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

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 (143) hide show
  1. package/dist/build.js +11 -2
  2. package/dist/build.js.map +1 -1
  3. package/dist/components/Body.vue +12 -0
  4. package/dist/components/Button.vue +16 -29
  5. package/dist/components/CodeBlock.vue +5 -4
  6. package/dist/components/CodeInline.vue +9 -8
  7. package/dist/components/Column.vue +17 -4
  8. package/dist/components/Container.vue +7 -11
  9. package/dist/components/Hr.vue +1 -1
  10. package/dist/components/Img.vue +39 -22
  11. package/dist/components/Layout.vue +1 -1
  12. package/dist/components/Markdown.vue +51 -24
  13. package/dist/components/QrCode.vue +2 -2
  14. package/dist/components/Section.vue +9 -6
  15. package/dist/components/Text.vue +2 -2
  16. package/dist/components/utils.d.ts +25 -1
  17. package/dist/components/utils.d.ts.map +1 -1
  18. package/dist/components/utils.js +29 -1
  19. package/dist/components/utils.js.map +1 -1
  20. package/dist/components/utils.ts +46 -0
  21. package/dist/composables/renderContext.d.ts +1 -0
  22. package/dist/composables/renderContext.d.ts.map +1 -1
  23. package/dist/composables/renderContext.js +1 -1
  24. package/dist/composables/renderContext.js.map +1 -1
  25. package/dist/composables/useConfig.d.ts +7 -0
  26. package/dist/composables/useConfig.d.ts.map +1 -1
  27. package/dist/composables/useConfig.js +8 -1
  28. package/dist/composables/useConfig.js.map +1 -1
  29. package/dist/composables/useCurrentTemplate.d.ts.map +1 -1
  30. package/dist/composables/useEvent.d.ts.map +1 -1
  31. package/dist/composables/useFont.js.map +1 -1
  32. package/dist/composables/useOutputPath.d.ts +17 -0
  33. package/dist/composables/useOutputPath.d.ts.map +1 -0
  34. package/dist/composables/useOutputPath.js +23 -0
  35. package/dist/composables/useOutputPath.js.map +1 -0
  36. package/dist/config/index.js.map +1 -1
  37. package/dist/events/index.d.ts.map +1 -1
  38. package/dist/events/index.js.map +1 -1
  39. package/dist/index.d.ts +2 -1
  40. package/dist/index.js +2 -1
  41. package/dist/plaintext.js.map +1 -1
  42. package/dist/plugins/postcss/mergeMediaQueries.js.map +1 -1
  43. package/dist/plugins/postcss/pruneVars.js.map +1 -1
  44. package/dist/plugins/postcss/quoteFontFamilies.d.ts.map +1 -1
  45. package/dist/plugins/postcss/quoteFontFamilies.js.map +1 -1
  46. package/dist/plugins/postcss/removeDeclarations.js.map +1 -1
  47. package/dist/plugins/postcss/resolveProps.d.ts.map +1 -1
  48. package/dist/plugins/postcss/resolveProps.js +0 -3
  49. package/dist/plugins/postcss/resolveProps.js.map +1 -1
  50. package/dist/plugins/postcss/tailwindCleanup.js.map +1 -1
  51. package/dist/prepare.js +1 -1
  52. package/dist/prepare.js.map +1 -1
  53. package/dist/render/active.d.ts.map +1 -1
  54. package/dist/render/createRenderer.d.ts +1 -0
  55. package/dist/render/createRenderer.d.ts.map +1 -1
  56. package/dist/render/createRenderer.js +19 -7
  57. package/dist/render/createRenderer.js.map +1 -1
  58. package/dist/render/index.js +1 -1
  59. package/dist/render/index.js.map +1 -1
  60. package/dist/render/injectFonts.js.map +1 -1
  61. package/dist/render/plugins/codeBlockExtract.d.ts.map +1 -1
  62. package/dist/render/plugins/codeBlockExtract.js.map +1 -1
  63. package/dist/render/plugins/markdownExtract.d.ts.map +1 -1
  64. package/dist/render/plugins/markdownExtract.js.map +1 -1
  65. package/dist/render/plugins/rawExtract.d.ts.map +1 -1
  66. package/dist/render/plugins/rawExtract.js.map +1 -1
  67. package/dist/render/plugins/rowSourceLocation.d.ts.map +1 -1
  68. package/dist/render/plugins/rowSourceLocation.js.map +1 -1
  69. package/dist/serve.js +3 -3
  70. package/dist/serve.js.map +1 -1
  71. package/dist/server/compatibility.d.ts.map +1 -1
  72. package/dist/server/compatibility.js.map +1 -1
  73. package/dist/server/linter.js.map +1 -1
  74. package/dist/server/sfc-utils.js.map +1 -1
  75. package/dist/server/ui/App.vue +3 -4
  76. package/dist/server/ui/main.css +25 -0
  77. package/dist/server/ui/pages/Preview.vue +5 -1
  78. package/dist/tests/render/_helpers.d.ts.map +1 -1
  79. package/dist/tests/render/_helpers.js.map +1 -1
  80. package/dist/transformers/addAttributes.js +2 -3
  81. package/dist/transformers/addAttributes.js.map +1 -1
  82. package/dist/transformers/base.d.ts +1 -1
  83. package/dist/transformers/base.d.ts.map +1 -1
  84. package/dist/transformers/base.js +5 -10
  85. package/dist/transformers/base.js.map +1 -1
  86. package/dist/transformers/columnWidth.d.ts.map +1 -1
  87. package/dist/transformers/columnWidth.js +2 -7
  88. package/dist/transformers/columnWidth.js.map +1 -1
  89. package/dist/transformers/entities.js.map +1 -1
  90. package/dist/transformers/filters/defaults.js.map +1 -1
  91. package/dist/transformers/filters/index.js.map +1 -1
  92. package/dist/transformers/format.js.map +1 -1
  93. package/dist/transformers/imgWidth.d.ts +20 -0
  94. package/dist/transformers/imgWidth.d.ts.map +1 -0
  95. package/dist/transformers/imgWidth.js +76 -0
  96. package/dist/transformers/imgWidth.js.map +1 -0
  97. package/dist/transformers/index.d.ts.map +1 -1
  98. package/dist/transformers/index.js +2 -0
  99. package/dist/transformers/index.js.map +1 -1
  100. package/dist/transformers/inlineCss.d.ts +3 -2
  101. package/dist/transformers/inlineCss.d.ts.map +1 -1
  102. package/dist/transformers/inlineCss.js.map +1 -1
  103. package/dist/transformers/inlineLink.js +1 -1
  104. package/dist/transformers/inlineLink.js.map +1 -1
  105. package/dist/transformers/minify.js.map +1 -1
  106. package/dist/transformers/minifyCodeInline.js.map +1 -1
  107. package/dist/transformers/msoPlaceholders.d.ts.map +1 -1
  108. package/dist/transformers/msoPlaceholders.js +2 -7
  109. package/dist/transformers/msoPlaceholders.js.map +1 -1
  110. package/dist/transformers/purgeCss.js.map +1 -1
  111. package/dist/transformers/replaceStrings.js.map +1 -1
  112. package/dist/transformers/safeSelectors.js.map +1 -1
  113. package/dist/transformers/shorthandCss.js.map +1 -1
  114. package/dist/transformers/tailwindComponent.js.map +1 -1
  115. package/dist/transformers/tailwindcss.js +1 -1
  116. package/dist/transformers/tailwindcss.js.map +1 -1
  117. package/dist/transformers/urlQuery.js.map +1 -1
  118. package/dist/types/config.d.ts +5 -4
  119. package/dist/types/config.d.ts.map +1 -1
  120. package/dist/utils/ast/serializer.js.map +1 -1
  121. package/dist/utils/compileTailwindCss.js.map +1 -1
  122. package/dist/utils/componentSources.js.map +1 -1
  123. package/dist/utils/cssBox.d.ts.map +1 -1
  124. package/dist/utils/cssBox.js +2 -7
  125. package/dist/utils/cssBox.js.map +1 -1
  126. package/dist/utils/decodeStyleEntities.js.map +1 -1
  127. package/dist/utils/url.js.map +1 -1
  128. package/dist/utils/watchPaths.js.map +1 -1
  129. package/node_modules/@clack/core/CHANGELOG.md +30 -0
  130. package/node_modules/@clack/core/dist/index.d.mts +109 -3
  131. package/node_modules/@clack/core/dist/index.mjs +972 -17
  132. package/node_modules/@clack/core/package.json +2 -1
  133. package/node_modules/@clack/prompts/CHANGELOG.md +42 -0
  134. package/node_modules/@clack/prompts/README.md +30 -9
  135. package/node_modules/@clack/prompts/dist/index.d.mts +458 -27
  136. package/node_modules/@clack/prompts/dist/index.mjs +1378 -141
  137. package/node_modules/@clack/prompts/package.json +2 -2
  138. package/node_modules/tinyexec/package.json +4 -4
  139. package/package.json +8 -7
  140. package/dist/components/Overlap.vue +0 -156
  141. package/dist/server/ui/components/Markdown.vue +0 -17
  142. package/node_modules/@clack/core/dist/index.mjs.map +0 -1
  143. package/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tailwindcss.js","names":[],"sources":["../../src/transformers/tailwindcss.ts"],"sourcesContent":["import { resolve, dirname, relative } from 'node:path'\nimport type { ChildNode, Element } from 'domhandler'\nimport { walk } from '../utils/ast/index.ts'\nimport { decodeStyleEntities } from '../utils/decodeStyleEntities.ts'\nimport { compileTailwindCss } from '../utils/compileTailwindCss.ts'\nimport type { MaizzleConfig } from '../types/config.ts'\n\n/**\n * Check if CSS content uses Tailwind features that require source scanning.\n *\n * Only CSS that imports Tailwind (or @maizzle/tailwindcss) needs @source\n * directives. Plain CSS without Tailwind imports doesn't need scanning\n * and would pass through @source directives unconsumed.\n */\nfunction usesTailwind(css: string): boolean {\n return /((@import|@reference)\\s+[\"'](tailwindcss|@maizzle\\/tailwindcss)|@tailwind\\s)/.test(css)\n}\n\n/**\n * Build @source directives for Tailwind CSS scanning.\n *\n * Configures two types of sources:\n * 1. Exclusions for output dir and user-configured paths\n * 2. Inline source with all class attribute values from the rendered DOM,\n * capturing classes from all components (built-in + user), dynamic\n * expressions, and the template itself — Tailwind's scanner handles\n * the actual class extraction from these raw values\n */\nfunction buildSourceDirectives(dom: ChildNode[], config: MaizzleConfig, fromDir: string): string {\n const directives: string[] = []\n\n // Exclude output dir and user-configured paths\n const excludePaths = [\n resolve(config.output?.path ?? 'dist'),\n ...(config.css?.exclude ?? []).map(p => resolve(p)),\n ]\n\n for (const p of excludePaths) {\n directives.push(`@source not \"${relative(fromDir, resolve(p))}\";`)\n }\n\n /**\n * Inline source: collect all class attribute values from the rendered DOM.\n * After Vue SSR, the DOM contains every class from every component\n * (built-in framework components, user components, dynamic\n * bindings). We pass these raw values to Tailwind's\n * scanner via @source inline().\n */\n const classes: string[] = []\n walk(dom, (n) => {\n const cls = (n as Element).attribs?.class\n if (cls) classes.push(cls)\n })\n\n if (classes.length) {\n directives.push(`@source inline(\"${classes.join(' ')}\");`)\n }\n\n return directives.join('\\n')\n}\n\n/**\n * Tailwind CSS transformer.\n *\n * Compiles CSS inside <style> tags in the DOM using\n * @tailwindcss/postcss, then lowers modern CSS syntax with lightningcss.\n *\n * Configures Tailwind sources to scan:\n * - Rendered class attributes (via `@source inline`) for all classes from all components\n * - User project files (via Tailwind's auto-detection from base/from path)\n *\n * User `@source` and `@source not directives` in style tags are preserved.\n * Source directives are only added to style tags that import Tailwind.\n *\n * Runs as the first transformer in the pipeline so that subsequent\n * transformers (inliner, purge, etc.) work with fully compiled CSS.\n */\nexport async function tailwindcss(dom: ChildNode[], config: MaizzleConfig, filePath?: string): Promise<ChildNode[]> {\n const styleTags: { node: Element; cssContent: string }[] = []\n\n walk(dom, (node) => {\n if ((node as Element).name !== 'style') return\n\n const el = node as Element\n const attrs = el.attribs || {}\n\n /**\n * `raw` opts out of compilation entirely (marker is consumed here).\n * `embed`/`data-embed` only signal \"preserve tag after inlining\"\n * — they still need to go through compile so Tailwind/@apply\n * resolves.\n */\n if ('raw' in attrs) {\n delete el.attribs.raw\n return\n }\n\n // Get text content from children and decode HTML entities\n const rawContent = el.children\n .filter(child => child.type === 'text')\n .map(child => (child as any).data)\n .join('')\n\n if (!rawContent.trim()) return\n\n styleTags.push({ node: el, cssContent: decodeStyleEntities(rawContent) })\n })\n\n if (!styleTags.length) return dom\n\n const fromPath = filePath ?? resolve(process.cwd(), 'template.vue')\n const fromDir = dirname(fromPath)\n\n // Only compute source directives if at least one style tag uses Tailwind\n const hasTailwindStyles = styleTags.some(({ cssContent }) => usesTailwind(cssContent))\n const sourceDirectives = hasTailwindStyles\n ? buildSourceDirectives(dom, config, fromDir)\n : ''\n\n for (let i = 0; i < styleTags.length; i++) {\n const { node, cssContent } = styleTags[i]\n\n /**\n * Only add source directives to style tags that import Tailwind —\n * plain CSS doesn't need them and @tailwindcss/postcss would\n * leave the directives unconsumed in the output.\n */\n const fullCss = usesTailwind(cssContent)\n ? `${cssContent}\\n${sourceDirectives}`\n : cssContent\n\n try {\n const optimized = await compileTailwindCss(fullCss, config, `${fromPath}?style=${i}`)\n\n // Replace the style tag's children with the compiled CSS\n node.children = [{\n type: 'text',\n data: optimized,\n parent: node,\n } as any]\n } catch {\n /**\n * If CSS processing fails, still replace with decoded content\n * so HTML entities don't break the CSS.\n */\n node.children = [{\n type: 'text',\n data: cssContent,\n parent: node,\n } as any]\n }\n }\n\n return dom\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAS,aAAa,KAAsB;CAC1C,OAAO,+EAA+E,KAAK,GAAG;AAChG;;;;;;;;;;;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AK,QAAQ,OAAO,IAC1C;CAEJ,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;EACzC,MAAM,EAAE,MAAM,eAAe,UAAU;;;;;;EAOvC,MAAM,UAAU,aAAa,UAAU,IACnC,GAAG,WAAW,IAAI,qBAClB;EAEJ,IAAI;GAIF,KAAK,WAAW,CAAC;IACf,MAAM;IACN,MAAM,MALgB,mBAAmB,SAAS,QAAQ,GAAG,SAAS,SAAS,GAAG;IAMlF,QAAQ;GACV,CAAQ;EACV,QAAQ;;;;;GAKN,KAAK,WAAW,CAAC;IACf,MAAM;IACN,MAAM;IACN,QAAQ;GACV,CAAQ;EACV;CACF;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"tailwindcss.js","names":[],"sources":["../../src/transformers/tailwindcss.ts"],"sourcesContent":["import { resolve, dirname, relative } from 'node:path'\nimport type { ChildNode, Element } from 'domhandler'\nimport { walk } from '../utils/ast/index.ts'\nimport { decodeStyleEntities } from '../utils/decodeStyleEntities.ts'\nimport { compileTailwindCss } from '../utils/compileTailwindCss.ts'\nimport type { MaizzleConfig } from '../types/config.ts'\n\n/**\n * Check if CSS content uses Tailwind features that require source scanning.\n *\n * Only CSS that imports Tailwind (or @maizzle/tailwindcss) needs @source\n * directives. Plain CSS without Tailwind imports doesn't need scanning\n * and would pass through @source directives unconsumed.\n */\nfunction usesTailwind(css: string): boolean {\n return /((@import|@reference)\\s+[\"'](tailwindcss|@maizzle\\/tailwindcss)|@tailwind\\s)/.test(css)\n}\n\n/**\n * Build @source directives for Tailwind CSS scanning.\n *\n * Configures two types of sources:\n * 1. Exclusions for output dir and user-configured paths\n * 2. Inline source with all class attribute values from the rendered DOM,\n * capturing classes from all components (built-in + user), dynamic\n * expressions, and the template itself — Tailwind's scanner handles\n * the actual class extraction from these raw values\n */\nfunction buildSourceDirectives(dom: ChildNode[], config: MaizzleConfig, fromDir: string): string {\n const directives: string[] = []\n\n // Exclude output dir and user-configured paths\n const excludePaths = [\n resolve(config.output?.path ?? 'dist'),\n ...(config.css?.exclude ?? []).map(p => resolve(p)),\n ]\n\n for (const p of excludePaths) {\n directives.push(`@source not \"${relative(fromDir, resolve(p))}\";`)\n }\n\n /**\n * Inline source: collect all class attribute values from the rendered DOM.\n * After Vue SSR, the DOM contains every class from every component\n * (built-in framework components, user components, dynamic\n * bindings). We pass these raw values to Tailwind's\n * scanner via @source inline().\n */\n const classes: string[] = []\n walk(dom, (n) => {\n const cls = (n as Element).attribs?.class\n if (cls) classes.push(cls)\n })\n\n if (classes.length) {\n directives.push(`@source inline(\"${classes.join(' ')}\");`)\n }\n\n return directives.join('\\n')\n}\n\n/**\n * Tailwind CSS transformer.\n *\n * Compiles CSS inside <style> tags in the DOM using\n * @tailwindcss/postcss, then lowers modern CSS syntax with lightningcss.\n *\n * Configures Tailwind sources to scan:\n * - Rendered class attributes (via `@source inline`) for all classes from all components\n * - User project files (via Tailwind's auto-detection from base/from path)\n *\n * User `@source` and `@source not directives` in style tags are preserved.\n * Source directives are only added to style tags that import Tailwind.\n *\n * Runs as the first transformer in the pipeline so that subsequent\n * transformers (inliner, purge, etc.) work with fully compiled CSS.\n */\nexport async function tailwindcss(dom: ChildNode[], config: MaizzleConfig, filePath?: string): Promise<ChildNode[]> {\n const styleTags: { node: Element; cssContent: string }[] = []\n\n walk(dom, (node) => {\n if ((node as Element).name !== 'style') return\n\n const el = node as Element\n const attrs = el.attribs\n\n /**\n * `raw` opts out of compilation entirely (marker is consumed here).\n * `embed`/`data-embed` only signal \"preserve tag after inlining\"\n * — they still need to go through compile so Tailwind/@apply\n * resolves.\n */\n if ('raw' in attrs) {\n delete el.attribs.raw\n return\n }\n\n // Get text content from children and decode HTML entities\n const rawContent = el.children\n .filter(child => child.type === 'text')\n .map(child => (child as any).data)\n .join('')\n\n if (!rawContent.trim()) return\n\n styleTags.push({ node: el, cssContent: decodeStyleEntities(rawContent) })\n })\n\n if (!styleTags.length) return dom\n\n const fromPath = filePath ?? resolve(process.cwd(), 'template.vue')\n const fromDir = dirname(fromPath)\n\n // Only compute source directives if at least one style tag uses Tailwind\n const hasTailwindStyles = styleTags.some(({ cssContent }) => usesTailwind(cssContent))\n const sourceDirectives = hasTailwindStyles\n ? buildSourceDirectives(dom, config, fromDir)\n : ''\n\n for (let i = 0; i < styleTags.length; i++) {\n const { node, cssContent } = styleTags[i]\n\n /**\n * Only add source directives to style tags that import Tailwind —\n * plain CSS doesn't need them and @tailwindcss/postcss would\n * leave the directives unconsumed in the output.\n */\n const fullCss = usesTailwind(cssContent)\n ? `${cssContent}\\n${sourceDirectives}`\n : cssContent\n\n try {\n const optimized = await compileTailwindCss(fullCss, config, `${fromPath}?style=${i}`)\n\n // Replace the style tag's children with the compiled CSS\n node.children = [{\n type: 'text',\n data: optimized,\n parent: node,\n } as any]\n } catch {\n /**\n * If CSS processing fails, still replace with decoded content\n * so HTML entities don't break the CSS.\n */\n node.children = [{\n type: 'text',\n data: cssContent,\n parent: node,\n } as any]\n }\n }\n\n return dom\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAS,aAAa,KAAsB;CAC1C,OAAO,+EAA+E,KAAK,GAAG;AAChG;;;;;;;;;;;AAYA,SAAS,sBAAsB,KAAkB,QAAuB,SAAyB;CAC/F,MAAM,aAAuB,CAAC;CAG9B,MAAM,eAAe,CACnB,QAAQ,OAAO,QAAQ,QAAQ,MAAM,GACrC,IAAI,OAAO,KAAK,WAAW,CAAC,EAAA,CAAG,KAAI,MAAK,QAAQ,CAAC,CAAC,CACpD;CAEA,KAAK,MAAM,KAAK,cACd,WAAW,KAAK,gBAAgB,SAAS,SAAS,QAAQ,CAAC,CAAC,EAAE,GAAG;;;;;;;;CAUnE,MAAM,UAAoB,CAAC;CAC3B,KAAK,MAAM,MAAM;EACf,MAAM,MAAO,EAAc,SAAS;EACpC,IAAI,KAAK,QAAQ,KAAK,GAAG;CAC3B,CAAC;CAED,IAAI,QAAQ,QACV,WAAW,KAAK,mBAAmB,QAAQ,KAAK,GAAG,E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ery.ts"],"sourcesContent":["import queryString from 'query-string'\nimport { selectAll } from 'css-select'\nimport type { ChildNode, Element } from 'domhandler'\nimport { parse, serialize } from '../utils/ast/index.ts'\nimport { isAbsoluteUrl } from '../utils/url.ts'\nimport type { UrlQueryOptions } from '../types/config.ts'\n\nconst DEFAULT_ATTRIBUTES = ['src', 'href', 'poster', 'srcset', 'background']\nconst DEFAULT_TAGS = ['a']\n\n/**\n * Append query parameters to a URL string using query-string.\n */\nfunction appendParams(\n url: string,\n params: Record<string, unknown>,\n qsOptions: queryString.StringifyOptions,\n strict: boolean,\n): string {\n if (strict && !isAbsoluteUrl(url)) return url\n\n return queryString.stringifyUrl(\n { url, query: params as queryString.StringifiableRecord },\n qsOptions,\n )\n}\n\n/**\n * Append query parameters to URLs found in matching attributes/elements.\n *\n * @param html HTML string to transform.\n * @param params Query parameters to append (e.g. `{ utm_source: 'newsletter' }`).\n * @param options Behaviour overrides — `tags` (CSS selectors, default `['a']`),\n * `attributes` (default `['src', 'href', 'poster', 'srcset', 'background']`),\n * `strict` (default `true`, only rewrites absolute URLs),\n * `qs` (forwarded to `query-string`, default `{ encode: false }`).\n * @returns The transformed HTML string.\n *\n * @example\n * import { urlQuery } from '@maizzle/framework'\n *\n * const out = urlQuery(\n * '<a href=\"https://example.com\">x</a>',\n * { utm_source: 'newsletter' },\n * )\n *\n * // Restrict to specific tags / attributes:\n * urlQuery(html, { ref: 'email' }, { tags: ['a', 'img'], attributes: ['href', 'src'] })\n */\nexport function urlQuery(\n html: string,\n params: Record<string, unknown> = {},\n options: UrlQueryOptions = {},\n): string {\n return serialize(urlQueryDom(parse(html), params, options))\n}\n\n/**\n * DOM-form of {@link urlQuery} used by the internal transformer pipeline.\n * Takes a parsed DOM, returns a parsed DOM — avoids redundant\n * serialize/parse round-trips when chained with other transformers.\n */\nexport function urlQueryDom(\n dom: ChildNode[],\n params: Record<string, unknown> = {},\n options: UrlQueryOptions = {},\n): ChildNode[] {\n if (!params || Object.keys(params).length === 0) return dom\n\n const tags = options.tags ?? DEFAULT_TAGS\n const attributes = options.attributes ?? DEFAULT_ATTRIBUTES\n const strict = options.strict ?? true\n const qsOptions: queryString.StringifyOptions = { encode: false, ...((options.qs ?? {}) as queryString.StringifyOptions) }\n\n // Use css-select to find all elements matching any of the tag selectors\n const selector = tags.join(', ')\n const elements = selectAll(selector, dom) as Element[]\n\n for (const el of elements) {\n for (const attr of attributes) {\n const value = el.attribs[attr]\n if (!value) continue\n\n const updated = appendParams(value, params, qsOptions, strict)\n if (updated !== value) {\n el.attribs[attr] = updated\n }\n }\n }\n\n return dom\n}\n"],"mappings":";;;;;;;AAOA,MAAM,qBAAqB;CAAC;CAAO;CAAQ;CAAU;CAAU;AAAY;AAC3E,MAAM,eAAe,CAAC,GAAG;;;;AAKzB,SAAS,aACP,KACA,QACA,WACA,QACQ;CACR,IAAI,UAAU,CAAC,cAAc,GAAG,GAAG,OAAO;CAE1C,OAAO,YAAY,aACjB;EAAE;EAAK,OAAO;CAA0C,GACxD,SACF;AACF;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,SACd,MACA,SAAkC,CAAC,GACnC,UAA2B,CAAC,GACpB;CACR,OAAO,UAAU,YAAY,MAAM,IAAI,GAAG,QAAQ,OAAO,CAAC;AAC5D;;;;;;AAOA,SAAgB,YACd,KACA,SAAkC,CAAC,GACnC,UAA2B,CAAC,GACf;CACb,IAAI,CAAC,UAAU,OAAO,KAAK,MAAM,EAAE,WAAW,GAAG,OAAO;CAExD,MAAM,OAAO,QAAQ,QAAQ;CAC7B,MAAM,aAAa,QAAQ,cAAc;CACzC,MAAM,SAAS,QAAQ,UAAU;CACjC,MAAM,YAA0C;EAAE,QAAQ;EAAO,GAAK,QAAQ,MAAM,CAAC;CAAoC;CAIzH,MAAM,WAAW,UADA,KAAK,KAAK,IACO,GAAG,GAAG;CAExC,KAAK,MAAM,MAAM,UACf,KAAK,MAAM,QAAQ,YAAY;EAC7B,MAAM,QAAQ,GAAG,QAAQ;EACzB,IAAI,CAAC,OAAO;EAEZ,MAAM,UAAU,aAAa,OAAO,QAAQ,WAAW,MAAM;EAC7D,IAAI,YAAY,OACd,GAAG,QAAQ,QAAQ;CAEvB;CAGF,OAAO;AACT"}
1
+ {"version":3,"file":"urlQuery.js","names":[],"sources":["../../src/transformers/urlQuery.ts"],"sourcesContent":["import queryString from 'query-string'\nimport { selectAll } from 'css-select'\nimport type { ChildNode, Element } from 'domhandler'\nimport { parse, serialize } from '../utils/ast/index.ts'\nimport { isAbsoluteUrl } from '../utils/url.ts'\nimport type { UrlQueryOptions } from '../types/config.ts'\n\nconst DEFAULT_ATTRIBUTES = ['src', 'href', 'poster', 'srcset', 'background']\nconst DEFAULT_TAGS = ['a']\n\n/**\n * Append query parameters to a URL string using query-string.\n */\nfunction appendParams(\n url: string,\n params: Record<string, unknown>,\n qsOptions: queryString.StringifyOptions,\n strict: boolean,\n): string {\n if (strict && !isAbsoluteUrl(url)) return url\n\n return queryString.stringifyUrl(\n { url, query: params as queryString.StringifiableRecord },\n qsOptions,\n )\n}\n\n/**\n * Append query parameters to URLs found in matching attributes/elements.\n *\n * @param html HTML string to transform.\n * @param params Query parameters to append (e.g. `{ utm_source: 'newsletter' }`).\n * @param options Behaviour overrides — `tags` (CSS selectors, default `['a']`),\n * `attributes` (default `['src', 'href', 'poster', 'srcset', 'background']`),\n * `strict` (default `true`, only rewrites absolute URLs),\n * `qs` (forwarded to `query-string`, default `{ encode: false }`).\n * @returns The transformed HTML string.\n *\n * @example\n * import { urlQuery } from '@maizzle/framework'\n *\n * const out = urlQuery(\n * '<a href=\"https://example.com\">x</a>',\n * { utm_source: 'newsletter' },\n * )\n *\n * // Restrict to specific tags / attributes:\n * urlQuery(html, { ref: 'email' }, { tags: ['a', 'img'], attributes: ['href', 'src'] })\n */\nexport function urlQuery(\n html: string,\n params: Record<string, unknown> = {},\n options: UrlQueryOptions = {},\n): string {\n return serialize(urlQueryDom(parse(html), params, options))\n}\n\n/**\n * DOM-form of {@link urlQuery} used by the internal transformer pipeline.\n * Takes a parsed DOM, returns a parsed DOM — avoids redundant\n * serialize/parse round-trips when chained with other transformers.\n */\nexport function urlQueryDom(\n dom: ChildNode[],\n params: Record<string, unknown> = {},\n options: UrlQueryOptions = {},\n): ChildNode[] {\n if (!params || Object.keys(params).length === 0) return dom\n\n const tags = options.tags ?? DEFAULT_TAGS\n const attributes = options.attributes ?? DEFAULT_ATTRIBUTES\n const strict = options.strict ?? true\n const qsOptions: queryString.StringifyOptions = { encode: false, ...((options.qs ?? {}) as queryString.StringifyOptions) }\n\n // Use css-select to find all elements matching any of the tag selectors\n const selector = tags.join(', ')\n const elements = selectAll(selector, dom) as Element[]\n\n for (const el of elements) {\n for (const attr of attributes) {\n const value = el.attribs[attr]\n if (!value) continue\n\n const updated = appendParams(value, params, qsOptions, strict)\n if (updated !== value) {\n el.attribs[attr] = updated\n }\n }\n }\n\n return dom\n}\n"],"mappings":";;;;;;;AAOA,MAAM,qBAAqB;CAAC;CAAO;CAAQ;CAAU;CAAU;AAAY;AAC3E,MAAM,eAAe,CAAC,GAAG;;;;AAKzB,SAAS,aACP,KACA,QACA,WACA,QACQ;CACR,IAAI,UAAU,CAAC,cAAc,GAAG,GAAG,OAAO;CAE1C,OAAO,YAAY,aACjB;EAAE;EAAK,OAAO;CAA0C,GACxD,SACF;AACF;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,SACd,MACA,SAAkC,CAAC,GACnC,UAA2B,CAAC,GACpB;CACR,OAAO,UAAU,YAAY,MAAM,IAAI,GAAG,QAAQ,OAAO,CAAC;AAC5D;;;;;;AAOA,SAAgB,YACd,KACA,SAAkC,CAAC,GACnC,UAA2B,CAAC,GACf;CACb,IAAI,CAAC,UAAU,OAAO,KAAK,MAAM,CAAC,CAAC,WAAW,GAAG,OAAO;CAExD,MAAM,OAAO,QAAQ,QAAQ;CAC7B,MAAM,aAAa,QAAQ,cAAc;CACzC,MAAM,SAAS,QAAQ,UAAU;CACjC,MAAM,YAA0C;EAAE,QAAQ;EAAO,GAAK,QAAQ,MAAM,CAAC;CAAoC;CAIzH,MAAM,WAAW,UADA,KAAK,KAAK,IACO,GAAG,GAAG;CAExC,KAAK,MAAM,MAAM,UACf,KAAK,MAAM,QAAQ,YAAY;EAC7B,MAAM,QAAQ,GAAG,QAAQ;EACzB,IAAI,CAAC,OAAO;EAEZ,MAAM,UAAU,aAAa,OAAO,QAAQ,WAAW,MAAM;EAC7D,IAAI,YAAY,OACd,GAAG,QAAQ,QAAQ;CAEvB;CAGF,OAAO;AACT"}
@@ -1,11 +1,12 @@
1
1
  import { RemoveValue } from "../plugins/postcss/removeDeclarations.js";
2
2
  import { TemplateInfo } from "../events/index.js";
3
3
  import { Directive, Plugin } from "vue";
4
- import { Options } from "juice";
4
+ import juice from "juice";
5
5
  import { InlineConfig } from "vite";
6
- import { Options as Options$1 } from "unplugin-vue-markdown/types";
6
+ import { Options } from "unplugin-vue-markdown/types";
7
7
 
8
8
  //#region src/types/config.d.ts
9
+ type JuiceOptions = NonNullable<Parameters<typeof juice>[1]>;
9
10
  interface UrlQueryOptions {
10
11
  /**
11
12
  * CSS selectors for elements to process.
@@ -94,7 +95,7 @@ interface CssConfig {
94
95
  * }
95
96
  * }
96
97
  */
97
- inline?: boolean | Options & {
98
+ inline?: boolean | JuiceOptions & {
98
99
  /**
99
100
  * Convert HTML attributes like `width`, `height`, `bgcolor`, and `valign`
100
101
  * to inline CSS styles. Set to `true` for all, or pass an array of attribute names.
@@ -362,7 +363,7 @@ interface HtmlConfig {
362
363
  }
363
364
  type FilterFunction = (str: string, value: string) => string;
364
365
  type FiltersConfig = false | Record<string, FilterFunction>;
365
- interface MarkdownConfig extends Options$1 {
366
+ interface MarkdownConfig extends Options {
366
367
  /**
367
368
  * The shiki theme to use for syntax highlighting in Markdown fenced code blocks.
368
369
  *
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","names":[],"sources":["../../src/types/config.ts"],"mappings":";;;;;;;;UAMiB,eAAA;;;A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AAA;;;;;;;;;EAS5B,cAAA,GAAiB,MAAA;;;;;;;;;;;;EAYjB,OAAA,GAAU,aAAA;;EAEV,GAAA,GAAM,SAAA;;EAEN,IAAA,GAAO,UAAA;;;;;;;;;;;;;EAaP,IAAA,GAAO,YAAA;;;;;;;;;;;;;;;;EAgBP,GAAA,GAAM,SAAA;;EAKN,YAAA,IAAgB,MAAA;IAAU,MAAA,EAAQ,aAAA;EAAA,aAA2B,OAAA;;EAE7D,YAAA,IAAgB,MAAA;IAAU,MAAA,EAAQ,aAAA;IAAe,QAAA,EAAU,YAAA;EAAA,sBAAmC,OAAA;;EAE9F,WAAA,IAAe,MAAA;IAAU,MAAA,EAAQ,aAAA;IAAe,QAAA,EAAU,YAAA;IAAc,IAAA;EAAA,sBAAmC,OAAA;;EAE3G,cAAA,IAAkB,MAAA;IAAU,MAAA,EAAQ,aAAA;IAAe,QAAA,EAAU,YAAA;IAAc,IAAA;EAAA,sBAAmC,OAAA;;EAE9G,UAAA,IAAc,MAAA;IAAU,KAAA;IAAiB,MAAA,EAAQ,aAAA;EAAA,aAA2B,OAAA;EAAA,CAG3E,GAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"serializer.js","names":[],"sources":["../../../src/utils/ast/serializer.ts"],"sourcesContent":["import render from 'dom-serializer'\nimport type { ChildNode, Element, Text } from 'domhandler'\nimport type { DomSerializerOptions } from 'dom-serializer'\n\nconst RAW_TEXT_ELEMENTS = new Set(['script', 'style'])\n\n/**\n * Re-encode `<` and `>` in text nodes before serialization.\n *\n * The parser decodes entities like `&lt;` into raw `<` in text nodes. With\n * `encodeEntities: false` (needed so other transformers can emit entity\n * strings such as `&nbsp;` verbatim), the serializer would write those raw\n * `<` characters as-is, turning escaped text (e.g. a Vue `{{ html }}`\n * interpolation containing `<p>...</p>`) into real DOM downstream.\n *\n * `&` is intentionally not re-encoded: the `entities` transformer writes\n * literal entity strings (`&nbsp;`, `&mdash;`) directly into text-node data\n * and relies on the serializer leaving them alone.\n *\n * Skip `<script>` / `<style>` — their children are raw-text containers, and\n * CSS/JS legitimately contains `<` and `>`.\n */\nfunction encodeTextNodes(dom: ChildNode[], inRawText = false): void {\n for (const node of dom) {\n if (node.type === 'text') {\n if (!inRawText) {\n const text = node as Text\n text.data = text.data\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n }\n continue\n }\n\n if ('children' in node && (node as Element).children?.length) {\n const el = node as Element\n const nextRaw = inRawText || RAW_TEXT_ELEMENTS.has(el.name)\n encodeTextNodes(el.children as ChildNode[], nextRaw)\n }\n }\n}\n\nexport function serialize(dom: ChildNode[], options?: DomSerializerOptions): string {\n encodeTextNodes(dom)\n return render(dom, { encodeEntities: false, ...options })\n}\n"],"mappings":";;AAIA,MAAM,oBAAoB,IAAI,IAAI,CAAC,UAAU,OAAO,CAAC;;;;;;;;;;;;;;;;;AAkBrD,SAAS,gBAAgB,KAAkB,YAAY,OAAa;CAClE,KAAK,MAAM,QAAQ,KAAK;EACtB,IAAI,KAAK,SAAS,QAAQ;GACxB,IAAI,CAAC,WAAW;IACd,MAAM,OAAO;IACb,KAAK,OAAO,KAAK,KACd,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM;GACzB;GACA;EACF;EAEA,IAAI,cAAc,QAAS,KAAiB,UAAU,QAAQ;GAC5D,MAAM,KAAK;GACX,MAAM,UAAU,aAAa,kBAAkB,IAAI,GAAG,IAAI;GAC1D,gBAAgB,GAAG,UAAyB,OAAO;EACrD;CACF;AACF;AAEA,SAAgB,UAAU,KAAkB,SAAwC;CAClF,gBAAgB,GAAG;CACnB,OAAO,OAAO,KAAK;EAAE,gBAAgB;EAAO,GAAG;CAAQ,CAAC;AAC1D"}
1
+ {"version":3,"file":"serializer.js","names":[],"sources":["../../../src/utils/ast/serializer.ts"],"sourcesContent":["import render from 'dom-serializer'\nimport type { ChildNode, Element, Text } from 'domhandler'\nimport type { DomSerializerOptions } from 'dom-serializer'\n\nconst RAW_TEXT_ELEMENTS = new Set(['script', 'style'])\n\n/**\n * Re-encode `<` and `>` in text nodes before serialization.\n *\n * The parser decodes entities like `&lt;` into raw `<` in text nodes. With\n * `encodeEntities: false` (needed so other transformers can emit entity\n * strings such as `&nbsp;` verbatim), the serializer would write those raw\n * `<` characters as-is, turning escaped text (e.g. a Vue `{{ html }}`\n * interpolation containing `<p>...</p>`) into real DOM downstream.\n *\n * `&` is intentionally not re-encoded: the `entities` transformer writes\n * literal entity strings (`&nbsp;`, `&mdash;`) directly into text-node data\n * and relies on the serializer leaving them alone.\n *\n * Skip `<script>` / `<style>` — their children are raw-text containers, and\n * CSS/JS legitimately contains `<` and `>`.\n */\nfunction encodeTextNodes(dom: ChildNode[], inRawText = false): void {\n for (const node of dom) {\n if (node.type === 'text') {\n if (!inRawText) {\n const text = node as Text\n text.data = text.data\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n }\n continue\n }\n\n if ('children' in node && (node as Element).children?.length) {\n const el = node as Element\n const nextRaw = inRawText || RAW_TEXT_ELEMENTS.has(el.name)\n encodeTextNodes(el.children as ChildNode[], nextRaw)\n }\n }\n}\n\nexport function serialize(dom: ChildNode[], options?: DomSerializerOptions): string {\n encodeTextNodes(dom)\n return render(dom, { encodeEntities: false, ...options })\n}\n"],"mappings":";;AAIA,MAAM,oBAAoB,IAAI,IAAI,CAAC,UAAU,OAAO,CAAC;;;;;;;;;;;;;;;;;AAkBrD,SAAS,gBAAgB,KAAkB,YAAY,OAAa;CAClE,KAAK,MAAM,QAAQ,KAAK;EACtB,IAAI,KAAK,SAAS,QAAQ;GACxB,IAAI,CAAC,WAAW;IACd,MAAM,OAAO;IACb,KAAK,OAAO,KAAK,KACd,QAAQ,MAAM,MAAM,CAAC,CACrB,QAAQ,MAAM,MAAM;GACzB;GACA;EACF;EAEA,IAAI,cAAc,QAAS,KAAiB,UAAU,QAAQ;GAC5D,MAAM,KAAK;GACX,MAAM,UAAU,aAAa,kBAAkB,IAAI,GAAG,IAAI;GAC1D,gBAAgB,GAAG,UAAyB,OAAO;EACrD;CACF;AACF;AAEA,SAAgB,UAAU,KAAkB,SAAwC;CAClF,gBAAgB,GAAG;CACnB,OAAO,OAAO,KAAK;EAAE,gBAAgB;EAAO,GAAG;CAAQ,CAAC;AAC1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"compileTailwindCss.js","names":["resolveProps","pruneVars"],"sources":["../../src/utils/compileTailwindCss.ts"],"sourcesContent":["import postcss from 'postcss'\nimport tailwindcssPostcss from '@tailwindcss/postcss'\nimport postcssCalc from 'postcss-calc'\nimport safeParser from 'postcss-safe-parser'\nimport { transform } from 'lightningcss'\nimport resolveProps from '../plugins/postcss/resolveProps.ts'\nimport pruneVars from '../plugins/postcss/pruneVars.ts'\nimport { tailwindCleanup } from '../plugins/postcss/tailwindCleanup.ts'\nimport { mergeMediaQueries } from '../plugins/postcss/mergeMediaQueries.ts'\nimport { quoteFontFamilies } from '../plugins/postcss/quoteFontFamilies.ts'\nimport { resolveMaizzleImports } from '../plugins/postcss/resolveMaizzleImports.ts'\nimport type { MaizzleConfig } from '../types/config.ts'\n\nexport function createTailwindProcessor(config: MaizzleConfig) {\n return postcss([\n // Must run before @tailwindcss/postcss so it sees absolute import paths\n resolveMaizzleImports(),\n tailwindcssPostcss({\n base: config.css?.base,\n transformAssetUrls: false,\n optimize: false,\n }),\n resolveProps(),\n postcssCalc({}),\n pruneVars(),\n ])\n}\n\nexport function lowerCssSyntax(css: string): string {\n const result = transform({\n filename: 'email.css',\n code: Buffer.from(css),\n minify: false,\n targets: { ie: 4 << 5 },\n })\n\n return result.code.toString()\n}\n\nexport async function optimizeTailwindCss(css: string, config: MaizzleConfig): Promise<string> {\n const plugins: postcss.Plugin[] = [...tailwindCleanup(config), quoteFontFamilies()]\n\n const mediaPlugin = mergeMediaQueries(config)\n if (mediaPlugin) plugins.push(mediaPlugin)\n\n const result = await postcss(plugins).process(css, { from: undefined })\n\n return result.css\n}\n\n/**\n * Compile a Tailwind CSS source string into final email-safe CSS:\n * runs @tailwindcss/postcss, lowers modern syntax via lightningcss,\n * then applies cleanup + media-query merging.\n */\nexport async function compileTailwindCss(\n cssInput: string,\n config: MaizzleConfig,\n from: string,\n): Promise<string> {\n const processor = createTailwindProcessor(config)\n const result = await processor.process(cssInput, { from, parser: safeParser })\n const lowered = lowerCssSyntax(result.css)\n return optimizeTailwindCss(lowered, config)\n}\n"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,wBAAwB,QAAuB;CAC7D,OAAO,QAAQ;EAEb,sBAAsB;EACtB,mBAAmB;GACjB,MAAM,OAAO,KAAK;GAClB,oBAAoB;GACpB,UAAU;EACZ,CAAC;EACDA,qBAAa;EACb,YAAY,CAAC,CAAC;EACdC,kBAAU;CACZ,CAAC;AACH;AAEA,SAAgB,eAAe,KAAqB;CAQlD,OAPe,UAAU;EACvB,UAAU;EACV,MAAM,OAAO,KAAK,GAAG;EACrB,QAAQ;EACR,SAAS,EAAE,IAAI,IAAO;CACxB,CAEY,EAAE,KAAK,SAAS;AAC9B;AAEA,eAAsB,oBAAoB,KAAa,QAAwC;CAC7F,MAAM,UAA4B,CAAC,GAAG,gBAAgB,MAAM,GAAG,kBAAkB,CAAC;CAElF,MAAM,cAAc,kBAAkB,MAAM;CAC5C,IAAI,aAAa,QAAQ,KAAK,WAAW;CAIzC,QAAO,MAFc,QAAQ,OAAO,EAAE,QAAQ,KAAK,EAAE,MAAM,KAAA,EAAU,CAAC,GAExD;AAChB;;;;;;AAOA,eAAsB,mBACpB,UACA,QACA,MACiB;CAIjB,OAAO,oBADS,gBAAe,MAFb,wBAAwB,MACb,EAAE,QAAQ,UAAU;EAAE;EAAM,QAAQ;CAAW,CAAC,GACvC,GACL,GAAG,MAAM;AAC5C"}
1
+ {"version":3,"file":"compileTailwindCss.js","names":["resolveProps","pruneVars"],"sources":["../../src/utils/compileTailwindCss.ts"],"sourcesContent":["import postcss from 'postcss'\nimport tailwindcssPostcss from '@tailwindcss/postcss'\nimport postcssCalc from 'postcss-calc'\nimport safeParser from 'postcss-safe-parser'\nimport { transform } from 'lightningcss'\nimport resolveProps from '../plugins/postcss/resolveProps.ts'\nimport pruneVars from '../plugins/postcss/pruneVars.ts'\nimport { tailwindCleanup } from '../plugins/postcss/tailwindCleanup.ts'\nimport { mergeMediaQueries } from '../plugins/postcss/mergeMediaQueries.ts'\nimport { quoteFontFamilies } from '../plugins/postcss/quoteFontFamilies.ts'\nimport { resolveMaizzleImports } from '../plugins/postcss/resolveMaizzleImports.ts'\nimport type { MaizzleConfig } from '../types/config.ts'\n\nexport function createTailwindProcessor(config: MaizzleConfig) {\n return postcss([\n // Must run before @tailwindcss/postcss so it sees absolute import paths\n resolveMaizzleImports(),\n tailwindcssPostcss({\n base: config.css?.base,\n transformAssetUrls: false,\n optimize: false,\n }),\n resolveProps(),\n postcssCalc({}),\n pruneVars(),\n ])\n}\n\nexport function lowerCssSyntax(css: string): string {\n const result = transform({\n filename: 'email.css',\n code: Buffer.from(css),\n minify: false,\n targets: { ie: 4 << 5 },\n })\n\n return result.code.toString()\n}\n\nexport async function optimizeTailwindCss(css: string, config: MaizzleConfig): Promise<string> {\n const plugins: postcss.Plugin[] = [...tailwindCleanup(config), quoteFontFamilies()]\n\n const mediaPlugin = mergeMediaQueries(config)\n if (mediaPlugin) plugins.push(mediaPlugin)\n\n const result = await postcss(plugins).process(css, { from: undefined })\n\n return result.css\n}\n\n/**\n * Compile a Tailwind CSS source string into final email-safe CSS:\n * runs @tailwindcss/postcss, lowers modern syntax via lightningcss,\n * then applies cleanup + media-query merging.\n */\nexport async function compileTailwindCss(\n cssInput: string,\n config: MaizzleConfig,\n from: string,\n): Promise<string> {\n const processor = createTailwindProcessor(config)\n const result = await processor.process(cssInput, { from, parser: safeParser })\n const lowered = lowerCssSyntax(result.css)\n return optimizeTailwindCss(lowered, config)\n}\n"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,wBAAwB,QAAuB;CAC7D,OAAO,QAAQ;EAEb,sBAAsB;EACtB,mBAAmB;GACjB,MAAM,OAAO,KAAK;GAClB,oBAAoB;GACpB,UAAU;EACZ,CAAC;EACDA,qBAAa;EACb,YAAY,CAAC,CAAC;EACdC,kBAAU;CACZ,CAAC;AACH;AAEA,SAAgB,eAAe,KAAqB;CAQlD,OAPe,UAAU;EACvB,UAAU;EACV,MAAM,OAAO,KAAK,GAAG;EACrB,QAAQ;EACR,SAAS,EAAE,IAAI,IAAO;CACxB,CAEY,CAAC,CAAC,KAAK,SAAS;AAC9B;AAEA,eAAsB,oBAAoB,KAAa,QAAwC;CAC7F,MAAM,UAA4B,CAAC,GAAG,gBAAgB,MAAM,GAAG,kBAAkB,CAAC;CAElF,MAAM,cAAc,kBAAkB,MAAM;CAC5C,IAAI,aAAa,QAAQ,KAAK,WAAW;CAIzC,QAAO,MAFc,QAAQ,OAAO,CAAC,CAAC,QAAQ,KAAK,EAAE,MAAM,KAAA,EAAU,CAAC,EAAA,CAExD;AAChB;;;;;;AAOA,eAAsB,mBACpB,UACA,QACA,MACiB;CAIjB,OAAO,oBADS,gBAAe,MAFb,wBAAwB,MACb,CAAC,CAAC,QAAQ,UAAU;EAAE;EAAM,QAAQ;CAAW,CAAC,EAAA,CACvC,GACL,GAAG,MAAM;AAC5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"componentSources.js","names":[],"sources":["../../src/utils/componentSources.ts"],"sourcesContent":["import { resolve, relative } from 'node:path'\nimport type { ComponentSource } from '../types/config.ts'\n\n/**\n * Internal representation of a component source after defaults are\n * resolved and `path` is made absolute. Always carries the same shape\n * regardless of which user-facing form produced it.\n */\nexport interface NormalizedComponentSource {\n /** Absolute directory path. */\n path: string\n /**\n * Custom prefix prepended to resolved component names.\n * - `undefined` → use folder-name namespace (the `directoryAsNamespace`\n * behavior of unplugin-vue-components).\n * - `''` (empty string) → no prefix at all; use the bare filename.\n * - any other string → exact prefix.\n */\n prefix?: string\n /** Include intermediate subfolder names in the resolved name. */\n pathPrefix: boolean\n}\n\n/**\n * Normalize a user-supplied `components.source` value into an array\n * of absolute, fully-defaulted entries.\n */\nexport function normalizeComponentSources(\n sources: ComponentSource | ComponentSource[] | undefined,\n cwd: string,\n): NormalizedComponentSource[] {\n if (!sources) return []\n const list = Array.isArray(sources) ? sources : [sources]\n return list.map((s) => {\n if (typeof s === 'string') {\n return { path: resolve(cwd, s), prefix: undefined, pathPrefix: true }\n }\n return {\n path: resolve(cwd, s.path),\n prefix: s.prefix,\n pathPrefix: s.pathPrefix ?? true,\n }\n })\n}\n\nfunction pascalCase(s: string): string {\n return s\n .replace(/[-_\\s]+(.)/g, (_, c) => c.toUpperCase())\n .replace(/^(.)/, c => c.toUpperCase())\n}\n\nexport interface ComponentNameOptions {\n /** Absolute path to the component file. */\n filePath: string\n /** Absolute path to the dir root the component was discovered under. */\n dirRoot: string\n /** See {@link NormalizedComponentSource.prefix}. */\n prefix?: string\n /** See {@link NormalizedComponentSource.pathPrefix}. */\n pathPrefix: boolean\n}\n\n/**\n * Compute the component name unplugin-vue-components would assign for a\n * given file under a given dir, mirroring the plugin's\n * `directoryAsNamespace: true` + `collapseSamePrefixes: true` behavior\n * and layering custom-prefix sources on top.\n *\n * Used both at render time (to register a custom resolver) and at lint\n * time (so the linter can follow component graph correctly).\n */\nexport function componentNameFromPath(opts: ComponentNameOptions): string {\n const { filePath, dirRoot, prefix, pathPrefix } = opts\n\n const rel = relative(dirRoot, filePath).replace(/\\\\/g, '/')\n const noExt = rel.replace(/\\.(vue|md)$/, '')\n const segments = noExt.split('/').map(pascalCase)\n const fileName = segments.pop() ?? ''\n\n if (prefix !== undefined) {\n const folderPart = pathPrefix ? segments.join('') : ''\n const stripped = prefix && fileName.startsWith(prefix)\n ? fileName.slice(prefix.length)\n : fileName\n return prefix + folderPart + stripped\n }\n\n const folderPart = segments.join('')\n if (folderPart && fileName.startsWith(folderPart)) {\n return fileName\n }\n return folderPart + fileName\n}\n"],"mappings":";;;;;;AA2BA,SAAgB,0BACd,SACA,KAC6B;CAC7B,IAAI,CAAC,SAAS,OAAO,CAAC;CAEtB,QADa,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,GAC5C,KAAK,MAAM;EACrB,IAAI,OAAO,MAAM,UACf,OAAO;GAAE,MAAM,QAAQ,KAAK,CAAC;GAAG,QAAQ,KAAA;GAAW,YAAY;EAAK;EAEtE,OAAO;GACL,MAAM,QAAQ,KAAK,EAAE,IAAI;GACzB,QAAQ,EAAE;GACV,YAAY,EAAE,cAAc;EAC9B;CACF,CAAC;AACH;AAEA,SAAS,WAAW,GAAmB;CACrC,OAAO,EACJ,QAAQ,gBAAgB,GAAG,MAAM,EAAE,YAAY,CAAC,EAChD,QAAQ,SAAQ,MAAK,EAAE,YAAY,CAAC;AACzC;;;;;;;;;;AAsBA,SAAgB,sBAAsB,MAAoC;CACxE,MAAM,EAAE,UAAU,SAAS,QAAQ,eAAe;CAIlD,MAAM,WAFM,SAAS,SAAS,QAAQ,EAAE,QAAQ,OAAO,GACvC,EAAE,QAAQ,eAAe,EACpB,EAAE,MAAM,GAAG,EAAE,IAAI,UAAU;CAChD,MAAM,WAAW,SAAS,IAAI,KAAK;CAEnC,IAAI,WAAW,KAAA,GAAW;EACxB,MAAM,aAAa,aAAa,SAAS,KAAK,EAAE,IAAI;EACpD,MAAM,WAAW,UAAU,SAAS,WAAW,MAAM,IACjD,SAAS,MAAM,OAAO,MAAM,IAC5B;EACJ,OAAO,SAAS,aAAa;CAC/B;CAEA,MAAM,aAAa,SAAS,KAAK,EAAE;CACnC,IAAI,cAAc,SAAS,WAAW,UAAU,GAC9C,OAAO;CAET,OAAO,aAAa;AACtB"}
1
+ {"version":3,"file":"componentSources.js","names":[],"sources":["../../src/utils/componentSources.ts"],"sourcesContent":["import { resolve, relative } from 'node:path'\nimport type { ComponentSource } from '../types/config.ts'\n\n/**\n * Internal representation of a component source after defaults are\n * resolved and `path` is made absolute. Always carries the same shape\n * regardless of which user-facing form produced it.\n */\nexport interface NormalizedComponentSource {\n /** Absolute directory path. */\n path: string\n /**\n * Custom prefix prepended to resolved component names.\n * - `undefined` → use folder-name namespace (the `directoryAsNamespace`\n * behavior of unplugin-vue-components).\n * - `''` (empty string) → no prefix at all; use the bare filename.\n * - any other string → exact prefix.\n */\n prefix?: string\n /** Include intermediate subfolder names in the resolved name. */\n pathPrefix: boolean\n}\n\n/**\n * Normalize a user-supplied `components.source` value into an array\n * of absolute, fully-defaulted entries.\n */\nexport function normalizeComponentSources(\n sources: ComponentSource | ComponentSource[] | undefined,\n cwd: string,\n): NormalizedComponentSource[] {\n if (!sources) return []\n const list = Array.isArray(sources) ? sources : [sources]\n return list.map((s) => {\n if (typeof s === 'string') {\n return { path: resolve(cwd, s), prefix: undefined, pathPrefix: true }\n }\n return {\n path: resolve(cwd, s.path),\n prefix: s.prefix,\n pathPrefix: s.pathPrefix ?? true,\n }\n })\n}\n\nfunction pascalCase(s: string): string {\n return s\n .replace(/[-_\\s]+(.)/g, (_, c) => c.toUpperCase())\n .replace(/^(.)/, c => c.toUpperCase())\n}\n\nexport interface ComponentNameOptions {\n /** Absolute path to the component file. */\n filePath: string\n /** Absolute path to the dir root the component was discovered under. */\n dirRoot: string\n /** See {@link NormalizedComponentSource.prefix}. */\n prefix?: string\n /** See {@link NormalizedComponentSource.pathPrefix}. */\n pathPrefix: boolean\n}\n\n/**\n * Compute the component name unplugin-vue-components would assign for a\n * given file under a given dir, mirroring the plugin's\n * `directoryAsNamespace: true` + `collapseSamePrefixes: true` behavior\n * and layering custom-prefix sources on top.\n *\n * Used both at render time (to register a custom resolver) and at lint\n * time (so the linter can follow component graph correctly).\n */\nexport function componentNameFromPath(opts: ComponentNameOptions): string {\n const { filePath, dirRoot, prefix, pathPrefix } = opts\n\n const rel = relative(dirRoot, filePath).replace(/\\\\/g, '/')\n const noExt = rel.replace(/\\.(vue|md)$/, '')\n const segments = noExt.split('/').map(pascalCase)\n const fileName = segments.pop() ?? ''\n\n if (prefix !== undefined) {\n const folderPart = pathPrefix ? segments.join('') : ''\n const stripped = prefix && fileName.startsWith(prefix)\n ? fileName.slice(prefix.length)\n : fileName\n return prefix + folderPart + stripped\n }\n\n const folderPart = segments.join('')\n if (folderPart && fileName.startsWith(folderPart)) {\n return fileName\n }\n return folderPart + fileName\n}\n"],"mappings":";;;;;;AA2BA,SAAgB,0BACd,SACA,KAC6B;CAC7B,IAAI,CAAC,SAAS,OAAO,CAAC;CAEtB,QADa,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,EAAA,CAC5C,KAAK,MAAM;EACrB,IAAI,OAAO,MAAM,UACf,OAAO;GAAE,MAAM,QAAQ,KAAK,CAAC;GAAG,QAAQ,KAAA;GAAW,YAAY;EAAK;EAEtE,OAAO;GACL,MAAM,QAAQ,KAAK,EAAE,IAAI;GACzB,QAAQ,EAAE;GACV,YAAY,EAAE,cAAc;EAC9B;CACF,CAAC;AACH;AAEA,SAAS,WAAW,GAAmB;CACrC,OAAO,EACJ,QAAQ,gBAAgB,GAAG,MAAM,EAAE,YAAY,CAAC,CAAC,CACjD,QAAQ,SAAQ,MAAK,EAAE,YAAY,CAAC;AACzC;;;;;;;;;;AAsBA,SAAgB,sBAAsB,MAAoC;CACxE,MAAM,EAAE,UAAU,SAAS,QAAQ,eAAe;CAIlD,MAAM,WAFM,SAAS,SAAS,QAAQ,CAAC,CAAC,QAAQ,OAAO,GACvC,CAAC,CAAC,QAAQ,eAAe,EACpB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,UAAU;CAChD,MAAM,WAAW,SAAS,IAAI,KAAK;CAEnC,IAAI,WAAW,KAAA,GAAW;EACxB,MAAM,aAAa,aAAa,SAAS,KAAK,EAAE,IAAI;EACpD,MAAM,WAAW,UAAU,SAAS,WAAW,MAAM,IACjD,SAAS,MAAM,OAAO,MAAM,IAC5B;EACJ,OAAO,SAAS,aAAa;CAC/B;CAEA,MAAM,aAAa,SAAS,KAAK,EAAE;CACnC,IAAI,cAAc,SAAS,WAAW,UAAU,GAC9C,OAAO;CAET,OAAO,aAAa;AACtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"cssBox.d.ts","names":[],"sources":["../../src/utils/cssBox.ts"],"mappings":";;;cAEa,gBAAA,EAAgB,GAAA;;AAA7B;;;;iBAOgB,UAAA,CAAW,KAAa;AAAxC;;;;AAAwC;AAoBxC;;AApBA,iBAoBgB,cAAA,CAAe,KAAA;EAAkB,IAAA;EAAe,KAAA;AAAA;;;AAAK;AAerE;iBAAgB,mBAAA,CAAoB,IAAU,EAAJ,IAAI;;;AAAA;AA8B9C;;;iBAAgB,sBAAA,CAAuB,KAAa;AAAA;AAepD;;;;AAfoD,iBAepC,kBAAA,CAAmB,IAAU,EAAJ,IAAI"}
1
+ {"version":3,"file":"cssBox.d.ts","names":[],"sources":["../../src/utils/cssBox.ts"],"mappings":";;;cAEa,gBAAA,EAAgB,GAAA;;AAA7B;;;;iBAOgB,UAAA,CAAW,KAAa;AAAxC;;;;AAAwC;AAexC;;AAfA,iBAegB,cAAA,CAAe,KAAA;EAAkB,IAAA;EAAe,KAAA;AAAA;;;AAAK;AAerE;iBAAgB,mBAAA,CAAoB,IAAU,EAAJ,IAAI;;;AAAA;AA8B9C;;;iBAAgB,sBAAA,CAAuB,KAAa;AAAA;AAepD;;;;AAfoD,iBAepC,kBAAA,CAAmB,IAAU,EAAJ,IAAI"}
@@ -9,13 +9,8 @@ function lengthToPx(value) {
9
9
  const m = value.trim().match(/^([\d.]+)(px|rem|em|pt)?$/i);
10
10
  if (!m) return null;
11
11
  const n = parseFloat(m[1]);
12
- switch ((m[2] || "px").toLowerCase()) {
13
- case "px": return n;
14
- case "rem":
15
- case "em": return n * 16;
16
- case "pt": return n * 1.333;
17
- default: return null;
18
- }
12
+ const unit = (m[2] || "px").toLowerCase();
13
+ return n * (unit === "rem" || unit === "em" ? 16 : unit === "pt" ? 1.333 : 1);
19
14
  }
20
15
  /**
21
16
  * Expand a 1-4 token CSS shorthand (T R B L) into a left/right pair:
@@ -1 +1 @@
1
- {"version":3,"file":"cssBox.js","names":[],"sources":["../../src/utils/cssBox.ts"],"sourcesContent":["import type { Root } from 'postcss'\n\nexport const NO_BORDER_STYLES = new Set(['none', 'hidden'])\n\n/**\n * Parse a length token into px. Handles `Npx`, `Nrem`, `Nem`, `Npt`, and\n * unitless N (treated as px). Returns null for percentages, calc(),\n * keywords, or anything that doesn't reduce to a concrete length.\n */\nexport function lengthToPx(value: string): number | null {\n const m = value.trim().match(/^([\\d.]+)(px|rem|em|pt)?$/i)\n if (!m) return null\n const n = parseFloat(m[1])\n switch ((m[2] || 'px').toLowerCase()) {\n case 'px': return n\n case 'rem':\n case 'em': return n * 16\n case 'pt': return n * 1.333\n default: return null\n }\n}\n\n/**\n * Expand a 1-4 token CSS shorthand (T R B L) into a left/right pair:\n * 1: all sides\n * 2: TB RL\n * 3: T RL B\n * 4: T R B L\n */\nexport function shorthandSides(value: string): { left?: string; right?: string } {\n const parts = value.trim().split(/\\s+/)\n switch (parts.length) {\n case 1: return { left: parts[0], right: parts[0] }\n case 2:\n case 3: return { left: parts[1], right: parts[1] }\n case 4: return { left: parts[3], right: parts[1] }\n default: return {}\n }\n}\n\n/**\n * Read horizontal padding (left + right) px from a parsed style root.\n * Percentages are skipped since they'd need a known container width.\n */\nexport function horizontalPaddingPx(root: Root): number {\n let left: number | null = null\n let right: number | null = null\n\n root.walkDecls((d) => {\n switch (d.prop) {\n case 'padding': {\n const { left: l, right: r } = shorthandSides(d.value)\n if (l) left = lengthToPx(l)\n if (r) right = lengthToPx(r)\n break\n }\n case 'padding-left':\n left = lengthToPx(d.value)\n break\n case 'padding-right':\n right = lengthToPx(d.value)\n break\n }\n })\n\n return (left ?? 0) + (right ?? 0)\n}\n\n/**\n * Extract a px length from a CSS border shorthand (e.g. `1px solid red` → 1).\n * Returns null when the value indicates no border (`none` or `hidden`).\n * Defaults to 3px (CSS `medium`) when a visible style is set but no\n * explicit width token is present in the shorthand value.\n */\nexport function shorthandBorderWidthPx(value: string): number | null {\n const tokens = value.trim().split(/\\s+/)\n if (tokens.some((t) => NO_BORDER_STYLES.has(t.toLowerCase()))) return null\n for (const t of tokens) {\n const px = lengthToPx(t)\n if (px != null) return px\n }\n return 3\n}\n\n/**\n * Read horizontal border widths (left + right) px from a parsed style root.\n * Per-side `border-style: none|hidden` overrides count as zero\n * contribution. Returns total px or 0 when nothing resolves.\n */\nexport function horizontalBorderPx(root: Root): number {\n let left: number | null = null\n let right: number | null = null\n let leftNone = false\n let rightNone = false\n\n root.walkDecls((d) => {\n switch (d.prop) {\n case 'border': {\n const w = shorthandBorderWidthPx(d.value)\n if (w == null) {\n leftNone = rightNone = true\n }\n else {\n left = right = w\n leftNone = rightNone = false\n }\n break\n }\n case 'border-width': {\n const { left: l, right: r } = shorthandSides(d.value)\n if (l) left = lengthToPx(l) ?? left\n if (r) right = lengthToPx(r) ?? right\n break\n }\n case 'border-style': {\n const { left: l, right: r } = shorthandSides(d.value)\n if (l && NO_BORDER_STYLES.has(l.toLowerCase())) leftNone = true\n if (r && NO_BORDER_STYLES.has(r.toLowerCase())) rightNone = true\n break\n }\n case 'border-left': {\n const w = shorthandBorderWidthPx(d.value)\n if (w == null) leftNone = true\n else { left = w; leftNone = false }\n break\n }\n case 'border-right': {\n const w = shorthandBorderWidthPx(d.value)\n if (w == null) rightNone = true\n else { right = w; rightNone = false }\n break\n }\n case 'border-left-width':\n left = lengthToPx(d.value) ?? left\n break\n case 'border-right-width':\n right = lengthToPx(d.value) ?? right\n break\n case 'border-left-style':\n if (NO_BORDER_STYLES.has(d.value.trim().toLowerCase())) leftNone = true\n break\n case 'border-right-style':\n if (NO_BORDER_STYLES.has(d.value.trim().toLowerCase())) rightNone = true\n break\n }\n })\n\n return (leftNone ? 0 : (left ?? 0)) + (rightNone ? 0 : (right ?? 0))\n}\n"],"mappings":";AAEA,MAAa,mBAAmB,IAAI,IAAI,CAAC,QAAQ,QAAQ,CAAC;;;;;;AAO1D,SAAgB,WAAW,OAA8B;CACvD,MAAM,IAAI,MAAM,KAAK,EAAE,MAAM,4BA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ACnE;GACF,KAAK;IACH,IAAI,iBAAiB,IAAI,EAAE,MAAM,KAAK,EAAE,YAAY,CAAC,GAAG,YAAY;IACpE;EACJ;CACF,CAAC;CAED,QAAQ,WAAW,IAAK,QAAQ,MAAO,YAAY,IAAK,SAAS;AACnE"}
1
+ {"version":3,"file":"cssBox.js","names":[],"sources":["../../src/utils/cssBox.ts"],"sourcesContent":["import type { Root } from 'postcss'\n\nexport const NO_BORDER_STYLES = new Set(['none', 'hidden'])\n\n/**\n * Parse a length token into px. Handles `Npx`, `Nrem`, `Nem`, `Npt`, and\n * unitless N (treated as px). Returns null for percentages, calc(),\n * keywords, or anything that doesn't reduce to a concrete length.\n */\nexport function lengthToPx(value: string): number | null {\n const m = value.trim().match(/^([\\d.]+)(px|rem|em|pt)?$/i)\n if (!m) return null\n const n = parseFloat(m[1])\n const unit = (m[2] || 'px').toLowerCase()\n return n * (unit === 'rem' || unit === 'em' ? 16 : unit === 'pt' ? 1.333 : 1)\n}\n\n/**\n * Expand a 1-4 token CSS shorthand (T R B L) into a left/right pair:\n * 1: all sides\n * 2: TB RL\n * 3: T RL B\n * 4: T R B L\n */\nexport function shorthandSides(value: string): { left?: string; right?: string } {\n const parts = value.trim().split(/\\s+/)\n switch (parts.length) {\n case 1: return { left: parts[0], right: parts[0] }\n case 2:\n case 3: return { left: parts[1], right: parts[1] }\n case 4: return { left: parts[3], right: parts[1] }\n default: return {}\n }\n}\n\n/**\n * Read horizontal padding (left + right) px from a parsed style root.\n * Percentages are skipped since they'd need a known container width.\n */\nexport function horizontalPaddingPx(root: Root): number {\n let left: number | null = null\n let right: number | null = null\n\n root.walkDecls((d) => {\n switch (d.prop) {\n case 'padding': {\n const { left: l, right: r } = shorthandSides(d.value)\n if (l) left = lengthToPx(l)\n if (r) right = lengthToPx(r)\n break\n }\n case 'padding-left':\n left = lengthToPx(d.value)\n break\n case 'padding-right':\n right = lengthToPx(d.value)\n break\n }\n })\n\n return (left ?? 0) + (right ?? 0)\n}\n\n/**\n * Extract a px length from a CSS border shorthand (e.g. `1px solid red` → 1).\n * Returns null when the value indicates no border (`none` or `hidden`).\n * Defaults to 3px (CSS `medium`) when a visible style is set but no\n * explicit width token is present in the shorthand value.\n */\nexport function shorthandBorderWidthPx(value: string): number | null {\n const tokens = value.trim().split(/\\s+/)\n if (tokens.some((t) => NO_BORDER_STYLES.has(t.toLowerCase()))) return null\n for (const t of tokens) {\n const px = lengthToPx(t)\n if (px != null) return px\n }\n return 3\n}\n\n/**\n * Read horizontal border widths (left + right) px from a parsed style root.\n * Per-side `border-style: none|hidden` overrides count as zero\n * contribution. Returns total px or 0 when nothing resolves.\n */\nexport function horizontalBorderPx(root: Root): number {\n let left: number | null = null\n let right: number | null = null\n let leftNone = false\n let rightNone = false\n\n root.walkDecls((d) => {\n switch (d.prop) {\n case 'border': {\n const w = shorthandBorderWidthPx(d.value)\n if (w == null) {\n leftNone = rightNone = true\n }\n else {\n left = right = w\n leftNone = rightNone = false\n }\n break\n }\n case 'border-width': {\n const { left: l, right: r } = shorthandSides(d.value)\n if (l) left = lengthToPx(l) ?? left\n if (r) right = lengthToPx(r) ?? right\n break\n }\n case 'border-style': {\n const { left: l, right: r } = shorthandSides(d.value)\n if (l && NO_BORDER_STYLES.has(l.toLowerCase())) leftNone = true\n if (r && NO_BORDER_STYLES.has(r.toLowerCase())) rightNone = true\n break\n }\n case 'border-left': {\n const w = shorthandBorderWidthPx(d.value)\n if (w == null) leftNone = true\n else { left = w; leftNone = false }\n break\n }\n case 'border-right': {\n const w = shorthandBorderWidthPx(d.value)\n if (w == null) rightNone = true\n else { right = w; rightNone = false }\n break\n }\n case 'border-left-width':\n left = lengthToPx(d.value) ?? left\n break\n case 'border-right-width':\n right = lengthToPx(d.value) ?? right\n break\n case 'border-left-style':\n if (NO_BORDER_STYLES.has(d.value.trim().toLowerCase())) leftNone = true\n break\n case 'border-right-style':\n if (NO_BORDER_STYLES.has(d.value.trim().toLowerCase())) rightNone = true\n break\n }\n })\n\n return (leftN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O,WAAW,EAAE,KAAK,KAAK;IAC9B;GACF,KAAK;IACH,QAAQ,WAAW,EAAE,KAAK,KAAK;IAC/B;GACF,KAAK;IACH,IAAI,iBAAiB,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC,YAAY,CAAC,GAAG,WAAW;IACnE;GACF,KAAK;IACH,IAAI,iBAAiB,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC,YAAY,CAAC,GAAG,YAAY;IACpE;EACJ;CACF,CAAC;CAED,QAAQ,WAAW,IAAK,QAAQ,MAAO,YAAY,IAAK,SAAS;AACnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"decodeStyleEntities.js","names":[],"sources":["../../src/utils/decodeStyleEntities.ts"],"sourcesContent":["/**\n * Decode HTML entities that Vue SSR encodes inside `<style>` tags.\n *\n * Vue's `renderToString` HTML-encodes quotes and angle brackets within\n * style elements in templates, breaking CSS like\n * `@import \"tailwindcss\"` → `@import &quot;tailwindcss&quot;`.\n *\n * `&amp;` is decoded last so previously-decoded entities are not\n * re-processed.\n */\nexport function decodeStyleEntities(s: string): string {\n return s\n .replace(/&quot;/g, '\"')\n .replace(/&#39;/g, \"'\")\n .replace(/&apos;/g, \"'\")\n .replace(/&lt;/g, '<')\n .replace(/&gt;/g, '>')\n .replace(/&amp;/g, '&')\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAAgB,oBAAoB,GAAmB;CACrD,OAAO,EACJ,QAAQ,WAAW,IAAG,EACtB,QAAQ,UAAU,GAAG,EACrB,QAAQ,WAAW,GAAG,EACtB,QAAQ,SAAS,GAAG,EACpB,QAAQ,SAAS,GAAG,EACpB,QAAQ,UAAU,GAAG;AAC1B"}
1
+ {"version":3,"file":"decodeStyleEntities.js","names":[],"sources":["../../src/utils/decodeStyleEntities.ts"],"sourcesContent":["/**\n * Decode HTML entities that Vue SSR encodes inside `<style>` tags.\n *\n * Vue's `renderToString` HTML-encodes quotes and angle brackets within\n * style elements in templates, breaking CSS like\n * `@import \"tailwindcss\"` → `@import &quot;tailwindcss&quot;`.\n *\n * `&amp;` is decoded last so previously-decoded entities are not\n * re-processed.\n */\nexport function decodeStyleEntities(s: string): string {\n return s\n .replace(/&quot;/g, '\"')\n .replace(/&#39;/g, \"'\")\n .replace(/&apos;/g, \"'\")\n .replace(/&lt;/g, '<')\n .replace(/&gt;/g, '>')\n .replace(/&amp;/g, '&')\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAAgB,oBAAoB,GAAmB;CACrD,OAAO,EACJ,QAAQ,WAAW,IAAG,CAAC,CACvB,QAAQ,UAAU,GAAG,CAAC,CACtB,QAAQ,WAAW,GAAG,CAAC,CACvB,QAAQ,SAAS,GAAG,CAAC,CACrB,QAAQ,SAAS,GAAG,CAAC,CACrB,QAAQ,UAAU,GAAG;AAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"url.js","names":[],"sources":["../../src/utils/url.ts"],"sourcesContent":["import isUrl from 'is-url-superb'\n\nexport const defaultTags: Record<string, string[]> = {\n a: ['href'],\n img: ['src', 'srcset'],\n video: ['src', 'poster'],\n source: ['src', 'srcset'],\n link: ['href'],\n script: ['src'],\n object: ['data'],\n embed: ['src'],\n iframe: ['src'],\n 'v:image': ['src'],\n 'v:fill': ['src'],\n}\n\nexport const urlAttributes = [...new Set(Object.values(defaultTags).flat())]\n\nexport function isAbsoluteUrl(url: string): boolean {\n if (!url) return true\n\n return url.startsWith('//') || url.startsWith('#') || url.startsWith('?') || isUrl(url)\n}\n\nexport function processSrcset(srcset: string, baseUrl: string): string {\n return srcset.split(',').map(entry => {\n const parts = entry.trim().split(/\\s+/)\n\n if (parts[0] && !isAbsoluteUrl(parts[0])) {\n parts[0] = baseUrl + parts[0]\n }\n\n return parts.join(' ')\n }).join(', ')\n}\n"],"mappings":";;AAEA,MAAa,cAAwC;CACnD,GAAG,CAAC,MAAM;CACV,KAAK,CAAC,OAAO,QAAQ;CACrB,OAAO,CAAC,OAAO,QAAQ;CACvB,QAAQ,CAAC,OAAO,QAAQ;CACxB,MAAM,CAAC,MAAM;CACb,QAAQ,CAAC,KAAK;CACd,QAAQ,CAAC,MAAM;CACf,OAAO,CAAC,KAAK;CACb,QAAQ,CAAC,KAAK;CACd,WAAW,CAAC,KAAK;CACjB,UAAU,CAAC,KAAK;AAClB;AAEA,MAAa,gBAAgB,CAAC,GAAG,IAAI,IAAI,OAAO,OAAO,WAAW,EAAE,KAAK,CAAC,CAAC;AAE3E,SAAgB,cAAc,KAAsB;CAClD,IAAI,CAAC,KAAK,OAAO;CAEjB,OAAO,IAAI,WAAW,IAAI,KAAK,IAAI,WAAW,GAAG,KAAK,IAAI,WAAW,GAAG,KAAK,MAAM,GAAG;AACxF;AAEA,SAAgB,cAAc,QAAgB,SAAyB;CACrE,OAAO,OAAO,MAAM,GAAG,EAAE,KAAI,UAAS;EACpC,MAAM,QAAQ,MAAM,KAAK,EAAE,MAAM,KAAK;EAEtC,IAAI,MAAM,MAAM,CAAC,cAAc,MAAM,EAAE,GACrC,MAAM,KAAK,UAAU,MAAM;EAG7B,OAAO,MAAM,KAAK,GAAG;CACvB,CAAC,EAAE,KAAK,IAAI;AACd"}
1
+ {"version":3,"file":"url.js","names":[],"sources":["../../src/utils/url.ts"],"sourcesContent":["import isUrl from 'is-url-superb'\n\nexport const defaultTags: Record<string, string[]> = {\n a: ['href'],\n img: ['src', 'srcset'],\n video: ['src', 'poster'],\n source: ['src', 'srcset'],\n link: ['href'],\n script: ['src'],\n object: ['data'],\n embed: ['src'],\n iframe: ['src'],\n 'v:image': ['src'],\n 'v:fill': ['src'],\n}\n\nexport const urlAttributes = [...new Set(Object.values(defaultTags).flat())]\n\nexport function isAbsoluteUrl(url: string): boolean {\n if (!url) return true\n\n return url.startsWith('//') || url.startsWith('#') || url.startsWith('?') || isUrl(url)\n}\n\nexport function processSrcset(srcset: string, baseUrl: string): string {\n return srcset.split(',').map(entry => {\n const parts = entry.trim().split(/\\s+/)\n\n if (parts[0] && !isAbsoluteUrl(parts[0])) {\n parts[0] = baseUrl + parts[0]\n }\n\n return parts.join(' ')\n }).join(', ')\n}\n"],"mappings":";;AAEA,MAAa,cAAwC;CACnD,GAAG,CAAC,MAAM;CACV,KAAK,CAAC,OAAO,QAAQ;CACrB,OAAO,CAAC,OAAO,QAAQ;CACvB,QAAQ,CAAC,OAAO,QAAQ;CACxB,MAAM,CAAC,MAAM;CACb,QAAQ,CAAC,KAAK;CACd,QAAQ,CAAC,MAAM;CACf,OAAO,CAAC,KAAK;CACb,QAAQ,CAAC,KAAK;CACd,WAAW,CAAC,KAAK;CACjB,UAAU,CAAC,KAAK;AAClB;AAEA,MAAa,gBAAgB,CAAC,GAAG,IAAI,IAAI,OAAO,OAAO,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC;AAE3E,SAAgB,cAAc,KAAsB;CAClD,IAAI,CAAC,KAAK,OAAO;CAEjB,OAAO,IAAI,WAAW,IAAI,KAAK,IAAI,WAAW,GAAG,KAAK,IAAI,WAAW,GAAG,KAAK,MAAM,GAAG;AACxF;AAEA,SAAgB,cAAc,QAAgB,SAAyB;CACrE,OAAO,OAAO,MAAM,GAAG,CAAC,CAAC,KAAI,UAAS;EACpC,MAAM,QAAQ,MAAM,KAAK,CAAC,CAAC,MAAM,KAAK;EAEtC,IAAI,MAAM,MAAM,CAAC,cAAc,MAAM,EAAE,GACrC,MAAM,KAAK,UAAU,MAAM;EAG7B,OAAO,MAAM,KAAK,GAAG;CACvB,CAAC,CAAC,CAAC,KAAK,IAAI;AACd"}
@@ -1 +1 @@
1
- {"version":3,"file":"watchPaths.js","names":[],"sources":["../../src/utils/watchPaths.ts"],"sourcesContent":["import { matchesGlob, relative } from 'node:path'\n\n/**\n * Build a predicate that tells whether an absolute file path emitted by\n * chokidar matches any of the given globs. Patterns are interpreted as\n * project-relative; a leading `./` is stripped so user-supplied globs like\n * `./locales/**` behave identically to `locales/**`.\n */\nexport function createWatchedFileMatcher(patterns: string[], cwd: string) {\n const normalized = patterns.map(p => p.replace(/^\\.\\//, ''))\n return (file: string) => {\n const rel = relative(cwd, file).replace(/\\\\/g, '/')\n return normalized.some(p => matchesGlob(rel, p))\n }\n}\n"],"mappings":";;;;;;;;AAQA,SAAgB,yBAAyB,UAAoB,KAAa;CACxE,MAAM,aAAa,SAAS,KAAI,MAAK,EAAE,QAAQ,SAAS,EAAE,CAAC;CAC3D,QAAQ,SAAiB;EACvB,MAAM,MAAM,SAAS,KAAK,IAAI,EAAE,QAAQ,OAAO,GAAG;EAClD,OAAO,WAAW,MAAK,MAAK,YAAY,KAAK,CAAC,CAAC;CACjD;AACF"}
1
+ {"version":3,"file":"watchPaths.js","names":[],"sources":["../../src/utils/watchPaths.ts"],"sourcesContent":["import { matchesGlob, relative } from 'node:path'\n\n/**\n * Build a predicate that tells whether an absolute file path emitted by\n * chokidar matches any of the given globs. Patterns are interpreted as\n * project-relative; a leading `./` is stripped so user-supplied globs like\n * `./locales/**` behave identically to `locales/**`.\n */\nexport function createWatchedFileMatcher(patterns: string[], cwd: string) {\n const normalized = patterns.map(p => p.replace(/^\\.\\//, ''))\n return (file: string) => {\n const rel = relative(cwd, file).replace(/\\\\/g, '/')\n return normalized.some(p => matchesGlob(rel, p))\n }\n}\n"],"mappings":";;;;;;;;AAQA,SAAgB,yBAAyB,UAAoB,KAAa;CACxE,MAAM,aAAa,SAAS,KAAI,MAAK,EAAE,QAAQ,SAAS,EAAE,CAAC;CAC3D,QAAQ,SAAiB;EACvB,MAAM,MAAM,SAAS,KAAK,IAAI,CAAC,CAAC,QAAQ,OAAO,GAAG;EAClD,OAAO,WAAW,MAAK,MAAK,YAAY,KAAK,CAAC,CAAC;CACjD;AACF"}
@@ -1,5 +1,35 @@
1
1
  # @clack/core
2
2
 
3
+ ## 1.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#548](https://github.com/bombshell-dev/clack/pull/548) [`2356e97`](https://github.com/bombshell-dev/clack/commit/2356e97c1f46007ead55133c3a26910404ef1cfb) Thanks [@43081j](https://github.com/43081j)! - Remove sourcemaps and enable pretty-ish build output.
8
+
9
+ ## 1.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#543](https://github.com/bombshell-dev/clack/pull/543) [`83428ac`](https://github.com/bombshell-dev/clack/commit/83428ac6d8bc5eda87615cc7b1f14e0c8b16e1b6) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Adds support for Standard Schema validation
14
+
15
+ Prompts accept an optional `validate()` function to validate user input. While a function provides more flexibility and customization over your validation, it can be a bit verbose. To help solve this, there are libraries that provide schema-based validation to make shorthand and type-strict validation substantially easier.
16
+
17
+ Libraries following the [Standard Schema specification](https://github.com/standard-schema/standard-schema) are now natively supported. For example, using [Arktype](https://arktype.io/):
18
+
19
+ ```diff
20
+ import { text } from '@clack/prompts';
21
+ import { type } from 'arktype';
22
+
23
+ const name = await text({
24
+ message: 'Enter your email',
25
+ + validate: type('string.email').describe('Invalid email'),
26
+ });
27
+ ```
28
+
29
+ ### Patch Changes
30
+
31
+ - [#534](https://github.com/bombshell-dev/clack/pull/534) [`3dcb31a`](https://github.com/bombshell-dev/clack/commit/3dcb31a7d63827d95a5a52ac630cbd48e3a68364) Thanks [@MattStypa](https://github.com/MattStypa)! - Fixed spaces and uppercase characters in multiline prompt
32
+
3
33
  ## 1.3.1
4
34
 
5
35
  ### Patch Changes
@@ -93,11 +93,117 @@ interface ClackEvents<TValue> {
93
93
  beforePrompt: () => void;
94
94
  }
95
95
 
96
+ /** The Standard Schema interface. */
97
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
98
+ /** The Standard Schema properties. */
99
+ readonly '~standard': StandardSchemaV1.Props<Input, Output>;
100
+ }
101
+ declare namespace StandardSchemaV1 {
102
+ /** The Standard Schema properties interface. */
103
+ interface Props<Input = unknown, Output = Input> {
104
+ /** The version number of the standard. */
105
+ readonly version: 1;
106
+ /** The vendor name of the schema library. */
107
+ readonly vendor: string;
108
+ /** Validates unknown input values. */
109
+ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
110
+ /** Inferred types associated with the schema. */
111
+ readonly types?: Types<Input, Output> | undefined;
112
+ }
113
+ /** The result interface of the validate function. */
114
+ type Result<Output> = SuccessResult<Output> | FailureResult;
115
+ /** The result interface if validation succeeds. */
116
+ interface SuccessResult<Output> {
117
+ /** The typed output value. */
118
+ readonly value: Output;
119
+ /** A falsy value for `issues` indicates success. */
120
+ readonly issues?: undefined;
121
+ }
122
+ interface Options {
123
+ /** Explicit support for additional vendor-specific parameters, if needed. */
124
+ readonly libraryOptions?: Record<string, unknown> | undefined;
125
+ }
126
+ /** The result interface if validation fails. */
127
+ interface FailureResult {
128
+ /** The issues of failed validation. */
129
+ readonly issues: ReadonlyArray<Issue>;
130
+ }
131
+ /** The issue interface of the failure output. */
132
+ interface Issue {
133
+ /** The error message of the issue. */
134
+ readonly message: string;
135
+ /** The path of the issue, if any. */
136
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
137
+ }
138
+ /** The path segment interface of the issue. */
139
+ interface PathSegment {
140
+ /** The key representing a path segment. */
141
+ readonly key: PropertyKey;
142
+ }
143
+ /** The Standard Schema types interface. */
144
+ interface Types<Input = unknown, Output = Input> {
145
+ /** The input type of the schema. */
146
+ readonly input: Input;
147
+ /** The output type of the schema. */
148
+ readonly output: Output;
149
+ }
150
+ /** Infers the input type of a Standard Schema. */
151
+ type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['input'];
152
+ /** Infers the output type of a Standard Schema. */
153
+ type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['output'];
154
+ }
155
+
156
+ /**
157
+ * A function or [Standard Schema](https://github.com/standard-schema/standard-schema)
158
+ * that validates user input. If a custom function is given, you should return a
159
+ * `string` or `Error` to show as a validation error, or `undefined` to accept the result.
160
+ *
161
+ * @example Using arktype
162
+ * ```ts
163
+ * import { text } from '@clack/prompts';
164
+ * import { type } from 'arktype';
165
+ *
166
+ * const name = await text({
167
+ * message: 'Enter your name (letters only)',
168
+ * validate: type('string.alpha').describe('Name can only contain letters'),
169
+ * });
170
+ * ```
171
+ *
172
+ * @example Custom validator
173
+ * ```ts
174
+ * import { text } from '@clack/prompts';
175
+ *
176
+ * const age = await text({
177
+ * message: 'Enter your age:',
178
+ * validate(value) {
179
+ * if (!value) return 'Please enter a value';
180
+ * const num = parseInt(value);
181
+ * if (isNaN(num)) return 'Please enter a valid number';
182
+ * if (num < 0 || num > 120) return 'Age must be between 0 and 120';
183
+ * return undefined;
184
+ * },
185
+ * });
186
+ * ```
187
+ */
188
+ type Validate<TValue> = ((value: TValue | undefined) => string | Error | undefined) | StandardSchemaV1<TValue | undefined, unknown>;
189
+ /**
190
+ * Runs the `validate()` option and normalizes the result
191
+ * @param validate - The validate option
192
+ * @param value - The user input
193
+ * @returns the validation result
194
+ */
195
+ declare function runValidation<TValue>(validate: Validate<TValue>, value: TValue | undefined): string | Error | undefined;
196
+
96
197
  interface PromptOptions<TValue, Self extends Prompt<TValue>> {
97
198
  render(this: Omit<Self, 'prompt'>): string | undefined;
98
199
  initialValue?: any;
99
200
  initialUserInput?: string;
100
- validate?: ((value: TValue | undefined) => string | Error | undefined) | undefined;
201
+ /**
202
+ * A function or a [Standard Schema](https://github.com/standard-schema/standard-schema)
203
+ * that validates user input. If a custom function is given, you should return a `string` or `Error`
204
+ * to show as a validation error, or `undefined` to accept the result.
205
+ */
206
+ validate?: Validate<TValue> | undefined;
101
207
  input?: Readable;
102
208
  output?: Writable;
103
209
  signal?: AbortSignal;
@@ -359,5 +465,5 @@ declare const getColumns: (output: Writable) => number;
359
465
  declare const getRows: (output: Writable) => number;
360
466
  declare function wrapTextWithPrefix(output: Writable | undefined, text: string, prefix: string, startPrefix?: string, endPrefix?: string, lineFormatter?: (line: string, index: number) => string): string;
361
467
 
362
- export { AutocompletePrompt, ConfirmPrompt, DatePrompt, GroupMultiSelectPrompt, MultiLinePrompt, MultiSelectPrompt, PasswordPrompt, Prompt, SelectKeyPrompt, SelectPrompt, TextPrompt, block, getColumns, getRows, isCancel, settings, updateSettings, wrapTextWithPrefix };
363
- export type { AutocompleteOptions, ClackSettings, ConfirmOptions, DateFormat, DateOptions, DateParts, GroupMultiSelectOptions, MultiLineOptions, MultiSelectOptions, PasswordOptions, PromptOptions, SelectKeyOptions, SelectOptions, ClackState as State, TextOptions };
468
+ export { AutocompletePrompt, ConfirmPrompt, DatePrompt, GroupMultiSelectPrompt, MultiLinePrompt, MultiSelectPrompt, PasswordPrompt, Prompt, SelectKeyPrompt, SelectPrompt, TextPrompt, block, getColumns, getRows, isCancel, runValidation, settings, updateSettings, wrapTextWithPrefix };
469
+ export type { AutocompleteOptions, ClackSettings, ConfirmOptions, DateFormat, DateOptions, DateParts, GroupMultiSelectOptions, MultiLineOptions, MultiSelectOptions, PasswordOptions, PromptOptions, SelectKeyOptions, SelectOptions, ClackState as State, TextOptions, Validate };