react-native-css 2.1.2 → 3.0.0-nightly.19372e8

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 (899) hide show
  1. package/{LICENSE.md → LICENSE} +6 -8
  2. package/README.md +177 -70
  3. package/dist/commonjs/babel/allowedModules.js +23 -0
  4. package/dist/commonjs/babel/allowedModules.js.map +1 -0
  5. package/dist/commonjs/babel/helpers.js +25 -0
  6. package/dist/commonjs/babel/helpers.js.map +1 -0
  7. package/dist/commonjs/babel/import-plugin.js +101 -0
  8. package/dist/commonjs/babel/import-plugin.js.map +1 -0
  9. package/dist/commonjs/babel/index.js +9 -0
  10. package/dist/commonjs/babel/index.js.map +1 -0
  11. package/dist/commonjs/babel/react-native-web.js +118 -0
  12. package/dist/commonjs/babel/react-native-web.js.map +1 -0
  13. package/dist/commonjs/babel/react-native.js +118 -0
  14. package/dist/commonjs/babel/react-native.js.map +1 -0
  15. package/dist/commonjs/compiler/atRules.js +114 -0
  16. package/dist/commonjs/compiler/atRules.js.map +1 -0
  17. package/dist/commonjs/compiler/compiler.js +281 -0
  18. package/dist/commonjs/compiler/compiler.js.map +1 -0
  19. package/dist/commonjs/compiler/compiler.types.js +4 -0
  20. package/dist/commonjs/compiler/compiler.types.js.map +1 -0
  21. package/dist/commonjs/compiler/container-query.js +63 -0
  22. package/dist/commonjs/compiler/container-query.js.map +1 -0
  23. package/dist/commonjs/compiler/declarations.js +2166 -0
  24. package/dist/commonjs/compiler/declarations.js.map +1 -0
  25. package/dist/commonjs/compiler/functions-web.js +44 -0
  26. package/dist/commonjs/compiler/functions-web.js.map +1 -0
  27. package/dist/commonjs/compiler/functions.js +59 -0
  28. package/dist/commonjs/compiler/functions.js.map +1 -0
  29. package/dist/commonjs/compiler/index.js +17 -0
  30. package/dist/commonjs/compiler/index.js.map +1 -0
  31. package/dist/commonjs/compiler/inheritance.test.js +78 -0
  32. package/dist/commonjs/compiler/inheritance.test.js.map +1 -0
  33. package/dist/commonjs/compiler/keyframes.js +60 -0
  34. package/dist/commonjs/compiler/keyframes.js.map +1 -0
  35. package/dist/commonjs/compiler/media-query.js +172 -0
  36. package/dist/commonjs/compiler/media-query.js.map +1 -0
  37. package/dist/commonjs/compiler/pseudo-elements.js +49 -0
  38. package/dist/commonjs/compiler/pseudo-elements.js.map +1 -0
  39. package/dist/commonjs/compiler/selector-builder.js +501 -0
  40. package/dist/commonjs/compiler/selector-builder.js.map +1 -0
  41. package/dist/commonjs/compiler/selectors.js +414 -0
  42. package/dist/commonjs/compiler/selectors.js.map +1 -0
  43. package/dist/commonjs/compiler/split-by-delimiter.js +21 -0
  44. package/dist/commonjs/compiler/split-by-delimiter.js.map +1 -0
  45. package/dist/commonjs/compiler/stylesheet.js +476 -0
  46. package/dist/commonjs/compiler/stylesheet.js.map +1 -0
  47. package/dist/commonjs/compiler/supports.js +27 -0
  48. package/dist/commonjs/compiler/supports.js.map +1 -0
  49. package/dist/commonjs/components/ActivityIndicator.js +22 -0
  50. package/dist/commonjs/components/ActivityIndicator.js.map +1 -0
  51. package/dist/commonjs/components/Button.js +22 -0
  52. package/dist/commonjs/components/Button.js.map +1 -0
  53. package/dist/commonjs/components/FlatList.js +19 -0
  54. package/dist/commonjs/components/FlatList.js.map +1 -0
  55. package/dist/commonjs/components/Image.js +17 -0
  56. package/dist/commonjs/components/Image.js.map +1 -0
  57. package/dist/commonjs/components/Switch.js +17 -0
  58. package/dist/commonjs/components/Switch.js.map +1 -0
  59. package/dist/commonjs/components/Text.js +17 -0
  60. package/dist/commonjs/components/Text.js.map +1 -0
  61. package/dist/commonjs/components/TextInput.js +17 -0
  62. package/dist/commonjs/components/TextInput.js.map +1 -0
  63. package/dist/commonjs/components/View.js +17 -0
  64. package/dist/commonjs/components/View.js.map +1 -0
  65. package/dist/commonjs/components/index.js +84 -0
  66. package/dist/commonjs/components/index.js.map +1 -0
  67. package/dist/commonjs/doctor/index.js +6 -0
  68. package/dist/commonjs/doctor/index.js.map +1 -0
  69. package/dist/commonjs/index.js +28 -0
  70. package/dist/commonjs/index.js.map +1 -0
  71. package/dist/commonjs/jest/expect.d.js +2 -0
  72. package/dist/commonjs/jest/expect.d.js.map +1 -0
  73. package/dist/commonjs/jest/index.js +56 -0
  74. package/dist/commonjs/jest/index.js.map +1 -0
  75. package/dist/commonjs/jest/setup.js +3 -0
  76. package/dist/commonjs/jest/setup.js.map +1 -0
  77. package/dist/commonjs/jest/setupAfterEnv.js +15 -0
  78. package/dist/commonjs/jest/setupAfterEnv.js.map +1 -0
  79. package/dist/commonjs/metro/index.js +167 -0
  80. package/dist/commonjs/metro/index.js.map +1 -0
  81. package/dist/commonjs/metro/injection-code.js +32 -0
  82. package/dist/commonjs/metro/injection-code.js.map +1 -0
  83. package/dist/commonjs/metro/metro-transformer.js +21 -0
  84. package/dist/commonjs/metro/metro-transformer.js.map +1 -0
  85. package/dist/commonjs/metro/picocolors.js +71 -0
  86. package/dist/commonjs/metro/picocolors.js.map +1 -0
  87. package/dist/commonjs/metro/resolver.js +62 -0
  88. package/dist/commonjs/metro/resolver.js.map +1 -0
  89. package/dist/commonjs/metro/stringify.js +59 -0
  90. package/dist/commonjs/metro/stringify.js.map +1 -0
  91. package/dist/commonjs/metro/typescript.js +47 -0
  92. package/dist/commonjs/metro/typescript.js.map +1 -0
  93. package/dist/commonjs/package.json +1 -0
  94. package/dist/commonjs/poison.pill.js +39 -0
  95. package/dist/commonjs/poison.pill.js.map +1 -0
  96. package/dist/commonjs/runtime/index.js +17 -0
  97. package/dist/commonjs/runtime/index.js.map +1 -0
  98. package/dist/commonjs/runtime/native/api.js +90 -0
  99. package/dist/commonjs/runtime/native/api.js.map +1 -0
  100. package/dist/commonjs/runtime/native/conditions/attributes.js +42 -0
  101. package/dist/commonjs/runtime/native/conditions/attributes.js.map +1 -0
  102. package/dist/commonjs/runtime/native/conditions/container-query.js +123 -0
  103. package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -0
  104. package/dist/commonjs/runtime/native/conditions/guards.js +33 -0
  105. package/dist/commonjs/runtime/native/conditions/guards.js.map +1 -0
  106. package/dist/commonjs/runtime/native/conditions/index.js +40 -0
  107. package/dist/commonjs/runtime/native/conditions/index.js.map +1 -0
  108. package/dist/commonjs/runtime/native/conditions/media-query.js +98 -0
  109. package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -0
  110. package/dist/commonjs/runtime/native/index.js +28 -0
  111. package/dist/commonjs/runtime/native/index.js.map +1 -0
  112. package/dist/commonjs/runtime/native/injection.js +100 -0
  113. package/dist/commonjs/runtime/native/injection.js.map +1 -0
  114. package/dist/commonjs/runtime/native/metro.js +6 -0
  115. package/dist/commonjs/runtime/native/metro.js.map +1 -0
  116. package/dist/commonjs/runtime/native/react/interaction.js +63 -0
  117. package/dist/commonjs/runtime/native/react/interaction.js.map +1 -0
  118. package/dist/commonjs/runtime/native/react/rules.js +255 -0
  119. package/dist/commonjs/runtime/native/react/rules.js.map +1 -0
  120. package/dist/commonjs/runtime/native/react/useNativeCss.js +159 -0
  121. package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -0
  122. package/dist/commonjs/runtime/native/react/usePassthrough.js +50 -0
  123. package/dist/commonjs/runtime/native/react/usePassthrough.js.map +1 -0
  124. package/dist/commonjs/runtime/native/reactivity.js +178 -0
  125. package/dist/commonjs/runtime/native/reactivity.js.map +1 -0
  126. package/dist/commonjs/runtime/native/reanimated.js +17 -0
  127. package/dist/commonjs/runtime/native/reanimated.js.map +1 -0
  128. package/dist/commonjs/runtime/native/root.js +28 -0
  129. package/dist/commonjs/runtime/native/root.js.map +1 -0
  130. package/dist/commonjs/runtime/native/styles/calculate-props.js +148 -0
  131. package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -0
  132. package/dist/commonjs/runtime/native/styles/constants.js +9 -0
  133. package/dist/commonjs/runtime/native/styles/constants.js.map +1 -0
  134. package/dist/commonjs/runtime/native/styles/defaults.js +69 -0
  135. package/dist/commonjs/runtime/native/styles/defaults.js.map +1 -0
  136. package/dist/commonjs/runtime/native/styles/functions/animation-timing.js +34 -0
  137. package/dist/commonjs/runtime/native/styles/functions/animation-timing.js.map +1 -0
  138. package/dist/commonjs/runtime/native/styles/functions/calc.js +125 -0
  139. package/dist/commonjs/runtime/native/styles/functions/calc.js.map +1 -0
  140. package/dist/commonjs/runtime/native/styles/functions/filters.js +84 -0
  141. package/dist/commonjs/runtime/native/styles/functions/filters.js.map +1 -0
  142. package/dist/commonjs/runtime/native/styles/functions/index.js +61 -0
  143. package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -0
  144. package/dist/commonjs/runtime/native/styles/functions/platform-functions.js +46 -0
  145. package/dist/commonjs/runtime/native/styles/functions/platform-functions.js.map +1 -0
  146. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js +121 -0
  147. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js.map +1 -0
  148. package/dist/commonjs/runtime/native/styles/index.js +115 -0
  149. package/dist/commonjs/runtime/native/styles/index.js.map +1 -0
  150. package/dist/commonjs/runtime/native/styles/resolve.js +106 -0
  151. package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -0
  152. package/dist/commonjs/runtime/native/styles/shorthands/_handler.js +79 -0
  153. package/dist/commonjs/runtime/native/styles/shorthands/_handler.js.map +1 -0
  154. package/dist/commonjs/runtime/native/styles/shorthands/animation.js +57 -0
  155. package/dist/commonjs/runtime/native/styles/shorthands/animation.js.map +1 -0
  156. package/dist/commonjs/runtime/native/styles/shorthands/border.js +12 -0
  157. package/dist/commonjs/runtime/native/styles/shorthands/border.js.map +1 -0
  158. package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js +40 -0
  159. package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
  160. package/dist/commonjs/runtime/native/styles/shorthands/index.js +61 -0
  161. package/dist/commonjs/runtime/native/styles/shorthands/index.js.map +1 -0
  162. package/dist/commonjs/runtime/native/styles/shorthands/text-shadow.js +13 -0
  163. package/dist/commonjs/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
  164. package/dist/commonjs/runtime/native/styles/shorthands/transform.js +23 -0
  165. package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -0
  166. package/dist/commonjs/runtime/native/styles/units.js +52 -0
  167. package/dist/commonjs/runtime/native/styles/units.js.map +1 -0
  168. package/dist/commonjs/runtime/native/styles/variables.js +79 -0
  169. package/dist/commonjs/runtime/native/styles/variables.js.map +1 -0
  170. package/dist/commonjs/runtime/runtime.js +17 -0
  171. package/dist/commonjs/runtime/runtime.js.map +1 -0
  172. package/dist/commonjs/runtime/runtime.native.js +17 -0
  173. package/dist/commonjs/runtime/runtime.native.js.map +1 -0
  174. package/dist/commonjs/runtime/runtime.types.js +6 -0
  175. package/dist/commonjs/runtime/runtime.types.js.map +1 -0
  176. package/dist/commonjs/runtime/utils/components.js +18 -0
  177. package/dist/commonjs/runtime/utils/components.js.map +1 -0
  178. package/dist/commonjs/runtime/utils/dot-notation.types.js +2 -0
  179. package/dist/commonjs/runtime/utils/dot-notation.types.js.map +1 -0
  180. package/dist/commonjs/runtime/utils/index.js +61 -0
  181. package/dist/commonjs/runtime/utils/index.js.map +1 -0
  182. package/dist/commonjs/runtime/utils/objects.js +92 -0
  183. package/dist/commonjs/runtime/utils/objects.js.map +1 -0
  184. package/dist/commonjs/runtime/utils/specificity.js +44 -0
  185. package/dist/commonjs/runtime/utils/specificity.js.map +1 -0
  186. package/dist/commonjs/runtime/utils/style-value.js +21 -0
  187. package/dist/commonjs/runtime/utils/style-value.js.map +1 -0
  188. package/dist/commonjs/runtime/utils/utils.types.js +6 -0
  189. package/dist/commonjs/runtime/utils/utils.types.js.map +1 -0
  190. package/dist/commonjs/runtime/web/api.js +68 -0
  191. package/dist/commonjs/runtime/web/api.js.map +1 -0
  192. package/dist/commonjs/runtime/web/assign-style.js +27 -0
  193. package/dist/commonjs/runtime/web/assign-style.js.map +1 -0
  194. package/dist/commonjs/runtime/web/index.js +18 -0
  195. package/dist/commonjs/runtime/web/index.js.map +1 -0
  196. package/dist/commonjs/runtime/web/metro.js +6 -0
  197. package/dist/commonjs/runtime/web/metro.js.map +1 -0
  198. package/dist/module/babel/allowedModules.js +19 -0
  199. package/dist/module/babel/allowedModules.js.map +1 -0
  200. package/dist/module/babel/helpers.js +21 -0
  201. package/dist/module/babel/helpers.js.map +1 -0
  202. package/dist/module/babel/import-plugin.js +97 -0
  203. package/dist/module/babel/import-plugin.js.map +1 -0
  204. package/dist/module/babel/index.js +9 -0
  205. package/dist/module/babel/index.js.map +1 -0
  206. package/dist/module/babel/react-native-web.js +112 -0
  207. package/dist/module/babel/react-native-web.js.map +1 -0
  208. package/dist/module/babel/react-native.js +112 -0
  209. package/dist/module/babel/react-native.js.map +1 -0
  210. package/dist/module/compiler/atRules.js +110 -0
  211. package/dist/module/compiler/atRules.js.map +1 -0
  212. package/dist/module/compiler/compiler.js +276 -0
  213. package/dist/module/compiler/compiler.js.map +1 -0
  214. package/dist/module/compiler/compiler.types.js +60 -0
  215. package/dist/module/compiler/compiler.types.js.map +1 -0
  216. package/dist/module/compiler/container-query.js +59 -0
  217. package/dist/module/compiler/container-query.js.map +1 -0
  218. package/dist/module/compiler/declarations.js +2091 -0
  219. package/dist/module/compiler/declarations.js.map +1 -0
  220. package/dist/module/compiler/functions-web.js +32 -0
  221. package/dist/module/compiler/functions-web.js.map +1 -0
  222. package/dist/module/compiler/functions.js +47 -0
  223. package/dist/module/compiler/functions.js.map +1 -0
  224. package/dist/module/compiler/index.js +9 -0
  225. package/dist/module/compiler/index.js.map +1 -0
  226. package/dist/module/compiler/inheritance.test.js +78 -0
  227. package/dist/module/compiler/inheritance.test.js.map +1 -0
  228. package/dist/module/compiler/keyframes.js +54 -0
  229. package/dist/module/compiler/keyframes.js.map +1 -0
  230. package/dist/module/compiler/media-query.js +166 -0
  231. package/dist/module/compiler/media-query.js.map +1 -0
  232. package/dist/module/compiler/pseudo-elements.js +44 -0
  233. package/dist/module/compiler/pseudo-elements.js.map +1 -0
  234. package/dist/module/compiler/selector-builder.js +496 -0
  235. package/dist/module/compiler/selector-builder.js.map +1 -0
  236. package/dist/module/compiler/selectors.js +409 -0
  237. package/dist/module/compiler/selectors.js.map +1 -0
  238. package/dist/module/compiler/split-by-delimiter.js +17 -0
  239. package/dist/module/compiler/split-by-delimiter.js.map +1 -0
  240. package/dist/module/compiler/stylesheet.js +471 -0
  241. package/dist/module/compiler/stylesheet.js.map +1 -0
  242. package/dist/module/compiler/supports.js +23 -0
  243. package/dist/module/compiler/supports.js.map +1 -0
  244. package/dist/module/components/ActivityIndicator.js +17 -0
  245. package/dist/module/components/ActivityIndicator.js.map +1 -0
  246. package/dist/module/components/Button.js +17 -0
  247. package/dist/module/components/Button.js.map +1 -0
  248. package/dist/module/components/FlatList.js +14 -0
  249. package/dist/module/components/FlatList.js.map +1 -0
  250. package/dist/module/components/Image.js +12 -0
  251. package/dist/module/components/Image.js.map +1 -0
  252. package/dist/module/components/Switch.js +12 -0
  253. package/dist/module/components/Switch.js.map +1 -0
  254. package/dist/module/components/Text.js +12 -0
  255. package/dist/module/components/Text.js.map +1 -0
  256. package/dist/module/components/TextInput.js +12 -0
  257. package/dist/module/components/TextInput.js.map +1 -0
  258. package/dist/module/components/View.js +12 -0
  259. package/dist/module/components/View.js.map +1 -0
  260. package/dist/module/components/index.js +12 -0
  261. package/dist/module/components/index.js.map +1 -0
  262. package/dist/module/doctor/index.js +4 -0
  263. package/dist/module/doctor/index.js.map +1 -0
  264. package/dist/module/index.js +5 -0
  265. package/dist/module/index.js.map +1 -0
  266. package/dist/module/jest/expect.d.js +2 -0
  267. package/dist/module/jest/expect.d.js.map +1 -0
  268. package/dist/module/jest/index.js +50 -0
  269. package/dist/module/jest/index.js.map +1 -0
  270. package/dist/module/jest/setup.js +3 -0
  271. package/dist/module/jest/setup.js.map +1 -0
  272. package/dist/module/jest/setupAfterEnv.js +15 -0
  273. package/dist/module/jest/setupAfterEnv.js.map +1 -0
  274. package/dist/module/metro/index.js +161 -0
  275. package/dist/module/metro/index.js.map +1 -0
  276. package/dist/module/metro/injection-code.js +27 -0
  277. package/dist/module/metro/injection-code.js.map +1 -0
  278. package/dist/module/metro/metro-transformer.js +17 -0
  279. package/dist/module/metro/metro-transformer.js.map +1 -0
  280. package/dist/module/metro/picocolors.js +67 -0
  281. package/dist/module/metro/picocolors.js.map +1 -0
  282. package/dist/module/metro/resolver.js +57 -0
  283. package/dist/module/metro/resolver.js.map +1 -0
  284. package/dist/module/metro/stringify.js +55 -0
  285. package/dist/module/metro/stringify.js.map +1 -0
  286. package/dist/module/metro/typescript.js +42 -0
  287. package/dist/module/metro/typescript.js.map +1 -0
  288. package/dist/module/package.json +1 -0
  289. package/dist/module/poison.pill.js +37 -0
  290. package/dist/module/poison.pill.js.map +1 -0
  291. package/dist/module/runtime/index.js +9 -0
  292. package/dist/module/runtime/index.js.map +1 -0
  293. package/dist/module/runtime/native/api.js +75 -0
  294. package/dist/module/runtime/native/api.js.map +1 -0
  295. package/dist/module/runtime/native/conditions/attributes.js +38 -0
  296. package/dist/module/runtime/native/conditions/attributes.js.map +1 -0
  297. package/dist/module/runtime/native/conditions/container-query.js +117 -0
  298. package/dist/module/runtime/native/conditions/container-query.js.map +1 -0
  299. package/dist/module/runtime/native/conditions/guards.js +29 -0
  300. package/dist/module/runtime/native/conditions/guards.js.map +1 -0
  301. package/dist/module/runtime/native/conditions/index.js +36 -0
  302. package/dist/module/runtime/native/conditions/index.js.map +1 -0
  303. package/dist/module/runtime/native/conditions/media-query.js +93 -0
  304. package/dist/module/runtime/native/conditions/media-query.js.map +1 -0
  305. package/dist/module/runtime/native/index.js +5 -0
  306. package/dist/module/runtime/native/index.js.map +1 -0
  307. package/dist/module/runtime/native/injection.js +95 -0
  308. package/dist/module/runtime/native/injection.js.map +1 -0
  309. package/dist/module/runtime/native/metro.js +5 -0
  310. package/dist/module/runtime/native/metro.js.map +1 -0
  311. package/dist/module/runtime/native/react/interaction.js +59 -0
  312. package/dist/module/runtime/native/react/interaction.js.map +1 -0
  313. package/dist/module/runtime/native/react/rules.js +248 -0
  314. package/dist/module/runtime/native/react/rules.js.map +1 -0
  315. package/dist/module/runtime/native/react/useNativeCss.js +153 -0
  316. package/dist/module/runtime/native/react/useNativeCss.js.map +1 -0
  317. package/dist/module/runtime/native/react/usePassthrough.js +45 -0
  318. package/dist/module/runtime/native/react/usePassthrough.js.map +1 -0
  319. package/dist/module/runtime/native/reactivity.js +166 -0
  320. package/dist/module/runtime/native/reactivity.js.map +1 -0
  321. package/dist/module/runtime/native/reanimated.js +13 -0
  322. package/dist/module/runtime/native/reanimated.js.map +1 -0
  323. package/dist/module/runtime/native/root.js +24 -0
  324. package/dist/module/runtime/native/root.js.map +1 -0
  325. package/dist/module/runtime/native/styles/calculate-props.js +143 -0
  326. package/dist/module/runtime/native/styles/calculate-props.js.map +1 -0
  327. package/dist/module/runtime/native/styles/constants.js +5 -0
  328. package/dist/module/runtime/native/styles/constants.js.map +1 -0
  329. package/dist/module/runtime/native/styles/defaults.js +65 -0
  330. package/dist/module/runtime/native/styles/defaults.js.map +1 -0
  331. package/dist/module/runtime/native/styles/functions/animation-timing.js +30 -0
  332. package/dist/module/runtime/native/styles/functions/animation-timing.js.map +1 -0
  333. package/dist/module/runtime/native/styles/functions/calc.js +120 -0
  334. package/dist/module/runtime/native/styles/functions/calc.js.map +1 -0
  335. package/dist/module/runtime/native/styles/functions/filters.js +70 -0
  336. package/dist/module/runtime/native/styles/functions/filters.js.map +1 -0
  337. package/dist/module/runtime/native/styles/functions/index.js +8 -0
  338. package/dist/module/runtime/native/styles/functions/index.js.map +1 -0
  339. package/dist/module/runtime/native/styles/functions/platform-functions.js +36 -0
  340. package/dist/module/runtime/native/styles/functions/platform-functions.js.map +1 -0
  341. package/dist/module/runtime/native/styles/functions/transform-functions.js +114 -0
  342. package/dist/module/runtime/native/styles/functions/transform-functions.js.map +1 -0
  343. package/dist/module/runtime/native/styles/index.js +110 -0
  344. package/dist/module/runtime/native/styles/index.js.map +1 -0
  345. package/dist/module/runtime/native/styles/resolve.js +101 -0
  346. package/dist/module/runtime/native/styles/resolve.js.map +1 -0
  347. package/dist/module/runtime/native/styles/shorthands/_handler.js +74 -0
  348. package/dist/module/runtime/native/styles/shorthands/_handler.js.map +1 -0
  349. package/dist/module/runtime/native/styles/shorthands/animation.js +51 -0
  350. package/dist/module/runtime/native/styles/shorthands/animation.js.map +1 -0
  351. package/dist/module/runtime/native/styles/shorthands/border.js +8 -0
  352. package/dist/module/runtime/native/styles/shorthands/border.js.map +1 -0
  353. package/dist/module/runtime/native/styles/shorthands/box-shadow.js +35 -0
  354. package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
  355. package/dist/module/runtime/native/styles/shorthands/index.js +8 -0
  356. package/dist/module/runtime/native/styles/shorthands/index.js.map +1 -0
  357. package/dist/module/runtime/native/styles/shorthands/text-shadow.js +9 -0
  358. package/dist/module/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
  359. package/dist/module/runtime/native/styles/shorthands/transform.js +18 -0
  360. package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -0
  361. package/dist/module/runtime/native/styles/units.js +43 -0
  362. package/dist/module/runtime/native/styles/units.js.map +1 -0
  363. package/dist/module/runtime/native/styles/variables.js +75 -0
  364. package/dist/module/runtime/native/styles/variables.js.map +1 -0
  365. package/dist/module/runtime/runtime.js +4 -0
  366. package/dist/module/runtime/runtime.js.map +1 -0
  367. package/dist/module/runtime/runtime.native.js +4 -0
  368. package/dist/module/runtime/runtime.native.js.map +1 -0
  369. package/dist/module/runtime/runtime.types.js +4 -0
  370. package/dist/module/runtime/runtime.types.js.map +1 -0
  371. package/dist/module/runtime/utils/components.js +14 -0
  372. package/dist/module/runtime/utils/components.js.map +1 -0
  373. package/dist/module/runtime/utils/dot-notation.types.js +2 -0
  374. package/dist/module/runtime/utils/dot-notation.types.js.map +1 -0
  375. package/dist/module/runtime/utils/index.js +8 -0
  376. package/dist/module/runtime/utils/index.js.map +1 -0
  377. package/dist/module/runtime/utils/objects.js +84 -0
  378. package/dist/module/runtime/utils/objects.js.map +1 -0
  379. package/dist/module/runtime/utils/specificity.js +39 -0
  380. package/dist/module/runtime/utils/specificity.js.map +1 -0
  381. package/dist/module/runtime/utils/style-value.js +16 -0
  382. package/dist/module/runtime/utils/style-value.js.map +1 -0
  383. package/dist/module/runtime/utils/utils.types.js +4 -0
  384. package/dist/module/runtime/utils/utils.types.js.map +1 -0
  385. package/dist/module/runtime/web/api.js +59 -0
  386. package/dist/module/runtime/web/api.js.map +1 -0
  387. package/dist/module/runtime/web/assign-style.js +23 -0
  388. package/dist/module/runtime/web/assign-style.js.map +1 -0
  389. package/dist/module/runtime/web/index.js +6 -0
  390. package/dist/module/runtime/web/index.js.map +1 -0
  391. package/dist/module/runtime/web/metro.js +5 -0
  392. package/dist/module/runtime/web/metro.js.map +1 -0
  393. package/dist/typescript/commonjs/example/app.config.d.ts +4 -0
  394. package/dist/typescript/commonjs/example/app.config.d.ts.map +1 -0
  395. package/dist/typescript/commonjs/example/src/App.d.ts +3 -0
  396. package/dist/typescript/commonjs/example/src/App.d.ts.map +1 -0
  397. package/dist/typescript/commonjs/package.json +1 -0
  398. package/dist/typescript/commonjs/src/babel/allowedModules.d.ts +2 -0
  399. package/dist/typescript/commonjs/src/babel/allowedModules.d.ts.map +1 -0
  400. package/dist/typescript/commonjs/src/babel/helpers.d.ts +13 -0
  401. package/dist/typescript/commonjs/src/babel/helpers.d.ts.map +1 -0
  402. package/dist/typescript/commonjs/src/babel/import-plugin.d.ts +6 -0
  403. package/dist/typescript/commonjs/src/babel/import-plugin.d.ts.map +1 -0
  404. package/dist/typescript/commonjs/src/babel/index.d.ts +1 -0
  405. package/dist/typescript/commonjs/src/babel/index.d.ts.map +1 -0
  406. package/dist/typescript/commonjs/src/babel/react-native-web.d.ts +8 -0
  407. package/dist/typescript/commonjs/src/babel/react-native-web.d.ts.map +1 -0
  408. package/dist/typescript/commonjs/src/babel/react-native.d.ts +8 -0
  409. package/dist/typescript/commonjs/src/babel/react-native.d.ts.map +1 -0
  410. package/dist/typescript/commonjs/src/compiler/atRules.d.ts +34 -0
  411. package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -0
  412. package/dist/typescript/commonjs/src/compiler/compiler.d.ts +17 -0
  413. package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -0
  414. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +197 -0
  415. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -0
  416. package/dist/typescript/commonjs/src/compiler/container-query.d.ts +5 -0
  417. package/dist/typescript/commonjs/src/compiler/container-query.d.ts.map +1 -0
  418. package/dist/typescript/commonjs/src/compiler/declarations.d.ts +118 -0
  419. package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -0
  420. package/dist/typescript/commonjs/src/compiler/functions-web.d.ts +11 -0
  421. package/dist/typescript/commonjs/src/compiler/functions-web.d.ts.map +1 -0
  422. package/dist/typescript/commonjs/src/compiler/functions.d.ts +11 -0
  423. package/dist/typescript/commonjs/src/compiler/functions.d.ts.map +1 -0
  424. package/dist/typescript/commonjs/src/compiler/index.d.ts +7 -0
  425. package/dist/typescript/commonjs/src/compiler/index.d.ts.map +1 -0
  426. package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts +2 -0
  427. package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts.map +1 -0
  428. package/dist/typescript/commonjs/src/compiler/keyframes.d.ts +7 -0
  429. package/dist/typescript/commonjs/src/compiler/keyframes.d.ts.map +1 -0
  430. package/dist/typescript/commonjs/src/compiler/media-query.d.ts +7 -0
  431. package/dist/typescript/commonjs/src/compiler/media-query.d.ts.map +1 -0
  432. package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts +4 -0
  433. package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts.map +1 -0
  434. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +24 -0
  435. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -0
  436. package/dist/typescript/commonjs/src/compiler/selectors.d.ts +24 -0
  437. package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -0
  438. package/dist/typescript/commonjs/src/compiler/split-by-delimiter.d.ts +2 -0
  439. package/dist/typescript/commonjs/src/compiler/split-by-delimiter.d.ts.map +1 -0
  440. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +68 -0
  441. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -0
  442. package/dist/typescript/commonjs/src/compiler/supports.d.ts +3 -0
  443. package/dist/typescript/commonjs/src/compiler/supports.d.ts.map +1 -0
  444. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +13 -0
  445. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -0
  446. package/dist/typescript/commonjs/src/components/Button.d.ts +13 -0
  447. package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -0
  448. package/dist/typescript/commonjs/src/components/FlatList.d.ts +10 -0
  449. package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -0
  450. package/dist/typescript/commonjs/src/components/Image.d.ts +8 -0
  451. package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -0
  452. package/dist/typescript/commonjs/src/components/Switch.d.ts +8 -0
  453. package/dist/typescript/commonjs/src/components/Switch.d.ts.map +1 -0
  454. package/dist/typescript/commonjs/src/components/Text.d.ts +8 -0
  455. package/dist/typescript/commonjs/src/components/Text.d.ts.map +1 -0
  456. package/dist/typescript/commonjs/src/components/TextInput.d.ts +8 -0
  457. package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -0
  458. package/dist/typescript/commonjs/src/components/View.d.ts +8 -0
  459. package/dist/typescript/commonjs/src/components/View.d.ts.map +1 -0
  460. package/dist/typescript/commonjs/src/components/index.d.ts +10 -0
  461. package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -0
  462. package/dist/typescript/commonjs/src/doctor/index.d.ts +2 -0
  463. package/dist/typescript/commonjs/src/doctor/index.d.ts.map +1 -0
  464. package/dist/typescript/commonjs/src/index.d.ts +3 -0
  465. package/dist/typescript/commonjs/src/index.d.ts.map +1 -0
  466. package/dist/typescript/commonjs/src/jest/index.d.ts +30 -0
  467. package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -0
  468. package/dist/typescript/commonjs/src/jest/setup.d.ts +1 -0
  469. package/dist/typescript/commonjs/src/jest/setup.d.ts.map +1 -0
  470. package/dist/typescript/commonjs/src/jest/setupAfterEnv.d.ts +1 -0
  471. package/dist/typescript/commonjs/src/jest/setupAfterEnv.d.ts.map +1 -0
  472. package/dist/typescript/commonjs/src/metro/index.d.ts +11 -0
  473. package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -0
  474. package/dist/typescript/commonjs/src/metro/injection-code.d.ts +16 -0
  475. package/dist/typescript/commonjs/src/metro/injection-code.d.ts.map +1 -0
  476. package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +3 -0
  477. package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -0
  478. package/dist/typescript/commonjs/src/metro/picocolors.d.ts +27 -0
  479. package/dist/typescript/commonjs/src/metro/picocolors.d.ts.map +1 -0
  480. package/dist/typescript/commonjs/src/metro/resolver.d.ts +4 -0
  481. package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -0
  482. package/dist/typescript/commonjs/src/metro/stringify.d.ts +7 -0
  483. package/dist/typescript/commonjs/src/metro/stringify.d.ts.map +1 -0
  484. package/dist/typescript/commonjs/src/metro/typescript.d.ts +2 -0
  485. package/dist/typescript/commonjs/src/metro/typescript.d.ts.map +1 -0
  486. package/dist/typescript/commonjs/src/poison.pill.d.ts +2 -0
  487. package/dist/typescript/commonjs/src/poison.pill.d.ts.map +1 -0
  488. package/dist/typescript/commonjs/src/runtime/index.d.ts +7 -0
  489. package/dist/typescript/commonjs/src/runtime/index.d.ts.map +1 -0
  490. package/dist/typescript/commonjs/src/runtime/native/api.d.ts +17 -0
  491. package/dist/typescript/commonjs/src/runtime/native/api.d.ts.map +1 -0
  492. package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts +5 -0
  493. package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts.map +1 -0
  494. package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts +7 -0
  495. package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -0
  496. package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts +5 -0
  497. package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts.map +1 -0
  498. package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts +6 -0
  499. package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts.map +1 -0
  500. package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts +4 -0
  501. package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts.map +1 -0
  502. package/dist/typescript/commonjs/src/runtime/native/index.d.ts +4 -0
  503. package/dist/typescript/commonjs/src/runtime/native/index.d.ts.map +1 -0
  504. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts +16 -0
  505. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +1 -0
  506. package/dist/typescript/commonjs/src/runtime/native/metro.d.ts +2 -0
  507. package/dist/typescript/commonjs/src/runtime/native/metro.d.ts.map +1 -0
  508. package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts +6 -0
  509. package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts.map +1 -0
  510. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts +7 -0
  511. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts.map +1 -0
  512. package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts +38 -0
  513. package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts.map +1 -0
  514. package/dist/typescript/commonjs/src/runtime/native/react/usePassthrough.d.ts +4 -0
  515. package/dist/typescript/commonjs/src/runtime/native/react/usePassthrough.d.ts.map +1 -0
  516. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +55 -0
  517. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -0
  518. package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts +5 -0
  519. package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts.map +1 -0
  520. package/dist/typescript/commonjs/src/runtime/native/root.d.ts +11 -0
  521. package/dist/typescript/commonjs/src/runtime/native/root.d.ts.map +1 -0
  522. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts +10 -0
  523. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -0
  524. package/dist/typescript/commonjs/src/runtime/native/styles/constants.d.ts +3 -0
  525. package/dist/typescript/commonjs/src/runtime/native/styles/constants.d.ts.map +1 -0
  526. package/dist/typescript/commonjs/src/runtime/native/styles/defaults.d.ts +3 -0
  527. package/dist/typescript/commonjs/src/runtime/native/styles/defaults.d.ts.map +1 -0
  528. package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
  529. package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
  530. package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts +3 -0
  531. package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
  532. package/dist/typescript/commonjs/src/runtime/native/styles/functions/filters.d.ts +12 -0
  533. package/dist/typescript/commonjs/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
  534. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts +6 -0
  535. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -0
  536. package/dist/typescript/commonjs/src/runtime/native/styles/functions/platform-functions.d.ts +8 -0
  537. package/dist/typescript/commonjs/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
  538. package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
  539. package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
  540. package/dist/typescript/commonjs/src/runtime/native/styles/index.d.ts +19 -0
  541. package/dist/typescript/commonjs/src/runtime/native/styles/index.d.ts.map +1 -0
  542. package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts +18 -0
  543. package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -0
  544. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/_handler.d.ts +11 -0
  545. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
  546. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
  547. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
  548. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts +2 -0
  549. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
  550. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
  551. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
  552. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts +6 -0
  553. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
  554. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
  555. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
  556. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.d.ts +7 -0
  557. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
  558. package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts +6 -0
  559. package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts.map +1 -0
  560. package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts +5 -0
  561. package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -0
  562. package/dist/typescript/commonjs/src/runtime/runtime.d.ts +2 -0
  563. package/dist/typescript/commonjs/src/runtime/runtime.d.ts.map +1 -0
  564. package/dist/typescript/commonjs/src/runtime/runtime.native.d.ts +2 -0
  565. package/dist/typescript/commonjs/src/runtime/runtime.native.d.ts.map +1 -0
  566. package/dist/typescript/commonjs/src/runtime/runtime.types.d.ts +47 -0
  567. package/dist/typescript/commonjs/src/runtime/runtime.types.d.ts.map +1 -0
  568. package/dist/typescript/commonjs/src/runtime/utils/components.d.ts +2 -0
  569. package/dist/typescript/commonjs/src/runtime/utils/components.d.ts.map +1 -0
  570. package/dist/typescript/commonjs/src/runtime/utils/dot-notation.types.d.ts +23 -0
  571. package/dist/typescript/commonjs/src/runtime/utils/dot-notation.types.d.ts.map +1 -0
  572. package/dist/typescript/commonjs/src/runtime/utils/index.d.ts +6 -0
  573. package/dist/typescript/commonjs/src/runtime/utils/index.d.ts.map +1 -0
  574. package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts +5 -0
  575. package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -0
  576. package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts +13 -0
  577. package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts.map +1 -0
  578. package/dist/typescript/commonjs/src/runtime/utils/style-value.d.ts +4 -0
  579. package/dist/typescript/commonjs/src/runtime/utils/style-value.d.ts.map +1 -0
  580. package/dist/typescript/commonjs/src/runtime/utils/utils.types.d.ts +5 -0
  581. package/dist/typescript/commonjs/src/runtime/utils/utils.types.d.ts.map +1 -0
  582. package/dist/typescript/commonjs/src/runtime/web/api.d.ts +10 -0
  583. package/dist/typescript/commonjs/src/runtime/web/api.d.ts.map +1 -0
  584. package/dist/typescript/commonjs/src/runtime/web/assign-style.d.ts +2 -0
  585. package/dist/typescript/commonjs/src/runtime/web/assign-style.d.ts.map +1 -0
  586. package/dist/typescript/commonjs/src/runtime/web/index.d.ts +4 -0
  587. package/dist/typescript/commonjs/src/runtime/web/index.d.ts.map +1 -0
  588. package/dist/typescript/commonjs/src/runtime/web/metro.d.ts +2 -0
  589. package/dist/typescript/commonjs/src/runtime/web/metro.d.ts.map +1 -0
  590. package/dist/typescript/module/example/app.config.d.ts +4 -0
  591. package/dist/typescript/module/example/app.config.d.ts.map +1 -0
  592. package/dist/typescript/module/example/src/App.d.ts +3 -0
  593. package/dist/typescript/module/example/src/App.d.ts.map +1 -0
  594. package/dist/typescript/module/package.json +1 -0
  595. package/dist/typescript/module/src/babel/allowedModules.d.ts +2 -0
  596. package/dist/typescript/module/src/babel/allowedModules.d.ts.map +1 -0
  597. package/dist/typescript/module/src/babel/helpers.d.ts +13 -0
  598. package/dist/typescript/module/src/babel/helpers.d.ts.map +1 -0
  599. package/dist/typescript/module/src/babel/import-plugin.d.ts +6 -0
  600. package/dist/typescript/module/src/babel/import-plugin.d.ts.map +1 -0
  601. package/dist/typescript/module/src/babel/index.d.ts +1 -0
  602. package/dist/typescript/module/src/babel/index.d.ts.map +1 -0
  603. package/dist/typescript/module/src/babel/react-native-web.d.ts +8 -0
  604. package/dist/typescript/module/src/babel/react-native-web.d.ts.map +1 -0
  605. package/dist/typescript/module/src/babel/react-native.d.ts +8 -0
  606. package/dist/typescript/module/src/babel/react-native.d.ts.map +1 -0
  607. package/dist/typescript/module/src/compiler/atRules.d.ts +34 -0
  608. package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -0
  609. package/dist/typescript/module/src/compiler/compiler.d.ts +17 -0
  610. package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -0
  611. package/dist/typescript/module/src/compiler/compiler.types.d.ts +197 -0
  612. package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -0
  613. package/dist/typescript/module/src/compiler/container-query.d.ts +5 -0
  614. package/dist/typescript/module/src/compiler/container-query.d.ts.map +1 -0
  615. package/dist/typescript/module/src/compiler/declarations.d.ts +118 -0
  616. package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -0
  617. package/dist/typescript/module/src/compiler/functions-web.d.ts +11 -0
  618. package/dist/typescript/module/src/compiler/functions-web.d.ts.map +1 -0
  619. package/dist/typescript/module/src/compiler/functions.d.ts +11 -0
  620. package/dist/typescript/module/src/compiler/functions.d.ts.map +1 -0
  621. package/dist/typescript/module/src/compiler/index.d.ts +7 -0
  622. package/dist/typescript/module/src/compiler/index.d.ts.map +1 -0
  623. package/dist/typescript/module/src/compiler/inheritance.test.d.ts +2 -0
  624. package/dist/typescript/module/src/compiler/inheritance.test.d.ts.map +1 -0
  625. package/dist/typescript/module/src/compiler/keyframes.d.ts +7 -0
  626. package/dist/typescript/module/src/compiler/keyframes.d.ts.map +1 -0
  627. package/dist/typescript/module/src/compiler/media-query.d.ts +7 -0
  628. package/dist/typescript/module/src/compiler/media-query.d.ts.map +1 -0
  629. package/dist/typescript/module/src/compiler/pseudo-elements.d.ts +4 -0
  630. package/dist/typescript/module/src/compiler/pseudo-elements.d.ts.map +1 -0
  631. package/dist/typescript/module/src/compiler/selector-builder.d.ts +24 -0
  632. package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -0
  633. package/dist/typescript/module/src/compiler/selectors.d.ts +24 -0
  634. package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -0
  635. package/dist/typescript/module/src/compiler/split-by-delimiter.d.ts +2 -0
  636. package/dist/typescript/module/src/compiler/split-by-delimiter.d.ts.map +1 -0
  637. package/dist/typescript/module/src/compiler/stylesheet.d.ts +68 -0
  638. package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -0
  639. package/dist/typescript/module/src/compiler/supports.d.ts +3 -0
  640. package/dist/typescript/module/src/compiler/supports.d.ts.map +1 -0
  641. package/dist/typescript/module/src/components/ActivityIndicator.d.ts +13 -0
  642. package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -0
  643. package/dist/typescript/module/src/components/Button.d.ts +13 -0
  644. package/dist/typescript/module/src/components/Button.d.ts.map +1 -0
  645. package/dist/typescript/module/src/components/FlatList.d.ts +10 -0
  646. package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -0
  647. package/dist/typescript/module/src/components/Image.d.ts +8 -0
  648. package/dist/typescript/module/src/components/Image.d.ts.map +1 -0
  649. package/dist/typescript/module/src/components/Switch.d.ts +8 -0
  650. package/dist/typescript/module/src/components/Switch.d.ts.map +1 -0
  651. package/dist/typescript/module/src/components/Text.d.ts +8 -0
  652. package/dist/typescript/module/src/components/Text.d.ts.map +1 -0
  653. package/dist/typescript/module/src/components/TextInput.d.ts +8 -0
  654. package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -0
  655. package/dist/typescript/module/src/components/View.d.ts +8 -0
  656. package/dist/typescript/module/src/components/View.d.ts.map +1 -0
  657. package/dist/typescript/module/src/components/index.d.ts +10 -0
  658. package/dist/typescript/module/src/components/index.d.ts.map +1 -0
  659. package/dist/typescript/module/src/doctor/index.d.ts +2 -0
  660. package/dist/typescript/module/src/doctor/index.d.ts.map +1 -0
  661. package/dist/typescript/module/src/index.d.ts +3 -0
  662. package/dist/typescript/module/src/index.d.ts.map +1 -0
  663. package/dist/typescript/module/src/jest/index.d.ts +30 -0
  664. package/dist/typescript/module/src/jest/index.d.ts.map +1 -0
  665. package/dist/typescript/module/src/jest/setup.d.ts +1 -0
  666. package/dist/typescript/module/src/jest/setup.d.ts.map +1 -0
  667. package/dist/typescript/module/src/jest/setupAfterEnv.d.ts +1 -0
  668. package/dist/typescript/module/src/jest/setupAfterEnv.d.ts.map +1 -0
  669. package/dist/typescript/module/src/metro/index.d.ts +11 -0
  670. package/dist/typescript/module/src/metro/index.d.ts.map +1 -0
  671. package/dist/typescript/module/src/metro/injection-code.d.ts +16 -0
  672. package/dist/typescript/module/src/metro/injection-code.d.ts.map +1 -0
  673. package/dist/typescript/module/src/metro/metro-transformer.d.ts +3 -0
  674. package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -0
  675. package/dist/typescript/module/src/metro/picocolors.d.ts +27 -0
  676. package/dist/typescript/module/src/metro/picocolors.d.ts.map +1 -0
  677. package/dist/typescript/module/src/metro/resolver.d.ts +4 -0
  678. package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -0
  679. package/dist/typescript/module/src/metro/stringify.d.ts +7 -0
  680. package/dist/typescript/module/src/metro/stringify.d.ts.map +1 -0
  681. package/dist/typescript/module/src/metro/typescript.d.ts +2 -0
  682. package/dist/typescript/module/src/metro/typescript.d.ts.map +1 -0
  683. package/dist/typescript/module/src/poison.pill.d.ts +2 -0
  684. package/dist/typescript/module/src/poison.pill.d.ts.map +1 -0
  685. package/dist/typescript/module/src/runtime/index.d.ts +7 -0
  686. package/dist/typescript/module/src/runtime/index.d.ts.map +1 -0
  687. package/dist/typescript/module/src/runtime/native/api.d.ts +17 -0
  688. package/dist/typescript/module/src/runtime/native/api.d.ts.map +1 -0
  689. package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts +5 -0
  690. package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts.map +1 -0
  691. package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts +7 -0
  692. package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -0
  693. package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts +5 -0
  694. package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts.map +1 -0
  695. package/dist/typescript/module/src/runtime/native/conditions/index.d.ts +6 -0
  696. package/dist/typescript/module/src/runtime/native/conditions/index.d.ts.map +1 -0
  697. package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts +4 -0
  698. package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts.map +1 -0
  699. package/dist/typescript/module/src/runtime/native/index.d.ts +4 -0
  700. package/dist/typescript/module/src/runtime/native/index.d.ts.map +1 -0
  701. package/dist/typescript/module/src/runtime/native/injection.d.ts +16 -0
  702. package/dist/typescript/module/src/runtime/native/injection.d.ts.map +1 -0
  703. package/dist/typescript/module/src/runtime/native/metro.d.ts +2 -0
  704. package/dist/typescript/module/src/runtime/native/metro.d.ts.map +1 -0
  705. package/dist/typescript/module/src/runtime/native/react/interaction.d.ts +6 -0
  706. package/dist/typescript/module/src/runtime/native/react/interaction.d.ts.map +1 -0
  707. package/dist/typescript/module/src/runtime/native/react/rules.d.ts +7 -0
  708. package/dist/typescript/module/src/runtime/native/react/rules.d.ts.map +1 -0
  709. package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts +38 -0
  710. package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts.map +1 -0
  711. package/dist/typescript/module/src/runtime/native/react/usePassthrough.d.ts +4 -0
  712. package/dist/typescript/module/src/runtime/native/react/usePassthrough.d.ts.map +1 -0
  713. package/dist/typescript/module/src/runtime/native/reactivity.d.ts +55 -0
  714. package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -0
  715. package/dist/typescript/module/src/runtime/native/reanimated.d.ts +5 -0
  716. package/dist/typescript/module/src/runtime/native/reanimated.d.ts.map +1 -0
  717. package/dist/typescript/module/src/runtime/native/root.d.ts +11 -0
  718. package/dist/typescript/module/src/runtime/native/root.d.ts.map +1 -0
  719. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts +10 -0
  720. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -0
  721. package/dist/typescript/module/src/runtime/native/styles/constants.d.ts +3 -0
  722. package/dist/typescript/module/src/runtime/native/styles/constants.d.ts.map +1 -0
  723. package/dist/typescript/module/src/runtime/native/styles/defaults.d.ts +3 -0
  724. package/dist/typescript/module/src/runtime/native/styles/defaults.d.ts.map +1 -0
  725. package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
  726. package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
  727. package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts +3 -0
  728. package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
  729. package/dist/typescript/module/src/runtime/native/styles/functions/filters.d.ts +12 -0
  730. package/dist/typescript/module/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
  731. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts +6 -0
  732. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -0
  733. package/dist/typescript/module/src/runtime/native/styles/functions/platform-functions.d.ts +8 -0
  734. package/dist/typescript/module/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
  735. package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
  736. package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
  737. package/dist/typescript/module/src/runtime/native/styles/index.d.ts +19 -0
  738. package/dist/typescript/module/src/runtime/native/styles/index.d.ts.map +1 -0
  739. package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts +18 -0
  740. package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -0
  741. package/dist/typescript/module/src/runtime/native/styles/shorthands/_handler.d.ts +11 -0
  742. package/dist/typescript/module/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
  743. package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
  744. package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
  745. package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts +2 -0
  746. package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
  747. package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
  748. package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
  749. package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts +6 -0
  750. package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
  751. package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
  752. package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
  753. package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.d.ts +7 -0
  754. package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
  755. package/dist/typescript/module/src/runtime/native/styles/units.d.ts +6 -0
  756. package/dist/typescript/module/src/runtime/native/styles/units.d.ts.map +1 -0
  757. package/dist/typescript/module/src/runtime/native/styles/variables.d.ts +5 -0
  758. package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -0
  759. package/dist/typescript/module/src/runtime/runtime.d.ts +2 -0
  760. package/dist/typescript/module/src/runtime/runtime.d.ts.map +1 -0
  761. package/dist/typescript/module/src/runtime/runtime.native.d.ts +2 -0
  762. package/dist/typescript/module/src/runtime/runtime.native.d.ts.map +1 -0
  763. package/dist/typescript/module/src/runtime/runtime.types.d.ts +47 -0
  764. package/dist/typescript/module/src/runtime/runtime.types.d.ts.map +1 -0
  765. package/dist/typescript/module/src/runtime/utils/components.d.ts +2 -0
  766. package/dist/typescript/module/src/runtime/utils/components.d.ts.map +1 -0
  767. package/dist/typescript/module/src/runtime/utils/dot-notation.types.d.ts +23 -0
  768. package/dist/typescript/module/src/runtime/utils/dot-notation.types.d.ts.map +1 -0
  769. package/dist/typescript/module/src/runtime/utils/index.d.ts +6 -0
  770. package/dist/typescript/module/src/runtime/utils/index.d.ts.map +1 -0
  771. package/dist/typescript/module/src/runtime/utils/objects.d.ts +5 -0
  772. package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -0
  773. package/dist/typescript/module/src/runtime/utils/specificity.d.ts +13 -0
  774. package/dist/typescript/module/src/runtime/utils/specificity.d.ts.map +1 -0
  775. package/dist/typescript/module/src/runtime/utils/style-value.d.ts +4 -0
  776. package/dist/typescript/module/src/runtime/utils/style-value.d.ts.map +1 -0
  777. package/dist/typescript/module/src/runtime/utils/utils.types.d.ts +5 -0
  778. package/dist/typescript/module/src/runtime/utils/utils.types.d.ts.map +1 -0
  779. package/dist/typescript/module/src/runtime/web/api.d.ts +10 -0
  780. package/dist/typescript/module/src/runtime/web/api.d.ts.map +1 -0
  781. package/dist/typescript/module/src/runtime/web/assign-style.d.ts +2 -0
  782. package/dist/typescript/module/src/runtime/web/assign-style.d.ts.map +1 -0
  783. package/dist/typescript/module/src/runtime/web/index.d.ts +4 -0
  784. package/dist/typescript/module/src/runtime/web/index.d.ts.map +1 -0
  785. package/dist/typescript/module/src/runtime/web/metro.d.ts +2 -0
  786. package/dist/typescript/module/src/runtime/web/metro.d.ts.map +1 -0
  787. package/package.json +248 -47
  788. package/src/babel/allowedModules.ts +24 -0
  789. package/src/babel/helpers.ts +40 -0
  790. package/src/babel/import-plugin.ts +176 -0
  791. package/src/babel/index.ts +9 -0
  792. package/src/babel/react-native-web.ts +226 -0
  793. package/src/babel/react-native.ts +226 -0
  794. package/src/compiler/atRules.ts +158 -0
  795. package/src/compiler/compiler.ts +305 -0
  796. package/src/compiler/compiler.types.ts +267 -0
  797. package/src/compiler/container-query.ts +97 -0
  798. package/src/compiler/declarations.ts +3177 -0
  799. package/src/compiler/functions-web.ts +44 -0
  800. package/src/compiler/functions.ts +64 -0
  801. package/src/compiler/index.ts +7 -0
  802. package/src/compiler/inheritance.test.ts +121 -0
  803. package/src/compiler/keyframes.ts +86 -0
  804. package/src/compiler/media-query.ts +251 -0
  805. package/src/compiler/pseudo-elements.ts +54 -0
  806. package/src/compiler/selector-builder.ts +586 -0
  807. package/src/compiler/selectors.ts +505 -0
  808. package/src/compiler/split-by-delimiter.ts +19 -0
  809. package/src/compiler/stylesheet.ts +681 -0
  810. package/src/compiler/supports.ts +26 -0
  811. package/src/components/ActivityIndicator.tsx +27 -0
  812. package/src/components/Button.tsx +22 -0
  813. package/src/components/FlatList.tsx +21 -0
  814. package/src/components/Image.tsx +17 -0
  815. package/src/components/Switch.tsx +17 -0
  816. package/src/components/Text.tsx +17 -0
  817. package/src/components/TextInput.tsx +17 -0
  818. package/src/components/View.tsx +17 -0
  819. package/src/components/index.tsx +10 -0
  820. package/src/doctor/index.ts +1 -0
  821. package/src/index.ts +3 -0
  822. package/src/jest/expect.d.ts +1 -0
  823. package/src/jest/index.ts +74 -0
  824. package/src/jest/setup.ts +1 -0
  825. package/src/jest/setupAfterEnv.ts +13 -0
  826. package/src/metro/index.ts +237 -0
  827. package/src/metro/injection-code.ts +38 -0
  828. package/src/metro/metro-transformer.ts +31 -0
  829. package/src/metro/picocolors.ts +77 -0
  830. package/src/metro/resolver.ts +89 -0
  831. package/src/metro/stringify.ts +59 -0
  832. package/src/metro/typescript.ts +73 -0
  833. package/src/poison.pill.ts +36 -0
  834. package/src/runtime/index.ts +7 -0
  835. package/src/runtime/native/api.ts +106 -0
  836. package/src/runtime/native/conditions/attributes.ts +52 -0
  837. package/src/runtime/native/conditions/container-query.ts +162 -0
  838. package/src/runtime/native/conditions/guards.ts +44 -0
  839. package/src/runtime/native/conditions/index.ts +54 -0
  840. package/src/runtime/native/conditions/media-query.ts +98 -0
  841. package/src/runtime/native/index.ts +4 -0
  842. package/src/runtime/native/injection.ts +132 -0
  843. package/src/runtime/native/metro.ts +2 -0
  844. package/src/runtime/native/react/interaction.ts +90 -0
  845. package/src/runtime/native/react/rules.ts +330 -0
  846. package/src/runtime/native/react/useNativeCss.ts +203 -0
  847. package/src/runtime/native/react/usePassthrough.ts +51 -0
  848. package/src/runtime/native/reactivity.ts +243 -0
  849. package/src/runtime/native/reanimated.ts +22 -0
  850. package/src/runtime/native/root.ts +31 -0
  851. package/src/runtime/native/styles/calculate-props.ts +197 -0
  852. package/src/runtime/native/styles/constants.ts +2 -0
  853. package/src/runtime/native/styles/defaults.ts +79 -0
  854. package/src/runtime/native/styles/functions/animation-timing.ts +44 -0
  855. package/src/runtime/native/styles/functions/calc.ts +121 -0
  856. package/src/runtime/native/styles/functions/filters.ts +98 -0
  857. package/src/runtime/native/styles/functions/index.ts +5 -0
  858. package/src/runtime/native/styles/functions/platform-functions.ts +50 -0
  859. package/src/runtime/native/styles/functions/transform-functions.ts +84 -0
  860. package/src/runtime/native/styles/index.ts +197 -0
  861. package/src/runtime/native/styles/resolve.ts +162 -0
  862. package/src/runtime/native/styles/shorthands/_handler.ts +121 -0
  863. package/src/runtime/native/styles/shorthands/animation.ts +122 -0
  864. package/src/runtime/native/styles/shorthands/border.ts +10 -0
  865. package/src/runtime/native/styles/shorthands/box-shadow.ts +54 -0
  866. package/src/runtime/native/styles/shorthands/index.ts +5 -0
  867. package/src/runtime/native/styles/shorthands/text-shadow.ts +17 -0
  868. package/src/runtime/native/styles/shorthands/transform.ts +23 -0
  869. package/src/runtime/native/styles/units.ts +57 -0
  870. package/src/runtime/native/styles/variables.ts +84 -0
  871. package/src/runtime/runtime.native.ts +1 -0
  872. package/src/runtime/runtime.ts +1 -0
  873. package/src/runtime/runtime.types.ts +130 -0
  874. package/src/runtime/utils/components.ts +15 -0
  875. package/src/runtime/utils/dot-notation.types.ts +118 -0
  876. package/src/runtime/utils/index.ts +5 -0
  877. package/src/runtime/utils/objects.ts +109 -0
  878. package/src/runtime/utils/specificity.ts +45 -0
  879. package/src/runtime/utils/style-value.ts +24 -0
  880. package/src/runtime/utils/utils.types.ts +19 -0
  881. package/src/runtime/web/api.ts +88 -0
  882. package/src/runtime/web/assign-style.ts +26 -0
  883. package/src/runtime/web/index.ts +5 -0
  884. package/src/runtime/web/metro.ts +2 -0
  885. package/types.d.ts +70 -0
  886. package/.babelrc +0 -17
  887. package/.editorconfig +0 -17
  888. package/.eslintignore +0 -3
  889. package/.eslintrc +0 -39
  890. package/.npmignore +0 -7
  891. package/build/index.js +0 -299
  892. package/build/utils.js +0 -61
  893. package/circle.yml +0 -31
  894. package/jsconfig.json +0 -9
  895. package/login.sh +0 -11
  896. package/src/index.js +0 -184
  897. package/src/utils.js +0 -32
  898. package/test/rnc.test.js +0 -258
  899. package/yarn.lock +0 -3333
@@ -0,0 +1,2091 @@
1
+ "use strict";
2
+
3
+ // cSpell:ignore rcap,vmin,svmin,lvmin,dvmin,cqmin,vmax,svmax,lvmax,dvmax,cqmax,currentcolor,oklab,oklch,prophoto
4
+
5
+ import Color from "colorjs.io";
6
+ import { parseEasingFunction, parseIterationCount } from "./keyframes.js";
7
+ import { toRNProperty } from "./selectors.js";
8
+ const CommaSeparator = Symbol("CommaSeparator");
9
+ const propertyRename = {
10
+ "background-image": "experimental_backgroundImage"
11
+ };
12
+
13
+ // TODO: We need a better way to handle this
14
+ const unparsedRuntimeParsing = new Set(["animation", "border", "box-shadow", "text-shadow", "transform", "scale", "rotate", "translate"]);
15
+ const parsers = {
16
+ "align-content": parseAlignContent,
17
+ "align-items": parseAlignItems,
18
+ "align-self": parseAlignSelf,
19
+ "animation": addAnimationValue,
20
+ "animation-delay": addAnimationValue,
21
+ "animation-direction": addAnimationValue,
22
+ "animation-duration": addAnimationValue,
23
+ "animation-fill-mode": addAnimationValue,
24
+ "animation-iteration-count": addAnimationValue,
25
+ "animation-name": addAnimationValue,
26
+ "animation-play-state": addAnimationValue,
27
+ "animation-timing-function": addAnimationValue,
28
+ "aspect-ratio": parseAspectRatio,
29
+ "background-color": parseColorDeclaration,
30
+ "background-image": parseBackgroundImage,
31
+ "block-size": parseSizeDeclaration,
32
+ "border": parseBorder,
33
+ "border-block": parseBorderBlock,
34
+ "border-block-color": parseBorderColor,
35
+ "border-block-end": parseBorderBlockEnd,
36
+ "border-block-end-color": parseColorDeclaration,
37
+ "border-block-end-width": parseBorderSideWidthDeclaration,
38
+ "border-block-start": parseBorderBlockStart,
39
+ "border-block-start-color": parseColorDeclaration,
40
+ "border-block-start-width": parseBorderSideWidthDeclaration,
41
+ "border-block-style": parseBorderBlockStyle,
42
+ "border-block-width": parseBorderBlockWidth,
43
+ "border-bottom": parseBorderSide,
44
+ "border-bottom-color": parseColorDeclaration,
45
+ "border-bottom-left-radius": parseSize2DDimensionPercentageDeclaration,
46
+ "border-bottom-right-radius": parseSize2DDimensionPercentageDeclaration,
47
+ "border-bottom-style": parseBorderStyleDeclaration,
48
+ "border-bottom-width": parseBorderSideWidthDeclaration,
49
+ "border-color": parseBorderColor,
50
+ "border-end-end-radius": parseSize2DDimensionPercentageDeclaration,
51
+ "border-end-start-radius": parseSize2DDimensionPercentageDeclaration,
52
+ "border-inline": parseBorderInline,
53
+ "border-inline-color": parseBorderColor,
54
+ "border-inline-end": parseBorderInlineEnd,
55
+ "border-inline-end-color": parseColorDeclaration,
56
+ "border-inline-end-style": parseBorderInlineStyle,
57
+ "border-inline-end-width": parseBorderSideWidthDeclaration,
58
+ "border-inline-start": parseBorderInlineStart,
59
+ "border-inline-start-color": parseColorDeclaration,
60
+ "border-inline-start-style": parseBorderInlineStyle,
61
+ "border-inline-start-width": parseBorderSideWidthDeclaration,
62
+ "border-inline-style": parseBorderInlineStyle,
63
+ "border-inline-width": parseBorderInlineWidth,
64
+ "border-left": parseBorderSide,
65
+ "border-left-color": parseColorDeclaration,
66
+ "border-left-style": parseBorderStyleDeclaration,
67
+ "border-left-width": parseBorderSideWidthDeclaration,
68
+ "border-radius": parseBorderRadius,
69
+ "border-right": parseBorderSide,
70
+ "border-right-color": parseColorDeclaration,
71
+ "border-right-style": parseBorderStyleDeclaration,
72
+ "border-right-width": parseBorderSideWidthDeclaration,
73
+ "border-start-end-radius": parseSize2DDimensionPercentageDeclaration,
74
+ "border-start-start-radius": parseSize2DDimensionPercentageDeclaration,
75
+ "border-style": parseBorderStyleDeclaration,
76
+ "border-top": parseBorderSide,
77
+ "border-top-color": parseColorDeclaration,
78
+ "border-top-left-radius": parseSize2DDimensionPercentageDeclaration,
79
+ "border-top-right-radius": parseSize2DDimensionPercentageDeclaration,
80
+ "border-top-style": parseBorderStyleDeclaration,
81
+ "border-top-width": parseBorderSideWidthDeclaration,
82
+ "border-width": parseBorderWidth,
83
+ "bottom": parseSizeDeclaration,
84
+ "box-shadow": parseBoxShadow,
85
+ "caret-color": parseColorOrAutoDeclaration,
86
+ "color": parseFontColorDeclaration,
87
+ "column-gap": parseGap,
88
+ "container": parseContainer,
89
+ "container-name": parseContainerName,
90
+ "container-type": parseContainerType,
91
+ "display": parseDisplay,
92
+ "fill": parseSVGPaint,
93
+ "filter": parseFilter,
94
+ "flex": parseFlex,
95
+ "flex-basis": parseLengthPercentageOrAutoDeclaration,
96
+ "flex-direction": ({
97
+ value
98
+ }) => value,
99
+ "flex-flow": parseFlexFlow,
100
+ "flex-grow": ({
101
+ value
102
+ }) => value,
103
+ "flex-shrink": ({
104
+ value
105
+ }) => value,
106
+ "flex-wrap": ({
107
+ value
108
+ }) => value,
109
+ "font": parseFont,
110
+ "font-family": parseFontFamily,
111
+ "font-size": parseFontSizeDeclaration,
112
+ "font-style": parseFontStyleDeclaration,
113
+ "font-variant-caps": parseFontVariantCapsDeclaration,
114
+ "font-weight": parseFontWeightDeclaration,
115
+ "gap": parseGap,
116
+ "height": parseSizeDeclaration,
117
+ "inline-size": parseSizeDeclaration,
118
+ "inset": parseInset,
119
+ "inset-block": parseInsetBlock,
120
+ "inset-block-end": parseLengthPercentageOrAutoDeclaration,
121
+ "inset-block-start": parseLengthPercentageOrAutoDeclaration,
122
+ "inset-inline": parseInsetInline,
123
+ "inset-inline-end": parseLengthPercentageOrAutoDeclaration,
124
+ "inset-inline-start": parseLengthPercentageOrAutoDeclaration,
125
+ "justify-content": parseJustifyContent,
126
+ "left": parseSizeDeclaration,
127
+ "letter-spacing": parseLetterSpacing,
128
+ "line-height": parseLineHeightDeclaration,
129
+ "margin": parseMargin,
130
+ "margin-block": parseMarginBlock,
131
+ "margin-block-end": parseLengthPercentageOrAutoDeclaration,
132
+ "margin-block-start": parseLengthPercentageOrAutoDeclaration,
133
+ "margin-bottom": parseSizeDeclaration,
134
+ "margin-inline": parseMarginInline,
135
+ "margin-inline-end": parseLengthPercentageOrAutoDeclaration,
136
+ "margin-inline-start": parseLengthPercentageOrAutoDeclaration,
137
+ "margin-left": parseSizeDeclaration,
138
+ "margin-right": parseSizeDeclaration,
139
+ "margin-top": parseSizeDeclaration,
140
+ "max-block-size": parseSizeDeclaration,
141
+ "max-height": parseSizeDeclaration,
142
+ "max-inline-size": parseSizeDeclaration,
143
+ "max-width": parseSizeDeclaration,
144
+ "min-block-size": parseSizeDeclaration,
145
+ "min-height": parseSizeDeclaration,
146
+ "min-inline-size": parseSizeDeclaration,
147
+ "min-width": parseSizeDeclaration,
148
+ "opacity": ({
149
+ value
150
+ }) => value,
151
+ "overflow": parseOverflow,
152
+ "padding": parsePadding,
153
+ "padding-block": parsePaddingBlock,
154
+ "padding-block-end": parseLengthPercentageOrAutoDeclaration,
155
+ "padding-block-start": parseLengthPercentageOrAutoDeclaration,
156
+ "padding-bottom": parseSizeDeclaration,
157
+ "padding-inline": parsePaddingInline,
158
+ "padding-inline-end": parseLengthPercentageOrAutoDeclaration,
159
+ "padding-inline-start": parseLengthPercentageOrAutoDeclaration,
160
+ "padding-left": parseSizeDeclaration,
161
+ "padding-right": parseSizeDeclaration,
162
+ "padding-top": parseSizeDeclaration,
163
+ "position": parsePosition,
164
+ "right": parseSizeDeclaration,
165
+ "rotate": parseRotate,
166
+ "row-gap": parseGap,
167
+ "scale": parseScale,
168
+ "stroke": parseSVGPaint,
169
+ "stroke-width": parseLengthDeclaration,
170
+ "text-align": parseTextAlign,
171
+ "text-decoration": parseTextDecoration,
172
+ "text-decoration-color": parseColorDeclaration,
173
+ "text-decoration-line": parseTextDecorationLineDeclaration,
174
+ "text-decoration-style": parseTextDecorationStyle,
175
+ "text-shadow": parseTextShadow,
176
+ "text-transform": ({
177
+ value
178
+ }) => value.case,
179
+ "top": parseSizeDeclaration,
180
+ "transform": parseTransform,
181
+ "transition": addTransitionValue,
182
+ "transition-delay": addTransitionValue,
183
+ "transition-duration": addTransitionValue,
184
+ "transition-property": addTransitionValue,
185
+ "transition-timing-function": addTransitionValue,
186
+ "translate": parseTranslate,
187
+ "user-select": parseUserSelect,
188
+ "vertical-align": parseVerticalAlign,
189
+ "width": parseSizeDeclaration,
190
+ "z-index": parseZIndex
191
+ };
192
+
193
+ // This is missing LightningCSS types
194
+ parsers["pointer-events"] = parsePointerEvents;
195
+ const validProperties = new Set(Object.keys(parsers));
196
+ export function parseDeclaration(declaration, builder) {
197
+ if ("vendorPrefix" in declaration && declaration.vendorPrefix.length) {
198
+ return;
199
+ }
200
+ if ("value" in declaration && typeof declaration.value === "object" && "vendorPrefix" in declaration.value && Array.isArray(declaration.value.vendorPrefix) && declaration.value.vendorPrefix.length) {
201
+ return;
202
+ }
203
+ if (declaration.property === "unparsed") {
204
+ parseUnparsedDeclaration(declaration, builder);
205
+ } else if (declaration.property === "custom") {
206
+ parseCustomDeclaration(declaration, builder);
207
+ } else {
208
+ parseWithParser(declaration, builder);
209
+ }
210
+ }
211
+ function parseWithParser(declaration, builder) {
212
+ if (declaration.property in parsers) {
213
+ const parser = parsers[declaration.property];
214
+ builder.descriptorProperty = declaration.property;
215
+ builder.setWarningProperty(declaration.property);
216
+ const value = parser(declaration, builder, declaration.property);
217
+ if (value !== undefined) {
218
+ builder.addDescriptor(propertyRename[declaration.property] ?? declaration.property, value);
219
+ }
220
+ } else {
221
+ builder.addWarning("property", declaration.property);
222
+ }
223
+ }
224
+ function parseInsetBlock({
225
+ value
226
+ }, builder) {
227
+ builder.addShorthand("inset-block", {
228
+ "inset-block-start": parseLengthPercentageOrAuto(value.blockStart, builder),
229
+ "inset-block-end": parseLengthPercentageOrAuto(value.blockEnd, builder)
230
+ });
231
+ }
232
+ function parseInsetInline({
233
+ value
234
+ }, builder) {
235
+ builder.addShorthand("inset-inline", {
236
+ "inset-block-start": parseLengthPercentageOrAuto(value.inlineStart, builder),
237
+ "inset-block-end": parseLengthPercentageOrAuto(value.inlineEnd, builder)
238
+ });
239
+ }
240
+ function parseInset({
241
+ value
242
+ }, builder) {
243
+ builder.addShorthand("inset", {
244
+ top: parseLengthPercentageOrAuto(value.top, builder),
245
+ bottom: parseLengthPercentageOrAuto(value.bottom, builder),
246
+ left: parseLengthPercentageOrAuto(value.left, builder),
247
+ right: parseLengthPercentageOrAuto(value.right, builder)
248
+ });
249
+ }
250
+ function parseBorderRadius({
251
+ value
252
+ }, builder) {
253
+ builder.addShorthand("border-radius", {
254
+ "border-bottom-left-radius": parseSize2DDimensionPercentage(value.bottomLeft, builder),
255
+ "border-bottom-right-radius": parseSize2DDimensionPercentage(value.bottomRight, builder),
256
+ "border-top-left-radius": parseSize2DDimensionPercentage(value.topLeft, builder),
257
+ "border-top-right-radius": parseSize2DDimensionPercentage(value.topRight, builder)
258
+ });
259
+ }
260
+ function parseBorderColor(declaration, builder) {
261
+ switch (declaration.property) {
262
+ case "border-color":
263
+ builder.addShorthand("border-color", {
264
+ "border-top-color": parseColor(declaration.value.top, builder),
265
+ "border-bottom-color": parseColor(declaration.value.bottom, builder),
266
+ "border-left-color": parseColor(declaration.value.left, builder),
267
+ "border-right-color": parseColor(declaration.value.right, builder)
268
+ });
269
+ break;
270
+ case "border-block-color":
271
+ builder.addDescriptor("border-top-color", parseColor(declaration.value.start, builder));
272
+ builder.addDescriptor("border-bottom-color", parseColor(declaration.value.end, builder));
273
+ break;
274
+ case "border-inline-color":
275
+ builder.addDescriptor("border-left-color", parseColor(declaration.value.start, builder));
276
+ builder.addDescriptor("border-right-color", parseColor(declaration.value.end, builder));
277
+ break;
278
+ }
279
+ }
280
+ function parseBorderWidth({
281
+ value
282
+ }, builder) {
283
+ builder.addShorthand("border-width", {
284
+ "border-top-width": parseBorderSideWidth(value.top, builder),
285
+ "border-bottom-width": parseBorderSideWidth(value.bottom, builder),
286
+ "border-left-width": parseBorderSideWidth(value.left, builder),
287
+ "border-right-width": parseBorderSideWidth(value.right, builder)
288
+ });
289
+ }
290
+ function parseBorder({
291
+ value
292
+ }, builder) {
293
+ builder.addShorthand("border", {
294
+ "border-width": parseBorderSideWidth(value.width, builder),
295
+ "border-style": parseBorderStyle(value.style, builder),
296
+ "border-color": parseColor(value.color, builder)
297
+ });
298
+ }
299
+ function parseBorderSide({
300
+ value,
301
+ property
302
+ }, builder) {
303
+ builder.addDescriptor(property + "-color", parseColor(value.color, builder));
304
+ builder.addDescriptor(property + "-width", parseBorderSideWidth(value.width, builder));
305
+ }
306
+ function parseBorderBlock({
307
+ value
308
+ }, builder) {
309
+ builder.addDescriptor("border-top-color", parseColor(value.color, builder));
310
+ builder.addDescriptor("border-bottom-color", parseColor(value.color, builder));
311
+ builder.addDescriptor("border-top-width", parseBorderSideWidth(value.width, builder));
312
+ builder.addDescriptor("border-bottom-width", parseBorderSideWidth(value.width, builder));
313
+ }
314
+ function parseBorderBlockStart({
315
+ value
316
+ }, builder) {
317
+ builder.addDescriptor("border-top-color", parseColor(value.color, builder));
318
+ builder.addDescriptor("border-top-width", parseBorderSideWidth(value.width, builder));
319
+ }
320
+ function parseBorderBlockEnd({
321
+ value
322
+ }, builder) {
323
+ builder.addDescriptor("border-bottom-color", parseColor(value.color, builder));
324
+ builder.addDescriptor("border-bottom-width", parseBorderSideWidth(value.width, builder));
325
+ }
326
+ function parseBorderInline({
327
+ value
328
+ }, builder) {
329
+ builder.addDescriptor("border-left-color", parseColor(value.color, builder));
330
+ builder.addDescriptor("border-right-color", parseColor(value.color, builder));
331
+ builder.addDescriptor("border-left-width", parseBorderSideWidth(value.width, builder));
332
+ builder.addDescriptor("border-right-width", parseBorderSideWidth(value.width, builder));
333
+ }
334
+ function parseBorderInlineStart({
335
+ value
336
+ }, builder) {
337
+ builder.addDescriptor("border-left-color", parseColor(value.color, builder));
338
+ builder.addDescriptor("border-left-width", parseBorderSideWidth(value.width, builder));
339
+ }
340
+ function parseBorderInlineEnd({
341
+ value
342
+ }, builder) {
343
+ builder.addDescriptor("border-right-color", parseColor(value.color, builder));
344
+ builder.addDescriptor("border-right-width", parseBorderSideWidth(value.width, builder));
345
+ }
346
+ export function parseBorderInlineWidth(declaration, builder) {
347
+ builder.addDescriptor("border-left-width", parseBorderSideWidth(declaration.value.start, builder));
348
+ builder.addDescriptor("border-right-width", parseBorderSideWidth(declaration.value.end, builder));
349
+ }
350
+ export function parseBorderInlineStyle(declaration, builder) {
351
+ if (typeof declaration.value === "string") {
352
+ builder.addDescriptor("border-style", parseBorderStyle(declaration.value, builder));
353
+ } else if (declaration.value.start === declaration.value.end) {
354
+ builder.addDescriptor("border-style", parseBorderStyle(declaration.value.start, builder));
355
+ } else {
356
+ builder.addWarning("property", "border-inline-style");
357
+ }
358
+ }
359
+ function parseFlexFlow({
360
+ value
361
+ }, builder) {
362
+ builder.addDescriptor("flexWrap", value.wrap);
363
+ builder.addDescriptor("flexDirection", value.direction);
364
+ }
365
+ function parseFlex({
366
+ value
367
+ }, builder) {
368
+ builder.addDescriptor("flex-grow", value.grow);
369
+ builder.addDescriptor("flex-shrink", value.shrink);
370
+ builder.addDescriptor("flex-basis", parseLengthPercentageOrAuto(value.basis, builder));
371
+ }
372
+ function parseMargin({
373
+ value
374
+ }, builder) {
375
+ builder.addShorthand("margin", {
376
+ "margin-top": parseSize(value.top, builder, {
377
+ allowAuto: true
378
+ }),
379
+ "margin-bottom": parseSize(value.bottom, builder, {
380
+ allowAuto: true
381
+ }),
382
+ "margin-left": parseSize(value.left, builder, {
383
+ allowAuto: true
384
+ }),
385
+ "margin-right": parseSize(value.right, builder, {
386
+ allowAuto: true
387
+ })
388
+ });
389
+ }
390
+ function parseMarginBlock({
391
+ value
392
+ }, builder) {
393
+ builder.addShorthand("margin-block", {
394
+ "margin-block-start": parseLengthPercentageOrAuto(value.blockStart, builder),
395
+ "margin-block-end": parseLengthPercentageOrAuto(value.blockEnd, builder)
396
+ });
397
+ }
398
+ function parseMarginInline({
399
+ value
400
+ }, builder) {
401
+ builder.addShorthand("margin-inline", {
402
+ "margin-inline-start": parseLengthPercentageOrAuto(value.inlineStart, builder),
403
+ "margin-inline-end": parseLengthPercentageOrAuto(value.inlineEnd, builder)
404
+ });
405
+ }
406
+ function parsePadding({
407
+ value
408
+ }, builder) {
409
+ builder.addShorthand("padding", {
410
+ "padding-top": parseSize(value.top, builder),
411
+ "padding-bottom": parseSize(value.bottom, builder),
412
+ "padding-left": parseSize(value.left, builder),
413
+ "padding-right": parseSize(value.right, builder)
414
+ });
415
+ }
416
+ function parsePaddingBlock({
417
+ value
418
+ }, builder) {
419
+ builder.addShorthand("padding-block", {
420
+ "padding-block-start": parseLengthPercentageOrAuto(value.blockStart, builder),
421
+ "padding-block-end": parseLengthPercentageOrAuto(value.blockEnd, builder)
422
+ });
423
+ }
424
+ function parsePaddingInline({
425
+ value
426
+ }, builder) {
427
+ builder.addShorthand("padding-inline", {
428
+ "padding-inline-start": parseLengthPercentageOrAuto(value.inlineStart, builder),
429
+ "padding-inline-end": parseLengthPercentageOrAuto(value.inlineEnd, builder)
430
+ });
431
+ }
432
+ function parseFont({
433
+ value
434
+ }, builder) {
435
+ builder.addDescriptor("font-family", value.family[0]);
436
+ builder.addDescriptor("line-height", parseLineHeight(value.lineHeight, builder));
437
+ builder.addDescriptor("font-size", parseFontSize(value.size, builder));
438
+ builder.addDescriptor("font-style", parseFontStyle(value.style, builder));
439
+ builder.addDescriptor("font-variant-caps", parseFontVariantCaps(value.variantCaps, builder));
440
+ builder.addDescriptor("font-weight", parseFontWeight(value.weight, builder));
441
+ }
442
+ function parseTransform({
443
+ value
444
+ }, builder) {
445
+ builder.addDescriptor("transform", [{}, "transform", value.flatMap(t => {
446
+ switch (t.type) {
447
+ case "perspective":
448
+ return [[{}, "perspective", parseLength(t.value, builder)]];
449
+ case "translate":
450
+ return [[{}, "translateX", parseLengthOrCoercePercentageToRuntime(t.value[0], builder)], [[{}, "translateY", parseLengthOrCoercePercentageToRuntime(t.value[1], builder)]]];
451
+ case "translateX":
452
+ return [[{}, "translateX", parseLengthOrCoercePercentageToRuntime(t.value, builder)]];
453
+ case "translateY":
454
+ return [[{}, "translateY", parseLengthOrCoercePercentageToRuntime(t.value, builder)]];
455
+ case "rotate":
456
+ return [[{}, "rotate", parseAngle(t.value, builder)]];
457
+ case "rotateX":
458
+ return [[{}, "rotateX", parseAngle(t.value, builder)]];
459
+ case "rotateY":
460
+ return [[{}, "rotateY", parseAngle(t.value, builder)]];
461
+ case "rotateZ":
462
+ return [[{}, "rotateZ", parseAngle(t.value, builder)]];
463
+ case "scale":
464
+ return [[{}, "scaleX", parseLength(t.value[0], builder)], [{}, "scaleY", parseLength(t.value[1], builder)]];
465
+ case "scaleX":
466
+ return [[{}, "scaleX", parseLength(t.value, builder)]];
467
+ case "scaleY":
468
+ return [[{}, "scaleY", parseLength(t.value, builder)]];
469
+ case "skew":
470
+ return [[{}, "skewX", parseAngle(t.value[0], builder)], [{}, "skewY", parseAngle(t.value[1], builder)]];
471
+ case "skewX":
472
+ return [[{}, "skewX", parseAngle(t.value, builder)]];
473
+ case "skewY":
474
+ return [[{}, "skewY", parseAngle(t.value, builder)]];
475
+ case "translateZ":
476
+ case "translate3d":
477
+ case "scaleZ":
478
+ case "scale3d":
479
+ case "rotate3d":
480
+ case "matrix":
481
+ case "matrix3d":
482
+ return [[]];
483
+ }
484
+ })]);
485
+ return;
486
+ }
487
+ function parseTranslate({
488
+ value
489
+ }, builder) {
490
+ builder.addDescriptor("translateX", [{}, "translateX", parseTranslateProp(value, "x", builder)]);
491
+ builder.addDescriptor("translateY", [{}, "translateY", parseTranslateProp(value, "y", builder)]);
492
+ }
493
+ function parseRotate({
494
+ value
495
+ }, builder) {
496
+ if (value.x) {
497
+ builder.addDescriptor("rotateX", [{}, "rotateX", parseAngle(value.angle, builder)]);
498
+ }
499
+ if (value.y) {
500
+ builder.addDescriptor("rotateY", [{}, "rotateY", parseAngle(value.angle, builder)]);
501
+ }
502
+ if (value.z) {
503
+ builder.addDescriptor("rotateZ", [{}, "rotateZ", parseAngle(value.angle, builder)]);
504
+ }
505
+ }
506
+ function parseScale({
507
+ value
508
+ }, builder) {
509
+ builder.addDescriptor("scaleX", [{}, "scaleX", parseScaleValue(value, "x", builder)]);
510
+ builder.addDescriptor("scaleY", [{}, "scaleY", parseScaleValue(value, "y", builder)]);
511
+ }
512
+ export function parseScaleValue(translate, prop, builder) {
513
+ if (translate === "none") {
514
+ return 0;
515
+ }
516
+ return parseLength(translate[prop], builder);
517
+ }
518
+ function parseLetterSpacing({
519
+ value
520
+ }, builder) {
521
+ if (value.type === "normal") {
522
+ return;
523
+ }
524
+ const descriptor = parseLength(value.value, builder);
525
+ if (Array.isArray(descriptor) && descriptor[1] === "em" && typeof descriptor[2] === "number") {
526
+ return descriptor[2];
527
+ }
528
+ return descriptor;
529
+ }
530
+ function parseTextDecoration({
531
+ value
532
+ }, builder) {
533
+ builder.addDescriptor("text-decoration-color", parseColor(value.color, builder));
534
+ builder.addDescriptor("text-decoration-line", parseTextDecorationLine(value.line, builder));
535
+ }
536
+ function parseZIndex({
537
+ value
538
+ }, builder) {
539
+ if (value.type === "integer") {
540
+ return parseLength(value.value, builder);
541
+ } else {
542
+ builder.addWarning("value", value.type);
543
+ return;
544
+ }
545
+ }
546
+ function parseContainerType(_declaration, builder) {
547
+ builder.addContainer(["___default___"]);
548
+ return;
549
+ }
550
+ function parseContainerName({
551
+ value
552
+ }, builder) {
553
+ builder.addContainer(value.type === "none" ? false : value.value);
554
+ return;
555
+ }
556
+ function parseContainer({
557
+ value
558
+ }, builder) {
559
+ builder.addContainer(value.name.type === "none" ? false : value.name.value);
560
+ return;
561
+ }
562
+ export function parseUnparsedDeclaration(declaration, builder) {
563
+ let property = declaration.value.propertyId.property;
564
+ if (!(property in parsers)) {
565
+ builder.addWarning("property", property);
566
+ return;
567
+ }
568
+ builder.setWarningProperty(property);
569
+
570
+ /**
571
+ * React Native doesn't support all the logical properties
572
+ */
573
+ const rename = propertyRename[property];
574
+ if (rename) {
575
+ property = rename;
576
+ }
577
+
578
+ /**
579
+ * Unparsed shorthand properties need to be parsed at runtime
580
+ */
581
+ builder.descriptorProperty = property;
582
+ if (unparsedRuntimeParsing.has(property)) {
583
+ const args = parseUnparsed(declaration.value.value, builder, property);
584
+ if (property === "animation") {
585
+ builder.addDescriptor("animation", [{}, property, args]);
586
+ } else {
587
+ builder.addDescriptor(property, [{}, toRNProperty(property), args, 1]);
588
+ }
589
+ } else {
590
+ const value = parseUnparsed(declaration.value.value, builder, property);
591
+ builder.addDescriptor(property, value);
592
+ if (property === "font-size") {
593
+ builder.addDescriptor("--__rn-css-em", value);
594
+ }
595
+ if (property === "color") {
596
+ builder.addDescriptor("--__rn-css-current-color", value);
597
+ }
598
+ }
599
+ }
600
+ export function parseCustomDeclaration(declaration, builder) {
601
+ const property = declaration.value.name;
602
+ if (property === "-webkit-line-clamp") {
603
+ builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
604
+ } else if (property === "-rn-ripple-style") {
605
+ builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property) === "borderless");
606
+ } else if (validProperties.has(property) || property.startsWith("--") || property.startsWith("-rn-")) {
607
+ builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
608
+ } else {
609
+ builder.addWarning("property", declaration.value.name);
610
+ }
611
+ }
612
+ export function reduceParseUnparsed(tokenOrValues, builder, property, allowAuto) {
613
+ const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder, property, allowAuto)).filter(v => v !== undefined);
614
+ if (result.length === 0) {
615
+ return undefined;
616
+ }
617
+ let currentGroup = [];
618
+ let groups = [currentGroup];
619
+ for (const value of result) {
620
+ if (value === CommaSeparator) {
621
+ currentGroup = [];
622
+ groups.push(currentGroup);
623
+ } else {
624
+ currentGroup.push(value);
625
+ }
626
+ }
627
+
628
+ // Groups are the tokens grouped together by comma location
629
+ // If a group only has 1 item, it shouldn't be an array
630
+ groups = groups.flatMap(group => {
631
+ if (!Array.isArray(group)) {
632
+ return [];
633
+ }
634
+ if (group.length === 0) {
635
+ return [];
636
+ } else if (group.length === 1) {
637
+ const first = group[0];
638
+ if (first === undefined) {
639
+ return [];
640
+ } else {
641
+ return [first];
642
+ }
643
+ } else if (
644
+ // This is a special case for <ratio> values
645
+ group.includes("/") && group.every(item => typeof item === "string" && item === "/" ? item : typeof item === "number")) {
646
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
647
+ return [group.join(" ")];
648
+ } else {
649
+ return [group];
650
+ }
651
+ });
652
+ return groups.length === 1 ? groups[0] : groups;
653
+ }
654
+ export function unparsedFunction(token, builder, property, allowAuto) {
655
+ return [{}, toRNProperty(token.value.name), reduceParseUnparsed(token.value.arguments, builder, property, allowAuto)];
656
+ }
657
+
658
+ /**
659
+ * When the CSS cannot be parsed (often due to a runtime condition like a CSS variable)
660
+ * This export function best efforts parsing it into a export function that we can evaluate at runtime
661
+ */
662
+ export function parseUnparsed(tokenOrValue, builder, property, allowAuto = allowAutoProperties.has(property)) {
663
+ if (tokenOrValue === undefined || tokenOrValue === null) {
664
+ return;
665
+ }
666
+ if (typeof tokenOrValue === "string") {
667
+ if (tokenOrValue === "true") {
668
+ return true;
669
+ } else if (tokenOrValue === "false") {
670
+ return false;
671
+ } else if (tokenOrValue === "currentcolor") {
672
+ return [{}, "var", "__rn-css-current-color"];
673
+ } else {
674
+ return tokenOrValue;
675
+ }
676
+ }
677
+ if (typeof tokenOrValue === "number") {
678
+ return round(tokenOrValue);
679
+ }
680
+ if (Array.isArray(tokenOrValue)) {
681
+ const args = reduceParseUnparsed(tokenOrValue, builder, property, allowAuto);
682
+ if (!args) return;
683
+ if (Array.isArray(args) && args.length === 1) return args[0];
684
+ return args;
685
+ }
686
+ switch (tokenOrValue.type) {
687
+ case "unresolved-color":
688
+ {
689
+ return parseUnresolvedColor(tokenOrValue.value, builder, property, allowAuto);
690
+ }
691
+ case "var":
692
+ {
693
+ let args = tokenOrValue.value.name.ident.slice(2);
694
+ const fallback = parseUnparsed(tokenOrValue.value.fallback, builder, property, allowAuto);
695
+ if (fallback !== undefined) {
696
+ args = [args, fallback];
697
+ }
698
+ return [{}, "var", args, 1];
699
+ }
700
+ case "function":
701
+ {
702
+ switch (tokenOrValue.value.name) {
703
+ case "blur":
704
+ case "brightness":
705
+ case "contrast":
706
+ case "cubic-bezier":
707
+ case "drop-shadow":
708
+ case "fontScale":
709
+ case "getPixelSizeForLayoutSize":
710
+ case "grayscale":
711
+ case "hsl":
712
+ case "hsla":
713
+ case "hue-rotate":
714
+ case "invert":
715
+ case "opacity":
716
+ case "pixelScale":
717
+ case "platformColor":
718
+ case "rgb":
719
+ case "rgba":
720
+ case "rotate":
721
+ case "rotateX":
722
+ case "rotateY":
723
+ case "roundToNearestPixel":
724
+ case "saturate":
725
+ case "scale":
726
+ case "scaleX":
727
+ case "scaleY":
728
+ case "sepia":
729
+ case "shadow":
730
+ case "skewX":
731
+ case "skewY":
732
+ case "steps":
733
+ case "translate":
734
+ case "translateX":
735
+ case "translateY":
736
+ return unparsedFunction(tokenOrValue, builder, property, allowAuto);
737
+ case "linear-gradient":
738
+ case "radial-gradient":
739
+ // These are special as React Native requires the '-' in their name
740
+ return [{}, tokenOrValue.value.name, reduceParseUnparsed(tokenOrValue.value.arguments, builder, property, allowAuto)];
741
+ case "hairlineWidth":
742
+ return [{}, tokenOrValue.value.name, []];
743
+ case "calc":
744
+ case "max":
745
+ case "min":
746
+ case "clamp":
747
+ return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder, property);
748
+ default:
749
+ {
750
+ builder.addWarning("value", `${tokenOrValue.value.name}()`);
751
+ return;
752
+ }
753
+ }
754
+ }
755
+ case "length":
756
+ return parseLength(tokenOrValue.value, builder);
757
+ case "angle":
758
+ return parseAngle(tokenOrValue.value, builder);
759
+ case "token":
760
+ switch (tokenOrValue.value.type) {
761
+ case "string":
762
+ case "ident":
763
+ {
764
+ const value = tokenOrValue.value.value;
765
+ if (!allowAuto && value === "auto") {
766
+ builder.addWarning("value", value);
767
+ return;
768
+ }
769
+ if (value === "inherit" || value === "initial") {
770
+ builder.addWarning("value", value);
771
+ return;
772
+ } else if (value === "currentcolor") {
773
+ return [{}, "var", "__rn-css-current-color"];
774
+ }
775
+ if (value === "true") {
776
+ return true;
777
+ } else if (value === "false") {
778
+ return false;
779
+ } else if (value === "infinity") {
780
+ return Number.MAX_SAFE_INTEGER;
781
+ } else {
782
+ return value;
783
+ }
784
+ }
785
+ case "number":
786
+ {
787
+ return round(tokenOrValue.value.value);
788
+ }
789
+ case "function":
790
+ builder.addWarning("value", tokenOrValue.value.value);
791
+ return;
792
+ case "percentage":
793
+ return `${round(tokenOrValue.value.value * 100)}%`;
794
+ case "dimension":
795
+ return parseDimension(tokenOrValue.value, builder);
796
+ case "comma":
797
+ return CommaSeparator;
798
+ case "delim":
799
+ {
800
+ if (tokenOrValue.value.value === "/") {
801
+ return tokenOrValue.value.value;
802
+ }
803
+ return;
804
+ }
805
+ case "at-keyword":
806
+ case "hash":
807
+ case "id-hash":
808
+ case "unquoted-url":
809
+ case "white-space":
810
+ case "comment":
811
+ case "colon":
812
+ case "semicolon":
813
+ case "include-match":
814
+ case "dash-match":
815
+ case "prefix-match":
816
+ case "suffix-match":
817
+ case "substring-match":
818
+ case "cdo":
819
+ case "cdc":
820
+ case "parenthesis-block":
821
+ case "square-bracket-block":
822
+ case "curly-bracket-block":
823
+ case "bad-url":
824
+ case "bad-string":
825
+ case "close-parenthesis":
826
+ case "close-square-bracket":
827
+ case "close-curly-bracket":
828
+ return;
829
+ default:
830
+ {
831
+ tokenOrValue.value;
832
+ return;
833
+ }
834
+ }
835
+ case "color":
836
+ return parseColor(tokenOrValue.value, builder);
837
+ case "env":
838
+ return parseEnv(tokenOrValue.value, builder);
839
+ case "time":
840
+ return parseTime(tokenOrValue.value);
841
+ case "url":
842
+ case "resolution":
843
+ case "dashed-ident":
844
+ case "animation-name":
845
+ return;
846
+ default:
847
+ {
848
+ tokenOrValue;
849
+ }
850
+ }
851
+ return;
852
+ }
853
+ export function parseLengthDeclaration(declaration, builder) {
854
+ return parseLength(declaration.value, builder);
855
+ }
856
+ export function parseLength(length, builder) {
857
+ const {
858
+ inlineRem = 14
859
+ } = builder.getOptions();
860
+ if (typeof length === "number") {
861
+ return round(length);
862
+ }
863
+ if ("unit" in length) {
864
+ switch (length.unit) {
865
+ case "px":
866
+ {
867
+ if (length.value === Infinity) {
868
+ return 9999;
869
+ } else if (length.value === -Infinity) {
870
+ return -9999;
871
+ } else {
872
+ // Normalize large values to safe integers, e.g. `calc(infinity * 1px)`
873
+ const value = Math.max(Math.min(length.value, Number.MAX_SAFE_INTEGER), Number.MIN_SAFE_INTEGER);
874
+ return round(value);
875
+ }
876
+ }
877
+ case "rem":
878
+ if (typeof inlineRem === "number") {
879
+ return length.value * inlineRem;
880
+ } else {
881
+ return [{}, "rem", round(length.value)];
882
+ }
883
+ case "vw":
884
+ case "vh":
885
+ case "em":
886
+ return [{}, length.unit, round(length.value), 1];
887
+ case "in":
888
+ case "cm":
889
+ case "mm":
890
+ case "q":
891
+ case "pt":
892
+ case "pc":
893
+ case "ex":
894
+ case "rex":
895
+ case "ch":
896
+ case "rch":
897
+ case "cap":
898
+ case "rcap":
899
+ case "ic":
900
+ case "ric":
901
+ case "lh":
902
+ case "rlh":
903
+ case "lvw":
904
+ case "svw":
905
+ case "dvw":
906
+ case "cqw":
907
+ case "lvh":
908
+ case "svh":
909
+ case "dvh":
910
+ case "cqh":
911
+ case "vi":
912
+ case "svi":
913
+ case "lvi":
914
+ case "dvi":
915
+ case "cqi":
916
+ case "vb":
917
+ case "svb":
918
+ case "lvb":
919
+ case "dvb":
920
+ case "cqb":
921
+ case "vmin":
922
+ case "svmin":
923
+ case "lvmin":
924
+ case "dvmin":
925
+ case "cqmin":
926
+ case "vmax":
927
+ case "svmax":
928
+ case "lvmax":
929
+ case "dvmax":
930
+ case "cqmax":
931
+ builder.addWarning("value", `${length.value}${length.unit}`);
932
+ return undefined;
933
+ default:
934
+ {
935
+ length.unit;
936
+ }
937
+ }
938
+ } else {
939
+ switch (length.type) {
940
+ case "calc":
941
+ {
942
+ // TODO: Add the calc polyfill
943
+ return undefined;
944
+ }
945
+ case "number":
946
+ {
947
+ return round(length.value);
948
+ }
949
+ case "percentage":
950
+ {
951
+ return `${round(length.value * 100)}%`;
952
+ }
953
+ case "dimension":
954
+ case "value":
955
+ {
956
+ return parseLength(length.value, builder);
957
+ }
958
+ }
959
+ }
960
+ return;
961
+ }
962
+ export function parseAngle(angle, builder) {
963
+ if (typeof angle === "number") {
964
+ return `${angle}deg`;
965
+ }
966
+ switch (angle.type) {
967
+ case "deg":
968
+ case "rad":
969
+ return `${angle.value}${angle.type}`;
970
+ default:
971
+ builder.addWarning("value", `${angle.value} ${angle.type}`);
972
+ return undefined;
973
+ }
974
+ }
975
+ export function parseSizeDeclaration(declaration, builder) {
976
+ return parseSize(declaration.value, builder);
977
+ }
978
+ export function parsePointerEvents({
979
+ value
980
+ }, builder) {
981
+ switch (value) {
982
+ case "none":
983
+ case "box-none":
984
+ case "box-only":
985
+ case "auto":
986
+ return value;
987
+ case "visible":
988
+ case "visiblePainted":
989
+ case "visibleFill":
990
+ case "visibleStroke":
991
+ case "painted":
992
+ case "fill":
993
+ case "stroke":
994
+ builder.addWarning("value", value);
995
+ }
996
+ return;
997
+ }
998
+ export function parseSize(size, builder, options, {
999
+ allowAuto = false
1000
+ } = {}) {
1001
+ allowAuto = (typeof options === "object" ? options.allowAuto : allowAuto) ?? false;
1002
+ switch (size.type) {
1003
+ case "length-percentage":
1004
+ return parseLength(size.value, builder);
1005
+ case "none":
1006
+ return size.type;
1007
+ case "auto":
1008
+ if (allowAuto) {
1009
+ return size.type;
1010
+ } else {
1011
+ builder.addWarning("value", size.type);
1012
+ return undefined;
1013
+ }
1014
+ case "min-content":
1015
+ case "max-content":
1016
+ case "fit-content":
1017
+ case "fit-content-function":
1018
+ case "stretch":
1019
+ case "contain":
1020
+ builder.addWarning("value", size.type);
1021
+ return undefined;
1022
+ default:
1023
+ {
1024
+ size;
1025
+ }
1026
+ }
1027
+ return;
1028
+ }
1029
+ export function parseColorOrAutoDeclaration({
1030
+ value
1031
+ }, builder) {
1032
+ if (value.type === "auto") {
1033
+ builder.addWarning("value", `Invalid color value ${value.type}`);
1034
+ return;
1035
+ } else {
1036
+ return parseColor(value.value, builder);
1037
+ }
1038
+ }
1039
+ export function parseFontColorDeclaration(declaration, builder) {
1040
+ parseColorDeclaration(declaration, builder);
1041
+ builder.addDescriptor("--__rn-css-color", parseColor(declaration.value, builder));
1042
+ }
1043
+ export function parseColorDeclaration(declaration, builder) {
1044
+ builder.addDescriptor(declaration.property, parseColor(declaration.value, builder));
1045
+ }
1046
+ export function parseColor(cssColor, builder) {
1047
+ if (typeof cssColor === "string") {
1048
+ if (namedColors.has(cssColor)) {
1049
+ return cssColor;
1050
+ }
1051
+ return;
1052
+ }
1053
+ let color;
1054
+ const {
1055
+ hexColors = true,
1056
+ colorPrecision
1057
+ } = builder.getOptions();
1058
+ switch (cssColor.type) {
1059
+ case "currentcolor":
1060
+ return [{}, "var", "__rn-css-current-color"];
1061
+ case "light-dark":
1062
+ {
1063
+ const extraRule = {
1064
+ s: [],
1065
+ m: [["=", "prefers-color-scheme", "dark"]]
1066
+ };
1067
+ builder.addUnnamedDescriptor(parseColor(cssColor.dark, builder), false, extraRule);
1068
+ builder.addExtraRule(extraRule);
1069
+ return parseColor(cssColor.light, builder);
1070
+ }
1071
+ case "rgb":
1072
+ {
1073
+ color = new Color({
1074
+ space: "sRGB",
1075
+ coords: [cssColor.r / 255, cssColor.g / 255, cssColor.b / 255],
1076
+ alpha: cssColor.alpha
1077
+ });
1078
+ break;
1079
+ }
1080
+ case "hsl":
1081
+ color = new Color({
1082
+ space: cssColor.type,
1083
+ coords: [cssColor.h, cssColor.s, cssColor.l],
1084
+ alpha: cssColor.alpha
1085
+ });
1086
+ break;
1087
+ case "hwb":
1088
+ color = new Color({
1089
+ space: cssColor.type,
1090
+ coords: [cssColor.h, cssColor.w, cssColor.b],
1091
+ alpha: cssColor.alpha
1092
+ });
1093
+ break;
1094
+ case "lab":
1095
+ color = new Color({
1096
+ space: cssColor.type,
1097
+ coords: [cssColor.l, cssColor.a, cssColor.b],
1098
+ alpha: cssColor.alpha
1099
+ });
1100
+ break;
1101
+ case "lch":
1102
+ color = new Color({
1103
+ space: cssColor.type,
1104
+ coords: [cssColor.l, cssColor.c, cssColor.h],
1105
+ alpha: cssColor.alpha
1106
+ });
1107
+ break;
1108
+ case "oklab":
1109
+ color = new Color({
1110
+ space: cssColor.type,
1111
+ coords: [cssColor.l, cssColor.a, cssColor.b],
1112
+ alpha: cssColor.alpha
1113
+ });
1114
+ break;
1115
+ case "oklch":
1116
+ color = new Color({
1117
+ space: cssColor.type,
1118
+ coords: [cssColor.l, cssColor.c, cssColor.h],
1119
+ alpha: cssColor.alpha
1120
+ });
1121
+ break;
1122
+ case "srgb":
1123
+ color = new Color({
1124
+ space: cssColor.type,
1125
+ coords: [cssColor.r, cssColor.g, cssColor.b],
1126
+ alpha: cssColor.alpha
1127
+ });
1128
+ break;
1129
+ case "srgb-linear":
1130
+ color = new Color({
1131
+ space: cssColor.type,
1132
+ coords: [cssColor.r, cssColor.g, cssColor.b],
1133
+ alpha: cssColor.alpha
1134
+ });
1135
+ break;
1136
+ case "display-p3":
1137
+ color = new Color({
1138
+ space: "p3",
1139
+ coords: [cssColor.r, cssColor.g, cssColor.b],
1140
+ alpha: cssColor.alpha
1141
+ });
1142
+ break;
1143
+ case "a98-rgb":
1144
+ color = new Color({
1145
+ space: "a98rgb",
1146
+ coords: [cssColor.r, cssColor.g, cssColor.b],
1147
+ alpha: cssColor.alpha
1148
+ });
1149
+ break;
1150
+ case "prophoto-rgb":
1151
+ color = new Color({
1152
+ space: "prophoto",
1153
+ coords: [cssColor.r, cssColor.g, cssColor.b],
1154
+ alpha: cssColor.alpha
1155
+ });
1156
+ break;
1157
+ case "rec2020":
1158
+ color = new Color({
1159
+ space: cssColor.type,
1160
+ coords: [cssColor.r, cssColor.g, cssColor.b],
1161
+ alpha: cssColor.alpha
1162
+ });
1163
+ break;
1164
+ case "xyz-d50":
1165
+ color = new Color({
1166
+ space: cssColor.type,
1167
+ coords: [cssColor.x, cssColor.y, cssColor.z],
1168
+ alpha: cssColor.alpha
1169
+ });
1170
+ break;
1171
+ case "xyz-d65":
1172
+ color = new Color({
1173
+ space: cssColor.type,
1174
+ coords: [cssColor.x, cssColor.y, cssColor.z],
1175
+ alpha: cssColor.alpha
1176
+ });
1177
+ break;
1178
+ default:
1179
+ {
1180
+ cssColor;
1181
+ }
1182
+ }
1183
+ if (!hexColors || colorPrecision) {
1184
+ return color?.toString({
1185
+ precision: colorPrecision ?? 3
1186
+ });
1187
+ } else {
1188
+ return color?.toString({
1189
+ format: "hex"
1190
+ });
1191
+ }
1192
+ }
1193
+ export function parseLengthPercentageOrAutoDeclaration(value, builder) {
1194
+ return parseLengthPercentageOrAuto(value.value, builder);
1195
+ }
1196
+ export function parseLengthPercentageOrAuto(lengthPercentageOrAuto, builder, {
1197
+ allowAuto = false
1198
+ } = {}) {
1199
+ switch (lengthPercentageOrAuto.type) {
1200
+ case "auto":
1201
+ if (allowAuto) {
1202
+ return lengthPercentageOrAuto.type;
1203
+ } else {
1204
+ builder.addWarning("value", lengthPercentageOrAuto.type);
1205
+ return undefined;
1206
+ }
1207
+ case "length-percentage":
1208
+ return parseLength(lengthPercentageOrAuto.value, builder);
1209
+ default:
1210
+ {
1211
+ lengthPercentageOrAuto;
1212
+ }
1213
+ }
1214
+ return;
1215
+ }
1216
+ export function parseJustifyContent(declaration, builder) {
1217
+ const allowed = new Set(["flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly"]);
1218
+ let value;
1219
+ switch (declaration.value.type) {
1220
+ case "normal":
1221
+ case "left":
1222
+ case "right":
1223
+ value = declaration.value.type;
1224
+ break;
1225
+ case "content-distribution":
1226
+ case "content-position":
1227
+ value = declaration.value.value;
1228
+ break;
1229
+ default:
1230
+ {
1231
+ declaration.value;
1232
+ }
1233
+ }
1234
+ if (value && !allowed.has(value)) {
1235
+ builder.addWarning("value", value);
1236
+ return;
1237
+ }
1238
+ return value;
1239
+ }
1240
+ export function parseAlignContent(declaration, builder) {
1241
+ const allowed = new Set(["flex-start", "flex-end", "center", "stretch", "space-between", "space-around"]);
1242
+ let value;
1243
+ switch (declaration.value.type) {
1244
+ case "normal":
1245
+ case "baseline-position":
1246
+ value = declaration.value.type;
1247
+ break;
1248
+ case "content-distribution":
1249
+ case "content-position":
1250
+ value = declaration.value.value;
1251
+ break;
1252
+ default:
1253
+ {
1254
+ declaration.value;
1255
+ }
1256
+ }
1257
+ if (value && !allowed.has(value)) {
1258
+ builder.addWarning("value", value);
1259
+ return;
1260
+ }
1261
+ return value;
1262
+ }
1263
+ export function parseAlignItems(alignItems, builder) {
1264
+ const allowed = new Set(["auto", "flex-start", "flex-end", "center", "stretch", "baseline"]);
1265
+ let value;
1266
+ switch (alignItems.value.type) {
1267
+ case "normal":
1268
+ value = "auto";
1269
+ break;
1270
+ case "stretch":
1271
+ value = alignItems.value.type;
1272
+ break;
1273
+ case "baseline-position":
1274
+ value = "baseline";
1275
+ break;
1276
+ case "self-position":
1277
+ value = alignItems.value.value;
1278
+ break;
1279
+ default:
1280
+ {
1281
+ alignItems.value;
1282
+ }
1283
+ }
1284
+ if (value && !allowed.has(value)) {
1285
+ builder.addWarning("value", value);
1286
+ return;
1287
+ }
1288
+ return value;
1289
+ }
1290
+ export function parseAlignSelf(alignSelf, builder) {
1291
+ const allowed = new Set(["auto", "flex-start", "flex-end", "center", "stretch", "baseline"]);
1292
+ let value;
1293
+ switch (alignSelf.value.type) {
1294
+ case "normal":
1295
+ case "auto":
1296
+ value = "auto";
1297
+ break;
1298
+ case "stretch":
1299
+ value = alignSelf.value.type;
1300
+ break;
1301
+ case "baseline-position":
1302
+ value = "baseline";
1303
+ break;
1304
+ case "self-position":
1305
+ value = alignSelf.value.value;
1306
+ break;
1307
+ default:
1308
+ {
1309
+ alignSelf.value;
1310
+ }
1311
+ }
1312
+ if (value && !allowed.has(value)) {
1313
+ builder.addWarning("value", value);
1314
+ return;
1315
+ }
1316
+ return value;
1317
+ }
1318
+ export function parseFontWeightDeclaration(declaration, builder) {
1319
+ return parseFontWeight(declaration.value, builder);
1320
+ }
1321
+ export function parseFontWeight(fontWeight, builder) {
1322
+ switch (fontWeight.type) {
1323
+ case "absolute":
1324
+ if (fontWeight.value.type === "weight") {
1325
+ return fontWeight.value.value.toString();
1326
+ } else {
1327
+ return fontWeight.value.type;
1328
+ }
1329
+ case "bolder":
1330
+ case "lighter":
1331
+ builder.addWarning("value", fontWeight.type);
1332
+ return;
1333
+ default:
1334
+ {
1335
+ fontWeight;
1336
+ }
1337
+ }
1338
+ return;
1339
+ }
1340
+ export function parseTextShadow(declaration, builder) {
1341
+ const [textShadow] = declaration.value;
1342
+ if (!textShadow) {
1343
+ return;
1344
+ }
1345
+ builder.addDescriptor("textShadowColor", parseColor(textShadow.color, builder));
1346
+ builder.addDescriptor("textShadowOffset.width", parseLength(textShadow.xOffset, builder));
1347
+ builder.addDescriptor("textShadowOffset.height", parseLength(textShadow.yOffset, builder));
1348
+ builder.addDescriptor("textShadowRadius", parseLength(textShadow.blur, builder));
1349
+ }
1350
+ export function parseTextDecorationStyle(declaration, builder) {
1351
+ const allowed = new Set(["solid", "double", "dotted", "dashed"]);
1352
+ if (allowed.has(declaration.value)) {
1353
+ return declaration.value;
1354
+ }
1355
+ builder.addWarning("value", declaration.value);
1356
+ return;
1357
+ }
1358
+ export function parseTextDecorationLineDeclaration(declaration, builder) {
1359
+ return parseTextDecorationLine(declaration.value, builder);
1360
+ }
1361
+ export function parseTextDecorationLine(value, builder) {
1362
+ if (!Array.isArray(value)) {
1363
+ if (value === "none") {
1364
+ return value;
1365
+ }
1366
+ builder.addWarning("value", value);
1367
+ return;
1368
+ }
1369
+ const set = new Set(value);
1370
+ if (set.has("underline")) {
1371
+ if (set.has("line-through")) {
1372
+ return "underline line-through";
1373
+ } else {
1374
+ return "underline";
1375
+ }
1376
+ } else if (set.has("line-through")) {
1377
+ return "line-through";
1378
+ }
1379
+ builder.addWarning("value", value.join(" "));
1380
+ return undefined;
1381
+ }
1382
+ export function parsePosition({
1383
+ value
1384
+ }, builder) {
1385
+ if (value.type === "absolute" || value.type === "relative") {
1386
+ return value.type;
1387
+ }
1388
+ builder.addWarning("value", value.type);
1389
+ return;
1390
+ }
1391
+ export function parseOverflow({
1392
+ value
1393
+ }, builder) {
1394
+ const allowed = new Set(["visible", "hidden"]);
1395
+ if (allowed.has(value.x)) {
1396
+ return value.x;
1397
+ }
1398
+ builder.addWarning("value", value.x);
1399
+ return undefined;
1400
+ }
1401
+ export function parseBorderStyleDeclaration(declaration, builder) {
1402
+ return parseBorderStyle(declaration.value, builder);
1403
+ }
1404
+ export function parseBorderStyle(value, builder) {
1405
+ const allowed = new Set(["solid", "dotted", "dashed"]);
1406
+ if (typeof value === "string") {
1407
+ if (allowed.has(value)) {
1408
+ return value;
1409
+ } else {
1410
+ builder.addWarning("value", value);
1411
+ return undefined;
1412
+ }
1413
+ } else if (value.top === value.bottom && value.top === value.left && value.top === value.right && allowed.has(value.top)) {
1414
+ return value.top;
1415
+ }
1416
+ builder.addWarning("value", value.top);
1417
+ return undefined;
1418
+ }
1419
+ export function parseBorderBlockWidth(declaration, builder) {
1420
+ builder.addDescriptor("border-top-width", parseBorderSideWidth(declaration.value.start, builder));
1421
+ builder.addDescriptor("border-bottom-width", parseBorderSideWidth(declaration.value.end, builder));
1422
+ }
1423
+ function parseBorderBlockStyle(declaration, builder) {
1424
+ if (declaration.value.start === declaration.value.end) {
1425
+ builder.addDescriptor("border-style", parseBorderStyle(declaration.value.start, builder));
1426
+ } else {
1427
+ builder.addWarning("property", "border-block-style");
1428
+ }
1429
+ }
1430
+ export function parseBorderSideWidthDeclaration(declaration, builder) {
1431
+ if (declaration.property.includes("block")) {
1432
+ builder.addDescriptor(`border-${declaration.property.includes("start") ? "top" : "bottom"}-width`, parseBorderSideWidth(declaration.value, builder));
1433
+ return;
1434
+ } else if (declaration.property.includes("inline")) {
1435
+ builder.addDescriptor(`border-${declaration.property.includes("start") ? "left" : "right"}-width`, parseBorderSideWidth(declaration.value, builder));
1436
+ return;
1437
+ } else {
1438
+ return parseBorderSideWidth(declaration.value, builder);
1439
+ }
1440
+ }
1441
+ export function parseBorderSideWidth(value, builder) {
1442
+ if (value.type === "length") {
1443
+ return parseLength(value.value, builder);
1444
+ }
1445
+ builder.addWarning("value", value.type);
1446
+ return undefined;
1447
+ }
1448
+ export function parseVerticalAlign({
1449
+ value
1450
+ }, builder) {
1451
+ if (value.type === "length") {
1452
+ return undefined;
1453
+ }
1454
+ const allowed = new Set(["auto", "top", "bottom", "middle"]);
1455
+ if (allowed.has(value.value)) {
1456
+ return value.value;
1457
+ }
1458
+ builder.addWarning("value", value.value);
1459
+ return undefined;
1460
+ }
1461
+ function parseFontFamily({
1462
+ value
1463
+ }) {
1464
+ // React Native only allows one font family - better hope this is the right one :)
1465
+ return value[0];
1466
+ }
1467
+ export function parseLineHeightDeclaration(declaration, builder) {
1468
+ return parseLineHeight(declaration.value, builder);
1469
+ }
1470
+ export function parseLineHeight(value, builder) {
1471
+ switch (value.type) {
1472
+ case "normal":
1473
+ return undefined;
1474
+ case "number":
1475
+ return [{}, "em", [value.value], 1];
1476
+ case "length":
1477
+ {
1478
+ const length = value.value;
1479
+ switch (length.type) {
1480
+ case "dimension":
1481
+ return parseLength(length, builder);
1482
+ case "percentage":
1483
+ case "calc":
1484
+ builder.addWarning("style", "line-height", typeof length.value === "number" ? length.value : JSON.stringify(length.value));
1485
+ return;
1486
+ default:
1487
+ {
1488
+ length;
1489
+ }
1490
+ }
1491
+ return;
1492
+ }
1493
+ default:
1494
+ {
1495
+ value;
1496
+ }
1497
+ }
1498
+ return;
1499
+ }
1500
+ export function parseFontSizeDeclaration(declaration, builder) {
1501
+ const fontSize = parseFontSize(declaration.value, builder);
1502
+ builder.addDescriptor("fontSize", fontSize);
1503
+ builder.addDescriptor("--__rn-css-em", fontSize);
1504
+ }
1505
+ export function parseFontSize(value, builder) {
1506
+ switch (value.type) {
1507
+ case "length":
1508
+ return parseLength(value.value, builder);
1509
+ case "absolute":
1510
+ case "relative":
1511
+ builder.addWarning("value", value.value);
1512
+ return undefined;
1513
+ default:
1514
+ {
1515
+ value;
1516
+ }
1517
+ }
1518
+ return;
1519
+ }
1520
+ export function parseFontStyleDeclaration(declaration, builder) {
1521
+ return parseFontStyle(declaration.value, builder);
1522
+ }
1523
+ export function parseFontStyle(value, builder) {
1524
+ switch (value.type) {
1525
+ case "normal":
1526
+ case "italic":
1527
+ return value.type;
1528
+ case "oblique":
1529
+ builder.addWarning("value", value.type);
1530
+ return undefined;
1531
+ default:
1532
+ {
1533
+ value;
1534
+ }
1535
+ }
1536
+ return;
1537
+ }
1538
+ export function parseFontVariantCapsDeclaration(declaration, builder) {
1539
+ return parseFontVariantCaps(declaration.value, builder);
1540
+ }
1541
+ export function parseFontVariantCaps(value, builder) {
1542
+ const allowed = new Set(["small-caps", "oldstyle-nums", "lining-nums", "tabular-nums", "proportional-nums"]);
1543
+ if (allowed.has(value)) {
1544
+ return value;
1545
+ }
1546
+ builder.addWarning("value", value);
1547
+ return undefined;
1548
+ }
1549
+ export function parseLengthOrCoercePercentageToRuntime(value, builder) {
1550
+ return parseLength(value, builder);
1551
+ }
1552
+ export function parseGap(declaration, builder) {
1553
+ if ("column" in declaration.value) {
1554
+ builder.addDescriptor("row-gap", parseGapValue(declaration.value.row, builder));
1555
+ builder.addDescriptor("column-gap", parseGapValue(declaration.value.column, builder));
1556
+ return;
1557
+ } else {
1558
+ if (declaration.value.type === "normal") {
1559
+ builder.addWarning("value", declaration.value.type);
1560
+ return;
1561
+ }
1562
+ return parseLength(declaration.value.value, builder);
1563
+ }
1564
+ }
1565
+ function parseGapValue(value, builder) {
1566
+ if (value.type === "normal") {
1567
+ return;
1568
+ } else {
1569
+ return parseLength(value.value, builder);
1570
+ }
1571
+ }
1572
+ export function parseTextAlign({
1573
+ value
1574
+ }, builder) {
1575
+ const allowed = new Set(["auto", "left", "right", "center", "justify"]);
1576
+ if (allowed.has(value)) {
1577
+ return value;
1578
+ }
1579
+ builder.addWarning("value", value);
1580
+ return undefined;
1581
+ }
1582
+ export function parseBoxShadow({
1583
+ value
1584
+ }, builder) {
1585
+ for (const [index, shadow] of value.entries()) {
1586
+ builder.addDescriptor(`boxShadow.[${index}].color`, parseColor(shadow.color, builder));
1587
+ builder.addDescriptor(`boxShadow.[${index}].offsetX`, parseLength(shadow.xOffset, builder));
1588
+ builder.addDescriptor(`boxShadow.[${index}].offsetY`, parseLength(shadow.yOffset, builder));
1589
+ builder.addDescriptor(`boxShadow.[${index}].blurRadius`, parseLength(shadow.blur, builder));
1590
+ builder.addDescriptor(`boxShadow.[${index}].spreadDistance`, parseLength(shadow.spread, builder));
1591
+ builder.addDescriptor(`boxShadow.[${index}].inset`, shadow.inset ? true : undefined);
1592
+ }
1593
+ }
1594
+ export function parseDisplay({
1595
+ value
1596
+ }, builder) {
1597
+ if (value.type === "keyword") {
1598
+ if (value.value === "none") {
1599
+ return value.value;
1600
+ } else {
1601
+ builder.addWarning("value", value.value);
1602
+ return;
1603
+ }
1604
+ } else {
1605
+ if (value.outside === "block") {
1606
+ switch (value.inside.type) {
1607
+ case "flow":
1608
+ if (value.isListItem) {
1609
+ builder.addWarning("value", "list-item");
1610
+ } else {
1611
+ builder.addWarning("value", "block");
1612
+ }
1613
+ return;
1614
+ case "flex":
1615
+ return value.inside.type;
1616
+ case "flow-root":
1617
+ case "table":
1618
+ case "box":
1619
+ case "grid":
1620
+ case "ruby":
1621
+ builder.addWarning("value", value.inside.type);
1622
+ return;
1623
+ }
1624
+ } else {
1625
+ switch (value.inside.type) {
1626
+ case "flow":
1627
+ builder.addWarning("value", "inline");
1628
+ return;
1629
+ case "flow-root":
1630
+ builder.addWarning("value", "inline-block");
1631
+ return;
1632
+ case "table":
1633
+ builder.addWarning("value", "inline-table");
1634
+ return;
1635
+ case "flex":
1636
+ builder.addWarning("value", "inline-flex");
1637
+ return;
1638
+ case "box":
1639
+ case "grid":
1640
+ builder.addWarning("value", "inline-grid");
1641
+ return;
1642
+ case "ruby":
1643
+ builder.addWarning("value", value.inside.type);
1644
+ return;
1645
+ }
1646
+ }
1647
+ }
1648
+ }
1649
+ export function parseAspectRatio({
1650
+ value
1651
+ }) {
1652
+ if (!value.ratio) {
1653
+ return;
1654
+ } else if (value.auto) {
1655
+ return "auto";
1656
+ } else {
1657
+ const [width, height] = value.ratio;
1658
+ if (width === height) {
1659
+ return 1;
1660
+ } else {
1661
+ return `${width}/${height}`;
1662
+ }
1663
+ }
1664
+ }
1665
+ export function parseDimension({
1666
+ unit,
1667
+ value
1668
+ }, builder) {
1669
+ switch (unit) {
1670
+ case "px":
1671
+ if (value === Infinity) {
1672
+ return 9999;
1673
+ } else {
1674
+ return value;
1675
+ }
1676
+ case "%":
1677
+ return `${value}%`;
1678
+ case "rnh":
1679
+ case "rnw":
1680
+ return [{}, unit, [value / 100], 1];
1681
+ default:
1682
+ {
1683
+ builder.addWarning("value", `${value}${unit}`);
1684
+ return;
1685
+ }
1686
+ }
1687
+ }
1688
+ export function parseUserSelect({
1689
+ value
1690
+ }, builder) {
1691
+ const allowed = ["auto", "text", "none", "contain", "all"];
1692
+ if (allowed.includes(value)) {
1693
+ return value;
1694
+ } else {
1695
+ builder.addWarning("value", value);
1696
+ return;
1697
+ }
1698
+ }
1699
+ export function parseSVGPaint({
1700
+ value,
1701
+ property
1702
+ }, builder) {
1703
+ let parsedValue;
1704
+ if (value.type === "none") {
1705
+ parsedValue = "transparent";
1706
+ } else if (value.type === "color") {
1707
+ parsedValue = parseColor(value.value, builder);
1708
+ } else {
1709
+ return;
1710
+ }
1711
+ builder.addDescriptor(property, parsedValue);
1712
+ }
1713
+ export function round(number) {
1714
+ return Math.round((number + Number.EPSILON) * 10000) / 10000;
1715
+ }
1716
+ export function parseDimensionPercentageFor_LengthValue(value, builder) {
1717
+ if (value.type === "calc") {
1718
+ return undefined;
1719
+ } else if (value.type === "percentage") {
1720
+ return `${value.value}%`;
1721
+ } else {
1722
+ return parseLength(value.value, builder);
1723
+ }
1724
+ }
1725
+ const allowAutoProperties = new Set(["pointer-events"]);
1726
+ export function parseEnv(value, builder) {
1727
+ switch (value.name.type) {
1728
+ case "ua":
1729
+ switch (value.name.value) {
1730
+ case "safe-area-inset-top":
1731
+ case "safe-area-inset-right":
1732
+ case "safe-area-inset-bottom":
1733
+ case "safe-area-inset-left":
1734
+ return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder, value.name.value)], 1];
1735
+ case "viewport-segment-width":
1736
+ case "viewport-segment-height":
1737
+ case "viewport-segment-top":
1738
+ case "viewport-segment-left":
1739
+ case "viewport-segment-bottom":
1740
+ case "viewport-segment-right":
1741
+ }
1742
+ break;
1743
+ case "custom":
1744
+ case "unknown":
1745
+ }
1746
+ return;
1747
+ }
1748
+ export function parseCalcFn(name, tokens, builder, property) {
1749
+ const args = parseCalcArguments(tokens, builder, property);
1750
+ if (args) {
1751
+ return [{}, name, args];
1752
+ }
1753
+ return;
1754
+ }
1755
+ export function parseCalcArguments([...args], builder, property) {
1756
+ const parsed = [];
1757
+ for (const arg of args) {
1758
+ switch (arg.type) {
1759
+ case "env":
1760
+ {
1761
+ parsed.push(parseEnv(arg.value, builder));
1762
+ break;
1763
+ }
1764
+ case "var":
1765
+ case "function":
1766
+ case "unresolved-color":
1767
+ {
1768
+ const value = parseUnparsed(arg, builder, property);
1769
+ if (value === undefined) {
1770
+ return undefined;
1771
+ }
1772
+ parsed.push(value);
1773
+ break;
1774
+ }
1775
+ case "length":
1776
+ {
1777
+ const value = parseLength(arg.value, builder);
1778
+ if (value !== undefined) {
1779
+ parsed.push(value);
1780
+ }
1781
+ break;
1782
+ }
1783
+ case "color":
1784
+ case "url":
1785
+ case "angle":
1786
+ case "time":
1787
+ case "resolution":
1788
+ case "dashed-ident":
1789
+ break;
1790
+ case "token":
1791
+ switch (arg.value.type) {
1792
+ case "delim":
1793
+ switch (arg.value.value) {
1794
+ case "+":
1795
+ case "-":
1796
+ case "*":
1797
+ case "/":
1798
+ parsed.push(arg.value.value);
1799
+ break;
1800
+ }
1801
+ break;
1802
+ case "percentage":
1803
+ parsed.push(`${round(arg.value.value * 100)}%`);
1804
+ break;
1805
+ case "number":
1806
+ {
1807
+ parsed.push(round(arg.value.value));
1808
+ break;
1809
+ }
1810
+ case "parenthesis-block":
1811
+ {
1812
+ parsed.push("(");
1813
+ break;
1814
+ }
1815
+ case "close-parenthesis":
1816
+ parsed.push(")");
1817
+ break;
1818
+ case "string":
1819
+ case "function":
1820
+ case "ident":
1821
+ case "at-keyword":
1822
+ case "hash":
1823
+ case "id-hash":
1824
+ case "unquoted-url":
1825
+ case "dimension":
1826
+ case "white-space":
1827
+ case "comment":
1828
+ case "colon":
1829
+ case "semicolon":
1830
+ case "comma":
1831
+ case "include-match":
1832
+ case "dash-match":
1833
+ case "prefix-match":
1834
+ case "suffix-match":
1835
+ case "substring-match":
1836
+ case "cdo":
1837
+ case "cdc":
1838
+ case "square-bracket-block":
1839
+ case "curly-bracket-block":
1840
+ case "bad-url":
1841
+ case "bad-string":
1842
+ case "close-square-bracket":
1843
+ case "close-curly-bracket":
1844
+ }
1845
+ }
1846
+ }
1847
+ return parsed;
1848
+ }
1849
+ export function parseTranslateProp(value, prop, builder) {
1850
+ if (value === "none") {
1851
+ return 0;
1852
+ }
1853
+ return parseLength(value[prop], builder);
1854
+ }
1855
+ export function parseUnresolvedColor(color, builder, property, allowAuto) {
1856
+ switch (color.type) {
1857
+ case "rgb":
1858
+ return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder, property)]];
1859
+ case "hsl":
1860
+ return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder, property)]];
1861
+ case "light-dark":
1862
+ {
1863
+ const extraRule = builder.extendRule({
1864
+ m: [["=", "prefers-color-scheme", "dark"]]
1865
+ });
1866
+ builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder, property, allowAuto), false, extraRule);
1867
+ builder.addExtraRule(extraRule);
1868
+ return reduceParseUnparsed(color.light, builder, property, allowAuto);
1869
+ }
1870
+ default:
1871
+ color;
1872
+ }
1873
+ return;
1874
+ }
1875
+ export function allEqual(...params) {
1876
+ return params.every((param, index, array) => {
1877
+ return index === 0 ? true : equal(array[0], param);
1878
+ });
1879
+ }
1880
+ export function equal(a, b) {
1881
+ if (a === b) return true;
1882
+ if (typeof a !== typeof b) return false;
1883
+ if (a === null || b === null) return false;
1884
+ if (Array.isArray(a) && Array.isArray(b)) {
1885
+ if (a.length !== b.length) return false;
1886
+ for (let i = 0; i < a.length; i++) {
1887
+ if (!equal(a[i], b[i])) return false;
1888
+ }
1889
+ return true;
1890
+ }
1891
+ if (typeof a === "object" && typeof b === "object") {
1892
+ if (Object.keys(a).length !== Object.keys(b).length) return false;
1893
+ for (const key in a) {
1894
+ if (!equal(a[key], b[key])) return false;
1895
+ }
1896
+ return true;
1897
+ }
1898
+ return false;
1899
+ }
1900
+ export function parseTime(time) {
1901
+ return time.type === "milliseconds" ? time.value : time.value * 1000;
1902
+ }
1903
+ export function parseSize2DDimensionPercentageDeclaration(declaration, builder) {
1904
+ return parseSize2DDimensionPercentage(declaration.value, builder);
1905
+ }
1906
+ export function parseSize2DDimensionPercentage(value, builder) {
1907
+ return parseLength(value[0], builder);
1908
+ }
1909
+ export function addTransitionValue(declaration, builder) {
1910
+ switch (declaration.property) {
1911
+ case "transition":
1912
+ {
1913
+ const grouped = {};
1914
+ for (const animation of declaration.value) {
1915
+ for (const [key, value] of Object.entries(animation)) {
1916
+ grouped[key] ??= [];
1917
+ grouped[key].push(value);
1918
+ }
1919
+ }
1920
+ for (const [property, value] of Object.entries(grouped)) {
1921
+ addTransitionValue({
1922
+ property: `transition-${kebabCase(property)}`,
1923
+ value
1924
+ }, builder);
1925
+ }
1926
+ break;
1927
+ }
1928
+ case "transition-property":
1929
+ {
1930
+ builder.addDescriptor(declaration.property, declaration.value.map(v => v.property).filter(v => v in parsers || v === "all" || v === "none").map(v => toRNProperty(v)));
1931
+ return;
1932
+ }
1933
+ case "transition-duration":
1934
+ builder.addDescriptor(declaration.property, declaration.value.map(t => parseTime(t)));
1935
+ return;
1936
+ case "transition-delay":
1937
+ builder.addDescriptor(declaration.property, declaration.value.map(t => parseTime(t)));
1938
+ return;
1939
+ case "transition-timing-function":
1940
+ builder.addDescriptor(declaration.property, parseEasingFunction(declaration.value));
1941
+ return;
1942
+ }
1943
+ }
1944
+ export function addAnimationValue(declaration, builder) {
1945
+ switch (declaration.property) {
1946
+ case "animation":
1947
+ {
1948
+ const grouped = {};
1949
+ for (const animation of declaration.value) {
1950
+ for (const [key, value] of Object.entries(animation)) {
1951
+ grouped[key] ??= [];
1952
+ grouped[key].push(value);
1953
+ }
1954
+ }
1955
+ for (const [property, value] of Object.entries(grouped)) {
1956
+ addAnimationValue({
1957
+ property: `animation-${kebabCase(property)}`,
1958
+ value
1959
+ }, builder);
1960
+ }
1961
+ break;
1962
+ }
1963
+ case "animation-delay":
1964
+ {
1965
+ builder.addDescriptor(declaration.property, declaration.value.map(t => parseTime(t)));
1966
+ break;
1967
+ }
1968
+ case "animation-direction":
1969
+ {
1970
+ builder.addDescriptor(declaration.property, declaration.value);
1971
+ break;
1972
+ }
1973
+ case "animation-duration":
1974
+ {
1975
+ builder.addDescriptor(declaration.property, declaration.value.map(t => parseTime(t)));
1976
+ break;
1977
+ }
1978
+ case "animation-fill-mode":
1979
+ {
1980
+ builder.addDescriptor(declaration.property, declaration.value);
1981
+ break;
1982
+ }
1983
+ case "animation-iteration-count":
1984
+ {
1985
+ builder.addDescriptor(declaration.property, parseIterationCount(declaration.value));
1986
+ break;
1987
+ }
1988
+ case "animation-name":
1989
+ {
1990
+ builder.addDescriptor(declaration.property, declaration.value.map(v => v.type === "none" ? "none" : [{}, "animationName", [v.value], 1]));
1991
+ break;
1992
+ }
1993
+ case "animation-play-state":
1994
+ {
1995
+ builder.addDescriptor(declaration.property, declaration.value);
1996
+ break;
1997
+ }
1998
+ case "animation-timing-function":
1999
+ {
2000
+ builder.addDescriptor(declaration.property, parseEasingFunction(declaration.value));
2001
+ break;
2002
+ }
2003
+ }
2004
+ }
2005
+ export function kebabCase(str) {
2006
+ return str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? "-" : "") + $.toLowerCase());
2007
+ }
2008
+ function parseBackgroundImage(declaration, builder) {
2009
+ builder.addDescriptor("experimental_backgroundImage", declaration.value.flatMap(image => {
2010
+ switch (image.type) {
2011
+ case "gradient":
2012
+ {
2013
+ const gradient = parseGradient(image.value, builder);
2014
+ return gradient ? [gradient] : [];
2015
+ }
2016
+ case "none":
2017
+ return ["none"];
2018
+ }
2019
+ return [];
2020
+ }));
2021
+ return;
2022
+ }
2023
+ function parseGradient(gradient, builder) {
2024
+ switch (gradient.type) {
2025
+ case "linear":
2026
+ {
2027
+ return [{}, "linear-gradient", [parseLineDirection(gradient.direction, builder), ...gradient.items.map(item => parseGradientItem(item, builder))]];
2028
+ }
2029
+ }
2030
+ return;
2031
+ }
2032
+ function parseLineDirection(lineDirection, builder) {
2033
+ switch (lineDirection.type) {
2034
+ case "corner":
2035
+ return `to ${lineDirection.horizontal} ${lineDirection.vertical}`;
2036
+ case "horizontal":
2037
+ case "vertical":
2038
+ return `to ${lineDirection.value}`;
2039
+ case "angle":
2040
+ return parseAngle(lineDirection.value, builder);
2041
+ default:
2042
+ {
2043
+ lineDirection;
2044
+ }
2045
+ }
2046
+ return;
2047
+ }
2048
+ function parseGradientItem(item, builder) {
2049
+ switch (item.type) {
2050
+ case "color-stop":
2051
+ {
2052
+ const args = [parseColor(item.color, builder)];
2053
+ if (item.position) {
2054
+ args.push(parseLength(item.position, builder));
2055
+ }
2056
+ return [{}, "@colorStop", args, 1];
2057
+ }
2058
+ case "hint":
2059
+ return parseLength(item.value, builder);
2060
+ }
2061
+ }
2062
+ function parseFilter(declaration, builder) {
2063
+ if (declaration.value.type === "none") {
2064
+ return "unset";
2065
+ }
2066
+ return declaration.value.value.map(value => {
2067
+ switch (value.type) {
2068
+ case "opacity":
2069
+ case "blur":
2070
+ case "brightness":
2071
+ case "contrast":
2072
+ case "grayscale":
2073
+ case "invert":
2074
+ case "saturate":
2075
+ case "sepia":
2076
+ return {
2077
+ [value.type]: parseLength(value.value, builder)
2078
+ };
2079
+ case "hue-rotate":
2080
+ return {
2081
+ [value.type]: parseAngle(value.value, builder)
2082
+ };
2083
+ case "drop-shadow":
2084
+ return [{}, toRNProperty(value.type), [parseLength(value.value.xOffset, builder), parseLength(value.value.yOffset, builder), parseLength(value.value.blur, builder), parseColor(value.value.color, builder)]];
2085
+ case "url":
2086
+ return;
2087
+ }
2088
+ }).filter(value => value !== undefined);
2089
+ }
2090
+ const namedColors = new Set(["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "green", "greenyellow", "grey", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen"]);
2091
+ //# sourceMappingURL=declarations.js.map