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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (328) hide show
  1. package/Unistyles.podspec +3 -2
  2. package/cxx/common/Constants.h +3 -0
  3. package/cxx/common/Helpers.h +97 -5
  4. package/cxx/core/HostStyle.cpp +19 -13
  5. package/cxx/core/HostStyle.h +4 -0
  6. package/cxx/core/StyleSheet.h +0 -2
  7. package/cxx/core/StyleSheetRegistry.cpp +10 -13
  8. package/cxx/core/StyleSheetRegistry.h +4 -4
  9. package/cxx/core/Unistyle.h +7 -10
  10. package/cxx/core/UnistyleData.h +23 -0
  11. package/cxx/core/UnistyleWrapper.h +58 -10
  12. package/cxx/core/UnistylesCommitHook.cpp +22 -13
  13. package/cxx/core/UnistylesCommitHook.h +8 -1
  14. package/cxx/core/UnistylesCommitShadowNode.h +13 -0
  15. package/cxx/core/UnistylesMountHook.cpp +37 -0
  16. package/cxx/core/UnistylesMountHook.h +31 -0
  17. package/cxx/core/UnistylesRegistry.cpp +56 -81
  18. package/cxx/core/UnistylesRegistry.h +15 -13
  19. package/cxx/core/UnistylesState.cpp +14 -8
  20. package/cxx/core/UnistylesState.h +1 -0
  21. package/cxx/hybridObjects/HybridShadowRegistry.cpp +15 -9
  22. package/cxx/hybridObjects/HybridStyleSheet.cpp +43 -38
  23. package/cxx/hybridObjects/HybridStyleSheet.h +10 -7
  24. package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +35 -16
  25. package/cxx/hybridObjects/HybridUnistylesRuntime.h +2 -0
  26. package/cxx/parser/Parser.cpp +105 -164
  27. package/cxx/parser/Parser.h +8 -14
  28. package/cxx/shadowTree/ShadowLeafUpdate.h +1 -1
  29. package/cxx/shadowTree/ShadowTrafficController.h +33 -0
  30. package/cxx/shadowTree/ShadowTreeManager.cpp +13 -11
  31. package/cxx/shadowTree/ShadowTreeManager.h +1 -0
  32. package/ios/Unistyles.h +1 -0
  33. package/ios/UnistylesModuleOnLoad.h +2 -0
  34. package/ios/UnistylesModuleOnLoad.mm +8 -1
  35. package/lib/commonjs/index.js +4 -0
  36. package/lib/commonjs/index.js.map +1 -1
  37. package/lib/commonjs/specs/NavigtionBar/index.js +1 -1
  38. package/lib/commonjs/specs/NavigtionBar/index.js.map +1 -1
  39. package/lib/commonjs/specs/ShadowRegistry/index.js +7 -6
  40. package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
  41. package/lib/commonjs/specs/StatusBar/index.js +1 -1
  42. package/lib/commonjs/specs/StatusBar/index.js.map +1 -1
  43. package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
  44. package/lib/commonjs/specs/UnistylesRuntime/index.js +1 -1
  45. package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -1
  46. package/lib/commonjs/specs/index.web.js +1 -1
  47. package/lib/commonjs/web/convert/boxShadow.js +77 -0
  48. package/lib/commonjs/web/convert/boxShadow.js.map +1 -0
  49. package/lib/commonjs/web/convert/breakpoint.js +25 -0
  50. package/lib/commonjs/web/convert/breakpoint.js.map +1 -0
  51. package/lib/commonjs/web/convert/index.js +76 -0
  52. package/lib/commonjs/web/convert/index.js.map +1 -0
  53. package/lib/commonjs/web/convert/module.d.js +2 -0
  54. package/lib/commonjs/web/convert/module.d.js.map +1 -0
  55. package/lib/commonjs/web/convert/shadow.js +68 -0
  56. package/lib/commonjs/web/convert/shadow.js.map +1 -0
  57. package/lib/commonjs/web/convert/style.js +89 -0
  58. package/lib/commonjs/web/convert/style.js.map +1 -0
  59. package/lib/commonjs/web/convert/textShadow.js +73 -0
  60. package/lib/commonjs/web/convert/textShadow.js.map +1 -0
  61. package/lib/commonjs/web/convert/transform.js +72 -0
  62. package/lib/commonjs/web/convert/transform.js.map +1 -0
  63. package/lib/commonjs/web/convert/types.js +9 -0
  64. package/lib/commonjs/web/convert/types.js.map +1 -0
  65. package/lib/commonjs/web/convert/utils.js +55 -0
  66. package/lib/commonjs/web/convert/utils.js.map +1 -0
  67. package/lib/commonjs/web/create.js +51 -0
  68. package/lib/commonjs/web/create.js.map +1 -0
  69. package/lib/commonjs/web/createUnistylesComponent.js +61 -0
  70. package/lib/commonjs/web/createUnistylesComponent.js.map +1 -0
  71. package/lib/commonjs/web/index.js +60 -0
  72. package/lib/commonjs/web/index.js.map +1 -0
  73. package/lib/commonjs/web/listener/index.js +20 -0
  74. package/lib/commonjs/web/listener/index.js.map +1 -0
  75. package/lib/commonjs/web/listener/listenToDependencies.js +38 -0
  76. package/lib/commonjs/web/listener/listenToDependencies.js.map +1 -0
  77. package/lib/commonjs/web/listener/listener.js +35 -0
  78. package/lib/commonjs/web/listener/listener.js.map +1 -0
  79. package/lib/commonjs/web/mock.js +28 -0
  80. package/lib/commonjs/web/mock.js.map +1 -0
  81. package/lib/commonjs/web/mq.js +23 -0
  82. package/lib/commonjs/web/mq.js.map +1 -0
  83. package/lib/commonjs/web/pseudo.js +10 -0
  84. package/lib/commonjs/web/pseudo.js.map +1 -0
  85. package/lib/commonjs/web/registry.js +50 -0
  86. package/lib/commonjs/web/registry.js.map +1 -0
  87. package/lib/commonjs/web/runtime.js +163 -0
  88. package/lib/commonjs/web/runtime.js.map +1 -0
  89. package/lib/commonjs/web/shadowRegistry.js +123 -0
  90. package/lib/commonjs/web/shadowRegistry.js.map +1 -0
  91. package/lib/commonjs/web/state.js +81 -0
  92. package/lib/commonjs/web/state.js.map +1 -0
  93. package/lib/commonjs/web/utils.js +130 -0
  94. package/lib/commonjs/web/utils.js.map +1 -0
  95. package/lib/commonjs/web/variants/getVariants.js +39 -0
  96. package/lib/commonjs/web/variants/getVariants.js.map +1 -0
  97. package/lib/commonjs/web/variants/index.js +28 -0
  98. package/lib/commonjs/web/variants/index.js.map +1 -0
  99. package/lib/commonjs/web/variants/useVariants.js +59 -0
  100. package/lib/commonjs/web/variants/useVariants.js.map +1 -0
  101. package/lib/module/index.js +4 -0
  102. package/lib/module/index.js.map +1 -1
  103. package/lib/module/specs/NavigtionBar/index.js +1 -1
  104. package/lib/module/specs/NavigtionBar/index.js.map +1 -1
  105. package/lib/module/specs/ShadowRegistry/index.js +7 -6
  106. package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
  107. package/lib/module/specs/StatusBar/index.js +1 -1
  108. package/lib/module/specs/StatusBar/index.js.map +1 -1
  109. package/lib/module/specs/StyleSheet/index.js.map +1 -1
  110. package/lib/module/specs/UnistylesRuntime/index.js +1 -1
  111. package/lib/module/specs/UnistylesRuntime/index.js.map +1 -1
  112. package/lib/module/specs/index.web.js +1 -1
  113. package/lib/module/specs/index.web.js.map +1 -1
  114. package/lib/module/web/convert/boxShadow.js +72 -0
  115. package/lib/module/web/convert/boxShadow.js.map +1 -0
  116. package/lib/module/web/convert/breakpoint.js +20 -0
  117. package/lib/module/web/convert/breakpoint.js.map +1 -0
  118. package/lib/module/web/convert/index.js +71 -0
  119. package/lib/module/web/convert/index.js.map +1 -0
  120. package/lib/module/web/convert/module.d.js +2 -0
  121. package/lib/module/web/convert/module.d.js.map +1 -0
  122. package/lib/module/web/convert/shadow.js +63 -0
  123. package/lib/module/web/convert/shadow.js.map +1 -0
  124. package/lib/module/web/convert/style.js +84 -0
  125. package/lib/module/web/convert/style.js.map +1 -0
  126. package/lib/module/web/convert/textShadow.js +68 -0
  127. package/lib/module/web/convert/textShadow.js.map +1 -0
  128. package/lib/module/web/convert/transform.js +67 -0
  129. package/lib/module/web/convert/transform.js.map +1 -0
  130. package/lib/module/web/convert/types.js +5 -0
  131. package/lib/module/web/convert/types.js.map +1 -0
  132. package/lib/module/web/convert/utils.js +43 -0
  133. package/lib/module/web/convert/utils.js.map +1 -0
  134. package/lib/module/web/create.js +46 -0
  135. package/lib/module/web/create.js.map +1 -0
  136. package/lib/module/web/createUnistylesComponent.js +54 -0
  137. package/lib/module/web/createUnistylesComponent.js.map +1 -0
  138. package/lib/module/web/index.js +26 -0
  139. package/lib/module/web/index.js.map +1 -0
  140. package/lib/module/web/listener/index.js +5 -0
  141. package/lib/module/web/listener/index.js.map +1 -0
  142. package/lib/module/web/listener/listenToDependencies.js +33 -0
  143. package/lib/module/web/listener/listenToDependencies.js.map +1 -0
  144. package/lib/module/web/listener/listener.js +31 -0
  145. package/lib/module/web/listener/listener.js.map +1 -0
  146. package/lib/module/web/mock.js +24 -0
  147. package/lib/module/web/mock.js.map +1 -0
  148. package/lib/module/web/mq.js +17 -0
  149. package/lib/module/web/mq.js.map +1 -0
  150. package/lib/module/web/pseudo.js +5 -0
  151. package/lib/module/web/pseudo.js.map +1 -0
  152. package/lib/module/web/registry.js +46 -0
  153. package/lib/module/web/registry.js.map +1 -0
  154. package/lib/module/web/runtime.js +159 -0
  155. package/lib/module/web/runtime.js.map +1 -0
  156. package/lib/module/web/shadowRegistry.js +119 -0
  157. package/lib/module/web/shadowRegistry.js.map +1 -0
  158. package/lib/module/web/state.js +77 -0
  159. package/lib/module/web/state.js.map +1 -0
  160. package/lib/module/web/utils.js +112 -0
  161. package/lib/module/web/utils.js.map +1 -0
  162. package/lib/module/web/variants/getVariants.js +34 -0
  163. package/lib/module/web/variants/getVariants.js.map +1 -0
  164. package/lib/module/web/variants/index.js +5 -0
  165. package/lib/module/web/variants/index.js.map +1 -0
  166. package/lib/module/web/variants/useVariants.js +54 -0
  167. package/lib/module/web/variants/useVariants.js.map +1 -0
  168. package/lib/typescript/example/App.d.ts.map +1 -1
  169. package/lib/typescript/example/Typography.d.ts +12 -0
  170. package/lib/typescript/example/Typography.d.ts.map +1 -0
  171. package/lib/typescript/expo-example/app/(tabs)/_layout.d.ts +3 -0
  172. package/lib/typescript/expo-example/app/(tabs)/_layout.d.ts.map +1 -0
  173. package/lib/typescript/expo-example/app/(tabs)/explore.d.ts +3 -0
  174. package/lib/typescript/expo-example/app/(tabs)/explore.d.ts.map +1 -0
  175. package/lib/typescript/expo-example/app/(tabs)/index.d.ts +3 -0
  176. package/lib/typescript/expo-example/app/(tabs)/index.d.ts.map +1 -0
  177. package/lib/typescript/expo-example/app/+html.d.ts +4 -0
  178. package/lib/typescript/expo-example/app/+html.d.ts.map +1 -0
  179. package/lib/typescript/expo-example/app/+not-found.d.ts +3 -0
  180. package/lib/typescript/expo-example/app/+not-found.d.ts.map +1 -0
  181. package/lib/typescript/expo-example/app/_layout.d.ts +3 -0
  182. package/lib/typescript/expo-example/app/_layout.d.ts.map +1 -0
  183. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +3 -3
  184. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
  185. package/lib/typescript/src/specs/StyleSheet/index.d.ts +2 -1
  186. package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
  187. package/lib/typescript/src/specs/index.web.d.ts +1 -1
  188. package/lib/typescript/src/specs/index.web.d.ts.map +1 -1
  189. package/lib/typescript/src/types/stylesheet.d.ts +2 -2
  190. package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
  191. package/lib/typescript/src/web/convert/boxShadow.d.ts.map +1 -0
  192. package/lib/typescript/src/web/convert/breakpoint.d.ts.map +1 -0
  193. package/lib/typescript/{web → src/web}/convert/index.d.ts +1 -1
  194. package/lib/typescript/src/web/convert/index.d.ts.map +1 -0
  195. package/lib/typescript/src/web/convert/shadow.d.ts.map +1 -0
  196. package/lib/typescript/src/web/convert/style.d.ts.map +1 -0
  197. package/lib/typescript/src/web/convert/textShadow.d.ts.map +1 -0
  198. package/lib/typescript/src/web/convert/transform.d.ts.map +1 -0
  199. package/lib/typescript/{web → src/web}/convert/types.d.ts +1 -1
  200. package/lib/typescript/src/web/convert/types.d.ts.map +1 -0
  201. package/lib/typescript/src/web/convert/utils.d.ts.map +1 -0
  202. package/lib/typescript/{web → src/web}/create.d.ts +11 -11
  203. package/lib/typescript/{web → src/web}/create.d.ts.map +1 -1
  204. package/lib/typescript/src/web/createUnistylesComponent.d.ts +3 -0
  205. package/lib/typescript/src/web/createUnistylesComponent.d.ts.map +1 -0
  206. package/lib/typescript/{web → src/web}/index.d.ts +14 -13
  207. package/lib/typescript/{web → src/web}/index.d.ts.map +1 -1
  208. package/lib/typescript/src/web/listener/index.d.ts +3 -0
  209. package/lib/typescript/src/web/listener/index.d.ts.map +1 -0
  210. package/lib/typescript/src/web/listener/listenToDependencies.d.ts +12 -0
  211. package/lib/typescript/src/web/listener/listenToDependencies.d.ts.map +1 -0
  212. package/lib/typescript/{web → src/web}/listener/listener.d.ts +3 -2
  213. package/lib/typescript/src/web/listener/listener.d.ts.map +1 -0
  214. package/lib/typescript/src/web/mock.d.ts +5 -0
  215. package/lib/typescript/src/web/mock.d.ts.map +1 -0
  216. package/lib/typescript/src/web/mq.d.ts.map +1 -0
  217. package/lib/typescript/src/web/pseudo.d.ts +6 -0
  218. package/lib/typescript/src/web/pseudo.d.ts.map +1 -0
  219. package/lib/typescript/src/web/registry.d.ts +15 -0
  220. package/lib/typescript/src/web/registry.d.ts.map +1 -0
  221. package/lib/typescript/{web → src/web}/runtime.d.ts +6 -7
  222. package/lib/typescript/src/web/runtime.d.ts.map +1 -0
  223. package/lib/typescript/src/web/shadowRegistry.d.ts +17 -0
  224. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -0
  225. package/lib/typescript/{web → src/web}/state.d.ts +4 -9
  226. package/lib/typescript/src/web/state.d.ts.map +1 -0
  227. package/lib/typescript/src/web/utils.d.ts +35 -0
  228. package/lib/typescript/src/web/utils.d.ts.map +1 -0
  229. package/lib/typescript/src/web/variants/getVariants.d.ts +3 -0
  230. package/lib/typescript/src/web/variants/getVariants.d.ts.map +1 -0
  231. package/lib/typescript/src/web/variants/index.d.ts +3 -0
  232. package/lib/typescript/src/web/variants/index.d.ts.map +1 -0
  233. package/lib/typescript/src/web/variants/useVariants.d.ts +3 -0
  234. package/lib/typescript/src/web/variants/useVariants.d.ts.map +1 -0
  235. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +6 -3
  236. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +8 -3
  237. package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +1 -1
  238. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +1 -1
  239. package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +14 -2
  240. package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +3 -0
  241. package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +3 -0
  242. package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.hpp +3 -0
  243. package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.hpp +3 -0
  244. package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +3 -0
  245. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -1
  246. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +4 -1
  247. package/package.json +3 -3
  248. package/plugin/__tests__/dependencies.spec.js +199 -111
  249. package/plugin/__tests__/ref.spec.js +638 -202
  250. package/plugin/__tests__/stylesheet.spec.js +182 -71
  251. package/plugin/index.js +110 -23
  252. package/plugin/ref.js +64 -13
  253. package/plugin/style.js +82 -22
  254. package/plugin/stylesheet.js +44 -1
  255. package/plugin/variants.js +33 -0
  256. package/src/index.ts +3 -0
  257. package/src/specs/NavigtionBar/index.ts +1 -1
  258. package/src/specs/ShadowRegistry/index.ts +10 -9
  259. package/src/specs/StatusBar/index.ts +1 -1
  260. package/src/specs/StyleSheet/index.ts +3 -1
  261. package/src/specs/UnistylesRuntime/index.ts +1 -1
  262. package/src/specs/index.web.ts +1 -1
  263. package/src/types/stylesheet.ts +2 -2
  264. package/{web → src/web}/convert/breakpoint.ts +1 -1
  265. package/{web → src/web}/convert/index.ts +2 -2
  266. package/{web → src/web}/convert/types.ts +1 -1
  267. package/src/web/create.ts +50 -0
  268. package/src/web/createUnistylesComponent.tsx +54 -0
  269. package/{web → src/web}/index.ts +3 -2
  270. package/src/web/listener/index.ts +2 -0
  271. package/src/web/listener/listenToDependencies.ts +45 -0
  272. package/{web → src/web}/listener/listener.ts +2 -2
  273. package/{web → src/web}/mock.ts +2 -12
  274. package/src/web/pseudo.ts +137 -0
  275. package/src/web/registry.ts +60 -0
  276. package/{web → src/web}/runtime.ts +4 -6
  277. package/src/web/shadowRegistry.ts +124 -0
  278. package/{web → src/web}/state.ts +5 -49
  279. package/{web → src/web}/utils.ts +91 -17
  280. package/src/web/variants/getVariants.ts +42 -0
  281. package/src/web/variants/index.ts +2 -0
  282. package/src/web/variants/useVariants.ts +65 -0
  283. package/lib/typescript/web/convert/boxShadow.d.ts.map +0 -1
  284. package/lib/typescript/web/convert/breakpoint.d.ts.map +0 -1
  285. package/lib/typescript/web/convert/index.d.ts.map +0 -1
  286. package/lib/typescript/web/convert/shadow.d.ts.map +0 -1
  287. package/lib/typescript/web/convert/style.d.ts.map +0 -1
  288. package/lib/typescript/web/convert/textShadow.d.ts.map +0 -1
  289. package/lib/typescript/web/convert/transform.d.ts.map +0 -1
  290. package/lib/typescript/web/convert/types.d.ts.map +0 -1
  291. package/lib/typescript/web/convert/utils.d.ts.map +0 -1
  292. package/lib/typescript/web/listener/index.d.ts +0 -2
  293. package/lib/typescript/web/listener/index.d.ts.map +0 -1
  294. package/lib/typescript/web/listener/listener.d.ts.map +0 -1
  295. package/lib/typescript/web/mock.d.ts +0 -14
  296. package/lib/typescript/web/mock.d.ts.map +0 -1
  297. package/lib/typescript/web/mq.d.ts.map +0 -1
  298. package/lib/typescript/web/pseudo.d.ts +0 -4
  299. package/lib/typescript/web/pseudo.d.ts.map +0 -1
  300. package/lib/typescript/web/registry.d.ts +0 -12
  301. package/lib/typescript/web/registry.d.ts.map +0 -1
  302. package/lib/typescript/web/runtime.d.ts.map +0 -1
  303. package/lib/typescript/web/state.d.ts.map +0 -1
  304. package/lib/typescript/web/useVariants.d.ts +0 -3
  305. package/lib/typescript/web/useVariants.d.ts.map +0 -1
  306. package/lib/typescript/web/utils.d.ts +0 -18
  307. package/lib/typescript/web/utils.d.ts.map +0 -1
  308. package/web/create.ts +0 -102
  309. package/web/listener/index.ts +0 -1
  310. package/web/pseudo.ts +0 -11
  311. package/web/registry.ts +0 -41
  312. package/web/useVariants.ts +0 -99
  313. /package/lib/typescript/{web → src/web}/convert/boxShadow.d.ts +0 -0
  314. /package/lib/typescript/{web → src/web}/convert/breakpoint.d.ts +0 -0
  315. /package/lib/typescript/{web → src/web}/convert/shadow.d.ts +0 -0
  316. /package/lib/typescript/{web → src/web}/convert/style.d.ts +0 -0
  317. /package/lib/typescript/{web → src/web}/convert/textShadow.d.ts +0 -0
  318. /package/lib/typescript/{web → src/web}/convert/transform.d.ts +0 -0
  319. /package/lib/typescript/{web → src/web}/convert/utils.d.ts +0 -0
  320. /package/lib/typescript/{web → src/web}/mq.d.ts +0 -0
  321. /package/{web → src/web}/convert/boxShadow.ts +0 -0
  322. /package/{web → src/web}/convert/module.d.ts +0 -0
  323. /package/{web → src/web}/convert/shadow.ts +0 -0
  324. /package/{web → src/web}/convert/style.ts +0 -0
  325. /package/{web → src/web}/convert/textShadow.ts +0 -0
  326. /package/{web → src/web}/convert/transform.ts +0 -0
  327. /package/{web → src/web}/convert/utils.ts +0 -0
  328. /package/{web → src/web}/mq.ts +0 -0
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.warn = exports.schemeToTheme = exports.reduceObject = exports.keyInObject = exports.isServer = exports.isInDocument = exports.hexToRGBA = exports.getStyles = exports.extractSecrets = exports.extractHiddenProperties = exports.equal = exports.deepMergeObjects = exports.createDoubleMap = exports.assignSecrets = void 0;
7
+ var _types = require("../specs/types");
8
+ const reduceObject = (obj, reducer) => Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, reducer(value, key)]));
9
+ exports.reduceObject = reduceObject;
10
+ const keyInObject = (obj, key) => key in obj;
11
+ exports.keyInObject = keyInObject;
12
+ const schemeToTheme = scheme => {
13
+ switch (scheme) {
14
+ case _types.ColorScheme.Dark:
15
+ return 'dark';
16
+ case _types.ColorScheme.Light:
17
+ default:
18
+ return 'light';
19
+ }
20
+ };
21
+ exports.schemeToTheme = schemeToTheme;
22
+ const hexToRGBA = (hex, opacity) => hex.replace('#', '').split(/(?=(?:..)*$)/).map(x => parseInt(x, 16)).filter(num => !isNaN(num)).reduce((acc, color) => `${acc}${color},`, 'rgba(').concat(`${opacity})`);
23
+ exports.hexToRGBA = hexToRGBA;
24
+ const isServer = () => typeof window === 'undefined';
25
+
26
+ /**
27
+ * Deeply merges properties of passed object
28
+ */
29
+ exports.isServer = isServer;
30
+ const deepMergeObjects = (...sources) => {
31
+ const target = {};
32
+ sources.forEach(source => {
33
+ Object.keys(source).forEach(key => {
34
+ const sourceValue = source[key];
35
+ const targetValue = target[key];
36
+ if (Object(sourceValue) == sourceValue && Object(targetValue) === targetValue) {
37
+ // @ts-expect-error - can't assign to generic
38
+ target[key] = deepMergeObjects(targetValue, sourceValue);
39
+ return;
40
+ }
41
+
42
+ // @ts-expect-error - can't assign to generic
43
+ target[key] = sourceValue;
44
+ });
45
+ });
46
+ return target;
47
+ };
48
+ exports.deepMergeObjects = deepMergeObjects;
49
+ const warn = message => console.warn(`🦄 [react-native-unistyles] ${message}`);
50
+ exports.warn = warn;
51
+ const equal = (a, b) => {
52
+ if (Object.is(a, b)) {
53
+ return true;
54
+ }
55
+ if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) {
56
+ return false;
57
+ }
58
+ const keysA = Object.keys(a);
59
+ if (keysA.length !== Object.keys(b).length) {
60
+ return false;
61
+ }
62
+ return keysA.every(key => Object.is(a[key], b[key]) && Object.prototype.hasOwnProperty.call(b, key));
63
+ };
64
+ exports.equal = equal;
65
+ const assignSecrets = (object, secrets) => {
66
+ // @ts-expect-error - assign secrets to object
67
+ object[`__uni__secrets__${Math.random().toString(16).slice(2)}`] = secrets;
68
+ return object;
69
+ };
70
+ exports.assignSecrets = assignSecrets;
71
+ const extractSecrets = object => {
72
+ const secrets = Object.entries(object).reduce((acc, [key, value]) => {
73
+ if (key.startsWith('__uni__secrets__')) {
74
+ acc.push(value);
75
+ }
76
+ return acc;
77
+ }, []);
78
+ return secrets;
79
+ };
80
+ exports.extractSecrets = extractSecrets;
81
+ const getStyles = values => {
82
+ const returnValue = {};
83
+ Object.defineProperties(returnValue, reduceObject(values, value => ({
84
+ value,
85
+ enumerable: false,
86
+ configurable: true
87
+ })));
88
+ return returnValue;
89
+ };
90
+ exports.getStyles = getStyles;
91
+ const createDoubleMap = () => {
92
+ const map = new Map();
93
+ return {
94
+ get: (key, secondKey) => {
95
+ const mapForKey = map.get(key);
96
+ if (!mapForKey) {
97
+ return undefined;
98
+ }
99
+ return mapForKey.get(secondKey);
100
+ },
101
+ set: (key, secondKey, value) => {
102
+ const mapForKey = map.get(key) ?? new Map();
103
+ map.set(key, mapForKey);
104
+ mapForKey.set(secondKey, value);
105
+ },
106
+ delete: (key, secondKey) => {
107
+ const mapForKey = map.get(key);
108
+ if (!mapForKey) {
109
+ return;
110
+ }
111
+ mapForKey.delete(secondKey);
112
+ },
113
+ forEach: callback => {
114
+ map.forEach((mapForKey, key) => {
115
+ mapForKey.forEach((value, secondKey) => {
116
+ callback(key, secondKey, value);
117
+ });
118
+ });
119
+ }
120
+ };
121
+ };
122
+ exports.createDoubleMap = createDoubleMap;
123
+ const extractHiddenProperties = object => {
124
+ const hiddenProperties = Object.getOwnPropertyNames(object);
125
+ return Object.fromEntries(hiddenProperties.filter(key => !key.startsWith('__uni__')).map(key => [key, object[key]]));
126
+ };
127
+ exports.extractHiddenProperties = extractHiddenProperties;
128
+ const isInDocument = element => document.body.contains(element);
129
+ exports.isInDocument = isInDocument;
130
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","reduceObject","obj","reducer","Object","fromEntries","entries","map","key","value","exports","keyInObject","schemeToTheme","scheme","ColorScheme","Dark","Light","hexToRGBA","hex","opacity","replace","split","x","parseInt","filter","num","isNaN","reduce","acc","color","concat","isServer","window","deepMergeObjects","sources","target","forEach","source","keys","sourceValue","targetValue","warn","message","console","equal","a","b","is","keysA","length","every","prototype","hasOwnProperty","call","assignSecrets","object","secrets","Math","random","toString","slice","extractSecrets","startsWith","push","getStyles","values","returnValue","defineProperties","enumerable","configurable","createDoubleMap","Map","get","secondKey","mapForKey","undefined","set","delete","callback","extractHiddenProperties","hiddenProperties","getOwnPropertyNames","isInDocument","element","document","body","contains"],"sourceRoot":"../../../src","sources":["web/utils.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGO,MAAMC,YAAY,GAAGA,CACxBC,GAAS,EACTC,OAA+D,KAC9DC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACJ,GAAG,CAAC,CAACK,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK,CAACD,GAAG,EAAEL,OAAO,CAACM,KAAK,EAAsBD,GAAG,CAAC,CAAC,CAAC,CAAoC;AAAAE,OAAA,CAAAT,YAAA,GAAAA,YAAA;AAE9I,MAAMU,WAAW,GAAGA,CAAgCT,GAAM,EAAEM,GAAgB,KAAqBA,GAAG,IAAIN,GAAG;AAAAQ,OAAA,CAAAC,WAAA,GAAAA,WAAA;AAE3G,MAAMC,aAAa,GAAIC,MAAmB,IAAmB;EAChE,QAAQA,MAAM;IACV,KAAKC,kBAAW,CAACC,IAAI;MACjB,OAAO,MAAM;IACjB,KAAKD,kBAAW,CAACE,KAAK;IACtB;MACI,OAAO,OAAO;EACtB;AACJ,CAAC;AAAAN,OAAA,CAAAE,aAAA,GAAAA,aAAA;AAEM,MAAMK,SAAS,GAAGA,CAACC,GAAW,EAAEC,OAAe,KAAKD,GAAG,CACzDE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAChBC,KAAK,CAAC,cAAc,CAAC,CACrBd,GAAG,CAACe,CAAC,IAAIC,QAAQ,CAACD,CAAC,EAAE,EAAE,CAAC,CAAC,CACzBE,MAAM,CAACC,GAAG,IAAI,CAACC,K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AC1C,MAAMC,SAAS,GAAGnE,GAAG,CAACiE,GAAG,CAAChE,GAAG,CAAC;MAE9B,IAAI,CAACkE,SAAS,EAAE;QACZ;MACJ;MAEAA,SAAS,CAACG,MAAM,CAACJ,SAAS,CAAC;IAC/B,CAAC;IACDrC,OAAO,EAAG0C,QAAmE,IAAK;MAC9EvE,GAAG,CAAC6B,OAAO,CAAC,CAACsC,SAAS,EAAElE,GAAG,KAAK;QAC5BkE,SAAS,CAACtC,OAAO,CAAC,CAAC3B,KAAK,EAAEgE,SAAS,KAAK;UACpCK,QAAQ,CAACtE,GAAG,EAAEiE,SAAS,EAAEhE,KAAK,CAAC;QACnC,CAAC,CAAC;MACN,CAAC,CAAC;IACN;EACJ,CAAC;AACL,CAAC;AAAAC,OAAA,CAAA4D,eAAA,GAAAA,eAAA;AAEM,MAAMS,uBAAuB,GAAIxB,MAAW,IAAK;EACpD,MAAMyB,gBAAgB,GAAG5E,MAAM,CAAC6E,mBAAmB,CAAC1B,MAAM,CAAC;EAE3D,OAAOnD,MAAM,CAACC,WAAW,CACrB2E,gBAAgB,CACXxD,MAAM,CAAChB,GAAG,IAAI,CAACA,GAAG,CAACsD,UAAU,CAAC,SAAS,CAAC,CAAC,CACzCvD,GAAG,CAACC,GAAG,IAAI,CAACA,GAAG,EAAE+C,MAAM,CAAC/C,GAAG,CAAC,CAAC,CACtC,CAAC;AACL,CAAC;AAAAE,OAAA,CAAAqE,uBAAA,GAAAA,uBAAA;AAEM,MAAMG,YAAY,GAAIC,OAAoB,IAAKC,QAAQ,CAACC,IAAI,CAACC,QAAQ,CAACH,OAAO,CAAC;AAAAzE,OAAA,CAAAwE,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getVariants = void 0;
7
+ var _utils = require("../utils");
8
+ const hasVariants = value => 'variants' in value[1];
9
+ const getVariants = (styles, selectedVariants) => {
10
+ return Object.entries(styles).filter(hasVariants).filter(([_key, {
11
+ variants
12
+ }]) => Object.keys(variants).some(variant => variant in variants)).map(([key, {
13
+ variants,
14
+ compoundVariants = []
15
+ }]) => {
16
+ const variantStyles = Object.entries(variants).flatMap(([variant, styles]) => {
17
+ const selectedVariant = selectedVariants[variant];
18
+ const selectedVariantStyles = styles[selectedVariant] ?? styles['default'];
19
+ if (!selectedVariantStyles) {
20
+ return [];
21
+ }
22
+ return selectedVariantStyles;
23
+ });
24
+ const compoundVariantStyles = compoundVariants.flatMap(compoundVariant => {
25
+ const {
26
+ styles,
27
+ ...conditions
28
+ } = compoundVariant;
29
+ if (Object.entries(conditions).some(([variant, value]) => String(selectedVariants[variant]) !== String(value))) {
30
+ return [];
31
+ }
32
+ return styles;
33
+ });
34
+ const mergedVariantStyles = (0, _utils.deepMergeObjects)(...variantStyles, ...compoundVariantStyles);
35
+ return [key, mergedVariantStyles];
36
+ });
37
+ };
38
+ exports.getVariants = getVariants;
39
+ //# sourceMappingURL=getVariants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_utils","require","hasVariants","value","getVariants","styles","selectedVariants","Object","entries","filter","_key","variants","keys","some","variant","map","key","compoundVariants","variantStyles","flatMap","selectedVariant","selectedVariantStyles","compoundVariantStyles","compoundVariant","conditions","String","mergedVariantStyles","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/variants/getVariants.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAQA,MAAMC,WAAW,GAAsBC,KAAkB,IAAgD,UAAU,IAAIA,KAAK,CAAC,CAAC,CAAC;AAExH,MAAMC,WAAW,GAAGA,CAACC,MAAyC,EAAEC,gBAAqC,KAAK;EAC7G,OAAOC,MAAM,CAACC,OAAO,CAACH,MAAM,CAAC,CACxBI,MAAM,CAACP,WAAW,CAAC,CACnBO,MAAM,CAAC,CAAC,CAACC,IAAI,EAAE;IAAEC;EAAS,CAAC,CAAC,KAAKJ,MAAM,CA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(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _useVariants = require("./useVariants");
7
+ Object.keys(_useVariants).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _useVariants[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _useVariants[key];
14
+ }
15
+ });
16
+ });
17
+ var _getVariants = require("./getVariants");
18
+ Object.keys(_getVariants).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _getVariants[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _getVariants[key];
25
+ }
26
+ });
27
+ });
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_useVariants","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_getVariants"],"sourceRoot":"../../../../src","sources":["web/variants/index.ts"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,YAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,YAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,YAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,YAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,YAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,YAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createUseVariants = void 0;
7
+ var _react = require("react");
8
+ var _utils = require("../utils");
9
+ var _getVariants = require("./getVariants");
10
+ const createUseVariants = (styles, setSelectedVariants) => {
11
+ const useVariants = selectedVariants => {
12
+ const [selectedVariantStylesMap] = (0, _react.useState)(() => new Map());
13
+ const lastSelectedVariantsRef = (0, _react.useRef)();
14
+ // Variable that determines if variants have changed and we need to recalculate styles
15
+ const variantsChanged = !(0, _utils.equal)(lastSelectedVariantsRef.current, selectedVariants);
16
+ if (variantsChanged) {
17
+ lastSelectedVariantsRef.current = selectedVariants;
18
+ setSelectedVariants(selectedVariants);
19
+ }
20
+ const combinedVariantStyles = (0, _react.useMemo)(() => {
21
+ const result = (0, _getVariants.getVariants)(styles, selectedVariants);
22
+ result.forEach(([key, value]) => {
23
+ selectedVariantStylesMap.set(key, value);
24
+ });
25
+ return result;
26
+ }, [lastSelectedVariantsRef.current]);
27
+ combinedVariantStyles.forEach(([key]) => {
28
+ const styleEntry = styles[key];
29
+ if (!styleEntry) {
30
+ return;
31
+ }
32
+ const selectedVariantStyles = selectedVariantStylesMap.get(key);
33
+ Object.defineProperties(styleEntry, (0, _utils.reduceObject)(selectedVariantStyles ?? {}, value => ({
34
+ value,
35
+ enumerable: false,
36
+ configurable: true
37
+ })));
38
+
39
+ // Add __uni__variants to static styles
40
+ Object.keys(styleEntry).forEach(key => {
41
+ if (!key.startsWith('__uni__secrets__')) {
42
+ return;
43
+ }
44
+ const secret = (0, _utils.keyInObject)(styleEntry, key) ? styleEntry[key] : undefined;
45
+ if (!secret) {
46
+ return;
47
+ }
48
+ Object.defineProperty(secret, '__uni__variants', {
49
+ value: selectedVariants
50
+ });
51
+ });
52
+ });
53
+ };
54
+ Object.defineProperty(styles, 'useVariants', {
55
+ value: useVariants
56
+ });
57
+ };
58
+ exports.createUseVariants = createUseVariants;
59
+ //# sourceMappingURL=useVariants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_utils","_getVariants","createUseVariants","styles","setSelectedVariants","useVariants","selectedVariants","selectedVariantStylesMap","useState","Map","lastSelectedVariantsRef","useRef","variantsChanged","equal","current","combinedVariantStyles","useMemo","result","getVariants","forEach","key","value","set","styleEntry","selectedVariantStyles","get","Object","defineProperties","reduceObject","enumerable","configurable","keys","startsWith","secret","keyInObject","undefined","defineProperty","exports"],"sourceRoot":"../../../../src","sources":["web/variants/useVariants.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEO,MAAMG,iBAAiB,GAAGA,CAACC,MAAyC,EAAEC,mBAA4D,KAAK;EAC1I,MAAMC,WAAW,GAAIC,gBAAqC,IAAK;IAC3D,MAAM,CAACC,wBAAwB,CAAC,GAAG,IAAAC,eAAQ,EAAC,MAAM,IAAIC,GAAG,CAA8B,CAAC,CAAC;IACzF,MAAMC,uBAAuB,GAAG,IAAAC,aAAM,EAAsB,CAAC;IAC7D;IACA,MAAMC,eAAe,GAAG,CAAC,IAAAC,YAAK,EAACH,uBAAuB,CAACI,OAAO,EAAER,gBAAgB,CAAC;IAEjF,IAAIM,eAAe,EAAE;MACjBF,uBAAuB,CAACI,OAAO,GAAGR,gBAAgB;MAClDF,mBAAmB,CAACE,gBAAgB,CAAC;IACzC;IAEA,MAAMS,qBAAqB,GAAG,IAAAC,cAAO,EAAC,MAAM;MACxC,MAAMC,MAAM,GAAG,IAAAC,wBAAW,EAACf,MAAM,EAAEG,gBAAgB,CAAC;MAEpDW,MAAM,CAACE,OAAO,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK;QAC7Bd,wBAAw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
4
  export * from './specs';
5
5
  export { mq } from './mq';
6
+ // TODO: export Native createUnistylesComponent
7
+ // can't import it this way, it will break native build
8
+ // export { createUnistylesComponent } from './web/createUnistylesComponent'
9
+
6
10
  // todo verify true min version
7
11
  const minReactVersionRequiredByUnistyles = '18.3.1';
8
12
  if (React.version < minReactVersionRequiredByUnistyles) {
@@ -1 +1 @@
1
- {"version":3,"names":["React","mq","minReactVersionRequiredByUnistyles","version","Error"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,cAAc,SAAS;AACvB,SAASC,EAAE,QAAQ,MAAM;AAGzB;AACA,MAAMC,kCAAkC,GAAG,QAAQ;AAEnD,IAAIF,KAAK,CAACG,OAAO,GAAGD,kCAAkC,EAAE;EACpD,MAAM,IAAIE,KAAK,CAAC;AACpB,sDAAsDJ,KAAK,CAACG,OAAO;AACnE,4CAA4CD,kCAAkC;AAC9E,KAAK,CAAC;AACN","ignoreList":[]}
1
+ {"version":3,"names":["React","mq","minReactVersionRequiredByUnistyles","version","Error"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,cAAc,SAAS;AACvB,SAASC,EAAE,QAAQ,MAAM;AAEzB;AACA;AACA;;AAEA;AACA,MAAMC,kCAAkC,GAAG,QAAQ;AAEnD,IAAIF,KAAK,CAACG,OAAO,GAAGD,kCAAkC,EAAE;EACpD,MAAM,IAAIE,KAAK,CAAC;AACpB,sDAAsDJ,KAAK,CAACG,OAAO;AACnE,4CAA4CD,kCAAkC;AAC9E,KAAK,CAAC;AACN","ignoreList":[]}
@@ -5,7 +5,7 @@ export const attachNavigationBarJSMethods = hybridObject => {
5
5
  const privateHybrid = hybridObject;
6
6
  privateHybrid._setBackgroundColor = hybridObject.setBackgroundColor;
7
7
  hybridObject.setBackgroundColor = color => {
8
- const parsedColor = processColor(color);
8
+ const parsedColor = processColor(color) ?? 0;
9
9
  privateHybrid._setBackgroundColor(parsedColor);
10
10
  };
11
11
  };
@@ -1 +1 @@
1
- {"version":3,"names":["processColor","attachNavigationBarJSMethods","hybridObject","privateHybrid","_setBackgroundColor","setBackgroundColor","color","parsedColor"],"sourceRoot":"../../../../src","sources":["specs/NavigtionBar/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,cAAc;AAS3C,OAAO,MAAMC,4BAA4B,GAAIC,YAAoC,IAAK;EAClF,MAAMC,aAAa,GAAGD,YAA6C;EAEnEC,aAAa,CAACC,mBAAmB,GAAGF,YAAY,CAACG,kBAAkB;EACnEH,YAAY,CAACG,kBAAkB,GAAIC,KAAc,IAAK;IAClD,MAAMC,WAAW,GAAGP,YAAY,CAACM,KAAK,CAAC;IAEvCH,aAAa,CAACC,mBAAmB,CAACG,WAAqB,CAAC;EAC5D,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["processColor","attachNavigationBarJSMethods","hybridObject","privateHybrid","_setBackgroundColor","setBackgroundColor","color","parsedColor"],"sourceRoot":"../../../../src","sources":["specs/NavigtionBar/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,cAAc;AAS3C,OAAO,MAAMC,4BAA4B,GAAIC,YAAoC,IAAK;EAClF,MAAMC,aAAa,GAAGD,YAA6C;EAEnEC,aAAa,CAACC,mBAAmB,GAAGF,YAAY,CAACG,kBAAkB;EACnEH,YAAY,CAACG,kBAAkB,GAAIC,KAAc,IAAK;IAClD,MAAMC,WAAW,GAAGP,YAAY,CAACM,KAAK,CAAC,IAAI,CAAC;IAE5CH,aAAa,CAACC,mBAAmB,CAACG,WAAqB,CAAC;EAC5D,CAAC;AACL,CAAC","ignoreList":[]}
@@ -10,17 +10,18 @@ const findShadowNodeForHandle = handle => {
10
10
  }
11
11
  return node;
12
12
  };
13
- HybridShadowRegistry.add = (handle, style) => {
14
- if (!handle || !style?.__unid) {
13
+ HybridShadowRegistry.add = (handle, style, variants, args) => {
14
+ // virtualized nodes can be null
15
+ if (!handle || !style) {
15
16
  return;
16
17
  }
17
- HybridShadowRegistry.link(findShadowNodeForHandle(handle), style);
18
+ HybridShadowRegistry.link(findShadowNodeForHandle(handle), style, variants ?? {}, args ?? []);
18
19
  };
19
- HybridShadowRegistry.remove = (handle, style) => {
20
- if (!handle || !style?.__unid) {
20
+ HybridShadowRegistry.remove = handle => {
21
+ if (!handle) {
21
22
  return;
22
23
  }
23
- HybridShadowRegistry.unlink(findShadowNodeForHandle(handle), style);
24
+ HybridShadowRegistry.unlink(findShadowNodeForHandle(handle));
24
25
  };
25
26
  export const UnistylesShadowRegistry = HybridShadowRegistry;
26
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NitroModules","HybridShadowRegistry","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","style","__unid","link","remove","unlink","UnistylesShadowRegistry"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAazD,MAAMC,oBAAoB,GAAGD,YAAY,CAACE,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;AAEDJ,oBAAoB,CAACU,GAAG,GAAG,CAACP,MAAM,EAAEQ,KAAK,KAAK;EAC1C,IAAI,CAACR,MAAM,IAAI,CAACQ,KAAK,EAAEC,MAAM,EAAE;IAC3B;EACJ;EAEAZ,oBAAoB,CAACa,IAAI,CAACX,uBAAuB,CAACC,MAAM,CAAC,EAAEQ,KAAK,CAAC;AACrE,CAAC;AAEDX,oBAAoB,CAACc,MAAM,GAAG,CAACX,MAAM,EAAEQ,KAAK,KAAK;EAC7C,IAAI,CAACR,MAAM,IAAI,CAACQ,KAAK,EAAEC,MAAM,EAAE;IAC3B;EACJ;EAEAZ,oBAAoB,CAACe,MAAM,CAACb,uBAAuB,CAACC,MAAM,CAAC,EAAEQ,KAAK,CAAC;AACvE,CAAC;AAQD,OAAO,MAAMK,uBAAuB,GAAGhB,oBAA4D","ignoreList":[]}
1
+ {"version":3,"names":["NitroModules","HybridShadowRegistry","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","style","variants","args","link","remove","unlink","UnistylesShadowRegistry"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAazD,MAAMC,oBAAoB,GAAGD,YAAY,CAACE,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;AAEDJ,oBAAoB,CAACU,GAAG,GAAG,CAACP,MAAM,EAAEQ,KAAK,EAAEC,QAAQ,EAAEC,IAAI,KAAK;EAC1D;EACA,IAAI,CAACV,MAAM,IAAI,CAACQ,KAAK,EAAE;IACnB;EACJ;EAEAX,oBAAoB,CAACc,IAAI,CAACZ,uBAAuB,CAACC,MAAM,CAAC,EAAEQ,KAAK,EAAEC,QAAQ,IAAI,CAAC,CAAC,EAAEC,IAAI,IAAI,EAAE,CAAC;AACjG,CAAC;AAEDb,oBAAoB,CAACe,MAAM,GAAGZ,MAAM,IAAI;EACpC,IAAI,CAACA,MAAM,EAAE;IACT;EACJ;EAEAH,oBAAoB,CAACgB,MAAM,CAACd,uBAAuB,CAACC,MAAM,CAAC,CAAC;AAChE,CAAC;AAQD,OAAO,MAAMc,uBAAuB,GAAGjB,oBAA4D","ignoreList":[]}
@@ -21,7 +21,7 @@ export const attachStatusBarJSMethods = hybridObject => {
21
21
  };
22
22
  privateHybrid._setBackgroundColor = hybridObject.setBackgroundColor;
23
23
  hybridObject.setBackgroundColor = color => {
24
- const parsedColor = processColor(color);
24
+ const parsedColor = processColor(color) ?? 0;
25
25
  privateHybrid._setBackgroundColor(parsedColor);
26
26
  };
27
27
  };
@@ -1 +1 @@
1
- {"version":3,"names":["processColor","StatusBar","NativeStatusBar","StatusBarStyle","attachStatusBarJSMethods","hybridObject","setStyle","style","animated","Light","setBarStyle","Dark","Default","privateHybrid","_setHidden","setHidden","isHidden","animation","_setBackgroundColor","setBackgroundColor","color","parsedColor"],"sourceRoot":"../../../../src","sources":["specs/StatusBar/index.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,SAAS,IAAIC,eAAe,QAAQ,cAAc;AAEzE,SAAqBC,cAAc,QAAQ,UAAU;AAYrD,OAAO,MAAMC,wBAAwB,GAAIC,YAAgC,IAAK;EAC1EA,YAAY,CAACC,QAAQ,GAAG,CAACC,KAAqB,EAAEC,QAAkB,KAAK;IACnE,QAAQD,KAAK;MACT,KAAKJ,cAAc,CAACM,KAAK;QACrB,OAAOP,eAAe,CAACQ,WAAW,CAAC,eAAe,EAAEF,QAAQ,CAAC;MACjE,KAAKL,cAAc,CAACQ,IAAI;QACpB,OAAOT,eAAe,CAACQ,WAAW,CAAC,cAAc,EAAEF,QAAQ,CAAC;MAChE,KAAKL,cAAc,CAACS,OAAO;QACvB,OAAOV,eAAe,CAACQ,WAAW,CAAC,SAAS,EAAEF,QAAQ,CAAC;IAC/D;EACJ,CAAC;EAED,MAAMK,aAAa,GAAGR,YAAyC;EAE/DQ,aAAa,CAACC,UAAU,GAAGT,YAAY,CAACU,SAAS;EACjDV,YAAY,CAACU,SAAS,GAAG,CAACC,QAAiB,EAAEC,SAAoC,KAAK;IAClFf,eAAe,CAACa,SAAS,CAACC,QAAQ,EAAEC,SAAS,CAAC;IAC9CJ,aAAa,CAACC,UAAU,CAACE,QAAQ,CAAC;EACtC,CAAC;EAEDH,aAAa,CAACK,mBAAmB,GAAGb,YAAY,CAACc,kBAAkB;EACnEd,YAAY,CAACc,kBAAkB,GAAIC,KAAc,IAAK;IAClD,MAAMC,WAAW,GAAGrB,YAAY,CAACoB,KAAK,CAAC;IAEvCP,aAAa,CAACK,mBAAmB,CAACG,WAAqB,CAAC;EAC5D,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["processColor","StatusBar","NativeStatusBar","StatusBarStyle","attachStatusBarJSMethods","hybridObject","setStyle","style","animated","Light","setBarStyle","Dark","Default","privateHybrid","_setHidden","setHidden","isHidden","animation","_setBackgroundColor","setBackgroundColor","color","parsedColor"],"sourceRoot":"../../../../src","sources":["specs/StatusBar/index.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,SAAS,IAAIC,eAAe,QAAQ,cAAc;AAEzE,SAAqBC,cAAc,QAAQ,UAAU;AAYrD,OAAO,MAAMC,wBAAwB,GAAIC,YAAgC,IAAK;EAC1EA,YAAY,CAACC,QAAQ,GAAG,CAACC,KAAqB,EAAEC,QAAkB,KAAK;IACnE,QAAQD,KAAK;MACT,KAAKJ,cAAc,CAACM,KAAK;QACrB,OAAOP,eAAe,CAACQ,WAAW,CAAC,eAAe,EAAEF,QAAQ,CAAC;MACjE,KAAKL,cAAc,CAACQ,IAAI;QACpB,OAAOT,eAAe,CAACQ,WAAW,CAAC,cAAc,EAAEF,QAAQ,CAAC;MAChE,KAAKL,cAAc,CAACS,OAAO;QACvB,OAAOV,eAAe,CAACQ,WAAW,CAAC,SAAS,EAAEF,QAAQ,CAAC;IAC/D;EACJ,CAAC;EAED,MAAMK,aAAa,GAAGR,YAAyC;EAE/DQ,aAAa,CAACC,UAAU,GAAGT,YAAY,CAACU,SAAS;EACjDV,YAAY,CAACU,SAAS,GAAG,CAACC,QAAiB,EAAEC,SAAoC,KAAK;IAClFf,eAAe,CAACa,SAAS,CAACC,QAAQ,EAAEC,SAAS,CAAC;IAC9CJ,aAAa,CAACC,UAAU,CAACE,QAAQ,CAAC;EACtC,CAAC;EAEDH,aAAa,CAACK,mBAAmB,GAAGb,YAAY,CAACc,kBAAkB;EACnEd,YAAY,CAACc,kBAAkB,GAAIC,KAAc,IAAK;IAClD,MAAMC,WAAW,GAAGrB,YAAY,CAACoB,KAAK,CAAC,IAAI,CAAC;IAE5CP,aAAa,CAACK,mBAAmB,CAACG,WAAqB,CAAC;EAC5D,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["NitroModules","processColor","StyleSheet","NativeStyleSheet","HybridUnistylesStyleSheet","createHybridObject","absoluteFillObject","absoluteFill","flatten","compose","jsMethods"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AACzD,SAASC,YAAY,EAAEC,UAAU,IAAIC,gBAAgB,QAAQ,cAAc;AA+B3E,MAAMC,yBAAyB,GAAGJ,YAAY,CACzCK,kBAAkB,CAAsB,qBAAqB,CAAC;AAEnED,yBAAyB,CAACE,kBAAkB,GAAGH,gBAAgB,CAACG,kBAAkB;AAClFF,yBAAyB,CAACG,YAAY,GAAGJ,gBAAgB,CAACI,YAAY;AACtEH,yBAAyB,CAACI,OAAO,GAAGL,gBAAgB,CAACK,OAAO;AAC5DJ,yBAAyB,CAACK,OAAO,GAAGN,gBAAgB,CAACM,OAAO;AAC5DL,yBAAyB,CAACM,SAAS,GAAG;EAClCT;AACJ,CAAC;AAED,OAAO,MAAMC,UAAU,GAAGE,yBAAmE","ignoreList":[]}
1
+ {"version":3,"names":["NitroModules","processColor","StyleSheet","NativeStyleSheet","HybridUnistylesStyleSheet","createHybridObject","absoluteFillObject","absoluteFill","flatten","compose","jsMethods"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AACzD,SAASC,YAAY,EAAEC,UAAU,IAAIC,gBAAgB,QAAQ,cAAc;AA+B3E,MAAMC,yBAAyB,GAAGJ,YAAY,CACzCK,kBAAkB,CAAsB,qBAAqB,CAAC;AAEnED,yBAAyB,CAACE,kBAAkB,GAAGH,gBAAgB,CAACG,kBAAkB;AAClFF,yBAAyB,CAACG,YAAY,GAAGJ,gBAAgB,CAACI,YAAY;AACtEH,yBAAyB,CAACI,OAAO,GAAGL,gBAAgB,CAACK,OAAO;AAC5DJ,yBAAyB,CAACK,OAAO,GAAGN,gBAAgB,CAACM,OAAO;AAC5DL,yBAAyB,CAACM,SAAS,GAAG;EAClCT;AACJ,CAAC;AAID,OAAO,MAAMC,UAAU,GAAGE,yBAAsE","ignoreList":[]}
@@ -10,7 +10,7 @@ HybridUnistylesRuntime.statusBar = HybridUnistylesRuntime.createHybridStatusBar(
10
10
  HybridUnistylesRuntime.navigationBar = HybridUnistylesRuntime.createHybridNavigationBar();
11
11
  HybridUnistylesRuntime._setRootViewBackgroundColor = HybridUnistylesRuntime.setRootViewBackgroundColor;
12
12
  HybridUnistylesRuntime.setRootViewBackgroundColor = color => {
13
- const parsedColor = processColor(color);
13
+ const parsedColor = processColor(color) ?? 0;
14
14
  HybridUnistylesRuntime._setRootViewBackgroundColor(parsedColor);
15
15
  };
16
16
  if (isIOS) {
@@ -1 +1 @@
1
- {"version":3,"names":["processColor","NitroModules","attachStatusBarJSMethods","attachNavigationBarJSMethods","isIOS","HybridUnistylesRuntime","createHybridObject","statusBar","createHybridStatusBar","navigationBar","createHybridNavigationBar","_setRootViewBackgroundColor","setRootViewBackgroundColor","color","parsedColor","setImmersiveMode","isEnabled","setHidden","Runtime"],"sourceRoot":"../../../../src","sources":["specs/UnistylesRuntime/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,cAAc;AAC3C,SAASC,YAAY,QAAQ,4BAA4B;AAGzD,SAASC,wBAAwB,QAAiC,cAAc;AAChF,SAASC,4BAA4B,QAAqC,iBAAiB;AAE3F,SAASC,KAAK,QAAQ,cAAc;AAgCpC,MAAMC,sBAAsB,GAAGJ,YAAY,CACtCK,kBAAkB,CAA0B,kBAAkB,CAAC;AAEpED,sBAAsB,CAACE,SAAS,GAAGF,sBAAsB,CAACG,qBAAqB,CAAC,CAAC;AACjFH,sBAAsB,CAACI,aAAa,GAAGJ,sBAAsB,CAACK,yBAAyB,CAAC,CAAC;AACzFL,sBAAsB,CAACM,2BAA2B,GAAGN,sBAAsB,CAACO,0BAA0B;AAEtGP,sBAAsB,CAACO,0BAA0B,GAAIC,KAAc,IAAK;EACpE,MAAMC,WAAW,GAAGd,YAAY,CAACa,KAAK,CAAC;EAEvCR,sBAAsB,CAACM,2BAA2B,CAACG,WAAqB,CAAC;AAC7E,CAAC;AAED,IAAIV,KAAK,EAAE;EACPC,sBAAsB,CAACU,gBAAgB,GAAIC,SAAkB,IAAKX,sBAAsB,CAACE,SAAS,CAACU,SAAS,CAACD,SAAS,EAAE,MAAM,CAAC;AACnI;AAEAd,wBAAwB,CAACG,sBAAsB,CAACE,SAAS,CAAC;AAC1DJ,4BAA4B,CAACE,sBAAsB,CAACI,aAAa,CAAC;AAElE,OAAO,MAAMS,OAAO,GAAGb,sBAA0C","ignoreList":[]}
1
+ {"version":3,"names":["processColor","NitroModules","attachStatusBarJSMethods","attachNavigationBarJSMethods","isIOS","HybridUnistylesRuntime","createHybridObject","statusBar","createHybridStatusBar","navigationBar","createHybridNavigationBar","_setRootViewBackgroundColor","setRootViewBackgroundColor","color","parsedColor","setImmersiveMode","isEnabled","setHidden","Runtime"],"sourceRoot":"../../../../src","sources":["specs/UnistylesRuntime/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,cAAc;AAC3C,SAASC,YAAY,QAAQ,4BAA4B;AAGzD,SAASC,wBAAwB,QAAiC,cAAc;AAChF,SAASC,4BAA4B,QAAqC,iBAAiB;AAE3F,SAASC,KAAK,QAAQ,cAAc;AAgCpC,MAAMC,sBAAsB,GAAGJ,YAAY,CACtCK,kBAAkB,CAA0B,kBAAkB,CAAC;AAEpED,sBAAsB,CAACE,SAAS,GAAGF,sBAAsB,CAACG,qBAAqB,CAAC,CAAC;AACjFH,sBAAsB,CAACI,aAAa,GAAGJ,sBAAsB,CAACK,yBAAyB,CAAC,CAAC;AACzFL,sBAAsB,CAACM,2BAA2B,GAAGN,sBAAsB,CAACO,0BAA0B;AAEtGP,sBAAsB,CAACO,0BAA0B,GAAIC,KAAc,IAAK;EACpE,MAAMC,WAAW,GAAGd,YAAY,CAACa,KAAK,CAAC,IAAI,CAAC;EAE5CR,sBAAsB,CAACM,2BAA2B,CAACG,WAAqB,CAAC;AAC7E,CAAC;AAED,IAAIV,KAAK,EAAE;EACPC,sBAAsB,CAACU,gBAAgB,GAAIC,SAAkB,IAAKX,sBAAsB,CAACE,SAAS,CAACU,SAAS,CAACD,SAAS,EAAE,MAAM,CAAC;AACnI;AAEAd,wBAAwB,CAACG,sBAAsB,CAACE,SAAS,CAAC;AAC1DJ,4BAA4B,CAACE,sBAAsB,CAACI,aAAa,CAAC;AAElE,OAAO,MAAMS,OAAO,GAAGb,sBAA0C","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  export const getSSRUnistyles = () => [];
4
- export * from '../../web';
4
+ export * from '../web';
5
5
  //# sourceMappingURL=index.web.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getSSRUnistyles"],"sourceRoot":"../../../src","sources":["specs/index.web.ts"],"mappings":";;AAEA,OAAO,MAAMA,eAAe,GAAGA,CAAA,KAAM,EAAyB;AAE9D,cAAc,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["getSSRUnistyles"],"sourceRoot":"../../../src","sources":["specs/index.web.ts"],"mappings":";;AAEA,OAAO,MAAMA,eAAe,GAAGA,CAAA,KAAM,EAAyB;AAE9D,cAAc,QAAQ","ignoreList":[]}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ import { media } from 'typestyle';
4
+ import { deepMergeObjects, warn } from '../utils';
5
+ import { validateShadow } from './shadow';
6
+ import { convertBreakpoint } from './breakpoint';
7
+ import { BOX_SHADOW_STYLES } from './types';
8
+ import { extractShadowValue, normalizeColor, normalizeNumericValue } from './utils';
9
+ const createBoxShadowValue = style => {
10
+ // at this point every prop is present
11
+ const {
12
+ shadowColor,
13
+ shadowOffset,
14
+ shadowOpacity,
15
+ shadowRadius
16
+ } = style;
17
+ const offsetX = normalizeNumericValue(shadowOffset.width);
18
+ const offsetY = normalizeNumericValue(shadowOffset.height);
19
+ const radius = normalizeNumericValue(shadowRadius);
20
+ const color = normalizeColor(shadowColor, shadowOpacity);
21
+ return `${offsetX} ${offsetY} ${radius} ${color}`;
22
+ };
23
+ export const getBoxShadowStyle = styles => {
24
+ const missingStyles = BOX_SHADOW_STYLES.filter(key => !(key in styles));
25
+ if (missingStyles.length) {
26
+ warn(`can't apply box shadow as you miss these properties: ${missingStyles.join(', ')}`);
27
+ return {};
28
+ }
29
+ const breakpointsSet = new Set();
30
+ try {
31
+ validateShadow(BOX_SHADOW_STYLES, styles, breakpointsSet);
32
+ } catch (error) {
33
+ if (typeof error === 'string') {
34
+ warn(error);
35
+ }
36
+ return {};
37
+ }
38
+ const breakpoints = Array.from(breakpointsSet);
39
+
40
+ // If no breakpoints were used return styles without media queries
41
+ if (breakpoints.length === 0) {
42
+ return {
43
+ boxShadow: createBoxShadowValue(styles)
44
+ };
45
+ }
46
+
47
+ // Create boxShadow for each breakpoint
48
+ const breakpointStyles = breakpoints.map(breakpoint => {
49
+ const color = extractShadowValue('shadowColor', breakpoint, styles);
50
+ const {
51
+ width,
52
+ height
53
+ } = extractShadowValue('shadowOffset', breakpoint, styles);
54
+ const radius = extractShadowValue('shadowRadius', breakpoint, styles);
55
+ const opacity = extractShadowValue('shadowOpacity', breakpoint, styles);
56
+ return media(convertBreakpoint(breakpoint), {
57
+ boxShadow: createBoxShadowValue({
58
+ shadowColor: color,
59
+ shadowOffset: {
60
+ width,
61
+ height
62
+ },
63
+ shadowRadius: radius,
64
+ shadowOpacity: opacity
65
+ })
66
+ });
67
+ });
68
+
69
+ // Merge all breakpoints styles into one
70
+ return deepMergeObjects(...breakpointStyles);
71
+ };
72
+ //# sourceMappingURL=boxShadow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["media","deepMergeObjects","warn","validateShadow","convertBreakpoint","BOX_SHADOW_STYLES","extractShadowValue","normalizeColor","normalizeNumericValue","createBoxShadowValue","style","shadowColor","shadowOffset","shadowOpacity","shadowRadius","offsetX","width","offsetY","height","radius","color","getBoxShadowStyle","styles","missingStyles","filter","key","length","join","breakpointsSet","Set","error","breakpoints","Array","from","boxShadow","breakpointStyles","map","breakpoint","opacity"],"sourceRoot":"../../../../src","sources":["web/convert/boxShadow.ts"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,WAAW;AAEjC,SAASC,gBAAgB,EAAEC,IAAI,QAAQ,UAAU;AACjD,SAASC,cAAc,QAAQ,UAAU;AACzC,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,iBAAiB,QAAwB,SAAS;AAC3D,SAASC,kBAAkB,EAAEC,cAAc,EAAEC,qBAAqB,QAAQ,SAAS;AAEnF,MAAMC,oBAAoB,G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,gBAAgB,GAAGJ,WAAW,CAACK,GAAG,CAACC,UAAU,IAAI;IACnD,MAAMjB,KAAK,GAAGd,kBAAkB,CAAC,aAAa,EAAE+B,UAAU,EAAEf,MAAM,CAAC;IACnE,MAAM;MAAEN,KAAK;MAAEE;IAAO,CAAC,GAAGZ,kBAAkB,CAAC,cAAc,EAAE+B,UAAU,EAAEf,MAAM,CAAC;IAChF,MAAMH,MAAM,GAAGb,kBAAkB,CAAC,cAAc,EAAE+B,UAAU,EAAEf,MAAM,CAAC;IACrE,MAAMgB,OAAO,GAAGhC,kBAAkB,CAAC,eAAe,EAAE+B,UAAU,EAAEf,MAAM,CAAC;IAEvE,OAAOtB,KAAK,CAACI,iBAAiB,CAACiC,UAAU,CAAC,EAAE;MACxCH,SAAS,EAAEzB,oBAAoB,CAAC;QAC5BE,WAAW,EAAES,KAAK;QAClBR,YAAY,EAAE;UACVI,KAAK;UACLE;QACJ,CAAC;QACDJ,YAAY,EAAEK,MAAM;QACpBN,aAAa,EAAEyB;MACnB,CAAC;IACL,CAAC,CAAC;EACN,CAAC,CAAC;;EAEF;EACA,OAAOrC,gBAAgB,CAAC,GAAGkC,gBAAgB,CAAC;AAChD,CAAC","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ import { UnistylesState } from '../state';
4
+ import { keyInObject } from '../utils';
5
+ import { isUnistylesMq, parseMq } from '../mq';
6
+ import { Orientation } from '../../specs/types';
7
+ export const convertBreakpoint = breakpoint => {
8
+ if (Object.values(Orientation).includes(breakpoint)) {
9
+ return {
10
+ orientation: breakpoint
11
+ };
12
+ }
13
+ if (isUnistylesMq(breakpoint)) {
14
+ return parseMq(breakpoint);
15
+ }
16
+ return {
17
+ minWidth: UnistylesState.breakpoints && keyInObject(UnistylesState.breakpoints, breakpoint) ? UnistylesState.breakpoints[breakpoint] : undefined
18
+ };
19
+ };
20
+ //# sourceMappingURL=breakpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["UnistylesState","keyInObject","isUnistylesMq","parseMq","Orientation","convertBreakpoint","breakpoint","Object","values","includes","orientation","minWidth","breakpoints","undefined"],"sourceRoot":"../../../../src","sources":["web/convert/breakpoint.ts"],"mappings":";;AACA,SAASA,cAAc,QAAQ,UAAU;AACzC,SAASC,WAAW,QAAQ,UAAU;AACtC,SAASC,aAAa,EAAEC,OAAO,QAAQ,OAAO;AAC9C,SAASC,WAAW,QAAQ,mBAAmB;AAE/C,OAAO,MAAMC,iBAAiB,GAAIC,UAAkB,IAAiB;EACjE,IAAIC,MAAM,CAACC,MAAM,CAACJ,WAAW,CAAC,CAACK,QAAQ,CAACH,UAAyB,CAAC,EAAE;IAChE,OAAO;MACHI,WAAW,EAAEJ;IACjB,CAAC;EACL;EAEA,IAAIJ,aAAa,CAACI,UAAU,CAAC,EAAE;IAC3B,OAAOH,OAAO,CAACG,UAAU,CAAC;EAC9B;EAEA,OAAO;IACHK,QAAQ,EAAEX,cAAc,CAACY,WAAW,IAAIX,WAAW,CAACD,cAAc,CAACY,WAAW,EAAEN,UAAU,CAAC,GAAGN,cAAc,CAACY,WAAW,CAACN,UAAU,CAAC,GAAGO;EAC3I,CAAC;AACL,CAAC","ignoreList":[]}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ import { media } from 'typestyle';
4
+ import { isPseudo } from '../pseudo';
5
+ import { convertBreakpoint } from './breakpoint';
6
+ import { getStyle } from './style';
7
+ import { deepMergeObjects } from '../utils';
8
+ import { getTransformStyle } from './transform';
9
+ import { isBoxShadow, isTextShadow, isTransform } from './utils';
10
+ import { getTextShadowStyle } from './textShadow';
11
+ import { getBoxShadowStyle } from './boxShadow';
12
+ export const convertToTypeStyle = value => {
13
+ // Flag to mark if textShadow is already created
14
+ let hasTextShadow = false;
15
+ // Flag to mark if boxShadow is already created
16
+ let hasBoxShadow = false;
17
+ const stylesArray = Object.entries({
18
+ ...value,
19
+ ...value._web
20
+ }).flatMap(([unistylesKey, unistylesValue]) => {
21
+ // Keys to omit
22
+ if (['_classNames', '_web', 'variants', 'compoundVariants', 'uni__dependencies', '__unistyles-secrets__'].includes(unistylesKey) || unistylesKey.startsWith('variant-')) {
23
+ return [];
24
+ }
25
+
26
+ // Pseudo classes :hover, :before etc.
27
+ if (isPseudo(unistylesKey)) {
28
+ const typestyleValues = convertToTypeStyle(unistylesValue);
29
+ return {
30
+ $nest: {
31
+ [unistylesKey.replace('_', '&:')]: typestyleValues
32
+ }
33
+ };
34
+ }
35
+
36
+ // Text shadow
37
+ if (isTextShadow(unistylesKey)) {
38
+ if (hasTextShadow) {
39
+ return [];
40
+ }
41
+ hasTextShadow = true;
42
+ return getTextShadowStyle(value);
43
+ }
44
+
45
+ // Box shadow
46
+ if (isBoxShadow(unistylesKey)) {
47
+ if (hasBoxShadow) {
48
+ return [];
49
+ }
50
+ hasBoxShadow = true;
51
+ return getBoxShadowStyle(value);
52
+ }
53
+
54
+ // Transforms
55
+ if (isTransform(unistylesKey, unistylesValue)) {
56
+ return getTransformStyle(unistylesValue);
57
+ }
58
+
59
+ // Breakpoints
60
+ if (typeof unistylesValue === 'object' && unistylesValue !== null) {
61
+ return Object.entries(unistylesValue).map(([breakpointKey, breakpointValue]) => {
62
+ return media(convertBreakpoint(breakpointKey), getStyle(unistylesKey, breakpointValue));
63
+ });
64
+ }
65
+
66
+ // Regular styles
67
+ return getStyle(unistylesKey, unistylesValue);
68
+ });
69
+ return deepMergeObjects(...stylesArray);
70
+ };
71
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["media","isPseudo","convertBreakpoint","getStyle","deepMergeObjects","getTransformStyle","isBoxShadow","isTextShadow","isTransform","getTextShadowStyle","getBoxShadowStyle","convertToTypeStyle","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","typestyleValues","$nest","replace","map","breakpointKey","breakpointValue"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;AAEA,SAASA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N,WAAW,CAACc,YAAY,CAAC,EAAE;MAC3B,IAAIN,YAAY,EAAE;QACd,OAAO,EAAE;MACb;MAEAA,YAAY,GAAG,IAAI;MAEnB,OAAOJ,iBAAiB,CAACE,KAAK,CAAC;IACnC;;IAEA;IACA,IAAIJ,WAAW,CAACY,YAAY,EAAEC,cAAc,CAAC,EAAE;MAC3C,OAAOhB,iBAAiB,CAACgB,cAAc,CAAC;IAC5C;;IAEA;IACA,IAAI,OAAOA,cAAc,KAAK,QAAQ,IAAIA,cAAc,KAAK,IAAI,EAAE;MAC/D,OAAOL,MAAM,CAACC,OAAO,CAACI,cAAc,CAAC,CAACM,GAAG,CAAC,CAAC,CAACC,aAAa,EAAEC,eAAe,CAAC,KAAK;QAC5E,OAAO7B,KAAK,CAACE,iBAAiB,CAAC0B,aAAa,CAAC,EAAEzB,QAAQ,CAACiB,YAAY,EAAES,eAAe,CAAC,CAAC;MAC3F,CAAC,CAAC;IACN;;IAEA;IACA,OAAO1B,QAAQ,CAACiB,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAOjB,gBAAgB,CAAC,GAAGW,WAAW,CAAC;AAC3C,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=module.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["web/convert/module.d.ts"],"mappings":"","ignoreList":[]}