@maizzle/framework 6.0.0-rc.9 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (623) hide show
  1. package/README.md +3 -3
  2. package/bin/maizzle.mjs +1 -1
  3. package/dist/build.d.ts +38 -0
  4. package/dist/build.d.ts.map +1 -0
  5. package/dist/build.js +234 -0
  6. package/dist/build.js.map +1 -0
  7. package/dist/components/Body.vue +32 -3
  8. package/dist/components/Button.vue +91 -62
  9. package/dist/components/CodeBlock.vue +6 -4
  10. package/dist/components/CodeInline.vue +77 -6
  11. package/dist/components/Column.vue +67 -31
  12. package/dist/components/Container.vue +73 -12
  13. package/dist/components/Font.vue +96 -0
  14. package/dist/components/Head.vue +1 -1
  15. package/dist/components/Heading.vue +1 -1
  16. package/dist/components/Hr.vue +33 -0
  17. package/dist/components/Html.vue +36 -3
  18. package/dist/components/Img.vue +332 -0
  19. package/dist/components/Layout.vue +71 -21
  20. package/dist/components/Link.vue +1 -1
  21. package/dist/components/Markdown.vue +51 -24
  22. package/dist/components/MarkdownLayout.vue +39 -0
  23. package/dist/components/NotPlaintext.vue +14 -0
  24. package/dist/components/Outlook.vue +38 -11
  25. package/dist/components/OutlookBg.vue +241 -0
  26. package/dist/components/Plaintext.vue +14 -0
  27. package/dist/components/Preheader.vue +35 -10
  28. package/dist/components/QrCode.vue +157 -0
  29. package/dist/components/Raw.vue +28 -0
  30. package/dist/components/Row.vue +115 -22
  31. package/dist/components/Section.vue +65 -26
  32. package/dist/components/Spacer.vue +35 -29
  33. package/dist/components/Tailwind.vue +45 -0
  34. package/dist/components/Text.vue +3 -3
  35. package/dist/components/Vml.vue +207 -94
  36. package/dist/components/utils.d.ts +53 -0
  37. package/dist/components/utils.d.ts.map +1 -0
  38. package/dist/components/utils.js +80 -0
  39. package/dist/components/utils.js.map +1 -0
  40. package/dist/components/utils.ts +102 -0
  41. package/dist/composables/defineConfig.d.ts +13 -0
  42. package/dist/composables/defineConfig.d.ts.map +1 -0
  43. package/dist/composables/{defineConfig.mjs → defineConfig.js} +7 -9
  44. package/dist/composables/defineConfig.js.map +1 -0
  45. package/dist/composables/renderContext.d.ts +37 -0
  46. package/dist/composables/renderContext.d.ts.map +1 -0
  47. package/dist/composables/renderContext.js +6 -0
  48. package/dist/composables/renderContext.js.map +1 -0
  49. package/dist/composables/useBaseUrl.d.ts +19 -0
  50. package/dist/composables/useBaseUrl.d.ts.map +1 -0
  51. package/dist/composables/useBaseUrl.js +26 -0
  52. package/dist/composables/useBaseUrl.js.map +1 -0
  53. package/dist/composables/useConfig.d.ts +16 -0
  54. package/dist/composables/useConfig.d.ts.map +1 -0
  55. package/dist/composables/useConfig.js +19 -0
  56. package/dist/composables/useConfig.js.map +1 -0
  57. package/dist/composables/useCurrentTemplate.d.ts +31 -0
  58. package/dist/composables/useCurrentTemplate.d.ts.map +1 -0
  59. package/dist/composables/useCurrentTemplate.js +42 -0
  60. package/dist/composables/useCurrentTemplate.js.map +1 -0
  61. package/dist/composables/{useDoctype.d.mts → useDoctype.d.ts} +1 -1
  62. package/dist/composables/useDoctype.d.ts.map +1 -0
  63. package/dist/composables/{useDoctype.mjs → useDoctype.js} +3 -4
  64. package/dist/composables/useDoctype.js.map +1 -0
  65. package/dist/composables/{useEvent.d.mts → useEvent.d.ts} +3 -3
  66. package/dist/composables/useEvent.d.ts.map +1 -0
  67. package/dist/composables/{useEvent.mjs → useEvent.js} +4 -5
  68. package/dist/composables/useEvent.js.map +1 -0
  69. package/dist/composables/useFont.d.ts +50 -0
  70. package/dist/composables/useFont.d.ts.map +1 -0
  71. package/dist/composables/useFont.js +92 -0
  72. package/dist/composables/useFont.js.map +1 -0
  73. package/dist/composables/useOutlookFallback.d.ts +21 -0
  74. package/dist/composables/useOutlookFallback.d.ts.map +1 -0
  75. package/dist/composables/useOutlookFallback.js +29 -0
  76. package/dist/composables/useOutlookFallback.js.map +1 -0
  77. package/dist/composables/useOutputPath.d.ts +17 -0
  78. package/dist/composables/useOutputPath.d.ts.map +1 -0
  79. package/dist/composables/useOutputPath.js +23 -0
  80. package/dist/composables/useOutputPath.js.map +1 -0
  81. package/dist/composables/{usePlaintext.d.mts → usePlaintext.d.ts} +3 -1
  82. package/dist/composables/usePlaintext.d.ts.map +1 -0
  83. package/dist/composables/{usePlaintext.mjs → usePlaintext.js} +4 -4
  84. package/dist/composables/usePlaintext.js.map +1 -0
  85. package/dist/composables/usePreheader.d.ts +25 -0
  86. package/dist/composables/usePreheader.d.ts.map +1 -0
  87. package/dist/composables/usePreheader.js +28 -0
  88. package/dist/composables/usePreheader.js.map +1 -0
  89. package/dist/composables/useTransformers.d.ts +34 -0
  90. package/dist/composables/useTransformers.d.ts.map +1 -0
  91. package/dist/composables/useTransformers.js +48 -0
  92. package/dist/composables/useTransformers.js.map +1 -0
  93. package/dist/composables/useUrlQuery.d.ts +19 -0
  94. package/dist/composables/useUrlQuery.d.ts.map +1 -0
  95. package/dist/composables/useUrlQuery.js +26 -0
  96. package/dist/composables/useUrlQuery.js.map +1 -0
  97. package/dist/config/{defaults.d.mts → defaults.d.ts} +2 -2
  98. package/dist/config/defaults.d.ts.map +1 -0
  99. package/dist/config/{defaults.mjs → defaults.js} +10 -6
  100. package/dist/config/defaults.js.map +1 -0
  101. package/dist/config/index.d.ts +24 -0
  102. package/dist/config/index.d.ts.map +1 -0
  103. package/dist/config/{index.mjs → index.js} +45 -14
  104. package/dist/config/index.js.map +1 -0
  105. package/dist/events/{index.d.mts → index.d.ts} +35 -12
  106. package/dist/events/index.d.ts.map +1 -0
  107. package/dist/events/{index.mjs → index.js} +31 -13
  108. package/dist/events/index.js.map +1 -0
  109. package/dist/index.d.ts +41 -0
  110. package/dist/index.js +40 -0
  111. package/dist/{plaintext.d.mts → plaintext.d.ts} +1 -1
  112. package/dist/plaintext.d.ts.map +1 -0
  113. package/dist/{plaintext.mjs → plaintext.js} +4 -5
  114. package/dist/plaintext.js.map +1 -0
  115. package/dist/{plugin.d.mts → plugin.d.ts} +2 -2
  116. package/dist/plugin.d.ts.map +1 -0
  117. package/dist/{plugin.mjs → plugin.js} +8 -9
  118. package/dist/plugin.js.map +1 -0
  119. package/dist/plugins/postcss/{mergeMediaQueries.d.mts → mergeMediaQueries.d.ts} +2 -2
  120. package/dist/plugins/postcss/mergeMediaQueries.d.ts.map +1 -0
  121. package/dist/plugins/postcss/{mergeMediaQueries.mjs → mergeMediaQueries.js} +2 -3
  122. package/dist/plugins/postcss/mergeMediaQueries.js.map +1 -0
  123. package/dist/plugins/postcss/{pruneVars.d.mts → pruneVars.d.ts} +1 -1
  124. package/dist/plugins/postcss/pruneVars.d.ts.map +1 -0
  125. package/dist/plugins/postcss/{pruneVars.mjs → pruneVars.js} +2 -2
  126. package/dist/plugins/postcss/pruneVars.js.map +1 -0
  127. package/dist/plugins/postcss/quoteFontFamilies.d.ts +13 -0
  128. package/dist/plugins/postcss/quoteFontFamilies.d.ts.map +1 -0
  129. package/dist/plugins/postcss/quoteFontFamilies.js +84 -0
  130. package/dist/plugins/postcss/quoteFontFamilies.js.map +1 -0
  131. package/dist/plugins/postcss/{removeDeclarations.d.mts → removeDeclarations.d.ts} +1 -1
  132. package/dist/plugins/postcss/removeDeclarations.d.ts.map +1 -0
  133. package/dist/plugins/postcss/{removeDeclarations.mjs → removeDeclarations.js} +2 -2
  134. package/dist/plugins/postcss/removeDeclarations.js.map +1 -0
  135. package/dist/plugins/postcss/resolveMaizzleImports.d.ts +16 -0
  136. package/dist/plugins/postcss/resolveMaizzleImports.d.ts.map +1 -0
  137. package/dist/plugins/postcss/resolveMaizzleImports.js +39 -0
  138. package/dist/plugins/postcss/resolveMaizzleImports.js.map +1 -0
  139. package/dist/plugins/postcss/resolveProps.d.ts +8 -0
  140. package/dist/plugins/postcss/resolveProps.d.ts.map +1 -0
  141. package/dist/plugins/postcss/resolveProps.js +155 -0
  142. package/dist/plugins/postcss/resolveProps.js.map +1 -0
  143. package/dist/plugins/postcss/{tailwindCleanup.d.mts → tailwindCleanup.d.ts} +2 -2
  144. package/dist/plugins/postcss/tailwindCleanup.d.ts.map +1 -0
  145. package/dist/plugins/postcss/{tailwindCleanup.mjs → tailwindCleanup.js} +5 -3
  146. package/dist/plugins/postcss/tailwindCleanup.js.map +1 -0
  147. package/dist/prepare.d.ts +17 -0
  148. package/dist/prepare.d.ts.map +1 -0
  149. package/dist/prepare.js +44 -0
  150. package/dist/prepare.js.map +1 -0
  151. package/dist/render/active.d.ts +8 -0
  152. package/dist/render/active.d.ts.map +1 -0
  153. package/dist/render/active.js +12 -0
  154. package/dist/render/active.js.map +1 -0
  155. package/dist/render/buildTemplate.d.ts +49 -0
  156. package/dist/render/buildTemplate.d.ts.map +1 -0
  157. package/dist/render/buildTemplate.js +141 -0
  158. package/dist/render/buildTemplate.js.map +1 -0
  159. package/dist/render/{createRenderer.d.mts → createRenderer.d.ts} +14 -6
  160. package/dist/render/createRenderer.d.ts.map +1 -0
  161. package/dist/render/createRenderer.js +468 -0
  162. package/dist/render/createRenderer.js.map +1 -0
  163. package/dist/render/index.d.ts +18 -0
  164. package/dist/render/index.d.ts.map +1 -0
  165. package/dist/render/index.js +59 -0
  166. package/dist/render/index.js.map +1 -0
  167. package/dist/render/injectFonts.d.ts +15 -0
  168. package/dist/render/injectFonts.d.ts.map +1 -0
  169. package/dist/render/injectFonts.js +45 -0
  170. package/dist/render/injectFonts.js.map +1 -0
  171. package/dist/render/parallel/buildWorker.d.ts +31 -0
  172. package/dist/render/parallel/buildWorker.d.ts.map +1 -0
  173. package/dist/render/parallel/buildWorker.js +66 -0
  174. package/dist/render/parallel/buildWorker.js.map +1 -0
  175. package/dist/render/parallel/worker.mjs +28 -0
  176. package/dist/render/plugins/codeBlockExtract.d.ts +14 -0
  177. package/dist/render/plugins/codeBlockExtract.d.ts.map +1 -0
  178. package/dist/render/plugins/codeBlockExtract.js +38 -0
  179. package/dist/render/plugins/codeBlockExtract.js.map +1 -0
  180. package/dist/render/plugins/markdownExtract.d.ts +12 -0
  181. package/dist/render/plugins/markdownExtract.d.ts.map +1 -0
  182. package/dist/render/plugins/markdownExtract.js +49 -0
  183. package/dist/render/plugins/markdownExtract.js.map +1 -0
  184. package/dist/render/plugins/rawExtract.d.ts +14 -0
  185. package/dist/render/plugins/rawExtract.d.ts.map +1 -0
  186. package/dist/render/plugins/rawExtract.js +34 -0
  187. package/dist/render/plugins/rawExtract.js.map +1 -0
  188. package/dist/render/plugins/rowSourceLocation.d.ts +18 -0
  189. package/dist/render/plugins/rowSourceLocation.d.ts.map +1 -0
  190. package/dist/render/plugins/rowSourceLocation.js +45 -0
  191. package/dist/render/plugins/rowSourceLocation.js.map +1 -0
  192. package/dist/{serve.d.mts → serve.d.ts} +5 -3
  193. package/dist/serve.d.ts.map +1 -0
  194. package/dist/{serve.mjs → serve.js} +201 -107
  195. package/dist/serve.js.map +1 -0
  196. package/dist/server/compatibility.d.ts +59 -0
  197. package/dist/server/compatibility.d.ts.map +1 -0
  198. package/dist/server/compatibility.js +959 -0
  199. package/dist/server/compatibility.js.map +1 -0
  200. package/dist/server/{email.d.mts → email.d.ts} +2 -2
  201. package/dist/server/email.d.ts.map +1 -0
  202. package/dist/server/{email.mjs → email.js} +2 -3
  203. package/dist/server/email.js.map +1 -0
  204. package/dist/server/linter.d.ts +20 -0
  205. package/dist/server/linter.d.ts.map +1 -0
  206. package/dist/server/linter.js +345 -0
  207. package/dist/server/linter.js.map +1 -0
  208. package/dist/server/sfc-utils.d.ts +21 -0
  209. package/dist/server/sfc-utils.d.ts.map +1 -0
  210. package/dist/server/sfc-utils.js +198 -0
  211. package/dist/server/sfc-utils.js.map +1 -0
  212. package/dist/server/ui/.vite/deps/@lucide_vue.js +44967 -0
  213. package/dist/server/ui/.vite/deps/@lucide_vue.js.map +1 -0
  214. package/dist/server/ui/.vite/deps/@vueuse_core.js +8155 -0
  215. package/dist/server/ui/.vite/deps/@vueuse_core.js.map +1 -0
  216. package/dist/server/ui/.vite/deps/@vueuse_shared.js +1859 -0
  217. package/dist/server/ui/.vite/deps/@vueuse_shared.js.map +1 -0
  218. package/dist/server/ui/.vite/deps/_metadata.json +78 -0
  219. package/dist/server/ui/.vite/deps/chunk-EAsCxrDo.js +14 -0
  220. package/dist/server/ui/.vite/deps/class-variance-authority.js +57 -0
  221. package/dist/server/ui/.vite/deps/class-variance-authority.js.map +1 -0
  222. package/dist/server/ui/.vite/deps/clsx.js +18 -0
  223. package/dist/server/ui/.vite/deps/clsx.js.map +1 -0
  224. package/dist/server/ui/.vite/deps/culori.js +4312 -0
  225. package/dist/server/ui/.vite/deps/culori.js.map +1 -0
  226. package/dist/server/ui/.vite/deps/package.json +3 -0
  227. package/dist/server/ui/.vite/deps/reka-ui.js +44464 -0
  228. package/dist/server/ui/.vite/deps/reka-ui.js.map +1 -0
  229. package/dist/server/ui/.vite/deps/tailwind-merge.js +3458 -0
  230. package/dist/server/ui/.vite/deps/tailwind-merge.js.map +1 -0
  231. package/dist/server/ui/.vite/deps/vue-router.js +6383 -0
  232. package/dist/server/ui/.vite/deps/vue-router.js.map +1 -0
  233. package/dist/server/ui/.vite/deps/vue.js +2 -0
  234. package/dist/server/ui/.vite/deps/vue.runtime.esm-bundler-DaqjATE_.js +8785 -0
  235. package/dist/server/ui/.vite/deps/vue.runtime.esm-bundler-DaqjATE_.js.map +1 -0
  236. package/dist/server/ui/App.vue +106 -66
  237. package/dist/server/ui/components/SidebarClose.vue +12 -0
  238. package/dist/server/ui/components/ui/checkbox/Checkbox.vue +1 -1
  239. package/dist/server/ui/components/ui/command/Command.vue +5 -1
  240. package/dist/server/ui/components/ui/command/CommandInput.vue +2 -2
  241. package/dist/server/ui/components/ui/dialog/DialogContent.vue +1 -1
  242. package/dist/server/ui/components/ui/dialog/DialogScrollContent.vue +1 -1
  243. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
  244. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
  245. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
  246. package/dist/server/ui/components/ui/input/Input.vue +1 -1
  247. package/dist/server/ui/components/ui/sheet/SheetContent.vue +1 -1
  248. package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +2 -2
  249. package/dist/server/ui/components/ui/tags-input/TagsInputInput.vue +1 -1
  250. package/dist/server/ui/components/ui/tags-input/TagsInputItemDelete.vue +1 -1
  251. package/dist/server/ui/lib/emulated-dark-mode.ts +146 -0
  252. package/dist/server/ui/main.css +25 -0
  253. package/dist/server/ui/pages/Home.vue +1 -1
  254. package/dist/server/ui/pages/Preview.vue +377 -186
  255. package/dist/server/ui/vite-env.d.ts +1 -0
  256. package/dist/tests/render/_helpers.d.ts +6 -0
  257. package/dist/tests/render/_helpers.d.ts.map +1 -0
  258. package/dist/tests/render/_helpers.js +16 -0
  259. package/dist/tests/render/_helpers.js.map +1 -0
  260. package/dist/transformers/addAttributes.d.ts +42 -0
  261. package/dist/transformers/addAttributes.d.ts.map +1 -0
  262. package/dist/transformers/{addAttributes.mjs → addAttributes.js} +40 -24
  263. package/dist/transformers/addAttributes.js.map +1 -0
  264. package/dist/transformers/attributeToStyle.d.ts +38 -0
  265. package/dist/transformers/attributeToStyle.d.ts.map +1 -0
  266. package/dist/transformers/attributeToStyle.js +94 -0
  267. package/dist/transformers/attributeToStyle.js.map +1 -0
  268. package/dist/transformers/base.d.ts +71 -0
  269. package/dist/transformers/base.d.ts.map +1 -0
  270. package/dist/transformers/{base.mjs → base.js} +65 -40
  271. package/dist/transformers/base.js.map +1 -0
  272. package/dist/transformers/columnWidth.d.ts +31 -0
  273. package/dist/transformers/columnWidth.d.ts.map +1 -0
  274. package/dist/transformers/columnWidth.js +527 -0
  275. package/dist/transformers/columnWidth.js.map +1 -0
  276. package/dist/transformers/entities.d.ts +37 -0
  277. package/dist/transformers/entities.d.ts.map +1 -0
  278. package/dist/transformers/entities.js +74 -0
  279. package/dist/transformers/entities.js.map +1 -0
  280. package/dist/transformers/filters/{defaults.d.mts → defaults.d.ts} +1 -1
  281. package/dist/transformers/filters/defaults.d.ts.map +1 -0
  282. package/dist/transformers/filters/{defaults.mjs → defaults.js} +2 -2
  283. package/dist/transformers/filters/defaults.js.map +1 -0
  284. package/dist/transformers/filters/index.d.ts +43 -0
  285. package/dist/transformers/filters/index.d.ts.map +1 -0
  286. package/dist/transformers/filters/index.js +89 -0
  287. package/dist/transformers/filters/index.js.map +1 -0
  288. package/dist/transformers/format.d.ts +22 -0
  289. package/dist/transformers/format.d.ts.map +1 -0
  290. package/dist/transformers/format.js +30 -0
  291. package/dist/transformers/format.js.map +1 -0
  292. package/dist/transformers/imgWidth.d.ts +20 -0
  293. package/dist/transformers/imgWidth.d.ts.map +1 -0
  294. package/dist/transformers/imgWidth.js +76 -0
  295. package/dist/transformers/imgWidth.js.map +1 -0
  296. package/dist/transformers/{index.d.mts → index.d.ts} +4 -3
  297. package/dist/transformers/index.d.ts.map +1 -0
  298. package/dist/transformers/index.js +163 -0
  299. package/dist/transformers/index.js.map +1 -0
  300. package/dist/transformers/inlineCss.d.ts +85 -0
  301. package/dist/transformers/inlineCss.d.ts.map +1 -0
  302. package/dist/transformers/inlineCss.js +112 -0
  303. package/dist/transformers/inlineCss.js.map +1 -0
  304. package/dist/transformers/inlineLink.d.ts +35 -0
  305. package/dist/transformers/inlineLink.d.ts.map +1 -0
  306. package/dist/transformers/{inlineLink.mjs → inlineLink.js} +35 -11
  307. package/dist/transformers/inlineLink.js.map +1 -0
  308. package/dist/transformers/minify.d.ts +21 -0
  309. package/dist/transformers/minify.d.ts.map +1 -0
  310. package/dist/transformers/minify.js +25 -0
  311. package/dist/transformers/minify.js.map +1 -0
  312. package/dist/transformers/minifyCodeInline.d.ts +29 -0
  313. package/dist/transformers/minifyCodeInline.d.ts.map +1 -0
  314. package/dist/transformers/minifyCodeInline.js +36 -0
  315. package/dist/transformers/minifyCodeInline.js.map +1 -0
  316. package/dist/transformers/msoPlaceholders.d.ts +33 -0
  317. package/dist/transformers/msoPlaceholders.d.ts.map +1 -0
  318. package/dist/transformers/msoPlaceholders.js +114 -0
  319. package/dist/transformers/msoPlaceholders.js.map +1 -0
  320. package/dist/transformers/purgeCss.d.ts +43 -0
  321. package/dist/transformers/purgeCss.d.ts.map +1 -0
  322. package/dist/transformers/purgeCss.js +207 -0
  323. package/dist/transformers/purgeCss.js.map +1 -0
  324. package/dist/transformers/removeAttributes.d.ts +54 -0
  325. package/dist/transformers/removeAttributes.d.ts.map +1 -0
  326. package/dist/transformers/removeAttributes.js +72 -0
  327. package/dist/transformers/removeAttributes.js.map +1 -0
  328. package/dist/transformers/{replaceStrings.d.mts → replaceStrings.d.ts} +2 -2
  329. package/dist/transformers/replaceStrings.d.ts.map +1 -0
  330. package/dist/transformers/{replaceStrings.mjs → replaceStrings.js} +2 -2
  331. package/dist/transformers/replaceStrings.js.map +1 -0
  332. package/dist/transformers/safeSelectors.d.ts +37 -0
  333. package/dist/transformers/safeSelectors.d.ts.map +1 -0
  334. package/dist/transformers/{safeClassNames.mjs → safeSelectors.js} +40 -10
  335. package/dist/transformers/safeSelectors.js.map +1 -0
  336. package/dist/transformers/shorthandCss.d.ts +47 -0
  337. package/dist/transformers/shorthandCss.d.ts.map +1 -0
  338. package/dist/transformers/shorthandCss.js +92 -0
  339. package/dist/transformers/shorthandCss.js.map +1 -0
  340. package/dist/transformers/sixHex.d.ts +25 -0
  341. package/dist/transformers/sixHex.d.ts.map +1 -0
  342. package/dist/transformers/sixHex.js +42 -0
  343. package/dist/transformers/sixHex.js.map +1 -0
  344. package/dist/transformers/tailwindComponent.d.ts +16 -0
  345. package/dist/transformers/tailwindComponent.d.ts.map +1 -0
  346. package/dist/transformers/tailwindComponent.js +101 -0
  347. package/dist/transformers/tailwindComponent.js.map +1 -0
  348. package/dist/transformers/{tailwindcss.d.mts → tailwindcss.d.ts} +2 -2
  349. package/dist/transformers/tailwindcss.d.ts.map +1 -0
  350. package/dist/transformers/{tailwindcss.mjs → tailwindcss.js} +33 -74
  351. package/dist/transformers/tailwindcss.js.map +1 -0
  352. package/dist/transformers/urlQuery.d.ts +36 -0
  353. package/dist/transformers/urlQuery.d.ts.map +1 -0
  354. package/dist/transformers/urlQuery.js +77 -0
  355. package/dist/transformers/urlQuery.js.map +1 -0
  356. package/dist/types/{config.d.mts → config.d.ts} +231 -46
  357. package/dist/types/config.d.ts.map +1 -0
  358. package/dist/types/config.js +1 -0
  359. package/dist/types/index.d.ts +2 -0
  360. package/dist/types/index.js +1 -0
  361. package/dist/utils/ast/index.d.ts +4 -0
  362. package/dist/utils/ast/index.js +4 -0
  363. package/dist/utils/ast/{parser.d.mts → parser.d.ts} +1 -1
  364. package/dist/utils/ast/parser.d.ts.map +1 -0
  365. package/dist/utils/ast/{parser.mjs → parser.js} +2 -3
  366. package/dist/utils/ast/parser.js.map +1 -0
  367. package/dist/utils/ast/{serializer.d.mts → serializer.d.ts} +1 -1
  368. package/dist/utils/ast/serializer.d.ts.map +1 -0
  369. package/dist/utils/ast/serializer.js +46 -0
  370. package/dist/utils/ast/serializer.js.map +1 -0
  371. package/dist/utils/ast/{walker.d.mts → walker.d.ts} +1 -1
  372. package/dist/utils/ast/walker.d.ts.map +1 -0
  373. package/dist/utils/ast/{walker.mjs → walker.js} +2 -2
  374. package/dist/utils/ast/walker.js.map +1 -0
  375. package/dist/utils/cloneConfig.d.ts +13 -0
  376. package/dist/utils/cloneConfig.d.ts.map +1 -0
  377. package/dist/utils/cloneConfig.js +21 -0
  378. package/dist/utils/cloneConfig.js.map +1 -0
  379. package/dist/utils/compileTailwindCss.d.ts +16 -0
  380. package/dist/utils/compileTailwindCss.d.ts.map +1 -0
  381. package/dist/utils/compileTailwindCss.js +55 -0
  382. package/dist/utils/compileTailwindCss.js.map +1 -0
  383. package/dist/utils/componentSources.d.ts +50 -0
  384. package/dist/utils/componentSources.d.ts.map +1 -0
  385. package/dist/utils/componentSources.js +50 -0
  386. package/dist/utils/componentSources.js.map +1 -0
  387. package/dist/utils/cssBox.d.ts +42 -0
  388. package/dist/utils/cssBox.d.ts.map +1 -0
  389. package/dist/utils/cssBox.js +151 -0
  390. package/dist/utils/cssBox.js.map +1 -0
  391. package/dist/utils/decodeStyleEntities.d.ts +15 -0
  392. package/dist/utils/decodeStyleEntities.d.ts.map +1 -0
  393. package/dist/utils/decodeStyleEntities.js +18 -0
  394. package/dist/utils/decodeStyleEntities.js.map +1 -0
  395. package/dist/utils/{detect.d.mts → detect.d.ts} +1 -1
  396. package/dist/utils/detect.d.ts.map +1 -0
  397. package/dist/utils/{detect.mjs → detect.js} +2 -3
  398. package/dist/utils/detect.js.map +1 -0
  399. package/dist/utils/output-markers.d.ts +29 -0
  400. package/dist/utils/output-markers.d.ts.map +1 -0
  401. package/dist/utils/output-markers.js +68 -0
  402. package/dist/utils/output-markers.js.map +1 -0
  403. package/dist/utils/{url.d.mts → url.d.ts} +1 -1
  404. package/dist/utils/url.d.ts.map +1 -0
  405. package/dist/utils/{url.mjs → url.js} +2 -3
  406. package/dist/utils/url.js.map +1 -0
  407. package/dist/utils/watchPaths.d.ts +11 -0
  408. package/dist/utils/watchPaths.d.ts.map +1 -0
  409. package/dist/utils/watchPaths.js +19 -0
  410. package/dist/utils/watchPaths.js.map +1 -0
  411. package/node_modules/@clack/core/CHANGELOG.md +44 -0
  412. package/node_modules/@clack/core/dist/index.d.mts +125 -5
  413. package/node_modules/@clack/core/dist/index.mjs +972 -11
  414. package/node_modules/@clack/core/package.json +6 -2
  415. package/node_modules/@clack/prompts/CHANGELOG.md +70 -0
  416. package/node_modules/@clack/prompts/README.md +129 -3
  417. package/node_modules/@clack/prompts/dist/index.d.mts +567 -33
  418. package/node_modules/@clack/prompts/dist/index.mjs +1378 -133
  419. package/node_modules/@clack/prompts/package.json +7 -4
  420. package/node_modules/fast-string-truncated-width/dist/index.js +36 -96
  421. package/node_modules/fast-string-truncated-width/dist/types.d.ts +0 -3
  422. package/node_modules/fast-string-truncated-width/dist/utils.d.ts +3 -3
  423. package/node_modules/fast-string-truncated-width/dist/utils.js +14 -9
  424. package/node_modules/fast-string-truncated-width/package.json +1 -1
  425. package/node_modules/fast-string-truncated-width/readme.md +2 -3
  426. package/node_modules/fast-string-width/package.json +2 -2
  427. package/node_modules/fast-string-width/readme.md +0 -3
  428. package/node_modules/fast-wrap-ansi/lib/main.js +4 -2
  429. package/node_modules/fast-wrap-ansi/package.json +11 -11
  430. package/node_modules/maizzle/README.md +24 -0
  431. package/node_modules/maizzle/dist/commands/make/component.mjs +1 -1
  432. package/node_modules/maizzle/dist/commands/make/config.mjs +8 -7
  433. package/node_modules/maizzle/dist/commands/make/layout.mjs +3 -3
  434. package/node_modules/maizzle/dist/commands/make/scaffold.mjs +1 -1
  435. package/node_modules/maizzle/dist/commands/make/stubs/Layout.vue +146 -0
  436. package/node_modules/maizzle/dist/commands/make/stubs/component.vue +2 -4
  437. package/node_modules/maizzle/dist/commands/make/stubs/config.ts +1 -5
  438. package/node_modules/maizzle/dist/commands/make/template.mjs +1 -1
  439. package/node_modules/maizzle/dist/commands/new.mjs +46 -135
  440. package/node_modules/maizzle/dist/index.d.mts +1 -0
  441. package/node_modules/maizzle/dist/index.mjs +30 -7
  442. package/node_modules/maizzle/package.json +5 -4
  443. package/node_modules/nypm/dist/cli.mjs +28 -5
  444. package/node_modules/nypm/dist/index.d.mts +0 -8
  445. package/node_modules/nypm/dist/index.mjs +27 -4
  446. package/node_modules/nypm/package.json +12 -12
  447. package/node_modules/tinyexec/README.md +9 -1
  448. package/node_modules/tinyexec/dist/main.d.mts +22 -7
  449. package/node_modules/tinyexec/dist/main.mjs +189 -491
  450. package/node_modules/tinyexec/package.json +14 -16
  451. package/package.json +37 -30
  452. package/dist/_virtual/_rolldown/runtime.mjs +0 -32
  453. package/dist/build.d.mts +0 -19
  454. package/dist/build.d.mts.map +0 -1
  455. package/dist/build.mjs +0 -141
  456. package/dist/build.mjs.map +0 -1
  457. package/dist/components/Divider.vue +0 -133
  458. package/dist/components/Image.vue +0 -70
  459. package/dist/components/Overlap.vue +0 -80
  460. package/dist/components/utils.d.mts +0 -5
  461. package/dist/components/utils.d.mts.map +0 -1
  462. package/dist/components/utils.mjs +0 -9
  463. package/dist/components/utils.mjs.map +0 -1
  464. package/dist/composables/defineConfig.d.mts +0 -14
  465. package/dist/composables/defineConfig.d.mts.map +0 -1
  466. package/dist/composables/defineConfig.mjs.map +0 -1
  467. package/dist/composables/renderContext.d.mts +0 -24
  468. package/dist/composables/renderContext.d.mts.map +0 -1
  469. package/dist/composables/renderContext.mjs +0 -6
  470. package/dist/composables/renderContext.mjs.map +0 -1
  471. package/dist/composables/useConfig.d.mts +0 -9
  472. package/dist/composables/useConfig.d.mts.map +0 -1
  473. package/dist/composables/useConfig.mjs +0 -13
  474. package/dist/composables/useConfig.mjs.map +0 -1
  475. package/dist/composables/useDoctype.d.mts.map +0 -1
  476. package/dist/composables/useDoctype.mjs.map +0 -1
  477. package/dist/composables/useEvent.d.mts.map +0 -1
  478. package/dist/composables/useEvent.mjs.map +0 -1
  479. package/dist/composables/usePlaintext.d.mts.map +0 -1
  480. package/dist/composables/usePlaintext.mjs.map +0 -1
  481. package/dist/composables/usePreviewText.d.mts +0 -24
  482. package/dist/composables/usePreviewText.d.mts.map +0 -1
  483. package/dist/composables/usePreviewText.mjs +0 -29
  484. package/dist/composables/usePreviewText.mjs.map +0 -1
  485. package/dist/config/defaults.d.mts.map +0 -1
  486. package/dist/config/defaults.mjs.map +0 -1
  487. package/dist/config/index.d.mts +0 -15
  488. package/dist/config/index.d.mts.map +0 -1
  489. package/dist/config/index.mjs.map +0 -1
  490. package/dist/events/index.d.mts.map +0 -1
  491. package/dist/events/index.mjs.map +0 -1
  492. package/dist/index.d.mts +0 -31
  493. package/dist/index.mjs +0 -31
  494. package/dist/node_modules/picomatch/index.mjs +0 -13
  495. package/dist/node_modules/picomatch/index.mjs.map +0 -1
  496. package/dist/node_modules/picomatch/lib/constants.mjs +0 -174
  497. package/dist/node_modules/picomatch/lib/constants.mjs.map +0 -1
  498. package/dist/node_modules/picomatch/lib/parse.mjs +0 -1067
  499. package/dist/node_modules/picomatch/lib/parse.mjs.map +0 -1
  500. package/dist/node_modules/picomatch/lib/picomatch.mjs +0 -304
  501. package/dist/node_modules/picomatch/lib/picomatch.mjs.map +0 -1
  502. package/dist/node_modules/picomatch/lib/scan.mjs +0 -296
  503. package/dist/node_modules/picomatch/lib/scan.mjs.map +0 -1
  504. package/dist/node_modules/picomatch/lib/utils.mjs +0 -53
  505. package/dist/node_modules/picomatch/lib/utils.mjs.map +0 -1
  506. package/dist/plaintext.d.mts.map +0 -1
  507. package/dist/plaintext.mjs.map +0 -1
  508. package/dist/plugin.d.mts.map +0 -1
  509. package/dist/plugin.mjs.map +0 -1
  510. package/dist/plugins/postcss/mergeMediaQueries.d.mts.map +0 -1
  511. package/dist/plugins/postcss/mergeMediaQueries.mjs.map +0 -1
  512. package/dist/plugins/postcss/pruneVars.d.mts.map +0 -1
  513. package/dist/plugins/postcss/pruneVars.mjs.map +0 -1
  514. package/dist/plugins/postcss/removeDeclarations.d.mts.map +0 -1
  515. package/dist/plugins/postcss/removeDeclarations.mjs.map +0 -1
  516. package/dist/plugins/postcss/tailwindCleanup.d.mts.map +0 -1
  517. package/dist/plugins/postcss/tailwindCleanup.mjs.map +0 -1
  518. package/dist/render/createRenderer.d.mts.map +0 -1
  519. package/dist/render/createRenderer.mjs +0 -286
  520. package/dist/render/createRenderer.mjs.map +0 -1
  521. package/dist/render/index.d.mts +0 -26
  522. package/dist/render/index.d.mts.map +0 -1
  523. package/dist/render/index.mjs +0 -46
  524. package/dist/render/index.mjs.map +0 -1
  525. package/dist/serve.d.mts.map +0 -1
  526. package/dist/serve.mjs.map +0 -1
  527. package/dist/server/compatibility.d.mts +0 -5
  528. package/dist/server/compatibility.d.mts.map +0 -1
  529. package/dist/server/compatibility.mjs +0 -97
  530. package/dist/server/compatibility.mjs.map +0 -1
  531. package/dist/server/email.d.mts.map +0 -1
  532. package/dist/server/email.mjs.map +0 -1
  533. package/dist/server/linter.d.mts +0 -5
  534. package/dist/server/linter.d.mts.map +0 -1
  535. package/dist/server/linter.mjs +0 -189
  536. package/dist/server/linter.mjs.map +0 -1
  537. package/dist/transformers/addAttributes.d.mts +0 -32
  538. package/dist/transformers/addAttributes.d.mts.map +0 -1
  539. package/dist/transformers/addAttributes.mjs.map +0 -1
  540. package/dist/transformers/attributeToStyle.d.mts +0 -25
  541. package/dist/transformers/attributeToStyle.d.mts.map +0 -1
  542. package/dist/transformers/attributeToStyle.mjs +0 -80
  543. package/dist/transformers/attributeToStyle.mjs.map +0 -1
  544. package/dist/transformers/base.d.mts +0 -8
  545. package/dist/transformers/base.d.mts.map +0 -1
  546. package/dist/transformers/base.mjs.map +0 -1
  547. package/dist/transformers/entities.d.mts +0 -8
  548. package/dist/transformers/entities.d.mts.map +0 -1
  549. package/dist/transformers/entities.mjs +0 -41
  550. package/dist/transformers/entities.mjs.map +0 -1
  551. package/dist/transformers/filters/defaults.d.mts.map +0 -1
  552. package/dist/transformers/filters/defaults.mjs.map +0 -1
  553. package/dist/transformers/filters/index.d.mts +0 -22
  554. package/dist/transformers/filters/index.d.mts.map +0 -1
  555. package/dist/transformers/filters/index.mjs +0 -67
  556. package/dist/transformers/filters/index.mjs.map +0 -1
  557. package/dist/transformers/format.d.mts +0 -15
  558. package/dist/transformers/format.d.mts.map +0 -1
  559. package/dist/transformers/format.mjs +0 -26
  560. package/dist/transformers/format.mjs.map +0 -1
  561. package/dist/transformers/index.d.mts.map +0 -1
  562. package/dist/transformers/index.mjs +0 -81
  563. package/dist/transformers/index.mjs.map +0 -1
  564. package/dist/transformers/inlineCSS.d.mts +0 -17
  565. package/dist/transformers/inlineCSS.d.mts.map +0 -1
  566. package/dist/transformers/inlineCSS.mjs +0 -70
  567. package/dist/transformers/inlineCSS.mjs.map +0 -1
  568. package/dist/transformers/inlineLink.d.mts +0 -14
  569. package/dist/transformers/inlineLink.d.mts.map +0 -1
  570. package/dist/transformers/inlineLink.mjs.map +0 -1
  571. package/dist/transformers/minify.d.mts +0 -17
  572. package/dist/transformers/minify.d.mts.map +0 -1
  573. package/dist/transformers/minify.mjs +0 -24
  574. package/dist/transformers/minify.mjs.map +0 -1
  575. package/dist/transformers/purgeCSS.d.mts +0 -23
  576. package/dist/transformers/purgeCSS.d.mts.map +0 -1
  577. package/dist/transformers/purgeCSS.mjs +0 -132
  578. package/dist/transformers/purgeCSS.mjs.map +0 -1
  579. package/dist/transformers/removeAttributes.d.mts +0 -31
  580. package/dist/transformers/removeAttributes.d.mts.map +0 -1
  581. package/dist/transformers/removeAttributes.mjs +0 -63
  582. package/dist/transformers/removeAttributes.mjs.map +0 -1
  583. package/dist/transformers/replaceStrings.d.mts.map +0 -1
  584. package/dist/transformers/replaceStrings.mjs.map +0 -1
  585. package/dist/transformers/safeClassNames.d.mts +0 -22
  586. package/dist/transformers/safeClassNames.d.mts.map +0 -1
  587. package/dist/transformers/safeClassNames.mjs.map +0 -1
  588. package/dist/transformers/shorthandCSS.d.mts +0 -24
  589. package/dist/transformers/shorthandCSS.d.mts.map +0 -1
  590. package/dist/transformers/shorthandCSS.mjs +0 -48
  591. package/dist/transformers/shorthandCSS.mjs.map +0 -1
  592. package/dist/transformers/sixHex.d.mts +0 -16
  593. package/dist/transformers/sixHex.d.mts.map +0 -1
  594. package/dist/transformers/sixHex.mjs +0 -30
  595. package/dist/transformers/sixHex.mjs.map +0 -1
  596. package/dist/transformers/tailwindcss.d.mts.map +0 -1
  597. package/dist/transformers/tailwindcss.mjs.map +0 -1
  598. package/dist/transformers/urlQuery.d.mts +0 -24
  599. package/dist/transformers/urlQuery.d.mts.map +0 -1
  600. package/dist/transformers/urlQuery.mjs +0 -65
  601. package/dist/transformers/urlQuery.mjs.map +0 -1
  602. package/dist/types/config.d.mts.map +0 -1
  603. package/dist/types/config.mjs +0 -1
  604. package/dist/types/index.d.mts +0 -2
  605. package/dist/types/index.mjs +0 -1
  606. package/dist/utils/ast/index.d.mts +0 -4
  607. package/dist/utils/ast/index.mjs +0 -5
  608. package/dist/utils/ast/parser.d.mts.map +0 -1
  609. package/dist/utils/ast/parser.mjs.map +0 -1
  610. package/dist/utils/ast/serializer.d.mts.map +0 -1
  611. package/dist/utils/ast/serializer.mjs +0 -37
  612. package/dist/utils/ast/serializer.mjs.map +0 -1
  613. package/dist/utils/ast/walker.d.mts.map +0 -1
  614. package/dist/utils/ast/walker.mjs.map +0 -1
  615. package/dist/utils/detect.d.mts.map +0 -1
  616. package/dist/utils/detect.mjs.map +0 -1
  617. package/dist/utils/url.d.mts.map +0 -1
  618. package/dist/utils/url.mjs.map +0 -1
  619. package/node_modules/@clack/core/dist/index.mjs.map +0 -1
  620. package/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
  621. package/node_modules/fast-wrap-ansi/lib/main.js.map +0 -1
  622. package/node_modules/maizzle/dist/commands/make/stubs/layout.vue +0 -39
  623. package/node_modules/tinyexec/dist/LICENSES.txt +0 -83
@@ -0,0 +1,959 @@
1
+ import { tailwindcss } from "../transformers/tailwindcss.js";
2
+ import { buildComponentMap, findComponentTags, isFrameworkComponent, parseSfcBlocks } from "./sfc-utils.js";
3
+ import { scanLint } from "./linter.js";
4
+ import { readFileSync } from "node:fs";
5
+ import { resolve } from "node:path";
6
+ import { Parser } from "htmlparser2";
7
+ import { DomHandler } from "domhandler";
8
+ import safeParser from "postcss-safe-parser";
9
+ import valueParser from "postcss-value-parser";
10
+ //#region src/server/compatibility.ts
11
+ const API_URL = "https://www.caniemail.com/api/data.json";
12
+ const DEFAULT_CLIENTS = new Set([
13
+ "gmail",
14
+ "apple-mail",
15
+ "outlook",
16
+ "yahoo"
17
+ ]);
18
+ let indexes = null;
19
+ let initPromise = null;
20
+ function mpush(m, k, v) {
21
+ const arr = m.get(k);
22
+ if (arr) arr.push(v);
23
+ else m.set(k, [v]);
24
+ }
25
+ function emptyIndexes(nicenames, familyNicenames) {
26
+ return {
27
+ nicenames,
28
+ familyNicenames,
29
+ cssProp: /* @__PURE__ */ new Map(),
30
+ cssPropValue: /* @__PURE__ */ new Map(),
31
+ cssAtRule: /* @__PURE__ */ new Map(),
32
+ cssMediaFeature: /* @__PURE__ */ new Map(),
33
+ cssPseudoClass: /* @__PURE__ */ new Map(),
34
+ cssPseudoElement: /* @__PURE__ */ new Map(),
35
+ cssFunction: /* @__PURE__ */ new Map(),
36
+ cssUnit: /* @__PURE__ */ new Map(),
37
+ htmlTag: /* @__PURE__ */ new Map(),
38
+ htmlAttr: /* @__PURE__ */ new Map(),
39
+ htmlInputType: /* @__PURE__ */ new Map(),
40
+ htmlButtonType: /* @__PURE__ */ new Map(),
41
+ imageExt: /* @__PURE__ */ new Map(),
42
+ bySlug: /* @__PURE__ */ new Map()
43
+ };
44
+ }
45
+ function hasAnyNonY(stats) {
46
+ if (!stats) return false;
47
+ for (const family in stats) for (const plat in stats[family]) for (const ver in stats[family][plat]) {
48
+ const v = stripNotes(String(stats[family][plat][ver]).trim());
49
+ if (v && v !== "y") return true;
50
+ }
51
+ return false;
52
+ }
53
+ /** Strip `#N` note markers — `"y #1"` → `"y"`. Notes document edge cases but
54
+ * don't change support semantics, so treat `y #1` as fully supported. */
55
+ function stripNotes(v) {
56
+ return v.split(/\s+/).filter((t) => t && !t.startsWith("#")).join(" ");
57
+ }
58
+ function computeSupport(stats, familyNicenames, allowedClients) {
59
+ let nY = 0, nN = 0, nU = 0, nPartial = 0, total = 0;
60
+ const affectedFamilies = /* @__PURE__ */ new Set();
61
+ for (const family in stats) {
62
+ if (allowedClients !== "all" && !allowedClients.has(family)) continue;
63
+ let familyHasNonY = false;
64
+ for (const plat in stats[family]) {
65
+ /**
66
+ * Only score the latest version per (family, platform) — legacy
67
+ * versions (Outlook 2007, etc.) otherwise flag modern-widely
68
+ * supported features as partial forever.
69
+ */
70
+ const versions = Object.keys(stats[family][plat]).sort();
71
+ const latest = versions[versions.length - 1];
72
+ if (!latest) continue;
73
+ total++;
74
+ const v = stripNotes(String(stats[family][plat][latest]).trim());
75
+ if (v === "y") nY++;
76
+ else if (v === "n") {
77
+ nN++;
78
+ familyHasNonY = true;
79
+ } else if (v === "u") {
80
+ nU++;
81
+ familyHasNonY = true;
82
+ } else {
83
+ nPartial++;
84
+ familyHasNonY = true;
85
+ }
86
+ }
87
+ if (familyHasNonY) affectedFamilies.add(family);
88
+ }
89
+ if (!total) return null;
90
+ if (nY === total) return null;
91
+ const affected = [...affectedFamilies].map((f) => familyNicenames[f] ?? f).sort();
92
+ if (nN === total) return {
93
+ level: "unsupported",
94
+ affected
95
+ };
96
+ if (nU === total) return {
97
+ level: "unknown",
98
+ affected
99
+ };
100
+ return {
101
+ level: "mitigated",
102
+ affected
103
+ };
104
+ }
105
+ /**
106
+ * Slugs we never report. Fundamental HTML (every email uses these) plus
107
+ * CSS noise that's not actionable (comments, !important usage).
108
+ */
109
+ const IGNORED_SLUGS = new Set([
110
+ "html-doctype",
111
+ "html-comments",
112
+ "html-html",
113
+ "html-head",
114
+ "html-body",
115
+ "html-title",
116
+ "html-meta",
117
+ "html-meta-color-scheme",
118
+ "html-style",
119
+ "html-link",
120
+ "html-div",
121
+ "html-span",
122
+ "html-br",
123
+ "html-p",
124
+ "html-a",
125
+ "html-img",
126
+ "html-table",
127
+ "html-tr",
128
+ "html-td",
129
+ "html-th",
130
+ "html-thead",
131
+ "html-tbody",
132
+ "html-tfoot",
133
+ "html-h1-h6",
134
+ "html-lists",
135
+ "html-strong",
136
+ "html-em",
137
+ "html-b",
138
+ "html-i",
139
+ "html-u",
140
+ "html-semantics",
141
+ "html-role",
142
+ "html-hidden",
143
+ "html-width",
144
+ "html-height",
145
+ "css-comments",
146
+ "css-important",
147
+ "css-margin",
148
+ "css-padding",
149
+ "css-border",
150
+ "css-font-size",
151
+ "css-font-weight",
152
+ "css-font",
153
+ "css-font-family",
154
+ "css-line-height",
155
+ "css-letter-spacing",
156
+ "css-text-align",
157
+ "css-text-decoration",
158
+ "css-text-transform",
159
+ "css-color",
160
+ "css-background",
161
+ "css-background-color",
162
+ "css-width",
163
+ "css-height",
164
+ "css-display"
165
+ ]);
166
+ function classify(f, idx) {
167
+ const slug = f.slug;
168
+ /**
169
+ * Retain html-style feature for the body-only detector even though it's
170
+ * blacklisted from the normal html-tag detection path. Title is
171
+ * suffixed so the flag reads as a body-placement warning, not a
172
+ * blanket `<style>`.
173
+ */
174
+ if (slug === "html-style") {
175
+ idx.htmlStyleInBody = {
176
+ ...f,
177
+ title: `${f.title} in <body>`
178
+ };
179
+ return;
180
+ }
181
+ if (IGNORED_SLUGS.has(slug)) return;
182
+ if (f.category === "css") return classifyCss(f, slug, idx);
183
+ if (f.category === "html") return classifyHtml(f, slug, idx);
184
+ if (f.category === "image") {
185
+ const ext = slug.slice(6);
186
+ if (ext === "base64") return;
187
+ mpush(idx.imageExt, ext, f);
188
+ }
189
+ }
190
+ function classifyCss(f, slug, idx) {
191
+ switch (slug) {
192
+ case "css-important":
193
+ idx.cssImportant = f;
194
+ return;
195
+ case "css-variables":
196
+ idx.cssVariables = f;
197
+ return;
198
+ case "css-nesting":
199
+ idx.cssNesting = f;
200
+ return;
201
+ case "css-comments":
202
+ idx.cssComments = f;
203
+ return;
204
+ case "css-modern-color":
205
+ idx.cssModernColor = f;
206
+ return;
207
+ case "css-display-flex":
208
+ mpushPropValue(idx, "display", "flex", f);
209
+ return;
210
+ case "css-display-grid":
211
+ mpushPropValue(idx, "display", "grid", f);
212
+ return;
213
+ case "css-display-none":
214
+ mpushPropValue(idx, "display", "none", f);
215
+ return;
216
+ case "css-rgb":
217
+ mpush(idx.cssFunction, "rgb", f);
218
+ return;
219
+ case "css-rgba":
220
+ mpush(idx.cssFunction, "rgba", f);
221
+ return;
222
+ case "css-linear-gradient":
223
+ mpush(idx.cssFunction, "linear-gradient", f);
224
+ return;
225
+ case "css-radial-gradient":
226
+ mpush(idx.cssFunction, "radial-gradient", f);
227
+ return;
228
+ case "css-conic-gradient":
229
+ mpush(idx.cssFunction, "conic-gradient", f);
230
+ return;
231
+ }
232
+ if (slug.startsWith("css-at-media-") && slug !== "css-at-media") {
233
+ mpush(idx.cssMediaFeature, slug.slice(13), f);
234
+ return;
235
+ }
236
+ if (slug.startsWith("css-at-")) {
237
+ mpush(idx.cssAtRule, slug.slice(7), f);
238
+ return;
239
+ }
240
+ if (slug.startsWith("css-pseudo-class-")) {
241
+ mpush(idx.cssPseudoClass, slug.slice(17), f);
242
+ return;
243
+ }
244
+ if (slug.startsWith("css-pseudo-element-")) {
245
+ mpush(idx.cssPseudoElement, slug.slice(19), f);
246
+ return;
247
+ }
248
+ if (slug.startsWith("css-unit-")) {
249
+ const u = slug.slice(9);
250
+ if (u === "calc") {
251
+ mpush(idx.cssFunction, "calc", f);
252
+ return;
253
+ }
254
+ if (u === "initial") return;
255
+ const unit = u === "percent" ? "%" : u;
256
+ mpush(idx.cssUnit, unit, f);
257
+ return;
258
+ }
259
+ if (slug.startsWith("css-function-")) {
260
+ mpush(idx.cssFunction, slug.slice(13), f);
261
+ return;
262
+ }
263
+ if (slug.startsWith("css-selector-")) return;
264
+ mpush(idx.cssProp, slug.slice(4), f);
265
+ }
266
+ function mpushPropValue(idx, prop, value, f) {
267
+ const arr = idx.cssPropValue.get(prop);
268
+ if (arr) arr.push({
269
+ value,
270
+ feature: f
271
+ });
272
+ else idx.cssPropValue.set(prop, [{
273
+ value,
274
+ feature: f
275
+ }]);
276
+ }
277
+ const HTML_ATTR_SLUGS = new Set([
278
+ "align",
279
+ "background",
280
+ "cellpadding",
281
+ "cellspacing",
282
+ "height",
283
+ "width",
284
+ "valign",
285
+ "target",
286
+ "srcset",
287
+ "lang",
288
+ "dir",
289
+ "role",
290
+ "required",
291
+ "hidden"
292
+ ]);
293
+ function classifyHtml(f, slug, idx) {
294
+ switch (slug) {
295
+ case "html-doctype":
296
+ idx.htmlDoctype = f;
297
+ return;
298
+ case "html-comments":
299
+ idx.htmlComments = f;
300
+ return;
301
+ case "html-anchor-links":
302
+ idx.htmlAnchorLinks = f;
303
+ return;
304
+ case "html-mailto-links":
305
+ idx.htmlMailtoLinks = f;
306
+ return;
307
+ case "html-meta-color-scheme":
308
+ idx.htmlMetaColorScheme = f;
309
+ return;
310
+ case "html-semantics":
311
+ idx.htmlSemantics = f;
312
+ return;
313
+ case "html-loading-attribute":
314
+ mpush(idx.htmlAttr, "loading", f);
315
+ return;
316
+ case "html-image-maps":
317
+ mpush(idx.htmlTag, "map", f);
318
+ mpush(idx.htmlTag, "area", f);
319
+ mpush(idx.htmlAttr, "usemap", f);
320
+ return;
321
+ case "html-lists":
322
+ for (const t of [
323
+ "ul",
324
+ "ol",
325
+ "li",
326
+ "dl",
327
+ "dt",
328
+ "dd"
329
+ ]) mpush(idx.htmlTag, t, f);
330
+ return;
331
+ case "html-h1-h6":
332
+ for (const t of [
333
+ "h1",
334
+ "h2",
335
+ "h3",
336
+ "h4",
337
+ "h5",
338
+ "h6"
339
+ ]) mpush(idx.htmlTag, t, f);
340
+ return;
341
+ }
342
+ if (slug.startsWith("html-input-")) {
343
+ mpush(idx.htmlInputType, slug.slice(11), f);
344
+ return;
345
+ }
346
+ if (slug.startsWith("html-button-")) {
347
+ mpush(idx.htmlButtonType, slug.slice(12), f);
348
+ return;
349
+ }
350
+ if (slug.startsWith("html-aria-")) {
351
+ mpush(idx.htmlAttr, slug.slice(5), f);
352
+ return;
353
+ }
354
+ const name = slug.slice(5);
355
+ if (HTML_ATTR_SLUGS.has(name)) {
356
+ mpush(idx.htmlAttr, name, f);
357
+ return;
358
+ }
359
+ mpush(idx.htmlTag, name, f);
360
+ }
361
+ async function initCompatibility() {
362
+ if (indexes) return indexes;
363
+ if (initPromise) return initPromise;
364
+ initPromise = (async () => {
365
+ try {
366
+ const res = await fetch(API_URL);
367
+ if (!res.ok) return null;
368
+ const data = await res.json();
369
+ const idx = emptyIndexes(data.nicenames?.support ?? {}, data.nicenames?.family ?? {});
370
+ for (const item of data.data ?? []) {
371
+ /**
372
+ * Record every slug's title/url so lint can look up caniemail
373
+ * pages for issues that map to a known feature, even ignored.
374
+ */
375
+ if (item.slug && item.url) idx.bySlug.set(item.slug, {
376
+ title: item.title,
377
+ url: item.url
378
+ });
379
+ /**
380
+ * Index the feature if any cell anywhere in the matrix is non-y.
381
+ * Per-request aggregation (with the active client filter)
382
+ * decides whether to actually surface the issue.
383
+ */
384
+ if (!hasAnyNonY(item.stats)) continue;
385
+ classify({
386
+ slug: item.slug,
387
+ title: item.title,
388
+ url: item.url,
389
+ category: item.category,
390
+ stats: item.stats
391
+ }, idx);
392
+ }
393
+ indexes = idx;
394
+ return idx;
395
+ } catch {
396
+ return null;
397
+ }
398
+ })();
399
+ return initPromise;
400
+ }
401
+ function collectStreams(filePath, componentMap, visited, out) {
402
+ if (visited.has(filePath)) return;
403
+ visited.add(filePath);
404
+ let source;
405
+ try {
406
+ source = readFileSync(filePath, "utf-8");
407
+ } catch {
408
+ return;
409
+ }
410
+ const { template, styles } = parseSfcBlocks(source);
411
+ const classes = /* @__PURE__ */ new Set();
412
+ if (template) extractClasses(template.content, classes);
413
+ out.push({
414
+ path: filePath,
415
+ source,
416
+ template,
417
+ styles,
418
+ classes
419
+ });
420
+ if (template) for (const tag of findComponentTags(template.content)) {
421
+ const cp = componentMap.get(tag.toLowerCase());
422
+ if (cp) collectStreams(cp, componentMap, visited, out);
423
+ }
424
+ }
425
+ function extractClasses(html, out) {
426
+ const parser = new Parser({ onopentag(_tag, attrs) {
427
+ const c = attrs.class;
428
+ if (!c) return;
429
+ for (const t of c.split(/\s+/)) if (t) out.add(t);
430
+ } }, { decodeEntities: true });
431
+ parser.write(html);
432
+ parser.end();
433
+ }
434
+ function parseWithIndices(html) {
435
+ const handler = new DomHandler(void 0, { withStartIndices: true });
436
+ const parser = new Parser(handler);
437
+ parser.write(html);
438
+ parser.end();
439
+ return handler.dom;
440
+ }
441
+ function findStyleNodes(nodes, out = []) {
442
+ for (const n of nodes) {
443
+ const el = n;
444
+ if (el.name === "style") out.push(el);
445
+ if (el.children?.length) findStyleNodes(el.children, out);
446
+ }
447
+ return out;
448
+ }
449
+ /**
450
+ * Parse each file's template, collect every `<style>` node with its source
451
+ * line (via htmlparser2 start indices), then pass the combined DOM through
452
+ * the framework's real Tailwind pipeline. The pipeline resolves imports
453
+ * (@maizzle/tailwindcss), compiles utilities from class attrs, lowers modern
454
+ * CSS via lightningcss, and resolves static calc() — so what we walk matches
455
+ * what ships.
456
+ */
457
+ async function compileViaPipeline(streams, config, rootFile) {
458
+ const all = [];
459
+ const tracked = [];
460
+ for (const s of streams) {
461
+ if (!s.template) continue;
462
+ const templateStart = s.source.indexOf(s.template.content);
463
+ const nodes = parseWithIndices(s.template.content);
464
+ for (const styleNode of findStyleNodes(nodes)) {
465
+ const startIdx = styleNode.startIndex ?? 0;
466
+ const line = offsetToLine(s.source, templateStart + startIdx);
467
+ tracked.push({
468
+ node: styleNode,
469
+ file: s.path,
470
+ line
471
+ });
472
+ }
473
+ for (const n of nodes) all.push(n);
474
+ }
475
+ if (!tracked.length) return [];
476
+ try {
477
+ await tailwindcss(all, config, rootFile);
478
+ } catch {
479
+ return [];
480
+ }
481
+ return tracked.map((t) => {
482
+ const txt = t.node.children?.find((c) => c.type === "text");
483
+ return txt?.data ? {
484
+ file: t.file,
485
+ css: txt.data,
486
+ line: t.line
487
+ } : null;
488
+ }).filter((x) => x !== null);
489
+ }
490
+ /**
491
+ * Walk CSS AST with detectors. Calls onHit per feature hit.
492
+ * `selector` is the containing rule's selector (undefined if no rule ancestor).
493
+ */
494
+ function walkCss(css, idx, onHit) {
495
+ let root;
496
+ try {
497
+ root = safeParser(css);
498
+ } catch {
499
+ return;
500
+ }
501
+ const containingSelector = (n) => {
502
+ let p = n?.parent;
503
+ while (p && p.type !== "root") {
504
+ if (p.type === "rule") return p.selector;
505
+ p = p.parent;
506
+ }
507
+ };
508
+ if (idx.cssComments) root.walkComments((c) => {
509
+ onHit(idx.cssComments, {
510
+ line: c.source?.start?.line,
511
+ selector: containingSelector(c)
512
+ });
513
+ });
514
+ root.walkAtRules((atRule) => {
515
+ const line = atRule.source?.start?.line;
516
+ let sel = containingSelector(atRule);
517
+ if (atRule.name === "media" && !sel) {
518
+ const innerSelectors = [];
519
+ atRule.walkRules((r) => {
520
+ innerSelectors.push(r.selector);
521
+ });
522
+ if (innerSelectors.length) sel = innerSelectors.join(", ");
523
+ }
524
+ if (atRule.name === "media") {
525
+ /**
526
+ * Pick the most specific media-feature match (prefers-color-scheme,
527
+ * hover, orientation, …). If one matches, skip the generic
528
+ * `css-at-media` to avoid duplicate rows on the same line.
529
+ */
530
+ const specific = [];
531
+ if (idx.cssMediaFeature.size) {
532
+ for (const [feat, fs2] of idx.cssMediaFeature) if (atRule.params.includes(`(${feat}`) || atRule.params.includes(feat)) specific.push(...fs2);
533
+ }
534
+ if (specific.length) for (const f of specific) onHit(f, {
535
+ line,
536
+ selector: sel
537
+ });
538
+ else {
539
+ const fs = idx.cssAtRule.get("media");
540
+ if (fs) for (const f of fs) onHit(f, {
541
+ line,
542
+ selector: sel
543
+ });
544
+ }
545
+ } else {
546
+ const fs = idx.cssAtRule.get(atRule.name);
547
+ if (fs) for (const f of fs) onHit(f, {
548
+ line,
549
+ selector: sel
550
+ });
551
+ }
552
+ });
553
+ root.walkRules((rule) => {
554
+ const line = rule.source?.start?.line;
555
+ const sel = rule.selector;
556
+ if (idx.cssPseudoClass.size) {
557
+ for (const [name, fs] of idx.cssPseudoClass) if (new RegExp(`(^|[^:]):${escapeRe(name)}(\\b|\\()`).test(sel)) for (const f of fs) onHit(f, {
558
+ line,
559
+ selector: sel
560
+ });
561
+ }
562
+ if (idx.cssPseudoElement.size) {
563
+ for (const [name, fs] of idx.cssPseudoElement) if (new RegExp(`::${escapeRe(name)}\\b`).test(sel)) for (const f of fs) onHit(f, {
564
+ line,
565
+ selector: sel
566
+ });
567
+ }
568
+ });
569
+ root.walkDecls((decl) => {
570
+ const line = decl.source?.start?.line;
571
+ const sel = containingSelector(decl);
572
+ const prop = decl.prop;
573
+ if (idx.cssImportant && decl.important) onHit(idx.cssImportant, {
574
+ line,
575
+ selector: sel
576
+ });
577
+ if (idx.cssVariables && prop.startsWith("--")) onHit(idx.cssVariables, {
578
+ line,
579
+ selector: sel
580
+ });
581
+ const fs = idx.cssProp.get(prop);
582
+ if (fs) for (const f of fs) onHit(f, {
583
+ line,
584
+ selector: sel
585
+ });
586
+ const pvs = idx.cssPropValue.get(prop);
587
+ if (pvs) {
588
+ const v = decl.value.trim().toLowerCase();
589
+ for (const pv of pvs) if (v === pv.value) onHit(pv.feature, {
590
+ line,
591
+ selector: sel
592
+ });
593
+ }
594
+ if (idx.cssFunction.size || idx.cssUnit.size || idx.cssVariables || idx.cssModernColor) try {
595
+ valueParser(decl.value).walk((n) => {
596
+ if (n.type === "function") {
597
+ const fname = n.value.toLowerCase();
598
+ const fs2 = idx.cssFunction.get(fname);
599
+ if (fs2) for (const f of fs2) onHit(f, {
600
+ line,
601
+ selector: sel
602
+ });
603
+ if (idx.cssVariables && fname === "var") onHit(idx.cssVariables, {
604
+ line,
605
+ selector: sel
606
+ });
607
+ if (idx.cssModernColor && MODERN_COLOR_FNS.has(fname)) onHit(idx.cssModernColor, {
608
+ line,
609
+ selector: sel
610
+ });
611
+ } else if (n.type === "word") {
612
+ const m = /^-?\d*\.?\d+([a-z%]+)$/i.exec(n.value);
613
+ if (m) {
614
+ const unit = m[1].toLowerCase();
615
+ const fs2 = idx.cssUnit.get(unit);
616
+ if (fs2) for (const f of fs2) onHit(f, {
617
+ line,
618
+ selector: sel
619
+ });
620
+ }
621
+ }
622
+ });
623
+ } catch {}
624
+ });
625
+ }
626
+ const MODERN_COLOR_FNS = new Set([
627
+ "oklch",
628
+ "oklab",
629
+ "lch",
630
+ "lab",
631
+ "color",
632
+ "color-mix",
633
+ "hwb"
634
+ ]);
635
+ function escapeRe(s) {
636
+ return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
637
+ }
638
+ function offsetToLine(source, offset) {
639
+ let line = 1;
640
+ for (let i = 0; i < offset && i < source.length; i++) if (source.charCodeAt(i) === 10) line++;
641
+ return line;
642
+ }
643
+ function walkTemplate(html, idx, fileLineOffset, source, templateStartOffset, onHit) {
644
+ const semanticTags = new Set([
645
+ "article",
646
+ "aside",
647
+ "details",
648
+ "figcaption",
649
+ "figure",
650
+ "footer",
651
+ "header",
652
+ "main",
653
+ "mark",
654
+ "nav",
655
+ "section",
656
+ "time",
657
+ "summary"
658
+ ]);
659
+ /**
660
+ * Stack of tags that opened a body-scope: a literal <body> or a
661
+ * <Teleport to="body..."> whose rendered contents land inside body.
662
+ */
663
+ const bodyScopeStack = [];
664
+ const parser = new Parser({
665
+ onopentag(tag, attrs) {
666
+ const startIdx = parser.startIndex;
667
+ const line = offsetToLine(source, templateStartOffset + startIdx);
668
+ const tagFs = idx.htmlTag.get(tag);
669
+ if (tagFs) for (const f of tagFs) onHit(f, line);
670
+ if (idx.htmlSemantics && semanticTags.has(tag)) onHit(idx.htmlSemantics, line);
671
+ if (tag === "style" && bodyScopeStack.length > 0 && idx.htmlStyleInBody) onHit(idx.htmlStyleInBody, line);
672
+ if (tag === "body") bodyScopeStack.push(tag);
673
+ else if (tag === "teleport" && /body/i.test(attrs.to ?? "")) bodyScopeStack.push(tag);
674
+ for (const attr in attrs) {
675
+ const attrFs = idx.htmlAttr.get(attr);
676
+ if (attrFs) for (const f of attrFs) onHit(f, line);
677
+ }
678
+ if (tag === "input" && attrs.type) {
679
+ const fs = idx.htmlInputType.get(attrs.type.toLowerCase());
680
+ if (fs) for (const f of fs) onHit(f, line);
681
+ }
682
+ if (tag === "button" && attrs.type) {
683
+ const fs = idx.htmlButtonType.get(attrs.type.toLowerCase());
684
+ if (fs) for (const f of fs) onHit(f, line);
685
+ }
686
+ if (tag === "a" && attrs.href) {
687
+ const h = attrs.href.trim();
688
+ if (idx.htmlMailtoLinks && /^mailto:/i.test(h)) onHit(idx.htmlMailtoLinks, line);
689
+ else if (idx.htmlAnchorLinks && h.startsWith("#")) onHit(idx.htmlAnchorLinks, line);
690
+ }
691
+ if (tag === "meta" && idx.htmlMetaColorScheme && attrs.name?.toLowerCase() === "color-scheme") onHit(idx.htmlMetaColorScheme, line);
692
+ if (idx.imageExt.size && (attrs.src || attrs.srcset)) {
693
+ const urls = [];
694
+ if (attrs.src) urls.push(attrs.src);
695
+ if (attrs.srcset) for (const part of attrs.srcset.split(",")) urls.push(part.trim().split(/\s+/)[0]);
696
+ for (const url of urls) {
697
+ const m = /\.([a-z0-9]+)(?:\?|#|$)/i.exec(url);
698
+ if (!m) continue;
699
+ const fs = idx.imageExt.get(m[1].toLowerCase());
700
+ if (fs) for (const f of fs) onHit(f, line);
701
+ }
702
+ }
703
+ if (attrs.style) scanInlineStyle(attrs.style, idx, line, onHit);
704
+ },
705
+ onclosetag(tag) {
706
+ if (bodyScopeStack[bodyScopeStack.length - 1] === tag) bodyScopeStack.pop();
707
+ },
708
+ onprocessinginstruction(name) {
709
+ if (idx.htmlDoctype && name.toLowerCase() === "!doctype") {
710
+ const startIdx = parser.startIndex;
711
+ onHit(idx.htmlDoctype, offsetToLine(source, templateStartOffset + startIdx));
712
+ }
713
+ },
714
+ oncomment() {
715
+ if (idx.htmlComments) {
716
+ const startIdx = parser.startIndex;
717
+ onHit(idx.htmlComments, offsetToLine(source, templateStartOffset + startIdx));
718
+ }
719
+ }
720
+ }, {
721
+ decodeEntities: false,
722
+ lowerCaseTags: true,
723
+ lowerCaseAttributeNames: true
724
+ });
725
+ parser.write(html);
726
+ parser.end();
727
+ }
728
+ function scanInlineStyle(style, idx, line, onHit) {
729
+ const wrapped = `*{${style}}`;
730
+ try {
731
+ safeParser(wrapped).walkDecls((decl) => {
732
+ if (idx.cssImportant && decl.important) onHit(idx.cssImportant, line);
733
+ const fs = idx.cssProp.get(decl.prop);
734
+ if (fs) for (const f of fs) onHit(f, line);
735
+ if (idx.cssVariables && decl.prop.startsWith("--")) onHit(idx.cssVariables, line);
736
+ const pvs = idx.cssPropValue.get(decl.prop);
737
+ if (pvs) {
738
+ const v = decl.value.trim().toLowerCase();
739
+ for (const pv of pvs) if (v === pv.value) onHit(pv.feature, line);
740
+ }
741
+ if (idx.cssFunction.size || idx.cssUnit.size || idx.cssVariables || idx.cssModernColor) try {
742
+ valueParser(decl.value).walk((n) => {
743
+ if (n.type === "function") {
744
+ const fname = n.value.toLowerCase();
745
+ const fs2 = idx.cssFunction.get(fname);
746
+ if (fs2) for (const f of fs2) onHit(f, line);
747
+ if (idx.cssVariables && fname === "var") onHit(idx.cssVariables, line);
748
+ if (idx.cssModernColor && MODERN_COLOR_FNS.has(fname)) onHit(idx.cssModernColor, line);
749
+ } else if (n.type === "word") {
750
+ const m = /^-?\d*\.?\d+([a-z%]+)$/i.exec(n.value);
751
+ if (m) {
752
+ const fs2 = idx.cssUnit.get(m[1].toLowerCase());
753
+ if (fs2) for (const f of fs2) onHit(f, line);
754
+ }
755
+ }
756
+ });
757
+ } catch {}
758
+ });
759
+ } catch {}
760
+ }
761
+ function labelFor(idx, level) {
762
+ const n = idx.nicenames;
763
+ if (level === "unsupported") return n.unsupported ?? "Not supported";
764
+ if (level === "mitigated") return n.mitigated ?? "Partially supported";
765
+ return n.unknown ?? "Support unknown";
766
+ }
767
+ async function scan(rootFile, config, componentDirs, allowedClients) {
768
+ const idx = await initCompatibility();
769
+ if (!idx) return [];
770
+ const componentMap = await buildComponentMap(config.root ?? process.cwd(), componentDirs);
771
+ const streams = [];
772
+ collectStreams(rootFile, componentMap, /* @__PURE__ */ new Set(), streams);
773
+ const issues = [];
774
+ const seen = /* @__PURE__ */ new Set();
775
+ const resolvedCache = /* @__PURE__ */ new Map();
776
+ const resolveSupport = (f) => {
777
+ let cached = resolvedCache.get(f.slug);
778
+ if (cached === void 0) {
779
+ cached = computeSupport(f.stats, idx.familyNicenames, allowedClients);
780
+ resolvedCache.set(f.slug, cached);
781
+ }
782
+ return cached;
783
+ };
784
+ const add = (f, file, line) => {
785
+ const key = `${f.slug}|${file}|${line ?? 0}`;
786
+ if (seen.has(key)) return;
787
+ const support = resolveSupport(f);
788
+ if (!support) return;
789
+ seen.add(key);
790
+ issues.push({
791
+ kind: "compat",
792
+ slug: f.slug,
793
+ title: f.title,
794
+ url: f.url,
795
+ category: f.category,
796
+ supportLevel: support.level,
797
+ supportLabel: labelFor(idx, support.level),
798
+ affectedClients: support.affected,
799
+ line,
800
+ file
801
+ });
802
+ };
803
+ /**
804
+ * Stream A: compiled CSS from real pipeline — reflects shipped output
805
+ * (Tailwind utilities resolved, @maizzle/tailwindcss imported, calc
806
+ * resolved, modern CSS lowered). Filter hits whose containing
807
+ * selector doesn't reference a user class — drops Tailwind
808
+ * preflight noise. For hits without a class selector
809
+ * (e.g. @media, user-written rules), attribute to the
810
+ * file that owned the style block.
811
+ */
812
+ const compiledBlocks = await compileViaPipeline(streams, config, rootFile);
813
+ for (const block of compiledBlocks) walkCss(block.css, idx, (feature, node) => {
814
+ const locations = classLocations(node.selector, streams);
815
+ if (!locations.length) {
816
+ add(feature, block.file, block.line);
817
+ return;
818
+ }
819
+ /**
820
+ * @media features collapse to a single source line: the first use
821
+ * of whatever class/variant triggered the wrapper. Other
822
+ * features show up for every occurrence.
823
+ */
824
+ if (feature.slug.startsWith("css-at-media")) add(feature, locations[0].file, locations[0].line);
825
+ else for (const { file, line } of locations) add(feature, file, line);
826
+ });
827
+ for (const s of streams) {
828
+ if (!s.template) continue;
829
+ walkTemplate(s.template.content, idx, s.template.offset, s.source, s.source.indexOf(s.template.content), (feature, line) => add(feature, s.path, line));
830
+ }
831
+ return issues;
832
+ }
833
+ /**
834
+ * Return every (file, line) where any class from the selector appears in a
835
+ * template. Scans every stream so a shared utility class used in multiple
836
+ * components surfaces once per occurrence.
837
+ */
838
+ function classLocations(selector, streams) {
839
+ if (!selector) return [];
840
+ const classNames = extractSelectorClasses(selector);
841
+ if (!classNames.length) return [];
842
+ const out = [];
843
+ const seen = /* @__PURE__ */ new Set();
844
+ for (const cn of classNames) for (const s of streams) {
845
+ if (!s.classes.has(cn) || !s.template) continue;
846
+ const tpl = s.template.content;
847
+ const tplStart = s.source.indexOf(tpl);
848
+ let pos = 0;
849
+ while (true) {
850
+ const i = tpl.indexOf(cn, pos);
851
+ if (i < 0) break;
852
+ pos = i + cn.length;
853
+ const before = i > 0 ? tpl[i - 1] : " ";
854
+ const after = i + cn.length < tpl.length ? tpl[i + cn.length] : " ";
855
+ if (!isClassBoundary(before) || !isClassBoundary(after)) continue;
856
+ const line = offsetToLine(s.source, tplStart + i);
857
+ const key = `${s.path}|${line}`;
858
+ if (seen.has(key)) continue;
859
+ seen.add(key);
860
+ out.push({
861
+ file: s.path,
862
+ line
863
+ });
864
+ }
865
+ }
866
+ return out;
867
+ }
868
+ function isClassBoundary(c) {
869
+ return c === " " || c === " " || c === "\n" || c === "\r" || c === "\"" || c === "'";
870
+ }
871
+ function extractSelectorClasses(selector) {
872
+ const out = [];
873
+ const re = /\.((?:\\.|[\w-])+)/g;
874
+ let m;
875
+ while ((m = re.exec(selector)) !== null) out.push(m[1].replace(/\\(.)/g, "$1"));
876
+ return out;
877
+ }
878
+ const CATEGORY_ORDER = [
879
+ "css",
880
+ "html",
881
+ "image",
882
+ "others"
883
+ ];
884
+ const LEVEL_ORDER = {
885
+ error: 0,
886
+ unsupported: 1,
887
+ warning: 2,
888
+ mitigated: 3,
889
+ unknown: 4
890
+ };
891
+ function orderKey(i) {
892
+ if (i.kind === "lint") return LEVEL_ORDER[i.severity] ?? 99;
893
+ return LEVEL_ORDER[i.supportLevel] ?? 99;
894
+ }
895
+ function resolveChecksConfig(config) {
896
+ const raw = config.server?.checks;
897
+ if (raw === false) return null;
898
+ return {
899
+ clients: raw?.clients === "all" ? "all" : Array.isArray(raw?.clients) && raw.clients.length ? new Set(raw.clients) : DEFAULT_CLIENTS,
900
+ level: raw?.level ?? null
901
+ };
902
+ }
903
+ function passesLevelFilter(issue, level) {
904
+ if (!level) return true;
905
+ if (level === "lint") return issue.kind === "lint";
906
+ if (issue.kind === "lint") return level === "error" ? issue.severity === "error" : issue.severity === "warning";
907
+ return level === "error" ? issue.supportLevel === "unsupported" : issue.supportLevel === "mitigated" || issue.supportLevel === "unknown";
908
+ }
909
+ async function serveCompatibility(url, res, config, componentDirs) {
910
+ const filePath = url.replace("/__maizzle/compatibility/", "").replace(/\?.*$/, "");
911
+ const checksCfg = resolveChecksConfig(config);
912
+ try {
913
+ res.setHeader("Content-Type", "application/json");
914
+ if (!checksCfg) {
915
+ /**
916
+ * Defensive: UI hides the tab using window.__MAIZZLE_CONFIG__ so
917
+ * it shouldn't reach this endpoint when disabled, but if
918
+ * something else does, return an empty list.
919
+ */
920
+ res.end(JSON.stringify([]));
921
+ return;
922
+ }
923
+ const absolutePath = resolve(filePath);
924
+ const [compatIssues, lintIssues] = await Promise.all([scan(absolutePath, config, componentDirs, checksCfg.clients), scanLint(absolutePath, config, componentDirs)]);
925
+ const idx = await initCompatibility();
926
+ const lintAsIssues = lintIssues.map((li) => {
927
+ const info = li.slug ? idx?.bySlug.get(li.slug) : void 0;
928
+ return {
929
+ kind: "lint",
930
+ slug: li.slug,
931
+ title: li.title,
932
+ url: info?.url,
933
+ category: li.category,
934
+ severity: li.type,
935
+ message: li.message,
936
+ line: li.line,
937
+ file: li.file
938
+ };
939
+ });
940
+ let issues = [...compatIssues, ...lintAsIssues];
941
+ issues = issues.filter((i) => !isFrameworkComponent(i.file));
942
+ if (checksCfg.level) issues = issues.filter((i) => passesLevelFilter(i, checksCfg.level));
943
+ issues.sort((a, b) => {
944
+ const c = CATEGORY_ORDER.indexOf(a.category) - CATEGORY_ORDER.indexOf(b.category);
945
+ if (c) return c;
946
+ const l = orderKey(a) - orderKey(b);
947
+ if (l) return l;
948
+ return (a.slug ?? a.title).localeCompare(b.slug ?? b.title);
949
+ });
950
+ res.end(JSON.stringify(issues));
951
+ } catch (error) {
952
+ res.statusCode = 500;
953
+ res.end(JSON.stringify({ error: error.message }));
954
+ }
955
+ }
956
+ //#endregion
957
+ export { initCompatibility, serveCompatibility };
958
+
959
+ //# sourceMappingURL=compatibility.js.map