@niibase/uniwind 1.6.4 → 1.7.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 (319) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/common/{css → bundler/artifacts/css}/index.js +1 -4
  3. package/dist/common/{css → bundler/artifacts/css}/themes.js +1 -1
  4. package/dist/common/{utils/buildDtsFile.js → bundler/artifacts/dts.js} +1 -2
  5. package/dist/common/bundler/config.js +69 -0
  6. package/dist/common/bundler/css-compiler/compileCSS.js +18 -0
  7. package/dist/common/bundler/css-compiler/compileNativeCSS.js +19 -0
  8. package/dist/common/bundler/css-compiler/compileTailwind.js +27 -0
  9. package/dist/common/bundler/css-compiler/compileWebCSS.js +15 -0
  10. package/dist/common/{vite → bundler/css-compiler}/index.js +4 -4
  11. package/dist/common/bundler/css-processor/addMetaToStylesTemplate.js +130 -0
  12. package/dist/common/bundler/css-processor/animation.js +112 -0
  13. package/dist/common/bundler/css-processor/color.js +66 -0
  14. package/dist/common/bundler/css-processor/css.js +510 -0
  15. package/dist/common/bundler/css-processor/functions.js +145 -0
  16. package/dist/common/bundler/css-processor/index.js +38 -0
  17. package/dist/common/bundler/css-processor/mq.js +87 -0
  18. package/dist/common/bundler/css-processor/processor.js +353 -0
  19. package/dist/common/bundler/css-processor/rn.js +356 -0
  20. package/dist/common/bundler/css-processor/serialize.js +86 -0
  21. package/dist/common/bundler/css-processor/types.js +1 -0
  22. package/dist/common/bundler/css-processor/units.js +55 -0
  23. package/dist/common/bundler/css-processor/utils.js +63 -0
  24. package/dist/common/bundler/css-processor/var.js +20 -0
  25. package/dist/common/{css-visitor → bundler/css-visitor}/rule-visitor.js +5 -5
  26. package/dist/common/{css-visitor → bundler/css-visitor}/visitor.js +5 -6
  27. package/dist/common/bundler/logger.js +41 -0
  28. package/dist/common/bundler/types.js +1 -0
  29. package/dist/common/common/consts.js +26 -2
  30. package/dist/common/components/web/rnw.js +2 -2
  31. package/dist/common/core/config/config.common.js +9 -9
  32. package/dist/common/core/config/config.js +2 -2
  33. package/dist/common/core/config/config.native.js +3 -3
  34. package/dist/common/core/listener.js +10 -10
  35. package/dist/common/core/native/runtime.js +7 -3
  36. package/dist/common/core/native/store.js +3 -4
  37. package/dist/common/core/web/cssListener.js +2 -2
  38. package/dist/common/hoc/withUniwind.js +5 -5
  39. package/dist/common/hoc/withUniwind.native.js +5 -5
  40. package/dist/common/hooks/useCSSVariable/useCSSVariable.js +6 -2
  41. package/dist/common/hooks/useUniwind.js +2 -2
  42. package/dist/metro/index.cjs +14 -24
  43. package/dist/metro/index.d.ts +2 -0
  44. package/dist/metro/index.mjs +7 -17
  45. package/dist/metro/{metro-transformer.cjs → transformer.cjs} +294 -174
  46. package/dist/metro/{metro-transformer.mjs → transformer.mjs} +236 -116
  47. package/dist/module/{css → bundler/artifacts/css}/index.d.ts +1 -1
  48. package/dist/module/{css → bundler/artifacts/css}/index.js +1 -4
  49. package/dist/module/{css → bundler/artifacts/css}/themes.js +1 -1
  50. package/dist/module/{utils/buildDtsFile.js → bundler/artifacts/dts.js} +3 -4
  51. package/dist/module/bundler/config.d.ts +16 -0
  52. package/dist/module/bundler/config.js +69 -0
  53. package/dist/module/bundler/css-compiler/compileCSS.d.ts +2 -0
  54. package/dist/module/bundler/css-compiler/compileCSS.js +11 -0
  55. package/dist/module/bundler/css-compiler/compileNativeCSS.d.ts +2 -0
  56. package/dist/module/bundler/css-compiler/compileNativeCSS.js +33 -0
  57. package/dist/module/bundler/css-compiler/compileTailwind.d.ts +2 -0
  58. package/dist/module/bundler/css-compiler/compileTailwind.js +22 -0
  59. package/dist/module/bundler/css-compiler/compileWebCSS.d.ts +2 -0
  60. package/dist/module/bundler/css-compiler/compileWebCSS.js +8 -0
  61. package/dist/module/bundler/css-compiler/index.d.ts +1 -0
  62. package/dist/module/bundler/css-compiler/index.js +1 -0
  63. package/dist/module/bundler/css-processor/addMetaToStylesTemplate.d.ts +3 -0
  64. package/dist/module/bundler/css-processor/addMetaToStylesTemplate.js +136 -0
  65. package/dist/module/bundler/css-processor/animation.d.ts +6 -0
  66. package/dist/module/bundler/css-processor/animation.js +112 -0
  67. package/dist/module/bundler/css-processor/color.d.ts +12 -0
  68. package/dist/module/bundler/css-processor/color.js +63 -0
  69. package/dist/module/bundler/css-processor/css.d.ts +23 -0
  70. package/dist/module/bundler/css-processor/css.js +566 -0
  71. package/dist/module/bundler/css-processor/functions.d.ts +12 -0
  72. package/dist/module/bundler/css-processor/functions.js +190 -0
  73. package/dist/module/bundler/css-processor/index.d.ts +3 -0
  74. package/dist/module/bundler/css-processor/index.js +3 -0
  75. package/dist/module/bundler/css-processor/mq.d.ts +12 -0
  76. package/dist/module/bundler/css-processor/mq.js +78 -0
  77. package/dist/module/bundler/css-processor/processor.d.ts +36 -0
  78. package/dist/module/bundler/css-processor/processor.js +336 -0
  79. package/dist/module/bundler/css-processor/rn.d.ts +10 -0
  80. package/dist/module/bundler/css-processor/rn.js +400 -0
  81. package/dist/module/bundler/css-processor/serialize.d.ts +2 -0
  82. package/dist/module/bundler/css-processor/serialize.js +101 -0
  83. package/dist/module/bundler/css-processor/types.d.ts +28 -0
  84. package/dist/module/bundler/css-processor/types.js +0 -0
  85. package/dist/module/bundler/css-processor/units.d.ts +10 -0
  86. package/dist/module/bundler/css-processor/units.js +48 -0
  87. package/dist/module/bundler/css-processor/utils.d.ts +24 -0
  88. package/dist/{shared/uniwind.PtWWxxnh.mjs → module/bundler/css-processor/utils.js} +11 -15
  89. package/dist/module/bundler/css-processor/var.d.ts +7 -0
  90. package/dist/module/bundler/css-processor/var.js +13 -0
  91. package/dist/module/{css-visitor → bundler/css-visitor}/function-visitor.d.ts +1 -1
  92. package/dist/module/{css-visitor → bundler/css-visitor}/rule-visitor.d.ts +4 -3
  93. package/dist/module/{css-visitor → bundler/css-visitor}/rule-visitor.js +5 -5
  94. package/dist/module/{css-visitor → bundler/css-visitor}/visitor.d.ts +3 -3
  95. package/dist/module/{css-visitor → bundler/css-visitor}/visitor.js +5 -6
  96. package/dist/module/bundler/logger.d.ts +11 -0
  97. package/dist/module/bundler/logger.js +34 -0
  98. package/dist/module/bundler/types.d.ts +15 -0
  99. package/dist/module/bundler/types.js +0 -0
  100. package/dist/module/common/consts.d.ts +21 -0
  101. package/dist/module/common/consts.js +24 -0
  102. package/dist/module/components/ScopedTheme/ScopedTheme.native.d.ts +1 -1
  103. package/dist/module/components/native/Pressable.d.ts +1 -1
  104. package/dist/module/components/native/TouchableHighlight.d.ts +1 -1
  105. package/dist/module/components/native/TouchableOpacity.d.ts +1 -1
  106. package/dist/module/components/native/useAccentColor.d.ts +1 -1
  107. package/dist/module/components/native/useStyle.d.ts +2 -2
  108. package/dist/module/components/react-native-gesture-handler/native/BaseButton.d.ts +1 -1
  109. package/dist/module/components/react-native-gesture-handler/native/BorderlessButton.d.ts +1 -1
  110. package/dist/module/components/react-native-gesture-handler/native/DrawerLayoutAndroid.d.ts +1 -1
  111. package/dist/module/components/react-native-gesture-handler/native/FlatList.d.ts +1 -1
  112. package/dist/module/components/react-native-gesture-handler/native/Pressable.d.ts +1 -1
  113. package/dist/module/components/react-native-gesture-handler/native/PureNativeButton.d.ts +1 -1
  114. package/dist/module/components/react-native-gesture-handler/native/RawButton.d.ts +1 -1
  115. package/dist/module/components/react-native-gesture-handler/native/RectButton.d.ts +1 -1
  116. package/dist/module/components/react-native-gesture-handler/native/RefreshControl.d.ts +1 -1
  117. package/dist/module/components/react-native-gesture-handler/native/ScrollView.d.ts +1 -1
  118. package/dist/module/components/react-native-gesture-handler/native/Switch.d.ts +1 -1
  119. package/dist/module/components/react-native-gesture-handler/native/TextInput.d.ts +1 -1
  120. package/dist/module/components/web/Pressable.d.ts +1 -1
  121. package/dist/module/components/web/TouchableHighlight.d.ts +1 -1
  122. package/dist/module/components/web/TouchableOpacity.d.ts +1 -1
  123. package/dist/module/components/web/rnw.js +1 -1
  124. package/dist/module/core/config/config.common.d.ts +6 -7
  125. package/dist/module/core/config/config.common.js +2 -2
  126. package/dist/module/core/config/config.d.ts +1 -1
  127. package/dist/module/core/config/config.js +1 -1
  128. package/dist/module/core/config/config.native.d.ts +2 -2
  129. package/dist/module/core/config/config.native.js +1 -1
  130. package/dist/module/core/listener.d.ts +1 -1
  131. package/dist/module/core/listener.js +1 -1
  132. package/dist/module/core/native/runtime.js +5 -1
  133. package/dist/module/core/native/store.d.ts +2 -2
  134. package/dist/module/core/native/store.js +1 -2
  135. package/dist/module/core/types.d.ts +6 -3
  136. package/dist/module/core/web/cssListener.js +1 -1
  137. package/dist/module/core/web/getWebStyles.d.ts +1 -1
  138. package/dist/module/hoc/types.d.ts +2 -2
  139. package/dist/module/hoc/withUniwind.d.ts +1 -1
  140. package/dist/module/hoc/withUniwind.js +5 -5
  141. package/dist/module/hoc/withUniwind.native.d.ts +1 -1
  142. package/dist/module/hoc/withUniwind.native.js +5 -5
  143. package/dist/module/hooks/useCSSVariable/getVariableValue.native.d.ts +1 -1
  144. package/dist/module/hooks/useCSSVariable/useCSSVariable.d.ts +1 -1
  145. package/dist/module/hooks/useCSSVariable/useCSSVariable.js +5 -1
  146. package/dist/module/hooks/useResolveClassNames.d.ts +1 -1
  147. package/dist/module/hooks/useUniwind.d.ts +1 -1
  148. package/dist/module/hooks/useUniwind.js +1 -1
  149. package/dist/module/index.d.ts +1 -2
  150. package/dist/shared/{uniwind.r2i22V6d.cjs → uniwind.CFiAZ3D-.cjs} +307 -217
  151. package/dist/shared/{uniwind.BGiqYvxb.mjs → uniwind.u-s1XVU8.mjs} +299 -214
  152. package/dist/vite/index.cjs +12 -22
  153. package/dist/vite/index.mjs +9 -19
  154. package/package.json +1 -1
  155. package/src/{metro → bundler/adapters/metro}/index.d.ts +2 -0
  156. package/src/bundler/adapters/metro/index.ts +1 -0
  157. package/src/{metro/withUniwindConfig.ts → bundler/adapters/metro/metro.ts} +7 -22
  158. package/src/{metro/metro-css-patches.ts → bundler/adapters/metro/patches.ts} +2 -1
  159. package/src/{metro → bundler/adapters/metro}/resolvers.ts +8 -8
  160. package/src/bundler/adapters/metro/transformer.ts +85 -0
  161. package/src/{vite → bundler/adapters/vite}/vite.ts +10 -28
  162. package/src/{css → bundler/artifacts/css}/extraUtilities.ts +1 -1
  163. package/src/{css → bundler/artifacts/css}/index.ts +1 -5
  164. package/src/{css → bundler/artifacts/css}/themes.ts +1 -1
  165. package/src/{utils/buildDtsFile.ts → bundler/artifacts/dts.ts} +3 -4
  166. package/src/bundler/config.ts +84 -0
  167. package/src/bundler/css-compiler/compileCSS.ts +15 -0
  168. package/src/bundler/css-compiler/compileNativeCSS.ts +41 -0
  169. package/src/bundler/css-compiler/compileTailwind.ts +25 -0
  170. package/src/bundler/css-compiler/compileWebCSS.ts +10 -0
  171. package/src/bundler/css-compiler/index.ts +1 -0
  172. package/src/{metro → bundler/css-processor}/addMetaToStylesTemplate.ts +33 -14
  173. package/src/{metro/processor → bundler/css-processor}/animation.ts +4 -4
  174. package/src/{metro/processor → bundler/css-processor}/color.ts +4 -3
  175. package/src/{metro/processor → bundler/css-processor}/css.ts +17 -9
  176. package/src/{metro/processor → bundler/css-processor}/functions.ts +2 -2
  177. package/src/bundler/css-processor/index.ts +3 -0
  178. package/src/{metro/processor → bundler/css-processor}/mq.ts +4 -4
  179. package/src/{metro/processor → bundler/css-processor}/processor.ts +13 -11
  180. package/src/{metro/processor → bundler/css-processor}/rn.ts +96 -3
  181. package/src/{metro/utils → bundler/css-processor}/serialize.ts +2 -2
  182. package/src/{metro → bundler/css-processor}/types.ts +3 -17
  183. package/src/{metro/processor → bundler/css-processor}/units.ts +1 -1
  184. package/src/{metro/processor → bundler/css-processor}/var.ts +1 -1
  185. package/src/{css-visitor → bundler/css-visitor}/function-visitor.ts +1 -1
  186. package/src/{css-visitor → bundler/css-visitor}/rule-visitor.ts +6 -5
  187. package/src/{css-visitor → bundler/css-visitor}/visitor.ts +4 -3
  188. package/src/bundler/types.ts +17 -0
  189. package/src/common/consts.ts +25 -0
  190. package/src/components/ScopedTheme/ScopedTheme.native.tsx +1 -1
  191. package/src/components/native/ActivityIndicator.tsx +2 -1
  192. package/src/components/native/Button.tsx +2 -1
  193. package/src/components/native/FlatList.tsx +2 -1
  194. package/src/components/native/Image.tsx +2 -1
  195. package/src/components/native/ImageBackground.tsx +2 -1
  196. package/src/components/native/InputAccessoryView.tsx +3 -2
  197. package/src/components/native/KeyboardAvoidingView.tsx +2 -1
  198. package/src/components/native/Modal.tsx +2 -1
  199. package/src/components/native/Pressable.tsx +1 -1
  200. package/src/components/native/RefreshControl.tsx +2 -1
  201. package/src/components/native/SafeAreaView.tsx +2 -1
  202. package/src/components/native/ScrollView.tsx +2 -1
  203. package/src/components/native/SectionList.tsx +2 -1
  204. package/src/components/native/Switch.tsx +3 -2
  205. package/src/components/native/Text.tsx +3 -2
  206. package/src/components/native/TextInput.tsx +3 -2
  207. package/src/components/native/TouchableHighlight.tsx +3 -2
  208. package/src/components/native/TouchableNativeFeedback.tsx +3 -2
  209. package/src/components/native/TouchableOpacity.tsx +3 -2
  210. package/src/components/native/TouchableWithoutFeedback.tsx +3 -2
  211. package/src/components/native/View.tsx +2 -1
  212. package/src/components/native/VirtualizedList.tsx +2 -1
  213. package/src/components/native/useAccentColor.ts +1 -1
  214. package/src/components/native/useStyle.ts +2 -2
  215. package/src/components/react-native-gesture-handler/native/BaseButton.tsx +1 -1
  216. package/src/components/react-native-gesture-handler/native/BorderlessButton.tsx +1 -1
  217. package/src/components/react-native-gesture-handler/native/DrawerLayoutAndroid.tsx +1 -1
  218. package/src/components/react-native-gesture-handler/native/FlatList.tsx +1 -1
  219. package/src/components/react-native-gesture-handler/native/GestureHandlerRootView.tsx +1 -1
  220. package/src/components/react-native-gesture-handler/native/Pressable.tsx +1 -1
  221. package/src/components/react-native-gesture-handler/native/PureNativeButton.tsx +1 -1
  222. package/src/components/react-native-gesture-handler/native/RawButton.tsx +1 -1
  223. package/src/components/react-native-gesture-handler/native/RectButton.tsx +1 -1
  224. package/src/components/react-native-gesture-handler/native/RefreshControl.tsx +1 -1
  225. package/src/components/react-native-gesture-handler/native/ScrollView.tsx +1 -1
  226. package/src/components/react-native-gesture-handler/native/Switch.tsx +2 -2
  227. package/src/components/react-native-gesture-handler/native/Text.tsx +2 -2
  228. package/src/components/react-native-gesture-handler/native/TextInput.tsx +2 -2
  229. package/src/components/react-native-gesture-handler/native/TouchableNativeFeedback.tsx +2 -2
  230. package/src/components/react-native-gesture-handler/native/TouchableOpacity.tsx +2 -2
  231. package/src/components/react-native-gesture-handler/native/TouchableWithoutFeedback.tsx +2 -2
  232. package/src/components/web/ActivityIndicator.tsx +2 -1
  233. package/src/components/web/Button.tsx +2 -1
  234. package/src/components/web/FlatList.tsx +2 -1
  235. package/src/components/web/Image.tsx +2 -1
  236. package/src/components/web/ImageBackground.tsx +2 -1
  237. package/src/components/web/KeyboardAvoidingView.tsx +2 -1
  238. package/src/components/web/Modal.tsx +2 -1
  239. package/src/components/web/Pressable.tsx +2 -1
  240. package/src/components/web/RefreshControl.tsx +2 -1
  241. package/src/components/web/SafeAreaView.tsx +2 -1
  242. package/src/components/web/ScrollView.tsx +2 -1
  243. package/src/components/web/SectionList.tsx +2 -1
  244. package/src/components/web/Switch.tsx +2 -1
  245. package/src/components/web/Text.tsx +2 -1
  246. package/src/components/web/TextInput.tsx +2 -1
  247. package/src/components/web/TouchableHighlight.tsx +2 -1
  248. package/src/components/web/TouchableOpacity.tsx +2 -1
  249. package/src/components/web/TouchableWithoutFeedback.tsx +2 -1
  250. package/src/components/web/View.tsx +2 -1
  251. package/src/components/web/VirtualizedList.tsx +2 -1
  252. package/src/components/web/rnw.ts +1 -1
  253. package/src/core/config/config.common.ts +11 -9
  254. package/src/core/config/config.native.ts +3 -3
  255. package/src/core/config/config.ts +2 -2
  256. package/src/core/listener.ts +1 -1
  257. package/src/core/native/runtime.ts +7 -2
  258. package/src/core/native/store.ts +3 -4
  259. package/src/core/types.ts +6 -3
  260. package/src/core/web/cssListener.ts +1 -1
  261. package/src/core/web/getWebStyles.ts +1 -1
  262. package/src/hoc/types.ts +2 -2
  263. package/src/hoc/withUniwind.native.tsx +4 -3
  264. package/src/hoc/withUniwind.tsx +3 -2
  265. package/src/hooks/useCSSVariable/getVariableValue.native.ts +1 -1
  266. package/src/hooks/useCSSVariable/useCSSVariable.ts +8 -2
  267. package/src/hooks/useResolveClassNames.ts +1 -1
  268. package/src/hooks/useUniwind.ts +2 -2
  269. package/src/index.ts +1 -2
  270. package/dist/common/types.js +0 -28
  271. package/dist/common/utils/stringifyThemes.js +0 -8
  272. package/dist/common/vite/vite.js +0 -95
  273. package/dist/module/types.d.ts +0 -21
  274. package/dist/module/types.js +0 -22
  275. package/dist/module/utils/stringifyThemes.d.ts +0 -1
  276. package/dist/module/utils/stringifyThemes.js +0 -1
  277. package/dist/module/vite/index.d.ts +0 -9
  278. package/dist/module/vite/index.js +0 -1
  279. package/dist/module/vite/vite.d.ts +0 -8
  280. package/dist/module/vite/vite.js +0 -98
  281. package/dist/shared/uniwind.B5q8hBGv.cjs +0 -18
  282. package/dist/shared/uniwind.Cv73KtI-.cjs +0 -86
  283. package/dist/shared/uniwind.JSWK3vHl.mjs +0 -14
  284. package/src/metro/compileVirtual.ts +0 -85
  285. package/src/metro/index.ts +0 -1
  286. package/src/metro/injectThemes.ts +0 -23
  287. package/src/metro/metro-transformer.ts +0 -116
  288. package/src/metro/processor/index.ts +0 -1
  289. package/src/metro/utils/index.ts +0 -2
  290. package/src/types.ts +0 -23
  291. package/src/utils/stringifyThemes.ts +0 -1
  292. package/src/vite/index.d.ts +0 -9
  293. /package/dist/common/{css → bundler/artifacts/css}/extraUtilities.js +0 -0
  294. /package/dist/common/{css → bundler/artifacts/css}/insets.js +0 -0
  295. /package/dist/common/{css → bundler/artifacts/css}/overwrite.js +0 -0
  296. /package/dist/common/{css → bundler/artifacts/css}/variants.js +0 -0
  297. /package/dist/common/{css-visitor → bundler/css-visitor}/function-visitor.js +0 -0
  298. /package/dist/common/{css-visitor → bundler/css-visitor}/index.js +0 -0
  299. /package/dist/module/{css → bundler/artifacts/css}/extraUtilities.d.ts +0 -0
  300. /package/dist/module/{css → bundler/artifacts/css}/extraUtilities.js +0 -0
  301. /package/dist/module/{css → bundler/artifacts/css}/insets.d.ts +0 -0
  302. /package/dist/module/{css → bundler/artifacts/css}/insets.js +0 -0
  303. /package/dist/module/{css → bundler/artifacts/css}/overwrite.d.ts +0 -0
  304. /package/dist/module/{css → bundler/artifacts/css}/overwrite.js +0 -0
  305. /package/dist/module/{css → bundler/artifacts/css}/themes.d.ts +0 -0
  306. /package/dist/module/{css → bundler/artifacts/css}/variants.d.ts +0 -0
  307. /package/dist/module/{css → bundler/artifacts/css}/variants.js +0 -0
  308. /package/dist/module/{utils/buildDtsFile.d.ts → bundler/artifacts/dts.d.ts} +0 -0
  309. /package/dist/module/{css-visitor → bundler/css-visitor}/function-visitor.js +0 -0
  310. /package/dist/module/{css-visitor → bundler/css-visitor}/index.d.ts +0 -0
  311. /package/dist/module/{css-visitor → bundler/css-visitor}/index.js +0 -0
  312. /package/{dist/common → src/bundler/adapters}/vite/index.d.ts +0 -0
  313. /package/src/{vite → bundler/adapters/vite}/index.ts +0 -0
  314. /package/src/{css → bundler/artifacts/css}/insets.ts +0 -0
  315. /package/src/{css → bundler/artifacts/css}/overwrite.ts +0 -0
  316. /package/src/{css → bundler/artifacts/css}/variants.ts +0 -0
  317. /package/src/{metro/utils/common.ts → bundler/css-processor/utils.ts} +0 -0
  318. /package/src/{css-visitor → bundler/css-visitor}/index.ts +0 -0
  319. /package/src/{metro → bundler}/logger.ts +0 -0
@@ -0,0 +1,356 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RN = void 0;
7
+ var _consts = require("@/common/consts");
8
+ var _utils = require("@/common/utils");
9
+ var _utils2 = require("./utils");
10
+ const transitions = {
11
+ overlay: '"overlayColor"'
12
+ };
13
+ const cssToRNMap = {
14
+ backgroundSize: value => {
15
+ return {
16
+ resizeMode: value
17
+ };
18
+ },
19
+ transitionProperty: value => {
20
+ const properties = value.replace(/"/g, "").split(",").filter(token => token !== "" && !token.startsWith("--")).map(token => transitions[token.trim()] ?? `"${(0, _utils2.toCamelCase)(token.trim())}"`);
21
+ if (properties.length === 1 && ['"allowDiscrete"', '"normal"'].includes(properties[0])) {
22
+ const behavior = properties[0] === '"allowDiscrete"' ? "allow-discrete" : "normal";
23
+ return {
24
+ transitionBehavior: `"${behavior}"`
25
+ };
26
+ }
27
+ return {
28
+ transitionProperty: properties
29
+ };
30
+ },
31
+ transitionDuration: value => {
32
+ return {
33
+ transitionDuration: value.includes('""') ? value.replace(/""/g, ",") : value
34
+ };
35
+ },
36
+ transitionTimingFunction: value => {
37
+ return {
38
+ transitionTimingFunction: value.includes('""') ? value.replace(/""/g, ",") : value
39
+ };
40
+ },
41
+ animation: value => {
42
+ if (Array.isArray(value)) {
43
+ const result = {};
44
+ for (const [key, val] of value) {
45
+ if (val === '"none"') {
46
+ continue;
47
+ }
48
+ const keyName = (0, _utils2.toCamelCase)(`animation-${key.replace(/^"|"$/g, "")}`);
49
+ if (key === "name") {
50
+ result[keyName] = typeof val === "string" ? val.split(",").map(v => v.startsWith('"') ? v : `"${v}"`) : val;
51
+ } else {
52
+ result[keyName] = val;
53
+ }
54
+ }
55
+ return result;
56
+ }
57
+ return {
58
+ animationName: value
59
+ };
60
+ },
61
+ flex: value => {
62
+ if (typeof value === "object") {
63
+ return value;
64
+ }
65
+ return {
66
+ flex: value
67
+ };
68
+ },
69
+ overflow: value => {
70
+ if (typeof value === "object") {
71
+ return value;
72
+ }
73
+ return {
74
+ overflow: value
75
+ };
76
+ },
77
+ backdropFilter: () => ({}),
78
+ filter: value => ({
79
+ filter: value
80
+ }),
81
+ backgroundImage: value => ({
82
+ experimental_backgroundImage: value
83
+ }),
84
+ borderSpacing: () => ({}),
85
+ translate: value => {
86
+ if (typeof value === "object" && "x" in value && "y" in value) {
87
+ return {
88
+ translateX: value.x,
89
+ translateY: value.y
90
+ };
91
+ }
92
+ if (typeof value === "string") {
93
+ const [x, y] = value.split(" ");
94
+ return {
95
+ translateX: x,
96
+ translateY: y ?? x
97
+ };
98
+ }
99
+ return {};
100
+ },
101
+ rotate: value => {
102
+ if (typeof value === "object") {
103
+ return value;
104
+ }
105
+ return {
106
+ rotate: value
107
+ };
108
+ },
109
+ scale: value => {
110
+ if (typeof value === "object") {
111
+ return {
112
+ scaleX: value.x,
113
+ scaleY: value.y,
114
+ scaleZ: value.z
115
+ };
116
+ }
117
+ if (typeof value === "string") {
118
+ const [x, y, z] = value.split(" ");
119
+ return {
120
+ scaleX: x,
121
+ scaleY: y,
122
+ scaleZ: z
123
+ };
124
+ }
125
+ return {};
126
+ },
127
+ transform: value => {
128
+ if (typeof value === "string" || Array.isArray(value)) {
129
+ return {
130
+ transform: value
131
+ };
132
+ }
133
+ if (typeof value === "object") {
134
+ return Object.keys(value).length === 0 ? {
135
+ transform: []
136
+ } : value;
137
+ }
138
+ return {};
139
+ },
140
+ fontSize: value => {
141
+ return {
142
+ fontSize: value,
143
+ "--uniwind-em": value
144
+ };
145
+ },
146
+ borderInlineWidth: value => {
147
+ const borderWidth = typeof value === "object" ? Object.values(value)[0] : value;
148
+ return {
149
+ borderLeftWidth: borderWidth,
150
+ borderRightWidth: borderWidth
151
+ };
152
+ },
153
+ borderBlockWidth: value => {
154
+ const borderWidth = typeof value === "object" ? Object.values(value)[0] : value;
155
+ return {
156
+ borderTopWidth: borderWidth,
157
+ borderBottomWidth: borderWidth
158
+ };
159
+ },
160
+ borderInlineStyle: value => {
161
+ return {
162
+ borderStyle: value
163
+ };
164
+ },
165
+ borderBlockStyle: value => {
166
+ return {
167
+ borderStyle: value
168
+ };
169
+ },
170
+ borderStyle: value => {
171
+ const borderStyle = typeof value === "object" ? Object.values(value)[0] : value;
172
+ return {
173
+ borderStyle
174
+ };
175
+ },
176
+ transformOrigin: value => {
177
+ if (typeof value === "object") {
178
+ return {
179
+ transformOrigin: `${value.x} ${value.y}`
180
+ };
181
+ }
182
+ return {
183
+ transformOrigin: value
184
+ };
185
+ },
186
+ fontVariantNumeric: value => ({
187
+ fontVariant: value
188
+ }),
189
+ display: value => {
190
+ if (value === '"box"') {
191
+ return {
192
+ display: '"flex"'
193
+ };
194
+ }
195
+ return {
196
+ display: value
197
+ };
198
+ }
199
+ };
200
+ const BORDER_WIDTH_KEYS = ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"];
201
+ const BORDER_COLOR_KEYS = ["borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor"];
202
+ const BORDER_RADIUS_KEYS = ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomLeftRadius", "borderBottomRightRadius"];
203
+ const COMPONENT_RESPONSIVE_PROPS = /* @__PURE__ */new Set(["width", "height", "minWidth", "maxWidth", "minHeight", "maxHeight", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingHorizontal", "paddingVertical", "paddingStart", "paddingEnd", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginHorizontal", "marginVertical", "marginStart", "marginEnd", "top", "right", "bottom", "left", "gap", "rowGap", "columnGap", "borderWidth", "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth", "borderStartWidth", "borderEndWidth", "borderRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderBottomLeftRadius", "borderBottomRightRadius", "borderTopStartRadius", "borderTopEndRadius", "borderBottomStartRadius", "borderBottomEndRadius", "flexBasis", "translateX", "translateY"]);
204
+ class RN {
205
+ constructor(Processor) {
206
+ this.Processor = Processor;
207
+ }
208
+ cssToRN(property, value) {
209
+ const transformedProperty = property.startsWith("--") ? property : (0, _utils2.pipe)(property)(_utils2.toCamelCase, x => {
210
+ if (x.includes("padding") || x.includes("margin")) {
211
+ return x.replace("InlineStart", "Start").replace("InlineEnd", "End").replace("Inline", "Horizontal").replace("Block", "Vertical");
212
+ }
213
+ if (x.includes("border")) {
214
+ return x.replace("InlineStart", "Start").replace("InlineEnd", "End");
215
+ }
216
+ return x;
217
+ });
218
+ const rn = this.transformProperty(transformedProperty, typeof value === "string" ? (0, _utils2.addMissingSpaces)(value) : value);
219
+ const joinedStyles = this.joinStyles(rn);
220
+ return Object.entries(joinedStyles).filter(([, value2]) => (0, _utils.isDefined)(value2)).map(([prop, val]) => [prop, this.makeResponsive(prop, val)]);
221
+ }
222
+ makeResponsive(property, value) {
223
+ const mode = this.Processor.bundlerConfig.polyfills?.responsive;
224
+ if (!mode) {
225
+ return value;
226
+ }
227
+ if (typeof value === "string") {
228
+ const rawValue = value.startsWith('"') && value.endsWith('"') ? value.slice(1, -1) : value;
229
+ if (rawValue.endsWith("%")) {
230
+ const numValue = parseFloat(rawValue);
231
+ if (!isNaN(numValue)) {
232
+ return `rt.makeResponsive(${numValue}, 100, true)`;
233
+ }
234
+ }
235
+ }
236
+ if (typeof value !== "number") {
237
+ return value;
238
+ }
239
+ const isTextMode = mode === true || mode === "text";
240
+ const isComponentMode = mode === true || mode === "components";
241
+ if (isTextMode && (property === "fontSize" || property === "--uniwind-em")) {
242
+ return `rt.makeResponsive(${value}, ${_consts.DEFAULT_SCREEN_HEIGHT}, true)`;
243
+ }
244
+ if (isComponentMode && COMPONENT_RESPONSIVE_PROPS.has(property)) {
245
+ return `rt.makeResponsive(${value}, ${_consts.DEFAULT_SCREEN_WIDTH})`;
246
+ }
247
+ return value;
248
+ }
249
+ transformProperty(property, value) {
250
+ if (property in cssToRNMap) {
251
+ return cssToRNMap[property](value);
252
+ }
253
+ if (typeof value === "object") {
254
+ const transformed = this.transformObjectProperty(property, value);
255
+ if (transformed) {
256
+ return transformed;
257
+ }
258
+ }
259
+ return {
260
+ [property]: value
261
+ };
262
+ }
263
+ transformObjectProperty(property, value) {
264
+ const properties = Object.keys(value);
265
+ const propertyEnd = property.includes("border") ? property.split("border").at(-1) ?? "" : "";
266
+ const transformedProperty = property.replace(propertyEnd, "");
267
+ const isSpacing = property.includes("margin") || property.includes("padding");
268
+ const wrapProperty = prop => `${transformedProperty}${prop}${propertyEnd}`;
269
+ if (properties.every(property2 => ["row", "column"].includes(property2))) {
270
+ return {
271
+ rowGap: value.row,
272
+ columnGap: value.column
273
+ };
274
+ }
275
+ if (properties.every(property2 => ["start", "end"].includes(property2))) {
276
+ if (isSpacing && property.includes("Horizontal")) {
277
+ return {
278
+ [`${property.replace("Horizontal", "Left")}`]: value.start,
279
+ [`${property.replace("Horizontal", "Right")}`]: value.end
280
+ };
281
+ }
282
+ if (isSpacing && property.includes("Vertical")) {
283
+ return {
284
+ [`${property.replace("Vertical", "Top")}`]: value.start,
285
+ [`${property.replace("Vertical", "Bottom")}`]: value.end
286
+ };
287
+ }
288
+ return {
289
+ [wrapProperty("Start")]: value.start,
290
+ [wrapProperty("End")]: value.end
291
+ };
292
+ }
293
+ if (properties.every(property2 => ["top", "right", "bottom", "left"].includes(property2))) {
294
+ if (transformedProperty === "inset") {
295
+ const isEverySideSame = properties.every(property2 => value[property2] === value.top);
296
+ return isEverySideSame ? {
297
+ inset: value.top
298
+ } : value;
299
+ }
300
+ return {
301
+ [wrapProperty("Top")]: value.top,
302
+ [wrapProperty("Right")]: value.right,
303
+ [wrapProperty("Bottom")]: value.bottom,
304
+ [wrapProperty("Left")]: value.left
305
+ };
306
+ }
307
+ if (properties.every(property2 => ["topLeft", "topRight", "bottomRight", "bottomLeft"].includes(property2))) {
308
+ return {
309
+ [wrapProperty("TopLeft")]: value.topLeft,
310
+ [wrapProperty("TopRight")]: value.topRight,
311
+ [wrapProperty("BottomRight")]: value.bottomRight,
312
+ [wrapProperty("BottomLeft")]: value.bottomLeft
313
+ };
314
+ }
315
+ if (properties.every(property2 => ["style", "width", "color"].includes(property2))) {
316
+ return {
317
+ [wrapProperty("Style")]: value.style,
318
+ [wrapProperty("Width")]: value.width,
319
+ [wrapProperty("Color")]: value.color
320
+ };
321
+ }
322
+ }
323
+ // Used when they're multiple styles with the same value that could be joined
324
+ joinStyles(styles) {
325
+ const keys = Object.keys(styles);
326
+ if (BORDER_WIDTH_KEYS.every(key => keys.includes(key))) {
327
+ const borderWidth = styles.borderTopWidth;
328
+ if (BORDER_WIDTH_KEYS.every(key => styles[key] === borderWidth)) {
329
+ return {
330
+ ...(0, _utils2.removeKeys)(styles, BORDER_WIDTH_KEYS),
331
+ borderWidth
332
+ };
333
+ }
334
+ }
335
+ if (BORDER_COLOR_KEYS.every(key => keys.includes(key))) {
336
+ const borderColor = styles.borderTopColor;
337
+ if (BORDER_COLOR_KEYS.every(key => styles[key] === borderColor)) {
338
+ return {
339
+ ...(0, _utils2.removeKeys)(styles, BORDER_COLOR_KEYS),
340
+ borderColor
341
+ };
342
+ }
343
+ }
344
+ if (BORDER_RADIUS_KEYS.every(key => keys.includes(key))) {
345
+ const borderRadius = styles.borderTopLeftRadius;
346
+ if (BORDER_RADIUS_KEYS.every(key => styles[key] === borderRadius)) {
347
+ return {
348
+ ...(0, _utils2.removeKeys)(styles, BORDER_RADIUS_KEYS),
349
+ borderRadius
350
+ };
351
+ }
352
+ }
353
+ return styles;
354
+ }
355
+ }
356
+ exports.RN = RN;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.serializeJSObject = exports.serialize = void 0;
7
+ var _logger = require("@/bundler/logger");
8
+ var _utils = require("./utils");
9
+ const parseStringValue = value => {
10
+ if ((0, _utils.isValidJSValue)(value)) {
11
+ return value;
12
+ }
13
+ if (value.startsWith("function")) {
14
+ return value;
15
+ }
16
+ const tokens = (0, _utils.smartSplit)((0, _utils.addMissingSpaces)(value));
17
+ const parsedTokens = tokens.map(token => {
18
+ if (token.startsWith('"')) {
19
+ return token.replace(/"/g, "");
20
+ }
21
+ if (/^[a-z]+$/i.test(token.replace(/,/g, ""))) {
22
+ return token;
23
+ }
24
+ if ((0, _utils.isNumber)(token)) {
25
+ return token;
26
+ }
27
+ const endsWithComma = token.endsWith(",");
28
+ const expr = endsWithComma ? token.slice(0, -1) : token;
29
+ if (!(0, _utils.isValidJSValue)(expr)) {
30
+ return token;
31
+ }
32
+ return ["${", expr, "}", endsWithComma ? "," : ""].join("");
33
+ });
34
+ return ["`", parsedTokens.join(" "), "`"].join("");
35
+ };
36
+ const serialize = value => {
37
+ const typeOfValue = typeof value;
38
+ switch (typeOfValue) {
39
+ case "string":
40
+ return parseStringValue(value);
41
+ case "symbol":
42
+ return String(value);
43
+ case "number":
44
+ case "bigint":
45
+ return String((0, _utils.roundToPrecision)(value, 2));
46
+ case "boolean":
47
+ return value.toString();
48
+ case "object":
49
+ if (value === null) {
50
+ return "null";
51
+ }
52
+ if (Array.isArray(value)) {
53
+ return ["[", value.map(serialize).join(", "), "]"].join("");
54
+ }
55
+ return ["{", Object.entries(value).map(([key, val]) => {
56
+ const serializedKey = (0, _utils.isNumber)(key) ? key : `"${key}"`;
57
+ return `${serializedKey}: ${serialize(val)}`;
58
+ }).join(", "), "}"].join("");
59
+ case "undefined":
60
+ return "undefined";
61
+ case "function":
62
+ return "";
63
+ default:
64
+ typeOfValue;
65
+ return "";
66
+ }
67
+ };
68
+ exports.serialize = serialize;
69
+ const serializeJSObject = (obj, serializer) => {
70
+ const serializedObject = (0, _utils.pipe)(obj)(Object.entries, entries => entries.map(([key, value]) => serializer(key, serialize(value))), serializedValues => serializedValues.filter(serializedValue => {
71
+ try {
72
+ new Function(`function validateJS() { const obj = ({ ${serializedValue} }) }`);
73
+ return true;
74
+ } catch {
75
+ _logger.Logger.error(`Failed to serialize ${serializedValue} as a valid JS object entry. Skipping.`);
76
+ return false;
77
+ }
78
+ }), entries => entries.join(","), result => {
79
+ if (result === "") {
80
+ return "";
81
+ }
82
+ return `${result},`;
83
+ });
84
+ return serializedObject;
85
+ };
86
+ exports.serializeJSObject = serializeJSObject;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Units = void 0;
7
+ var _logger = require("../logger");
8
+ class Units {
9
+ constructor(Processor) {
10
+ this.Processor = Processor;
11
+ }
12
+ logger = new _logger.Logger("Units");
13
+ processLength(length) {
14
+ if (typeof length === "number") {
15
+ return length;
16
+ }
17
+ if ("unit" in length) {
18
+ switch (length.unit) {
19
+ case "px":
20
+ return this.replaceInfinity(length.value);
21
+ case "vw":
22
+ return `rt.screen.width * ${length.value / 100}`;
23
+ case "vh":
24
+ return `rt.screen.height * ${length.value / 100}`;
25
+ case "rem":
26
+ return length.value * this.Processor.vars["--uniwind-em"];
27
+ case "em":
28
+ return `this[\`--uniwind-em\`] * ${length.value}`;
29
+ default:
30
+ this.logger.warn(`Unsupported unit - ${length.unit}`);
31
+ return length.value;
32
+ }
33
+ }
34
+ return this.Processor.CSS.processValue(length);
35
+ }
36
+ processAnyLength(length) {
37
+ if ("type" in length) {
38
+ switch (length.type) {
39
+ case "value":
40
+ case "dimension":
41
+ return this.processLength(length.value);
42
+ case "percentage":
43
+ return `${length.value * 100}%`;
44
+ default:
45
+ this.logger.warn(`Unsupported length type - ${length.type}`);
46
+ return length.value;
47
+ }
48
+ }
49
+ return this.processLength(length);
50
+ }
51
+ replaceInfinity(value) {
52
+ return value === Infinity ? 99999 : value;
53
+ }
54
+ }
55
+ exports.Units = Units;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.uniq = exports.toCamelCase = exports.smartSplit = exports.shouldBeSerialized = exports.roundToPrecision = exports.removeKeys = exports.pipe = exports.isValidJSValue = exports.isNumber = exports.deepEqual = exports.addMissingSpaces = void 0;
7
+ const toCamelCase = str => str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
8
+ exports.toCamelCase = toCamelCase;
9
+ const pipe = data => (...fns) => fns.reduce((acc, fn) => fn(acc), data);
10
+ exports.pipe = pipe;
11
+ const isNumber = data => {
12
+ if (typeof data === "number") {
13
+ return true;
14
+ }
15
+ if (typeof data === "string" && data !== "") {
16
+ return !isNaN(Number(data));
17
+ }
18
+ return false;
19
+ };
20
+ exports.isNumber = isNumber;
21
+ const smartSplit = (str, separator = " ") => {
22
+ const escaper = "&&&";
23
+ return pipe(str)(x => x.replace(/\s\?\?\s/g, `${escaper}??${escaper}`), x => x.replace(/\s([+\-*/])\s/g, `${escaper}$1${escaper}`), x => x.split(separator), x => x.map(token => token.replace(new RegExp(escaper, "g"), " ")));
24
+ };
25
+ exports.smartSplit = smartSplit;
26
+ const addMissingSpaces = str => pipe(str)(x => x.trim(), x => x.replace(/([^ {])this/g, "$1 this"), x => x.replace(/\](?=\d)/g, "] "), x => x.replace(/\](?=")/g, "] "), x => x.replace(/\)(?=\S)/g, ") "), x => x.replace(/(?<!^)(?<!\s)"(?=\d)/g, '" '));
27
+ exports.addMissingSpaces = addMissingSpaces;
28
+ const uniq = arr => Array.from(new Set(arr));
29
+ exports.uniq = uniq;
30
+ const isValidJSValue = jsValueString => {
31
+ try {
32
+ new Function(`const test = ${jsValueString}`);
33
+ return true;
34
+ } catch {
35
+ return false;
36
+ }
37
+ };
38
+ exports.isValidJSValue = isValidJSValue;
39
+ const shouldBeSerialized = value => {
40
+ if (value.includes("-")) {
41
+ return value.split("-").some(shouldBeSerialized);
42
+ }
43
+ return [isNumber(value), value.startsWith("this["), value.startsWith("rt."), /[*/+-]/.test(value), value.includes('"'), value.includes(" "), value === "(", value === ")"].some(Boolean);
44
+ };
45
+ exports.shouldBeSerialized = shouldBeSerialized;
46
+ const roundToPrecision = (value, precision) => parseFloat(value.toFixed(precision));
47
+ exports.roundToPrecision = roundToPrecision;
48
+ const deepEqual = (a, b) => {
49
+ if (Object.is(a, b)) {
50
+ return true;
51
+ }
52
+ if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) {
53
+ return false;
54
+ }
55
+ const keysA = Object.keys(a);
56
+ if (keysA.length !== Object.keys(b).length) {
57
+ return false;
58
+ }
59
+ return keysA.every(key => deepEqual(a[key], b[key]) && Object.prototype.hasOwnProperty.call(b, key));
60
+ };
61
+ exports.deepEqual = deepEqual;
62
+ const removeKeys = (obj, keysToRemove) => Object.fromEntries(Object.entries(obj).filter(([key]) => !keysToRemove.includes(key)));
63
+ exports.removeKeys = removeKeys;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Var = void 0;
7
+ class Var {
8
+ constructor(Processor) {
9
+ this.Processor = Processor;
10
+ }
11
+ processVar(variable) {
12
+ const value = `this[\`${variable.name.ident}\`]`;
13
+ if (!variable.fallback || variable.fallback.length === 0) {
14
+ return value;
15
+ }
16
+ const fallback = this.Processor.CSS.processValue(variable.fallback);
17
+ return `${value} ?? ${fallback}`;
18
+ }
19
+ }
20
+ exports.Var = Var;
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.RuleVisitor = void 0;
7
7
  class RuleVisitor {
8
- constructor(themes) {
9
- this.themes = themes;
8
+ constructor(bundlerConfig) {
9
+ this.bundlerConfig = bundlerConfig;
10
10
  }
11
11
  processedClassNames = /* @__PURE__ */new Set();
12
12
  processedVariables = /* @__PURE__ */new Set();
@@ -63,7 +63,7 @@ class RuleVisitor {
63
63
  if (whereSelector?.type !== "class") {
64
64
  return styleRule;
65
65
  }
66
- const selectedVariant = this.themes.find(theme => whereSelector.name === theme);
66
+ const selectedVariant = this.bundlerConfig.themes.find(theme => whereSelector.name === theme);
67
67
  if (selectedVariant === void 0 || this.processedVariables.has(selectedVariant)) {
68
68
  return styleRule;
69
69
  }
@@ -82,7 +82,7 @@ class RuleVisitor {
82
82
  };
83
83
  }
84
84
  processClassStyle(styleRule, firstSelector) {
85
- const selectedVariant = this.themes.find(theme => firstSelector.name.includes(`${theme}:`));
85
+ const selectedVariant = this.bundlerConfig.themes.find(theme => firstSelector.name.includes(`${theme}:`));
86
86
  if (selectedVariant === void 0 || this.processedClassNames.has(firstSelector.name)) {
87
87
  return;
88
88
  }
@@ -96,7 +96,7 @@ class RuleVisitor {
96
96
  type: "class",
97
97
  name: selectedVariant
98
98
  }]],
99
- scopeEnd: this.themes.filter(theme => theme !== selectedVariant).map(theme => [{
99
+ scopeEnd: this.bundlerConfig.themes.filter(theme => theme !== selectedVariant).map(theme => [{
100
100
  type: "class",
101
101
  name: theme
102
102
  }])
@@ -7,17 +7,16 @@ exports.UniwindCSSVisitor = void 0;
7
7
  var _functionVisitor = require("./function-visitor");
8
8
  var _ruleVisitor = require("./rule-visitor");
9
9
  class UniwindCSSVisitor {
10
- constructor(themes) {
11
- this.themes = themes;
12
- const ruleVisitor = new _ruleVisitor.RuleVisitor(this.themes);
10
+ Function;
11
+ Rule;
12
+ StyleSheet;
13
+ constructor(bundlerConfig) {
14
+ const ruleVisitor = new _ruleVisitor.RuleVisitor(bundlerConfig);
13
15
  this.Function = new _functionVisitor.FunctionVisitor();
14
16
  this.Rule = ruleVisitor;
15
17
  this.StyleSheet = () => {
16
18
  ruleVisitor.cleanup();
17
19
  };
18
20
  }
19
- Function;
20
- Rule;
21
- StyleSheet;
22
21
  }
23
22
  exports.UniwindCSSVisitor = UniwindCSSVisitor;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Logger = void 0;
7
+ const red = "\x1B[91m";
8
+ const yellow = "\x1B[33m";
9
+ const blue = "\x1B[36m";
10
+ const reset = "\x1B[0m";
11
+ class Logger {
12
+ constructor(name) {
13
+ this.name = name;
14
+ }
15
+ static debug = false;
16
+ static log(message, meta = "") {
17
+ if (!Logger.debug) {
18
+ return;
19
+ }
20
+ console.log(`${blue}Uniwind ${meta}- ${message}${reset}`);
21
+ }
22
+ static error(message, meta = "") {
23
+ console.log(`${red}Uniwind Error ${meta}- ${message}${reset}`);
24
+ }
25
+ static warn(message, meta = "") {
26
+ if (!Logger.debug) {
27
+ return;
28
+ }
29
+ console.log(`${yellow}Uniwind Warning ${meta}- ${message}${reset}`);
30
+ }
31
+ log(message) {
32
+ Logger.log(message, `[${this.name} Processor] `);
33
+ }
34
+ error(message) {
35
+ Logger.error(message, `[${this.name} Processor] `);
36
+ }
37
+ warn(message) {
38
+ Logger.warn(message, `[${this.name} Processor] `);
39
+ }
40
+ }
41
+ exports.Logger = Logger;
@@ -0,0 +1 @@
1
+ "use strict";