react-native-unistyles 3.0.0-beta.1 → 3.0.0-beta.2

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 (367) hide show
  1. package/README.md +4 -4
  2. package/Unistyles.podspec +7 -1
  3. package/android/build.gradle +6 -0
  4. package/android/src/main/cxx/NativeUnistylesModule.cpp +2 -2
  5. package/cxx/common/Constants.h +2 -0
  6. package/cxx/core/HostStyle.cpp +12 -7
  7. package/cxx/core/HostStyle.h +5 -0
  8. package/cxx/core/UnistyleData.h +3 -3
  9. package/cxx/core/UnistyleWrapper.h +8 -8
  10. package/cxx/core/UnistylesRegistry.cpp +23 -30
  11. package/cxx/core/UnistylesRegistry.h +8 -2
  12. package/cxx/hybridObjects/HybridShadowRegistry.cpp +108 -12
  13. package/cxx/hybridObjects/HybridShadowRegistry.h +21 -2
  14. package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +4 -0
  15. package/cxx/parser/Parser.cpp +182 -26
  16. package/cxx/parser/Parser.h +3 -1
  17. package/ios/UnistylesModuleOnLoad.mm +2 -2
  18. package/lib/commonjs/components/ScopedTheme.js +36 -0
  19. package/lib/commonjs/components/ScopedTheme.js.map +1 -0
  20. package/lib/commonjs/components/Variants.js +33 -0
  21. package/lib/commonjs/components/Variants.js.map +1 -0
  22. package/lib/commonjs/components/index.js +10 -3
  23. package/lib/commonjs/components/index.js.map +1 -1
  24. package/lib/commonjs/components/native/ActivityIndicator.js +10 -0
  25. package/lib/commonjs/components/native/ActivityIndicator.js.map +1 -0
  26. package/lib/commonjs/components/native/FlatList.js +10 -0
  27. package/lib/commonjs/components/native/FlatList.js.map +1 -0
  28. package/lib/commonjs/components/native/Image.js +10 -0
  29. package/lib/commonjs/components/native/Image.js.map +1 -0
  30. package/lib/commonjs/components/native/ImageBackground.js +10 -0
  31. package/lib/commonjs/components/native/ImageBackground.js.map +1 -0
  32. package/lib/commonjs/components/native/KeyboardAvoidingView.js +10 -0
  33. package/lib/commonjs/components/native/KeyboardAvoidingView.js.map +1 -0
  34. package/lib/commonjs/components/{Pressable.web.js → native/Pressable.js} +26 -66
  35. package/lib/commonjs/components/native/Pressable.js.map +1 -0
  36. package/lib/commonjs/components/native/Pressable.native.js +48 -0
  37. package/lib/commonjs/components/native/Pressable.native.js.map +1 -0
  38. package/lib/commonjs/components/native/RefreshControl.js +10 -0
  39. package/lib/commonjs/components/native/RefreshControl.js.map +1 -0
  40. package/lib/commonjs/components/native/ScrollView.js +10 -0
  41. package/lib/commonjs/components/native/ScrollView.js.map +1 -0
  42. package/lib/commonjs/components/native/SectionList.js +10 -0
  43. package/lib/commonjs/components/native/SectionList.js.map +1 -0
  44. package/lib/commonjs/components/native/Switch.js +10 -0
  45. package/lib/commonjs/components/native/Switch.js.map +1 -0
  46. package/lib/commonjs/components/native/Text.js +10 -0
  47. package/lib/commonjs/components/native/Text.js.map +1 -0
  48. package/lib/commonjs/components/native/TextInput.js +10 -0
  49. package/lib/commonjs/components/native/TextInput.js.map +1 -0
  50. package/lib/commonjs/components/native/TouchableHighlight.js +10 -0
  51. package/lib/commonjs/components/native/TouchableHighlight.js.map +1 -0
  52. package/lib/commonjs/components/native/TouchableOpacity.js +10 -0
  53. package/lib/commonjs/components/native/TouchableOpacity.js.map +1 -0
  54. package/lib/commonjs/components/native/View.js +10 -0
  55. package/lib/commonjs/components/native/View.js.map +1 -0
  56. package/lib/commonjs/components/native/VirtualizedList.js +10 -0
  57. package/lib/commonjs/components/native/VirtualizedList.js.map +1 -0
  58. package/lib/commonjs/core/createUnistylesComponent.js +5 -68
  59. package/lib/commonjs/core/createUnistylesComponent.js.map +1 -1
  60. package/lib/commonjs/core/createUnistylesElement.js +16 -0
  61. package/lib/commonjs/core/createUnistylesElement.js.map +1 -0
  62. package/lib/commonjs/core/createUnistylesImageBackground.js +27 -0
  63. package/lib/commonjs/core/createUnistylesImageBackground.js.map +1 -0
  64. package/lib/commonjs/core/index.js +20 -6
  65. package/lib/commonjs/core/index.js.map +1 -1
  66. package/lib/commonjs/core/passForwardRef.js +27 -0
  67. package/lib/commonjs/core/passForwardRef.js.map +1 -0
  68. package/lib/commonjs/core/withUnistyles/index.js +13 -0
  69. package/lib/commonjs/core/withUnistyles/index.js.map +1 -0
  70. package/lib/commonjs/core/withUnistyles/types.js +8 -0
  71. package/lib/commonjs/core/withUnistyles/types.js.map +1 -0
  72. package/lib/commonjs/core/withUnistyles/useDependencies.js +81 -0
  73. package/lib/commonjs/core/withUnistyles/useDependencies.js.map +1 -0
  74. package/lib/commonjs/core/withUnistyles/withUnistyles.js +88 -0
  75. package/lib/commonjs/core/withUnistyles/withUnistyles.js.map +1 -0
  76. package/lib/commonjs/core/withUnistyles/withUnistyles.native.js +96 -0
  77. package/lib/commonjs/core/withUnistyles/withUnistyles.native.js.map +1 -0
  78. package/lib/commonjs/hooks/useMedia.js +17 -33
  79. package/lib/commonjs/hooks/useMedia.js.map +1 -1
  80. package/lib/commonjs/hooks/useMedia.native.js +60 -0
  81. package/lib/commonjs/hooks/useMedia.native.js.map +1 -0
  82. package/lib/commonjs/index.js +33 -16
  83. package/lib/commonjs/index.js.map +1 -1
  84. package/lib/commonjs/specs/ShadowRegistry/index.js +3 -3
  85. package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
  86. package/lib/commonjs/specs/index.js +14 -40
  87. package/lib/commonjs/specs/index.js.map +1 -1
  88. package/lib/commonjs/specs/index.native.js +54 -0
  89. package/lib/commonjs/specs/index.native.js.map +1 -0
  90. package/lib/commonjs/web/create.js +12 -33
  91. package/lib/commonjs/web/create.js.map +1 -1
  92. package/lib/commonjs/web/index.js.map +1 -1
  93. package/lib/commonjs/web/registry.js +10 -3
  94. package/lib/commonjs/web/registry.js.map +1 -1
  95. package/lib/commonjs/web/runtime.js +3 -1
  96. package/lib/commonjs/web/runtime.js.map +1 -1
  97. package/lib/commonjs/web/shadowRegistry.js +71 -64
  98. package/lib/commonjs/web/shadowRegistry.js.map +1 -1
  99. package/lib/commonjs/web/utils/unistyle.js +3 -3
  100. package/lib/commonjs/web/utils/unistyle.js.map +1 -1
  101. package/lib/module/components/ScopedTheme.js +29 -0
  102. package/lib/module/components/ScopedTheme.js.map +1 -0
  103. package/lib/module/components/Variants.js +26 -0
  104. package/lib/module/components/Variants.js.map +1 -0
  105. package/lib/module/components/index.js +2 -1
  106. package/lib/module/components/index.js.map +1 -1
  107. package/lib/module/components/native/ActivityIndicator.js +6 -0
  108. package/lib/module/components/native/ActivityIndicator.js.map +1 -0
  109. package/lib/module/components/native/FlatList.js +6 -0
  110. package/lib/module/components/native/FlatList.js.map +1 -0
  111. package/lib/module/components/native/Image.js +6 -0
  112. package/lib/module/components/native/Image.js.map +1 -0
  113. package/lib/module/components/native/ImageBackground.js +6 -0
  114. package/lib/module/components/native/ImageBackground.js.map +1 -0
  115. package/lib/module/components/native/KeyboardAvoidingView.js +6 -0
  116. package/lib/module/components/native/KeyboardAvoidingView.js.map +1 -0
  117. package/lib/module/components/native/Pressable.js +69 -0
  118. package/lib/module/components/native/Pressable.js.map +1 -0
  119. package/lib/module/components/native/Pressable.native.js +42 -0
  120. package/lib/module/components/native/Pressable.native.js.map +1 -0
  121. package/lib/module/components/native/RefreshControl.js +6 -0
  122. package/lib/module/components/native/RefreshControl.js.map +1 -0
  123. package/lib/module/components/native/ScrollView.js +6 -0
  124. package/lib/module/components/native/ScrollView.js.map +1 -0
  125. package/lib/module/components/native/SectionList.js +6 -0
  126. package/lib/module/components/native/SectionList.js.map +1 -0
  127. package/lib/module/components/native/Switch.js +6 -0
  128. package/lib/module/components/native/Switch.js.map +1 -0
  129. package/lib/module/components/native/Text.js +6 -0
  130. package/lib/module/components/native/Text.js.map +1 -0
  131. package/lib/module/components/native/TextInput.js +6 -0
  132. package/lib/module/components/native/TextInput.js.map +1 -0
  133. package/lib/module/components/native/TouchableHighlight.js +6 -0
  134. package/lib/module/components/native/TouchableHighlight.js.map +1 -0
  135. package/lib/module/components/native/TouchableOpacity.js +6 -0
  136. package/lib/module/components/native/TouchableOpacity.js.map +1 -0
  137. package/lib/module/components/native/View.js +6 -0
  138. package/lib/module/components/native/View.js.map +1 -0
  139. package/lib/module/components/native/VirtualizedList.js +6 -0
  140. package/lib/module/components/native/VirtualizedList.js.map +1 -0
  141. package/lib/module/core/createUnistylesComponent.js +5 -66
  142. package/lib/module/core/createUnistylesComponent.js.map +1 -1
  143. package/lib/module/core/createUnistylesElement.js +10 -0
  144. package/lib/module/core/createUnistylesElement.js.map +1 -0
  145. package/lib/module/core/createUnistylesImageBackground.js +21 -0
  146. package/lib/module/core/createUnistylesImageBackground.js.map +1 -0
  147. package/lib/module/core/index.js +4 -2
  148. package/lib/module/core/index.js.map +1 -1
  149. package/lib/module/core/passForwardRef.js +22 -0
  150. package/lib/module/core/passForwardRef.js.map +1 -0
  151. package/lib/module/core/withUnistyles/index.js +4 -0
  152. package/lib/module/core/withUnistyles/index.js.map +1 -0
  153. package/lib/module/core/withUnistyles/types.js +4 -0
  154. package/lib/module/core/withUnistyles/types.js.map +1 -0
  155. package/lib/module/core/withUnistyles/useDependencies.js +75 -0
  156. package/lib/module/core/withUnistyles/useDependencies.js.map +1 -0
  157. package/lib/module/core/withUnistyles/withUnistyles.js +81 -0
  158. package/lib/module/core/withUnistyles/withUnistyles.js.map +1 -0
  159. package/lib/module/core/withUnistyles/withUnistyles.native.js +89 -0
  160. package/lib/module/core/withUnistyles/withUnistyles.native.js.map +1 -0
  161. package/lib/module/hooks/useMedia.js +19 -35
  162. package/lib/module/hooks/useMedia.js.map +1 -1
  163. package/lib/module/hooks/useMedia.native.js +55 -0
  164. package/lib/module/hooks/useMedia.native.js.map +1 -0
  165. package/lib/module/index.js +2 -2
  166. package/lib/module/index.js.map +1 -1
  167. package/lib/module/specs/ShadowRegistry/index.js +3 -3
  168. package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
  169. package/lib/module/specs/index.js +2 -8
  170. package/lib/module/specs/index.js.map +1 -1
  171. package/lib/module/specs/index.native.js +11 -0
  172. package/lib/module/specs/index.native.js.map +1 -0
  173. package/lib/module/web/create.js +13 -34
  174. package/lib/module/web/create.js.map +1 -1
  175. package/lib/module/web/index.js +1 -1
  176. package/lib/module/web/index.js.map +1 -1
  177. package/lib/module/web/registry.js +11 -4
  178. package/lib/module/web/registry.js.map +1 -1
  179. package/lib/module/web/runtime.js +3 -1
  180. package/lib/module/web/runtime.js.map +1 -1
  181. package/lib/module/web/shadowRegistry.js +70 -63
  182. package/lib/module/web/shadowRegistry.js.map +1 -1
  183. package/lib/module/web/utils/unistyle.js +1 -1
  184. package/lib/module/web/utils/unistyle.js.map +1 -1
  185. package/lib/typescript/src/components/ScopedTheme.d.ts +8 -0
  186. package/lib/typescript/src/components/ScopedTheme.d.ts.map +1 -0
  187. package/lib/typescript/src/components/Variants.d.ts +7 -0
  188. package/lib/typescript/src/components/Variants.d.ts.map +1 -0
  189. package/lib/typescript/src/components/index.d.ts +2 -1
  190. package/lib/typescript/src/components/index.d.ts.map +1 -1
  191. package/lib/typescript/src/components/native/ActivityIndicator.d.ts +2 -0
  192. package/lib/typescript/src/components/native/ActivityIndicator.d.ts.map +1 -0
  193. package/lib/typescript/src/components/native/FlatList.d.ts +2 -0
  194. package/lib/typescript/src/components/native/FlatList.d.ts.map +1 -0
  195. package/lib/typescript/src/components/native/Image.d.ts +2 -0
  196. package/lib/typescript/src/components/native/Image.d.ts.map +1 -0
  197. package/lib/typescript/src/components/native/ImageBackground.d.ts +3 -0
  198. package/lib/typescript/src/components/native/ImageBackground.d.ts.map +1 -0
  199. package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts +2 -0
  200. package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts.map +1 -0
  201. package/lib/typescript/src/components/{Pressable.web.d.ts → native/Pressable.d.ts} +3 -2
  202. package/lib/typescript/src/components/native/Pressable.d.ts.map +1 -0
  203. package/lib/typescript/src/components/{Pressable.d.ts → native/Pressable.native.d.ts} +1 -3
  204. package/lib/typescript/src/components/native/Pressable.native.d.ts.map +1 -0
  205. package/lib/typescript/src/components/native/RefreshControl.d.ts +2 -0
  206. package/lib/typescript/src/components/native/RefreshControl.d.ts.map +1 -0
  207. package/lib/typescript/src/components/native/ScrollView.d.ts +2 -0
  208. package/lib/typescript/src/components/native/ScrollView.d.ts.map +1 -0
  209. package/lib/typescript/src/components/native/SectionList.d.ts +2 -0
  210. package/lib/typescript/src/components/native/SectionList.d.ts.map +1 -0
  211. package/lib/typescript/src/components/native/Switch.d.ts +2 -0
  212. package/lib/typescript/src/components/native/Switch.d.ts.map +1 -0
  213. package/lib/typescript/src/components/native/Text.d.ts +2 -0
  214. package/lib/typescript/src/components/native/Text.d.ts.map +1 -0
  215. package/lib/typescript/src/components/native/TextInput.d.ts +2 -0
  216. package/lib/typescript/src/components/native/TextInput.d.ts.map +1 -0
  217. package/lib/typescript/src/components/native/TouchableHighlight.d.ts +2 -0
  218. package/lib/typescript/src/components/native/TouchableHighlight.d.ts.map +1 -0
  219. package/lib/typescript/src/components/native/TouchableOpacity.d.ts +2 -0
  220. package/lib/typescript/src/components/native/TouchableOpacity.d.ts.map +1 -0
  221. package/lib/typescript/src/components/native/View.d.ts +2 -0
  222. package/lib/typescript/src/components/native/View.d.ts.map +1 -0
  223. package/lib/typescript/src/components/native/VirtualizedList.d.ts +2 -0
  224. package/lib/typescript/src/components/native/VirtualizedList.d.ts.map +1 -0
  225. package/lib/typescript/src/core/createUnistylesComponent.d.ts +9 -3
  226. package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +1 -1
  227. package/lib/typescript/src/core/createUnistylesElement.d.ts +3 -0
  228. package/lib/typescript/src/core/createUnistylesElement.d.ts.map +1 -0
  229. package/lib/typescript/src/core/createUnistylesImageBackground.d.ts +4 -0
  230. package/lib/typescript/src/core/createUnistylesImageBackground.d.ts.map +1 -0
  231. package/lib/typescript/src/core/index.d.ts +4 -2
  232. package/lib/typescript/src/core/index.d.ts.map +1 -1
  233. package/lib/typescript/src/core/passForwardRef.d.ts +3 -0
  234. package/lib/typescript/src/core/passForwardRef.d.ts.map +1 -0
  235. package/lib/typescript/src/core/withUnistyles/index.d.ts +2 -0
  236. package/lib/typescript/src/core/withUnistyles/index.d.ts.map +1 -0
  237. package/lib/typescript/src/core/withUnistyles/types.d.ts +6 -0
  238. package/lib/typescript/src/core/withUnistyles/types.d.ts.map +1 -0
  239. package/lib/typescript/src/core/withUnistyles/useDependencies.d.ts +13 -0
  240. package/lib/typescript/src/core/withUnistyles/useDependencies.d.ts.map +1 -0
  241. package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts +11 -0
  242. package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts.map +1 -0
  243. package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts +8 -0
  244. package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts.map +1 -0
  245. package/lib/typescript/src/hooks/useMedia.d.ts +1 -1
  246. package/lib/typescript/src/hooks/useMedia.d.ts.map +1 -1
  247. package/lib/typescript/src/hooks/useMedia.native.d.ts +6 -0
  248. package/lib/typescript/src/hooks/useMedia.native.d.ts.map +1 -0
  249. package/lib/typescript/src/index.d.ts +2 -2
  250. package/lib/typescript/src/index.d.ts.map +1 -1
  251. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +7 -2
  252. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
  253. package/lib/typescript/src/specs/ShadowRegistry/types.d.ts +17 -0
  254. package/lib/typescript/src/specs/ShadowRegistry/types.d.ts.map +1 -1
  255. package/lib/typescript/src/specs/index.d.ts +3 -11
  256. package/lib/typescript/src/specs/index.d.ts.map +1 -1
  257. package/lib/typescript/src/specs/index.native.d.ts +12 -0
  258. package/lib/typescript/src/specs/index.native.d.ts.map +1 -0
  259. package/lib/typescript/src/web/create.d.ts +1 -1441
  260. package/lib/typescript/src/web/create.d.ts.map +1 -1
  261. package/lib/typescript/src/web/index.d.ts +2 -1441
  262. package/lib/typescript/src/web/index.d.ts.map +1 -1
  263. package/lib/typescript/src/web/registry.d.ts +2 -3
  264. package/lib/typescript/src/web/registry.d.ts.map +1 -1
  265. package/lib/typescript/src/web/runtime.d.ts.map +1 -1
  266. package/lib/typescript/src/web/shadowRegistry.d.ts +11 -3
  267. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
  268. package/lib/typescript/src/web/utils/unistyle.d.ts +1 -2
  269. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
  270. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +3 -0
  271. package/package.json +4 -4
  272. package/plugin/common.js +4 -6
  273. package/plugin/import.js +63 -26
  274. package/plugin/index.js +48 -28
  275. package/plugin/ref.js +0 -234
  276. package/plugin/style.js +4 -317
  277. package/plugin/stylesheet.js +25 -10
  278. package/plugin/variants.js +54 -1
  279. package/src/components/ScopedTheme.tsx +32 -0
  280. package/src/components/Variants.tsx +29 -0
  281. package/src/components/index.ts +2 -1
  282. package/src/components/native/ActivityIndicator.tsx +4 -0
  283. package/src/components/native/FlatList.tsx +4 -0
  284. package/src/components/native/Image.tsx +4 -0
  285. package/src/components/native/ImageBackground.tsx +4 -0
  286. package/src/components/native/KeyboardAvoidingView.tsx +4 -0
  287. package/src/components/native/Pressable.native.tsx +55 -0
  288. package/src/components/native/Pressable.tsx +98 -0
  289. package/src/components/native/RefreshControl.tsx +4 -0
  290. package/src/components/native/ScrollView.tsx +4 -0
  291. package/src/components/native/SectionList.tsx +4 -0
  292. package/src/components/native/Switch.tsx +4 -0
  293. package/src/components/native/Text.tsx +4 -0
  294. package/src/components/native/TextInput.tsx +4 -0
  295. package/src/components/native/TouchableHighlight.tsx +4 -0
  296. package/src/components/native/TouchableOpacity.tsx +4 -0
  297. package/src/components/native/View.tsx +4 -0
  298. package/src/components/native/VirtualizedList.tsx +4 -0
  299. package/src/core/createUnistylesComponent.tsx +6 -76
  300. package/src/core/createUnistylesElement.tsx +9 -0
  301. package/src/core/createUnistylesImageBackground.tsx +24 -0
  302. package/src/core/index.ts +4 -2
  303. package/src/core/passForwardRef.ts +29 -0
  304. package/src/core/withUnistyles/index.ts +1 -0
  305. package/src/core/withUnistyles/types.ts +7 -0
  306. package/src/core/withUnistyles/useDependencies.ts +93 -0
  307. package/src/core/withUnistyles/withUnistyles.native.tsx +96 -0
  308. package/src/core/withUnistyles/withUnistyles.tsx +90 -0
  309. package/src/hooks/useMedia.native.ts +65 -0
  310. package/src/hooks/useMedia.ts +19 -36
  311. package/src/index.ts +2 -2
  312. package/src/specs/ShadowRegistry/index.ts +14 -5
  313. package/src/specs/ShadowRegistry/types.ts +18 -1
  314. package/src/specs/index.native.ts +27 -0
  315. package/src/specs/index.ts +3 -27
  316. package/src/web/create.ts +14 -32
  317. package/src/web/index.ts +3 -2
  318. package/src/web/registry.ts +15 -6
  319. package/src/web/runtime.ts +3 -1
  320. package/src/web/shadowRegistry.ts +66 -52
  321. package/src/web/utils/unistyle.ts +1 -2
  322. package/lib/commonjs/components/Pressable.js +0 -74
  323. package/lib/commonjs/components/Pressable.js.map +0 -1
  324. package/lib/commonjs/components/Pressable.web.js.map +0 -1
  325. package/lib/commonjs/core/createUnistylesComponent.native.js +0 -82
  326. package/lib/commonjs/core/createUnistylesComponent.native.js.map +0 -1
  327. package/lib/commonjs/core/getBoundArgs.js +0 -18
  328. package/lib/commonjs/core/getBoundArgs.js.map +0 -1
  329. package/lib/commonjs/core/getId.js +0 -9
  330. package/lib/commonjs/core/getId.js.map +0 -1
  331. package/lib/commonjs/hooks/useMedia.web.js +0 -43
  332. package/lib/commonjs/hooks/useMedia.web.js.map +0 -1
  333. package/lib/commonjs/specs/index.web.js +0 -17
  334. package/lib/commonjs/specs/index.web.js.map +0 -1
  335. package/lib/module/components/Pressable.js +0 -68
  336. package/lib/module/components/Pressable.js.map +0 -1
  337. package/lib/module/components/Pressable.web.js +0 -109
  338. package/lib/module/components/Pressable.web.js.map +0 -1
  339. package/lib/module/core/createUnistylesComponent.native.js +0 -75
  340. package/lib/module/core/createUnistylesComponent.native.js.map +0 -1
  341. package/lib/module/core/getBoundArgs.js +0 -13
  342. package/lib/module/core/getBoundArgs.js.map +0 -1
  343. package/lib/module/core/getId.js +0 -4
  344. package/lib/module/core/getId.js.map +0 -1
  345. package/lib/module/hooks/useMedia.web.js +0 -38
  346. package/lib/module/hooks/useMedia.web.js.map +0 -1
  347. package/lib/module/specs/index.web.js +0 -4
  348. package/lib/module/specs/index.web.js.map +0 -1
  349. package/lib/typescript/src/components/Pressable.d.ts.map +0 -1
  350. package/lib/typescript/src/components/Pressable.web.d.ts.map +0 -1
  351. package/lib/typescript/src/core/createUnistylesComponent.native.d.ts +0 -8
  352. package/lib/typescript/src/core/createUnistylesComponent.native.d.ts.map +0 -1
  353. package/lib/typescript/src/core/getBoundArgs.d.ts +0 -2
  354. package/lib/typescript/src/core/getBoundArgs.d.ts.map +0 -1
  355. package/lib/typescript/src/core/getId.d.ts +0 -2
  356. package/lib/typescript/src/core/getId.d.ts.map +0 -1
  357. package/lib/typescript/src/hooks/useMedia.web.d.ts +0 -6
  358. package/lib/typescript/src/hooks/useMedia.web.d.ts.map +0 -1
  359. package/lib/typescript/src/specs/index.web.d.ts +0 -2
  360. package/lib/typescript/src/specs/index.web.d.ts.map +0 -1
  361. package/src/components/Pressable.tsx +0 -89
  362. package/src/components/Pressable.web.tsx +0 -129
  363. package/src/core/createUnistylesComponent.native.tsx +0 -83
  364. package/src/core/getBoundArgs.ts +0 -15
  365. package/src/core/getId.ts +0 -1
  366. package/src/hooks/useMedia.web.ts +0 -47
  367. package/src/specs/index.web.ts +0 -1
@@ -0,0 +1,32 @@
1
+ import React, { useLayoutEffect } from 'react'
2
+ import type { UnistylesThemes } from '../global'
3
+ import { UnistylesShadowRegistry } from '../specs'
4
+
5
+ type ThemeProps = {
6
+ name: keyof UnistylesThemes
7
+ }
8
+
9
+ const Apply = ({ name }: { name?: keyof UnistylesThemes }) => {
10
+ UnistylesShadowRegistry.setScopedTheme(name)
11
+
12
+ useLayoutEffect(() => {
13
+ UnistylesShadowRegistry.setScopedTheme(name)
14
+ })
15
+
16
+ return null
17
+ }
18
+
19
+ export const ScopedTheme: React.FunctionComponent<React.PropsWithChildren<ThemeProps>> = ({ name, children }) => {
20
+ const previousScopedTheme = UnistylesShadowRegistry.getScopedTheme()
21
+ const mappedChildren = [
22
+ <Apply key={name} name={name} />,
23
+ children,
24
+ <Apply key='dispose' name={previousScopedTheme} />
25
+ ]
26
+
27
+ return (
28
+ <React.Fragment>
29
+ {mappedChildren}
30
+ </React.Fragment>
31
+ )
32
+ }
@@ -0,0 +1,29 @@
1
+ import React, { useLayoutEffect } from 'react'
2
+ import { UnistylesShadowRegistry } from '../specs'
3
+
4
+ type VariantProps = {
5
+ variants?: Record<string, string | boolean | undefined>
6
+ }
7
+
8
+ const Apply: React.FunctionComponent<VariantProps> = ({ variants }) => {
9
+ UnistylesShadowRegistry.selectVariants(variants)
10
+
11
+ useLayoutEffect(() => {
12
+ UnistylesShadowRegistry.selectVariants(variants)
13
+ })
14
+
15
+ return null
16
+ }
17
+ export const Variants: React.FunctionComponent<React.PropsWithChildren<VariantProps>> = ({ variants, children }) => {
18
+ const mappedChildren = [
19
+ <Apply key='add' variants={variants} />,
20
+ children,
21
+ <Apply key='remove' />
22
+ ]
23
+
24
+ return (
25
+ <React.Fragment>
26
+ {mappedChildren}
27
+ </React.Fragment>
28
+ )
29
+ }
@@ -1,3 +1,4 @@
1
1
  export { Hide } from './Hide'
2
2
  export { Display } from './Display'
3
- export { Pressable } from './Pressable'
3
+ export { Variants } from './Variants'
4
+ export { ScopedTheme } from './ScopedTheme'
@@ -0,0 +1,4 @@
1
+ import { ActivityIndicator as NativeActivityIndicator } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const ActivityIndicator = createUnistylesElement(NativeActivityIndicator)
@@ -0,0 +1,4 @@
1
+ import { FlatList as NativeFlatList } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const FlatList = createUnistylesElement(NativeFlatList)
@@ -0,0 +1,4 @@
1
+ import { Image as NativeImage } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const Image = createUnistylesElement(NativeImage)
@@ -0,0 +1,4 @@
1
+ import { ImageBackground as NativeImageBackground } from 'react-native'
2
+ import { createUnistylesImageBackground } from '../../core'
3
+
4
+ export const ImageBackground = createUnistylesImageBackground(NativeImageBackground)
@@ -0,0 +1,4 @@
1
+ import { KeyboardAvoidingView as NativeKeyboardAvoidingView } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const KeyboardAvoidingView = createUnistylesElement(NativeKeyboardAvoidingView)
@@ -0,0 +1,55 @@
1
+ import React, { forwardRef, useRef } from 'react'
2
+ import { Pressable as NativePressableReactNative } from 'react-native'
3
+ import type { PressableProps as Props, View } from 'react-native'
4
+ import { UnistylesShadowRegistry } from '../../specs'
5
+ import { passForwardedRef } from '../../core'
6
+
7
+ type PressableProps = Props & {
8
+ variants?: Record<string, string | boolean>
9
+ }
10
+
11
+ export const Pressable = forwardRef<View, PressableProps>(({ variants, style, ...props }, forwardedRef) => {
12
+ const storedRef = useRef<View | null>()
13
+
14
+ return (
15
+ <NativePressableReactNative
16
+ {...props}
17
+ ref={ref => {
18
+ const unistyles = typeof style === 'function'
19
+ ? style({ pressed: false })
20
+ : style
21
+ const styles = Array.isArray(unistyles)
22
+ ? unistyles
23
+ : [unistyles]
24
+
25
+ // @ts-expect-error - this is hidden from TS
26
+ UnistylesShadowRegistry.add(ref, styles)
27
+
28
+ storedRef.current = ref
29
+
30
+ return passForwardedRef(props, ref, forwardedRef)
31
+ }}
32
+ style={state => {
33
+ UnistylesShadowRegistry.selectVariants(variants)
34
+
35
+ const unistyles = typeof style === 'function'
36
+ ? style(state)
37
+ : style
38
+ const styles = Array.isArray(unistyles)
39
+ ? unistyles
40
+ : [unistyles]
41
+
42
+ if (storedRef.current) {
43
+ // @ts-expect-error - this is hidden from TS
44
+ UnistylesShadowRegistry.remove(storedRef.current)
45
+ // @ts-expect-error - this is hidden from TS
46
+ UnistylesShadowRegistry.add(storedRef.current, styles)
47
+ }
48
+
49
+ UnistylesShadowRegistry.selectVariants(undefined)
50
+
51
+ return unistyles
52
+ }}
53
+ />
54
+ )
55
+ })
@@ -0,0 +1,98 @@
1
+ import React, { forwardRef, useRef } from 'react'
2
+ import { Pressable as NativePressableReactNative } from 'react-native'
3
+ import type { PressableProps as Props, View, ViewStyle } from 'react-native'
4
+ import { UnistylesShadowRegistry } from '../../specs'
5
+
6
+ type Variants = Record<string, string | boolean | undefined>
7
+ type WebPressableState = {
8
+ pressed: boolean,
9
+ hovered: boolean,
10
+ focused: boolean
11
+ }
12
+
13
+ type WebPressableStyle = ((state: WebPressableState) => ViewStyle) | ViewStyle
14
+
15
+ type PressableProps = Props & {
16
+ variants?: Variants
17
+ style?: WebPressableStyle,
18
+ }
19
+
20
+ const initialState: WebPressableState = {
21
+ pressed: false,
22
+ hovered: false,
23
+ focused: false
24
+ }
25
+
26
+ type UpdateStylesProps = {
27
+ ref: View | null,
28
+ style: WebPressableStyle,
29
+ variants?: Variants,
30
+ state: WebPressableState
31
+ scopedTheme?: string
32
+ }
33
+
34
+ const extractStyleResult = (style: any) => {
35
+ return typeof style === 'function'
36
+ ? [style()]
37
+ : Array.isArray(style)
38
+ ? style.map(style => typeof style === 'function' ? style() : style)
39
+ : [style]
40
+ }
41
+
42
+ const updateStyles = ({ ref, style, state, scopedTheme, variants }: UpdateStylesProps) => {
43
+ const styleResult = typeof style === 'function'
44
+ ? style(state)
45
+ : style
46
+ const extractedResult = extractStyleResult(styleResult)
47
+ const previousScopedTheme = UnistylesShadowRegistry.getScopedTheme()
48
+ const previousVariants = UnistylesShadowRegistry.getVariants()
49
+
50
+ UnistylesShadowRegistry.selectVariants(variants as unknown as Variants)
51
+ UnistylesShadowRegistry.setScopedTheme(scopedTheme as any)
52
+
53
+ UnistylesShadowRegistry.add(ref, extractedResult)
54
+
55
+ UnistylesShadowRegistry.setScopedTheme(previousScopedTheme)
56
+ UnistylesShadowRegistry.selectVariants(previousVariants as unknown as Variants)
57
+ }
58
+
59
+ export const Pressable = forwardRef<View, PressableProps>(({ style, ...props }, passedRef) => {
60
+ const storedRef = useRef<View | null>(null)
61
+ const scopedTheme = UnistylesShadowRegistry.getScopedTheme()
62
+ const variants = UnistylesShadowRegistry.getVariants()
63
+
64
+ return (
65
+ <NativePressableReactNative
66
+ {...props}
67
+ style={state => {
68
+ if (!storedRef.current) {
69
+ return {}
70
+ }
71
+
72
+ updateStyles({
73
+ ref: storedRef.current,
74
+ style: style as WebPressableStyle,
75
+ variants,
76
+ scopedTheme,
77
+ state: state as WebPressableState
78
+ })
79
+
80
+ return {}
81
+ }}
82
+ ref={ref => {
83
+ storedRef.current = ref
84
+ updateStyles({
85
+ ref,
86
+ style: style as WebPressableStyle,
87
+ variants,
88
+ scopedTheme,
89
+ state: initialState
90
+ })
91
+
92
+ if (typeof passedRef === 'object' && passedRef !== null) {
93
+ passedRef.current = ref
94
+ }
95
+ }}
96
+ />
97
+ )
98
+ })
@@ -0,0 +1,4 @@
1
+ import { RefreshControl as NativeRefreshControl } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const RefreshControl = createUnistylesElement(NativeRefreshControl)
@@ -0,0 +1,4 @@
1
+ import { ScrollView as NativeScrollView } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const ScrollView = createUnistylesElement(NativeScrollView)
@@ -0,0 +1,4 @@
1
+ import { SectionList as NativeSectionList } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const SectionList = createUnistylesElement(NativeSectionList)
@@ -0,0 +1,4 @@
1
+ import { Switch as NativeSwitch } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const Switch = createUnistylesElement(NativeSwitch)
@@ -0,0 +1,4 @@
1
+ import { Text as NativeText } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const Text = createUnistylesElement(NativeText)
@@ -0,0 +1,4 @@
1
+ import { TextInput as NativeTextInput } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const TextInput = createUnistylesElement(NativeTextInput)
@@ -0,0 +1,4 @@
1
+ import { TouchableHighlight as NativeTouchableHighlight } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const TouchableHighlight = createUnistylesElement(NativeTouchableHighlight)
@@ -0,0 +1,4 @@
1
+ import { TouchableOpacity as NativeTouchableOpacity } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const TouchableOpacity = createUnistylesElement(NativeTouchableOpacity)
@@ -0,0 +1,4 @@
1
+ import { View as NativeView } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const View = createUnistylesElement(NativeView)
@@ -0,0 +1,4 @@
1
+ import { VirtualizedList as NativeVirtualizedList } from 'react-native'
2
+ import { createUnistylesElement } from '../../core'
3
+
4
+ export const VirtualizedList = createUnistylesElement(NativeVirtualizedList)
@@ -1,84 +1,14 @@
1
- import React, { useEffect, useState, type ComponentType, forwardRef, useRef, useMemo } from 'react'
1
+ import type { ComponentType } from 'react'
2
2
  import type { UnistylesTheme } from '../types'
3
- import { UnistylesRuntime } from '../specs'
4
- import { UnistyleDependency } from '../specs/NativePlatform'
5
- import type { PartialBy } from '../types/common'
6
- import { UnistylesListener } from '../web/listener'
7
- import { UnistylesShadowRegistry } from '../web'
8
- import { equal } from '../web/utils'
9
- import { deepMergeObjects } from '../utils'
3
+ import { withUnistyles } from './withUnistyles'
10
4
 
11
5
  const SUPPORTED_STYLE_PROPS = ['style', 'contentContainerStyle'] as const
12
- const ALL_DEPENDENCIES = Object.values(UnistyleDependency).filter((dependency): dependency is UnistyleDependency => typeof dependency === 'number')
13
6
 
14
7
  type SupportedStyleProps = typeof SUPPORTED_STYLE_PROPS[number]
15
8
 
16
- const useShadowRegistry = (style?: Record<string, any>) => {
17
- const [ref] = useState(document.createElement('div'))
18
- const oldClassNames = useRef<Array<string>>([])
19
- const classNames = useMemo(() => {
20
- if (!style) {
21
- return []
22
- }
23
-
24
- const newClassNames = UnistylesShadowRegistry.add(ref, [style], undefined, []) ?? []
25
-
26
- if (equal(oldClassNames.current, newClassNames)) {
27
- return oldClassNames.current
28
- }
29
-
30
- oldClassNames.current = newClassNames
31
-
32
- return newClassNames
33
- }, [style])
34
-
35
- useEffect(() => () => {
36
- // Remove styles on unmount
37
- if (style) {
38
- UnistylesShadowRegistry.add(null, [style], undefined, [])
39
- }
40
- })
41
-
42
- return classNames
43
- }
44
-
9
+ /**
10
+ * @deprecated Use withUnistyles instead
11
+ */
45
12
  export const createUnistylesComponent = <TProps extends Record<string, any>, TMappings extends Partial<Omit<TProps, SupportedStyleProps>>>(Component: ComponentType<TProps>, mappings?: (theme: UnistylesTheme) => TMappings) => {
46
- return forwardRef<unknown, PartialBy<TProps, keyof TMappings | SupportedStyleProps>>((props, ref) => {
47
- const narrowedProps = props as PartialBy<TProps, keyof TMappings | SupportedStyleProps>
48
- const [mappingsProps, setMappingsProps] = useState(mappings?.(UnistylesRuntime.getTheme()))
49
- const styleClassNames = useShadowRegistry(narrowedProps.style)
50
- const contentContainerStyleClassNames = useShadowRegistry(narrowedProps.contentContainerStyle)
51
-
52
- useEffect(() => {
53
- const disposeMappings = UnistylesListener.addListeners(ALL_DEPENDENCIES, () => {
54
- if (!mappings) {
55
- disposeMappings()
56
-
57
- return
58
- }
59
-
60
- return setMappingsProps(mappings(UnistylesRuntime.getTheme()))
61
- })
62
-
63
- return () => disposeMappings()
64
- }, [mappingsProps, narrowedProps.style])
65
-
66
- const combinedProps = {
67
- ...deepMergeObjects(props, (mappingsProps ?? {}) as object),
68
- ...narrowedProps.style ? {
69
- style: {
70
- $$css: true,
71
- 'unistyles': styleClassNames.join(' ')
72
- },
73
- } : {},
74
- ...narrowedProps.contentContainerStyle ? {
75
- style: {
76
- $$css: true,
77
- 'unistyles': contentContainerStyleClassNames.join(' ')
78
- },
79
- } : {},
80
- } as unknown as TProps
81
-
82
- return <Component {...combinedProps} ref={ref} />
83
- })
13
+ return withUnistyles(Component as any, mappings as any)
84
14
  }
@@ -0,0 +1,9 @@
1
+ import React from 'react'
2
+ import { passForwardedRef } from './passForwardRef'
3
+
4
+ export const createUnistylesElement = (Component: any) => React.forwardRef((props, forwardedRef) => (
5
+ <Component
6
+ {...props}
7
+ ref={(ref: unknown) => passForwardedRef(props, ref, forwardedRef)}
8
+ />
9
+ ))
@@ -0,0 +1,24 @@
1
+ import React from 'react'
2
+ import type { ImageBackground, ImageBackgroundProps } from 'react-native'
3
+ import { UnistylesShadowRegistry } from '../specs'
4
+ import { passForwardedRef } from './passForwardRef'
5
+
6
+ export const createUnistylesImageBackground = (Component: typeof ImageBackground) => React.forwardRef<ImageBackground, ImageBackgroundProps>((props, forwardedRef) => (
7
+ <Component
8
+ {...props}
9
+ ref={ref => passForwardedRef(props, ref, forwardedRef)}
10
+ imageRef={ref => {
11
+ const style = Array.isArray(props.imageStyle)
12
+ ? props.imageStyle
13
+ : [props.imageStyle]
14
+
15
+ // @ts-expect-error - This is hidden from TS
16
+ UnistylesShadowRegistry.add(ref, style)
17
+
18
+ return () => {
19
+ // @ts-expect-error - This is hidden from TS
20
+ UnistylesShadowRegistry.remove(ref)
21
+ }
22
+ }}
23
+ />
24
+ ))
package/src/core/index.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  export { createUnistylesComponent } from './createUnistylesComponent'
2
- export { getBoundArgs } from './getBoundArgs'
3
- export { getId } from './getId'
2
+ export { createUnistylesElement } from './createUnistylesElement'
3
+ export { createUnistylesImageBackground } from './createUnistylesImageBackground'
4
+ export { withUnistyles } from './withUnistyles'
5
+ export { passForwardedRef } from './passForwardRef'
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+ import { UnistylesShadowRegistry } from '../specs'
3
+
4
+ export const passForwardedRef = <T>(
5
+ props: any,
6
+ ref: T,
7
+ forwardedRef: React.ForwardedRef<T>
8
+ ) => {
9
+ const passForwardedRef = () => {
10
+ if (typeof forwardedRef === 'function') {
11
+ return forwardedRef(ref)
12
+ }
13
+
14
+ if (forwardedRef) {
15
+ forwardedRef.current = ref
16
+ }
17
+
18
+ return () => {}
19
+ }
20
+ const forwardedRefReturnFn = passForwardedRef()
21
+
22
+ UnistylesShadowRegistry.add(ref, props.style)
23
+
24
+ return () => {
25
+ // @ts-expect-error - This is hidden from TS
26
+ UnistylesShadowRegistry.remove(ref)
27
+ forwardedRefReturnFn?.()
28
+ }
29
+ }
@@ -0,0 +1 @@
1
+ export { withUnistyles } from './withUnistyles'
@@ -0,0 +1,7 @@
1
+ import type { UnistylesMiniRuntime } from '../../specs';
2
+ import type { UnistylesTheme } from '../../types';
3
+
4
+ export const SUPPORTED_STYLE_PROPS = ['style', 'contentContainerStyle'] as const
5
+
6
+ export type SupportedStyleProps = typeof SUPPORTED_STYLE_PROPS[number]
7
+ export type Mappings<T = {}> = (theme: UnistylesTheme, rt: UnistylesMiniRuntime) => Omit<Partial<T>, SupportedStyleProps>
@@ -0,0 +1,93 @@
1
+ import { useEffect, useReducer, useRef, useState } from 'react'
2
+ import { UnistylesRuntime, UnistylesShadowRegistry, type UnistylesMiniRuntime } from '../../specs'
3
+ // It's imported that way because of circular dependency
4
+ import { UnistyleDependency } from '../../specs/NativePlatform'
5
+ import type { UnistylesTheme } from '../../types'
6
+ import type { Mappings } from './types'
7
+
8
+ const RTDependencyMap = {
9
+ breakpoint: UnistyleDependency.Breakpoints,
10
+ colorScheme: UnistyleDependency.ColorScheme,
11
+ contentSizeCategory: UnistyleDependency.ContentSizeCategory,
12
+ hasAdaptiveThemes: UnistyleDependency.AdaptiveThemes,
13
+ insets: UnistyleDependency.Insets,
14
+ fontScale: UnistyleDependency.FontScale,
15
+ isLandscape: UnistyleDependency.Orientation,
16
+ isPortrait: UnistyleDependency.Orientation,
17
+ navigationBar: UnistyleDependency.NavigationBar,
18
+ screen: UnistyleDependency.Dimensions,
19
+ statusBar: UnistyleDependency.StatusBar,
20
+ pixelRatio: UnistyleDependency.PixelRatio,
21
+ themeName: UnistyleDependency.ThemeName,
22
+ } satisfies Partial<Record<keyof UnistylesMiniRuntime, UnistyleDependency>>
23
+
24
+ type ListenerProps = {
25
+ updateTheme: VoidFunction,
26
+ updateRuntime: VoidFunction,
27
+ dependencies: Array<UnistyleDependency>
28
+ }
29
+
30
+ export const useDependencies = (listener: (props: ListenerProps) => VoidFunction) => {
31
+ const scopedTheme = UnistylesShadowRegistry.getScopedTheme() as UnistylesTheme
32
+ const [dependencies] = useState(() => new Set<number>())
33
+ const [theme, setTheme] = useState(UnistylesRuntime.getTheme(scopedTheme))
34
+ const [_, runtimeChanged] = useReducer(() => ({}), {})
35
+ const disposeRef = useRef<VoidFunction>()
36
+
37
+ const reinitListener = () => {
38
+ disposeRef.current?.()
39
+ disposeRef.current = listener({
40
+ dependencies: Array.from(dependencies),
41
+ updateTheme: () => {
42
+ if (scopedTheme) {
43
+ return
44
+ }
45
+
46
+ setTheme(UnistylesRuntime.getTheme(scopedTheme))
47
+ },
48
+ updateRuntime: () => runtimeChanged()
49
+ })
50
+ }
51
+
52
+ useEffect(() => {
53
+ reinitListener()
54
+
55
+ return () => disposeRef.current?.()
56
+ }, [dependencies.size])
57
+
58
+ return {
59
+ mappingsCallback: (callback: Mappings) => {
60
+ const proxifiedTheme = new Proxy(theme, {
61
+ get: (target, prop) => {
62
+ dependencies.add(UnistyleDependency.Theme)
63
+
64
+ return target[prop]
65
+ }
66
+ })
67
+ const proxifiedRuntime = new Proxy(UnistylesRuntime.miniRuntime, {
68
+ get: (target, prop) => {
69
+ if (prop in RTDependencyMap) {
70
+ dependencies.add(RTDependencyMap[prop as keyof typeof RTDependencyMap])
71
+ }
72
+
73
+ return target[prop as keyof typeof target]
74
+ }
75
+ })
76
+
77
+ return callback(proxifiedTheme, proxifiedRuntime)
78
+ },
79
+ addDependencies: (newDependencies: Array<UnistyleDependency>) => {
80
+ const dependenciesSize = dependencies.size
81
+
82
+ newDependencies.forEach(dependency => {
83
+ dependencies.add(dependency)
84
+ })
85
+
86
+ if (dependenciesSize === dependencies.size) {
87
+ return
88
+ }
89
+
90
+ reinitListener()
91
+ }
92
+ }
93
+ }