@maizzle/framework 6.0.0-rc.22 → 6.0.0-rc.23

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 (210) hide show
  1. package/dist/build.d.ts.map +1 -1
  2. package/dist/build.js +11 -0
  3. package/dist/build.js.map +1 -1
  4. package/dist/components/Heading.vue +1 -1
  5. package/dist/components/Img.vue +60 -10
  6. package/dist/components/Link.vue +1 -1
  7. package/dist/components/Preheader.vue +4 -2
  8. package/dist/components/Tailwind.vue +4 -2
  9. package/dist/components/Text.vue +1 -1
  10. package/dist/components/Vml.vue +354 -0
  11. package/dist/components/utils.d.ts.map +1 -1
  12. package/dist/components/utils.js.map +1 -1
  13. package/dist/composables/defineConfig.js.map +1 -1
  14. package/dist/composables/renderContext.d.ts.map +1 -1
  15. package/dist/composables/renderContext.js.map +1 -1
  16. package/dist/composables/useBaseUrl.d.ts.map +1 -1
  17. package/dist/composables/useBaseUrl.js.map +1 -1
  18. package/dist/composables/useConfig.d.ts.map +1 -1
  19. package/dist/composables/useConfig.js.map +1 -1
  20. package/dist/composables/useCurrentTemplate.d.ts.map +1 -1
  21. package/dist/composables/useCurrentTemplate.js +10 -3
  22. package/dist/composables/useCurrentTemplate.js.map +1 -1
  23. package/dist/composables/useDoctype.d.ts.map +1 -1
  24. package/dist/composables/useDoctype.js.map +1 -1
  25. package/dist/composables/useEvent.js.map +1 -1
  26. package/dist/composables/useFont.d.ts.map +1 -1
  27. package/dist/composables/useFont.js.map +1 -1
  28. package/dist/composables/useOutlookFallback.d.ts.map +1 -1
  29. package/dist/composables/useOutlookFallback.js.map +1 -1
  30. package/dist/composables/usePlaintext.d.ts.map +1 -1
  31. package/dist/composables/usePlaintext.js.map +1 -1
  32. package/dist/composables/usePreheader.d.ts.map +1 -1
  33. package/dist/composables/usePreheader.js.map +1 -1
  34. package/dist/composables/useTransformers.d.ts.map +1 -1
  35. package/dist/composables/useTransformers.js.map +1 -1
  36. package/dist/composables/useUrlQuery.d.ts.map +1 -1
  37. package/dist/composables/useUrlQuery.js.map +1 -1
  38. package/dist/config/defaults.d.ts.map +1 -1
  39. package/dist/config/defaults.js.map +1 -1
  40. package/dist/config/index.js +12 -0
  41. package/dist/config/index.js.map +1 -1
  42. package/dist/events/index.d.ts +5 -0
  43. package/dist/events/index.d.ts.map +1 -1
  44. package/dist/events/index.js +5 -0
  45. package/dist/events/index.js.map +1 -1
  46. package/dist/plaintext.d.ts.map +1 -1
  47. package/dist/plaintext.js.map +1 -1
  48. package/dist/plugin.js.map +1 -1
  49. package/dist/plugins/postcss/mergeMediaQueries.d.ts.map +1 -1
  50. package/dist/plugins/postcss/mergeMediaQueries.js.map +1 -1
  51. package/dist/plugins/postcss/pruneVars.d.ts.map +1 -1
  52. package/dist/plugins/postcss/pruneVars.js.map +1 -1
  53. package/dist/plugins/postcss/quoteFontFamilies.d.ts.map +1 -1
  54. package/dist/plugins/postcss/quoteFontFamilies.js.map +1 -1
  55. package/dist/plugins/postcss/removeDeclarations.d.ts.map +1 -1
  56. package/dist/plugins/postcss/removeDeclarations.js.map +1 -1
  57. package/dist/plugins/postcss/resolveMaizzleImports.d.ts.map +1 -1
  58. package/dist/plugins/postcss/resolveMaizzleImports.js.map +1 -1
  59. package/dist/plugins/postcss/resolveProps.d.ts.map +1 -1
  60. package/dist/plugins/postcss/resolveProps.js +14 -0
  61. package/dist/plugins/postcss/resolveProps.js.map +1 -1
  62. package/dist/plugins/postcss/tailwindCleanup.d.ts.map +1 -1
  63. package/dist/plugins/postcss/tailwindCleanup.js.map +1 -1
  64. package/dist/prepare.d.ts.map +1 -1
  65. package/dist/prepare.js.map +1 -1
  66. package/dist/render/active.d.ts.map +1 -1
  67. package/dist/render/active.js.map +1 -1
  68. package/dist/render/createRenderer.d.ts.map +1 -1
  69. package/dist/render/createRenderer.js +89 -1
  70. package/dist/render/createRenderer.js.map +1 -1
  71. package/dist/render/index.d.ts.map +1 -1
  72. package/dist/render/index.js +6 -0
  73. package/dist/render/index.js.map +1 -1
  74. package/dist/render/injectFonts.js.map +1 -1
  75. package/dist/render/plugins/codeBlockExtract.d.ts.map +1 -1
  76. package/dist/render/plugins/codeBlockExtract.js +4 -0
  77. package/dist/render/plugins/codeBlockExtract.js.map +1 -1
  78. package/dist/render/plugins/markdownExtract.d.ts.map +1 -1
  79. package/dist/render/plugins/markdownExtract.js.map +1 -1
  80. package/dist/render/plugins/rawExtract.d.ts.map +1 -1
  81. package/dist/render/plugins/rawExtract.js.map +1 -1
  82. package/dist/render/plugins/rowSourceLocation.d.ts.map +1 -1
  83. package/dist/render/plugins/rowSourceLocation.js.map +1 -1
  84. package/dist/serve.d.ts.map +1 -1
  85. package/dist/serve.js +48 -15
  86. package/dist/serve.js.map +1 -1
  87. package/dist/server/compatibility.d.ts.map +1 -1
  88. package/dist/server/compatibility.js +48 -0
  89. package/dist/server/compatibility.js.map +1 -1
  90. package/dist/server/email.js.map +1 -1
  91. package/dist/server/linter.js +6 -0
  92. package/dist/server/linter.js.map +1 -1
  93. package/dist/server/sfc-utils.d.ts.map +1 -1
  94. package/dist/server/sfc-utils.js.map +1 -1
  95. package/dist/server/ui/App.vue +17 -16
  96. package/dist/server/ui/components/Markdown.vue +17 -0
  97. package/dist/server/ui/components/SidebarClose.vue +1 -1
  98. package/dist/server/ui/components/ui/checkbox/Checkbox.vue +1 -1
  99. package/dist/server/ui/components/ui/command/CommandInput.vue +2 -2
  100. package/dist/server/ui/components/ui/dialog/DialogContent.vue +1 -1
  101. package/dist/server/ui/components/ui/dialog/DialogScrollContent.vue +1 -1
  102. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
  103. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
  104. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
  105. package/dist/server/ui/components/ui/sheet/SheetContent.vue +1 -1
  106. package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +1 -1
  107. package/dist/server/ui/components/ui/tags-input/TagsInputItemDelete.vue +1 -1
  108. package/dist/server/ui/lib/emulated-dark-mode.ts +25 -10
  109. package/dist/server/ui/pages/Home.vue +1 -1
  110. package/dist/server/ui/pages/Preview.vue +32 -18
  111. package/dist/tests/render/_helpers.js.map +1 -1
  112. package/dist/transformers/addAttributes.d.ts.map +1 -1
  113. package/dist/transformers/addAttributes.js.map +1 -1
  114. package/dist/transformers/attributeToStyle.d.ts.map +1 -1
  115. package/dist/transformers/attributeToStyle.js.map +1 -1
  116. package/dist/transformers/base.d.ts.map +1 -1
  117. package/dist/transformers/base.js +4 -0
  118. package/dist/transformers/base.js.map +1 -1
  119. package/dist/transformers/columnWidth.d.ts.map +1 -1
  120. package/dist/transformers/columnWidth.js.map +1 -1
  121. package/dist/transformers/entities.d.ts.map +1 -1
  122. package/dist/transformers/entities.js.map +1 -1
  123. package/dist/transformers/filters/defaults.d.ts.map +1 -1
  124. package/dist/transformers/filters/defaults.js.map +1 -1
  125. package/dist/transformers/filters/index.d.ts.map +1 -1
  126. package/dist/transformers/filters/index.js.map +1 -1
  127. package/dist/transformers/format.d.ts.map +1 -1
  128. package/dist/transformers/format.js.map +1 -1
  129. package/dist/transformers/index.d.ts.map +1 -1
  130. package/dist/transformers/index.js +26 -0
  131. package/dist/transformers/index.js.map +1 -1
  132. package/dist/transformers/inlineCss.d.ts.map +1 -1
  133. package/dist/transformers/inlineCss.js +25 -2
  134. package/dist/transformers/inlineCss.js.map +1 -1
  135. package/dist/transformers/inlineLink.d.ts.map +1 -1
  136. package/dist/transformers/inlineLink.js.map +1 -1
  137. package/dist/transformers/minify.d.ts.map +1 -1
  138. package/dist/transformers/minify.js.map +1 -1
  139. package/dist/transformers/minifyCodeInline.d.ts.map +1 -1
  140. package/dist/transformers/minifyCodeInline.js.map +1 -1
  141. package/dist/transformers/msoPlaceholders.d.ts.map +1 -1
  142. package/dist/transformers/msoPlaceholders.js.map +1 -1
  143. package/dist/transformers/purgeCss.d.ts.map +1 -1
  144. package/dist/transformers/purgeCss.js +29 -3
  145. package/dist/transformers/purgeCss.js.map +1 -1
  146. package/dist/transformers/removeAttributes.d.ts.map +1 -1
  147. package/dist/transformers/removeAttributes.js.map +1 -1
  148. package/dist/transformers/replaceStrings.d.ts.map +1 -1
  149. package/dist/transformers/replaceStrings.js.map +1 -1
  150. package/dist/transformers/safeSelectors.d.ts.map +1 -1
  151. package/dist/transformers/safeSelectors.js +13 -1
  152. package/dist/transformers/safeSelectors.js.map +1 -1
  153. package/dist/transformers/shorthandCss.d.ts.map +1 -1
  154. package/dist/transformers/shorthandCss.js.map +1 -1
  155. package/dist/transformers/sixHex.d.ts.map +1 -1
  156. package/dist/transformers/sixHex.js.map +1 -1
  157. package/dist/transformers/tailwindComponent.js +9 -0
  158. package/dist/transformers/tailwindComponent.js.map +1 -1
  159. package/dist/transformers/tailwindcss.d.ts.map +1 -1
  160. package/dist/transformers/tailwindcss.js +22 -0
  161. package/dist/transformers/tailwindcss.js.map +1 -1
  162. package/dist/transformers/urlQuery.d.ts.map +1 -1
  163. package/dist/transformers/urlQuery.js.map +1 -1
  164. package/dist/types/config.d.ts +4 -8
  165. package/dist/types/config.d.ts.map +1 -1
  166. package/dist/types/index.d.ts +1 -1
  167. package/dist/utils/ast/parser.d.ts.map +1 -1
  168. package/dist/utils/ast/parser.js.map +1 -1
  169. package/dist/utils/ast/serializer.d.ts.map +1 -1
  170. package/dist/utils/ast/serializer.js.map +1 -1
  171. package/dist/utils/ast/walker.d.ts.map +1 -1
  172. package/dist/utils/ast/walker.js.map +1 -1
  173. package/dist/utils/compileTailwindCss.d.ts.map +1 -1
  174. package/dist/utils/compileTailwindCss.js.map +1 -1
  175. package/dist/utils/componentSources.d.ts.map +1 -1
  176. package/dist/utils/componentSources.js.map +1 -1
  177. package/dist/utils/cssBox.d.ts.map +1 -1
  178. package/dist/utils/cssBox.js.map +1 -1
  179. package/dist/utils/decodeStyleEntities.d.ts.map +1 -1
  180. package/dist/utils/decodeStyleEntities.js.map +1 -1
  181. package/dist/utils/detect.d.ts.map +1 -1
  182. package/dist/utils/detect.js.map +1 -1
  183. package/dist/utils/output-markers.d.ts.map +1 -1
  184. package/dist/utils/output-markers.js.map +1 -1
  185. package/dist/utils/url.d.ts.map +1 -1
  186. package/dist/utils/url.js.map +1 -1
  187. package/dist/utils/watchPaths.js.map +1 -1
  188. package/node_modules/@clack/core/CHANGELOG.md +6 -0
  189. package/node_modules/@clack/core/dist/index.d.mts +1 -1
  190. package/node_modules/@clack/core/dist/index.mjs +8 -8
  191. package/node_modules/@clack/core/dist/index.mjs.map +1 -1
  192. package/node_modules/@clack/core/package.json +1 -1
  193. package/node_modules/@clack/prompts/CHANGELOG.md +13 -0
  194. package/node_modules/@clack/prompts/README.md +2 -2
  195. package/node_modules/@clack/prompts/dist/index.d.mts +98 -0
  196. package/node_modules/@clack/prompts/dist/index.mjs +122 -121
  197. package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
  198. package/node_modules/@clack/prompts/package.json +2 -2
  199. package/node_modules/fast-wrap-ansi/lib/main.js +0 -1
  200. package/node_modules/fast-wrap-ansi/package.json +10 -10
  201. package/node_modules/maizzle/dist/commands/make/config.mjs +7 -6
  202. package/node_modules/maizzle/dist/commands/new.mjs +15 -84
  203. package/node_modules/maizzle/package.json +2 -2
  204. package/node_modules/tinyexec/README.md +8 -0
  205. package/node_modules/tinyexec/dist/main.d.mts +16 -1
  206. package/node_modules/tinyexec/dist/main.mjs +163 -457
  207. package/node_modules/tinyexec/package.json +12 -14
  208. package/package.json +3 -4
  209. package/node_modules/fast-wrap-ansi/lib/main.js.map +0 -1
  210. package/node_modules/tinyexec/dist/LICENSES.txt +0 -83
@@ -1 +1 @@
1
- {"version":3,"file":"renderContext.js","names":[],"sources":["../../src/composables/renderContext.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\nimport type { MaizzleConfig } from '../types/index.ts'\nimport type { EventName, EventMap } from '../events/index.ts'\nimport type { UsePlaintextOptions } from './usePlaintext.ts'\n\nexport interface FontRegistration {\n family: string\n slug: string\n declaration: string\n url: string\n}\n\nexport interface TailwindBlock {\n id: string\n /** Optional raw CSS from the component's `#config` slot. */\n css?: string\n}\n\nexport interface RenderContext {\n doctype?: string\n preheader?: { text: string; fillerCount: number }\n sfcConfig?: MaizzleConfig\n sfcEventHandlers: Array<{ name: EventName; handler: EventMap[EventName] }>\n plaintext?: UsePlaintextOptions\n fonts?: FontRegistration[]\n tailwindBlocks?: TailwindBlock[]\n}\n\nexport const RenderContextKey: InjectionKey<RenderContext> = Symbol('RenderContext')\n"],"mappings":";AA4BA,MAAa,mBAAgD,OAAO,gBAAgB"}
1
+ {"version":3,"file":"renderContext.js","names":[],"sources":["../../src/composables/renderContext.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\nimport type { MaizzleConfig } from '../types/index.ts'\nimport type { EventName, EventMap } from '../events/index.ts'\nimport type { UsePlaintextOptions } from './usePlaintext.ts'\n\nexport interface FontRegistration {\n family: string\n slug: string\n declaration: string\n url: string\n}\n\nexport interface TailwindBlock {\n id: string\n /** Optional raw CSS from the component's `#config` slot. */\n css?: string\n}\n\nexport interface RenderContext {\n doctype?: string\n preheader?: { text: string; fillerCount: number }\n sfcConfig?: MaizzleConfig\n sfcEventHandlers: Array<{ name: EventName; handler: EventMap[EventName] }>\n plaintext?: UsePlaintextOptions\n fonts?: FontRegistration[]\n tailwindBlocks?: TailwindBlock[]\n}\n\nexport const RenderContextKey: InjectionKey<RenderContext> = Symbol('RenderContext')\n"],"mappings":";AA4BA,MAAa,mBAAgD,OAAO,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"useBaseUrl.d.ts","names":[],"sources":["../../src/composables/useBaseUrl.ts"],"mappings":";;;;;AAkBA;;;;;;;;;;iBAAgB,UAAA,CAAW,KAAA,EAAO,SAAA"}
1
+ {"version":3,"file":"useBaseUrl.d.ts","names":[],"sources":["../../src/composables/useBaseUrl.ts"],"mappings":";;;;;AAkBA;;;;AAAmD;;;;;;iBAAnC,UAAA,CAAW,KAAwB,EAAjB,SAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"useBaseUrl.js","names":["merge"],"sources":["../../src/composables/useBaseUrl.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { defu as merge } from 'defu'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { UrlConfig } from '../types/index.ts'\n\n/**\n * Set the base URL for the current email template — same as\n * `config.url.base`, scoped to one SFC.\n *\n * Pass a string to prepend to all default tags/attributes, or an object\n * for fine-grained control (which tags/attributes, style tags, etc.).\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useBaseUrl('https://cdn.example.com/emails/')\n * useBaseUrl({ url: 'https://cdn.example.com/', styleTag: true })\n * ```\n */\nexport function useBaseUrl(value: UrlConfig['base']): void {\n const ctx = inject(RenderContextKey)\n if (!ctx) return\n ctx.sfcConfig = merge({ url: { base: value } }, ctx.sfcConfig ?? {})\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,WAAW,OAAgC;CACzD,MAAM,MAAM,OAAO,iBAAiB;CACpC,IAAI,CAAC,KAAK;CACV,IAAI,YAAYA,OAAM,EAAE,KAAK,EAAE,MAAM,OAAO,EAAE,EAAE,IAAI,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"useBaseUrl.js","names":["merge"],"sources":["../../src/composables/useBaseUrl.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { defu as merge } from 'defu'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { UrlConfig } from '../types/index.ts'\n\n/**\n * Set the base URL for the current email template — same as\n * `config.url.base`, scoped to one SFC.\n *\n * Pass a string to prepend to all default tags/attributes, or an object\n * for fine-grained control (which tags/attributes, style tags, etc.).\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useBaseUrl('https://cdn.example.com/emails/')\n * useBaseUrl({ url: 'https://cdn.example.com/', styleTag: true })\n * ```\n */\nexport function useBaseUrl(value: UrlConfig['base']): void {\n const ctx = inject(RenderContextKey)\n if (!ctx) return\n ctx.sfcConfig = merge({ url: { base: value } }, ctx.sfcConfig ?? {})\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,WAAW,OAAgC;CACzD,MAAM,MAAM,OAAO,gBAAgB;CACnC,IAAI,CAAC,KAAK;CACV,IAAI,YAAYA,OAAM,EAAE,KAAK,EAAE,MAAM,MAAM,EAAE,GAAG,IAAI,aAAa,CAAC,CAAC;AACrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"useConfig.d.ts","names":[],"sources":["../../src/composables/useConfig.ts"],"mappings":";;;;cAIa,gBAAA,EAAkB,YAAA,CAAa,aAAA;AAAA,iBAE5B,SAAA,CAAA,GAAa,aAAA"}
1
+ {"version":3,"file":"useConfig.d.ts","names":[],"sources":["../../src/composables/useConfig.ts"],"mappings":";;;;cAIa,gBAAA,EAAkB,YAAY,CAAC,aAAA;AAAA,iBAE5B,SAAA,CAAA,GAAa,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"useConfig.js","names":[],"sources":["../../src/composables/useConfig.ts"],"sourcesContent":["import { inject } from 'vue'\nimport type { InjectionKey } from 'vue'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nexport const MaizzleConfigKey: InjectionKey<MaizzleConfig> = Symbol('MaizzleConfig')\n\nexport function useConfig(): MaizzleConfig {\n const config = inject(MaizzleConfigKey)\n\n if (!config) {\n throw new Error('useConfig() requires the Maizzle plugin to provide config. Make sure you are using it inside a Maizzle template.')\n }\n\n return config\n}\n"],"mappings":";;AAIA,MAAa,mBAAgD,OAAO,gBAAgB;AAEpF,SAAgB,YAA2B;CACzC,MAAM,SAAS,OAAO,iBAAiB;CAEvC,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,mHAAmH;CAGrI,OAAO"}
1
+ {"version":3,"file":"useConfig.js","names":[],"sources":["../../src/composables/useConfig.ts"],"sourcesContent":["import { inject } from 'vue'\nimport type { InjectionKey } from 'vue'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nexport const MaizzleConfigKey: InjectionKey<MaizzleConfig> = Symbol('MaizzleConfig')\n\nexport function useConfig(): MaizzleConfig {\n const config = inject(MaizzleConfigKey)\n\n if (!config) {\n throw new Error('useConfig() requires the Maizzle plugin to provide config. Make sure you are using it inside a Maizzle template.')\n }\n\n return config\n}\n"],"mappings":";;AAIA,MAAa,mBAAgD,OAAO,eAAe;AAEnF,SAAgB,YAA2B;CACzC,MAAM,SAAS,OAAO,gBAAgB;CAEtC,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,kHAAkH;CAGpI,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrentTemplate.d.ts","names":[],"sources":["../../src/composables/useCurrentTemplate.ts"],"mappings":";;;;;AAQA;;iBAAgB,mBAAA,CAAoB,MAAA,EAAQ,UAAA;;;AAuB5C;;;;;;;;;;;;;;;;;iBAAgB,kBAAA,CAAA,GAAsB,UAAA"}
1
+ {"version":3,"file":"useCurrentTemplate.d.ts","names":[],"sources":["../../src/composables/useCurrentTemplate.ts"],"mappings":";;;;;AAmBA;;iBAAgB,mBAAA,CAAoB,MAA8B,EAAtB,UAAU;;AAAY;AAuBlE;;;;AAAgD;;;;;;;;;;;;;iBAAhC,kBAAA,CAAA,GAAsB,UAAU"}
@@ -1,11 +1,18 @@
1
1
  //#region src/composables/useCurrentTemplate.ts
2
- let current;
2
+ /**
3
+ * Stored on globalThis so the Vite SSR module graph (which loads this file
4
+ * when a user SFC auto-imports useCurrentTemplate) and the Node import
5
+ * graph (used by build.ts / serve.ts) share the same value. Two
6
+ * module instances would otherwise hold independent `let`
7
+ * bindings.
8
+ */
9
+ const KEY = Symbol.for("maizzle.currentTemplate");
3
10
  /**
4
11
  * Internal — set by the build loop before each template iteration and
5
12
  * cleared in `finally`. Not exported from the package entrypoint.
6
13
  */
7
14
  function _setCurrentTemplate(parsed) {
8
- current = parsed;
15
+ globalThis[KEY] = parsed;
9
16
  }
10
17
  /**
11
18
  * Returns the parsed path of the template currently being processed,
@@ -27,7 +34,7 @@ function _setCurrentTemplate(parsed) {
27
34
  * ```
28
35
  */
29
36
  function useCurrentTemplate() {
30
- return current;
37
+ return globalThis[KEY];
31
38
  }
32
39
  //#endregion
33
40
  export { _setCurrentTemplate, useCurrentTemplate };
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrentTemplate.js","names":[],"sources":["../../src/composables/useCurrentTemplate.ts"],"sourcesContent":["import type { ParsedPath } from 'node:path'\n\nlet current: ParsedPath | undefined\n\n/**\n * Internal — set by the build loop before each template iteration and\n * cleared in `finally`. Not exported from the package entrypoint.\n */\nexport function _setCurrentTemplate(parsed: ParsedPath | undefined): void {\n current = parsed\n}\n\n/**\n * Returns the parsed path of the template currently being processed,\n * or `undefined` when called outside the per-template scope (e.g. from\n * `beforeCreate` / `afterBuild`, or outside a build entirely).\n *\n * Usage in an SFC `<script setup>`:\n * ```ts\n * const file = useCurrentTemplate()\n * console.log(file?.name) // 'welcome'\n * ```\n *\n * Usage in an event handler:\n * ```ts\n * beforeRender() {\n * const file = useCurrentTemplate()\n * // file?.dir, file?.name, file?.ext, file?.base, file?.root\n * }\n * ```\n */\nexport function useCurrentTemplate(): ParsedPath | undefined {\n return current\n}\n"],"mappings":";AAEA,IAAI;;;;;AAMJ,SAAgB,oBAAoB,QAAsC;CACxE,UAAU;;;;;;;;;;;;;;;;;;;;;AAsBZ,SAAgB,qBAA6C;CAC3D,OAAO"}
1
+ {"version":3,"file":"useCurrentTemplate.js","names":[],"sources":["../../src/composables/useCurrentTemplate.ts"],"sourcesContent":["import type { ParsedPath } from 'node:path'\n\n/**\n * Stored on globalThis so the Vite SSR module graph (which loads this file\n * when a user SFC auto-imports useCurrentTemplate) and the Node import\n * graph (used by build.ts / serve.ts) share the same value. Two\n * module instances would otherwise hold independent `let`\n * bindings.\n */\nconst KEY = Symbol.for('maizzle.currentTemplate')\n\ninterface GlobalWithCurrentTemplate {\n [KEY]?: ParsedPath\n}\n\n/**\n * Internal — set by the build loop before each template iteration and\n * cleared in `finally`. Not exported from the package entrypoint.\n */\nexport function _setCurrentTemplate(parsed: ParsedPath | undefined): void {\n (globalThis as GlobalWithCurrentTemplate)[KEY] = parsed\n}\n\n/**\n * Returns the parsed path of the template currently being processed,\n * or `undefined` when called outside the per-template scope (e.g. from\n * `beforeCreate` / `afterBuild`, or outside a build entirely).\n *\n * Usage in an SFC `<script setup>`:\n * ```ts\n * const file = useCurrentTemplate()\n * console.log(file?.name) // 'welcome'\n * ```\n *\n * Usage in an event handler:\n * ```ts\n * beforeRender() {\n * const file = useCurrentTemplate()\n * // file?.dir, file?.name, file?.ext, file?.base, file?.root\n * }\n * ```\n */\nexport function useCurrentTemplate(): ParsedPath | undefined {\n return (globalThis as GlobalWithCurrentTemplate)[KEY]\n}\n"],"mappings":";;;;;;;;AASA,MAAM,MAAM,OAAO,IAAI,yBAAyB;;;;;AAUhD,SAAgB,oBAAoB,QAAsC;CACxE,WAA0C,OAAO;AACnD;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,qBAA6C;CAC3D,OAAQ,WAAyC;AACnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDoctype.d.ts","names":[],"sources":["../../src/composables/useDoctype.ts"],"mappings":";;AAWA;;;;;;;iBAAgB,UAAA,CAAW,OAAA"}
1
+ {"version":3,"file":"useDoctype.d.ts","names":[],"sources":["../../src/composables/useDoctype.ts"],"mappings":";;AAWA;;;;AAA0C;;;iBAA1B,UAAA,CAAW,OAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDoctype.js","names":[],"sources":["../../src/composables/useDoctype.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\n\n/**\n * Set the doctype for the current email template.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useDoctype('<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">')\n * ```\n */\nexport function useDoctype(doctype: string): void {\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.doctype = doctype\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,WAAW,SAAuB;CAChD,MAAM,MAAM,OAAO,iBAAiB;CACpC,IAAI,KAAK,IAAI,UAAU"}
1
+ {"version":3,"file":"useDoctype.js","names":[],"sources":["../../src/composables/useDoctype.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\n\n/**\n * Set the doctype for the current email template.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useDoctype('<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">')\n * ```\n */\nexport function useDoctype(doctype: string): void {\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.doctype = doctype\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,WAAW,SAAuB;CAChD,MAAM,MAAM,OAAO,gBAAgB;CACnC,IAAI,KAAK,IAAI,UAAU;AACzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEvent.js","names":[],"sources":["../../src/composables/useEvent.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { EventName, EventMap } from '../events/index.ts'\n\n/**\n * Register an event handler from within an SFC's <script setup>.\n *\n * Usage:\n * ```ts\n * useEvent('beforeRender', ({ config, template }) => {\n * return template.source.replace('foo', 'bar')\n * })\n * ```\n */\nexport function useEvent<K extends EventName>(name: K, handler: EventMap[K]) {\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.sfcEventHandlers.push({ name, handler })\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgB,SAA8B,MAAS,SAAsB;CAC3E,MAAM,MAAM,OAAO,iBAAiB;CACpC,IAAI,KAAK,IAAI,iBAAiB,KAAK;EAAE;EAAM;EAAS,CAAC"}
1
+ {"version":3,"file":"useEvent.js","names":[],"sources":["../../src/composables/useEvent.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { EventName, EventMap } from '../events/index.ts'\n\n/**\n * Register an event handler from within an SFC's <script setup>.\n *\n * Usage:\n * ```ts\n * useEvent('beforeRender', ({ config, template }) => {\n * return template.source.replace('foo', 'bar')\n * })\n * ```\n */\nexport function useEvent<K extends EventName>(name: K, handler: EventMap[K]) {\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.sfcEventHandlers.push({ name, handler })\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgB,SAA8B,MAAS,SAAsB;CAC3E,MAAM,MAAM,OAAO,gBAAgB;CACnC,IAAI,KAAK,IAAI,iBAAiB,KAAK;EAAE;EAAM;CAAQ,CAAC;AACtD"}
@@ -1 +1 @@
1
- {"version":3,"file":"useFont.d.ts","names":[],"sources":["../../src/composables/useFont.ts"],"mappings":";KA8CY,YAAA;AAAA,UAEK,cAAA;EAFO;;;;AAExB;;EAOE,MAAA;EAoBc;EAlBd,QAAA;EAAA;;;;;EAMA,QAAA,GAAW,YAAA;EAYX;;;;AA+CF;EArDE,GAAA;;EAEA,OAAA;EAmD6C;EAjD7C,OAAA;;EAEA,MAAA,GAAS,KAAA;AAAA;;;;;;;;;;;;;;;;iBA+CK,OAAA,CAAQ,OAAA,EAAS,cAAA"}
1
+ {"version":3,"file":"useFont.d.ts","names":[],"sources":["../../src/composables/useFont.ts"],"mappings":";KA8CY,YAAA;AAAA,UAEK,cAAA;EAFO;;;AAAA;AAExB;;EAOE,MAAA;EAoBc;EAlBd,QAAA;EAAA;;;;;EAMA,QAAA,GAAW,YAAA;EAYX;;;AAAc;AA+ChB;EArDE,GAAA;;EAEA,OAAA;EAmD6C;EAjD7C,OAAA;;EAEA,MAAA,GAAS,KAAK;AAAA;;;;;;;;;;;;;;;;iBA+CA,OAAA,CAAQ,OAAuB,EAAd,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"useFont.js","names":[],"sources":["../../src/composables/useFont.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\n\ntype FontCategory = 'sans' | 'serif' | 'mono' | 'display' | 'handwriting'\n\nconst FAMILY_CATEGORIES: Record<string, FontCategory> = {\n // Sans-serif\n 'Roboto': 'sans',\n 'Open Sans': 'sans',\n 'Inter': 'sans',\n 'Lato': 'sans',\n 'Montserrat': 'sans',\n // Serif\n 'Merriweather': 'serif',\n 'Playfair Display': 'serif',\n 'Lora': 'serif',\n 'PT Serif': 'serif',\n 'Noto Serif': 'serif',\n // Display\n 'Oswald': 'display',\n 'Bebas Neue': 'display',\n 'Anton': 'display',\n 'Lobster': 'display',\n 'Pacifico': 'display',\n // Handwriting\n 'Dancing Script': 'handwriting',\n 'Caveat': 'handwriting',\n 'Shadows Into Light': 'handwriting',\n 'Satisfy': 'handwriting',\n 'Great Vibes': 'handwriting',\n // Monospace\n 'Roboto Mono': 'mono',\n 'Source Code Pro': 'mono',\n 'JetBrains Mono': 'mono',\n 'Fira Code': 'mono',\n 'Inconsolata': 'mono',\n}\n\nconst DEFAULT_FALLBACKS: Record<FontCategory, string> = {\n sans: 'ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif',\n serif: 'ui-serif, Georgia, Cambria, \"Times New Roman\", Times, serif',\n mono: 'ui-monospace, Menlo, Consolas, monospace',\n display: 'Impact, \"Arial Black\", system-ui, sans-serif',\n handwriting: '\"Segoe Script\", \"Brush Script MT\", cursive',\n}\n\nexport type FontProvider = 'google' | 'bunny'\n\nexport interface UseFontOptions {\n /**\n * A single font family name, e.g. `\"Roboto\"` or `\"Open Sans\"`.\n *\n * For fallback fonts, use the `fallback` option instead of a\n * comma-separated list here.\n */\n family: string\n /** CSS fallback list appended to the `font-family` declaration. */\n fallback?: string\n /**\n * Font provider used to build the stylesheet URL when `url` is omitted.\n * Bunny Fonts is a drop-in, privacy-friendly Google Fonts mirror.\n * @default 'google'\n */\n provider?: FontProvider\n /**\n * Stylesheet URL. When provided, used as-is for the `<link href>`.\n * When omitted, a URL is built from `provider`, `family`, `weights`,\n * `display` and `styles`.\n */\n url?: string\n /** Font weights to load. Ignored when `url` is provided. */\n weights?: number[]\n /** `font-display` value. Ignored when `url` is provided. */\n display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional'\n /** Font styles to load. Ignored when `url` is provided. */\n styles?: Array<'normal' | 'italic'>\n}\n\nconst PROVIDER_BASE_URL: Record<FontProvider, string> = {\n google: 'https://fonts.googleapis.com/css2',\n bunny: 'https://fonts.bunny.net/css2',\n}\n\nfunction slugify(family: string): string {\n return family\n .trim()\n .toLowerCase()\n .replace(/\\s+/g, '-')\n .replace(/[^a-z0-9-]/g, '')\n}\n\nfunction buildProviderUrl(opts: Required<Omit<UseFontOptions, 'url' | 'fallback'>>): string {\n const familyParam = opts.family.trim().replace(/\\s+/g, '+')\n const weights = [...opts.weights].sort((a, b) => a - b)\n const hasItalic = opts.styles.includes('italic')\n const hasNormal = opts.styles.includes('normal')\n\n const axis = hasItalic\n ? `:ital,wght@${weights.flatMap(w => [\n ...(hasNormal ? [`0,${w}`] : []),\n `1,${w}`,\n ]).join(';')}`\n : `:wght@${weights.join(';')}`\n\n return `${PROVIDER_BASE_URL[opts.provider]}?family=${familyParam}${axis}&display=${opts.display}`\n}\n\n/**\n * Register a font for the current email template.\n *\n * Builds a Google Fonts stylesheet URL from `family`/`weights`/`display`/`styles`\n * (or uses `url` as-is). The renderer injects a `<link>` tag into `<head>`\n * and merges `--font-{slug}` declarations into the template's existing\n * `@import \"tailwindcss\"` style block so a `font-{slug}` utility class\n * is generated. If no Tailwind import is found, falls back to a `:root`\n * declaration so the CSS variable is still available.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useFont({ family: 'Roboto', fallback: 'Verdana, sans-serif', weights: [400, 600] })\n * ```\n */\nexport function useFont(options: UseFontOptions): void {\n const ctx = inject(RenderContextKey)\n if (!ctx) return\n\n ctx.fonts = ctx.fonts ?? []\n if (ctx.fonts.some(f => f.family === options.family)) return\n\n const url = options.url ?? buildProviderUrl({\n family: options.family,\n provider: options.provider ?? 'google',\n weights: options.weights ?? [400],\n display: options.display ?? 'swap',\n styles: options.styles ?? ['normal'],\n })\n\n const fallback = options.fallback\n ?? DEFAULT_FALLBACKS[FAMILY_CATEGORIES[options.family] ?? 'sans']\n const quoted = /\\s/.test(options.family) ? `\"${options.family}\"` : options.family\n const declaration = `${quoted}, ${fallback}`\n\n ctx.fonts.push({\n family: options.family,\n slug: slugify(options.family),\n declaration,\n url,\n })\n}\n"],"mappings":";;;AAKA,MAAM,oBAAkD;CAEtD,UAAU;CACV,aAAa;CACb,SAAS;CACT,QAAQ;CACR,cAAc;CAEd,gBAAgB;CAChB,oBAAoB;CACpB,QAAQ;CACR,YAAY;CACZ,cAAc;CAEd,UAAU;CACV,cAAc;CACd,SAAS;CACT,WAAW;CACX,YAAY;CAEZ,kBAAkB;CAClB,UAAU;CACV,sBAAsB;CACtB,WAAW;CACX,eAAe;CAEf,eAAe;CACf,mBAAmB;CACnB,kBAAkB;CAClB,aAAa;CACb,eAAe;CAChB;AAED,MAAM,oBAAkD;CACtD,MAAM;CACN,OAAO;CACP,MAAM;CACN,SAAS;CACT,aAAa;CACd;AAkCD,MAAM,oBAAkD;CACtD,QAAQ;CACR,OAAO;CACR;AAED,SAAS,QAAQ,QAAwB;CACvC,OAAO,OACJ,MAAM,CACN,aAAa,CACb,QAAQ,QAAQ,IAAI,CACpB,QAAQ,eAAe,GAAG;;AAG/B,SAAS,iBAAiB,MAAkE;CAC1F,MAAM,cAAc,KAAK,OAAO,MAAM,CAAC,QAAQ,QAAQ,IAAI;CAC3D,MAAM,UAAU,CAAC,GAAG,KAAK,QAAQ,CAAC,MAAM,GAAG,MAAM,IAAI,EAAE;CACvD,MAAM,YAAY,KAAK,OAAO,SAAS,SAAS;CAChD,MAAM,YAAY,KAAK,OAAO,SAAS,SAAS;CAEhD,MAAM,OAAO,YACT,cAAc,QAAQ,SAAQ,MAAK,CACjC,GAAI,YAAY,CAAC,KAAK,IAAI,GAAG,EAAE,EAC/B,KAAK,IACN,CAAC,CAAC,KAAK,IAAI,KACZ,SAAS,QAAQ,KAAK,IAAI;CAE9B,OAAO,GAAG,kBAAkB,KAAK,UAAU,UAAU,cAAc,KAAK,WAAW,KAAK;;;;;;;;;;;;;;;;;AAkB1F,SAAgB,QAAQ,SAA+B;CACrD,MAAM,MAAM,OAAO,iBAAiB;CACpC,IAAI,CAAC,KAAK;CAEV,IAAI,QAAQ,IAAI,SAAS,EAAE;CAC3B,IAAI,IAAI,MAAM,MAAK,MAAK,EAAE,WAAW,QAAQ,OAAO,EAAE;CAEtD,MAAM,MAAM,QAAQ,OAAO,iBAAiB;EAC1C,QAAQ,QAAQ;EAChB,UAAU,QAAQ,YAAY;EAC9B,SAAS,QAAQ,WAAW,CAAC,IAAI;EACjC,SAAS,QAAQ,WAAW;EAC5B,QAAQ,QAAQ,UAAU,CAAC,SAAS;EACrC,CAAC;CAEF,MAAM,WAAW,QAAQ,YACpB,kBAAkB,kBAAkB,QAAQ,WAAW;CAE5D,MAAM,cAAc,GADL,KAAK,KAAK,QAAQ,OAAO,GAAG,IAAI,QAAQ,OAAO,KAAK,QAAQ,OAC7C,IAAI;CAElC,IAAI,MAAM,KAAK;EACb,QAAQ,QAAQ;EAChB,MAAM,QAAQ,QAAQ,OAAO;EAC7B;EACA;EACD,CAAC"}
1
+ {"version":3,"file":"useFont.js","names":[],"sources":["../../src/composables/useFont.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\n\ntype FontCategory = 'sans' | 'serif' | 'mono' | 'display' | 'handwriting'\n\nconst FAMILY_CATEGORIES: Record<string, FontCategory> = {\n // Sans-serif\n 'Roboto': 'sans',\n 'Open Sans': 'sans',\n 'Inter': 'sans',\n 'Lato': 'sans',\n 'Montserrat': 'sans',\n // Serif\n 'Merriweather': 'serif',\n 'Playfair Display': 'serif',\n 'Lora': 'serif',\n 'PT Serif': 'serif',\n 'Noto Serif': 'serif',\n // Display\n 'Oswald': 'display',\n 'Bebas Neue': 'display',\n 'Anton': 'display',\n 'Lobster': 'display',\n 'Pacifico': 'display',\n // Handwriting\n 'Dancing Script': 'handwriting',\n 'Caveat': 'handwriting',\n 'Shadows Into Light': 'handwriting',\n 'Satisfy': 'handwriting',\n 'Great Vibes': 'handwriting',\n // Monospace\n 'Roboto Mono': 'mono',\n 'Source Code Pro': 'mono',\n 'JetBrains Mono': 'mono',\n 'Fira Code': 'mono',\n 'Inconsolata': 'mono',\n}\n\nconst DEFAULT_FALLBACKS: Record<FontCategory, string> = {\n sans: 'ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif',\n serif: 'ui-serif, Georgia, Cambria, \"Times New Roman\", Times, serif',\n mono: 'ui-monospace, Menlo, Consolas, monospace',\n display: 'Impact, \"Arial Black\", system-ui, sans-serif',\n handwriting: '\"Segoe Script\", \"Brush Script MT\", cursive',\n}\n\nexport type FontProvider = 'google' | 'bunny'\n\nexport interface UseFontOptions {\n /**\n * A single font family name, e.g. `\"Roboto\"` or `\"Open Sans\"`.\n *\n * For fallback fonts, use the `fallback` option instead of a\n * comma-separated list here.\n */\n family: string\n /** CSS fallback list appended to the `font-family` declaration. */\n fallback?: string\n /**\n * Font provider used to build the stylesheet URL when `url` is omitted.\n * Bunny Fonts is a drop-in, privacy-friendly Google Fonts mirror.\n * @default 'google'\n */\n provider?: FontProvider\n /**\n * Stylesheet URL. When provided, used as-is for the `<link href>`.\n * When omitted, a URL is built from `provider`, `family`, `weights`,\n * `display` and `styles`.\n */\n url?: string\n /** Font weights to load. Ignored when `url` is provided. */\n weights?: number[]\n /** `font-display` value. Ignored when `url` is provided. */\n display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional'\n /** Font styles to load. Ignored when `url` is provided. */\n styles?: Array<'normal' | 'italic'>\n}\n\nconst PROVIDER_BASE_URL: Record<FontProvider, string> = {\n google: 'https://fonts.googleapis.com/css2',\n bunny: 'https://fonts.bunny.net/css2',\n}\n\nfunction slugify(family: string): string {\n return family\n .trim()\n .toLowerCase()\n .replace(/\\s+/g, '-')\n .replace(/[^a-z0-9-]/g, '')\n}\n\nfunction buildProviderUrl(opts: Required<Omit<UseFontOptions, 'url' | 'fallback'>>): string {\n const familyParam = opts.family.trim().replace(/\\s+/g, '+')\n const weights = [...opts.weights].sort((a, b) => a - b)\n const hasItalic = opts.styles.includes('italic')\n const hasNormal = opts.styles.includes('normal')\n\n const axis = hasItalic\n ? `:ital,wght@${weights.flatMap(w => [\n ...(hasNormal ? [`0,${w}`] : []),\n `1,${w}`,\n ]).join(';')}`\n : `:wght@${weights.join(';')}`\n\n return `${PROVIDER_BASE_URL[opts.provider]}?family=${familyParam}${axis}&display=${opts.display}`\n}\n\n/**\n * Register a font for the current email template.\n *\n * Builds a Google Fonts stylesheet URL from `family`/`weights`/`display`/`styles`\n * (or uses `url` as-is). The renderer injects a `<link>` tag into `<head>`\n * and merges `--font-{slug}` declarations into the template's existing\n * `@import \"tailwindcss\"` style block so a `font-{slug}` utility class\n * is generated. If no Tailwind import is found, falls back to a `:root`\n * declaration so the CSS variable is still available.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useFont({ family: 'Roboto', fallback: 'Verdana, sans-serif', weights: [400, 600] })\n * ```\n */\nexport function useFont(options: UseFontOptions): void {\n const ctx = inject(RenderContextKey)\n if (!ctx) return\n\n ctx.fonts = ctx.fonts ?? []\n if (ctx.fonts.some(f => f.family === options.family)) return\n\n const url = options.url ?? buildProviderUrl({\n family: options.family,\n provider: options.provider ?? 'google',\n weights: options.weights ?? [400],\n display: options.display ?? 'swap',\n styles: options.styles ?? ['normal'],\n })\n\n const fallback = options.fallback\n ?? DEFAULT_FALLBACKS[FAMILY_CATEGORIES[options.family] ?? 'sans']\n const quoted = /\\s/.test(options.family) ? `\"${options.family}\"` : options.family\n const declaration = `${quoted}, ${fallback}`\n\n ctx.fonts.push({\n family: options.family,\n slug: slugify(options.family),\n declaration,\n url,\n })\n}\n"],"mappings":";;;AAKA,MA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I,IAAI,MAAM,MAAK,MAAK,EAAE,WAAW,QAAQ,MAAM,GAAG;CAEtD,MAAM,MAAM,QAAQ,OAAO,iBAAiB;EAC1C,QAAQ,QAAQ;EAChB,UAAU,QAAQ,YAAY;EAC9B,SAAS,QAAQ,WAAW,CAAC,GAAG;EAChC,SAAS,QAAQ,WAAW;EAC5B,QAAQ,QAAQ,UAAU,CAAC,QAAQ;CACrC,CAAC;CAED,MAAM,WAAW,QAAQ,YACpB,kBAAkB,kBAAkB,QAAQ,WAAW;CAE5D,MAAM,cAAc,GADL,KAAK,KAAK,QAAQ,MAAM,IAAI,IAAI,QAAQ,OAAO,KAAK,QAAQ,OAC7C,IAAI;CAElC,IAAI,MAAM,KAAK;EACb,QAAQ,QAAQ;EAChB,MAAM,QAAQ,QAAQ,MAAM;EAC5B;EACA;CACF,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"useOutlookFallback.d.ts","names":[],"sources":["../../src/composables/useOutlookFallback.ts"],"mappings":";;AAoBA;;;;;;;;;;;;;;;iBAAgB,kBAAA,CAAmB,KAAA"}
1
+ {"version":3,"file":"useOutlookFallback.d.ts","names":[],"sources":["../../src/composables/useOutlookFallback.ts"],"mappings":";;AAoBA;;;;AAAyD;;;;;;;;;;;iBAAzC,kBAAA,CAAmB,KAAsB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useOutlookFallback.js","names":[],"sources":["../../src/composables/useOutlookFallback.ts"],"sourcesContent":["import { inject, provide, type InjectionKey } from 'vue'\n\nconst OutlookFallbackKey: InjectionKey<boolean> = Symbol('OutlookFallback')\n\n/**\n * Toggle whether descendants emit Outlook (MSO) and VML fallback markup.\n *\n * Call once in a Layout/template's `<script setup>` to disable for the\n * whole tree:\n * `useOutlookFallback(false)`\n *\n * Components inheriting `false` skip MSO ghost tables, VML rectangles,\n * `xmlns:v`/`xmlns:o`, mso-specific CSS, and Button's `<Outlook>`\n * spacers. Each MSO-aware component still accepts an `outlook-fallback`\n * prop that overrides inheritance for its subtree.\n *\n * @param value Pass `true`/`false` to set; omit to just read the\n * inherited value (defaults to `true` at the root).\n * @returns The resolved boolean for the current component.\n */\nexport function useOutlookFallback(value?: boolean | null): boolean {\n const inherited = inject(OutlookFallbackKey, true)\n const enabled = value == null ? inherited : value\n provide(OutlookFallbackKey, enabled)\n return enabled\n}\n"],"mappings":";;AAEA,MAAM,qBAA4C,OAAO,kBAAkB;;;;;;;;;;;;;;;;;AAkB3E,SAAgB,mBAAmB,OAAiC;CAClE,MAAM,YAAY,OAAO,oBAAoB,KAAK;CAClD,MAAM,UAAU,SAAS,OAAO,YAAY;CAC5C,QAAQ,oBAAoB,QAAQ;CACpC,OAAO"}
1
+ {"version":3,"file":"useOutlookFallback.js","names":[],"sources":["../../src/composables/useOutlookFallback.ts"],"sourcesContent":["import { inject, provide, type InjectionKey } from 'vue'\n\nconst OutlookFallbackKey: InjectionKey<boolean> = Symbol('OutlookFallback')\n\n/**\n * Toggle whether descendants emit Outlook (MSO) and VML fallback markup.\n *\n * Call once in a Layout/template's `<script setup>` to disable for the\n * whole tree:\n * `useOutlookFallback(false)`\n *\n * Components inheriting `false` skip MSO ghost tables, VML rectangles,\n * `xmlns:v`/`xmlns:o`, mso-specific CSS, and Button's `<Outlook>`\n * spacers. Each MSO-aware component still accepts an `outlook-fallback`\n * prop that overrides inheritance for its subtree.\n *\n * @param value Pass `true`/`false` to set; omit to just read the\n * inherited value (defaults to `true` at the root).\n * @returns The resolved boolean for the current component.\n */\nexport function useOutlookFallback(value?: boolean | null): boolean {\n const inherited = inject(OutlookFallbackKey, true)\n const enabled = value == null ? inherited : value\n provide(OutlookFallbackKey, enabled)\n return enabled\n}\n"],"mappings":";;AAEA,MAAM,qBAA4C,OAAO,iBAAiB;;;;;;;;;;;;;;;;;AAkB1E,SAAgB,mBAAmB,OAAiC;CAClE,MAAM,YAAY,OAAO,oBAAoB,IAAI;CACjD,MAAM,UAAU,SAAS,OAAO,YAAY;CAC5C,QAAQ,oBAAoB,OAAO;CACnC,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePlaintext.d.ts","names":[],"sources":["../../src/composables/usePlaintext.ts"],"mappings":";UAGiB,mBAAA;EACf,SAAA;EACA,WAAA;EACA,OAAA,GAAU,MAAA;AAAA;;;;;;;AAcZ;;;;;iBAAgB,YAAA,CAAa,OAAA,GAAU,mBAAA"}
1
+ {"version":3,"file":"usePlaintext.d.ts","names":[],"sources":["../../src/composables/usePlaintext.ts"],"mappings":";UAGiB,mBAAA;EACf,SAAA;EACA,WAAA;EACA,OAAA,GAAU,MAAM;AAAA;;;;;;AAAA;AAclB;;;;AAA0D;iBAA1C,YAAA,CAAa,OAA6B,GAAnB,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePlaintext.js","names":[],"sources":["../../src/composables/usePlaintext.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\n\nexport interface UsePlaintextOptions {\n extension?: string\n destination?: string\n options?: Record<string, unknown>\n}\n\n/**\n * Enable plaintext generation for the current email template.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * usePlaintext()\n * usePlaintext({ extension: 'text' })\n * usePlaintext({ destination: '/custom/path' })\n * usePlaintext({ options: { ignoreTags: ['br'] } })\n * ```\n */\nexport function usePlaintext(options?: UsePlaintextOptions): void {\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.plaintext = options ?? {}\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,SAAgB,aAAa,SAAqC;CAChE,MAAM,MAAM,OAAO,iBAAiB;CACpC,IAAI,KAAK,IAAI,YAAY,WAAW,EAAE"}
1
+ {"version":3,"file":"usePlaintext.js","names":[],"sources":["../../src/composables/usePlaintext.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\n\nexport interface UsePlaintextOptions {\n extension?: string\n destination?: string\n options?: Record<string, unknown>\n}\n\n/**\n * Enable plaintext generation for the current email template.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * usePlaintext()\n * usePlaintext({ extension: 'text' })\n * usePlaintext({ destination: '/custom/path' })\n * usePlaintext({ options: { ignoreTags: ['br'] } })\n * ```\n */\nexport function usePlaintext(options?: UsePlaintextOptions): void {\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.plaintext = options ?? {}\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,SAAgB,aAAa,SAAqC;CAChE,MAAM,MAAM,OAAO,gBAAgB;CACnC,IAAI,KAAK,IAAI,YAAY,WAAW,CAAC;AACvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePreheader.d.ts","names":[],"sources":["../../src/composables/usePreheader.ts"],"mappings":";UAKiB,mBAAA;EAAA;;;;EAKf,MAAA;AAAA;;;;;;;;;;;;;;iBAgBc,YAAA,CAAa,IAAA,UAAc,OAAA,GAAU,mBAAA"}
1
+ {"version":3,"file":"usePreheader.d.ts","names":[],"sources":["../../src/composables/usePreheader.ts"],"mappings":";UAKiB,mBAAA;EAAA;;;;EAKf,MAAM;AAAA;;;;;;;;AAgBgE;;;;;;iBAAxD,YAAA,CAAa,IAAA,UAAc,OAAA,GAAU,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePreheader.js","names":[],"sources":["../../src/composables/usePreheader.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\n\nconst PREVIEW_LENGTH = 200\n\nexport interface UsePreheaderOptions {\n /**\n * Explicit number of filler sequences to render. When omitted, the count\n * is auto-derived to fill the 200-char inbox preview budget.\n */\n spaces?: number\n}\n\n/**\n * Set the preheader text for the current email template.\n *\n * Injects a hidden `<div>` at the start of `<body>` with the preheader text\n * followed by filler characters that prevent email clients from pulling\n * in body content after the preheader.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * usePreheader('Thanks for signing up!')\n * usePreheader('Welcome!', { spaces: 50 })\n * ```\n */\nexport function usePreheader(text: string, options?: UsePreheaderOptions): void {\n const ctx = inject(RenderContextKey)\n if (ctx) {\n const fillerCount = options?.spaces !== undefined\n ? Math.max(0, options.spaces)\n : Math.max(0, PREVIEW_LENGTH - text.length)\n ctx.preheader = { text, fillerCount }\n }\n}\n"],"mappings":";;;AAGA,MAAM,iBAAiB;;;;;;;;;;;;;;AAuBvB,SAAgB,aAAa,MAAc,SAAqC;CAC9E,MAAM,MAAM,OAAO,iBAAiB;CACpC,IAAI,KAIF,IAAI,YAAY;EAAE;EAAM,aAHJ,SAAS,WAAW,KAAA,IACpC,KAAK,IAAI,GAAG,QAAQ,OAAO,GAC3B,KAAK,IAAI,GAAG,iBAAiB,KAAK,OAAO;EACR"}
1
+ {"version":3,"file":"usePreheader.js","names":[],"sources":["../../src/composables/usePreheader.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\n\nconst PREVIEW_LENGTH = 200\n\nexport interface UsePreheaderOptions {\n /**\n * Explicit number of filler sequences to render. When omitted, the count\n * is auto-derived to fill the 200-char inbox preview budget.\n */\n spaces?: number\n}\n\n/**\n * Set the preheader text for the current email template.\n *\n * Injects a hidden `<div>` at the start of `<body>` with the preheader text\n * followed by filler characters that prevent email clients from pulling\n * in body content after the preheader.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * usePreheader('Thanks for signing up!')\n * usePreheader('Welcome!', { spaces: 50 })\n * ```\n */\nexport function usePreheader(text: string, options?: UsePreheaderOptions): void {\n const ctx = inject(RenderContextKey)\n if (ctx) {\n const fillerCount = options?.spaces !== undefined\n ? Math.max(0, options.spaces)\n : Math.max(0, PREVIEW_LENGTH - text.length)\n ctx.preheader = { text, fillerCount }\n }\n}\n"],"mappings":";;;AAGA,MAAM,iBAAiB;;;;;;;;;;;;;;AAuBvB,SAAgB,aAAa,MAAc,SAAqC;CAC9E,MAAM,MAAM,OAAO,gBAAgB;CACnC,IAAI,KAIF,IAAI,YAAY;EAAE;EAAM,aAHJ,SAAS,WAAW,KAAA,IACpC,KAAK,IAAI,GAAG,QAAQ,MAAM,IAC1B,KAAK,IAAI,GAAG,iBAAiB,KAAK,MAAM;CACR;AAExC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTransformers.d.ts","names":[],"sources":["../../src/composables/useTransformers.ts"],"mappings":";;;;;AAiCA;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,eAAA,CAAgB,KAAA,aAAiB,kBAAA"}
1
+ {"version":3,"file":"useTransformers.d.ts","names":[],"sources":["../../src/composables/useTransformers.ts"],"mappings":";;;;;AAiCA;;;;AAA0E;;;;;;;;;;;;;;;;;;;;;iBAA1D,eAAA,CAAgB,KAA0C,aAAzB,kBAAyB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTransformers.js","names":[],"sources":["../../src/composables/useTransformers.ts"],"sourcesContent":["import { getCurrentInstance, inject, provide } from 'vue'\nimport { MaizzleConfigKey } from './useConfig.ts'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { MaizzleConfig, TransformerToggles } from '../types/index.ts'\n\n/**\n * Toggle the transformer pipeline for the current template.\n *\n * - `useTransformers(false)` skips the entire pipeline (CSS inlining,\n * purging, shorthand, etc).\n * - `useTransformers(true)` (or no argument) keeps everything on.\n * - `useTransformers({ inlineCss: false, minify: false })` runs the\n * pipeline but skips the listed transformers.\n * - `useTransformers({ prettify: true, minify: true })` *enables*\n * transformers that would otherwise no-op (boolean-driven ones:\n * inlineCss, purgeCss, prettify, minify, shorthandCss, sixHex,\n * safeSelectors, entities). Same effect as setting their config\n * slice directly, scoped to one template.\n *\n * Data-driven transformers (filters, baseURL, urlQuery, addAttributes,\n * removeAttributes, replaceStrings, attributeToStyle) need actual\n * values in config — a bare `true` toggle for them is a no-op.\n *\n * Mirrors the `useTransformers` config flag, scoped to a single template\n * — no need to edit `maizzle.config.ts`.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useTransformers(false)\n * useTransformers({ inlineCss: false, minify: false })\n * useTransformers({ prettify: true })\n * ```\n */\nexport function useTransformers(value: boolean | TransformerToggles = true): void {\n if (!getCurrentInstance()) return\n\n const ctx = inject(RenderContextKey)\n if (!ctx) return\n\n const globalConfig = inject(MaizzleConfigKey, {} as MaizzleConfig)\n const merged: MaizzleConfig = {\n ...(ctx.sfcConfig ?? globalConfig),\n useTransformers: value,\n }\n\n ctx.sfcConfig = merged\n provide(MaizzleConfigKey, merged)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAgB,gBAAgB,QAAsC,MAAY;CAChF,IAAI,CAAC,oBAAoB,EAAE;CAE3B,MAAM,MAAM,OAAO,iBAAiB;CACpC,IAAI,CAAC,KAAK;CAEV,MAAM,eAAe,OAAO,kBAAkB,EAAE,CAAkB;CAClE,MAAM,SAAwB;EAC5B,GAAI,IAAI,aAAa;EACrB,iBAAiB;EAClB;CAED,IAAI,YAAY;CAChB,QAAQ,kBAAkB,OAAO"}
1
+ {"version":3,"file":"useTransformers.js","names":[],"sources":["../../src/composables/useTransformers.ts"],"sourcesContent":["import { getCurrentInstance, inject, provide } from 'vue'\nimport { MaizzleConfigKey } from './useConfig.ts'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { MaizzleConfig, TransformerToggles } from '../types/index.ts'\n\n/**\n * Toggle the transformer pipeline for the current template.\n *\n * - `useTransformers(false)` skips the entire pipeline (CSS inlining,\n * purging, shorthand, etc).\n * - `useTransformers(true)` (or no argument) keeps everything on.\n * - `useTransformers({ inlineCss: false, minify: false })` runs the\n * pipeline but skips the listed transformers.\n * - `useTransformers({ prettify: true, minify: true })` *enables*\n * transformers that would otherwise no-op (boolean-driven ones:\n * inlineCss, purgeCss, prettify, minify, shorthandCss, sixHex,\n * safeSelectors, entities). Same effect as setting their config\n * slice directly, scoped to one template.\n *\n * Data-driven transformers (filters, baseURL, urlQuery, addAttributes,\n * removeAttributes, replaceStrings, attributeToStyle) need actual\n * values in config — a bare `true` toggle for them is a no-op.\n *\n * Mirrors the `useTransformers` config flag, scoped to a single template\n * — no need to edit `maizzle.config.ts`.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useTransformers(false)\n * useTransformers({ inlineCss: false, minify: false })\n * useTransformers({ prettify: true })\n * ```\n */\nexport function useTransformers(value: boolean | TransformerToggles = true): void {\n if (!getCurrentInstance()) return\n\n const ctx = inject(RenderContextKey)\n if (!ctx) return\n\n const globalConfig = inject(MaizzleConfigKey, {} as MaizzleConfig)\n const merged: MaizzleConfig = {\n ...(ctx.sfcConfig ?? globalConfig),\n useTransformers: value,\n }\n\n ctx.sfcConfig = merged\n provide(MaizzleConfigKey, merged)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAgB,gBAAgB,QAAsC,MAAY;CAChF,IAAI,CAAC,mBAAmB,GAAG;CAE3B,MAAM,MAAM,OAAO,gBAAgB;CACnC,IAAI,CAAC,KAAK;CAEV,MAAM,eAAe,OAAO,kBAAkB,CAAC,CAAkB;CACjE,MAAM,SAAwB;EAC5B,GAAI,IAAI,aAAa;EACrB,iBAAiB;CACnB;CAEA,IAAI,YAAY;CAChB,QAAQ,kBAAkB,MAAM;AAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useUrlQuery.d.ts","names":[],"sources":["../../src/composables/useUrlQuery.ts"],"mappings":";;;;;AAkBA;;;;;;;;;;iBAAgB,WAAA,CAAY,KAAA,EAAO,QAAA"}
1
+ {"version":3,"file":"useUrlQuery.d.ts","names":[],"sources":["../../src/composables/useUrlQuery.ts"],"mappings":";;;;;AAkBA;;;;AAA2C;;;;;;iBAA3B,WAAA,CAAY,KAAe,EAAR,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"useUrlQuery.js","names":["merge"],"sources":["../../src/composables/useUrlQuery.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { defu as merge } from 'defu'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { UrlQuery } from '../types/index.ts'\n\n/**\n * Append query parameters to URLs in the current email template — same\n * as `config.url.query`, scoped to one SFC. Common use: per-template\n * UTM parameters or campaign tracking.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useUrlQuery({ utm_source: 'maizzle', utm_campaign: 'newsletter' })\n * ```\n *\n * Pass `_options` alongside the params to tweak which tags/attributes\n * receive them (see `UrlQueryOptions`).\n */\nexport function useUrlQuery(value: UrlQuery): void {\n const ctx = inject(RenderContextKey)\n if (!ctx) return\n ctx.sfcConfig = merge({ url: { query: value } }, ctx.sfcConfig ?? {})\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,YAAY,OAAuB;CACjD,MAAM,MAAM,OAAO,iBAAiB;CACpC,IAAI,CAAC,KAAK;CACV,IAAI,YAAYA,OAAM,EAAE,KAAK,EAAE,OAAO,OAAO,EAAE,EAAE,IAAI,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"useUrlQuery.js","names":["merge"],"sources":["../../src/composables/useUrlQuery.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { defu as merge } from 'defu'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { UrlQuery } from '../types/index.ts'\n\n/**\n * Append query parameters to URLs in the current email template — same\n * as `config.url.query`, scoped to one SFC. Common use: per-template\n * UTM parameters or campaign tracking.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useUrlQuery({ utm_source: 'maizzle', utm_campaign: 'newsletter' })\n * ```\n *\n * Pass `_options` alongside the params to tweak which tags/attributes\n * receive them (see `UrlQueryOptions`).\n */\nexport function useUrlQuery(value: UrlQuery): void {\n const ctx = inject(RenderContextKey)\n if (!ctx) return\n ctx.sfcConfig = merge({ url: { query: value } }, ctx.sfcConfig ?? {})\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,YAAY,OAAuB;CACjD,MAAM,MAAM,OAAO,gBAAgB;CACnC,IAAI,CAAC,KAAK;CACV,IAAI,YAAYA,OAAM,EAAE,KAAK,EAAE,OAAO,MAAM,EAAE,GAAG,IAAI,aAAa,CAAC,CAAC;AACtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","names":[],"sources":["../../src/config/defaults.ts"],"mappings":";;cAEa,QAAA,EAAU,aAAA"}
1
+ {"version":3,"file":"defaults.d.ts","names":[],"sources":["../../src/config/defaults.ts"],"mappings":";;cAEa,QAAA,EAAU,aA0BtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.js","names":[],"sources":["../../src/config/defaults.ts"],"sourcesContent":["import type { MaizzleConfig } from '../types/index.ts'\n\nexport const defaults: MaizzleConfig = {\n content: ['emails/**/*.{vue,md}'],\n output: {\n path: 'dist',\n extension: 'html',\n },\n static: {\n source: ['public/**/*.*'],\n destination: 'public',\n },\n server: {\n port: 3000,\n watch: [],\n },\n css: {\n inline: true,\n purge: true,\n shorthand: true,\n safe: true,\n preferUnitless: true,\n },\n html: {\n decodeEntities: true,\n format: true,\n },\n useTransformers: true,\n}\n"],"mappings":";AAEA,MAAa,WAA0B;CACrC,SAAS,CAAC,uBAAuB;CACjC,QAAQ;EACN,MAAM;EACN,WAAW;EACZ;CACD,QAAQ;EACN,QAAQ,CAAC,gBAAgB;EACzB,aAAa;EACd;CACD,QAAQ;EACN,MAAM;EACN,OAAO,EAAE;EACV;CACD,KAAK;EACH,QAAQ;EACR,OAAO;EACP,WAAW;EACX,MAAM;EACN,gBAAgB;EACjB;CACD,MAAM;EACJ,gBAAgB;EAChB,QAAQ;EACT;CACD,iBAAiB;CAClB"}
1
+ {"version":3,"file":"defaults.js","names":[],"sources":["../../src/config/defaults.ts"],"sourcesContent":["import type { MaizzleConfig } from '../types/index.ts'\n\nexport const defaults: MaizzleConfig = {\n content: ['emails/**/*.{vue,md}'],\n output: {\n path: 'dist',\n extension: 'html',\n },\n static: {\n source: ['public/**/*.*'],\n destination: 'public',\n },\n server: {\n port: 3000,\n watch: [],\n },\n css: {\n inline: true,\n purge: true,\n shorthand: true,\n safe: true,\n preferUnitless: true,\n },\n html: {\n decodeEntities: true,\n format: true,\n },\n useTransformers: true,\n}\n"],"mappings":";AAEA,MAAa,WAA0B;CACrC,SAAS,CAAC,sBAAsB;CAChC,QAAQ;EACN,MAAM;EACN,WAAW;CACb;CACA,QAAQ;EACN,QAAQ,CAAC,eAAe;EACxB,aAAa;CACf;CACA,QAAQ;EACN,MAAM;EACN,OAAO,CAAC;CACV;CACA,KAAK;EACH,QAAQ;EACR,OAAO;EACP,WAAW;EACX,MAAM;EACN,gBAAgB;CAClB;CACA,MAAM;EACJ,gBAAgB;EAChB,QAAQ;CACV;CACA,iBAAiB;AACnB"}
@@ -34,6 +34,12 @@ async function resolveConfig(config, cwd = process.cwd()) {
34
34
  if (p.startsWith("/") || p.startsWith("!")) return p;
35
35
  return resolve(root, p).replace(/\\/g, "/");
36
36
  });
37
+ /**
38
+ * Resolve components.source paths relative to cwd (not root), since extra
39
+ * component dirs often live outside the root directory. String
40
+ * entries → resolve in-place. Object entries → resolve
41
+ * `path`, preserve `prefix`/`pathPrefix`.
42
+ */
37
43
  if (merged.components?.source) {
38
44
  const dirs = Array.isArray(merged.components.source) ? merged.components.source : [merged.components.source];
39
45
  merged.components.source = dirs.map((entry) => {
@@ -44,6 +50,12 @@ async function resolveConfig(config, cwd = process.cwd()) {
44
50
  };
45
51
  });
46
52
  }
53
+ /**
54
+ * Default css.base to root when root is explicitly set, so Tailwind resolves
55
+ * @source from the right directory. When root is not set, leave
56
+ * css.base undefined so Tailwind uses its own default (the
57
+ * template file's directory).
58
+ */
47
59
  if (hasExplicitRoot && !merged.css?.base) {
48
60
  if (!merged.css) merged.css = {};
49
61
  merged.css.base = root;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/config/index.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { createJiti } from 'jiti'\nimport { fileURLToPath } from 'node:url'\nimport { createDefu } from 'defu'\n\n// defu that replaces arrays: if user provides content: ['x'], it replaces the default, not appends\nconst merge = createDefu((obj, key, value) => {\n if (Array.isArray(obj[key])) {\n obj[key] = value\n return true\n }\n})\nimport { defaults } from './defaults.ts'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nexport { defineConfig } from '../composables/defineConfig.ts'\nexport { defaults } from './defaults.ts'\n\nconst CONFIG_FILES = [\n 'maizzle.config.ts',\n 'maizzle.config.js',\n]\n\n/**\n * Resolve the Maizzle config.\n *\n * Always loads from the config file on disk (maizzle.config.{ts,js}),\n * then merges the programmatic config on top, then fills in defaults.\n */\nexport async function resolveConfig(\n config?: Partial<MaizzleConfig> | string,\n cwd: string = process.cwd(),\n): Promise<MaizzleConfig> {\n // If a string path was provided, load that specific file\n const fileConfig = await loadConfig(\n typeof config === 'string' ? config : undefined,\n cwd,\n )\n\n // Programmatic config (object) overrides file config, which overrides defaults\n const programmaticConfig = typeof config === 'object' && config !== null ? config : {}\n\n const merged = merge(programmaticConfig, fileConfig, defaults) as MaizzleConfig\n\n // Check if root was explicitly provided before resolving\n const hasExplicitRoot = !!(programmaticConfig.root ?? fileConfig.root)\n\n // Resolve root to an absolute path (defaults to cwd)\n const root = resolve(cwd, merged.root ?? '.')\n merged.root = root\n\n // Resolve content patterns relative to root\n if (merged.content) {\n merged.content = merged.content.map(p => {\n // Skip already-absolute or negated patterns\n if (p.startsWith('/') || p.startsWith('!')) return p\n return resolve(root, p).replace(/\\\\/g, '/')\n })\n }\n\n // Resolve static source patterns relative to root\n if (merged.static?.source) {\n merged.static.source = merged.static.source.map(p => {\n if (p.startsWith('/') || p.startsWith('!')) return p\n return resolve(root, p).replace(/\\\\/g, '/')\n })\n }\n\n // Resolve components.source paths relative to cwd (not root),\n // since extra component dirs often live outside the root directory.\n // String entries → resolve in-place. Object entries → resolve `path`,\n // preserve `prefix`/`pathPrefix`.\n if (merged.components?.source) {\n const dirs = Array.isArray(merged.components.source)\n ? merged.components.source\n : [merged.components.source]\n\n merged.components.source = dirs.map(entry => {\n if (typeof entry === 'string') {\n return entry.startsWith('/') ? entry : resolve(cwd, entry)\n }\n return {\n ...entry,\n path: entry.path.startsWith('/') ? entry.path : resolve(cwd, entry.path),\n }\n })\n }\n\n // Default css.base to root when root is explicitly set,\n // so Tailwind resolves @source from the right directory.\n // When root is not set, leave css.base undefined so Tailwind\n // uses its own default (the template file's directory).\n if (hasExplicitRoot && !merged.css?.base) {\n if (!merged.css) merged.css = {}\n merged.css.base = root\n }\n\n return merged\n}\n\nasync function loadConfig(\n configPath?: string,\n cwd: string = process.cwd(),\n): Promise<MaizzleConfig> {\n const jiti = createJiti(fileURLToPath(import.meta.url), { moduleCache: false })\n\n // If an explicit path was provided, use it directly\n if (configPath) {\n const absolutePath = resolve(cwd, configPath)\n\n if (!existsSync(absolutePath)) {\n throw new Error(`Config file not found: ${absolutePath}`)\n }\n\n const mod = await jiti.import(absolutePath) as any\n return mod.default ?? mod\n }\n\n // Otherwise scan cwd for known config file names\n for (const filename of CONFIG_FILES) {\n const filepath = resolve(cwd, filename)\n\n if (existsSync(filepath)) {\n const mod = await jiti.import(filepath) as any\n return mod.default ?? mod\n }\n }\n\n // No config file found, return empty (defaults will be applied by resolveConfig)\n return {}\n}\n"],"mappings":";;;;;;;;AAOA,MAAM,QAAQ,YAAY,KAAK,KAAK,UAAU;CAC5C,IAAI,MAAM,QAAQ,IAAI,KAAK,EAAE;EAC3B,IAAI,OAAO;EACX,OAAO;;EAET;AAOF,MAAM,eAAe,CACnB,qBACA,oBACD;;;;;;;AAQD,eAAsB,cACpB,QACA,MAAc,QAAQ,KAAK,EACH;CAExB,MAAM,aAAa,MAAM,WACvB,OAAO,WAAW,WAAW,SAAS,KAAA,GACtC,IACD;CAGD,MAAM,qBAAqB,OAAO,WAAW,YAAY,WAAW,OAAO,SAAS,EAAE;CAEtF,MAAM,SAAS,MAAM,oBAAoB,YAAY,SAAS;CAG9D,MAAM,kBAAkB,CAAC,EAAE,mBAAmB,QAAQ,WAAW;CAGjE,MAAM,OAAO,QAAQ,KAAK,OAAO,QAAQ,IAAI;CAC7C,OAAO,OAAO;CAGd,IAAI,OAAO,SACT,OAAO,UAAU,OAAO,QAAQ,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,QAAQ,KAAK,SAAS;EAEvC,IAAI,WAAW,SAAS,EAAE;GACxB,MAAM,MAAM,MAAM,KAAK,OAAO,SAAS;GACvC,OAAO,IAAI,WAAW;;;CAK1B,OAAO,EAAE"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/config/index.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { createJiti } from 'jiti'\nimport { fileURLToPath } from 'node:url'\nimport { createDefu } from 'defu'\n\n// defu that replaces arrays: if user provides content: ['x'], it replaces the default, not appends\nconst merge = createDefu((obj, key, value) => {\n if (Array.isArray(obj[key])) {\n obj[key] = value\n return true\n }\n})\nimport { defaults } from './defaults.ts'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nexport { defineConfig } from '../composables/defineConfig.ts'\nexport { defaults } from './defaults.ts'\n\nconst CONFIG_FILES = [\n 'maizzle.config.ts',\n 'maizzle.config.js',\n]\n\n/**\n * Resolve the Maizzle config.\n *\n * Always loads from the config file on disk (maizzle.config.{ts,js}),\n * then merges the programmatic config on top, then fills in defaults.\n */\nexport async function resolveConfig(\n config?: Partial<MaizzleConfig> | string,\n cwd: string = process.cwd(),\n): Promise<MaizzleConfig> {\n // If a string path was provided, load that specific file\n const fileConfig = await loadConfig(\n typeof config === 'string' ? config : undefined,\n cwd,\n )\n\n // Programmatic config (object) overrides file config, which overrides defaults\n const programmaticConfig = typeof config === 'object' && config !== null ? config : {}\n\n const merged = merge(programmaticConfig, fileConfig, defaults) as MaizzleConfig\n\n // Check if root was explicitly provided before resolving\n const hasExplicitRoot = !!(programmaticConfig.root ?? fileConfig.root)\n\n // Resolve root to an absolute path (defaults to cwd)\n const root = resolve(cwd, merged.root ?? '.')\n merged.root = root\n\n // Resolve content patterns relative to root\n if (merged.content) {\n merged.content = merged.content.map(p => {\n // Skip already-absolute or negated patterns\n if (p.startsWith('/') || p.startsWith('!')) return p\n return resolve(root, p).replace(/\\\\/g, '/')\n })\n }\n\n // Resolve static source patterns relative to root\n if (merged.static?.source) {\n merged.static.source = merged.static.source.map(p => {\n if (p.startsWith('/') || p.startsWith('!')) return p\n return resolve(root, p).replace(/\\\\/g, '/')\n })\n }\n\n /**\n * Resolve components.source paths relative to cwd (not root), since extra\n * component dirs often live outside the root directory. String\n * entries → resolve in-place. Object entries → resolve\n * `path`, preserve `prefix`/`pathPrefix`.\n */\n if (merged.components?.source) {\n const dirs = Array.isArray(merged.components.source)\n ? merged.components.source\n : [merged.components.source]\n\n merged.components.source = dirs.map(entry => {\n if (typeof entry === 'string') {\n return entry.startsWith('/') ? entry : resolve(cwd, entry)\n }\n return {\n ...entry,\n path: entry.path.startsWith('/') ? entry.path : resolve(cwd, entry.path),\n }\n })\n }\n\n /**\n * Default css.base to root when root is explicitly set, so Tailwind resolves\n * @source from the right directory. When root is not set, leave\n * css.base undefined so Tailwind uses its own default (the\n * template file's directory).\n */\n if (hasExplicitRoot && !merged.css?.base) {\n if (!merged.css) merged.css = {}\n merged.css.base = root\n }\n\n return merged\n}\n\nasync function loadConfig(\n configPath?: string,\n cwd: string = process.cwd(),\n): Promise<MaizzleConfig> {\n const jiti = createJiti(fileURLToPath(import.meta.url), { moduleCache: false })\n\n // If an explicit path was provided, use it directly\n if (configPath) {\n const absolutePath = resolve(cwd, configPath)\n\n if (!existsSync(absolutePath)) {\n throw new Error(`Config file not found: ${absolutePath}`)\n }\n\n const mod = await jiti.import(absolutePath) as any\n return mod.default ?? mod\n }\n\n // Otherwise scan cwd for known config file names\n for (const filename of CONFIG_FILES) {\n const filepath = resolve(cwd, filename)\n\n if (existsSync(filepath)) {\n const mod = await jiti.import(filepath) as any\n return mod.default ?? mod\n }\n }\n\n // No config file found, return empty (defaults will be applied by resolveConfig)\n return {}\n}\n"],"mappings":";;;;;;;;AAOA,MAAM,QAAQ,YAAY,KAAK,KAAK,UAAU;CAC5C,IAAI,MAAM,QAAQ,IAAI,IAAI,GAAG;EAC3B,IAAI,OAAO;EACX,OAAO;CACT;AACF,CAAC;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AC,OAAO,KAAK,MAAM;EACxC,IAAI,CAAC,OAAO,KAAK,OAAO,MAAM,CAAC;EAC/B,OAAO,IAAI,OAAO;CACpB;CAEA,OAAO;AACT;AAEA,eAAe,WACb,YACA,MAAc,QAAQ,IAAI,GACF;CACxB,MAAM,OAAO,WAAW,cAAc,OAAO,KAAK,GAAG,GAAG,EAAE,aAAa,MAAM,CAAC;CAG9E,IAAI,YAAY;EACd,MAAM,eAAe,QAAQ,KAAK,UAAU;EAE5C,IAAI,CAAC,WAAW,YAAY,GAC1B,MAAM,IAAI,MAAM,0BAA0B,cAAc;EAG1D,MAAM,MAAM,MAAM,KAAK,OAAO,YAAY;EAC1C,OAAO,IAAI,WAAW;CACxB;CAGA,KAAK,MAAM,YAAY,cAAc;EACnC,MAAM,WAAW,QAAQ,KAAK,QAAQ;EAEtC,IAAI,WAAW,QAAQ,GAAG;GACxB,MAAM,MAAM,MAAM,KAAK,OAAO,QAAQ;GACtC,OAAO,IAAI,WAAW;EACxB;CACF;CAGA,OAAO,CAAC;AACV"}
@@ -44,6 +44,11 @@ interface EventMap {
44
44
  */
45
45
  declare class EventManager {
46
46
  private handlers;
47
+ /**
48
+ * Snapshot of config-handler counts per event, captured at registerConfig().
49
+ * clearSfcHandlers() truncates each list back to this count, dropping
50
+ * any SFC-registered handlers that were appended after.
51
+ */
47
52
  private configHandlerCount;
48
53
  /**
49
54
  * Register handlers from the Maizzle config.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/events/index.ts"],"mappings":";;;;KAGY,SAAA;;;AAAZ;;;UAOiB,YAAA;EACf,MAAA;EACA,IAAA,EAAM,UAAA;AAAA;AAAA,UAGS,QAAA;EACf,YAAA,GAAe,MAAA;IAAU,MAAA,EAAQ,aAAA;EAAA,aAA2B,OAAA;EAC5D,YAAA,GAAe,MAAA;IAAU,MAAA,EAAQ,aAAA;IAAe,QAAA,EAAU,YAAA;EAAA,sBAAmC,OAAA;EAC7F,WAAA,GAAc,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AQ,aAAA;EAAA,IAAe,OAAA;EAgBrC;;;;;;;;EAAlC,gBAAA,CAAiB,MAAA,GAAQ,SAAA;EA9FZ;;;EA4Gb,KAAA,CAAA;AAAA"}
@@ -8,6 +8,11 @@
8
8
  */
9
9
  var EventManager = class {
10
10
  handlers = /* @__PURE__ */ new Map();
11
+ /**
12
+ * Snapshot of config-handler counts per event, captured at registerConfig().
13
+ * clearSfcHandlers() truncates each list back to this count, dropping
14
+ * any SFC-registered handlers that were appended after.
15
+ */
11
16
  configHandlerCount = /* @__PURE__ */ new Map();
12
17
  /**
13
18
  * Register handlers from the Maizzle config.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/events/index.ts"],"sourcesContent":["import type { ParsedPath } from 'node:path'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nexport type EventName = 'beforeCreate' | 'beforeRender' | 'afterRender' | 'afterTransform' | 'afterBuild'\n\n/**\n * Info about the template currently being processed, passed to per-template\n * event handlers. `source` is the SFC file contents; `path` is the result of\n * `path.parse(absolutePath)` — `{ root, dir, base, ext, name }`.\n */\nexport interface TemplateInfo {\n source: string\n path: ParsedPath\n}\n\nexport interface EventMap {\n beforeCreate: (params: { config: MaizzleConfig }) => void | Promise<void>\n beforeRender: (params: { config: MaizzleConfig; template: TemplateInfo }) => string | void | Promise<string | void>\n afterRender: (params: { config: MaizzleConfig; template: TemplateInfo; html: string }) => string | void | Promise<string | void>\n afterTransform: (params: { config: MaizzleConfig; template: TemplateInfo; html: string }) => string | void | Promise<string | void>\n afterBuild: (params: { files: string[]; config: MaizzleConfig }) => void | Promise<void>\n}\n\n/**\n * Central event manager that collects handlers from config and useEvent() calls.\n *\n * Handlers are run in order: config handler first, then SFC handlers in registration order.\n * For events that return a value (beforeRender, afterRender, afterTransform),\n * the returned value replaces the corresponding input for the next handler.\n */\nexport class EventManager {\n private handlers = new Map<EventName, EventMap[EventName][]>()\n // Snapshot of config-handler counts per event, captured at registerConfig().\n // clearSfcHandlers() truncates each list back to this count, dropping any\n // SFC-registered handlers that were appended after.\n private configHandlerCount = new Map<EventName, number>()\n\n /**\n * Register handlers from the Maizzle config.\n */\n registerConfig(config: MaizzleConfig) {\n const eventNames: EventName[] = ['beforeCreate', 'beforeRender', 'afterRender', 'afterTransform', 'afterBuild']\n\n for (const name of eventNames) {\n const handler = config[name]\n if (typeof handler === 'function') {\n this.on(name, handler as EventMap[typeof name])\n }\n this.configHandlerCount.set(name, this.handlers.get(name)?.length ?? 0)\n }\n }\n\n /**\n * Register a handler for an event (used by useEvent composable).\n */\n on<K extends EventName>(name: K, handler: EventMap[K]) {\n if (!this.handlers.has(name)) {\n this.handlers.set(name, [])\n }\n\n this.handlers.get(name)!.push(handler)\n }\n\n /**\n * Fire beforeCreate — runs all handlers, config is mutated in place.\n */\n async fireBeforeCreate(params: { config: MaizzleConfig }) {\n const handlers = this.handlers.get('beforeCreate') ?? []\n\n for (const handler of handlers) {\n await (handler as EventMap['beforeCreate'])(params)\n }\n }\n\n /**\n * Fire beforeRender — if a handler returns a string, it replaces\n * `template.source` for subsequent handlers and the renderer.\n */\n async fireBeforeRender(params: { config: MaizzleConfig; template: TemplateInfo }): Promise<string> {\n const handlers = this.handlers.get('beforeRender') ?? []\n\n for (const handler of handlers) {\n const result = await (handler as EventMap['beforeRender'])(params)\n\n if (typeof result === 'string') {\n params.template.source = result\n }\n }\n\n return params.template.source\n }\n\n /**\n * Fire afterRender — if a handler returns a string, it replaces `html`.\n */\n async fireAfterRender(params: { config: MaizzleConfig; template: TemplateInfo; html: string }): Promise<string> {\n const handlers = this.handlers.get('afterRender') ?? []\n\n let { html } = params\n\n for (const handler of handlers) {\n const result = await (handler as EventMap['afterRender'])({ config: params.config, template: params.template, html })\n\n if (typeof result === 'string') {\n html = result\n }\n }\n\n return html\n }\n\n /**\n * Fire afterTransform — if a handler returns a string, it replaces `html`.\n */\n async fireAfterTransform(params: { config: MaizzleConfig; template: TemplateInfo; html: string }): Promise<string> {\n const handlers = this.handlers.get('afterTransform') ?? []\n\n let { html } = params\n\n for (const handler of handlers) {\n const result = await (handler as EventMap['afterTransform'])({ config: params.config, template: params.template, html })\n\n if (typeof result === 'string') {\n html = result\n }\n }\n\n return html\n }\n\n /**\n * Fire afterBuild — runs all handlers with the file list.\n */\n async fireAfterBuild(params: { files: string[]; config: MaizzleConfig }) {\n const handlers = this.handlers.get('afterBuild') ?? []\n\n for (const handler of handlers) {\n await (handler as EventMap['afterBuild'])(params)\n }\n }\n\n /**\n * Drop SFC-registered handlers, keep config-registered ones.\n *\n * Per default, only clears events whose scope is per-template\n * (`beforeRender`, `afterRender`, `afterTransform`). Build-scoped events\n * (`afterBuild`) accumulate across all templates and fire once at end of\n * build. Pass an explicit list to override.\n */\n clearSfcHandlers(events: EventName[] = ['beforeRender', 'afterRender', 'afterTransform']) {\n for (const name of events) {\n const handlers = this.handlers.get(name)\n if (!handlers) continue\n const keep = this.configHandlerCount.get(name) ?? 0\n if (handlers.length > keep) {\n this.handlers.set(name, handlers.slice(0, keep))\n }\n }\n }\n\n /**\n * Clear all handlers entirely.\n */\n clear() {\n this.handlers.clear()\n }\n}\n"],"mappings":";;;;;;;;AA8BA,IAAa,eAAb,MAA0B;CACxB,2BAAmB,IAAI,KAAuC;CAI9D,qCAA6B,IAAI,KAAwB;;;;CAKzD,eAAe,QAAuB;EAGpC,KAAK,MAAM,QAAQ;GAFc;GAAgB;GAAgB;GAAe;GAAkB;GAErE,EAAE;GAC7B,MAAM,UAAU,OAAO;GACvB,IAAI,OAAO,YAAY,YACrB,KAAK,GAAG,MAAM,QAAiC;GAEjD,KAAK,mBAAmB,IAAI,MAAM,KAAK,SAAS,IAAI,KAAK,EAAE,UAAU,EAAE;;;;;;CAO3E,GAAwB,MAAS,SAAsB;EACrD,IAAI,CAAC,KAAK,SAAS,IAAI,KAAK,EAC1B,KAAK,SAAS,IAAI,MAAM,EAAE,CAAC;EAG7B,KAAK,SAAS,IAAI,KAAK,CAAE,KAAK,QAAQ;;;;;C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,MAAM,OAAO,KAAK,mBAAmB,IAAI,KAAK,IAAI;GAClD,IAAI,SAAS,SAAS,MACpB,KAAK,SAAS,IAAI,MAAM,SAAS,MAAM,GAAG,KAAK,CAAC;;;;;;CAQtD,QAAQ;EACN,KAAK,SAAS,OAAO"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/events/index.ts"],"sourcesContent":["import type { ParsedPath } from 'node:path'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nexport type EventName = 'beforeCreate' | 'beforeRender' | 'afterRender' | 'afterTransform' | 'afterBuild'\n\n/**\n * Info about the template currently being processed, passed to per-template\n * event handlers. `source` is the SFC file contents; `path` is the result of\n * `path.parse(absolutePath)` — `{ root, dir, base, ext, name }`.\n */\nexport interface TemplateInfo {\n source: string\n path: ParsedPath\n}\n\nexport interface EventMap {\n beforeCreate: (params: { config: MaizzleConfig }) => void | Promise<void>\n beforeRender: (params: { config: MaizzleConfig; template: TemplateInfo }) => string | void | Promise<string | void>\n afterRender: (params: { config: MaizzleConfig; template: TemplateInfo; html: string }) => string | void | Promise<string | void>\n afterTransform: (params: { config: MaizzleConfig; template: TemplateInfo; html: string }) => string | void | Promise<string | void>\n afterBuild: (params: { files: string[]; config: MaizzleConfig }) => void | Promise<void>\n}\n\n/**\n * Central event manager that collects handlers from config and useEvent() calls.\n *\n * Handlers are run in order: config handler first, then SFC handlers in registration order.\n * For events that return a value (beforeRender, afterRender, afterTransform),\n * the returned value replaces the corresponding input for the next handler.\n */\nexport class EventManager {\n private handlers = new Map<EventName, EventMap[EventName][]>()\n /**\n * Snapshot of config-handler counts per event, captured at registerConfig().\n * clearSfcHandlers() truncates each list back to this count, dropping\n * any SFC-registered handlers that were appended after.\n */\n private configHandlerCount = new Map<EventName, number>()\n\n /**\n * Register handlers from the Maizzle config.\n */\n registerConfig(config: MaizzleConfig) {\n const eventNames: EventName[] = ['beforeCreate', 'beforeRender', 'afterRender', 'afterTransform', 'afterBuild']\n\n for (const name of eventNames) {\n const handler = config[name]\n if (typeof handler === 'function') {\n this.on(name, handler as EventMap[typeof name])\n }\n this.configHandlerCount.set(name, this.handlers.get(name)?.length ?? 0)\n }\n }\n\n /**\n * Register a handler for an event (used by useEvent composable).\n */\n on<K extends EventName>(name: K, handler: EventMap[K]) {\n if (!this.handlers.has(name)) {\n this.handlers.set(name, [])\n }\n\n this.handlers.get(name)!.push(handler)\n }\n\n /**\n * Fire beforeCreate — runs all handlers, config is mutated in place.\n */\n async fireBeforeCreate(params: { config: MaizzleConfig }) {\n const handlers = this.handlers.get('beforeCreate') ?? []\n\n for (const handler of handlers) {\n await (handler as EventMap['beforeCreate'])(params)\n }\n }\n\n /**\n * Fire beforeRender — if a handler returns a string, it replaces\n * `template.source` for subsequent handlers and the renderer.\n */\n async fireBeforeRender(params: { config: MaizzleConfig; template: TemplateInfo }): Promise<string> {\n const handlers = this.handlers.get('beforeRender') ?? []\n\n for (const handler of handlers) {\n const result = await (handler as EventMap['beforeRender'])(params)\n\n if (typeof result === 'string') {\n params.template.source = result\n }\n }\n\n return params.template.source\n }\n\n /**\n * Fire afterRender — if a handler returns a string, it replaces `html`.\n */\n async fireAfterRender(params: { config: MaizzleConfig; template: TemplateInfo; html: string }): Promise<string> {\n const handlers = this.handlers.get('afterRender') ?? []\n\n let { html } = params\n\n for (const handler of handlers) {\n const result = await (handler as EventMap['afterRender'])({ config: params.config, template: params.template, html })\n\n if (typeof result === 'string') {\n html = result\n }\n }\n\n return html\n }\n\n /**\n * Fire afterTransform — if a handler returns a string, it replaces `html`.\n */\n async fireAfterTransform(params: { config: MaizzleConfig; template: TemplateInfo; html: string }): Promise<string> {\n const handlers = this.handlers.get('afterTransform') ?? []\n\n let { html } = params\n\n for (const handler of handlers) {\n const result = await (handler as EventMap['afterTransform'])({ config: params.config, template: params.template, html })\n\n if (typeof result === 'string') {\n html = result\n }\n }\n\n return html\n }\n\n /**\n * Fire afterBuild — runs all handlers with the file list.\n */\n async fireAfterBuild(params: { files: string[]; config: MaizzleConfig }) {\n const handlers = this.handlers.get('afterBuild') ?? []\n\n for (const handler of handlers) {\n await (handler as EventMap['afterBuild'])(params)\n }\n }\n\n /**\n * Drop SFC-registered handlers, keep config-registered ones.\n *\n * Per default, only clears events whose scope is per-template\n * (`beforeRender`, `afterRender`, `afterTransform`). Build-scoped events\n * (`afterBuild`) accumulate across all templates and fire once at end of\n * build. Pass an explicit list to override.\n */\n clearSfcHandlers(events: EventName[] = ['beforeRender', 'afterRender', 'afterTransform']) {\n for (const name of events) {\n const handlers = this.handlers.get(name)\n if (!handlers) continue\n const keep = this.configHandlerCount.get(name) ?? 0\n if (handlers.length > keep) {\n this.handlers.set(name, handlers.slice(0, keep))\n }\n }\n }\n\n /**\n * Clear all handlers entirely.\n */\n clear() {\n this.handlers.clear()\n }\n}\n"],"mappings":";;;;;;;;AA8BA,IAAa,eAAb,MAA0B;CACxB,2BAAmB,IAAI,IAAsC;;;;;;CAM7D,qCAA6B,IAAI,IAAuB;;;;CAKxD,eAAe,QAAuB;EAGpC,KAAK,MAAM,QAAQ;GAFc;GAAgB;GAAgB;GAAe;GAAkB;EAEtE,GAAG;GAC7B,MAAM,UAAU,OAAO;GACvB,IAAI,OAAO,YAAY,YACrB,KAAK,GAAG,MAAM,OAAgC;GAEhD,KAAK,mBAAmB,IAAI,MAAM,KAAK,SAAS,IAAI,IAAI,GAAG,UAAU,CAAC;EACxE;CACF;;;;CAKA,GAAwB,MAAS,SAAsB;EACrD,IAAI,CAAC,KAAK,SAAS,IAAI,IAAI,GACzB,KAAK,SAAS,IAAI,MAAM,CAAC,CAAC;EAG5B,KAAK,SAAS,IAAI,IAAI,EAAG,KAAK,OAAO;CACvC;;;;CAKA,MAAM,iBAAiB,QAAmC;EACxD,MAAM,WAAW,KAAK,SAAS,IAAI,cAAc,KAAK,CAAC;EAEvD,KAAK,MAAM,WAAW,UACpB,MAAO,QAAqC,MAAM;CAEtD;;;;;CAMA,MAAM,iBAAiB,QAA4E;EACjG,MAAM,WAAW,KAAK,S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;EACN,KAAK,SAAS,MAAM;CACtB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"plaintext.d.ts","names":[],"sources":["../src/plaintext.ts"],"mappings":";iBAUgB,eAAA,CAAgB,IAAA,UAAc,OAAA,GAAU,MAAA"}
1
+ {"version":3,"file":"plaintext.d.ts","names":[],"sources":["../src/plaintext.ts"],"mappings":";iBAUgB,eAAA,CAAgB,IAAA,UAAc,OAAA,GAAU,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"plaintext.js","names":[],"sources":["../src/plaintext.ts"],"sourcesContent":["import { stripHtml } from 'string-strip-html'\nimport defu from 'defu'\n\nconst defaults = {\n dumpLinkHrefsNearby: {\n enabled: true,\n putOnNewLine: true,\n },\n}\n\nexport function createPlaintext(html: string, options?: Record<string, unknown>): string {\n return stripHtml(html, defu(options, defaults)).result\n}\n"],"mappings":";;;AAGA,MAAM,WAAW,EACf,qBAAqB;CACnB,SAAS;CACT,cAAc;CACf,EACF;AAED,SAAgB,gBAAgB,MAAc,SAA2C;CACvF,OAAO,UAAU,MAAM,KAAK,SAAS,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"plaintext.js","names":[],"sources":["../src/plaintext.ts"],"sourcesContent":["import { stripHtml } from 'string-strip-html'\nimport defu from 'defu'\n\nconst defaults = {\n dumpLinkHrefsNearby: {\n enabled: true,\n putOnNewLine: true,\n },\n}\n\nexport function createPlaintext(html: string, options?: Record<string, unknown>): string {\n return stripHtml(html, defu(options, defaults)).result\n}\n"],"mappings":";;;AAGA,MAAM,WAAW,EACf,qBAAqB;CACnB,SAAS;CACT,cAAc;AAChB,EACF;AAEA,SAAgB,gBAAgB,MAAc,SAA2C;CACvF,OAAO,UAAU,MAAM,KAAK,SAAS,QAAQ,CAAC,EAAE;AAClD"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type { Plugin, ViteDevServer } from 'vite'\nimport type { MaizzleConfig } from './types/index.ts'\nimport { isLaravel } from './utils/detect.ts'\n\n/**\n * Maizzle Vite plugin for use inside an existing Vite project.\n *\n * - During `vite dev`: starts a separate Maizzle dev server on its own port\n * - During `vite build`: builds email templates alongside the host app\n *\n * Does NOT inject Vue, Tailwind, or any other plugins into the host's pipeline.\n * The host app manages its own stack. Maizzle runs in its own process.\n */\nexport function maizzle(configInput?: Partial<MaizzleConfig>): Plugin[] {\n let maizzleServer: ViteDevServer | null = null\n\n // Auto-configure defaults for Laravel projects\n if (isLaravel()) {\n const existing = configInput?.components?.source\n const laravelComponentDir = 'resources/js/components/email'\n\n if (!existing) {\n configInput = {\n ...configInput,\n components: {\n ...configInput?.components,\n source: [laravelComponentDir],\n },\n }\n }\n }\n\n return [{\n name: 'maizzle',\n\n async configureServer(hostServer) {\n // Close previous Maizzle server if the host restarts\n if (maizzleServer) {\n await maizzleServer.close()\n maizzleServer = null\n }\n\n const { serve } = await import('./serve.ts')\n maizzleServer = await serve({ config: configInput })\n\n // Clean up when the host server closes\n hostServer.httpServer?.on('close', () => {\n if (maizzleServer) {\n maizzleServer.close()\n maizzleServer = null\n }\n })\n },\n\n async closeBundle() {\n if (this.meta.watchMode) return\n\n const { build } = await import('./build.ts')\n await build(configInput)\n },\n\n async buildEnd() {\n if (maizzleServer) {\n await maizzleServer.close()\n maizzleServer = null\n }\n },\n }]\n}\n"],"mappings":";;;;;;;;;;;AAaA,SAAgB,QAAQ,aAAgD;CACtE,IAAI,gBAAsC;CAG1C,IAAI,WAAW,EAAE;EACf,MAAM,WAAW,aAAa,YAAY;EAC1C,MAAM,sBAAsB;EAE5B,IAAI,CAAC,UACH,cAAc;GACZ,GAAG;GACH,YAAY;IACV,GAAG,aAAa;IAChB,QAAQ,CAAC,oBAAoB;IAC9B;GACF;;CAIL,OAAO,CAAC;EACN,MAAM;EAEN,MAAM,gBAAgB,YAAY;GAEhC,IAAI,eAAe;IACjB,MAAM,cAAc,OAAO;IAC3B,gBAAgB;;GAGlB,MAAM,EAAE,UAAU,MAAM,OAAO;GAC/B,gBAAgB,MAAM,MAAM,EAAE,QAAQ,aAAa,CAAC;GAGpD,WAAW,YAAY,GAAG,eAAe;IACvC,IAAI,eAAe;KACjB,cAAc,OAAO;KACrB,gBAAgB;;KAElB;;EAGJ,MAAM,cAAc;GAClB,IAAI,KAAK,KAAK,WAAW;GAEzB,MAAM,EAAE,UAAU,MAAM,OAAO;GAC/B,MAAM,MAAM,YAAY;;EAG1B,MAAM,WAAW;GACf,IAAI,eAAe;IACjB,MAAM,cAAc,OAAO;IAC3B,gBAAgB;;;EAGrB,CAAC"}
1
+ {"version":3,"file":"plugin.js","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type { Plugin, ViteDevServer } from 'vite'\nimport type { MaizzleConfig } from './types/index.ts'\nimport { isLaravel } from './utils/detect.ts'\n\n/**\n * Maizzle Vite plugin for use inside an existing Vite project.\n *\n * - During `vite dev`: starts a separate Maizzle dev server on its own port\n * - During `vite build`: builds email templates alongside the host app\n *\n * Does NOT inject Vue, Tailwind, or any other plugins into the host's pipeline.\n * The host app manages its own stack. Maizzle runs in its own process.\n */\nexport function maizzle(configInput?: Partial<MaizzleConfig>): Plugin[] {\n let maizzleServer: ViteDevServer | null = null\n\n // Auto-configure defaults for Laravel projects\n if (isLaravel()) {\n const existing = configInput?.components?.source\n const laravelComponentDir = 'resources/js/components/email'\n\n if (!existing) {\n configInput = {\n ...configInput,\n components: {\n ...configInput?.components,\n source: [laravelComponentDir],\n },\n }\n }\n }\n\n return [{\n name: 'maizzle',\n\n async configureServer(hostServer) {\n // Close previous Maizzle server if the host restarts\n if (maizzleServer) {\n await maizzleServer.close()\n maizzleServer = null\n }\n\n const { serve } = await import('./serve.ts')\n maizzleServer = await serve({ config: configInput })\n\n // Clean up when the host server closes\n hostServer.httpServer?.on('close', () => {\n if (maizzleServer) {\n maizzleServer.close()\n maizzleServer = null\n }\n })\n },\n\n async closeBundle() {\n if (this.meta.watchMode) return\n\n const { build } = await import('./build.ts')\n await build(configInput)\n },\n\n async buildEnd() {\n if (maizzleServer) {\n await maizzleServer.close()\n maizzleServer = null\n }\n },\n }]\n}\n"],"mappings":";;;;;;;;;;;AAaA,SAAgB,QAAQ,aAAgD;CACtE,IAAI,gBAAsC;CAG1C,IAAI,UAAU,GAAG;EACf,MAAM,WAAW,aAAa,YAAY;EAC1C,MAAM,sBAAsB;EAE5B,IAAI,CAAC,UACH,cAAc;GACZ,GAAG;GACH,YAAY;IACV,GAAG,aAAa;IAChB,QAAQ,CAAC,mBAAmB;GAC9B;EACF;CAEJ;CAEA,OAAO,CAAC;EACN,MAAM;EAEN,MAAM,gBAAgB,YAAY;GAEhC,IAAI,eAAe;IACjB,MAAM,cAAc,MAAM;IAC1B,gBAAgB;GAClB;GAEA,MAAM,EAAE,UAAU,MAAM,OAAO;GAC/B,gBAAgB,MAAM,MAAM,EAAE,QAAQ,YAAY,CAAC;GAGnD,WAAW,YAAY,GAAG,eAAe;IACvC,IAAI,eAAe;KACjB,cAAc,MAAM;KACpB,gBAAgB;IAClB;GACF,CAAC;EACH;EAEA,MAAM,cAAc;GAClB,IAAI,KAAK,KAAK,WAAW;GAEzB,MAAM,EAAE,UAAU,MAAM,OAAO;GAC/B,MAAM,MAAM,WAAW;EACzB;EAEA,MAAM,WAAW;GACf,IAAI,eAAe;IACjB,MAAM,cAAc,MAAM;IAC1B,gBAAgB;GAClB;EACF;CACF,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"mergeMediaQueries.d.ts","names":[],"sources":["../../../src/plugins/postcss/mergeMediaQueries.ts"],"mappings":";;;;;;AAcA;;;;;;;;iBAAgB,iBAAA,CAAkB,MAAA,EAAQ,aAAA,GAAgB,OAAA,CAAQ,MAAA"}
1
+ {"version":3,"file":"mergeMediaQueries.d.ts","names":[],"sources":["../../../src/plugins/postcss/mergeMediaQueries.ts"],"mappings":";;;;;;AAcA;;;;;;;;iBAAgB,iBAAA,CAAkB,MAAA,EAAQ,aAAA,GAAgB,OAAA,CAAQ,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"mergeMediaQueries.js","names":[],"sources":["../../../src/plugins/postcss/mergeMediaQueries.ts"],"sourcesContent":["import sortMediaQueries from 'postcss-sort-media-queries'\nimport type postcss from 'postcss'\nimport type { MaizzleConfig } from '../../types/config.ts'\n\n/**\n * Sorts and merges CSS media queries using postcss-sort-media-queries.\n *\n * Enabled by default. Opt out with css: { media: false }.\n *\n * Config examples:\n * css: { media: true } // merge, mobile-first sort (default)\n * css: { media: { sort: 'desktop-first' } } // merge, desktop-first sort\n * css: { media: false } // disabled\n */\nexport function mergeMediaQueries(config: MaizzleConfig): postcss.Plugin | null {\n const media = config.css?.media\n\n if (media === false) return null\n\n const options = typeof media === 'object' ? media : {}\n const sort = options.sort ?? 'mobile-first'\n\n return sortMediaQueries({ sort }) as postcss.Plugin\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAgB,kBAAkB,QAA8C;CAC9E,MAAM,QAAQ,OAAO,KAAK;CAE1B,IAAI,UAAU,OAAO,OAAO;CAK5B,OAAO,iBAAiB,EAAE,OAHV,OAAO,UAAU,WAAW,QAAQ,EAAE,EACjC,QAAQ,gBAEG,CAAC"}
1
+ {"version":3,"file":"mergeMediaQueries.js","names":[],"sources":["../../../src/plugins/postcss/mergeMediaQueries.ts"],"sourcesContent":["import sortMediaQueries from 'postcss-sort-media-queries'\nimport type postcss from 'postcss'\nimport type { MaizzleConfig } from '../../types/config.ts'\n\n/**\n * Sorts and merges CSS media queries using postcss-sort-media-queries.\n *\n * Enabled by default. Opt out with css: { media: false }.\n *\n * Config examples:\n * css: { media: true } // merge, mobile-first sort (default)\n * css: { media: { sort: 'desktop-first' } } // merge, desktop-first sort\n * css: { media: false } // disabled\n */\nexport function mergeMediaQueries(config: MaizzleConfig): postcss.Plugin | null {\n const media = config.css?.media\n\n if (media === false) return null\n\n const options = typeof media === 'object' ? media : {}\n const sort = options.sort ?? 'mobile-first'\n\n return sortMediaQueries({ sort }) as postcss.Plugin\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAgB,kBAAkB,QAA8C;CAC9E,MAAM,QAAQ,OAAO,KAAK;CAE1B,IAAI,UAAU,OAAO,OAAO;CAK5B,OAAO,iBAAiB,EAAE,OAHV,OAAO,UAAU,WAAW,QAAQ,CAAC,GAChC,QAAQ,eAEE,CAAC;AAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pruneVars.d.ts","names":[],"sources":["../../../src/plugins/postcss/pruneVars.ts"],"mappings":";;;cAKyD,QAAA,QAYtC,MAAA;AAAA,cA2DN,OAAA"}
1
+ {"version":3,"file":"pruneVars.d.ts","names":[],"sources":["../../../src/plugins/postcss/pruneVars.ts"],"mappings":";;;cAKyD,QAAA,QAYtC,MAAM;AAAA,cA2DZ,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"pruneVars.js","names":[],"sources":["../../../src/plugins/postcss/pruneVars.ts"],"sourcesContent":["/**\n * postcss-prune-var\n * Removes unused CSS custom properties.\n */\n\nimport type { Declaration, Plugin, Root } from 'postcss';\n\nconst PLUGIN_NAME = 'postcss-prune-var';\n\nconst VAR_RE = /var\\(\\s*(--[^ ,);]+)/g;\n\ninterface VarRecord {\n uses: number;\n declarations: Set<Declaration>;\n dependencies: Set<string>;\n}\n\nexport default (): Plugin => {\n return {\n postcssPlugin: PLUGIN_NAME,\n\n Once(root: Root) {\n const records = new Map<string, VarRecord>();\n const usedVars = new Set<string>();\n\n const getRecord = (name: string): VarRecord => {\n let r = records.get(name);\n if (!r) {\n r = { uses: 0, declarations: new Set(), dependencies: new Set() };\n records.set(name, r);\n }\n return r;\n };\n\n const registerUse = (name: string, seen = new Set<string>()) => {\n const r = getRecord(name);\n r.uses++;\n seen.add(name);\n for (const dep of r.dependencies) {\n if (!seen.has(dep)) registerUse(dep, seen);\n }\n };\n\n // Build dependency graph\n root.walkDecls((decl) => {\n const isVar = decl.prop.startsWith('--');\n\n if (isVar) getRecord(decl.prop).declarations.add(decl);\n\n if (!decl.value.includes('var(')) return;\n\n let m;\n VAR_RE.lastIndex = 0;\n while ((m = VAR_RE.exec(decl.value))) {\n const ref = m[1].trim();\n if (isVar) {\n getRecord(decl.prop).dependencies.add(ref);\n } else {\n usedVars.add(ref);\n }\n }\n });\n\n // Propagate usage through the graph\n for (const v of usedVars) registerUse(v);\n\n // Remove declarations with zero uses\n for (const { uses, declarations } of records.values()) {\n if (uses === 0) {\n for (const decl of declarations) decl.remove();\n }\n }\n },\n };\n};\n\nexport const postcss = true;\n"],"mappings":";AAOA,MAAM,cAAc;AAEpB,MAAM,SAAS;AAQf,IAAA,0BAA6B;CAC3B,OAAO;EACL,eAAe;EAEf,KAAK,MAAY;GACf,MAAM,0BAAU,IAAI,KAAwB;GAC5C,MAAM,2BAAW,IAAI,KAAa;GAElC,MAAM,aAAa,SAA4B;IAC7C,IAAI,IAAI,QAAQ,IAAI,KAAK;IACzB,IAAI,CAAC,GAAG;KACN,IAAI;MAAE,MAAM;MAAG,8BAAc,IAAI,KAAK;MAAE,8BAAc,IAAI,KAAK;MAAE;KACjE,QAAQ,IAAI,MAAM,EAAE;;IAEtB,OAAO;;GAGT,MAAM,eAAe,MAAc,uBAAO,IAAI,KAAa,KAAK;IAC9D,MAAM,IAAI,UAAU,KAAK;IACzB,EAAE;IACF,KAAK,IAAI,KAAK;IACd,KAAK,MAAM,OAAO,EAAE,cAClB,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,YAAY,KAAK,KAAK;;GAK9C,KAAK,WAAW,SAAS;IACvB,MAAM,QAAQ,KAAK,KAAK,WAAW,KAAK;IAExC,IAAI,OAAO,UAAU,KAAK,KAAK,CAAC,aAAa,IAAI,KAAK;IAEtD,IAAI,CAAC,KAAK,MAAM,SAAS,OAAO,EAAE;IAElC,IAAI;IACJ,OAAO,YAAY;IACnB,OAAQ,IAAI,OAAO,KAAK,KAAK,MAAM,EAAG;KACpC,MAAM,MAAM,EAAE,GAAG,MAAM;KACvB,IAAI,OACF,UAAU,KAAK,KAAK,CAAC,aAAa,IAAI,IAAI;UAE1C,SAAS,IAAI,IAAI;;KAGrB;GAGF,KAAK,MAAM,KAAK,UAAU,YAAY,EAAE;GAGxC,KAAK,MAAM,EAAE,MAAM,kBAAkB,QAAQ,QAAQ,EACnD,IAAI,SAAS,GACX,KAAK,MAAM,QAAQ,cAAc,KAAK,QAAQ;;EAIrD;;AAGH,MAAa,UAAU"}
1
+ {"version":3,"file":"pruneVars.js","names":[],"sources":["../../../src/plugins/postcss/pruneVars.ts"],"sourcesContent":["/**\n * postcss-prune-var\n * Removes unused CSS custom properties.\n */\n\nimport type { Declaration, Plugin, Root } from 'postcss';\n\nconst PLUGIN_NAME = 'postcss-prune-var';\n\nconst VAR_RE = /var\\(\\s*(--[^ ,);]+)/g;\n\ninterface VarRecord {\n uses: number;\n declarations: Set<Declaration>;\n dependencies: Set<string>;\n}\n\nexport default (): Plugin => {\n return {\n postcssPlugin: PLUGIN_NAME,\n\n Once(root: Root) {\n const records = new Map<string, VarRecord>();\n const usedVars = new Set<string>();\n\n const getRecord = (name: string): VarRecord => {\n let r = records.get(name);\n if (!r) {\n r = { uses: 0, declarations: new Set(), dependencies: new Set() };\n records.set(name, r);\n }\n return r;\n };\n\n const registerUse = (name: string, seen = new Set<string>()) => {\n const r = getRecord(name);\n r.uses++;\n seen.add(name);\n for (const dep of r.dependencies) {\n if (!seen.has(dep)) registerUse(dep, seen);\n }\n };\n\n // Build dependency graph\n root.walkDecls((decl) => {\n const isVar = decl.prop.startsWith('--');\n\n if (isVar) getRecord(decl.prop).declarations.add(decl);\n\n if (!decl.value.includes('var(')) return;\n\n let m;\n VAR_RE.lastIndex = 0;\n while ((m = VAR_RE.exec(decl.value))) {\n const ref = m[1].trim();\n if (isVar) {\n getRecord(decl.prop).dependencies.add(ref);\n } else {\n usedVars.add(ref);\n }\n }\n });\n\n // Propagate usage through the graph\n for (const v of usedVars) registerUse(v);\n\n // Remove declarations with zero uses\n for (const { uses, declarations } of records.values()) {\n if (uses === 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F;AAEA,MAAa,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"quoteFontFamilies.d.ts","names":[],"sources":["../../../src/plugins/postcss/quoteFontFamilies.ts"],"mappings":";;;;;AA+CA;;;iBAAgB,iBAAA,CAAA,GAAqB,MAAA;AAAA,cA6BxB,OAAA"}
1
+ {"version":3,"file":"quoteFontFamilies.d.ts","names":[],"sources":["../../../src/plugins/postcss/quoteFontFamilies.ts"],"mappings":";;;;;AA+CA;;;iBAAgB,iBAAA,CAAA,GAAqB,MAAM;AAAA,cA6B9B,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"quoteFontFamilies.js","names":[],"sources":["../../../src/plugins/postcss/quoteFontFamilies.ts"],"sourcesContent":["import type { Plugin } from 'postcss'\n\nconst GENERIC_KEYWORDS = new Set([\n 'serif', 'sans-serif', 'monospace', 'cursive', 'fantasy',\n 'system-ui', 'ui-serif', 'ui-sans-serif', 'ui-monospace', 'ui-rounded',\n 'emoji', 'math', 'fangsong',\n 'inherit', 'initial', 'unset', 'revert', 'revert-layer',\n])\n\n/**\n * Split a font-family value on top-level commas only, preserving quoted\n * strings and parenthesised groups like `var(...)`.\n */\nfunction splitFamilies(value: string): string[] {\n const parts: string[] = []\n let depth = 0\n let quote: string | null = null\n let start = 0\n\n for (let i = 0; i < value.length; i++) {\n const ch = value[i]\n if (quote) {\n if (ch === '\\\\') { i++; continue }\n if (ch === quote) quote = null\n continue\n }\n if (ch === '\"' || ch === \"'\") {\n quote = ch\n continue\n }\n if (ch === '(') depth++\n else if (ch === ')') depth--\n else if (ch === ',' && depth === 0) {\n parts.push(value.slice(start, i).trim())\n start = i + 1\n }\n }\n\n parts.push(value.slice(start).trim())\n return parts.filter(Boolean)\n}\n\n/**\n * Re-quote multi-word font-family identifiers that lightningcss \"optimised\"\n * by removing quotes. CSS allows space-separated identifiers as a family\n * name, but Google Fonts (and most style guides) prescribe quoted form.\n */\nexport function quoteFontFamilies(): Plugin {\n return {\n postcssPlugin: 'quote-font-families',\n Declaration: {\n 'font-family': (decl) => {\n const value = decl.value\n if (!value || !/\\s/.test(value)) return\n\n const families = splitFamilies(value)\n let changed = false\n\n const fixed = families.map((token) => {\n if (token.startsWith('\"') || token.startsWith(\"'\")) return token\n if (token.startsWith('var(')) return token\n if (!token.includes(' ')) return token\n if (GENERIC_KEYWORDS.has(token.toLowerCase())) return token\n\n changed = true\n return `\"${token}\"`\n })\n\n if (changed) {\n decl.value = fixed.join(', ')\n }\n },\n },\n }\n}\n\nexport const postcss = true\n"],"mappings":";AAEA,MAAM,mBAAmB,IAAI,IAAI;CAC/B;CAAS;CAAc;CAAa;CAAW;CAC/C;CAAa;CAAY;CAAiB;CAAgB;CAC1D;CAAS;CAAQ;CACjB;CAAW;CAAW;CAAS;CAAU;CAC1C,CAAC;;;;;AAMF,SAAS,cAAc,OAAyB;CAC9C,MAAM,QAAkB,EAAE;CAC1B,IAAI,QAAQ;CACZ,IAAI,QAAuB;CAC3B,IAAI,QAAQ;CAEZ,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,MAAM,KAAK,MAAM;EACjB,IAAI,OAAO;GACT,IAAI,OAAO,MAAM;IAAE;IAAK;;GACxB,IAAI,OAAO,OAAO,QAAQ;GAC1B;;EAEF,IAAI,OAAO,QAAO,OAAO,KAAK;GAC5B,QAAQ;GACR;;EAEF,IAAI,OAAO,KAAK;OACX,IAAI,OAAO,KAAK;OAChB,IAAI,OAAO,OAAO,UAAU,GAAG;GAClC,MAAM,KAAK,MAAM,MAAM,OAAO,EAAE,CAAC,MAAM,CAAC;GACxC,QAAQ,IAAI;;;CAIhB,MAAM,KAAK,MAAM,MAAM,MAAM,CAAC,MAAM,CAAC;CACrC,OAAO,MAAM,OAAO,QAAQ;;;;;;;AAQ9B,SAAgB,oBAA4B;CAC1C,OAAO;EACL,eAAe;EACf,aAAa,EACX,gBAAgB,SAAS;GACvB,MAAM,QAAQ,KAAK;GACnB,IAAI,CAAC,SAAS,CAAC,KAAK,KAAK,MAAM,EAAE;GAEjC,MAAM,WAAW,cAAc,MAAM;GACrC,IAAI,UAAU;GAEd,MAAM,QAAQ,SAAS,KAAK,UAAU;IACpC,IAAI,MAAM,WAAW,KAAI,IAAI,MAAM,WAAW,IAAI,EAAE,OAAO;IAC3D,IAAI,MAAM,WAAW,OAAO,EAAE,OAAO;IACrC,IAAI,CAAC,MAAM,SAAS,IAAI,EAAE,OAAO;IACjC,IAAI,iBAAiB,IAAI,MAAM,aAAa,CAAC,EAAE,OAAO;IAEtD,UAAU;IACV,OAAO,IAAI,MAAM;KACjB;GAEF,IAAI,SACF,KAAK,QAAQ,MAAM,KAAK,KAAK;KAGlC;EACF;;AAGH,MAAa,UAAU"}
1
+ {"version":3,"file":"quoteFontFamilies.js","names":[],"sources":["../../../src/plugins/postcss/quoteFontFamilies.ts"],"sourcesContent":["import type { Plugin } from 'postcss'\n\nconst GENERIC_KEYWORDS = new Set([\n 'serif', 'sans-serif', 'monospace', 'cursive', 'fantasy',\n 'system-ui', 'ui-serif', 'ui-sans-serif', 'ui-monospace', 'ui-rounded',\n 'emoji', 'math', 'fangsong',\n 'inherit', 'initial', 'unset', 'revert', 'revert-layer',\n])\n\n/**\n * Split a font-family value on top-level commas only, preserving quoted\n * strings and parenthesised groups like `var(...)`.\n */\nfunction splitFamilies(value: string): string[] {\n const parts: string[] = []\n let depth = 0\n let quote: string | null = null\n let start = 0\n\n for (let i = 0; i < value.length; i++) {\n const ch = value[i]\n if (quote) {\n if (ch === '\\\\') { i++; continue }\n if (ch === quote) quote = null\n continue\n }\n if (ch === '\"' || ch === \"'\") {\n quote = ch\n continue\n }\n if (ch === '(') depth++\n else if (ch === ')') depth--\n else if (ch === ',' && depth === 0) {\n parts.push(value.slice(start, i).trim())\n start = i + 1\n }\n }\n\n parts.push(value.slice(start).trim())\n return parts.filter(Boolean)\n}\n\n/**\n * Re-quote multi-word font-family identifiers that lightningcss \"optimised\"\n * by removing quotes. CSS allows space-separated identifiers as a family\n * name, but Google Fonts (and most style guides) prescribe quoted form.\n */\nexport function quoteFontFamilies(): Plugin {\n return {\n postcssPlugin: 'quote-font-families',\n Declaration: {\n 'font-family': (decl) => {\n const value = decl.value\n if (!value || !/\\s/.test(value)) return\n\n const families = splitFamilies(value)\n let changed = false\n\n const fixed = families.map((token) => {\n if (token.startsWith('\"') || token.startsWith(\"'\")) return token\n if (token.startsWith('var(')) return token\n if (!token.includes(' ')) return token\n if (GENERIC_KEYWORDS.has(token.toLowerCase())) return token\n\n changed = true\n return `\"${token}\"`\n })\n\n if (changed) {\n decl.value = fixed.join(', ')\n }\n },\n },\n }\n}\n\nexport const postcss = true\n"],"mappings":";AAEA,MAAM,mBAAmB,IAAI,IAAI;CAC/B;CAAS;CAAc;CAAa;CAAW;CAC/C;CAAa;CAAY;CAAiB;CAAgB;CAC1D;CAAS;CAAQ;CACjB;CAAW;CAAW;CAAS;CAAU;AAC3C,CAAC;;;;;AAMD,SAAS,cAAc,OAAyB;CAC9C,MAAM,QAAkB,CAAC;CACzB,IAAI,QAAQ;CACZ,IAAI,QAAuB;CAC3B,IAAI,QAAQ;CAEZ,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,MAAM,KAAK,MAAM;EACjB,IAAI,OAAO;GACT,IAAI,OAAO,MAAM;IAAE;IAAK;GAAS;GACjC,IAAI,OAAO,OAAO,QAAQ;GAC1B;EACF;EACA,IAAI,OAAO,QAAO,OAAO,KAAK;GAC5B,QAAQ;GACR;EACF;EACA,IAAI,OAAO,KAAK;OACX,IAAI,OAAO,KAAK;OAChB,IAAI,OAAO,OAAO,UAAU,GAAG;GAClC,MAAM,KAAK,MAAM,MAAM,OAAO,CAAC,EAAE,KAAK,CAAC;GACvC,QAAQ,IAAI;EACd;CACF;CAEA,MAAM,KAAK,MAAM,MAAM,KAAK,EAAE,KAAK,CAAC;CACpC,OAAO,MAAM,OAAO,OAAO;AAC7B;;;;;;AAOA,SAAgB,oBAA4B;CAC1C,OAAO;EACL,eAAe;EACf,aAAa,EACX,gBAAgB,SAAS;GACvB,MAAM,QAAQ,KAAK;GACnB,IAAI,CAAC,SAAS,CAAC,KAAK,KAAK,KAAK,GAAG;GAEjC,MAAM,WAAW,cAAc,KAAK;GACpC,IAAI,UAAU;GAEd,MAAM,QAAQ,SAAS,KAAK,UAAU;IACpC,IAAI,MAAM,WAAW,IAAG,KAAK,MAAM,WAAW,GAAG,GAAG,OAAO;IAC3D,IAAI,MAAM,WAAW,MAAM,GAAG,OAAO;IACrC,IAAI,CAAC,MAAM,SAAS,GAAG,GAAG,OAAO;IACjC,IAAI,iBAAiB,IAAI,MAAM,YAAY,CAAC,GAAG,OAAO;IAEtD,UAAU;IACV,OAAO,IAAI,MAAM;GACnB,CAAC;GAED,IAAI,SACF,KAAK,QAAQ,MAAM,KAAK,IAAI;EAEhC,EACF;CACF;AACF;AAEA,MAAa,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"removeDeclarations.d.ts","names":[],"sources":["../../../src/plugins/postcss/removeDeclarations.ts"],"mappings":";;;KA0BY,WAAA,6BAIR,MAAA;AAAA,UAEa,yBAAA;EACf,MAAA,EAAQ,MAAA,SAAe,WAAA;AAAA;AAAA,cACxB,QAAA,GAQe,OAAA,EAAS,yBAAA,KAA4B,MAAA;AAAA,cAyDxC,OAAA"}
1
+ {"version":3,"file":"removeDeclarations.d.ts","names":[],"sources":["../../../src/plugins/postcss/removeDeclarations.ts"],"mappings":";;;KA0BY,WAAA,6BAIR,MAAM;AAAA,UAEO,yBAAA;EACf,MAAA,EAAQ,MAAM,SAAS,WAAA;AAAA;AAAA,cACxB,QAAA,GAQe,OAAA,EAAS,yBAAA,KAA4B,MAAM;AAAA,cAyD9C,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"removeDeclarations.js","names":[],"sources":["../../../src/plugins/postcss/removeDeclarations.ts"],"sourcesContent":["/**\n * postcss-remove-declarations\n *\n * Removes CSS declarations (or whole rules) based on a selector map.\n *\n * The `remove` option maps a selector string to one of:\n *\n * - `\"*\"` — remove the entire rule\n * - `string` — remove the single named property\n * - `string[]` — remove every listed property\n * - `Record<string, string>` — remove a property only when its value matches.\n * Append `!important` to the value to restrict the match\n * to non-important declarations only.\n *\n * Example:\n * removeDeclarations({\n * remove: {\n * ':root': '*',\n * '.foo': ['color', 'margin'],\n * '.bar': { color: 'red' },\n * }\n * })\n */\n\nimport type { Plugin, Root } from 'postcss'\n\nexport type RemoveValue =\n | '*'\n | string\n | string[]\n | Record<string, string>\n\nexport interface RemoveDeclarationsOptions {\n remove: Record<string, RemoveValue>\n}\n\nconst IMPORTANT = '!important'\n\nfunction normalizeSelector(selector: string): string {\n return selector.replace(/(\\r\\n|\\n|\\r)/gm, '')\n}\n\nexport default (options: RemoveDeclarationsOptions): Plugin => {\n return {\n postcssPlugin: 'postcss-remove-declarations',\n\n Once(root: Root) {\n const remove = options.remove ?? {}\n\n root.walkRules((rule) => {\n let toRemove = remove[normalizeSelector(rule.selector)]\n\n if (!toRemove) return\n\n // Remove the entire rule\n if (toRemove === '*') {\n rule.remove()\n return\n }\n\n // Normalise a bare string into an array\n if (typeof toRemove === 'string') {\n toRemove = [toRemove]\n }\n\n if (Array.isArray(toRemove)) {\n const props = toRemove as string[]\n rule.walkDecls((decl) => {\n if (props.includes(decl.prop)) decl.remove()\n })\n } else if (typeof toRemove === 'object') {\n // Object: match both property and value\n const map = toRemove as Record<string, string>\n rule.walkDecls((decl) => {\n if (!(decl.prop in map)) return\n\n let expected = map[decl.prop]\n const requireNonImportant = expected.endsWith(IMPORTANT)\n\n if (requireNonImportant) {\n expected = expected.slice(0, -IMPORTANT.length).trim()\n }\n\n if (decl.value !== expected) return\n if (decl.important && requireNonImportant) return\n\n decl.remove()\n })\n }\n\n // Remove the rule if all declarations were removed\n if (rule.nodes?.length === 0) {\n rule.remove()\n }\n })\n },\n }\n}\n\nexport const postcss = true\n"],"mappings":";AAoCA,MAAM,YAAY;AAElB,SAAS,kBAAkB,UAA0B;CACnD,OAAO,SAAS,QAAQ,kBAAkB,GAAG;;AAG/C,IAAA,8BAAgB,YAA+C;CAC7D,OAAO;EACL,eAAe;EAEf,KAAK,MAAY;GACf,MAAM,SAAS,QAAQ,UAAU,EAAE;GAEnC,KAAK,WAAW,SAAS;IACvB,IAAI,WAAW,OAAO,kBAAkB,KAAK,SAAS;IAEtD,IAAI,CAAC,UAAU;IAGf,IAAI,aAAa,KAAK;KACpB,KAAK,QAAQ;KACb;;IAIF,IAAI,OAAO,aAAa,UACtB,WAAW,CAAC,SAAS;IAGvB,IAAI,MAAM,QAAQ,SAAS,EAAE;KAC3B,MAAM,QAAQ;KACd,KAAK,WAAW,SAAS;MACvB,IAAI,MAAM,SAAS,KAAK,KAAK,EAAE,KAAK,QAAQ;OAC5C;WACG,IAAI,OAAO,aAAa,UAAU;KAEvC,MAAM,MAAM;KACZ,KAAK,WAAW,SAAS;MACvB,IAAI,EAAE,KAAK,QAAQ,MAAM;MAEzB,IAAI,WAAW,IAAI,KAAK;MACxB,MAAM,sBAAsB,SAAS,SAAS,UAAU;MAExD,IAAI,qBACF,WAAW,SAAS,MAAM,GAAG,IAAkB,CAAC,MAAM;MAGxD,IAAI,KAAK,UAAU,UAAU;MAC7B,IAAI,KAAK,aAAa,qBAAqB;MAE3C,KAAK,QAAQ;OACb;;IAIJ,IAAI,KAAK,OAAO,WAAW,GACzB,KAAK,QAAQ;KAEf;;EAEL;;AAGH,MAAa,UAAU"}
1
+ {"version":3,"file":"removeDeclarations.js","names":[],"sources":["../../../src/plugins/postcss/removeDeclarations.ts"],"sourcesContent":["/**\n * postcss-remove-declarations\n *\n * Removes CSS declarations (or whole rules) based on a selector map.\n *\n * The `remove` option maps a selector string to one of:\n *\n * - `\"*\"` — remove the entire rule\n * - `string` — remove the single named property\n * - `string[]` — remove every listed property\n * - `Record<string, string>` — remove a property only when its value matches.\n * Append `!important` to the value to restrict the match\n * to non-important declarations only.\n *\n * Example:\n * removeDeclarations({\n * remove: {\n * ':root': '*',\n * '.foo': ['color', 'margin'],\n * '.bar': { color: 'red' },\n * }\n * })\n */\n\nimport type { Plugin, Root } from 'postcss'\n\nexport type RemoveValue =\n | '*'\n | string\n | string[]\n | Record<string, string>\n\nexport interface RemoveDeclarationsOptions {\n remove: Record<string, RemoveValue>\n}\n\nconst IMPORTANT = '!important'\n\nfunction normalizeSelector(selector: string): string {\n return selector.replace(/(\\r\\n|\\n|\\r)/gm, '')\n}\n\nexport default (options: RemoveDeclarationsOptions): Plugin => {\n return {\n postcssPlugin: 'postcss-remove-declarations',\n\n Once(root: Root) {\n const remove = options.remove ?? {}\n\n root.walkRules((rule) => {\n let toRemove = remove[normalizeSelector(rule.selector)]\n\n if (!toRemove) return\n\n // Remove the entire rule\n if (toRemove === '*') {\n rule.remove()\n return\n }\n\n // Normalise a bare string into an array\n if (typeof toRemove === 'string') {\n toRemove = [toRemove]\n }\n\n if (Array.isArray(toRemove)) {\n const props = toRemove as string[]\n rule.walkDecls((decl) => {\n if (props.includes(decl.prop)) decl.remove()\n })\n } else if (typeof toRemove === 'object') {\n // Object: match both property and value\n const map = toRemove as Record<string, string>\n rule.walkDecls((decl) => {\n if (!(decl.prop in map)) return\n\n let expected = map[decl.prop]\n const requireNonImportant = expected.endsWith(IMPORTANT)\n\n if (requireNonImportant) {\n expected = expected.slice(0, -IMPORTANT.length).trim()\n }\n\n if (decl.value !== expected) return\n if (decl.important && requireNonImportant) return\n\n decl.remove()\n })\n }\n\n // Remove the rule if all declarations were removed\n if (rule.nodes?.length === 0) {\n rule.remove()\n }\n })\n },\n }\n}\n\nexport const postcss = true\n"],"mappings":";AAoCA,MAAM,YAAY;AAElB,SAAS,kBAAkB,UAA0B;CACnD,OAAO,SAAS,QAAQ,kBAAkB,EAAE;AAC9C;AAEA,IAAA,8BAAgB,YAA+C;CAC7D,OAAO;EACL,eAAe;EAEf,KAAK,MAAY;GACf,MAAM,SAAS,QAAQ,UAAU,CAAC;GAElC,KAAK,WAAW,SAAS;IACvB,IAAI,WAAW,OAAO,kBAAkB,KAAK,QAAQ;IAErD,IAAI,CAAC,UAAU;IAGf,IAAI,aAAa,KAAK;KACpB,KAAK,OAAO;KACZ;IACF;IAGA,IAAI,OAAO,aAAa,UACtB,WAAW,CAAC,QAAQ;IAGtB,IAAI,MAAM,QAAQ,QAAQ,GAAG;KAC3B,MAAM,QAAQ;KACd,KAAK,WAAW,SAAS;MACvB,IAAI,MAAM,SAAS,KAAK,IAAI,GAAG,KAAK,OAAO;KAC7C,CAAC;IACH,OAAO,IAAI,OAAO,aAAa,UAAU;KAEvC,MAAM,MAAM;KACZ,KAAK,WAAW,SAAS;MACvB,IAAI,EAAE,KAAK,QAAQ,MAAM;MAEzB,IAAI,WAAW,IAAI,KAAK;MACxB,MAAM,sBAAsB,SAAS,SAAS,SAAS;MAEvD,IAAI,qBACF,WAAW,SAAS,MAAM,GAAG,GAAiB,EAAE,KAAK;MAGvD,IAAI,KAAK,UAAU,UAAU;MAC7B,IAAI,KAAK,aAAa,qBAAqB;MAE3C,KAAK,OAAO;KACd,CAAC;IACH;IAGA,IAAI,KAAK,OAAO,WAAW,GACzB,KAAK,OAAO;GAEhB,CAAC;EACH;CACF;AACF;AAEA,MAAa,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveMaizzleImports.d.ts","names":[],"sources":["../../../src/plugins/postcss/resolveMaizzleImports.ts"],"mappings":";;;;;AAiBA;;;;;;;iBAAgB,qBAAA,CAAsB,QAAA,YAAmC,MAAA"}
1
+ {"version":3,"file":"resolveMaizzleImports.d.ts","names":[],"sources":["../../../src/plugins/postcss/resolveMaizzleImports.ts"],"mappings":";;;;;AAiBA;;;;AAA+E;;;iBAA/D,qBAAA,CAAsB,QAAA,YAAmC,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveMaizzleImports.js","names":[],"sources":["../../../src/plugins/postcss/resolveMaizzleImports.ts"],"sourcesContent":["import { createRequire } from 'node:module'\nimport type { Plugin } from 'postcss'\n\nconst PKG = '@maizzle/tailwindcss'\nconst SUBPATH_RE = new RegExp(`^${PKG}(?:/|$)`)\n\nconst requireFromFramework = createRequire(import.meta.url)\n\n/**\n * Rewrite `@import \"@maizzle/tailwindcss\"` (and subpaths like\n * `@maizzle/tailwindcss/mso`) to absolute file paths so postcss/Tailwind\n * can resolve them regardless of where the user's template lives or how\n * their package manager hoists dependencies.\n *\n * Resolution order: prefer the user's project copy (so explicit installs\n * win), then fall back to the copy bundled with the framework.\n */\nexport function resolveMaizzleImports(userRoot: string = process.cwd()): Plugin {\n const requireFromUser = createRequire(`${userRoot}/_maizzle.js`)\n\n function resolve(spec: string): string | undefined {\n try { return requireFromUser.resolve(spec) } catch {}\n try { return requireFromFramework.resolve(spec) } catch {}\n return undefined\n }\n\n return {\n postcssPlugin: 'maizzle:resolve-tw-imports',\n AtRule: {\n import(rule) {\n const m = rule.params.match(/^\\s*[\"']([^\"']+)[\"']/)\n if (!m) return\n const spec = m[1]\n if (!SUBPATH_RE.test(spec)) return\n\n const abs = resolve(spec)\n if (abs) rule.params = rule.params.replace(m[0], `\"${abs}\"`)\n },\n },\n }\n}\n"],"mappings":";;AAIA,MAAM,aAAa,IAAI,OAAO,+BAAiB;AAE/C,MAAM,uBAAuB,cAAc,OAAO,KAAK,IAAI;;;;;;;;;;AAW3D,SAAgB,sBAAsB,WAAmB,QAAQ,KAAK,EAAU;CAC9E,MAAM,kBAAkB,cAAc,GAAG,SAAS,cAAc;CAEhE,SAAS,QAAQ,MAAkC;EACjD,IAAI;GAAE,OAAO,gBAAgB,QAAQ,KAAK;UAAS;EACnD,IAAI;GAAE,OAAO,qBAAqB,QAAQ,KAAK;UAAS;;CAI1D,OAAO;EACL,eAAe;EACf,QAAQ,EACN,OAAO,MAAM;GACX,MAAM,IAAI,KAAK,OAAO,MAAM,uBAAuB;GACnD,IAAI,CAAC,GAAG;GACR,MAAM,OAAO,EAAE;GACf,IAAI,CAAC,WAAW,KAAK,KAAK,EAAE;GAE5B,MAAM,MAAM,QAAQ,KAAK;GACzB,IAAI,KAAK,KAAK,SAAS,KAAK,OAAO,QAAQ,EAAE,IAAI,IAAI,IAAI,GAAG;KAE/D;EACF"}
1
+ {"version":3,"file":"resolveMaizzleImports.js","names":[],"sources":["../../../src/plugins/postcss/resolveMaizzleImports.ts"],"sourcesContent":["import { createRequire } from 'node:module'\nimport type { Plugin } from 'postcss'\n\nconst PKG = '@maizzle/tailwindcss'\nconst SUBPATH_RE = new RegExp(`^${PKG}(?:/|$)`)\n\nconst requireFromFramework = createRequire(import.meta.url)\n\n/**\n * Rewrite `@import \"@maizzle/tailwindcss\"` (and subpaths like\n * `@maizzle/tailwindcss/mso`) to absolute file paths so postcss/Tailwind\n * can resolve them regardless of where the user's template lives or how\n * their package manager hoists dependencies.\n *\n * Resolution order: prefer the user's project copy (so explicit installs\n * win), then fall back to the copy bundled with the framework.\n */\nexport function resolveMaizzleImports(userRoot: string = process.cwd()): Plugin {\n const requireFromUser = createRequire(`${userRoot}/_maizzle.js`)\n\n function resolve(spec: string): string | undefined {\n try { return requireFromUser.resolve(spec) } catch {}\n try { return requireFromFramework.resolve(spec) } catch {}\n return undefined\n }\n\n return {\n postcssPlugin: 'maizzle:resolve-tw-imports',\n AtRule: {\n import(rule) {\n const m = rule.params.match(/^\\s*[\"']([^\"']+)[\"']/)\n if (!m) return\n const spec = m[1]\n if (!SUBPATH_RE.test(spec)) return\n\n const abs = resolve(spec)\n if (abs) rule.params = rule.params.replace(m[0], `\"${abs}\"`)\n },\n },\n }\n}\n"],"mappings":";;AAIA,MAAM,aAAa,IAAI,OAAO,8BAAgB;AAE9C,MAAM,uBAAuB,cAAc,OAAO,KAAK,GAAG;;;;;;;;;;AAW1D,SAAgB,sBAAsB,WAAmB,QAAQ,IAAI,GAAW;CAC9E,MAAM,kBAAkB,cAAc,GAAG,SAAS,aAAa;CAE/D,SAAS,QAAQ,MAAkC;EACjD,IAAI;GAAE,OAAO,gBAAgB,QAAQ,IAAI;EAAE,QAAQ,CAAC;EACpD,IAAI;GAAE,OAAO,qBAAqB,QAAQ,IAAI;EAAE,QAAQ,CAAC;CAE3D;CAEA,OAAO;EACL,eAAe;EACf,QAAQ,EACN,OAAO,MAAM;GACX,MAAM,IAAI,KAAK,OAAO,MAAM,sBAAsB;GAClD,IAAI,CAAC,GAAG;GACR,MAAM,OAAO,EAAE;GACf,IAAI,CAAC,WAAW,KAAK,IAAI,GAAG;GAE5B,MAAM,MAAM,QAAQ,IAAI;GACxB,IAAI,KAAK,KAAK,SAAS,KAAK,OAAO,QAAQ,EAAE,IAAI,IAAI,IAAI,EAAE;EAC7D,EACF;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveProps.d.ts","names":[],"sources":["../../../src/plugins/postcss/resolveProps.ts"],"mappings":";;;cAiByD,QAAA,QA6FtC,MAAA;AAAA,cA8IN,OAAA"}
1
+ {"version":3,"file":"resolveProps.d.ts","names":[],"sources":["../../../src/plugins/postcss/resolveProps.ts"],"mappings":";;;cAiByD,QAAA,QA+FtC,MAAM;AAAA,cAqJZ,OAAA"}