@maizzle/framework 6.0.0-rc.2 → 6.0.0-rc.20

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 (542) hide show
  1. package/README.md +3 -3
  2. package/bin/maizzle.mjs +1 -1
  3. package/dist/build.d.ts +20 -0
  4. package/dist/build.d.ts.map +1 -0
  5. package/dist/{build.mjs → build.js} +33 -19
  6. package/dist/build.js.map +1 -0
  7. package/dist/components/Body.vue +128 -0
  8. package/dist/components/Button.vue +148 -52
  9. package/dist/components/CodeBlock.vue +69 -0
  10. package/dist/components/CodeInline.vue +49 -0
  11. package/dist/components/Column.vue +108 -0
  12. package/dist/components/Container.vue +123 -0
  13. package/dist/components/Font.vue +96 -0
  14. package/dist/components/Head.vue +30 -0
  15. package/dist/components/Heading.vue +28 -0
  16. package/dist/components/Hr.vue +33 -0
  17. package/dist/components/Html.vue +137 -0
  18. package/dist/components/Img.vue +70 -0
  19. package/dist/components/Layout.vue +143 -0
  20. package/dist/components/Link.vue +26 -0
  21. package/dist/components/Markdown.vue +89 -0
  22. package/dist/components/MarkdownLayout.vue +39 -0
  23. package/dist/components/NotPlaintext.vue +14 -0
  24. package/dist/components/Outlook.vue +74 -11
  25. package/dist/components/OutlookBg.vue +241 -0
  26. package/dist/components/Overlap.vue +156 -0
  27. package/dist/components/Plaintext.vue +14 -0
  28. package/dist/components/Preheader.vue +15 -0
  29. package/dist/components/QrCode.vue +157 -0
  30. package/dist/components/Raw.vue +28 -0
  31. package/dist/components/Row.vue +184 -0
  32. package/dist/components/Section.vue +124 -0
  33. package/dist/components/Spacer.vue +70 -21
  34. package/dist/components/Tailwind.vue +43 -0
  35. package/dist/components/Text.vue +29 -0
  36. package/dist/components/utils.d.ts +28 -0
  37. package/dist/components/utils.d.ts.map +1 -0
  38. package/dist/components/utils.js +50 -0
  39. package/dist/components/utils.js.map +1 -0
  40. package/dist/components/utils.ts +51 -0
  41. package/dist/composables/{defineConfig.d.mts → defineConfig.d.ts} +2 -2
  42. package/dist/composables/defineConfig.d.ts.map +1 -0
  43. package/dist/composables/{defineConfig.mjs → defineConfig.js} +4 -5
  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.mjs → renderContext.js} +2 -2
  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.mts → useConfig.d.ts} +2 -2
  54. package/dist/composables/useConfig.d.ts.map +1 -0
  55. package/dist/composables/{useConfig.mjs → useConfig.js} +2 -3
  56. package/dist/composables/useConfig.js.map +1 -0
  57. package/dist/composables/{useDoctype.d.mts → useDoctype.d.ts} +1 -1
  58. package/dist/composables/useDoctype.d.ts.map +1 -0
  59. package/dist/composables/{useDoctype.mjs → useDoctype.js} +3 -4
  60. package/dist/composables/useDoctype.js.map +1 -0
  61. package/dist/composables/{useEvent.d.mts → useEvent.d.ts} +2 -2
  62. package/dist/composables/useEvent.d.ts.map +1 -0
  63. package/dist/composables/{useEvent.mjs → useEvent.js} +3 -4
  64. package/dist/composables/useEvent.js.map +1 -0
  65. package/dist/composables/useFont.d.ts +50 -0
  66. package/dist/composables/useFont.d.ts.map +1 -0
  67. package/dist/composables/useFont.js +92 -0
  68. package/dist/composables/useFont.js.map +1 -0
  69. package/dist/composables/useOutlookFallback.d.ts +21 -0
  70. package/dist/composables/useOutlookFallback.d.ts.map +1 -0
  71. package/dist/composables/useOutlookFallback.js +29 -0
  72. package/dist/composables/useOutlookFallback.js.map +1 -0
  73. package/dist/composables/{usePlaintext.d.mts → usePlaintext.d.ts} +3 -1
  74. package/dist/composables/usePlaintext.d.ts.map +1 -0
  75. package/dist/composables/{usePlaintext.mjs → usePlaintext.js} +4 -4
  76. package/dist/composables/usePlaintext.js.map +1 -0
  77. package/dist/composables/usePreheader.d.ts +24 -0
  78. package/dist/composables/usePreheader.d.ts.map +1 -0
  79. package/dist/composables/usePreheader.js +28 -0
  80. package/dist/composables/usePreheader.js.map +1 -0
  81. package/dist/composables/useTransformers.d.ts +34 -0
  82. package/dist/composables/useTransformers.d.ts.map +1 -0
  83. package/dist/composables/useTransformers.js +48 -0
  84. package/dist/composables/useTransformers.js.map +1 -0
  85. package/dist/composables/useUrlQuery.d.ts +19 -0
  86. package/dist/composables/useUrlQuery.d.ts.map +1 -0
  87. package/dist/composables/useUrlQuery.js +26 -0
  88. package/dist/composables/useUrlQuery.js.map +1 -0
  89. package/dist/config/{defaults.d.mts → defaults.d.ts} +2 -2
  90. package/dist/config/defaults.d.ts.map +1 -0
  91. package/dist/config/{defaults.mjs → defaults.js} +10 -6
  92. package/dist/config/defaults.js.map +1 -0
  93. package/dist/config/{index.d.mts → index.d.ts} +4 -4
  94. package/dist/config/index.d.ts.map +1 -0
  95. package/dist/config/{index.mjs → index.js} +12 -10
  96. package/dist/config/index.js.map +1 -0
  97. package/dist/events/{index.d.mts → index.d.ts} +10 -4
  98. package/dist/events/index.d.ts.map +1 -0
  99. package/dist/events/{index.mjs → index.js} +21 -5
  100. package/dist/events/index.js.map +1 -0
  101. package/dist/index.d.ts +38 -0
  102. package/dist/index.js +37 -0
  103. package/dist/{plaintext.d.mts → plaintext.d.ts} +1 -1
  104. package/dist/plaintext.d.ts.map +1 -0
  105. package/dist/{plaintext.mjs → plaintext.js} +4 -5
  106. package/dist/plaintext.js.map +1 -0
  107. package/dist/{plugin.d.mts → plugin.d.ts} +2 -2
  108. package/dist/plugin.d.ts.map +1 -0
  109. package/dist/plugin.js +57 -0
  110. package/dist/plugin.js.map +1 -0
  111. package/dist/plugins/postcss/{mergeMediaQueries.d.mts → mergeMediaQueries.d.ts} +2 -2
  112. package/dist/plugins/postcss/mergeMediaQueries.d.ts.map +1 -0
  113. package/dist/plugins/postcss/{mergeMediaQueries.mjs → mergeMediaQueries.js} +2 -3
  114. package/dist/plugins/postcss/mergeMediaQueries.js.map +1 -0
  115. package/dist/plugins/postcss/{pruneVars.d.mts → pruneVars.d.ts} +1 -1
  116. package/dist/plugins/postcss/pruneVars.d.ts.map +1 -0
  117. package/dist/plugins/postcss/{pruneVars.mjs → pruneVars.js} +2 -2
  118. package/dist/plugins/postcss/pruneVars.js.map +1 -0
  119. package/dist/plugins/postcss/quoteFontFamilies.d.ts +13 -0
  120. package/dist/plugins/postcss/quoteFontFamilies.d.ts.map +1 -0
  121. package/dist/plugins/postcss/quoteFontFamilies.js +84 -0
  122. package/dist/plugins/postcss/quoteFontFamilies.js.map +1 -0
  123. package/dist/plugins/postcss/{removeDeclarations.d.mts → removeDeclarations.d.ts} +1 -1
  124. package/dist/plugins/postcss/removeDeclarations.d.ts.map +1 -0
  125. package/dist/plugins/postcss/{removeDeclarations.mjs → removeDeclarations.js} +2 -2
  126. package/dist/plugins/postcss/removeDeclarations.js.map +1 -0
  127. package/dist/plugins/postcss/resolveMaizzleImports.d.ts +16 -0
  128. package/dist/plugins/postcss/resolveMaizzleImports.d.ts.map +1 -0
  129. package/dist/plugins/postcss/resolveMaizzleImports.js +39 -0
  130. package/dist/plugins/postcss/resolveMaizzleImports.js.map +1 -0
  131. package/dist/plugins/postcss/resolveProps.d.ts +8 -0
  132. package/dist/plugins/postcss/resolveProps.d.ts.map +1 -0
  133. package/dist/plugins/postcss/resolveProps.js +144 -0
  134. package/dist/plugins/postcss/resolveProps.js.map +1 -0
  135. package/dist/plugins/postcss/{tailwindCleanup.d.mts → tailwindCleanup.d.ts} +2 -2
  136. package/dist/plugins/postcss/tailwindCleanup.d.ts.map +1 -0
  137. package/dist/plugins/postcss/tailwindCleanup.js +68 -0
  138. package/dist/plugins/postcss/tailwindCleanup.js.map +1 -0
  139. package/dist/prepare.d.ts +17 -0
  140. package/dist/prepare.d.ts.map +1 -0
  141. package/dist/prepare.js +44 -0
  142. package/dist/prepare.js.map +1 -0
  143. package/dist/render/active.d.ts +8 -0
  144. package/dist/render/active.d.ts.map +1 -0
  145. package/dist/render/active.js +12 -0
  146. package/dist/render/active.js.map +1 -0
  147. package/dist/render/{createRenderer.d.mts → createRenderer.d.ts} +15 -7
  148. package/dist/render/createRenderer.d.ts.map +1 -0
  149. package/dist/render/createRenderer.js +319 -0
  150. package/dist/render/createRenderer.js.map +1 -0
  151. package/dist/render/index.d.ts +18 -0
  152. package/dist/render/index.d.ts.map +1 -0
  153. package/dist/render/index.js +53 -0
  154. package/dist/render/index.js.map +1 -0
  155. package/dist/render/injectFonts.d.ts +15 -0
  156. package/dist/render/injectFonts.d.ts.map +1 -0
  157. package/dist/render/injectFonts.js +45 -0
  158. package/dist/render/injectFonts.js.map +1 -0
  159. package/dist/render/plugins/codeBlockExtract.d.ts +14 -0
  160. package/dist/render/plugins/codeBlockExtract.d.ts.map +1 -0
  161. package/dist/render/plugins/codeBlockExtract.js +34 -0
  162. package/dist/render/plugins/codeBlockExtract.js.map +1 -0
  163. package/dist/render/plugins/markdownExtract.d.ts +12 -0
  164. package/dist/render/plugins/markdownExtract.d.ts.map +1 -0
  165. package/dist/render/plugins/markdownExtract.js +49 -0
  166. package/dist/render/plugins/markdownExtract.js.map +1 -0
  167. package/dist/render/plugins/rawExtract.d.ts +14 -0
  168. package/dist/render/plugins/rawExtract.d.ts.map +1 -0
  169. package/dist/render/plugins/rawExtract.js +34 -0
  170. package/dist/render/plugins/rawExtract.js.map +1 -0
  171. package/dist/render/plugins/rowSourceLocation.d.ts +18 -0
  172. package/dist/render/plugins/rowSourceLocation.d.ts.map +1 -0
  173. package/dist/render/plugins/rowSourceLocation.js +45 -0
  174. package/dist/render/plugins/rowSourceLocation.js.map +1 -0
  175. package/dist/{serve.d.mts → serve.d.ts} +4 -2
  176. package/dist/serve.d.ts.map +1 -0
  177. package/dist/{serve.mjs → serve.js} +203 -79
  178. package/dist/serve.js.map +1 -0
  179. package/dist/server/compatibility.d.ts +59 -0
  180. package/dist/server/compatibility.d.ts.map +1 -0
  181. package/dist/server/compatibility.js +911 -0
  182. package/dist/server/compatibility.js.map +1 -0
  183. package/dist/server/email.d.ts +17 -0
  184. package/dist/server/email.d.ts.map +1 -0
  185. package/dist/server/email.js +40 -0
  186. package/dist/server/email.js.map +1 -0
  187. package/dist/server/linter.d.ts +20 -0
  188. package/dist/server/linter.d.ts.map +1 -0
  189. package/dist/server/linter.js +339 -0
  190. package/dist/server/linter.js.map +1 -0
  191. package/dist/server/sfc-utils.d.ts +21 -0
  192. package/dist/server/sfc-utils.d.ts.map +1 -0
  193. package/dist/server/sfc-utils.js +198 -0
  194. package/dist/server/sfc-utils.js.map +1 -0
  195. package/dist/server/ui/App.vue +253 -77
  196. package/dist/server/ui/components/SidebarClose.vue +12 -0
  197. package/dist/server/ui/components/ui/checkbox/Checkbox.vue +35 -0
  198. package/dist/server/ui/components/ui/checkbox/index.ts +1 -0
  199. package/dist/server/ui/components/ui/command/Command.vue +5 -1
  200. package/dist/server/ui/components/ui/command/CommandDialog.vue +1 -1
  201. package/dist/server/ui/components/ui/command/CommandInput.vue +19 -1
  202. package/dist/server/ui/components/ui/command/CommandItem.vue +1 -1
  203. package/dist/server/ui/components/ui/command/CommandList.vue +1 -1
  204. package/dist/server/ui/components/ui/command/CommandShortcut.vue +1 -1
  205. package/dist/server/ui/components/ui/dialog/DialogOverlay.vue +9 -1
  206. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuItem.vue +1 -1
  207. package/dist/server/ui/components/ui/input/Input.vue +1 -1
  208. package/dist/server/ui/components/ui/scroll-area/ScrollBar.vue +1 -1
  209. package/dist/server/ui/components/ui/sheet/SheetContent.vue +1 -1
  210. package/dist/server/ui/components/ui/sheet/SheetOverlay.vue +9 -1
  211. package/dist/server/ui/components/ui/sidebar/Sidebar.vue +8 -1
  212. package/dist/server/ui/components/ui/sidebar/SidebarProvider.vue +1 -1
  213. package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +5 -4
  214. package/dist/server/ui/components/ui/tags-input/TagsInput.vue +26 -0
  215. package/dist/server/ui/components/ui/tags-input/TagsInputInput.vue +17 -0
  216. package/dist/server/ui/components/ui/tags-input/TagsInputItem.vue +19 -0
  217. package/dist/server/ui/components/ui/tags-input/TagsInputItemDelete.vue +22 -0
  218. package/dist/server/ui/components/ui/tags-input/TagsInputItemText.vue +17 -0
  219. package/dist/server/ui/components/ui/tags-input/index.ts +5 -0
  220. package/dist/server/ui/components/ui/toggle/index.ts +3 -3
  221. package/dist/server/ui/components/ui/toggle-group/ToggleGroup.vue +1 -1
  222. package/dist/server/ui/components/ui/toggle-group/ToggleGroupItem.vue +2 -2
  223. package/dist/server/ui/lib/emulated-dark-mode.ts +131 -0
  224. package/dist/server/ui/main.css +20 -20
  225. package/dist/server/ui/pages/Home.vue +12 -5
  226. package/dist/server/ui/pages/Preview.vue +716 -276
  227. package/dist/tests/render/_helpers.d.ts +6 -0
  228. package/dist/tests/render/_helpers.d.ts.map +1 -0
  229. package/dist/tests/render/_helpers.js +16 -0
  230. package/dist/tests/render/_helpers.js.map +1 -0
  231. package/dist/transformers/{addAttributes.d.mts → addAttributes.d.ts} +2 -2
  232. package/dist/transformers/addAttributes.d.ts.map +1 -0
  233. package/dist/transformers/{addAttributes.mjs → addAttributes.js} +16 -13
  234. package/dist/transformers/addAttributes.js.map +1 -0
  235. package/dist/transformers/attributeToStyle.d.ts +38 -0
  236. package/dist/transformers/attributeToStyle.d.ts.map +1 -0
  237. package/dist/transformers/attributeToStyle.js +94 -0
  238. package/dist/transformers/attributeToStyle.js.map +1 -0
  239. package/dist/transformers/base.d.ts +71 -0
  240. package/dist/transformers/base.d.ts.map +1 -0
  241. package/dist/transformers/{base.mjs → base.js} +56 -30
  242. package/dist/transformers/base.js.map +1 -0
  243. package/dist/transformers/columnWidth.d.ts +31 -0
  244. package/dist/transformers/columnWidth.d.ts.map +1 -0
  245. package/dist/transformers/columnWidth.js +546 -0
  246. package/dist/transformers/columnWidth.js.map +1 -0
  247. package/dist/transformers/entities.d.ts +37 -0
  248. package/dist/transformers/entities.d.ts.map +1 -0
  249. package/dist/transformers/entities.js +73 -0
  250. package/dist/transformers/entities.js.map +1 -0
  251. package/dist/transformers/filters/defaults.d.ts +6 -0
  252. package/dist/transformers/filters/defaults.d.ts.map +1 -0
  253. package/dist/transformers/filters/defaults.js +78 -0
  254. package/dist/transformers/filters/defaults.js.map +1 -0
  255. package/dist/transformers/filters/index.d.ts +43 -0
  256. package/dist/transformers/filters/index.d.ts.map +1 -0
  257. package/dist/transformers/filters/index.js +89 -0
  258. package/dist/transformers/filters/index.js.map +1 -0
  259. package/dist/transformers/format.d.ts +22 -0
  260. package/dist/transformers/format.d.ts.map +1 -0
  261. package/dist/transformers/format.js +30 -0
  262. package/dist/transformers/format.js.map +1 -0
  263. package/dist/transformers/{index.d.mts → index.d.ts} +14 -11
  264. package/dist/transformers/index.d.ts.map +1 -0
  265. package/dist/transformers/index.js +133 -0
  266. package/dist/transformers/index.js.map +1 -0
  267. package/dist/transformers/inlineCss.d.ts +84 -0
  268. package/dist/transformers/inlineCss.d.ts.map +1 -0
  269. package/dist/transformers/inlineCss.js +91 -0
  270. package/dist/transformers/inlineCss.js.map +1 -0
  271. package/dist/transformers/inlineLink.d.ts +35 -0
  272. package/dist/transformers/inlineLink.d.ts.map +1 -0
  273. package/dist/transformers/{inlineLink.mjs → inlineLink.js} +34 -10
  274. package/dist/transformers/inlineLink.js.map +1 -0
  275. package/dist/transformers/minify.d.ts +21 -0
  276. package/dist/transformers/minify.d.ts.map +1 -0
  277. package/dist/transformers/minify.js +25 -0
  278. package/dist/transformers/minify.js.map +1 -0
  279. package/dist/transformers/msoPlaceholders.d.ts +28 -0
  280. package/dist/transformers/msoPlaceholders.d.ts.map +1 -0
  281. package/dist/transformers/msoPlaceholders.js +88 -0
  282. package/dist/transformers/msoPlaceholders.js.map +1 -0
  283. package/dist/transformers/purgeCss.d.ts +43 -0
  284. package/dist/transformers/purgeCss.d.ts.map +1 -0
  285. package/dist/transformers/purgeCss.js +181 -0
  286. package/dist/transformers/purgeCss.js.map +1 -0
  287. package/dist/transformers/removeAttributes.d.ts +54 -0
  288. package/dist/transformers/removeAttributes.d.ts.map +1 -0
  289. package/dist/transformers/removeAttributes.js +70 -0
  290. package/dist/transformers/removeAttributes.js.map +1 -0
  291. package/dist/transformers/{replaceStrings.d.mts → replaceStrings.d.ts} +2 -2
  292. package/dist/transformers/replaceStrings.d.ts.map +1 -0
  293. package/dist/transformers/{replaceStrings.mjs → replaceStrings.js} +2 -2
  294. package/dist/transformers/replaceStrings.js.map +1 -0
  295. package/dist/transformers/{safeClassNames.d.mts → safeClassNames.d.ts} +2 -2
  296. package/dist/transformers/safeClassNames.d.ts.map +1 -0
  297. package/dist/transformers/{safeClassNames.mjs → safeClassNames.js} +4 -5
  298. package/dist/transformers/safeClassNames.js.map +1 -0
  299. package/dist/transformers/shorthandCss.d.ts +47 -0
  300. package/dist/transformers/shorthandCss.d.ts.map +1 -0
  301. package/dist/transformers/shorthandCss.js +61 -0
  302. package/dist/transformers/shorthandCss.js.map +1 -0
  303. package/dist/transformers/sixHex.d.ts +25 -0
  304. package/dist/transformers/sixHex.d.ts.map +1 -0
  305. package/dist/transformers/sixHex.js +42 -0
  306. package/dist/transformers/sixHex.js.map +1 -0
  307. package/dist/transformers/tailwindComponent.d.ts +16 -0
  308. package/dist/transformers/tailwindComponent.d.ts.map +1 -0
  309. package/dist/transformers/tailwindComponent.js +92 -0
  310. package/dist/transformers/tailwindComponent.js.map +1 -0
  311. package/dist/transformers/{tailwindcss.d.mts → tailwindcss.d.ts} +8 -4
  312. package/dist/transformers/tailwindcss.d.ts.map +1 -0
  313. package/dist/transformers/tailwindcss.js +97 -0
  314. package/dist/transformers/tailwindcss.js.map +1 -0
  315. package/dist/transformers/urlQuery.d.ts +36 -0
  316. package/dist/transformers/urlQuery.d.ts.map +1 -0
  317. package/dist/transformers/urlQuery.js +77 -0
  318. package/dist/transformers/urlQuery.js.map +1 -0
  319. package/dist/types/config.d.ts +727 -0
  320. package/dist/types/config.d.ts.map +1 -0
  321. package/dist/types/config.js +1 -0
  322. package/dist/types/index.d.ts +2 -0
  323. package/dist/types/index.js +1 -0
  324. package/dist/utils/ast/index.d.ts +4 -0
  325. package/dist/utils/ast/index.js +4 -0
  326. package/dist/utils/ast/{parser.d.mts → parser.d.ts} +1 -1
  327. package/dist/utils/ast/parser.d.ts.map +1 -0
  328. package/dist/utils/ast/{parser.mjs → parser.js} +2 -3
  329. package/dist/utils/ast/parser.js.map +1 -0
  330. package/dist/utils/ast/serializer.d.ts +8 -0
  331. package/dist/utils/ast/serializer.d.ts.map +1 -0
  332. package/dist/utils/ast/serializer.js +36 -0
  333. package/dist/utils/ast/serializer.js.map +1 -0
  334. package/dist/utils/ast/{walker.d.mts → walker.d.ts} +1 -1
  335. package/dist/utils/ast/walker.d.ts.map +1 -0
  336. package/dist/utils/ast/{walker.mjs → walker.js} +2 -2
  337. package/dist/utils/ast/walker.js.map +1 -0
  338. package/dist/utils/compileTailwindCss.d.ts +16 -0
  339. package/dist/utils/compileTailwindCss.d.ts.map +1 -0
  340. package/dist/utils/compileTailwindCss.js +54 -0
  341. package/dist/utils/compileTailwindCss.js.map +1 -0
  342. package/dist/utils/componentSources.d.ts +50 -0
  343. package/dist/utils/componentSources.d.ts.map +1 -0
  344. package/dist/utils/componentSources.js +50 -0
  345. package/dist/utils/componentSources.js.map +1 -0
  346. package/dist/utils/decodeStyleEntities.d.ts +15 -0
  347. package/dist/utils/decodeStyleEntities.d.ts.map +1 -0
  348. package/dist/utils/decodeStyleEntities.js +18 -0
  349. package/dist/utils/decodeStyleEntities.js.map +1 -0
  350. package/dist/utils/detect.d.ts +5 -0
  351. package/dist/utils/detect.d.ts.map +1 -0
  352. package/dist/utils/detect.js +10 -0
  353. package/dist/utils/detect.js.map +1 -0
  354. package/dist/utils/output-markers.d.ts +29 -0
  355. package/dist/utils/output-markers.d.ts.map +1 -0
  356. package/dist/utils/output-markers.js +68 -0
  357. package/dist/utils/output-markers.js.map +1 -0
  358. package/dist/utils/{url.d.mts → url.d.ts} +1 -1
  359. package/dist/utils/url.d.ts.map +1 -0
  360. package/dist/utils/{url.mjs → url.js} +2 -3
  361. package/dist/utils/url.js.map +1 -0
  362. package/node_modules/@clack/core/CHANGELOG.md +8 -0
  363. package/node_modules/@clack/core/dist/index.d.mts +18 -4
  364. package/node_modules/@clack/core/dist/index.mjs +16 -10
  365. package/node_modules/@clack/core/dist/index.mjs.map +1 -1
  366. package/node_modules/@clack/core/package.json +5 -2
  367. package/node_modules/@clack/prompts/CHANGELOG.md +15 -0
  368. package/node_modules/@clack/prompts/README.md +107 -2
  369. package/node_modules/@clack/prompts/dist/index.d.mts +16 -11
  370. package/node_modules/@clack/prompts/dist/index.mjs +114 -107
  371. package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
  372. package/node_modules/@clack/prompts/package.json +7 -4
  373. package/node_modules/fast-string-truncated-width/dist/index.js +36 -96
  374. package/node_modules/fast-string-truncated-width/dist/types.d.ts +0 -3
  375. package/node_modules/fast-string-truncated-width/dist/utils.d.ts +3 -3
  376. package/node_modules/fast-string-truncated-width/dist/utils.js +14 -9
  377. package/node_modules/fast-string-truncated-width/package.json +1 -1
  378. package/node_modules/fast-string-truncated-width/readme.md +2 -3
  379. package/node_modules/fast-string-width/package.json +2 -2
  380. package/node_modules/fast-string-width/readme.md +0 -3
  381. package/node_modules/fast-wrap-ansi/lib/main.js +4 -1
  382. package/node_modules/fast-wrap-ansi/lib/main.js.map +1 -1
  383. package/node_modules/fast-wrap-ansi/package.json +2 -2
  384. package/node_modules/maizzle/README.md +24 -0
  385. package/node_modules/maizzle/dist/commands/make/component.mjs +1 -1
  386. package/node_modules/maizzle/dist/commands/make/config.mjs +1 -1
  387. package/node_modules/maizzle/dist/commands/make/layout.mjs +3 -3
  388. package/node_modules/maizzle/dist/commands/make/scaffold.mjs +1 -1
  389. package/node_modules/maizzle/dist/commands/make/stubs/Layout.vue +146 -0
  390. package/node_modules/maizzle/dist/commands/make/stubs/component.vue +2 -4
  391. package/node_modules/maizzle/dist/commands/make/stubs/config.ts +1 -5
  392. package/node_modules/maizzle/dist/commands/make/template.mjs +1 -1
  393. package/node_modules/maizzle/dist/commands/new.mjs +32 -52
  394. package/node_modules/maizzle/dist/index.d.mts +1 -0
  395. package/node_modules/maizzle/dist/index.mjs +30 -7
  396. package/node_modules/maizzle/package.json +4 -3
  397. package/node_modules/nypm/dist/cli.mjs +28 -5
  398. package/node_modules/nypm/dist/index.d.mts +0 -8
  399. package/node_modules/nypm/dist/index.mjs +27 -4
  400. package/node_modules/nypm/package.json +12 -12
  401. package/node_modules/tinyexec/README.md +1 -1
  402. package/node_modules/tinyexec/dist/main.d.mts +6 -6
  403. package/node_modules/tinyexec/dist/main.mjs +126 -134
  404. package/node_modules/tinyexec/package.json +9 -9
  405. package/package.json +31 -21
  406. package/dist/build.d.mts +0 -19
  407. package/dist/build.d.mts.map +0 -1
  408. package/dist/build.mjs.map +0 -1
  409. package/dist/components/Divider.vue +0 -105
  410. package/dist/components/Vml.vue +0 -89
  411. package/dist/components/utils.d.mts +0 -5
  412. package/dist/components/utils.d.mts.map +0 -1
  413. package/dist/components/utils.mjs +0 -9
  414. package/dist/components/utils.mjs.map +0 -1
  415. package/dist/composables/defineConfig.d.mts.map +0 -1
  416. package/dist/composables/defineConfig.mjs.map +0 -1
  417. package/dist/composables/renderContext.d.mts +0 -19
  418. package/dist/composables/renderContext.d.mts.map +0 -1
  419. package/dist/composables/renderContext.mjs.map +0 -1
  420. package/dist/composables/useConfig.d.mts.map +0 -1
  421. package/dist/composables/useConfig.mjs.map +0 -1
  422. package/dist/composables/useDoctype.d.mts.map +0 -1
  423. package/dist/composables/useDoctype.mjs.map +0 -1
  424. package/dist/composables/useEvent.d.mts.map +0 -1
  425. package/dist/composables/useEvent.mjs.map +0 -1
  426. package/dist/composables/usePlaintext.d.mts.map +0 -1
  427. package/dist/composables/usePlaintext.mjs.map +0 -1
  428. package/dist/config/defaults.d.mts.map +0 -1
  429. package/dist/config/defaults.mjs.map +0 -1
  430. package/dist/config/index.d.mts.map +0 -1
  431. package/dist/config/index.mjs.map +0 -1
  432. package/dist/events/index.d.mts.map +0 -1
  433. package/dist/events/index.mjs.map +0 -1
  434. package/dist/index.d.mts +0 -29
  435. package/dist/index.mjs +0 -29
  436. package/dist/plaintext.d.mts.map +0 -1
  437. package/dist/plaintext.mjs.map +0 -1
  438. package/dist/plugin.d.mts.map +0 -1
  439. package/dist/plugin.mjs +0 -41
  440. package/dist/plugin.mjs.map +0 -1
  441. package/dist/plugins/postcss/mergeMediaQueries.d.mts.map +0 -1
  442. package/dist/plugins/postcss/mergeMediaQueries.mjs.map +0 -1
  443. package/dist/plugins/postcss/pruneVars.d.mts.map +0 -1
  444. package/dist/plugins/postcss/pruneVars.mjs.map +0 -1
  445. package/dist/plugins/postcss/removeDeclarations.d.mts.map +0 -1
  446. package/dist/plugins/postcss/removeDeclarations.mjs.map +0 -1
  447. package/dist/plugins/postcss/tailwindCleanup.d.mts.map +0 -1
  448. package/dist/plugins/postcss/tailwindCleanup.mjs +0 -35
  449. package/dist/plugins/postcss/tailwindCleanup.mjs.map +0 -1
  450. package/dist/render/createRenderer.d.mts.map +0 -1
  451. package/dist/render/createRenderer.mjs +0 -155
  452. package/dist/render/createRenderer.mjs.map +0 -1
  453. package/dist/render/index.d.mts +0 -26
  454. package/dist/render/index.d.mts.map +0 -1
  455. package/dist/render/index.mjs +0 -44
  456. package/dist/render/index.mjs.map +0 -1
  457. package/dist/serve.d.mts.map +0 -1
  458. package/dist/serve.mjs.map +0 -1
  459. package/dist/server/compatibility.d.mts +0 -6
  460. package/dist/server/compatibility.d.mts.map +0 -1
  461. package/dist/server/compatibility.mjs +0 -83
  462. package/dist/server/compatibility.mjs.map +0 -1
  463. package/dist/server/linter.d.mts +0 -6
  464. package/dist/server/linter.d.mts.map +0 -1
  465. package/dist/server/linter.mjs +0 -200
  466. package/dist/server/linter.mjs.map +0 -1
  467. package/dist/server/ui/components/ui/resizable/ResizableHandle.vue +0 -30
  468. package/dist/server/ui/components/ui/resizable/ResizablePanel.vue +0 -21
  469. package/dist/server/ui/components/ui/resizable/ResizablePanelGroup.vue +0 -25
  470. package/dist/server/ui/components/ui/resizable/index.ts +0 -3
  471. package/dist/transformers/addAttributes.d.mts.map +0 -1
  472. package/dist/transformers/addAttributes.mjs.map +0 -1
  473. package/dist/transformers/attributeToStyle.d.mts +0 -25
  474. package/dist/transformers/attributeToStyle.d.mts.map +0 -1
  475. package/dist/transformers/attributeToStyle.mjs +0 -80
  476. package/dist/transformers/attributeToStyle.mjs.map +0 -1
  477. package/dist/transformers/base.d.mts +0 -8
  478. package/dist/transformers/base.d.mts.map +0 -1
  479. package/dist/transformers/base.mjs.map +0 -1
  480. package/dist/transformers/entities.d.mts +0 -8
  481. package/dist/transformers/entities.d.mts.map +0 -1
  482. package/dist/transformers/entities.mjs +0 -38
  483. package/dist/transformers/entities.mjs.map +0 -1
  484. package/dist/transformers/format.d.mts +0 -15
  485. package/dist/transformers/format.d.mts.map +0 -1
  486. package/dist/transformers/format.mjs +0 -26
  487. package/dist/transformers/format.mjs.map +0 -1
  488. package/dist/transformers/index.d.mts.map +0 -1
  489. package/dist/transformers/index.mjs +0 -73
  490. package/dist/transformers/index.mjs.map +0 -1
  491. package/dist/transformers/inlineCSS.d.mts +0 -30
  492. package/dist/transformers/inlineCSS.d.mts.map +0 -1
  493. package/dist/transformers/inlineCSS.mjs +0 -79
  494. package/dist/transformers/inlineCSS.mjs.map +0 -1
  495. package/dist/transformers/inlineLink.d.mts +0 -14
  496. package/dist/transformers/inlineLink.d.mts.map +0 -1
  497. package/dist/transformers/inlineLink.mjs.map +0 -1
  498. package/dist/transformers/minify.d.mts +0 -17
  499. package/dist/transformers/minify.d.mts.map +0 -1
  500. package/dist/transformers/minify.mjs +0 -24
  501. package/dist/transformers/minify.mjs.map +0 -1
  502. package/dist/transformers/purgeCSS.d.mts +0 -23
  503. package/dist/transformers/purgeCSS.d.mts.map +0 -1
  504. package/dist/transformers/purgeCSS.mjs +0 -66
  505. package/dist/transformers/purgeCSS.mjs.map +0 -1
  506. package/dist/transformers/removeAttributes.d.mts +0 -31
  507. package/dist/transformers/removeAttributes.d.mts.map +0 -1
  508. package/dist/transformers/removeAttributes.mjs +0 -63
  509. package/dist/transformers/removeAttributes.mjs.map +0 -1
  510. package/dist/transformers/replaceStrings.d.mts.map +0 -1
  511. package/dist/transformers/replaceStrings.mjs.map +0 -1
  512. package/dist/transformers/safeClassNames.d.mts.map +0 -1
  513. package/dist/transformers/safeClassNames.mjs.map +0 -1
  514. package/dist/transformers/shorthandCSS.d.mts +0 -24
  515. package/dist/transformers/shorthandCSS.d.mts.map +0 -1
  516. package/dist/transformers/shorthandCSS.mjs +0 -48
  517. package/dist/transformers/shorthandCSS.mjs.map +0 -1
  518. package/dist/transformers/tailwindcss.d.mts.map +0 -1
  519. package/dist/transformers/tailwindcss.mjs +0 -136
  520. package/dist/transformers/tailwindcss.mjs.map +0 -1
  521. package/dist/transformers/urlQuery.d.mts +0 -24
  522. package/dist/transformers/urlQuery.d.mts.map +0 -1
  523. package/dist/transformers/urlQuery.mjs +0 -65
  524. package/dist/transformers/urlQuery.mjs.map +0 -1
  525. package/dist/types/config.d.mts +0 -149
  526. package/dist/types/config.d.mts.map +0 -1
  527. package/dist/types/config.mjs +0 -1
  528. package/dist/types/index.d.mts +0 -2
  529. package/dist/types/index.mjs +0 -1
  530. package/dist/utils/ast/index.d.mts +0 -4
  531. package/dist/utils/ast/index.mjs +0 -5
  532. package/dist/utils/ast/parser.d.mts.map +0 -1
  533. package/dist/utils/ast/parser.mjs.map +0 -1
  534. package/dist/utils/ast/serializer.d.mts +0 -7
  535. package/dist/utils/ast/serializer.d.mts.map +0 -1
  536. package/dist/utils/ast/serializer.mjs +0 -13
  537. package/dist/utils/ast/serializer.mjs.map +0 -1
  538. package/dist/utils/ast/walker.d.mts.map +0 -1
  539. package/dist/utils/ast/walker.mjs.map +0 -1
  540. package/dist/utils/url.d.mts.map +0 -1
  541. package/dist/utils/url.mjs.map +0 -1
  542. package/node_modules/maizzle/dist/commands/make/stubs/layout.vue +0 -39
@@ -0,0 +1,16 @@
1
+ import { MaizzleConfig } from "../types/config.js";
2
+ import { TailwindBlock } from "../composables/renderContext.js";
3
+ import { ChildNode } from "domhandler";
4
+
5
+ //#region src/transformers/tailwindComponent.d.ts
6
+ /**
7
+ * Compile Tailwind CSS for each top-level <Tailwind> block in the render
8
+ * context. Nested <Tailwind> instances are flattened: their classes flow
9
+ * up to the outermost block, their `#config` slot (if any) is ignored.
10
+ * One <style> per outermost block is appended to <head>; marker comments
11
+ * are stripped after.
12
+ */
13
+ declare function tailwindComponent(dom: ChildNode[], blocks: TailwindBlock[], config: MaizzleConfig, filePath?: string): Promise<ChildNode[]>;
14
+ //#endregion
15
+ export { tailwindComponent };
16
+ //# sourceMappingURL=tailwindComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tailwindComponent.d.ts","names":[],"sources":["../../src/transformers/tailwindComponent.ts"],"mappings":";;;;;;;AA0BA;;;;;iBAAsB,iBAAA,CACpB,GAAA,EAAK,SAAA,IACL,MAAA,EAAQ,aAAA,IACR,MAAA,EAAQ,aAAA,EACR,QAAA,YACC,OAAA,CAAQ,SAAA"}
@@ -0,0 +1,92 @@
1
+ import { walk } from "../utils/ast/walker.js";
2
+ import "../utils/ast/index.js";
3
+ import { compileTailwindCss } from "../utils/compileTailwindCss.js";
4
+ import { resolve } from "node:path";
5
+ //#region src/transformers/tailwindComponent.ts
6
+ const DEFAULT_SEED = "@import \"@maizzle/tailwindcss\";";
7
+ const OPEN_RE = /^mz-tw:(\S+)$/;
8
+ const CLOSE_RE = /^\/mz-tw:(\S+)$/;
9
+ /**
10
+ * Compile Tailwind CSS for each top-level <Tailwind> block in the render
11
+ * context. Nested <Tailwind> instances are flattened: their classes flow
12
+ * up to the outermost block, their `#config` slot (if any) is ignored.
13
+ * One <style> per outermost block is appended to <head>; marker comments
14
+ * are stripped after.
15
+ */
16
+ async function tailwindComponent(dom, blocks, config, filePath) {
17
+ if (!blocks.length) return dom;
18
+ const map = /* @__PURE__ */ new Map();
19
+ for (const b of blocks) map.set(b.id, {
20
+ id: b.id,
21
+ configCss: b.css,
22
+ nested: false,
23
+ classes: /* @__PURE__ */ new Set()
24
+ });
25
+ const stack = [];
26
+ const markers = [];
27
+ walk(dom, (node) => {
28
+ if (node.type === "comment") {
29
+ const data = node.data;
30
+ const open = data.match(OPEN_RE);
31
+ const close = data.match(CLOSE_RE);
32
+ if (open) {
33
+ const id = open[1];
34
+ const meta = map.get(id);
35
+ if (meta && stack.length > 0) meta.nested = true;
36
+ if (meta) stack.push(id);
37
+ markers.push(node);
38
+ } else if (close) {
39
+ const id = close[1];
40
+ if (stack[stack.length - 1] === id) stack.pop();
41
+ markers.push(node);
42
+ }
43
+ return;
44
+ }
45
+ const el = node;
46
+ if (el.attribs?.class && stack.length > 0) map.get(stack[0]).classes.add(el.attribs.class);
47
+ });
48
+ const fromPath = filePath ?? resolve(process.cwd(), "template.vue");
49
+ let head;
50
+ walk(dom, (n) => {
51
+ if (!head && n.name === "head") head = n;
52
+ });
53
+ if (!head) throw new Error("`Tailwind` component requires `Head` component to be present in the template.");
54
+ for (const meta of map.values()) {
55
+ if (meta.nested) continue;
56
+ const css = (await compileTailwindCss(buildCssInput(meta.configCss, meta.classes), config, `${fromPath}?tw=${meta.id}`)).trim();
57
+ if (!css) continue;
58
+ const styleNode = {
59
+ type: "tag",
60
+ name: "style",
61
+ attribs: { raw: "" },
62
+ children: [],
63
+ parent: head,
64
+ prev: null,
65
+ next: null
66
+ };
67
+ styleNode.children = [{
68
+ type: "text",
69
+ data: css,
70
+ parent: styleNode,
71
+ prev: null,
72
+ next: null
73
+ }];
74
+ head.children.push(styleNode);
75
+ }
76
+ for (const c of markers) {
77
+ const parent = c.parent;
78
+ if (!parent?.children) continue;
79
+ const i = parent.children.indexOf(c);
80
+ if (i >= 0) parent.children.splice(i, 1);
81
+ }
82
+ return dom;
83
+ }
84
+ function buildCssInput(configCss, classes) {
85
+ const seed = configCss ?? DEFAULT_SEED;
86
+ if (!classes.size) return seed;
87
+ return `${seed}\n@source inline("${[...classes].join(" ").replace(/"/g, "\\\"")}");`;
88
+ }
89
+ //#endregion
90
+ export { tailwindComponent };
91
+
92
+ //# sourceMappingURL=tailwindComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tailwindComponent.js","names":[],"sources":["../../src/transformers/tailwindComponent.ts"],"sourcesContent":["import { resolve } from 'node:path'\nimport type { ChildNode, Element, Comment } from 'domhandler'\nimport { walk } from '../utils/ast/index.ts'\nimport { compileTailwindCss } from '../utils/compileTailwindCss.ts'\nimport type { TailwindBlock } from '../composables/renderContext.ts'\nimport type { MaizzleConfig } from '../types/config.ts'\n\nconst DEFAULT_SEED = '@import \"@maizzle/tailwindcss\";'\n\ninterface BlockMeta {\n id: string\n configCss?: string\n nested: boolean\n classes: Set<string>\n}\n\nconst OPEN_RE = /^mz-tw:(\\S+)$/\nconst CLOSE_RE = /^\\/mz-tw:(\\S+)$/\n\n/**\n * Compile Tailwind CSS for each top-level <Tailwind> block in the render\n * context. Nested <Tailwind> instances are flattened: their classes flow\n * up to the outermost block, their `#config` slot (if any) is ignored.\n * One <style> per outermost block is appended to <head>; marker comments\n * are stripped after.\n */\nexport async function tailwindComponent(\n dom: ChildNode[],\n blocks: TailwindBlock[],\n config: MaizzleConfig,\n filePath?: string,\n): Promise<ChildNode[]> {\n if (!blocks.length) return dom\n\n const map = new Map<string, BlockMeta>()\n for (const b of blocks) {\n map.set(b.id, { id: b.id, configCss: b.css, nested: false, classes: new Set() })\n }\n\n const stack: string[] = []\n const markers: Comment[] = []\n\n walk(dom, (node) => {\n if (node.type === 'comment') {\n const data = (node as Comment).data\n const open = data.match(OPEN_RE)\n const close = data.match(CLOSE_RE)\n if (open) {\n const id = open[1]\n const meta = map.get(id)\n if (meta && stack.length > 0) meta.nested = true\n if (meta) stack.push(id)\n markers.push(node as Comment)\n } else if (close) {\n const id = close[1]\n if (stack[stack.length - 1] === id) stack.pop()\n markers.push(node as Comment)\n }\n return\n }\n\n const el = node as Element\n // Always assign to the OUTERMOST active marker (stack[0]) so nested\n // <Tailwind> blocks merge their classes into the parent's scope.\n if (el.attribs?.class && stack.length > 0) {\n map.get(stack[0])!.classes.add(el.attribs.class)\n }\n })\n\n const fromPath = filePath ?? resolve(process.cwd(), 'template.vue')\n\n let head: Element | undefined\n walk(dom, (n) => {\n if (!head && (n as Element).name === 'head') head = n as Element\n })\n\n if (!head) {\n throw new Error('`Tailwind` component requires `Head` component to be present in the template.')\n }\n\n // Compile + inject one <style raw> per outermost block. `raw` opts the\n // existing tailwindcss transformer out of recompiling already-compiled CSS.\n for (const meta of map.values()) {\n if (meta.nested) continue\n\n const cssInput = buildCssInput(meta.configCss, meta.classes)\n const css = (await compileTailwindCss(cssInput, config, `${fromPath}?tw=${meta.id}`)).trim()\n if (!css) continue\n\n const styleNode: Element = {\n type: 'tag',\n name: 'style',\n attribs: { raw: '' },\n children: [],\n parent: head,\n prev: null,\n next: null,\n } as any\n\n const textNode = {\n type: 'text',\n data: css,\n parent: styleNode,\n prev: null,\n next: null,\n } as any\n\n styleNode.children = [textNode]\n head.children.push(styleNode)\n }\n\n // Strip marker comments from their parents\n for (const c of markers) {\n const parent = c.parent as Element | null\n if (!parent?.children) continue\n const i = parent.children.indexOf(c)\n if (i >= 0) parent.children.splice(i, 1)\n }\n\n return dom\n}\n\nfunction buildCssInput(configCss: string | undefined, classes: Set<string>): string {\n const seed = configCss ?? DEFAULT_SEED\n\n if (!classes.size) return seed\n\n const inline = [...classes].join(' ').replace(/\"/g, '\\\\\"')\n return `${seed}\\n@source inline(\"${inline}\");`\n}\n"],"mappings":";;;;;AAOA,MAAM,eAAe;AASrB,MAAM,UAAU;AAChB,MAAM,WAAW;;;;;;;;AASjB,eAAsB,kBACpB,KACA,QACA,QACA,UACsB;CACtB,IAAI,CAAC,OAAO,QAAQ,OAAO;CAE3B,MAAM,sBAAM,IAAI,KAAwB;CACxC,KAAK,MAAM,KAAK,QACd,IAAI,IAAI,EAAE,IAAI;EAAE,IAAI,EAAE;EAAI,WAAW,EAAE;EAAK,QAAQ;EAAO,yBAAS,IAAI,KAAK;EAAE,CAAC;CAGlF,MAAM,QAAkB,EAAE;CAC1B,MAAM,UAAqB,EAAE;CAE7B,KAAK,MAAM,SAAS;EAClB,IAAI,KAAK,SAAS,WAAW;GAC3B,MAAM,OAAQ,KAAiB;GAC/B,MAAM,OAAO,KAAK,MAAM,QAAQ;GAChC,MAAM,QAAQ,KAAK,MAAM,SAAS;GAClC,IAAI,MAAM;IACR,MAAM,KAAK,KAAK;IAChB,MAAM,OAAO,IAAI,IAAI,GAAG;IACxB,IAAI,QAAQ,MAAM,SAAS,GAAG,KAAK,SAAS;IAC5C,IAAI,MAAM,MAAM,KAAK,GAAG;IACxB,QAAQ,KAAK,KAAgB;UACxB,IAAI,OAAO;IAChB,MAAM,KAAK,MAAM;IACjB,IAAI,MAAM,MAAM,SAAS,OAAO,IAAI,MAAM,KAAK;IAC/C,QAAQ,KAAK,KAAgB;;GAE/B;;EAGF,MAAM,KAAK;EAGX,IAAI,GAAG,SAAS,SAAS,MAAM,SAAS,GACtC,IAAI,IAAI,MAAM,GAAG,CAAE,QAAQ,IAAI,GAAG,QAAQ,MAAM;GAElD;CAEF,MAAM,WAAW,YAAY,QAAQ,QAAQ,KAAK,EAAE,eAAe;CAEnE,IAAI;CACJ,KAAK,MAAM,MAAM;EACf,IAAI,CAAC,QAAS,EAAc,SAAS,QAAQ,OAAO;GACpD;CAEF,IAAI,CAAC,MACH,MAAM,IAAI,MAAM,gFAAgF;CAKlG,KAAK,MAAM,QAAQ,IAAI,QAAQ,EAAE;EAC/B,IAAI,KAAK,QAAQ;EAGjB,MAAM,OAAO,MAAM,mBADF,cAAc,KAAK,WAAW,KAAK,QACN,EAAE,QAAQ,GAAG,SAAS,MAAM,KAAK,KAAK,EAAE,MAAM;EAC5F,IAAI,CAAC,KAAK;EAEV,MAAM,YAAqB;GACzB,MAAM;GACN,MAAM;GACN,SAAS,EAAE,KAAK,IAAI;GACpB,UAAU,EAAE;GACZ,QAAQ;GACR,MAAM;GACN,MAAM;GACP;EAUD,UAAU,WAAW,CAAC;GAPpB,MAAM;GACN,MAAM;GACN,QAAQ;GACR,MAAM;GACN,MAAM;GAGsB,CAAC;EAC/B,KAAK,SAAS,KAAK,UAAU;;CAI/B,KAAK,MAAM,KAAK,SAAS;EACvB,MAAM,SAAS,EAAE;EACjB,IAAI,CAAC,QAAQ,UAAU;EACvB,MAAM,IAAI,OAAO,SAAS,QAAQ,EAAE;EACpC,IAAI,KAAK,GAAG,OAAO,SAAS,OAAO,GAAG,EAAE;;CAG1C,OAAO;;AAGT,SAAS,cAAc,WAA+B,SAA8B;CAClF,MAAM,OAAO,aAAa;CAE1B,IAAI,CAAC,QAAQ,MAAM,OAAO;CAG1B,OAAO,GAAG,KAAK,oBADA,CAAC,GAAG,QAAQ,CAAC,KAAK,IAAI,CAAC,QAAQ,MAAM,OACX,CAAC"}
@@ -1,4 +1,4 @@
1
- import { MaizzleConfig } from "../types/config.mjs";
1
+ import { MaizzleConfig } from "../types/config.js";
2
2
  import { ChildNode } from "domhandler";
3
3
 
4
4
  //#region src/transformers/tailwindcss.d.ts
@@ -8,8 +8,12 @@ import { ChildNode } from "domhandler";
8
8
  * Compiles CSS inside <style> tags in the DOM using
9
9
  * @tailwindcss/postcss, then lowers modern CSS syntax with lightningcss.
10
10
  *
11
- * Uses the AST walker to find <style> tags and decodes HTML entities
12
- * that Vue SSR encodes (e.g. &quot;) before CSS processing.
11
+ * Configures Tailwind sources to scan:
12
+ * - Rendered class attributes (via `@source inline`) for all classes from all components
13
+ * - User project files (via Tailwind's auto-detection from base/from path)
14
+ *
15
+ * User `@source` and `@source not directives` in style tags are preserved.
16
+ * Source directives are only added to style tags that import Tailwind.
13
17
  *
14
18
  * Runs as the first transformer in the pipeline so that subsequent
15
19
  * transformers (inliner, purge, etc.) work with fully compiled CSS.
@@ -17,4 +21,4 @@ import { ChildNode } from "domhandler";
17
21
  declare function tailwindcss(dom: ChildNode[], config: MaizzleConfig, filePath?: string): Promise<ChildNode[]>;
18
22
  //#endregion
19
23
  export { tailwindcss };
20
- //# sourceMappingURL=tailwindcss.d.mts.map
24
+ //# sourceMappingURL=tailwindcss.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tailwindcss.d.ts","names":[],"sources":["../../src/transformers/tailwindcss.ts"],"mappings":";;;;;;AA0EA;;;;;;;;;;;;;;iBAAsB,WAAA,CAAY,GAAA,EAAK,SAAA,IAAa,MAAA,EAAQ,aAAA,EAAe,QAAA,YAAoB,OAAA,CAAQ,SAAA"}
@@ -0,0 +1,97 @@
1
+ import { walk } from "../utils/ast/walker.js";
2
+ import "../utils/ast/index.js";
3
+ import { compileTailwindCss } from "../utils/compileTailwindCss.js";
4
+ import { decodeStyleEntities } from "../utils/decodeStyleEntities.js";
5
+ import { dirname, relative, resolve } from "node:path";
6
+ //#region src/transformers/tailwindcss.ts
7
+ /**
8
+ * Check if CSS content uses Tailwind features that require source scanning.
9
+ *
10
+ * Only CSS that imports Tailwind (or @maizzle/tailwindcss) needs @source
11
+ * directives. Plain CSS without Tailwind imports doesn't need scanning
12
+ * and would pass through @source directives unconsumed.
13
+ */
14
+ function usesTailwind(css) {
15
+ return /((@import|@reference)\s+["'](tailwindcss|@maizzle\/tailwindcss)|@tailwind\s)/.test(css);
16
+ }
17
+ /**
18
+ * Build @source directives for Tailwind CSS scanning.
19
+ *
20
+ * Configures two types of sources:
21
+ * 1. Exclusions for output dir and user-configured paths
22
+ * 2. Inline source with all class attribute values from the rendered DOM,
23
+ * capturing classes from all components (built-in + user), dynamic
24
+ * expressions, and the template itself — Tailwind's scanner handles
25
+ * the actual class extraction from these raw values
26
+ */
27
+ function buildSourceDirectives(dom, config, fromDir) {
28
+ const directives = [];
29
+ const excludePaths = [resolve(config.output?.path ?? "dist"), ...(config.css?.exclude ?? []).map((p) => resolve(p))];
30
+ for (const p of excludePaths) directives.push(`@source not "${relative(fromDir, resolve(p))}";`);
31
+ const classes = [];
32
+ walk(dom, (n) => {
33
+ const cls = n.attribs?.class;
34
+ if (cls) classes.push(cls);
35
+ });
36
+ if (classes.length) directives.push(`@source inline("${classes.join(" ")}");`);
37
+ return directives.join("\n");
38
+ }
39
+ /**
40
+ * Tailwind CSS transformer.
41
+ *
42
+ * Compiles CSS inside <style> tags in the DOM using
43
+ * @tailwindcss/postcss, then lowers modern CSS syntax with lightningcss.
44
+ *
45
+ * Configures Tailwind sources to scan:
46
+ * - Rendered class attributes (via `@source inline`) for all classes from all components
47
+ * - User project files (via Tailwind's auto-detection from base/from path)
48
+ *
49
+ * User `@source` and `@source not directives` in style tags are preserved.
50
+ * Source directives are only added to style tags that import Tailwind.
51
+ *
52
+ * Runs as the first transformer in the pipeline so that subsequent
53
+ * transformers (inliner, purge, etc.) work with fully compiled CSS.
54
+ */
55
+ async function tailwindcss(dom, config, filePath) {
56
+ const styleTags = [];
57
+ walk(dom, (node) => {
58
+ if (node.name !== "style") return;
59
+ const el = node;
60
+ if ("raw" in (el.attribs || {})) {
61
+ delete el.attribs.raw;
62
+ return;
63
+ }
64
+ const rawContent = el.children.filter((child) => child.type === "text").map((child) => child.data).join("");
65
+ if (!rawContent.trim()) return;
66
+ styleTags.push({
67
+ node: el,
68
+ cssContent: decodeStyleEntities(rawContent)
69
+ });
70
+ });
71
+ if (!styleTags.length) return dom;
72
+ const fromPath = filePath ?? resolve(process.cwd(), "template.vue");
73
+ const fromDir = dirname(fromPath);
74
+ const sourceDirectives = styleTags.some(({ cssContent }) => usesTailwind(cssContent)) ? buildSourceDirectives(dom, config, fromDir) : "";
75
+ for (let i = 0; i < styleTags.length; i++) {
76
+ const { node, cssContent } = styleTags[i];
77
+ const fullCss = usesTailwind(cssContent) ? `${cssContent}\n${sourceDirectives}` : cssContent;
78
+ try {
79
+ node.children = [{
80
+ type: "text",
81
+ data: await compileTailwindCss(fullCss, config, `${fromPath}?style=${i}`),
82
+ parent: node
83
+ }];
84
+ } catch {
85
+ node.children = [{
86
+ type: "text",
87
+ data: cssContent,
88
+ parent: node
89
+ }];
90
+ }
91
+ }
92
+ return dom;
93
+ }
94
+ //#endregion
95
+ export { tailwindcss };
96
+
97
+ //# sourceMappingURL=tailwindcss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tailwindcss.js","names":[],"sources":["../../src/transformers/tailwindcss.ts"],"sourcesContent":["import { resolve, dirname, relative } from 'node:path'\nimport type { ChildNode, Element } from 'domhandler'\nimport { walk } from '../utils/ast/index.ts'\nimport { decodeStyleEntities } from '../utils/decodeStyleEntities.ts'\nimport { compileTailwindCss } from '../utils/compileTailwindCss.ts'\nimport type { MaizzleConfig } from '../types/config.ts'\n\n/**\n * Check if CSS content uses Tailwind features that require source scanning.\n *\n * Only CSS that imports Tailwind (or @maizzle/tailwindcss) needs @source\n * directives. Plain CSS without Tailwind imports doesn't need scanning\n * and would pass through @source directives unconsumed.\n */\nfunction usesTailwind(css: string): boolean {\n return /((@import|@reference)\\s+[\"'](tailwindcss|@maizzle\\/tailwindcss)|@tailwind\\s)/.test(css)\n}\n\n/**\n * Build @source directives for Tailwind CSS scanning.\n *\n * Configures two types of sources:\n * 1. Exclusions for output dir and user-configured paths\n * 2. Inline source with all class attribute values from the rendered DOM,\n * capturing classes from all components (built-in + user), dynamic\n * expressions, and the template itself — Tailwind's scanner handles\n * the actual class extraction from these raw values\n */\nfunction buildSourceDirectives(dom: ChildNode[], config: MaizzleConfig, fromDir: string): string {\n const directives: string[] = []\n\n // Exclude output dir and user-configured paths\n const excludePaths = [\n resolve(config.output?.path ?? 'dist'),\n ...(config.css?.exclude ?? []).map(p => resolve(p)),\n ]\n\n for (const p of excludePaths) {\n directives.push(`@source not \"${relative(fromDir, resolve(p))}\";`)\n }\n\n // Inline source: collect all class attribute values from the rendered DOM.\n // After Vue SSR, the DOM contains every class from every component\n // (built-in framework components, user components, dynamic bindings).\n // We pass these raw values to Tailwind's scanner via @source inline().\n const classes: string[] = []\n walk(dom, (n) => {\n const cls = (n as Element).attribs?.class\n if (cls) classes.push(cls)\n })\n\n if (classes.length) {\n directives.push(`@source inline(\"${classes.join(' ')}\");`)\n }\n\n return directives.join('\\n')\n}\n\n/**\n * Tailwind CSS transformer.\n *\n * Compiles CSS inside <style> tags in the DOM using\n * @tailwindcss/postcss, then lowers modern CSS syntax with lightningcss.\n *\n * Configures Tailwind sources to scan:\n * - Rendered class attributes (via `@source inline`) for all classes from all components\n * - User project files (via Tailwind's auto-detection from base/from path)\n *\n * User `@source` and `@source not directives` in style tags are preserved.\n * Source directives are only added to style tags that import Tailwind.\n *\n * Runs as the first transformer in the pipeline so that subsequent\n * transformers (inliner, purge, etc.) work with fully compiled CSS.\n */\nexport async function tailwindcss(dom: ChildNode[], config: MaizzleConfig, filePath?: string): Promise<ChildNode[]> {\n const styleTags: { node: Element; cssContent: string }[] = []\n\n walk(dom, (node) => {\n if ((node as Element).name !== 'style') return\n\n const el = node as Element\n const attrs = el.attribs || {}\n\n // `raw` opts out of compilation entirely (marker is consumed here).\n // `embed`/`data-embed` only signal \"preserve tag after inlining\" — they\n // still need to go through compile so Tailwind/@apply resolves.\n if ('raw' in attrs) {\n delete el.attribs.raw\n return\n }\n\n // Get text content from children and decode HTML entities\n const rawContent = el.children\n .filter(child => child.type === 'text')\n .map(child => (child as any).data)\n .join('')\n\n if (!rawContent.trim()) return\n\n styleTags.push({ node: el, cssContent: decodeStyleEntities(rawContent) })\n })\n\n if (!styleTags.length) return dom\n\n const fromPath = filePath ?? resolve(process.cwd(), 'template.vue')\n const fromDir = dirname(fromPath)\n\n // Only compute source directives if at least one style tag uses Tailwind\n const hasTailwindStyles = styleTags.some(({ cssContent }) => usesTailwind(cssContent))\n const sourceDirectives = hasTailwindStyles\n ? buildSourceDirectives(dom, config, fromDir)\n : ''\n\n for (let i = 0; i < styleTags.length; i++) {\n const { node, cssContent } = styleTags[i]\n\n // Only add source directives to style tags that import Tailwind —\n // plain CSS doesn't need them and @tailwindcss/postcss would leave\n // the directives unconsumed in the output\n const fullCss = usesTailwind(cssContent)\n ? `${cssContent}\\n${sourceDirectives}`\n : cssContent\n\n try {\n const optimized = await compileTailwindCss(fullCss, config, `${fromPath}?style=${i}`)\n\n // Replace the style tag's children with the compiled CSS\n node.children = [{\n type: 'text',\n data: optimized,\n parent: node,\n } as any]\n } catch {\n // If CSS processing fails, still replace with decoded content\n // so HTML entities don't break the CSS\n node.children = [{\n type: 'text',\n data: cssContent,\n parent: node,\n } as any]\n }\n }\n\n return dom\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAS,aAAa,KAAsB;CAC1C,OAAO,+EAA+E,KAAK,IAAI;;;;;;;;;;;;AAajG,SAAS,sBAAsB,KAAkB,QAAuB,SAAyB;CAC/F,MAAM,aAAuB,EAAE;CAG/B,MAAM,eAAe,CACnB,QAAQ,OAAO,QAAQ,QAAQ,OAAO,EACtC,IAAI,OAAO,KAAK,WAAW,EAAE,EAAE,KAAI,MAAK,QAAQ,EAAE,CAAC,CACpD;CAED,KAAK,MAAM,KAAK,cACd,WAAW,KAAK,gBAAgB,SAAS,SAAS,QAAQ,EAAE,CAAC,CAAC,IAAI;CAOpE,MAAM,UAAoB,EAAE;CAC5B,KAAK,MAAM,MAAM;EACf,MAAM,MAAO,EAAc,SAAS;EACpC,IAAI,KAAK,QAAQ,KAAK,IAAI;GAC1B;CAEF,IAAI,QAAQ,QACV,WAAW,KAAK,mBAAmB,QAAQ,KAAK,IAAI,CAAC,KAAK;CAG5D,OAAO,WAAW,KAAK,KAAK;;;;;;;;;;;;;;;;;;AAmB9B,eAAsB,YAAY,KAAkB,QAAuB,UAAyC;CAClH,MAAM,YAAqD,EAAE;CAE7D,KAAK,MAAM,SAAS;EAClB,IAAK,KAAiB,SAAS,SAAS;EAExC,MAAM,KAAK;EAMX,IAAI,UALU,GAAG,WAAW,EAAE,GAKV;GAClB,OAAO,GAAG,QAAQ;GAClB;;EAIF,MAAM,aAAa,GAAG,SACnB,QAAO,UAAS,MAAM,SAAS,OAAO,CACtC,KAAI,UAAU,MAAc,KAAK,CACjC,KAAK,GAAG;EAEX,IAAI,CAAC,WAAW,MAAM,EAAE;EAExB,UAAU,KAAK;GAAE,MAAM;GAAI,YAAY,oBAAoB,WAAW;GAAE,CAAC;GACzE;CAEF,IAAI,CAAC,UAAU,QAAQ,OAAO;CAE9B,MAAM,WAAW,YAAY,QAAQ,QAAQ,KAAK,EAAE,eAAe;CACnE,MAAM,UAAU,QAAQ,SAAS;CAIjC,MAAM,mBADoB,UAAU,MAAM,EAAE,iBAAiB,aAAa,WAAW,CAC3C,GACtC,sBAAsB,KAAK,QAAQ,QAAQ,GAC3C;CAEJ,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;EACzC,MAAM,EAAE,MAAM,eAAe,UAAU;EAKvC,MAAM,UAAU,aAAa,WAAW,GACpC,GAAG,WAAW,IAAI,qBAClB;EAEJ,IAAI;GAIF,KAAK,WAAW,CAAC;IACf,MAAM;IACN,MAAM,MALgB,mBAAmB,SAAS,QAAQ,GAAG,SAAS,SAAS,IAAI;IAMnF,QAAQ;IACT,CAAQ;UACH;GAGN,KAAK,WAAW,CAAC;IACf,MAAM;IACN,MAAM;IACN,QAAQ;IACT,CAAQ;;;CAIb,OAAO"}
@@ -0,0 +1,36 @@
1
+ import { UrlQueryOptions } from "../types/config.js";
2
+ import { ChildNode } from "domhandler";
3
+
4
+ //#region src/transformers/urlQuery.d.ts
5
+ /**
6
+ * Append query parameters to URLs found in matching attributes/elements.
7
+ *
8
+ * @param html HTML string to transform.
9
+ * @param params Query parameters to append (e.g. `{ utm_source: 'newsletter' }`).
10
+ * @param options Behaviour overrides — `tags` (CSS selectors, default `['a']`),
11
+ * `attributes` (default `['src', 'href', 'poster', 'srcset', 'background']`),
12
+ * `strict` (default `true`, only rewrites absolute URLs),
13
+ * `qs` (forwarded to `query-string`, default `{ encode: false }`).
14
+ * @returns The transformed HTML string.
15
+ *
16
+ * @example
17
+ * import { urlQuery } from '@maizzle/framework'
18
+ *
19
+ * const out = urlQuery(
20
+ * '<a href="https://example.com">x</a>',
21
+ * { utm_source: 'newsletter' },
22
+ * )
23
+ *
24
+ * // Restrict to specific tags / attributes:
25
+ * urlQuery(html, { ref: 'email' }, { tags: ['a', 'img'], attributes: ['href', 'src'] })
26
+ */
27
+ declare function urlQuery(html: string, params?: Record<string, unknown>, options?: UrlQueryOptions): string;
28
+ /**
29
+ * DOM-form of {@link urlQuery} used by the internal transformer pipeline.
30
+ * Takes a parsed DOM, returns a parsed DOM — avoids redundant
31
+ * serialize/parse round-trips when chained with other transformers.
32
+ */
33
+ declare function urlQueryDom(dom: ChildNode[], params?: Record<string, unknown>, options?: UrlQueryOptions): ChildNode[];
34
+ //#endregion
35
+ export { urlQuery, urlQueryDom };
36
+ //# sourceMappingURL=urlQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlQuery.d.ts","names":[],"sources":["../../src/transformers/urlQuery.ts"],"mappings":";;;;;;AAiDA;;;;;;;;;;;AAaA;;;;;;;;;iBAbgB,QAAA,CACd,IAAA,UACA,MAAA,GAAQ,MAAA,mBACR,OAAA,GAAS,eAAA;;;;;;iBAUK,WAAA,CACd,GAAA,EAAK,SAAA,IACL,MAAA,GAAQ,MAAA,mBACR,OAAA,GAAS,eAAA,GACR,SAAA"}
@@ -0,0 +1,77 @@
1
+ import { parse } from "../utils/ast/parser.js";
2
+ import { serialize } from "../utils/ast/serializer.js";
3
+ import "../utils/ast/index.js";
4
+ import { isAbsoluteUrl } from "../utils/url.js";
5
+ import queryString from "query-string";
6
+ import { selectAll } from "css-select";
7
+ //#region src/transformers/urlQuery.ts
8
+ const DEFAULT_ATTRIBUTES = [
9
+ "src",
10
+ "href",
11
+ "poster",
12
+ "srcset",
13
+ "background"
14
+ ];
15
+ const DEFAULT_TAGS = ["a"];
16
+ /**
17
+ * Append query parameters to a URL string using query-string.
18
+ */
19
+ function appendParams(url, params, qsOptions, strict) {
20
+ if (strict && !isAbsoluteUrl(url)) return url;
21
+ return queryString.stringifyUrl({
22
+ url,
23
+ query: params
24
+ }, qsOptions);
25
+ }
26
+ /**
27
+ * Append query parameters to URLs found in matching attributes/elements.
28
+ *
29
+ * @param html HTML string to transform.
30
+ * @param params Query parameters to append (e.g. `{ utm_source: 'newsletter' }`).
31
+ * @param options Behaviour overrides — `tags` (CSS selectors, default `['a']`),
32
+ * `attributes` (default `['src', 'href', 'poster', 'srcset', 'background']`),
33
+ * `strict` (default `true`, only rewrites absolute URLs),
34
+ * `qs` (forwarded to `query-string`, default `{ encode: false }`).
35
+ * @returns The transformed HTML string.
36
+ *
37
+ * @example
38
+ * import { urlQuery } from '@maizzle/framework'
39
+ *
40
+ * const out = urlQuery(
41
+ * '<a href="https://example.com">x</a>',
42
+ * { utm_source: 'newsletter' },
43
+ * )
44
+ *
45
+ * // Restrict to specific tags / attributes:
46
+ * urlQuery(html, { ref: 'email' }, { tags: ['a', 'img'], attributes: ['href', 'src'] })
47
+ */
48
+ function urlQuery(html, params = {}, options = {}) {
49
+ return serialize(urlQueryDom(parse(html), params, options));
50
+ }
51
+ /**
52
+ * DOM-form of {@link urlQuery} used by the internal transformer pipeline.
53
+ * Takes a parsed DOM, returns a parsed DOM — avoids redundant
54
+ * serialize/parse round-trips when chained with other transformers.
55
+ */
56
+ function urlQueryDom(dom, params = {}, options = {}) {
57
+ if (!params || Object.keys(params).length === 0) return dom;
58
+ const tags = options.tags ?? DEFAULT_TAGS;
59
+ const attributes = options.attributes ?? DEFAULT_ATTRIBUTES;
60
+ const strict = options.strict ?? true;
61
+ const qsOptions = {
62
+ encode: false,
63
+ ...options.qs ?? {}
64
+ };
65
+ const elements = selectAll(tags.join(", "), dom);
66
+ for (const el of elements) for (const attr of attributes) {
67
+ const value = el.attribs[attr];
68
+ if (!value) continue;
69
+ const updated = appendParams(value, params, qsOptions, strict);
70
+ if (updated !== value) el.attribs[attr] = updated;
71
+ }
72
+ return dom;
73
+ }
74
+ //#endregion
75
+ export { urlQuery, urlQueryDom };
76
+
77
+ //# sourceMappingURL=urlQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlQuery.js","names":[],"sources":["../../src/transformers/urlQuery.ts"],"sourcesContent":["import queryString from 'query-string'\nimport { selectAll } from 'css-select'\nimport type { ChildNode, Element } from 'domhandler'\nimport { parse, serialize } from '../utils/ast/index.ts'\nimport { isAbsoluteUrl } from '../utils/url.ts'\nimport type { UrlQueryOptions } from '../types/config.ts'\n\nconst DEFAULT_ATTRIBUTES = ['src', 'href', 'poster', 'srcset', 'background']\nconst DEFAULT_TAGS = ['a']\n\n/**\n * Append query parameters to a URL string using query-string.\n */\nfunction appendParams(\n url: string,\n params: Record<string, unknown>,\n qsOptions: queryString.StringifyOptions,\n strict: boolean,\n): string {\n if (strict && !isAbsoluteUrl(url)) return url\n\n return queryString.stringifyUrl(\n { url, query: params as queryString.StringifiableRecord },\n qsOptions,\n )\n}\n\n/**\n * Append query parameters to URLs found in matching attributes/elements.\n *\n * @param html HTML string to transform.\n * @param params Query parameters to append (e.g. `{ utm_source: 'newsletter' }`).\n * @param options Behaviour overrides — `tags` (CSS selectors, default `['a']`),\n * `attributes` (default `['src', 'href', 'poster', 'srcset', 'background']`),\n * `strict` (default `true`, only rewrites absolute URLs),\n * `qs` (forwarded to `query-string`, default `{ encode: false }`).\n * @returns The transformed HTML string.\n *\n * @example\n * import { urlQuery } from '@maizzle/framework'\n *\n * const out = urlQuery(\n * '<a href=\"https://example.com\">x</a>',\n * { utm_source: 'newsletter' },\n * )\n *\n * // Restrict to specific tags / attributes:\n * urlQuery(html, { ref: 'email' }, { tags: ['a', 'img'], attributes: ['href', 'src'] })\n */\nexport function urlQuery(\n html: string,\n params: Record<string, unknown> = {},\n options: UrlQueryOptions = {},\n): string {\n return serialize(urlQueryDom(parse(html), params, options))\n}\n\n/**\n * DOM-form of {@link urlQuery} used by the internal transformer pipeline.\n * Takes a parsed DOM, returns a parsed DOM — avoids redundant\n * serialize/parse round-trips when chained with other transformers.\n */\nexport function urlQueryDom(\n dom: ChildNode[],\n params: Record<string, unknown> = {},\n options: UrlQueryOptions = {},\n): ChildNode[] {\n if (!params || Object.keys(params).length === 0) return dom\n\n const tags = options.tags ?? DEFAULT_TAGS\n const attributes = options.attributes ?? DEFAULT_ATTRIBUTES\n const strict = options.strict ?? true\n const qsOptions: queryString.StringifyOptions = { encode: false, ...((options.qs ?? {}) as queryString.StringifyOptions) }\n\n // Use css-select to find all elements matching any of the tag selectors\n const selector = tags.join(', ')\n const elements = selectAll(selector, dom) as Element[]\n\n for (const el of elements) {\n for (const attr of attributes) {\n const value = el.attribs[attr]\n if (!value) continue\n\n const updated = appendParams(value, params, qsOptions, strict)\n if (updated !== value) {\n el.attribs[attr] = updated\n }\n }\n }\n\n return dom\n}\n"],"mappings":";;;;;;;AAOA,MAAM,qBAAqB;CAAC;CAAO;CAAQ;CAAU;CAAU;CAAa;AAC5E,MAAM,eAAe,CAAC,IAAI;;;;AAK1B,SAAS,aACP,KACA,QACA,WACA,QACQ;CACR,IAAI,UAAU,CAAC,cAAc,IAAI,EAAE,OAAO;CAE1C,OAAO,YAAY,aACjB;EAAE;EAAK,OAAO;EAA2C,EACzD,UACD;;;;;;;;;;;;;;;;;;;;;;;;AAyBH,SAAgB,SACd,MACA,SAAkC,EAAE,EACpC,UAA2B,EAAE,EACrB;CACR,OAAO,UAAU,YAAY,MAAM,KAAK,EAAE,QAAQ,QAAQ,CAAC;;;;;;;AAQ7D,SAAgB,YACd,KACA,SAAkC,EAAE,EACpC,UAA2B,EAAE,EAChB;CACb,IAAI,CAAC,UAAU,OAAO,KAAK,OAAO,CAAC,WAAW,GAAG,OAAO;CAExD,MAAM,OAAO,QAAQ,QAAQ;CAC7B,MAAM,aAAa,QAAQ,cAAc;CACzC,MAAM,SAAS,QAAQ,UAAU;CACjC,MAAM,YAA0C;EAAE,QAAQ;EAAO,GAAK,QAAQ,MAAM,EAAE;EAAoC;CAI1H,MAAM,WAAW,UADA,KAAK,KAAK,KACQ,EAAE,IAAI;CAEzC,KAAK,MAAM,MAAM,UACf,KAAK,MAAM,QAAQ,YAAY;EAC7B,MAAM,QAAQ,GAAG,QAAQ;EACzB,IAAI,CAAC,OAAO;EAEZ,MAAM,UAAU,aAAa,OAAO,QAAQ,WAAW,OAAO;EAC9D,IAAI,YAAY,OACd,GAAG,QAAQ,QAAQ;;CAKzB,OAAO"}