react-native-unistyles 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (396) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +38 -30
  3. package/lib/commonjs/UnistylesTheme.js +21 -0
  4. package/lib/commonjs/UnistylesTheme.js.map +1 -0
  5. package/lib/commonjs/createUnistyles.js +57 -0
  6. package/lib/commonjs/createUnistyles.js.map +1 -0
  7. package/lib/commonjs/hooks/index.js +3 -24
  8. package/lib/commonjs/hooks/index.js.map +1 -1
  9. package/lib/commonjs/hooks/useDimensions.js +10 -0
  10. package/lib/commonjs/hooks/useDimensions.js.map +1 -0
  11. package/lib/commonjs/hooks/useDimensions.web.js +34 -0
  12. package/lib/commonjs/hooks/useDimensions.web.js.map +1 -0
  13. package/lib/commonjs/index.js +6 -63
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/commonjs/types/index.js +0 -11
  16. package/lib/commonjs/types/index.js.map +1 -1
  17. package/lib/commonjs/types/mediaQueries.js +2 -0
  18. package/lib/commonjs/types/{unistyles.js.map → mediaQueries.js.map} +1 -1
  19. package/lib/commonjs/utils/breakpoints.js +122 -20
  20. package/lib/commonjs/utils/breakpoints.js.map +1 -1
  21. package/lib/commonjs/utils/common.js +20 -0
  22. package/lib/commonjs/utils/common.js.map +1 -0
  23. package/lib/commonjs/utils/index.js +54 -22
  24. package/lib/commonjs/utils/index.js.map +1 -1
  25. package/lib/commonjs/utils/mediaQueries.js +189 -0
  26. package/lib/commonjs/utils/mediaQueries.js.map +1 -0
  27. package/lib/{module/types/common.js.map → commonjs/utils/module.d.js.map} +1 -1
  28. package/lib/commonjs/utils/normalizeStyles.js +10 -0
  29. package/lib/commonjs/utils/normalizeStyles.js.map +1 -0
  30. package/lib/commonjs/{normalizer/normalizeStyle.js → utils/normalizeStyles.web.js} +5 -5
  31. package/lib/commonjs/utils/normalizeStyles.web.js.map +1 -0
  32. package/lib/commonjs/{normalizer → utils}/normalizer.js +3 -2
  33. package/lib/commonjs/utils/normalizer.js.map +1 -0
  34. package/lib/commonjs/utils/styles.js +72 -45
  35. package/lib/commonjs/utils/styles.js.map +1 -1
  36. package/lib/module/UnistylesTheme.js +12 -0
  37. package/lib/module/UnistylesTheme.js.map +1 -0
  38. package/lib/module/createUnistyles.js +50 -0
  39. package/lib/module/createUnistyles.js.map +1 -0
  40. package/lib/module/hooks/index.js +1 -4
  41. package/lib/module/hooks/index.js.map +1 -1
  42. package/lib/module/hooks/useDimensions.js +3 -0
  43. package/lib/module/hooks/useDimensions.js.map +1 -0
  44. package/lib/module/hooks/useDimensions.web.js +27 -0
  45. package/lib/module/hooks/useDimensions.web.js.map +1 -0
  46. package/lib/module/index.js +2 -30
  47. package/lib/module/index.js.map +1 -1
  48. package/lib/module/types/index.js +0 -1
  49. package/lib/module/types/index.js.map +1 -1
  50. package/lib/module/types/mediaQueries.js +2 -0
  51. package/lib/{commonjs/types/stylesheet.js.map → module/types/mediaQueries.js.map} +1 -1
  52. package/lib/module/utils/breakpoints.js +120 -19
  53. package/lib/module/utils/breakpoints.js.map +1 -1
  54. package/lib/module/utils/common.js +12 -0
  55. package/lib/module/utils/common.js.map +1 -0
  56. package/lib/module/utils/index.js +6 -6
  57. package/lib/module/utils/index.js.map +1 -1
  58. package/lib/module/utils/mediaQueries.js +176 -0
  59. package/lib/module/utils/mediaQueries.js.map +1 -0
  60. package/lib/{commonjs/types/variants.js.map → module/utils/module.d.js.map} +1 -1
  61. package/lib/module/utils/normalizeStyles.js +3 -0
  62. package/lib/module/utils/normalizeStyles.js.map +1 -0
  63. package/lib/module/{normalizer/normalizeStyle.js → utils/normalizeStyles.web.js} +3 -3
  64. package/lib/module/utils/normalizeStyles.web.js.map +1 -0
  65. package/lib/module/{normalizer → utils}/normalizer.js +3 -2
  66. package/lib/module/utils/normalizer.js.map +1 -0
  67. package/lib/module/utils/styles.js +72 -44
  68. package/lib/module/utils/styles.js.map +1 -1
  69. package/lib/typescript/examples/expo/src/App.d.ts +3 -0
  70. package/lib/typescript/examples/expo/src/App.d.ts.map +1 -0
  71. package/lib/typescript/examples/expo/src/examples/Breakpoints.d.ts +3 -0
  72. package/lib/typescript/examples/expo/src/examples/Breakpoints.d.ts.map +1 -0
  73. package/lib/typescript/examples/expo/src/examples/EmptyStyles.d.ts +3 -0
  74. package/lib/typescript/examples/expo/src/examples/EmptyStyles.d.ts.map +1 -0
  75. package/lib/typescript/examples/expo/src/examples/Extreme.d.ts +7 -0
  76. package/lib/typescript/examples/expo/src/examples/Extreme.d.ts.map +1 -0
  77. package/lib/typescript/examples/expo/src/examples/MediaQueries.d.ts +3 -0
  78. package/lib/typescript/examples/expo/src/examples/MediaQueries.d.ts.map +1 -0
  79. package/lib/typescript/examples/expo/src/examples/Memoization.d.ts +3 -0
  80. package/lib/typescript/examples/expo/src/examples/Memoization.d.ts.map +1 -0
  81. package/lib/typescript/examples/expo/src/examples/Minimal.d.ts +3 -0
  82. package/lib/typescript/examples/expo/src/examples/Minimal.d.ts.map +1 -0
  83. package/lib/typescript/examples/expo/src/examples/MinimalWithCreateStyleSheet.d.ts +3 -0
  84. package/lib/typescript/examples/expo/src/examples/MinimalWithCreateStyleSheet.d.ts.map +1 -0
  85. package/lib/typescript/examples/expo/src/examples/PlatformColors.d.ts +3 -0
  86. package/lib/typescript/examples/expo/src/examples/PlatformColors.d.ts.map +1 -0
  87. package/lib/typescript/examples/expo/src/examples/Theme.d.ts +3 -0
  88. package/lib/typescript/examples/expo/src/examples/Theme.d.ts.map +1 -0
  89. package/lib/typescript/examples/expo/src/examples/index.d.ts +9 -0
  90. package/lib/typescript/examples/expo/src/examples/index.d.ts.map +1 -0
  91. package/lib/typescript/examples/expo/src/index.d.ts +2 -0
  92. package/lib/typescript/examples/expo/src/index.d.ts.map +1 -0
  93. package/lib/typescript/examples/expo/src/styles/breakpoints.d.ts +8 -0
  94. package/lib/typescript/examples/expo/src/styles/breakpoints.d.ts.map +1 -0
  95. package/lib/typescript/examples/expo/src/styles/index.d.ts +46 -0
  96. package/lib/typescript/examples/expo/src/styles/index.d.ts.map +1 -0
  97. package/lib/typescript/examples/expo/src/styles/theme.d.ts +24 -0
  98. package/lib/typescript/examples/expo/src/styles/theme.d.ts.map +1 -0
  99. package/lib/typescript/src/UnistylesTheme.d.ts +9 -0
  100. package/lib/typescript/src/UnistylesTheme.d.ts.map +1 -0
  101. package/lib/typescript/src/createUnistyles.d.ts +10 -0
  102. package/lib/typescript/src/createUnistyles.d.ts.map +1 -0
  103. package/lib/typescript/src/hooks/index.d.ts +1 -4
  104. package/lib/typescript/src/hooks/index.d.ts.map +1 -1
  105. package/lib/typescript/src/hooks/useDimensions.d.ts +3 -0
  106. package/lib/typescript/src/hooks/useDimensions.d.ts.map +1 -0
  107. package/lib/typescript/src/hooks/useDimensions.web.d.ts +3 -0
  108. package/lib/typescript/src/hooks/useDimensions.web.d.ts.map +1 -0
  109. package/lib/typescript/src/index.d.ts +2 -76
  110. package/lib/typescript/src/index.d.ts.map +1 -1
  111. package/lib/typescript/src/types/breakpoints.d.ts +17 -25
  112. package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
  113. package/lib/typescript/src/types/core.d.ts +25 -11
  114. package/lib/typescript/src/types/core.d.ts.map +1 -1
  115. package/lib/typescript/src/types/index.d.ts +2 -7
  116. package/lib/typescript/src/types/index.d.ts.map +1 -1
  117. package/lib/typescript/src/types/mediaQueries.d.ts +8 -0
  118. package/lib/typescript/src/types/mediaQueries.d.ts.map +1 -0
  119. package/lib/typescript/src/utils/breakpoints.d.ts +62 -2
  120. package/lib/typescript/src/utils/breakpoints.d.ts.map +1 -1
  121. package/lib/typescript/src/utils/common.d.ts +7 -0
  122. package/lib/typescript/src/utils/common.d.ts.map +1 -0
  123. package/lib/typescript/src/utils/index.d.ts +6 -7
  124. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  125. package/lib/typescript/src/utils/mediaQueries.d.ts +130 -0
  126. package/lib/typescript/src/utils/mediaQueries.d.ts.map +1 -0
  127. package/lib/typescript/src/utils/normalizeStyles.d.ts +2 -0
  128. package/lib/typescript/src/utils/normalizeStyles.d.ts.map +1 -0
  129. package/lib/typescript/src/utils/normalizeStyles.web.d.ts +5 -0
  130. package/lib/typescript/src/utils/normalizeStyles.web.d.ts.map +1 -0
  131. package/lib/typescript/src/utils/normalizer.d.ts.map +1 -0
  132. package/lib/typescript/src/utils/styles.d.ts +49 -3
  133. package/lib/typescript/src/utils/styles.d.ts.map +1 -1
  134. package/package.json +25 -46
  135. package/src/UnistylesTheme.tsx +17 -0
  136. package/src/__tests__/createUnistyles.spec.tsx +192 -0
  137. package/src/createUnistyles.ts +70 -0
  138. package/src/hooks/index.ts +1 -4
  139. package/src/hooks/useDimensions.ts +4 -0
  140. package/src/hooks/useDimensions.web.ts +34 -0
  141. package/src/index.ts +2 -50
  142. package/src/types/breakpoints.ts +33 -58
  143. package/src/types/core.ts +36 -11
  144. package/src/types/index.ts +7 -12
  145. package/src/types/mediaQueries.ts +10 -0
  146. package/src/utils/breakpoints.ts +124 -28
  147. package/src/utils/common.ts +14 -0
  148. package/src/utils/index.ts +13 -7
  149. package/src/utils/mediaQueries.ts +201 -0
  150. package/src/utils/normalizeStyles.ts +2 -0
  151. package/src/{normalizer/normalizeStyle.ts → utils/normalizeStyles.web.ts} +3 -3
  152. package/src/{normalizer → utils}/normalizer.ts +4 -5
  153. package/src/utils/styles.ts +102 -54
  154. package/android/CMakeLists.txt +0 -27
  155. package/android/build.gradle +0 -75
  156. package/android/src/main/cxx/cpp-adapter.cpp +0 -132
  157. package/android/src/main/java/com/unistyles/UnistylesModule.kt +0 -189
  158. package/android/src/main/java/com/unistyles/UnistylesPackage.kt +0 -18
  159. package/cxx/UnistylesRuntime.cpp +0 -318
  160. package/cxx/UnistylesRuntime.h +0 -74
  161. package/ios/UnistylesHelpers.h +0 -3
  162. package/ios/UnistylesHelpers.mm +0 -5
  163. package/ios/UnistylesModule.h +0 -16
  164. package/ios/UnistylesModule.mm +0 -138
  165. package/ios/platform/Platform_iOS.h +0 -21
  166. package/ios/platform/Platform_iOS.mm +0 -132
  167. package/ios/platform/Platform_macOS.h +0 -20
  168. package/ios/platform/Platform_macOS.mm +0 -83
  169. package/lib/commonjs/common.js +0 -60
  170. package/lib/commonjs/common.js.map +0 -1
  171. package/lib/commonjs/core/UnistyleRegistry.js +0 -94
  172. package/lib/commonjs/core/UnistyleRegistry.js.map +0 -1
  173. package/lib/commonjs/core/Unistyles.js +0 -32
  174. package/lib/commonjs/core/Unistyles.js.map +0 -1
  175. package/lib/commonjs/core/UnistylesModule.js +0 -197
  176. package/lib/commonjs/core/UnistylesModule.js.map +0 -1
  177. package/lib/commonjs/core/UnistylesModule.native.js +0 -9
  178. package/lib/commonjs/core/UnistylesModule.native.js.map +0 -1
  179. package/lib/commonjs/core/UnistylesRuntime.js +0 -140
  180. package/lib/commonjs/core/UnistylesRuntime.js.map +0 -1
  181. package/lib/commonjs/core/index.js +0 -13
  182. package/lib/commonjs/core/index.js.map +0 -1
  183. package/lib/commonjs/createStyleSheet.js +0 -14
  184. package/lib/commonjs/createStyleSheet.js.map +0 -1
  185. package/lib/commonjs/global.js +0 -2
  186. package/lib/commonjs/global.js.map +0 -1
  187. package/lib/commonjs/hooks/useCSS.js +0 -44
  188. package/lib/commonjs/hooks/useCSS.js.map +0 -1
  189. package/lib/commonjs/hooks/useCSS.native.js +0 -9
  190. package/lib/commonjs/hooks/useCSS.native.js.map +0 -1
  191. package/lib/commonjs/hooks/useInitialTheme.js +0 -17
  192. package/lib/commonjs/hooks/useInitialTheme.js.map +0 -1
  193. package/lib/commonjs/hooks/useUnistyles.js +0 -64
  194. package/lib/commonjs/hooks/useUnistyles.js.map +0 -1
  195. package/lib/commonjs/hooks/useVariants.js +0 -14
  196. package/lib/commonjs/hooks/useVariants.js.map +0 -1
  197. package/lib/commonjs/normalizer/index.js +0 -32
  198. package/lib/commonjs/normalizer/index.js.map +0 -1
  199. package/lib/commonjs/normalizer/module.d.js.map +0 -1
  200. package/lib/commonjs/normalizer/normalizeStyle.js.map +0 -1
  201. package/lib/commonjs/normalizer/normalizer.js.map +0 -1
  202. package/lib/commonjs/normalizer/normalizer.macos.js +0 -3
  203. package/lib/commonjs/normalizer/normalizer.macos.js.map +0 -1
  204. package/lib/commonjs/plugins/cssMediaQueriesPlugin.js +0 -14
  205. package/lib/commonjs/plugins/cssMediaQueriesPlugin.js.map +0 -1
  206. package/lib/commonjs/plugins/index.js +0 -20
  207. package/lib/commonjs/plugins/index.js.map +0 -1
  208. package/lib/commonjs/plugins/normalizeWebStylesPlugin.js +0 -12
  209. package/lib/commonjs/plugins/normalizeWebStylesPlugin.js.map +0 -1
  210. package/lib/commonjs/types/common.js +0 -2
  211. package/lib/commonjs/types/common.js.map +0 -1
  212. package/lib/commonjs/types/plugin.js +0 -6
  213. package/lib/commonjs/types/plugin.js.map +0 -1
  214. package/lib/commonjs/types/stylesheet.js +0 -6
  215. package/lib/commonjs/types/unistyles.js +0 -6
  216. package/lib/commonjs/types/variants.js +0 -2
  217. package/lib/commonjs/useStyles.js +0 -47
  218. package/lib/commonjs/useStyles.js.map +0 -1
  219. package/lib/commonjs/utils/cssMediaQuery.js +0 -244
  220. package/lib/commonjs/utils/cssMediaQuery.js.map +0 -1
  221. package/lib/commonjs/utils/generateId.js +0 -15
  222. package/lib/commonjs/utils/generateId.js.map +0 -1
  223. package/lib/commonjs/utils/hash32.js +0 -43
  224. package/lib/commonjs/utils/hash32.js.map +0 -1
  225. package/lib/commonjs/utils/mq.js +0 -38
  226. package/lib/commonjs/utils/mq.js.map +0 -1
  227. package/lib/commonjs/utils/mqParser.js +0 -89
  228. package/lib/commonjs/utils/mqParser.js.map +0 -1
  229. package/lib/commonjs/utils/withPlugins.js +0 -15
  230. package/lib/commonjs/utils/withPlugins.js.map +0 -1
  231. package/lib/module/common.js +0 -53
  232. package/lib/module/common.js.map +0 -1
  233. package/lib/module/core/UnistyleRegistry.js +0 -87
  234. package/lib/module/core/UnistyleRegistry.js.map +0 -1
  235. package/lib/module/core/Unistyles.js +0 -26
  236. package/lib/module/core/Unistyles.js.map +0 -1
  237. package/lib/module/core/UnistylesModule.js +0 -190
  238. package/lib/module/core/UnistylesModule.js.map +0 -1
  239. package/lib/module/core/UnistylesModule.native.js +0 -3
  240. package/lib/module/core/UnistylesModule.native.js.map +0 -1
  241. package/lib/module/core/UnistylesRuntime.js +0 -133
  242. package/lib/module/core/UnistylesRuntime.js.map +0 -1
  243. package/lib/module/core/index.js +0 -2
  244. package/lib/module/core/index.js.map +0 -1
  245. package/lib/module/createStyleSheet.js +0 -7
  246. package/lib/module/createStyleSheet.js.map +0 -1
  247. package/lib/module/global.js +0 -2
  248. package/lib/module/global.js.map +0 -1
  249. package/lib/module/hooks/useCSS.js +0 -37
  250. package/lib/module/hooks/useCSS.js.map +0 -1
  251. package/lib/module/hooks/useCSS.native.js +0 -2
  252. package/lib/module/hooks/useCSS.native.js.map +0 -1
  253. package/lib/module/hooks/useInitialTheme.js +0 -10
  254. package/lib/module/hooks/useInitialTheme.js.map +0 -1
  255. package/lib/module/hooks/useUnistyles.js +0 -57
  256. package/lib/module/hooks/useUnistyles.js.map +0 -1
  257. package/lib/module/hooks/useVariants.js +0 -7
  258. package/lib/module/hooks/useVariants.js.map +0 -1
  259. package/lib/module/normalizer/index.js +0 -3
  260. package/lib/module/normalizer/index.js.map +0 -1
  261. package/lib/module/normalizer/module.d.js.map +0 -1
  262. package/lib/module/normalizer/normalizeStyle.js.map +0 -1
  263. package/lib/module/normalizer/normalizer.js.map +0 -1
  264. package/lib/module/normalizer/normalizer.macos.js +0 -2
  265. package/lib/module/normalizer/normalizer.macos.js.map +0 -1
  266. package/lib/module/plugins/cssMediaQueriesPlugin.js +0 -7
  267. package/lib/module/plugins/cssMediaQueriesPlugin.js.map +0 -1
  268. package/lib/module/plugins/index.js +0 -3
  269. package/lib/module/plugins/index.js.map +0 -1
  270. package/lib/module/plugins/normalizeWebStylesPlugin.js +0 -6
  271. package/lib/module/plugins/normalizeWebStylesPlugin.js.map +0 -1
  272. package/lib/module/types/common.js +0 -2
  273. package/lib/module/types/plugin.js +0 -2
  274. package/lib/module/types/plugin.js.map +0 -1
  275. package/lib/module/types/stylesheet.js +0 -2
  276. package/lib/module/types/stylesheet.js.map +0 -1
  277. package/lib/module/types/unistyles.js +0 -2
  278. package/lib/module/types/unistyles.js.map +0 -1
  279. package/lib/module/types/variants.js +0 -2
  280. package/lib/module/types/variants.js.map +0 -1
  281. package/lib/module/useStyles.js +0 -40
  282. package/lib/module/useStyles.js.map +0 -1
  283. package/lib/module/utils/cssMediaQuery.js +0 -237
  284. package/lib/module/utils/cssMediaQuery.js.map +0 -1
  285. package/lib/module/utils/generateId.js +0 -7
  286. package/lib/module/utils/generateId.js.map +0 -1
  287. package/lib/module/utils/hash32.js +0 -36
  288. package/lib/module/utils/hash32.js.map +0 -1
  289. package/lib/module/utils/mq.js +0 -32
  290. package/lib/module/utils/mq.js.map +0 -1
  291. package/lib/module/utils/mqParser.js +0 -78
  292. package/lib/module/utils/mqParser.js.map +0 -1
  293. package/lib/module/utils/withPlugins.js +0 -8
  294. package/lib/module/utils/withPlugins.js.map +0 -1
  295. package/lib/typescript/src/common.d.ts +0 -46
  296. package/lib/typescript/src/common.d.ts.map +0 -1
  297. package/lib/typescript/src/core/UnistyleRegistry.d.ts +0 -56
  298. package/lib/typescript/src/core/UnistyleRegistry.d.ts.map +0 -1
  299. package/lib/typescript/src/core/Unistyles.d.ts +0 -13
  300. package/lib/typescript/src/core/Unistyles.d.ts.map +0 -1
  301. package/lib/typescript/src/core/UnistylesModule.d.ts +0 -19
  302. package/lib/typescript/src/core/UnistylesModule.d.ts.map +0 -1
  303. package/lib/typescript/src/core/UnistylesModule.native.d.ts +0 -6
  304. package/lib/typescript/src/core/UnistylesModule.native.d.ts.map +0 -1
  305. package/lib/typescript/src/core/UnistylesRuntime.d.ts +0 -81
  306. package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +0 -1
  307. package/lib/typescript/src/core/index.d.ts +0 -3
  308. package/lib/typescript/src/core/index.d.ts.map +0 -1
  309. package/lib/typescript/src/createStyleSheet.d.ts +0 -8
  310. package/lib/typescript/src/createStyleSheet.d.ts.map +0 -1
  311. package/lib/typescript/src/global.d.ts +0 -7
  312. package/lib/typescript/src/global.d.ts.map +0 -1
  313. package/lib/typescript/src/hooks/useCSS.d.ts +0 -3
  314. package/lib/typescript/src/hooks/useCSS.d.ts.map +0 -1
  315. package/lib/typescript/src/hooks/useCSS.native.d.ts +0 -3
  316. package/lib/typescript/src/hooks/useCSS.native.d.ts.map +0 -1
  317. package/lib/typescript/src/hooks/useInitialTheme.d.ts +0 -3
  318. package/lib/typescript/src/hooks/useInitialTheme.d.ts.map +0 -1
  319. package/lib/typescript/src/hooks/useUnistyles.d.ts +0 -14
  320. package/lib/typescript/src/hooks/useUnistyles.d.ts.map +0 -1
  321. package/lib/typescript/src/hooks/useVariants.d.ts +0 -3
  322. package/lib/typescript/src/hooks/useVariants.d.ts.map +0 -1
  323. package/lib/typescript/src/normalizer/index.d.ts +0 -3
  324. package/lib/typescript/src/normalizer/index.d.ts.map +0 -1
  325. package/lib/typescript/src/normalizer/normalizeStyle.d.ts +0 -3
  326. package/lib/typescript/src/normalizer/normalizeStyle.d.ts.map +0 -1
  327. package/lib/typescript/src/normalizer/normalizer.d.ts.map +0 -1
  328. package/lib/typescript/src/normalizer/normalizer.macos.d.ts +0 -1
  329. package/lib/typescript/src/normalizer/normalizer.macos.d.ts.map +0 -1
  330. package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts +0 -3
  331. package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts.map +0 -1
  332. package/lib/typescript/src/plugins/index.d.ts +0 -3
  333. package/lib/typescript/src/plugins/index.d.ts.map +0 -1
  334. package/lib/typescript/src/plugins/normalizeWebStylesPlugin.d.ts +0 -3
  335. package/lib/typescript/src/plugins/normalizeWebStylesPlugin.d.ts.map +0 -1
  336. package/lib/typescript/src/types/common.d.ts +0 -3
  337. package/lib/typescript/src/types/common.d.ts.map +0 -1
  338. package/lib/typescript/src/types/plugin.d.ts +0 -7
  339. package/lib/typescript/src/types/plugin.d.ts.map +0 -1
  340. package/lib/typescript/src/types/stylesheet.d.ts +0 -40
  341. package/lib/typescript/src/types/stylesheet.d.ts.map +0 -1
  342. package/lib/typescript/src/types/unistyles.d.ts +0 -53
  343. package/lib/typescript/src/types/unistyles.d.ts.map +0 -1
  344. package/lib/typescript/src/types/variants.d.ts +0 -14
  345. package/lib/typescript/src/types/variants.d.ts.map +0 -1
  346. package/lib/typescript/src/useStyles.d.ts +0 -16
  347. package/lib/typescript/src/useStyles.d.ts.map +0 -1
  348. package/lib/typescript/src/utils/cssMediaQuery.d.ts +0 -4
  349. package/lib/typescript/src/utils/cssMediaQuery.d.ts.map +0 -1
  350. package/lib/typescript/src/utils/generateId.d.ts +0 -2
  351. package/lib/typescript/src/utils/generateId.d.ts.map +0 -1
  352. package/lib/typescript/src/utils/hash32.d.ts +0 -2
  353. package/lib/typescript/src/utils/hash32.d.ts.map +0 -1
  354. package/lib/typescript/src/utils/mq.d.ts +0 -26
  355. package/lib/typescript/src/utils/mq.d.ts.map +0 -1
  356. package/lib/typescript/src/utils/mqParser.d.ts +0 -16
  357. package/lib/typescript/src/utils/mqParser.d.ts.map +0 -1
  358. package/lib/typescript/src/utils/withPlugins.d.ts +0 -3
  359. package/lib/typescript/src/utils/withPlugins.d.ts.map +0 -1
  360. package/react-native-unistyles.podspec +0 -22
  361. package/src/__tests__/mocks.ts +0 -24
  362. package/src/common.ts +0 -55
  363. package/src/core/UnistyleRegistry.ts +0 -108
  364. package/src/core/Unistyles.ts +0 -35
  365. package/src/core/UnistylesModule.native.ts +0 -7
  366. package/src/core/UnistylesModule.ts +0 -230
  367. package/src/core/UnistylesRuntime.ts +0 -135
  368. package/src/core/index.ts +0 -2
  369. package/src/createStyleSheet.ts +0 -8
  370. package/src/global.ts +0 -6
  371. package/src/hooks/useCSS.native.ts +0 -3
  372. package/src/hooks/useCSS.ts +0 -51
  373. package/src/hooks/useInitialTheme.ts +0 -11
  374. package/src/hooks/useUnistyles.ts +0 -64
  375. package/src/hooks/useVariants.ts +0 -10
  376. package/src/normalizer/index.ts +0 -2
  377. package/src/normalizer/normalizer.macos.ts +0 -1
  378. package/src/plugins/cssMediaQueriesPlugin.ts +0 -8
  379. package/src/plugins/index.ts +0 -2
  380. package/src/plugins/normalizeWebStylesPlugin.ts +0 -7
  381. package/src/types/common.ts +0 -2
  382. package/src/types/plugin.ts +0 -7
  383. package/src/types/stylesheet.ts +0 -49
  384. package/src/types/unistyles.ts +0 -63
  385. package/src/types/variants.ts +0 -19
  386. package/src/useStyles.ts +0 -60
  387. package/src/utils/cssMediaQuery.ts +0 -268
  388. package/src/utils/generateId.ts +0 -10
  389. package/src/utils/hash32.ts +0 -53
  390. package/src/utils/mq.ts +0 -57
  391. package/src/utils/mqParser.ts +0 -99
  392. package/src/utils/withPlugins.ts +0 -13
  393. /package/lib/commonjs/{normalizer → utils}/module.d.js +0 -0
  394. /package/lib/module/{normalizer → utils}/module.d.js +0 -0
  395. /package/lib/typescript/src/{normalizer → utils}/normalizer.d.ts +0 -0
  396. /package/src/{normalizer → utils}/module.d.ts +0 -0
@@ -1,132 +0,0 @@
1
- #if TARGET_OS_IOS
2
-
3
- #import "Platform_iOS.h"
4
- #import "UnistylesRuntime.h"
5
- #import <React/RCTAppearance.h>
6
-
7
- @implementation Platform
8
-
9
- - (instancetype)init {
10
- self = [super init];
11
- if (self) {
12
- UIScreen *screen = [UIScreen mainScreen];
13
- UIContentSizeCategory contentSizeCategory = [[UIApplication sharedApplication] preferredContentSizeCategory];
14
-
15
- self.initialWidth = screen.bounds.size.width;
16
- self.initialHeight = screen.bounds.size.height;
17
- self.initialColorScheme = [self getColorScheme];
18
- self.initialContentSizeCategory = [self getContentSizeCategory:contentSizeCategory];
19
-
20
- [self setupListeners];
21
- }
22
- return self;
23
- }
24
-
25
- - (void)dealloc {
26
- if (self.unistylesRuntime != nullptr) {
27
- self.unistylesRuntime = nullptr;
28
- }
29
-
30
- [[NSNotificationCenter defaultCenter] removeObserver:self
31
- name: UIContentSizeCategoryDidChangeNotification
32
- object: nil];
33
- [[NSNotificationCenter defaultCenter] removeObserver:self
34
- name: RCTUserInterfaceStyleDidChangeNotification
35
- object: nil];
36
- [[NSNotificationCenter defaultCenter] removeObserver:self
37
- name: UIDeviceOrientationDidChangeNotification
38
- object: nil];
39
- }
40
-
41
- - (void)setupListeners {
42
- [[NSNotificationCenter defaultCenter] addObserver:self
43
- selector:@selector(onOrientationChange:)
44
- name:UIDeviceOrientationDidChangeNotification
45
- object:nil];
46
- [[NSNotificationCenter defaultCenter] addObserver:self
47
- selector:@selector(onAppearanceChange:)
48
- name:RCTUserInterfaceStyleDidChangeNotification
49
- object:nil];
50
- [[NSNotificationCenter defaultCenter] addObserver:self
51
- selector:@selector(onContentSizeCategoryChange:)
52
- name:UIContentSizeCategoryDidChangeNotification
53
- object:nil];
54
- }
55
-
56
- - (void)onAppearanceChange:(NSNotification *)notification {
57
- std::string colorScheme = [self getColorScheme];
58
-
59
- if (self.unistylesRuntime != nullptr) {
60
- ((UnistylesRuntime*)self.unistylesRuntime)->handleAppearanceChange(colorScheme);
61
- }
62
- }
63
-
64
- - (void)onContentSizeCategoryChange:(NSNotification *)notification {
65
- UIContentSizeCategory contentSizeCategory = [[UIApplication sharedApplication] preferredContentSizeCategory];
66
-
67
- if (self.unistylesRuntime != nullptr) {
68
- ((UnistylesRuntime*)self.unistylesRuntime)->handleContentSizeCategoryChange([self getContentSizeCategory:contentSizeCategory]);
69
- }
70
- }
71
-
72
- - (void)onOrientationChange:(NSNotification *)notification {
73
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
74
- UIScreen *screen = [UIScreen mainScreen];
75
- CGFloat screenWidth = screen.bounds.size.width;
76
- CGFloat screenHeight = screen.bounds.size.height;
77
-
78
- if (self.unistylesRuntime != nullptr) {
79
- ((UnistylesRuntime*)self.unistylesRuntime)->handleScreenSizeChange((int)screenWidth, (int)screenHeight);
80
- }
81
- });
82
- }
83
-
84
- - (std::string)getColorScheme {
85
- UIUserInterfaceStyle colorScheme = [UIScreen mainScreen].traitCollection.userInterfaceStyle;
86
-
87
- switch (colorScheme) {
88
- case UIUserInterfaceStyleLight:
89
- return UnistylesLightScheme;
90
- case UIUserInterfaceStyleDark:
91
- return UnistylesDarkScheme;
92
- case UIUserInterfaceStyleUnspecified:
93
- default:
94
- return UnistylesUnspecifiedScheme;
95
- }
96
- }
97
-
98
- - (std::string)getContentSizeCategory:(UIContentSizeCategory)contentSizeCategory {
99
- if ([contentSizeCategory isEqualToString:UIContentSizeCategoryExtraExtraExtraLarge]) {
100
- return std::string([@"xxxLarge" UTF8String]);
101
- }
102
-
103
- if ([contentSizeCategory isEqualToString:UIContentSizeCategoryExtraExtraLarge]) {
104
- return std::string([@"xxLarge" UTF8String]);
105
- }
106
-
107
- if ([contentSizeCategory isEqualToString:UIContentSizeCategoryExtraLarge]) {
108
- return std::string([@"xLarge" UTF8String]);
109
- }
110
-
111
- if ([contentSizeCategory isEqualToString:UIContentSizeCategoryLarge]) {
112
- return std::string([@"Large" UTF8String]);
113
- }
114
-
115
- if ([contentSizeCategory isEqualToString:UIContentSizeCategoryMedium]) {
116
- return std::string([@"Medium" UTF8String]);
117
- }
118
-
119
- if ([contentSizeCategory isEqualToString:UIContentSizeCategorySmall]) {
120
- return std::string([@"Small" UTF8String]);
121
- }
122
-
123
- if ([contentSizeCategory isEqualToString:UIContentSizeCategoryExtraSmall]) {
124
- return std::string([@"xSmall" UTF8String]);
125
- }
126
-
127
- return std::string([@"unspecified" UTF8String]);
128
- }
129
-
130
- @end
131
-
132
- #endif
@@ -1,20 +0,0 @@
1
- #include <string>
2
-
3
- @interface Platform : NSObject
4
-
5
- @property (nonatomic, assign) CGFloat initialWidth;
6
- @property (nonatomic, assign) CGFloat initialHeight;
7
- @property (nonatomic, assign) std::string initialColorScheme;
8
- @property (nonatomic, assign) std::string initialContentSizeCategory;
9
- @property (nonatomic, assign) void* unistylesRuntime;
10
-
11
- - (instancetype)init;
12
-
13
- - (void)setupListeners;
14
- - (void)onWindowResize;
15
- - (void)onAppearanceChange;
16
-
17
- - (std::string)getColorScheme;
18
-
19
- @end
20
-
@@ -1,83 +0,0 @@
1
- #if TARGET_OS_OSX
2
-
3
- #import "Platform_macOS.h"
4
- #import "UnistylesRuntime.h"
5
- #import <React/RCTUtils.h>
6
-
7
- @implementation Platform
8
-
9
- - (instancetype)init {
10
- self = [super init];
11
- if (self) {
12
- NSWindow *window = RCTSharedApplication().mainWindow;
13
-
14
- self.initialWidth = window.frame.size.width;
15
- self.initialHeight = window.frame.size.height;
16
- self.initialContentSizeCategory = std::string([@"unspecified" UTF8String]);
17
- self.initialColorScheme = [self getColorScheme];
18
-
19
- [self setupListeners];
20
- }
21
- return self;
22
- }
23
-
24
- - (void)dealloc {
25
- if (self.unistylesRuntime != nullptr) {
26
- self.unistylesRuntime = nullptr;
27
- }
28
-
29
- NSWindow *window = RCTSharedApplication().mainWindow;
30
-
31
- [window removeObserver:self forKeyPath:@"effectiveAppearance"];
32
- [window removeObserver:self forKeyPath:@"frame"];
33
- }
34
-
35
- - (void)setupListeners {
36
- NSWindow *window = RCTSharedApplication().mainWindow;
37
-
38
- [window addObserver:self forKeyPath:@"effectiveAppearance" options:NSKeyValueObservingOptionNew context:nil];
39
- [window addObserver:self forKeyPath:@"frame" options:NSKeyValueObservingOptionNew context:nil];
40
- }
41
-
42
- - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
43
- if ([keyPath isEqualToString:@"effectiveAppearance"]) {
44
- return [self onAppearanceChange];
45
- }
46
-
47
- if ([keyPath isEqualToString:@"frame"]) {
48
- return [self onWindowResize];
49
- }
50
- }
51
-
52
- - (void)onAppearanceChange {
53
- std::string colorScheme = [self getColorScheme];
54
-
55
- if (self.unistylesRuntime != nullptr) {
56
- ((UnistylesRuntime*)self.unistylesRuntime)->handleAppearanceChange(colorScheme);
57
- }
58
- }
59
-
60
- - (void)onWindowResize {
61
- NSWindow *window = RCTSharedApplication().mainWindow;
62
-
63
- CGFloat screenWidth = window.frame.size.width;
64
- CGFloat screenHeight = window.frame.size.height;
65
-
66
- if (self.unistylesRuntime != nullptr) {
67
- ((UnistylesRuntime*)self.unistylesRuntime)->handleScreenSizeChange((int)screenWidth, (int)screenHeight);
68
- }
69
- }
70
-
71
- - (std::string)getColorScheme {
72
- NSAppearance *appearance = RCTSharedApplication().effectiveAppearance;
73
-
74
- if (appearance.name == NSAppearanceNameDarkAqua) {
75
- return UnistylesDarkScheme;
76
- }
77
-
78
- return UnistylesLightScheme;
79
- }
80
-
81
- @end
82
-
83
- #endif
@@ -1,60 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.warn = exports.isWeb = exports.isServer = exports.isMobile = exports.isIOS = exports.isAndroid = exports.UnistylesEventType = exports.UnistylesError = exports.ScreenOrientation = exports.IOSContentSizeCategory = exports.AndroidContentSizeCategory = void 0;
7
- var _reactNative = require("react-native");
8
- const warn = message => {
9
- console.warn(`🦄 [react-native-unistyles]: ${message}`);
10
- };
11
- exports.warn = warn;
12
- const isWeb = exports.isWeb = _reactNative.Platform.OS === 'web';
13
- const isIOS = exports.isIOS = _reactNative.Platform.OS === 'ios';
14
- const isAndroid = exports.isAndroid = _reactNative.Platform.OS === 'android';
15
- const isMobile = exports.isMobile = isIOS || isAndroid;
16
- const isServer = exports.isServer = typeof window === 'undefined';
17
- const ScreenOrientation = exports.ScreenOrientation = {
18
- Landscape: 'landscape',
19
- Portrait: 'portrait'
20
- };
21
- let IOSContentSizeCategory = exports.IOSContentSizeCategory = /*#__PURE__*/function (IOSContentSizeCategory) {
22
- IOSContentSizeCategory["ExtraExtraExtraLarge"] = "xxxLarge";
23
- IOSContentSizeCategory["ExtraExtraLarge"] = "xxLarge";
24
- IOSContentSizeCategory["ExtraLarge"] = "xLarge";
25
- IOSContentSizeCategory["Large"] = "Large";
26
- IOSContentSizeCategory["Medium"] = "Medium";
27
- IOSContentSizeCategory["Small"] = "Small";
28
- IOSContentSizeCategory["ExtraSmall"] = "xSmall";
29
- IOSContentSizeCategory["Unspecified"] = "unspecified";
30
- return IOSContentSizeCategory;
31
- }({});
32
- let AndroidContentSizeCategory = exports.AndroidContentSizeCategory = /*#__PURE__*/function (AndroidContentSizeCategory) {
33
- AndroidContentSizeCategory["Small"] = "Small";
34
- AndroidContentSizeCategory["Default"] = "Default";
35
- AndroidContentSizeCategory["Large"] = "Large";
36
- AndroidContentSizeCategory["ExtraLarge"] = "ExtraLarge";
37
- AndroidContentSizeCategory["Huge"] = "Huge";
38
- return AndroidContentSizeCategory;
39
- }({});
40
- let UnistylesEventType = exports.UnistylesEventType = /*#__PURE__*/function (UnistylesEventType) {
41
- UnistylesEventType["Theme"] = "theme";
42
- UnistylesEventType["Layout"] = "layout";
43
- UnistylesEventType["Plugin"] = "plugin";
44
- UnistylesEventType["DynamicTypeSize"] = "dynamicTypeSize";
45
- return UnistylesEventType;
46
- }({});
47
- let UnistylesError = exports.UnistylesError = /*#__PURE__*/function (UnistylesError) {
48
- UnistylesError["RuntimeUnavailable"] = "Unistyles runtime is not available. Make sure you followed the installation instructions";
49
- UnistylesError["ThemeNotFound"] = "You are trying to get a theme that is not registered with UnistylesRegistry";
50
- UnistylesError["ThemeNotRegistered"] = "You are trying to set a theme that was not registered with UnistylesRegistry";
51
- UnistylesError["ThemeNotSelected"] = "Your themes are registered, but you didn't select the initial theme";
52
- UnistylesError["ThemesCannotBeEmpty"] = "You are trying to register empty themes object";
53
- UnistylesError["BreakpointsCannotBeEmpty"] = "You are trying to register empty breakpoints object";
54
- UnistylesError["BreakpointsMustStartFromZero"] = "You are trying to register breakpoints that don't start from 0";
55
- UnistylesError["InvalidPluginName"] = "Plugin name can't start from reserved prefix __unistyles";
56
- UnistylesError["DuplicatePluginName"] = "You are trying to register a plugin with a name that is already registered";
57
- UnistylesError["CantRemoveInternalPlugin"] = "You are trying to remove an internal unistyles plugin";
58
- return UnistylesError;
59
- }({});
60
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","warn","message","console","exports","isWeb","Platform","OS","isIOS","isAndroid","isMobile","isServer","window","ScreenOrientation","Landscape","Portrait","IOSContentSizeCategory","AndroidContentSizeCategory","UnistylesEventType","UnistylesError"],"sourceRoot":"../../src","sources":["common.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,IAAI,GAAIC,OAAe,IAAK;EACrCC,OAAO,CAACF,IAAI,CAAE,gCAA+BC,OAAQ,EAAC,CAAC;AAC3D,CAAC;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA;AAEM,MAAMI,KAAK,GAAAD,OAAA,CAAAC,KAAA,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK;AACnC,MAAMC,KAAK,GAAAJ,OAAA,CAAAI,KAAA,GAAGF,qBAAQ,CAACC,EAAE,KAAK,KAAK;AACnC,MAAME,SAAS,GAAAL,OAAA,CAAAK,SAAA,GAAGH,qBAAQ,CAACC,EAAE,KAAK,SAAS;AAC3C,MAAMG,QAAQ,GAAAN,OAAA,CAAAM,QAAA,GAAGF,KAAK,IAAIC,SAAS;AACnC,MAAME,QAAQ,GAAAP,OAAA,CAAAO,QAAA,GAAG,OAAOC,MAAM,KAAK,WAAW;AAE9C,MAAMC,iBAAiB,GAAAT,OAAA,CAAAS,iBAAA,GAAG;EAC7BC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE;AACd,CAAU;AAAA,IAEEC,sBAAsB,GAAAZ,OAAA,CAAAY,sBAAA,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;AAAA,IAWtBC,0BAA0B,GAAAb,OAAA,CAAAa,0BAAA,0BAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA;AAAA,IAQ1BC,kBAAkB,GAAAd,OAAA,CAAAc,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAAA,IAOlBC,cAAc,GAAAf,OAAA,CAAAe,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA"}
@@ -1,94 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UnistyleRegistry = void 0;
7
- var _common = require("../common");
8
- var _plugins = require("../plugins");
9
- class UnistyleRegistry {
10
- config = {};
11
- plugins = _common.isWeb ? [_plugins.normalizeWebStylesPlugin] : [];
12
- themeNames = [];
13
- themes = {};
14
- breakpoints = {};
15
- sortedBreakpointPairs = [];
16
- constructor(unistylesBridge) {
17
- this.unistylesBridge = unistylesBridge;
18
- }
19
- addThemes = themes => {
20
- this.themes = themes;
21
- const keys = Object.keys(themes);
22
- this.unistylesBridge.themes = keys;
23
- this.themeNames = keys;
24
- return {
25
- addBreakpoints: this.addBreakpoints,
26
- addConfig: this.addConfig
27
- };
28
- };
29
- addBreakpoints = breakpoints => {
30
- this.breakpoints = breakpoints;
31
- this.unistylesBridge.useBreakpoints(breakpoints);
32
- this.sortedBreakpointPairs = this.unistylesBridge.sortedBreakpointPairs;
33
- return {
34
- addThemes: this.addThemes,
35
- addConfig: this.addConfig
36
- };
37
- };
38
- addConfig = config => {
39
- this.config = config;
40
- if (config.adaptiveThemes) {
41
- this.unistylesBridge.useAdaptiveThemes(config.adaptiveThemes);
42
- }
43
- if (config.plugins) {
44
- config.plugins.forEach(plugin => this.addPlugin(plugin, false));
45
- }
46
- if (config.initialTheme) {
47
- this.unistylesBridge.useTheme(config.initialTheme);
48
- }
49
- if (config.experimentalCSSMediaQueries) {
50
- this.plugins = [_plugins.cssMediaQueriesPlugin].concat(this.plugins);
51
- this.unistylesBridge.addPlugin(_plugins.cssMediaQueriesPlugin.name, false);
52
- }
53
- return {
54
- addBreakpoints: this.addBreakpoints,
55
- addThemes: this.addThemes
56
- };
57
- };
58
- getTheme = forName => {
59
- if (this.themeNames.length === 0) {
60
- return {};
61
- }
62
- if (this.hasTheme(forName)) {
63
- return this.themes[forName];
64
- }
65
- if (this.unistylesBridge.themeName) {
66
- throw new Error(_common.UnistylesError.ThemeNotFound);
67
- }
68
- throw new Error(_common.UnistylesError.ThemeNotSelected);
69
- };
70
- addPlugin = (plugin, notify = true) => {
71
- if (plugin.name.startsWith('__unistyles')) {
72
- throw new Error(_common.UnistylesError.InvalidPluginName);
73
- }
74
- if (this.plugins.some(({
75
- name
76
- }) => name === plugin.name)) {
77
- throw new Error(_common.UnistylesError.DuplicatePluginName);
78
- }
79
- this.plugins = [plugin].concat(this.plugins);
80
- this.unistylesBridge.addPlugin(plugin.name, notify);
81
- };
82
- removePlugin = plugin => {
83
- if (plugin.name.startsWith('__unistyles')) {
84
- throw new Error(_common.UnistylesError.CantRemoveInternalPlugin);
85
- }
86
- this.plugins = this.plugins.filter(({
87
- name
88
- }) => name !== plugin.name);
89
- this.unistylesBridge.removePlugin(plugin.name);
90
- };
91
- hasTheme = name => name in this.themes;
92
- }
93
- exports.UnistyleRegistry = UnistyleRegistry;
94
- //# sourceMappingURL=UnistyleRegistry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_common","require","_plugins","UnistyleRegistry","config","plugins","isWeb","normalizeWebStylesPlugin","themeNames","themes","breakpoints","sortedBreakpointPairs","constructor","unistylesBridge","addThemes","keys","Object","addBreakpoints","addConfig","useBreakpoints","adaptiveThemes","useAdaptiveThemes","forEach","plugin","addPlugin","initialTheme","useTheme","experimentalCSSMediaQueries","cssMediaQueriesPlugin","concat","name","getTheme","forName","length","hasTheme","themeName","Error","UnistylesError","ThemeNotFound","ThemeNotSelected","notify","startsWith","InvalidPluginName","some","DuplicatePluginName","removePlugin","CantRemoveInternalPlugin","filter","exports"],"sourceRoot":"../../../src","sources":["core/UnistyleRegistry.ts"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEO,MAAME,gBAAgB,CAAC;EACnBC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,OAAO,GAA2BC,aAAK,GACxC,CAACC,iCAAwB,CAAC,GAC1B,EAAE;EACDC,UAAU,GAAiC,EAAE;EAC7CC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,WAAW,GAAyB,CAAC,CAAC;EACtCC,qBAAqB,GAA0F,EAAE;EAExHC,WAAWA,CAASC,eAAgC,EAAE;IAAA,KAAlCA,eAAgC,GAAhCA,eAAgC;EAAG;EAEhDC,SAAS,GAAIL,MAAuB,IAAK;IAC5C,IAAI,CAACA,MAAM,GAAGA,MAAM;IAEpB,MAAMM,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACN,MAAM,CAAiC;IAEhE,IAAI,CAACI,eAAe,CAACJ,MAAM,GAAGM,IAAI;IAClC,IAAI,CAACP,UAAU,GAAGO,IAAI;IAEtB,OAAO;MACHE,cAAc,EAAE,IAAI,CAACA,cAAc;MACnCC,SAAS,EAAE,IAAI,CAACA;IACpB,CAAC;EACL,CAAC;EAEMD,cAAc,GAAIP,WAAiC,IAAK;IAC3D,IAAI,CAACA,WAAW,GAAGA,WAAW;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CAACrB,MAAM;AAC1E;AAACuC,OAAA,CAAA7C,gBAAA,GAAAA,gBAAA"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.unistyles = void 0;
7
- var _UnistylesModule = require("./UnistylesModule");
8
- var _UnistylesRuntime = require("./UnistylesRuntime");
9
- var _UnistyleRegistry = require("./UnistyleRegistry");
10
- var _common = require("../common");
11
- class Unistyles {
12
- constructor() {
13
- const isInstalled = _UnistylesModule.UnistylesModule?.install() ?? false;
14
- if (!isInstalled) {
15
- throw new Error(_common.UnistylesError.RuntimeUnavailable);
16
- }
17
-
18
- // @ts-ignore
19
- // eslint-disable-next-line no-undef
20
- this._bridge = (_common.isWeb ? globalThis : global).__UNISTYLES__;
21
- this._registry = new _UnistyleRegistry.UnistyleRegistry(this._bridge);
22
- this._runtime = new _UnistylesRuntime.UnistylesRuntime(this._bridge, this._registry);
23
- }
24
- get registry() {
25
- return this._registry;
26
- }
27
- get runtime() {
28
- return this._runtime;
29
- }
30
- }
31
- const unistyles = exports.unistyles = new Unistyles();
32
- //# sourceMappingURL=Unistyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_UnistylesModule","require","_UnistylesRuntime","_UnistyleRegistry","_common","Unistyles","constructor","isInstalled","UnistylesModule","install","Error","UnistylesError","RuntimeUnavailable","_bridge","isWeb","globalThis","global","__UNISTYLES__","_registry","UnistyleRegistry","_runtime","UnistylesRuntime","registry","runtime","unistyles","exports"],"sourceRoot":"../../../src","sources":["core/Unistyles.ts"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAEA,MAAMI,SAAS,CAAC;EAKZC,WAAWA,CAAA,EAAG;IACV,MAAMC,WAAW,GAAGC,gCAAe,EAAEC,OAAO,CAAC,CAAC,IAAI,KAAK;IAEvD,IAAI,CAACF,WAAW,EAAE;MACd,MAAM,IAAIG,KAAK,CAACC,sBAAc,CAACC,kBAAkB,CAAC;IACtD;;IAEA;IACA;IACA,IAAI,CAACC,OAAO,GAAG,CAACC,aAAK,GAAGC,UAAU,GAAGC,MAAM,EAAEC,aAAgC;IAC7E,IAAI,CAACC,SAAS,GAAG,IAAIC,kCAAgB,CAAC,IAAI,CAACN,OAAO,CAAC;IACnD,IAAI,CAACO,QAAQ,GAAG,IAAIC,kCAAgB,CAAC,IAAI,CAACR,OAAO,EAAE,IAAI,CAACK,SAAS,CAAC;EACtE;EAEA,IAAWI,QAAQA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACJ,SAAS;EACzB;EAEA,IAAWK,OAAOA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACH,QAAQ;EACxB;AACJ;AAEO,MAAMI,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAInB,SAAS,CAAC,CAAC"}
@@ -1,197 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UnistylesModule = exports.UnistylesBridgeWeb = void 0;
7
- var _reactNative = require("react-native");
8
- var _plugins = require("../plugins");
9
- var _common = require("../common");
10
- class UnistylesBridgeWeb {
11
- #timerRef = undefined;
12
- #hasAdaptiveThemes = false;
13
- #supportsAutomaticColorScheme = false;
14
- #screenWidth = _common.isServer ? undefined : window.innerWidth;
15
- #screenHeight = _common.isServer ? undefined : window.innerHeight;
16
- #themes = [];
17
- #breakpoints = {};
18
- #colorScheme = this.getPreferredColorScheme();
19
- #themeName = '';
20
- #enabledPlugins = [_plugins.normalizeWebStylesPlugin.name];
21
- #unistylesEvents = new _reactNative.NativeEventEmitter(_reactNative.NativeModules.Unistyles);
22
- #sortedBreakpointPairs = [];
23
- #breakpoint = '';
24
- #contentSizeCategory = 'unspecified';
25
- constructor() {
26
- if (!_common.isServer) {
27
- this.setupListeners();
28
- this.#screenWidth = window.innerWidth;
29
- this.#screenHeight = window.innerHeight;
30
- }
31
- }
32
- install() {
33
- // @ts-ignore
34
- // eslint-disable-next-line no-undef
35
- globalThis.__UNISTYLES__ = new Proxy({}, {
36
- get: (_target, prop) => {
37
- switch (prop) {
38
- case 'themeName':
39
- return this.getTheme();
40
- case 'screenWidth':
41
- return this.#screenWidth;
42
- case 'screenHeight':
43
- return this.#screenHeight;
44
- case 'contentSizeCategory':
45
- return this.#contentSizeCategory;
46
- case 'breakpoint':
47
- return this.#breakpoint || undefined;
48
- case 'breakpoints':
49
- return this.#breakpoints;
50
- case 'hasAdaptiveThemes':
51
- return this.#hasAdaptiveThemes;
52
- case 'sortedBreakpointPairs':
53
- return this.#sortedBreakpointPairs;
54
- case 'enabledPlugins':
55
- return this.#enabledPlugins;
56
- case 'colorScheme':
57
- return this.#colorScheme;
58
- case 'useTheme':
59
- return themeName => this.useTheme(themeName);
60
- case 'useBreakpoints':
61
- return breakpoints => this.useBreakpoints(breakpoints);
62
- case 'useAdaptiveThemes':
63
- return enable => this.useAdaptiveThemes(enable);
64
- case 'addPlugin':
65
- return (pluginName, notify) => this.addPlugin(pluginName, notify);
66
- case 'removePlugin':
67
- return pluginName => this.removePlugin(pluginName);
68
- default:
69
- return Reflect.get(this, prop);
70
- }
71
- },
72
- set: (target, prop, newValue, receiver) => {
73
- switch (prop) {
74
- case 'themes':
75
- {
76
- this.#themes = newValue;
77
- this.#supportsAutomaticColorScheme = newValue.includes('light') && newValue.includes('dark');
78
- return true;
79
- }
80
- case 'themeName':
81
- {
82
- this.#themeName = newValue;
83
- this.emitThemeChange();
84
- return true;
85
- }
86
- default:
87
- return Reflect.set(target, prop, newValue, receiver);
88
- }
89
- }
90
- });
91
- return true;
92
- }
93
- useTheme(themeName) {
94
- this.#themeName = themeName;
95
- this.emitThemeChange();
96
- }
97
- useBreakpoints(breakpoints) {
98
- this.#breakpoints = breakpoints;
99
- this.#sortedBreakpointPairs = Object.entries(breakpoints).sort(([, a], [, b]) => (a ?? 0) - (b ?? 0));
100
- if (!_common.isServer) {
101
- this.#breakpoint = this.getBreakpointFromScreenWidth(this.#screenWidth);
102
- }
103
- }
104
- useAdaptiveThemes(enable) {
105
- this.#hasAdaptiveThemes = enable;
106
- if (!this.#hasAdaptiveThemes || !this.#supportsAutomaticColorScheme) {
107
- return;
108
- }
109
- if (this.#themeName !== this.#colorScheme) {
110
- this.#themeName = this.#colorScheme;
111
- this.emitThemeChange();
112
- }
113
- }
114
- addPlugin(pluginName, notify) {
115
- this.#enabledPlugins = [pluginName].concat(this.#enabledPlugins);
116
- if (notify) {
117
- this.emitPluginChange();
118
- }
119
- }
120
- removePlugin(pluginName) {
121
- this.#enabledPlugins = this.#enabledPlugins.filter(name => name !== pluginName);
122
- this.emitPluginChange();
123
- }
124
- getTheme() {
125
- if (this.#themes.length === 1) {
126
- return this.#themes.at(0);
127
- }
128
- return this.#themeName;
129
- }
130
- setupListeners() {
131
- window.addEventListener('resize', () => {
132
- clearTimeout(this.#timerRef);
133
- this.#timerRef = setTimeout(() => {
134
- this.#screenWidth = window.innerWidth;
135
- this.#screenHeight = window.innerHeight;
136
- this.#breakpoint = this.getBreakpointFromScreenWidth(this.#screenWidth);
137
- this.emitLayoutChange();
138
- }, 100);
139
- });
140
- window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
141
- this.#colorScheme = event.matches ? 'dark' : 'light';
142
- if (!this.#supportsAutomaticColorScheme || !this.#hasAdaptiveThemes) {
143
- return;
144
- }
145
- if (this.#colorScheme !== this.#themeName) {
146
- this.#themeName = this.#colorScheme;
147
- this.emitThemeChange();
148
- }
149
- });
150
- }
151
- getBreakpointFromScreenWidth(width) {
152
- const breakpoint = this.#sortedBreakpointPairs.find(([, value], index, otherBreakpoints) => {
153
- const minVal = value;
154
- const maxVal = otherBreakpoints[index + 1]?.[1];
155
- if (!maxVal) {
156
- return true;
157
- }
158
- return width >= minVal && width < maxVal;
159
- });
160
- return breakpoint?.at(0);
161
- }
162
- getPreferredColorScheme() {
163
- if (!_common.isServer && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
164
- return 'dark';
165
- }
166
- return 'light';
167
- }
168
- emitPluginChange() {
169
- this.#unistylesEvents.emit('__unistylesOnChange', {
170
- type: 'plugin'
171
- });
172
- }
173
- emitThemeChange() {
174
- this.#unistylesEvents.emit('__unistylesOnChange', {
175
- type: 'theme',
176
- payload: {
177
- themeName: this.#themeName
178
- }
179
- });
180
- }
181
- emitLayoutChange() {
182
- this.#unistylesEvents.emit('__unistylesOnChange', {
183
- type: 'layout',
184
- payload: {
185
- breakpoint: this.#breakpoint,
186
- orientation: this.#screenWidth > this.#screenHeight ? 'landscape' : 'portrait',
187
- screen: {
188
- width: this.#screenWidth,
189
- height: this.#screenHeight
190
- }
191
- }
192
- });
193
- }
194
- }
195
- exports.UnistylesBridgeWeb = UnistylesBridgeWeb;
196
- const UnistylesModule = exports.UnistylesModule = new UnistylesBridgeWeb();
197
- //# sourceMappingURL=UnistylesModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_plugins","_common","UnistylesBridgeWeb","timerRef","undefined","hasAdaptiveThemes","supportsAutomaticColorScheme","screenWidth","isServer","window","innerWidth","screenHeight","innerHeight","themes","breakpoints","colorScheme","getPreferredColorScheme","themeName","enabledPlugins","normalizeWebStylesPlugin","name","unistylesEvents","NativeEventEmitter","NativeModules","Unistyles","sortedBreakpointPairs","breakpoint","contentSizeCategory","constructor","setupListeners","install","globalThis","__UNISTYLES__","Proxy","get","_target","prop","getTheme","useTheme","useBreakpoints","enable","useAdaptiveThemes","pluginName","notify","addPlugin","removePlugin","Reflect","set","target","newValue","receiver","includes","emitThemeChange","Object","entries","sort","a","b","getBreakpointFromScreenWidth","concat","emitPluginChange","filter","length","at","addEventListener","clearTimeout","setTimeout","emitLayoutChange","matchMedia","event","matches","width","find","value","index","otherBreakpoints","minVal","maxVal","emit","type","payload","orientation","screen","height","exports","UnistylesModule"],"sourceRoot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OAAO;EAClB;EAEQV,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC,CAACvC,eAAe,CAACyD,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE;IACV,CAAC,CAAC;EACN;EAEQ3B,eAAeA,CAAA,EAAG;IACtB,IAAI,CAAC,CAAC/B,eAAe,CAACyD,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,OAAO;MACbC,OAAO,EAAE;QACL/D,SAAS,EAAE,IAAI,CAAC,CAACA;MACrB;IACJ,CAAC,CAAC;EACN;EAEQkD,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC,CAAC9C,eAAe,CAACyD,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;QACLtD,UAAU,EAAE,IAAI,CAAC,CAACA,UAAU;QAC5BuD,WAAW,EAAG,IAAI,CAAC,CAAC1E,WAAW,GAAe,IAAI,CAAC,CAACI,YAAuB,GACrE,WAAW,GACX,UAAU;QAChBuE,MAAM,EAAE;UACJX,KAAK,EAAE,IAAI,CAAC,CAAChE,WAAW;UACxB4E,MAAM,EAAE,IAAI,CAAC,CAACxE;QAClB;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAACyE,OAAA,CAAAlF,kBAAA,GAAAA,kBAAA;AAEM,MAAMmF,eAAe,GAAAD,OAAA,CAAAC,eAAA,GAAG,IAAInF,kBAAkB,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UnistylesModule = void 0;
7
- var _reactNative = require("react-native");
8
- const UnistylesModule = exports.UnistylesModule = _reactNative.NativeModules?.Unistyles;
9
- //# sourceMappingURL=UnistylesModule.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","UnistylesModule","exports","NativeModules","Unistyles"],"sourceRoot":"../../../src","sources":["core/UnistylesModule.native.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMO,MAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGE,0BAAa,EAAEC,SAAkC"}