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

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 (496) hide show
  1. package/README.md +6 -3
  2. package/android/src/main/cxx/NativeUnistylesModule.cpp +1 -1
  3. package/android/src/main/cxx/NativeUnistylesModule.h +1 -1
  4. package/components/native/ActivityIndicator/package.json +2 -1
  5. package/components/native/FlatList/package.json +2 -1
  6. package/components/native/Image/package.json +2 -1
  7. package/components/native/ImageBackground/package.json +2 -1
  8. package/components/native/KeyboardAvoidingView/package.json +2 -1
  9. package/components/native/Pressable/package.json +1 -1
  10. package/components/native/RefreshControl/package.json +2 -1
  11. package/components/native/ScrollView/package.json +2 -1
  12. package/components/native/SectionList/package.json +2 -1
  13. package/components/native/Switch/package.json +2 -1
  14. package/components/native/Text/package.json +2 -1
  15. package/components/native/TextInput/package.json +2 -1
  16. package/components/native/TouchableHighlight/package.json +2 -1
  17. package/components/native/TouchableOpacity/package.json +2 -1
  18. package/components/native/View/package.json +2 -1
  19. package/components/native/VirtualizedList/package.json +2 -1
  20. package/cxx/common/Constants.h +4 -4
  21. package/cxx/common/Helpers.h +1 -1
  22. package/cxx/core/HashGenerator.cpp +23 -0
  23. package/cxx/core/HashGenerator.h +13 -0
  24. package/cxx/core/HostUnistyle.cpp +83 -0
  25. package/cxx/core/HostUnistyle.h +27 -0
  26. package/cxx/core/RNStyle.h +18 -0
  27. package/cxx/core/Unistyle.h +9 -4
  28. package/cxx/core/UnistyleWrapper.h +92 -47
  29. package/cxx/core/UnistylesRegistry.cpp +19 -11
  30. package/cxx/core/UnistylesRegistry.h +2 -4
  31. package/cxx/hybridObjects/HybridNavigationBar.cpp +3 -3
  32. package/cxx/hybridObjects/HybridNavigationBar.h +2 -2
  33. package/cxx/hybridObjects/HybridShadowRegistry.cpp +32 -45
  34. package/cxx/hybridObjects/HybridShadowRegistry.h +0 -10
  35. package/cxx/hybridObjects/HybridStatusBar.cpp +3 -3
  36. package/cxx/hybridObjects/HybridStatusBar.h +2 -2
  37. package/cxx/hybridObjects/HybridStyleSheet.cpp +25 -8
  38. package/cxx/hybridObjects/HybridStyleSheet.h +2 -1
  39. package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +15 -15
  40. package/cxx/hybridObjects/HybridUnistylesRuntime.h +2 -2
  41. package/cxx/parser/Parser.cpp +17 -24
  42. package/cxx/parser/Parser.h +2 -1
  43. package/ios/NativePlatform+ios.swift +5 -7
  44. package/ios/NativePlatform.swift +2 -2
  45. package/ios/UnistylesModuleOnLoad.mm +2 -1
  46. package/lib/commonjs/components/ScopedTheme.js.map +1 -1
  47. package/lib/commonjs/components/index.js +0 -7
  48. package/lib/commonjs/components/index.js.map +1 -1
  49. package/lib/commonjs/components/native/ImageBackground.js +45 -1
  50. package/lib/commonjs/components/native/ImageBackground.js.map +1 -1
  51. package/lib/commonjs/components/native/ImageBackground.native.js +10 -0
  52. package/lib/commonjs/components/native/ImageBackground.native.js.map +1 -0
  53. package/lib/commonjs/components/native/Pressable.js +26 -51
  54. package/lib/commonjs/components/native/Pressable.js.map +1 -1
  55. package/lib/commonjs/components/native/Pressable.native.js +14 -11
  56. package/lib/commonjs/components/native/Pressable.native.js.map +1 -1
  57. package/lib/commonjs/core/createUnistylesElement.js +29 -5
  58. package/lib/commonjs/core/createUnistylesElement.js.map +1 -1
  59. package/lib/commonjs/core/createUnistylesElement.native.js +40 -0
  60. package/lib/commonjs/core/createUnistylesElement.native.js.map +1 -0
  61. package/lib/commonjs/core/createUnistylesImageBackground.js +36 -14
  62. package/lib/commonjs/core/createUnistylesImageBackground.js.map +1 -1
  63. package/lib/commonjs/core/getClassname.js +25 -0
  64. package/lib/commonjs/core/getClassname.js.map +1 -0
  65. package/lib/commonjs/core/getClassname.native.js +9 -0
  66. package/lib/commonjs/core/getClassname.native.js.map +1 -0
  67. package/lib/commonjs/core/index.js +14 -7
  68. package/lib/commonjs/core/index.js.map +1 -1
  69. package/lib/commonjs/core/passForwardRef.js +2 -2
  70. package/lib/commonjs/core/passForwardRef.js.map +1 -1
  71. package/lib/commonjs/core/useProxifiedUnistyles/index.js +13 -0
  72. package/lib/commonjs/core/useProxifiedUnistyles/index.js.map +1 -0
  73. package/lib/commonjs/core/useProxifiedUnistyles/listener.js +22 -0
  74. package/lib/commonjs/core/useProxifiedUnistyles/listener.js.map +1 -0
  75. package/lib/commonjs/core/useProxifiedUnistyles/listener.native.js +26 -0
  76. package/lib/commonjs/core/useProxifiedUnistyles/listener.native.js.map +1 -0
  77. package/lib/commonjs/core/useProxifiedUnistyles/types.js +6 -0
  78. package/lib/commonjs/core/useProxifiedUnistyles/types.js.map +1 -0
  79. package/lib/commonjs/core/{withUnistyles/useDependencies.js → useProxifiedUnistyles/useProxifiedUnistyles.js} +22 -22
  80. package/lib/commonjs/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -0
  81. package/lib/commonjs/core/useUnistyles.js +19 -0
  82. package/lib/commonjs/core/useUnistyles.js.map +1 -0
  83. package/lib/commonjs/core/warn.js +16 -0
  84. package/lib/commonjs/core/warn.js.map +1 -0
  85. package/lib/commonjs/core/withUnistyles/withUnistyles.js +19 -55
  86. package/lib/commonjs/core/withUnistyles/withUnistyles.js.map +1 -1
  87. package/lib/commonjs/core/withUnistyles/withUnistyles.native.js +32 -65
  88. package/lib/commonjs/core/withUnistyles/withUnistyles.native.js.map +1 -1
  89. package/lib/commonjs/index.js +23 -4
  90. package/lib/commonjs/index.js.map +1 -1
  91. package/lib/commonjs/server/getServerUnistyles.js +38 -0
  92. package/lib/commonjs/server/getServerUnistyles.js.map +1 -0
  93. package/lib/commonjs/server/hydrateServerUnistyles.js +17 -0
  94. package/lib/commonjs/server/hydrateServerUnistyles.js.map +1 -0
  95. package/lib/commonjs/server/index.js +34 -0
  96. package/lib/commonjs/server/index.js.map +1 -0
  97. package/lib/commonjs/server/resetServerUnistyles.js +16 -0
  98. package/lib/commonjs/server/resetServerUnistyles.js.map +1 -0
  99. package/lib/commonjs/server/types.js +8 -0
  100. package/lib/commonjs/server/types.js.map +1 -0
  101. package/lib/commonjs/server/useServerUnistyles.js +27 -0
  102. package/lib/commonjs/server/useServerUnistyles.js.map +1 -0
  103. package/lib/commonjs/specs/ShadowRegistry/index.js +6 -3
  104. package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
  105. package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
  106. package/lib/commonjs/utils.js +4 -2
  107. package/lib/commonjs/utils.js.map +1 -1
  108. package/lib/commonjs/web/convert/object/filter.js +2 -2
  109. package/lib/commonjs/web/convert/object/filter.js.map +1 -1
  110. package/lib/commonjs/web/convert/style.js +4 -4
  111. package/lib/commonjs/web/convert/style.js.map +1 -1
  112. package/lib/commonjs/web/create.js +20 -15
  113. package/lib/commonjs/web/create.js.map +1 -1
  114. package/lib/commonjs/web/css/core.js +55 -0
  115. package/lib/commonjs/web/css/core.js.map +1 -0
  116. package/lib/commonjs/web/css/index.js +17 -0
  117. package/lib/commonjs/web/css/index.js.map +1 -0
  118. package/lib/commonjs/web/css/state.js +155 -0
  119. package/lib/commonjs/web/css/state.js.map +1 -0
  120. package/lib/commonjs/web/css/utils.js +47 -0
  121. package/lib/commonjs/web/css/utils.js.map +1 -0
  122. package/lib/commonjs/web/index.js +14 -18
  123. package/lib/commonjs/web/index.js.map +1 -1
  124. package/lib/commonjs/web/listener.js +9 -7
  125. package/lib/commonjs/web/listener.js.map +1 -1
  126. package/lib/commonjs/web/registry.js +44 -123
  127. package/lib/commonjs/web/registry.js.map +1 -1
  128. package/lib/commonjs/web/runtime.js +28 -21
  129. package/lib/commonjs/web/runtime.js.map +1 -1
  130. package/lib/commonjs/web/services.js +28 -0
  131. package/lib/commonjs/web/services.js.map +1 -0
  132. package/lib/commonjs/web/shadowRegistry.js +46 -93
  133. package/lib/commonjs/web/shadowRegistry.js.map +1 -1
  134. package/lib/commonjs/web/state.js +39 -9
  135. package/lib/commonjs/web/state.js.map +1 -1
  136. package/lib/commonjs/web/types.js +6 -0
  137. package/lib/commonjs/web/types.js.map +1 -0
  138. package/lib/commonjs/web/utils/common.js +29 -9
  139. package/lib/commonjs/web/utils/common.js.map +1 -1
  140. package/lib/commonjs/web/utils/unistyle.js +28 -19
  141. package/lib/commonjs/web/utils/unistyle.js.map +1 -1
  142. package/lib/commonjs/web/variants.js +25 -27
  143. package/lib/commonjs/web/variants.js.map +1 -1
  144. package/lib/module/components/ScopedTheme.js.map +1 -1
  145. package/lib/module/components/index.js +0 -1
  146. package/lib/module/components/index.js.map +1 -1
  147. package/lib/module/components/native/ImageBackground.js +45 -2
  148. package/lib/module/components/native/ImageBackground.js.map +1 -1
  149. package/lib/module/components/native/ImageBackground.native.js +6 -0
  150. package/lib/module/components/native/ImageBackground.native.js.map +1 -0
  151. package/lib/module/components/native/Pressable.js +27 -52
  152. package/lib/module/components/native/Pressable.js.map +1 -1
  153. package/lib/module/components/native/Pressable.native.js +15 -12
  154. package/lib/module/components/native/Pressable.native.js.map +1 -1
  155. package/lib/module/core/createUnistylesElement.js +29 -5
  156. package/lib/module/core/createUnistylesElement.js.map +1 -1
  157. package/lib/module/core/createUnistylesElement.native.js +33 -0
  158. package/lib/module/core/createUnistylesElement.native.js.map +1 -0
  159. package/lib/module/core/createUnistylesImageBackground.js +34 -13
  160. package/lib/module/core/createUnistylesImageBackground.js.map +1 -1
  161. package/lib/module/core/getClassname.js +20 -0
  162. package/lib/module/core/getClassname.js.map +1 -0
  163. package/lib/module/core/getClassname.native.js +4 -0
  164. package/lib/module/core/getClassname.native.js.map +1 -0
  165. package/lib/module/core/index.js +2 -1
  166. package/lib/module/core/index.js.map +1 -1
  167. package/lib/module/core/passForwardRef.js +2 -2
  168. package/lib/module/core/passForwardRef.js.map +1 -1
  169. package/lib/module/core/useProxifiedUnistyles/index.js +4 -0
  170. package/lib/module/core/useProxifiedUnistyles/index.js.map +1 -0
  171. package/lib/module/core/useProxifiedUnistyles/listener.js +17 -0
  172. package/lib/module/core/useProxifiedUnistyles/listener.js.map +1 -0
  173. package/lib/module/core/useProxifiedUnistyles/listener.native.js +21 -0
  174. package/lib/module/core/useProxifiedUnistyles/listener.native.js.map +1 -0
  175. package/lib/module/core/useProxifiedUnistyles/types.js +4 -0
  176. package/lib/module/core/useProxifiedUnistyles/types.js.map +1 -0
  177. package/lib/module/core/{withUnistyles/useDependencies.js → useProxifiedUnistyles/useProxifiedUnistyles.js} +19 -19
  178. package/lib/module/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -0
  179. package/lib/module/core/useUnistyles.js +14 -0
  180. package/lib/module/core/useUnistyles.js.map +1 -0
  181. package/lib/module/core/warn.js +11 -0
  182. package/lib/module/core/warn.js.map +1 -0
  183. package/lib/module/core/withUnistyles/withUnistyles.js +19 -55
  184. package/lib/module/core/withUnistyles/withUnistyles.js.map +1 -1
  185. package/lib/module/core/withUnistyles/withUnistyles.native.js +33 -66
  186. package/lib/module/core/withUnistyles/withUnistyles.native.js.map +1 -1
  187. package/lib/module/index.js +3 -2
  188. package/lib/module/index.js.map +1 -1
  189. package/lib/module/server/getServerUnistyles.js +32 -0
  190. package/lib/module/server/getServerUnistyles.js.map +1 -0
  191. package/lib/module/server/hydrateServerUnistyles.js +12 -0
  192. package/lib/module/server/hydrateServerUnistyles.js.map +1 -0
  193. package/lib/module/server/index.js +7 -0
  194. package/lib/module/server/index.js.map +1 -0
  195. package/lib/module/server/resetServerUnistyles.js +11 -0
  196. package/lib/module/server/resetServerUnistyles.js.map +1 -0
  197. package/lib/module/server/types.js +4 -0
  198. package/lib/module/server/types.js.map +1 -0
  199. package/lib/module/server/useServerUnistyles.js +22 -0
  200. package/lib/module/server/useServerUnistyles.js.map +1 -0
  201. package/lib/module/specs/ShadowRegistry/index.js +6 -3
  202. package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
  203. package/lib/module/specs/StyleSheet/index.js.map +1 -1
  204. package/lib/module/utils.js +2 -1
  205. package/lib/module/utils.js.map +1 -1
  206. package/lib/module/web/convert/object/filter.js +2 -2
  207. package/lib/module/web/convert/object/filter.js.map +1 -1
  208. package/lib/module/web/convert/style.js +4 -4
  209. package/lib/module/web/convert/style.js.map +1 -1
  210. package/lib/module/web/create.js +20 -15
  211. package/lib/module/web/create.js.map +1 -1
  212. package/lib/module/web/css/core.js +50 -0
  213. package/lib/module/web/css/core.js.map +1 -0
  214. package/lib/module/web/css/index.js +4 -0
  215. package/lib/module/web/css/index.js.map +1 -0
  216. package/lib/module/web/css/state.js +150 -0
  217. package/lib/module/web/css/state.js.map +1 -0
  218. package/lib/module/web/css/utils.js +41 -0
  219. package/lib/module/web/css/utils.js.map +1 -0
  220. package/lib/module/web/index.js +10 -5
  221. package/lib/module/web/index.js.map +1 -1
  222. package/lib/module/web/listener.js +8 -7
  223. package/lib/module/web/listener.js.map +1 -1
  224. package/lib/module/web/registry.js +44 -124
  225. package/lib/module/web/registry.js.map +1 -1
  226. package/lib/module/web/runtime.js +27 -21
  227. package/lib/module/web/runtime.js.map +1 -1
  228. package/lib/module/web/services.js +23 -0
  229. package/lib/module/web/services.js.map +1 -0
  230. package/lib/module/web/shadowRegistry.js +46 -94
  231. package/lib/module/web/shadowRegistry.js.map +1 -1
  232. package/lib/module/web/state.js +39 -10
  233. package/lib/module/web/state.js.map +1 -1
  234. package/lib/module/web/types.js +4 -0
  235. package/lib/module/web/types.js.map +1 -0
  236. package/lib/module/web/utils/common.js +26 -7
  237. package/lib/module/web/utils/common.js.map +1 -1
  238. package/lib/module/web/utils/unistyle.js +27 -17
  239. package/lib/module/web/utils/unistyle.js.map +1 -1
  240. package/lib/module/web/variants.js +25 -27
  241. package/lib/module/web/variants.js.map +1 -1
  242. package/lib/typescript/src/components/index.d.ts +0 -1
  243. package/lib/typescript/src/components/index.d.ts.map +1 -1
  244. package/lib/typescript/src/components/native/ActivityIndicator.d.ts +3 -1
  245. package/lib/typescript/src/components/native/ActivityIndicator.d.ts.map +1 -1
  246. package/lib/typescript/src/components/native/FlatList.d.ts +3 -1
  247. package/lib/typescript/src/components/native/FlatList.d.ts.map +1 -1
  248. package/lib/typescript/src/components/native/Image.d.ts +3 -1
  249. package/lib/typescript/src/components/native/Image.d.ts.map +1 -1
  250. package/lib/typescript/src/components/native/ImageBackground.d.ts +8 -2
  251. package/lib/typescript/src/components/native/ImageBackground.d.ts.map +1 -1
  252. package/lib/typescript/src/components/native/ImageBackground.native.d.ts +3 -0
  253. package/lib/typescript/src/components/native/ImageBackground.native.d.ts.map +1 -0
  254. package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts +3 -1
  255. package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts.map +1 -1
  256. package/lib/typescript/src/components/native/Pressable.d.ts +3 -2
  257. package/lib/typescript/src/components/native/Pressable.d.ts.map +1 -1
  258. package/lib/typescript/src/components/native/Pressable.native.d.ts.map +1 -1
  259. package/lib/typescript/src/components/native/RefreshControl.d.ts +3 -1
  260. package/lib/typescript/src/components/native/RefreshControl.d.ts.map +1 -1
  261. package/lib/typescript/src/components/native/ScrollView.d.ts +3 -1
  262. package/lib/typescript/src/components/native/ScrollView.d.ts.map +1 -1
  263. package/lib/typescript/src/components/native/SectionList.d.ts +3 -1
  264. package/lib/typescript/src/components/native/SectionList.d.ts.map +1 -1
  265. package/lib/typescript/src/components/native/Switch.d.ts +3 -1
  266. package/lib/typescript/src/components/native/Switch.d.ts.map +1 -1
  267. package/lib/typescript/src/components/native/Text.d.ts +3 -1
  268. package/lib/typescript/src/components/native/Text.d.ts.map +1 -1
  269. package/lib/typescript/src/components/native/TextInput.d.ts +3 -1
  270. package/lib/typescript/src/components/native/TextInput.d.ts.map +1 -1
  271. package/lib/typescript/src/components/native/TouchableHighlight.d.ts +3 -1
  272. package/lib/typescript/src/components/native/TouchableHighlight.d.ts.map +1 -1
  273. package/lib/typescript/src/components/native/TouchableOpacity.d.ts +3 -1
  274. package/lib/typescript/src/components/native/TouchableOpacity.d.ts.map +1 -1
  275. package/lib/typescript/src/components/native/View.d.ts +3 -1
  276. package/lib/typescript/src/components/native/View.d.ts.map +1 -1
  277. package/lib/typescript/src/components/native/VirtualizedList.d.ts +3 -1
  278. package/lib/typescript/src/components/native/VirtualizedList.d.ts.map +1 -1
  279. package/lib/typescript/src/core/createUnistylesElement.d.ts +6 -1
  280. package/lib/typescript/src/core/createUnistylesElement.d.ts.map +1 -1
  281. package/lib/typescript/src/core/createUnistylesElement.native.d.ts +3 -0
  282. package/lib/typescript/src/core/createUnistylesElement.native.d.ts.map +1 -0
  283. package/lib/typescript/src/core/createUnistylesImageBackground.d.ts.map +1 -1
  284. package/lib/typescript/src/core/getClassname.d.ts +7 -0
  285. package/lib/typescript/src/core/getClassname.d.ts.map +1 -0
  286. package/lib/typescript/src/core/getClassname.native.d.ts +2 -0
  287. package/lib/typescript/src/core/getClassname.native.d.ts.map +1 -0
  288. package/lib/typescript/src/core/index.d.ts +2 -1
  289. package/lib/typescript/src/core/index.d.ts.map +1 -1
  290. package/lib/typescript/src/core/passForwardRef.d.ts.map +1 -1
  291. package/lib/typescript/src/core/useProxifiedUnistyles/index.d.ts +2 -0
  292. package/lib/typescript/src/core/useProxifiedUnistyles/index.d.ts.map +1 -0
  293. package/lib/typescript/src/core/useProxifiedUnistyles/listener.d.ts +3 -0
  294. package/lib/typescript/src/core/useProxifiedUnistyles/listener.d.ts.map +1 -0
  295. package/lib/typescript/src/core/useProxifiedUnistyles/listener.native.d.ts +3 -0
  296. package/lib/typescript/src/core/useProxifiedUnistyles/listener.native.d.ts.map +1 -0
  297. package/lib/typescript/src/core/useProxifiedUnistyles/types.d.ts +7 -0
  298. package/lib/typescript/src/core/useProxifiedUnistyles/types.d.ts.map +1 -0
  299. package/lib/typescript/src/core/useProxifiedUnistyles/useProxifiedUnistyles.d.ts +8 -0
  300. package/lib/typescript/src/core/useProxifiedUnistyles/useProxifiedUnistyles.d.ts.map +1 -0
  301. package/lib/typescript/src/core/useUnistyles.d.ts +6 -0
  302. package/lib/typescript/src/core/useUnistyles.d.ts.map +1 -0
  303. package/lib/typescript/src/core/warn.d.ts +3 -0
  304. package/lib/typescript/src/core/warn.d.ts.map +1 -0
  305. package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts +0 -3
  306. package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts.map +1 -1
  307. package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts.map +1 -1
  308. package/lib/typescript/src/index.d.ts +3 -2
  309. package/lib/typescript/src/index.d.ts.map +1 -1
  310. package/lib/typescript/src/server/getServerUnistyles.d.ts +4 -0
  311. package/lib/typescript/src/server/getServerUnistyles.d.ts.map +1 -0
  312. package/lib/typescript/src/server/hydrateServerUnistyles.d.ts +8 -0
  313. package/lib/typescript/src/server/hydrateServerUnistyles.d.ts.map +1 -0
  314. package/lib/typescript/src/server/index.d.ts +5 -0
  315. package/lib/typescript/src/server/index.d.ts.map +1 -0
  316. package/lib/typescript/src/server/resetServerUnistyles.d.ts +2 -0
  317. package/lib/typescript/src/server/resetServerUnistyles.d.ts.map +1 -0
  318. package/lib/typescript/src/server/types.d.ts +5 -0
  319. package/lib/typescript/src/server/types.d.ts.map +1 -0
  320. package/lib/typescript/src/server/useServerUnistyles.d.ts +4 -0
  321. package/lib/typescript/src/server/useServerUnistyles.d.ts.map +1 -0
  322. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +0 -3
  323. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
  324. package/lib/typescript/src/specs/StyleSheet/index.d.ts +4 -1
  325. package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
  326. package/lib/typescript/src/utils.d.ts +1 -0
  327. package/lib/typescript/src/utils.d.ts.map +1 -1
  328. package/lib/typescript/src/web/convert/style.d.ts.map +1 -1
  329. package/lib/typescript/src/web/create.d.ts.map +1 -1
  330. package/lib/typescript/src/web/css/core.d.ts +3 -0
  331. package/lib/typescript/src/web/css/core.d.ts.map +1 -0
  332. package/lib/typescript/src/web/css/index.d.ts +2 -0
  333. package/lib/typescript/src/web/css/index.d.ts.map +1 -0
  334. package/lib/typescript/src/web/css/state.d.ts +30 -0
  335. package/lib/typescript/src/web/css/state.d.ts.map +1 -0
  336. package/lib/typescript/src/web/css/utils.d.ts +4 -0
  337. package/lib/typescript/src/web/css/utils.d.ts.map +1 -0
  338. package/lib/typescript/src/web/index.d.ts +7 -1
  339. package/lib/typescript/src/web/index.d.ts.map +1 -1
  340. package/lib/typescript/src/web/listener.d.ts +4 -3
  341. package/lib/typescript/src/web/listener.d.ts.map +1 -1
  342. package/lib/typescript/src/web/registry.d.ts +11 -8
  343. package/lib/typescript/src/web/registry.d.ts.map +1 -1
  344. package/lib/typescript/src/web/runtime.d.ts +6 -4
  345. package/lib/typescript/src/web/runtime.d.ts.map +1 -1
  346. package/lib/typescript/src/web/services.d.ts +15 -0
  347. package/lib/typescript/src/web/services.d.ts.map +1 -0
  348. package/lib/typescript/src/web/shadowRegistry.d.ts +10 -13
  349. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
  350. package/lib/typescript/src/web/state.d.ts +7 -3
  351. package/lib/typescript/src/web/state.d.ts.map +1 -1
  352. package/lib/typescript/src/web/types.d.ts +13 -0
  353. package/lib/typescript/src/web/types.d.ts.map +1 -0
  354. package/lib/typescript/src/web/utils/common.d.ts +2 -1
  355. package/lib/typescript/src/web/utils/common.d.ts.map +1 -1
  356. package/lib/typescript/src/web/utils/unistyle.d.ts +5 -4
  357. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
  358. package/lib/typescript/src/web/variants.d.ts +2 -2
  359. package/lib/typescript/src/web/variants.d.ts.map +1 -1
  360. package/nitrogen/generated/android/c++/JColorScheme.hpp +2 -1
  361. package/nitrogen/generated/android/c++/JDimensions.hpp +2 -1
  362. package/nitrogen/generated/android/c++/JFunc_void_UnistylesNativeMiniRuntime.hpp +36 -10
  363. package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp +53 -19
  364. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +5 -5
  365. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +1 -1
  366. package/nitrogen/generated/android/c++/JInsets.hpp +2 -1
  367. package/nitrogen/generated/android/c++/JOrientation.hpp +2 -1
  368. package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +2 -1
  369. package/nitrogen/generated/android/c++/JUnistylesNativeMiniRuntime.hpp +2 -1
  370. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/ColorScheme.kt +1 -1
  371. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Dimensions.kt +10 -5
  372. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_UnistylesNativeMiniRuntime.kt +43 -14
  373. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.kt +43 -14
  374. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +10 -10
  375. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Insets.kt +13 -8
  376. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Orientation.kt +1 -1
  377. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistyleDependency.kt +1 -1
  378. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt +19 -14
  379. package/nitrogen/generated/android/unistyles+autolinking.cmake +4 -1
  380. package/nitrogen/generated/android/unistyles+autolinking.gradle +1 -1
  381. package/nitrogen/generated/android/unistylesOnLoad.cpp +7 -3
  382. package/nitrogen/generated/android/unistylesOnLoad.hpp +1 -1
  383. package/nitrogen/generated/ios/Unistyles+autolinking.rb +1 -1
  384. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +21 -6
  385. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +105 -27
  386. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +5 -3
  387. package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.cpp +1 -1
  388. package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +92 -33
  389. package/nitrogen/generated/ios/swift/ColorScheme.swift +1 -1
  390. package/nitrogen/generated/ios/swift/Dimensions.swift +1 -1
  391. package/nitrogen/generated/ios/swift/Func_void_UnistylesNativeMiniRuntime.swift +46 -0
  392. package/nitrogen/generated/ios/swift/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.swift +46 -0
  393. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +36 -23
  394. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec_cxx.swift +327 -0
  395. package/nitrogen/generated/ios/swift/Insets.swift +1 -1
  396. package/nitrogen/generated/ios/swift/Orientation.swift +1 -1
  397. package/nitrogen/generated/ios/swift/UnistyleDependency.swift +1 -1
  398. package/nitrogen/generated/ios/swift/UnistylesNativeMiniRuntime.swift +1 -1
  399. package/nitrogen/generated/shared/c++/ColorScheme.hpp +1 -1
  400. package/nitrogen/generated/shared/c++/Dimensions.hpp +1 -1
  401. package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +1 -1
  402. package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +1 -1
  403. package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.cpp +1 -1
  404. package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +1 -1
  405. package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.cpp +1 -1
  406. package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.hpp +1 -1
  407. package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.cpp +1 -1
  408. package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.hpp +1 -1
  409. package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.cpp +1 -1
  410. package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +1 -1
  411. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -1
  412. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +1 -1
  413. package/nitrogen/generated/shared/c++/Insets.hpp +1 -1
  414. package/nitrogen/generated/shared/c++/Orientation.hpp +1 -1
  415. package/nitrogen/generated/shared/c++/UnistyleDependency.hpp +2 -2
  416. package/nitrogen/generated/shared/c++/UnistylesCxxMiniRuntime.hpp +1 -1
  417. package/nitrogen/generated/shared/c++/UnistylesNativeMiniRuntime.hpp +1 -1
  418. package/package.json +21 -12
  419. package/plugin/import.js +1 -21
  420. package/plugin/index.d.ts +41 -0
  421. package/plugin/index.js +44 -76
  422. package/plugin/stylesheet.js +17 -1
  423. package/plugin/variants.js +49 -75
  424. package/src/components/ScopedTheme.tsx +1 -1
  425. package/src/components/index.ts +0 -1
  426. package/src/components/native/ImageBackground.native.tsx +4 -0
  427. package/src/components/native/ImageBackground.tsx +54 -2
  428. package/src/components/native/Pressable.native.tsx +16 -17
  429. package/src/components/native/Pressable.tsx +35 -69
  430. package/src/core/createUnistylesElement.native.tsx +36 -0
  431. package/src/core/createUnistylesElement.tsx +42 -8
  432. package/src/core/createUnistylesImageBackground.tsx +40 -19
  433. package/src/core/getClassname.native.ts +1 -0
  434. package/src/core/getClassname.ts +13 -0
  435. package/src/core/index.ts +2 -1
  436. package/src/core/passForwardRef.ts +1 -2
  437. package/src/core/useProxifiedUnistyles/index.ts +1 -0
  438. package/src/core/useProxifiedUnistyles/listener.native.ts +18 -0
  439. package/src/core/useProxifiedUnistyles/listener.ts +13 -0
  440. package/src/core/useProxifiedUnistyles/types.ts +7 -0
  441. package/src/core/{withUnistyles/useDependencies.ts → useProxifiedUnistyles/useProxifiedUnistyles.ts} +19 -26
  442. package/src/core/useUnistyles.ts +11 -0
  443. package/src/core/warn.ts +13 -0
  444. package/src/core/withUnistyles/withUnistyles.native.tsx +39 -68
  445. package/src/core/withUnistyles/withUnistyles.tsx +19 -56
  446. package/src/index.ts +3 -2
  447. package/src/server/getServerUnistyles.tsx +20 -0
  448. package/src/server/hydrateServerUnistyles.ts +17 -0
  449. package/src/server/index.ts +5 -0
  450. package/src/server/resetServerUnistyles.ts +9 -0
  451. package/src/server/types.ts +4 -0
  452. package/src/server/useServerUnistyles.tsx +22 -0
  453. package/src/specs/ShadowRegistry/index.ts +12 -9
  454. package/src/specs/StyleSheet/index.ts +5 -1
  455. package/src/utils.ts +15 -11
  456. package/src/web/convert/object/filter.ts +2 -2
  457. package/src/web/convert/style.ts +8 -7
  458. package/src/web/create.ts +23 -18
  459. package/src/web/css/core.ts +58 -0
  460. package/src/web/css/index.ts +1 -0
  461. package/src/web/css/state.ts +191 -0
  462. package/src/web/css/utils.ts +54 -0
  463. package/src/web/index.ts +18 -5
  464. package/src/web/listener.ts +8 -8
  465. package/src/web/registry.ts +47 -152
  466. package/src/web/runtime.ts +32 -22
  467. package/src/web/services.ts +28 -0
  468. package/src/web/shadowRegistry.ts +46 -104
  469. package/src/web/state.ts +46 -11
  470. package/src/web/types.ts +13 -0
  471. package/src/web/utils/common.ts +32 -8
  472. package/src/web/utils/unistyle.ts +40 -25
  473. package/src/web/variants.ts +27 -27
  474. package/cxx/core/HostStyle.cpp +0 -73
  475. package/cxx/core/HostStyle.h +0 -34
  476. package/lib/commonjs/components/Variants.js +0 -36
  477. package/lib/commonjs/components/Variants.js.map +0 -1
  478. package/lib/commonjs/core/createUnistylesComponent.js +0 -16
  479. package/lib/commonjs/core/createUnistylesComponent.js.map +0 -1
  480. package/lib/commonjs/core/withUnistyles/useDependencies.js.map +0 -1
  481. package/lib/module/components/Variants.js +0 -29
  482. package/lib/module/components/Variants.js.map +0 -1
  483. package/lib/module/core/createUnistylesComponent.js +0 -11
  484. package/lib/module/core/createUnistylesComponent.js.map +0 -1
  485. package/lib/module/core/withUnistyles/useDependencies.js.map +0 -1
  486. package/lib/typescript/src/components/Variants.d.ts +0 -7
  487. package/lib/typescript/src/components/Variants.d.ts.map +0 -1
  488. package/lib/typescript/src/core/createUnistylesComponent.d.ts +0 -14
  489. package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +0 -1
  490. package/lib/typescript/src/core/withUnistyles/useDependencies.d.ts +0 -13
  491. package/lib/typescript/src/core/withUnistyles/useDependencies.d.ts.map +0 -1
  492. package/nitrogen/generated/android/unistylesOnLoad.kt +0 -1
  493. package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +0 -314
  494. package/plugin/style.js +0 -168
  495. package/src/components/Variants.tsx +0 -30
  496. package/src/core/createUnistylesComponent.tsx +0 -14
@@ -75,7 +75,7 @@ void core::UnistylesRegistry::linkShadowNodeWithUnistyle(
75
75
  ) {
76
76
  shadow::ShadowLeafUpdates updates;
77
77
  auto parser = parser::Parser(nullptr);
78
-
78
+
79
79
  std::for_each(unistylesData.begin(), unistylesData.end(), [this, &rt, shadowNodeFamily](std::shared_ptr<UnistyleData> unistyleData){
80
80
  this->_shadowRegistry[&rt][shadowNodeFamily].emplace_back(unistyleData);
81
81
  });
@@ -159,7 +159,7 @@ std::vector<std::shared_ptr<core::StyleSheet>> core::UnistylesRegistry::getStyle
159
159
  UnistyleDependency::THEME);
160
160
  auto themeDidChange = themeDidChangeIt != unistylesDependencies.end();
161
161
  auto runtimeDidChange = (themeDidChange && unistylesDependencies.size() > 1) || unistylesDependencies.size() > 0;
162
-
162
+
163
163
  // if nothing changed, skip further lookup
164
164
  if (!themeDidChange && !runtimeDidChange) {
165
165
  return stylesheetsToRefresh;
@@ -173,7 +173,7 @@ std::vector<std::shared_ptr<core::StyleSheet>> core::UnistylesRegistry::getStyle
173
173
  if (styleSheet->type == StyleSheetType::ThemableWithMiniRuntime) {
174
174
  for (const auto& unistylePair: styleSheet->unistyles) {
175
175
  auto& [_, unistyle] = unistylePair;
176
-
176
+
177
177
  bool hasAnyOfDependencies = std::any_of(
178
178
  unistyle->dependencies.begin(),
179
179
  unistyle->dependencies.end(),
@@ -181,10 +181,10 @@ std::vector<std::shared_ptr<core::StyleSheet>> core::UnistylesRegistry::getStyle
181
181
  return std::find(unistylesDependencies.begin(), unistylesDependencies.end(), dep) != unistylesDependencies.end();
182
182
  }
183
183
  );
184
-
184
+
185
185
  if (hasAnyOfDependencies) {
186
186
  stylesheetsToRefresh.emplace_back(styleSheet);
187
-
187
+
188
188
  return;
189
189
  }
190
190
  }
@@ -198,18 +198,26 @@ std::vector<std::shared_ptr<core::StyleSheet>> core::UnistylesRegistry::getStyle
198
198
  return stylesheetsToRefresh;
199
199
  }
200
200
 
201
- const core::Variants& core::UnistylesRegistry::getScopedVariants() {
202
- return this->_scopedVariants;
201
+ core::Unistyle::Shared core::UnistylesRegistry::getUnistyleById(jsi::Runtime& rt, std::string unistyleID) {
202
+ for (auto& pair: this->_styleSheetRegistry[&rt]) {
203
+ auto [_, stylesheet] = pair;
204
+
205
+ for (auto unistylePair: stylesheet->unistyles) {
206
+ auto [_, unistyle] = unistylePair;
207
+
208
+ if (unistyle->unid == unistyleID) {
209
+ return unistyle;
210
+ }
211
+ }
212
+ }
213
+
214
+ return nullptr;
203
215
  }
204
216
 
205
217
  const std::optional<std::string> core::UnistylesRegistry::getScopedTheme() {
206
218
  return this->_scopedTheme;
207
219
  }
208
220
 
209
- void core::UnistylesRegistry::setScopedVariants(core::Variants&& variants) {
210
- this->_scopedVariants = std::move(variants);
211
- }
212
-
213
221
  void core::UnistylesRegistry::setScopedTheme(std::optional<std::string> themeName) {
214
222
  this->_scopedTheme = std::move(themeName);
215
223
  }
@@ -43,15 +43,13 @@ struct UnistylesRegistry: public StyleSheetRegistry {
43
43
  DependencyMap buildDependencyMap(jsi::Runtime& rt, std::vector<UnistyleDependency>& deps);
44
44
  void shadowLeafUpdateFromUnistyle(jsi::Runtime& rt, Unistyle::Shared unistyle, jsi::Value& maybePressableId);
45
45
  shadow::ShadowTrafficController trafficController{};
46
- const core::Variants& getScopedVariants();
47
46
  const std::optional<std::string> getScopedTheme();
48
- void setScopedVariants(core::Variants&& variants);
49
47
  void setScopedTheme(std::optional<std::string> themeName);
48
+ core::Unistyle::Shared getUnistyleById(jsi::Runtime& rt, std::string unistyleID);
50
49
 
51
50
  private:
52
51
  UnistylesRegistry() = default;
53
-
54
- core::Variants _scopedVariants{};
52
+
55
53
  std::optional<std::string> _scopedTheme{};
56
54
  std::unordered_map<jsi::Runtime*, UnistylesState> _states{};
57
55
  std::unordered_map<jsi::Runtime*, std::unordered_map<int, std::shared_ptr<core::StyleSheet>>> _styleSheetRegistry{};
@@ -1,13 +1,13 @@
1
1
  #include "HybridNavigationBar.h"
2
2
 
3
3
  void HybridNavigationBar::setHidden(bool isHidden) {
4
- this->_nativePlatform.setNavigationBarHidden(isHidden);
4
+ this->_nativePlatform->setNavigationBarHidden(isHidden);
5
5
  };
6
6
 
7
7
  double HybridNavigationBar::getWidth() {
8
- return this->_nativePlatform.getNavigationBarDimensions().width;
8
+ return this->_nativePlatform->getNavigationBarDimensions().width;
9
9
  }
10
10
 
11
11
  double HybridNavigationBar::getHeight() {
12
- return this->_nativePlatform.getNavigationBarDimensions().height;
12
+ return this->_nativePlatform->getNavigationBarDimensions().height;
13
13
  }
@@ -7,12 +7,12 @@
7
7
  using namespace margelo::nitro::unistyles;
8
8
 
9
9
  struct HybridNavigationBar: public HybridUnistylesNavigationBarSpec {
10
- HybridNavigationBar(Unistyles::HybridNativePlatformSpecCxx nativePlatform): HybridObject(TAG), _nativePlatform{nativePlatform} {}
10
+ HybridNavigationBar(std::shared_ptr<HybridNativePlatformSpec> nativePlatform): HybridObject(TAG), _nativePlatform{nativePlatform} {}
11
11
 
12
12
  void setHidden(bool isHidden) override;
13
13
  double getWidth() override;
14
14
  double getHeight() override;
15
15
 
16
16
  private:
17
- Unistyles::HybridNativePlatformSpecCxx _nativePlatform;
17
+ std::shared_ptr<HybridNativePlatformSpec> _nativePlatform;
18
18
  };
@@ -7,30 +7,31 @@ jsi::Value HybridShadowRegistry::link(jsi::Runtime &rt, const jsi::Value &thisVa
7
7
  helpers::assertThat(rt, count == 2, "Unistyles: Invalid babel transform 'ShadowRegistry link' expected 2 arguments.");
8
8
 
9
9
  ShadowNode::Shared shadowNodeWrapper = shadowNodeFromValue(rt, args[0]);
10
+
10
11
  std::vector<core::Unistyle::Shared> unistyleWrappers = core::unistyleFromValue(rt, args[1]);
11
12
  std::vector<std::vector<folly::dynamic>> arguments;
12
13
  auto& registry = core::UnistylesRegistry::get();
13
14
 
14
15
  for (size_t i = 0; i < unistyleWrappers.size(); i++) {
15
16
  if (unistyleWrappers[i]->type == core::UnistyleType::DynamicFunction) {
16
- auto rawStyle = args[1].asObject(rt).asArray(rt).getValueAtIndex(rt, i);
17
-
18
- helpers::assertThat(rt, rawStyle.isObject(), "Unistyles: Dynamic function is not bound!");
19
-
20
- auto maybeSecrets = rawStyle.getObject(rt).getProperty(rt, helpers::SECRETS.c_str());
21
-
22
- helpers::assertThat(rt, maybeSecrets.isObject(), "Unistyles: Dynamic function is not bound!");
23
-
24
- auto secrets = maybeSecrets.asObject(rt).getProperty(rt, helpers::ARGUMENTS.c_str());
25
-
26
- arguments.push_back(helpers::parseDynamicFunctionArguments(rt, secrets.asObject(rt).asArray(rt)));
27
-
28
- continue;
17
+ try {
18
+ auto rawStyle = args[1].asObject(rt).asArray(rt).getValueAtIndex(rt, i);
19
+ auto rawStyleObj = rawStyle.getObject(rt);
20
+ auto unistyleHashKeys = core::getUnistylesHashKeys(rt, rawStyleObj);
21
+ auto secrets = rawStyleObj.getProperty(rt, unistyleHashKeys.at(0).c_str()).asObject(rt);
22
+ auto secretArguments = secrets.getProperty(rt, helpers::ARGUMENTS.c_str()).asObject(rt).asArray(rt);
23
+
24
+ arguments.push_back(helpers::parseDynamicFunctionArguments(rt, secretArguments));
25
+
26
+ continue;
27
+ } catch (...) {
28
+ arguments.push_back({});
29
+ }
29
30
  }
30
31
 
31
32
  arguments.push_back({});
32
33
  }
33
-
34
+
34
35
  auto scopedTheme = registry.getScopedTheme();
35
36
 
36
37
  // check if scope theme exists
@@ -47,9 +48,23 @@ jsi::Value HybridShadowRegistry::link(jsi::Runtime &rt, const jsi::Value &thisVa
47
48
  // create unistyleData based on wrappers
48
49
  for (size_t i = 0; i < unistyleWrappers.size(); i++) {
49
50
  core::Unistyle::Shared& unistyle = unistyleWrappers[i];
51
+ auto rawStyle = args[1].asObject(rt).asArray(rt).getValueAtIndex(rt, i);
52
+ auto rawStyleObj = rawStyle.getObject(rt);
53
+ auto unistyleHashKeys = core::getUnistylesHashKeys(rt, rawStyleObj);
54
+ core::Variants variants{};
55
+
56
+ if (unistyleHashKeys.size() == 1) {
57
+ auto secrets = rawStyleObj.getProperty(rt, unistyleHashKeys.at(0).c_str()).asObject(rt);
58
+ auto hasVariants = secrets.hasProperty(rt, helpers::STYLESHEET_VARIANTS.c_str());
59
+
60
+ if (hasVariants) {
61
+ variants = helpers::variantsToPairs(rt, secrets.getProperty(rt, helpers::STYLESHEET_VARIANTS.c_str()).asObject(rt));
62
+ }
63
+ }
64
+
50
65
  std::shared_ptr<core::UnistyleData> unistyleData = std::make_shared<core::UnistyleData>(
51
66
  unistyle,
52
- registry.getScopedVariants(),
67
+ variants,
53
68
  arguments[i],
54
69
  scopedTheme
55
70
  );
@@ -62,9 +77,6 @@ jsi::Value HybridShadowRegistry::link(jsi::Runtime &rt, const jsi::Value &thisVa
62
77
 
63
78
  // if so we need to force update
64
79
  parser.rebuildUnistyleWithScopedTheme(rt, parsedStyleSheet, unistyleData);
65
- } else {
66
- // for other styles, not scoped to theme we need to compute variants value
67
- parser.rebuildUnistyleWithVariants(rt, unistyleData);
68
80
  }
69
81
 
70
82
  unistylesData.emplace_back(unistyleData);
@@ -91,25 +103,9 @@ jsi::Value HybridShadowRegistry::unlink(jsi::Runtime &rt, const jsi::Value &this
91
103
  return jsi::Value::undefined();
92
104
  }
93
105
 
94
- jsi::Value HybridShadowRegistry::selectVariants(jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) {
95
- helpers::assertThat(rt, count == 1, "Unistyles: Invalid babel transform 'ShadowRegistry selectVariants' expected 1 arguments.");
96
-
97
- auto& registry = core::UnistylesRegistry::get();
98
-
99
- if (args[0].isUndefined()) {
100
- registry.setScopedVariants({});
101
- }
102
-
103
- if (args[0].isObject()) {
104
- registry.setScopedVariants(helpers::variantsToPairs(rt, args[0].asObject(rt)));
105
- }
106
-
107
- return jsi::Value::undefined();
108
- }
109
-
110
106
  jsi::Value HybridShadowRegistry::setScopedTheme(jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) {
111
107
  helpers::assertThat(rt, count == 1, "Unistyles: setScopedTheme expected 1 argument.");
112
-
108
+
113
109
  auto& registry = core::UnistylesRegistry::get();
114
110
 
115
111
  if (args[0].isUndefined()) {
@@ -127,17 +123,8 @@ jsi::Value HybridShadowRegistry::setScopedTheme(jsi::Runtime &rt, const jsi::Val
127
123
  jsi::Value HybridShadowRegistry::getScopedTheme(jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) {
128
124
  auto& registry = core::UnistylesRegistry::get();
129
125
  auto maybeScopedTheme = registry.getScopedTheme();
130
-
126
+
131
127
  return maybeScopedTheme.has_value()
132
128
  ? jsi::String::createFromUtf8(rt, maybeScopedTheme.value())
133
129
  : jsi::Value::undefined();
134
130
  }
135
-
136
- jsi::Value HybridShadowRegistry::getVariants(jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) {
137
- auto& registry = core::UnistylesRegistry::get();
138
- auto maybeScopedVariants = registry.getScopedVariants();
139
-
140
- return maybeScopedVariants.size() > 0
141
- ? helpers::variantsToValue(rt, maybeScopedVariants)
142
- : jsi::Value::undefined();
143
- }
@@ -20,10 +20,6 @@ struct HybridShadowRegistry: public HybridUnistylesShadowRegistrySpec {
20
20
  const jsi::Value& thisValue,
21
21
  const jsi::Value* args,
22
22
  size_t count);
23
- jsi::Value selectVariants(jsi::Runtime& rt,
24
- const jsi::Value& thisValue,
25
- const jsi::Value* args,
26
- size_t count);
27
23
  jsi::Value setScopedTheme(jsi::Runtime& rt,
28
24
  const jsi::Value& thisValue,
29
25
  const jsi::Value* args,
@@ -32,10 +28,6 @@ struct HybridShadowRegistry: public HybridUnistylesShadowRegistrySpec {
32
28
  const jsi::Value& thisValue,
33
29
  const jsi::Value* args,
34
30
  size_t count);
35
- jsi::Value getVariants(jsi::Runtime& rt,
36
- const jsi::Value& thisValue,
37
- const jsi::Value* args,
38
- size_t count);
39
31
 
40
32
  void loadHybridMethods() override {
41
33
  HybridUnistylesShadowRegistrySpec::loadHybridMethods();
@@ -43,10 +35,8 @@ struct HybridShadowRegistry: public HybridUnistylesShadowRegistrySpec {
43
35
  registerHybrids(this, [](Prototype& prototype) {
44
36
  prototype.registerRawHybridMethod("link", 2, &HybridShadowRegistry::link);
45
37
  prototype.registerRawHybridMethod("unlink", 1, &HybridShadowRegistry::unlink);
46
- prototype.registerRawHybridMethod("selectVariants", 1, &HybridShadowRegistry::selectVariants);
47
38
  prototype.registerRawHybridMethod("setScopedTheme", 1, &HybridShadowRegistry::setScopedTheme);
48
39
  prototype.registerRawHybridMethod("getScopedTheme", 0, &HybridShadowRegistry::getScopedTheme);
49
- prototype.registerRawHybridMethod("getVariants", 0, &HybridShadowRegistry::getVariants);
50
40
  });
51
41
  };
52
42
 
@@ -1,13 +1,13 @@
1
1
  #include "HybridStatusBar.h"
2
2
 
3
3
  double HybridStatusBar::getWidth() {
4
- return this->_nativePlatform.getStatusBarDimensions().width;
4
+ return this->_nativePlatform->getStatusBarDimensions().width;
5
5
  }
6
6
 
7
7
  double HybridStatusBar::getHeight() {
8
- return this->_nativePlatform.getStatusBarDimensions().height;
8
+ return this->_nativePlatform->getStatusBarDimensions().height;
9
9
  }
10
10
 
11
11
  void HybridStatusBar::setHidden(bool isHidden) {
12
- return this->_nativePlatform.setStatusBarHidden(isHidden);
12
+ this->_nativePlatform->setStatusBarHidden(isHidden);
13
13
  }
@@ -7,12 +7,12 @@
7
7
  using namespace margelo::nitro::unistyles;
8
8
 
9
9
  struct HybridStatusBar: public HybridUnistylesStatusBarSpec {
10
- HybridStatusBar(Unistyles::HybridNativePlatformSpecCxx nativePlatform): HybridObject(TAG), _nativePlatform{nativePlatform} {}
10
+ HybridStatusBar(std::shared_ptr<HybridNativePlatformSpec> nativePlatform): HybridObject(TAG), _nativePlatform{nativePlatform} {}
11
11
 
12
12
  double getWidth() override;
13
13
  double getHeight() override;
14
14
  void setHidden(bool isHidden) override;
15
15
 
16
16
  private:
17
- Unistyles::HybridNativePlatformSpecCxx _nativePlatform;
17
+ std::shared_ptr<HybridNativePlatformSpec> _nativePlatform;
18
18
  };
@@ -36,10 +36,7 @@ jsi::Value HybridStyleSheet::create(jsi::Runtime& rt, const jsi::Value &thisVal,
36
36
  parser.buildUnistyles(rt, registeredStyleSheet);
37
37
  parser.parseUnistyles(rt, registeredStyleSheet);
38
38
 
39
- auto style = std::make_shared<core::HostStyle>(registeredStyleSheet, this->_unistylesRuntime);
40
- auto styleHostObject = jsi::Object::createFromHostObject(rt, style);
41
-
42
- return styleHostObject;
39
+ return core::toRNStyle(rt, registeredStyleSheet, this->_unistylesRuntime, {});
43
40
  }
44
41
 
45
42
  jsi::Value HybridStyleSheet::configure(jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *arguments, size_t count) {
@@ -80,6 +77,10 @@ jsi::Value HybridStyleSheet::configure(jsi::Runtime &rt, const jsi::Value &thisV
80
77
  }
81
78
 
82
79
  jsi::Value HybridStyleSheet::init(jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *arguments, size_t count) {
80
+ if (this->isInitialized) {
81
+ return jsi::Value::undefined();
82
+ }
83
+
83
84
  // create new state
84
85
  auto& registry = core::UnistylesRegistry::get();
85
86
 
@@ -87,6 +88,8 @@ jsi::Value HybridStyleSheet::init(jsi::Runtime &rt, const jsi::Value &thisVal, c
87
88
 
88
89
  loadExternalMethods(thisVal, rt);
89
90
  registerHooks(rt);
91
+
92
+ this->isInitialized = true;
90
93
 
91
94
  return jsi::Value::undefined();
92
95
  }
@@ -121,6 +124,10 @@ void HybridStyleSheet::parseSettings(jsi::Runtime &rt, jsi::Object settings) {
121
124
  return;
122
125
  }
123
126
 
127
+ if (propertyName == "CSSVars") {
128
+ return;
129
+ }
130
+
124
131
  helpers::assertThat(rt, false, "StyleSheet.configure's settings received unexpected key: '" + std::string(propertyName) + "'");
125
132
  });
126
133
  }
@@ -250,8 +257,6 @@ void HybridStyleSheet::onPlatformDependenciesChange(std::vector<UnistyleDependen
250
257
 
251
258
  if (dependencyMap.empty()) {
252
259
  this->notifyJSListeners(dependencies);
253
-
254
- return;
255
260
  }
256
261
 
257
262
  // in a later step, we will rebuild only Unistyles with mounted StyleSheets
@@ -260,6 +265,13 @@ void HybridStyleSheet::onPlatformDependenciesChange(std::vector<UnistyleDependen
260
265
  auto dependentStyleSheets = registry.getStyleSheetsToRefresh(rt, dependencies);
261
266
 
262
267
  parser.rebuildUnistylesInDependencyMap(rt, dependencyMap, dependentStyleSheets, std::nullopt);
268
+
269
+ // we need to stop here if there is nothing to update at the moment,
270
+ // but we need to compute dependentStyleSheets
271
+ if (dependencyMap.empty()) {
272
+ return;
273
+ }
274
+
263
275
  parser.rebuildShadowLeafUpdates(rt, dependencyMap);
264
276
 
265
277
  this->notifyJSListeners(dependencies);
@@ -296,8 +308,6 @@ void HybridStyleSheet::onPlatformNativeDependenciesChange(std::vector<UnistyleDe
296
308
 
297
309
  if (dependencyMap.empty()) {
298
310
  this->notifyJSListeners(unistyleDependencies);
299
-
300
- return;
301
311
  }
302
312
 
303
313
  // in a later step, we will rebuild only Unistyles with mounted StyleSheets
@@ -306,6 +316,13 @@ void HybridStyleSheet::onPlatformNativeDependenciesChange(std::vector<UnistyleDe
306
316
  auto dependentStyleSheets = registry.getStyleSheetsToRefresh(rt, unistyleDependencies);
307
317
 
308
318
  parser.rebuildUnistylesInDependencyMap(rt, dependencyMap, dependentStyleSheets, miniRuntime);
319
+
320
+ // we need to stop here if there is nothing to update at the moment,
321
+ // but we need to compute dependentStyleSheets
322
+ if (dependencyMap.empty()) {
323
+ return;
324
+ }
325
+
309
326
  parser.rebuildShadowLeafUpdates(rt, dependencyMap);
310
327
 
311
328
  this->notifyJSListeners(unistyleDependencies);
@@ -4,7 +4,7 @@
4
4
  #include <jsi/jsi.h>
5
5
  #include "HybridUnistylesRuntime.h"
6
6
  #include "HybridUnistylesStyleSheetSpec.hpp"
7
- #include "HostStyle.h"
7
+ #include "RNStyle.h"
8
8
  #include "Helpers.h"
9
9
  #include "Constants.h"
10
10
  #include "Breakpoints.h"
@@ -73,6 +73,7 @@ private:
73
73
  void onImeChange(UnistylesNativeMiniRuntime miniRuntime);
74
74
  void notifyJSListeners(std::vector<UnistyleDependency>& dependencies);
75
75
 
76
+ bool isInitialized = false;
76
77
  double __unid = -1;
77
78
  std::vector<std::unique_ptr<const std::function<void(std::vector<UnistyleDependency>&)>>> _changeListeners{};
78
79
  std::shared_ptr<HybridUnistylesRuntime> _unistylesRuntime;
@@ -4,7 +4,7 @@
4
4
  using namespace margelo::nitro::unistyles;
5
5
 
6
6
  ColorScheme HybridUnistylesRuntime::getColorScheme() {
7
- auto colorScheme = this->_nativePlatform.getColorScheme();
7
+ auto colorScheme = this->_nativePlatform->getColorScheme();
8
8
 
9
9
  return static_cast<ColorScheme>(colorScheme);
10
10
  }
@@ -16,7 +16,7 @@ bool HybridUnistylesRuntime::getHasAdaptiveThemes() {
16
16
  };
17
17
 
18
18
  Dimensions HybridUnistylesRuntime::getScreen() {
19
- return this->_nativePlatform.getScreenDimensions();
19
+ return this->_nativePlatform->getScreenDimensions();
20
20
  };
21
21
 
22
22
  std::optional<std::string> HybridUnistylesRuntime::getThemeName() {
@@ -26,7 +26,7 @@ std::optional<std::string> HybridUnistylesRuntime::getThemeName() {
26
26
  };
27
27
 
28
28
  std::string HybridUnistylesRuntime::getContentSizeCategory() {
29
- return this->_nativePlatform.getContentSizeCategory();
29
+ return this->_nativePlatform->getContentSizeCategory();
30
30
  };
31
31
 
32
32
  std::optional<std::string> HybridUnistylesRuntime::getBreakpoint() {
@@ -36,25 +36,25 @@ std::optional<std::string> HybridUnistylesRuntime::getBreakpoint() {
36
36
  };
37
37
 
38
38
  bool HybridUnistylesRuntime::getRtl() {
39
- return this->_nativePlatform.getPrefersRtlDirection();
39
+ return this->_nativePlatform->getPrefersRtlDirection();
40
40
  }
41
41
 
42
42
  Insets HybridUnistylesRuntime::getInsets() {
43
- return this->_nativePlatform.getInsets();
43
+ return this->_nativePlatform->getInsets();
44
44
  };
45
45
 
46
46
  Orientation HybridUnistylesRuntime::getOrientation() {
47
- auto orientation = this->_nativePlatform.getOrientation();
47
+ auto orientation = this->_nativePlatform->getOrientation();
48
48
 
49
49
  return static_cast<Orientation>(orientation);
50
50
  };
51
51
 
52
52
  double HybridUnistylesRuntime::getPixelRatio() {
53
- return this->_nativePlatform.getPixelRatio();
53
+ return this->_nativePlatform->getPixelRatio();
54
54
  };
55
55
 
56
56
  double HybridUnistylesRuntime::getFontScale() {
57
- return this->_nativePlatform.getFontScale();
57
+ return this->_nativePlatform->getFontScale();
58
58
  };
59
59
 
60
60
  std::unordered_map<std::string, double> HybridUnistylesRuntime::getBreakpoints() {
@@ -133,7 +133,7 @@ jsi::Value HybridUnistylesRuntime::getTheme(jsi::Runtime &rt, const jsi::Value &
133
133
  if (args[0].isUndefined()) {
134
134
  return state.getCurrentJSTheme();
135
135
  }
136
-
136
+
137
137
  helpers::assertThat(rt, args[0].isString(), "UnistylesRuntime.getTheme expected to be called with string.");
138
138
 
139
139
  auto themeName = args[0].asString(rt).utf8(rt);
@@ -164,11 +164,11 @@ jsi::Value HybridUnistylesRuntime::updateTheme(jsi::Runtime &rt, const jsi::Valu
164
164
  }
165
165
 
166
166
  void HybridUnistylesRuntime::setImmersiveMode(bool isEnabled) {
167
- this->_nativePlatform.setImmersiveMode(isEnabled);
167
+ this->_nativePlatform->setImmersiveMode(isEnabled);
168
168
  };
169
169
 
170
170
  void HybridUnistylesRuntime::setRootViewBackgroundColor(double color) {
171
- this->_nativePlatform.setRootViewBackgroundColor(color);
171
+ this->_nativePlatform->setRootViewBackgroundColor(color);
172
172
  }
173
173
 
174
174
  jsi::Value HybridUnistylesRuntime::createHybridStatusBar(jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) {
@@ -188,7 +188,7 @@ jsi::Value HybridUnistylesRuntime::createHybridNavigationBar(jsi::Runtime &rt, c
188
188
  }
189
189
 
190
190
  UnistylesCxxMiniRuntime HybridUnistylesRuntime::getMiniRuntime() {
191
- UnistylesNativeMiniRuntime nativeMiniRuntime = this->_nativePlatform.getMiniRuntime();
191
+ UnistylesNativeMiniRuntime nativeMiniRuntime = this->_nativePlatform->getMiniRuntime();
192
192
  UnistylesCxxMiniRuntime cxxMiniRuntime{
193
193
  this->getThemeName(),
194
194
  this->getBreakpoint(),
@@ -260,16 +260,16 @@ void HybridUnistylesRuntime::registerPlatformListener(const std::function<void (
260
260
  }
261
261
 
262
262
  void HybridUnistylesRuntime::registerNativePlatformListener(const std::function<void(std::vector<UnistyleDependency>, UnistylesNativeMiniRuntime)>& listener) {
263
- this->_nativePlatform.registerPlatformListener(listener);
263
+ this->_nativePlatform->registerPlatformListener(listener);
264
264
  this->_onNativeDependenciesChange = listener;
265
265
  }
266
266
 
267
267
  void HybridUnistylesRuntime::registerImeListener(const std::function<void(UnistylesNativeMiniRuntime)>& listener) {
268
- this->_nativePlatform.registerImeListener(listener);
268
+ this->_nativePlatform->registerImeListener(listener);
269
269
  }
270
270
 
271
271
  void HybridUnistylesRuntime::unregisterNativePlatformListeners() {
272
- this->_nativePlatform.unregisterPlatformListeners();
272
+ this->_nativePlatform->unregisterPlatformListeners();
273
273
  }
274
274
 
275
275
  void HybridUnistylesRuntime::includeDependenciesForColorSchemeChange(std::vector<UnistyleDependency>& deps) {
@@ -13,7 +13,7 @@
13
13
  namespace margelo::nitro::unistyles {
14
14
 
15
15
  struct HybridUnistylesRuntime: public HybridUnistylesRuntimeSpec {
16
- HybridUnistylesRuntime(Unistyles::HybridNativePlatformSpecCxx nativePlatform, jsi::Runtime& rt, std::function<void(std::function<void(jsi::Runtime&)>&&)> runOnJSThread)
16
+ HybridUnistylesRuntime(std::shared_ptr<HybridNativePlatformSpec> nativePlatform, jsi::Runtime& rt, std::function<void(std::function<void(jsi::Runtime&)>&&)> runOnJSThread)
17
17
  : HybridObject(TAG), _nativePlatform{nativePlatform}, _rt{&rt}, runOnJSThread(std::move(runOnJSThread)) {}
18
18
 
19
19
  jsi::Value getTheme(jsi::Runtime& rt,
@@ -78,7 +78,7 @@ private:
78
78
  jsi::Runtime* _rt;
79
79
  std::shared_ptr<HybridNavigationBar> _navigationBar;
80
80
  std::shared_ptr<HybridStatusBar> _statusBar;
81
- Unistyles::HybridNativePlatformSpecCxx _nativePlatform;
81
+ std::shared_ptr<HybridNativePlatformSpec> _nativePlatform;
82
82
  std::function<void(std::vector<UnistyleDependency>)> _onDependenciesChange;
83
83
  std::function<void(std::vector<UnistyleDependency>, UnistylesNativeMiniRuntime)> _onNativeDependenciesChange;
84
84
  };
@@ -18,6 +18,7 @@ void parser::Parser::buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet
18
18
 
19
19
  if (styleValue.isFunction(rt)) {
20
20
  styleSheet->unistyles[styleKey] = std::make_shared<UnistyleDynamicFunction>(
21
+ helpers::HashGenerator::generateHash(styleKey),
21
22
  UnistyleType::DynamicFunction,
22
23
  styleKey,
23
24
  styleValue,
@@ -28,6 +29,7 @@ void parser::Parser::buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet
28
29
  }
29
30
 
30
31
  styleSheet->unistyles[styleKey] = std::make_shared<Unistyle>(
32
+ helpers::HashGenerator::generateHash(styleKey),
31
33
  UnistyleType::Object,
32
34
  styleKey,
33
35
  styleValue,
@@ -301,7 +303,7 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
301
303
  );
302
304
  } else {
303
305
  unistyle->rawValue = parsedStyleSheetsWithDefaultTheme[unistyleStyleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
304
- this->rebuildUnistyle(rt, unistyleStyleSheet, unistyle, unistyleData->variants, unistyleData->dynamicFunctionMetadata);
306
+ this->rebuildUnistyle(rt, unistyle, unistyleData->variants, unistyleData->dynamicFunctionMetadata);
305
307
  unistyleData->parsedStyle = jsi::Value(rt, unistyle->parsedStyle.value()).asObject(rt);
306
308
  }
307
309
 
@@ -317,13 +319,14 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
317
319
  for (auto& [_, unistyle] : styleSheet->unistyles) {
318
320
  if (!parsedUnistyles.contains(unistyle)) {
319
321
  unistyle->rawValue = parsedStyleSheetsWithDefaultTheme[styleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
322
+ unistyle->isDirty = true;
320
323
  }
321
324
  }
322
325
  }
323
326
  }
324
327
 
325
328
  // rebuild single unistyle
326
- void parser::Parser::rebuildUnistyle(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Unistyle::Shared unistyle, const Variants& variants, std::optional<std::vector<folly::dynamic>> metadata) {
329
+ void parser::Parser::rebuildUnistyle(jsi::Runtime& rt, Unistyle::Shared unistyle, const Variants& variants, std::optional<std::vector<folly::dynamic>> metadata) {
327
330
  if (unistyle->type == core::UnistyleType::Object) {
328
331
  auto result = this->parseFirstLevel(rt, unistyle, variants);
329
332
 
@@ -358,6 +361,10 @@ void parser::Parser::rebuildUnistyle(jsi::Runtime& rt, std::shared_ptr<StyleShee
358
361
  unistyleFn->unprocessedValue = std::move(functionResult);
359
362
  unistyleFn->parsedStyle = this->parseFirstLevel(rt, unistyleFn, variants);
360
363
  }
364
+
365
+ if (unistyle->isDirty) {
366
+ unistyle->isDirty = false;
367
+ }
361
368
  }
362
369
 
363
370
  // convert dependency map to shadow tree updates
@@ -508,36 +515,22 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
508
515
 
509
516
  // memoize metadata to call it later
510
517
  auto unistyleFn = std::dynamic_pointer_cast<UnistyleDynamicFunction>(unistyle);
511
- auto& registry = core::UnistylesRegistry::get();
512
518
 
513
519
  unistyleFn->unprocessedValue = jsi::Value(rt, result).asObject(rt);
514
520
 
515
- jsi::Value rawVariants = thisObject.hasProperty(rt, helpers::STYLE_VARIANTS.c_str())
516
- ? thisObject.getProperty(rt, helpers::STYLE_VARIANTS.c_str())
517
- : jsi::Value::undefined();
518
- std::optional<Variants> variants = rawVariants.isUndefined()
519
- ? registry.getScopedVariants()
520
- : std::optional<Variants>(helpers::variantsToPairs(rt, rawVariants.asObject(rt)));
521
+ jsi::Value rawVariants = thisObject.hasProperty(rt, helpers::STYLESHEET_VARIANTS.c_str())
522
+ ? thisObject.getProperty(rt, helpers::STYLESHEET_VARIANTS.c_str())
523
+ : jsi::Object(rt);
524
+
525
+ Variants variants = helpers::variantsToPairs(rt, rawVariants.asObject(rt));
521
526
 
522
527
  unistyleFn->parsedStyle = this->parseFirstLevel(rt, unistyleFn, variants);
523
528
  unistyleFn->seal();
524
529
 
525
- jsi::Object style = jsi::Value(rt, unistyleFn->parsedStyle.value()).asObject(rt);
526
-
527
- // include dependencies for createUnistylesComponent
528
- style.setProperty(rt, "__proto__", generateUnistylesPrototype(rt, unistylesRuntime, unistyle, variants, helpers::functionArgumentsToArray(rt, args, count)));
529
-
530
- jsi::Object secrets = jsi::Object(rt);
531
-
532
- secrets.setProperty(rt, helpers::ARGUMENTS.c_str(), helpers::functionArgumentsToArray(rt, args, count));
533
-
534
- helpers::defineHiddenProperty(rt, style, helpers::SECRETS.c_str(), secrets);
535
-
536
- auto wrappedUnistyle = std::make_shared<UnistyleWrapper>(unistyle);
537
-
538
- style.setNativeState(rt, std::move(wrappedUnistyle));
530
+ // for compatibility purpose save last arguments to style instance. It will work ok, if user sees warning about multiple unistyles
531
+ helpers::defineHiddenProperty(rt, thisObject, helpers::ARGUMENTS.c_str() + std::string("_") + unistyleFn->styleKey, helpers::functionArgumentsToArray(rt, args, count));
539
532
 
540
- return style;
533
+ return core::objectFromUnistyle(rt, unistylesRuntime, unistyle, variants, std::make_optional<jsi::Array>(helpers::functionArgumentsToArray(rt, args, count))).asObject(rt);
541
534
  });
542
535
  }
543
536