react-native-unistyles 3.0.0-beta.5 → 3.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/README.md +17 -2
  2. package/android/CMakeLists.txt +1 -1
  3. package/android/src/main/cxx/NativeUnistylesModule.cpp +1 -1
  4. package/android/src/main/java/com/unistyles/NativePlatform+android.kt +5 -2
  5. package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +24 -1
  6. package/android/src/main/java/com/unistyles/NativePlatform+listener.kt +6 -1
  7. package/android/src/main/java/com/unistyles/UnistylesModule.kt +5 -4
  8. package/android/src/main/java/com/unistyles/UnistylesPackage.kt +6 -6
  9. package/components/native/Animated/package.json +5 -0
  10. package/components/native/NativeText/package.json +5 -0
  11. package/components/native/NativeView/package.json +5 -0
  12. package/cxx/core/HashGenerator.cpp +1 -1
  13. package/cxx/core/HostUnistyle.cpp +28 -4
  14. package/cxx/core/HostUnistyle.h +1 -0
  15. package/cxx/core/Unistyle.h +4 -0
  16. package/cxx/core/UnistyleWrapper.h +6 -6
  17. package/cxx/core/UnistylesRegistry.cpp +24 -3
  18. package/cxx/core/UnistylesRegistry.h +3 -0
  19. package/cxx/hybridObjects/HybridShadowRegistry.cpp +7 -0
  20. package/cxx/hybridObjects/HybridStyleSheet.cpp +27 -2
  21. package/cxx/parser/Parser.cpp +13 -7
  22. package/ios/NativePlatform+ios.swift +16 -4
  23. package/ios/UnistylesModuleOnLoad.h +4 -4
  24. package/ios/UnistylesModuleOnLoad.mm +4 -8
  25. package/lib/commonjs/components/native/Animated.js +23 -0
  26. package/lib/commonjs/components/native/Animated.js.map +1 -0
  27. package/lib/commonjs/components/native/ImageBackground.js +6 -4
  28. package/lib/commonjs/components/native/ImageBackground.js.map +1 -1
  29. package/lib/commonjs/components/native/NativeText.js +13 -0
  30. package/lib/commonjs/components/native/NativeText.js.map +1 -0
  31. package/lib/commonjs/components/native/NativeText.native.js +18 -0
  32. package/lib/commonjs/components/native/NativeText.native.js.map +1 -0
  33. package/lib/commonjs/components/native/NativeView.js +9 -0
  34. package/lib/commonjs/components/native/NativeView.js.map +1 -0
  35. package/lib/commonjs/components/native/NativeView.native.js +20 -0
  36. package/lib/commonjs/components/native/NativeView.native.js.map +1 -0
  37. package/lib/commonjs/components/native/Pressable.js +1 -1
  38. package/lib/commonjs/components/native/Pressable.js.map +1 -1
  39. package/lib/commonjs/components/native/Pressable.native.js +18 -9
  40. package/lib/commonjs/components/native/Pressable.native.js.map +1 -1
  41. package/lib/commonjs/core/createUnistylesElement.js +28 -24
  42. package/lib/commonjs/core/createUnistylesElement.js.map +1 -1
  43. package/lib/commonjs/core/createUnistylesElement.native.js +37 -23
  44. package/lib/commonjs/core/createUnistylesElement.native.js.map +1 -1
  45. package/lib/commonjs/core/createUnistylesImageBackground.js +34 -30
  46. package/lib/commonjs/core/createUnistylesImageBackground.js.map +1 -1
  47. package/lib/commonjs/core/getClassname.js +1 -3
  48. package/lib/commonjs/core/getClassname.js.map +1 -1
  49. package/lib/commonjs/core/useProxifiedUnistyles/useProxifiedUnistyles.js +2 -2
  50. package/lib/commonjs/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -1
  51. package/lib/commonjs/core/warn.js +1 -1
  52. package/lib/commonjs/core/withUnistyles/withUnistyles.js +2 -2
  53. package/lib/commonjs/core/withUnistyles/withUnistyles.js.map +1 -1
  54. package/lib/commonjs/core/withUnistyles/withUnistyles.native.js +5 -3
  55. package/lib/commonjs/core/withUnistyles/withUnistyles.native.js.map +1 -1
  56. package/lib/commonjs/hooks/useMedia.native.js +1 -1
  57. package/lib/commonjs/hooks/useMedia.native.js.map +1 -1
  58. package/lib/commonjs/mq.js.map +1 -1
  59. package/lib/commonjs/server/getServerUnistyles.js +4 -2
  60. package/lib/commonjs/server/getServerUnistyles.js.map +1 -1
  61. package/lib/commonjs/server/hydrateServerUnistyles.js +1 -1
  62. package/lib/commonjs/server/hydrateServerUnistyles.js.map +1 -1
  63. package/lib/commonjs/server/resetServerUnistyles.js +1 -1
  64. package/lib/commonjs/server/resetServerUnistyles.js.map +1 -1
  65. package/lib/commonjs/server/useServerUnistyles.js +2 -2
  66. package/lib/commonjs/server/useServerUnistyles.js.map +1 -1
  67. package/lib/commonjs/specs/StatusBar/index.js.map +1 -1
  68. package/lib/commonjs/specs/StyleSheet/index.js +1 -1
  69. package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
  70. package/lib/commonjs/specs/UnistylesRuntime/index.js +1 -1
  71. package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -1
  72. package/lib/commonjs/specs/index.native.js +3 -3
  73. package/lib/commonjs/specs/index.native.js.map +1 -1
  74. package/lib/commonjs/utils.js +16 -1
  75. package/lib/commonjs/utils.js.map +1 -1
  76. package/lib/commonjs/web/convert/index.js +4 -4
  77. package/lib/commonjs/web/convert/index.js.map +1 -1
  78. package/lib/commonjs/web/convert/object/boxShadow.js +4 -4
  79. package/lib/commonjs/web/convert/object/boxShadow.js.map +1 -1
  80. package/lib/commonjs/web/convert/object/filter.js +3 -3
  81. package/lib/commonjs/web/convert/object/filter.js.map +1 -1
  82. package/lib/commonjs/web/convert/object/transform.js +1 -1
  83. package/lib/commonjs/web/convert/object/transform.js.map +1 -1
  84. package/lib/commonjs/web/convert/utils.js.map +1 -1
  85. package/lib/commonjs/web/index.js +1 -1
  86. package/lib/commonjs/web/index.js.map +1 -1
  87. package/lib/commonjs/web/registry.js +1 -1
  88. package/lib/commonjs/web/registry.js.map +1 -1
  89. package/lib/commonjs/web/runtime.js.map +1 -1
  90. package/lib/commonjs/web/shadowRegistry.js +1 -1
  91. package/lib/commonjs/web/shadowRegistry.js.map +1 -1
  92. package/lib/commonjs/web/state.js +1 -1
  93. package/lib/commonjs/web/state.js.map +1 -1
  94. package/lib/commonjs/web/utils/common.js +1 -1
  95. package/lib/commonjs/web/utils/unistyle.js +10 -6
  96. package/lib/commonjs/web/utils/unistyle.js.map +1 -1
  97. package/lib/module/components/native/Animated.js +19 -0
  98. package/lib/module/components/native/Animated.js.map +1 -0
  99. package/lib/module/components/native/ImageBackground.js +5 -3
  100. package/lib/module/components/native/ImageBackground.js.map +1 -1
  101. package/lib/module/components/native/NativeText.js +4 -0
  102. package/lib/module/components/native/NativeText.js.map +1 -0
  103. package/lib/module/components/native/NativeText.native.js +15 -0
  104. package/lib/module/components/native/NativeText.native.js.map +1 -0
  105. package/lib/module/components/native/NativeView.js +5 -0
  106. package/lib/module/components/native/NativeView.js.map +1 -0
  107. package/lib/module/components/native/NativeView.native.js +17 -0
  108. package/lib/module/components/native/NativeView.native.js.map +1 -0
  109. package/lib/module/components/native/Pressable.js +1 -1
  110. package/lib/module/components/native/Pressable.js.map +1 -1
  111. package/lib/module/components/native/Pressable.native.js +19 -10
  112. package/lib/module/components/native/Pressable.native.js.map +1 -1
  113. package/lib/module/core/createUnistylesElement.js +28 -24
  114. package/lib/module/core/createUnistylesElement.js.map +1 -1
  115. package/lib/module/core/createUnistylesElement.native.js +38 -24
  116. package/lib/module/core/createUnistylesElement.native.js.map +1 -1
  117. package/lib/module/core/createUnistylesImageBackground.js +35 -31
  118. package/lib/module/core/createUnistylesImageBackground.js.map +1 -1
  119. package/lib/module/core/getClassname.js +2 -4
  120. package/lib/module/core/getClassname.js.map +1 -1
  121. package/lib/module/core/useProxifiedUnistyles/useProxifiedUnistyles.js +2 -2
  122. package/lib/module/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -1
  123. package/lib/module/core/warn.js +1 -1
  124. package/lib/module/core/withUnistyles/withUnistyles.js +2 -2
  125. package/lib/module/core/withUnistyles/withUnistyles.js.map +1 -1
  126. package/lib/module/core/withUnistyles/withUnistyles.native.js +6 -4
  127. package/lib/module/core/withUnistyles/withUnistyles.native.js.map +1 -1
  128. package/lib/module/hooks/useMedia.native.js +1 -1
  129. package/lib/module/hooks/useMedia.native.js.map +1 -1
  130. package/lib/module/mq.js.map +1 -1
  131. package/lib/module/server/getServerUnistyles.js +4 -2
  132. package/lib/module/server/getServerUnistyles.js.map +1 -1
  133. package/lib/module/server/hydrateServerUnistyles.js +1 -1
  134. package/lib/module/server/hydrateServerUnistyles.js.map +1 -1
  135. package/lib/module/server/resetServerUnistyles.js +1 -1
  136. package/lib/module/server/resetServerUnistyles.js.map +1 -1
  137. package/lib/module/server/useServerUnistyles.js +2 -2
  138. package/lib/module/server/useServerUnistyles.js.map +1 -1
  139. package/lib/module/specs/StatusBar/index.js.map +1 -1
  140. package/lib/module/specs/StyleSheet/index.js +1 -1
  141. package/lib/module/specs/StyleSheet/index.js.map +1 -1
  142. package/lib/module/specs/UnistylesRuntime/index.js +1 -1
  143. package/lib/module/specs/UnistylesRuntime/index.js.map +1 -1
  144. package/lib/module/specs/index.native.js +4 -4
  145. package/lib/module/specs/index.native.js.map +1 -1
  146. package/lib/module/utils.js +14 -0
  147. package/lib/module/utils.js.map +1 -1
  148. package/lib/module/web/convert/index.js +5 -5
  149. package/lib/module/web/convert/index.js.map +1 -1
  150. package/lib/module/web/convert/object/boxShadow.js +2 -2
  151. package/lib/module/web/convert/object/boxShadow.js.map +1 -1
  152. package/lib/module/web/convert/object/filter.js +3 -3
  153. package/lib/module/web/convert/object/filter.js.map +1 -1
  154. package/lib/module/web/convert/object/transform.js +1 -1
  155. package/lib/module/web/convert/object/transform.js.map +1 -1
  156. package/lib/module/web/convert/utils.js.map +1 -1
  157. package/lib/module/web/index.js +1 -1
  158. package/lib/module/web/index.js.map +1 -1
  159. package/lib/module/web/registry.js +1 -1
  160. package/lib/module/web/registry.js.map +1 -1
  161. package/lib/module/web/runtime.js.map +1 -1
  162. package/lib/module/web/shadowRegistry.js +1 -1
  163. package/lib/module/web/shadowRegistry.js.map +1 -1
  164. package/lib/module/web/state.js +1 -1
  165. package/lib/module/web/state.js.map +1 -1
  166. package/lib/module/web/utils/common.js +1 -1
  167. package/lib/module/web/utils/unistyle.js +10 -6
  168. package/lib/module/web/utils/unistyle.js.map +1 -1
  169. package/lib/typescript/src/components/native/ActivityIndicator.d.ts +1 -3
  170. package/lib/typescript/src/components/native/ActivityIndicator.d.ts.map +1 -1
  171. package/lib/typescript/src/components/native/Animated.d.ts +39 -0
  172. package/lib/typescript/src/components/native/Animated.d.ts.map +1 -0
  173. package/lib/typescript/src/components/native/FlatList.d.ts +1 -3
  174. package/lib/typescript/src/components/native/FlatList.d.ts.map +1 -1
  175. package/lib/typescript/src/components/native/Image.d.ts +1 -3
  176. package/lib/typescript/src/components/native/Image.d.ts.map +1 -1
  177. package/lib/typescript/src/components/native/ImageBackground.d.ts +1 -8
  178. package/lib/typescript/src/components/native/ImageBackground.d.ts.map +1 -1
  179. package/lib/typescript/src/components/native/ImageBackground.native.d.ts +1 -2
  180. package/lib/typescript/src/components/native/ImageBackground.native.d.ts.map +1 -1
  181. package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts +1 -3
  182. package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts.map +1 -1
  183. package/lib/typescript/src/components/native/NativeText.d.ts +2 -0
  184. package/lib/typescript/src/components/native/NativeText.d.ts.map +1 -0
  185. package/lib/typescript/src/components/native/NativeText.native.d.ts +2 -0
  186. package/lib/typescript/src/components/native/NativeText.native.d.ts.map +1 -0
  187. package/lib/typescript/src/components/native/NativeView.d.ts +3 -0
  188. package/lib/typescript/src/components/native/NativeView.d.ts.map +1 -0
  189. package/lib/typescript/src/components/native/NativeView.native.d.ts +3 -0
  190. package/lib/typescript/src/components/native/NativeView.native.d.ts.map +1 -0
  191. package/lib/typescript/src/components/native/Pressable.d.ts.map +1 -1
  192. package/lib/typescript/src/components/native/Pressable.native.d.ts.map +1 -1
  193. package/lib/typescript/src/components/native/RefreshControl.d.ts +1 -3
  194. package/lib/typescript/src/components/native/RefreshControl.d.ts.map +1 -1
  195. package/lib/typescript/src/components/native/ScrollView.d.ts +1 -3
  196. package/lib/typescript/src/components/native/ScrollView.d.ts.map +1 -1
  197. package/lib/typescript/src/components/native/SectionList.d.ts +1 -3
  198. package/lib/typescript/src/components/native/SectionList.d.ts.map +1 -1
  199. package/lib/typescript/src/components/native/Switch.d.ts +1 -3
  200. package/lib/typescript/src/components/native/Switch.d.ts.map +1 -1
  201. package/lib/typescript/src/components/native/Text.d.ts +1 -3
  202. package/lib/typescript/src/components/native/Text.d.ts.map +1 -1
  203. package/lib/typescript/src/components/native/TextInput.d.ts +1 -3
  204. package/lib/typescript/src/components/native/TextInput.d.ts.map +1 -1
  205. package/lib/typescript/src/components/native/TouchableHighlight.d.ts +1 -3
  206. package/lib/typescript/src/components/native/TouchableHighlight.d.ts.map +1 -1
  207. package/lib/typescript/src/components/native/TouchableOpacity.d.ts +1 -3
  208. package/lib/typescript/src/components/native/TouchableOpacity.d.ts.map +1 -1
  209. package/lib/typescript/src/components/native/View.d.ts +1 -3
  210. package/lib/typescript/src/components/native/View.d.ts.map +1 -1
  211. package/lib/typescript/src/components/native/VirtualizedList.d.ts +1 -3
  212. package/lib/typescript/src/components/native/VirtualizedList.d.ts.map +1 -1
  213. package/lib/typescript/src/core/createUnistylesElement.d.ts +1 -7
  214. package/lib/typescript/src/core/createUnistylesElement.d.ts.map +1 -1
  215. package/lib/typescript/src/core/createUnistylesElement.native.d.ts +1 -2
  216. package/lib/typescript/src/core/createUnistylesElement.native.d.ts.map +1 -1
  217. package/lib/typescript/src/core/createUnistylesImageBackground.d.ts +2 -3
  218. package/lib/typescript/src/core/createUnistylesImageBackground.d.ts.map +1 -1
  219. package/lib/typescript/src/core/getClassname.d.ts +2 -2
  220. package/lib/typescript/src/core/getClassname.d.ts.map +1 -1
  221. package/lib/typescript/src/core/useProxifiedUnistyles/useProxifiedUnistyles.d.ts +2 -1
  222. package/lib/typescript/src/core/useProxifiedUnistyles/useProxifiedUnistyles.d.ts.map +1 -1
  223. package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts.map +1 -1
  224. package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts.map +1 -1
  225. package/lib/typescript/src/mq.d.ts +1 -1
  226. package/lib/typescript/src/mq.d.ts.map +1 -1
  227. package/lib/typescript/src/server/getServerUnistyles.d.ts.map +1 -1
  228. package/lib/typescript/src/server/hydrateServerUnistyles.d.ts.map +1 -1
  229. package/lib/typescript/src/server/useServerUnistyles.d.ts.map +1 -1
  230. package/lib/typescript/src/specs/StatusBar/index.d.ts +1 -1
  231. package/lib/typescript/src/specs/StatusBar/index.d.ts.map +1 -1
  232. package/lib/typescript/src/specs/StyleSheet/index.d.ts +2 -1
  233. package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
  234. package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts +1 -1
  235. package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts.map +1 -1
  236. package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts +5 -5
  237. package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
  238. package/lib/typescript/src/specs/index.native.d.ts +4 -4
  239. package/lib/typescript/src/specs/index.native.d.ts.map +1 -1
  240. package/lib/typescript/src/types/breakpoints.d.ts +2 -2
  241. package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
  242. package/lib/typescript/src/types/core.d.ts +1 -1
  243. package/lib/typescript/src/types/core.d.ts.map +1 -1
  244. package/lib/typescript/src/types/stylesheet.d.ts +4 -4
  245. package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
  246. package/lib/typescript/src/utils.d.ts +1 -0
  247. package/lib/typescript/src/utils.d.ts.map +1 -1
  248. package/lib/typescript/src/web/convert/object/filter.d.ts.map +1 -1
  249. package/lib/typescript/src/web/convert/object/transform.d.ts.map +1 -1
  250. package/lib/typescript/src/web/convert/types.d.ts +1 -1
  251. package/lib/typescript/src/web/convert/types.d.ts.map +1 -1
  252. package/lib/typescript/src/web/convert/utils.d.ts +2 -2
  253. package/lib/typescript/src/web/convert/utils.d.ts.map +1 -1
  254. package/lib/typescript/src/web/create.d.ts +1 -1
  255. package/lib/typescript/src/web/create.d.ts.map +1 -1
  256. package/lib/typescript/src/web/index.d.ts +1 -1
  257. package/lib/typescript/src/web/index.d.ts.map +1 -1
  258. package/lib/typescript/src/web/registry.d.ts +1 -1
  259. package/lib/typescript/src/web/registry.d.ts.map +1 -1
  260. package/lib/typescript/src/web/runtime.d.ts +1 -1
  261. package/lib/typescript/src/web/runtime.d.ts.map +1 -1
  262. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
  263. package/lib/typescript/src/web/state.d.ts +1 -1
  264. package/lib/typescript/src/web/state.d.ts.map +1 -1
  265. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
  266. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +1 -1
  267. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +23 -39
  268. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/unistylesOnLoad.kt +35 -0
  269. package/nitrogen/generated/ios/Unistyles+autolinking.rb +2 -0
  270. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +1 -1
  271. package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +3 -1
  272. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +2 -3
  273. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec_cxx.swift +18 -18
  274. package/nitrogen/generated/shared/c++/ColorScheme.hpp +1 -1
  275. package/nitrogen/generated/shared/c++/Dimensions.hpp +1 -1
  276. package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +1 -1
  277. package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +1 -1
  278. package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.hpp +1 -1
  279. package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.hpp +1 -1
  280. package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +1 -1
  281. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +1 -1
  282. package/nitrogen/generated/shared/c++/Insets.hpp +1 -1
  283. package/nitrogen/generated/shared/c++/Orientation.hpp +1 -1
  284. package/nitrogen/generated/shared/c++/UnistyleDependency.hpp +1 -1
  285. package/nitrogen/generated/shared/c++/UnistylesCxxMiniRuntime.hpp +1 -1
  286. package/nitrogen/generated/shared/c++/UnistylesNativeMiniRuntime.hpp +1 -1
  287. package/package.json +16 -12
  288. package/plugin/consts.js +63 -0
  289. package/plugin/exotic.js +54 -0
  290. package/plugin/import.js +1 -1
  291. package/plugin/index.d.ts +84 -36
  292. package/plugin/index.js +48 -65
  293. package/plugin/stylesheet.js +454 -117
  294. package/plugin/variants.js +1 -1
  295. package/src/components/native/Animated.tsx +17 -0
  296. package/src/components/native/ImageBackground.tsx +7 -4
  297. package/src/components/native/NativeText.native.tsx +12 -0
  298. package/src/components/native/NativeText.tsx +1 -0
  299. package/src/components/native/NativeView.native.tsx +13 -0
  300. package/src/components/native/NativeView.tsx +3 -0
  301. package/src/components/native/Pressable.native.tsx +26 -13
  302. package/src/components/native/Pressable.tsx +1 -1
  303. package/src/core/createUnistylesElement.native.tsx +42 -27
  304. package/src/core/createUnistylesElement.tsx +36 -31
  305. package/src/core/createUnistylesImageBackground.tsx +39 -34
  306. package/src/core/getClassname.ts +5 -4
  307. package/src/core/useProxifiedUnistyles/useProxifiedUnistyles.ts +3 -3
  308. package/src/core/warn.ts +1 -1
  309. package/src/core/withUnistyles/withUnistyles.native.tsx +8 -6
  310. package/src/core/withUnistyles/withUnistyles.tsx +4 -4
  311. package/src/hooks/useMedia.native.ts +1 -1
  312. package/src/mq.ts +1 -1
  313. package/src/server/getServerUnistyles.tsx +3 -2
  314. package/src/server/hydrateServerUnistyles.ts +1 -1
  315. package/src/server/resetServerUnistyles.ts +1 -1
  316. package/src/server/useServerUnistyles.tsx +2 -2
  317. package/src/specs/StatusBar/index.ts +1 -1
  318. package/src/specs/StyleSheet/index.ts +5 -4
  319. package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.ts +1 -1
  320. package/src/specs/UnistylesRuntime/index.ts +5 -5
  321. package/src/specs/index.native.ts +4 -4
  322. package/src/types/breakpoints.ts +2 -2
  323. package/src/types/core.ts +1 -1
  324. package/src/types/stylesheet.ts +4 -4
  325. package/src/utils.ts +17 -0
  326. package/src/web/convert/index.ts +5 -5
  327. package/src/web/convert/object/boxShadow.ts +2 -2
  328. package/src/web/convert/object/filter.ts +3 -3
  329. package/src/web/convert/object/transform.ts +2 -2
  330. package/src/web/convert/types.ts +1 -1
  331. package/src/web/convert/utils.ts +2 -2
  332. package/src/web/create.ts +1 -1
  333. package/src/web/index.ts +3 -3
  334. package/src/web/registry.ts +2 -2
  335. package/src/web/runtime.ts +2 -2
  336. package/src/web/shadowRegistry.ts +2 -2
  337. package/src/web/state.ts +4 -4
  338. package/src/web/utils/common.ts +1 -1
  339. package/src/web/utils/unistyle.ts +13 -7
  340. package/plugin/common.js +0 -142
@@ -1,17 +1,18 @@
1
1
  import React from 'react'
2
- import { ImageBackground as NativeImageBackground } from 'react-native'
3
2
  import { forwardRef } from 'react'
4
- import type { UnistylesValues } from '../../types'
3
+ import { ImageBackground as NativeImageBackground } from 'react-native'
5
4
  import { getClassName } from '../../core'
6
- import { isServer } from '../../web/utils'
5
+ import type { UnistylesValues } from '../../types'
6
+ import { copyComponentProperties } from '../../utils'
7
7
  import { UnistylesShadowRegistry } from '../../web'
8
+ import { isServer } from '../../web/utils'
8
9
 
9
10
  type Props = {
10
11
  style?: UnistylesValues
11
12
  imageStyle?: UnistylesValues
12
13
  }
13
14
 
14
- export const ImageBackground = forwardRef<unknown, Props>((props, forwardedRef) => {
15
+ const UnistylesImageBackground = forwardRef<unknown, Props>((props, forwardedRef) => {
15
16
  let storedRef: NativeImageBackground | null = null
16
17
  let storedImageRef: NativeImageBackground | null = null
17
18
  const styleClassNames = getClassName(props.style)
@@ -54,3 +55,5 @@ export const ImageBackground = forwardRef<unknown, Props>((props, forwardedRef)
54
55
  />
55
56
  )
56
57
  })
58
+
59
+ export const ImageBackground = copyComponentProperties(NativeImageBackground, UnistylesImageBackground)
@@ -0,0 +1,12 @@
1
+ import { type ComponentType, createElement, forwardRef } from 'react'
2
+ import type { TextProps } from 'react-native'
3
+ import { createUnistylesElement } from '../../core'
4
+
5
+ // credits to @hirbod
6
+ const LeanText = forwardRef((props, ref) => {
7
+ return createElement('RCTText', { ...props, ref })
8
+ }) as ComponentType<TextProps>
9
+
10
+ LeanText.displayName = 'RCTText'
11
+
12
+ export const NativeText = createUnistylesElement(LeanText)
@@ -0,0 +1 @@
1
+ export { Text } from './Text'
@@ -0,0 +1,13 @@
1
+ import { type ComponentType, createElement, forwardRef } from 'react'
2
+ import type { ViewProps } from 'react-native'
3
+ import { createUnistylesElement } from '../../core'
4
+
5
+ // credits to @hirbod
6
+ const LeanView = forwardRef((props, ref) => {
7
+ return createElement('RCTView', { ...props, ref })
8
+ }) as ComponentType<ViewProps>
9
+
10
+ LeanView.displayName = 'RCTView'
11
+
12
+ // this will match default export from react-native
13
+ export default createUnistylesElement(LeanView)
@@ -0,0 +1,3 @@
1
+ import { View } from './View'
2
+
3
+ export default View
@@ -1,17 +1,33 @@
1
- import React, { forwardRef, useEffect, useRef } from 'react'
1
+ import React, { forwardRef, useLayoutEffect, useRef } from 'react'
2
2
  import { Pressable as NativePressableReactNative } from 'react-native'
3
3
  import type { PressableProps as Props, View } from 'react-native'
4
- import { UnistylesShadowRegistry } from '../../specs'
5
4
  import { passForwardedRef } from '../../core'
5
+ import { UnistylesShadowRegistry } from '../../specs'
6
6
 
7
7
  type PressableProps = Props & {
8
8
  variants?: Record<string, string | boolean>
9
9
  }
10
10
 
11
+ const getStyles = (styleProps: Record<string, any> = {}) => {
12
+ const unistyleKey = Object
13
+ .keys(styleProps)
14
+ .find(key => key.startsWith('unistyles_'))
15
+
16
+ if (!unistyleKey) {
17
+ return styleProps
18
+ }
19
+
20
+ return {
21
+ // styles without C++ state
22
+ ...styleProps[unistyleKey].uni__getStyles(),
23
+ [unistyleKey]: styleProps[unistyleKey]
24
+ }
25
+ }
26
+
11
27
  export const Pressable = forwardRef<View, PressableProps>(({ variants, style, ...props }, forwardedRef) => {
12
28
  const storedRef = useRef<View | null>()
13
29
 
14
- useEffect(() => {
30
+ useLayoutEffect(() => {
15
31
  return () => {
16
32
  if (storedRef.current) {
17
33
  // @ts-expect-error - this is hidden from TS
@@ -24,13 +40,6 @@ export const Pressable = forwardRef<View, PressableProps>(({ variants, style, ..
24
40
  <NativePressableReactNative
25
41
  {...props}
26
42
  ref={ref => {
27
- const unistyles = typeof style === 'function'
28
- ? style({ pressed: false })
29
- : style
30
-
31
- // @ts-expect-error web types are not compatible with RN styles
32
- UnistylesShadowRegistry.add(ref, unistyles)
33
-
34
43
  if (ref) {
35
44
  storedRef.current = ref
36
45
  }
@@ -38,14 +47,18 @@ export const Pressable = forwardRef<View, PressableProps>(({ variants, style, ..
38
47
  return passForwardedRef(props, ref, forwardedRef)
39
48
  }}
40
49
  style={state => {
41
- const unistyles = typeof style === 'function'
42
- ? style(state)
43
- : style
50
+ const isPropStyleAFunction = typeof style === 'function'
51
+ const unistyles = isPropStyleAFunction
52
+ ? style.call(style, state)
53
+ : getStyles(style as unknown as Record<string, any>)
44
54
 
45
55
  if (!storedRef.current) {
46
56
  return unistyles
47
57
  }
48
58
 
59
+ // @ts-expect-error - this is hidden from TS
60
+ UnistylesShadowRegistry.remove(storedRef.current)
61
+
49
62
  // @ts-expect-error - this is hidden from TS
50
63
  UnistylesShadowRegistry.add(storedRef.current, unistyles)
51
64
 
@@ -1,9 +1,9 @@
1
1
  import React, { forwardRef } from 'react'
2
2
  import { Pressable as NativePressableReactNative } from 'react-native'
3
3
  import type { PressableProps as Props, View } from 'react-native'
4
+ import { getClassName } from '../../core'
4
5
  import { UnistylesShadowRegistry } from '../../specs'
5
6
  import type { UnistylesValues } from '../../types'
6
- import { getClassName } from '../../core'
7
7
  import { isServer } from '../../web/utils'
8
8
 
9
9
  type Variants = Record<string, string | boolean | undefined>
@@ -1,36 +1,51 @@
1
- import React, { useEffect, useRef } from 'react'
1
+ import React, { useLayoutEffect, useRef } from 'react'
2
2
  import { UnistylesShadowRegistry } from '../specs'
3
+ import { copyComponentProperties } from '../utils'
3
4
  import { passForwardedRef } from './passForwardRef'
4
5
  import { maybeWarnAboutMultipleUnistyles } from './warn'
5
6
 
6
- export const createUnistylesElement = (Component: any) => React.forwardRef((props, forwardedRef) => {
7
- const storedRef = useRef<unknown>(null)
7
+ const getNativeRef = (Component: any, ref: any) => {
8
+ switch (Component.name) {
9
+ case 'KeyboardAvoidingView':
10
+ return ref.viewRef?.current
11
+ case 'FlatList':
12
+ return ref.getNativeScrollRef?.()
13
+ case 'VirtualizedList':
14
+ return ref.getScrollRef?.()
15
+ default:
16
+ return ref
17
+ }
18
+ }
8
19
 
9
- useEffect(() => {
10
- return () => {
11
- if (storedRef.current) {
12
- // @ts-ignore
13
- UnistylesShadowRegistry.remove(storedRef.current)
14
- }
15
- }
16
- }, [])
20
+ export const createUnistylesElement = (Component: any) => {
21
+ const UnistylesComponent = React.forwardRef((props, forwardedRef) => {
22
+ const storedRef = useRef<unknown>(null)
17
23
 
18
- return (
19
- <Component
20
- {...props}
21
- ref={(ref: unknown) => {
22
- if (ref) {
23
- storedRef.current = Component.name === 'KeyboardAvoidingView'
24
- // @ts-ignore this is special case for KeyboardAvoidingView
25
- ? ref.viewRef.current
26
- : ref
24
+ useLayoutEffect(() => {
25
+ return () => {
26
+ if (storedRef.current) {
27
+ // @ts-ignore
28
+ UnistylesShadowRegistry.remove(storedRef.current)
27
29
  }
30
+ }
31
+ }, [])
32
+
33
+ return (
34
+ <Component
35
+ {...props}
36
+ ref={(ref: unknown) => {
37
+ if (ref) {
38
+ storedRef.current = getNativeRef(Component, ref)
39
+ }
40
+
41
+ passForwardedRef(props, ref, forwardedRef)
28
42
 
29
- passForwardedRef(props, ref, forwardedRef)
43
+ // @ts-ignore we don't know the type of the component
44
+ maybeWarnAboutMultipleUnistyles(props.style, Component.displayName)
45
+ }}
46
+ />
47
+ )
48
+ })
30
49
 
31
- // @ts-ignore we don't know the type of the component
32
- maybeWarnAboutMultipleUnistyles(props.style, Component.displayName)
33
- }}
34
- />
35
- )
36
- })
50
+ return copyComponentProperties(Component, UnistylesComponent)
51
+ }
@@ -1,43 +1,48 @@
1
1
  import React from 'react'
2
2
  import type { UnistylesValues } from '../types'
3
- import { getClassName } from './getClassname'
4
- import { isServer } from '../web/utils'
3
+ import { copyComponentProperties } from '../utils'
5
4
  import { UnistylesShadowRegistry } from '../web'
5
+ import { isServer } from '../web/utils'
6
+ import { getClassName } from './getClassname'
6
7
  import { maybeWarnAboutMultipleUnistyles } from './warn'
7
8
 
8
9
  type ComponentProps = {
9
10
  style?: UnistylesValues | Array<UnistylesValues>
10
11
  }
11
12
 
12
- export const createUnistylesElement = (Component: any) => React.forwardRef<unknown, ComponentProps>((props, forwardedRef) => {
13
- let storedRef: HTMLElement | null = null
14
- const classNames = getClassName(props.style)
13
+ export const createUnistylesElement = (Component: any) => {
14
+ const UnistylesComponent = React.forwardRef<unknown, ComponentProps>((props, forwardedRef) => {
15
+ let storedRef: HTMLElement | null = null
16
+ const classNames = getClassName(props.style)
17
+
18
+ return (
19
+ <Component
20
+ {...props}
21
+ style={classNames}
22
+ ref={isServer() ? undefined : (ref: HTMLElement | null) => {
23
+ // @ts-ignore we don't know the type of the component
24
+ maybeWarnAboutMultipleUnistyles(props.style, Component.displayName)
15
25
 
16
- return (
17
- <Component
18
- {...props}
19
- style={classNames}
20
- ref={isServer() ? undefined : (ref: HTMLElement | null) => {
21
- // @ts-ignore we don't know the type of the component
22
- maybeWarnAboutMultipleUnistyles(props.style, Component.displayName)
26
+ if (!ref) {
27
+ // @ts-expect-error hidden from TS
28
+ UnistylesShadowRegistry.remove(storedRef, classNames?.hash)
29
+ }
23
30
 
24
- if (!ref) {
31
+ storedRef = ref
25
32
  // @ts-expect-error hidden from TS
26
- UnistylesShadowRegistry.remove(storedRef, classNames?.hash)
27
- }
28
-
29
- storedRef = ref
30
- // @ts-expect-error hidden from TS
31
- UnistylesShadowRegistry.add(ref, classNames?.hash)
32
-
33
- if (typeof forwardedRef === 'function') {
34
- return forwardedRef(ref)
35
- }
36
-
37
- if (forwardedRef) {
38
- forwardedRef.current = ref
39
- }
40
- }}
41
- />
42
- )
43
- })
33
+ UnistylesShadowRegistry.add(ref, classNames?.hash)
34
+
35
+ if (typeof forwardedRef === 'function') {
36
+ return forwardedRef(ref)
37
+ }
38
+
39
+ if (forwardedRef) {
40
+ forwardedRef.current = ref
41
+ }
42
+ }}
43
+ />
44
+ )
45
+ })
46
+
47
+ return copyComponentProperties(Component, UnistylesComponent)
48
+ }
@@ -1,45 +1,50 @@
1
- import React, { useEffect, useRef } from 'react'
1
+ import React, { useLayoutEffect, useRef } from 'react'
2
2
  import type { Image, ImageBackground, ImageBackgroundProps } from 'react-native'
3
3
  import { UnistylesShadowRegistry } from '../specs'
4
+ import { copyComponentProperties } from '../utils'
4
5
  import { passForwardedRef } from './passForwardRef'
5
6
  import { maybeWarnAboutMultipleUnistyles } from './warn'
6
7
 
7
- export const createUnistylesImageBackground = (Component: typeof ImageBackground) => React.forwardRef<ImageBackground, ImageBackgroundProps>((props, forwardedRef) => {
8
- const storedImageRef = useRef<Image | null>(null)
8
+ export const createUnistylesImageBackground = (Component: typeof ImageBackground) => {
9
+ const UnistylesImageBackground = React.forwardRef<ImageBackground, ImageBackgroundProps>((props, forwardedRef) => {
10
+ const storedImageRef = useRef<Image | null>(null)
9
11
 
10
- useEffect(() => {
11
- return () => {
12
- if (storedImageRef.current) {
13
- // @ts-ignore
14
- UnistylesShadowRegistry.remove(storedImageRef.current)
12
+ useLayoutEffect(() => {
13
+ return () => {
14
+ if (storedImageRef.current) {
15
+ // @ts-ignore
16
+ UnistylesShadowRegistry.remove(storedImageRef.current)
17
+ }
15
18
  }
16
- }
17
- }, [])
19
+ }, [])
18
20
 
19
- // @ts-expect-error we don't know the type of the component
20
- maybeWarnAboutMultipleUnistyles(props.style, 'ImageBackground')
21
- // @ts-ignore we don't know the type of the component
22
- maybeWarnAboutMultipleUnistyles(props.imageStyle, 'ImageBackground')
21
+ // @ts-expect-error we don't know the type of the component
22
+ maybeWarnAboutMultipleUnistyles(props.style, 'ImageBackground')
23
+ // @ts-ignore we don't know the type of the component
24
+ maybeWarnAboutMultipleUnistyles(props.imageStyle, 'ImageBackground')
23
25
 
24
- return (
25
- <Component
26
- {...props}
27
- ref={ref => {
28
- passForwardedRef(props, ref, forwardedRef)
26
+ return (
27
+ <Component
28
+ {...props}
29
+ ref={ref => {
30
+ passForwardedRef(props, ref, forwardedRef)
29
31
 
30
- return () => {
31
- // @ts-ignore
32
- UnistylesShadowRegistry.remove(ref)
33
- }
34
- }}
35
- imageRef={ref => {
36
- if (ref) {
37
- storedImageRef.current = ref
38
- }
32
+ return () => {
33
+ // @ts-ignore
34
+ UnistylesShadowRegistry.remove(ref)
35
+ }
36
+ }}
37
+ imageRef={ref => {
38
+ if (ref) {
39
+ storedImageRef.current = ref
40
+ }
41
+
42
+ // @ts-expect-error web types are not compatible with RN styles
43
+ UnistylesShadowRegistry.add(ref, props.imageStyle)
44
+ }}
45
+ />
46
+ )
47
+ })
39
48
 
40
- // @ts-expect-error web types are not compatible with RN styles
41
- UnistylesShadowRegistry.add(ref, props.imageStyle)
42
- }}
43
- />
44
- )
45
- })
49
+ return copyComponentProperties(Component, UnistylesImageBackground)
50
+ }
@@ -1,13 +1,14 @@
1
- import type { UnistylesValues } from '../types';
2
- import { UnistylesShadowRegistry } from '../web';
1
+ import type { UnistylesValues } from '../types'
2
+ import { UnistylesWeb } from '../web'
3
3
 
4
4
  export const getClassName = (unistyle: UnistylesValues | undefined | Array<UnistylesValues>) => {
5
5
  if (!unistyle) {
6
6
  return undefined
7
7
  }
8
8
 
9
- // @ts-expect-error hidden from TS
10
- const { hash, injectedClassName } = UnistylesShadowRegistry.addStyles(Array.isArray(unistyle) ? unistyle : [unistyle])
9
+ const { hash, injectedClassName } = UnistylesWeb.shadowRegistry.addStyles(
10
+ Array.isArray(unistyle) ? unistyle.flat(Number.POSITIVE_INFINITY) : [unistyle]
11
+ )
11
12
 
12
13
  return hash ? { $$css: true, hash, injectedClassName } : undefined
13
14
  }
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useReducer, useRef, useState } from 'react'
2
- import { UnistylesRuntime, UnistylesShadowRegistry, type UnistylesMiniRuntime } from '../../specs'
2
+ import { type UnistylesMiniRuntime, UnistylesRuntime, UnistylesShadowRegistry } from '../../specs'
3
3
  // It's imported that way because of circular dependency
4
4
  import { UnistyleDependency } from '../../specs/NativePlatform'
5
5
  import type { UnistylesTheme } from '../../types'
@@ -26,8 +26,8 @@ const RTDependencyMap = {
26
26
  themeName: UnistyleDependency.ThemeName,
27
27
  } satisfies Partial<Record<keyof UnistylesMiniRuntime, UnistyleDependency>>
28
28
 
29
- export const useProxifiedUnistyles = () => {
30
- const scopedTheme = UnistylesShadowRegistry.getScopedTheme() as UnistylesTheme
29
+ export const useProxifiedUnistyles = (forcedTheme?: UnistylesTheme) => {
30
+ const scopedTheme = forcedTheme ?? UnistylesShadowRegistry.getScopedTheme() as UnistylesTheme
31
31
  const [dependencies] = useState(() => new Set<number>())
32
32
  const [theme, setTheme] = useState(UnistylesRuntime.getTheme(scopedTheme))
33
33
  const [_, runtimeChanged] = useReducer(() => ({}), {})
package/src/core/warn.ts CHANGED
@@ -4,7 +4,7 @@ export const maybeWarnAboutMultipleUnistyles = (style: ViewStyle, displayName =
4
4
  if (__DEV__ && style && !Array.isArray(style)) {
5
5
  const unistylesKeys = Object
6
6
  .keys(style)
7
- .filter(key => key.startsWith('unistyles-'))
7
+ .filter(key => key.startsWith('unistyles_'))
8
8
 
9
9
  if (unistylesKeys.length > 1) {
10
10
  console.warn(`Unistyles: we detected style object with ${unistylesKeys.length} unistyles styles. This might cause no updates or unpredictable behavior. Please check style prop for "${displayName}" and use array syntax instead of object syntax.`)
@@ -1,10 +1,11 @@
1
- import React, { forwardRef, useEffect, type ComponentType } from 'react'
2
- import type { UnistyleDependency } from '../../specs'
1
+ import React, { forwardRef, useEffect, type ComponentType, useRef } from 'react'
2
+ import { type UnistyleDependency, UnistylesShadowRegistry } from '../../specs'
3
+ import type { UnistylesTheme } from '../../types'
3
4
  import type { PartialBy } from '../../types/common'
4
5
  import { deepMergeObjects } from '../../utils'
5
- import type { Mappings, SupportedStyleProps } from './types'
6
- import { maybeWarnAboutMultipleUnistyles } from '../warn'
7
6
  import { useProxifiedUnistyles } from '../useProxifiedUnistyles'
7
+ import { maybeWarnAboutMultipleUnistyles } from '../warn'
8
+ import type { Mappings, SupportedStyleProps } from './types'
8
9
 
9
10
  // @ts-expect-error
10
11
  type GenericComponentProps<P> = ComponentProps<P>
@@ -19,7 +20,7 @@ export const withUnistyles = <TComponent, TMappings extends GenericComponentProp
19
20
  const getSecrets = (styleProps: Record<string, any> = {}): { uni__getStyles(): any, uni__dependencies: Array<UnistyleDependency> } => {
20
21
  const unistyleKey = Object
21
22
  .keys(styleProps)
22
- .find(key => key.startsWith('unistyles-'))
23
+ .find(key => key.startsWith('unistyles_'))
23
24
 
24
25
  return unistyleKey
25
26
  ? styleProps[unistyleKey]
@@ -38,7 +39,8 @@ export const withUnistyles = <TComponent, TMappings extends GenericComponentProp
38
39
  // @ts-ignore we don't know the type of the component
39
40
  maybeWarnAboutMultipleUnistyles(narrowedProps.contentContainerStyle, `withUnistyles(${Component.displayName ?? Component.name ?? 'Unknown'})`)
40
41
 
41
- const { proxifiedRuntime, proxifiedTheme, addDependencies } = useProxifiedUnistyles()
42
+ const scopedTheme = useRef(UnistylesShadowRegistry.getScopedTheme() as UnistylesTheme)
43
+ const { proxifiedRuntime, proxifiedTheme, addDependencies } = useProxifiedUnistyles(scopedTheme.current)
42
44
 
43
45
  useEffect(() => {
44
46
  const styleSecrets = getSecrets(narrowedProps.style)
@@ -1,11 +1,11 @@
1
1
  import React, { type ComponentType, forwardRef, type ComponentProps, type ComponentRef } from 'react'
2
+ import type { UnistylesValues } from '../../types'
2
3
  import type { PartialBy } from '../../types/common'
3
4
  import { deepMergeObjects } from '../../utils'
4
- import type { Mappings, SupportedStyleProps } from './types'
5
- import type { UnistylesValues } from '../../types'
6
5
  import { getClassName } from '../getClassname'
7
- import { maybeWarnAboutMultipleUnistyles } from '../warn'
8
6
  import { useProxifiedUnistyles } from '../useProxifiedUnistyles'
7
+ import { maybeWarnAboutMultipleUnistyles } from '../warn'
8
+ import type { Mappings, SupportedStyleProps } from './types'
9
9
 
10
10
  // @ts-expect-error
11
11
  type GenericComponentProps<T> = ComponentProps<T>
@@ -37,7 +37,7 @@ export const withUnistyles = <TComponent, TMappings extends GenericComponentProp
37
37
  style: styleClassNames,
38
38
  } : {},
39
39
  ...narrowedProps.contentContainerStyle ? {
40
- style: contentContainerStyleClassNames,
40
+ contentContainerStyle: contentContainerStyleClassNames,
41
41
  } : {},
42
42
  } as any
43
43
 
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useLayoutEffect, useState } from 'react'
2
+ import { isUnistylesMq, isValidMq, parseMq } from '../mq'
2
3
  import { StyleSheet, UnistyleDependency, UnistylesRuntime } from '../specs'
3
- import { isValidMq, parseMq, isUnistylesMq } from '../mq'
4
4
 
5
5
  export const useMedia = (config: { mq: symbol }) => {
6
6
  const computeIsVisible = (): boolean => {
package/src/mq.ts CHANGED
@@ -1,6 +1,6 @@
1
- import type { Nullable } from './types'
2
1
  import type { UnistylesBreakpoints } from './global'
3
2
  import { UnistylesRuntime } from './specs'
3
+ import type { Nullable } from './types'
4
4
 
5
5
  const IS_UNISTYLES_REGEX = /:([hw])\[(\d+)(?:,\s*(\d+|Infinity))?]/
6
6
  const UNISTYLES_WIDTH_REGEX = /:(w)\[(\d+)(?:,\s*(\d+|Infinity))?]/
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { StyleSheet } from 'react-native'
3
- import { error, isServer } from '../web/utils'
4
3
  import { UnistylesWeb } from '../web'
4
+ import { error, isServer } from '../web/utils'
5
5
  import { DefaultServerUnistylesSettings, type ServerUnistylesSettings } from './types'
6
6
 
7
7
  export const getServerUnistyles = ({ includeRNWStyles = true }: ServerUnistylesSettings = DefaultServerUnistylesSettings) => {
@@ -15,6 +15,7 @@ export const getServerUnistyles = ({ includeRNWStyles = true }: ServerUnistylesS
15
15
  return <>
16
16
  {rnwStyle && <style id='rnw-style'>{rnwStyle}</style>}
17
17
  <style id='unistyles-web'>{css}</style>
18
- <script id='unistyles-script'>{`window.__UNISTYLES_STATE__ = ${JSON.stringify(state)}`}</script>
18
+ {/* biome-ignore lint/security/noDangerouslySetInnerHtml: Needs the json quotes to be unescaped */}
19
+ <script id='unistyles-script' dangerouslySetInnerHTML={{ __html: `window.__UNISTYLES_STATE__ = ${JSON.stringify(state)}`}} />
19
20
  </>
20
21
  }
@@ -1,5 +1,5 @@
1
- import { error, isServer } from '../web/utils'
2
1
  import { UnistylesWeb } from '../web'
2
+ import { error, isServer } from '../web/utils'
3
3
 
4
4
  declare global {
5
5
  interface Window {
@@ -1,5 +1,5 @@
1
- import { error, isServer } from '../web/utils'
2
1
  import { UnistylesWeb } from '../web'
2
+ import { error, isServer } from '../web/utils'
3
3
 
4
4
  export const resetServerUnistyles = () => {
5
5
  if (!isServer()) {
@@ -1,9 +1,9 @@
1
1
  import React, { useRef } from 'react'
2
2
  import { isServer } from '../web/utils'
3
- import { DefaultServerUnistylesSettings, type ServerUnistylesSettings } from './types'
4
3
  import { getServerUnistyles } from './getServerUnistyles'
5
- import { resetServerUnistyles } from './resetServerUnistyles'
6
4
  import { hydrateServerUnistyles } from './hydrateServerUnistyles'
5
+ import { resetServerUnistyles } from './resetServerUnistyles'
6
+ import { DefaultServerUnistylesSettings, type ServerUnistylesSettings } from './types'
7
7
 
8
8
  export const useServerUnistyles = (settings: ServerUnistylesSettings = DefaultServerUnistylesSettings): React.ReactNode | null => {
9
9
  const isServerInserted = useRef(false)
@@ -1,6 +1,6 @@
1
1
  import { StatusBar as NativeStatusBar } from 'react-native'
2
- import type { UnistylesStatusBar as UnistylesStatusBarSpec } from './UnistylesStatusBar.nitro'
3
2
  import { StatusBarStyle } from '../types'
3
+ import type { UnistylesStatusBar as UnistylesStatusBarSpec } from './UnistylesStatusBar.nitro'
4
4
 
5
5
  export type StatusBarHiddenAnimation = 'none' | 'fade' | 'slide'
6
6
 
@@ -1,9 +1,9 @@
1
- import { NitroModules } from 'react-native-nitro-modules'
2
- import { processColor, StyleSheet as NativeStyleSheet } from 'react-native'
1
+ import { StyleSheet as NativeStyleSheet, processColor } from 'react-native'
3
2
  import type { StyleSheet as NativeStyleSheetType } from 'react-native'
4
- import type { UnistylesStyleSheet as UnistylesStyleSheetSpec } from './UnistylesStyleSheet.nitro'
3
+ import { NitroModules } from 'react-native-nitro-modules'
5
4
  import type { UnistylesBreakpoints, UnistylesThemes } from '../../global'
6
5
  import type { CreateUnistylesStyleSheet } from '../../types'
6
+ import type { UnistylesStyleSheet as UnistylesStyleSheetSpec } from './UnistylesStyleSheet.nitro'
7
7
 
8
8
  type UnistylesThemeSettings = {
9
9
  initialTheme: (() => keyof UnistylesThemes) | keyof UnistylesThemes
@@ -12,7 +12,8 @@ type UnistylesThemeSettings = {
12
12
  }
13
13
 
14
14
  type UnistylesSettings = UnistylesThemeSettings & {
15
- CSSVars?: boolean
15
+ CSSVars?: boolean,
16
+ nativeBreakpointsMode?: 'pixels' | 'points'
16
17
  }
17
18
 
18
19
  export type UnistylesConfig = {
@@ -1,7 +1,7 @@
1
1
  import type { HybridObject } from 'react-native-nitro-modules'
2
- import type { AppBreakpoint, AppThemeName, Dimensions, Insets } from '../types'
3
2
  import type { AndroidContentSizeCategory, IOSContentSizeCategory, WebContentSizeCategory } from '../../types'
4
3
  import type { UnistylesNativeMiniRuntime } from '../NativePlatform'
4
+ import type { AppBreakpoint, AppThemeName, Dimensions, Insets } from '../types'
5
5
 
6
6
  type ColorScheme = 'light' | 'dark' | 'unspecified'
7
7
  type Orientation = 'portrait' | 'landscape'
@@ -1,12 +1,12 @@
1
1
  import { processColor } from 'react-native'
2
2
  import { NitroModules } from 'react-native-nitro-modules'
3
- import type { UnistylesRuntime as UnistylesRuntimeSpec, UnistylesMiniRuntime } from './UnistylesRuntime.nitro'
4
- import type { AppBreakpoint, AppTheme, AppThemeName, Color, ColorScheme, Orientation } from '../types'
5
- import { attachStatusBarJSMethods, type UnistylesStatusBar } from '../StatusBar'
6
- import type { UnistylesNavigationBar } from '../NavigtionBar'
7
- import type { AndroidContentSizeCategory, IOSContentSizeCategory, UnistylesTheme } from '../../types'
8
3
  import { isIOS } from '../../common'
9
4
  import type { UnistylesThemes } from '../../global'
5
+ import type { AndroidContentSizeCategory, IOSContentSizeCategory, UnistylesTheme } from '../../types'
6
+ import type { UnistylesNavigationBar } from '../NavigtionBar'
7
+ import { type UnistylesStatusBar, attachStatusBarJSMethods } from '../StatusBar'
8
+ import type { AppBreakpoint, AppTheme, AppThemeName, Color, ColorScheme, Orientation } from '../types'
9
+ import type { UnistylesMiniRuntime, UnistylesRuntime as UnistylesRuntimeSpec } from './UnistylesRuntime.nitro'
10
10
 
11
11
  export interface UnistylesRuntimePrivate extends Omit<UnistylesRuntimeSpec, 'setRootViewBackgroundColor'> {
12
12
  readonly colorScheme: ColorScheme,