@maizzle/framework 6.0.0-rc.9 → 6.0.1
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.
- package/README.md +3 -3
- package/bin/maizzle.mjs +1 -1
- package/dist/build.d.ts +38 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +234 -0
- package/dist/build.js.map +1 -0
- package/dist/components/Body.vue +32 -3
- package/dist/components/Button.vue +91 -62
- package/dist/components/CodeBlock.vue +6 -4
- package/dist/components/CodeInline.vue +77 -6
- package/dist/components/Column.vue +67 -31
- package/dist/components/Container.vue +73 -12
- package/dist/components/Font.vue +96 -0
- package/dist/components/Head.vue +1 -1
- package/dist/components/Heading.vue +1 -1
- package/dist/components/Hr.vue +33 -0
- package/dist/components/Html.vue +36 -3
- package/dist/components/Img.vue +332 -0
- package/dist/components/Layout.vue +73 -21
- package/dist/components/Link.vue +1 -1
- package/dist/components/Markdown.vue +51 -24
- package/dist/components/MarkdownLayout.vue +39 -0
- package/dist/components/NotPlaintext.vue +14 -0
- package/dist/components/Outlook.vue +38 -11
- package/dist/components/OutlookBg.vue +241 -0
- package/dist/components/Plaintext.vue +14 -0
- package/dist/components/Preheader.vue +35 -10
- package/dist/components/QrCode.vue +157 -0
- package/dist/components/Raw.vue +28 -0
- package/dist/components/Row.vue +115 -22
- package/dist/components/Section.vue +65 -26
- package/dist/components/Spacer.vue +35 -29
- package/dist/components/Tailwind.vue +45 -0
- package/dist/components/Text.vue +3 -3
- package/dist/components/Vml.vue +207 -94
- package/dist/components/utils.d.ts +53 -0
- package/dist/components/utils.d.ts.map +1 -0
- package/dist/components/utils.js +80 -0
- package/dist/components/utils.js.map +1 -0
- package/dist/components/utils.ts +102 -0
- package/dist/composables/defineConfig.d.ts +13 -0
- package/dist/composables/defineConfig.d.ts.map +1 -0
- package/dist/composables/{defineConfig.mjs → defineConfig.js} +7 -9
- package/dist/composables/defineConfig.js.map +1 -0
- package/dist/composables/renderContext.d.ts +37 -0
- package/dist/composables/renderContext.d.ts.map +1 -0
- package/dist/composables/renderContext.js +6 -0
- package/dist/composables/renderContext.js.map +1 -0
- package/dist/composables/useBaseUrl.d.ts +19 -0
- package/dist/composables/useBaseUrl.d.ts.map +1 -0
- package/dist/composables/useBaseUrl.js +26 -0
- package/dist/composables/useBaseUrl.js.map +1 -0
- package/dist/composables/useConfig.d.ts +16 -0
- package/dist/composables/useConfig.d.ts.map +1 -0
- package/dist/composables/useConfig.js +19 -0
- package/dist/composables/useConfig.js.map +1 -0
- package/dist/composables/useCurrentTemplate.d.ts +31 -0
- package/dist/composables/useCurrentTemplate.d.ts.map +1 -0
- package/dist/composables/useCurrentTemplate.js +42 -0
- package/dist/composables/useCurrentTemplate.js.map +1 -0
- package/dist/composables/{useDoctype.d.mts → useDoctype.d.ts} +1 -1
- package/dist/composables/useDoctype.d.ts.map +1 -0
- package/dist/composables/{useDoctype.mjs → useDoctype.js} +3 -4
- package/dist/composables/useDoctype.js.map +1 -0
- package/dist/composables/{useEvent.d.mts → useEvent.d.ts} +3 -3
- package/dist/composables/useEvent.d.ts.map +1 -0
- package/dist/composables/{useEvent.mjs → useEvent.js} +4 -5
- package/dist/composables/useEvent.js.map +1 -0
- package/dist/composables/useFont.d.ts +50 -0
- package/dist/composables/useFont.d.ts.map +1 -0
- package/dist/composables/useFont.js +92 -0
- package/dist/composables/useFont.js.map +1 -0
- package/dist/composables/useOutlookFallback.d.ts +21 -0
- package/dist/composables/useOutlookFallback.d.ts.map +1 -0
- package/dist/composables/useOutlookFallback.js +29 -0
- package/dist/composables/useOutlookFallback.js.map +1 -0
- package/dist/composables/useOutputPath.d.ts +17 -0
- package/dist/composables/useOutputPath.d.ts.map +1 -0
- package/dist/composables/useOutputPath.js +23 -0
- package/dist/composables/useOutputPath.js.map +1 -0
- package/dist/composables/{usePlaintext.d.mts → usePlaintext.d.ts} +3 -1
- package/dist/composables/usePlaintext.d.ts.map +1 -0
- package/dist/composables/{usePlaintext.mjs → usePlaintext.js} +4 -4
- package/dist/composables/usePlaintext.js.map +1 -0
- package/dist/composables/usePreheader.d.ts +25 -0
- package/dist/composables/usePreheader.d.ts.map +1 -0
- package/dist/composables/usePreheader.js +28 -0
- package/dist/composables/usePreheader.js.map +1 -0
- package/dist/composables/useTransformers.d.ts +34 -0
- package/dist/composables/useTransformers.d.ts.map +1 -0
- package/dist/composables/useTransformers.js +48 -0
- package/dist/composables/useTransformers.js.map +1 -0
- package/dist/composables/useUrlQuery.d.ts +19 -0
- package/dist/composables/useUrlQuery.d.ts.map +1 -0
- package/dist/composables/useUrlQuery.js +26 -0
- package/dist/composables/useUrlQuery.js.map +1 -0
- package/dist/config/{defaults.d.mts → defaults.d.ts} +2 -2
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/{defaults.mjs → defaults.js} +10 -6
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/index.d.ts +33 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +136 -0
- package/dist/config/index.js.map +1 -0
- package/dist/events/{index.d.mts → index.d.ts} +35 -12
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/{index.mjs → index.js} +31 -13
- package/dist/events/index.js.map +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +40 -0
- package/dist/{plaintext.d.mts → plaintext.d.ts} +1 -1
- package/dist/plaintext.d.ts.map +1 -0
- package/dist/{plaintext.mjs → plaintext.js} +4 -5
- package/dist/plaintext.js.map +1 -0
- package/dist/{plugin.d.mts → plugin.d.ts} +2 -2
- package/dist/plugin.d.ts.map +1 -0
- package/dist/{plugin.mjs → plugin.js} +8 -9
- package/dist/plugin.js.map +1 -0
- package/dist/plugins/postcss/{mergeMediaQueries.d.mts → mergeMediaQueries.d.ts} +2 -2
- package/dist/plugins/postcss/mergeMediaQueries.d.ts.map +1 -0
- package/dist/plugins/postcss/{mergeMediaQueries.mjs → mergeMediaQueries.js} +2 -3
- package/dist/plugins/postcss/mergeMediaQueries.js.map +1 -0
- package/dist/plugins/postcss/{pruneVars.d.mts → pruneVars.d.ts} +1 -1
- package/dist/plugins/postcss/pruneVars.d.ts.map +1 -0
- package/dist/plugins/postcss/{pruneVars.mjs → pruneVars.js} +2 -2
- package/dist/plugins/postcss/pruneVars.js.map +1 -0
- package/dist/plugins/postcss/quoteFontFamilies.d.ts +13 -0
- package/dist/plugins/postcss/quoteFontFamilies.d.ts.map +1 -0
- package/dist/plugins/postcss/quoteFontFamilies.js +84 -0
- package/dist/plugins/postcss/quoteFontFamilies.js.map +1 -0
- package/dist/plugins/postcss/{removeDeclarations.d.mts → removeDeclarations.d.ts} +1 -1
- package/dist/plugins/postcss/removeDeclarations.d.ts.map +1 -0
- package/dist/plugins/postcss/{removeDeclarations.mjs → removeDeclarations.js} +2 -2
- package/dist/plugins/postcss/removeDeclarations.js.map +1 -0
- package/dist/plugins/postcss/resolveMaizzleImports.d.ts +16 -0
- package/dist/plugins/postcss/resolveMaizzleImports.d.ts.map +1 -0
- package/dist/plugins/postcss/resolveMaizzleImports.js +39 -0
- package/dist/plugins/postcss/resolveMaizzleImports.js.map +1 -0
- package/dist/plugins/postcss/resolveProps.d.ts +8 -0
- package/dist/plugins/postcss/resolveProps.d.ts.map +1 -0
- package/dist/plugins/postcss/resolveProps.js +155 -0
- package/dist/plugins/postcss/resolveProps.js.map +1 -0
- package/dist/plugins/postcss/{tailwindCleanup.d.mts → tailwindCleanup.d.ts} +2 -2
- package/dist/plugins/postcss/tailwindCleanup.d.ts.map +1 -0
- package/dist/plugins/postcss/{tailwindCleanup.mjs → tailwindCleanup.js} +5 -3
- package/dist/plugins/postcss/tailwindCleanup.js.map +1 -0
- package/dist/prepare.d.ts +17 -0
- package/dist/prepare.d.ts.map +1 -0
- package/dist/prepare.js +44 -0
- package/dist/prepare.js.map +1 -0
- package/dist/render/active.d.ts +8 -0
- package/dist/render/active.d.ts.map +1 -0
- package/dist/render/active.js +12 -0
- package/dist/render/active.js.map +1 -0
- package/dist/render/buildTemplate.d.ts +49 -0
- package/dist/render/buildTemplate.d.ts.map +1 -0
- package/dist/render/buildTemplate.js +141 -0
- package/dist/render/buildTemplate.js.map +1 -0
- package/dist/render/{createRenderer.d.mts → createRenderer.d.ts} +14 -6
- package/dist/render/createRenderer.d.ts.map +1 -0
- package/dist/render/createRenderer.js +468 -0
- package/dist/render/createRenderer.js.map +1 -0
- package/dist/render/index.d.ts +18 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +59 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/injectFonts.d.ts +15 -0
- package/dist/render/injectFonts.d.ts.map +1 -0
- package/dist/render/injectFonts.js +45 -0
- package/dist/render/injectFonts.js.map +1 -0
- package/dist/render/parallel/buildWorker.d.ts +31 -0
- package/dist/render/parallel/buildWorker.d.ts.map +1 -0
- package/dist/render/parallel/buildWorker.js +66 -0
- package/dist/render/parallel/buildWorker.js.map +1 -0
- package/dist/render/parallel/worker.mjs +28 -0
- package/dist/render/plugins/codeBlockExtract.d.ts +14 -0
- package/dist/render/plugins/codeBlockExtract.d.ts.map +1 -0
- package/dist/render/plugins/codeBlockExtract.js +38 -0
- package/dist/render/plugins/codeBlockExtract.js.map +1 -0
- package/dist/render/plugins/markdownExtract.d.ts +12 -0
- package/dist/render/plugins/markdownExtract.d.ts.map +1 -0
- package/dist/render/plugins/markdownExtract.js +49 -0
- package/dist/render/plugins/markdownExtract.js.map +1 -0
- package/dist/render/plugins/rawExtract.d.ts +14 -0
- package/dist/render/plugins/rawExtract.d.ts.map +1 -0
- package/dist/render/plugins/rawExtract.js +34 -0
- package/dist/render/plugins/rawExtract.js.map +1 -0
- package/dist/render/plugins/rowSourceLocation.d.ts +18 -0
- package/dist/render/plugins/rowSourceLocation.d.ts.map +1 -0
- package/dist/render/plugins/rowSourceLocation.js +45 -0
- package/dist/render/plugins/rowSourceLocation.js.map +1 -0
- package/dist/{serve.d.mts → serve.d.ts} +5 -3
- package/dist/serve.d.ts.map +1 -0
- package/dist/{serve.mjs → serve.js} +248 -119
- package/dist/serve.js.map +1 -0
- package/dist/server/compatibility.d.ts +59 -0
- package/dist/server/compatibility.d.ts.map +1 -0
- package/dist/server/compatibility.js +959 -0
- package/dist/server/compatibility.js.map +1 -0
- package/dist/server/{email.d.mts → email.d.ts} +2 -2
- package/dist/server/email.d.ts.map +1 -0
- package/dist/server/{email.mjs → email.js} +2 -3
- package/dist/server/email.js.map +1 -0
- package/dist/server/linter.d.ts +20 -0
- package/dist/server/linter.d.ts.map +1 -0
- package/dist/server/linter.js +345 -0
- package/dist/server/linter.js.map +1 -0
- package/dist/server/sfc-utils.d.ts +21 -0
- package/dist/server/sfc-utils.d.ts.map +1 -0
- package/dist/server/sfc-utils.js +198 -0
- package/dist/server/sfc-utils.js.map +1 -0
- package/dist/server/ui/.vite/deps/@lucide_vue.js +44967 -0
- package/dist/server/ui/.vite/deps/@lucide_vue.js.map +1 -0
- package/dist/server/ui/.vite/deps/@vueuse_core.js +8155 -0
- package/dist/server/ui/.vite/deps/@vueuse_core.js.map +1 -0
- package/dist/server/ui/.vite/deps/@vueuse_shared.js +1859 -0
- package/dist/server/ui/.vite/deps/@vueuse_shared.js.map +1 -0
- package/dist/server/ui/.vite/deps/_metadata.json +78 -0
- package/dist/server/ui/.vite/deps/chunk-EAsCxrDo.js +14 -0
- package/dist/server/ui/.vite/deps/class-variance-authority.js +57 -0
- package/dist/server/ui/.vite/deps/class-variance-authority.js.map +1 -0
- package/dist/server/ui/.vite/deps/clsx.js +18 -0
- package/dist/server/ui/.vite/deps/clsx.js.map +1 -0
- package/dist/server/ui/.vite/deps/culori.js +4312 -0
- package/dist/server/ui/.vite/deps/culori.js.map +1 -0
- package/dist/server/ui/.vite/deps/package.json +3 -0
- package/dist/server/ui/.vite/deps/reka-ui.js +44464 -0
- package/dist/server/ui/.vite/deps/reka-ui.js.map +1 -0
- package/dist/server/ui/.vite/deps/tailwind-merge.js +3458 -0
- package/dist/server/ui/.vite/deps/tailwind-merge.js.map +1 -0
- package/dist/server/ui/.vite/deps/vue-router.js +6383 -0
- package/dist/server/ui/.vite/deps/vue-router.js.map +1 -0
- package/dist/server/ui/.vite/deps/vue.js +2 -0
- package/dist/server/ui/.vite/deps/vue.runtime.esm-bundler-N1X0OxKs.js +8800 -0
- package/dist/server/ui/.vite/deps/vue.runtime.esm-bundler-N1X0OxKs.js.map +1 -0
- package/dist/server/ui/App.vue +106 -66
- package/dist/server/ui/components/SidebarClose.vue +12 -0
- package/dist/server/ui/components/ui/checkbox/Checkbox.vue +1 -1
- package/dist/server/ui/components/ui/command/Command.vue +5 -1
- package/dist/server/ui/components/ui/command/CommandInput.vue +2 -2
- package/dist/server/ui/components/ui/dialog/DialogContent.vue +1 -1
- package/dist/server/ui/components/ui/dialog/DialogScrollContent.vue +1 -1
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
- package/dist/server/ui/components/ui/input/Input.vue +1 -1
- package/dist/server/ui/components/ui/sheet/SheetContent.vue +1 -1
- package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +2 -2
- package/dist/server/ui/components/ui/tags-input/TagsInputInput.vue +1 -1
- package/dist/server/ui/components/ui/tags-input/TagsInputItemDelete.vue +1 -1
- package/dist/server/ui/lib/emulated-dark-mode.ts +146 -0
- package/dist/server/ui/main.css +25 -0
- package/dist/server/ui/pages/Home.vue +1 -1
- package/dist/server/ui/pages/Preview.vue +377 -186
- package/dist/server/ui/vite-env.d.ts +1 -0
- package/dist/tests/render/_helpers.d.ts +6 -0
- package/dist/tests/render/_helpers.d.ts.map +1 -0
- package/dist/tests/render/_helpers.js +16 -0
- package/dist/tests/render/_helpers.js.map +1 -0
- package/dist/transformers/addAttributes.d.ts +42 -0
- package/dist/transformers/addAttributes.d.ts.map +1 -0
- package/dist/transformers/{addAttributes.mjs → addAttributes.js} +40 -24
- package/dist/transformers/addAttributes.js.map +1 -0
- package/dist/transformers/attributeToStyle.d.ts +38 -0
- package/dist/transformers/attributeToStyle.d.ts.map +1 -0
- package/dist/transformers/attributeToStyle.js +94 -0
- package/dist/transformers/attributeToStyle.js.map +1 -0
- package/dist/transformers/base.d.ts +71 -0
- package/dist/transformers/base.d.ts.map +1 -0
- package/dist/transformers/{base.mjs → base.js} +65 -40
- package/dist/transformers/base.js.map +1 -0
- package/dist/transformers/columnWidth.d.ts +31 -0
- package/dist/transformers/columnWidth.d.ts.map +1 -0
- package/dist/transformers/columnWidth.js +527 -0
- package/dist/transformers/columnWidth.js.map +1 -0
- package/dist/transformers/entities.d.ts +37 -0
- package/dist/transformers/entities.d.ts.map +1 -0
- package/dist/transformers/entities.js +74 -0
- package/dist/transformers/entities.js.map +1 -0
- package/dist/transformers/filters/{defaults.d.mts → defaults.d.ts} +1 -1
- package/dist/transformers/filters/defaults.d.ts.map +1 -0
- package/dist/transformers/filters/{defaults.mjs → defaults.js} +2 -2
- package/dist/transformers/filters/defaults.js.map +1 -0
- package/dist/transformers/filters/index.d.ts +43 -0
- package/dist/transformers/filters/index.d.ts.map +1 -0
- package/dist/transformers/filters/index.js +89 -0
- package/dist/transformers/filters/index.js.map +1 -0
- package/dist/transformers/format.d.ts +22 -0
- package/dist/transformers/format.d.ts.map +1 -0
- package/dist/transformers/format.js +30 -0
- package/dist/transformers/format.js.map +1 -0
- package/dist/transformers/imgWidth.d.ts +20 -0
- package/dist/transformers/imgWidth.d.ts.map +1 -0
- package/dist/transformers/imgWidth.js +76 -0
- package/dist/transformers/imgWidth.js.map +1 -0
- package/dist/transformers/{index.d.mts → index.d.ts} +4 -3
- package/dist/transformers/index.d.ts.map +1 -0
- package/dist/transformers/index.js +163 -0
- package/dist/transformers/index.js.map +1 -0
- package/dist/transformers/inlineCss.d.ts +85 -0
- package/dist/transformers/inlineCss.d.ts.map +1 -0
- package/dist/transformers/inlineCss.js +112 -0
- package/dist/transformers/inlineCss.js.map +1 -0
- package/dist/transformers/inlineLink.d.ts +35 -0
- package/dist/transformers/inlineLink.d.ts.map +1 -0
- package/dist/transformers/{inlineLink.mjs → inlineLink.js} +35 -11
- package/dist/transformers/inlineLink.js.map +1 -0
- package/dist/transformers/minify.d.ts +21 -0
- package/dist/transformers/minify.d.ts.map +1 -0
- package/dist/transformers/minify.js +25 -0
- package/dist/transformers/minify.js.map +1 -0
- package/dist/transformers/minifyCodeInline.d.ts +29 -0
- package/dist/transformers/minifyCodeInline.d.ts.map +1 -0
- package/dist/transformers/minifyCodeInline.js +36 -0
- package/dist/transformers/minifyCodeInline.js.map +1 -0
- package/dist/transformers/msoPlaceholders.d.ts +33 -0
- package/dist/transformers/msoPlaceholders.d.ts.map +1 -0
- package/dist/transformers/msoPlaceholders.js +114 -0
- package/dist/transformers/msoPlaceholders.js.map +1 -0
- package/dist/transformers/purgeCss.d.ts +43 -0
- package/dist/transformers/purgeCss.d.ts.map +1 -0
- package/dist/transformers/purgeCss.js +207 -0
- package/dist/transformers/purgeCss.js.map +1 -0
- package/dist/transformers/removeAttributes.d.ts +54 -0
- package/dist/transformers/removeAttributes.d.ts.map +1 -0
- package/dist/transformers/removeAttributes.js +72 -0
- package/dist/transformers/removeAttributes.js.map +1 -0
- package/dist/transformers/{replaceStrings.d.mts → replaceStrings.d.ts} +2 -2
- package/dist/transformers/replaceStrings.d.ts.map +1 -0
- package/dist/transformers/{replaceStrings.mjs → replaceStrings.js} +2 -2
- package/dist/transformers/replaceStrings.js.map +1 -0
- package/dist/transformers/safeSelectors.d.ts +37 -0
- package/dist/transformers/safeSelectors.d.ts.map +1 -0
- package/dist/transformers/{safeClassNames.mjs → safeSelectors.js} +40 -10
- package/dist/transformers/safeSelectors.js.map +1 -0
- package/dist/transformers/shorthandCss.d.ts +47 -0
- package/dist/transformers/shorthandCss.d.ts.map +1 -0
- package/dist/transformers/shorthandCss.js +92 -0
- package/dist/transformers/shorthandCss.js.map +1 -0
- package/dist/transformers/sixHex.d.ts +25 -0
- package/dist/transformers/sixHex.d.ts.map +1 -0
- package/dist/transformers/sixHex.js +42 -0
- package/dist/transformers/sixHex.js.map +1 -0
- package/dist/transformers/tailwindComponent.d.ts +16 -0
- package/dist/transformers/tailwindComponent.d.ts.map +1 -0
- package/dist/transformers/tailwindComponent.js +101 -0
- package/dist/transformers/tailwindComponent.js.map +1 -0
- package/dist/transformers/{tailwindcss.d.mts → tailwindcss.d.ts} +2 -2
- package/dist/transformers/tailwindcss.d.ts.map +1 -0
- package/dist/transformers/{tailwindcss.mjs → tailwindcss.js} +33 -74
- package/dist/transformers/tailwindcss.js.map +1 -0
- package/dist/transformers/urlQuery.d.ts +36 -0
- package/dist/transformers/urlQuery.d.ts.map +1 -0
- package/dist/transformers/urlQuery.js +77 -0
- package/dist/transformers/urlQuery.js.map +1 -0
- package/dist/types/{config.d.mts → config.d.ts} +231 -46
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/ast/index.d.ts +4 -0
- package/dist/utils/ast/index.js +4 -0
- package/dist/utils/ast/{parser.d.mts → parser.d.ts} +1 -1
- package/dist/utils/ast/parser.d.ts.map +1 -0
- package/dist/utils/ast/{parser.mjs → parser.js} +2 -3
- package/dist/utils/ast/parser.js.map +1 -0
- package/dist/utils/ast/{serializer.d.mts → serializer.d.ts} +1 -1
- package/dist/utils/ast/serializer.d.ts.map +1 -0
- package/dist/utils/ast/serializer.js +46 -0
- package/dist/utils/ast/serializer.js.map +1 -0
- package/dist/utils/ast/{walker.d.mts → walker.d.ts} +1 -1
- package/dist/utils/ast/walker.d.ts.map +1 -0
- package/dist/utils/ast/{walker.mjs → walker.js} +2 -2
- package/dist/utils/ast/walker.js.map +1 -0
- package/dist/utils/cloneConfig.d.ts +13 -0
- package/dist/utils/cloneConfig.d.ts.map +1 -0
- package/dist/utils/cloneConfig.js +21 -0
- package/dist/utils/cloneConfig.js.map +1 -0
- package/dist/utils/compileTailwindCss.d.ts +16 -0
- package/dist/utils/compileTailwindCss.d.ts.map +1 -0
- package/dist/utils/compileTailwindCss.js +55 -0
- package/dist/utils/compileTailwindCss.js.map +1 -0
- package/dist/utils/componentSources.d.ts +50 -0
- package/dist/utils/componentSources.d.ts.map +1 -0
- package/dist/utils/componentSources.js +50 -0
- package/dist/utils/componentSources.js.map +1 -0
- package/dist/utils/cssBox.d.ts +42 -0
- package/dist/utils/cssBox.d.ts.map +1 -0
- package/dist/utils/cssBox.js +151 -0
- package/dist/utils/cssBox.js.map +1 -0
- package/dist/utils/decodeStyleEntities.d.ts +15 -0
- package/dist/utils/decodeStyleEntities.d.ts.map +1 -0
- package/dist/utils/decodeStyleEntities.js +18 -0
- package/dist/utils/decodeStyleEntities.js.map +1 -0
- package/dist/utils/{detect.d.mts → detect.d.ts} +1 -1
- package/dist/utils/detect.d.ts.map +1 -0
- package/dist/utils/{detect.mjs → detect.js} +2 -3
- package/dist/utils/detect.js.map +1 -0
- package/dist/utils/output-markers.d.ts +29 -0
- package/dist/utils/output-markers.d.ts.map +1 -0
- package/dist/utils/output-markers.js +68 -0
- package/dist/utils/output-markers.js.map +1 -0
- package/dist/utils/{url.d.mts → url.d.ts} +1 -1
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/{url.mjs → url.js} +2 -3
- package/dist/utils/url.js.map +1 -0
- package/dist/utils/watchPaths.d.ts +11 -0
- package/dist/utils/watchPaths.d.ts.map +1 -0
- package/dist/utils/watchPaths.js +19 -0
- package/dist/utils/watchPaths.js.map +1 -0
- package/node_modules/@clack/core/CHANGELOG.md +44 -0
- package/node_modules/@clack/core/dist/index.d.mts +125 -5
- package/node_modules/@clack/core/dist/index.mjs +972 -11
- package/node_modules/@clack/core/package.json +6 -2
- package/node_modules/@clack/prompts/CHANGELOG.md +70 -0
- package/node_modules/@clack/prompts/README.md +129 -3
- package/node_modules/@clack/prompts/dist/index.d.mts +567 -33
- package/node_modules/@clack/prompts/dist/index.mjs +1378 -133
- package/node_modules/@clack/prompts/package.json +7 -4
- package/node_modules/fast-string-truncated-width/dist/index.js +36 -96
- package/node_modules/fast-string-truncated-width/dist/types.d.ts +0 -3
- package/node_modules/fast-string-truncated-width/dist/utils.d.ts +3 -3
- package/node_modules/fast-string-truncated-width/dist/utils.js +14 -9
- package/node_modules/fast-string-truncated-width/package.json +1 -1
- package/node_modules/fast-string-truncated-width/readme.md +2 -3
- package/node_modules/fast-string-width/package.json +2 -2
- package/node_modules/fast-string-width/readme.md +0 -3
- package/node_modules/fast-wrap-ansi/lib/main.js +4 -2
- package/node_modules/fast-wrap-ansi/package.json +11 -11
- package/node_modules/maizzle/README.md +24 -0
- package/node_modules/maizzle/dist/commands/make/component.mjs +1 -1
- package/node_modules/maizzle/dist/commands/make/config.mjs +8 -7
- package/node_modules/maizzle/dist/commands/make/layout.mjs +3 -3
- package/node_modules/maizzle/dist/commands/make/scaffold.mjs +1 -1
- package/node_modules/maizzle/dist/commands/make/stubs/Layout.vue +146 -0
- package/node_modules/maizzle/dist/commands/make/stubs/component.vue +2 -4
- package/node_modules/maizzle/dist/commands/make/stubs/config.ts +1 -5
- package/node_modules/maizzle/dist/commands/make/template.mjs +1 -1
- package/node_modules/maizzle/dist/commands/new.mjs +46 -135
- package/node_modules/maizzle/dist/index.d.mts +1 -0
- package/node_modules/maizzle/dist/index.mjs +30 -7
- package/node_modules/maizzle/package.json +5 -4
- package/node_modules/nypm/dist/cli.mjs +28 -5
- package/node_modules/nypm/dist/index.d.mts +0 -8
- package/node_modules/nypm/dist/index.mjs +27 -4
- package/node_modules/nypm/package.json +12 -12
- package/node_modules/tinyexec/README.md +9 -1
- package/node_modules/tinyexec/dist/main.d.mts +22 -7
- package/node_modules/tinyexec/dist/main.mjs +189 -491
- package/node_modules/tinyexec/package.json +14 -16
- package/package.json +38 -31
- package/dist/_virtual/_rolldown/runtime.mjs +0 -32
- package/dist/build.d.mts +0 -19
- package/dist/build.d.mts.map +0 -1
- package/dist/build.mjs +0 -141
- package/dist/build.mjs.map +0 -1
- package/dist/components/Divider.vue +0 -133
- package/dist/components/Image.vue +0 -70
- package/dist/components/Overlap.vue +0 -80
- package/dist/components/utils.d.mts +0 -5
- package/dist/components/utils.d.mts.map +0 -1
- package/dist/components/utils.mjs +0 -9
- package/dist/components/utils.mjs.map +0 -1
- package/dist/composables/defineConfig.d.mts +0 -14
- package/dist/composables/defineConfig.d.mts.map +0 -1
- package/dist/composables/defineConfig.mjs.map +0 -1
- package/dist/composables/renderContext.d.mts +0 -24
- package/dist/composables/renderContext.d.mts.map +0 -1
- package/dist/composables/renderContext.mjs +0 -6
- package/dist/composables/renderContext.mjs.map +0 -1
- package/dist/composables/useConfig.d.mts +0 -9
- package/dist/composables/useConfig.d.mts.map +0 -1
- package/dist/composables/useConfig.mjs +0 -13
- package/dist/composables/useConfig.mjs.map +0 -1
- package/dist/composables/useDoctype.d.mts.map +0 -1
- package/dist/composables/useDoctype.mjs.map +0 -1
- package/dist/composables/useEvent.d.mts.map +0 -1
- package/dist/composables/useEvent.mjs.map +0 -1
- package/dist/composables/usePlaintext.d.mts.map +0 -1
- package/dist/composables/usePlaintext.mjs.map +0 -1
- package/dist/composables/usePreviewText.d.mts +0 -24
- package/dist/composables/usePreviewText.d.mts.map +0 -1
- package/dist/composables/usePreviewText.mjs +0 -29
- package/dist/composables/usePreviewText.mjs.map +0 -1
- package/dist/config/defaults.d.mts.map +0 -1
- package/dist/config/defaults.mjs.map +0 -1
- package/dist/config/index.d.mts +0 -15
- package/dist/config/index.d.mts.map +0 -1
- package/dist/config/index.mjs +0 -71
- package/dist/config/index.mjs.map +0 -1
- package/dist/events/index.d.mts.map +0 -1
- package/dist/events/index.mjs.map +0 -1
- package/dist/index.d.mts +0 -31
- package/dist/index.mjs +0 -31
- package/dist/node_modules/picomatch/index.mjs +0 -13
- package/dist/node_modules/picomatch/index.mjs.map +0 -1
- package/dist/node_modules/picomatch/lib/constants.mjs +0 -174
- package/dist/node_modules/picomatch/lib/constants.mjs.map +0 -1
- package/dist/node_modules/picomatch/lib/parse.mjs +0 -1067
- package/dist/node_modules/picomatch/lib/parse.mjs.map +0 -1
- package/dist/node_modules/picomatch/lib/picomatch.mjs +0 -304
- package/dist/node_modules/picomatch/lib/picomatch.mjs.map +0 -1
- package/dist/node_modules/picomatch/lib/scan.mjs +0 -296
- package/dist/node_modules/picomatch/lib/scan.mjs.map +0 -1
- package/dist/node_modules/picomatch/lib/utils.mjs +0 -53
- package/dist/node_modules/picomatch/lib/utils.mjs.map +0 -1
- package/dist/plaintext.d.mts.map +0 -1
- package/dist/plaintext.mjs.map +0 -1
- package/dist/plugin.d.mts.map +0 -1
- package/dist/plugin.mjs.map +0 -1
- package/dist/plugins/postcss/mergeMediaQueries.d.mts.map +0 -1
- package/dist/plugins/postcss/mergeMediaQueries.mjs.map +0 -1
- package/dist/plugins/postcss/pruneVars.d.mts.map +0 -1
- package/dist/plugins/postcss/pruneVars.mjs.map +0 -1
- package/dist/plugins/postcss/removeDeclarations.d.mts.map +0 -1
- package/dist/plugins/postcss/removeDeclarations.mjs.map +0 -1
- package/dist/plugins/postcss/tailwindCleanup.d.mts.map +0 -1
- package/dist/plugins/postcss/tailwindCleanup.mjs.map +0 -1
- package/dist/render/createRenderer.d.mts.map +0 -1
- package/dist/render/createRenderer.mjs +0 -286
- package/dist/render/createRenderer.mjs.map +0 -1
- package/dist/render/index.d.mts +0 -26
- package/dist/render/index.d.mts.map +0 -1
- package/dist/render/index.mjs +0 -46
- package/dist/render/index.mjs.map +0 -1
- package/dist/serve.d.mts.map +0 -1
- package/dist/serve.mjs.map +0 -1
- package/dist/server/compatibility.d.mts +0 -5
- package/dist/server/compatibility.d.mts.map +0 -1
- package/dist/server/compatibility.mjs +0 -97
- package/dist/server/compatibility.mjs.map +0 -1
- package/dist/server/email.d.mts.map +0 -1
- package/dist/server/email.mjs.map +0 -1
- package/dist/server/linter.d.mts +0 -5
- package/dist/server/linter.d.mts.map +0 -1
- package/dist/server/linter.mjs +0 -189
- package/dist/server/linter.mjs.map +0 -1
- package/dist/transformers/addAttributes.d.mts +0 -32
- package/dist/transformers/addAttributes.d.mts.map +0 -1
- package/dist/transformers/addAttributes.mjs.map +0 -1
- package/dist/transformers/attributeToStyle.d.mts +0 -25
- package/dist/transformers/attributeToStyle.d.mts.map +0 -1
- package/dist/transformers/attributeToStyle.mjs +0 -80
- package/dist/transformers/attributeToStyle.mjs.map +0 -1
- package/dist/transformers/base.d.mts +0 -8
- package/dist/transformers/base.d.mts.map +0 -1
- package/dist/transformers/base.mjs.map +0 -1
- package/dist/transformers/entities.d.mts +0 -8
- package/dist/transformers/entities.d.mts.map +0 -1
- package/dist/transformers/entities.mjs +0 -41
- package/dist/transformers/entities.mjs.map +0 -1
- package/dist/transformers/filters/defaults.d.mts.map +0 -1
- package/dist/transformers/filters/defaults.mjs.map +0 -1
- package/dist/transformers/filters/index.d.mts +0 -22
- package/dist/transformers/filters/index.d.mts.map +0 -1
- package/dist/transformers/filters/index.mjs +0 -67
- package/dist/transformers/filters/index.mjs.map +0 -1
- package/dist/transformers/format.d.mts +0 -15
- package/dist/transformers/format.d.mts.map +0 -1
- package/dist/transformers/format.mjs +0 -26
- package/dist/transformers/format.mjs.map +0 -1
- package/dist/transformers/index.d.mts.map +0 -1
- package/dist/transformers/index.mjs +0 -81
- package/dist/transformers/index.mjs.map +0 -1
- package/dist/transformers/inlineCSS.d.mts +0 -17
- package/dist/transformers/inlineCSS.d.mts.map +0 -1
- package/dist/transformers/inlineCSS.mjs +0 -70
- package/dist/transformers/inlineCSS.mjs.map +0 -1
- package/dist/transformers/inlineLink.d.mts +0 -14
- package/dist/transformers/inlineLink.d.mts.map +0 -1
- package/dist/transformers/inlineLink.mjs.map +0 -1
- package/dist/transformers/minify.d.mts +0 -17
- package/dist/transformers/minify.d.mts.map +0 -1
- package/dist/transformers/minify.mjs +0 -24
- package/dist/transformers/minify.mjs.map +0 -1
- package/dist/transformers/purgeCSS.d.mts +0 -23
- package/dist/transformers/purgeCSS.d.mts.map +0 -1
- package/dist/transformers/purgeCSS.mjs +0 -132
- package/dist/transformers/purgeCSS.mjs.map +0 -1
- package/dist/transformers/removeAttributes.d.mts +0 -31
- package/dist/transformers/removeAttributes.d.mts.map +0 -1
- package/dist/transformers/removeAttributes.mjs +0 -63
- package/dist/transformers/removeAttributes.mjs.map +0 -1
- package/dist/transformers/replaceStrings.d.mts.map +0 -1
- package/dist/transformers/replaceStrings.mjs.map +0 -1
- package/dist/transformers/safeClassNames.d.mts +0 -22
- package/dist/transformers/safeClassNames.d.mts.map +0 -1
- package/dist/transformers/safeClassNames.mjs.map +0 -1
- package/dist/transformers/shorthandCSS.d.mts +0 -24
- package/dist/transformers/shorthandCSS.d.mts.map +0 -1
- package/dist/transformers/shorthandCSS.mjs +0 -48
- package/dist/transformers/shorthandCSS.mjs.map +0 -1
- package/dist/transformers/sixHex.d.mts +0 -16
- package/dist/transformers/sixHex.d.mts.map +0 -1
- package/dist/transformers/sixHex.mjs +0 -30
- package/dist/transformers/sixHex.mjs.map +0 -1
- package/dist/transformers/tailwindcss.d.mts.map +0 -1
- package/dist/transformers/tailwindcss.mjs.map +0 -1
- package/dist/transformers/urlQuery.d.mts +0 -24
- package/dist/transformers/urlQuery.d.mts.map +0 -1
- package/dist/transformers/urlQuery.mjs +0 -65
- package/dist/transformers/urlQuery.mjs.map +0 -1
- package/dist/types/config.d.mts.map +0 -1
- package/dist/types/config.mjs +0 -1
- package/dist/types/index.d.mts +0 -2
- package/dist/types/index.mjs +0 -1
- package/dist/utils/ast/index.d.mts +0 -4
- package/dist/utils/ast/index.mjs +0 -5
- package/dist/utils/ast/parser.d.mts.map +0 -1
- package/dist/utils/ast/parser.mjs.map +0 -1
- package/dist/utils/ast/serializer.d.mts.map +0 -1
- package/dist/utils/ast/serializer.mjs +0 -37
- package/dist/utils/ast/serializer.mjs.map +0 -1
- package/dist/utils/ast/walker.d.mts.map +0 -1
- package/dist/utils/ast/walker.mjs.map +0 -1
- package/dist/utils/detect.d.mts.map +0 -1
- package/dist/utils/detect.mjs.map +0 -1
- package/dist/utils/url.d.mts.map +0 -1
- package/dist/utils/url.mjs.map +0 -1
- package/node_modules/@clack/core/dist/index.mjs.map +0 -1
- package/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
- package/node_modules/fast-wrap-ansi/lib/main.js.map +0 -1
- package/node_modules/maizzle/dist/commands/make/stubs/layout.vue +0 -39
- package/node_modules/tinyexec/dist/LICENSES.txt +0 -83
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import render from "dom-serializer";
|
|
2
|
+
//#region src/utils/ast/serializer.ts
|
|
3
|
+
const RAW_TEXT_ELEMENTS = new Set(["script", "style"]);
|
|
4
|
+
/**
|
|
5
|
+
* Re-encode `<` and `>` in text nodes before serialization.
|
|
6
|
+
*
|
|
7
|
+
* The parser decodes entities like `<` into raw `<` in text nodes. With
|
|
8
|
+
* `encodeEntities: false` (needed so other transformers can emit entity
|
|
9
|
+
* strings such as ` ` verbatim), the serializer would write those raw
|
|
10
|
+
* `<` characters as-is, turning escaped text (e.g. a Vue `{{ html }}`
|
|
11
|
+
* interpolation containing `<p>...</p>`) into real DOM downstream.
|
|
12
|
+
*
|
|
13
|
+
* `&` is intentionally not re-encoded: the `entities` transformer writes
|
|
14
|
+
* literal entity strings (` `, `—`) directly into text-node data
|
|
15
|
+
* and relies on the serializer leaving them alone.
|
|
16
|
+
*
|
|
17
|
+
* Skip `<script>` / `<style>` — their children are raw-text containers, and
|
|
18
|
+
* CSS/JS legitimately contains `<` and `>`.
|
|
19
|
+
*/
|
|
20
|
+
function encodeTextNodes(dom, inRawText = false) {
|
|
21
|
+
for (const node of dom) {
|
|
22
|
+
if (node.type === "text") {
|
|
23
|
+
if (!inRawText) {
|
|
24
|
+
const text = node;
|
|
25
|
+
text.data = text.data.replace(/</g, "<").replace(/>/g, ">");
|
|
26
|
+
}
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if ("children" in node && node.children?.length) {
|
|
30
|
+
const el = node;
|
|
31
|
+
const nextRaw = inRawText || RAW_TEXT_ELEMENTS.has(el.name);
|
|
32
|
+
encodeTextNodes(el.children, nextRaw);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function serialize(dom, options) {
|
|
37
|
+
encodeTextNodes(dom);
|
|
38
|
+
return render(dom, {
|
|
39
|
+
encodeEntities: false,
|
|
40
|
+
...options
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { serialize };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=serializer.js.map
|
|
@@ -0,0 +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 `<` into raw `<` in text nodes. With\n * `encodeEntities: false` (needed so other transformers can emit entity\n * strings such as ` ` 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 (` `, `—`) 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, '<')\n .replace(/>/g, '>')\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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walker.d.ts","names":[],"sources":["../../../src/utils/ast/walker.ts"],"mappings":";;;iBAEgB,IAAA,CAAK,GAAA,EAAK,SAAA,IAAa,QAAA,GAAW,IAAA,EAAM,SAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walker.js","names":[],"sources":["../../../src/utils/ast/walker.ts"],"sourcesContent":["import type { ChildNode } from 'domhandler'\n\nexport function walk(ast: ChildNode[], callback: (node: ChildNode) => void): void {\n function traverse(node: ChildNode) {\n callback(node)\n\n if ('children' in node && node.children && node.children.length > 0) {\n for (const child of node.children) {\n traverse(child)\n }\n }\n }\n\n for (const node of ast) {\n traverse(node)\n }\n}\n"],"mappings":";AAEA,SAAgB,KAAK,KAAkB,UAA2C;CAChF,SAAS,SAAS,MAAiB;EACjC,SAAS,IAAI;EAEb,IAAI,cAAc,QAAQ,KAAK,YAAY,KAAK,SAAS,SAAS,GAChE,KAAK,MAAM,SAAS,KAAK,UACvB,SAAS,KAAK;CAGpB;CAEA,KAAK,MAAM,QAAQ,KACjB,SAAS,IAAI;AAEjB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/utils/cloneConfig.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Deep-clone plain objects so per-template config mutations stay isolated.
|
|
4
|
+
*
|
|
5
|
+
* Arrays, functions, and class instances (Date, RegExp, Vite plugins, …) pass
|
|
6
|
+
* through by reference — only nested plain-object props are copied, which is
|
|
7
|
+
* what `beforeRender` mutations (`config.url.base`, `config.css.inline`, …)
|
|
8
|
+
* touch. Sharing arrays by reference matches the parallel worker's merge.
|
|
9
|
+
*/
|
|
10
|
+
declare function cloneConfig<T>(value: T): T;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { cloneConfig };
|
|
13
|
+
//# sourceMappingURL=cloneConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloneConfig.d.ts","names":[],"sources":["../../src/utils/cloneConfig.ts"],"mappings":";;AAQA;;;;;;;iBAAgB,WAAA,IAAe,KAAA,EAAO,CAAA,GAAI,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/utils/cloneConfig.ts
|
|
2
|
+
/**
|
|
3
|
+
* Deep-clone plain objects so per-template config mutations stay isolated.
|
|
4
|
+
*
|
|
5
|
+
* Arrays, functions, and class instances (Date, RegExp, Vite plugins, …) pass
|
|
6
|
+
* through by reference — only nested plain-object props are copied, which is
|
|
7
|
+
* what `beforeRender` mutations (`config.url.base`, `config.css.inline`, …)
|
|
8
|
+
* touch. Sharing arrays by reference matches the parallel worker's merge.
|
|
9
|
+
*/
|
|
10
|
+
function cloneConfig(value) {
|
|
11
|
+
if (value === null || typeof value !== "object") return value;
|
|
12
|
+
if (Array.isArray(value)) return value;
|
|
13
|
+
if (Object.getPrototypeOf(value) !== Object.prototype) return value;
|
|
14
|
+
const out = {};
|
|
15
|
+
for (const key of Object.keys(value)) out[key] = cloneConfig(value[key]);
|
|
16
|
+
return out;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { cloneConfig };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=cloneConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloneConfig.js","names":[],"sources":["../../src/utils/cloneConfig.ts"],"sourcesContent":["/**\n * Deep-clone plain objects so per-template config mutations stay isolated.\n *\n * Arrays, functions, and class instances (Date, RegExp, Vite plugins, …) pass\n * through by reference — only nested plain-object props are copied, which is\n * what `beforeRender` mutations (`config.url.base`, `config.css.inline`, …)\n * touch. Sharing arrays by reference matches the parallel worker's merge.\n */\nexport function cloneConfig<T>(value: T): T {\n if (value === null || typeof value !== 'object') return value\n if (Array.isArray(value)) return value\n if (Object.getPrototypeOf(value) !== Object.prototype) return value\n\n const out: Record<string, unknown> = {}\n for (const key of Object.keys(value as object)) {\n out[key] = cloneConfig((value as Record<string, unknown>)[key])\n }\n\n return out as T\n}\n"],"mappings":";;;;;;;;;AAQA,SAAgB,YAAe,OAAa;CAC1C,IAAI,UAAU,QAAQ,OAAO,UAAU,UAAU,OAAO;CACxD,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO;CACjC,IAAI,OAAO,eAAe,KAAK,MAAM,OAAO,WAAW,OAAO;CAE9D,MAAM,MAA+B,CAAC;CACtC,KAAK,MAAM,OAAO,OAAO,KAAK,KAAe,GAC3C,IAAI,OAAO,YAAa,MAAkC,IAAI;CAGhE,OAAO;AACT"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MaizzleConfig } from "../types/config.js";
|
|
2
|
+
import postcss from "postcss";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/compileTailwindCss.d.ts
|
|
5
|
+
declare function createTailwindProcessor(config: MaizzleConfig): postcss.Processor;
|
|
6
|
+
declare function lowerCssSyntax(css: string): string;
|
|
7
|
+
declare function optimizeTailwindCss(css: string, config: MaizzleConfig): Promise<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Compile a Tailwind CSS source string into final email-safe CSS:
|
|
10
|
+
* runs @tailwindcss/postcss, lowers modern syntax via lightningcss,
|
|
11
|
+
* then applies cleanup + media-query merging.
|
|
12
|
+
*/
|
|
13
|
+
declare function compileTailwindCss(cssInput: string, config: MaizzleConfig, from: string): Promise<string>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { compileTailwindCss, createTailwindProcessor, lowerCssSyntax, optimizeTailwindCss };
|
|
16
|
+
//# sourceMappingURL=compileTailwindCss.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compileTailwindCss.d.ts","names":[],"sources":["../../src/utils/compileTailwindCss.ts"],"mappings":";;;;iBAagB,uBAAA,CAAwB,MAAA,EAAQ,aAAA,GAAa,OAAA,CAAA,SAAA;AAAA,iBAe7C,cAAA,CAAe,GAAW;AAAA,iBAWpB,mBAAA,CAAoB,GAAA,UAAa,MAAA,EAAQ,aAAA,GAAgB,OAAO;;;;;;iBAgBhE,kBAAA,CACpB,QAAA,UACA,MAAA,EAAQ,aAAA,EACR,IAAA,WACC,OAAO"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import resolveProps_default from "../plugins/postcss/resolveProps.js";
|
|
2
|
+
import pruneVars_default from "../plugins/postcss/pruneVars.js";
|
|
3
|
+
import { tailwindCleanup } from "../plugins/postcss/tailwindCleanup.js";
|
|
4
|
+
import { mergeMediaQueries } from "../plugins/postcss/mergeMediaQueries.js";
|
|
5
|
+
import { quoteFontFamilies } from "../plugins/postcss/quoteFontFamilies.js";
|
|
6
|
+
import { resolveMaizzleImports } from "../plugins/postcss/resolveMaizzleImports.js";
|
|
7
|
+
import postcss from "postcss";
|
|
8
|
+
import tailwindcssPostcss from "@tailwindcss/postcss";
|
|
9
|
+
import postcssCalc from "postcss-calc";
|
|
10
|
+
import safeParser from "postcss-safe-parser";
|
|
11
|
+
import { transform } from "lightningcss";
|
|
12
|
+
//#region src/utils/compileTailwindCss.ts
|
|
13
|
+
function createTailwindProcessor(config) {
|
|
14
|
+
return postcss([
|
|
15
|
+
resolveMaizzleImports(),
|
|
16
|
+
tailwindcssPostcss({
|
|
17
|
+
base: config.css?.base,
|
|
18
|
+
transformAssetUrls: false,
|
|
19
|
+
optimize: false
|
|
20
|
+
}),
|
|
21
|
+
resolveProps_default(),
|
|
22
|
+
postcssCalc({}),
|
|
23
|
+
pruneVars_default()
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
function lowerCssSyntax(css) {
|
|
27
|
+
const result = transform({
|
|
28
|
+
filename: "email.css",
|
|
29
|
+
code: new TextEncoder().encode(css),
|
|
30
|
+
minify: false,
|
|
31
|
+
targets: { ie: 128 }
|
|
32
|
+
});
|
|
33
|
+
return new TextDecoder().decode(result.code);
|
|
34
|
+
}
|
|
35
|
+
async function optimizeTailwindCss(css, config) {
|
|
36
|
+
const plugins = [...tailwindCleanup(config), quoteFontFamilies()];
|
|
37
|
+
const mediaPlugin = mergeMediaQueries(config);
|
|
38
|
+
if (mediaPlugin) plugins.push(mediaPlugin);
|
|
39
|
+
return (await postcss(plugins).process(css, { from: void 0 })).css;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Compile a Tailwind CSS source string into final email-safe CSS:
|
|
43
|
+
* runs @tailwindcss/postcss, lowers modern syntax via lightningcss,
|
|
44
|
+
* then applies cleanup + media-query merging.
|
|
45
|
+
*/
|
|
46
|
+
async function compileTailwindCss(cssInput, config, from) {
|
|
47
|
+
return optimizeTailwindCss(lowerCssSyntax((await createTailwindProcessor(config).process(cssInput, {
|
|
48
|
+
from,
|
|
49
|
+
parser: safeParser
|
|
50
|
+
})).css), config);
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { compileTailwindCss, createTailwindProcessor, lowerCssSyntax, optimizeTailwindCss };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=compileTailwindCss.js.map
|
|
@@ -0,0 +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: new TextEncoder().encode(css),\n minify: false,\n targets: { ie: 4 << 5 },\n })\n\n return new TextDecoder().decode(result.code)\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;CAClD,MAAM,SAAS,UAAU;EACvB,UAAU;EACV,MAAM,IAAI,YAAY,CAAC,CAAC,OAAO,GAAG;EAClC,QAAQ;EACR,SAAS,EAAE,IAAI,IAAO;CACxB,CAAC;CAED,OAAO,IAAI,YAAY,CAAC,CAAC,OAAO,OAAO,IAAI;AAC7C;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"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ComponentSource } from "../types/config.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/componentSources.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Internal representation of a component source after defaults are
|
|
6
|
+
* resolved and `path` is made absolute. Always carries the same shape
|
|
7
|
+
* regardless of which user-facing form produced it.
|
|
8
|
+
*/
|
|
9
|
+
interface NormalizedComponentSource {
|
|
10
|
+
/** Absolute directory path. */
|
|
11
|
+
path: string;
|
|
12
|
+
/**
|
|
13
|
+
* Custom prefix prepended to resolved component names.
|
|
14
|
+
* - `undefined` → use folder-name namespace (the `directoryAsNamespace`
|
|
15
|
+
* behavior of unplugin-vue-components).
|
|
16
|
+
* - `''` (empty string) → no prefix at all; use the bare filename.
|
|
17
|
+
* - any other string → exact prefix.
|
|
18
|
+
*/
|
|
19
|
+
prefix?: string;
|
|
20
|
+
/** Include intermediate subfolder names in the resolved name. */
|
|
21
|
+
pathPrefix: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Normalize a user-supplied `components.source` value into an array
|
|
25
|
+
* of absolute, fully-defaulted entries.
|
|
26
|
+
*/
|
|
27
|
+
declare function normalizeComponentSources(sources: ComponentSource | ComponentSource[] | undefined, cwd: string): NormalizedComponentSource[];
|
|
28
|
+
interface ComponentNameOptions {
|
|
29
|
+
/** Absolute path to the component file. */
|
|
30
|
+
filePath: string;
|
|
31
|
+
/** Absolute path to the dir root the component was discovered under. */
|
|
32
|
+
dirRoot: string;
|
|
33
|
+
/** See {@link NormalizedComponentSource.prefix}. */
|
|
34
|
+
prefix?: string;
|
|
35
|
+
/** See {@link NormalizedComponentSource.pathPrefix}. */
|
|
36
|
+
pathPrefix: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Compute the component name unplugin-vue-components would assign for a
|
|
40
|
+
* given file under a given dir, mirroring the plugin's
|
|
41
|
+
* `directoryAsNamespace: true` + `collapseSamePrefixes: true` behavior
|
|
42
|
+
* and layering custom-prefix sources on top.
|
|
43
|
+
*
|
|
44
|
+
* Used both at render time (to register a custom resolver) and at lint
|
|
45
|
+
* time (so the linter can follow component graph correctly).
|
|
46
|
+
*/
|
|
47
|
+
declare function componentNameFromPath(opts: ComponentNameOptions): string;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { ComponentNameOptions, NormalizedComponentSource, componentNameFromPath, normalizeComponentSources };
|
|
50
|
+
//# sourceMappingURL=componentSources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentSources.d.ts","names":[],"sources":["../../src/utils/componentSources.ts"],"mappings":";;;;;AAQA;;;UAAiB,yBAAA;EAEf;EAAA,IAAA;EAUA;;AAAU;AAOZ;;;;EATE,MAAA;EAYC;EAVD,UAAA;AAAA;;;;;iBAOc,yBAAA,CACd,OAAA,EAAS,eAAA,GAAkB,eAAA,gBAC3B,GAAA,WACC,yBAAA;AAAA,UAqBc,oBAAA;EArBW;EAuB1B,QAAA;EAFmC;EAInC,OAAA;EAJmC;EAMnC,MAAA;EAFA;EAIA,UAAA;AAAA;;AAAU;AAYZ;;;;AAAgE;;;iBAAhD,qBAAA,CAAsB,IAA0B,EAApB,oBAAoB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { relative, resolve } from "pathe";
|
|
2
|
+
//#region src/utils/componentSources.ts
|
|
3
|
+
/**
|
|
4
|
+
* Normalize a user-supplied `components.source` value into an array
|
|
5
|
+
* of absolute, fully-defaulted entries.
|
|
6
|
+
*/
|
|
7
|
+
function normalizeComponentSources(sources, cwd) {
|
|
8
|
+
if (!sources) return [];
|
|
9
|
+
return (Array.isArray(sources) ? sources : [sources]).map((s) => {
|
|
10
|
+
if (typeof s === "string") return {
|
|
11
|
+
path: resolve(cwd, s),
|
|
12
|
+
prefix: void 0,
|
|
13
|
+
pathPrefix: true
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
path: resolve(cwd, s.path),
|
|
17
|
+
prefix: s.prefix,
|
|
18
|
+
pathPrefix: s.pathPrefix ?? true
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function pascalCase(s) {
|
|
23
|
+
return s.replace(/[-_\s]+(.)/g, (_, c) => c.toUpperCase()).replace(/^(.)/, (c) => c.toUpperCase());
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Compute the component name unplugin-vue-components would assign for a
|
|
27
|
+
* given file under a given dir, mirroring the plugin's
|
|
28
|
+
* `directoryAsNamespace: true` + `collapseSamePrefixes: true` behavior
|
|
29
|
+
* and layering custom-prefix sources on top.
|
|
30
|
+
*
|
|
31
|
+
* Used both at render time (to register a custom resolver) and at lint
|
|
32
|
+
* time (so the linter can follow component graph correctly).
|
|
33
|
+
*/
|
|
34
|
+
function componentNameFromPath(opts) {
|
|
35
|
+
const { filePath, dirRoot, prefix, pathPrefix } = opts;
|
|
36
|
+
const segments = relative(dirRoot, filePath).replace(/\.(vue|md)$/, "").split("/").map(pascalCase);
|
|
37
|
+
const fileName = segments.pop() ?? "";
|
|
38
|
+
if (prefix !== void 0) {
|
|
39
|
+
const folderPart = pathPrefix ? segments.join("") : "";
|
|
40
|
+
const stripped = prefix && fileName.startsWith(prefix) ? fileName.slice(prefix.length) : fileName;
|
|
41
|
+
return prefix + folderPart + stripped;
|
|
42
|
+
}
|
|
43
|
+
const folderPart = segments.join("");
|
|
44
|
+
if (folderPart && fileName.startsWith(folderPart)) return fileName;
|
|
45
|
+
return folderPart + fileName;
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { componentNameFromPath, normalizeComponentSources };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=componentSources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentSources.js","names":[],"sources":["../../src/utils/componentSources.ts"],"sourcesContent":["import { resolve, relative } from 'pathe'\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)\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,QACd,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"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Root } from "postcss";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/cssBox.d.ts
|
|
4
|
+
declare const NO_BORDER_STYLES: Set<string>;
|
|
5
|
+
/**
|
|
6
|
+
* Parse a length token into px. Handles `Npx`, `Nrem`, `Nem`, `Npt`, and
|
|
7
|
+
* unitless N (treated as px). Returns null for percentages, calc(),
|
|
8
|
+
* keywords, or anything that doesn't reduce to a concrete length.
|
|
9
|
+
*/
|
|
10
|
+
declare function lengthToPx(value: string): number | null;
|
|
11
|
+
/**
|
|
12
|
+
* Expand a 1-4 token CSS shorthand (T R B L) into a left/right pair:
|
|
13
|
+
* 1: all sides
|
|
14
|
+
* 2: TB RL
|
|
15
|
+
* 3: T RL B
|
|
16
|
+
* 4: T R B L
|
|
17
|
+
*/
|
|
18
|
+
declare function shorthandSides(value: string): {
|
|
19
|
+
left?: string;
|
|
20
|
+
right?: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Read horizontal padding (left + right) px from a parsed style root.
|
|
24
|
+
* Percentages are skipped since they'd need a known container width.
|
|
25
|
+
*/
|
|
26
|
+
declare function horizontalPaddingPx(root: Root): number;
|
|
27
|
+
/**
|
|
28
|
+
* Extract a px length from a CSS border shorthand (e.g. `1px solid red` → 1).
|
|
29
|
+
* Returns null when the value indicates no border (`none` or `hidden`).
|
|
30
|
+
* Defaults to 3px (CSS `medium`) when a visible style is set but no
|
|
31
|
+
* explicit width token is present in the shorthand value.
|
|
32
|
+
*/
|
|
33
|
+
declare function shorthandBorderWidthPx(value: string): number | null;
|
|
34
|
+
/**
|
|
35
|
+
* Read horizontal border widths (left + right) px from a parsed style root.
|
|
36
|
+
* Per-side `border-style: none|hidden` overrides count as zero
|
|
37
|
+
* contribution. Returns total px or 0 when nothing resolves.
|
|
38
|
+
*/
|
|
39
|
+
declare function horizontalBorderPx(root: Root): number;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { NO_BORDER_STYLES, horizontalBorderPx, horizontalPaddingPx, lengthToPx, shorthandBorderWidthPx, shorthandSides };
|
|
42
|
+
//# sourceMappingURL=cssBox.d.ts.map
|
|
@@ -0,0 +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;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"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
//#region src/utils/cssBox.ts
|
|
2
|
+
const NO_BORDER_STYLES = new Set(["none", "hidden"]);
|
|
3
|
+
/**
|
|
4
|
+
* Parse a length token into px. Handles `Npx`, `Nrem`, `Nem`, `Npt`, and
|
|
5
|
+
* unitless N (treated as px). Returns null for percentages, calc(),
|
|
6
|
+
* keywords, or anything that doesn't reduce to a concrete length.
|
|
7
|
+
*/
|
|
8
|
+
function lengthToPx(value) {
|
|
9
|
+
const m = value.trim().match(/^([\d.]+)(px|rem|em|pt)?$/i);
|
|
10
|
+
if (!m) return null;
|
|
11
|
+
const n = parseFloat(m[1]);
|
|
12
|
+
const unit = (m[2] || "px").toLowerCase();
|
|
13
|
+
return n * (unit === "rem" || unit === "em" ? 16 : unit === "pt" ? 1.333 : 1);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Expand a 1-4 token CSS shorthand (T R B L) into a left/right pair:
|
|
17
|
+
* 1: all sides
|
|
18
|
+
* 2: TB RL
|
|
19
|
+
* 3: T RL B
|
|
20
|
+
* 4: T R B L
|
|
21
|
+
*/
|
|
22
|
+
function shorthandSides(value) {
|
|
23
|
+
const parts = value.trim().split(/\s+/);
|
|
24
|
+
switch (parts.length) {
|
|
25
|
+
case 1: return {
|
|
26
|
+
left: parts[0],
|
|
27
|
+
right: parts[0]
|
|
28
|
+
};
|
|
29
|
+
case 2:
|
|
30
|
+
case 3: return {
|
|
31
|
+
left: parts[1],
|
|
32
|
+
right: parts[1]
|
|
33
|
+
};
|
|
34
|
+
case 4: return {
|
|
35
|
+
left: parts[3],
|
|
36
|
+
right: parts[1]
|
|
37
|
+
};
|
|
38
|
+
default: return {};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Read horizontal padding (left + right) px from a parsed style root.
|
|
43
|
+
* Percentages are skipped since they'd need a known container width.
|
|
44
|
+
*/
|
|
45
|
+
function horizontalPaddingPx(root) {
|
|
46
|
+
let left = null;
|
|
47
|
+
let right = null;
|
|
48
|
+
root.walkDecls((d) => {
|
|
49
|
+
switch (d.prop) {
|
|
50
|
+
case "padding": {
|
|
51
|
+
const { left: l, right: r } = shorthandSides(d.value);
|
|
52
|
+
if (l) left = lengthToPx(l);
|
|
53
|
+
if (r) right = lengthToPx(r);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
case "padding-left":
|
|
57
|
+
left = lengthToPx(d.value);
|
|
58
|
+
break;
|
|
59
|
+
case "padding-right":
|
|
60
|
+
right = lengthToPx(d.value);
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return (left ?? 0) + (right ?? 0);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Extract a px length from a CSS border shorthand (e.g. `1px solid red` → 1).
|
|
68
|
+
* Returns null when the value indicates no border (`none` or `hidden`).
|
|
69
|
+
* Defaults to 3px (CSS `medium`) when a visible style is set but no
|
|
70
|
+
* explicit width token is present in the shorthand value.
|
|
71
|
+
*/
|
|
72
|
+
function shorthandBorderWidthPx(value) {
|
|
73
|
+
const tokens = value.trim().split(/\s+/);
|
|
74
|
+
if (tokens.some((t) => NO_BORDER_STYLES.has(t.toLowerCase()))) return null;
|
|
75
|
+
for (const t of tokens) {
|
|
76
|
+
const px = lengthToPx(t);
|
|
77
|
+
if (px != null) return px;
|
|
78
|
+
}
|
|
79
|
+
return 3;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Read horizontal border widths (left + right) px from a parsed style root.
|
|
83
|
+
* Per-side `border-style: none|hidden` overrides count as zero
|
|
84
|
+
* contribution. Returns total px or 0 when nothing resolves.
|
|
85
|
+
*/
|
|
86
|
+
function horizontalBorderPx(root) {
|
|
87
|
+
let left = null;
|
|
88
|
+
let right = null;
|
|
89
|
+
let leftNone = false;
|
|
90
|
+
let rightNone = false;
|
|
91
|
+
root.walkDecls((d) => {
|
|
92
|
+
switch (d.prop) {
|
|
93
|
+
case "border": {
|
|
94
|
+
const w = shorthandBorderWidthPx(d.value);
|
|
95
|
+
if (w == null) leftNone = rightNone = true;
|
|
96
|
+
else {
|
|
97
|
+
left = right = w;
|
|
98
|
+
leftNone = rightNone = false;
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
case "border-width": {
|
|
103
|
+
const { left: l, right: r } = shorthandSides(d.value);
|
|
104
|
+
if (l) left = lengthToPx(l) ?? left;
|
|
105
|
+
if (r) right = lengthToPx(r) ?? right;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
case "border-style": {
|
|
109
|
+
const { left: l, right: r } = shorthandSides(d.value);
|
|
110
|
+
if (l && NO_BORDER_STYLES.has(l.toLowerCase())) leftNone = true;
|
|
111
|
+
if (r && NO_BORDER_STYLES.has(r.toLowerCase())) rightNone = true;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
case "border-left": {
|
|
115
|
+
const w = shorthandBorderWidthPx(d.value);
|
|
116
|
+
if (w == null) leftNone = true;
|
|
117
|
+
else {
|
|
118
|
+
left = w;
|
|
119
|
+
leftNone = false;
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
case "border-right": {
|
|
124
|
+
const w = shorthandBorderWidthPx(d.value);
|
|
125
|
+
if (w == null) rightNone = true;
|
|
126
|
+
else {
|
|
127
|
+
right = w;
|
|
128
|
+
rightNone = false;
|
|
129
|
+
}
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
case "border-left-width":
|
|
133
|
+
left = lengthToPx(d.value) ?? left;
|
|
134
|
+
break;
|
|
135
|
+
case "border-right-width":
|
|
136
|
+
right = lengthToPx(d.value) ?? right;
|
|
137
|
+
break;
|
|
138
|
+
case "border-left-style":
|
|
139
|
+
if (NO_BORDER_STYLES.has(d.value.trim().toLowerCase())) leftNone = true;
|
|
140
|
+
break;
|
|
141
|
+
case "border-right-style":
|
|
142
|
+
if (NO_BORDER_STYLES.has(d.value.trim().toLowerCase())) rightNone = true;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
return (leftNone ? 0 : left ?? 0) + (rightNone ? 0 : right ?? 0);
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
export { NO_BORDER_STYLES, horizontalBorderPx, horizontalPaddingPx, lengthToPx, shorthandBorderWidthPx, shorthandSides };
|
|
150
|
+
|
|
151
|
+
//# sourceMappingURL=cssBox.js.map
|
|
@@ -0,0 +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 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 (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,CAAC,CAAC,MAAM,4BAA4B;CACzD,IAAI,CAAC,GAAG,OAAO;CACf,MAAM,IAAI,WAAW,EAAE,EAAE;CACzB,MAAM,QAAQ,EAAE,MAAM,KAAA,CAAM,YAAY;CACxC,OAAO,KAAK,SAAS,SAAS,SAAS,OAAO,KAAK,SAAS,OAAO,QAAQ;AAC7E;;;;;;;;AASA,SAAgB,eAAe,OAAkD;CAC/E,MAAM,QAAQ,MAAM,KAAK,CAAC,CAAC,MAAM,KAAK;CACtC,QAAQ,MAAM,QAAd;EACE,KAAK,GAAG,OAAO;GAAE,MAAM,MAAM;GAAI,OAAO,MAAM;EAAG;EACjD,KAAK;EACL,KAAK,GAAG,OAAO;GAAE,MAAM,MAAM;GAAI,OAAO,MAAM;EAAG;EACjD,KAAK,GAAG,OAAO;GAAE,MAAM,MAAM;GAAI,OAAO,MAAM;EAAG;EACjD,SAAS,OAAO,CAAC;CACnB;AACF;;;;;AAMA,SAAgB,oBAAoB,MAAoB;CACtD,IAAI,OAAsB;CAC1B,IAAI,QAAuB;CAE3B,KAAK,WAAW,MAAM;EACpB,QAAQ,EAAE,MAAV;GACE,KAAK,WAAW;IACd,MAAM,EAAE,MAAM,GAAG,OAAO,MAAM,eAAe,EAAE,KAAK;IACpD,IAAI,GAAG,OAAO,WAAW,CAAC;IAC1B,IAAI,GAAG,QAAQ,WAAW,CAAC;IAC3B;GACF;GACA,KAAK;IACH,OAAO,WAAW,EAAE,KAAK;IACzB;GACF,KAAK;IACH,QAAQ,WAAW,EAAE,KAAK;IAC1B;EACJ;CACF,CAAC;CAED,QAAQ,QAAQ,MAAM,SAAS;AACjC;;;;;;;AAQA,SAAgB,uBAAuB,OAA8B;CACnE,MAAM,SAAS,MAAM,KAAK,CAAC,CAAC,MAAM,KAAK;CACvC,IAAI,OAAO,MAAM,MAAM,iBAAiB,IAAI,EAAE,YAAY,CAAC,CAAC,GAAG,OAAO;CACtE,KAAK,MAAM,KAAK,QAAQ;EACtB,MAAM,KAAK,WAAW,CAAC;EACvB,IAAI,MAAM,MAAM,OAAO;CACzB;CACA,OAAO;AACT;;;;;;AAOA,SAAgB,mBAAmB,MAAoB;CACrD,IAAI,OAAsB;CAC1B,IAAI,QAAuB;CAC3B,IAAI,WAAW;CACf,IAAI,YAAY;CAEhB,KAAK,WAAW,MAAM;EACpB,QAAQ,EAAE,MAAV;GACE,KAAK,UAAU;IACb,MAAM,IAAI,uBAAuB,EAAE,KAAK;IACxC,IAAI,KAAK,MACP,WAAW,YAAY;SAEpB;KACH,OAAO,QAAQ;KACf,WAAW,YAAY;IACzB;IACA;GACF;GACA,KAAK,gBAAgB;IACnB,MAAM,EAAE,MAAM,GAAG,OAAO,MAAM,eAAe,EAAE,KAAK;IACpD,IAAI,GAAG,OAAO,WAAW,CAAC,KAAK;IAC/B,IAAI,GAAG,QAAQ,WAAW,CAAC,KAAK;IAChC;GACF;GACA,KAAK,gBAAgB;IACnB,MAAM,EAAE,MAAM,GAAG,OAAO,MAAM,eAAe,EAAE,KAAK;IACpD,IAAI,KAAK,iBAAiB,IAAI,EAAE,YAAY,CAAC,GAAG,WAAW;IAC3D,IAAI,KAAK,iBAAiB,IAAI,EAAE,YAAY,CAAC,GAAG,YAAY;IAC5D;GACF;GACA,KAAK,eAAe;IAClB,MAAM,IAAI,uBAAuB,EAAE,KAAK;IACxC,IAAI,KAAK,MAAM,WAAW;SACrB;KAAE,OAAO;KAAG,WAAW;IAAM;IAClC;GACF;GACA,KAAK,gBAAgB;IACnB,MAAM,IAAI,uBAAuB,EAAE,KAAK;IACxC,IAAI,KAAK,MAAM,YAAY;SACtB;KAAE,QAAQ;KAAG,YAAY;IAAM;IACpC;GACF;GACA,KAAK;IACH,OAAO,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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/utils/decodeStyleEntities.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Decode HTML entities that Vue SSR encodes inside `<style>` tags.
|
|
4
|
+
*
|
|
5
|
+
* Vue's `renderToString` HTML-encodes quotes and angle brackets within
|
|
6
|
+
* style elements in templates, breaking CSS like
|
|
7
|
+
* `@import "tailwindcss"` → `@import "tailwindcss"`.
|
|
8
|
+
*
|
|
9
|
+
* `&` is decoded last so previously-decoded entities are not
|
|
10
|
+
* re-processed.
|
|
11
|
+
*/
|
|
12
|
+
declare function decodeStyleEntities(s: string): string;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { decodeStyleEntities };
|
|
15
|
+
//# sourceMappingURL=decodeStyleEntities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decodeStyleEntities.d.ts","names":[],"sources":["../../src/utils/decodeStyleEntities.ts"],"mappings":";;AAUA;;;;AAA6C;;;;;iBAA7B,mBAAA,CAAoB,CAAS"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/utils/decodeStyleEntities.ts
|
|
2
|
+
/**
|
|
3
|
+
* Decode HTML entities that Vue SSR encodes inside `<style>` tags.
|
|
4
|
+
*
|
|
5
|
+
* Vue's `renderToString` HTML-encodes quotes and angle brackets within
|
|
6
|
+
* style elements in templates, breaking CSS like
|
|
7
|
+
* `@import "tailwindcss"` → `@import "tailwindcss"`.
|
|
8
|
+
*
|
|
9
|
+
* `&` is decoded last so previously-decoded entities are not
|
|
10
|
+
* re-processed.
|
|
11
|
+
*/
|
|
12
|
+
function decodeStyleEntities(s) {
|
|
13
|
+
return s.replace(/"/g, "\"").replace(/'/g, "'").replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { decodeStyleEntities };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=decodeStyleEntities.js.map
|
|
@@ -0,0 +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 "tailwindcss"`.\n *\n * `&` is decoded last so previously-decoded entities are not\n * re-processed.\n */\nexport function decodeStyleEntities(s: string): string {\n return s\n .replace(/"/g, '\"')\n .replace(/'/g, \"'\")\n .replace(/'/g, \"'\")\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/&/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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","names":[],"sources":["../../src/utils/detect.ts"],"mappings":";iBAGgB,SAAA,CAAU,GAA2B"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
|
-
|
|
4
3
|
//#region src/utils/detect.ts
|
|
5
4
|
function isLaravel(cwd = process.cwd()) {
|
|
6
5
|
return existsSync(resolve(cwd, "artisan"));
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
//#endregion
|
|
10
8
|
export { isLaravel };
|
|
11
|
-
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.js","names":[],"sources":["../../src/utils/detect.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\n\nexport function isLaravel(cwd: string = process.cwd()): boolean {\n return existsSync(resolve(cwd, 'artisan'))\n}\n"],"mappings":";;;AAGA,SAAgB,UAAU,MAAc,QAAQ,IAAI,GAAY;CAC9D,OAAO,WAAW,QAAQ,KAAK,SAAS,CAAC;AAC3C"}
|