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

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 (551) 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.js +163 -0
  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/useCurrentTemplate.d.ts +31 -0
  58. package/dist/composables/useCurrentTemplate.d.ts.map +1 -0
  59. package/dist/composables/useCurrentTemplate.js +35 -0
  60. package/dist/composables/useCurrentTemplate.js.map +1 -0
  61. package/dist/composables/{useDoctype.d.mts → useDoctype.d.ts} +1 -1
  62. package/dist/composables/useDoctype.d.ts.map +1 -0
  63. package/dist/composables/{useDoctype.mjs → useDoctype.js} +3 -4
  64. package/dist/composables/useDoctype.js.map +1 -0
  65. package/dist/composables/{useEvent.d.mts → useEvent.d.ts} +3 -3
  66. package/dist/composables/useEvent.d.ts.map +1 -0
  67. package/dist/composables/{useEvent.mjs → useEvent.js} +4 -5
  68. package/dist/composables/useEvent.js.map +1 -0
  69. package/dist/composables/useFont.d.ts +50 -0
  70. package/dist/composables/useFont.d.ts.map +1 -0
  71. package/dist/composables/useFont.js +92 -0
  72. package/dist/composables/useFont.js.map +1 -0
  73. package/dist/composables/useOutlookFallback.d.ts +21 -0
  74. package/dist/composables/useOutlookFallback.d.ts.map +1 -0
  75. package/dist/composables/useOutlookFallback.js +29 -0
  76. package/dist/composables/useOutlookFallback.js.map +1 -0
  77. package/dist/composables/{usePlaintext.d.mts → usePlaintext.d.ts} +3 -1
  78. package/dist/composables/usePlaintext.d.ts.map +1 -0
  79. package/dist/composables/{usePlaintext.mjs → usePlaintext.js} +4 -4
  80. package/dist/composables/usePlaintext.js.map +1 -0
  81. package/dist/composables/usePreheader.d.ts +24 -0
  82. package/dist/composables/usePreheader.d.ts.map +1 -0
  83. package/dist/composables/usePreheader.js +28 -0
  84. package/dist/composables/usePreheader.js.map +1 -0
  85. package/dist/composables/useTransformers.d.ts +34 -0
  86. package/dist/composables/useTransformers.d.ts.map +1 -0
  87. package/dist/composables/useTransformers.js +48 -0
  88. package/dist/composables/useTransformers.js.map +1 -0
  89. package/dist/composables/useUrlQuery.d.ts +19 -0
  90. package/dist/composables/useUrlQuery.d.ts.map +1 -0
  91. package/dist/composables/useUrlQuery.js +26 -0
  92. package/dist/composables/useUrlQuery.js.map +1 -0
  93. package/dist/config/{defaults.d.mts → defaults.d.ts} +2 -2
  94. package/dist/config/defaults.d.ts.map +1 -0
  95. package/dist/config/{defaults.mjs → defaults.js} +10 -6
  96. package/dist/config/defaults.js.map +1 -0
  97. package/dist/config/{index.d.mts → index.d.ts} +4 -4
  98. package/dist/config/index.d.ts.map +1 -0
  99. package/dist/config/{index.mjs → index.js} +12 -10
  100. package/dist/config/index.js.map +1 -0
  101. package/dist/events/{index.d.mts → index.d.ts} +30 -12
  102. package/dist/events/index.d.ts.map +1 -0
  103. package/dist/events/{index.mjs → index.js} +26 -13
  104. package/dist/events/index.js.map +1 -0
  105. package/dist/index.d.ts +39 -0
  106. package/dist/index.js +38 -0
  107. package/dist/{plaintext.d.mts → plaintext.d.ts} +1 -1
  108. package/dist/plaintext.d.ts.map +1 -0
  109. package/dist/{plaintext.mjs → plaintext.js} +4 -5
  110. package/dist/plaintext.js.map +1 -0
  111. package/dist/{plugin.d.mts → plugin.d.ts} +2 -2
  112. package/dist/plugin.d.ts.map +1 -0
  113. package/dist/plugin.js +57 -0
  114. package/dist/plugin.js.map +1 -0
  115. package/dist/plugins/postcss/{mergeMediaQueries.d.mts → mergeMediaQueries.d.ts} +2 -2
  116. package/dist/plugins/postcss/mergeMediaQueries.d.ts.map +1 -0
  117. package/dist/plugins/postcss/{mergeMediaQueries.mjs → mergeMediaQueries.js} +2 -3
  118. package/dist/plugins/postcss/mergeMediaQueries.js.map +1 -0
  119. package/dist/plugins/postcss/{pruneVars.d.mts → pruneVars.d.ts} +1 -1
  120. package/dist/plugins/postcss/pruneVars.d.ts.map +1 -0
  121. package/dist/plugins/postcss/{pruneVars.mjs → pruneVars.js} +2 -2
  122. package/dist/plugins/postcss/pruneVars.js.map +1 -0
  123. package/dist/plugins/postcss/quoteFontFamilies.d.ts +13 -0
  124. package/dist/plugins/postcss/quoteFontFamilies.d.ts.map +1 -0
  125. package/dist/plugins/postcss/quoteFontFamilies.js +84 -0
  126. package/dist/plugins/postcss/quoteFontFamilies.js.map +1 -0
  127. package/dist/plugins/postcss/{removeDeclarations.d.mts → removeDeclarations.d.ts} +1 -1
  128. package/dist/plugins/postcss/removeDeclarations.d.ts.map +1 -0
  129. package/dist/plugins/postcss/{removeDeclarations.mjs → removeDeclarations.js} +2 -2
  130. package/dist/plugins/postcss/removeDeclarations.js.map +1 -0
  131. package/dist/plugins/postcss/resolveMaizzleImports.d.ts +16 -0
  132. package/dist/plugins/postcss/resolveMaizzleImports.d.ts.map +1 -0
  133. package/dist/plugins/postcss/resolveMaizzleImports.js +39 -0
  134. package/dist/plugins/postcss/resolveMaizzleImports.js.map +1 -0
  135. package/dist/plugins/postcss/resolveProps.d.ts +8 -0
  136. package/dist/plugins/postcss/resolveProps.d.ts.map +1 -0
  137. package/dist/plugins/postcss/resolveProps.js +144 -0
  138. package/dist/plugins/postcss/resolveProps.js.map +1 -0
  139. package/dist/plugins/postcss/{tailwindCleanup.d.mts → tailwindCleanup.d.ts} +2 -2
  140. package/dist/plugins/postcss/tailwindCleanup.d.ts.map +1 -0
  141. package/dist/plugins/postcss/tailwindCleanup.js +68 -0
  142. package/dist/plugins/postcss/tailwindCleanup.js.map +1 -0
  143. package/dist/prepare.d.ts +17 -0
  144. package/dist/prepare.d.ts.map +1 -0
  145. package/dist/prepare.js +44 -0
  146. package/dist/prepare.js.map +1 -0
  147. package/dist/render/active.d.ts +8 -0
  148. package/dist/render/active.d.ts.map +1 -0
  149. package/dist/render/active.js +12 -0
  150. package/dist/render/active.js.map +1 -0
  151. package/dist/render/{createRenderer.d.mts → createRenderer.d.ts} +15 -7
  152. package/dist/render/createRenderer.d.ts.map +1 -0
  153. package/dist/render/createRenderer.js +320 -0
  154. package/dist/render/createRenderer.js.map +1 -0
  155. package/dist/render/index.d.ts +18 -0
  156. package/dist/render/index.d.ts.map +1 -0
  157. package/dist/render/index.js +53 -0
  158. package/dist/render/index.js.map +1 -0
  159. package/dist/render/injectFonts.d.ts +15 -0
  160. package/dist/render/injectFonts.d.ts.map +1 -0
  161. package/dist/render/injectFonts.js +45 -0
  162. package/dist/render/injectFonts.js.map +1 -0
  163. package/dist/render/plugins/codeBlockExtract.d.ts +14 -0
  164. package/dist/render/plugins/codeBlockExtract.d.ts.map +1 -0
  165. package/dist/render/plugins/codeBlockExtract.js +34 -0
  166. package/dist/render/plugins/codeBlockExtract.js.map +1 -0
  167. package/dist/render/plugins/markdownExtract.d.ts +12 -0
  168. package/dist/render/plugins/markdownExtract.d.ts.map +1 -0
  169. package/dist/render/plugins/markdownExtract.js +49 -0
  170. package/dist/render/plugins/markdownExtract.js.map +1 -0
  171. package/dist/render/plugins/rawExtract.d.ts +14 -0
  172. package/dist/render/plugins/rawExtract.d.ts.map +1 -0
  173. package/dist/render/plugins/rawExtract.js +34 -0
  174. package/dist/render/plugins/rawExtract.js.map +1 -0
  175. package/dist/render/plugins/rowSourceLocation.d.ts +18 -0
  176. package/dist/render/plugins/rowSourceLocation.d.ts.map +1 -0
  177. package/dist/render/plugins/rowSourceLocation.js +45 -0
  178. package/dist/render/plugins/rowSourceLocation.js.map +1 -0
  179. package/dist/{serve.d.mts → serve.d.ts} +4 -2
  180. package/dist/serve.d.ts.map +1 -0
  181. package/dist/{serve.mjs → serve.js} +203 -78
  182. package/dist/serve.js.map +1 -0
  183. package/dist/server/compatibility.d.ts +59 -0
  184. package/dist/server/compatibility.d.ts.map +1 -0
  185. package/dist/server/compatibility.js +911 -0
  186. package/dist/server/compatibility.js.map +1 -0
  187. package/dist/server/email.d.ts +17 -0
  188. package/dist/server/email.d.ts.map +1 -0
  189. package/dist/server/email.js +40 -0
  190. package/dist/server/email.js.map +1 -0
  191. package/dist/server/linter.d.ts +20 -0
  192. package/dist/server/linter.d.ts.map +1 -0
  193. package/dist/server/linter.js +339 -0
  194. package/dist/server/linter.js.map +1 -0
  195. package/dist/server/sfc-utils.d.ts +21 -0
  196. package/dist/server/sfc-utils.d.ts.map +1 -0
  197. package/dist/server/sfc-utils.js +198 -0
  198. package/dist/server/sfc-utils.js.map +1 -0
  199. package/dist/server/ui/App.vue +253 -77
  200. package/dist/server/ui/components/SidebarClose.vue +12 -0
  201. package/dist/server/ui/components/ui/checkbox/Checkbox.vue +35 -0
  202. package/dist/server/ui/components/ui/checkbox/index.ts +1 -0
  203. package/dist/server/ui/components/ui/command/Command.vue +5 -1
  204. package/dist/server/ui/components/ui/command/CommandDialog.vue +1 -1
  205. package/dist/server/ui/components/ui/command/CommandInput.vue +19 -1
  206. package/dist/server/ui/components/ui/command/CommandItem.vue +1 -1
  207. package/dist/server/ui/components/ui/command/CommandList.vue +1 -1
  208. package/dist/server/ui/components/ui/command/CommandShortcut.vue +1 -1
  209. package/dist/server/ui/components/ui/dialog/DialogOverlay.vue +9 -1
  210. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuItem.vue +1 -1
  211. package/dist/server/ui/components/ui/input/Input.vue +1 -1
  212. package/dist/server/ui/components/ui/scroll-area/ScrollBar.vue +1 -1
  213. package/dist/server/ui/components/ui/sheet/SheetContent.vue +1 -1
  214. package/dist/server/ui/components/ui/sheet/SheetOverlay.vue +9 -1
  215. package/dist/server/ui/components/ui/sidebar/Sidebar.vue +8 -1
  216. package/dist/server/ui/components/ui/sidebar/SidebarProvider.vue +1 -1
  217. package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +5 -4
  218. package/dist/server/ui/components/ui/tags-input/TagsInput.vue +26 -0
  219. package/dist/server/ui/components/ui/tags-input/TagsInputInput.vue +17 -0
  220. package/dist/server/ui/components/ui/tags-input/TagsInputItem.vue +19 -0
  221. package/dist/server/ui/components/ui/tags-input/TagsInputItemDelete.vue +22 -0
  222. package/dist/server/ui/components/ui/tags-input/TagsInputItemText.vue +17 -0
  223. package/dist/server/ui/components/ui/tags-input/index.ts +5 -0
  224. package/dist/server/ui/components/ui/toggle/index.ts +3 -3
  225. package/dist/server/ui/components/ui/toggle-group/ToggleGroup.vue +1 -1
  226. package/dist/server/ui/components/ui/toggle-group/ToggleGroupItem.vue +2 -2
  227. package/dist/server/ui/lib/emulated-dark-mode.ts +131 -0
  228. package/dist/server/ui/main.css +20 -20
  229. package/dist/server/ui/pages/Home.vue +12 -5
  230. package/dist/server/ui/pages/Preview.vue +716 -276
  231. package/dist/tests/render/_helpers.d.ts +6 -0
  232. package/dist/tests/render/_helpers.d.ts.map +1 -0
  233. package/dist/tests/render/_helpers.js +16 -0
  234. package/dist/tests/render/_helpers.js.map +1 -0
  235. package/dist/transformers/{addAttributes.d.mts → addAttributes.d.ts} +2 -2
  236. package/dist/transformers/addAttributes.d.ts.map +1 -0
  237. package/dist/transformers/{addAttributes.mjs → addAttributes.js} +16 -13
  238. package/dist/transformers/addAttributes.js.map +1 -0
  239. package/dist/transformers/attributeToStyle.d.ts +38 -0
  240. package/dist/transformers/attributeToStyle.d.ts.map +1 -0
  241. package/dist/transformers/attributeToStyle.js +94 -0
  242. package/dist/transformers/attributeToStyle.js.map +1 -0
  243. package/dist/transformers/base.d.ts +71 -0
  244. package/dist/transformers/base.d.ts.map +1 -0
  245. package/dist/transformers/{base.mjs → base.js} +56 -30
  246. package/dist/transformers/base.js.map +1 -0
  247. package/dist/transformers/columnWidth.d.ts +31 -0
  248. package/dist/transformers/columnWidth.d.ts.map +1 -0
  249. package/dist/transformers/columnWidth.js +546 -0
  250. package/dist/transformers/columnWidth.js.map +1 -0
  251. package/dist/transformers/entities.d.ts +37 -0
  252. package/dist/transformers/entities.d.ts.map +1 -0
  253. package/dist/transformers/entities.js +73 -0
  254. package/dist/transformers/entities.js.map +1 -0
  255. package/dist/transformers/filters/defaults.d.ts +6 -0
  256. package/dist/transformers/filters/defaults.d.ts.map +1 -0
  257. package/dist/transformers/filters/defaults.js +78 -0
  258. package/dist/transformers/filters/defaults.js.map +1 -0
  259. package/dist/transformers/filters/index.d.ts +43 -0
  260. package/dist/transformers/filters/index.d.ts.map +1 -0
  261. package/dist/transformers/filters/index.js +89 -0
  262. package/dist/transformers/filters/index.js.map +1 -0
  263. package/dist/transformers/format.d.ts +22 -0
  264. package/dist/transformers/format.d.ts.map +1 -0
  265. package/dist/transformers/format.js +30 -0
  266. package/dist/transformers/format.js.map +1 -0
  267. package/dist/transformers/{index.d.mts → index.d.ts} +14 -11
  268. package/dist/transformers/index.d.ts.map +1 -0
  269. package/dist/transformers/index.js +133 -0
  270. package/dist/transformers/index.js.map +1 -0
  271. package/dist/transformers/inlineCss.d.ts +84 -0
  272. package/dist/transformers/inlineCss.d.ts.map +1 -0
  273. package/dist/transformers/inlineCss.js +91 -0
  274. package/dist/transformers/inlineCss.js.map +1 -0
  275. package/dist/transformers/inlineLink.d.ts +35 -0
  276. package/dist/transformers/inlineLink.d.ts.map +1 -0
  277. package/dist/transformers/{inlineLink.mjs → inlineLink.js} +34 -10
  278. package/dist/transformers/inlineLink.js.map +1 -0
  279. package/dist/transformers/minify.d.ts +21 -0
  280. package/dist/transformers/minify.d.ts.map +1 -0
  281. package/dist/transformers/minify.js +25 -0
  282. package/dist/transformers/minify.js.map +1 -0
  283. package/dist/transformers/msoPlaceholders.d.ts +28 -0
  284. package/dist/transformers/msoPlaceholders.d.ts.map +1 -0
  285. package/dist/transformers/msoPlaceholders.js +88 -0
  286. package/dist/transformers/msoPlaceholders.js.map +1 -0
  287. package/dist/transformers/purgeCss.d.ts +43 -0
  288. package/dist/transformers/purgeCss.d.ts.map +1 -0
  289. package/dist/transformers/purgeCss.js +181 -0
  290. package/dist/transformers/purgeCss.js.map +1 -0
  291. package/dist/transformers/removeAttributes.d.ts +54 -0
  292. package/dist/transformers/removeAttributes.d.ts.map +1 -0
  293. package/dist/transformers/removeAttributes.js +70 -0
  294. package/dist/transformers/removeAttributes.js.map +1 -0
  295. package/dist/transformers/{replaceStrings.d.mts → replaceStrings.d.ts} +2 -2
  296. package/dist/transformers/replaceStrings.d.ts.map +1 -0
  297. package/dist/transformers/{replaceStrings.mjs → replaceStrings.js} +2 -2
  298. package/dist/transformers/replaceStrings.js.map +1 -0
  299. package/dist/transformers/{safeClassNames.d.mts → safeClassNames.d.ts} +2 -2
  300. package/dist/transformers/safeClassNames.d.ts.map +1 -0
  301. package/dist/transformers/{safeClassNames.mjs → safeClassNames.js} +4 -5
  302. package/dist/transformers/safeClassNames.js.map +1 -0
  303. package/dist/transformers/shorthandCss.d.ts +47 -0
  304. package/dist/transformers/shorthandCss.d.ts.map +1 -0
  305. package/dist/transformers/shorthandCss.js +61 -0
  306. package/dist/transformers/shorthandCss.js.map +1 -0
  307. package/dist/transformers/sixHex.d.ts +25 -0
  308. package/dist/transformers/sixHex.d.ts.map +1 -0
  309. package/dist/transformers/sixHex.js +42 -0
  310. package/dist/transformers/sixHex.js.map +1 -0
  311. package/dist/transformers/tailwindComponent.d.ts +16 -0
  312. package/dist/transformers/tailwindComponent.d.ts.map +1 -0
  313. package/dist/transformers/tailwindComponent.js +92 -0
  314. package/dist/transformers/tailwindComponent.js.map +1 -0
  315. package/dist/transformers/{tailwindcss.d.mts → tailwindcss.d.ts} +8 -4
  316. package/dist/transformers/tailwindcss.d.ts.map +1 -0
  317. package/dist/transformers/tailwindcss.js +97 -0
  318. package/dist/transformers/tailwindcss.js.map +1 -0
  319. package/dist/transformers/urlQuery.d.ts +36 -0
  320. package/dist/transformers/urlQuery.d.ts.map +1 -0
  321. package/dist/transformers/urlQuery.js +77 -0
  322. package/dist/transformers/urlQuery.js.map +1 -0
  323. package/dist/types/config.d.ts +737 -0
  324. package/dist/types/config.d.ts.map +1 -0
  325. package/dist/types/config.js +1 -0
  326. package/dist/types/index.d.ts +2 -0
  327. package/dist/types/index.js +1 -0
  328. package/dist/utils/ast/index.d.ts +4 -0
  329. package/dist/utils/ast/index.js +4 -0
  330. package/dist/utils/ast/{parser.d.mts → parser.d.ts} +1 -1
  331. package/dist/utils/ast/parser.d.ts.map +1 -0
  332. package/dist/utils/ast/{parser.mjs → parser.js} +2 -3
  333. package/dist/utils/ast/parser.js.map +1 -0
  334. package/dist/utils/ast/serializer.d.ts +8 -0
  335. package/dist/utils/ast/serializer.d.ts.map +1 -0
  336. package/dist/utils/ast/serializer.js +36 -0
  337. package/dist/utils/ast/serializer.js.map +1 -0
  338. package/dist/utils/ast/{walker.d.mts → walker.d.ts} +1 -1
  339. package/dist/utils/ast/walker.d.ts.map +1 -0
  340. package/dist/utils/ast/{walker.mjs → walker.js} +2 -2
  341. package/dist/utils/ast/walker.js.map +1 -0
  342. package/dist/utils/compileTailwindCss.d.ts +16 -0
  343. package/dist/utils/compileTailwindCss.d.ts.map +1 -0
  344. package/dist/utils/compileTailwindCss.js +54 -0
  345. package/dist/utils/compileTailwindCss.js.map +1 -0
  346. package/dist/utils/componentSources.d.ts +50 -0
  347. package/dist/utils/componentSources.d.ts.map +1 -0
  348. package/dist/utils/componentSources.js +50 -0
  349. package/dist/utils/componentSources.js.map +1 -0
  350. package/dist/utils/decodeStyleEntities.d.ts +15 -0
  351. package/dist/utils/decodeStyleEntities.d.ts.map +1 -0
  352. package/dist/utils/decodeStyleEntities.js +18 -0
  353. package/dist/utils/decodeStyleEntities.js.map +1 -0
  354. package/dist/utils/detect.d.ts +5 -0
  355. package/dist/utils/detect.d.ts.map +1 -0
  356. package/dist/utils/detect.js +10 -0
  357. package/dist/utils/detect.js.map +1 -0
  358. package/dist/utils/output-markers.d.ts +29 -0
  359. package/dist/utils/output-markers.d.ts.map +1 -0
  360. package/dist/utils/output-markers.js +68 -0
  361. package/dist/utils/output-markers.js.map +1 -0
  362. package/dist/utils/{url.d.mts → url.d.ts} +1 -1
  363. package/dist/utils/url.d.ts.map +1 -0
  364. package/dist/utils/{url.mjs → url.js} +2 -3
  365. package/dist/utils/url.js.map +1 -0
  366. package/dist/utils/watchPaths.d.ts +11 -0
  367. package/dist/utils/watchPaths.d.ts.map +1 -0
  368. package/dist/utils/watchPaths.js +19 -0
  369. package/dist/utils/watchPaths.js.map +1 -0
  370. package/node_modules/@clack/core/CHANGELOG.md +8 -0
  371. package/node_modules/@clack/core/dist/index.d.mts +18 -4
  372. package/node_modules/@clack/core/dist/index.mjs +16 -10
  373. package/node_modules/@clack/core/dist/index.mjs.map +1 -1
  374. package/node_modules/@clack/core/package.json +5 -2
  375. package/node_modules/@clack/prompts/CHANGELOG.md +15 -0
  376. package/node_modules/@clack/prompts/README.md +107 -2
  377. package/node_modules/@clack/prompts/dist/index.d.mts +16 -11
  378. package/node_modules/@clack/prompts/dist/index.mjs +114 -107
  379. package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
  380. package/node_modules/@clack/prompts/package.json +7 -4
  381. package/node_modules/fast-string-truncated-width/dist/index.js +36 -96
  382. package/node_modules/fast-string-truncated-width/dist/types.d.ts +0 -3
  383. package/node_modules/fast-string-truncated-width/dist/utils.d.ts +3 -3
  384. package/node_modules/fast-string-truncated-width/dist/utils.js +14 -9
  385. package/node_modules/fast-string-truncated-width/package.json +1 -1
  386. package/node_modules/fast-string-truncated-width/readme.md +2 -3
  387. package/node_modules/fast-string-width/package.json +2 -2
  388. package/node_modules/fast-string-width/readme.md +0 -3
  389. package/node_modules/fast-wrap-ansi/lib/main.js +4 -1
  390. package/node_modules/fast-wrap-ansi/lib/main.js.map +1 -1
  391. package/node_modules/fast-wrap-ansi/package.json +2 -2
  392. package/node_modules/maizzle/README.md +24 -0
  393. package/node_modules/maizzle/dist/commands/make/component.mjs +1 -1
  394. package/node_modules/maizzle/dist/commands/make/config.mjs +1 -1
  395. package/node_modules/maizzle/dist/commands/make/layout.mjs +3 -3
  396. package/node_modules/maizzle/dist/commands/make/scaffold.mjs +1 -1
  397. package/node_modules/maizzle/dist/commands/make/stubs/Layout.vue +146 -0
  398. package/node_modules/maizzle/dist/commands/make/stubs/component.vue +2 -4
  399. package/node_modules/maizzle/dist/commands/make/stubs/config.ts +1 -5
  400. package/node_modules/maizzle/dist/commands/make/template.mjs +1 -1
  401. package/node_modules/maizzle/dist/commands/new.mjs +32 -52
  402. package/node_modules/maizzle/dist/index.d.mts +1 -0
  403. package/node_modules/maizzle/dist/index.mjs +30 -7
  404. package/node_modules/maizzle/package.json +4 -3
  405. package/node_modules/nypm/dist/cli.mjs +28 -5
  406. package/node_modules/nypm/dist/index.d.mts +0 -8
  407. package/node_modules/nypm/dist/index.mjs +27 -4
  408. package/node_modules/nypm/package.json +12 -12
  409. package/node_modules/tinyexec/README.md +1 -1
  410. package/node_modules/tinyexec/dist/main.d.mts +6 -6
  411. package/node_modules/tinyexec/dist/main.mjs +126 -134
  412. package/node_modules/tinyexec/package.json +9 -9
  413. package/package.json +31 -21
  414. package/dist/build.d.mts +0 -19
  415. package/dist/build.d.mts.map +0 -1
  416. package/dist/build.mjs +0 -139
  417. package/dist/build.mjs.map +0 -1
  418. package/dist/components/Divider.vue +0 -105
  419. package/dist/components/Vml.vue +0 -89
  420. package/dist/components/utils.d.mts +0 -5
  421. package/dist/components/utils.d.mts.map +0 -1
  422. package/dist/components/utils.mjs +0 -9
  423. package/dist/components/utils.mjs.map +0 -1
  424. package/dist/composables/defineConfig.d.mts.map +0 -1
  425. package/dist/composables/defineConfig.mjs.map +0 -1
  426. package/dist/composables/renderContext.d.mts +0 -19
  427. package/dist/composables/renderContext.d.mts.map +0 -1
  428. package/dist/composables/renderContext.mjs.map +0 -1
  429. package/dist/composables/useConfig.d.mts.map +0 -1
  430. package/dist/composables/useConfig.mjs.map +0 -1
  431. package/dist/composables/useDoctype.d.mts.map +0 -1
  432. package/dist/composables/useDoctype.mjs.map +0 -1
  433. package/dist/composables/useEvent.d.mts.map +0 -1
  434. package/dist/composables/useEvent.mjs.map +0 -1
  435. package/dist/composables/usePlaintext.d.mts.map +0 -1
  436. package/dist/composables/usePlaintext.mjs.map +0 -1
  437. package/dist/config/defaults.d.mts.map +0 -1
  438. package/dist/config/defaults.mjs.map +0 -1
  439. package/dist/config/index.d.mts.map +0 -1
  440. package/dist/config/index.mjs.map +0 -1
  441. package/dist/events/index.d.mts.map +0 -1
  442. package/dist/events/index.mjs.map +0 -1
  443. package/dist/index.d.mts +0 -29
  444. package/dist/index.mjs +0 -29
  445. package/dist/plaintext.d.mts.map +0 -1
  446. package/dist/plaintext.mjs.map +0 -1
  447. package/dist/plugin.d.mts.map +0 -1
  448. package/dist/plugin.mjs +0 -41
  449. package/dist/plugin.mjs.map +0 -1
  450. package/dist/plugins/postcss/mergeMediaQueries.d.mts.map +0 -1
  451. package/dist/plugins/postcss/mergeMediaQueries.mjs.map +0 -1
  452. package/dist/plugins/postcss/pruneVars.d.mts.map +0 -1
  453. package/dist/plugins/postcss/pruneVars.mjs.map +0 -1
  454. package/dist/plugins/postcss/removeDeclarations.d.mts.map +0 -1
  455. package/dist/plugins/postcss/removeDeclarations.mjs.map +0 -1
  456. package/dist/plugins/postcss/tailwindCleanup.d.mts.map +0 -1
  457. package/dist/plugins/postcss/tailwindCleanup.mjs +0 -35
  458. package/dist/plugins/postcss/tailwindCleanup.mjs.map +0 -1
  459. package/dist/render/createRenderer.d.mts.map +0 -1
  460. package/dist/render/createRenderer.mjs +0 -155
  461. package/dist/render/createRenderer.mjs.map +0 -1
  462. package/dist/render/index.d.mts +0 -26
  463. package/dist/render/index.d.mts.map +0 -1
  464. package/dist/render/index.mjs +0 -44
  465. package/dist/render/index.mjs.map +0 -1
  466. package/dist/serve.d.mts.map +0 -1
  467. package/dist/serve.mjs.map +0 -1
  468. package/dist/server/compatibility.d.mts +0 -6
  469. package/dist/server/compatibility.d.mts.map +0 -1
  470. package/dist/server/compatibility.mjs +0 -83
  471. package/dist/server/compatibility.mjs.map +0 -1
  472. package/dist/server/linter.d.mts +0 -6
  473. package/dist/server/linter.d.mts.map +0 -1
  474. package/dist/server/linter.mjs +0 -200
  475. package/dist/server/linter.mjs.map +0 -1
  476. package/dist/server/ui/components/ui/resizable/ResizableHandle.vue +0 -30
  477. package/dist/server/ui/components/ui/resizable/ResizablePanel.vue +0 -21
  478. package/dist/server/ui/components/ui/resizable/ResizablePanelGroup.vue +0 -25
  479. package/dist/server/ui/components/ui/resizable/index.ts +0 -3
  480. package/dist/transformers/addAttributes.d.mts.map +0 -1
  481. package/dist/transformers/addAttributes.mjs.map +0 -1
  482. package/dist/transformers/attributeToStyle.d.mts +0 -25
  483. package/dist/transformers/attributeToStyle.d.mts.map +0 -1
  484. package/dist/transformers/attributeToStyle.mjs +0 -80
  485. package/dist/transformers/attributeToStyle.mjs.map +0 -1
  486. package/dist/transformers/base.d.mts +0 -8
  487. package/dist/transformers/base.d.mts.map +0 -1
  488. package/dist/transformers/base.mjs.map +0 -1
  489. package/dist/transformers/entities.d.mts +0 -8
  490. package/dist/transformers/entities.d.mts.map +0 -1
  491. package/dist/transformers/entities.mjs +0 -38
  492. package/dist/transformers/entities.mjs.map +0 -1
  493. package/dist/transformers/format.d.mts +0 -15
  494. package/dist/transformers/format.d.mts.map +0 -1
  495. package/dist/transformers/format.mjs +0 -26
  496. package/dist/transformers/format.mjs.map +0 -1
  497. package/dist/transformers/index.d.mts.map +0 -1
  498. package/dist/transformers/index.mjs +0 -73
  499. package/dist/transformers/index.mjs.map +0 -1
  500. package/dist/transformers/inlineCSS.d.mts +0 -30
  501. package/dist/transformers/inlineCSS.d.mts.map +0 -1
  502. package/dist/transformers/inlineCSS.mjs +0 -79
  503. package/dist/transformers/inlineCSS.mjs.map +0 -1
  504. package/dist/transformers/inlineLink.d.mts +0 -14
  505. package/dist/transformers/inlineLink.d.mts.map +0 -1
  506. package/dist/transformers/inlineLink.mjs.map +0 -1
  507. package/dist/transformers/minify.d.mts +0 -17
  508. package/dist/transformers/minify.d.mts.map +0 -1
  509. package/dist/transformers/minify.mjs +0 -24
  510. package/dist/transformers/minify.mjs.map +0 -1
  511. package/dist/transformers/purgeCSS.d.mts +0 -23
  512. package/dist/transformers/purgeCSS.d.mts.map +0 -1
  513. package/dist/transformers/purgeCSS.mjs +0 -66
  514. package/dist/transformers/purgeCSS.mjs.map +0 -1
  515. package/dist/transformers/removeAttributes.d.mts +0 -31
  516. package/dist/transformers/removeAttributes.d.mts.map +0 -1
  517. package/dist/transformers/removeAttributes.mjs +0 -63
  518. package/dist/transformers/removeAttributes.mjs.map +0 -1
  519. package/dist/transformers/replaceStrings.d.mts.map +0 -1
  520. package/dist/transformers/replaceStrings.mjs.map +0 -1
  521. package/dist/transformers/safeClassNames.d.mts.map +0 -1
  522. package/dist/transformers/safeClassNames.mjs.map +0 -1
  523. package/dist/transformers/shorthandCSS.d.mts +0 -24
  524. package/dist/transformers/shorthandCSS.d.mts.map +0 -1
  525. package/dist/transformers/shorthandCSS.mjs +0 -48
  526. package/dist/transformers/shorthandCSS.mjs.map +0 -1
  527. package/dist/transformers/tailwindcss.d.mts.map +0 -1
  528. package/dist/transformers/tailwindcss.mjs +0 -136
  529. package/dist/transformers/tailwindcss.mjs.map +0 -1
  530. package/dist/transformers/urlQuery.d.mts +0 -24
  531. package/dist/transformers/urlQuery.d.mts.map +0 -1
  532. package/dist/transformers/urlQuery.mjs +0 -65
  533. package/dist/transformers/urlQuery.mjs.map +0 -1
  534. package/dist/types/config.d.mts +0 -149
  535. package/dist/types/config.d.mts.map +0 -1
  536. package/dist/types/config.mjs +0 -1
  537. package/dist/types/index.d.mts +0 -2
  538. package/dist/types/index.mjs +0 -1
  539. package/dist/utils/ast/index.d.mts +0 -4
  540. package/dist/utils/ast/index.mjs +0 -5
  541. package/dist/utils/ast/parser.d.mts.map +0 -1
  542. package/dist/utils/ast/parser.mjs.map +0 -1
  543. package/dist/utils/ast/serializer.d.mts +0 -7
  544. package/dist/utils/ast/serializer.d.mts.map +0 -1
  545. package/dist/utils/ast/serializer.mjs +0 -13
  546. package/dist/utils/ast/serializer.mjs.map +0 -1
  547. package/dist/utils/ast/walker.d.mts.map +0 -1
  548. package/dist/utils/ast/walker.mjs.map +0 -1
  549. package/dist/utils/url.d.mts.map +0 -1
  550. package/dist/utils/url.mjs.map +0 -1
  551. package/node_modules/maizzle/dist/commands/make/stubs/layout.vue +0 -39
@@ -0,0 +1,184 @@
1
+ <script lang="ts">
2
+ const warnedLocations = new Set<string>()
3
+ </script>
4
+
5
+ <script setup lang="ts">
6
+ import { Comment, Text, computed, createStaticVNode, provide, useAttrs, useSlots, Fragment } from 'vue'
7
+ import type { VNode } from 'vue'
8
+ import { twMerge } from 'tailwind-merge'
9
+ import Column from './Column.vue'
10
+ import { hasWidthInStyle, hasWidthUtility, normalizeToPixels, outlookFallbackProp } from './utils.ts'
11
+ import { useOutlookFallback } from '../composables/useOutlookFallback'
12
+
13
+ defineOptions({ inheritAttrs: false })
14
+
15
+ const attrs = useAttrs()
16
+
17
+ const props = defineProps({
18
+ /**
19
+ * Explicit row width.
20
+ *
21
+ * Used as the width source for column min-width calculation.
22
+ * When not set, the nearest sized ancestor (`Container`, `Section`,
23
+ * outer `Column`, or this row's own width class/inline style) is
24
+ * used instead.
25
+ */
26
+ width: {
27
+ type: [String, Number],
28
+ default: null
29
+ },
30
+ /**
31
+ * Override the auto-detected column count.
32
+ *
33
+ * By default, the number of direct child elements is used.
34
+ * Set this when the auto-detection doesn't match your layout
35
+ * (e.g. when using `v-if` or `v-for`).
36
+ */
37
+ cols: {
38
+ type: Number,
39
+ default: null
40
+ },
41
+ /**
42
+ * Toggle Outlook (MSO) and VML fallback markup for this
43
+ * component and all descendants.
44
+ *
45
+ * When `false`, skips MSO ghost tables, VML shapes,
46
+ * `xmlns:v`/`xmlns:o` attributes, and mso-specific CSS
47
+ * in all built-in components.
48
+ *
49
+ * @default true
50
+ */
51
+ outlookFallback: outlookFallbackProp,
52
+ })
53
+
54
+ const outlookFallback = useOutlookFallback(props.outlookFallback)
55
+
56
+ const slots = useSlots()
57
+
58
+ function countChildren(vnodes: VNode[]): number {
59
+ let count = 0
60
+
61
+ for (const vnode of vnodes) {
62
+ if (vnode.type === Fragment && Array.isArray(vnode.children)) {
63
+ count += countChildren(vnode.children as VNode[])
64
+ } else if (vnode.type !== Comment && typeof vnode.type !== 'symbol') {
65
+ count++
66
+ }
67
+ }
68
+
69
+ return count
70
+ }
71
+
72
+ function hasColumnChild(vnodes: VNode[]): boolean {
73
+ for (const vnode of vnodes) {
74
+ if (vnode.type === Fragment && Array.isArray(vnode.children)) {
75
+ if (hasColumnChild(vnode.children as VNode[])) return true
76
+ } else if (vnode.type === Column) {
77
+ return true
78
+ } else if (
79
+ typeof vnode.type === 'object'
80
+ && vnode.type !== null
81
+ && '__name' in vnode.type
82
+ && (vnode.type as { __name?: string }).__name === 'Column'
83
+ ) {
84
+ return true
85
+ }
86
+ }
87
+ return false
88
+ }
89
+
90
+ function hasMeaningfulContent(vnodes: VNode[]): boolean {
91
+ for (const vnode of vnodes) {
92
+ if (vnode.type === Comment) continue
93
+ if (vnode.type === Fragment && Array.isArray(vnode.children)) {
94
+ if (hasMeaningfulContent(vnode.children as VNode[])) return true
95
+ continue
96
+ }
97
+ if (vnode.type === Text) {
98
+ if (typeof vnode.children === 'string' && vnode.children.trim()) return true
99
+ continue
100
+ }
101
+ if (typeof vnode.type === 'symbol') continue
102
+ return true
103
+ }
104
+ return false
105
+ }
106
+
107
+ const columnCount = computed(() => {
108
+ if (props.cols) return props.cols
109
+
110
+ const children = slots.default?.() ?? []
111
+ return countChildren(children) || 1
112
+ })
113
+
114
+ provide('columnCount', columnCount)
115
+
116
+ const userStyle = computed(() => {
117
+ const s = attrs.style
118
+ if (!s) return ''
119
+ return typeof s === 'object'
120
+ ? Object.entries(s).map(([k, v]) => `${k.replace(/([A-Z])/g, '-$1').toLowerCase()}: ${v}`).join('; ')
121
+ : String(s)
122
+ })
123
+
124
+ const userHasWidth = computed(() => {
125
+ const cls = (attrs.class as string) ?? ''
126
+ return hasWidthUtility(cls) || hasWidthInStyle(userStyle.value)
127
+ })
128
+
129
+ const colWidthSource = computed(() => {
130
+ if (props.width != null) return normalizeToPixels(props.width)
131
+ if (userHasWidth.value) return ''
132
+ return null
133
+ })
134
+
135
+ const restAttrs = computed(() => {
136
+ const { style: _, class: __, 'data-maizzle-loc': ___, ...rest } = attrs
137
+ return rest
138
+ })
139
+
140
+ /**
141
+ * `font-size: 0;` removes the whitespace gap between inline-block
142
+ * children. Lives in a class so users can override (e.g. via a custom
143
+ * `text-*`) and twMerge resolves the conflict cleanly instead of the
144
+ * inline declaration silently shadowing the user's class.
145
+ */
146
+ const baseClass = 'text-0'
147
+ const mergedClass = computed(() => twMerge(baseClass, (attrs.class as string) ?? ''))
148
+
149
+ const divStyle = computed(() => userStyle.value || undefined)
150
+
151
+ const MsoBefore = () => createStaticVNode(
152
+ '<!--[if mso]><table role="none" cellpadding="0" cellspacing="0" style="width: 100%"><tr><![endif]-->',
153
+ 1
154
+ )
155
+
156
+ const MsoAfter = () => createStaticVNode(
157
+ '<!--[if mso]></tr></table><![endif]-->',
158
+ 1
159
+ )
160
+
161
+ const initialChildren = slots.default?.() ?? []
162
+ if (hasMeaningfulContent(initialChildren) && !hasColumnChild(initialChildren)) {
163
+ const loc = (attrs['data-maizzle-loc'] as string | undefined) ?? '<unknown location>'
164
+ if (!warnedLocations.has(loc)) {
165
+ warnedLocations.add(loc)
166
+ const display = loc.split('/').pop() ?? loc
167
+ const suffix = outlookFallback ? ' Layout will break in Outlook.' : ''
168
+ console.warn(`[maizzle] <Row> in ${display} has no <Column> inside it.${suffix}`)
169
+ }
170
+ }
171
+ </script>
172
+
173
+ <template>
174
+ <MsoBefore v-if="outlookFallback" />
175
+ <div
176
+ v-bind="restAttrs"
177
+ :class="mergedClass"
178
+ :style="divStyle"
179
+ :data-maizzle-cw="colWidthSource"
180
+ >
181
+ <slot />
182
+ </div>
183
+ <MsoAfter v-if="outlookFallback" />
184
+ </template>
@@ -0,0 +1,124 @@
1
+ <script setup lang="ts">
2
+ import { computed, createStaticVNode, useAttrs } from 'vue'
3
+ import { hasWidthInStyle, hasWidthUtility, nextId, normalizeToPixels, outlookFallbackProp } from './utils.ts'
4
+ import { useOutlookFallback } from '../composables/useOutlookFallback'
5
+
6
+ defineOptions({ inheritAttrs: false })
7
+
8
+ const attrs = useAttrs()
9
+
10
+ const props = defineProps({
11
+ /**
12
+ * Width of the section.
13
+ *
14
+ * Applied as `max-width` on the div and as `width` on the MSO table.
15
+ *
16
+ * When not set, the MSO table width is auto-derived from a width
17
+ * utility class (e.g. `max-w-md`) or inline style (`max-width`/
18
+ * `width`) on the component, after CSS inlining. Falls back to
19
+ * `100%` when no width source is provided.
20
+ */
21
+ width: {
22
+ type: [String, Number],
23
+ default: null
24
+ },
25
+ /**
26
+ * Inline CSS applied only to the MSO `<td>` element.
27
+ *
28
+ * Use for Outlook-specific styling that shouldn't affect other clients.
29
+ *
30
+ * @example 'padding: 10px 20px'
31
+ */
32
+ msoStyle: {
33
+ type: String,
34
+ default: undefined
35
+ },
36
+ /**
37
+ * Toggle Outlook (MSO) and VML fallback markup for this
38
+ * component and all descendants.
39
+ *
40
+ * When `false`, skips MSO ghost tables, VML shapes,
41
+ * `xmlns:v`/`xmlns:o` attributes, and mso-specific CSS
42
+ * in all built-in components.
43
+ *
44
+ * @default true
45
+ */
46
+ outlookFallback: outlookFallbackProp,
47
+ })
48
+
49
+ const outlookFallback = useOutlookFallback(props.outlookFallback)
50
+
51
+ const userStyle = computed(() => {
52
+ const s = attrs.style
53
+ if (!s) return ''
54
+ return typeof s === 'object'
55
+ ? Object.entries(s).map(([k, v]) => `${k.replace(/([A-Z])/g, '-$1').toLowerCase()}: ${v}`).join('; ')
56
+ : String(s)
57
+ })
58
+
59
+ const userHasWidth = computed(() => {
60
+ const cls = (attrs.class as string) ?? ''
61
+ return hasWidthUtility(cls) || hasWidthInStyle(userStyle.value)
62
+ })
63
+
64
+ const useMarker = outlookFallback && props.width == null && userHasWidth.value
65
+ const msoId = useMarker ? nextId('s') : null
66
+
67
+ const divStyle = computed(() => {
68
+ const parts: string[] = []
69
+ if (props.width != null) parts.push(`max-width: ${normalizeToPixels(props.width)}`)
70
+ if (userStyle.value) parts.push(userStyle.value)
71
+ return parts.length ? parts.join('; ') : undefined
72
+ })
73
+
74
+ const restAttrs = computed(() => {
75
+ const { style: _, ...rest } = attrs
76
+ return rest
77
+ })
78
+
79
+ const tdStyles = computed(() => {
80
+ const parts: string[] = []
81
+ if (userStyle.value) parts.push(userStyle.value)
82
+ if (props.msoStyle) parts.push(props.msoStyle)
83
+ return parts.length ? parts.join('; ') : ''
84
+ })
85
+
86
+ const msoWidth = computed(() => {
87
+ if (props.width != null) return normalizeToPixels(props.width)
88
+ if (useMarker) return `__MAIZZLE_MSOW_${msoId}__`
89
+ return '100%'
90
+ })
91
+
92
+ const colWidthSource = computed(() => {
93
+ if (props.width != null) return normalizeToPixels(props.width)
94
+ if (userHasWidth.value) return ''
95
+ return null
96
+ })
97
+
98
+ const MsoBefore = () => {
99
+ const tdStyle = tdStyles.value ? ` style="${tdStyles.value}"` : ''
100
+ return createStaticVNode(
101
+ `<!--[if mso]><table role="none" cellpadding="0" cellspacing="0" style="width: ${msoWidth.value}"><tr><td${tdStyle}><![endif]-->`,
102
+ 1
103
+ )
104
+ }
105
+
106
+ const MsoAfter = () => createStaticVNode(
107
+ '<!--[if mso]></td></tr></table><![endif]-->',
108
+ 1
109
+ )
110
+ </script>
111
+
112
+ <template>
113
+ <MsoBefore v-if="outlookFallback" />
114
+ <div
115
+ v-bind="restAttrs"
116
+ :style="divStyle"
117
+ :data-maizzle-msow-id="msoId"
118
+ :data-maizzle-msow-fallback="useMarker ? '100%' : null"
119
+ :data-maizzle-cw="colWidthSource"
120
+ >
121
+ <slot />
122
+ </div>
123
+ <MsoAfter v-if="outlookFallback" />
124
+ </template>
@@ -1,36 +1,85 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue'
3
- import { normalizeToPixels } from './utils.ts'
2
+ import { computed, h, useAttrs } from 'vue'
3
+ import { normalizeToPixels, outlookFallbackProp } from './utils.ts'
4
+ import { useOutlookFallback } from '../composables/useOutlookFallback'
5
+
6
+ defineOptions({ inheritAttrs: false })
4
7
 
5
8
  const props = defineProps({
6
- /** The height of the spacer. */
7
- size: {
8
- type: [String, Number],
9
- default: null
9
+ /** The type of spacer. */
10
+ type: {
11
+ type: String as () => 'vertical' | 'horizontal',
12
+ default: 'vertical'
10
13
  },
11
- /** The alternative height to use in Outlook. */
12
- msoHeight: {
14
+ /** The width of the spacer (horizontal). */
15
+ width: {
13
16
  type: [String, Number],
14
- default: null
15
- }
17
+ default: 16
18
+ },
19
+ outlookFallback: outlookFallbackProp,
16
20
  })
17
21
 
18
- const styles = computed(() => {
19
- const s = []
22
+ const attrs = useAttrs()
23
+ const outlookFallback = useOutlookFallback(props.outlookFallback)
24
+
25
+ const HEIGHT_RE = /(?:^|\s)h-([\w./\-[\]%]+)/g
26
+ const LEADING_RE = /(?:^|\s)leading-/
20
27
 
21
- if (props.size) {
22
- s.push(`line-height: ${normalizeToPixels(props.size)};`)
23
- }
28
+ const verticalClass = computed(() => {
29
+ const userClass = (attrs.class as string) || ''
30
+ if (!userClass) return ''
31
+
32
+ const heights = [...userClass.matchAll(HEIGHT_RE)]
33
+ const stripped = userClass.replace(HEIGHT_RE, ' ').replace(/\s+/g, ' ').trim()
34
+
35
+ if (!heights.length) return stripped
36
+ if (LEADING_RE.test(stripped)) return stripped
37
+
38
+ return `${stripped} leading-${heights[heights.length - 1][1]}`.trim()
39
+ })
24
40
 
25
- if (props.msoHeight) {
26
- s.push(`mso-line-height-alt: ${normalizeToPixels(props.msoHeight)};`)
27
- }
41
+ function parsePixelValue(value: string | number): number {
42
+ if (typeof value === 'number') return value
43
+ return Number.parseFloat(value) || 0
44
+ }
28
45
 
29
- return s.join('')
46
+ const horizontalStyles = computed(() => {
47
+ const mso = outlookFallback ? msoFontWidth.value : ''
48
+ return `display:inline-block; width: ${normalizeToPixels(props.width)}; font-size: 16px;${mso}`
30
49
  })
50
+
51
+ const msoFontWidth = computed(() => {
52
+ const widthPx = parsePixelValue(props.width)
53
+ const emspBase = 16
54
+ const maxPercent = 500
55
+ const maxPerEmsp = emspBase * (maxPercent / 100)
56
+ const numEmsps = Math.ceil(widthPx / maxPerEmsp)
57
+ const percent = Math.round((widthPx / (numEmsps * emspBase)) * 100)
58
+
59
+ return ` mso-font-width:${percent}%;`
60
+ })
61
+
62
+ const emspCount = computed(() => {
63
+ const widthPx = parsePixelValue(props.width)
64
+ const maxPerEmsp = 16 * 5
65
+ return Math.ceil(widthPx / maxPerEmsp)
66
+ })
67
+
68
+ const emsps = computed(() => '\u2003'.repeat(emspCount.value))
69
+
70
+ const HorizontalSpacer = () =>
71
+ h('i', { ...attrs, style: horizontalStyles.value }, emsps.value)
31
72
  </script>
32
73
 
33
74
  <template>
34
- <div v-if="size" role="separator" :style="styles">&zwj;</div>
35
- <div v-else role="separator">&zwj;</div>
75
+ <template v-if="type === 'horizontal'">
76
+ <HorizontalSpacer />
77
+ </template>
78
+ <template v-else>
79
+ <div
80
+ role="separator"
81
+ v-bind="{ ...$attrs, class: undefined }"
82
+ :class="verticalClass"
83
+ >&zwj;</div>
84
+ </template>
36
85
  </template>
@@ -0,0 +1,43 @@
1
+ <script lang="ts">
2
+ import { defineComponent, createCommentVNode, inject, h, Fragment, type VNode } from 'vue'
3
+ import { RenderContextKey } from '../composables/renderContext'
4
+
5
+ /**
6
+ * Walk a slot's vnode tree and concatenate its text content.
7
+ * Handles plain text children, arrays, and Comment vnodes.
8
+ * Static text in <template #config>...</template> compiles into
9
+ * text vnodes whose `children` is a string — that's our path.
10
+ */
11
+ function vnodeText(input: unknown): string {
12
+ if (input == null || input === false) return ''
13
+ if (typeof input === 'string') return input
14
+ if (typeof input === 'number') return String(input)
15
+ if (Array.isArray(input)) return input.map(vnodeText).join('')
16
+
17
+ const v = input as VNode
18
+ if (typeof v.children === 'string') return v.children
19
+ if (Array.isArray(v.children)) return vnodeText(v.children)
20
+ return ''
21
+ }
22
+
23
+ export default defineComponent({
24
+ name: 'Tailwind',
25
+ setup(_, { slots }) {
26
+ const ctx = inject(RenderContextKey)!
27
+ if (!ctx.tailwindBlocks) ctx.tailwindBlocks = []
28
+ const id = `tw${ctx.tailwindBlocks.length}`
29
+
30
+ // Extract optional `#config` slot content as raw CSS. Evaluated at
31
+ // setup time; the slot is NOT rendered into the document.
32
+ const css = slots.config ? vnodeText(slots.config()).trim() : undefined
33
+
34
+ ctx.tailwindBlocks.push({ id, css: css || undefined })
35
+
36
+ return () => h(Fragment, null, [
37
+ createCommentVNode(`mz-tw:${id}`),
38
+ slots.default?.(),
39
+ createCommentVNode(`/mz-tw:${id}`),
40
+ ])
41
+ },
42
+ })
43
+ </script>
@@ -0,0 +1,29 @@
1
+ <script setup lang="ts">
2
+ import { type PropType, computed, useAttrs } from 'vue'
3
+ import { twMerge } from 'tailwind-merge'
4
+
5
+ defineOptions({ inheritAttrs: false })
6
+
7
+ const props = defineProps({
8
+ /**
9
+ * The HTML element to render.
10
+ * @default 'p'
11
+ */
12
+ as: {
13
+ type: String as PropType<'p' | 'span'>,
14
+ default: 'p',
15
+ validator: (v: string) => ['p', 'span'].includes(v),
16
+ },
17
+ })
18
+
19
+ const attrs = useAttrs()
20
+
21
+ const defaultClass = computed(() => props.as === 'span' ? 'text-base' : 'm-0 my-4 text-base')
22
+ const mergedClass = computed(() => twMerge(defaultClass.value, attrs.class as string))
23
+ </script>
24
+
25
+ <template>
26
+ <component :is="props.as" v-bind="$attrs" :class="mergedClass">
27
+ <slot />
28
+ </component>
29
+ </template>
@@ -0,0 +1,28 @@
1
+ //#region src/components/utils.d.ts
2
+ declare function normalizeToPixels(value: string | number): string;
3
+ /**
4
+ * Module-scoped sequential ID generator. Used by components to mint
5
+ * unique marker ids (e.g. `c1`, `c2`) for the post-render transformer.
6
+ *
7
+ * Must live here (not inside `<script setup>`) because Vue compiles
8
+ * `<script setup>` into the component's `setup()` function — any
9
+ * `let counter = 0` there resets per instance, causing id collisions.
10
+ */
11
+ declare function nextId(prefix: string): string;
12
+ declare function hasWidthUtility(classStr: string): boolean;
13
+ declare function hasWidthInStyle(styleStr: string): boolean;
14
+ declare function hasHeightUtility(classStr: string): boolean;
15
+ declare function hasHeightInStyle(styleStr: string): boolean;
16
+ /**
17
+ * Shared prop for components that emit MSO/VML fallback markup. The
18
+ * `null` default acts as the "unset" sentinel — `useOutlookFallback`
19
+ * treats `null` as inherit-from-ancestor (root default `true`),
20
+ * letting users override per-component without losing inheritance.
21
+ */
22
+ declare const outlookFallbackProp: {
23
+ readonly type: BooleanConstructor;
24
+ readonly default: null;
25
+ };
26
+ //#endregion
27
+ export { hasHeightInStyle, hasHeightUtility, hasWidthInStyle, hasWidthUtility, nextId, normalizeToPixels, outlookFallbackProp };
28
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/components/utils.ts"],"mappings":";iBAAgB,iBAAA,CAAkB,KAAA;AAAlC;;;;;AAiBA;;;AAjBA,iBAiBgB,MAAA,CAAO,MAAA;AAAA,iBAKP,eAAA,CAAgB,QAAA;AAAA,iBAQhB,eAAA,CAAgB,QAAA;AAAA,iBAIhB,gBAAA,CAAiB,QAAA;AAAA,iBAQjB,gBAAA,CAAiB,QAAA;;;AAZjC;;;;cAsBa,mBAAA;EAAA,eAGH,kBAAA;EAAA"}
@@ -0,0 +1,50 @@
1
+ //#region src/components/utils.ts
2
+ function normalizeToPixels(value) {
3
+ if (typeof value === "number" || Number.isFinite(Number(value))) return `${value}px`;
4
+ return value;
5
+ }
6
+ const counters = {};
7
+ /**
8
+ * Module-scoped sequential ID generator. Used by components to mint
9
+ * unique marker ids (e.g. `c1`, `c2`) for the post-render transformer.
10
+ *
11
+ * Must live here (not inside `<script setup>`) because Vue compiles
12
+ * `<script setup>` into the component's `setup()` function — any
13
+ * `let counter = 0` there resets per instance, causing id collisions.
14
+ */
15
+ function nextId(prefix) {
16
+ counters[prefix] = (counters[prefix] ?? 0) + 1;
17
+ return `${prefix}${counters[prefix]}`;
18
+ }
19
+ function hasWidthUtility(classStr) {
20
+ return classStr.split(/\s+/).some((c) => {
21
+ const clean = (c.split(":").pop() ?? "").replace(/^!/, "");
22
+ return /^(w-|max-w-|min-w-)/.test(clean);
23
+ });
24
+ }
25
+ function hasWidthInStyle(styleStr) {
26
+ return /(?:^|;\s*)(?:max-width|width)\s*:/i.test(styleStr);
27
+ }
28
+ function hasHeightUtility(classStr) {
29
+ return classStr.split(/\s+/).some((c) => {
30
+ const clean = (c.split(":").pop() ?? "").replace(/^!/, "");
31
+ return /^(h-|max-h-|min-h-)/.test(clean);
32
+ });
33
+ }
34
+ function hasHeightInStyle(styleStr) {
35
+ return /(?:^|;\s*)(?:max-height|height)\s*:/i.test(styleStr);
36
+ }
37
+ /**
38
+ * Shared prop for components that emit MSO/VML fallback markup. The
39
+ * `null` default acts as the "unset" sentinel — `useOutlookFallback`
40
+ * treats `null` as inherit-from-ancestor (root default `true`),
41
+ * letting users override per-component without losing inheritance.
42
+ */
43
+ const outlookFallbackProp = {
44
+ type: Boolean,
45
+ default: null
46
+ };
47
+ //#endregion
48
+ export { hasHeightInStyle, hasHeightUtility, hasWidthInStyle, hasWidthUtility, nextId, normalizeToPixels, outlookFallbackProp };
49
+
50
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../src/components/utils.ts"],"sourcesContent":["export function normalizeToPixels(value: string | number): string {\n if (typeof value === 'number' || Number.isFinite(Number(value))) {\n return `${value}px`\n }\n return value\n}\n\nconst counters: Record<string, number> = {}\n\n/**\n * Module-scoped sequential ID generator. Used by components to mint\n * unique marker ids (e.g. `c1`, `c2`) for the post-render transformer.\n *\n * Must live here (not inside `<script setup>`) because Vue compiles\n * `<script setup>` into the component's `setup()` function — any\n * `let counter = 0` there resets per instance, causing id collisions.\n */\nexport function nextId(prefix: string): string {\n counters[prefix] = (counters[prefix] ?? 0) + 1\n return `${prefix}${counters[prefix]}`\n}\n\nexport function hasWidthUtility(classStr: string): boolean {\n return classStr.split(/\\s+/).some((c) => {\n const utility = c.split(':').pop() ?? ''\n const clean = utility.replace(/^!/, '')\n return /^(w-|max-w-|min-w-)/.test(clean)\n })\n}\n\nexport function hasWidthInStyle(styleStr: string): boolean {\n return /(?:^|;\\s*)(?:max-width|width)\\s*:/i.test(styleStr)\n}\n\nexport function hasHeightUtility(classStr: string): boolean {\n return classStr.split(/\\s+/).some((c) => {\n const utility = c.split(':').pop() ?? ''\n const clean = utility.replace(/^!/, '')\n return /^(h-|max-h-|min-h-)/.test(clean)\n })\n}\n\nexport function hasHeightInStyle(styleStr: string): boolean {\n return /(?:^|;\\s*)(?:max-height|height)\\s*:/i.test(styleStr)\n}\n\n/**\n * Shared prop for components that emit MSO/VML fallback markup. The\n * `null` default acts as the \"unset\" sentinel — `useOutlookFallback`\n * treats `null` as inherit-from-ancestor (root default `true`),\n * letting users override per-component without losing inheritance.\n */\nexport const outlookFallbackProp = {\n type: Boolean,\n default: null,\n} as const\n\n"],"mappings":";AAAA,SAAgB,kBAAkB,OAAgC;CAChE,IAAI,OAAO,UAAU,YAAY,OAAO,SAAS,OAAO,MAAM,CAAC,EAC7D,OAAO,GAAG,MAAM;CAElB,OAAO;;AAGT,MAAM,WAAmC,EAAE;;;;;;;;;AAU3C,SAAgB,OAAO,QAAwB;CAC7C,SAAS,WAAW,SAAS,WAAW,KAAK;CAC7C,OAAO,GAAG,SAAS,SAAS;;AAG9B,SAAgB,gBAAgB,UAA2B;CACzD,OAAO,SAAS,MAAM,MAAM,CAAC,MAAM,MAAM;EAEvC,MAAM,SADU,EAAE,MAAM,IAAI,CAAC,KAAK,IAAI,IAChB,QAAQ,MAAM,GAAG;EACvC,OAAO,sBAAsB,KAAK,MAAM;GACxC;;AAGJ,SAAgB,gBAAgB,UAA2B;CACzD,OAAO,qCAAqC,KAAK,SAAS;;AAG5D,SAAgB,iBAAiB,UAA2B;CAC1D,OAAO,SAAS,MAAM,MAAM,CAAC,MAAM,MAAM;EAEvC,MAAM,SADU,EAAE,MAAM,IAAI,CAAC,KAAK,IAAI,IAChB,QAAQ,MAAM,GAAG;EACvC,OAAO,sBAAsB,KAAK,MAAM;GACxC;;AAGJ,SAAgB,iBAAiB,UAA2B;CAC1D,OAAO,uCAAuC,KAAK,SAAS;;;;;;;;AAS9D,MAAa,sBAAsB;CACjC,MAAM;CACN,SAAS;CACV"}
@@ -4,3 +4,54 @@ export function normalizeToPixels(value: string | number): string {
4
4
  }
5
5
  return value
6
6
  }
7
+
8
+ const counters: Record<string, number> = {}
9
+
10
+ /**
11
+ * Module-scoped sequential ID generator. Used by components to mint
12
+ * unique marker ids (e.g. `c1`, `c2`) for the post-render transformer.
13
+ *
14
+ * Must live here (not inside `<script setup>`) because Vue compiles
15
+ * `<script setup>` into the component's `setup()` function — any
16
+ * `let counter = 0` there resets per instance, causing id collisions.
17
+ */
18
+ export function nextId(prefix: string): string {
19
+ counters[prefix] = (counters[prefix] ?? 0) + 1
20
+ return `${prefix}${counters[prefix]}`
21
+ }
22
+
23
+ export function hasWidthUtility(classStr: string): boolean {
24
+ return classStr.split(/\s+/).some((c) => {
25
+ const utility = c.split(':').pop() ?? ''
26
+ const clean = utility.replace(/^!/, '')
27
+ return /^(w-|max-w-|min-w-)/.test(clean)
28
+ })
29
+ }
30
+
31
+ export function hasWidthInStyle(styleStr: string): boolean {
32
+ return /(?:^|;\s*)(?:max-width|width)\s*:/i.test(styleStr)
33
+ }
34
+
35
+ export function hasHeightUtility(classStr: string): boolean {
36
+ return classStr.split(/\s+/).some((c) => {
37
+ const utility = c.split(':').pop() ?? ''
38
+ const clean = utility.replace(/^!/, '')
39
+ return /^(h-|max-h-|min-h-)/.test(clean)
40
+ })
41
+ }
42
+
43
+ export function hasHeightInStyle(styleStr: string): boolean {
44
+ return /(?:^|;\s*)(?:max-height|height)\s*:/i.test(styleStr)
45
+ }
46
+
47
+ /**
48
+ * Shared prop for components that emit MSO/VML fallback markup. The
49
+ * `null` default acts as the "unset" sentinel — `useOutlookFallback`
50
+ * treats `null` as inherit-from-ancestor (root default `true`),
51
+ * letting users override per-component without losing inheritance.
52
+ */
53
+ export const outlookFallbackProp = {
54
+ type: Boolean,
55
+ default: null,
56
+ } as const
57
+
@@ -1,4 +1,4 @@
1
- import { MaizzleConfig } from "../types/config.mjs";
1
+ import { MaizzleConfig } from "../types/config.js";
2
2
  //#region src/composables/defineConfig.d.ts
3
3
  /**
4
4
  * Define Maizzle config.
@@ -11,4 +11,4 @@ import { MaizzleConfig } from "../types/config.mjs";
11
11
  declare function defineConfig(data?: Partial<MaizzleConfig>): MaizzleConfig;
12
12
  //#endregion
13
13
  export { defineConfig };
14
- //# sourceMappingURL=defineConfig.d.mts.map
14
+ //# sourceMappingURL=defineConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineConfig.d.ts","names":[],"sources":["../../src/composables/defineConfig.ts"],"mappings":";;;;;AAqBA;;;;;iBAAgB,YAAA,CAAa,IAAA,GAAM,OAAA,CAAQ,aAAA,IAAsB,aAAA"}
@@ -1,8 +1,7 @@
1
- import { MaizzleConfigKey } from "./useConfig.mjs";
2
- import { RenderContextKey } from "./renderContext.mjs";
1
+ import { MaizzleConfigKey } from "./useConfig.js";
2
+ import { RenderContextKey } from "./renderContext.js";
3
3
  import { createDefu } from "defu";
4
4
  import { getCurrentInstance, inject, provide } from "vue";
5
-
6
5
  //#region src/composables/defineConfig.ts
7
6
  const merge = createDefu((obj, key, value) => {
8
7
  if (Array.isArray(obj[key])) {
@@ -28,7 +27,7 @@ function defineConfig(data = {}) {
28
27
  }
29
28
  return data;
30
29
  }
31
-
32
30
  //#endregion
33
31
  export { defineConfig };
34
- //# sourceMappingURL=defineConfig.mjs.map
32
+
33
+ //# sourceMappingURL=defineConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineConfig.js","names":[],"sources":["../../src/composables/defineConfig.ts"],"sourcesContent":["import { getCurrentInstance, inject, provide } from 'vue'\nimport { createDefu } from 'defu'\nimport { MaizzleConfigKey } from './useConfig.ts'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nconst merge = createDefu((obj, key, value) => {\n if (Array.isArray(obj[key])) {\n obj[key] = value\n return true\n }\n})\n\n/**\n * Define Maizzle config.\n *\n * Works in both contexts:\n * - In maizzle.config.ts: typed identity function, returns the config as-is\n * - In Vue SFC <script setup>: merges with the global config and provides\n * the result to child components via useConfig()\n */\nexport function defineConfig(data: Partial<MaizzleConfig> = {}): MaizzleConfig {\n // Inside a Vue SFC — merge with global config and provide to children\n if (getCurrentInstance()) {\n const globalConfig = inject(MaizzleConfigKey, {} as MaizzleConfig)\n const merged = merge(data, globalConfig) as MaizzleConfig\n\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.sfcConfig = merged\n\n provide(MaizzleConfigKey, merged)\n\n return merged\n }\n\n // Outside Vue (maizzle.config.ts) — just return the config\n return data as MaizzleConfig\n}\n"],"mappings":";;;;;AAMA,MAAM,QAAQ,YAAY,KAAK,KAAK,UAAU;CAC5C,IAAI,MAAM,QAAQ,IAAI,KAAK,EAAE;EAC3B,IAAI,OAAO;EACX,OAAO;;EAET;;;;;;;;;AAUF,SAAgB,aAAa,OAA+B,EAAE,EAAiB;CAE7E,IAAI,oBAAoB,EAAE;EAExB,MAAM,SAAS,MAAM,MADA,OAAO,kBAAkB,EAAE,CACT,CAAC;EAExC,MAAM,MAAM,OAAO,iBAAiB;EACpC,IAAI,KAAK,IAAI,YAAY;EAEzB,QAAQ,kBAAkB,OAAO;EAEjC,OAAO;;CAIT,OAAO"}