@niibase/uniwind 1.6.4 → 1.8.0

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 (342) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/cli/index.cjs +91 -0
  3. package/dist/cli/index.mjs +84 -0
  4. package/dist/common/{css → bundler/artifacts/css}/index.js +1 -4
  5. package/dist/common/{css → bundler/artifacts/css}/themes.js +4 -1
  6. package/dist/common/{utils/buildDtsFile.js → bundler/artifacts/dts.js} +1 -2
  7. package/dist/common/bundler/cli/index.js +76 -0
  8. package/dist/common/bundler/config.js +75 -0
  9. package/dist/common/bundler/css-compiler/compileCSS.js +18 -0
  10. package/dist/common/bundler/css-compiler/compileNativeCSS.js +19 -0
  11. package/dist/common/bundler/css-compiler/compileTailwind.js +27 -0
  12. package/dist/common/bundler/css-compiler/compileWebCSS.js +15 -0
  13. package/dist/common/{vite → bundler/css-compiler}/index.js +4 -4
  14. package/dist/common/bundler/css-processor/addMetaToStylesTemplate.js +130 -0
  15. package/dist/common/bundler/css-processor/animation.js +112 -0
  16. package/dist/common/bundler/css-processor/color.js +66 -0
  17. package/dist/common/bundler/css-processor/css.js +510 -0
  18. package/dist/common/bundler/css-processor/functions.js +145 -0
  19. package/dist/common/bundler/css-processor/index.js +38 -0
  20. package/dist/common/bundler/css-processor/mq.js +87 -0
  21. package/dist/common/bundler/css-processor/processor.js +353 -0
  22. package/dist/common/bundler/css-processor/rn.js +356 -0
  23. package/dist/common/bundler/css-processor/serialize.js +86 -0
  24. package/dist/common/bundler/css-processor/types.js +1 -0
  25. package/dist/common/bundler/css-processor/units.js +55 -0
  26. package/dist/common/bundler/css-processor/utils.js +61 -0
  27. package/dist/common/bundler/css-processor/var.js +20 -0
  28. package/dist/common/{css-visitor → bundler/css-visitor}/rule-visitor.js +7 -7
  29. package/dist/common/{css-visitor → bundler/css-visitor}/visitor.js +5 -6
  30. package/dist/common/bundler/logger.js +44 -0
  31. package/dist/common/bundler/types.js +1 -0
  32. package/dist/common/common/consts.js +26 -2
  33. package/dist/common/components/web/rnw.js +2 -2
  34. package/dist/common/core/config/config.common.js +9 -9
  35. package/dist/common/core/config/config.js +2 -2
  36. package/dist/common/core/config/config.native.js +4 -8
  37. package/dist/common/core/listener.js +10 -10
  38. package/dist/common/core/native/native-utils.js +1 -8
  39. package/dist/common/core/native/parsers/textShadow.js +6 -18
  40. package/dist/common/core/native/parsers/transforms.js +1 -5
  41. package/dist/common/core/native/runtime.js +7 -3
  42. package/dist/common/core/native/store.js +22 -69
  43. package/dist/common/core/web/cssListener.js +2 -2
  44. package/dist/common/hoc/withUniwind.js +5 -5
  45. package/dist/common/hoc/withUniwind.native.js +5 -5
  46. package/dist/common/hooks/useCSSVariable/getVariableValue.native.js +4 -1
  47. package/dist/common/hooks/useCSSVariable/useCSSVariable.js +6 -2
  48. package/dist/common/hooks/useUniwind.js +2 -2
  49. package/dist/metro/index.cjs +40 -34
  50. package/dist/metro/index.d.ts +2 -0
  51. package/dist/metro/index.mjs +28 -22
  52. package/dist/metro/{metro-transformer.cjs → transformer.cjs} +316 -200
  53. package/dist/metro/{metro-transformer.mjs → transformer.mjs} +254 -138
  54. package/dist/module/{css → bundler/artifacts/css}/index.d.ts +1 -1
  55. package/dist/module/{css → bundler/artifacts/css}/index.js +1 -4
  56. package/dist/module/{css → bundler/artifacts/css}/themes.js +4 -1
  57. package/dist/module/{utils/buildDtsFile.js → bundler/artifacts/dts.js} +3 -4
  58. package/dist/module/bundler/cli/index.d.ts +2 -0
  59. package/dist/module/bundler/cli/index.js +81 -0
  60. package/dist/module/bundler/config.d.ts +17 -0
  61. package/dist/module/bundler/config.js +77 -0
  62. package/dist/module/bundler/css-compiler/compileCSS.d.ts +2 -0
  63. package/dist/module/bundler/css-compiler/compileCSS.js +11 -0
  64. package/dist/module/bundler/css-compiler/compileNativeCSS.d.ts +2 -0
  65. package/dist/module/bundler/css-compiler/compileNativeCSS.js +33 -0
  66. package/dist/module/bundler/css-compiler/compileTailwind.d.ts +2 -0
  67. package/dist/module/bundler/css-compiler/compileTailwind.js +22 -0
  68. package/dist/module/bundler/css-compiler/compileWebCSS.d.ts +2 -0
  69. package/dist/module/bundler/css-compiler/compileWebCSS.js +8 -0
  70. package/dist/module/bundler/css-compiler/index.d.ts +1 -0
  71. package/dist/module/bundler/css-compiler/index.js +1 -0
  72. package/dist/module/bundler/css-processor/addMetaToStylesTemplate.d.ts +3 -0
  73. package/dist/module/bundler/css-processor/addMetaToStylesTemplate.js +136 -0
  74. package/dist/module/bundler/css-processor/animation.d.ts +6 -0
  75. package/dist/module/bundler/css-processor/animation.js +112 -0
  76. package/dist/module/bundler/css-processor/color.d.ts +12 -0
  77. package/dist/module/bundler/css-processor/color.js +63 -0
  78. package/dist/module/bundler/css-processor/css.d.ts +23 -0
  79. package/dist/module/bundler/css-processor/css.js +566 -0
  80. package/dist/module/bundler/css-processor/functions.d.ts +12 -0
  81. package/dist/module/bundler/css-processor/functions.js +190 -0
  82. package/dist/module/bundler/css-processor/index.d.ts +3 -0
  83. package/dist/module/bundler/css-processor/index.js +3 -0
  84. package/dist/module/bundler/css-processor/mq.d.ts +12 -0
  85. package/dist/module/bundler/css-processor/mq.js +78 -0
  86. package/dist/module/bundler/css-processor/processor.d.ts +36 -0
  87. package/dist/module/bundler/css-processor/processor.js +336 -0
  88. package/dist/module/bundler/css-processor/rn.d.ts +10 -0
  89. package/dist/module/bundler/css-processor/rn.js +400 -0
  90. package/dist/module/bundler/css-processor/serialize.d.ts +2 -0
  91. package/dist/module/bundler/css-processor/serialize.js +101 -0
  92. package/dist/module/bundler/css-processor/types.d.ts +28 -0
  93. package/dist/module/bundler/css-processor/types.js +0 -0
  94. package/dist/module/bundler/css-processor/units.d.ts +10 -0
  95. package/dist/module/bundler/css-processor/units.js +48 -0
  96. package/dist/module/bundler/css-processor/utils.d.ts +23 -0
  97. package/dist/{shared/uniwind.PtWWxxnh.mjs → module/bundler/css-processor/utils.js} +12 -18
  98. package/dist/module/bundler/css-processor/var.d.ts +7 -0
  99. package/dist/module/bundler/css-processor/var.js +13 -0
  100. package/dist/module/{css-visitor → bundler/css-visitor}/function-visitor.d.ts +1 -1
  101. package/dist/module/{css-visitor → bundler/css-visitor}/rule-visitor.d.ts +4 -3
  102. package/dist/module/{css-visitor → bundler/css-visitor}/rule-visitor.js +7 -7
  103. package/dist/module/{css-visitor → bundler/css-visitor}/visitor.d.ts +3 -3
  104. package/dist/module/{css-visitor → bundler/css-visitor}/visitor.js +5 -6
  105. package/dist/module/bundler/logger.d.ts +12 -0
  106. package/dist/module/bundler/logger.js +37 -0
  107. package/dist/module/bundler/types.d.ts +15 -0
  108. package/dist/module/bundler/types.js +0 -0
  109. package/dist/module/common/consts.d.ts +21 -0
  110. package/dist/module/common/consts.js +24 -0
  111. package/dist/module/components/ScopedTheme/ScopedTheme.native.d.ts +1 -1
  112. package/dist/module/components/native/Pressable.d.ts +1 -1
  113. package/dist/module/components/native/TouchableHighlight.d.ts +1 -1
  114. package/dist/module/components/native/TouchableOpacity.d.ts +1 -1
  115. package/dist/module/components/native/useAccentColor.d.ts +1 -1
  116. package/dist/module/components/native/useStyle.d.ts +3 -3
  117. package/dist/module/components/react-native-gesture-handler/native/BaseButton.d.ts +1 -1
  118. package/dist/module/components/react-native-gesture-handler/native/BorderlessButton.d.ts +1 -1
  119. package/dist/module/components/react-native-gesture-handler/native/DrawerLayoutAndroid.d.ts +1 -1
  120. package/dist/module/components/react-native-gesture-handler/native/FlatList.d.ts +1 -1
  121. package/dist/module/components/react-native-gesture-handler/native/Pressable.d.ts +1 -1
  122. package/dist/module/components/react-native-gesture-handler/native/PureNativeButton.d.ts +1 -1
  123. package/dist/module/components/react-native-gesture-handler/native/RawButton.d.ts +1 -1
  124. package/dist/module/components/react-native-gesture-handler/native/RectButton.d.ts +1 -1
  125. package/dist/module/components/react-native-gesture-handler/native/RefreshControl.d.ts +1 -1
  126. package/dist/module/components/react-native-gesture-handler/native/ScrollView.d.ts +1 -1
  127. package/dist/module/components/react-native-gesture-handler/native/Switch.d.ts +1 -1
  128. package/dist/module/components/react-native-gesture-handler/native/Text.d.ts +4 -1
  129. package/dist/module/components/react-native-gesture-handler/native/TextInput.d.ts +1 -1
  130. package/dist/module/components/web/Pressable.d.ts +1 -1
  131. package/dist/module/components/web/TouchableHighlight.d.ts +1 -1
  132. package/dist/module/components/web/TouchableOpacity.d.ts +1 -1
  133. package/dist/module/components/web/rnw.js +1 -1
  134. package/dist/module/core/config/config.common.d.ts +6 -7
  135. package/dist/module/core/config/config.common.js +2 -2
  136. package/dist/module/core/config/config.d.ts +1 -1
  137. package/dist/module/core/config/config.js +1 -1
  138. package/dist/module/core/config/config.native.d.ts +2 -2
  139. package/dist/module/core/config/config.native.js +2 -6
  140. package/dist/module/core/listener.d.ts +1 -1
  141. package/dist/module/core/listener.js +1 -1
  142. package/dist/module/core/native/native-utils.d.ts +0 -1
  143. package/dist/module/core/native/native-utils.js +0 -6
  144. package/dist/module/core/native/parsers/textShadow.js +6 -18
  145. package/dist/module/core/native/parsers/transforms.js +1 -5
  146. package/dist/module/core/native/runtime.js +5 -1
  147. package/dist/module/core/native/store.d.ts +3 -3
  148. package/dist/module/core/native/store.js +22 -65
  149. package/dist/module/core/types.d.ts +12 -7
  150. package/dist/module/core/web/cssListener.js +1 -1
  151. package/dist/module/core/web/getWebStyles.d.ts +1 -1
  152. package/dist/module/hoc/types.d.ts +2 -2
  153. package/dist/module/hoc/withUniwind.d.ts +1 -1
  154. package/dist/module/hoc/withUniwind.js +5 -5
  155. package/dist/module/hoc/withUniwind.native.d.ts +1 -1
  156. package/dist/module/hoc/withUniwind.native.js +5 -5
  157. package/dist/module/hooks/useCSSVariable/getVariableValue.native.d.ts +1 -1
  158. package/dist/module/hooks/useCSSVariable/getVariableValue.native.js +4 -1
  159. package/dist/module/hooks/useCSSVariable/useCSSVariable.d.ts +1 -1
  160. package/dist/module/hooks/useCSSVariable/useCSSVariable.js +5 -1
  161. package/dist/module/hooks/useResolveClassNames.d.ts +1 -1
  162. package/dist/module/hooks/useUniwind.d.ts +1 -1
  163. package/dist/module/hooks/useUniwind.js +1 -1
  164. package/dist/module/index.d.ts +1 -2
  165. package/dist/shared/{uniwind.r2i22V6d.cjs → uniwind.BEqYiPBB.cjs} +319 -217
  166. package/dist/shared/uniwind.CFAAUZ2t.mjs +3 -0
  167. package/dist/shared/uniwind.DJ5M1Q4q.cjs +5 -0
  168. package/dist/shared/{uniwind.BGiqYvxb.mjs → uniwind.DgC4MT51.mjs} +312 -214
  169. package/dist/vite/index.cjs +82 -59
  170. package/dist/vite/index.mjs +80 -58
  171. package/package.json +37 -21
  172. package/src/{metro → bundler/adapters/metro}/index.d.ts +2 -0
  173. package/src/bundler/adapters/metro/index.ts +1 -0
  174. package/src/bundler/adapters/metro/metro.ts +67 -0
  175. package/src/{metro/metro-css-patches.ts → bundler/adapters/metro/patches.ts} +3 -2
  176. package/src/{metro → bundler/adapters/metro}/resolvers.ts +8 -8
  177. package/src/bundler/adapters/metro/transformer.ts +85 -0
  178. package/src/bundler/adapters/vite/vite.ts +148 -0
  179. package/src/{css → bundler/artifacts/css}/extraUtilities.ts +1 -1
  180. package/src/{css → bundler/artifacts/css}/index.ts +1 -5
  181. package/src/{css → bundler/artifacts/css}/themes.ts +7 -2
  182. package/src/{utils/buildDtsFile.ts → bundler/artifacts/dts.ts} +3 -4
  183. package/src/bundler/cli/index.ts +105 -0
  184. package/src/bundler/config.ts +94 -0
  185. package/src/bundler/css-compiler/compileCSS.ts +15 -0
  186. package/src/bundler/css-compiler/compileNativeCSS.ts +41 -0
  187. package/src/bundler/css-compiler/compileTailwind.ts +25 -0
  188. package/src/bundler/css-compiler/compileWebCSS.ts +10 -0
  189. package/src/bundler/css-compiler/index.ts +1 -0
  190. package/src/{metro → bundler/css-processor}/addMetaToStylesTemplate.ts +36 -17
  191. package/src/{metro/processor → bundler/css-processor}/animation.ts +4 -4
  192. package/src/{metro/processor → bundler/css-processor}/color.ts +5 -4
  193. package/src/{metro/processor → bundler/css-processor}/css.ts +19 -11
  194. package/src/{metro/processor → bundler/css-processor}/functions.ts +2 -2
  195. package/src/bundler/css-processor/index.ts +3 -0
  196. package/src/{metro/processor → bundler/css-processor}/mq.ts +4 -4
  197. package/src/{metro/processor → bundler/css-processor}/processor.ts +20 -18
  198. package/src/{metro/processor → bundler/css-processor}/rn.ts +96 -3
  199. package/src/{metro/utils → bundler/css-processor}/serialize.ts +2 -2
  200. package/src/{metro → bundler/css-processor}/types.ts +3 -17
  201. package/src/{metro/processor → bundler/css-processor}/units.ts +2 -2
  202. package/src/{metro/utils/common.ts → bundler/css-processor/utils.ts} +2 -5
  203. package/src/{metro/processor → bundler/css-processor}/var.ts +2 -2
  204. package/src/{css-visitor → bundler/css-visitor}/function-visitor.ts +1 -1
  205. package/src/{css-visitor → bundler/css-visitor}/rule-visitor.ts +8 -7
  206. package/src/{css-visitor → bundler/css-visitor}/visitor.ts +4 -3
  207. package/src/{metro → bundler}/logger.ts +4 -0
  208. package/src/bundler/types.ts +17 -0
  209. package/src/common/consts.ts +25 -0
  210. package/src/components/ScopedTheme/ScopedTheme.native.tsx +1 -1
  211. package/src/components/native/ActivityIndicator.tsx +2 -1
  212. package/src/components/native/Button.tsx +2 -1
  213. package/src/components/native/FlatList.tsx +2 -1
  214. package/src/components/native/Image.tsx +2 -1
  215. package/src/components/native/ImageBackground.tsx +2 -1
  216. package/src/components/native/InputAccessoryView.tsx +3 -2
  217. package/src/components/native/KeyboardAvoidingView.tsx +2 -1
  218. package/src/components/native/Modal.tsx +2 -1
  219. package/src/components/native/Pressable.tsx +1 -1
  220. package/src/components/native/RefreshControl.tsx +2 -1
  221. package/src/components/native/SafeAreaView.tsx +2 -1
  222. package/src/components/native/ScrollView.tsx +2 -1
  223. package/src/components/native/SectionList.tsx +2 -1
  224. package/src/components/native/Switch.tsx +3 -2
  225. package/src/components/native/Text.tsx +3 -2
  226. package/src/components/native/TextInput.tsx +3 -2
  227. package/src/components/native/TouchableHighlight.tsx +3 -2
  228. package/src/components/native/TouchableNativeFeedback.tsx +3 -2
  229. package/src/components/native/TouchableOpacity.tsx +3 -2
  230. package/src/components/native/TouchableWithoutFeedback.tsx +3 -2
  231. package/src/components/native/View.tsx +2 -1
  232. package/src/components/native/VirtualizedList.tsx +2 -1
  233. package/src/components/native/useAccentColor.ts +1 -1
  234. package/src/components/native/useStyle.ts +2 -2
  235. package/src/components/react-native-gesture-handler/native/BaseButton.tsx +1 -1
  236. package/src/components/react-native-gesture-handler/native/BorderlessButton.tsx +1 -1
  237. package/src/components/react-native-gesture-handler/native/DrawerLayoutAndroid.tsx +1 -1
  238. package/src/components/react-native-gesture-handler/native/FlatList.tsx +1 -1
  239. package/src/components/react-native-gesture-handler/native/GestureHandlerRootView.tsx +1 -1
  240. package/src/components/react-native-gesture-handler/native/Pressable.tsx +1 -1
  241. package/src/components/react-native-gesture-handler/native/PureNativeButton.tsx +1 -1
  242. package/src/components/react-native-gesture-handler/native/RawButton.tsx +1 -1
  243. package/src/components/react-native-gesture-handler/native/RectButton.tsx +1 -1
  244. package/src/components/react-native-gesture-handler/native/RefreshControl.tsx +1 -1
  245. package/src/components/react-native-gesture-handler/native/ScrollView.tsx +1 -1
  246. package/src/components/react-native-gesture-handler/native/Switch.tsx +2 -2
  247. package/src/components/react-native-gesture-handler/native/Text.tsx +2 -2
  248. package/src/components/react-native-gesture-handler/native/TextInput.tsx +2 -2
  249. package/src/components/react-native-gesture-handler/native/TouchableNativeFeedback.tsx +2 -2
  250. package/src/components/react-native-gesture-handler/native/TouchableOpacity.tsx +2 -2
  251. package/src/components/react-native-gesture-handler/native/TouchableWithoutFeedback.tsx +2 -2
  252. package/src/components/web/ActivityIndicator.tsx +2 -1
  253. package/src/components/web/Button.tsx +2 -1
  254. package/src/components/web/FlatList.tsx +2 -1
  255. package/src/components/web/Image.tsx +2 -1
  256. package/src/components/web/ImageBackground.tsx +2 -1
  257. package/src/components/web/KeyboardAvoidingView.tsx +2 -1
  258. package/src/components/web/Modal.tsx +2 -1
  259. package/src/components/web/Pressable.tsx +2 -1
  260. package/src/components/web/RefreshControl.tsx +2 -1
  261. package/src/components/web/SafeAreaView.tsx +2 -1
  262. package/src/components/web/ScrollView.tsx +2 -1
  263. package/src/components/web/SectionList.tsx +2 -1
  264. package/src/components/web/Switch.tsx +2 -1
  265. package/src/components/web/Text.tsx +2 -1
  266. package/src/components/web/TextInput.tsx +2 -1
  267. package/src/components/web/TouchableHighlight.tsx +2 -1
  268. package/src/components/web/TouchableOpacity.tsx +2 -1
  269. package/src/components/web/TouchableWithoutFeedback.tsx +2 -1
  270. package/src/components/web/View.tsx +2 -1
  271. package/src/components/web/VirtualizedList.tsx +2 -1
  272. package/src/components/web/rnw.ts +1 -1
  273. package/src/core/config/config.common.ts +11 -9
  274. package/src/core/config/config.native.ts +4 -8
  275. package/src/core/config/config.ts +2 -2
  276. package/src/core/listener.ts +1 -1
  277. package/src/core/native/native-utils.ts +0 -9
  278. package/src/core/native/parsers/textShadow.ts +6 -18
  279. package/src/core/native/parsers/transforms.ts +1 -5
  280. package/src/core/native/runtime.ts +6 -1
  281. package/src/core/native/store.ts +26 -69
  282. package/src/core/types.ts +13 -7
  283. package/src/core/web/cssListener.ts +1 -1
  284. package/src/core/web/getWebStyles.ts +1 -1
  285. package/src/hoc/types.ts +2 -2
  286. package/src/hoc/withUniwind.native.tsx +4 -3
  287. package/src/hoc/withUniwind.tsx +3 -2
  288. package/src/hooks/useCSSVariable/getVariableValue.native.ts +6 -3
  289. package/src/hooks/useCSSVariable/useCSSVariable.ts +8 -2
  290. package/src/hooks/useResolveClassNames.ts +1 -1
  291. package/src/hooks/useUniwind.ts +2 -2
  292. package/src/index.ts +1 -2
  293. package/dist/common/types.js +0 -28
  294. package/dist/common/utils/stringifyThemes.js +0 -8
  295. package/dist/common/vite/vite.js +0 -95
  296. package/dist/module/types.d.ts +0 -21
  297. package/dist/module/types.js +0 -22
  298. package/dist/module/utils/stringifyThemes.d.ts +0 -1
  299. package/dist/module/utils/stringifyThemes.js +0 -1
  300. package/dist/module/vite/index.d.ts +0 -9
  301. package/dist/module/vite/index.js +0 -1
  302. package/dist/module/vite/vite.d.ts +0 -8
  303. package/dist/module/vite/vite.js +0 -98
  304. package/dist/shared/uniwind.B5q8hBGv.cjs +0 -18
  305. package/dist/shared/uniwind.Cv73KtI-.cjs +0 -86
  306. package/dist/shared/uniwind.JSWK3vHl.mjs +0 -14
  307. package/src/metro/compileVirtual.ts +0 -85
  308. package/src/metro/index.ts +0 -1
  309. package/src/metro/injectThemes.ts +0 -23
  310. package/src/metro/metro-transformer.ts +0 -116
  311. package/src/metro/processor/index.ts +0 -1
  312. package/src/metro/utils/index.ts +0 -2
  313. package/src/metro/withUniwindConfig.ts +0 -61
  314. package/src/types.ts +0 -23
  315. package/src/utils/stringifyThemes.ts +0 -1
  316. package/src/vite/index.d.ts +0 -9
  317. package/src/vite/vite.ts +0 -113
  318. /package/dist/common/{css → bundler/artifacts/css}/extraUtilities.js +0 -0
  319. /package/dist/common/{css → bundler/artifacts/css}/insets.js +0 -0
  320. /package/dist/common/{css → bundler/artifacts/css}/overwrite.js +0 -0
  321. /package/dist/common/{css → bundler/artifacts/css}/variants.js +0 -0
  322. /package/dist/common/{css-visitor → bundler/css-visitor}/function-visitor.js +0 -0
  323. /package/dist/common/{css-visitor → bundler/css-visitor}/index.js +0 -0
  324. /package/dist/module/{css → bundler/artifacts/css}/extraUtilities.d.ts +0 -0
  325. /package/dist/module/{css → bundler/artifacts/css}/extraUtilities.js +0 -0
  326. /package/dist/module/{css → bundler/artifacts/css}/insets.d.ts +0 -0
  327. /package/dist/module/{css → bundler/artifacts/css}/insets.js +0 -0
  328. /package/dist/module/{css → bundler/artifacts/css}/overwrite.d.ts +0 -0
  329. /package/dist/module/{css → bundler/artifacts/css}/overwrite.js +0 -0
  330. /package/dist/module/{css → bundler/artifacts/css}/themes.d.ts +0 -0
  331. /package/dist/module/{css → bundler/artifacts/css}/variants.d.ts +0 -0
  332. /package/dist/module/{css → bundler/artifacts/css}/variants.js +0 -0
  333. /package/dist/module/{utils/buildDtsFile.d.ts → bundler/artifacts/dts.d.ts} +0 -0
  334. /package/dist/module/{css-visitor → bundler/css-visitor}/function-visitor.js +0 -0
  335. /package/dist/module/{css-visitor → bundler/css-visitor}/index.d.ts +0 -0
  336. /package/dist/module/{css-visitor → bundler/css-visitor}/index.js +0 -0
  337. /package/{dist/common → src/bundler/adapters}/vite/index.d.ts +0 -0
  338. /package/src/{vite → bundler/adapters/vite}/index.ts +0 -0
  339. /package/src/{css → bundler/artifacts/css}/insets.ts +0 -0
  340. /package/src/{css → bundler/artifacts/css}/overwrite.ts +0 -0
  341. /package/src/{css → bundler/artifacts/css}/variants.ts +0 -0
  342. /package/src/{css-visitor → bundler/css-visitor}/index.ts +0 -0
@@ -1,8 +1,6 @@
1
1
  import { Dimensions, Platform } from "react-native";
2
- import { Platform as UniwindPlatform, UNIWIND_PLATFORM_VARIABLES, UNIWIND_THEME_VARIABLES } from "../../common/consts.js";
3
- import { Orientation, StyleDependency } from "../../types.js";
2
+ import { Orientation, Platform as UniwindPlatform, StyleDependency, UNIWIND_PLATFORM_VARIABLES, UNIWIND_THEME_VARIABLES } from "../../common/consts.js";
4
3
  import { UniwindListener } from "../listener.js";
5
- import { cloneWithAccessors } from "./native-utils.js";
6
4
  import {
7
5
  parseBoxShadow,
8
6
  parseFontVariant,
@@ -46,18 +44,18 @@ class UniwindStoreBuilder {
46
44
  const commonPlatformVars = scopedVars[`${UNIWIND_PLATFORM_VARIABLES}${commonPlatform}`];
47
45
  const platformVars = scopedVars[`${UNIWIND_PLATFORM_VARIABLES}${platform}`];
48
46
  if (commonPlatformVars) {
49
- Object.defineProperties(vars, Object.getOwnPropertyDescriptors(commonPlatformVars));
47
+ Object.assign(vars, commonPlatformVars);
50
48
  }
51
49
  if (platformVars) {
52
- Object.defineProperties(vars, Object.getOwnPropertyDescriptors(platformVars));
50
+ Object.assign(vars, platformVars);
53
51
  }
54
52
  this.keyframes = keyframes;
55
53
  this.stylesheet = stylesheet;
56
54
  this.vars = Object.fromEntries(themes.map((theme) => {
57
- const clonedVars = cloneWithAccessors(vars);
55
+ const clonedVars = Object.create(vars);
58
56
  const themeVars = scopedVars[`${UNIWIND_THEME_VARIABLES}${theme}`];
59
57
  if (themeVars) {
60
- Object.defineProperties(clonedVars, Object.getOwnPropertyDescriptors(themeVars));
58
+ Object.assign(clonedVars, themeVars);
61
59
  }
62
60
  return [theme, clonedVars];
63
61
  }));
@@ -67,7 +65,7 @@ class UniwindStoreBuilder {
67
65
  }
68
66
  };
69
67
  resolveStyles(classNames, componentProps, state, uniwindContext) {
70
- const result = {};
68
+ const resultGetters = {};
71
69
  const theme = uniwindContext.scopedTheme ?? this.runtime.currentThemeName;
72
70
  let vars = this.vars[theme];
73
71
  const originalVars = vars;
@@ -103,93 +101,52 @@ class UniwindStoreBuilder {
103
101
  }
104
102
  if (property[0] === "-") {
105
103
  if (vars === originalVars) {
106
- vars = cloneWithAccessors(originalVars);
104
+ vars = Object.create(originalVars);
107
105
  }
108
- Object.defineProperty(vars, property, {
109
- configurable: true,
110
- enumerable: true,
111
- get: valueGetter
112
- });
106
+ vars[property] = valueGetter;
113
107
  } else {
114
- Object.defineProperty(result, property, {
115
- configurable: true,
116
- enumerable: true,
117
- get: () => valueGetter.call(vars)
118
- });
108
+ resultGetters[property] = valueGetter;
119
109
  }
120
110
  bestBreakpoints.set(property, style);
121
111
  }
122
112
  }
123
113
  }
114
+ const result = Object.fromEntries(
115
+ Object.entries(resultGetters).map(([property, valueGetter]) => [property, valueGetter(vars)])
116
+ );
124
117
  if (result.lineHeight !== void 0 && result.lineHeight < 6) {
125
- Object.defineProperty(result, "lineHeight", {
126
- value: result.fontSize * result.lineHeight,
127
- configurable: true,
128
- enumerable: true
129
- });
118
+ result.lineHeight *= result.fontSize;
130
119
  }
131
120
  if (result.boxShadow !== void 0) {
132
- Object.defineProperty(result, "boxShadow", {
133
- value: parseBoxShadow(result.boxShadow),
134
- configurable: true,
135
- enumerable: true
136
- });
121
+ result.boxShadow = parseBoxShadow(result.boxShadow);
137
122
  }
138
123
  if (result.visibility === "hidden") {
139
- Object.defineProperty(result, "display", {
140
- value: "none",
141
- configurable: true,
142
- enumerable: true
143
- });
124
+ result.display = "none";
144
125
  }
145
126
  if (result.borderStyle !== void 0 && result.borderColor === void 0) {
146
- Object.defineProperty(result, "borderColor", {
147
- value: "#000000",
148
- configurable: true,
149
- enumerable: true
150
- });
127
+ result.borderColor = "#000000";
151
128
  }
152
129
  if (result.outlineStyle !== void 0 && result.outlineColor === void 0) {
153
- Object.defineProperty(result, "outlineColor", {
154
- value: "#000000",
155
- configurable: true,
156
- enumerable: true
157
- });
130
+ result.outlineColor = "#000000";
158
131
  }
159
132
  if (result.fontVariant !== void 0) {
160
- Object.defineProperty(result, "fontVariant", {
161
- value: parseFontVariant(result.fontVariant),
162
- configurable: true,
163
- enumerable: true
164
- });
133
+ result.fontVariant = parseFontVariant(result.fontVariant);
165
134
  }
166
135
  parseTransformsMutation(result);
167
136
  parseTransitionsMutation(result);
168
137
  if (typeof result.animationName === "string") {
169
- Object.defineProperty(result, "animationName", {
170
- value: this.keyframes[result.animationName] ?? [],
171
- configurable: true,
172
- enumerable: true
173
- });
138
+ result.animationName = this.keyframes[result.animationName] ?? [];
174
139
  } else if (Array.isArray(result.animationName)) {
175
- Object.defineProperty(result, "animationName", {
176
- value: result.animationName.map((animationName) => this.keyframes[animationName] ?? void 0).filter(Boolean),
177
- configurable: true,
178
- enumerable: true
179
- });
140
+ result.animationName = result.animationName.map((animationName) => this.keyframes[animationName] ?? void 0).filter(Boolean);
180
141
  }
181
142
  if (result.experimental_backgroundImage !== void 0) {
182
- Object.defineProperty(result, "experimental_backgroundImage", {
183
- value: resolveGradient(result.experimental_backgroundImage),
184
- configurable: true,
185
- enumerable: true
186
- });
143
+ result.experimental_backgroundImage = resolveGradient(result.experimental_backgroundImage);
187
144
  }
188
145
  if (result.textShadow !== void 0) {
189
146
  parseTextShadowMutation(result);
190
147
  }
191
148
  return {
192
- styles: { ...result },
149
+ styles: result,
193
150
  dependencies: Array.from(dependencies),
194
151
  dependencySum,
195
152
  hasDataAttributes
@@ -1,15 +1,17 @@
1
1
  import React from 'react';
2
2
  import type { ImageStyle, StyleProp, TextStyle, ViewStyle } from 'react-native';
3
- import { CSSAnimationKeyframes } from 'react-native-reanimated';
4
- import { ControlPoint, CubicBezierEasing, LinearEasing, StepsEasing, StepsModifier } from 'react-native-reanimated/lib/typescript/css/easing';
5
- import { ColorScheme, Orientation, StyleDependency, UniwindConfig } from '../types';
3
+ import type { CSSAnimationKeyframes } from 'react-native-reanimated';
4
+ import type { ControlPoint, CubicBezierEasing, LinearEasing, StepsEasing, StepsModifier } from 'react-native-reanimated/lib/typescript/css/easing';
5
+ import type { ColorScheme, Orientation, StyleDependency } from '../common/consts';
6
6
  import type { UniwindContext } from './context';
7
+ export type Vars = Record<PropertyKey, Var>;
8
+ export type Var = (vars: Vars) => unknown;
7
9
  export type Style = {
8
- entries: Array<[string, () => unknown]>;
10
+ entries: Array<[string, Var]>;
9
11
  minWidth: number;
10
12
  maxWidth: number;
11
13
  orientation: Orientation | null;
12
- theme: ColorScheme | null;
14
+ theme: ThemeName | null;
13
15
  rtl: boolean | null;
14
16
  native: boolean;
15
17
  dependencies: Array<StyleDependency> | null;
@@ -25,10 +27,12 @@ export type Style = {
25
27
  export type StyleSheets = Record<string, Array<Style>>;
26
28
  export type GenerateStyleSheetsCallback = (rt: UniwindRuntime) => {
27
29
  stylesheet: StyleSheets;
28
- vars: Record<string, unknown>;
30
+ vars: Vars;
29
31
  keyframes: Record<string, CSSAnimationKeyframes>;
30
- scopedVars: Partial<Record<string, Record<string, unknown>>>;
32
+ scopedVars: Partial<Record<string, Vars>>;
31
33
  };
34
+ export interface UniwindConfig {
35
+ }
32
36
  type UserThemes = UniwindConfig extends {
33
37
  themes: infer T extends readonly string[];
34
38
  } ? T : readonly string[];
@@ -58,6 +62,7 @@ export type UniwindRuntime = {
58
62
  lightDark: (light: string, dark: string) => string;
59
63
  parseColor: (type: string, color: string) => string;
60
64
  platformSelect: (android: string, ios: string, other?: string) => string;
65
+ makeResponsive: (value: number, base: number, useHeight?: boolean) => number;
61
66
  };
62
67
  export type RNStyle = ViewStyle & TextStyle & ImageStyle & {
63
68
  accentColor?: string;
@@ -1,4 +1,4 @@
1
- import { StyleDependency } from "../../types.js";
1
+ import { StyleDependency } from "../../common/consts.js";
2
2
  import { UniwindListener } from "../listener.js";
3
3
  class CSSListenerBuilder {
4
4
  activeRules = /* @__PURE__ */ new Set();
@@ -1,3 +1,3 @@
1
- import { RNStyle, UniwindContextType } from '../types';
1
+ import type { RNStyle, UniwindContextType } from '../types';
2
2
  export declare const getWebStyles: (className: string | undefined, componentProps: Record<string, unknown> | undefined, uniwindContext: UniwindContextType) => RNStyle;
3
3
  export declare const getWebVariable: (name: string, uniwindContext: UniwindContextType) => string | undefined;
@@ -1,5 +1,5 @@
1
- import { ComponentProps, ComponentPropsWithRef } from 'react';
2
- import { RNStyle } from '../core/types';
1
+ import type { ComponentProps, ComponentPropsWithRef } from 'react';
2
+ import type { RNStyle } from '../core/types';
3
3
  export type AnyObject = Record<PropertyKey, any>;
4
4
  type StyleToClass<K extends PropertyKey> = K extends 'style' ? 'className' : K extends `${infer StyleProp}Style` ? `${StyleProp}ClassName` : never;
5
5
  type ColorPropToClass<K extends PropertyKey> = K extends 'color' ? 'colorClassName' : K extends `${string}Color` | `${string}color${string}` ? `${K}ClassName` : never;
@@ -1,2 +1,2 @@
1
- import { WithUniwind } from './types';
1
+ import type { WithUniwind } from './types';
2
2
  export declare const withUniwind: WithUniwind;
@@ -7,8 +7,8 @@ import { Logger } from "../core/logger.js";
7
7
  import { CSSListener, formatColor, getWebStyles } from "../core/web/index.js";
8
8
  import { classToColor, classToStyle, isClassProperty, isColorClassProperty, isStyleProperty } from "./withUniwindUtils.js";
9
9
  let warnedOnce = false;
10
- export const withUniwind = (Component2, options) => options ? withManualUniwind(Component2, options) : withAutoUniwind(Component2);
11
- const withAutoUniwind = (Component2) => (props) => {
10
+ export const withUniwind = (Component, options) => options ? withManualUniwind(Component, options) : withAutoUniwind(Component);
11
+ const withAutoUniwind = (Component) => (props) => {
12
12
  const uniwindContext = useUniwindContext();
13
13
  const { classNames, generatedProps } = Object.entries(props).reduce((acc, [propName, propValue]) => {
14
14
  if (isColorClassProperty(propName)) {
@@ -47,7 +47,7 @@ const withAutoUniwind = (Component2) => (props) => {
47
47
  return dispose;
48
48
  }, [classNames]);
49
49
  return /* @__PURE__ */ jsx(
50
- Component2,
50
+ Component,
51
51
  {
52
52
  ...props,
53
53
  ...generatedProps,
@@ -55,7 +55,7 @@ const withAutoUniwind = (Component2) => (props) => {
55
55
  }
56
56
  );
57
57
  };
58
- const withManualUniwind = (Component2, options) => (props) => {
58
+ const withManualUniwind = (Component, options) => (props) => {
59
59
  const uniwindContext = useUniwindContext();
60
60
  const { generatedProps, classNames } = Object.entries(options).reduce((acc, [propName, option]) => {
61
61
  const className = props[option.fromClassName];
@@ -81,7 +81,7 @@ const withManualUniwind = (Component2, options) => (props) => {
81
81
  return dispose;
82
82
  }, [classNames]);
83
83
  return /* @__PURE__ */ jsx(
84
- Component2,
84
+ Component,
85
85
  {
86
86
  ...props,
87
87
  ...generatedProps,
@@ -1,2 +1,2 @@
1
- import { WithUniwind } from './types';
1
+ import type { WithUniwind } from './types';
2
2
  export declare const withUniwind: WithUniwind;
@@ -7,8 +7,8 @@ import { Logger } from "../core/logger.js";
7
7
  import { UniwindStore } from "../core/native/index.js";
8
8
  import { classToColor, classToStyle, isClassProperty, isColorClassProperty, isStyleProperty } from "./withUniwindUtils.js";
9
9
  let warnedOnce = false;
10
- export const withUniwind = (Component2, options) => options ? withManualUniwind(Component2, options) : withAutoUniwind(Component2);
11
- const withAutoUniwind = (Component2) => (props) => {
10
+ export const withUniwind = (Component, options) => options ? withManualUniwind(Component, options) : withAutoUniwind(Component);
11
+ const withAutoUniwind = (Component) => (props) => {
12
12
  const uniwindContext = useUniwindContext();
13
13
  const { dependencies, generatedProps } = Object.entries(props).reduce((acc, [propName, propValue]) => {
14
14
  if (isColorClassProperty(propName)) {
@@ -52,14 +52,14 @@ const withAutoUniwind = (Component2) => (props) => {
52
52
  return dispose;
53
53
  }, [dependencySum]);
54
54
  return /* @__PURE__ */ jsx(
55
- Component2,
55
+ Component,
56
56
  {
57
57
  ...props,
58
58
  ...generatedProps
59
59
  }
60
60
  );
61
61
  };
62
- const withManualUniwind = (Component2, options) => (props) => {
62
+ const withManualUniwind = (Component, options) => (props) => {
63
63
  const uniwindContext = useUniwindContext();
64
64
  const { generatedProps, dependencies } = Object.entries(options).reduce((acc, [propName, option]) => {
65
65
  const className = props[option.fromClassName];
@@ -99,7 +99,7 @@ const withManualUniwind = (Component2, options) => (props) => {
99
99
  return dispose;
100
100
  }, [dependencySum]);
101
101
  return /* @__PURE__ */ jsx(
102
- Component2,
102
+ Component,
103
103
  {
104
104
  ...props,
105
105
  ...generatedProps
@@ -1,2 +1,2 @@
1
- import { UniwindContextType } from '../../core/types';
1
+ import type { UniwindContextType } from '../../core/types';
2
2
  export declare const getVariableValue: (name: string, uniwindContext: UniwindContextType) => unknown;
@@ -1,2 +1,5 @@
1
1
  import { UniwindRuntime, UniwindStore } from "../../core/native/index.js";
2
- export const getVariableValue = (name, uniwindContext) => UniwindStore.vars[uniwindContext.scopedTheme ?? UniwindRuntime.currentThemeName]?.[name];
2
+ export const getVariableValue = (name, uniwindContext) => {
3
+ const vars = UniwindStore.vars[uniwindContext.scopedTheme ?? UniwindRuntime.currentThemeName];
4
+ return vars?.[name]?.(vars);
5
+ };
@@ -1,4 +1,4 @@
1
- import { UniwindContextType } from '../../core/types';
1
+ import type { UniwindContextType } from '../../core/types';
2
2
  export declare const getCSSVariable: (name: string | Array<string>, uniwindContext: UniwindContextType) => string | (string | undefined)[] | undefined;
3
3
  type IsGenericNumber<T> = T & 0 extends -1 ? false : true;
4
4
  type CreateArray<N extends number, Value, TAcc extends Array<Value> = []> = TAcc['length'] extends N ? TAcc : CreateArray<N, Value, [...TAcc, Value]>;
@@ -1,12 +1,16 @@
1
1
  import { useLayoutEffect, useRef, useState } from "react";
2
+ import { Platform } from "react-native";
3
+ import { StyleDependency } from "../../common/consts.js";
2
4
  import { arrayEquals } from "../../common/utils.js";
3
5
  import { useUniwindContext } from "../../core/context.js";
4
6
  import { UniwindListener } from "../../core/listener.js";
5
7
  import { Logger } from "../../core/logger.js";
6
- import { StyleDependency } from "../../types.js";
7
8
  import { getVariableValue } from "./getVariableValue.js";
8
9
  let warned = false;
9
10
  const logDevError = (name) => {
11
+ if (Platform.OS === "web" && (typeof document === "undefined" || typeof window === "undefined")) {
12
+ return;
13
+ }
10
14
  warned = true;
11
15
  Logger.warn(
12
16
  `We couldn't find your variable ${name}. Make sure it's used at least once in your className, or define it in a static theme as described in the docs: https://docs.uniwind.dev/api/use-css-variable`
@@ -1,2 +1,2 @@
1
- import { RNStyle } from '../core/types';
1
+ import type { RNStyle } from '../core/types';
2
2
  export declare const useResolveClassNames: (className: string) => RNStyle;
@@ -1,4 +1,4 @@
1
- import { ThemeName } from '../core/types';
1
+ import type { ThemeName } from '../core/types';
2
2
  export declare const useUniwind: () => {
3
3
  theme: ThemeName;
4
4
  hasAdaptiveThemes: boolean;
@@ -1,8 +1,8 @@
1
1
  import { useLayoutEffect, useState } from "react";
2
+ import { StyleDependency } from "../common/consts.js";
2
3
  import { Uniwind } from "../core/index.js";
3
4
  import { useUniwindContext } from "../core/context.js";
4
5
  import { UniwindListener } from "../core/listener.js";
5
- import { StyleDependency } from "../types.js";
6
6
  export const useUniwind = () => {
7
7
  const uniwindContext = useUniwindContext();
8
8
  const [theme, setTheme] = useState(Uniwind.currentTheme);
@@ -1,7 +1,6 @@
1
1
  export * from './components/ScopedTheme';
2
2
  export { Uniwind } from './core';
3
- export type { ThemeName } from './core/types';
3
+ export type { ThemeName, UniwindConfig } from './core/types';
4
4
  export { withUniwind } from './hoc';
5
5
  export type { ApplyUniwind, ApplyUniwindOptions } from './hoc/types';
6
6
  export { useCSSVariable, useResolveClassNames, useUniwind } from './hooks';
7
- export type { UniwindConfig } from './types';