rnwind 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/lib/cjs/core/parser/animation.cjs +427 -0
  2. package/lib/cjs/core/parser/animation.cjs.map +1 -0
  3. package/lib/cjs/core/parser/animation.d.ts +126 -0
  4. package/lib/cjs/core/parser/border-dispatcher.cjs +180 -0
  5. package/lib/cjs/core/parser/border-dispatcher.cjs.map +1 -0
  6. package/lib/cjs/core/parser/border-dispatcher.d.ts +15 -0
  7. package/lib/cjs/core/parser/case-convert.cjs +15 -0
  8. package/lib/cjs/core/parser/case-convert.cjs.map +1 -0
  9. package/lib/cjs/core/parser/case-convert.d.ts +6 -0
  10. package/lib/cjs/core/parser/color-properties-dispatcher.cjs +84 -0
  11. package/lib/cjs/core/parser/color-properties-dispatcher.cjs.map +1 -0
  12. package/lib/cjs/core/parser/color-properties-dispatcher.d.ts +19 -0
  13. package/lib/cjs/core/parser/color.cjs +164 -0
  14. package/lib/cjs/core/parser/color.cjs.map +1 -0
  15. package/lib/cjs/core/parser/color.d.ts +12 -0
  16. package/lib/cjs/core/parser/constants.cjs +21 -0
  17. package/lib/cjs/core/parser/constants.cjs.map +1 -0
  18. package/lib/cjs/core/parser/constants.d.ts +8 -0
  19. package/lib/cjs/core/parser/declaration.cjs +347 -0
  20. package/lib/cjs/core/parser/declaration.cjs.map +1 -0
  21. package/lib/cjs/core/parser/declaration.d.ts +15 -0
  22. package/lib/cjs/core/parser/gradient.cjs +132 -0
  23. package/lib/cjs/core/parser/gradient.cjs.map +1 -0
  24. package/lib/cjs/core/parser/gradient.d.ts +59 -0
  25. package/lib/cjs/core/parser/haptics.cjs +73 -0
  26. package/lib/cjs/core/parser/haptics.cjs.map +1 -0
  27. package/lib/cjs/core/parser/haptics.d.ts +47 -0
  28. package/lib/cjs/core/parser/index.d.ts +8 -0
  29. package/lib/cjs/core/parser/keyframes.cjs +95 -0
  30. package/lib/cjs/core/parser/keyframes.cjs.map +1 -0
  31. package/lib/cjs/core/parser/keyframes.d.ts +26 -0
  32. package/lib/cjs/core/parser/layout-dispatcher.cjs +100 -0
  33. package/lib/cjs/core/parser/layout-dispatcher.cjs.map +1 -0
  34. package/lib/cjs/core/parser/layout-dispatcher.d.ts +14 -0
  35. package/lib/cjs/core/parser/length.cjs +96 -0
  36. package/lib/cjs/core/parser/length.cjs.map +1 -0
  37. package/lib/cjs/core/parser/length.d.ts +48 -0
  38. package/lib/cjs/core/parser/motion-dispatcher.cjs +77 -0
  39. package/lib/cjs/core/parser/motion-dispatcher.cjs.map +1 -0
  40. package/lib/cjs/core/parser/motion-dispatcher.d.ts +11 -0
  41. package/lib/cjs/core/parser/property.cjs +22 -0
  42. package/lib/cjs/core/parser/property.cjs.map +1 -0
  43. package/lib/cjs/core/parser/property.d.ts +8 -0
  44. package/lib/cjs/core/parser/safe-area.cjs +404 -0
  45. package/lib/cjs/core/parser/safe-area.cjs.map +1 -0
  46. package/lib/cjs/core/parser/safe-area.d.ts +39 -0
  47. package/lib/cjs/core/parser/selector.cjs +22 -0
  48. package/lib/cjs/core/parser/selector.cjs.map +1 -0
  49. package/lib/cjs/core/parser/selector.d.ts +11 -0
  50. package/lib/cjs/core/parser/shorthand.cjs +156 -0
  51. package/lib/cjs/core/parser/shorthand.cjs.map +1 -0
  52. package/lib/cjs/core/parser/shorthand.d.ts +61 -0
  53. package/lib/cjs/core/parser/text-truncate.cjs +78 -0
  54. package/lib/cjs/core/parser/text-truncate.cjs.map +1 -0
  55. package/lib/cjs/core/parser/text-truncate.d.ts +44 -0
  56. package/lib/cjs/core/parser/theme-vars.cjs +414 -0
  57. package/lib/cjs/core/parser/theme-vars.cjs.map +1 -0
  58. package/lib/cjs/core/parser/theme-vars.d.ts +61 -0
  59. package/lib/cjs/core/parser/tokens.cjs +304 -0
  60. package/lib/cjs/core/parser/tokens.cjs.map +1 -0
  61. package/lib/cjs/core/parser/tokens.d.ts +45 -0
  62. package/lib/cjs/core/parser/transform.cjs +198 -0
  63. package/lib/cjs/core/parser/transform.cjs.map +1 -0
  64. package/lib/cjs/core/parser/transform.d.ts +36 -0
  65. package/lib/cjs/core/parser/tw-parser.cjs +1567 -0
  66. package/lib/cjs/core/parser/tw-parser.cjs.map +1 -0
  67. package/lib/cjs/core/parser/tw-parser.d.ts +194 -0
  68. package/lib/cjs/core/parser/types.d.ts +37 -0
  69. package/lib/cjs/core/parser/typography-dispatcher.cjs +93 -0
  70. package/lib/cjs/core/parser/typography-dispatcher.cjs.map +1 -0
  71. package/lib/cjs/core/parser/typography-dispatcher.d.ts +11 -0
  72. package/lib/cjs/core/parser/typography.cjs +97 -0
  73. package/lib/cjs/core/parser/typography.cjs.map +1 -0
  74. package/lib/cjs/core/parser/typography.d.ts +43 -0
  75. package/lib/cjs/core/style-builder/build-style.cjs +397 -0
  76. package/lib/cjs/core/style-builder/build-style.cjs.map +1 -0
  77. package/lib/cjs/core/style-builder/build-style.d.ts +54 -0
  78. package/lib/cjs/core/style-builder/index.d.ts +3 -0
  79. package/lib/cjs/core/style-builder/union-builder.cjs +326 -0
  80. package/lib/cjs/core/style-builder/union-builder.cjs.map +1 -0
  81. package/lib/cjs/core/style-builder/union-builder.d.ts +128 -0
  82. package/lib/cjs/core/types.d.ts +14 -0
  83. package/lib/cjs/metro/dts.cjs +127 -0
  84. package/lib/cjs/metro/dts.cjs.map +1 -0
  85. package/lib/cjs/metro/dts.d.ts +16 -0
  86. package/lib/cjs/metro/index.cjs +19 -0
  87. package/lib/cjs/metro/index.cjs.map +1 -0
  88. package/lib/cjs/metro/index.d.ts +9 -0
  89. package/lib/cjs/metro/resolver.cjs +47 -0
  90. package/lib/cjs/metro/resolver.cjs.map +1 -0
  91. package/lib/cjs/metro/resolver.d.ts +22 -0
  92. package/lib/cjs/metro/state.cjs +251 -0
  93. package/lib/cjs/metro/state.cjs.map +1 -0
  94. package/lib/cjs/metro/state.d.ts +72 -0
  95. package/lib/cjs/metro/transform-ast.cjs +1255 -0
  96. package/lib/cjs/metro/transform-ast.cjs.map +1 -0
  97. package/lib/cjs/metro/transform-ast.d.ts +73 -0
  98. package/lib/cjs/metro/transformer.cjs +345 -0
  99. package/lib/cjs/metro/transformer.cjs.map +1 -0
  100. package/lib/cjs/metro/transformer.d.ts +47 -0
  101. package/lib/cjs/metro/warn-unknown-classes.cjs +86 -0
  102. package/lib/cjs/metro/warn-unknown-classes.cjs.map +1 -0
  103. package/lib/cjs/metro/warn-unknown-classes.d.ts +21 -0
  104. package/lib/cjs/metro/with-config.cjs +196 -0
  105. package/lib/cjs/metro/with-config.cjs.map +1 -0
  106. package/lib/cjs/metro/with-config.d.ts +57 -0
  107. package/lib/cjs/runtime/chain-handlers.cjs +37 -0
  108. package/lib/cjs/runtime/chain-handlers.cjs.map +1 -0
  109. package/lib/cjs/runtime/chain-handlers.d.ts +33 -0
  110. package/lib/cjs/runtime/components/rnwind-provider.cjs +98 -0
  111. package/lib/cjs/runtime/components/rnwind-provider.cjs.map +1 -0
  112. package/lib/cjs/runtime/components/rnwind-provider.d.ts +84 -0
  113. package/lib/cjs/runtime/gradient-types.d.ts +58 -0
  114. package/lib/cjs/runtime/haptics.cjs +113 -0
  115. package/lib/cjs/runtime/haptics.cjs.map +1 -0
  116. package/lib/cjs/runtime/haptics.d.ts +48 -0
  117. package/lib/cjs/runtime/hooks/use-css.cjs +21 -0
  118. package/lib/cjs/runtime/hooks/use-css.cjs.map +1 -0
  119. package/lib/cjs/runtime/hooks/use-css.d.ts +11 -0
  120. package/lib/cjs/runtime/hooks/use-interact.cjs +46 -0
  121. package/lib/cjs/runtime/hooks/use-interact.cjs.map +1 -0
  122. package/lib/cjs/runtime/hooks/use-interact.d.ts +42 -0
  123. package/lib/cjs/runtime/hooks/use-scheme.cjs +68 -0
  124. package/lib/cjs/runtime/hooks/use-scheme.cjs.map +1 -0
  125. package/lib/cjs/runtime/hooks/use-scheme.d.ts +34 -0
  126. package/lib/cjs/runtime/index.cjs +45 -0
  127. package/lib/cjs/runtime/index.cjs.map +1 -0
  128. package/lib/cjs/runtime/index.d.ts +27 -0
  129. package/lib/cjs/runtime/interactive-box.cjs +35 -0
  130. package/lib/cjs/runtime/interactive-box.cjs.map +1 -0
  131. package/lib/cjs/runtime/interactive-box.d.ts +40 -0
  132. package/lib/cjs/runtime/lookup-css.cjs +542 -0
  133. package/lib/cjs/runtime/lookup-css.cjs.map +1 -0
  134. package/lib/cjs/runtime/lookup-css.d.ts +164 -0
  135. package/lib/cjs/runtime/types.d.ts +29 -0
  136. package/lib/cjs/testing/index.cjs +367 -0
  137. package/lib/cjs/testing/index.cjs.map +1 -0
  138. package/lib/cjs/testing/index.d.ts +145 -0
  139. package/lib/esm/core/parser/animation.d.ts +126 -0
  140. package/lib/esm/core/parser/animation.mjs +408 -0
  141. package/lib/esm/core/parser/animation.mjs.map +1 -0
  142. package/lib/esm/core/parser/border-dispatcher.d.ts +15 -0
  143. package/lib/esm/core/parser/border-dispatcher.mjs +178 -0
  144. package/lib/esm/core/parser/border-dispatcher.mjs.map +1 -0
  145. package/lib/esm/core/parser/case-convert.d.ts +6 -0
  146. package/lib/esm/core/parser/case-convert.mjs +13 -0
  147. package/lib/esm/core/parser/case-convert.mjs.map +1 -0
  148. package/lib/esm/core/parser/color-properties-dispatcher.d.ts +19 -0
  149. package/lib/esm/core/parser/color-properties-dispatcher.mjs +82 -0
  150. package/lib/esm/core/parser/color-properties-dispatcher.mjs.map +1 -0
  151. package/lib/esm/core/parser/color.d.ts +12 -0
  152. package/lib/esm/core/parser/color.mjs +162 -0
  153. package/lib/esm/core/parser/color.mjs.map +1 -0
  154. package/lib/esm/core/parser/constants.d.ts +8 -0
  155. package/lib/esm/core/parser/constants.mjs +13 -0
  156. package/lib/esm/core/parser/constants.mjs.map +1 -0
  157. package/lib/esm/core/parser/declaration.d.ts +15 -0
  158. package/lib/esm/core/parser/declaration.mjs +345 -0
  159. package/lib/esm/core/parser/declaration.mjs.map +1 -0
  160. package/lib/esm/core/parser/gradient.d.ts +59 -0
  161. package/lib/esm/core/parser/gradient.mjs +130 -0
  162. package/lib/esm/core/parser/gradient.mjs.map +1 -0
  163. package/lib/esm/core/parser/haptics.d.ts +47 -0
  164. package/lib/esm/core/parser/haptics.mjs +71 -0
  165. package/lib/esm/core/parser/haptics.mjs.map +1 -0
  166. package/lib/esm/core/parser/index.d.ts +8 -0
  167. package/lib/esm/core/parser/keyframes.d.ts +26 -0
  168. package/lib/esm/core/parser/keyframes.mjs +91 -0
  169. package/lib/esm/core/parser/keyframes.mjs.map +1 -0
  170. package/lib/esm/core/parser/layout-dispatcher.d.ts +14 -0
  171. package/lib/esm/core/parser/layout-dispatcher.mjs +98 -0
  172. package/lib/esm/core/parser/layout-dispatcher.mjs.map +1 -0
  173. package/lib/esm/core/parser/length.d.ts +48 -0
  174. package/lib/esm/core/parser/length.mjs +90 -0
  175. package/lib/esm/core/parser/length.mjs.map +1 -0
  176. package/lib/esm/core/parser/motion-dispatcher.d.ts +11 -0
  177. package/lib/esm/core/parser/motion-dispatcher.mjs +75 -0
  178. package/lib/esm/core/parser/motion-dispatcher.mjs.map +1 -0
  179. package/lib/esm/core/parser/property.d.ts +8 -0
  180. package/lib/esm/core/parser/property.mjs +20 -0
  181. package/lib/esm/core/parser/property.mjs.map +1 -0
  182. package/lib/esm/core/parser/safe-area.d.ts +39 -0
  183. package/lib/esm/core/parser/safe-area.mjs +402 -0
  184. package/lib/esm/core/parser/safe-area.mjs.map +1 -0
  185. package/lib/esm/core/parser/selector.d.ts +11 -0
  186. package/lib/esm/core/parser/selector.mjs +20 -0
  187. package/lib/esm/core/parser/selector.mjs.map +1 -0
  188. package/lib/esm/core/parser/shorthand.d.ts +61 -0
  189. package/lib/esm/core/parser/shorthand.mjs +148 -0
  190. package/lib/esm/core/parser/shorthand.mjs.map +1 -0
  191. package/lib/esm/core/parser/text-truncate.d.ts +44 -0
  192. package/lib/esm/core/parser/text-truncate.mjs +75 -0
  193. package/lib/esm/core/parser/text-truncate.mjs.map +1 -0
  194. package/lib/esm/core/parser/theme-vars.d.ts +61 -0
  195. package/lib/esm/core/parser/theme-vars.mjs +409 -0
  196. package/lib/esm/core/parser/theme-vars.mjs.map +1 -0
  197. package/lib/esm/core/parser/tokens.d.ts +45 -0
  198. package/lib/esm/core/parser/tokens.mjs +298 -0
  199. package/lib/esm/core/parser/tokens.mjs.map +1 -0
  200. package/lib/esm/core/parser/transform.d.ts +36 -0
  201. package/lib/esm/core/parser/transform.mjs +193 -0
  202. package/lib/esm/core/parser/transform.mjs.map +1 -0
  203. package/lib/esm/core/parser/tw-parser.d.ts +194 -0
  204. package/lib/esm/core/parser/tw-parser.mjs +1565 -0
  205. package/lib/esm/core/parser/tw-parser.mjs.map +1 -0
  206. package/lib/esm/core/parser/types.d.ts +37 -0
  207. package/lib/esm/core/parser/typography-dispatcher.d.ts +11 -0
  208. package/lib/esm/core/parser/typography-dispatcher.mjs +91 -0
  209. package/lib/esm/core/parser/typography-dispatcher.mjs.map +1 -0
  210. package/lib/esm/core/parser/typography.d.ts +43 -0
  211. package/lib/esm/core/parser/typography.mjs +91 -0
  212. package/lib/esm/core/parser/typography.mjs.map +1 -0
  213. package/lib/esm/core/style-builder/build-style.d.ts +54 -0
  214. package/lib/esm/core/style-builder/build-style.mjs +395 -0
  215. package/lib/esm/core/style-builder/build-style.mjs.map +1 -0
  216. package/lib/esm/core/style-builder/index.d.ts +3 -0
  217. package/lib/esm/core/style-builder/union-builder.d.ts +128 -0
  218. package/lib/esm/core/style-builder/union-builder.mjs +324 -0
  219. package/lib/esm/core/style-builder/union-builder.mjs.map +1 -0
  220. package/lib/esm/core/types.d.ts +14 -0
  221. package/lib/esm/metro/dts.d.ts +16 -0
  222. package/lib/esm/metro/dts.mjs +125 -0
  223. package/lib/esm/metro/dts.mjs.map +1 -0
  224. package/lib/esm/metro/index.d.ts +9 -0
  225. package/lib/esm/metro/index.mjs +6 -0
  226. package/lib/esm/metro/index.mjs.map +1 -0
  227. package/lib/esm/metro/resolver.d.ts +22 -0
  228. package/lib/esm/metro/resolver.mjs +43 -0
  229. package/lib/esm/metro/resolver.mjs.map +1 -0
  230. package/lib/esm/metro/state.d.ts +72 -0
  231. package/lib/esm/metro/state.mjs +243 -0
  232. package/lib/esm/metro/state.mjs.map +1 -0
  233. package/lib/esm/metro/transform-ast.d.ts +73 -0
  234. package/lib/esm/metro/transform-ast.mjs +1234 -0
  235. package/lib/esm/metro/transform-ast.mjs.map +1 -0
  236. package/lib/esm/metro/transformer.d.ts +47 -0
  237. package/lib/esm/metro/transformer.mjs +322 -0
  238. package/lib/esm/metro/transformer.mjs.map +1 -0
  239. package/lib/esm/metro/warn-unknown-classes.d.ts +21 -0
  240. package/lib/esm/metro/warn-unknown-classes.mjs +84 -0
  241. package/lib/esm/metro/warn-unknown-classes.mjs.map +1 -0
  242. package/lib/esm/metro/with-config.d.ts +57 -0
  243. package/lib/esm/metro/with-config.mjs +194 -0
  244. package/lib/esm/metro/with-config.mjs.map +1 -0
  245. package/lib/esm/runtime/chain-handlers.d.ts +33 -0
  246. package/lib/esm/runtime/chain-handlers.mjs +34 -0
  247. package/lib/esm/runtime/chain-handlers.mjs.map +1 -0
  248. package/lib/esm/runtime/components/rnwind-provider.d.ts +84 -0
  249. package/lib/esm/runtime/components/rnwind-provider.mjs +94 -0
  250. package/lib/esm/runtime/components/rnwind-provider.mjs.map +1 -0
  251. package/lib/esm/runtime/gradient-types.d.ts +58 -0
  252. package/lib/esm/runtime/haptics.d.ts +48 -0
  253. package/lib/esm/runtime/haptics.mjs +110 -0
  254. package/lib/esm/runtime/haptics.mjs.map +1 -0
  255. package/lib/esm/runtime/hooks/use-css.d.ts +11 -0
  256. package/lib/esm/runtime/hooks/use-css.mjs +19 -0
  257. package/lib/esm/runtime/hooks/use-css.mjs.map +1 -0
  258. package/lib/esm/runtime/hooks/use-interact.d.ts +42 -0
  259. package/lib/esm/runtime/hooks/use-interact.mjs +44 -0
  260. package/lib/esm/runtime/hooks/use-interact.mjs.map +1 -0
  261. package/lib/esm/runtime/hooks/use-scheme.d.ts +34 -0
  262. package/lib/esm/runtime/hooks/use-scheme.mjs +63 -0
  263. package/lib/esm/runtime/hooks/use-scheme.mjs.map +1 -0
  264. package/lib/esm/runtime/index.d.ts +27 -0
  265. package/lib/esm/runtime/index.mjs +18 -0
  266. package/lib/esm/runtime/index.mjs.map +1 -0
  267. package/lib/esm/runtime/interactive-box.d.ts +40 -0
  268. package/lib/esm/runtime/interactive-box.mjs +33 -0
  269. package/lib/esm/runtime/interactive-box.mjs.map +1 -0
  270. package/lib/esm/runtime/lookup-css.d.ts +164 -0
  271. package/lib/esm/runtime/lookup-css.mjs +531 -0
  272. package/lib/esm/runtime/lookup-css.mjs.map +1 -0
  273. package/lib/esm/runtime/types.d.ts +29 -0
  274. package/lib/esm/testing/index.d.ts +145 -0
  275. package/lib/esm/testing/index.mjs +344 -0
  276. package/lib/esm/testing/index.mjs.map +1 -0
  277. package/package.json +79 -13
  278. package/preset.css +1171 -0
  279. package/src/core/parser/animation.ts +404 -0
  280. package/src/core/parser/border-dispatcher.ts +176 -0
  281. package/src/core/parser/case-convert.ts +10 -0
  282. package/src/core/parser/color-properties-dispatcher.ts +78 -0
  283. package/src/core/parser/color.ts +157 -0
  284. package/src/core/parser/constants.ts +11 -0
  285. package/src/core/parser/declaration.ts +340 -0
  286. package/src/core/parser/gradient.ts +148 -0
  287. package/src/core/parser/haptics.ts +88 -0
  288. package/src/core/parser/index.ts +8 -0
  289. package/src/core/parser/keyframes.ts +84 -0
  290. package/src/core/parser/layout-dispatcher.ts +92 -0
  291. package/src/core/parser/length.ts +100 -0
  292. package/src/core/parser/motion-dispatcher.ts +89 -0
  293. package/src/core/parser/property.ts +15 -0
  294. package/src/core/parser/safe-area.ts +404 -0
  295. package/src/core/parser/selector.ts +17 -0
  296. package/src/core/parser/shorthand.ts +152 -0
  297. package/src/core/parser/text-truncate.ts +79 -0
  298. package/src/core/parser/theme-vars.ts +412 -0
  299. package/src/core/parser/tokens.ts +286 -0
  300. package/src/core/parser/transform.ts +195 -0
  301. package/src/core/parser/tw-parser.ts +1709 -0
  302. package/src/core/parser/types.ts +45 -0
  303. package/src/core/parser/typography-dispatcher.ts +83 -0
  304. package/src/core/parser/typography.ts +83 -0
  305. package/src/core/style-builder/build-style.ts +442 -0
  306. package/src/core/style-builder/index.ts +3 -0
  307. package/src/core/style-builder/union-builder.ts +328 -0
  308. package/src/core/types.ts +15 -0
  309. package/src/metro/dts.ts +128 -0
  310. package/src/metro/index.ts +9 -0
  311. package/src/metro/resolver.ts +42 -0
  312. package/src/metro/state.ts +257 -0
  313. package/src/metro/transform-ast.ts +1498 -0
  314. package/src/metro/transformer.ts +347 -0
  315. package/src/metro/warn-unknown-classes.ts +79 -0
  316. package/src/metro/with-config.ts +229 -0
  317. package/src/runtime/chain-handlers.ts +47 -0
  318. package/src/runtime/components/rnwind-provider.tsx +144 -0
  319. package/src/runtime/gradient-types.ts +60 -0
  320. package/src/runtime/haptics.ts +120 -0
  321. package/src/runtime/hooks/use-css.ts +16 -0
  322. package/src/runtime/hooks/use-interact.ts +65 -0
  323. package/src/runtime/hooks/use-scheme.ts +63 -0
  324. package/src/runtime/index.ts +54 -0
  325. package/src/runtime/interactive-box.tsx +57 -0
  326. package/src/runtime/lookup-css.ts +628 -0
  327. package/src/runtime/types.ts +32 -0
  328. package/src/testing/index.ts +507 -0
  329. package/src/types/tailwindcss-node.d.ts +33 -0
  330. package/src/index.ts +0 -1
@@ -0,0 +1,97 @@
1
+ 'use strict';
2
+
3
+ var length = require('./length.cjs');
4
+
5
+ /**
6
+ * Expand lightningcss's `Display` typed value to an RN `{display}` entry.
7
+ * - `keyword` variant (`none`, `flex`, `grid`, `inline`, …) passes through.
8
+ * - `pair` variant (the modern CSS model — `{inside: {type}, outside,
9
+ * isListItem}`) collapses to RN's `'flex'` / `'grid'` when the inside
10
+ * type matches, otherwise skips.
11
+ * @param value Typed display value.
12
+ * @returns RN entries (zero or one).
13
+ */
14
+ function displayToEntries(value) {
15
+ if (value.type === 'keyword')
16
+ return [['display', value.value]];
17
+ if (value.type === 'pair') {
18
+ const inside = value.inside.type;
19
+ // `flow` is the default inside mode — maps to `block` / `inline` /
20
+ // `inline-block` based on the outer; RN only distinguishes `block`-ish
21
+ // from `flex`, so collapse the `flow` family to the `outside` keyword.
22
+ if (inside === 'flow')
23
+ return [['display', value.outside]];
24
+ if (inside === 'flex')
25
+ return [['display', 'flex']];
26
+ if (inside === 'grid')
27
+ return [['display', 'grid']];
28
+ }
29
+ return [];
30
+ }
31
+ /**
32
+ * Convert `FontSize` to a pixel number. The `length` variant carries a
33
+ * `DimensionPercentage`; `absolute` / `relative` keyword variants have no
34
+ * RN numeric equivalent and get dropped.
35
+ * @param value Typed font-size value.
36
+ * @returns Pixel size, or `null` when not a pure length.
37
+ */
38
+ function fontSizeToPx(value) {
39
+ if (value.type !== 'length')
40
+ return null;
41
+ const length$1 = length.dimensionPercentageToNumber(value.value);
42
+ if (typeof length$1 !== 'number')
43
+ return null;
44
+ return length$1;
45
+ }
46
+ /**
47
+ * Convert `FontWeight` to the form RN accepts — numbers for absolute
48
+ * weights, `'bolder'` / `'lighter'` keywords pass through as strings.
49
+ * @param value Typed font-weight value.
50
+ * @returns RN font weight.
51
+ */
52
+ function fontWeightToValue(value) {
53
+ if (value.type === 'absolute') {
54
+ if (value.value.type === 'weight')
55
+ return value.value.value;
56
+ return value.value.type;
57
+ }
58
+ return value.type;
59
+ }
60
+ /**
61
+ * Coerce `z-index` to a number. `{type: 'auto'}` has no RN equivalent so
62
+ * it collapses to 0.
63
+ * @param value Typed z-index value.
64
+ * @returns Integer z-index.
65
+ */
66
+ function zIndexToNumber(value) {
67
+ if (value.type === 'auto')
68
+ return 0;
69
+ return value.value;
70
+ }
71
+ /**
72
+ * Convert lightningcss `LineHeight` into RN's `lineHeight` entry. RN
73
+ * accepts a single number (pixel value). For unitless multipliers we
74
+ * multiply by the default 16-px font size (RN's base); for px values we
75
+ * pass through; percentages are approximated the same way.
76
+ * @param value Typed line-height.
77
+ * @returns RN entry.
78
+ */
79
+ function lineHeightToEntries(value) {
80
+ if (value.type === 'normal')
81
+ return [['lineHeight', 20]];
82
+ if (value.type === 'number')
83
+ return [['lineHeight', Math.round(value.value * 16 * 10_000) / 10_000]];
84
+ if (value.type === 'length') {
85
+ const px = length.dimensionPercentageToNumber(value.value);
86
+ if (typeof px === 'number')
87
+ return [['lineHeight', Math.round(px * 10_000) / 10_000]];
88
+ }
89
+ return [];
90
+ }
91
+
92
+ exports.displayToEntries = displayToEntries;
93
+ exports.fontSizeToPx = fontSizeToPx;
94
+ exports.fontWeightToValue = fontWeightToValue;
95
+ exports.lineHeightToEntries = lineHeightToEntries;
96
+ exports.zIndexToNumber = zIndexToNumber;
97
+ //# sourceMappingURL=typography.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typography.cjs","sources":["../../../../../src/core/parser/typography.ts"],"sourcesContent":["import type { Display, FontSize, FontWeight, LineHeight, ZIndex } from 'lightningcss'\nimport { dimensionPercentageToNumber } from './length'\nimport type { RNEntry } from './types'\n\n/**\n * Expand lightningcss's `Display` typed value to an RN `{display}` entry.\n * - `keyword` variant (`none`, `flex`, `grid`, `inline`, …) passes through.\n * - `pair` variant (the modern CSS model — `{inside: {type}, outside,\n * isListItem}`) collapses to RN's `'flex'` / `'grid'` when the inside\n * type matches, otherwise skips.\n * @param value Typed display value.\n * @returns RN entries (zero or one).\n */\nexport function displayToEntries(value: Display): readonly RNEntry[] {\n if (value.type === 'keyword') return [['display', value.value]]\n if (value.type === 'pair') {\n const inside = value.inside.type\n // `flow` is the default inside mode — maps to `block` / `inline` /\n // `inline-block` based on the outer; RN only distinguishes `block`-ish\n // from `flex`, so collapse the `flow` family to the `outside` keyword.\n if (inside === 'flow') return [['display', value.outside]]\n if (inside === 'flex') return [['display', 'flex']]\n if (inside === 'grid') return [['display', 'grid']]\n }\n return []\n}\n\n/**\n * Convert `FontSize` to a pixel number. The `length` variant carries a\n * `DimensionPercentage`; `absolute` / `relative` keyword variants have no\n * RN numeric equivalent and get dropped.\n * @param value Typed font-size value.\n * @returns Pixel size, or `null` when not a pure length.\n */\nexport function fontSizeToPx(value: FontSize): number | null {\n if (value.type !== 'length') return null\n const length = dimensionPercentageToNumber(value.value)\n if (typeof length !== 'number') return null\n return length\n}\n\n/**\n * Convert `FontWeight` to the form RN accepts — numbers for absolute\n * weights, `'bolder'` / `'lighter'` keywords pass through as strings.\n * @param value Typed font-weight value.\n * @returns RN font weight.\n */\nexport function fontWeightToValue(value: FontWeight): number | string {\n if (value.type === 'absolute') {\n if (value.value.type === 'weight') return value.value.value\n return value.value.type\n }\n return value.type\n}\n\n/**\n * Coerce `z-index` to a number. `{type: 'auto'}` has no RN equivalent so\n * it collapses to 0.\n * @param value Typed z-index value.\n * @returns Integer z-index.\n */\nexport function zIndexToNumber(value: ZIndex): number {\n if (value.type === 'auto') return 0\n return value.value\n}\n\n/**\n * Convert lightningcss `LineHeight` into RN's `lineHeight` entry. RN\n * accepts a single number (pixel value). For unitless multipliers we\n * multiply by the default 16-px font size (RN's base); for px values we\n * pass through; percentages are approximated the same way.\n * @param value Typed line-height.\n * @returns RN entry.\n */\nexport function lineHeightToEntries(value: LineHeight): readonly RNEntry[] {\n if (value.type === 'normal') return [['lineHeight', 20]]\n if (value.type === 'number') return [['lineHeight', Math.round(value.value * 16 * 10_000) / 10_000]]\n if (value.type === 'length') {\n const px = dimensionPercentageToNumber(value.value)\n if (typeof px === 'number') return [['lineHeight', Math.round(px * 10_000) / 10_000]]\n }\n return []\n}\n"],"names":["length","dimensionPercentageToNumber"],"mappings":";;;;AAIA;;;;;;;;AAQG;AACG,SAAU,gBAAgB,CAAC,KAAc,EAAA;AAC7C,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;AAC/D,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,M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,IAAI,KAAK,QAAQ;AAAE,QAAA,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AACxD,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;AACpG,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC3B,MAAM,EAAE,GAAGC,kCAA2B,CAAC,KAAK,CAAC,KAAK,CAAC;QACnD,IAAI,OAAO,EAAE,KAAK,QAAQ;AAAE,YAAA,OAAO,CAAC,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;IACvF;AACA,IAAA,OAAO,EAAE;AACX;;;;;;;;"}
@@ -0,0 +1,43 @@
1
+ import type { Display, FontSize, FontWeight, LineHeight, ZIndex } from 'lightningcss';
2
+ import type { RNEntry } from './types';
3
+ /**
4
+ * Expand lightningcss's `Display` typed value to an RN `{display}` entry.
5
+ * - `keyword` variant (`none`, `flex`, `grid`, `inline`, …) passes through.
6
+ * - `pair` variant (the modern CSS model — `{inside: {type}, outside,
7
+ * isListItem}`) collapses to RN's `'flex'` / `'grid'` when the inside
8
+ * type matches, otherwise skips.
9
+ * @param value Typed display value.
10
+ * @returns RN entries (zero or one).
11
+ */
12
+ export declare function displayToEntries(value: Display): readonly RNEntry[];
13
+ /**
14
+ * Convert `FontSize` to a pixel number. The `length` variant carries a
15
+ * `DimensionPercentage`; `absolute` / `relative` keyword variants have no
16
+ * RN numeric equivalent and get dropped.
17
+ * @param value Typed font-size value.
18
+ * @returns Pixel size, or `null` when not a pure length.
19
+ */
20
+ export declare function fontSizeToPx(value: FontSize): number | null;
21
+ /**
22
+ * Convert `FontWeight` to the form RN accepts — numbers for absolute
23
+ * weights, `'bolder'` / `'lighter'` keywords pass through as strings.
24
+ * @param value Typed font-weight value.
25
+ * @returns RN font weight.
26
+ */
27
+ export declare function fontWeightToValue(value: FontWeight): number | string;
28
+ /**
29
+ * Coerce `z-index` to a number. `{type: 'auto'}` has no RN equivalent so
30
+ * it collapses to 0.
31
+ * @param value Typed z-index value.
32
+ * @returns Integer z-index.
33
+ */
34
+ export declare function zIndexToNumber(value: ZIndex): number;
35
+ /**
36
+ * Convert lightningcss `LineHeight` into RN's `lineHeight` entry. RN
37
+ * accepts a single number (pixel value). For unitless multipliers we
38
+ * multiply by the default 16-px font size (RN's base); for px values we
39
+ * pass through; percentages are approximated the same way.
40
+ * @param value Typed line-height.
41
+ * @returns RN entry.
42
+ */
43
+ export declare function lineHeightToEntries(value: LineHeight): readonly RNEntry[];
@@ -0,0 +1,397 @@
1
+ 'use strict';
2
+
3
+ /** Match atom names like `border-hairline`, `h-hairline`, `border-t-hairline`, etc. */
4
+ const HAIRLINE_ATOM = /-hairline$/;
5
+ /** Parser's synthetic "no variant" scheme — provides the canonical fallback. */
6
+ const BASE_SCHEME = 'base';
7
+ /** Runtime registry key for the always-loaded fallback scheme. */
8
+ const COMMON_SCHEME = 'common';
9
+ /** Sentinel key the parser sets on interactive (`active:`/`focus:`) atoms. */
10
+ const STATE_KEY = '__state';
11
+ /**
12
+ * Whether an atom is a `*-hairline` utility — its numeric value must be
13
+ * rewritten as `StyleSheet.hairlineWidth` at runtime.
14
+ * @param atomName Class name.
15
+ * @returns True when the atom is a hairline utility.
16
+ */
17
+ function isHairlineAtom(atomName) {
18
+ return HAIRLINE_ATOM.test(atomName);
19
+ }
20
+ /**
21
+ * Whether an RN style object carries any own key. The parser emits
22
+ * empty `{}` for schemes an atom doesn't apply to; we treat those as
23
+ * "inherit canonical" and don't emit an entry for that scheme.
24
+ * @param style RN style object.
25
+ * @returns Whether the style has content.
26
+ */
27
+ function isNonEmptyStyle(style) {
28
+ if (!style)
29
+ return false;
30
+ return Object.keys(style).length > 0;
31
+ }
32
+ /**
33
+ * Iterate per-scheme entries from a parser-produced schemed bucket,
34
+ * skipping the reserved `__state` metadata key.
35
+ * @param schemed Parser output for one atom.
36
+ * @yields `[scheme, style]` pairs in object-key order.
37
+ */
38
+ function* iterScheme(schemed) {
39
+ const raw = schemed;
40
+ for (const key in raw) {
41
+ if (key === STATE_KEY)
42
+ continue;
43
+ yield [key, raw[key]];
44
+ }
45
+ }
46
+ /**
47
+ * Pick the canonical style for an atom — the value that goes into
48
+ * `common.style.js`. Prefers the parser's `base` entry (the "default
49
+ * when no variant matches"); falls back to the first non-empty per-
50
+ * scheme entry when the atom has no explicit base.
51
+ * @param schemed Parser-produced per-scheme bucket.
52
+ * @returns Canonical style, or undefined when every scheme is empty.
53
+ */
54
+ function canonicalValue(schemed) {
55
+ const baseEntry = schemed[BASE_SCHEME];
56
+ if (isNonEmptyStyle(baseEntry))
57
+ return baseEntry;
58
+ for (const [, style] of iterScheme(schemed)) {
59
+ if (isNonEmptyStyle(style))
60
+ return style;
61
+ }
62
+ return undefined;
63
+ }
64
+ /**
65
+ * Collect every variant scheme name across the project's atoms. The
66
+ * synthetic `base` scheme is excluded — it's folded into the `common`
67
+ * output. Returns variants in sorted order for deterministic output.
68
+ * @param resolved Parser-produced atom map.
69
+ * @returns Variant scheme names (no `base`, no `common`).
70
+ */
71
+ function collectVariantSchemes(resolved) {
72
+ const set = new Set();
73
+ for (const schemed of resolved.values()) {
74
+ for (const [scheme] of iterScheme(schemed)) {
75
+ if (scheme !== BASE_SCHEME)
76
+ set.add(scheme);
77
+ }
78
+ }
79
+ return [...set].toSorted((a, b) => a.localeCompare(b));
80
+ }
81
+ /**
82
+ * Normalize a CSS keyframe selector to the percentage form Reanimated
83
+ * v4 keyframes objects use.
84
+ * @param offset Selector text (`'from'`, `'to'`, `'50%'`).
85
+ * @returns Percentage string.
86
+ */
87
+ function offsetToPercent(offset) {
88
+ if (offset === 'from')
89
+ return '0%';
90
+ if (offset === 'to')
91
+ return '100%';
92
+ return offset;
93
+ }
94
+ /**
95
+ * Replace a string `animationName` with the inline keyframes object
96
+ * Reanimated v4's CSS engine expects. Atoms whose `animationName`
97
+ * doesn't match any registered keyframe keep the original string.
98
+ * @param style RN style object (possibly carrying `animationName`).
99
+ * @param keyframes Keyframes available to this build.
100
+ * @returns Style with `animationName` inlined when matched.
101
+ */
102
+ function inlineAnimationName(style, keyframes) {
103
+ const name = style.animationName;
104
+ if (typeof name !== 'string')
105
+ return style;
106
+ const block = keyframes.get(name);
107
+ if (!block)
108
+ return style;
109
+ const out = { ...style };
110
+ const inline = {};
111
+ for (const step of block.steps)
112
+ inline[offsetToPercent(step.offset)] = step.style;
113
+ out.animationName = inline;
114
+ return out;
115
+ }
116
+ /**
117
+ * Convert any safe-area markers in the style into a precomputed spec
118
+ * envelope. Atoms with `__safe` markers become
119
+ * `{__safeStyle: [[cssKey, sideTag, or, offset], ...]}` — the runtime
120
+ * resolver reads `value.__safeStyle` as a single property access and
121
+ * resolves against live insets without walking the value's keys.
122
+ * @param style RN style as resolved by the parser.
123
+ * @returns Original style OR the safe-style envelope.
124
+ */
125
+ function envelopeSafeMarkers(style) {
126
+ let specs = null;
127
+ for (const key of Object.keys(style)) {
128
+ const value = style[key];
129
+ if (typeof value !== 'object' || !value)
130
+ continue;
131
+ const marker = value;
132
+ if (typeof marker.__safe !== 'string')
133
+ continue;
134
+ if (!specs)
135
+ specs = [];
136
+ specs.push([key, marker.__safe, marker.or, marker.offset]);
137
+ }
138
+ if (!specs)
139
+ return style;
140
+ return { __safeStyle: specs };
141
+ }
142
+ /**
143
+ * Serialise a single atom's RN style to a JS object literal. Honors
144
+ * the `*-hairline` sentinel: numeric values get rewritten to
145
+ * `StyleSheet.hairlineWidth` so device-density differences land in the
146
+ * rendered border.
147
+ * @param atomName The atom's class name (used to detect hairline).
148
+ * @param style The atom's RN style object.
149
+ * @returns JS object-literal source.
150
+ */
151
+ function serializeStyle(atomName, style) {
152
+ const json = JSON.stringify(style);
153
+ if (!isHairlineAtom(atomName))
154
+ return json;
155
+ return json.replaceAll(/:(-?\d+(?:\.\d+)?)/g, ': StyleSheet.hairlineWidth');
156
+ }
157
+ /**
158
+ * Serialise an atom's resolved value — bare RN style object or an
159
+ * already-enveloped safe-style value.
160
+ * @param atomName Atom name (controls hairline rewrite).
161
+ * @param value Atom value (bare style or `{__safeStyle: spec[]}`).
162
+ * @returns JS source for the value.
163
+ */
164
+ function serializeAtomValue(atomName, value) {
165
+ if (typeof value === 'object' && value !== null && '__safeStyle' in value)
166
+ return JSON.stringify(value);
167
+ return serializeStyle(atomName, value);
168
+ }
169
+ /**
170
+ * Resolve + envelope + serialize an atom's value under one scheme.
171
+ * @param atomName Atom name.
172
+ * @param style Raw RN style for this scheme.
173
+ * @param keyframes Keyframes available to this build.
174
+ * @returns Serialized text ready to emit.
175
+ */
176
+ function prepareAtomValue(atomName, style, keyframes) {
177
+ const enveloped = envelopeSafeMarkers(inlineAnimationName(style, keyframes));
178
+ return serializeAtomValue(atomName, enveloped);
179
+ }
180
+ /**
181
+ * Per-file value deduplicator — interns each unique serialized atom
182
+ * value once and emits `const _s<N> = <value>` at module scope. Scheme
183
+ * entries reference the const instead of inlining the literal.
184
+ *
185
+ * Wins: (1) smaller bundle bytes for themes with many atoms sharing a
186
+ * style shape; (2) stable `===` inside one scheme so two atoms
187
+ * resolving to the same value yield the same object reference.
188
+ */
189
+ class ValueDeduper {
190
+ byText = new Map();
191
+ decls = [];
192
+ intern(serialized) {
193
+ const existing = this.byText.get(serialized);
194
+ if (existing)
195
+ return existing;
196
+ const name = `_s${this.decls.length}`;
197
+ this.decls.push(`const ${name} = ${serialized}`);
198
+ this.byText.set(serialized, name);
199
+ return name;
200
+ }
201
+ get declarations() {
202
+ return this.decls;
203
+ }
204
+ }
205
+ /**
206
+ * Render one scheme file's source. `entries` is the list of atoms this
207
+ * scheme contributes — for `common` every atom's canonical value; for
208
+ * a variant only atoms whose value differs from canonical. Hairline
209
+ * atoms in this file trigger the `StyleSheet` import.
210
+ * @param schemeName Registry key (`'common'` or the variant name).
211
+ * @param entries `[atomName, serializedValue]` pairs to emit.
212
+ * @returns JS source text.
213
+ */
214
+ function renderSchemeFile(schemeName, entries) {
215
+ const needsStyleSheet = entries.some(([atom]) => isHairlineAtom(atom));
216
+ const deduper = new ValueDeduper();
217
+ const recordLines = [];
218
+ for (const [atom, value] of entries) {
219
+ const ref = deduper.intern(value);
220
+ recordLines.push(` ${JSON.stringify(atom)}: ${ref},`);
221
+ }
222
+ const lines = [];
223
+ if (needsStyleSheet)
224
+ lines.push(`import { StyleSheet } from 'react-native'`);
225
+ lines.push(`import { registerAtoms } from 'rnwind'`, ``);
226
+ if (deduper.declarations.length > 0) {
227
+ for (const decl of deduper.declarations)
228
+ lines.push(decl);
229
+ lines.push(``);
230
+ }
231
+ lines.push(`registerAtoms(${JSON.stringify(schemeName)}, {`, ...recordLines, `})`, ``);
232
+ return lines.join('\n');
233
+ }
234
+ /**
235
+ * Render the JS-object literal for the responsive-breakpoint table the
236
+ * runtime registers at manifest-load time. Sorted by ascending px
237
+ * threshold so the runtime can build a deterministic "tier index" for
238
+ * its style cache.
239
+ * @param breakpoints Breakpoint name → px-threshold map.
240
+ * @returns Object-literal source (`{}` when empty).
241
+ */
242
+ function serializeBreakpoints(breakpoints) {
243
+ if (breakpoints.size === 0)
244
+ return '{}';
245
+ const entries = [...breakpoints].toSorted((a, b) => a[1] - b[1] || a[0].localeCompare(b[0]));
246
+ const inner = entries.map(([name, px]) => `${JSON.stringify(name)}: ${px}`).join(', ');
247
+ return `{ ${inner} }`;
248
+ }
249
+ /**
250
+ * Render the manifest module. Eager-imports `common.style.js` (every
251
+ * rewritten source file pulls this via a transitive side-effect
252
+ * import), registers the responsive-breakpoint table once, and lazy-
253
+ * requires every variant scheme's file through an inline require —
254
+ * first call in `ensureSchemeLoaded(name)` triggers the scheme
255
+ * module's evaluation; Metro's module cache makes subsequent calls
256
+ * no-ops.
257
+ * @param variants Variant scheme names (no `base`, no `common`).
258
+ * @param breakpoints Responsive breakpoint name → px-threshold map.
259
+ * @returns JS source text.
260
+ */
261
+ function renderManifest(variants, breakpoints) {
262
+ const lines = [
263
+ `import { registerSchemeLoader, registerBreakpoints } from 'rnwind'`,
264
+ `import './common.style'`,
265
+ ``,
266
+ `registerBreakpoints(${serializeBreakpoints(breakpoints)})`,
267
+ ``,
268
+ ];
269
+ if (variants.length === 0) {
270
+ lines.push(`function ensureSchemeLoaded(_name) {}`, ``, `registerSchemeLoader(ensureSchemeLoaded)`, ``, `export { ensureSchemeLoaded }`, ``);
271
+ return lines.join('\n');
272
+ }
273
+ lines.push(`const LOADERS = {`);
274
+ for (const variant of variants) {
275
+ lines.push(` ${JSON.stringify(variant)}: () => require(${JSON.stringify(`./${variant}.style`)}),`);
276
+ }
277
+ lines.push(`}`, ``, `function ensureSchemeLoaded(name) {`, ` const loader = LOADERS[name]`, ` if (loader) loader()`, `}`, ``, `registerSchemeLoader(ensureSchemeLoaded)`, ``, `export { ensureSchemeLoaded }`, ``);
278
+ return lines.join('\n');
279
+ }
280
+ /**
281
+ * Serialize one atom's canonical + variant-diff entries, honouring
282
+ * the per-atom cache. Returns the number of cache MISSES this atom
283
+ * incurred (0 when canonical was cached AND every needed variant was
284
+ * cached; 1 when anything had to be re-stringified). Split out of
285
+ * `buildSchemeSources` to keep that function under the repo's cognitive
286
+ * complexity budget.
287
+ *
288
+ * Two paths gated on whether the parser produced a non-empty `base`
289
+ * bucket:
290
+ * - **Themed atom (base present)**: canonical goes to `common`, each
291
+ * variant whose own value diverges from canonical writes the diff
292
+ * into its own scheme file. `lookupAtom` then finds the variant's
293
+ * override or falls through to common.
294
+ * - **Scheme-gated atom (base empty)**: the atom only matches when a
295
+ * specific scheme is active (Tailwind `light:` / `dark:` / `brand:`
296
+ * selectors). Skipping `common` here is essential — registering it
297
+ * would let the lookup fall through under non-matching schemes and
298
+ * leak the variant style into every scheme. Each populated variant
299
+ * bucket writes the value into its own scheme file directly.
300
+ * @param atom Atom name.
301
+ * @param schemed Parser-produced schemed bucket for the atom.
302
+ * @param canonical Canonical RN style for `common`.
303
+ * @param variants Variant scheme names in deterministic order.
304
+ * @param keyframes Keyframes available to inline.
305
+ * @param commonEntries Mutable collector for `common`'s `[atom, text]` pairs.
306
+ * @param variantEntries Mutable collector keyed by variant name.
307
+ * @param cache Optional shared serialized-value cache.
308
+ * @returns Number of JSON.stringify passes triggered for this atom.
309
+ */
310
+ function collectAtomEntries(atom, schemed, canonical, variants, keyframes, commonEntries, variantEntries, cache) {
311
+ const cached = cache?.get(atom);
312
+ const hit = cached?.styleRef === schemed;
313
+ const baseEntry = schemed[BASE_SCHEME];
314
+ const isSchemeGated = !isNonEmptyStyle(baseEntry);
315
+ const canonicalText = hit ? cached.canonical : prepareAtomValue(atom, canonical, keyframes);
316
+ if (!isSchemeGated)
317
+ commonEntries.push([atom, canonicalText]);
318
+ const entry = hit
319
+ ? cached
320
+ : { styleRef: schemed, canonical: canonicalText, variants: new Map() };
321
+ if (!hit)
322
+ cache?.set(atom, entry);
323
+ for (const variant of variants) {
324
+ const own = schemed[variant];
325
+ if (!isNonEmptyStyle(own))
326
+ continue;
327
+ let ownText = entry.variants.get(variant);
328
+ if (ownText === undefined) {
329
+ ownText = prepareAtomValue(atom, own, keyframes);
330
+ entry.variants.set(variant, ownText);
331
+ }
332
+ if (!isSchemeGated && ownText === canonicalText)
333
+ continue;
334
+ variantEntries[variant].push([atom, ownText]);
335
+ }
336
+ return hit ? 0 : 1;
337
+ }
338
+ /** Empty fallback when the caller didn't supply breakpoints (legacy callers, tests). */
339
+ const EMPTY_BREAKPOINTS = new Map();
340
+ /**
341
+ * Build the per-scheme style files + manifest source.
342
+ *
343
+ * Dedup rule (the thing that shrinks scheme files to their diff):
344
+ * - Every atom's canonical value goes into `common.style.js`.
345
+ * - Each variant's file emits an entry for an atom ONLY when the
346
+ * variant's own resolved value differs from canonical. When the
347
+ * variant inherits (parser emits an empty `{}` for that scheme) or
348
+ * the variant's resolved value serializes identically to canonical,
349
+ * the atom is omitted — at runtime the lookup falls through via
350
+ * `cache.atoms[scheme]?.[atom] ?? cache.atoms.common[atom]`.
351
+ *
352
+ * Keyframes are inlined directly into atom values via `animationName`
353
+ * ({@link inlineAnimationName}). Safe-area markers get pre-enveloped
354
+ * via {@link envelopeSafeMarkers}. Hairline utilities stay bound to
355
+ * `StyleSheet.hairlineWidth` at runtime.
356
+ * @param atomNames All atom names (sorted).
357
+ * @param resolved Per-atom schemed styles from the parser.
358
+ * @param keyframes Keyframe blocks referenced by any atom.
359
+ * @param cache Optional shared serialized-value cache.
360
+ * @param breakpoints Responsive breakpoint name → px-threshold map. The
361
+ * manifest emits `registerBreakpoints({...})` so the runtime can gate
362
+ * `md:*` / `lg:*` atoms on `windowWidth`. Optional — empty when the
363
+ * theme declares no breakpoints (legacy/test callers).
364
+ * @returns Per-scheme sources, manifest source, variant list.
365
+ */
366
+ function buildSchemeSources(atomNames, resolved, keyframes, cache, breakpoints = EMPTY_BREAKPOINTS) {
367
+ const variants = collectVariantSchemes(resolved);
368
+ const commonEntries = [];
369
+ const variantEntries = {};
370
+ for (const variant of variants)
371
+ variantEntries[variant] = [];
372
+ let misses = 0;
373
+ for (const atom of atomNames) {
374
+ const schemed = resolved.get(atom);
375
+ if (!schemed)
376
+ continue;
377
+ const canonical = canonicalValue(schemed);
378
+ if (!canonical)
379
+ continue;
380
+ misses += collectAtomEntries(atom, schemed, canonical, variants, keyframes, commonEntries, variantEntries, cache);
381
+ }
382
+ const schemeSources = {
383
+ [COMMON_SCHEME]: renderSchemeFile(COMMON_SCHEME, commonEntries),
384
+ };
385
+ for (const variant of variants) {
386
+ schemeSources[variant] = renderSchemeFile(variant, variantEntries[variant]);
387
+ }
388
+ return {
389
+ schemeSources,
390
+ manifestSource: renderManifest(variants, breakpoints),
391
+ variants,
392
+ serializedMisses: misses,
393
+ };
394
+ }
395
+
396
+ exports.buildSchemeSources = buildSchemeSources;
397
+ //# sourceMappingURL=build-style.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-style.cjs","sources":["../../../../../src/core/style-builder/build-style.ts"],"sourcesContent":["import type { KeyframeBlock, RNStyle, SchemedStyle } from '../parser'\n\n/** Match atom names like `border-hairline`, `h-hairline`, `border-t-hairline`, etc. */\nconst HAIRLINE_ATOM = /-hairline$/\n\n/** Parser's synthetic \"no variant\" scheme — provides the canonical fallback. */\nconst BASE_SCHEME = 'base'\n\n/** Runtime registry key for the always-loaded fallback scheme. */\nconst COMMON_SCHEME = 'common'\n\n/** Sentinel key the parser sets on interactive (`active:`/`focus:`) atoms. */\nconst STATE_KEY = '__state'\n\n/**\n * Whether an atom is a `*-hairline` utility — its numeric value must be\n * rewritten as `StyleSheet.hairlineWidth` at runtime.\n * @param atomName Class name.\n * @returns True when the atom is a hairline utility.\n */\nfunction isHairlineAtom(atomName: string): boolean {\n return HAIRLINE_ATOM.test(atomName)\n}\n\n/**\n * Whether an RN style object carries any own key. The parser emits\n * empty `{}` for schemes an atom doesn't apply to; we treat those as\n * \"inherit canonical\" and don't emit an entry for that scheme.\n * @param style RN style object.\n * @returns Whether the style has content.\n */\nfunction isNonEmptyStyle(style: RNStyle | undefined): style is RNStyle {\n if (!style) return false\n return Object.keys(style).length > 0\n}\n\n/**\n * Iterate per-scheme entries from a parser-produced schemed bucket,\n * skipping the reserved `__state` metadata key.\n * @param schemed Parser output for one atom.\n * @yields `[scheme, style]` pairs in object-key order.\n */\nfunction* iterScheme(schemed: SchemedStyle): IterableIterator<[string, RNStyle]> {\n const raw = schemed as Readonly<Record<string, RNStyle | string>>\n for (const key in raw) {\n if (key === STATE_KEY) continue\n yield [key, raw[key] as RNStyle]\n }\n}\n\n/**\n * Pick the canonical style for an atom — the value that goes into\n * `common.style.js`. Prefers the parser's `base` entry (the \"default\n * when no variant matches\"); falls back to the first non-empty per-\n * scheme entry when the atom has no explicit base.\n * @param schemed Parser-produced per-scheme bucket.\n * @returns Canonical style, or undefined when every scheme is empty.\n */\nfunction canonicalValue(schemed: SchemedStyle): RNStyle | undefined {\n const baseEntry = (schemed as Readonly<Record<string, RNStyle>>)[BASE_SCHEME]\n if (isNonEmptyStyle(baseEntry)) return baseEntry\n for (const [, style] of iterScheme(schemed)) {\n if (isNonEmptyStyle(style)) return style\n }\n return undefined\n}\n\n/**\n * Collect every variant scheme name across the project's atoms. The\n * synthetic `base` scheme is excluded — it's folded into the `common`\n * output. Returns variants in sorted order for deterministic output.\n * @param resolved Parser-produced atom map.\n * @returns Variant scheme names (no `base`, no `common`).\n */\nfunction collectVariantSchemes(resolved: ReadonlyMap<string, SchemedStyle>): readonly string[] {\n const set = new Set<string>()\n for (const schemed of resolved.values()) {\n for (const [scheme] of iterScheme(schemed)) {\n if (scheme !== BASE_SCHEME) set.add(scheme)\n }\n }\n return [...set].toSorted((a, b) => a.localeCompare(b))\n}\n\n/**\n * Normalize a CSS keyframe selector to the percentage form Reanimated\n * v4 keyframes objects use.\n * @param offset Selector text (`'from'`, `'to'`, `'50%'`).\n * @returns Percentage string.\n */\nfunction offsetToPercent(offset: string): string {\n if (offset === 'from') return '0%'\n if (offset === 'to') return '100%'\n return offset\n}\n\n/**\n * Replace a string `animationName` with the inline keyframes object\n * Reanimated v4's CSS engine expects. Atoms whose `animationName`\n * doesn't match any registered keyframe keep the original string.\n * @param style RN style object (possibly carrying `animationName`).\n * @param keyframes Keyframes available to this build.\n * @returns Style with `animationName` inlined when matched.\n */\nfunction inlineAnimationName(style: RNStyle, keyframes: ReadonlyMap<string, KeyframeBlock>): RNStyle {\n const name = style.animationName\n if (typeof name !== 'string') return style\n const block = keyframes.get(name)\n if (!block) return style\n const out: RNStyle = { ...style }\n const inline: Record<string, Record<string, string | number>> = {}\n for (const step of block.steps) inline[offsetToPercent(step.offset)] = step.style as Record<string, string | number>\n out.animationName = inline as unknown as RNStyle[string]\n return out\n}\n\n/**\n * Convert any safe-area markers in the style into a precomputed spec\n * envelope. Atoms with `__safe` markers become\n * `{__safeStyle: [[cssKey, sideTag, or, offset], ...]}` — the runtime\n * resolver reads `value.__safeStyle` as a single property access and\n * resolves against live insets without walking the value's keys.\n * @param style RN style as resolved by the parser.\n * @returns Original style OR the safe-style envelope.\n */\nfunction envelopeSafeMarkers(\n style: RNStyle,\n): RNStyle | { __safeStyle: readonly (readonly [string, string, number | undefined, number | undefined])[] } {\n let specs: [string, string, number | undefined, number | undefined][] | null = null\n for (const key of Object.keys(style)) {\n const value = style[key]\n if (typeof value !== 'object' || !value) continue\n const marker = value as { __safe?: string; or?: number; offset?: number }\n if (typeof marker.__safe !== 'string') continue\n if (!specs) specs = []\n specs.push([key, marker.__safe, marker.or, marker.offset])\n }\n if (!specs) return style\n return { __safeStyle: specs }\n}\n\n/**\n * Serialise a single atom's RN style to a JS object literal. Honors\n * the `*-hairline` sentinel: numeric values get rewritten to\n * `StyleSheet.hairlineWidth` so device-density differences land in the\n * rendered border.\n * @param atomName The atom's class name (used to detect hairline).\n * @param style The atom's RN style object.\n * @returns JS object-literal source.\n */\nfunction serializeStyle(atomName: string, style: RNStyle): string {\n const json = JSON.stringify(style)\n if (!isHairlineAtom(atomName)) return json\n return json.replaceAll(/:(-?\\d+(?:\\.\\d+)?)/g, ': StyleSheet.hairlineWidth')\n}\n\n/**\n * Serialise an atom's resolved value — bare RN style object or an\n * already-enveloped safe-style value.\n * @param atomName Atom name (controls hairline rewrite).\n * @param value Atom value (bare style or `{__safeStyle: spec[]}`).\n * @returns JS source for the value.\n */\nfunction serializeAtomValue(atomName: string, value: unknown): string {\n if (typeof value === 'object' && value !== null && '__safeStyle' in value) return JSON.stringify(value)\n return serializeStyle(atomName, value as RNStyle)\n}\n\n/**\n * Resolve + envelope + serialize an atom's value under one scheme.\n * @param atomName Atom name.\n * @param style Raw RN style for this scheme.\n * @param keyframes Keyframes available to this build.\n * @returns Serialized text ready to emit.\n */\nfunction prepareAtomValue(atomName: string, style: RNStyle, keyframes: ReadonlyMap<string, KeyframeBlock>): string {\n const enveloped = envelopeSafeMarkers(inlineAnimationName(style, keyframes))\n return serializeAtomValue(atomName, enveloped)\n}\n\n/**\n * Per-file value deduplicator — interns each unique serialized atom\n * value once and emits `const _s<N> = <value>` at module scope. Scheme\n * entries reference the const instead of inlining the literal.\n *\n * Wins: (1) smaller bundle bytes for themes with many atoms sharing a\n * style shape; (2) stable `===` inside one scheme so two atoms\n * resolving to the same value yield the same object reference.\n */\nclass ValueDeduper {\n private readonly byText = new Map<string, string>()\n private readonly decls: string[] = []\n\n intern(serialized: string): string {\n const existing = this.byText.get(serialized)\n if (existing) return existing\n const name = `_s${this.decls.length}`\n this.decls.push(`const ${name} = ${serialized}`)\n this.byText.set(serialized, name)\n return name\n }\n\n get declarations(): readonly string[] {\n return this.decls\n }\n}\n\n/**\n * Render one scheme file's source. `entries` is the list of atoms this\n * scheme contributes — for `common` every atom's canonical value; for\n * a variant only atoms whose value differs from canonical. Hairline\n * atoms in this file trigger the `StyleSheet` import.\n * @param schemeName Registry key (`'common'` or the variant name).\n * @param entries `[atomName, serializedValue]` pairs to emit.\n * @returns JS source text.\n */\nfunction renderSchemeFile(schemeName: string, entries: readonly (readonly [string, string])[]): string {\n const needsStyleSheet = entries.some(([atom]) => isHairlineAtom(atom))\n const deduper = new ValueDeduper()\n const recordLines: string[] = []\n for (const [atom, value] of entries) {\n const ref = deduper.intern(value)\n recordLines.push(` ${JSON.stringify(atom)}: ${ref},`)\n }\n\n const lines: string[] = []\n if (needsStyleSheet) lines.push(`import { StyleSheet } from 'react-native'`)\n lines.push(`import { registerAtoms } from 'rnwind'`, ``)\n if (deduper.declarations.length > 0) {\n for (const decl of deduper.declarations) lines.push(decl)\n lines.push(``)\n }\n lines.push(`registerAtoms(${JSON.stringify(schemeName)}, {`, ...recordLines, `})`, ``)\n return lines.join('\\n')\n}\n\n/**\n * Render the JS-object literal for the responsive-breakpoint table the\n * runtime registers at manifest-load time. Sorted by ascending px\n * threshold so the runtime can build a deterministic \"tier index\" for\n * its style cache.\n * @param breakpoints Breakpoint name → px-threshold map.\n * @returns Object-literal source (`{}` when empty).\n */\nfunction serializeBreakpoints(breakpoints: ReadonlyMap<string, number>): string {\n if (breakpoints.size === 0) return '{}'\n const entries = [...breakpoints].toSorted((a, b) => a[1] - b[1] || a[0].localeCompare(b[0]))\n const inner = entries.map(([name, px]) => `${JSON.stringify(name)}: ${px}`).join(', ')\n return `{ ${inner} }`\n}\n\n/**\n * Render the manifest module. Eager-imports `common.style.js` (every\n * rewritten source file pulls this via a transitive side-effect\n * import), registers the responsive-breakpoint table once, and lazy-\n * requires every variant scheme's file through an inline require —\n * first call in `ensureSchemeLoaded(name)` triggers the scheme\n * module's evaluation; Metro's module cache makes subsequent calls\n * no-ops.\n * @param variants Variant scheme names (no `base`, no `common`).\n * @param breakpoints Responsive breakpoint name → px-threshold map.\n * @returns JS source text.\n */\nfunction renderManifest(variants: readonly string[], breakpoints: ReadonlyMap<string, number>): string {\n const lines: string[] = [\n `import { registerSchemeLoader, registerBreakpoints } from 'rnwind'`,\n `import './common.style'`,\n ``,\n `registerBreakpoints(${serializeBreakpoints(breakpoints)})`,\n ``,\n ]\n if (variants.length === 0) {\n lines.push(`function ensureSchemeLoaded(_name) {}`, ``, `registerSchemeLoader(ensureSchemeLoaded)`, ``, `export { ensureSchemeLoaded }`, ``)\n return lines.join('\\n')\n }\n lines.push(`const LOADERS = {`)\n for (const variant of variants) {\n lines.push(` ${JSON.stringify(variant)}: () => require(${JSON.stringify(`./${variant}.style`)}),`)\n }\n lines.push(`}`, ``, `function ensureSchemeLoaded(name) {`, ` const loader = LOADERS[name]`, ` if (loader) loader()`, `}`, ``, `registerSchemeLoader(ensureSchemeLoaded)`, ``, `export { ensureSchemeLoaded }`, ``)\n return lines.join('\\n')\n}\n\n/** Output of one build pass — one source per scheme plus the manifest. */\nexport interface BuildSchemeSourcesOutput {\n /** `<schemeName>.style.js` source per scheme. Always contains `common`. */\n readonly schemeSources: Readonly<Record<string, string>>\n /** Manifest module source (`schemes.js`). */\n readonly manifestSource: string\n /** Variant scheme names this build covers (sorted; excludes `common`). */\n readonly variants: readonly string[]\n /** Number of `prepareAtomValue` / JSON.stringify passes (cache MISSES) this call did — test telemetry. */\n readonly serializedMisses: number\n}\n\n/**\n * Per-atom cached serialized value. Canonical (common) string plus a\n * map of variant → own-serialized-string. `styleRef` is an identity\n * guard against the resolved SchemedStyle — when callers replace an\n * atom's value the ref diverges and the cache rebuilds that entry.\n */\nexport interface AtomSerializedEntry {\n styleRef: SchemedStyle\n canonical: string\n variants: Map<string, string>\n}\n\n/** Cache UnionBuilder owns across repeated writeSchemes calls. */\nexport type AtomSerializedCache = Map<string, AtomSerializedEntry>\n\n/**\n * Serialize one atom's canonical + variant-diff entries, honouring\n * the per-atom cache. Returns the number of cache MISSES this atom\n * incurred (0 when canonical was cached AND every needed variant was\n * cached; 1 when anything had to be re-stringified). Split out of\n * `buildSchemeSources` to keep that function under the repo's cognitive\n * complexity budget.\n *\n * Two paths gated on whether the parser produced a non-empty `base`\n * bucket:\n * - **Themed atom (base present)**: canonical goes to `common`, each\n * variant whose own value diverges from canonical writes the diff\n * into its own scheme file. `lookupAtom` then finds the variant's\n * override or falls through to common.\n * - **Scheme-gated atom (base empty)**: the atom only matches when a\n * specific scheme is active (Tailwind `light:` / `dark:` / `brand:`\n * selectors). Skipping `common` here is essential — registering it\n * would let the lookup fall through under non-matching schemes and\n * leak the variant style into every scheme. Each populated variant\n * bucket writes the value into its own scheme file directly.\n * @param atom Atom name.\n * @param schemed Parser-produced schemed bucket for the atom.\n * @param canonical Canonical RN style for `common`.\n * @param variants Variant scheme names in deterministic order.\n * @param keyframes Keyframes available to inline.\n * @param commonEntries Mutable collector for `common`'s `[atom, text]` pairs.\n * @param variantEntries Mutable collector keyed by variant name.\n * @param cache Optional shared serialized-value cache.\n * @returns Number of JSON.stringify passes triggered for this atom.\n */\nfunction collectAtomEntries(\n atom: string,\n schemed: SchemedStyle,\n canonical: RNStyle,\n variants: readonly string[],\n keyframes: ReadonlyMap<string, KeyframeBlock>,\n commonEntries: (readonly [string, string])[],\n variantEntries: Record<string, (readonly [string, string])[]>,\n cache?: AtomSerializedCache,\n): number {\n const cached = cache?.get(atom)\n const hit = cached?.styleRef === schemed\n const baseEntry = (schemed as Readonly<Record<string, RNStyle>>)[BASE_SCHEME]\n const isSchemeGated = !isNonEmptyStyle(baseEntry)\n const canonicalText = hit ? cached.canonical : prepareAtomValue(atom, canonical, keyframes)\n if (!isSchemeGated) commonEntries.push([atom, canonicalText])\n const entry: AtomSerializedEntry = hit\n ? cached\n : { styleRef: schemed, canonical: canonicalText, variants: new Map<string, string>() }\n if (!hit) cache?.set(atom, entry)\n\n for (const variant of variants) {\n const own = (schemed as Readonly<Record<string, RNStyle>>)[variant]\n if (!isNonEmptyStyle(own)) continue\n let ownText = entry.variants.get(variant)\n if (ownText === undefined) {\n ownText = prepareAtomValue(atom, own, keyframes)\n entry.variants.set(variant, ownText)\n }\n if (!isSchemeGated && ownText === canonicalText) continue\n variantEntries[variant].push([atom, ownText])\n }\n return hit ? 0 : 1\n}\n\n/** Empty fallback when the caller didn't supply breakpoints (legacy callers, tests). */\nconst EMPTY_BREAKPOINTS: ReadonlyMap<string, number> = new Map()\n\n/**\n * Build the per-scheme style files + manifest source.\n *\n * Dedup rule (the thing that shrinks scheme files to their diff):\n * - Every atom's canonical value goes into `common.style.js`.\n * - Each variant's file emits an entry for an atom ONLY when the\n * variant's own resolved value differs from canonical. When the\n * variant inherits (parser emits an empty `{}` for that scheme) or\n * the variant's resolved value serializes identically to canonical,\n * the atom is omitted — at runtime the lookup falls through via\n * `cache.atoms[scheme]?.[atom] ?? cache.atoms.common[atom]`.\n *\n * Keyframes are inlined directly into atom values via `animationName`\n * ({@link inlineAnimationName}). Safe-area markers get pre-enveloped\n * via {@link envelopeSafeMarkers}. Hairline utilities stay bound to\n * `StyleSheet.hairlineWidth` at runtime.\n * @param atomNames All atom names (sorted).\n * @param resolved Per-atom schemed styles from the parser.\n * @param keyframes Keyframe blocks referenced by any atom.\n * @param cache Optional shared serialized-value cache.\n * @param breakpoints Responsive breakpoint name → px-threshold map. The\n * manifest emits `registerBreakpoints({...})` so the runtime can gate\n * `md:*` / `lg:*` atoms on `windowWidth`. Optional — empty when the\n * theme declares no breakpoints (legacy/test callers).\n * @returns Per-scheme sources, manifest source, variant list.\n */\nexport function buildSchemeSources(\n atomNames: readonly string[],\n resolved: ReadonlyMap<string, SchemedStyle>,\n keyframes: ReadonlyMap<string, KeyframeBlock>,\n cache?: AtomSerializedCache,\n breakpoints: ReadonlyMap<string, number> = EMPTY_BREAKPOINTS,\n): BuildSchemeSourcesOutput {\n const variants = collectVariantSchemes(resolved)\n const commonEntries: (readonly [string, string])[] = []\n const variantEntries: Record<string, (readonly [string, string])[]> = {}\n for (const variant of variants) variantEntries[variant] = []\n let misses = 0\n\n for (const atom of atomNames) {\n const schemed = resolved.get(atom)\n if (!schemed) continue\n const canonical = canonicalValue(schemed)\n if (!canonical) continue\n misses += collectAtomEntries(atom, schemed, canonical, variants, keyframes, commonEntries, variantEntries, cache)\n }\n\n const schemeSources: Record<string, string> = {\n [COMMON_SCHEME]: renderSchemeFile(COMMON_SCHEME, commonEntries),\n }\n for (const variant of variants) {\n schemeSources[variant] = renderSchemeFile(variant, variantEntries[variant])\n }\n\n return {\n schemeSources,\n manifestSource: renderManifest(variants, breakpoints),\n variants,\n serializedMisses: misses,\n }\n}\n\n/** Registry key the runtime uses for the always-loaded fallback. */\nexport const COMMON_SCHEME_NAME: string = COMMON_SCHEME\n"],"names":[],"mappings":";;AAEA;AACA,MAAM,aAAa,GAAG,YAAY;AAElC;AACA,MAAM,WAAW,GAAG,MAAM;AAE1B;AACA,MAAM,aAAa,GAAG,QAAQ;AAE9B;AACA,MAAM,SAAS,GAAG,SAAS;AAE3B;;;;;AAKG;AACH,SAAS,cAAc,CAAC,QAAgB,EAAA;AACtC,IAAA,OAAO,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC;AACrC;AAEA;;;;;;AAMG;AACH,SAAS,eAAe,CAAC,KAA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source per scheme plus the manifest. */
3
+ export interface BuildSchemeSourcesOutput {
4
+ /** `<schemeName>.style.js` source per scheme. Always contains `common`. */
5
+ readonly schemeSources: Readonly<Record<string, string>>;
6
+ /** Manifest module source (`schemes.js`). */
7
+ readonly manifestSource: string;
8
+ /** Variant scheme names this build covers (sorted; excludes `common`). */
9
+ readonly variants: readonly string[];
10
+ /** Number of `prepareAtomValue` / JSON.stringify passes (cache MISSES) this call did — test telemetry. */
11
+ readonly serializedMisses: number;
12
+ }
13
+ /**
14
+ * Per-atom cached serialized value. Canonical (common) string plus a
15
+ * map of variant → own-serialized-string. `styleRef` is an identity
16
+ * guard against the resolved SchemedStyle — when callers replace an
17
+ * atom's value the ref diverges and the cache rebuilds that entry.
18
+ */
19
+ export interface AtomSerializedEntry {
20
+ styleRef: SchemedStyle;
21
+ canonical: string;
22
+ variants: Map<string, string>;
23
+ }
24
+ /** Cache UnionBuilder owns across repeated writeSchemes calls. */
25
+ export type AtomSerializedCache = Map<string, AtomSerializedEntry>;
26
+ /**
27
+ * Build the per-scheme style files + manifest source.
28
+ *
29
+ * Dedup rule (the thing that shrinks scheme files to their diff):
30
+ * - Every atom's canonical value goes into `common.style.js`.
31
+ * - Each variant's file emits an entry for an atom ONLY when the
32
+ * variant's own resolved value differs from canonical. When the
33
+ * variant inherits (parser emits an empty `{}` for that scheme) or
34
+ * the variant's resolved value serializes identically to canonical,
35
+ * the atom is omitted — at runtime the lookup falls through via
36
+ * `cache.atoms[scheme]?.[atom] ?? cache.atoms.common[atom]`.
37
+ *
38
+ * Keyframes are inlined directly into atom values via `animationName`
39
+ * ({@link inlineAnimationName}). Safe-area markers get pre-enveloped
40
+ * via {@link envelopeSafeMarkers}. Hairline utilities stay bound to
41
+ * `StyleSheet.hairlineWidth` at runtime.
42
+ * @param atomNames All atom names (sorted).
43
+ * @param resolved Per-atom schemed styles from the parser.
44
+ * @param keyframes Keyframe blocks referenced by any atom.
45
+ * @param cache Optional shared serialized-value cache.
46
+ * @param breakpoints Responsive breakpoint name → px-threshold map. The
47
+ * manifest emits `registerBreakpoints({...})` so the runtime can gate
48
+ * `md:*` / `lg:*` atoms on `windowWidth`. Optional — empty when the
49
+ * theme declares no breakpoints (legacy/test callers).
50
+ * @returns Per-scheme sources, manifest source, variant list.
51
+ */
52
+ export declare function buildSchemeSources(atomNames: readonly string[], resolved: ReadonlyMap<string, SchemedStyle>, keyframes: ReadonlyMap<string, KeyframeBlock>, cache?: AtomSerializedCache, breakpoints?: ReadonlyMap<string, number>): BuildSchemeSourcesOutput;
53
+ /** Registry key the runtime uses for the always-loaded fallback. */
54
+ export declare const COMMON_SCHEME_NAME: string;