@maizzle/framework 6.0.0-8 → 6.0.0-rc.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 (614) hide show
  1. package/bin/maizzle.mjs +10 -0
  2. package/dist/build.d.mts +19 -0
  3. package/dist/build.d.mts.map +1 -0
  4. package/dist/build.mjs +121 -0
  5. package/dist/build.mjs.map +1 -0
  6. package/dist/components/Button.vue +141 -0
  7. package/dist/components/Divider.vue +105 -0
  8. package/dist/components/NoWidows.vue +123 -0
  9. package/dist/components/NotOutlook.vue +17 -0
  10. package/dist/components/Outlook.vue +74 -0
  11. package/dist/components/Spacer.vue +36 -0
  12. package/dist/components/Vml.vue +89 -0
  13. package/dist/components/WithUrl.vue +190 -0
  14. package/dist/components/utils.d.mts +5 -0
  15. package/dist/components/utils.d.mts.map +1 -0
  16. package/dist/components/utils.mjs +9 -0
  17. package/dist/components/utils.mjs.map +1 -0
  18. package/dist/components/utils.ts +6 -0
  19. package/dist/composables/defineConfig.d.mts +14 -0
  20. package/dist/composables/defineConfig.d.mts.map +1 -0
  21. package/dist/composables/defineConfig.mjs +34 -0
  22. package/dist/composables/defineConfig.mjs.map +1 -0
  23. package/dist/composables/renderContext.d.mts +19 -0
  24. package/dist/composables/renderContext.d.mts.map +1 -0
  25. package/dist/composables/renderContext.mjs +6 -0
  26. package/dist/composables/renderContext.mjs.map +1 -0
  27. package/dist/composables/useConfig.d.mts +9 -0
  28. package/dist/composables/useConfig.d.mts.map +1 -0
  29. package/dist/composables/useConfig.mjs +13 -0
  30. package/dist/composables/useConfig.mjs.map +1 -0
  31. package/dist/composables/useDoctype.d.mts +13 -0
  32. package/dist/composables/useDoctype.d.mts.map +1 -0
  33. package/dist/composables/useDoctype.mjs +20 -0
  34. package/dist/composables/useDoctype.mjs.map +1 -0
  35. package/dist/composables/useEvent.d.mts +17 -0
  36. package/dist/composables/useEvent.d.mts.map +1 -0
  37. package/dist/composables/useEvent.mjs +25 -0
  38. package/dist/composables/useEvent.mjs.map +1 -0
  39. package/dist/composables/usePlaintext.d.mts +19 -0
  40. package/dist/composables/usePlaintext.d.mts.map +1 -0
  41. package/dist/composables/usePlaintext.mjs +22 -0
  42. package/dist/composables/usePlaintext.mjs.map +1 -0
  43. package/dist/config/defaults.d.mts +6 -0
  44. package/dist/config/defaults.d.mts.map +1 -0
  45. package/dist/config/defaults.mjs +28 -0
  46. package/dist/config/defaults.mjs.map +1 -0
  47. package/dist/config/index.d.mts +15 -0
  48. package/dist/config/index.d.mts.map +1 -0
  49. package/dist/config/index.mjs +47 -0
  50. package/dist/config/index.mjs.map +1 -0
  51. package/dist/events/index.d.mts +91 -0
  52. package/dist/events/index.d.mts.map +1 -0
  53. package/dist/events/index.mjs +110 -0
  54. package/dist/events/index.mjs.map +1 -0
  55. package/dist/index.d.mts +29 -0
  56. package/dist/index.mjs +29 -0
  57. package/dist/plaintext.d.mts +5 -0
  58. package/dist/plaintext.d.mts.map +1 -0
  59. package/dist/plaintext.mjs +15 -0
  60. package/dist/plaintext.mjs.map +1 -0
  61. package/dist/plugin.d.mts +17 -0
  62. package/dist/plugin.d.mts.map +1 -0
  63. package/dist/plugin.mjs +41 -0
  64. package/dist/plugin.mjs.map +1 -0
  65. package/dist/plugins/postcss/mergeMediaQueries.d.mts +18 -0
  66. package/dist/plugins/postcss/mergeMediaQueries.d.mts.map +1 -0
  67. package/dist/plugins/postcss/mergeMediaQueries.mjs +22 -0
  68. package/dist/plugins/postcss/mergeMediaQueries.mjs.map +1 -0
  69. package/dist/plugins/postcss/pruneVars.d.mts +8 -0
  70. package/dist/plugins/postcss/pruneVars.d.mts.map +1 -0
  71. package/dist/plugins/postcss/pruneVars.mjs +49 -0
  72. package/dist/plugins/postcss/pruneVars.mjs.map +1 -0
  73. package/dist/plugins/postcss/removeDeclarations.d.mts +12 -0
  74. package/dist/plugins/postcss/removeDeclarations.d.mts.map +1 -0
  75. package/dist/plugins/postcss/removeDeclarations.mjs +45 -0
  76. package/dist/plugins/postcss/removeDeclarations.mjs.map +1 -0
  77. package/dist/plugins/postcss/tailwindCleanup.d.mts +18 -0
  78. package/dist/plugins/postcss/tailwindCleanup.d.mts.map +1 -0
  79. package/dist/plugins/postcss/tailwindCleanup.mjs +35 -0
  80. package/dist/plugins/postcss/tailwindCleanup.mjs.map +1 -0
  81. package/dist/render/createRenderer.d.mts +34 -0
  82. package/dist/render/createRenderer.d.mts.map +1 -0
  83. package/dist/render/createRenderer.mjs +149 -0
  84. package/dist/render/createRenderer.mjs.map +1 -0
  85. package/dist/render/index.d.mts +26 -0
  86. package/dist/render/index.d.mts.map +1 -0
  87. package/dist/render/index.mjs +40 -0
  88. package/dist/render/index.mjs.map +1 -0
  89. package/dist/serve.d.mts +25 -0
  90. package/dist/serve.d.mts.map +1 -0
  91. package/dist/serve.mjs +402 -0
  92. package/dist/serve.mjs.map +1 -0
  93. package/dist/server/compatibility.d.mts +6 -0
  94. package/dist/server/compatibility.d.mts.map +1 -0
  95. package/dist/server/compatibility.mjs +83 -0
  96. package/dist/server/compatibility.mjs.map +1 -0
  97. package/dist/server/linter.d.mts +6 -0
  98. package/dist/server/linter.d.mts.map +1 -0
  99. package/dist/server/linter.mjs +200 -0
  100. package/dist/server/linter.mjs.map +1 -0
  101. package/dist/server/ui/App.vue +360 -0
  102. package/dist/server/ui/components/ui/button/Button.vue +31 -0
  103. package/dist/server/ui/components/ui/button/index.ts +38 -0
  104. package/dist/server/ui/components/ui/command/Command.vue +87 -0
  105. package/dist/server/ui/components/ui/command/CommandDialog.vue +31 -0
  106. package/dist/server/ui/components/ui/command/CommandEmpty.vue +27 -0
  107. package/dist/server/ui/components/ui/command/CommandGroup.vue +45 -0
  108. package/dist/server/ui/components/ui/command/CommandInput.vue +39 -0
  109. package/dist/server/ui/components/ui/command/CommandItem.vue +76 -0
  110. package/dist/server/ui/components/ui/command/CommandList.vue +25 -0
  111. package/dist/server/ui/components/ui/command/CommandSeparator.vue +21 -0
  112. package/dist/server/ui/components/ui/command/CommandShortcut.vue +17 -0
  113. package/dist/server/ui/components/ui/command/index.ts +25 -0
  114. package/dist/server/ui/components/ui/dialog/Dialog.vue +19 -0
  115. package/dist/server/ui/components/ui/dialog/DialogClose.vue +15 -0
  116. package/dist/server/ui/components/ui/dialog/DialogContent.vue +53 -0
  117. package/dist/server/ui/components/ui/dialog/DialogDescription.vue +23 -0
  118. package/dist/server/ui/components/ui/dialog/DialogFooter.vue +27 -0
  119. package/dist/server/ui/components/ui/dialog/DialogHeader.vue +17 -0
  120. package/dist/server/ui/components/ui/dialog/DialogOverlay.vue +21 -0
  121. package/dist/server/ui/components/ui/dialog/DialogScrollContent.vue +59 -0
  122. package/dist/server/ui/components/ui/dialog/DialogTitle.vue +23 -0
  123. package/dist/server/ui/components/ui/dialog/DialogTrigger.vue +15 -0
  124. package/dist/server/ui/components/ui/dialog/index.ts +10 -0
  125. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
  126. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -0
  127. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -0
  128. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -0
  129. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -0
  130. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
  131. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
  132. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
  133. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
  134. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
  135. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -0
  136. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
  137. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
  138. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
  139. package/dist/server/ui/components/ui/dropdown-menu/index.ts +16 -0
  140. package/dist/server/ui/components/ui/empty/Empty.vue +20 -0
  141. package/dist/server/ui/components/ui/empty/EmptyContent.vue +20 -0
  142. package/dist/server/ui/components/ui/empty/EmptyDescription.vue +20 -0
  143. package/dist/server/ui/components/ui/empty/EmptyHeader.vue +20 -0
  144. package/dist/server/ui/components/ui/empty/EmptyMedia.vue +21 -0
  145. package/dist/server/ui/components/ui/empty/EmptyTitle.vue +17 -0
  146. package/dist/server/ui/components/ui/empty/index.ts +26 -0
  147. package/dist/server/ui/components/ui/input/Input.vue +33 -0
  148. package/dist/server/ui/components/ui/input/index.ts +1 -0
  149. package/dist/server/ui/components/ui/kbd/Kbd.vue +20 -0
  150. package/dist/server/ui/components/ui/kbd/KbdGroup.vue +17 -0
  151. package/dist/server/ui/components/ui/kbd/index.ts +2 -0
  152. package/dist/server/ui/components/ui/resizable/ResizableHandle.vue +30 -0
  153. package/dist/server/ui/components/ui/resizable/ResizablePanel.vue +21 -0
  154. package/dist/server/ui/components/ui/resizable/ResizablePanelGroup.vue +25 -0
  155. package/dist/server/ui/components/ui/resizable/index.ts +3 -0
  156. package/dist/server/ui/components/ui/scroll-area/ScrollArea.vue +33 -0
  157. package/dist/server/ui/components/ui/scroll-area/ScrollBar.vue +32 -0
  158. package/dist/server/ui/components/ui/scroll-area/index.ts +2 -0
  159. package/dist/server/ui/components/ui/separator/Separator.vue +29 -0
  160. package/dist/server/ui/components/ui/separator/index.ts +1 -0
  161. package/dist/server/ui/components/ui/sheet/Sheet.vue +19 -0
  162. package/dist/server/ui/components/ui/sheet/SheetClose.vue +15 -0
  163. package/dist/server/ui/components/ui/sheet/SheetContent.vue +62 -0
  164. package/dist/server/ui/components/ui/sheet/SheetDescription.vue +21 -0
  165. package/dist/server/ui/components/ui/sheet/SheetFooter.vue +16 -0
  166. package/dist/server/ui/components/ui/sheet/SheetHeader.vue +15 -0
  167. package/dist/server/ui/components/ui/sheet/SheetOverlay.vue +21 -0
  168. package/dist/server/ui/components/ui/sheet/SheetTitle.vue +21 -0
  169. package/dist/server/ui/components/ui/sheet/SheetTrigger.vue +15 -0
  170. package/dist/server/ui/components/ui/sheet/index.ts +8 -0
  171. package/dist/server/ui/components/ui/sidebar/Sidebar.vue +96 -0
  172. package/dist/server/ui/components/ui/sidebar/SidebarContent.vue +18 -0
  173. package/dist/server/ui/components/ui/sidebar/SidebarFooter.vue +18 -0
  174. package/dist/server/ui/components/ui/sidebar/SidebarGroup.vue +18 -0
  175. package/dist/server/ui/components/ui/sidebar/SidebarGroupAction.vue +27 -0
  176. package/dist/server/ui/components/ui/sidebar/SidebarGroupContent.vue +18 -0
  177. package/dist/server/ui/components/ui/sidebar/SidebarGroupLabel.vue +25 -0
  178. package/dist/server/ui/components/ui/sidebar/SidebarHeader.vue +18 -0
  179. package/dist/server/ui/components/ui/sidebar/SidebarInput.vue +31 -0
  180. package/dist/server/ui/components/ui/sidebar/SidebarInset.vue +21 -0
  181. package/dist/server/ui/components/ui/sidebar/SidebarMenu.vue +18 -0
  182. package/dist/server/ui/components/ui/sidebar/SidebarMenuAction.vue +35 -0
  183. package/dist/server/ui/components/ui/sidebar/SidebarMenuBadge.vue +26 -0
  184. package/dist/server/ui/components/ui/sidebar/SidebarMenuButton.vue +48 -0
  185. package/dist/server/ui/components/ui/sidebar/SidebarMenuButtonChild.vue +36 -0
  186. package/dist/server/ui/components/ui/sidebar/SidebarMenuItem.vue +18 -0
  187. package/dist/server/ui/components/ui/sidebar/SidebarMenuSkeleton.vue +35 -0
  188. package/dist/server/ui/components/ui/sidebar/SidebarMenuSub.vue +22 -0
  189. package/dist/server/ui/components/ui/sidebar/SidebarMenuSubButton.vue +36 -0
  190. package/dist/server/ui/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
  191. package/dist/server/ui/components/ui/sidebar/SidebarProvider.vue +82 -0
  192. package/dist/server/ui/components/ui/sidebar/SidebarRail.vue +33 -0
  193. package/dist/server/ui/components/ui/sidebar/SidebarSeparator.vue +19 -0
  194. package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +28 -0
  195. package/dist/server/ui/components/ui/sidebar/index.ts +60 -0
  196. package/dist/server/ui/components/ui/sidebar/utils.ts +19 -0
  197. package/dist/server/ui/components/ui/skeleton/Skeleton.vue +17 -0
  198. package/dist/server/ui/components/ui/skeleton/index.ts +1 -0
  199. package/dist/server/ui/components/ui/tabs/Tabs.vue +24 -0
  200. package/dist/server/ui/components/ui/tabs/TabsContent.vue +21 -0
  201. package/dist/server/ui/components/ui/tabs/TabsList.vue +24 -0
  202. package/dist/server/ui/components/ui/tabs/TabsTrigger.vue +26 -0
  203. package/dist/server/ui/components/ui/tabs/index.ts +4 -0
  204. package/dist/server/ui/components/ui/toggle/Toggle.vue +35 -0
  205. package/dist/server/ui/components/ui/toggle/index.ts +28 -0
  206. package/dist/server/ui/components/ui/toggle-group/ToggleGroup.vue +49 -0
  207. package/dist/server/ui/components/ui/toggle-group/ToggleGroupItem.vue +46 -0
  208. package/dist/server/ui/components/ui/toggle-group/index.ts +2 -0
  209. package/dist/server/ui/components/ui/tooltip/Tooltip.vue +19 -0
  210. package/dist/server/ui/components/ui/tooltip/TooltipContent.vue +34 -0
  211. package/dist/server/ui/components/ui/tooltip/TooltipProvider.vue +14 -0
  212. package/dist/server/ui/components/ui/tooltip/TooltipTrigger.vue +15 -0
  213. package/dist/server/ui/components/ui/tooltip/index.ts +4 -0
  214. package/dist/server/ui/favicon.svg +1 -0
  215. package/dist/server/ui/index.html +13 -0
  216. package/dist/server/ui/lib/utils.ts +7 -0
  217. package/dist/server/ui/logo-gradient.svg +1 -0
  218. package/dist/server/ui/logo.svg +1 -0
  219. package/dist/server/ui/main.css +129 -0
  220. package/dist/server/ui/main.ts +16 -0
  221. package/dist/server/ui/mark-gradient.svg +1 -0
  222. package/dist/server/ui/mark.svg +1 -0
  223. package/dist/server/ui/pages/Home.vue +39 -0
  224. package/dist/server/ui/pages/Preview.vue +609 -0
  225. package/dist/server/ui/stripes.svg +174 -0
  226. package/dist/transformers/addAttributes.d.mts +32 -0
  227. package/dist/transformers/addAttributes.d.mts.map +1 -0
  228. package/dist/transformers/addAttributes.mjs +101 -0
  229. package/dist/transformers/addAttributes.mjs.map +1 -0
  230. package/dist/transformers/attributeToStyle.d.mts +25 -0
  231. package/dist/transformers/attributeToStyle.d.mts.map +1 -0
  232. package/dist/transformers/attributeToStyle.mjs +80 -0
  233. package/dist/transformers/attributeToStyle.mjs.map +1 -0
  234. package/dist/transformers/base.d.mts +8 -0
  235. package/dist/transformers/base.d.mts.map +1 -0
  236. package/dist/transformers/base.mjs +160 -0
  237. package/dist/transformers/base.mjs.map +1 -0
  238. package/dist/transformers/entities.d.mts +8 -0
  239. package/dist/transformers/entities.d.mts.map +1 -0
  240. package/dist/transformers/entities.mjs +38 -0
  241. package/dist/transformers/entities.mjs.map +1 -0
  242. package/dist/transformers/format.d.mts +15 -0
  243. package/dist/transformers/format.d.mts.map +1 -0
  244. package/dist/transformers/format.mjs +26 -0
  245. package/dist/transformers/format.mjs.map +1 -0
  246. package/dist/transformers/index.d.mts +35 -0
  247. package/dist/transformers/index.d.mts.map +1 -0
  248. package/dist/transformers/index.mjs +73 -0
  249. package/dist/transformers/index.mjs.map +1 -0
  250. package/dist/transformers/inlineCSS.d.mts +30 -0
  251. package/dist/transformers/inlineCSS.d.mts.map +1 -0
  252. package/dist/transformers/inlineCSS.mjs +79 -0
  253. package/dist/transformers/inlineCSS.mjs.map +1 -0
  254. package/dist/transformers/inlineLink.d.mts +14 -0
  255. package/dist/transformers/inlineLink.d.mts.map +1 -0
  256. package/dist/transformers/inlineLink.mjs +76 -0
  257. package/dist/transformers/inlineLink.mjs.map +1 -0
  258. package/dist/transformers/minify.d.mts +17 -0
  259. package/dist/transformers/minify.d.mts.map +1 -0
  260. package/dist/transformers/minify.mjs +24 -0
  261. package/dist/transformers/minify.mjs.map +1 -0
  262. package/dist/transformers/purgeCSS.d.mts +23 -0
  263. package/dist/transformers/purgeCSS.d.mts.map +1 -0
  264. package/dist/transformers/purgeCSS.mjs +66 -0
  265. package/dist/transformers/purgeCSS.mjs.map +1 -0
  266. package/dist/transformers/removeAttributes.d.mts +31 -0
  267. package/dist/transformers/removeAttributes.d.mts.map +1 -0
  268. package/dist/transformers/removeAttributes.mjs +63 -0
  269. package/dist/transformers/removeAttributes.mjs.map +1 -0
  270. package/dist/transformers/replaceStrings.d.mts +16 -0
  271. package/dist/transformers/replaceStrings.d.mts.map +1 -0
  272. package/dist/transformers/replaceStrings.mjs +19 -0
  273. package/dist/transformers/replaceStrings.mjs.map +1 -0
  274. package/dist/transformers/safeClassNames.d.mts +22 -0
  275. package/dist/transformers/safeClassNames.d.mts.map +1 -0
  276. package/dist/transformers/safeClassNames.mjs +103 -0
  277. package/dist/transformers/safeClassNames.mjs.map +1 -0
  278. package/dist/transformers/shorthandCSS.d.mts +24 -0
  279. package/dist/transformers/shorthandCSS.d.mts.map +1 -0
  280. package/dist/transformers/shorthandCSS.mjs +48 -0
  281. package/dist/transformers/shorthandCSS.mjs.map +1 -0
  282. package/dist/transformers/tailwindcss.d.mts +20 -0
  283. package/dist/transformers/tailwindcss.d.mts.map +1 -0
  284. package/dist/transformers/tailwindcss.mjs +136 -0
  285. package/dist/transformers/tailwindcss.mjs.map +1 -0
  286. package/dist/transformers/urlQuery.d.mts +24 -0
  287. package/dist/transformers/urlQuery.d.mts.map +1 -0
  288. package/dist/transformers/urlQuery.mjs +65 -0
  289. package/dist/transformers/urlQuery.mjs.map +1 -0
  290. package/dist/types/config.d.mts +129 -0
  291. package/dist/types/config.d.mts.map +1 -0
  292. package/dist/types/config.mjs +1 -0
  293. package/dist/types/index.d.mts +2 -0
  294. package/dist/types/index.mjs +1 -0
  295. package/dist/utils/ast/index.d.mts +4 -0
  296. package/dist/utils/ast/index.mjs +5 -0
  297. package/dist/utils/ast/parser.d.mts +7 -0
  298. package/dist/utils/ast/parser.d.mts.map +1 -0
  299. package/dist/utils/ast/parser.mjs +15 -0
  300. package/dist/utils/ast/parser.mjs.map +1 -0
  301. package/dist/utils/ast/serializer.d.mts +7 -0
  302. package/dist/utils/ast/serializer.d.mts.map +1 -0
  303. package/dist/utils/ast/serializer.mjs +13 -0
  304. package/dist/utils/ast/serializer.mjs.map +1 -0
  305. package/dist/utils/ast/walker.d.mts +7 -0
  306. package/dist/utils/ast/walker.d.mts.map +1 -0
  307. package/dist/utils/ast/walker.mjs +12 -0
  308. package/dist/utils/ast/walker.mjs.map +1 -0
  309. package/dist/utils/url.d.mts +8 -0
  310. package/dist/utils/url.d.mts.map +1 -0
  311. package/dist/utils/url.mjs +32 -0
  312. package/dist/utils/url.mjs.map +1 -0
  313. package/node_modules/@clack/core/CHANGELOG.md +257 -0
  314. package/node_modules/@clack/core/LICENSE +9 -0
  315. package/node_modules/@clack/core/README.md +22 -0
  316. package/node_modules/@clack/core/dist/index.cjs +15 -0
  317. package/node_modules/@clack/core/dist/index.cjs.map +1 -0
  318. package/node_modules/@clack/core/dist/index.d.cts +211 -0
  319. package/node_modules/@clack/core/dist/index.d.mts +211 -0
  320. package/node_modules/@clack/core/dist/index.d.ts +211 -0
  321. package/node_modules/@clack/core/dist/index.mjs +15 -0
  322. package/node_modules/@clack/core/dist/index.mjs.map +1 -0
  323. package/node_modules/@clack/core/package.json +62 -0
  324. package/node_modules/@clack/prompts/CHANGELOG.md +412 -0
  325. package/node_modules/@clack/prompts/LICENSE +9 -0
  326. package/node_modules/@clack/prompts/README.md +207 -0
  327. package/node_modules/@clack/prompts/dist/index.cjs +87 -0
  328. package/node_modules/@clack/prompts/dist/index.cjs.map +1 -0
  329. package/node_modules/@clack/prompts/dist/index.d.cts +165 -0
  330. package/node_modules/@clack/prompts/dist/index.d.mts +165 -0
  331. package/node_modules/@clack/prompts/dist/index.d.ts +165 -0
  332. package/node_modules/@clack/prompts/dist/index.mjs +87 -0
  333. package/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
  334. package/node_modules/@clack/prompts/package.json +61 -0
  335. package/node_modules/@maizzle/cli/LICENSE +21 -0
  336. package/node_modules/@maizzle/cli/README.md +58 -0
  337. package/node_modules/@maizzle/cli/dist/commands/make/component.d.mts +4 -0
  338. package/node_modules/@maizzle/cli/dist/commands/make/component.mjs +31 -0
  339. package/node_modules/@maizzle/cli/dist/commands/make/config.d.mts +4 -0
  340. package/node_modules/@maizzle/cli/dist/commands/make/config.mjs +21 -0
  341. package/node_modules/@maizzle/cli/dist/commands/make/layout.d.mts +4 -0
  342. package/node_modules/@maizzle/cli/dist/commands/make/layout.mjs +31 -0
  343. package/node_modules/@maizzle/cli/dist/commands/make/scaffold.d.mts +5 -0
  344. package/node_modules/@maizzle/cli/dist/commands/make/scaffold.mjs +28 -0
  345. package/node_modules/@maizzle/cli/dist/commands/make/stubs/component.vue +9 -0
  346. package/node_modules/@maizzle/cli/dist/commands/make/stubs/config.ts +9 -0
  347. package/node_modules/@maizzle/cli/dist/commands/make/stubs/layout.vue +39 -0
  348. package/node_modules/@maizzle/cli/dist/commands/make/stubs/template.vue +8 -0
  349. package/node_modules/@maizzle/cli/dist/commands/make/template.d.mts +4 -0
  350. package/node_modules/@maizzle/cli/dist/commands/make/template.mjs +31 -0
  351. package/node_modules/@maizzle/cli/dist/index.d.mts +8 -0
  352. package/node_modules/@maizzle/cli/dist/index.mjs +42 -0
  353. package/node_modules/@maizzle/cli/package.json +59 -0
  354. package/node_modules/citty/LICENSE +36 -0
  355. package/node_modules/citty/README.md +134 -0
  356. package/node_modules/citty/dist/index.cjs +475 -0
  357. package/node_modules/citty/dist/index.d.cts +80 -0
  358. package/node_modules/citty/dist/index.d.mts +80 -0
  359. package/node_modules/citty/dist/index.d.ts +80 -0
  360. package/node_modules/citty/dist/index.mjs +463 -0
  361. package/node_modules/citty/package.json +49 -0
  362. package/node_modules/commander/LICENSE +22 -0
  363. package/node_modules/commander/Readme.md +1149 -0
  364. package/node_modules/commander/esm.mjs +16 -0
  365. package/node_modules/commander/index.js +24 -0
  366. package/node_modules/commander/lib/argument.js +149 -0
  367. package/node_modules/commander/lib/command.js +2662 -0
  368. package/node_modules/commander/lib/error.js +39 -0
  369. package/node_modules/commander/lib/help.js +709 -0
  370. package/node_modules/commander/lib/option.js +367 -0
  371. package/node_modules/commander/lib/suggestSimilar.js +101 -0
  372. package/node_modules/commander/package-support.json +16 -0
  373. package/node_modules/commander/package.json +82 -0
  374. package/node_modules/commander/typings/esm.d.mts +3 -0
  375. package/node_modules/commander/typings/index.d.ts +1045 -0
  376. package/node_modules/consola/LICENSE +47 -0
  377. package/node_modules/consola/README.md +352 -0
  378. package/node_modules/consola/basic.d.ts +1 -0
  379. package/node_modules/consola/browser.d.ts +1 -0
  380. package/node_modules/consola/core.d.ts +1 -0
  381. package/node_modules/consola/dist/basic.cjs +32 -0
  382. package/node_modules/consola/dist/basic.d.cts +23 -0
  383. package/node_modules/consola/dist/basic.d.mts +21 -0
  384. package/node_modules/consola/dist/basic.d.ts +23 -0
  385. package/node_modules/consola/dist/basic.mjs +24 -0
  386. package/node_modules/consola/dist/browser.cjs +84 -0
  387. package/node_modules/consola/dist/browser.d.cts +23 -0
  388. package/node_modules/consola/dist/browser.d.mts +21 -0
  389. package/node_modules/consola/dist/browser.d.ts +23 -0
  390. package/node_modules/consola/dist/browser.mjs +76 -0
  391. package/node_modules/consola/dist/chunks/prompt.cjs +288 -0
  392. package/node_modules/consola/dist/chunks/prompt.mjs +280 -0
  393. package/node_modules/consola/dist/core.cjs +517 -0
  394. package/node_modules/consola/dist/core.d.cts +459 -0
  395. package/node_modules/consola/dist/core.d.mts +459 -0
  396. package/node_modules/consola/dist/core.d.ts +459 -0
  397. package/node_modules/consola/dist/core.mjs +512 -0
  398. package/node_modules/consola/dist/index.cjs +663 -0
  399. package/node_modules/consola/dist/index.d.cts +24 -0
  400. package/node_modules/consola/dist/index.d.mts +22 -0
  401. package/node_modules/consola/dist/index.d.ts +24 -0
  402. package/node_modules/consola/dist/index.mjs +651 -0
  403. package/node_modules/consola/dist/shared/consola.DCGIlDNP.cjs +75 -0
  404. package/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
  405. package/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
  406. package/node_modules/consola/dist/shared/consola.DwRq1yyg.cjs +312 -0
  407. package/node_modules/consola/dist/utils.cjs +64 -0
  408. package/node_modules/consola/dist/utils.d.cts +286 -0
  409. package/node_modules/consola/dist/utils.d.mts +286 -0
  410. package/node_modules/consola/dist/utils.d.ts +286 -0
  411. package/node_modules/consola/dist/utils.mjs +54 -0
  412. package/node_modules/consola/lib/index.cjs +10 -0
  413. package/node_modules/consola/package.json +136 -0
  414. package/node_modules/consola/utils.d.ts +1 -0
  415. package/node_modules/create-maizzle/README.md +86 -0
  416. package/node_modules/create-maizzle/bin/create-maizzle.mjs +4 -0
  417. package/node_modules/create-maizzle/node_modules/@clack/core/CHANGELOG.md +340 -0
  418. package/node_modules/create-maizzle/node_modules/@clack/core/LICENSE +9 -0
  419. package/node_modules/create-maizzle/node_modules/@clack/core/README.md +22 -0
  420. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.d.mts +349 -0
  421. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs +11 -0
  422. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs.map +1 -0
  423. package/node_modules/create-maizzle/node_modules/@clack/core/package.json +60 -0
  424. package/node_modules/create-maizzle/node_modules/@clack/prompts/CHANGELOG.md +576 -0
  425. package/node_modules/create-maizzle/node_modules/@clack/prompts/LICENSE +9 -0
  426. package/node_modules/create-maizzle/node_modules/@clack/prompts/README.md +270 -0
  427. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.d.mts +391 -0
  428. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs +137 -0
  429. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
  430. package/node_modules/create-maizzle/node_modules/@clack/prompts/package.json +65 -0
  431. package/node_modules/create-maizzle/package.json +47 -0
  432. package/node_modules/create-maizzle/src/index.js +242 -0
  433. package/node_modules/defu/LICENSE +21 -0
  434. package/node_modules/defu/README.md +171 -0
  435. package/node_modules/defu/dist/defu.cjs +77 -0
  436. package/node_modules/defu/dist/defu.d.cts +31 -0
  437. package/node_modules/defu/dist/defu.d.mts +29 -0
  438. package/node_modules/defu/dist/defu.d.ts +31 -0
  439. package/node_modules/defu/dist/defu.mjs +69 -0
  440. package/node_modules/defu/lib/defu.cjs +10 -0
  441. package/node_modules/defu/lib/defu.d.cts +12 -0
  442. package/node_modules/defu/package.json +48 -0
  443. package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
  444. package/node_modules/fast-string-truncated-width/dist/index.js +171 -0
  445. package/node_modules/fast-string-truncated-width/dist/types.d.ts +22 -0
  446. package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
  447. package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
  448. package/node_modules/fast-string-truncated-width/dist/utils.js +15 -0
  449. package/node_modules/fast-string-truncated-width/license +21 -0
  450. package/node_modules/fast-string-truncated-width/package.json +35 -0
  451. package/node_modules/fast-string-truncated-width/readme.md +60 -0
  452. package/node_modules/fast-string-width/dist/index.d.ts +4 -0
  453. package/node_modules/fast-string-width/dist/index.js +14 -0
  454. package/node_modules/fast-string-width/license +21 -0
  455. package/node_modules/fast-string-width/package.json +34 -0
  456. package/node_modules/fast-string-width/readme.md +45 -0
  457. package/node_modules/fast-wrap-ansi/LICENSE +23 -0
  458. package/node_modules/fast-wrap-ansi/README.md +26 -0
  459. package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
  460. package/node_modules/fast-wrap-ansi/lib/main.js +216 -0
  461. package/node_modules/fast-wrap-ansi/lib/main.js.map +1 -0
  462. package/node_modules/fast-wrap-ansi/package.json +51 -0
  463. package/node_modules/giget/LICENSE +184 -0
  464. package/node_modules/giget/README.md +248 -0
  465. package/node_modules/giget/dist/cli.mjs +112 -0
  466. package/node_modules/giget/dist/index.d.mts +49 -0
  467. package/node_modules/giget/dist/index.mjs +22 -0
  468. package/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +468 -0
  469. package/node_modules/giget/package.json +62 -0
  470. package/node_modules/node-fetch-native/LICENSE +114 -0
  471. package/node_modules/node-fetch-native/README.md +225 -0
  472. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +2 -0
  473. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +2 -0
  474. package/node_modules/node-fetch-native/dist/index.cjs +1 -0
  475. package/node_modules/node-fetch-native/dist/index.mjs +1 -0
  476. package/node_modules/node-fetch-native/dist/native.cjs +1 -0
  477. package/node_modules/node-fetch-native/dist/native.mjs +1 -0
  478. package/node_modules/node-fetch-native/dist/node.cjs +19 -0
  479. package/node_modules/node-fetch-native/dist/node.mjs +19 -0
  480. package/node_modules/node-fetch-native/dist/polyfill.cjs +1 -0
  481. package/node_modules/node-fetch-native/dist/polyfill.mjs +1 -0
  482. package/node_modules/node-fetch-native/dist/proxy-stub.cjs +1 -0
  483. package/node_modules/node-fetch-native/dist/proxy-stub.mjs +1 -0
  484. package/node_modules/node-fetch-native/dist/proxy.cjs +58 -0
  485. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +1 -0
  486. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +1 -0
  487. package/node_modules/node-fetch-native/index.d.ts +1 -0
  488. package/node_modules/node-fetch-native/lib/empty.cjs +0 -0
  489. package/node_modules/node-fetch-native/lib/empty.mjs +0 -0
  490. package/node_modules/node-fetch-native/lib/index.cjs +11 -0
  491. package/node_modules/node-fetch-native/lib/index.d.cts +10 -0
  492. package/node_modules/node-fetch-native/lib/index.d.mts +10 -0
  493. package/node_modules/node-fetch-native/lib/index.d.ts +10 -0
  494. package/node_modules/node-fetch-native/lib/native.cjs +11 -0
  495. package/node_modules/node-fetch-native/lib/polyfill.d.cts +1 -0
  496. package/node_modules/node-fetch-native/lib/polyfill.d.mts +1 -0
  497. package/node_modules/node-fetch-native/lib/polyfill.d.ts +1 -0
  498. package/node_modules/node-fetch-native/lib/proxy.d.ts +32 -0
  499. package/node_modules/node-fetch-native/node.d.ts +1 -0
  500. package/node_modules/node-fetch-native/package.json +138 -0
  501. package/node_modules/node-fetch-native/polyfill.d.ts +1 -0
  502. package/node_modules/node-fetch-native/proxy.d.ts +1 -0
  503. package/node_modules/nypm/LICENSE +21 -0
  504. package/node_modules/nypm/README.md +152 -0
  505. package/node_modules/nypm/dist/cli.d.mts +1 -0
  506. package/node_modules/nypm/dist/cli.mjs +460 -0
  507. package/node_modules/nypm/dist/index.d.mts +209 -0
  508. package/node_modules/nypm/dist/index.mjs +423 -0
  509. package/node_modules/nypm/node_modules/citty/LICENSE +21 -0
  510. package/node_modules/nypm/node_modules/citty/README.md +231 -0
  511. package/node_modules/nypm/node_modules/citty/dist/THIRD-PARTY-LICENSES.md +33 -0
  512. package/node_modules/nypm/node_modules/citty/dist/_chunks/libs/scule.mjs +70 -0
  513. package/node_modules/nypm/node_modules/citty/dist/index.d.mts +112 -0
  514. package/node_modules/nypm/node_modules/citty/dist/index.mjs +425 -0
  515. package/node_modules/nypm/node_modules/citty/package.json +42 -0
  516. package/node_modules/nypm/package.json +54 -0
  517. package/node_modules/pathe/LICENSE +70 -0
  518. package/node_modules/pathe/README.md +73 -0
  519. package/node_modules/pathe/dist/index.cjs +39 -0
  520. package/node_modules/pathe/dist/index.d.cts +47 -0
  521. package/node_modules/pathe/dist/index.d.mts +47 -0
  522. package/node_modules/pathe/dist/index.d.ts +47 -0
  523. package/node_modules/pathe/dist/index.mjs +19 -0
  524. package/node_modules/pathe/dist/shared/pathe.BSlhyZSM.cjs +266 -0
  525. package/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +249 -0
  526. package/node_modules/pathe/dist/utils.cjs +82 -0
  527. package/node_modules/pathe/dist/utils.d.cts +32 -0
  528. package/node_modules/pathe/dist/utils.d.mts +32 -0
  529. package/node_modules/pathe/dist/utils.d.ts +32 -0
  530. package/node_modules/pathe/dist/utils.mjs +77 -0
  531. package/node_modules/pathe/package.json +61 -0
  532. package/node_modules/pathe/utils.d.ts +1 -0
  533. package/node_modules/picocolors/LICENSE +15 -0
  534. package/node_modules/picocolors/README.md +21 -0
  535. package/node_modules/picocolors/package.json +25 -0
  536. package/node_modules/picocolors/picocolors.browser.js +4 -0
  537. package/node_modules/picocolors/picocolors.d.ts +5 -0
  538. package/node_modules/picocolors/picocolors.js +75 -0
  539. package/node_modules/picocolors/types.d.ts +51 -0
  540. package/node_modules/sisteransi/license +21 -0
  541. package/node_modules/sisteransi/package.json +34 -0
  542. package/node_modules/sisteransi/readme.md +113 -0
  543. package/node_modules/sisteransi/src/index.js +58 -0
  544. package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
  545. package/node_modules/tinyexec/LICENSE +21 -0
  546. package/node_modules/tinyexec/README.md +269 -0
  547. package/node_modules/tinyexec/dist/LICENSES.txt +83 -0
  548. package/node_modules/tinyexec/dist/main.d.mts +71 -0
  549. package/node_modules/tinyexec/dist/main.mjs +642 -0
  550. package/node_modules/tinyexec/package.json +62 -0
  551. package/package.json +74 -74
  552. package/CHANGELOG.md +0 -764
  553. package/bin/maizzle +0 -5
  554. package/src/commands/build.js +0 -348
  555. package/src/commands/serve.js +0 -3
  556. package/src/generators/plaintext.js +0 -222
  557. package/src/generators/render.js +0 -129
  558. package/src/index.js +0 -49
  559. package/src/posthtml/defaultComponentsConfig.js +0 -19
  560. package/src/posthtml/defaultConfig.js +0 -14
  561. package/src/posthtml/index.js +0 -102
  562. package/src/posthtml/plugins/combineMediaQueries.js +0 -42
  563. package/src/posthtml/plugins/envAttributes.js +0 -32
  564. package/src/posthtml/plugins/envTags.js +0 -33
  565. package/src/posthtml/plugins/expandLinkTag.js +0 -59
  566. package/src/posthtml/plugins/postcss/compileCss.js +0 -129
  567. package/src/posthtml/plugins/removeRawStyleAttributes.js +0 -30
  568. package/src/server/client.js +0 -182
  569. package/src/server/index.js +0 -464
  570. package/src/server/routes/hmr.js +0 -26
  571. package/src/server/routes/index.js +0 -77
  572. package/src/server/views/404.html +0 -59
  573. package/src/server/views/error.html +0 -83
  574. package/src/server/views/index.html +0 -172
  575. package/src/server/websockets.js +0 -27
  576. package/src/transformers/addAttributes.js +0 -29
  577. package/src/transformers/attributeToStyle.js +0 -90
  578. package/src/transformers/baseUrl.js +0 -154
  579. package/src/transformers/core.js +0 -32
  580. package/src/transformers/filters/defaultFilters.js +0 -146
  581. package/src/transformers/filters/index.js +0 -18
  582. package/src/transformers/index.js +0 -259
  583. package/src/transformers/inline.js +0 -306
  584. package/src/transformers/markdown.js +0 -26
  585. package/src/transformers/minify.js +0 -27
  586. package/src/transformers/posthtmlMso.js +0 -14
  587. package/src/transformers/prettify.js +0 -29
  588. package/src/transformers/preventWidows.js +0 -37
  589. package/src/transformers/purge.js +0 -56
  590. package/src/transformers/removeAttributes.js +0 -55
  591. package/src/transformers/replaceStrings.js +0 -37
  592. package/src/transformers/safeClassNames.js +0 -29
  593. package/src/transformers/shorthandCss.js +0 -20
  594. package/src/transformers/sixHex.js +0 -30
  595. package/src/transformers/template.js +0 -26
  596. package/src/transformers/urlParameters.js +0 -20
  597. package/src/transformers/useAttributeSizes.js +0 -63
  598. package/src/utils/getConfigByFilePath.js +0 -143
  599. package/src/utils/node.js +0 -68
  600. package/src/utils/string.js +0 -186
  601. package/types/build.d.ts +0 -166
  602. package/types/config.d.ts +0 -638
  603. package/types/css/combineMediaQueries.d.ts +0 -90
  604. package/types/css/inline.d.ts +0 -218
  605. package/types/css/purge.d.ts +0 -125
  606. package/types/events.d.ts +0 -153
  607. package/types/index.d.ts +0 -232
  608. package/types/markdown.d.ts +0 -33
  609. package/types/minify.d.ts +0 -138
  610. package/types/plaintext.d.ts +0 -56
  611. package/types/posthtml.d.ts +0 -162
  612. package/types/render.d.ts +0 -13
  613. package/types/urlParameters.d.ts +0 -40
  614. package/types/widowWords.d.ts +0 -38
@@ -0,0 +1,174 @@
1
+ <svg width="696" height="691" viewBox="0 0 696 691" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <line x1="-1362.38" y1="1221.17" x2="5.61744" y2="-529.787" stroke="#4B5563"/>
3
+ <line x1="-1350.38" y1="1221.17" x2="17.6174" y2="-529.787" stroke="#4B5563"/>
4
+ <line x1="-1338.38" y1="1221.17" x2="29.6174" y2="-529.787" stroke="#4B5563"/>
5
+ <line x1="-1326.38" y1="1221.17" x2="41.6174" y2="-529.787" stroke="#4B5563"/>
6
+ <line x1="-1314.38" y1="1221.17" x2="53.6174" y2="-529.787" stroke="#4B5563"/>
7
+ <line x1="-1302.38" y1="1221.17" x2="65.6174" y2="-529.787" stroke="#4B5563"/>
8
+ <line x1="-1290.38" y1="1221.17" x2="77.6194" y2="-529.787" stroke="#4B5563"/>
9
+ <line x1="-1278.38" y1="1221.17" x2="89.6194" y2="-529.787" stroke="#4B5563"/>
10
+ <line x1="-1266.38" y1="1221.17" x2="101.619" y2="-529.787" stroke="#4B5563"/>
11
+ <line x1="-1254.38" y1="1221.17" x2="113.619" y2="-529.787" stroke="#4B5563"/>
12
+ <line x1="-1242.38" y1="1221.17" x2="125.619" y2="-529.787" stroke="#4B5563"/>
13
+ <line x1="-1230.38" y1="1221.17" x2="137.619" y2="-529.787" stroke="#4B5563"/>
14
+ <line x1="-1218.38" y1="1221.17" x2="149.619" y2="-529.787" stroke="#4B5563"/>
15
+ <line x1="-1206.38" y1="1221.17" x2="161.619" y2="-529.787" stroke="#4B5563"/>
16
+ <line x1="-1194.38" y1="1221.17" x2="173.619" y2="-529.787" stroke="#4B5563"/>
17
+ <line x1="-1182.38" y1="1221.17" x2="185.619" y2="-529.787" stroke="#4B5563"/>
18
+ <line x1="-1170.38" y1="1221.17" x2="197.619" y2="-529.787" stroke="#4B5563"/>
19
+ <line x1="-1158.38" y1="1221.17" x2="209.619" y2="-529.787" stroke="#4B5563"/>
20
+ <line x1="-1146.38" y1="1221.17" x2="221.619" y2="-529.787" stroke="#4B5563"/>
21
+ <line x1="-1134.38" y1="1221.17" x2="233.619" y2="-529.787" stroke="#4B5563"/>
22
+ <line x1="-1122.38" y1="1221.17" x2="245.619" y2="-529.787" stroke="#4B5563"/>
23
+ <line x1="-1110.38" y1="1221.17" x2="257.619" y2="-529.787" stroke="#4B5563"/>
24
+ <line x1="-1098.38" y1="1221.17" x2="269.621" y2="-529.787" stroke="#4B5563"/>
25
+ <line x1="-1086.38" y1="1221.17" x2="281.621" y2="-529.787" stroke="#4B5563"/>
26
+ <line x1="-1074.38" y1="1221.17" x2="293.621" y2="-529.787" stroke="#4B5563"/>
27
+ <line x1="-1062.38" y1="1221.17" x2="305.621" y2="-529.787" stroke="#4B5563"/>
28
+ <line x1="-1050.38" y1="1221.17" x2="317.621" y2="-529.787" stroke="#4B5563"/>
29
+ <line x1="-1038.38" y1="1221.17" x2="329.621" y2="-529.787" stroke="#4B5563"/>
30
+ <line x1="-1026.38" y1="1221.17" x2="341.621" y2="-529.787" stroke="#4B5563"/>
31
+ <line x1="-1014.38" y1="1221.17" x2="353.621" y2="-529.787" stroke="#4B5563"/>
32
+ <line x1="-1002.38" y1="1221.17" x2="365.621" y2="-529.787" stroke="#4B5563"/>
33
+ <line x1="-990.378" y1="1221.17" x2="377.621" y2="-529.787" stroke="#4B5563"/>
34
+ <line x1="-978.378" y1="1221.17" x2="389.621" y2="-529.787" stroke="#4B5563"/>
35
+ <line x1="-966.378" y1="1221.17" x2="401.621" y2="-529.787" stroke="#4B5563"/>
36
+ <line x1="-954.378" y1="1221.17" x2="413.621" y2="-529.787" stroke="#4B5563"/>
37
+ <line x1="-942.378" y1="1221.17" x2="425.621" y2="-529.787" stroke="#4B5563"/>
38
+ <line x1="-930.378" y1="1221.17" x2="437.621" y2="-529.787" stroke="#4B5563"/>
39
+ <line x1="-918.378" y1="1221.17" x2="449.621" y2="-529.787" stroke="#4B5563"/>
40
+ <line x1="-906.378" y1="1221.17" x2="461.621" y2="-529.787" stroke="#4B5563"/>
41
+ <line x1="-894.378" y1="1221.17" x2="473.621" y2="-529.787" stroke="#4B5563"/>
42
+ <line x1="-882.378" y1="1221.17" x2="485.621" y2="-529.787" stroke="#4B5563"/>
43
+ <line x1="-870.378" y1="1221.17" x2="497.621" y2="-529.787" stroke="#4B5563"/>
44
+ <line x1="-858.378" y1="1221.17" x2="509.621" y2="-529.787" stroke="#4B5563"/>
45
+ <line x1="-846.378" y1="1221.17" x2="521.621" y2="-529.787" stroke="#4B5563"/>
46
+ <line x1="-834.378" y1="1221.17" x2="533.621" y2="-529.787" stroke="#4B5563"/>
47
+ <line x1="-822.376" y1="1221.17" x2="545.623" y2="-529.787" stroke="#4B5563"/>
48
+ <line x1="-810.376" y1="1221.17" x2="557.623" y2="-529.787" stroke="#4B5563"/>
49
+ <line x1="-798.376" y1="1221.17" x2="569.623" y2="-529.787" stroke="#4B5563"/>
50
+ <line x1="-786.376" y1="1221.17" x2="581.623" y2="-529.787" stroke="#4B5563"/>
51
+ <line x1="-774.376" y1="1221.17" x2="593.623" y2="-529.787" stroke="#4B5563"/>
52
+ <line x1="-762.376" y1="1221.17" x2="605.623" y2="-529.787" stroke="#4B5563"/>
53
+ <line x1="-750.376" y1="1221.17" x2="617.623" y2="-529.787" stroke="#4B5563"/>
54
+ <line x1="-738.376" y1="1221.17" x2="629.623" y2="-529.787" stroke="#4B5563"/>
55
+ <line x1="-726.378" y1="1221.17" x2="641.621" y2="-529.787" stroke="#4B5563"/>
56
+ <line x1="-714.376" y1="1221.17" x2="653.623" y2="-529.787" stroke="#4B5563"/>
57
+ <line x1="-702.376" y1="1221.17" x2="665.623" y2="-529.787" stroke="#4B5563"/>
58
+ <line x1="-690.376" y1="1221.17" x2="677.623" y2="-529.787" stroke="#4B5563"/>
59
+ <line x1="-678.376" y1="1221.17" x2="689.623" y2="-529.787" stroke="#4B5563"/>
60
+ <line x1="-666.376" y1="1221.17" x2="701.623" y2="-529.787" stroke="#4B5563"/>
61
+ <line x1="-654.376" y1="1221.17" x2="713.623" y2="-529.787" stroke="#4B5563"/>
62
+ <line x1="-642.376" y1="1221.17" x2="725.623" y2="-529.787" stroke="#4B5563"/>
63
+ <line x1="-630.376" y1="1221.17" x2="737.623" y2="-529.787" stroke="#4B5563"/>
64
+ <line x1="-618.376" y1="1221.17" x2="749.623" y2="-529.787" stroke="#4B5563"/>
65
+ <line x1="-606.376" y1="1221.17" x2="761.623" y2="-529.787" stroke="#4B5563"/>
66
+ <line x1="-594.376" y1="1221.17" x2="773.623" y2="-529.787" stroke="#4B5563"/>
67
+ <line x1="-582.376" y1="1221.17" x2="785.623" y2="-529.787" stroke="#4B5563"/>
68
+ <line x1="-570.376" y1="1221.17" x2="797.623" y2="-529.787" stroke="#4B5563"/>
69
+ <line x1="-558.376" y1="1221.17" x2="809.623" y2="-529.787" stroke="#4B5563"/>
70
+ <line x1="-546.376" y1="1221.17" x2="821.623" y2="-529.787" stroke="#4B5563"/>
71
+ <line x1="-534.376" y1="1221.17" x2="833.623" y2="-529.787" stroke="#4B5563"/>
72
+ <line x1="-522.374" y1="1221.17" x2="845.625" y2="-529.787" stroke="#4B5563"/>
73
+ <line x1="-510.374" y1="1221.17" x2="857.625" y2="-529.787" stroke="#4B5563"/>
74
+ <line x1="-498.374" y1="1221.17" x2="869.625" y2="-529.787" stroke="#4B5563"/>
75
+ <line x1="-486.374" y1="1221.17" x2="881.625" y2="-529.787" stroke="#4B5563"/>
76
+ <line x1="-474.374" y1="1221.17" x2="893.625" y2="-529.787" stroke="#4B5563"/>
77
+ <line x1="-462.374" y1="1221.17" x2="905.625" y2="-529.787" stroke="#4B5563"/>
78
+ <line x1="-450.374" y1="1221.17" x2="917.625" y2="-529.787" stroke="#4B5563"/>
79
+ <line x1="-438.374" y1="1221.17" x2="929.625" y2="-529.787" stroke="#4B5563"/>
80
+ <line x1="-426.374" y1="1221.17" x2="941.625" y2="-529.787" stroke="#4B5563"/>
81
+ <line x1="-414.374" y1="1221.17" x2="953.625" y2="-529.787" stroke="#4B5563"/>
82
+ <line x1="-402.374" y1="1221.17" x2="965.625" y2="-529.787" stroke="#4B5563"/>
83
+ <line x1="-390.374" y1="1221.17" x2="977.625" y2="-529.787" stroke="#4B5563"/>
84
+ <line x1="-378.374" y1="1221.17" x2="989.625" y2="-529.787" stroke="#4B5563"/>
85
+ <line x1="-366.374" y1="1221.17" x2="1001.63" y2="-529.787" stroke="#4B5563"/>
86
+ <line x1="-354.374" y1="1221.17" x2="1013.63" y2="-529.787" stroke="#4B5563"/>
87
+ <line x1="-342.374" y1="1221.17" x2="1025.63" y2="-529.787" stroke="#4B5563"/>
88
+ <line x1="-330.374" y1="1221.17" x2="1037.63" y2="-529.787" stroke="#4B5563"/>
89
+ <line x1="-318.374" y1="1221.17" x2="1049.63" y2="-529.787" stroke="#4B5563"/>
90
+ <line x1="-306.374" y1="1221.17" x2="1061.63" y2="-529.787" stroke="#4B5563"/>
91
+ <line x1="-294.374" y1="1221.17" x2="1073.63" y2="-529.787" stroke="#4B5563"/>
92
+ <line x1="-282.374" y1="1221.17" x2="1085.63" y2="-529.787" stroke="#4B5563"/>
93
+ <line x1="-270.374" y1="1221.17" x2="1097.63" y2="-529.787" stroke="#4B5563"/>
94
+ <line x1="-258.374" y1="1221.17" x2="1109.63" y2="-529.787" stroke="#4B5563"/>
95
+ <line x1="-246.374" y1="1221.17" x2="1121.63" y2="-529.787" stroke="#4B5563"/>
96
+ <line x1="-234.374" y1="1221.17" x2="1133.63" y2="-529.787" stroke="#4B5563"/>
97
+ <line x1="-222.374" y1="1221.17" x2="1145.63" y2="-529.787" stroke="#4B5563"/>
98
+ <line x1="-210.374" y1="1221.17" x2="1157.63" y2="-529.787" stroke="#4B5563"/>
99
+ <line x1="-198.374" y1="1221.17" x2="1169.63" y2="-529.787" stroke="#4B5563"/>
100
+ <line x1="-186.374" y1="1221.17" x2="1181.63" y2="-529.787" stroke="#4B5563"/>
101
+ <line x1="-174.374" y1="1221.17" x2="1193.63" y2="-529.787" stroke="#4B5563"/>
102
+ <line x1="-162.374" y1="1221.17" x2="1205.63" y2="-529.787" stroke="#4B5563"/>
103
+ <line x1="-150.374" y1="1221.17" x2="1217.63" y2="-529.787" stroke="#4B5563"/>
104
+ <line x1="-138.374" y1="1221.17" x2="1229.63" y2="-529.787" stroke="#4B5563"/>
105
+ <line x1="-126.374" y1="1221.17" x2="1241.63" y2="-529.787" stroke="#4B5563"/>
106
+ <line x1="-114.374" y1="1221.17" x2="1253.63" y2="-529.787" stroke="#4B5563"/>
107
+ <line x1="-102.374" y1="1221.17" x2="1265.63" y2="-529.787" stroke="#4B5563"/>
108
+ <line x1="-90.3745" y1="1221.17" x2="1277.63" y2="-529.787" stroke="#4B5563"/>
109
+ <line x1="-78.3745" y1="1221.17" x2="1289.63" y2="-529.787" stroke="#4B5563"/>
110
+ <line x1="-66.3745" y1="1221.17" x2="1301.63" y2="-529.787" stroke="#4B5563"/>
111
+ <line x1="-54.3745" y1="1221.17" x2="1313.63" y2="-529.787" stroke="#4B5563"/>
112
+ <line x1="-42.3745" y1="1221.17" x2="1325.63" y2="-529.787" stroke="#4B5563"/>
113
+ <line x1="-30.3745" y1="1221.17" x2="1337.63" y2="-529.787" stroke="#4B5563"/>
114
+ <line x1="-18.3745" y1="1221.17" x2="1349.63" y2="-529.787" stroke="#4B5563"/>
115
+ <line x1="-6.37447" y1="1221.17" x2="1361.63" y2="-529.787" stroke="#4B5563"/>
116
+ <line x1="5.62553" y1="1221.17" x2="1373.63" y2="-529.787" stroke="#4B5563"/>
117
+ <line x1="17.6255" y1="1221.17" x2="1385.63" y2="-529.787" stroke="#4B5563"/>
118
+ <line x1="29.6255" y1="1221.17" x2="1397.63" y2="-529.787" stroke="#4B5563"/>
119
+ <line x1="41.6255" y1="1221.17" x2="1409.63" y2="-529.787" stroke="#4B5563"/>
120
+ <line x1="53.6255" y1="1221.17" x2="1421.63" y2="-529.787" stroke="#4B5563"/>
121
+ <line x1="65.6255" y1="1221.17" x2="1433.63" y2="-529.787" stroke="#4B5563"/>
122
+ <line x1="77.6255" y1="1221.17" x2="1445.63" y2="-529.787" stroke="#4B5563"/>
123
+ <line x1="89.6255" y1="1221.17" x2="1457.63" y2="-529.787" stroke="#4B5563"/>
124
+ <line x1="101.626" y1="1221.17" x2="1469.63" y2="-529.787" stroke="#4B5563"/>
125
+ <line x1="113.626" y1="1221.17" x2="1481.63" y2="-529.787" stroke="#4B5563"/>
126
+ <line x1="125.626" y1="1221.17" x2="1493.63" y2="-529.787" stroke="#4B5563"/>
127
+ <line x1="137.626" y1="1221.17" x2="1505.63" y2="-529.787" stroke="#4B5563"/>
128
+ <line x1="149.626" y1="1221.17" x2="1517.63" y2="-529.787" stroke="#4B5563"/>
129
+ <line x1="161.626" y1="1221.17" x2="1529.63" y2="-529.787" stroke="#4B5563"/>
130
+ <line x1="173.626" y1="1221.17" x2="1541.63" y2="-529.787" stroke="#4B5563"/>
131
+ <line x1="185.626" y1="1221.17" x2="1553.63" y2="-529.787" stroke="#4B5563"/>
132
+ <line x1="197.626" y1="1221.17" x2="1565.63" y2="-529.787" stroke="#4B5563"/>
133
+ <line x1="209.626" y1="1221.17" x2="1577.63" y2="-529.787" stroke="#4B5563"/>
134
+ <line x1="221.626" y1="1221.17" x2="1589.63" y2="-529.787" stroke="#4B5563"/>
135
+ <line x1="233.626" y1="1221.17" x2="1601.63" y2="-529.787" stroke="#4B5563"/>
136
+ <line x1="245.626" y1="1221.17" x2="1613.63" y2="-529.787" stroke="#4B5563"/>
137
+ <line x1="257.626" y1="1221.17" x2="1625.63" y2="-529.787" stroke="#4B5563"/>
138
+ <line x1="269.626" y1="1221.17" x2="1637.63" y2="-529.787" stroke="#4B5563"/>
139
+ <line x1="281.626" y1="1221.17" x2="1649.63" y2="-529.787" stroke="#4B5563"/>
140
+ <line x1="293.626" y1="1221.17" x2="1661.63" y2="-529.787" stroke="#4B5563"/>
141
+ <line x1="305.626" y1="1221.17" x2="1673.63" y2="-529.787" stroke="#4B5563"/>
142
+ <line x1="317.626" y1="1221.17" x2="1685.63" y2="-529.787" stroke="#4B5563"/>
143
+ <line x1="329.626" y1="1221.17" x2="1697.63" y2="-529.787" stroke="#4B5563"/>
144
+ <line x1="341.626" y1="1221.17" x2="1709.63" y2="-529.787" stroke="#4B5563"/>
145
+ <line x1="353.626" y1="1221.17" x2="1721.63" y2="-529.787" stroke="#4B5563"/>
146
+ <line x1="365.626" y1="1221.17" x2="1733.63" y2="-529.787" stroke="#4B5563"/>
147
+ <line x1="377.626" y1="1221.17" x2="1745.63" y2="-529.787" stroke="#4B5563"/>
148
+ <line x1="389.626" y1="1221.17" x2="1757.63" y2="-529.787" stroke="#4B5563"/>
149
+ <line x1="401.626" y1="1221.17" x2="1769.63" y2="-529.787" stroke="#4B5563"/>
150
+ <line x1="413.626" y1="1221.17" x2="1781.63" y2="-529.787" stroke="#4B5563"/>
151
+ <line x1="425.626" y1="1221.17" x2="1793.63" y2="-529.787" stroke="#4B5563"/>
152
+ <line x1="437.626" y1="1221.17" x2="1805.63" y2="-529.787" stroke="#4B5563"/>
153
+ <line x1="449.626" y1="1221.17" x2="1817.63" y2="-529.787" stroke="#4B5563"/>
154
+ <line x1="461.626" y1="1221.17" x2="1829.63" y2="-529.787" stroke="#4B5563"/>
155
+ <line x1="473.626" y1="1221.17" x2="1841.63" y2="-529.787" stroke="#4B5563"/>
156
+ <line x1="485.626" y1="1221.17" x2="1853.63" y2="-529.787" stroke="#4B5563"/>
157
+ <line x1="497.626" y1="1221.17" x2="1865.63" y2="-529.787" stroke="#4B5563"/>
158
+ <line x1="509.626" y1="1221.17" x2="1877.63" y2="-529.787" stroke="#4B5563"/>
159
+ <line x1="521.626" y1="1221.17" x2="1889.63" y2="-529.787" stroke="#4B5563"/>
160
+ <line x1="533.626" y1="1221.17" x2="1901.63" y2="-529.787" stroke="#4B5563"/>
161
+ <line x1="545.626" y1="1221.17" x2="1913.63" y2="-529.787" stroke="#4B5563"/>
162
+ <line x1="557.626" y1="1221.17" x2="1925.63" y2="-529.787" stroke="#4B5563"/>
163
+ <line x1="569.626" y1="1221.17" x2="1937.63" y2="-529.787" stroke="#4B5563"/>
164
+ <line x1="581.626" y1="1221.17" x2="1949.63" y2="-529.787" stroke="#4B5563"/>
165
+ <line x1="593.626" y1="1221.17" x2="1961.63" y2="-529.787" stroke="#4B5563"/>
166
+ <line x1="605.626" y1="1221.17" x2="1973.63" y2="-529.787" stroke="#4B5563"/>
167
+ <line x1="617.626" y1="1221.17" x2="1985.63" y2="-529.787" stroke="#4B5563"/>
168
+ <line x1="629.626" y1="1221.17" x2="1997.63" y2="-529.787" stroke="#4B5563"/>
169
+ <line x1="641.626" y1="1221.17" x2="2009.63" y2="-529.787" stroke="#4B5563"/>
170
+ <line x1="653.626" y1="1221.17" x2="2021.63" y2="-529.787" stroke="#4B5563"/>
171
+ <line x1="665.626" y1="1221.17" x2="2033.63" y2="-529.787" stroke="#4B5563"/>
172
+ <line x1="677.626" y1="1221.17" x2="2045.63" y2="-529.787" stroke="#4B5563"/>
173
+ <line x1="689.626" y1="1221.17" x2="2057.63" y2="-529.787" stroke="#4B5563"/>
174
+ </svg>
@@ -0,0 +1,32 @@
1
+ import { AttributesConfig } from "../types/config.mjs";
2
+ import { ChildNode } from "domhandler";
3
+
4
+ //#region src/transformers/addAttributes.d.ts
5
+ /**
6
+ * Add attributes transformer.
7
+ *
8
+ * Automatically adds attributes to HTML elements based on CSS selectors.
9
+ *
10
+ * Default attributes (can be disabled by setting `attributes.add` to false):
11
+ * - table: cellpadding="0", cellspacing="0", role="none"
12
+ * - img: alt=""
13
+ *
14
+ * Supports tag, class, id, and attribute selectors.
15
+ * Multiple selectors can be specified by comma-separating them.
16
+ *
17
+ * Examples:
18
+ * ```js
19
+ * attributes: {
20
+ * add: {
21
+ * div: { role: 'article' },
22
+ * '.test': { editable: true },
23
+ * '#header': { 'data-id': 'main' },
24
+ * 'div, p': { class: 'content' },
25
+ * }
26
+ * }
27
+ * ```
28
+ */
29
+ declare function addAttributes(dom: ChildNode[], config?: AttributesConfig): ChildNode[];
30
+ //#endregion
31
+ export { addAttributes };
32
+ //# sourceMappingURL=addAttributes.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addAttributes.d.mts","names":[],"sources":["../../src/transformers/addAttributes.ts"],"mappings":";;;;;;AA2CA;;;;;;;;;;;;;;;;;;;;;;iBAAgB,aAAA,CAAc,GAAA,EAAK,SAAA,IAAa,MAAA,GAAQ,gBAAA,GAAwB,SAAA"}
@@ -0,0 +1,101 @@
1
+ import { walk } from "../utils/ast/walker.mjs";
2
+ import "../utils/ast/index.mjs";
3
+ import { defu } from "defu";
4
+
5
+ //#region src/transformers/addAttributes.ts
6
+ /**
7
+ * Default attributes to add to elements.
8
+ */
9
+ const DEFAULT_ATTRIBUTES = {
10
+ table: {
11
+ cellpadding: 0,
12
+ cellspacing: 0,
13
+ role: "none"
14
+ },
15
+ img: { alt: "" }
16
+ };
17
+ /**
18
+ * Add attributes transformer.
19
+ *
20
+ * Automatically adds attributes to HTML elements based on CSS selectors.
21
+ *
22
+ * Default attributes (can be disabled by setting `attributes.add` to false):
23
+ * - table: cellpadding="0", cellspacing="0", role="none"
24
+ * - img: alt=""
25
+ *
26
+ * Supports tag, class, id, and attribute selectors.
27
+ * Multiple selectors can be specified by comma-separating them.
28
+ *
29
+ * Examples:
30
+ * ```js
31
+ * attributes: {
32
+ * add: {
33
+ * div: { role: 'article' },
34
+ * '.test': { editable: true },
35
+ * '#header': { 'data-id': 'main' },
36
+ * 'div, p': { class: 'content' },
37
+ * }
38
+ * }
39
+ * ```
40
+ */
41
+ function addAttributes(dom, config = {}) {
42
+ const addConfig = config.add;
43
+ if (addConfig === false) return dom;
44
+ const attributesToAdd = defu(typeof addConfig === "object" ? addConfig : {}, DEFAULT_ATTRIBUTES);
45
+ if (Object.keys(attributesToAdd).length === 0) return dom;
46
+ for (const [selectorPattern, attributes] of Object.entries(attributesToAdd)) {
47
+ const selectors = selectorPattern.split(",").map((s) => s.trim());
48
+ walk(dom, (node) => {
49
+ const el = node;
50
+ if (!el.name) return;
51
+ if (selectors.some((selector) => elementMatches(el, selector))) {
52
+ if (!el.attribs) el.attribs = {};
53
+ for (const [attrName, attrValue] of Object.entries(attributes)) if (attrName === "class" && el.attribs.class) {
54
+ const existingClasses = el.attribs.class.split(/\s+/).filter(Boolean);
55
+ const newClasses = String(attrValue).split(/\s+/).filter(Boolean);
56
+ const mergedClasses = [...new Set([...existingClasses, ...newClasses])];
57
+ if (mergedClasses.join(" ") !== el.attribs.class) el.attribs.class = mergedClasses.join(" ");
58
+ } else if (!(attrName in el.attribs)) el.attribs[attrName] = String(attrValue);
59
+ }
60
+ });
61
+ }
62
+ return dom;
63
+ }
64
+ /**
65
+ * Check if an element matches a CSS selector.
66
+ * Supports: tag, .class, #id, [attribute], [attribute=value]
67
+ */
68
+ function elementMatches(el, selector) {
69
+ selector = selector.trim();
70
+ const attrMatch = selector.match(/^\[([^\]=]+)(?:=([^\]]*))?\]$/);
71
+ if (attrMatch) {
72
+ const [, attrName, attrValue] = attrMatch;
73
+ if (attrValue === void 0) return attrName in (el.attribs || {});
74
+ else return el.attribs?.[attrName] === attrValue;
75
+ }
76
+ if (selector.startsWith(".")) {
77
+ const className = selector.slice(1);
78
+ return (el.attribs?.class?.split(/\s+/) || []).includes(className);
79
+ }
80
+ if (selector.startsWith("#")) {
81
+ const id = selector.slice(1);
82
+ return el.attribs?.id === id;
83
+ }
84
+ const tagAttrMatch = selector.match(/^([a-z][a-z0-9]*)\[([^\]]+)\]$/i);
85
+ if (tagAttrMatch) {
86
+ const [, tagName, attrPart] = tagAttrMatch;
87
+ if (el.name !== tagName) return false;
88
+ const attrEqMatch = attrPart.match(/^([^=]+)(?:=(.*))?$/);
89
+ if (attrEqMatch) {
90
+ const [, attrName, attrValue] = attrEqMatch;
91
+ if (attrValue === void 0) return attrName in (el.attribs || {});
92
+ else return el.attribs?.[attrName] === attrValue;
93
+ }
94
+ return false;
95
+ }
96
+ return el.name === selector;
97
+ }
98
+
99
+ //#endregion
100
+ export { addAttributes };
101
+ //# sourceMappingURL=addAttributes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addAttributes.mjs","names":["merge"],"sources":["../../src/transformers/addAttributes.ts"],"sourcesContent":["import { defu as merge } from 'defu'\nimport type { ChildNode, Element } from 'domhandler'\nimport { walk } from '../utils/ast/index.ts'\nimport type { AttributesConfig } from '../types/config.ts'\n\n/**\n * Default attributes to add to elements.\n */\nconst DEFAULT_ATTRIBUTES: Record<string, Record<string, string | boolean | number>> = {\n table: {\n cellpadding: 0,\n cellspacing: 0,\n role: 'none',\n },\n img: {\n alt: '',\n },\n}\n\n/**\n * Add attributes transformer.\n *\n * Automatically adds attributes to HTML elements based on CSS selectors.\n *\n * Default attributes (can be disabled by setting `attributes.add` to false):\n * - table: cellpadding=\"0\", cellspacing=\"0\", role=\"none\"\n * - img: alt=\"\"\n *\n * Supports tag, class, id, and attribute selectors.\n * Multiple selectors can be specified by comma-separating them.\n *\n * Examples:\n * ```js\n * attributes: {\n * add: {\n * div: { role: 'article' },\n * '.test': { editable: true },\n * '#header': { 'data-id': 'main' },\n * 'div, p': { class: 'content' },\n * }\n * }\n * ```\n */\nexport function addAttributes(dom: ChildNode[], config: AttributesConfig = {}): ChildNode[] {\n const addConfig = config.add\n\n // Disabled when explicitly set to false\n if (addConfig === false) {\n return dom\n }\n\n // Deep merge user attributes on top of defaults using defu\n const userAttributes = typeof addConfig === 'object' ? addConfig : {}\n const attributesToAdd = merge(userAttributes, DEFAULT_ATTRIBUTES) as Record<string, Record<string, string | boolean | number>>\n\n if (Object.keys(attributesToAdd).length === 0) {\n return dom\n }\n\n // Process each selector pattern\n for (const [selectorPattern, attributes] of Object.entries(attributesToAdd)) {\n // Split by comma for multiple selectors\n const selectors = selectorPattern.split(',').map(s => s.trim())\n\n walk(dom, (node) => {\n const el = node as Element\n if (!el.name) return\n\n // Check if element matches any selector in the pattern\n const matches = selectors.some(selector => elementMatches(el, selector))\n\n if (matches) {\n // Initialize attribs if needed\n if (!el.attribs) {\n el.attribs = {}\n }\n\n for (const [attrName, attrValue] of Object.entries(attributes)) {\n // Special handling for class - merge instead of replace\n if (attrName === 'class' && el.attribs.class) {\n const existingClasses = el.attribs.class.split(/\\s+/).filter(Boolean)\n const newClasses = String(attrValue).split(/\\s+/).filter(Boolean)\n const mergedClasses = [...new Set([...existingClasses, ...newClasses])]\n if (mergedClasses.join(' ') !== el.attribs.class) {\n el.attribs.class = mergedClasses.join(' ')\n }\n } else {\n // Only add attribute if not already present\n if (!(attrName in el.attribs)) {\n el.attribs[attrName] = String(attrValue)\n }\n }\n }\n }\n })\n }\n\n return dom\n}\n\n/**\n * Check if an element matches a CSS selector.\n * Supports: tag, .class, #id, [attribute], [attribute=value]\n */\nfunction elementMatches(el: Element, selector: string): boolean {\n // Remove whitespace\n selector = selector.trim()\n\n // Check for attribute selector [attr] or [attr=value]\n const attrMatch = selector.match(/^\\[([^\\]=]+)(?:=([^\\]]*))?\\]$/)\n if (attrMatch) {\n const [, attrName, attrValue] = attrMatch\n if (attrValue === undefined) {\n // Just checking if attribute exists\n return attrName in (el.attribs || {})\n } else {\n // Check if attribute has specific value\n return el.attribs?.[attrName] === attrValue\n }\n }\n\n // Check for class selector .class\n if (selector.startsWith('.')) {\n const className = selector.slice(1)\n const classes = el.attribs?.class?.split(/\\s+/) || []\n return classes.includes(className)\n }\n\n // Check for id selector #id\n if (selector.startsWith('#')) {\n const id = selector.slice(1)\n return el.attribs?.id === id\n }\n\n // Check for tag selector (possibly with attribute)\n // Split tag from attribute if present, e.g., \"div[role=alert]\"\n const tagAttrMatch = selector.match(/^([a-z][a-z0-9]*)\\[([^\\]]+)\\]$/i)\n if (tagAttrMatch) {\n const [, tagName, attrPart] = tagAttrMatch\n if (el.name !== tagName) return false\n\n // Parse attribute part: could be \"attr\" or \"attr=value\"\n const attrEqMatch = attrPart.match(/^([^=]+)(?:=(.*))?$/)\n if (attrEqMatch) {\n const [, attrName, attrValue] = attrEqMatch\n if (attrValue === undefined) {\n return attrName in (el.attribs || {})\n } else {\n return el.attribs?.[attrName] === attrValue\n }\n }\n return false\n }\n\n // Simple tag selector\n return el.name === selector\n}\n"],"mappings":";;;;;;;;AAQA,MAAM,qBAAgF;CACpF,OAAO;EACL,aAAa;EACb,aAAa;EACb,MAAM;EACP;CACD,KAAK,EACH,KAAK,IACN;CACF;;;;;;;;;;;;;;;;;;;;;;;;;AA0BD,SAAgB,cAAc,KAAkB,SAA2B,EAAE,EAAe;CAC1F,MAAM,YAAY,OAAO;AAGzB,KAAI,cAAc,MAChB,QAAO;CAKT,MAAM,kBAAkBA,KADD,OAAO,cAAc,WAAW,YAAY,EAAE,EACvB,mBAAmB;AAEjE,KAAI,OAAO,KAAK,gBAAgB,CAAC,WAAW,EAC1C,QAAO;AAIT,MAAK,MAAM,CAAC,iBAAiB,eAAe,OAAO,QAAQ,gBAAgB,EAAE;EAE3E,MAAM,YAAY,gBAAgB,MAAM,IAAI,CAAC,KAAI,MAAK,EAAE,MAAM,CAAC;AAE/D,OAAK,MAAM,SAAS;GAClB,MAAM,KAAK;AACX,OAAI,CAAC,GAAG,KAAM;AAKd,OAFgB,UAAU,MAAK,aAAY,eAAe,IAAI,SAAS,CAAC,EAE3D;AAEX,QAAI,CAAC,GAAG,QACN,IAAG,UAAU,EAAE;AAGjB,SAAK,MAAM,CAAC,UAAU,cAAc,OAAO,QAAQ,WAAW,CAE5D,KAAI,aAAa,WAAW,GAAG,QAAQ,OAAO;KAC5C,MAAM,kBAAkB,GAAG,QAAQ,MAAM,MAAM,MAAM,CAAC,OAAO,QAAQ;KACrE,MAAM,aAAa,OAAO,UAAU,CAAC,MAAM,MAAM,CAAC,OAAO,QAAQ;KACjE,MAAM,gBAAgB,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,iBAAiB,GAAG,WAAW,CAAC,CAAC;AACvE,SAAI,cAAc,KAAK,IAAI,KAAK,GAAG,QAAQ,MACzC,IAAG,QAAQ,QAAQ,cAAc,KAAK,IAAI;eAIxC,EAAE,YAAY,GAAG,SACnB,IAAG,QAAQ,YAAY,OAAO,UAAU;;IAKhD;;AAGJ,QAAO;;;;;;AAOT,SAAS,eAAe,IAAa,UAA2B;AAE9D,YAAW,SAAS,MAAM;CAG1B,MAAM,YAAY,SAAS,MAAM,gCAAgC;AACjE,KAAI,WAAW;EACb,MAAM,GAAG,UAAU,aAAa;AAChC,MAAI,cAAc,OAEhB,QAAO,aAAa,GAAG,WAAW,EAAE;MAGpC,QAAO,GAAG,UAAU,cAAc;;AAKtC,KAAI,SAAS,WAAW,IAAI,EAAE;EAC5B,MAAM,YAAY,SAAS,MAAM,EAAE;AAEnC,UADgB,GAAG,SAAS,OAAO,MAAM,MAAM,IAAI,EAAE,EACtC,SAAS,UAAU;;AAIpC,KAAI,SAAS,WAAW,IAAI,EAAE;EAC5B,MAAM,KAAK,SAAS,MAAM,EAAE;AAC5B,SAAO,GAAG,SAAS,OAAO;;CAK5B,MAAM,eAAe,SAAS,MAAM,kCAAkC;AACtE,KAAI,cAAc;EAChB,MAAM,GAAG,SAAS,YAAY;AAC9B,MAAI,GAAG,SAAS,QAAS,QAAO;EAGhC,MAAM,cAAc,SAAS,MAAM,sBAAsB;AACzD,MAAI,aAAa;GACf,MAAM,GAAG,UAAU,aAAa;AAChC,OAAI,cAAc,OAChB,QAAO,aAAa,GAAG,WAAW,EAAE;OAEpC,QAAO,GAAG,UAAU,cAAc;;AAGtC,SAAO;;AAIT,QAAO,GAAG,SAAS"}
@@ -0,0 +1,25 @@
1
+ import { CssConfig } from "../types/config.mjs";
2
+ import { ChildNode } from "domhandler";
3
+
4
+ //#region src/transformers/attributeToStyle.d.ts
5
+ /**
6
+ * Convert HTML attributes to inline CSS styles.
7
+ *
8
+ * Supported attributes:
9
+ * - width: converted to `width: ${value}${unit}` (supports px and %, defaults to px)
10
+ * - height: converted to `height: ${value}${unit}` (supports px and %, defaults to px)
11
+ * - bgcolor: converted to `background-color: ${value}`
12
+ * - background: converted to `background-image: url('${value}')`
13
+ * - align: on `<table>` elements, `left`/`right` become `float`, `center` becomes `margin: 0 auto`;
14
+ * on other elements, becomes `text-align: ${value}`
15
+ * - valign: converted to `vertical-align: ${value}`
16
+ *
17
+ * Enabled via `config.css.inline.attributeToStyle`:
18
+ * - `true`: process all default attributes
19
+ * - `false` or `undefined`: disabled (returns html unchanged)
20
+ * - `string[]`: process only the specified attributes
21
+ */
22
+ declare function attributeToStyle(dom: ChildNode[], config?: CssConfig): ChildNode[];
23
+ //#endregion
24
+ export { attributeToStyle };
25
+ //# sourceMappingURL=attributeToStyle.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributeToStyle.d.mts","names":[],"sources":["../../src/transformers/attributeToStyle.ts"],"mappings":";;;;;;AA0BA;;;;;;;;;;;;;;;iBAAgB,gBAAA,CAAiB,GAAA,EAAK,SAAA,IAAa,MAAA,GAAQ,SAAA,GAAiB,SAAA"}
@@ -0,0 +1,80 @@
1
+ import { walk } from "../utils/ast/walker.mjs";
2
+ import "../utils/ast/index.mjs";
3
+
4
+ //#region src/transformers/attributeToStyle.ts
5
+ /**
6
+ * Default list of attributes that can be converted to inline styles.
7
+ */
8
+ const DEFAULT_ATTRIBUTES = [
9
+ "width",
10
+ "height",
11
+ "bgcolor",
12
+ "background",
13
+ "align",
14
+ "valign"
15
+ ];
16
+ /**
17
+ * Convert HTML attributes to inline CSS styles.
18
+ *
19
+ * Supported attributes:
20
+ * - width: converted to `width: ${value}${unit}` (supports px and %, defaults to px)
21
+ * - height: converted to `height: ${value}${unit}` (supports px and %, defaults to px)
22
+ * - bgcolor: converted to `background-color: ${value}`
23
+ * - background: converted to `background-image: url('${value}')`
24
+ * - align: on `<table>` elements, `left`/`right` become `float`, `center` becomes `margin: 0 auto`;
25
+ * on other elements, becomes `text-align: ${value}`
26
+ * - valign: converted to `vertical-align: ${value}`
27
+ *
28
+ * Enabled via `config.css.inline.attributeToStyle`:
29
+ * - `true`: process all default attributes
30
+ * - `false` or `undefined`: disabled (returns html unchanged)
31
+ * - `string[]`: process only the specified attributes
32
+ */
33
+ function attributeToStyle(dom, config = {}) {
34
+ const inline = config.inline;
35
+ if (typeof inline !== "object" || inline === null) return dom;
36
+ const option = inline.attributeToStyle;
37
+ if (!option) return dom;
38
+ const attributesToProcess = option === true ? DEFAULT_ATTRIBUTES : Array.isArray(option) ? option : [];
39
+ if (attributesToProcess.length === 0) return dom;
40
+ walk(dom, (node) => {
41
+ const el = node;
42
+ if (!("attribs" in el) || !el.attribs) return;
43
+ const styles = [];
44
+ for (const attr of attributesToProcess) {
45
+ const value = el.attribs[attr];
46
+ if (!value) continue;
47
+ const styleValue = convertAttributeToStyle(el.name, attr, value);
48
+ if (styleValue) styles.push(styleValue);
49
+ }
50
+ if (styles.length > 0) {
51
+ const existingStyle = el.attribs.style || "";
52
+ const separator = existingStyle ? "; " : "";
53
+ el.attribs.style = existingStyle + separator + styles.join("; ");
54
+ }
55
+ });
56
+ return dom;
57
+ }
58
+ /**
59
+ * Convert a single HTML attribute value to a CSS style declaration.
60
+ */
61
+ function convertAttributeToStyle(tagName, attr, value) {
62
+ switch (attr) {
63
+ case "width":
64
+ case "height": return `${attr}: ${/^\d+$/.test(value) ? `${value}px` : value}`;
65
+ case "bgcolor": return `background-color: ${value}`;
66
+ case "background": return `background-image: url('${value}')`;
67
+ case "align":
68
+ if (tagName === "table") {
69
+ if (value === "left" || value === "right") return `float: ${value}`;
70
+ if (value === "center") return "margin-left: auto; margin-right: auto";
71
+ }
72
+ return `text-align: ${value}`;
73
+ case "valign": return `vertical-align: ${value}`;
74
+ default: return null;
75
+ }
76
+ }
77
+
78
+ //#endregion
79
+ export { attributeToStyle };
80
+ //# sourceMappingURL=attributeToStyle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributeToStyle.mjs","names":[],"sources":["../../src/transformers/attributeToStyle.ts"],"sourcesContent":["import type { ChildNode, Element } from 'domhandler'\nimport { walk } from '../utils/ast/index.ts'\nimport type { CssConfig } from '../types/config.ts'\n\n/**\n * Default list of attributes that can be converted to inline styles.\n */\nconst DEFAULT_ATTRIBUTES = ['width', 'height', 'bgcolor', 'background', 'align', 'valign']\n\n/**\n * Convert HTML attributes to inline CSS styles.\n *\n * Supported attributes:\n * - width: converted to `width: ${value}${unit}` (supports px and %, defaults to px)\n * - height: converted to `height: ${value}${unit}` (supports px and %, defaults to px)\n * - bgcolor: converted to `background-color: ${value}`\n * - background: converted to `background-image: url('${value}')`\n * - align: on `<table>` elements, `left`/`right` become `float`, `center` becomes `margin: 0 auto`;\n * on other elements, becomes `text-align: ${value}`\n * - valign: converted to `vertical-align: ${value}`\n *\n * Enabled via `config.css.inline.attributeToStyle`:\n * - `true`: process all default attributes\n * - `false` or `undefined`: disabled (returns html unchanged)\n * - `string[]`: process only the specified attributes\n */\nexport function attributeToStyle(dom: ChildNode[], config: CssConfig = {}): ChildNode[] {\n const inline = config.inline\n\n // Disabled when inline is a boolean or undefined\n if (typeof inline !== 'object' || inline === null) {\n return dom\n }\n\n const option = inline.attributeToStyle\n\n // Disabled when not set or explicitly false\n if (!option) {\n return dom\n }\n\n // Determine which attributes to process\n const attributesToProcess: string[] =\n option === true\n ? DEFAULT_ATTRIBUTES\n : Array.isArray(option)\n ? option\n : []\n\n if (attributesToProcess.length === 0) {\n return dom\n }\n\n walk(dom, (node) => {\n const el = node as Element\n\n if (!('attribs' in el) || !el.attribs) {\n return\n }\n\n const styles: string[] = []\n\n for (const attr of attributesToProcess) {\n const value = el.attribs[attr]\n if (!value) continue\n\n const styleValue = convertAttributeToStyle(el.name, attr, value)\n if (styleValue) {\n styles.push(styleValue)\n }\n }\n\n // Append new styles to existing style attribute\n if (styles.length > 0) {\n const existingStyle = el.attribs.style || ''\n const separator = existingStyle ? '; ' : ''\n el.attribs.style = existingStyle + separator + styles.join('; ')\n }\n })\n\n return dom\n}\n\n/**\n * Convert a single HTML attribute value to a CSS style declaration.\n */\nfunction convertAttributeToStyle(\n tagName: string,\n attr: string,\n value: string,\n): string | null {\n switch (attr) {\n case 'width':\n case 'height': {\n // Support px and % values, default to px if no unit\n const normalizedValue = /^\\d+$/.test(value) ? `${value}px` : value\n return `${attr}: ${normalizedValue}`\n }\n\n case 'bgcolor':\n return `background-color: ${value}`\n\n case 'background':\n return `background-image: url('${value}')`\n\n case 'align': {\n // On table elements: left/right -> float, center -> margin auto\n if (tagName === 'table') {\n if (value === 'left' || value === 'right') {\n return `float: ${value}`\n }\n if (value === 'center') {\n return 'margin-left: auto; margin-right: auto'\n }\n }\n // On other elements: text-align\n return `text-align: ${value}`\n }\n\n case 'valign':\n return `vertical-align: ${value}`\n\n default:\n return null\n }\n}\n"],"mappings":";;;;;;;AAOA,MAAM,qBAAqB;CAAC;CAAS;CAAU;CAAW;CAAc;CAAS;CAAS;;;;;;;;;;;;;;;;;;AAmB1F,SAAgB,iBAAiB,KAAkB,SAAoB,EAAE,EAAe;CACtF,MAAM,SAAS,OAAO;AAGtB,KAAI,OAAO,WAAW,YAAY,WAAW,KAC3C,QAAO;CAGT,MAAM,SAAS,OAAO;AAGtB,KAAI,CAAC,OACH,QAAO;CAIT,MAAM,sBACJ,WAAW,OACP,qBACA,MAAM,QAAQ,OAAO,GACnB,SACA,EAAE;AAEV,KAAI,oBAAoB,WAAW,EACjC,QAAO;AAGT,MAAK,MAAM,SAAS;EAClB,MAAM,KAAK;AAEX,MAAI,EAAE,aAAa,OAAO,CAAC,GAAG,QAC5B;EAGF,MAAM,SAAmB,EAAE;AAE3B,OAAK,MAAM,QAAQ,qBAAqB;GACtC,MAAM,QAAQ,GAAG,QAAQ;AACzB,OAAI,CAAC,MAAO;GAEZ,MAAM,aAAa,wBAAwB,GAAG,MAAM,MAAM,MAAM;AAChE,OAAI,WACF,QAAO,KAAK,WAAW;;AAK3B,MAAI,OAAO,SAAS,GAAG;GACrB,MAAM,gBAAgB,GAAG,QAAQ,SAAS;GAC1C,MAAM,YAAY,gBAAgB,OAAO;AACzC,MAAG,QAAQ,QAAQ,gBAAgB,YAAY,OAAO,KAAK,KAAK;;GAElE;AAEF,QAAO;;;;;AAMT,SAAS,wBACP,SACA,MACA,OACe;AACf,SAAQ,MAAR;EACE,KAAK;EACL,KAAK,SAGH,QAAO,GAAG,KAAK,IADS,QAAQ,KAAK,MAAM,GAAG,GAAG,MAAM,MAAM;EAI/D,KAAK,UACH,QAAO,qBAAqB;EAE9B,KAAK,aACH,QAAO,0BAA0B,MAAM;EAEzC,KAAK;AAEH,OAAI,YAAY,SAAS;AACvB,QAAI,UAAU,UAAU,UAAU,QAChC,QAAO,UAAU;AAEnB,QAAI,UAAU,SACZ,QAAO;;AAIX,UAAO,eAAe;EAGxB,KAAK,SACH,QAAO,mBAAmB;EAE5B,QACE,QAAO"}
@@ -0,0 +1,8 @@
1
+ import { UrlConfig } from "../types/config.mjs";
2
+ import { ChildNode } from "domhandler";
3
+
4
+ //#region src/transformers/base.d.ts
5
+ declare function base(dom: ChildNode[], config?: UrlConfig): ChildNode[];
6
+ //#endregion
7
+ export { base };
8
+ //# sourceMappingURL=base.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.mts","names":[],"sources":["../../src/transformers/base.ts"],"mappings":";;;;iBAwHgB,IAAA,CAAK,GAAA,EAAK,SAAA,IAAa,MAAA,GAAQ,SAAA,GAAiB,SAAA"}
@@ -0,0 +1,160 @@
1
+ import { parse } from "../utils/ast/parser.mjs";
2
+ import { walk } from "../utils/ast/walker.mjs";
3
+ import { serialize } from "../utils/ast/serializer.mjs";
4
+ import "../utils/ast/index.mjs";
5
+ import { defaultTags, isAbsoluteUrl, processSrcset } from "../utils/url.mjs";
6
+ import postcss from "postcss";
7
+ import safeParser from "postcss-safe-parser";
8
+ import valueParser from "postcss-value-parser";
9
+
10
+ //#region src/transformers/base.ts
11
+ const sourceAttributes = [
12
+ "src",
13
+ "href",
14
+ "srcset",
15
+ "poster",
16
+ "background",
17
+ "data"
18
+ ];
19
+ /**
20
+ * Convert the shared `defaultTags` (tag → string[]) into the richer format
21
+ * the transformer needs (tag → Record<attr, true>).
22
+ */
23
+ const defaultTagConfig = Object.fromEntries(Object.entries(defaultTags).map(([tag, attrs]) => [tag, Object.fromEntries(attrs.map((attr) => [attr, true]))]));
24
+ const postcssBaseUrl = (opts) => {
25
+ return {
26
+ postcssPlugin: "postcss-base-url",
27
+ Declaration(decl) {
28
+ if (!decl.value.includes("url(")) return;
29
+ const parsed = valueParser(decl.value);
30
+ let changed = false;
31
+ parsed.walk((node) => {
32
+ if (node.type !== "function" || node.value !== "url") return;
33
+ const urlNode = node.nodes[0];
34
+ if (!urlNode) return;
35
+ if (isAbsoluteUrl(urlNode.value)) return;
36
+ urlNode.value = opts.url + urlNode.value;
37
+ changed = true;
38
+ });
39
+ if (changed) decl.value = parsed.toString();
40
+ }
41
+ };
42
+ };
43
+ postcssBaseUrl.postcss = true;
44
+ function processCss(css, url) {
45
+ const { css: result } = postcss([postcssBaseUrl({ url })]).process(css, {
46
+ parser: safeParser,
47
+ from: void 0
48
+ });
49
+ return result;
50
+ }
51
+ function processInlineStyle(style, url) {
52
+ try {
53
+ const { css } = postcss([postcssBaseUrl({ url })]).process(`a{${style}}`, {
54
+ parser: safeParser,
55
+ from: void 0
56
+ });
57
+ return css.match(/a\s*\{\s*([\s\S]*?)\s*\}/)?.[1]?.trim() ?? style;
58
+ } catch {
59
+ return style;
60
+ }
61
+ }
62
+ function getBaseUrl(config) {
63
+ const baseUrlConfig = config.base;
64
+ if (!baseUrlConfig || baseUrlConfig === "") return;
65
+ return baseUrlConfig;
66
+ }
67
+ function resolveOptions(baseUrlConfig) {
68
+ if (!baseUrlConfig) return void 0;
69
+ if (typeof baseUrlConfig === "string") return {
70
+ url: baseUrlConfig,
71
+ styleTag: true,
72
+ inlineCss: true
73
+ };
74
+ if (typeof baseUrlConfig === "object" && "url" in baseUrlConfig) return {
75
+ url: baseUrlConfig.url ?? "",
76
+ tags: baseUrlConfig.tags,
77
+ attributes: baseUrlConfig.attributes,
78
+ styleTag: baseUrlConfig.styleTag ?? true,
79
+ inlineCss: baseUrlConfig.inlineCss ?? true
80
+ };
81
+ }
82
+ function getTagConfig(tagName, options) {
83
+ const { tags } = options;
84
+ if (tags === void 0) return defaultTagConfig[tagName];
85
+ if (Array.isArray(tags)) {
86
+ if (!tags.includes(tagName)) return void 0;
87
+ return defaultTagConfig[tagName];
88
+ }
89
+ if (typeof tags === "object") return tags[tagName];
90
+ }
91
+ function base(dom, config = {}) {
92
+ const options = resolveOptions(getBaseUrl(config));
93
+ if (!options || !options.url) return dom;
94
+ const { url: baseUrl, styleTag = true, inlineCss = true, attributes = {} } = options;
95
+ walk(dom, (node) => {
96
+ const el = node;
97
+ if (!el.name) return;
98
+ if (el.name === "style" && styleTag && el.children) {
99
+ for (const child of el.children) if (child.type === "text") {
100
+ const textNode = child;
101
+ const processed = processCss(textNode.data, baseUrl);
102
+ if (processed !== textNode.data) textNode.data = processed;
103
+ }
104
+ return;
105
+ }
106
+ if (!el.attribs) return;
107
+ const tagConfig = getTagConfig(el.name, options);
108
+ if (tagConfig || options.tags === void 0) for (const [attr, value] of Object.entries(el.attribs)) {
109
+ if (!value) continue;
110
+ const attrConfig = tagConfig?.[attr];
111
+ if (!attrConfig && attr !== "style") continue;
112
+ if (attr === "srcset" && (attrConfig === true || typeof attrConfig === "string")) {
113
+ const newSrcset = processSrcset(value, typeof attrConfig === "string" ? attrConfig : baseUrl);
114
+ if (newSrcset !== value) el.attribs.srcset = newSrcset;
115
+ } else if (attr === "style" && inlineCss && value.includes("url(")) {
116
+ const newStyle = processInlineStyle(value, baseUrl);
117
+ if (newStyle !== value) el.attribs.style = newStyle;
118
+ } else if (attrConfig === true && !isAbsoluteUrl(value)) el.attribs[attr] = baseUrl + value;
119
+ else if (typeof attrConfig === "string" && !isAbsoluteUrl(value)) el.attribs[attr] = attrConfig + value;
120
+ }
121
+ for (const [attr, url] of Object.entries(attributes)) if (el.attribs[attr] && !isAbsoluteUrl(el.attribs[attr])) el.attribs[attr] = url + el.attribs[attr];
122
+ });
123
+ const serialized = serialize(dom);
124
+ const rewritten = rewriteMsoComments(rewriteVMLs(serialized, baseUrl), baseUrl);
125
+ if (rewritten !== serialized) return parse(rewritten);
126
+ return dom;
127
+ }
128
+ function rewriteVMLs(html, url) {
129
+ html = html.replace(/<v:image[^>]+src="?([^"\s]+)"/gi, (match, src) => {
130
+ if (isAbsoluteUrl(src)) return match;
131
+ return match.replace(src, url + src);
132
+ });
133
+ html = html.replace(/<v:fill[^>]+src="?([^"\s]+)"/gi, (match, src) => {
134
+ if (isAbsoluteUrl(src)) return match;
135
+ return match.replace(src, url + src);
136
+ });
137
+ return html;
138
+ }
139
+ function rewriteMsoComments(html, url) {
140
+ return html.replace(/<!--\[if [^\]]+\]>[\s\S]*?<!\[endif\]-->/g, (msoBlock) => {
141
+ let result = msoBlock;
142
+ for (const attr of sourceAttributes) {
143
+ const attrRegex = new RegExp(`\\b${attr}="([^"]+)"`, "gi");
144
+ result = result.replace(attrRegex, (match, value) => {
145
+ if (isAbsoluteUrl(value)) return match;
146
+ if (attr === "srcset") return `srcset="${processSrcset(value, url)}"`;
147
+ return `${attr}="${url}${value}"`;
148
+ });
149
+ }
150
+ result = result.replace(/style="([^"]+)"/gi, (match, style) => {
151
+ if (!style.includes("url(")) return match;
152
+ return `style="${processInlineStyle(style, url)}"`;
153
+ });
154
+ return result;
155
+ });
156
+ }
157
+
158
+ //#endregion
159
+ export { base };
160
+ //# sourceMappingURL=base.mjs.map