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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (539) hide show
  1. package/README.md +7 -0
  2. package/Unistyles.podspec +1 -1
  3. package/android/CMakeLists.txt +19 -45
  4. package/android/build.gradle +6 -5
  5. package/android/src/main/cxx/NativeUnistylesModule.cpp +71 -0
  6. package/android/src/main/cxx/NativeUnistylesModule.h +42 -0
  7. package/android/src/main/cxx/cpp-adapter.cpp +8 -86
  8. package/android/src/main/java/com/unistyles/Equatable.kt +61 -0
  9. package/android/src/main/java/com/unistyles/NativePlatform+android.kt +285 -0
  10. package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +152 -0
  11. package/android/src/main/java/com/unistyles/NativePlatform+listener.kt +59 -0
  12. package/android/src/main/java/com/unistyles/UnistylesModule.kt +51 -0
  13. package/android/src/main/java/com/unistyles/UnistylesPackage.kt +16 -14
  14. package/cxx/NativePlatform.h +11 -0
  15. package/cxx/common/Constants.h +3 -0
  16. package/cxx/common/Helpers.h +140 -5
  17. package/cxx/core/HostStyle.cpp +10 -6
  18. package/cxx/core/HostStyle.h +4 -0
  19. package/cxx/core/StyleSheet.h +0 -2
  20. package/cxx/core/StyleSheetRegistry.cpp +9 -17
  21. package/cxx/core/StyleSheetRegistry.h +3 -4
  22. package/cxx/core/Unistyle.h +8 -11
  23. package/cxx/core/UnistyleData.h +23 -0
  24. package/cxx/core/UnistyleWrapper.h +108 -13
  25. package/cxx/core/UnistylesCommitHook.cpp +14 -15
  26. package/cxx/core/UnistylesCommitHook.h +6 -11
  27. package/cxx/core/UnistylesCommitShadowNode.h +13 -0
  28. package/cxx/core/UnistylesMountHook.cpp +28 -0
  29. package/cxx/core/UnistylesMountHook.h +27 -0
  30. package/cxx/core/UnistylesRegistry.cpp +119 -83
  31. package/cxx/core/UnistylesRegistry.h +16 -14
  32. package/cxx/core/UnistylesState.cpp +29 -8
  33. package/cxx/core/UnistylesState.h +5 -2
  34. package/cxx/hybridObjects/HybridNavigationBar.cpp +0 -4
  35. package/cxx/hybridObjects/HybridNavigationBar.h +3 -4
  36. package/cxx/hybridObjects/HybridShadowRegistry.cpp +16 -11
  37. package/cxx/hybridObjects/HybridStatusBar.cpp +0 -4
  38. package/cxx/hybridObjects/HybridStatusBar.h +3 -4
  39. package/cxx/hybridObjects/HybridStyleSheet.cpp +154 -23
  40. package/cxx/hybridObjects/HybridStyleSheet.h +27 -5
  41. package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +96 -14
  42. package/cxx/hybridObjects/HybridUnistylesRuntime.h +19 -3
  43. package/cxx/parser/Parser.cpp +226 -175
  44. package/cxx/parser/Parser.h +11 -15
  45. package/cxx/shadowTree/ShadowLeafUpdate.h +2 -1
  46. package/cxx/shadowTree/ShadowTrafficController.h +71 -0
  47. package/cxx/shadowTree/ShadowTreeManager.cpp +23 -18
  48. package/cxx/shadowTree/ShadowTreeManager.h +3 -2
  49. package/ios/Equatable.swift +2 -1
  50. package/ios/NativePlatform+ios.swift +21 -7
  51. package/ios/NativePlatform+keyboard.swift +83 -0
  52. package/ios/NativePlatformListener+ios.swift +37 -24
  53. package/ios/Unistyles.h +1 -0
  54. package/ios/UnistylesModuleOnLoad.h +8 -2
  55. package/ios/UnistylesModuleOnLoad.mm +9 -1
  56. package/lib/commonjs/components/Display.js +18 -0
  57. package/lib/commonjs/components/Display.js.map +1 -0
  58. package/lib/commonjs/components/Hide.js +18 -0
  59. package/lib/commonjs/components/Hide.js.map +1 -0
  60. package/lib/commonjs/components/index.js +20 -0
  61. package/lib/commonjs/components/index.js.map +1 -0
  62. package/lib/commonjs/components/useMedia.js +59 -0
  63. package/lib/commonjs/components/useMedia.js.map +1 -0
  64. package/lib/commonjs/components/useMedia.web.js +43 -0
  65. package/lib/commonjs/components/useMedia.web.js.map +1 -0
  66. package/lib/commonjs/core/createUnistylesComponent.js +79 -0
  67. package/lib/commonjs/core/createUnistylesComponent.js.map +1 -0
  68. package/lib/commonjs/core/createUnistylesComponent.native.js +82 -0
  69. package/lib/commonjs/core/createUnistylesComponent.native.js.map +1 -0
  70. package/lib/commonjs/core/index.js +13 -0
  71. package/lib/commonjs/core/index.js.map +1 -0
  72. package/lib/commonjs/index.js +21 -11
  73. package/lib/commonjs/index.js.map +1 -1
  74. package/lib/commonjs/mq.js +25 -12
  75. package/lib/commonjs/mq.js.map +1 -1
  76. package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js +1 -0
  77. package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
  78. package/lib/commonjs/specs/NavigtionBar/index.js +0 -15
  79. package/lib/commonjs/specs/NavigtionBar/index.js.map +1 -1
  80. package/lib/commonjs/specs/ShadowRegistry/index.js +10 -6
  81. package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
  82. package/lib/commonjs/specs/StatusBar/index.js +0 -5
  83. package/lib/commonjs/specs/StatusBar/index.js.map +1 -1
  84. package/lib/commonjs/specs/StyleSheet/index.js +1 -0
  85. package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
  86. package/lib/commonjs/specs/UnistylesRuntime/index.js +1 -3
  87. package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -1
  88. package/lib/commonjs/specs/index.js +7 -0
  89. package/lib/commonjs/specs/index.js.map +1 -1
  90. package/lib/commonjs/specs/index.web.js +1 -1
  91. package/lib/commonjs/types/stylesheet.js.map +1 -1
  92. package/lib/commonjs/utils.js +26 -0
  93. package/lib/commonjs/utils.js.map +1 -0
  94. package/lib/commonjs/web/convert/index.js +79 -0
  95. package/lib/commonjs/web/convert/index.js.map +1 -0
  96. package/lib/commonjs/web/convert/module.d.js +2 -0
  97. package/lib/commonjs/web/convert/module.d.js.map +1 -0
  98. package/lib/commonjs/web/convert/object/boxShadow.js +59 -0
  99. package/lib/commonjs/web/convert/object/boxShadow.js.map +1 -0
  100. package/lib/commonjs/web/convert/object/filter.js +42 -0
  101. package/lib/commonjs/web/convert/object/filter.js.map +1 -0
  102. package/lib/commonjs/web/convert/object/index.js +39 -0
  103. package/lib/commonjs/web/convert/object/index.js.map +1 -0
  104. package/lib/commonjs/web/convert/object/objectStyle.js +56 -0
  105. package/lib/commonjs/web/convert/object/objectStyle.js.map +1 -0
  106. package/lib/commonjs/web/convert/object/transform.js +27 -0
  107. package/lib/commonjs/web/convert/object/transform.js.map +1 -0
  108. package/lib/commonjs/web/convert/pseudo.js +10 -0
  109. package/lib/commonjs/web/convert/pseudo.js.map +1 -0
  110. package/lib/commonjs/web/convert/shadow/boxShadow.js +62 -0
  111. package/lib/commonjs/web/convert/shadow/boxShadow.js.map +1 -0
  112. package/lib/commonjs/web/convert/shadow/getShadowBreakpoints.js +38 -0
  113. package/lib/commonjs/web/convert/shadow/getShadowBreakpoints.js.map +1 -0
  114. package/lib/commonjs/web/convert/shadow/index.js +28 -0
  115. package/lib/commonjs/web/convert/shadow/index.js.map +1 -0
  116. package/lib/commonjs/web/convert/shadow/textShadow.js +59 -0
  117. package/lib/commonjs/web/convert/shadow/textShadow.js.map +1 -0
  118. package/lib/commonjs/web/convert/style.js +93 -0
  119. package/lib/commonjs/web/convert/style.js.map +1 -0
  120. package/lib/commonjs/web/convert/types.js +9 -0
  121. package/lib/commonjs/web/convert/types.js.map +1 -0
  122. package/lib/commonjs/web/convert/utils.js +59 -0
  123. package/lib/commonjs/web/convert/utils.js.map +1 -0
  124. package/lib/commonjs/web/create.js +49 -0
  125. package/lib/commonjs/web/create.js.map +1 -0
  126. package/lib/commonjs/web/index.js +60 -0
  127. package/lib/commonjs/web/index.js.map +1 -0
  128. package/lib/commonjs/web/listener.js +61 -0
  129. package/lib/commonjs/web/listener.js.map +1 -0
  130. package/lib/commonjs/web/mock.js +27 -0
  131. package/lib/commonjs/web/mock.js.map +1 -0
  132. package/lib/commonjs/web/registry.js +172 -0
  133. package/lib/commonjs/web/registry.js.map +1 -0
  134. package/lib/commonjs/web/runtime.js +173 -0
  135. package/lib/commonjs/web/runtime.js.map +1 -0
  136. package/lib/commonjs/web/shadowRegistry.js +142 -0
  137. package/lib/commonjs/web/shadowRegistry.js.map +1 -0
  138. package/lib/commonjs/web/state.js +73 -0
  139. package/lib/commonjs/web/state.js.map +1 -0
  140. package/lib/commonjs/web/utils/common.js +39 -0
  141. package/lib/commonjs/web/utils/common.js.map +1 -0
  142. package/lib/commonjs/web/utils/index.js +28 -0
  143. package/lib/commonjs/web/utils/index.js.map +1 -0
  144. package/lib/commonjs/web/utils/unistyle.js +85 -0
  145. package/lib/commonjs/web/utils/unistyle.js.map +1 -0
  146. package/lib/commonjs/web/variants/getVariants.js +39 -0
  147. package/lib/commonjs/web/variants/getVariants.js.map +1 -0
  148. package/lib/commonjs/web/variants/index.js +28 -0
  149. package/lib/commonjs/web/variants/index.js.map +1 -0
  150. package/lib/commonjs/web/variants/useVariants.js +59 -0
  151. package/lib/commonjs/web/variants/useVariants.js.map +1 -0
  152. package/lib/module/components/Display.js +13 -0
  153. package/lib/module/components/Display.js.map +1 -0
  154. package/lib/module/components/Hide.js +13 -0
  155. package/lib/module/components/Hide.js.map +1 -0
  156. package/lib/module/components/index.js +5 -0
  157. package/lib/module/components/index.js.map +1 -0
  158. package/lib/module/components/useMedia.js +54 -0
  159. package/lib/module/components/useMedia.js.map +1 -0
  160. package/lib/module/components/useMedia.web.js +38 -0
  161. package/lib/module/components/useMedia.web.js.map +1 -0
  162. package/lib/module/core/createUnistylesComponent.js +72 -0
  163. package/lib/module/core/createUnistylesComponent.js.map +1 -0
  164. package/lib/module/core/createUnistylesComponent.native.js +75 -0
  165. package/lib/module/core/createUnistylesComponent.native.js.map +1 -0
  166. package/lib/module/core/index.js +4 -0
  167. package/lib/module/core/index.js.map +1 -0
  168. package/lib/module/index.js +2 -9
  169. package/lib/module/index.js.map +1 -1
  170. package/lib/module/mq.js +21 -11
  171. package/lib/module/mq.js.map +1 -1
  172. package/lib/module/specs/NativePlatform/NativePlatform.nitro.js +1 -0
  173. package/lib/module/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
  174. package/lib/module/specs/NavigtionBar/index.js +0 -10
  175. package/lib/module/specs/NavigtionBar/index.js.map +1 -1
  176. package/lib/module/specs/ShadowRegistry/index.js +10 -6
  177. package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
  178. package/lib/module/specs/StatusBar/index.js +1 -6
  179. package/lib/module/specs/StatusBar/index.js.map +1 -1
  180. package/lib/module/specs/StyleSheet/index.js +1 -0
  181. package/lib/module/specs/StyleSheet/index.js.map +1 -1
  182. package/lib/module/specs/UnistylesRuntime/index.js +1 -3
  183. package/lib/module/specs/UnistylesRuntime/index.js.map +1 -1
  184. package/lib/module/specs/index.js +2 -1
  185. package/lib/module/specs/index.js.map +1 -1
  186. package/lib/module/specs/index.web.js +1 -1
  187. package/lib/module/specs/index.web.js.map +1 -1
  188. package/lib/module/types/stylesheet.js.map +1 -1
  189. package/lib/module/utils.js +21 -0
  190. package/lib/module/utils.js.map +1 -0
  191. package/lib/module/web/convert/index.js +74 -0
  192. package/lib/module/web/convert/index.js.map +1 -0
  193. package/lib/module/web/convert/module.d.js +2 -0
  194. package/lib/module/web/convert/module.d.js.map +1 -0
  195. package/lib/module/web/convert/object/boxShadow.js +54 -0
  196. package/lib/module/web/convert/object/boxShadow.js.map +1 -0
  197. package/lib/module/web/convert/object/filter.js +37 -0
  198. package/lib/module/web/convert/object/filter.js.map +1 -0
  199. package/lib/module/web/convert/object/index.js +6 -0
  200. package/lib/module/web/convert/object/index.js.map +1 -0
  201. package/lib/module/web/convert/object/objectStyle.js +51 -0
  202. package/lib/module/web/convert/object/objectStyle.js.map +1 -0
  203. package/lib/module/web/convert/object/transform.js +22 -0
  204. package/lib/module/web/convert/object/transform.js.map +1 -0
  205. package/lib/module/web/convert/pseudo.js +5 -0
  206. package/lib/module/web/convert/pseudo.js.map +1 -0
  207. package/lib/module/web/convert/shadow/boxShadow.js +57 -0
  208. package/lib/module/web/convert/shadow/boxShadow.js.map +1 -0
  209. package/lib/module/web/convert/shadow/getShadowBreakpoints.js +33 -0
  210. package/lib/module/web/convert/shadow/getShadowBreakpoints.js.map +1 -0
  211. package/lib/module/web/convert/shadow/index.js +5 -0
  212. package/lib/module/web/convert/shadow/index.js.map +1 -0
  213. package/lib/module/web/convert/shadow/textShadow.js +54 -0
  214. package/lib/module/web/convert/shadow/textShadow.js.map +1 -0
  215. package/lib/module/web/convert/style.js +88 -0
  216. package/lib/module/web/convert/style.js.map +1 -0
  217. package/lib/module/web/convert/types.js +5 -0
  218. package/lib/module/web/convert/types.js.map +1 -0
  219. package/lib/module/web/convert/utils.js +45 -0
  220. package/lib/module/web/convert/utils.js.map +1 -0
  221. package/lib/module/web/create.js +44 -0
  222. package/lib/module/web/create.js.map +1 -0
  223. package/lib/module/web/index.js +26 -0
  224. package/lib/module/web/index.js.map +1 -0
  225. package/lib/module/web/listener.js +57 -0
  226. package/lib/module/web/listener.js.map +1 -0
  227. package/lib/module/web/mock.js +23 -0
  228. package/lib/module/web/mock.js.map +1 -0
  229. package/lib/module/web/registry.js +168 -0
  230. package/lib/module/web/registry.js.map +1 -0
  231. package/lib/module/web/runtime.js +169 -0
  232. package/lib/module/web/runtime.js.map +1 -0
  233. package/lib/module/web/shadowRegistry.js +138 -0
  234. package/lib/module/web/shadowRegistry.js.map +1 -0
  235. package/lib/module/web/state.js +69 -0
  236. package/lib/module/web/state.js.map +1 -0
  237. package/lib/module/web/utils/common.js +28 -0
  238. package/lib/module/web/utils/common.js.map +1 -0
  239. package/lib/module/web/utils/index.js +5 -0
  240. package/lib/module/web/utils/index.js.map +1 -0
  241. package/lib/module/web/utils/unistyle.js +72 -0
  242. package/lib/module/web/utils/unistyle.js.map +1 -0
  243. package/lib/module/web/variants/getVariants.js +34 -0
  244. package/lib/module/web/variants/getVariants.js.map +1 -0
  245. package/lib/module/web/variants/index.js +5 -0
  246. package/lib/module/web/variants/index.js.map +1 -0
  247. package/lib/module/web/variants/useVariants.js +54 -0
  248. package/lib/module/web/variants/useVariants.js.map +1 -0
  249. package/lib/typescript/src/components/Display.d.ts +7 -0
  250. package/lib/typescript/src/components/Display.d.ts.map +1 -0
  251. package/lib/typescript/src/components/Hide.d.ts +7 -0
  252. package/lib/typescript/src/components/Hide.d.ts.map +1 -0
  253. package/lib/typescript/src/components/index.d.ts +3 -0
  254. package/lib/typescript/src/components/index.d.ts.map +1 -0
  255. package/lib/typescript/src/components/useMedia.d.ts +6 -0
  256. package/lib/typescript/src/components/useMedia.d.ts.map +1 -0
  257. package/lib/typescript/src/components/useMedia.web.d.ts +6 -0
  258. package/lib/typescript/src/components/useMedia.web.d.ts.map +1 -0
  259. package/lib/typescript/src/core/createUnistylesComponent.d.ts +8 -0
  260. package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +1 -0
  261. package/lib/typescript/src/core/createUnistylesComponent.native.d.ts +8 -0
  262. package/lib/typescript/src/core/createUnistylesComponent.native.d.ts.map +1 -0
  263. package/lib/typescript/src/core/index.d.ts +2 -0
  264. package/lib/typescript/src/core/index.d.ts.map +1 -0
  265. package/lib/typescript/src/index.d.ts +3 -0
  266. package/lib/typescript/src/index.d.ts.map +1 -1
  267. package/lib/typescript/src/mq.d.ts +8 -0
  268. package/lib/typescript/src/mq.d.ts.map +1 -1
  269. package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +7 -5
  270. package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
  271. package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts +0 -1
  272. package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts.map +1 -1
  273. package/lib/typescript/src/specs/NavigtionBar/index.d.ts +1 -10
  274. package/lib/typescript/src/specs/NavigtionBar/index.d.ts.map +1 -1
  275. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +4 -4
  276. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
  277. package/lib/typescript/src/specs/ShadowRegistry/types.d.ts +3 -0
  278. package/lib/typescript/src/specs/ShadowRegistry/types.d.ts.map +1 -1
  279. package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts +0 -1
  280. package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts.map +1 -1
  281. package/lib/typescript/src/specs/StatusBar/index.d.ts +2 -4
  282. package/lib/typescript/src/specs/StatusBar/index.d.ts.map +1 -1
  283. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +3 -1
  284. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -1
  285. package/lib/typescript/src/specs/StyleSheet/index.d.ts +3 -1
  286. package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
  287. package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts +1 -1
  288. package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts.map +1 -1
  289. package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts +3 -1
  290. package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
  291. package/lib/typescript/src/specs/index.d.ts +4 -2
  292. package/lib/typescript/src/specs/index.d.ts.map +1 -1
  293. package/lib/typescript/src/specs/index.web.d.ts +1 -1
  294. package/lib/typescript/src/specs/index.web.d.ts.map +1 -1
  295. package/lib/typescript/src/types/breakpoints.d.ts +11 -11
  296. package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
  297. package/lib/typescript/src/types/common.d.ts +1 -0
  298. package/lib/typescript/src/types/common.d.ts.map +1 -1
  299. package/lib/typescript/src/types/index.d.ts +1 -1
  300. package/lib/typescript/src/types/index.d.ts.map +1 -1
  301. package/lib/typescript/src/types/stylesheet.d.ts +6 -4
  302. package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
  303. package/lib/typescript/src/types/variants.d.ts +4 -1
  304. package/lib/typescript/src/types/variants.d.ts.map +1 -1
  305. package/lib/typescript/src/utils.d.ts +2 -0
  306. package/lib/typescript/src/utils.d.ts.map +1 -0
  307. package/lib/typescript/src/web/convert/index.d.ts +3 -0
  308. package/lib/typescript/src/web/convert/index.d.ts.map +1 -0
  309. package/lib/typescript/src/web/convert/object/boxShadow.d.ts +9 -0
  310. package/lib/typescript/src/web/convert/object/boxShadow.d.ts.map +1 -0
  311. package/lib/typescript/src/web/convert/object/filter.d.ts +3 -0
  312. package/lib/typescript/src/web/convert/object/filter.d.ts.map +1 -0
  313. package/lib/typescript/src/web/convert/object/index.d.ts +4 -0
  314. package/lib/typescript/src/web/convert/object/index.d.ts.map +1 -0
  315. package/lib/typescript/src/web/convert/object/objectStyle.d.ts +5 -0
  316. package/lib/typescript/src/web/convert/object/objectStyle.d.ts.map +1 -0
  317. package/lib/typescript/src/web/convert/object/transform.d.ts +3 -0
  318. package/lib/typescript/src/web/convert/object/transform.d.ts.map +1 -0
  319. package/lib/typescript/src/web/convert/pseudo.d.ts +6 -0
  320. package/lib/typescript/src/web/convert/pseudo.d.ts.map +1 -0
  321. package/lib/typescript/src/web/convert/shadow/boxShadow.d.ts +8 -0
  322. package/lib/typescript/src/web/convert/shadow/boxShadow.d.ts.map +1 -0
  323. package/lib/typescript/src/web/convert/shadow/getShadowBreakpoints.d.ts +2 -0
  324. package/lib/typescript/src/web/convert/shadow/getShadowBreakpoints.d.ts.map +1 -0
  325. package/lib/typescript/src/web/convert/shadow/index.d.ts +3 -0
  326. package/lib/typescript/src/web/convert/shadow/index.d.ts.map +1 -0
  327. package/lib/typescript/src/web/convert/shadow/textShadow.d.ts +8 -0
  328. package/lib/typescript/src/web/convert/shadow/textShadow.d.ts.map +1 -0
  329. package/lib/typescript/src/web/convert/style.d.ts +2 -0
  330. package/lib/typescript/src/web/convert/style.d.ts.map +1 -0
  331. package/lib/typescript/{web → src/web}/convert/types.d.ts +8 -2
  332. package/lib/typescript/src/web/convert/types.d.ts.map +1 -0
  333. package/lib/typescript/src/web/convert/utils.d.ts +12 -0
  334. package/lib/typescript/src/web/convert/utils.d.ts.map +1 -0
  335. package/lib/typescript/src/web/create.d.ts +1443 -0
  336. package/lib/typescript/{web → src/web}/create.d.ts.map +1 -1
  337. package/lib/typescript/src/web/index.d.ts +1459 -0
  338. package/lib/typescript/{web → src/web}/index.d.ts.map +1 -1
  339. package/lib/typescript/{web/listener → src/web}/listener.d.ts +5 -2
  340. package/lib/typescript/src/web/listener.d.ts.map +1 -0
  341. package/lib/typescript/src/web/mock.d.ts +5 -0
  342. package/lib/typescript/src/web/mock.d.ts.map +1 -0
  343. package/lib/typescript/src/web/registry.d.ts +24 -0
  344. package/lib/typescript/src/web/registry.d.ts.map +1 -0
  345. package/lib/typescript/{web → src/web}/runtime.d.ts +11 -10
  346. package/lib/typescript/src/web/runtime.d.ts.map +1 -0
  347. package/lib/typescript/src/web/shadowRegistry.d.ts +17 -0
  348. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -0
  349. package/lib/typescript/src/web/state.d.ts +18 -0
  350. package/lib/typescript/src/web/state.d.ts.map +1 -0
  351. package/lib/typescript/src/web/utils/common.d.ts +8 -0
  352. package/lib/typescript/src/web/utils/common.d.ts.map +1 -0
  353. package/lib/typescript/src/web/utils/index.d.ts +3 -0
  354. package/lib/typescript/src/web/utils/index.d.ts.map +1 -0
  355. package/lib/typescript/src/web/utils/unistyle.d.ts +20 -0
  356. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -0
  357. package/lib/typescript/src/web/variants/getVariants.d.ts +3 -0
  358. package/lib/typescript/src/web/variants/getVariants.d.ts.map +1 -0
  359. package/lib/typescript/src/web/variants/index.d.ts +3 -0
  360. package/lib/typescript/src/web/variants/index.d.ts.map +1 -0
  361. package/lib/typescript/src/web/variants/useVariants.d.ts +3 -0
  362. package/lib/typescript/src/web/variants/useVariants.d.ts.map +1 -0
  363. package/nitrogen/generated/android/c++/JColorScheme.hpp +1 -1
  364. package/nitrogen/generated/android/c++/JFunc_void_UnistylesNativeMiniRuntime.hpp +57 -0
  365. package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp +69 -0
  366. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +35 -34
  367. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +15 -6
  368. package/nitrogen/generated/android/c++/JOrientation.hpp +1 -1
  369. package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +4 -1
  370. package/nitrogen/generated/android/c++/JUnistylesNativeMiniRuntime.hpp +9 -7
  371. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Dimensions.kt +1 -0
  372. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/{Func_void_std__vector_UnistyleDependency_.kt → Func_void_UnistylesNativeMiniRuntime.kt} +6 -5
  373. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.kt +46 -0
  374. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +25 -13
  375. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Insets.kt +1 -0
  376. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistyleDependency.kt +2 -1
  377. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt +3 -1
  378. package/nitrogen/generated/android/unistyles+autolinking.cmake +13 -1
  379. package/nitrogen/generated/android/unistyles+autolinking.gradle +2 -0
  380. package/nitrogen/generated/android/{UnistylesOnLoad.cpp → unistylesOnLoad.cpp} +6 -4
  381. package/nitrogen/generated/android/{UnistylesOnLoad.hpp → unistylesOnLoad.hpp} +1 -1
  382. package/nitrogen/generated/ios/Unistyles+autolinking.rb +6 -4
  383. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +25 -0
  384. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +73 -38
  385. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +0 -29
  386. package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +8 -8
  387. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +4 -16
  388. package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +156 -115
  389. package/nitrogen/generated/ios/swift/UnistyleDependency.swift +4 -0
  390. package/nitrogen/generated/ios/swift/UnistylesNativeMiniRuntime.swift +16 -5
  391. package/nitrogen/generated/shared/c++/ColorScheme.hpp +2 -2
  392. package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +2 -2
  393. package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +6 -3
  394. package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.cpp +0 -1
  395. package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +3 -1
  396. package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.cpp +1 -0
  397. package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.hpp +5 -0
  398. package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.hpp +3 -0
  399. package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.cpp +0 -1
  400. package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +3 -1
  401. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +2 -1
  402. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +10 -4
  403. package/nitrogen/generated/shared/c++/Orientation.hpp +2 -2
  404. package/nitrogen/generated/shared/c++/UnistyleDependency.hpp +2 -1
  405. package/nitrogen/generated/shared/c++/UnistylesCxxMiniRuntime.hpp +10 -9
  406. package/nitrogen/generated/shared/c++/UnistylesNativeMiniRuntime.hpp +9 -8
  407. package/package.json +20 -30
  408. package/plugin/common.js +31 -3
  409. package/plugin/index.js +107 -18
  410. package/plugin/ref.js +129 -13
  411. package/plugin/style.js +189 -22
  412. package/plugin/stylesheet.js +53 -3
  413. package/plugin/variants.js +33 -0
  414. package/src/components/Display.tsx +12 -0
  415. package/src/components/Hide.tsx +12 -0
  416. package/src/components/index.ts +2 -0
  417. package/src/components/useMedia.ts +64 -0
  418. package/src/components/useMedia.web.ts +47 -0
  419. package/src/core/createUnistylesComponent.native.tsx +83 -0
  420. package/src/core/createUnistylesComponent.tsx +84 -0
  421. package/src/core/index.ts +1 -0
  422. package/src/index.ts +3 -12
  423. package/src/mq.ts +27 -9
  424. package/src/specs/NativePlatform/NativePlatform.nitro.ts +7 -5
  425. package/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.ts +0 -1
  426. package/src/specs/NavigtionBar/index.ts +1 -25
  427. package/src/specs/ShadowRegistry/index.ts +16 -10
  428. package/src/specs/ShadowRegistry/types.ts +4 -1
  429. package/src/specs/StatusBar/UnistylesStatusBar.nitro.ts +0 -1
  430. package/src/specs/StatusBar/index.ts +2 -12
  431. package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +4 -1
  432. package/src/specs/StyleSheet/index.ts +6 -1
  433. package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.ts +1 -1
  434. package/src/specs/UnistylesRuntime/index.ts +5 -4
  435. package/src/specs/index.ts +6 -2
  436. package/src/specs/index.web.ts +1 -1
  437. package/src/types/breakpoints.ts +25 -13
  438. package/src/types/common.ts +1 -0
  439. package/src/types/index.ts +1 -1
  440. package/src/types/stylesheet.ts +7 -5
  441. package/src/types/variants.ts +7 -1
  442. package/src/utils.ts +22 -0
  443. package/{web → src/web}/convert/index.ts +25 -25
  444. package/src/web/convert/object/boxShadow.ts +55 -0
  445. package/src/web/convert/object/filter.ts +39 -0
  446. package/src/web/convert/object/index.ts +3 -0
  447. package/src/web/convert/object/objectStyle.ts +69 -0
  448. package/src/web/convert/object/transform.ts +24 -0
  449. package/src/web/convert/pseudo.ts +137 -0
  450. package/src/web/convert/shadow/boxShadow.ts +50 -0
  451. package/src/web/convert/shadow/getShadowBreakpoints.ts +34 -0
  452. package/src/web/convert/shadow/index.ts +2 -0
  453. package/src/web/convert/shadow/textShadow.ts +48 -0
  454. package/{web → src/web}/convert/style.ts +61 -10
  455. package/{web → src/web}/convert/types.ts +9 -2
  456. package/{web → src/web}/convert/utils.ts +11 -5
  457. package/src/web/create.ts +48 -0
  458. package/{web → src/web}/index.ts +4 -3
  459. package/src/web/listener.ts +63 -0
  460. package/{web → src/web}/mock.ts +3 -14
  461. package/src/web/registry.ts +215 -0
  462. package/{web → src/web}/runtime.ts +32 -21
  463. package/src/web/shadowRegistry.ts +145 -0
  464. package/src/web/state.ts +94 -0
  465. package/src/web/utils/common.ts +45 -0
  466. package/src/web/utils/index.ts +2 -0
  467. package/src/web/utils/unistyle.ts +108 -0
  468. package/src/web/variants/getVariants.ts +42 -0
  469. package/src/web/variants/index.ts +2 -0
  470. package/src/web/variants/useVariants.ts +65 -0
  471. package/android/src/main/cxx/helpers.cpp +0 -105
  472. package/android/src/main/cxx/helpers.h +0 -16
  473. package/android/src/main/cxx/platform.cpp +0 -170
  474. package/android/src/main/cxx/platform.h +0 -20
  475. package/lib/typescript/example/App.d.ts +0 -4
  476. package/lib/typescript/example/App.d.ts.map +0 -1
  477. package/lib/typescript/example/unistyles.d.ts +0 -63
  478. package/lib/typescript/example/unistyles.d.ts.map +0 -1
  479. package/lib/typescript/expo-example/App.d.ts +0 -4
  480. package/lib/typescript/expo-example/App.d.ts.map +0 -1
  481. package/lib/typescript/expo-example/unistyles.d.ts +0 -63
  482. package/lib/typescript/expo-example/unistyles.d.ts.map +0 -1
  483. package/lib/typescript/web/convert/boxShadow.d.ts +0 -3
  484. package/lib/typescript/web/convert/boxShadow.d.ts.map +0 -1
  485. package/lib/typescript/web/convert/breakpoint.d.ts +0 -3
  486. package/lib/typescript/web/convert/breakpoint.d.ts.map +0 -1
  487. package/lib/typescript/web/convert/index.d.ts +0 -4
  488. package/lib/typescript/web/convert/index.d.ts.map +0 -1
  489. package/lib/typescript/web/convert/shadow.d.ts +0 -2
  490. package/lib/typescript/web/convert/shadow.d.ts.map +0 -1
  491. package/lib/typescript/web/convert/style.d.ts +0 -3
  492. package/lib/typescript/web/convert/style.d.ts.map +0 -1
  493. package/lib/typescript/web/convert/textShadow.d.ts +0 -3
  494. package/lib/typescript/web/convert/textShadow.d.ts.map +0 -1
  495. package/lib/typescript/web/convert/transform.d.ts +0 -5
  496. package/lib/typescript/web/convert/transform.d.ts.map +0 -1
  497. package/lib/typescript/web/convert/types.d.ts.map +0 -1
  498. package/lib/typescript/web/convert/utils.d.ts +0 -8
  499. package/lib/typescript/web/convert/utils.d.ts.map +0 -1
  500. package/lib/typescript/web/create.d.ts +0 -2449
  501. package/lib/typescript/web/index.d.ts +0 -2464
  502. package/lib/typescript/web/listener/index.d.ts +0 -2
  503. package/lib/typescript/web/listener/index.d.ts.map +0 -1
  504. package/lib/typescript/web/listener/listener.d.ts.map +0 -1
  505. package/lib/typescript/web/mock.d.ts +0 -14
  506. package/lib/typescript/web/mock.d.ts.map +0 -1
  507. package/lib/typescript/web/mq.d.ts +0 -4
  508. package/lib/typescript/web/mq.d.ts.map +0 -1
  509. package/lib/typescript/web/pseudo.d.ts +0 -4
  510. package/lib/typescript/web/pseudo.d.ts.map +0 -1
  511. package/lib/typescript/web/registry.d.ts +0 -12
  512. package/lib/typescript/web/registry.d.ts.map +0 -1
  513. package/lib/typescript/web/runtime.d.ts.map +0 -1
  514. package/lib/typescript/web/state.d.ts +0 -24
  515. package/lib/typescript/web/state.d.ts.map +0 -1
  516. package/lib/typescript/web/useVariants.d.ts +0 -3
  517. package/lib/typescript/web/useVariants.d.ts.map +0 -1
  518. package/lib/typescript/web/utils.d.ts +0 -18
  519. package/lib/typescript/web/utils.d.ts.map +0 -1
  520. package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency_.hpp +0 -60
  521. package/plugin/__tests__/dependencies.spec.js +0 -360
  522. package/plugin/__tests__/ref.spec.js +0 -991
  523. package/plugin/__tests__/stylesheet.spec.js +0 -396
  524. package/web/convert/boxShadow.ts +0 -72
  525. package/web/convert/breakpoint.ts +0 -21
  526. package/web/convert/shadow.ts +0 -68
  527. package/web/convert/textShadow.ts +0 -69
  528. package/web/convert/transform.ts +0 -89
  529. package/web/create.ts +0 -102
  530. package/web/listener/index.ts +0 -1
  531. package/web/listener/listener.ts +0 -33
  532. package/web/mq.ts +0 -19
  533. package/web/pseudo.ts +0 -11
  534. package/web/registry.ts +0 -41
  535. package/web/state.ts +0 -148
  536. package/web/useVariants.ts +0 -99
  537. package/web/utils.ts +0 -95
  538. /package/nitrogen/generated/android/{UnistylesOnLoad.kt → unistylesOnLoad.kt} +0 -0
  539. /package/{web → src/web}/convert/module.d.ts +0 -0
@@ -9,24 +9,25 @@ double HybridStyleSheet::getHairlineWidth() {
9
9
  return nearestPixel / pixelRatio;
10
10
  }
11
11
 
12
- double HybridStyleSheet::get___unid() {
12
+ double HybridStyleSheet::getUnid() {
13
13
  return this->__unid;
14
14
  }
15
15
 
16
- jsi::Value HybridStyleSheet::create(jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *arguments, size_t count) {
17
- helpers::assertThat(rt, count == 1, "StyleSheet.create expected to be called with one argument.");
16
+ jsi::Value HybridStyleSheet::create(jsi::Runtime& rt, const jsi::Value &thisVal, const jsi::Value *arguments, size_t count) {
17
+ if (count == 1) {
18
+ helpers::assertThat(rt, false, "Unistyles is not initialized correctly. Please add babel plugin to your babel config.");
19
+ }
20
+
21
+ // second argument is hidden, so validation is perfectly fine
22
+ helpers::assertThat(rt, count == 2, "StyleSheet.create expected to be called with one argument.");
18
23
  helpers::assertThat(rt, arguments[0].isObject(), "StyleSheet.create expected to be called with object or function.");
19
24
 
20
25
  auto thisStyleSheet = thisVal.asObject(rt);
21
26
  auto& registry = core::UnistylesRegistry::get();
22
-
23
- // this might happen only when hot reloading
24
- if (this->__unid != -1) {
25
- registry.removeStyleSheet(this->__unid);
26
- }
27
+ int unid = arguments[1].asNumber();
27
28
 
28
29
  jsi::Object rawStyleSheet = arguments[0].asObject(rt);
29
- auto registeredStyleSheet = registry.addStyleSheetFromValue(rt, std::move(rawStyleSheet));
30
+ auto registeredStyleSheet = registry.addStyleSheetFromValue(rt, std::move(rawStyleSheet), unid);
30
31
 
31
32
  this->__unid = registeredStyleSheet->tag;
32
33
 
@@ -45,11 +46,7 @@ jsi::Value HybridStyleSheet::configure(jsi::Runtime &rt, const jsi::Value &thisV
45
46
  helpers::assertThat(rt, count == 1, "StyleSheet.configure expected to be called with one argument.");
46
47
  helpers::assertThat(rt, arguments[0].isObject(), "StyleSheet.configure expected to be called with object.");
47
48
 
48
- // create new state
49
49
  auto config = arguments[0].asObject(rt);
50
- auto& registry = core::UnistylesRegistry::get();
51
-
52
- registry.createState(rt);
53
50
 
54
51
  helpers::enumerateJSIObject(rt, config, [&](const std::string& propertyName, jsi::Value& propertyValue){
55
52
  if (propertyName == "settings") {
@@ -74,7 +71,22 @@ jsi::Value HybridStyleSheet::configure(jsi::Runtime &rt, const jsi::Value &thisV
74
71
  });
75
72
 
76
73
  verifyAndSelectTheme(rt);
74
+
75
+ auto& state = core::UnistylesRegistry::get().getState(rt);
76
+
77
+ state.hasUserConfig = true;
78
+
79
+ return jsi::Value::undefined();
80
+ }
81
+
82
+ jsi::Value HybridStyleSheet::init(jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *arguments, size_t count) {
83
+ // create new state
84
+ auto& registry = core::UnistylesRegistry::get();
85
+
86
+ registry.createState(rt);
87
+
77
88
  loadExternalMethods(thisVal, rt);
89
+ registerHooks(rt);
78
90
 
79
91
  return jsi::Value::undefined();
80
92
  }
@@ -116,7 +128,7 @@ void HybridStyleSheet::parseSettings(jsi::Runtime &rt, jsi::Object settings) {
116
128
  void HybridStyleSheet::parseBreakpoints(jsi::Runtime &rt, jsi::Object breakpoints){
117
129
  helpers::Breakpoints sortedBreakpoints = helpers::jsiBreakpointsToVecPairs(rt, std::move(breakpoints));
118
130
 
119
- helpers::assertThat(rt, sortedBreakpoints.size() > 0, "StyleSheet.configure's breakpoints can't be empty.");
131
+ helpers::assertThat(rt, !sortedBreakpoints.empty(), "StyleSheet.configure's breakpoints can't be empty.");
120
132
  helpers::assertThat(rt, sortedBreakpoints.front().second == 0, "StyleSheet.configure's first breakpoint must start from 0.");
121
133
 
122
134
  auto& registry = core::UnistylesRegistry::get();
@@ -132,11 +144,10 @@ void HybridStyleSheet::parseThemes(jsi::Runtime &rt, jsi::Object themes) {
132
144
  helpers::enumerateJSIObject(rt, themes, [&](const std::string& propertyName, jsi::Value& propertyValue){
133
145
  helpers::assertThat(rt, propertyValue.isObject(), "StyleSheet.configure's registered theme '" + propertyName + "' must be an object.");
134
146
 
135
- registry.registerTheme(rt, propertyName, propertyValue.asObject(rt));
147
+ registry.registerTheme(rt, propertyName, propertyValue);
136
148
  });
137
149
  }
138
150
 
139
-
140
151
  void HybridStyleSheet::verifyAndSelectTheme(jsi::Runtime &rt) {
141
152
  auto& state = core::UnistylesRegistry::get().getState(rt);
142
153
 
@@ -186,7 +197,7 @@ void HybridStyleSheet::verifyAndSelectTheme(jsi::Runtime &rt) {
186
197
 
187
198
  void HybridStyleSheet::setThemeFromColorScheme(jsi::Runtime& rt) {
188
199
  auto& state = core::UnistylesRegistry::get().getState(rt);
189
- ColorScheme colorScheme = static_cast<ColorScheme>(this->_unistylesRuntime->getColorScheme());
200
+ auto colorScheme = static_cast<ColorScheme>(this->_unistylesRuntime->getColorScheme());
190
201
 
191
202
  switch (colorScheme) {
192
203
  case ColorScheme::LIGHT:
@@ -218,19 +229,139 @@ void HybridStyleSheet::loadExternalMethods(const jsi::Value& thisValue, jsi::Run
218
229
  state.registerProcessColorFunction(std::move(processColorFn));
219
230
  }
220
231
 
232
+ void HybridStyleSheet::registerHooks(jsi::Runtime& rt) {
233
+ // cleanup Shadow updates
234
+ core::UnistylesRegistry::get().trafficController.restore();
235
+
236
+ this->_unistylesCommitHook = std::make_shared<core::UnistylesCommitHook>(this->_uiManager);
237
+ this->_unistylesMountHook = std::make_shared<core::UnistylesMountHook>(this->_uiManager, this->_unistylesRuntime);
238
+ }
239
+
221
240
  void HybridStyleSheet::onPlatformDependenciesChange(std::vector<UnistyleDependency> dependencies) {
241
+ // this event listener is triggered from C++ module, and it's only about theme / adaptive theme changes
242
+ if (dependencies.size() == 0) {
243
+ return;
244
+ }
245
+
222
246
  auto& registry = core::UnistylesRegistry::get();
223
- auto parser = parser::Parser(this->_unistylesRuntime);
224
- auto dependencyMap = registry.buildDependencyMap(dependencies);
225
247
  auto& rt = this->_unistylesRuntime->getRuntime();
248
+ auto parser = parser::Parser(this->_unistylesRuntime);
249
+ auto dependencyMap = registry.buildDependencyMap(rt, dependencies);
250
+
251
+ if (dependencyMap.empty()) {
252
+ this->notifyJSListeners(dependencies);
253
+
254
+ return;
255
+ }
256
+
257
+ // in a later step, we will rebuild only Unistyles with mounted StyleSheets
258
+ // however, user may have StyleSheets with components that haven't mounted yet
259
+ // we need to rebuild all dependent StyleSheets as well
260
+ auto dependentStyleSheets = registry.getStyleSheetsToRefresh(rt, dependencies);
261
+
262
+ parser.rebuildUnistylesInDependencyMap(rt, dependencyMap, dependentStyleSheets, std::nullopt);
263
+ parser.rebuildShadowLeafUpdates(rt, dependencyMap);
264
+
265
+ this->notifyJSListeners(dependencies);
266
+ shadow::ShadowTreeManager::updateShadowTree(UIManagerBinding::getBinding(rt)->getUIManager().getShadowTreeRegistry());
267
+ }
268
+
269
+ void HybridStyleSheet::onPlatformNativeDependenciesChange(std::vector<UnistyleDependency> dependencies, UnistylesNativeMiniRuntime miniRuntime) {
270
+ // this event listener is triggered from Native platform
271
+ if (dependencies.size() == 0 || this->_unistylesRuntime == nullptr) {
272
+ return;
273
+ }
274
+
275
+ this->_unistylesRuntime->runOnJSThread([this, dependencies, miniRuntime](jsi::Runtime& rt){
276
+ auto& registry = core::UnistylesRegistry::get();
277
+ auto parser = parser::Parser(this->_unistylesRuntime);
278
+ auto unistyleDependencies = std::move(dependencies);
279
+
280
+ // re-compute new breakpoint
281
+ auto dimensionsIt = std::find(dependencies.begin(), dependencies.end(), UnistyleDependency::DIMENSIONS);
282
+
283
+ if (dimensionsIt != dependencies.end()) {
284
+ registry.getState(rt).computeCurrentBreakpoint(this->_unistylesRuntime->getScreen().width);
285
+ }
286
+
287
+ // check if color scheme changed and then if Unistyles state depend on it (adaptive themes)
288
+ auto colorSchemeIt = std::find(dependencies.begin(), dependencies.end(), UnistyleDependency::COLORSCHEME);
289
+ auto hasNewColorScheme = colorSchemeIt != dependencies.end();
290
+
291
+ if (hasNewColorScheme) {
292
+ this->_unistylesRuntime->includeDependenciesForColorSchemeChange(unistyleDependencies);
293
+ }
294
+
295
+ auto dependencyMap = registry.buildDependencyMap(rt, unistyleDependencies);
296
+
297
+ if (dependencyMap.empty()) {
298
+ this->notifyJSListeners(unistyleDependencies);
299
+
300
+ return;
301
+ }
302
+
303
+ // in a later step, we will rebuild only Unistyles with mounted StyleSheets
304
+ // however, user may have StyleSheets with components that haven't mounted yet
305
+ // we need to rebuild all dependent StyleSheets as well
306
+ auto dependentStyleSheets = registry.getStyleSheetsToRefresh(rt, unistyleDependencies);
307
+
308
+ parser.rebuildUnistylesInDependencyMap(rt, dependencyMap, dependentStyleSheets, miniRuntime);
309
+ parser.rebuildShadowLeafUpdates(rt, dependencyMap);
226
310
 
227
- if (dependencyMap.size() == 0) {
311
+ this->notifyJSListeners(unistyleDependencies);
312
+ shadow::ShadowTreeManager::updateShadowTree(UIManagerBinding::getBinding(rt)->getUIManager().getShadowTreeRegistry());
313
+ });
314
+ }
315
+
316
+ void HybridStyleSheet::onImeChange(UnistylesNativeMiniRuntime miniRuntime) {
317
+ if (this->_unistylesRuntime == nullptr) {
228
318
  return;
229
319
  }
230
320
 
231
- parser.rebuildUnistylesInDependencyMap(rt, dependencyMap);
321
+ this->_unistylesRuntime->runOnJSThread([this, miniRuntime](jsi::Runtime& rt){
322
+ std::vector<UnistyleDependency> dependencies{UnistyleDependency::IME};
323
+ auto& registry = core::UnistylesRegistry::get();
324
+ auto parser = parser::Parser(this->_unistylesRuntime);
325
+ auto dependencyMap = registry.buildDependencyMap(rt, dependencies);
326
+
327
+ if (dependencyMap.empty()) {
328
+ this->notifyJSListeners(dependencies);
329
+
330
+ return;
331
+ }
332
+
333
+ // we don't care about other unmounted stylesheets as their not visible
334
+ // so user won't see any changes
335
+ std::vector<std::shared_ptr<core::StyleSheet>> dependentStyleSheets;
336
+
337
+ parser.rebuildUnistylesInDependencyMap(rt, dependencyMap, dependentStyleSheets, miniRuntime);
338
+ parser.rebuildShadowLeafUpdates(rt, dependencyMap);
339
+
340
+ this->notifyJSListeners(dependencies);
341
+ shadow::ShadowTreeManager::updateShadowTree(UIManagerBinding::getBinding(rt)->getUIManager().getShadowTreeRegistry());
342
+ });
343
+ }
344
+
345
+ void HybridStyleSheet::notifyJSListeners(std::vector<UnistyleDependency>& dependencies) {
346
+ if (!dependencies.empty()) {
347
+ std::for_each(this->_changeListeners.begin(), this->_changeListeners.end(), [&](auto& listener){
348
+ (*listener)(dependencies);
349
+ });
350
+ }
351
+ }
352
+
353
+ std::function<void ()> HybridStyleSheet::addChangeListener(const std::function<void (const std::vector<UnistyleDependency>&)>& onChanged) {
354
+ auto listener = std::make_unique<std::function<void(std::vector<UnistyleDependency>&)>>(onChanged);
232
355
 
233
- auto shadowLeafUpdates = parser.dependencyMapToShadowLeafUpdates(dependencyMap);
356
+ this->_changeListeners.push_back(std::move(listener));
234
357
 
235
- shadow::ShadowTreeManager::updateShadowTree(rt, shadowLeafUpdates);
358
+ return [this, listenerPtr = this->_changeListeners.back().get()](){
359
+ auto it = std::find_if(this->_changeListeners.begin(), this->_changeListeners.end(), [listenerPtr](auto& ptr) {
360
+ return ptr.get() == listenerPtr;
361
+ });
362
+
363
+ if (it != this->_changeListeners.end()) {
364
+ this->_changeListeners.erase(it);
365
+ }
366
+ };
236
367
  }
@@ -9,21 +9,30 @@
9
9
  #include "Constants.h"
10
10
  #include "Breakpoints.h"
11
11
  #include "Parser.h"
12
- #include "ShadowTreeManager.h"
13
12
  #include "UnistylesCommitHook.h"
13
+ #include "UnistylesMountHook.h"
14
14
 
15
15
  using namespace margelo::nitro::unistyles;
16
16
  using namespace facebook::react;
17
17
 
18
18
  struct HybridStyleSheet: public HybridUnistylesStyleSheetSpec {
19
19
  HybridStyleSheet(std::shared_ptr<HybridUnistylesRuntime> unistylesRuntime, std::shared_ptr<UIManager> uiManager)
20
- : HybridObject(TAG), _unistylesRuntime{unistylesRuntime} {
21
- this->_unistylesCommitHook = std::make_shared<core::UnistylesCommitHook>(uiManager, unistylesRuntime);
20
+ : HybridObject(TAG), _unistylesRuntime{unistylesRuntime}, _uiManager{uiManager} {
22
21
  this->_unistylesRuntime->registerPlatformListener(
23
22
  std::bind(&HybridStyleSheet::onPlatformDependenciesChange, this, std::placeholders::_1)
24
23
  );
24
+ this->_unistylesRuntime->registerNativePlatformListener(
25
+ std::bind(&HybridStyleSheet::onPlatformNativeDependenciesChange, this, std::placeholders::_1, std::placeholders::_2)
26
+ );
27
+ this->_unistylesRuntime->registerImeListener(
28
+ std::bind(&HybridStyleSheet::onImeChange, this, std::placeholders::_1)
29
+ );
25
30
  }
26
31
 
32
+ ~HybridStyleSheet() {
33
+ this->_unistylesRuntime->unregisterNativePlatformListeners();
34
+ }
35
+
27
36
  jsi::Value create(jsi::Runtime& rt,
28
37
  const jsi::Value& thisValue,
29
38
  const jsi::Value* args,
@@ -32,19 +41,25 @@ struct HybridStyleSheet: public HybridUnistylesStyleSheetSpec {
32
41
  const jsi::Value& thisValue,
33
42
  const jsi::Value* args,
34
43
  size_t count);
44
+ jsi::Value init(jsi::Runtime& rt,
45
+ const jsi::Value& thisValue,
46
+ const jsi::Value* args,
47
+ size_t count);
35
48
 
36
49
  void loadHybridMethods() override {
37
50
  HybridUnistylesStyleSheetSpec::loadHybridMethods();
38
51
 
39
52
  registerHybrids(this, [](Prototype& prototype) {
53
+ prototype.registerRawHybridMethod("init", 1, &HybridStyleSheet::init);
40
54
  prototype.registerRawHybridMethod("create", 1, &HybridStyleSheet::create);
41
55
  prototype.registerRawHybridMethod("configure", 1, &HybridStyleSheet::configure);
42
56
  });
43
57
  };
44
58
 
45
59
  double getHairlineWidth() override;
46
- double get___unid() override;
47
-
60
+ double getUnid() override;
61
+ std::function<void ()> addChangeListener(const std::function<void (const std::vector<UnistyleDependency> &)>& onChanged) override;
62
+
48
63
  private:
49
64
  void parseSettings(jsi::Runtime& rt, jsi::Object settings);
50
65
  void parseBreakpoints(jsi::Runtime& rt, jsi::Object breakpoints);
@@ -52,10 +67,17 @@ private:
52
67
  void verifyAndSelectTheme(jsi::Runtime &rt);
53
68
  void setThemeFromColorScheme(jsi::Runtime& rt);
54
69
  void loadExternalMethods(const jsi::Value& thisValue, jsi::Runtime& rt);
70
+ void registerHooks(jsi::Runtime& rt);
55
71
  void onPlatformDependenciesChange(std::vector<UnistyleDependency> dependencies);
72
+ void onPlatformNativeDependenciesChange(std::vector<UnistyleDependency> dependencies, UnistylesNativeMiniRuntime miniRuntime);
73
+ void onImeChange(UnistylesNativeMiniRuntime miniRuntime);
74
+ void notifyJSListeners(std::vector<UnistyleDependency>& dependencies);
56
75
 
57
76
  double __unid = -1;
77
+ std::vector<std::unique_ptr<const std::function<void(std::vector<UnistyleDependency>&)>>> _changeListeners{};
58
78
  std::shared_ptr<HybridUnistylesRuntime> _unistylesRuntime;
59
79
  std::shared_ptr<core::UnistylesCommitHook> _unistylesCommitHook;
80
+ std::shared_ptr<core::UnistylesMountHook> _unistylesMountHook;
81
+ std::shared_ptr<UIManager> _uiManager;
60
82
  };
61
83
 
@@ -4,7 +4,7 @@
4
4
  using namespace margelo::nitro::unistyles;
5
5
 
6
6
  ColorScheme HybridUnistylesRuntime::getColorScheme() {
7
- int colorScheme = this->_nativePlatform.getColorScheme();
7
+ auto colorScheme = this->_nativePlatform.getColorScheme();
8
8
 
9
9
  return static_cast<ColorScheme>(colorScheme);
10
10
  }
@@ -44,7 +44,7 @@ Insets HybridUnistylesRuntime::getInsets() {
44
44
  };
45
45
 
46
46
  Orientation HybridUnistylesRuntime::getOrientation() {
47
- int orientation = this->_nativePlatform.getOrientation();
47
+ auto orientation = this->_nativePlatform.getOrientation();
48
48
 
49
49
  return static_cast<Orientation>(orientation);
50
50
  };
@@ -57,6 +57,18 @@ double HybridUnistylesRuntime::getFontScale() {
57
57
  return this->_nativePlatform.getFontScale();
58
58
  };
59
59
 
60
+ std::unordered_map<std::string, double> HybridUnistylesRuntime::getBreakpoints() {
61
+ auto& state = core::UnistylesRegistry::get().getState(*_rt);
62
+ auto sortedBreakpointPairs = state.getSortedBreakpointPairs();
63
+ std::unordered_map<std::string, double> breakpoints{};
64
+
65
+ std::for_each(sortedBreakpointPairs.begin(), sortedBreakpointPairs.end(), [&breakpoints](std::pair<std::string, double>& pair){
66
+ breakpoints[pair.first] = pair.second;
67
+ });
68
+
69
+ return breakpoints;
70
+ }
71
+
60
72
  void HybridUnistylesRuntime::setTheme(const std::string &themeName) {
61
73
  helpers::assertThat(*_rt, !this->getHasAdaptiveThemes(), "Unistyles: You're trying to set theme to: '" + themeName + "', but adaptiveThemes are enabled.");
62
74
 
@@ -71,7 +83,7 @@ void HybridUnistylesRuntime::setAdaptiveThemes(bool isEnabled) {
71
83
 
72
84
  std::vector<UnistyleDependency> changedDependencies{};
73
85
 
74
- changedDependencies.reserve(5);
86
+ changedDependencies.reserve(3);
75
87
 
76
88
  bool hadAdaptiveThemes = this->getHasAdaptiveThemes();
77
89
 
@@ -92,6 +104,11 @@ void HybridUnistylesRuntime::setAdaptiveThemes(bool isEnabled) {
92
104
 
93
105
  // if user enabled adaptive themes, then we need to make sure
94
106
  // we selected theme based on color scheme
107
+ this->calculateNewThemeAndDependencies(changedDependencies);
108
+ this->_onDependenciesChange(changedDependencies);
109
+ };
110
+
111
+ void HybridUnistylesRuntime::calculateNewThemeAndDependencies(std::vector<UnistyleDependency>& changedDependencies) {
95
112
  auto& state = core::UnistylesRegistry::get().getState(*_rt);
96
113
  auto colorScheme = this->getColorScheme();
97
114
  auto currentThemeName = this->getThemeName();
@@ -105,9 +122,25 @@ void HybridUnistylesRuntime::setAdaptiveThemes(bool isEnabled) {
105
122
 
106
123
  state.setTheme(nextTheme);
107
124
  }
125
+ }
108
126
 
109
- this->_onDependenciesChange(changedDependencies);
110
- };
127
+ jsi::Value HybridUnistylesRuntime::getTheme(jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) {
128
+ helpers::assertThat(rt, count <= 1, "UnistylesRuntime.getTheme expected to be called with 0 or 1 argument.");
129
+
130
+ auto& state = core::UnistylesRegistry::get().getState(*_rt);
131
+
132
+ if (count == 1) {
133
+ helpers::assertThat(rt, args[0].isString(), "UnistylesRuntime.getTheme expected to be called with string.");
134
+
135
+ auto themeName = args[0].asString(rt).utf8(rt);
136
+
137
+ helpers::assertThat(rt, state.hasTheme(themeName), "Unistyles: You're trying to get theme '" + themeName + "' but it wasn't registered.");
138
+
139
+ return state.getJSThemeByName(themeName);
140
+ }
141
+
142
+ return state.getCurrentJSTheme();
143
+ }
111
144
 
112
145
  jsi::Value HybridUnistylesRuntime::updateTheme(jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) {
113
146
  helpers::assertThat(rt, count == 2, "UnistylesRuntime.updateTheme expected to be called with 2 arguments.");
@@ -155,7 +188,6 @@ UnistylesCxxMiniRuntime HybridUnistylesRuntime::getMiniRuntime() {
155
188
  UnistylesCxxMiniRuntime cxxMiniRuntime{
156
189
  this->getThemeName(),
157
190
  this->getBreakpoint(),
158
- nativeMiniRuntime.orientation,
159
191
  this->getHasAdaptiveThemes(),
160
192
  nativeMiniRuntime.colorScheme,
161
193
  nativeMiniRuntime.screen,
@@ -165,20 +197,44 @@ UnistylesCxxMiniRuntime HybridUnistylesRuntime::getMiniRuntime() {
165
197
  nativeMiniRuntime.fontScale,
166
198
  nativeMiniRuntime.rtl,
167
199
  nativeMiniRuntime.statusBar,
168
- nativeMiniRuntime.navigationBar
200
+ nativeMiniRuntime.navigationBar,
201
+ nativeMiniRuntime.isPortrait,
202
+ nativeMiniRuntime.isLandscape
203
+ };
204
+
205
+ return cxxMiniRuntime;
206
+ }
207
+
208
+ UnistylesCxxMiniRuntime HybridUnistylesRuntime::buildMiniRuntimeFromNativeRuntime(UnistylesNativeMiniRuntime& nativeMiniRuntime) {
209
+ UnistylesCxxMiniRuntime cxxMiniRuntime{
210
+ this->getThemeName(),
211
+ this->getBreakpoint(),
212
+ this->getHasAdaptiveThemes(),
213
+ nativeMiniRuntime.colorScheme,
214
+ nativeMiniRuntime.screen,
215
+ nativeMiniRuntime.contentSizeCategory,
216
+ nativeMiniRuntime.insets,
217
+ nativeMiniRuntime.pixelRatio,
218
+ nativeMiniRuntime.fontScale,
219
+ nativeMiniRuntime.rtl,
220
+ nativeMiniRuntime.statusBar,
221
+ nativeMiniRuntime.navigationBar,
222
+ nativeMiniRuntime.isPortrait,
223
+ nativeMiniRuntime.isLandscape
169
224
  };
170
225
 
171
226
  return cxxMiniRuntime;
172
227
  }
173
228
 
174
- jsi::Value HybridUnistylesRuntime::getMiniRuntimeAsValue(jsi::Runtime& rt) {
175
- auto miniRuntime = this->getMiniRuntime();
229
+ jsi::Value HybridUnistylesRuntime::getMiniRuntimeAsValue(jsi::Runtime& rt, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime) {
176
230
  jsi::Object obj(rt);
231
+ auto miniRuntime = maybeMiniRuntime.has_value()
232
+ ? this->buildMiniRuntimeFromNativeRuntime(maybeMiniRuntime.value())
233
+ : this->getMiniRuntime();
177
234
 
178
235
  // auto generated by nitro, but can't be accessed due to static inline function
179
236
  obj.setProperty(rt, "themeName", JSIConverter<std::optional<std::string>>::toJSI(rt, miniRuntime.themeName));
180
237
  obj.setProperty(rt, "breakpoint", JSIConverter<std::optional<std::string>>::toJSI(rt, miniRuntime.breakpoint));
181
- obj.setProperty(rt, "orientation", JSIConverter<Orientation>::toJSI(rt, miniRuntime.orientation));
182
238
  obj.setProperty(rt, "hasAdaptiveThemes", JSIConverter<bool>::toJSI(rt, miniRuntime.hasAdaptiveThemes));
183
239
  obj.setProperty(rt, "colorScheme", JSIConverter<ColorScheme>::toJSI(rt, miniRuntime.colorScheme));
184
240
  obj.setProperty(rt, "screen", JSIConverter<Dimensions>::toJSI(rt, miniRuntime.screen));
@@ -189,15 +245,41 @@ jsi::Value HybridUnistylesRuntime::getMiniRuntimeAsValue(jsi::Runtime& rt) {
189
245
  obj.setProperty(rt, "rtl", JSIConverter<bool>::toJSI(rt, miniRuntime.rtl));
190
246
  obj.setProperty(rt, "statusBar", JSIConverter<Dimensions>::toJSI(rt, miniRuntime.statusBar));
191
247
  obj.setProperty(rt, "navigationBar", JSIConverter<Dimensions>::toJSI(rt, miniRuntime.navigationBar));
248
+ obj.setProperty(rt, "isPortrait", JSIConverter<bool>::toJSI(rt, miniRuntime.isPortrait));
249
+ obj.setProperty(rt, "isLandscape", JSIConverter<bool>::toJSI(rt, miniRuntime.isLandscape));
192
250
 
193
251
  return obj;
194
252
  }
195
253
 
196
- jsi::Runtime& HybridUnistylesRuntime::getRuntime() {
197
- return *this->_rt;
254
+ void HybridUnistylesRuntime::registerPlatformListener(const std::function<void (std::vector<UnistyleDependency>)>& listener) {
255
+ this->_onDependenciesChange = listener;
198
256
  }
199
257
 
200
- void HybridUnistylesRuntime::registerPlatformListener(const std::function<void(std::vector<UnistyleDependency>)>& listener) {
258
+ void HybridUnistylesRuntime::registerNativePlatformListener(const std::function<void(std::vector<UnistyleDependency>, UnistylesNativeMiniRuntime)>& listener) {
201
259
  this->_nativePlatform.registerPlatformListener(listener);
202
- this->_onDependenciesChange = listener;
260
+ this->_onNativeDependenciesChange = listener;
261
+ }
262
+
263
+ void HybridUnistylesRuntime::registerImeListener(const std::function<void(UnistylesNativeMiniRuntime)>& listener) {
264
+ this->_nativePlatform.registerImeListener(listener);
265
+ }
266
+
267
+ void HybridUnistylesRuntime::unregisterNativePlatformListeners() {
268
+ this->_nativePlatform.unregisterPlatformListeners();
269
+ }
270
+
271
+ void HybridUnistylesRuntime::includeDependenciesForColorSchemeChange(std::vector<UnistyleDependency>& deps) {
272
+ auto& registry = core::UnistylesRegistry::get();
273
+ auto& state = registry.getState(*this->_rt);
274
+
275
+ // ignore color scheme changes if user has no adaptive themes
276
+ if (!state.hasAdaptiveThemes()) {
277
+ return;
278
+ }
279
+
280
+ this->calculateNewThemeAndDependencies(deps);
281
+ }
282
+
283
+ jsi::Runtime& HybridUnistylesRuntime::getRuntime() {
284
+ return *this->_rt;
203
285
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  #include "HybridUnistylesRuntimeSpec.hpp"
4
4
  #include "HybridNativePlatformSpec.hpp"
5
- #include "Unistyles-Swift-Cxx-Umbrella.hpp"
5
+ #include "NativePlatform.h"
6
6
  #include "UnistylesState.h"
7
7
  #include "HybridUnistylesStatusBarSpec.hpp"
8
8
  #include "HybridNavigationBar.h"
@@ -13,8 +13,13 @@
13
13
  namespace margelo::nitro::unistyles {
14
14
 
15
15
  struct HybridUnistylesRuntime: public HybridUnistylesRuntimeSpec {
16
- HybridUnistylesRuntime(Unistyles::HybridNativePlatformSpecCxx nativePlatform, jsi::Runtime& rt) : HybridObject(TAG), _nativePlatform{nativePlatform}, _rt{&rt} {}
16
+ HybridUnistylesRuntime(Unistyles::HybridNativePlatformSpecCxx nativePlatform, jsi::Runtime& rt, std::function<void(std::function<void(jsi::Runtime&)>&&)> runOnJSThread)
17
+ : HybridObject(TAG), _nativePlatform{nativePlatform}, _rt{&rt}, runOnJSThread(std::move(runOnJSThread)) {}
17
18
 
19
+ jsi::Value getTheme(jsi::Runtime& rt,
20
+ const jsi::Value& thisValue,
21
+ const jsi::Value* args,
22
+ size_t count);
18
23
  jsi::Value updateTheme(jsi::Runtime& rt,
19
24
  const jsi::Value& thisValue,
20
25
  const jsi::Value* args,
@@ -32,6 +37,7 @@ struct HybridUnistylesRuntime: public HybridUnistylesRuntimeSpec {
32
37
  HybridUnistylesRuntimeSpec::loadHybridMethods();
33
38
 
34
39
  registerHybrids(this, [](Prototype& prototype) {
40
+ prototype.registerRawHybridMethod("getTheme", 1, &HybridUnistylesRuntime::getTheme);
35
41
  prototype.registerRawHybridMethod("updateTheme", 1, &HybridUnistylesRuntime::updateTheme);
36
42
  prototype.registerRawHybridMethod("createHybridStatusBar", 0, &HybridUnistylesRuntime::createHybridStatusBar);
37
43
  prototype.registerRawHybridMethod("createHybridNavigationBar", 0, &HybridUnistylesRuntime::createHybridNavigationBar);
@@ -50,14 +56,23 @@ struct HybridUnistylesRuntime: public HybridUnistylesRuntimeSpec {
50
56
  double getPixelRatio() override;
51
57
  double getFontScale() override;
52
58
  void registerPlatformListener(const std::function<void(std::vector<UnistyleDependency>)>& listener);
59
+ void registerNativePlatformListener(const std::function<void(std::vector<UnistyleDependency>, UnistylesNativeMiniRuntime)>& listener);
60
+ void registerImeListener(const std::function<void(UnistylesNativeMiniRuntime)>& listener);
61
+ void unregisterNativePlatformListeners();
53
62
 
54
63
  void setTheme(const std::string &themeName) override;
55
64
  void setAdaptiveThemes(bool isEnabled) override;
56
65
  void setImmersiveMode(bool isEnabled) override;
57
66
  void setRootViewBackgroundColor(double color) override;
58
67
  UnistylesCxxMiniRuntime getMiniRuntime() override;
59
- jsi::Value getMiniRuntimeAsValue(jsi::Runtime& rt);
68
+ std::unordered_map<std::string, double> getBreakpoints() override;
69
+
60
70
  jsi::Runtime& getRuntime();
71
+ UnistylesCxxMiniRuntime buildMiniRuntimeFromNativeRuntime(UnistylesNativeMiniRuntime& nativeMiniRuntime);
72
+ jsi::Value getMiniRuntimeAsValue(jsi::Runtime& rt, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime);
73
+ void includeDependenciesForColorSchemeChange(std::vector<UnistyleDependency>& deps);
74
+ void calculateNewThemeAndDependencies(std::vector<UnistyleDependency>& deps);
75
+ std::function<void(std::function<void(jsi::Runtime&)>&&)> runOnJSThread;
61
76
 
62
77
  private:
63
78
  jsi::Runtime* _rt;
@@ -65,6 +80,7 @@ private:
65
80
  std::shared_ptr<HybridStatusBar> _statusBar;
66
81
  Unistyles::HybridNativePlatformSpecCxx _nativePlatform;
67
82
  std::function<void(std::vector<UnistyleDependency>)> _onDependenciesChange;
83
+ std::function<void(std::vector<UnistyleDependency>, UnistylesNativeMiniRuntime)> _onNativeDependenciesChange;
68
84
  };
69
85
 
70
86
  }