@maizzle/framework 6.0.0-rc.0 → 6.0.0-rc.10
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/bin/maizzle.mjs +1 -1
- package/dist/_virtual/_rolldown/runtime.mjs +32 -0
- package/dist/build.mjs +29 -9
- package/dist/build.mjs.map +1 -1
- package/dist/components/Body.vue +111 -0
- package/dist/components/Button.vue +68 -14
- package/dist/components/CodeBlock.vue +68 -0
- package/dist/components/CodeInline.vue +49 -0
- package/dist/components/Column.vue +86 -0
- package/dist/components/Container.vue +48 -0
- package/dist/components/Divider.vue +28 -0
- package/dist/components/Head.vue +30 -0
- package/dist/components/Heading.vue +28 -0
- package/dist/components/Html.vue +104 -0
- package/dist/components/Image.vue +70 -0
- package/dist/components/Layout.vue +93 -0
- package/dist/components/Link.vue +26 -0
- package/dist/components/Markdown.vue +89 -0
- package/dist/components/Outlook.vue +36 -0
- package/dist/components/Overlap.vue +80 -0
- package/dist/components/Preheader.vue +20 -0
- package/dist/components/Row.vue +91 -0
- package/dist/components/Section.vue +83 -0
- package/dist/components/Spacer.vue +50 -7
- package/dist/components/Text.vue +29 -0
- package/dist/components/Vml.vue +165 -13
- package/dist/composables/renderContext.d.mts +5 -0
- package/dist/composables/renderContext.d.mts.map +1 -1
- package/dist/composables/renderContext.mjs.map +1 -1
- package/dist/composables/usePreviewText.d.mts +24 -0
- package/dist/composables/usePreviewText.d.mts.map +1 -0
- package/dist/composables/usePreviewText.mjs +29 -0
- package/dist/composables/usePreviewText.mjs.map +1 -0
- package/dist/config/index.mjs +25 -1
- package/dist/config/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +3 -1
- package/dist/node_modules/picomatch/index.mjs +13 -0
- package/dist/node_modules/picomatch/index.mjs.map +1 -0
- package/dist/node_modules/picomatch/lib/constants.mjs +174 -0
- package/dist/node_modules/picomatch/lib/constants.mjs.map +1 -0
- package/dist/node_modules/picomatch/lib/parse.mjs +1067 -0
- package/dist/node_modules/picomatch/lib/parse.mjs.map +1 -0
- package/dist/node_modules/picomatch/lib/picomatch.mjs +304 -0
- package/dist/node_modules/picomatch/lib/picomatch.mjs.map +1 -0
- package/dist/node_modules/picomatch/lib/scan.mjs +296 -0
- package/dist/node_modules/picomatch/lib/scan.mjs.map +1 -0
- package/dist/node_modules/picomatch/lib/utils.mjs +53 -0
- package/dist/node_modules/picomatch/lib/utils.mjs.map +1 -0
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +24 -7
- package/dist/plugin.mjs.map +1 -1
- package/dist/plugins/postcss/tailwindCleanup.d.mts.map +1 -1
- package/dist/plugins/postcss/tailwindCleanup.mjs +44 -13
- package/dist/plugins/postcss/tailwindCleanup.mjs.map +1 -1
- package/dist/render/createRenderer.d.mts +10 -3
- package/dist/render/createRenderer.d.mts.map +1 -1
- package/dist/render/createRenderer.mjs +147 -10
- package/dist/render/createRenderer.mjs.map +1 -1
- package/dist/render/index.mjs +9 -3
- package/dist/render/index.mjs.map +1 -1
- package/dist/serve.d.mts.map +1 -1
- package/dist/serve.mjs +159 -63
- package/dist/serve.mjs.map +1 -1
- package/dist/server/compatibility.d.mts +1 -2
- package/dist/server/compatibility.d.mts.map +1 -1
- package/dist/server/compatibility.mjs +30 -16
- package/dist/server/compatibility.mjs.map +1 -1
- package/dist/server/email.d.mts +17 -0
- package/dist/server/email.d.mts.map +1 -0
- package/dist/server/email.mjs +41 -0
- package/dist/server/email.mjs.map +1 -0
- package/dist/server/linter.d.mts +1 -2
- package/dist/server/linter.d.mts.map +1 -1
- package/dist/server/linter.mjs +60 -71
- package/dist/server/linter.mjs.map +1 -1
- package/dist/server/ui/App.vue +205 -69
- package/dist/server/ui/components/ui/checkbox/Checkbox.vue +35 -0
- package/dist/server/ui/components/ui/checkbox/index.ts +1 -0
- package/dist/server/ui/components/ui/command/CommandDialog.vue +1 -1
- package/dist/server/ui/components/ui/command/CommandInput.vue +19 -1
- package/dist/server/ui/components/ui/command/CommandItem.vue +1 -1
- package/dist/server/ui/components/ui/command/CommandList.vue +1 -1
- package/dist/server/ui/components/ui/command/CommandShortcut.vue +1 -1
- package/dist/server/ui/components/ui/dialog/DialogOverlay.vue +9 -1
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/dist/server/ui/components/ui/scroll-area/ScrollBar.vue +1 -1
- package/dist/server/ui/components/ui/sheet/SheetContent.vue +1 -1
- package/dist/server/ui/components/ui/sheet/SheetOverlay.vue +9 -1
- package/dist/server/ui/components/ui/sidebar/Sidebar.vue +8 -1
- package/dist/server/ui/components/ui/sidebar/SidebarProvider.vue +1 -1
- package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +5 -4
- package/dist/server/ui/components/ui/tags-input/TagsInput.vue +26 -0
- package/dist/server/ui/components/ui/tags-input/TagsInputInput.vue +17 -0
- package/dist/server/ui/components/ui/tags-input/TagsInputItem.vue +19 -0
- package/dist/server/ui/components/ui/tags-input/TagsInputItemDelete.vue +22 -0
- package/dist/server/ui/components/ui/tags-input/TagsInputItemText.vue +17 -0
- package/dist/server/ui/components/ui/tags-input/index.ts +5 -0
- package/dist/server/ui/components/ui/toggle/index.ts +3 -3
- package/dist/server/ui/components/ui/toggle-group/ToggleGroup.vue +1 -1
- package/dist/server/ui/components/ui/toggle-group/ToggleGroupItem.vue +2 -2
- package/dist/server/ui/main.css +20 -20
- package/dist/server/ui/pages/Home.vue +12 -5
- package/dist/server/ui/pages/Preview.vue +506 -216
- package/dist/transformers/entities.d.mts.map +1 -1
- package/dist/transformers/entities.mjs +3 -0
- package/dist/transformers/entities.mjs.map +1 -1
- package/dist/transformers/filters/defaults.d.mts +6 -0
- package/dist/transformers/filters/defaults.d.mts.map +1 -0
- package/dist/transformers/filters/defaults.mjs +78 -0
- package/dist/transformers/filters/defaults.mjs.map +1 -0
- package/dist/transformers/filters/index.d.mts +22 -0
- package/dist/transformers/filters/index.d.mts.map +1 -0
- package/dist/transformers/filters/index.mjs +67 -0
- package/dist/transformers/filters/index.mjs.map +1 -0
- package/dist/transformers/index.d.mts +11 -9
- package/dist/transformers/index.d.mts.map +1 -1
- package/dist/transformers/index.mjs +19 -11
- package/dist/transformers/index.mjs.map +1 -1
- package/dist/transformers/inlineCSS.d.mts +1 -14
- package/dist/transformers/inlineCSS.d.mts.map +1 -1
- package/dist/transformers/inlineCSS.mjs +25 -34
- package/dist/transformers/inlineCSS.mjs.map +1 -1
- package/dist/transformers/purgeCSS.d.mts.map +1 -1
- package/dist/transformers/purgeCSS.mjs +67 -1
- package/dist/transformers/purgeCSS.mjs.map +1 -1
- package/dist/transformers/sixHex.d.mts +16 -0
- package/dist/transformers/sixHex.d.mts.map +1 -0
- package/dist/transformers/sixHex.mjs +30 -0
- package/dist/transformers/sixHex.mjs.map +1 -0
- package/dist/transformers/tailwindcss.d.mts +6 -2
- package/dist/transformers/tailwindcss.d.mts.map +1 -1
- package/dist/transformers/tailwindcss.mjs +52 -28
- package/dist/transformers/tailwindcss.mjs.map +1 -1
- package/dist/types/config.d.mts +459 -17
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/utils/ast/serializer.d.mts +3 -2
- package/dist/utils/ast/serializer.d.mts.map +1 -1
- package/dist/utils/ast/serializer.mjs +24 -0
- package/dist/utils/ast/serializer.mjs.map +1 -1
- package/dist/utils/detect.d.mts +5 -0
- package/dist/utils/detect.d.mts.map +1 -0
- package/dist/utils/detect.mjs +11 -0
- package/dist/utils/detect.mjs.map +1 -0
- package/node_modules/@clack/core/CHANGELOG.md +87 -4
- package/node_modules/@clack/core/README.md +1 -1
- package/node_modules/@clack/core/dist/index.d.mts +186 -48
- package/node_modules/@clack/core/dist/index.mjs +10 -14
- package/node_modules/@clack/core/dist/index.mjs.map +1 -1
- package/node_modules/@clack/core/package.json +7 -9
- package/node_modules/@clack/prompts/CHANGELOG.md +171 -7
- package/node_modules/@clack/prompts/README.md +66 -3
- package/node_modules/@clack/prompts/dist/index.d.mts +302 -76
- package/node_modules/@clack/prompts/dist/index.mjs +134 -84
- package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
- package/node_modules/@clack/prompts/package.json +14 -10
- package/node_modules/citty/LICENSE +0 -15
- package/node_modules/citty/README.md +166 -69
- package/node_modules/citty/dist/index.d.mts +88 -56
- package/node_modules/citty/dist/index.mjs +399 -437
- package/node_modules/citty/package.json +28 -35
- package/node_modules/giget/README.md +59 -11
- package/node_modules/giget/dist/THIRD-PARTY-LICENSES.md +205 -0
- package/node_modules/giget/dist/_chunks/giget.mjs +508 -0
- package/node_modules/giget/dist/_chunks/libs/citty.mjs +269 -0
- package/node_modules/giget/dist/_chunks/libs/nypm.d.mts +1 -0
- package/node_modules/giget/dist/_chunks/libs/nypm.mjs +669 -0
- package/node_modules/giget/dist/_chunks/libs/tar.mjs +2931 -0
- package/node_modules/giget/dist/_chunks/rolldown-runtime.mjs +14 -0
- package/node_modules/giget/dist/cli.d.mts +1 -0
- package/node_modules/giget/dist/cli.mjs +89 -111
- package/node_modules/giget/dist/index.d.mts +46 -35
- package/node_modules/giget/dist/index.mjs +2 -22
- package/node_modules/giget/package.json +32 -45
- package/node_modules/maizzle/README.md +140 -0
- package/node_modules/maizzle/bin/maizzle.mjs +5 -0
- package/node_modules/maizzle/dist/commands/new.d.mts +7 -0
- package/node_modules/maizzle/dist/commands/new.mjs +278 -0
- package/node_modules/{@maizzle/cli → maizzle}/dist/index.d.mts +1 -1
- package/node_modules/maizzle/dist/index.mjs +44 -0
- package/node_modules/{commander → maizzle/node_modules/commander}/Readme.md +94 -67
- package/node_modules/{commander → maizzle/node_modules/commander}/lib/argument.js +5 -4
- package/node_modules/{commander → maizzle/node_modules/commander}/lib/command.js +154 -39
- package/node_modules/{commander → maizzle/node_modules/commander}/lib/help.js +77 -39
- package/node_modules/{commander → maizzle/node_modules/commander}/lib/option.js +16 -3
- package/node_modules/{commander → maizzle/node_modules/commander}/package-support.json +4 -1
- package/node_modules/{commander → maizzle/node_modules/commander}/package.json +8 -8
- package/node_modules/{commander → maizzle/node_modules/commander}/typings/index.d.ts +71 -3
- package/node_modules/{@maizzle/cli → maizzle}/package.json +13 -11
- package/node_modules/tinyexec/README.md +49 -3
- package/node_modules/tinyexec/dist/main.d.mts +25 -14
- package/node_modules/tinyexec/dist/main.mjs +148 -100
- package/node_modules/tinyexec/package.json +9 -8
- package/package.json +9 -4
- package/dist/server/ui/components/ui/resizable/ResizableHandle.vue +0 -30
- package/dist/server/ui/components/ui/resizable/ResizablePanel.vue +0 -21
- package/dist/server/ui/components/ui/resizable/ResizablePanelGroup.vue +0 -25
- package/dist/server/ui/components/ui/resizable/index.ts +0 -3
- package/node_modules/@clack/core/dist/index.cjs +0 -15
- package/node_modules/@clack/core/dist/index.cjs.map +0 -1
- package/node_modules/@clack/core/dist/index.d.cts +0 -211
- package/node_modules/@clack/core/dist/index.d.ts +0 -211
- package/node_modules/@clack/prompts/dist/index.cjs +0 -87
- package/node_modules/@clack/prompts/dist/index.cjs.map +0 -1
- package/node_modules/@clack/prompts/dist/index.d.cts +0 -165
- package/node_modules/@clack/prompts/dist/index.d.ts +0 -165
- package/node_modules/@maizzle/cli/README.md +0 -58
- package/node_modules/@maizzle/cli/dist/index.mjs +0 -42
- package/node_modules/citty/dist/index.cjs +0 -475
- package/node_modules/citty/dist/index.d.cts +0 -80
- package/node_modules/citty/dist/index.d.ts +0 -80
- package/node_modules/consola/LICENSE +0 -47
- package/node_modules/consola/README.md +0 -352
- package/node_modules/consola/basic.d.ts +0 -1
- package/node_modules/consola/browser.d.ts +0 -1
- package/node_modules/consola/core.d.ts +0 -1
- package/node_modules/consola/dist/basic.cjs +0 -32
- package/node_modules/consola/dist/basic.d.cts +0 -23
- package/node_modules/consola/dist/basic.d.mts +0 -21
- package/node_modules/consola/dist/basic.d.ts +0 -23
- package/node_modules/consola/dist/basic.mjs +0 -24
- package/node_modules/consola/dist/browser.cjs +0 -84
- package/node_modules/consola/dist/browser.d.cts +0 -23
- package/node_modules/consola/dist/browser.d.mts +0 -21
- package/node_modules/consola/dist/browser.d.ts +0 -23
- package/node_modules/consola/dist/browser.mjs +0 -76
- package/node_modules/consola/dist/chunks/prompt.cjs +0 -288
- package/node_modules/consola/dist/chunks/prompt.mjs +0 -280
- package/node_modules/consola/dist/core.cjs +0 -517
- package/node_modules/consola/dist/core.d.cts +0 -459
- package/node_modules/consola/dist/core.d.mts +0 -459
- package/node_modules/consola/dist/core.d.ts +0 -459
- package/node_modules/consola/dist/core.mjs +0 -512
- package/node_modules/consola/dist/index.cjs +0 -663
- package/node_modules/consola/dist/index.d.cts +0 -24
- package/node_modules/consola/dist/index.d.mts +0 -22
- package/node_modules/consola/dist/index.d.ts +0 -24
- package/node_modules/consola/dist/index.mjs +0 -651
- package/node_modules/consola/dist/shared/consola.DCGIlDNP.cjs +0 -75
- package/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +0 -72
- package/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +0 -288
- package/node_modules/consola/dist/shared/consola.DwRq1yyg.cjs +0 -312
- package/node_modules/consola/dist/utils.cjs +0 -64
- package/node_modules/consola/dist/utils.d.cts +0 -286
- package/node_modules/consola/dist/utils.d.mts +0 -286
- package/node_modules/consola/dist/utils.d.ts +0 -286
- package/node_modules/consola/dist/utils.mjs +0 -54
- package/node_modules/consola/lib/index.cjs +0 -10
- package/node_modules/consola/package.json +0 -136
- package/node_modules/consola/utils.d.ts +0 -1
- package/node_modules/create-maizzle/README.md +0 -86
- package/node_modules/create-maizzle/bin/create-maizzle.mjs +0 -4
- package/node_modules/create-maizzle/node_modules/@clack/core/CHANGELOG.md +0 -340
- package/node_modules/create-maizzle/node_modules/@clack/core/LICENSE +0 -9
- package/node_modules/create-maizzle/node_modules/@clack/core/README.md +0 -22
- package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.d.mts +0 -349
- package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs +0 -11
- package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs.map +0 -1
- package/node_modules/create-maizzle/node_modules/@clack/core/package.json +0 -60
- package/node_modules/create-maizzle/node_modules/@clack/prompts/CHANGELOG.md +0 -576
- package/node_modules/create-maizzle/node_modules/@clack/prompts/LICENSE +0 -9
- package/node_modules/create-maizzle/node_modules/@clack/prompts/README.md +0 -270
- package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.d.mts +0 -391
- package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs +0 -137
- package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
- package/node_modules/create-maizzle/node_modules/@clack/prompts/package.json +0 -65
- package/node_modules/create-maizzle/package.json +0 -47
- package/node_modules/create-maizzle/src/index.js +0 -242
- package/node_modules/defu/LICENSE +0 -21
- package/node_modules/defu/README.md +0 -171
- package/node_modules/defu/dist/defu.cjs +0 -77
- package/node_modules/defu/dist/defu.d.cts +0 -31
- package/node_modules/defu/dist/defu.d.mts +0 -29
- package/node_modules/defu/dist/defu.d.ts +0 -31
- package/node_modules/defu/dist/defu.mjs +0 -69
- package/node_modules/defu/lib/defu.cjs +0 -10
- package/node_modules/defu/lib/defu.d.cts +0 -12
- package/node_modules/defu/package.json +0 -48
- package/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +0 -468
- package/node_modules/node-fetch-native/LICENSE +0 -114
- package/node_modules/node-fetch-native/README.md +0 -225
- package/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -2
- package/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -2
- package/node_modules/node-fetch-native/dist/index.cjs +0 -1
- package/node_modules/node-fetch-native/dist/index.mjs +0 -1
- package/node_modules/node-fetch-native/dist/native.cjs +0 -1
- package/node_modules/node-fetch-native/dist/native.mjs +0 -1
- package/node_modules/node-fetch-native/dist/node.cjs +0 -19
- package/node_modules/node-fetch-native/dist/node.mjs +0 -19
- package/node_modules/node-fetch-native/dist/polyfill.cjs +0 -1
- package/node_modules/node-fetch-native/dist/polyfill.mjs +0 -1
- package/node_modules/node-fetch-native/dist/proxy-stub.cjs +0 -1
- package/node_modules/node-fetch-native/dist/proxy-stub.mjs +0 -1
- package/node_modules/node-fetch-native/dist/proxy.cjs +0 -58
- package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +0 -1
- package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +0 -1
- package/node_modules/node-fetch-native/index.d.ts +0 -1
- package/node_modules/node-fetch-native/lib/empty.cjs +0 -0
- package/node_modules/node-fetch-native/lib/empty.mjs +0 -0
- package/node_modules/node-fetch-native/lib/index.cjs +0 -11
- package/node_modules/node-fetch-native/lib/index.d.cts +0 -10
- package/node_modules/node-fetch-native/lib/index.d.mts +0 -10
- package/node_modules/node-fetch-native/lib/index.d.ts +0 -10
- package/node_modules/node-fetch-native/lib/native.cjs +0 -11
- package/node_modules/node-fetch-native/lib/polyfill.d.cts +0 -1
- package/node_modules/node-fetch-native/lib/polyfill.d.mts +0 -1
- package/node_modules/node-fetch-native/lib/polyfill.d.ts +0 -1
- package/node_modules/node-fetch-native/lib/proxy.d.ts +0 -32
- package/node_modules/node-fetch-native/node.d.ts +0 -1
- package/node_modules/node-fetch-native/package.json +0 -138
- package/node_modules/node-fetch-native/polyfill.d.ts +0 -1
- package/node_modules/node-fetch-native/proxy.d.ts +0 -1
- package/node_modules/nypm/node_modules/citty/LICENSE +0 -21
- package/node_modules/nypm/node_modules/citty/README.md +0 -231
- package/node_modules/nypm/node_modules/citty/dist/index.d.mts +0 -112
- package/node_modules/nypm/node_modules/citty/dist/index.mjs +0 -425
- package/node_modules/nypm/node_modules/citty/package.json +0 -42
- /package/node_modules/{nypm/node_modules/citty → citty}/dist/THIRD-PARTY-LICENSES.md +0 -0
- /package/node_modules/{nypm/node_modules/citty → citty}/dist/_chunks/libs/scule.mjs +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/LICENSE +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.d.mts +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.mjs +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.d.mts +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.mjs +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.d.mts +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.mjs +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.d.mts +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.mjs +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/component.vue +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/config.ts +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/layout.vue +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/template.vue +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.d.mts +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.mjs +0 -0
- /package/node_modules/{commander → maizzle/node_modules/commander}/LICENSE +0 -0
- /package/node_modules/{commander → maizzle/node_modules/commander}/esm.mjs +0 -0
- /package/node_modules/{commander → maizzle/node_modules/commander}/index.js +0 -0
- /package/node_modules/{commander → maizzle/node_modules/commander}/lib/error.js +0 -0
- /package/node_modules/{commander → maizzle/node_modules/commander}/lib/suggestSimilar.js +0 -0
- /package/node_modules/{commander → maizzle/node_modules/commander}/typings/esm.d.mts +0 -0
package/bin/maizzle.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { createJiti } from 'jiti'
|
|
|
4
4
|
import { fileURLToPath } from 'node:url'
|
|
5
5
|
|
|
6
6
|
const jiti = createJiti(fileURLToPath(import.meta.url), { interopDefault: true })
|
|
7
|
-
const { default: bootstrap } = await jiti.import('
|
|
7
|
+
const { default: bootstrap } = await jiti.import('maizzle')
|
|
8
8
|
const framework = await jiti.import('../dist/index.mjs')
|
|
9
9
|
|
|
10
10
|
await bootstrap(framework)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
|
+
key = keys[i];
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
16
|
+
__defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: true
|
|
28
|
+
}) : target, mod));
|
|
29
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { __commonJSMin, __require, __toESM };
|
package/dist/build.mjs
CHANGED
|
@@ -24,7 +24,9 @@ async function build(options = {}) {
|
|
|
24
24
|
await events.fireBeforeCreate({ config });
|
|
25
25
|
const outputPath = resolve(config.output?.path ?? "dist");
|
|
26
26
|
const outputExtension = config.output?.extension ?? "html";
|
|
27
|
-
const
|
|
27
|
+
const contentPatterns = config.content ?? ["emails/**/*.vue"];
|
|
28
|
+
const contentBase = computeContentBase(contentPatterns);
|
|
29
|
+
const templateFiles = await glob(contentPatterns);
|
|
28
30
|
if (templateFiles.length === 0) {
|
|
29
31
|
spinner.succeed("No templates found");
|
|
30
32
|
return {
|
|
@@ -36,7 +38,12 @@ async function build(options = {}) {
|
|
|
36
38
|
recursive: true,
|
|
37
39
|
force: true
|
|
38
40
|
});
|
|
39
|
-
const renderer = await createRenderer({
|
|
41
|
+
const renderer = await createRenderer({
|
|
42
|
+
markdown: config.markdown,
|
|
43
|
+
root: config.root,
|
|
44
|
+
componentDirs: [config.components?.source ?? []].flat(),
|
|
45
|
+
vite: config.vite
|
|
46
|
+
});
|
|
40
47
|
const outputFiles = [];
|
|
41
48
|
try {
|
|
42
49
|
for (const templatePath of templateFiles) {
|
|
@@ -53,14 +60,15 @@ async function build(options = {}) {
|
|
|
53
60
|
html: rendered.html
|
|
54
61
|
});
|
|
55
62
|
const templateConfig = rendered.templateConfig;
|
|
56
|
-
|
|
63
|
+
const doctype = rendered.doctype ?? templateConfig.doctype ?? "<!DOCTYPE html>";
|
|
64
|
+
if (templateConfig.useTransformers !== false) html = await runTransformers(html, templateConfig, absolutePath, doctype);
|
|
57
65
|
html = await events.fireAfterTransform({
|
|
58
66
|
config,
|
|
59
67
|
template,
|
|
60
68
|
html
|
|
61
69
|
});
|
|
62
|
-
html = `${
|
|
63
|
-
const outputFilePath = resolveOutputPath(templatePath, outputPath, outputExtension);
|
|
70
|
+
html = `${doctype}\n${html}`;
|
|
71
|
+
const outputFilePath = resolveOutputPath(templatePath, outputPath, outputExtension, contentBase);
|
|
64
72
|
mkdirSync(dirname(outputFilePath), { recursive: true });
|
|
65
73
|
writeFileSync(outputFilePath, html);
|
|
66
74
|
outputFiles.push(outputFilePath);
|
|
@@ -73,8 +81,8 @@ async function build(options = {}) {
|
|
|
73
81
|
if (sfcPlaintext?.destination) {
|
|
74
82
|
const name = basename(templatePath).replace(/\.(vue|md)$/, "");
|
|
75
83
|
ptOutputPath = join(resolve(sfcPlaintext.destination), `${name}.${ptExtension}`);
|
|
76
|
-
} else if (typeof globalPlaintext === "string") ptOutputPath = resolveOutputPath(templatePath, resolve(globalPlaintext), ptExtension);
|
|
77
|
-
else ptOutputPath = resolveOutputPath(templatePath, outputPath, ptExtension);
|
|
84
|
+
} else if (typeof globalPlaintext === "string") ptOutputPath = resolveOutputPath(templatePath, resolve(globalPlaintext), ptExtension, contentBase);
|
|
85
|
+
else ptOutputPath = resolveOutputPath(templatePath, outputPath, ptExtension, contentBase);
|
|
78
86
|
mkdirSync(dirname(ptOutputPath), { recursive: true });
|
|
79
87
|
writeFileSync(ptOutputPath, plaintext);
|
|
80
88
|
}
|
|
@@ -100,9 +108,21 @@ async function build(options = {}) {
|
|
|
100
108
|
config
|
|
101
109
|
};
|
|
102
110
|
}
|
|
103
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Extract the static (non-glob) prefix from content patterns.
|
|
113
|
+
*
|
|
114
|
+
* For example, `['/abs/path/emails/**\/*.vue']` → `'/abs/path/emails'`
|
|
115
|
+
*
|
|
116
|
+
* This is used to strip the content base from template paths
|
|
117
|
+
* so the output preserves only the subdirectory structure.
|
|
118
|
+
*/
|
|
119
|
+
function computeContentBase(patterns) {
|
|
120
|
+
const staticPart = (patterns.find((p) => !p.startsWith("!")) ?? patterns[0]).split(/[*{?[]/)[0];
|
|
121
|
+
return resolve(staticPart.endsWith("/") ? staticPart : dirname(staticPart));
|
|
122
|
+
}
|
|
123
|
+
function resolveOutputPath(templatePath, outputDir, extension, contentBase) {
|
|
104
124
|
const name = basename(templatePath).replace(/\.(vue|md)$/, "");
|
|
105
|
-
return join(outputDir, dirname(templatePath)
|
|
125
|
+
return join(outputDir, relative(contentBase, dirname(resolve(templatePath))), `${name}.${extension}`);
|
|
106
126
|
}
|
|
107
127
|
async function copyStatic(config, outputPath) {
|
|
108
128
|
const sources = config.static?.source ?? ["public/**/*.*"];
|
package/dist/build.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.mjs","names":[],"sources":["../src/build.ts"],"sourcesContent":["import { readFileSync, writeFileSync, mkdirSync, cpSync, existsSync, rmSync } from 'node:fs'\nimport { resolve, dirname, basename, relative, join } from 'node:path'\nimport { glob } from 'tinyglobby'\nimport ora from 'ora'\nimport { resolveConfig } from './config/index.ts'\nimport { EventManager } from './events/index.ts'\nimport { runTransformers } from './transformers/index.ts'\nimport { createRenderer } from './render/createRenderer.ts'\nimport { createPlaintext } from './plaintext.ts'\nimport type { MaizzleConfig } from './types/index.ts'\n\nexport interface BuildOptions {\n config?: Partial<MaizzleConfig> | string\n}\n\nexport interface BuildResult {\n files: string[]\n config: MaizzleConfig\n}\n\n/**\n * Build all SFC email templates to HTML files.\n *\n * Creates a single Renderer instance, then loops through each template\n * calling render → transformers → write to disk.\n */\nexport async function build(options: BuildOptions = {}): Promise<BuildResult> {\n const start = Date.now()\n const spinner = ora('Building templates...').start()\n\n const config = await resolveConfig(options.config)\n\n const events = new EventManager()\n events.registerConfig(config)\n await events.fireBeforeCreate({ config })\n\n const outputPath = resolve(config.output?.path ?? 'dist')\n const outputExtension = config.output?.extension ?? 'html'\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templateFiles = await glob(contentPatterns)\n\n if (templateFiles.length === 0) {\n spinner.succeed('No templates found')\n return { files: [], config }\n }\n\n // Clear the output directory before writing fresh output\n if (existsSync(outputPath)) {\n rmSync(outputPath, { recursive: true, force: true })\n }\n\n const renderer = await createRenderer({ markdown: config.markdown })\n const outputFiles: string[] = []\n\n try {\n for (const templatePath of templateFiles) {\n const absolutePath = resolve(templatePath)\n let template = readFileSync(absolutePath, 'utf-8')\n\n template = await events.fireBeforeRender({ config, template })\n\n const rendered = await renderer.render(absolutePath, config)\n\n let html = await events.fireAfterRender({ config, template, html: rendered.html })\n\n // Use the per-template merged config (from defineConfig() in the SFC) so that\n // template-level overrides like css.safe: false are respected by transformers.\n const templateConfig = rendered.templateConfig\n\n if (templateConfig.useTransformers !== false) {\n html = await runTransformers(html, templateConfig, absolutePath)\n }\n\n html = await events.fireAfterTransform({ config, template, html })\n
|
|
1
|
+
{"version":3,"file":"build.mjs","names":[],"sources":["../src/build.ts"],"sourcesContent":["import { readFileSync, writeFileSync, mkdirSync, cpSync, existsSync, rmSync } from 'node:fs'\nimport { resolve, dirname, basename, relative, join } from 'node:path'\nimport { glob } from 'tinyglobby'\nimport ora from 'ora'\nimport { resolveConfig } from './config/index.ts'\nimport { EventManager } from './events/index.ts'\nimport { runTransformers } from './transformers/index.ts'\nimport { createRenderer } from './render/createRenderer.ts'\nimport { createPlaintext } from './plaintext.ts'\nimport type { MaizzleConfig } from './types/index.ts'\n\nexport interface BuildOptions {\n config?: Partial<MaizzleConfig> | string\n}\n\nexport interface BuildResult {\n files: string[]\n config: MaizzleConfig\n}\n\n/**\n * Build all SFC email templates to HTML files.\n *\n * Creates a single Renderer instance, then loops through each template\n * calling render → transformers → write to disk.\n */\nexport async function build(options: BuildOptions = {}): Promise<BuildResult> {\n const start = Date.now()\n const spinner = ora('Building templates...').start()\n\n const config = await resolveConfig(options.config)\n\n const events = new EventManager()\n events.registerConfig(config)\n await events.fireBeforeCreate({ config })\n\n const outputPath = resolve(config.output?.path ?? 'dist')\n const outputExtension = config.output?.extension ?? 'html'\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const contentBase = computeContentBase(contentPatterns)\n const templateFiles = await glob(contentPatterns)\n\n if (templateFiles.length === 0) {\n spinner.succeed('No templates found')\n return { files: [], config }\n }\n\n // Clear the output directory before writing fresh output\n if (existsSync(outputPath)) {\n rmSync(outputPath, { recursive: true, force: true })\n }\n\n const renderer = await createRenderer({ markdown: config.markdown, root: config.root, componentDirs: [config.components?.source ?? []].flat(), vite: config.vite })\n const outputFiles: string[] = []\n\n try {\n for (const templatePath of templateFiles) {\n const absolutePath = resolve(templatePath)\n let template = readFileSync(absolutePath, 'utf-8')\n\n template = await events.fireBeforeRender({ config, template })\n\n const rendered = await renderer.render(absolutePath, config)\n\n let html = await events.fireAfterRender({ config, template, html: rendered.html })\n\n // Use the per-template merged config (from defineConfig() in the SFC) so that\n // template-level overrides like css.safe: false are respected by transformers.\n const templateConfig = rendered.templateConfig\n\n const doctype = rendered.doctype ?? templateConfig.doctype ?? '<!DOCTYPE html>'\n\n if (templateConfig.useTransformers !== false) {\n html = await runTransformers(html, templateConfig, absolutePath, doctype)\n }\n\n html = await events.fireAfterTransform({ config, template, html })\n html = `${doctype}\\n${html}`\n\n const outputFilePath = resolveOutputPath(templatePath, outputPath, outputExtension, contentBase)\n mkdirSync(dirname(outputFilePath), { recursive: true })\n writeFileSync(outputFilePath, html)\n outputFiles.push(outputFilePath)\n\n // Generate plaintext version if configured\n const globalPlaintext = templateConfig.plaintext\n const sfcPlaintext = rendered.plaintext\n\n if (globalPlaintext || sfcPlaintext) {\n const stripOptions = typeof globalPlaintext === 'object' ? globalPlaintext : {}\n const plaintext = createPlaintext(html, stripOptions)\n const ptExtension = sfcPlaintext?.extension ?? 'txt'\n\n let ptOutputPath: string\n\n if (sfcPlaintext?.destination) {\n const name = basename(templatePath).replace(/\\.(vue|md)$/, '')\n ptOutputPath = join(resolve(sfcPlaintext.destination), `${name}.${ptExtension}`)\n } else if (typeof globalPlaintext === 'string') {\n ptOutputPath = resolveOutputPath(templatePath, resolve(globalPlaintext), ptExtension, contentBase)\n } else {\n ptOutputPath = resolveOutputPath(templatePath, outputPath, ptExtension, contentBase)\n }\n\n mkdirSync(dirname(ptOutputPath), { recursive: true })\n writeFileSync(ptOutputPath, plaintext)\n }\n\n // Register SFC event handlers that were collected during render\n for (const { name, handler } of rendered.sfcEventHandlers) {\n events.on(name, handler)\n }\n\n events.clearSfcHandlers()\n }\n\n await copyStatic(config, outputPath)\n await events.fireAfterBuild({ files: outputFiles, config })\n } finally {\n await renderer.close()\n }\n\n const duration = ((Date.now() - start) / 1000).toFixed(2)\n const count = outputFiles.length\n spinner.stopAndPersist({\n symbol: '✅',\n text: `Built ${count} template${count !== 1 ? 's' : ''} in ${duration}s`,\n })\n\n return { files: outputFiles, config }\n}\n\n/**\n * Extract the static (non-glob) prefix from content patterns.\n *\n * For example, `['/abs/path/emails/**\\/*.vue']` → `'/abs/path/emails'`\n *\n * This is used to strip the content base from template paths\n * so the output preserves only the subdirectory structure.\n */\nfunction computeContentBase(patterns: string[]): string {\n // Use the first non-negated pattern\n const pattern = patterns.find(p => !p.startsWith('!')) ?? patterns[0]\n\n // Split on first glob character (* { ? [) and take the directory part\n const staticPart = pattern.split(/[*{?[]/)[0]\n\n // Ensure we have a clean directory path (not a partial segment)\n return resolve(staticPart.endsWith('/') ? staticPart : dirname(staticPart))\n}\n\nfunction resolveOutputPath(templatePath: string, outputDir: string, extension: string, contentBase: string): string {\n const name = basename(templatePath).replace(/\\.(vue|md)$/, '')\n const absTemplate = resolve(templatePath)\n const rel = relative(contentBase, dirname(absTemplate))\n\n return join(outputDir, rel, `${name}.${extension}`)\n}\n\nasync function copyStatic(config: MaizzleConfig, outputPath: string): Promise<void> {\n const sources = config.static?.source ?? ['public/**/*.*']\n const destination = config.static?.destination ?? 'public'\n\n const files = await glob(sources)\n\n for (const file of files) {\n const destPath = join(outputPath, destination, relative(dirname(sources[0]).replace(/\\*.*$/, ''), file))\n const destDir = dirname(destPath)\n\n if (!existsSync(destDir)) {\n mkdirSync(destDir, { recursive: true })\n }\n\n cpSync(file, destPath)\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { createStaticVNode, inject, useAttrs, useSlots } from 'vue'
|
|
3
|
+
import type { PropType } from 'vue'
|
|
4
|
+
|
|
5
|
+
defineOptions({ inheritAttrs: false })
|
|
6
|
+
|
|
7
|
+
const attrs = useAttrs()
|
|
8
|
+
const slots = useSlots()
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
/**
|
|
12
|
+
* Language code for the `xml:lang` attribute on `<body>`.
|
|
13
|
+
*
|
|
14
|
+
* Inherited from the parent `Html` component's `lang` prop by default.
|
|
15
|
+
*
|
|
16
|
+
* @example 'fr'
|
|
17
|
+
*/
|
|
18
|
+
xmlLang: {
|
|
19
|
+
type: String as PropType<
|
|
20
|
+
| 'af' | 'ar' | 'az'
|
|
21
|
+
| 'be' | 'bg' | 'bs'
|
|
22
|
+
| 'ca' | 'cs' | 'cy'
|
|
23
|
+
| 'da' | 'de' | 'dv'
|
|
24
|
+
| 'el' | 'en' | 'es' | 'et' | 'eu'
|
|
25
|
+
| 'fa' | 'fi' | 'fo' | 'fr'
|
|
26
|
+
| 'gl' | 'gu'
|
|
27
|
+
| 'he' | 'hi' | 'hr' | 'hu' | 'hy'
|
|
28
|
+
| 'id' | 'is' | 'it'
|
|
29
|
+
| 'ja'
|
|
30
|
+
| 'ka' | 'kk' | 'kn' | 'ko' | 'ky'
|
|
31
|
+
| 'lt' | 'lv'
|
|
32
|
+
| 'mk' | 'mn' | 'mr' | 'ms' | 'mt'
|
|
33
|
+
| 'nb' | 'nl' | 'nn' | 'no'
|
|
34
|
+
| 'pa' | 'pl' | 'pt'
|
|
35
|
+
| 'ro' | 'ru'
|
|
36
|
+
| 'sa' | 'se' | 'sk' | 'sl' | 'sq' | 'sr' | 'sv' | 'sw'
|
|
37
|
+
| 'ta' | 'te' | 'th' | 'tr' | 'tt'
|
|
38
|
+
| 'uk' | 'ur' | 'uz'
|
|
39
|
+
| 'vi'
|
|
40
|
+
| 'zh'
|
|
41
|
+
| (string & {})
|
|
42
|
+
>,
|
|
43
|
+
default: undefined
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* Text direction of the body.
|
|
47
|
+
*
|
|
48
|
+
* - `ltr` — left to right (default)
|
|
49
|
+
* - `rtl` — right to left
|
|
50
|
+
*
|
|
51
|
+
* @default 'ltr'
|
|
52
|
+
*/
|
|
53
|
+
dir: {
|
|
54
|
+
type: String as PropType<'ltr' | 'rtl'>,
|
|
55
|
+
default: 'ltr'
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* Accessible label for the email article wrapper.
|
|
59
|
+
*
|
|
60
|
+
* Used as the `aria-label` on the inner `<div role="article">`.
|
|
61
|
+
* Helps screen readers identify the email content.
|
|
62
|
+
*
|
|
63
|
+
* @example 'Order confirmation'
|
|
64
|
+
*/
|
|
65
|
+
ariaLabel: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: undefined
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
const htmlLang = inject<string>('htmlLang', 'en')
|
|
72
|
+
|
|
73
|
+
const render = () => {
|
|
74
|
+
const extraAttrs = Object.entries(attrs)
|
|
75
|
+
.map(([key, value]) => value === true ? key : `${key}="${value}"`)
|
|
76
|
+
.join(' ')
|
|
77
|
+
|
|
78
|
+
const lang = props.xmlLang ?? htmlLang
|
|
79
|
+
|
|
80
|
+
const parts = [
|
|
81
|
+
`xml:lang="${lang}"`,
|
|
82
|
+
`dir="${props.dir}"`,
|
|
83
|
+
'style="margin: 0; padding: 0; width: 100%; word-break: break-word;"',
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
if (extraAttrs) {
|
|
87
|
+
parts.push(extraAttrs)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const articleParts = [
|
|
91
|
+
'role="article"',
|
|
92
|
+
'aria-roledescription="email"',
|
|
93
|
+
props.ariaLabel ? `aria-label="${props.ariaLabel}"` : '',
|
|
94
|
+
`lang="${lang}"`,
|
|
95
|
+
`dir="${props.dir}"`,
|
|
96
|
+
'style="font-size: medium; font-size: max(16px, 1rem)"',
|
|
97
|
+
].filter(Boolean).join(' ')
|
|
98
|
+
|
|
99
|
+
return [
|
|
100
|
+
createStaticVNode(`<body ${parts.join(' ')}>`, 1),
|
|
101
|
+
createStaticVNode(`<div ${articleParts}>`, 1),
|
|
102
|
+
slots.default?.(),
|
|
103
|
+
createStaticVNode('</div>', 1),
|
|
104
|
+
createStaticVNode('</body>', 1),
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<template>
|
|
110
|
+
<render />
|
|
111
|
+
</template>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, useAttrs } from 'vue'
|
|
3
|
+
import type { PropType } from 'vue'
|
|
3
4
|
import { twMerge } from 'tailwind-merge'
|
|
4
5
|
import Outlook from './Outlook.vue'
|
|
5
6
|
|
|
@@ -9,43 +10,96 @@ const attrs = useAttrs()
|
|
|
9
10
|
|
|
10
11
|
const props = defineProps({
|
|
11
12
|
/** The URL the button links to. */
|
|
12
|
-
href:
|
|
13
|
-
type: {
|
|
13
|
+
href: {
|
|
14
14
|
type: String,
|
|
15
|
-
|
|
15
|
+
required: true
|
|
16
16
|
},
|
|
17
|
+
/**
|
|
18
|
+
* The button style variant.
|
|
19
|
+
* - `solid` — filled background (default)
|
|
20
|
+
* - `outline` — transparent background with a border
|
|
21
|
+
* - `ghost` — transparent background, no border
|
|
22
|
+
* - `link` — plain anchor with no button chrome
|
|
23
|
+
* @default 'solid'
|
|
24
|
+
*/
|
|
25
|
+
variant: {
|
|
26
|
+
type: String as PropType<'solid' | 'outline' | 'ghost' | 'link'>,
|
|
27
|
+
default: 'solid' as const
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* Horizontal alignment of the button wrapper.
|
|
31
|
+
* Accepts `'left'`, `'center'`, or `'right'`.
|
|
32
|
+
* @default null
|
|
33
|
+
*/
|
|
17
34
|
align: {
|
|
18
|
-
type: String
|
|
35
|
+
type: String as PropType<'left' | 'center' | 'right' | null>,
|
|
19
36
|
default: null
|
|
20
37
|
},
|
|
38
|
+
/**
|
|
39
|
+
* Background color for `solid` and `outline` variants.
|
|
40
|
+
* Also used as the text color for `outline` and `ghost` variants when `color` is not set.
|
|
41
|
+
* @default '#4338ca'
|
|
42
|
+
*/
|
|
21
43
|
bgColor: {
|
|
22
44
|
type: String,
|
|
23
45
|
default: '#4338ca'
|
|
24
46
|
},
|
|
47
|
+
/**
|
|
48
|
+
* Explicit text color. When omitted, `solid` buttons use `#fffffe`
|
|
49
|
+
* and all other variants fall back to `bgColor`.
|
|
50
|
+
* @default null
|
|
51
|
+
*/
|
|
25
52
|
color: {
|
|
26
53
|
type: String,
|
|
27
54
|
default: null
|
|
28
55
|
},
|
|
56
|
+
/**
|
|
57
|
+
* `mso-text-raise` value applied to the inner `<span>` elements.
|
|
58
|
+
* Controls vertical text alignment inside the button in old Outlook.
|
|
59
|
+
* @default '16px'
|
|
60
|
+
*/
|
|
29
61
|
msoPt: {
|
|
30
62
|
type: String,
|
|
31
63
|
default: '16px'
|
|
32
64
|
},
|
|
65
|
+
/**
|
|
66
|
+
* `mso-text-raise` value applied to the spacer `<i>` element rendered for Outlook.
|
|
67
|
+
* Adjusts the bottom spacing that old Outlook uses to simulate padding.
|
|
68
|
+
* @default '31px'
|
|
69
|
+
*/
|
|
33
70
|
msoPb: {
|
|
34
71
|
type: String,
|
|
35
72
|
default: '31px'
|
|
36
73
|
},
|
|
74
|
+
/**
|
|
75
|
+
* URL or path to an icon image displayed alongside the button label.
|
|
76
|
+
* @default null
|
|
77
|
+
*/
|
|
37
78
|
icon: {
|
|
38
79
|
type: String,
|
|
39
80
|
default: null
|
|
40
81
|
},
|
|
82
|
+
/**
|
|
83
|
+
* Width of the icon image in pixels.
|
|
84
|
+
* @default 12
|
|
85
|
+
*/
|
|
41
86
|
iconWidth: {
|
|
42
87
|
type: [String, Number],
|
|
43
88
|
default: 12
|
|
44
89
|
},
|
|
90
|
+
/**
|
|
91
|
+
* Side on which the icon is placed relative to the button label.
|
|
92
|
+
* Accepts `'left'` or `'right'`.
|
|
93
|
+
* @default 'right'
|
|
94
|
+
*/
|
|
45
95
|
iconPosition: {
|
|
46
|
-
type: String
|
|
47
|
-
default: 'right'
|
|
96
|
+
type: String as PropType<'left' | 'right'>,
|
|
97
|
+
default: 'right' as const
|
|
48
98
|
},
|
|
99
|
+
/**
|
|
100
|
+
* Additional CSS classes applied to the icon `<img>` element.
|
|
101
|
+
* @default ''
|
|
102
|
+
*/
|
|
49
103
|
iconClass: {
|
|
50
104
|
type: String,
|
|
51
105
|
default: ''
|
|
@@ -54,20 +108,20 @@ const props = defineProps({
|
|
|
54
108
|
|
|
55
109
|
const parsedIconWidth = computed(() => parseInt(String(props.iconWidth), 10))
|
|
56
110
|
|
|
57
|
-
const alignClass = computed(() => ({
|
|
111
|
+
const alignClass = computed(() => props.align ? ({
|
|
58
112
|
left: 'text-left',
|
|
59
113
|
center: 'text-center',
|
|
60
114
|
right: 'text-right',
|
|
61
|
-
})[props.align] || '')
|
|
115
|
+
})[props.align] || '' : '')
|
|
62
116
|
|
|
63
117
|
const textColor = computed(() => {
|
|
64
118
|
if (props.color) return props.color
|
|
65
119
|
|
|
66
|
-
return props.
|
|
120
|
+
return props.variant === 'solid' ? '#fffffe' : props.bgColor
|
|
67
121
|
})
|
|
68
122
|
|
|
69
123
|
const styles = computed(() => {
|
|
70
|
-
if (props.
|
|
124
|
+
if (props.variant === 'link') {
|
|
71
125
|
return [
|
|
72
126
|
'text-decoration: none;',
|
|
73
127
|
`color: ${textColor.value};`,
|
|
@@ -84,12 +138,12 @@ const styles = computed(() => {
|
|
|
84
138
|
`color: ${textColor.value};`,
|
|
85
139
|
]
|
|
86
140
|
|
|
87
|
-
if (props.
|
|
141
|
+
if (props.variant === 'outline') {
|
|
88
142
|
base.push(
|
|
89
143
|
'background-color: transparent;',
|
|
90
144
|
`border: 1px solid ${props.bgColor};`,
|
|
91
145
|
)
|
|
92
|
-
} else if (props.
|
|
146
|
+
} else if (props.variant === 'ghost') {
|
|
93
147
|
base.push('background-color: transparent;')
|
|
94
148
|
} else {
|
|
95
149
|
base.push(`background-color: ${props.bgColor};`)
|
|
@@ -98,10 +152,10 @@ const styles = computed(() => {
|
|
|
98
152
|
return base.join('')
|
|
99
153
|
})
|
|
100
154
|
|
|
101
|
-
const isLink = computed(() => props.
|
|
155
|
+
const isLink = computed(() => props.variant === 'link')
|
|
102
156
|
|
|
103
157
|
const defaultClasses = computed(() => {
|
|
104
|
-
if (props.
|
|
158
|
+
if (props.variant === 'ghost') return 'hover:bg-indigo-50'
|
|
105
159
|
return ''
|
|
106
160
|
})
|
|
107
161
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createStaticVNode, type PropType } from 'vue'
|
|
3
|
+
import { codeToHtml, getSingletonHighlighter, type BundledLanguage, type BundledTheme } from 'shiki'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
props: {
|
|
7
|
+
/** The code to highlight. */
|
|
8
|
+
code: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: ''
|
|
11
|
+
},
|
|
12
|
+
/** The language for syntax highlighting. @default 'html' */
|
|
13
|
+
language: {
|
|
14
|
+
type: String as PropType<BundledLanguage>,
|
|
15
|
+
default: 'html'
|
|
16
|
+
},
|
|
17
|
+
/** The shiki theme to use. @default 'github-light' */
|
|
18
|
+
theme: {
|
|
19
|
+
type: String as PropType<BundledTheme>,
|
|
20
|
+
default: 'github-light'
|
|
21
|
+
},
|
|
22
|
+
/** CSS class for the wrapping table cell. @default 'max-w-0 mso-padding-alt-4' */
|
|
23
|
+
tdClass: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: 'max-w-0 mso-padding-alt-4'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
inheritAttrs: false,
|
|
29
|
+
async setup(props, { slots, attrs }) {
|
|
30
|
+
// Prefer code prop → slot text
|
|
31
|
+
let source = props.code
|
|
32
|
+
|
|
33
|
+
if (!source) {
|
|
34
|
+
const slotContent = slots.default?.()
|
|
35
|
+
source = slotContent
|
|
36
|
+
?.map((vnode: any) => (typeof vnode.children === 'string' ? vnode.children : ''))
|
|
37
|
+
.join('') ?? ''
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
source = source.trim()
|
|
41
|
+
|
|
42
|
+
if (!source) {
|
|
43
|
+
return () => createStaticVNode('', 0)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const highlighted = await codeToHtml(source, {
|
|
47
|
+
lang: props.language,
|
|
48
|
+
theme: props.theme,
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const hl = await getSingletonHighlighter({ themes: [props.theme], langs: [] })
|
|
52
|
+
const bg = hl.getTheme(props.theme).bg
|
|
53
|
+
|
|
54
|
+
// Shiki outputs <pre><code>...</code></pre>, extract the inner content
|
|
55
|
+
const codeContent = highlighted
|
|
56
|
+
.replace(/^<pre[^>]*><code>/, '')
|
|
57
|
+
.replace(/<\/code><\/pre>$/, '')
|
|
58
|
+
|
|
59
|
+
const classes = ['font-mono', attrs.class].filter(Boolean).join(' ')
|
|
60
|
+
const baseStyles = `background-color:${bg};padding:16px;overflow:auto;white-space:pre;word-wrap:normal;word-break:normal;word-spacing:normal`
|
|
61
|
+
const styles = [baseStyles, attrs.style].filter(Boolean).join(';')
|
|
62
|
+
|
|
63
|
+
const html = `<table class="w-full"><tr><td class="${props.tdClass}"><pre class="${classes}" style="${styles}"><code>${codeContent}</code></pre></td></tr></table>`
|
|
64
|
+
|
|
65
|
+
return () => createStaticVNode(html, 1)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</script>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createStaticVNode } from 'vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
inheritAttrs: false,
|
|
6
|
+
props: {
|
|
7
|
+
/**
|
|
8
|
+
* The inline code text to render.
|
|
9
|
+
*
|
|
10
|
+
* If not provided, the slot content is used instead.
|
|
11
|
+
* The text is HTML-escaped automatically.
|
|
12
|
+
*/
|
|
13
|
+
code: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ''
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(props, { slots, attrs }) {
|
|
19
|
+
let source = props.code
|
|
20
|
+
|
|
21
|
+
if (!source) {
|
|
22
|
+
const slotContent = slots.default?.()
|
|
23
|
+
source = slotContent
|
|
24
|
+
?.map((vnode: any) => (typeof vnode.children === 'string' ? vnode.children : ''))
|
|
25
|
+
.join('') ?? ''
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
source = source.trim()
|
|
29
|
+
|
|
30
|
+
if (!source) {
|
|
31
|
+
return () => createStaticVNode('', 0)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const classes = attrs.class ? ` class="${attrs.class}"` : ''
|
|
35
|
+
const baseStyles = 'white-space:normal;border-radius:6px;border:1px solid #d1d5db;background-color:#f3f4f6;padding:2px 6px;font-size:11px;color:inherit'
|
|
36
|
+
const styles = [baseStyles, attrs.style].filter(Boolean).join(';')
|
|
37
|
+
|
|
38
|
+
const escaped = source
|
|
39
|
+
.replace(/&/g, '&')
|
|
40
|
+
.replace(/</g, '<')
|
|
41
|
+
.replace(/>/g, '>')
|
|
42
|
+
.replace(/"/g, '"')
|
|
43
|
+
|
|
44
|
+
const html = `<code${classes} style="${styles}">${escaped}</code>`
|
|
45
|
+
|
|
46
|
+
return () => createStaticVNode(html, 1)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, createStaticVNode, inject, provide, useAttrs } from 'vue'
|
|
3
|
+
import type { ComputedRef } from 'vue'
|
|
4
|
+
import { normalizeToPixels } from './utils.ts'
|
|
5
|
+
|
|
6
|
+
defineOptions({ inheritAttrs: false })
|
|
7
|
+
|
|
8
|
+
const attrs = useAttrs()
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
/**
|
|
12
|
+
* Override the auto-computed column width.
|
|
13
|
+
*
|
|
14
|
+
* By default, the width is calculated from the parent `Row`
|
|
15
|
+
* by dividing its width by the column count.
|
|
16
|
+
*/
|
|
17
|
+
width: {
|
|
18
|
+
type: [String, Number],
|
|
19
|
+
default: null
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* Inline CSS applied only to the MSO `<td>` element.
|
|
23
|
+
*
|
|
24
|
+
* Use for Outlook-specific styling that shouldn't affect other clients.
|
|
25
|
+
*
|
|
26
|
+
* @example 'padding: 10px'
|
|
27
|
+
*/
|
|
28
|
+
msoStyle: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: undefined
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const injectedMinWidth = inject<ComputedRef<string> | null>('columnMinWidth', null)
|
|
35
|
+
const containerWidth = inject<ComputedRef<string | number> | null>('containerWidth', null)
|
|
36
|
+
const injectedMsoWidth = inject<ComputedRef<string> | null>('columnMsoWidth', null)
|
|
37
|
+
|
|
38
|
+
const minWidth = computed(() => {
|
|
39
|
+
if (props.width) return normalizeToPixels(props.width)
|
|
40
|
+
if (injectedMinWidth?.value) return injectedMinWidth.value
|
|
41
|
+
|
|
42
|
+
// Fallback: divide container width by 2 if available
|
|
43
|
+
if (containerWidth?.value) {
|
|
44
|
+
const val = containerWidth.value
|
|
45
|
+
if (typeof val === 'number') return `${parseFloat((val / 2).toFixed(2))}px`
|
|
46
|
+
const num = Number.parseFloat(val)
|
|
47
|
+
const unit = val.replace(String(num), '') || 'px'
|
|
48
|
+
return `${parseFloat((num / 2).toFixed(2))}${unit}`
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return '18.75em'
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const msoWidth = computed(() => injectedMsoWidth?.value ?? '50%')
|
|
55
|
+
|
|
56
|
+
// Provide column width as containerWidth for nested Rows
|
|
57
|
+
provide('containerWidth', minWidth)
|
|
58
|
+
|
|
59
|
+
const styles = computed(() => {
|
|
60
|
+
return `display: inline-block; min-width: ${minWidth.value}; font-size: 16px; vertical-align: top;`
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
const tdStyle = computed(() => {
|
|
64
|
+
const parts = ['vertical-align: top']
|
|
65
|
+
if (props.msoStyle) parts.push(props.msoStyle)
|
|
66
|
+
return parts.join('; ')
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const MsoBefore = () => createStaticVNode(
|
|
70
|
+
`<!--[if mso]><td width="${msoWidth.value}" style="${tdStyle.value}"><![endif]-->`,
|
|
71
|
+
1
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
const MsoAfter = () => createStaticVNode(
|
|
75
|
+
'<!--[if mso]></td><![endif]-->',
|
|
76
|
+
1
|
|
77
|
+
)
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<template>
|
|
81
|
+
<MsoBefore />
|
|
82
|
+
<div v-bind="attrs" :style="styles">
|
|
83
|
+
<slot />
|
|
84
|
+
</div>
|
|
85
|
+
<MsoAfter />
|
|
86
|
+
</template>
|