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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/web/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiBN,MAAM,KAAK,MAAM;yBACT,KAAK,CAAC,MAAM,CAAC;;CAErC,CAAA;AAED,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/web/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AAEzD,eAAO,MAAM,UAAU;;YAED,yBAAyB;;;;;;;;;;;;;;;iBAe9B,MAAM,KAAK,MAAM;yBACT,KAAK,CAAC,MAAM,CAAC;mBACd,MAAM;CAC7B,CAAA;AAED,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,cAAc,QAAQ,CAAA"}
@@ -1,7 +1,6 @@
1
1
  import type { UnistylesTheme, UnistylesValues } from '../types';
2
2
  import type { StyleSheet, StyleSheetWithSuperPowers } from '../types/stylesheet';
3
- import type { UnistyleDependency } from '../specs/NativePlatform';
4
- import type { UnistylesMiniRuntime } from '../specs';
3
+ import type { UnistylesMiniRuntime, UnistyleDependency } from '../specs';
5
4
  declare class UnistylesRegistryBuilder {
6
5
  #private;
7
6
  private readonly stylesheets;
@@ -9,7 +8,7 @@ declare class UnistylesRegistryBuilder {
9
8
  private readonly disposeListenersMap;
10
9
  private readonly dependenciesMap;
11
10
  private get styleTag();
12
- getComputedStylesheet: (stylesheet: StyleSheetWithSuperPowers<StyleSheet>) => StyleSheet;
11
+ getComputedStylesheet: (stylesheet: StyleSheetWithSuperPowers<StyleSheet>, scopedThemeName?: UnistylesTheme) => StyleSheet;
13
12
  addDependenciesToStylesheet: (stylesheet: (theme: UnistylesTheme, miniRuntime: UnistylesMiniRuntime) => StyleSheet, dependencies: Array<UnistyleDependency>) => void;
14
13
  add: (value: UnistylesValues) => {
15
14
  hash: string;
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/web/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAKhF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAWpD,cAAM,wBAAwB;;IAC1B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+D;IAC3F,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0C;IAExE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAkC;IACtE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA4E;IAE5G,OAAO,KAAK,QAAQ,GAcnB;IAED,qBAAqB,eAAgB,yBAAyB,CAAC,UAAU,CAAC,gBAkBzE;IAED,2BAA2B,eAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,KAAK,UAAU,gBAAgB,KAAK,CAAC,kBAAkB,CAAC,UAe3J;IAED,GAAG,UAAW,eAAe;;;MAiB5B;IAED,WAAW,SAAU,MAAM,UAAU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,UAwEvD;IAED,OAAO,CAAC,SAAS,CAmBhB;IAED,MAAM,UAAW,eAAe,UAmB/B;CACJ;AAED,eAAO,MAAM,iBAAiB,0BAAiC,CAAA"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/web/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAKhF,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAWxE,cAAM,wBAAwB;;IAC1B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+D;IAC3F,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0C;IAExE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAkC;IACtE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA4E;IAE5G,OAAO,KAAK,QAAQ,GAcnB;IAED,qBAAqB,eAAgB,yBAAyB,CAAC,UAAU,CAAC,oBAAoB,cAAc,gBA4B3G;IAED,2BAA2B,eAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,KAAK,UAAU,gBAAgB,KAAK,CAAC,kBAAkB,CAAC,UAe3J;IAED,GAAG,UAAW,eAAe;;;MAiB5B;IAED,WAAW,SAAU,MAAM,UAAU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,UAwEvD;IAED,OAAO,CAAC,SAAS,CAmBhB;IAED,MAAM,UAAW,eAAe,UAmB/B;CACJ;AAED,eAAO,MAAM,iBAAiB,0BAAiC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/web/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,QAA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jD,cAAM,uBAAuB;IACzB,UAAU,wBAAuB;IACjC,SAAS,wBAAsB;IAE/B,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IAYpB,IAAI,WAAW,gBASd;IAED,IAAI,SAAS,cAMZ;IAED,IAAI,mBAAmB,2BAEtB;IAED,IAAI,WAAW,sCAEd;IAED,IAAI,UAAU,wDAEb;IAED,IAAI,WAAW,gBAMd;IAED,IAAI,KAAK,UAER;IAED,IAAI,UAAU,WAEb;IAED,IAAI,MAAM;;;MAYT;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,MAAM;;;;;;MAQT;IAED,IAAI,SAAS,oDAEZ;IAED,IAAI,GAAG,YAEN;IAED,IAAI,iBAAiB,YAEpB;IAED,IAAI,aAAa,2DAEhB;IAED,IAAI,WAAW,IAAI,oBAAoB,CAuBtC;IAED,QAAQ,cAAe,YAAY,UAYlC;IAED,iBAAiB,cAAe,OAAO,UAQtC;IAED,0BAA0B,UAAW,MAAM,UAM1C;IAED,gBAAgB,aAAW;IAE3B,WAAW,cAAe,YAAY,WAAW,CAAC,YAAY,EAAE,QAAQ,KAAK,QAAQ,UAQpF;IAED,QAAQ,mCAQP;CACJ;AAED,eAAO,MAAM,gBAAgB,yBAAgC,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { UnistylesValues } from '../types';
1
+ import type { UnistylesTheme, UnistylesValues } from '../types';
2
2
  type Style = UnistylesValues | ((...args: Array<any>) => UnistylesValues);
3
3
  declare class UnistylesShadowRegistryBuilder {
4
4
  name: string;
@@ -7,9 +7,17 @@ declare class UnistylesShadowRegistryBuilder {
7
7
  toString: () => string;
8
8
  dispose: () => void;
9
9
  private resultsMap;
10
- private hashMap;
11
10
  private classNamesMap;
12
- add: (ref: any, styles: Array<Style>, _variants: Record<string, any> | undefined, _args: Array<Array<any>>) => string[] | undefined;
11
+ private selectedVariants;
12
+ private scopedTheme;
13
+ private disposeMap;
14
+ add: (ref: any, styles: Array<Style>) => string[] | undefined;
15
+ selectVariants: (variants?: Record<string, string | boolean | undefined>) => void;
16
+ setScopedTheme: (theme?: UnistylesTheme) => void;
17
+ getScopedTheme: () => undefined;
18
+ getVariants: () => {
19
+ [k: string]: string | boolean | undefined;
20
+ };
13
21
  remove: () => void;
14
22
  }
15
23
  export declare const UnistylesShadowRegistry: UnistylesShadowRegistryBuilder;
@@ -1 +1 @@
1
- {"version":3,"file":"shadowRegistry.d.ts","sourceRoot":"","sources":["../../../../src/web/shadowRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAQ/C,KAAK,KAAK,GAAG,eAAe,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,eAAe,CAAC,CAAA;AAEzE,cAAM,8BAA8B;IAEhC,IAAI,SAA4B;IAChC,MAAM,SAAQ;IACd,MAAM,gBAAa;IACnB,QAAQ,eAAkC;IAC1C,OAAO,aAAW;IAGlB,OAAO,CAAC,UAAU,CAA0C;IAC5D,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,aAAa,CAAwC;IAE7D,GAAG,QAAS,GAAG,UAAU,KAAK,CAAC,KAAK,CAAC,aAAa,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,SAAS,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,0BAwH1G;IAED,MAAM,aAAW;CACpB;AAED,eAAO,MAAM,uBAAuB,gCAAuC,CAAA"}
1
+ {"version":3,"file":"shadowRegistry.d.ts","sourceRoot":"","sources":["../../../../src/web/shadowRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAO/D,KAAK,KAAK,GAAG,eAAe,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,eAAe,CAAC,CAAA;AAEzE,cAAM,8BAA8B;IAEhC,IAAI,SAA4B;IAChC,MAAM,SAAQ;IACd,MAAM,gBAAa;IACnB,QAAQ,eAAkC;IAC1C,OAAO,aAAW;IAGlB,OAAO,CAAC,UAAU,CAA0C;IAC5D,OAAO,CAAC,aAAa,CAAwC;IAC7D,OAAO,CAAC,gBAAgB,CAAkD;IAC1E,OAAO,CAAC,WAAW,CAAwC;IAC3D,OAAO,CAAC,UAAU,CAAuC;IAEzD,GAAG,QAAS,GAAG,UAAU,KAAK,CAAC,KAAK,CAAC,0BAiHpC;IAED,cAAc,cAAe,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,UAUxE;IAED,cAAc,WAAY,cAAc,UAEvC;IAED,cAAc,kBAAyB;IAEvC,WAAW;;MAA4D;IAEvE,MAAM,aAAW;CACpB;AAED,eAAO,MAAM,uBAAuB,gCAAuC,CAAA"}
@@ -6,12 +6,11 @@ export type UnistyleSecrets = {
6
6
  __uni__stylesheet: StyleSheetWithSuperPowers<StyleSheet>;
7
7
  __uni__key: string;
8
8
  __uni__refs: Set<HTMLElement>;
9
- __uni__variants: Record<string, any>;
10
9
  __uni__args?: Array<any>;
11
10
  };
12
11
  export declare const assignSecrets: <T>(object: T, secrets: UnistyleSecrets) => T;
13
12
  export declare const extractSecrets: (object: any) => UnistyleSecrets | undefined;
14
- export declare const getStyles: (values: UnistylesValues) => {};
13
+ export declare const removeInlineStyles: (values: UnistylesValues) => {};
15
14
  export declare const isInDocument: (element: HTMLElement) => boolean;
16
15
  export declare const extractMediaQueryValue: (query: string) => number | undefined;
17
16
  export declare const getMediaQuery: (query: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"unistyle.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/unistyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,EAAE,WAAW,EAAe,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EAAE,UAA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AAG,CAAC,WAAW,CAAC,CAAA;IAC7B,WAAW,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,CAAC,UAAU,CAAC,WAAW,eAAe,MAKnE,CAAA;AAED,eAAO,MAAM,cAAc,WAAY,GAAG,gCAEzC,CAAA;AAED,eAAO,MAAM,kBAAkB,WAAY,eAAe,OAUzD,CAAA;AAED,eAAO,MAAM,YAAY,YAAa,WAAW,YAAoC,CAAA;AAErF,eAAO,MAAM,sBAAsB,UAAW,MAAM,uBAYnD,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,WAmB1C,CAAA;AAED,eAAO,MAAM,2BAA2B,UAAW,GAAG,yBAQrD,CAAA"}
@@ -54,6 +54,9 @@ namespace Unistyles { class HybridNativePlatformSpecCxx; }
54
54
  // This header is generated by Xcode/Swift on every app build.
55
55
  // If it cannot be found, make sure the Swift module's name (= podspec name) is actually "Unistyles".
56
56
  #include "Unistyles-Swift.h"
57
+ // Same as above, but used when building with frameworks (`use_frameworks`)
58
+ #elif __has_include(<Unistyles/Unistyles-Swift.h>)
59
+ #include <Unistyles/Unistyles-Swift.h>
57
60
  #else
58
61
  #error Unistyles's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "Unistyles", and try building the app first.
59
62
  #endif
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unistyles",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "Level up your React Native StyleSheet",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -70,11 +70,11 @@
70
70
  "husky": "9.1.7",
71
71
  "jest": "29.7.0",
72
72
  "metro-react-native-babel-preset": "0.77.0",
73
- "nitro-codegen": "0.18.0",
73
+ "nitro-codegen": "0.18.2",
74
74
  "react": "18.3.1",
75
75
  "react-native": "0.76.3",
76
76
  "react-native-builder-bob": "0.33.1",
77
- "react-native-nitro-modules": "0.18.0",
77
+ "react-native-nitro-modules": "0.18.2",
78
78
  "react-native-web": "0.19.13",
79
79
  "react-test-renderer": "18.3.1",
80
80
  "release-it": "17.6.0",
@@ -93,7 +93,7 @@
93
93
  ],
94
94
  "packageManager": "yarn@3.6.1",
95
95
  "engines": {
96
- "node": ">= 20.0.0"
96
+ "node": ">= 18.0.0"
97
97
  },
98
98
  "jest": {
99
99
  "preset": "react-native",
package/plugin/common.js CHANGED
@@ -1,7 +1,10 @@
1
1
  function getIdentifierNameFromExpression(t, memberExpression) {
2
2
  if (t.isMemberExpression(memberExpression)) {
3
3
  if (memberExpression.computed) {
4
- return getIdentifierNameFromExpression(t, memberExpression.property).flat()
4
+ return [
5
+ getIdentifierNameFromExpression(t, memberExpression.property),
6
+ getIdentifierNameFromExpression(t, memberExpression.object)
7
+ ].flat()
5
8
  }
6
9
 
7
10
  const object = memberExpression.object
@@ -15,11 +18,6 @@ function getIdentifierNameFromExpression(t, memberExpression) {
15
18
  if (t.isMemberExpression(object)) {
16
19
  return getIdentifierNameFromExpression(t, object).flat()
17
20
  }
18
-
19
- // If the object is a computed property, it may also be an Identifier
20
- if (t.isMemberExpression(object) && t.isIdentifier(object.property)) {
21
- return [object.object.name]
22
- }
23
21
  }
24
22
 
25
23
  if (t.isBinaryExpression(memberExpression)) {
package/plugin/import.js CHANGED
@@ -1,34 +1,71 @@
1
- module.exports = function addUnistylesImport(t, path, state) {
2
- const newImport = t.importDeclaration(
3
- [
4
- t.importSpecifier(t.identifier('UnistylesShadowRegistry'), t.identifier('UnistylesShadowRegistry')),
5
- ...state.file.shouldIncludePressable
6
- ? [
7
- t.importSpecifier(t.identifier('Pressable'), t.identifier('Pressable')),
8
- t.importSpecifier(t.identifier('getBoundArgs'), t.identifier('getBoundArgs'))
9
- ]
10
- : []
11
- ].filter(Boolean),
12
- t.stringLiteral('react-native-unistyles')
13
- )
14
-
15
- if (state.file.shouldIncludePressable) {
16
- const rnImport = path.node.body.find(node => t.isImportDeclaration(node) && node.source.value === 'react-native')
17
-
18
- if (rnImport) {
19
- rnImport.specifiers = rnImport.specifiers.filter(specifier => specifier.local.name !== 'Pressable')
1
+ function addUnistylesImport(t, path, state) {
2
+ const localNames = Object.keys(state.reactNativeImports)
3
+ const names = Object.values(state.reactNativeImports)
4
+ const pairs = Object.entries(state.reactNativeImports)
5
+ const nodesToRemove = []
6
+
7
+ // remove rn-imports
8
+ path.node.body.forEach(node => {
9
+ // user might have multiple imports like import type, import
10
+ if (t.isImportDeclaration(node) && node.source.value === 'react-native') {
11
+ node.specifiers = node.specifiers.filter(specifier => !localNames.some(name => name === specifier.local.name))
12
+
13
+ if (node.specifiers.length === 0) {
14
+ nodesToRemove.push(node)
15
+ }
20
16
  }
17
+ })
21
18
 
22
- const rnWebImport = path.node.body.find(node => t.isImportDeclaration(node) && node.source.value === 'react-native-web/dist/exports/Pressable')
23
- const unistylesImport = path.node.body.find(node => t.isImportDeclaration(node) && node.source.value === 'react-native-unistyles')
24
- const hasUniPressable = unistylesImport && unistylesImport.specifiers
25
- ? unistylesImport.specifiers.find(specifier => specifier.imported.name === 'Pressable' && specifier.local.name !== "NativePressableReactNative")
26
- : false
19
+ // remove RNWeb imports
20
+ names.forEach(name => {
21
+ const rnWebImport = path.node.body.find(node => t.isImportDeclaration(node) && node.source.value === `react-native-web/dist/exports/${name}`)
27
22
 
28
- if (rnWebImport && !hasUniPressable) {
23
+ if (rnWebImport) {
29
24
  rnWebImport.specifiers = []
30
25
  }
26
+ })
27
+
28
+ // import components from react-native-unistyles
29
+ pairs.forEach(([localName, name]) => {
30
+ const newImport = t.importDeclaration(
31
+ [t.importSpecifier(t.identifier(localName), t.identifier(name))],
32
+ t.stringLiteral(state.opts.isLocal
33
+ ? state.file.opts.filename.split('react-native-unistyles').at(0).concat(`react-native-unistyles/src/components/native/${name}`)
34
+ : `react-native-unistyles/src/components/native/${name}`
35
+ )
36
+ )
37
+
38
+ path.node.body.unshift(newImport)
39
+ })
40
+
41
+ // import variants
42
+ if (state.file.hasVariants) {
43
+ const unistylesImport = path.node.body
44
+ .find(node => t.isImportDeclaration(node) && node.source.value === 'react-native-unistyles')
45
+
46
+ if (unistylesImport) {
47
+ // prevent duplications
48
+ if (!unistylesImport.specifiers.some(specifier => specifier.local.name === 'Variants')) {
49
+ unistylesImport.specifiers.push(t.importSpecifier(t.identifier('Variants'), t.identifier('Variants')))
50
+ }
51
+ } else {
52
+ // Add a new import declaration for "Variants" from "react-native-unistyles"
53
+ const newImport = t.importDeclaration(
54
+ [t.importSpecifier(t.identifier('Variants'), t.identifier('Variants'))],
55
+ t.stringLiteral('react-native-unistyles')
56
+ )
57
+
58
+ path.node.body.unshift(newImport)
59
+ }
31
60
  }
32
61
 
33
- path.node.body.unshift(newImport)
62
+ // cleanup
63
+ nodesToRemove.forEach(node => path.node.body.splice(path.node.body.indexOf(node), 1))
64
+ }
65
+
66
+ const isInsideNodeModules = state => state.file.opts.filename.includes('node_modules')
67
+
68
+ module.exports = {
69
+ isInsideNodeModules,
70
+ addUnistylesImport
34
71
  }
package/plugin/index.js CHANGED
@@ -1,35 +1,41 @@
1
- const addUnistylesImport = require('./import')
1
+ const { addUnistylesImport, isInsideNodeModules } = require('./import')
2
2
  const { getStyleMetadata, getStyleAttribute, styleAttributeToArray, handlePressable } = require('./style')
3
- const { getRefProp, addRef, overrideRef, hasStringRef } = require('./ref')
4
- const { isUnistylesStyleSheet, analyzeDependencies, addStyleSheetTag, getUnistyle } = require('./stylesheet')
5
- const { isUsingVariants, extractVariants } = require('./variants')
3
+ const { hasStringRef } = require('./ref')
4
+ const { isUnistylesStyleSheet, analyzeDependencies, addStyleSheetTag, getUnistyles } = require('./stylesheet')
5
+ const { isUsingVariants, extractVariants, addJSXVariants } = require('./variants')
6
6
 
7
7
  const reactNativeComponentNames = [
8
+ 'ActivityIndicator',
8
9
  'View',
9
10
  'Text',
10
11
  'Image',
11
12
  'ImageBackground',
12
13
  'KeyboardAvoidingView',
13
- 'Modal',
14
14
  'Pressable',
15
15
  'ScrollView',
16
16
  'FlatList',
17
17
  'SectionList',
18
18
  'Switch',
19
- 'Text',
20
19
  'TextInput',
20
+ 'RefreshControl',
21
21
  'TouchableHighlight',
22
22
  'TouchableOpacity',
23
- 'TouchableWithoutFeedback',
24
23
  'VirtualizedList'
25
24
  ]
26
25
 
26
+ // Modal - there is no exposed native handle
27
+ // TouchableWithoutFeedback - can't accept a ref
28
+
27
29
  module.exports = function ({ types: t }) {
28
30
  return {
29
31
  name: 'babel-react-native-unistyles',
30
32
  visitor: {
31
33
  Program: {
32
34
  enter(path, state) {
35
+ if (isInsideNodeModules(state)) {
36
+ return
37
+ }
38
+
33
39
  state.file.hasAnyUnistyle = false
34
40
  state.file.hasUnistylesImport = false
35
41
  state.file.shouldIncludePressable = false
@@ -40,7 +46,7 @@ module.exports = function ({ types: t }) {
40
46
  state.reactNativeImports = {}
41
47
  },
42
48
  exit(path, state) {
43
- if (state.file.hasAnyUnistyle) {
49
+ if (state.file.hasAnyUnistyle || state.file.hasVariants) {
44
50
  addUnistylesImport(t, path, state)
45
51
  }
46
52
  }
@@ -65,6 +71,10 @@ module.exports = function ({ types: t }) {
65
71
  }
66
72
  },
67
73
  VariableDeclaration(path, state) {
74
+ if (isInsideNodeModules(state)) {
75
+ return
76
+ }
77
+
68
78
  path.node.declarations.forEach((declaration) => {
69
79
  if (t.isArrowFunctionExpression(declaration.init) || t.isFunctionExpression(declaration.init)) {
70
80
  const componentName = declaration.id
@@ -78,6 +88,10 @@ module.exports = function ({ types: t }) {
78
88
  })
79
89
  },
80
90
  ImportDeclaration(path, state) {
91
+ if (isInsideNodeModules(state)) {
92
+ return
93
+ }
94
+
81
95
  const importSource = path.node.source.value
82
96
 
83
97
  if (importSource.includes('react-native-unistyles')) {
@@ -97,7 +111,7 @@ module.exports = function ({ types: t }) {
97
111
  }
98
112
 
99
113
  if (specifier.imported && reactNativeComponentNames.includes(specifier.imported.name)) {
100
- state.reactNativeImports[specifier.local.name] = true
114
+ state.reactNativeImports[specifier.local.name] = specifier.imported.name
101
115
  }
102
116
  })
103
117
  }
@@ -107,6 +121,10 @@ module.exports = function ({ types: t }) {
107
121
  }
108
122
  },
109
123
  JSXElement(path, state) {
124
+ if (isInsideNodeModules(state)) {
125
+ return
126
+ }
127
+
110
128
  if (state.file.isClassComponent) {
111
129
  return
112
130
  }
@@ -147,17 +165,15 @@ module.exports = function ({ types: t }) {
147
165
  // to add import
148
166
  state.file.hasAnyUnistyle = true
149
167
 
150
- const refProp = getRefProp(t, path)
151
-
152
- if (!refProp && hasStringRef(t, path)) {
168
+ if (hasStringRef(t, path)) {
153
169
  throw new Error("Detected string based ref which is not supported by Unistyles.")
154
170
  }
155
-
156
- refProp
157
- ? overrideRef(t, path, refProp, metadata, state)
158
- : addRef(t, path, metadata, state)
159
171
  },
160
172
  CallExpression(path, state) {
173
+ if (isInsideNodeModules(state)) {
174
+ return
175
+ }
176
+
161
177
  if (isUsingVariants(t, path)) {
162
178
  extractVariants(t, path, state)
163
179
  }
@@ -174,13 +190,11 @@ module.exports = function ({ types: t }) {
174
190
  if (t.isObjectExpression(arg)) {
175
191
  arg.properties.forEach(property => {
176
192
  if (t.isObjectProperty(property)) {
177
- const propertyValue = getUnistyle(t, property)
193
+ const propertyValues = getUnistyles(t, property)
178
194
 
179
- if (!propertyValue) {
180
- return
181
- }
182
-
183
- analyzeDependencies(t, state, property.key.name, propertyValue)
195
+ propertyValues.forEach(propertyValue => {
196
+ analyzeDependencies(t, state, property.key.name, propertyValue)
197
+ })
184
198
  }
185
199
  })
186
200
  }
@@ -204,17 +218,23 @@ module.exports = function ({ types: t }) {
204
218
  if (t.isObjectExpression(body)) {
205
219
  body.properties.forEach(property => {
206
220
  if (t.isObjectProperty(property)) {
207
- const propertyValue = getUnistyle(t, property)
208
-
209
- if (!propertyValue) {
210
- return
211
- }
221
+ const propertyValues = getUnistyles(t, property)
212
222
 
213
- analyzeDependencies(t, state, property.key.name, propertyValue, themeLocalName, miniRuntimeLocalName)
223
+ propertyValues.forEach(propertyValue => {
224
+ analyzeDependencies(t, state, property.key.name, propertyValue, themeLocalName, miniRuntimeLocalName)
225
+ })
214
226
  }
215
227
  })
216
228
  }
217
229
  }
230
+ },
231
+ ReturnStatement(path, state) {
232
+ // ignore nested returns in JSX elements
233
+ const hasJSXParent = path.findParent(p => p.isJSXElement())
234
+
235
+ if (!hasJSXParent && state.file.hasVariants) {
236
+ addJSXVariants(t, path, state)
237
+ }
218
238
  }
219
239
  }
220
240
  }