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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (539) hide show
  1. package/README.md +7 -0
  2. package/Unistyles.podspec +1 -1
  3. package/android/CMakeLists.txt +19 -45
  4. package/android/build.gradle +6 -5
  5. package/android/src/main/cxx/NativeUnistylesModule.cpp +71 -0
  6. package/android/src/main/cxx/NativeUnistylesModule.h +42 -0
  7. package/android/src/main/cxx/cpp-adapter.cpp +8 -86
  8. package/android/src/main/java/com/unistyles/Equatable.kt +61 -0
  9. package/android/src/main/java/com/unistyles/NativePlatform+android.kt +285 -0
  10. package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +152 -0
  11. package/android/src/main/java/com/unistyles/NativePlatform+listener.kt +59 -0
  12. package/android/src/main/java/com/unistyles/UnistylesModule.kt +51 -0
  13. package/android/src/main/java/com/unistyles/UnistylesPackage.kt +16 -14
  14. package/cxx/NativePlatform.h +11 -0
  15. package/cxx/common/Constants.h +3 -0
  16. package/cxx/common/Helpers.h +140 -5
  17. package/cxx/core/HostStyle.cpp +10 -6
  18. package/cxx/core/HostStyle.h +4 -0
  19. package/cxx/core/StyleSheet.h +0 -2
  20. package/cxx/core/StyleSheetRegistry.cpp +9 -17
  21. package/cxx/core/StyleSheetRegistry.h +3 -4
  22. package/cxx/core/Unistyle.h +8 -11
  23. package/cxx/core/UnistyleData.h +23 -0
  24. package/cxx/core/UnistyleWrapper.h +108 -13
  25. package/cxx/core/UnistylesCommitHook.cpp +14 -15
  26. package/cxx/core/UnistylesCommitHook.h +6 -11
  27. package/cxx/core/UnistylesCommitShadowNode.h +13 -0
  28. package/cxx/core/UnistylesMountHook.cpp +28 -0
  29. package/cxx/core/UnistylesMountHook.h +27 -0
  30. package/cxx/core/UnistylesRegistry.cpp +119 -83
  31. package/cxx/core/UnistylesRegistry.h +16 -14
  32. package/cxx/core/UnistylesState.cpp +29 -8
  33. package/cxx/core/UnistylesState.h +5 -2
  34. package/cxx/hybridObjects/HybridNavigationBar.cpp +0 -4
  35. package/cxx/hybridObjects/HybridNavigationBar.h +3 -4
  36. package/cxx/hybridObjects/HybridShadowRegistry.cpp +16 -11
  37. package/cxx/hybridObjects/HybridStatusBar.cpp +0 -4
  38. package/cxx/hybridObjects/HybridStatusBar.h +3 -4
  39. package/cxx/hybridObjects/HybridStyleSheet.cpp +154 -23
  40. package/cxx/hybridObjects/HybridStyleSheet.h +27 -5
  41. package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +96 -14
  42. package/cxx/hybridObjects/HybridUnistylesRuntime.h +19 -3
  43. package/cxx/parser/Parser.cpp +226 -175
  44. package/cxx/parser/Parser.h +11 -15
  45. package/cxx/shadowTree/ShadowLeafUpdate.h +2 -1
  46. package/cxx/shadowTree/ShadowTrafficController.h +71 -0
  47. package/cxx/shadowTree/ShadowTreeManager.cpp +23 -18
  48. package/cxx/shadowTree/ShadowTreeManager.h +3 -2
  49. package/ios/Equatable.swift +2 -1
  50. package/ios/NativePlatform+ios.swift +21 -7
  51. package/ios/NativePlatform+keyboard.swift +83 -0
  52. package/ios/NativePlatformListener+ios.swift +37 -24
  53. package/ios/Unistyles.h +1 -0
  54. package/ios/UnistylesModuleOnLoad.h +8 -2
  55. package/ios/UnistylesModuleOnLoad.mm +9 -1
  56. package/lib/commonjs/components/Display.js +18 -0
  57. package/lib/commonjs/components/Display.js.map +1 -0
  58. package/lib/commonjs/components/Hide.js +18 -0
  59. package/lib/commonjs/components/Hide.js.map +1 -0
  60. package/lib/commonjs/components/index.js +20 -0
  61. package/lib/commonjs/components/index.js.map +1 -0
  62. package/lib/commonjs/components/useMedia.js +59 -0
  63. package/lib/commonjs/components/useMedia.js.map +1 -0
  64. package/lib/commonjs/components/useMedia.web.js +43 -0
  65. package/lib/commonjs/components/useMedia.web.js.map +1 -0
  66. package/lib/commonjs/core/createUnistylesComponent.js +79 -0
  67. package/lib/commonjs/core/createUnistylesComponent.js.map +1 -0
  68. package/lib/commonjs/core/createUnistylesComponent.native.js +82 -0
  69. package/lib/commonjs/core/createUnistylesComponent.native.js.map +1 -0
  70. package/lib/commonjs/core/index.js +13 -0
  71. package/lib/commonjs/core/index.js.map +1 -0
  72. package/lib/commonjs/index.js +21 -11
  73. package/lib/commonjs/index.js.map +1 -1
  74. package/lib/commonjs/mq.js +25 -12
  75. package/lib/commonjs/mq.js.map +1 -1
  76. package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js +1 -0
  77. package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
  78. package/lib/commonjs/specs/NavigtionBar/index.js +0 -15
  79. package/lib/commonjs/specs/NavigtionBar/index.js.map +1 -1
  80. package/lib/commonjs/specs/ShadowRegistry/index.js +10 -6
  81. package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
  82. package/lib/commonjs/specs/StatusBar/index.js +0 -5
  83. package/lib/commonjs/specs/StatusBar/index.js.map +1 -1
  84. package/lib/commonjs/specs/StyleSheet/index.js +1 -0
  85. package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
  86. package/lib/commonjs/specs/UnistylesRuntime/index.js +1 -3
  87. package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -1
  88. package/lib/commonjs/specs/index.js +7 -0
  89. package/lib/commonjs/specs/index.js.map +1 -1
  90. package/lib/commonjs/specs/index.web.js +1 -1
  91. package/lib/commonjs/types/stylesheet.js.map +1 -1
  92. package/lib/commonjs/utils.js +26 -0
  93. package/lib/commonjs/utils.js.map +1 -0
  94. package/lib/commonjs/web/convert/index.js +79 -0
  95. package/lib/commonjs/web/convert/index.js.map +1 -0
  96. package/lib/commonjs/web/convert/module.d.js +2 -0
  97. package/lib/commonjs/web/convert/module.d.js.map +1 -0
  98. package/lib/commonjs/web/convert/object/boxShadow.js +59 -0
  99. package/lib/commonjs/web/convert/object/boxShadow.js.map +1 -0
  100. package/lib/commonjs/web/convert/object/filter.js +42 -0
  101. package/lib/commonjs/web/convert/object/filter.js.map +1 -0
  102. package/lib/commonjs/web/convert/object/index.js +39 -0
  103. package/lib/commonjs/web/convert/object/index.js.map +1 -0
  104. package/lib/commonjs/web/convert/object/objectStyle.js +56 -0
  105. package/lib/commonjs/web/convert/object/objectStyle.js.map +1 -0
  106. package/lib/commonjs/web/convert/object/transform.js +27 -0
  107. package/lib/commonjs/web/convert/object/transform.js.map +1 -0
  108. package/lib/commonjs/web/convert/pseudo.js +10 -0
  109. package/lib/commonjs/web/convert/pseudo.js.map +1 -0
  110. package/lib/commonjs/web/convert/shadow/boxShadow.js +62 -0
  111. package/lib/commonjs/web/convert/shadow/boxShadow.js.map +1 -0
  112. package/lib/commonjs/web/convert/shadow/getShadowBreakpoints.js +38 -0
  113. package/lib/commonjs/web/convert/shadow/getShadowBreakpoints.js.map +1 -0
  114. package/lib/commonjs/web/convert/shadow/index.js +28 -0
  115. package/lib/commonjs/web/convert/shadow/index.js.map +1 -0
  116. package/lib/commonjs/web/convert/shadow/textShadow.js +59 -0
  117. package/lib/commonjs/web/convert/shadow/textShadow.js.map +1 -0
  118. package/lib/commonjs/web/convert/style.js +93 -0
  119. package/lib/commonjs/web/convert/style.js.map +1 -0
  120. package/lib/commonjs/web/convert/types.js +9 -0
  121. package/lib/commonjs/web/convert/types.js.map +1 -0
  122. package/lib/commonjs/web/convert/utils.js +59 -0
  123. package/lib/commonjs/web/convert/utils.js.map +1 -0
  124. package/lib/commonjs/web/create.js +49 -0
  125. package/lib/commonjs/web/create.js.map +1 -0
  126. package/lib/commonjs/web/index.js +60 -0
  127. package/lib/commonjs/web/index.js.map +1 -0
  128. package/lib/commonjs/web/listener.js +61 -0
  129. package/lib/commonjs/web/listener.js.map +1 -0
  130. package/lib/commonjs/web/mock.js +27 -0
  131. package/lib/commonjs/web/mock.js.map +1 -0
  132. package/lib/commonjs/web/registry.js +172 -0
  133. package/lib/commonjs/web/registry.js.map +1 -0
  134. package/lib/commonjs/web/runtime.js +173 -0
  135. package/lib/commonjs/web/runtime.js.map +1 -0
  136. package/lib/commonjs/web/shadowRegistry.js +142 -0
  137. package/lib/commonjs/web/shadowRegistry.js.map +1 -0
  138. package/lib/commonjs/web/state.js +73 -0
  139. package/lib/commonjs/web/state.js.map +1 -0
  140. package/lib/commonjs/web/utils/common.js +39 -0
  141. package/lib/commonjs/web/utils/common.js.map +1 -0
  142. package/lib/commonjs/web/utils/index.js +28 -0
  143. package/lib/commonjs/web/utils/index.js.map +1 -0
  144. package/lib/commonjs/web/utils/unistyle.js +85 -0
  145. package/lib/commonjs/web/utils/unistyle.js.map +1 -0
  146. package/lib/commonjs/web/variants/getVariants.js +39 -0
  147. package/lib/commonjs/web/variants/getVariants.js.map +1 -0
  148. package/lib/commonjs/web/variants/index.js +28 -0
  149. package/lib/commonjs/web/variants/index.js.map +1 -0
  150. package/lib/commonjs/web/variants/useVariants.js +59 -0
  151. package/lib/commonjs/web/variants/useVariants.js.map +1 -0
  152. package/lib/module/components/Display.js +13 -0
  153. package/lib/module/components/Display.js.map +1 -0
  154. package/lib/module/components/Hide.js +13 -0
  155. package/lib/module/components/Hide.js.map +1 -0
  156. package/lib/module/components/index.js +5 -0
  157. package/lib/module/components/index.js.map +1 -0
  158. package/lib/module/components/useMedia.js +54 -0
  159. package/lib/module/components/useMedia.js.map +1 -0
  160. package/lib/module/components/useMedia.web.js +38 -0
  161. package/lib/module/components/useMedia.web.js.map +1 -0
  162. package/lib/module/core/createUnistylesComponent.js +72 -0
  163. package/lib/module/core/createUnistylesComponent.js.map +1 -0
  164. package/lib/module/core/createUnistylesComponent.native.js +75 -0
  165. package/lib/module/core/createUnistylesComponent.native.js.map +1 -0
  166. package/lib/module/core/index.js +4 -0
  167. package/lib/module/core/index.js.map +1 -0
  168. package/lib/module/index.js +2 -9
  169. package/lib/module/index.js.map +1 -1
  170. package/lib/module/mq.js +21 -11
  171. package/lib/module/mq.js.map +1 -1
  172. package/lib/module/specs/NativePlatform/NativePlatform.nitro.js +1 -0
  173. package/lib/module/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
  174. package/lib/module/specs/NavigtionBar/index.js +0 -10
  175. package/lib/module/specs/NavigtionBar/index.js.map +1 -1
  176. package/lib/module/specs/ShadowRegistry/index.js +10 -6
  177. package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
  178. package/lib/module/specs/StatusBar/index.js +1 -6
  179. package/lib/module/specs/StatusBar/index.js.map +1 -1
  180. package/lib/module/specs/StyleSheet/index.js +1 -0
  181. package/lib/module/specs/StyleSheet/index.js.map +1 -1
  182. package/lib/module/specs/UnistylesRuntime/index.js +1 -3
  183. package/lib/module/specs/UnistylesRuntime/index.js.map +1 -1
  184. package/lib/module/specs/index.js +2 -1
  185. package/lib/module/specs/index.js.map +1 -1
  186. package/lib/module/specs/index.web.js +1 -1
  187. package/lib/module/specs/index.web.js.map +1 -1
  188. package/lib/module/types/stylesheet.js.map +1 -1
  189. package/lib/module/utils.js +21 -0
  190. package/lib/module/utils.js.map +1 -0
  191. package/lib/module/web/convert/index.js +74 -0
  192. package/lib/module/web/convert/index.js.map +1 -0
  193. package/lib/module/web/convert/module.d.js +2 -0
  194. package/lib/module/web/convert/module.d.js.map +1 -0
  195. package/lib/module/web/convert/object/boxShadow.js +54 -0
  196. package/lib/module/web/convert/object/boxShadow.js.map +1 -0
  197. package/lib/module/web/convert/object/filter.js +37 -0
  198. package/lib/module/web/convert/object/filter.js.map +1 -0
  199. package/lib/module/web/convert/object/index.js +6 -0
  200. package/lib/module/web/convert/object/index.js.map +1 -0
  201. package/lib/module/web/convert/object/objectStyle.js +51 -0
  202. package/lib/module/web/convert/object/objectStyle.js.map +1 -0
  203. package/lib/module/web/convert/object/transform.js +22 -0
  204. package/lib/module/web/convert/object/transform.js.map +1 -0
  205. package/lib/module/web/convert/pseudo.js +5 -0
  206. package/lib/module/web/convert/pseudo.js.map +1 -0
  207. package/lib/module/web/convert/shadow/boxShadow.js +57 -0
  208. package/lib/module/web/convert/shadow/boxShadow.js.map +1 -0
  209. package/lib/module/web/convert/shadow/getShadowBreakpoints.js +33 -0
  210. package/lib/module/web/convert/shadow/getShadowBreakpoints.js.map +1 -0
  211. package/lib/module/web/convert/shadow/index.js +5 -0
  212. package/lib/module/web/convert/shadow/index.js.map +1 -0
  213. package/lib/module/web/convert/shadow/textShadow.js +54 -0
  214. package/lib/module/web/convert/shadow/textShadow.js.map +1 -0
  215. package/lib/module/web/convert/style.js +88 -0
  216. package/lib/module/web/convert/style.js.map +1 -0
  217. package/lib/module/web/convert/types.js +5 -0
  218. package/lib/module/web/convert/types.js.map +1 -0
  219. package/lib/module/web/convert/utils.js +45 -0
  220. package/lib/module/web/convert/utils.js.map +1 -0
  221. package/lib/module/web/create.js +44 -0
  222. package/lib/module/web/create.js.map +1 -0
  223. package/lib/module/web/index.js +26 -0
  224. package/lib/module/web/index.js.map +1 -0
  225. package/lib/module/web/listener.js +57 -0
  226. package/lib/module/web/listener.js.map +1 -0
  227. package/lib/module/web/mock.js +23 -0
  228. package/lib/module/web/mock.js.map +1 -0
  229. package/lib/module/web/registry.js +168 -0
  230. package/lib/module/web/registry.js.map +1 -0
  231. package/lib/module/web/runtime.js +169 -0
  232. package/lib/module/web/runtime.js.map +1 -0
  233. package/lib/module/web/shadowRegistry.js +138 -0
  234. package/lib/module/web/shadowRegistry.js.map +1 -0
  235. package/lib/module/web/state.js +69 -0
  236. package/lib/module/web/state.js.map +1 -0
  237. package/lib/module/web/utils/common.js +28 -0
  238. package/lib/module/web/utils/common.js.map +1 -0
  239. package/lib/module/web/utils/index.js +5 -0
  240. package/lib/module/web/utils/index.js.map +1 -0
  241. package/lib/module/web/utils/unistyle.js +72 -0
  242. package/lib/module/web/utils/unistyle.js.map +1 -0
  243. package/lib/module/web/variants/getVariants.js +34 -0
  244. package/lib/module/web/variants/getVariants.js.map +1 -0
  245. package/lib/module/web/variants/index.js +5 -0
  246. package/lib/module/web/variants/index.js.map +1 -0
  247. package/lib/module/web/variants/useVariants.js +54 -0
  248. package/lib/module/web/variants/useVariants.js.map +1 -0
  249. package/lib/typescript/src/components/Display.d.ts +7 -0
  250. package/lib/typescript/src/components/Display.d.ts.map +1 -0
  251. package/lib/typescript/src/components/Hide.d.ts +7 -0
  252. package/lib/typescript/src/components/Hide.d.ts.map +1 -0
  253. package/lib/typescript/src/components/index.d.ts +3 -0
  254. package/lib/typescript/src/components/index.d.ts.map +1 -0
  255. package/lib/typescript/src/components/useMedia.d.ts +6 -0
  256. package/lib/typescript/src/components/useMedia.d.ts.map +1 -0
  257. package/lib/typescript/src/components/useMedia.web.d.ts +6 -0
  258. package/lib/typescript/src/components/useMedia.web.d.ts.map +1 -0
  259. package/lib/typescript/src/core/createUnistylesComponent.d.ts +8 -0
  260. package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +1 -0
  261. package/lib/typescript/src/core/createUnistylesComponent.native.d.ts +8 -0
  262. package/lib/typescript/src/core/createUnistylesComponent.native.d.ts.map +1 -0
  263. package/lib/typescript/src/core/index.d.ts +2 -0
  264. package/lib/typescript/src/core/index.d.ts.map +1 -0
  265. package/lib/typescript/src/index.d.ts +3 -0
  266. package/lib/typescript/src/index.d.ts.map +1 -1
  267. package/lib/typescript/src/mq.d.ts +8 -0
  268. package/lib/typescript/src/mq.d.ts.map +1 -1
  269. package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +7 -5
  270. package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
  271. package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts +0 -1
  272. package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts.map +1 -1
  273. package/lib/typescript/src/specs/NavigtionBar/index.d.ts +1 -10
  274. package/lib/typescript/src/specs/NavigtionBar/index.d.ts.map +1 -1
  275. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +4 -4
  276. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
  277. package/lib/typescript/src/specs/ShadowRegistry/types.d.ts +3 -0
  278. package/lib/typescript/src/specs/ShadowRegistry/types.d.ts.map +1 -1
  279. package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts +0 -1
  280. package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts.map +1 -1
  281. package/lib/typescript/src/specs/StatusBar/index.d.ts +2 -4
  282. package/lib/typescript/src/specs/StatusBar/index.d.ts.map +1 -1
  283. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +3 -1
  284. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -1
  285. package/lib/typescript/src/specs/StyleSheet/index.d.ts +3 -1
  286. package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
  287. package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts +1 -1
  288. package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts.map +1 -1
  289. package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts +3 -1
  290. package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
  291. package/lib/typescript/src/specs/index.d.ts +4 -2
  292. package/lib/typescript/src/specs/index.d.ts.map +1 -1
  293. package/lib/typescript/src/specs/index.web.d.ts +1 -1
  294. package/lib/typescript/src/specs/index.web.d.ts.map +1 -1
  295. package/lib/typescript/src/types/breakpoints.d.ts +11 -11
  296. package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
  297. package/lib/typescript/src/types/common.d.ts +1 -0
  298. package/lib/typescript/src/types/common.d.ts.map +1 -1
  299. package/lib/typescript/src/types/index.d.ts +1 -1
  300. package/lib/typescript/src/types/index.d.ts.map +1 -1
  301. package/lib/typescript/src/types/stylesheet.d.ts +6 -4
  302. package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
  303. package/lib/typescript/src/types/variants.d.ts +4 -1
  304. package/lib/typescript/src/types/variants.d.ts.map +1 -1
  305. package/lib/typescript/src/utils.d.ts +2 -0
  306. package/lib/typescript/src/utils.d.ts.map +1 -0
  307. package/lib/typescript/src/web/convert/index.d.ts +3 -0
  308. package/lib/typescript/src/web/convert/index.d.ts.map +1 -0
  309. package/lib/typescript/src/web/convert/object/boxShadow.d.ts +9 -0
  310. package/lib/typescript/src/web/convert/object/boxShadow.d.ts.map +1 -0
  311. package/lib/typescript/src/web/convert/object/filter.d.ts +3 -0
  312. package/lib/typescript/src/web/convert/object/filter.d.ts.map +1 -0
  313. package/lib/typescript/src/web/convert/object/index.d.ts +4 -0
  314. package/lib/typescript/src/web/convert/object/index.d.ts.map +1 -0
  315. package/lib/typescript/src/web/convert/object/objectStyle.d.ts +5 -0
  316. package/lib/typescript/src/web/convert/object/objectStyle.d.ts.map +1 -0
  317. package/lib/typescript/src/web/convert/object/transform.d.ts +3 -0
  318. package/lib/typescript/src/web/convert/object/transform.d.ts.map +1 -0
  319. package/lib/typescript/src/web/convert/pseudo.d.ts +6 -0
  320. package/lib/typescript/src/web/convert/pseudo.d.ts.map +1 -0
  321. package/lib/typescript/src/web/convert/shadow/boxShadow.d.ts +8 -0
  322. package/lib/typescript/src/web/convert/shadow/boxShadow.d.ts.map +1 -0
  323. package/lib/typescript/src/web/convert/shadow/getShadowBreakpoints.d.ts +2 -0
  324. package/lib/typescript/src/web/convert/shadow/getShadowBreakpoints.d.ts.map +1 -0
  325. package/lib/typescript/src/web/convert/shadow/index.d.ts +3 -0
  326. package/lib/typescript/src/web/convert/shadow/index.d.ts.map +1 -0
  327. package/lib/typescript/src/web/convert/shadow/textShadow.d.ts +8 -0
  328. package/lib/typescript/src/web/convert/shadow/textShadow.d.ts.map +1 -0
  329. package/lib/typescript/src/web/convert/style.d.ts +2 -0
  330. package/lib/typescript/src/web/convert/style.d.ts.map +1 -0
  331. package/lib/typescript/{web → src/web}/convert/types.d.ts +8 -2
  332. package/lib/typescript/src/web/convert/types.d.ts.map +1 -0
  333. package/lib/typescript/src/web/convert/utils.d.ts +12 -0
  334. package/lib/typescript/src/web/convert/utils.d.ts.map +1 -0
  335. package/lib/typescript/src/web/create.d.ts +1443 -0
  336. package/lib/typescript/{web → src/web}/create.d.ts.map +1 -1
  337. package/lib/typescript/src/web/index.d.ts +1459 -0
  338. package/lib/typescript/{web → src/web}/index.d.ts.map +1 -1
  339. package/lib/typescript/{web/listener → src/web}/listener.d.ts +5 -2
  340. package/lib/typescript/src/web/listener.d.ts.map +1 -0
  341. package/lib/typescript/src/web/mock.d.ts +5 -0
  342. package/lib/typescript/src/web/mock.d.ts.map +1 -0
  343. package/lib/typescript/src/web/registry.d.ts +24 -0
  344. package/lib/typescript/src/web/registry.d.ts.map +1 -0
  345. package/lib/typescript/{web → src/web}/runtime.d.ts +11 -10
  346. package/lib/typescript/src/web/runtime.d.ts.map +1 -0
  347. package/lib/typescript/src/web/shadowRegistry.d.ts +17 -0
  348. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -0
  349. package/lib/typescript/src/web/state.d.ts +18 -0
  350. package/lib/typescript/src/web/state.d.ts.map +1 -0
  351. package/lib/typescript/src/web/utils/common.d.ts +8 -0
  352. package/lib/typescript/src/web/utils/common.d.ts.map +1 -0
  353. package/lib/typescript/src/web/utils/index.d.ts +3 -0
  354. package/lib/typescript/src/web/utils/index.d.ts.map +1 -0
  355. package/lib/typescript/src/web/utils/unistyle.d.ts +20 -0
  356. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -0
  357. package/lib/typescript/src/web/variants/getVariants.d.ts +3 -0
  358. package/lib/typescript/src/web/variants/getVariants.d.ts.map +1 -0
  359. package/lib/typescript/src/web/variants/index.d.ts +3 -0
  360. package/lib/typescript/src/web/variants/index.d.ts.map +1 -0
  361. package/lib/typescript/src/web/variants/useVariants.d.ts +3 -0
  362. package/lib/typescript/src/web/variants/useVariants.d.ts.map +1 -0
  363. package/nitrogen/generated/android/c++/JColorScheme.hpp +1 -1
  364. package/nitrogen/generated/android/c++/JFunc_void_UnistylesNativeMiniRuntime.hpp +57 -0
  365. package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp +69 -0
  366. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +35 -34
  367. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +15 -6
  368. package/nitrogen/generated/android/c++/JOrientation.hpp +1 -1
  369. package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +4 -1
  370. package/nitrogen/generated/android/c++/JUnistylesNativeMiniRuntime.hpp +9 -7
  371. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Dimensions.kt +1 -0
  372. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/{Func_void_std__vector_UnistyleDependency_.kt → Func_void_UnistylesNativeMiniRuntime.kt} +6 -5
  373. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.kt +46 -0
  374. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +25 -13
  375. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Insets.kt +1 -0
  376. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistyleDependency.kt +2 -1
  377. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt +3 -1
  378. package/nitrogen/generated/android/unistyles+autolinking.cmake +13 -1
  379. package/nitrogen/generated/android/unistyles+autolinking.gradle +2 -0
  380. package/nitrogen/generated/android/{UnistylesOnLoad.cpp → unistylesOnLoad.cpp} +6 -4
  381. package/nitrogen/generated/android/{UnistylesOnLoad.hpp → unistylesOnLoad.hpp} +1 -1
  382. package/nitrogen/generated/ios/Unistyles+autolinking.rb +6 -4
  383. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +25 -0
  384. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +73 -38
  385. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +0 -29
  386. package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +8 -8
  387. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +4 -16
  388. package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +156 -115
  389. package/nitrogen/generated/ios/swift/UnistyleDependency.swift +4 -0
  390. package/nitrogen/generated/ios/swift/UnistylesNativeMiniRuntime.swift +16 -5
  391. package/nitrogen/generated/shared/c++/ColorScheme.hpp +2 -2
  392. package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +2 -2
  393. package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +6 -3
  394. package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.cpp +0 -1
  395. package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +3 -1
  396. package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.cpp +1 -0
  397. package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.hpp +5 -0
  398. package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.hpp +3 -0
  399. package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.cpp +0 -1
  400. package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +3 -1
  401. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +2 -1
  402. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +10 -4
  403. package/nitrogen/generated/shared/c++/Orientation.hpp +2 -2
  404. package/nitrogen/generated/shared/c++/UnistyleDependency.hpp +2 -1
  405. package/nitrogen/generated/shared/c++/UnistylesCxxMiniRuntime.hpp +10 -9
  406. package/nitrogen/generated/shared/c++/UnistylesNativeMiniRuntime.hpp +9 -8
  407. package/package.json +20 -30
  408. package/plugin/common.js +31 -3
  409. package/plugin/index.js +107 -18
  410. package/plugin/ref.js +129 -13
  411. package/plugin/style.js +189 -22
  412. package/plugin/stylesheet.js +53 -3
  413. package/plugin/variants.js +33 -0
  414. package/src/components/Display.tsx +12 -0
  415. package/src/components/Hide.tsx +12 -0
  416. package/src/components/index.ts +2 -0
  417. package/src/components/useMedia.ts +64 -0
  418. package/src/components/useMedia.web.ts +47 -0
  419. package/src/core/createUnistylesComponent.native.tsx +83 -0
  420. package/src/core/createUnistylesComponent.tsx +84 -0
  421. package/src/core/index.ts +1 -0
  422. package/src/index.ts +3 -12
  423. package/src/mq.ts +27 -9
  424. package/src/specs/NativePlatform/NativePlatform.nitro.ts +7 -5
  425. package/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.ts +0 -1
  426. package/src/specs/NavigtionBar/index.ts +1 -25
  427. package/src/specs/ShadowRegistry/index.ts +16 -10
  428. package/src/specs/ShadowRegistry/types.ts +4 -1
  429. package/src/specs/StatusBar/UnistylesStatusBar.nitro.ts +0 -1
  430. package/src/specs/StatusBar/index.ts +2 -12
  431. package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +4 -1
  432. package/src/specs/StyleSheet/index.ts +6 -1
  433. package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.ts +1 -1
  434. package/src/specs/UnistylesRuntime/index.ts +5 -4
  435. package/src/specs/index.ts +6 -2
  436. package/src/specs/index.web.ts +1 -1
  437. package/src/types/breakpoints.ts +25 -13
  438. package/src/types/common.ts +1 -0
  439. package/src/types/index.ts +1 -1
  440. package/src/types/stylesheet.ts +7 -5
  441. package/src/types/variants.ts +7 -1
  442. package/src/utils.ts +22 -0
  443. package/{web → src/web}/convert/index.ts +25 -25
  444. package/src/web/convert/object/boxShadow.ts +55 -0
  445. package/src/web/convert/object/filter.ts +39 -0
  446. package/src/web/convert/object/index.ts +3 -0
  447. package/src/web/convert/object/objectStyle.ts +69 -0
  448. package/src/web/convert/object/transform.ts +24 -0
  449. package/src/web/convert/pseudo.ts +137 -0
  450. package/src/web/convert/shadow/boxShadow.ts +50 -0
  451. package/src/web/convert/shadow/getShadowBreakpoints.ts +34 -0
  452. package/src/web/convert/shadow/index.ts +2 -0
  453. package/src/web/convert/shadow/textShadow.ts +48 -0
  454. package/{web → src/web}/convert/style.ts +61 -10
  455. package/{web → src/web}/convert/types.ts +9 -2
  456. package/{web → src/web}/convert/utils.ts +11 -5
  457. package/src/web/create.ts +48 -0
  458. package/{web → src/web}/index.ts +4 -3
  459. package/src/web/listener.ts +63 -0
  460. package/{web → src/web}/mock.ts +3 -14
  461. package/src/web/registry.ts +215 -0
  462. package/{web → src/web}/runtime.ts +32 -21
  463. package/src/web/shadowRegistry.ts +145 -0
  464. package/src/web/state.ts +94 -0
  465. package/src/web/utils/common.ts +45 -0
  466. package/src/web/utils/index.ts +2 -0
  467. package/src/web/utils/unistyle.ts +108 -0
  468. package/src/web/variants/getVariants.ts +42 -0
  469. package/src/web/variants/index.ts +2 -0
  470. package/src/web/variants/useVariants.ts +65 -0
  471. package/android/src/main/cxx/helpers.cpp +0 -105
  472. package/android/src/main/cxx/helpers.h +0 -16
  473. package/android/src/main/cxx/platform.cpp +0 -170
  474. package/android/src/main/cxx/platform.h +0 -20
  475. package/lib/typescript/example/App.d.ts +0 -4
  476. package/lib/typescript/example/App.d.ts.map +0 -1
  477. package/lib/typescript/example/unistyles.d.ts +0 -63
  478. package/lib/typescript/example/unistyles.d.ts.map +0 -1
  479. package/lib/typescript/expo-example/App.d.ts +0 -4
  480. package/lib/typescript/expo-example/App.d.ts.map +0 -1
  481. package/lib/typescript/expo-example/unistyles.d.ts +0 -63
  482. package/lib/typescript/expo-example/unistyles.d.ts.map +0 -1
  483. package/lib/typescript/web/convert/boxShadow.d.ts +0 -3
  484. package/lib/typescript/web/convert/boxShadow.d.ts.map +0 -1
  485. package/lib/typescript/web/convert/breakpoint.d.ts +0 -3
  486. package/lib/typescript/web/convert/breakpoint.d.ts.map +0 -1
  487. package/lib/typescript/web/convert/index.d.ts +0 -4
  488. package/lib/typescript/web/convert/index.d.ts.map +0 -1
  489. package/lib/typescript/web/convert/shadow.d.ts +0 -2
  490. package/lib/typescript/web/convert/shadow.d.ts.map +0 -1
  491. package/lib/typescript/web/convert/style.d.ts +0 -3
  492. package/lib/typescript/web/convert/style.d.ts.map +0 -1
  493. package/lib/typescript/web/convert/textShadow.d.ts +0 -3
  494. package/lib/typescript/web/convert/textShadow.d.ts.map +0 -1
  495. package/lib/typescript/web/convert/transform.d.ts +0 -5
  496. package/lib/typescript/web/convert/transform.d.ts.map +0 -1
  497. package/lib/typescript/web/convert/types.d.ts.map +0 -1
  498. package/lib/typescript/web/convert/utils.d.ts +0 -8
  499. package/lib/typescript/web/convert/utils.d.ts.map +0 -1
  500. package/lib/typescript/web/create.d.ts +0 -2449
  501. package/lib/typescript/web/index.d.ts +0 -2464
  502. package/lib/typescript/web/listener/index.d.ts +0 -2
  503. package/lib/typescript/web/listener/index.d.ts.map +0 -1
  504. package/lib/typescript/web/listener/listener.d.ts.map +0 -1
  505. package/lib/typescript/web/mock.d.ts +0 -14
  506. package/lib/typescript/web/mock.d.ts.map +0 -1
  507. package/lib/typescript/web/mq.d.ts +0 -4
  508. package/lib/typescript/web/mq.d.ts.map +0 -1
  509. package/lib/typescript/web/pseudo.d.ts +0 -4
  510. package/lib/typescript/web/pseudo.d.ts.map +0 -1
  511. package/lib/typescript/web/registry.d.ts +0 -12
  512. package/lib/typescript/web/registry.d.ts.map +0 -1
  513. package/lib/typescript/web/runtime.d.ts.map +0 -1
  514. package/lib/typescript/web/state.d.ts +0 -24
  515. package/lib/typescript/web/state.d.ts.map +0 -1
  516. package/lib/typescript/web/useVariants.d.ts +0 -3
  517. package/lib/typescript/web/useVariants.d.ts.map +0 -1
  518. package/lib/typescript/web/utils.d.ts +0 -18
  519. package/lib/typescript/web/utils.d.ts.map +0 -1
  520. package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency_.hpp +0 -60
  521. package/plugin/__tests__/dependencies.spec.js +0 -360
  522. package/plugin/__tests__/ref.spec.js +0 -991
  523. package/plugin/__tests__/stylesheet.spec.js +0 -396
  524. package/web/convert/boxShadow.ts +0 -72
  525. package/web/convert/breakpoint.ts +0 -21
  526. package/web/convert/shadow.ts +0 -68
  527. package/web/convert/textShadow.ts +0 -69
  528. package/web/convert/transform.ts +0 -89
  529. package/web/create.ts +0 -102
  530. package/web/listener/index.ts +0 -1
  531. package/web/listener/listener.ts +0 -33
  532. package/web/mq.ts +0 -19
  533. package/web/pseudo.ts +0 -11
  534. package/web/registry.ts +0 -41
  535. package/web/state.ts +0 -148
  536. package/web/useVariants.ts +0 -99
  537. package/web/utils.ts +0 -95
  538. /package/nitrogen/generated/android/{UnistylesOnLoad.kt → unistylesOnLoad.kt} +0 -0
  539. /package/{web → src/web}/convert/module.d.ts +0 -0
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ import { deepMergeObjects } from '../../../utils';
4
+ import { TEXT_SHADOW_STYLES } from '../types';
5
+ import { extractShadowValue, normalizeColor, normalizeNumericValue } from '../utils';
6
+ import { getShadowBreakpoints } from './getShadowBreakpoints';
7
+ const createTextShadowValue = style => {
8
+ const {
9
+ textShadowColor,
10
+ textShadowOffset,
11
+ textShadowRadius
12
+ } = style;
13
+ const offsetX = normalizeNumericValue(textShadowOffset?.width ?? 0);
14
+ const offsetY = normalizeNumericValue(textShadowOffset?.height ?? 0);
15
+ const radius = normalizeNumericValue(textShadowRadius ?? 0);
16
+ const color = normalizeColor(textShadowColor ?? '#000000');
17
+ return `${offsetX} ${offsetY} ${radius} ${color}`;
18
+ };
19
+ export const getTextShadowStyle = styles => {
20
+ const breakpoints = getShadowBreakpoints(TEXT_SHADOW_STYLES, styles);
21
+
22
+ // If no breakpoints were used return styles without media queries
23
+ if (breakpoints.length === 0) {
24
+ return {
25
+ textShadow: createTextShadowValue(styles)
26
+ };
27
+ }
28
+
29
+ // Create textShadow for each breakpoint
30
+ const breakpointStyles = breakpoints.map(breakpoint => {
31
+ const color = extractShadowValue('textShadowColor', breakpoint, styles);
32
+ const {
33
+ width,
34
+ height
35
+ } = extractShadowValue('textShadowOffset', breakpoint, styles);
36
+ const radius = extractShadowValue('textShadowRadius', breakpoint, styles);
37
+ return {
38
+ [breakpoint]: {
39
+ textShadow: createTextShadowValue({
40
+ textShadowColor: color,
41
+ textShadowOffset: {
42
+ width,
43
+ height
44
+ },
45
+ textShadowRadius: radius
46
+ })
47
+ }
48
+ };
49
+ });
50
+
51
+ // Merge all breakpoints styles into one
52
+ return deepMergeObjects(...breakpointStyles);
53
+ };
54
+ //# sourceMappingURL=textShadow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["deepMergeObjects","TEXT_SHADOW_STYLES","extractShadowValue","normalizeColor","normalizeNumericValue","getShadowBreakpoints","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","width","offsetY","height","radius","color","getTextShadowStyle","styles","breakpoints","length","textShadow","breakpointStyles","map","breakpoint"],"sourceRoot":"../../../../../src","sources":["web/convert/shadow/textShadow.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,kBAAkB,QAAyB,UAAU;AAC9D,SAASC,kBAAkB,EAAEC,cAAc,EAAEC,qBAAqB,QAAQ,UAAU;AACpF,SAASC,oBAAoB,QAAQ,wBAAwB;AAE7D,MAAMC,qBAAqB,GAAIC,KAAiB,IAAK;EACjD,MAAM;IAAEC,eAAe;IAAEC,gBAAgB;IAAEC;EAAiB,CAAC,GAAGH,KAAK;EACrE,MAAMI,OAAO,GAAGP,qBAAqB,CAACK,gBAAgB,EAAEG,KAAK,IAAI,CAAC,CAAC;EACnE,MAAMC,OAAO,GAAGT,qBAAqB,CAACK,gBAAgB,EAAEK,MAAM,IAAI,CAAC,CAAC;EACpE,MAAMC,MAAM,GAAGX,qBAAqB,CAACM,gBAAgB,IAAI,CAAC,CAAC;EAC3D,MAAMM,KAAK,GAAGb,cAAc,CAAEK,eAAe,IAAI,SAAoB,CAAC;EAEtE,OAAO,GAAGG,OAAO,IAAIE,OAAO,IAAIE,MAAM,IAAIC,KAAK,EAAE;AACrD,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAIC,MAA2B,IAAK;EAC/D,MAAMC,WAAW,GAAGd,oBAAoB,CAACJ,kBAAkB,EAAEiB,MAAM,CAAC;;EAEpE;EACA,IAAIC,WAAW,CAACC,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAO;MACHC,UAAU,EAAEf,qBAAqB,CAACY,MAAoB;IAC1D,CAAC;EACL;;EAEA;EACA,MAAMI,gBAAgB,GAAGH,WAAW,CAACI,GAAG,CAACC,UAAU,IAAI;IACnD,MAAMR,KAAK,GAAGd,kBAAkB,CAAC,iBAAiB,EAAEsB,UAAU,EAAEN,MAAM,CAAC;IACvE,MAAM;MAAEN,KAAK;MAAEE;IAAO,CAAC,GAAGZ,kBAAkB,CAAC,kBAAkB,EAAEsB,UAAU,EAAEN,MAAM,CAAC;IACpF,MAAMH,MAAM,GAAGb,kBAAkB,CAAC,kBAAkB,EAAEsB,UAAU,EAAEN,MAAM,CAAC;IAEzE,OAAO;MACH,CAACM,UAAU,GAAG;QACVH,UAAU,EAAEf,qBAAqB,CAAC;UAC9BE,eAAe,EAAEQ,KAAK;UACtBP,gBAAgB,EAAE;YACdG,KAAK;YACLE;UACJ,CAAC;UACDJ,gBAAgB,EAAEK;QACtB,CAAC;MACL;IACJ,CAAC;EACL,CAAC,CAAC;;EAEF;EACA,OAAOf,gBAAgB,CAAC,GAAGsB,gBAAgB,CAAC;AAChD,CAAC","ignoreList":[]}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ import { keyInObject } from '../utils';
4
+ const SKIP_STYLES = ['borderCurve', 'elevation', 'textAlignVertical', 'includeFontPadding', 'overlayColor', 'tintColor'];
5
+ const CSS_NUMBER_KEYS = ['animationIterationCount', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'boxFlex', 'boxFlexGroup', 'boxOrdinalGroup', 'columnCount', 'columns', 'counterIncrement', 'counterReset', 'flex', 'flexGrow', 'flexPositive', 'flexShrink', 'flexNegative', 'flexOrder', 'fontWeight', 'gridArea', 'gridColumn', 'gridColumnEnd', 'gridColumnSpan', 'gridColumnStart', 'gridRow', 'gridRowEnd', 'gridRowSpan', 'gridRowStart', 'line-clamp', 'line-height', 'opacity', 'order', 'orphans', 'tabSize', 'widows', 'zIndex', 'zoom', 'fillOpacity', 'floodOpacity', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth'];
6
+ const convertMap = {
7
+ marginHorizontal: value => ({
8
+ marginInline: value
9
+ }),
10
+ marginVertical: value => ({
11
+ marginBlock: value
12
+ }),
13
+ paddingHorizontal: value => ({
14
+ paddingInline: value
15
+ }),
16
+ paddingVertical: value => ({
17
+ paddingBlock: value
18
+ }),
19
+ writingDirection: value => ({
20
+ direction: value
21
+ }),
22
+ borderBottomEndRadius: value => ({
23
+ borderBottomRightRadius: value
24
+ }),
25
+ borderBottomStartRadius: value => ({
26
+ borderBottomLeftRadius: value
27
+ }),
28
+ borderEndColor: value => ({
29
+ borderInlineEndColor: value
30
+ }),
31
+ borderStartColor: value => ({
32
+ borderInlineStartColor: value
33
+ }),
34
+ borderTopEndRadius: value => ({
35
+ borderTopRightRadius: value
36
+ }),
37
+ borderTopStartRadius: value => ({
38
+ borderTopLeftRadius: value
39
+ }),
40
+ borderEndWidth: value => ({
41
+ borderInlineEndWidth: value
42
+ }),
43
+ borderStartWidth: value => ({
44
+ borderInlineStartWidth: value
45
+ }),
46
+ end: value => ({
47
+ right: value
48
+ }),
49
+ start: value => ({
50
+ left: value
51
+ }),
52
+ marginEnd: value => ({
53
+ marginRight: value
54
+ }),
55
+ marginStart: value => ({
56
+ marginLeft: value
57
+ }),
58
+ paddingEnd: value => ({
59
+ paddingRight: value
60
+ }),
61
+ paddingStart: value => ({
62
+ paddingLeft: value
63
+ }),
64
+ transformMatrix: value => ({
65
+ transform: `matrix(${value.join(', ')})`
66
+ }),
67
+ resizeMode: value => ({
68
+ backgroundSize: value
69
+ })
70
+ };
71
+ const convertNumber = (key, value) => {
72
+ if (typeof value === 'number') {
73
+ return CSS_NUMBER_KEYS.includes(key, value) ? value : `${value}px`;
74
+ }
75
+ return value;
76
+ };
77
+ export const getStyle = (key, value) => {
78
+ if (SKIP_STYLES.includes(key)) {
79
+ return {};
80
+ }
81
+ if (keyInObject(convertMap, key)) {
82
+ return convertMap[key]?.(convertNumber(key, value)) ?? {};
83
+ }
84
+ return {
85
+ [key]: convertNumber(key, value)
86
+ };
87
+ };
88
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["keyInObject","SKIP_STYLES","CSS_NUMBER_KEYS","convertMap","marginHorizontal","value","marginInline","marginVertical","marginBlock","paddingHorizontal","paddingInline","paddingVertical","paddingBlock","writingDirection","direction","borderBottomEndRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomLeftRadius","borderEndColor","borderInlineEndColor","borderStartColor","borderInlineStartColor","borderTopEndRadius","borderTopRightRadius","borderTopStartRadius","borderTopLeftRadius","borderEndWidth","borderInlineEndWidth","borderStartWidth","borderInlineStartWidth","end","right","start","left","marginEnd","marginRight","marginStart","marginLeft","paddingEnd","paddingRight","paddingStart","paddingLeft","transformMatrix","transform","join","resizeMode","backgroundSize","convertNumber","key","includes","getStyle"],"sourceRoot":"../../../../src","sources":["web/convert/style.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,UAAU;AAEtC,MAAMC,WAAW,GAAG,CAChB,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,WAAW,CACd;AAED,MAAMC,eAAe,GAAG,CACpB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,MAAM,EACN,UAAU,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,WAAW,EACX,YAAY,EACZ,UAAU,EACV,YAAY,EAC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,GAAG,EAAE5C,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;EAC7D;EAEA,OAAO;IACH,CAAC4C,GAAG,GAAGD,aAAa,CAACC,GAAG,EAAE5C,KAAK;EACnC,CAAC;AACL,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ export const TEXT_SHADOW_STYLES = ['textShadowColor', 'textShadowOffset', 'textShadowRadius'];
4
+ export const BOX_SHADOW_STYLES = ['shadowColor', 'shadowRadius', 'shadowOpacity', 'shadowOffset'];
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TEXT_SHADOW_STYLES","BOX_SHADOW_STYLES"],"sourceRoot":"../../../../src","sources":["web/convert/types.ts"],"mappings":";;AAKA,OAAO,MAAMA,kBAAkB,GAAG,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,CAAU;AAItG,OAAO,MAAMC,iBAAiB,GAAG,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,CAAU","ignoreList":[]}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ // based on react-native-web normalizer
4
+ // https://github.com/necolas/react-native-web
5
+ import normalizeColors from '@react-native/normalize-colors';
6
+ import { BOX_SHADOW_STYLES, TEXT_SHADOW_STYLES } from './types';
7
+ export const isTransform = (key, value) => key === 'transform' && Array.isArray(value);
8
+ export const isTextShadow = key => TEXT_SHADOW_STYLES.includes(key);
9
+ export const isShadow = key => BOX_SHADOW_STYLES.includes(key);
10
+ export const isFilter = (key, value) => key === 'filter' && Array.isArray(value);
11
+ export const isBoxShadow = (key, value) => key === 'boxShadow' && Array.isArray(value);
12
+ export const normalizeNumericValue = value => value && typeof value === 'number' ? `${value}px` : value;
13
+ export const normalizeColor = (color, opacity = 1) => {
14
+ // If the opacity is 1 there's no need to normalize the color
15
+ if (opacity === 1) {
16
+ return color;
17
+ }
18
+ const integer = normalizeColors(color);
19
+
20
+ // If the color is an unknown format, the return value is null
21
+ if (integer === null) {
22
+ return color;
23
+ }
24
+ const hex = integer.toString(16).padStart(8, '0');
25
+ if (hex.length === 8) {
26
+ const [r = 0, g = 0, b = 0, a = 1] = hex.split(/(?=(?:..)*$)/).map(x => parseInt(x, 16)).filter(num => !isNaN(num));
27
+ return `rgba(${r},${g},${b},${a / 255 * opacity})`;
28
+ }
29
+ return color;
30
+ };
31
+ export const extractShadowValue = (key, breakpoint, styles) => {
32
+ const value = styles[key];
33
+ if (key === 'textShadowOffset' || key === 'shadowOffset') {
34
+ const {
35
+ width,
36
+ height
37
+ } = value;
38
+ return {
39
+ width: typeof width === 'object' ? width[breakpoint] : width,
40
+ height: typeof height === 'object' ? height[breakpoint] : height
41
+ };
42
+ }
43
+ return typeof value === 'object' ? value[breakpoint] : value;
44
+ };
45
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizeColors","BOX_SHADOW_STYLES","TEXT_SHADOW_STYLES","isTransform","key","value","Array","isArray","isTextShadow","includes","isShadow","isFilter","isBoxShadow","normalizeNumericValue","normalizeColor","color","opacity","integer","hex","toString","padStart","length","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","extractShadowValue","breakpoint","styles","width","height"],"sourceRoot":"../../../../src","sources":["web/convert/utils.ts"],"mappings":";;AAAA;AACA;AACA,OAAOA,eAAe,MAAM,gCAAgC;AAC5D,SAASC,iBAAiB,EAAEC,kBAAkB,QAA0D,SAAS;AAIjH,OAAO,MAAMC,WAAW,GAAGA,CAACC,GAAW,EAAEC,KAAU,KAAsCD,GAAG,KAAK,WAAW,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAEpI,OAAO,MAAMG,YAAY,GAAIJ,GAAW,IAAKF,kBAAkB,CAACO,QAAQ,CAACL,GAAwC,CAAC;AAElH,OAAO,MAAMM,QAAQ,GAAIN,GAAW,IAAKH,iBAAiB,CAACQ,QAAQ,CAACL,GAAuC,CAAC;AAE5G,OAAO,MAAM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C;AAED,OAAO,MAAMkB,kBAAkB,GAAGA,CAA6B7B,GAAS,EAAE8B,UAAkB,EAAEC,MAAW,KAAsB;EAC3H,MAAM9B,KAAK,GAAG8B,MAAM,CAAC/B,GAAG,CAAC;EAEzB,IAAIA,GAAG,KAAK,kBAAkB,IAAIA,GAAG,KAAK,cAAc,EAAE;IACtD,MAAM;MAAEgC,KAAK;MAAEC;IAAO,CAAC,GAAGhC,KAAK;IAE/B,OAAO;MACH+B,KAAK,EAAE,OAAOA,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAACF,UAAU,CAAC,GAAGE,KAAK;MAC5DC,MAAM,EAAE,OAAOA,MAAM,KAAK,QAAQ,GAAGA,MAAM,CAACH,UAAU,CAAC,GAAGG;IAC9D,CAAC;EACL;EAEA,OAAO,OAAOhC,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAAC6B,UAAU,CAAC,GAAG7B,KAAK;AAChE,CAAC","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ import { assignSecrets, reduceObject, getStyles } from './utils';
4
+ import { deepMergeObjects } from '../utils';
5
+ import { UnistylesRuntime } from './runtime';
6
+ import { createUseVariants, getVariants } from './variants';
7
+ export const create = stylesheet => {
8
+ const computedStylesheet = typeof stylesheet === 'function' ? stylesheet(UnistylesRuntime.theme, UnistylesRuntime.miniRuntime) : stylesheet;
9
+ const selectedVariants = new Map();
10
+ const copyVariants = () => Object.fromEntries(selectedVariants.entries());
11
+ const addSecrets = (value, key, args) => assignSecrets(value, {
12
+ __uni__key: key,
13
+ __uni__refs: new Set(),
14
+ __uni__stylesheet: stylesheet,
15
+ __uni__args: args,
16
+ __uni__variants: copyVariants()
17
+ });
18
+ const styles = reduceObject(computedStylesheet, (value, _key) => {
19
+ const key = String(_key);
20
+ if (typeof value === 'function') {
21
+ const dynamicStyle = (...args) => {
22
+ const result = value(...args);
23
+ const variants = Object.fromEntries(getVariants({
24
+ [key]: result
25
+ }, copyVariants()));
26
+ const resultWithVariants = deepMergeObjects(result, variants[key] ?? {});
27
+
28
+ // Add secrets to result of dynamic styles function
29
+ return addSecrets(getStyles(resultWithVariants), key, args);
30
+ };
31
+
32
+ // Add secrets to dynamic styles function
33
+ return addSecrets(dynamicStyle, key);
34
+ }
35
+
36
+ // Add secrets to static styles
37
+ return addSecrets(getStyles(value), key);
38
+ });
39
+
40
+ // Inject useVariants hook to styles
41
+ createUseVariants(styles, newVariants => Object.entries(newVariants).forEach(([key, value]) => selectedVariants.set(key, value)));
42
+ return styles;
43
+ };
44
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["assignSecrets","reduceObject","getStyles","deepMergeObjects","UnistylesRuntime","createUseVariants","getVariants","create","stylesheet","computedStylesheet","theme","miniRuntime","selectedVariants","Map","copyVariants","Object","fromEntries","entries","addSecrets","value","key","args","__uni__key","__uni__refs","Set","__uni__stylesheet","__uni__args","__uni__variants","styles","_key","String","dynamicStyle","result","variants","resultWithVariants","newVariants","forEach","set"],"sourceRoot":"../../../src","sources":["web/create.ts"],"mappings":";;AAEA,SAASA,aAAa,EAAEC,YAAY,EAAEC,SAAS,QAAQ,SAAS;AAChE,SAASC,gBAAgB,QAAQ,UAAU;AAC3C,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,iBAAiB,EAAEC,WAAW,QAAQ,YAAY;AAE3D,OAAO,MAAMC,MAAM,GAAIC,UAAiD,IAAK;EACzE,MAAMC,kBAAkB,GAAG,OAAOD,UAAU,KAAK,UAAU,GACrDA,UAAU,CAACJ,gBAAgB,CAACM,KAAK,EAAEN,gBAAgB,CAACO,WAAW,CAAC,GAChEH,UAAU;EAChB,MAAMI,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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,GAAG,EAAED,KAAK,CAAC,CAAC,CAAC;EAEjI,OAAOS,MAAM;AACjB,CAAC","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ import { create } from './create';
4
+ import { UnistylesState } from './state';
5
+ import { deepMergeObjects } from '../utils';
6
+ export const StyleSheet = {
7
+ configure: UnistylesState.init,
8
+ create,
9
+ absoluteFill: {
10
+ position: 'absolute',
11
+ left: 0,
12
+ top: 0,
13
+ right: 0,
14
+ bottom: 0
15
+ },
16
+ compose: (a, b) => deepMergeObjects(a, b),
17
+ flatten: (...styles) => deepMergeObjects(...styles),
18
+ hairlineWidth: 1
19
+ };
20
+ export { UnistylesRuntime } from './runtime';
21
+ export { UnistylesShadowRegistry } from './shadowRegistry';
22
+ export * from './mock';
23
+
24
+ // TODO: Work on SSR
25
+ export const getSSRUnistyles = () => [];
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["create","UnistylesState","deepMergeObjects","StyleSheet","configure","init","absoluteFill","position","left","top","right","bottom","compose","a","b","flatten","styles","hairlineWidth","UnistylesRuntime","UnistylesShadowRegistry","getSSRUnistyles"],"sourceRoot":"../../../src","sources":["web/index.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,UAAU;AACjC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,gBAAgB,QAAQ,UAAU;AAE3C,OAAO,MAAMC,UAAU,GAAG;EACtBC,SAAS,EAAEH,cAAc,CAACI,IAAI;EAC9BL,MAAM;EACNM,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,KAAKZ,gBAAgB,CAACW,CAAC,EAAEC,CAAC,CAAC;EACzDC,OAAO,EAAEA,CAAC,GAAGC,MAAqB,KAAKd,gBAAgB,CAAC,GAAGc,MAAM,CAAC;EAClEC,aAAa,EAAE;AACnB,CAAC;AAED,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,cAAc,QAAQ;;AAEtB;AACA,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM,EAAE","ignoreList":[]}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ import { UnistyleDependency } from '../specs/NativePlatform';
4
+ import { UnistylesRuntime } from './runtime';
5
+ class UnistylesListenerBuilder {
6
+ isInitialized = false;
7
+ listeners = Array.from({
8
+ length: Object.keys(UnistyleDependency).length / 2
9
+ }, () => new Set());
10
+ stylesheetListeners = Array.from({
11
+ length: Object.keys(UnistyleDependency).length / 2
12
+ }, () => new Set());
13
+ emitChange = dependency => {
14
+ this.stylesheetListeners[dependency]?.forEach(listener => listener());
15
+ this.listeners[dependency]?.forEach(listener => listener());
16
+ };
17
+ initListeners = () => {
18
+ if (this.isInitialized) {
19
+ return;
20
+ }
21
+ this.isInitialized = true;
22
+ UnistylesRuntime.darkMedia?.addEventListener('change', event => {
23
+ if (!event.matches) {
24
+ return;
25
+ }
26
+ this.emitChange(UnistyleDependency.ColorScheme);
27
+ if (UnistylesRuntime.hasAdaptiveThemes) {
28
+ this.emitChange(UnistyleDependency.Theme);
29
+ }
30
+ });
31
+ UnistylesRuntime.lightMedia?.addEventListener('change', event => {
32
+ if (!event.matches) {
33
+ return;
34
+ }
35
+ this.emitChange(UnistyleDependency.ColorScheme);
36
+ if (UnistylesRuntime.hasAdaptiveThemes) {
37
+ this.emitChange(UnistyleDependency.Theme);
38
+ }
39
+ });
40
+ window.addEventListener('orientationchange', () => this.emitChange(UnistyleDependency.Orientation));
41
+ window.addEventListener('resize', () => this.emitChange(UnistyleDependency.Dimensions));
42
+ };
43
+ addListeners = (dependencies, listener) => {
44
+ dependencies.forEach(dependency => this.listeners[dependency]?.add(listener));
45
+ return () => {
46
+ dependencies.forEach(dependency => this.listeners[dependency]?.delete(listener));
47
+ };
48
+ };
49
+ addStylesheetListeners = (dependencies, listener) => {
50
+ dependencies.forEach(dependency => this.stylesheetListeners[dependency]?.add(listener));
51
+ return () => {
52
+ dependencies.forEach(dependency => this.stylesheetListeners[dependency]?.delete(listener));
53
+ };
54
+ };
55
+ }
56
+ export const UnistylesListener = new UnistylesListenerBuilder();
57
+ //# sourceMappingURL=listener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["UnistyleDependency","UnistylesRuntime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","Set","stylesheetListeners","emitChange","dependency","forEach","listener","initListeners","darkMedia","addEventListener","event","matches","ColorScheme","hasAdaptiveThemes","Theme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","addStylesheetListeners","UnistylesListener"],"sourceRoot":"../../../src","sources":["web/listener.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,gBAAgB,QAAQ,WAAW;AAE5C,MAAMC,wBAAwB,CAAC;EACnBC,aAAa,GAAG,KAAK;EACrBC,SAAS,GAAGC,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,CAACC,IAAI,CAACT,kBAAkB,CAAC,CAACO,MAAM,GAAG;EAAE,CAAC,EAAE,MAAM,IAAIG,GAAG,CAAe,CAAC,CAAC;EAC7GC,mBAAmB,GAAGN,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,CAACC,IAAI,CAACT,kBAAkB,CAAC,CAACO,MAAM,GAAG;EAAE,CAAC,EAAE,MAAM,IAAIG,GAAG,CAAe,CAAC,CAAC;EAE/HE,UAAU,GAAIC,UAA8B,IAAK;IAC7C,IAAI,CAACF,mBAAmB,CAACE,UAAU,CAAC,EAAEC,OAAO,CAACC,QAAQ,IAAIA,QAAQ,CAAC,CAAC,CAAC;IACrE,IAAI,CAACX,SAAS,CAACS,UAAU,CAAC,EAAEC,OAAO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IAE7E,OAAO,MAAM;MACTc,YAAY,CAACf,OAAO,CAACD,UAAU,IAAI,IAAI,CAACT,SAAS,CAACS,UAAU,CAAC,EAAEkB,MAAM,CAAChB,QAAQ,CAAC,CAAC;IACpF,CAAC;EACL,CAAC;EAEDiB,sBAAsB,GAAGA,CAACH,YAAuC,EAAEd,QAAsB,KAAK;IAC1Fc,YAAY,CAACf,OAAO,CAACD,UAAU,IAAI,IAAI,CAACF,mBAAmB,CAACE,UAAU,CAAC,EAAEiB,GAAG,CAACf,QAAQ,CAAC,CAAC;IAEvF,OAAO,MAAM;MACTc,YAAY,CAACf,OAAO,CAACD,UAAU,IAAI,IAAI,CAACF,mBAAmB,CAACE,UAAU,CAAC,EAAEkB,MAAM,CAAChB,QAAQ,CAAC,CAAC;IAC9F,CAAC;EACL,CAAC;AACL;AAEA,OAAO,MAAMkB,iBAAiB,GAAG,IAAI/B,wBAAwB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ export const StatusBar = {
4
+ width: 0,
5
+ height: 0,
6
+ setStyle: () => {},
7
+ setHidden: () => {},
8
+ equals: () => true,
9
+ toString: () => 'StatusBar',
10
+ __type: 'web',
11
+ name: 'StatusBar'
12
+ };
13
+ export const NavigationBar = {
14
+ width: 0,
15
+ height: 0,
16
+ setHidden: () => {},
17
+ equals: () => true,
18
+ dispose: () => {},
19
+ toString: () => 'NavigationBar',
20
+ __type: 'web',
21
+ name: 'NavigationBar'
22
+ };
23
+ //# sourceMappingURL=mock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StatusBar","width","height","setStyle","setHidden","equals","toString","__type","name","NavigationBar","dispose"],"sourceRoot":"../../../src","sources":["web/mock.ts"],"mappings":";;AAGA,OAAO,MAAMA,SAAwB,GAAG;EACpCC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,QAAQ,EAAEA,CAAA,KAAM,CAAC,CAAC;EAClBC,SAAS,EAAEA,CAAA,KAAM,CAAC,CAAC;EACnBC,MAAM,EAAEA,CAAA,KAAM,IAAI;EAClBC,QAAQ,EAAEA,CAAA,KAAM,WAAW;EAC3BC,MAAM,EAAE,KAAK;EACbC,IAAI,EAAE;AACV,CAAC;AAED,OAAO,MAAMC,aAAgC,GAAG;EAC5CR,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTE,SAAS,EAAEA,CAAA,KAAM,CAAC,CAAC;EACnBC,MAAM,EAAEA,CAAA,KAAM,IAAI;EAClBK,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;EACjBJ,QAAQ,EAAEA,CAAA,KAAM,eAAe;EAC/BC,MAAM,EAAE,KAAK;EACbC,IAAI,EAAE;AACV,CAAC","ignoreList":[]}
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+
3
+ import { UnistylesRuntime } from './runtime';
4
+ import { extractMediaQueryValue, keyInObject, getMediaQuery, generateHash, extractUnistyleDependencies } from './utils';
5
+ import { UnistylesListener } from './listener';
6
+ import { convertUnistyles } from './convert';
7
+ class UnistylesRegistryBuilder {
8
+ stylesheets = new Map();
9
+ stylesCounter = new Map();
10
+ #styleTag = null;
11
+ disposeListenersMap = new Map();
12
+ dependenciesMap = new Map();
13
+ get styleTag() {
14
+ const tag = this.#styleTag;
15
+ if (!tag) {
16
+ const newTag = document.createElement('style');
17
+ newTag.id = 'unistyles-web';
18
+ this.#styleTag = newTag;
19
+ document.head.appendChild(newTag);
20
+ return newTag;
21
+ }
22
+ return tag;
23
+ }
24
+ getComputedStylesheet = stylesheet => {
25
+ if (typeof stylesheet !== 'function') {
26
+ return stylesheet;
27
+ }
28
+ const computedStylesheet = this.stylesheets.get(stylesheet);
29
+ if (computedStylesheet) {
30
+ return computedStylesheet;
31
+ }
32
+ const createdStylesheet = stylesheet(UnistylesRuntime.theme, UnistylesRuntime.miniRuntime);
33
+ const dependencies = Object.values(createdStylesheet).flatMap(value => extractUnistyleDependencies(value));
34
+ this.addDependenciesToStylesheet(stylesheet, dependencies);
35
+ this.stylesheets.set(stylesheet, createdStylesheet);
36
+ return createdStylesheet;
37
+ };
38
+ addDependenciesToStylesheet = (stylesheet, dependencies) => {
39
+ this.disposeListenersMap.get(stylesheet)?.();
40
+ const dependenciesMap = this.dependenciesMap.get(stylesheet) ?? new Set(dependencies);
41
+ dependencies.forEach(dependency => dependenciesMap.add(dependency));
42
+ const dispose = UnistylesListener.addStylesheetListeners(Array.from(dependenciesMap), () => {
43
+ const newComputedStylesheet = stylesheet(UnistylesRuntime.theme, UnistylesRuntime.miniRuntime);
44
+ this.stylesheets.set(stylesheet, newComputedStylesheet);
45
+ });
46
+ this.dependenciesMap.set(stylesheet, dependenciesMap);
47
+ this.disposeListenersMap.set(stylesheet, dispose);
48
+ };
49
+ add = value => {
50
+ const hash = generateHash(value);
51
+ const existingCounter = this.stylesCounter.get(hash);
52
+ if (!existingCounter || existingCounter.size === 0) {
53
+ const counter = new Set();
54
+ counter.add(value);
55
+ this.stylesCounter.set(hash, counter);
56
+ this.applyStyles(hash, convertUnistyles(value));
57
+ return {
58
+ hash,
59
+ existingHash: false
60
+ };
61
+ }
62
+ existingCounter.add(value);
63
+ return {
64
+ hash,
65
+ existingHash: true
66
+ };
67
+ };
68
+ applyStyles = (hash, styles) => {
69
+ Object.entries(styles).forEach(([key, value]) => {
70
+ if (!this.styleTag.sheet) {
71
+ return;
72
+ }
73
+ if (typeof value === 'object' && !key.startsWith('_')) {
74
+ const mediaQuery = getMediaQuery(key);
75
+ const cssRules = Array.from(this.styleTag.sheet.cssRules);
76
+ let queryRule = cssRules.find(rule => {
77
+ if (!(rule instanceof CSSMediaRule)) {
78
+ return false;
79
+ }
80
+ return rule.media.item(0)?.includes(mediaQuery);
81
+ }) ?? null;
82
+ if (!queryRule) {
83
+ const mediaQueryValue = extractMediaQueryValue(mediaQuery);
84
+ const ruleIndex = mediaQueryValue ? cssRules.reduce((acc, rule, ruleIndex) => {
85
+ if (!(rule instanceof CSSMediaRule)) {
86
+ return acc;
87
+ }
88
+ const ruleMediaQueryValue = extractMediaQueryValue(rule.conditionText);
89
+ if (ruleMediaQueryValue === undefined) {
90
+ return;
91
+ }
92
+ return ruleMediaQueryValue > mediaQueryValue ? ruleIndex : acc;
93
+ }, cssRules.length) : undefined;
94
+ queryRule = this.styleTag.sheet.cssRules.item(this.styleTag.sheet.insertRule(`@media ${mediaQuery} {.${hash} {}}`, ruleIndex));
95
+ }
96
+ if (queryRule instanceof CSSMediaRule) {
97
+ Object.entries(value).forEach(([mqKey, mqValue]) => {
98
+ this.applyRule({
99
+ hash,
100
+ key: mqKey,
101
+ value: mqValue,
102
+ sheet: queryRule
103
+ });
104
+ });
105
+ }
106
+ return;
107
+ }
108
+
109
+ // Pseudo
110
+ if (typeof value === 'object') {
111
+ Object.entries(value).forEach(([pseudoKey, pseudoValue]) => {
112
+ this.applyRule({
113
+ hash: `${hash}${key.replace('_', ':')}`,
114
+ key: pseudoKey,
115
+ value: pseudoValue,
116
+ sheet: this.styleTag.sheet
117
+ });
118
+ });
119
+ return;
120
+ }
121
+ this.applyRule({
122
+ hash,
123
+ key,
124
+ value,
125
+ sheet: this.styleTag.sheet
126
+ });
127
+ });
128
+ };
129
+ applyRule = ({
130
+ hash,
131
+ key,
132
+ value,
133
+ sheet
134
+ }) => {
135
+ let rule = Array.from(sheet.cssRules).find(rule => {
136
+ if (!(rule instanceof CSSStyleRule)) {
137
+ return false;
138
+ }
139
+
140
+ // In unistyles pseudos are prefixed with ':' but in css some of them are prefixed with '::'
141
+ return rule.selectorText.replace('::', ':').includes(hash);
142
+ }) ?? null;
143
+ if (!rule) {
144
+ rule = sheet.cssRules.item(sheet.insertRule(`.${hash} {}`));
145
+ }
146
+ if (!(rule instanceof CSSStyleRule) || !keyInObject(rule.style, key)) {
147
+ return;
148
+ }
149
+ rule.style[key] = value;
150
+ };
151
+ remove = value => {
152
+ const hash = generateHash(value);
153
+ const existingStyles = this.stylesCounter.get(hash);
154
+ if (!existingStyles) {
155
+ return;
156
+ }
157
+ existingStyles.delete(value);
158
+ if (existingStyles.size === 0) {
159
+ const ruleIndex = Array.from(this.styleTag.sheet?.cssRules ?? []).findIndex(rule => rule.cssText.includes(`.${hash}`));
160
+ if (ruleIndex === -1) {
161
+ return;
162
+ }
163
+ this.styleTag.sheet?.deleteRule(ruleIndex);
164
+ }
165
+ };
166
+ }
167
+ export const UnistylesRegistry = new UnistylesRegistryBuilder();
168
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["UnistylesRuntime","extractMediaQueryValue","keyInObject","getMediaQuery","generateHash","extractUnistyleDependencies","UnistylesListener","convertUnistyles","UnistylesRegistryBuilder","stylesheets","Map","stylesCounter","styleTag","disposeListenersMap","dependenciesMap","tag","newTag","document","createElement","id","head","appendChild","getComputedStylesheet","stylesheet","computedStylesheet","get","createdStylesheet","theme","miniRuntime","dependencies","Object","values","flatMap","value","addDependenciesToStylesheet","set","Set","forEach","dependency","add","dispose","addStylesheetListeners","Array","from","newComputedStylesheet","hash","existingCounter","size","counter","applyStyles","existingHash","styles","entries","key","sheet","startsWith","mediaQuery","cssRules","queryRule","find","rule","CSSMediaRule","media","item","includes","mediaQueryValue","ruleIndex","reduce","acc","ruleMediaQueryValue","conditionText","undefined","length","insertRule","mqKey","mqValue","applyRule","pseudoKey","pseudoValue","replace","CSSStyleRule","selectorText","style","remove","existingStyles","delete","findIndex","cssText","deleteRule","UnistylesRegistry"],"sourceRoot":"../../../src","sources":["web/registry.ts"],"mappings":";;AAEA,SAASA,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,sBAAsB,EAAEC,WAAW,EAAEC,aAAa,EAAEC,YAAY,EAAEC,2BAA2B,QAAQ,SAAS;AACvH,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,gBAAgB,QAAQ,WAAW;AAa5C,MAAMC,wBAAwB,CAAC;EACVC,WAAW,GAAG,IAAIC,GAAG,CAAoD,CAAC;EAC1EC,aAAa,GAAG,IAAID,GAAG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