@maizzle/framework 6.0.0-8 → 6.0.0-rc.0
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 +10 -0
- package/dist/build.d.mts +19 -0
- package/dist/build.d.mts.map +1 -0
- package/dist/build.mjs +121 -0
- package/dist/build.mjs.map +1 -0
- package/dist/components/Button.vue +141 -0
- package/dist/components/Divider.vue +105 -0
- package/dist/components/NoWidows.vue +123 -0
- package/dist/components/NotOutlook.vue +17 -0
- package/dist/components/Outlook.vue +74 -0
- package/dist/components/Spacer.vue +36 -0
- package/dist/components/Vml.vue +89 -0
- package/dist/components/WithUrl.vue +190 -0
- package/dist/components/utils.d.mts +5 -0
- package/dist/components/utils.d.mts.map +1 -0
- package/dist/components/utils.mjs +9 -0
- package/dist/components/utils.mjs.map +1 -0
- package/dist/components/utils.ts +6 -0
- package/dist/composables/defineConfig.d.mts +14 -0
- package/dist/composables/defineConfig.d.mts.map +1 -0
- package/dist/composables/defineConfig.mjs +34 -0
- package/dist/composables/defineConfig.mjs.map +1 -0
- package/dist/composables/renderContext.d.mts +19 -0
- package/dist/composables/renderContext.d.mts.map +1 -0
- package/dist/composables/renderContext.mjs +6 -0
- package/dist/composables/renderContext.mjs.map +1 -0
- package/dist/composables/useConfig.d.mts +9 -0
- package/dist/composables/useConfig.d.mts.map +1 -0
- package/dist/composables/useConfig.mjs +13 -0
- package/dist/composables/useConfig.mjs.map +1 -0
- package/dist/composables/useDoctype.d.mts +13 -0
- package/dist/composables/useDoctype.d.mts.map +1 -0
- package/dist/composables/useDoctype.mjs +20 -0
- package/dist/composables/useDoctype.mjs.map +1 -0
- package/dist/composables/useEvent.d.mts +17 -0
- package/dist/composables/useEvent.d.mts.map +1 -0
- package/dist/composables/useEvent.mjs +25 -0
- package/dist/composables/useEvent.mjs.map +1 -0
- package/dist/composables/usePlaintext.d.mts +19 -0
- package/dist/composables/usePlaintext.d.mts.map +1 -0
- package/dist/composables/usePlaintext.mjs +22 -0
- package/dist/composables/usePlaintext.mjs.map +1 -0
- package/dist/config/defaults.d.mts +6 -0
- package/dist/config/defaults.d.mts.map +1 -0
- package/dist/config/defaults.mjs +28 -0
- package/dist/config/defaults.mjs.map +1 -0
- package/dist/config/index.d.mts +15 -0
- package/dist/config/index.d.mts.map +1 -0
- package/dist/config/index.mjs +47 -0
- package/dist/config/index.mjs.map +1 -0
- package/dist/events/index.d.mts +91 -0
- package/dist/events/index.d.mts.map +1 -0
- package/dist/events/index.mjs +110 -0
- package/dist/events/index.mjs.map +1 -0
- package/dist/index.d.mts +29 -0
- package/dist/index.mjs +29 -0
- package/dist/plaintext.d.mts +5 -0
- package/dist/plaintext.d.mts.map +1 -0
- package/dist/plaintext.mjs +15 -0
- package/dist/plaintext.mjs.map +1 -0
- package/dist/plugin.d.mts +17 -0
- package/dist/plugin.d.mts.map +1 -0
- package/dist/plugin.mjs +41 -0
- package/dist/plugin.mjs.map +1 -0
- package/dist/plugins/postcss/mergeMediaQueries.d.mts +18 -0
- package/dist/plugins/postcss/mergeMediaQueries.d.mts.map +1 -0
- package/dist/plugins/postcss/mergeMediaQueries.mjs +22 -0
- package/dist/plugins/postcss/mergeMediaQueries.mjs.map +1 -0
- package/dist/plugins/postcss/pruneVars.d.mts +8 -0
- package/dist/plugins/postcss/pruneVars.d.mts.map +1 -0
- package/dist/plugins/postcss/pruneVars.mjs +49 -0
- package/dist/plugins/postcss/pruneVars.mjs.map +1 -0
- package/dist/plugins/postcss/removeDeclarations.d.mts +12 -0
- package/dist/plugins/postcss/removeDeclarations.d.mts.map +1 -0
- package/dist/plugins/postcss/removeDeclarations.mjs +45 -0
- package/dist/plugins/postcss/removeDeclarations.mjs.map +1 -0
- package/dist/plugins/postcss/tailwindCleanup.d.mts +18 -0
- package/dist/plugins/postcss/tailwindCleanup.d.mts.map +1 -0
- package/dist/plugins/postcss/tailwindCleanup.mjs +35 -0
- package/dist/plugins/postcss/tailwindCleanup.mjs.map +1 -0
- package/dist/render/createRenderer.d.mts +34 -0
- package/dist/render/createRenderer.d.mts.map +1 -0
- package/dist/render/createRenderer.mjs +149 -0
- package/dist/render/createRenderer.mjs.map +1 -0
- package/dist/render/index.d.mts +26 -0
- package/dist/render/index.d.mts.map +1 -0
- package/dist/render/index.mjs +40 -0
- package/dist/render/index.mjs.map +1 -0
- package/dist/serve.d.mts +25 -0
- package/dist/serve.d.mts.map +1 -0
- package/dist/serve.mjs +402 -0
- package/dist/serve.mjs.map +1 -0
- package/dist/server/compatibility.d.mts +6 -0
- package/dist/server/compatibility.d.mts.map +1 -0
- package/dist/server/compatibility.mjs +83 -0
- package/dist/server/compatibility.mjs.map +1 -0
- package/dist/server/linter.d.mts +6 -0
- package/dist/server/linter.d.mts.map +1 -0
- package/dist/server/linter.mjs +200 -0
- package/dist/server/linter.mjs.map +1 -0
- package/dist/server/ui/App.vue +360 -0
- package/dist/server/ui/components/ui/button/Button.vue +31 -0
- package/dist/server/ui/components/ui/button/index.ts +38 -0
- package/dist/server/ui/components/ui/command/Command.vue +87 -0
- package/dist/server/ui/components/ui/command/CommandDialog.vue +31 -0
- package/dist/server/ui/components/ui/command/CommandEmpty.vue +27 -0
- package/dist/server/ui/components/ui/command/CommandGroup.vue +45 -0
- package/dist/server/ui/components/ui/command/CommandInput.vue +39 -0
- package/dist/server/ui/components/ui/command/CommandItem.vue +76 -0
- package/dist/server/ui/components/ui/command/CommandList.vue +25 -0
- package/dist/server/ui/components/ui/command/CommandSeparator.vue +21 -0
- package/dist/server/ui/components/ui/command/CommandShortcut.vue +17 -0
- package/dist/server/ui/components/ui/command/index.ts +25 -0
- package/dist/server/ui/components/ui/dialog/Dialog.vue +19 -0
- package/dist/server/ui/components/ui/dialog/DialogClose.vue +15 -0
- package/dist/server/ui/components/ui/dialog/DialogContent.vue +53 -0
- package/dist/server/ui/components/ui/dialog/DialogDescription.vue +23 -0
- package/dist/server/ui/components/ui/dialog/DialogFooter.vue +27 -0
- package/dist/server/ui/components/ui/dialog/DialogHeader.vue +17 -0
- package/dist/server/ui/components/ui/dialog/DialogOverlay.vue +21 -0
- package/dist/server/ui/components/ui/dialog/DialogScrollContent.vue +59 -0
- package/dist/server/ui/components/ui/dialog/DialogTitle.vue +23 -0
- package/dist/server/ui/components/ui/dialog/DialogTrigger.vue +15 -0
- package/dist/server/ui/components/ui/dialog/index.ts +10 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/dist/server/ui/components/ui/dropdown-menu/index.ts +16 -0
- package/dist/server/ui/components/ui/empty/Empty.vue +20 -0
- package/dist/server/ui/components/ui/empty/EmptyContent.vue +20 -0
- package/dist/server/ui/components/ui/empty/EmptyDescription.vue +20 -0
- package/dist/server/ui/components/ui/empty/EmptyHeader.vue +20 -0
- package/dist/server/ui/components/ui/empty/EmptyMedia.vue +21 -0
- package/dist/server/ui/components/ui/empty/EmptyTitle.vue +17 -0
- package/dist/server/ui/components/ui/empty/index.ts +26 -0
- package/dist/server/ui/components/ui/input/Input.vue +33 -0
- package/dist/server/ui/components/ui/input/index.ts +1 -0
- package/dist/server/ui/components/ui/kbd/Kbd.vue +20 -0
- package/dist/server/ui/components/ui/kbd/KbdGroup.vue +17 -0
- package/dist/server/ui/components/ui/kbd/index.ts +2 -0
- package/dist/server/ui/components/ui/resizable/ResizableHandle.vue +30 -0
- package/dist/server/ui/components/ui/resizable/ResizablePanel.vue +21 -0
- package/dist/server/ui/components/ui/resizable/ResizablePanelGroup.vue +25 -0
- package/dist/server/ui/components/ui/resizable/index.ts +3 -0
- package/dist/server/ui/components/ui/scroll-area/ScrollArea.vue +33 -0
- package/dist/server/ui/components/ui/scroll-area/ScrollBar.vue +32 -0
- package/dist/server/ui/components/ui/scroll-area/index.ts +2 -0
- package/dist/server/ui/components/ui/separator/Separator.vue +29 -0
- package/dist/server/ui/components/ui/separator/index.ts +1 -0
- package/dist/server/ui/components/ui/sheet/Sheet.vue +19 -0
- package/dist/server/ui/components/ui/sheet/SheetClose.vue +15 -0
- package/dist/server/ui/components/ui/sheet/SheetContent.vue +62 -0
- package/dist/server/ui/components/ui/sheet/SheetDescription.vue +21 -0
- package/dist/server/ui/components/ui/sheet/SheetFooter.vue +16 -0
- package/dist/server/ui/components/ui/sheet/SheetHeader.vue +15 -0
- package/dist/server/ui/components/ui/sheet/SheetOverlay.vue +21 -0
- package/dist/server/ui/components/ui/sheet/SheetTitle.vue +21 -0
- package/dist/server/ui/components/ui/sheet/SheetTrigger.vue +15 -0
- package/dist/server/ui/components/ui/sheet/index.ts +8 -0
- package/dist/server/ui/components/ui/sidebar/Sidebar.vue +96 -0
- package/dist/server/ui/components/ui/sidebar/SidebarContent.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarFooter.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarGroup.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarGroupAction.vue +27 -0
- package/dist/server/ui/components/ui/sidebar/SidebarGroupContent.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarGroupLabel.vue +25 -0
- package/dist/server/ui/components/ui/sidebar/SidebarHeader.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarInput.vue +31 -0
- package/dist/server/ui/components/ui/sidebar/SidebarInset.vue +21 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenu.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuAction.vue +35 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuBadge.vue +26 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuButton.vue +48 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuButtonChild.vue +36 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuItem.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuSkeleton.vue +35 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuSub.vue +22 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuSubButton.vue +36 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarProvider.vue +82 -0
- package/dist/server/ui/components/ui/sidebar/SidebarRail.vue +33 -0
- package/dist/server/ui/components/ui/sidebar/SidebarSeparator.vue +19 -0
- package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +28 -0
- package/dist/server/ui/components/ui/sidebar/index.ts +60 -0
- package/dist/server/ui/components/ui/sidebar/utils.ts +19 -0
- package/dist/server/ui/components/ui/skeleton/Skeleton.vue +17 -0
- package/dist/server/ui/components/ui/skeleton/index.ts +1 -0
- package/dist/server/ui/components/ui/tabs/Tabs.vue +24 -0
- package/dist/server/ui/components/ui/tabs/TabsContent.vue +21 -0
- package/dist/server/ui/components/ui/tabs/TabsList.vue +24 -0
- package/dist/server/ui/components/ui/tabs/TabsTrigger.vue +26 -0
- package/dist/server/ui/components/ui/tabs/index.ts +4 -0
- package/dist/server/ui/components/ui/toggle/Toggle.vue +35 -0
- package/dist/server/ui/components/ui/toggle/index.ts +28 -0
- package/dist/server/ui/components/ui/toggle-group/ToggleGroup.vue +49 -0
- package/dist/server/ui/components/ui/toggle-group/ToggleGroupItem.vue +46 -0
- package/dist/server/ui/components/ui/toggle-group/index.ts +2 -0
- package/dist/server/ui/components/ui/tooltip/Tooltip.vue +19 -0
- package/dist/server/ui/components/ui/tooltip/TooltipContent.vue +34 -0
- package/dist/server/ui/components/ui/tooltip/TooltipProvider.vue +14 -0
- package/dist/server/ui/components/ui/tooltip/TooltipTrigger.vue +15 -0
- package/dist/server/ui/components/ui/tooltip/index.ts +4 -0
- package/dist/server/ui/favicon.svg +1 -0
- package/dist/server/ui/index.html +13 -0
- package/dist/server/ui/lib/utils.ts +7 -0
- package/dist/server/ui/logo-gradient.svg +1 -0
- package/dist/server/ui/logo.svg +1 -0
- package/dist/server/ui/main.css +129 -0
- package/dist/server/ui/main.ts +16 -0
- package/dist/server/ui/mark-gradient.svg +1 -0
- package/dist/server/ui/mark.svg +1 -0
- package/dist/server/ui/pages/Home.vue +39 -0
- package/dist/server/ui/pages/Preview.vue +609 -0
- package/dist/server/ui/stripes.svg +174 -0
- package/dist/transformers/addAttributes.d.mts +32 -0
- package/dist/transformers/addAttributes.d.mts.map +1 -0
- package/dist/transformers/addAttributes.mjs +101 -0
- package/dist/transformers/addAttributes.mjs.map +1 -0
- package/dist/transformers/attributeToStyle.d.mts +25 -0
- package/dist/transformers/attributeToStyle.d.mts.map +1 -0
- package/dist/transformers/attributeToStyle.mjs +80 -0
- package/dist/transformers/attributeToStyle.mjs.map +1 -0
- package/dist/transformers/base.d.mts +8 -0
- package/dist/transformers/base.d.mts.map +1 -0
- package/dist/transformers/base.mjs +160 -0
- package/dist/transformers/base.mjs.map +1 -0
- package/dist/transformers/entities.d.mts +8 -0
- package/dist/transformers/entities.d.mts.map +1 -0
- package/dist/transformers/entities.mjs +38 -0
- package/dist/transformers/entities.mjs.map +1 -0
- package/dist/transformers/format.d.mts +15 -0
- package/dist/transformers/format.d.mts.map +1 -0
- package/dist/transformers/format.mjs +26 -0
- package/dist/transformers/format.mjs.map +1 -0
- package/dist/transformers/index.d.mts +35 -0
- package/dist/transformers/index.d.mts.map +1 -0
- package/dist/transformers/index.mjs +73 -0
- package/dist/transformers/index.mjs.map +1 -0
- package/dist/transformers/inlineCSS.d.mts +30 -0
- package/dist/transformers/inlineCSS.d.mts.map +1 -0
- package/dist/transformers/inlineCSS.mjs +79 -0
- package/dist/transformers/inlineCSS.mjs.map +1 -0
- package/dist/transformers/inlineLink.d.mts +14 -0
- package/dist/transformers/inlineLink.d.mts.map +1 -0
- package/dist/transformers/inlineLink.mjs +76 -0
- package/dist/transformers/inlineLink.mjs.map +1 -0
- package/dist/transformers/minify.d.mts +17 -0
- package/dist/transformers/minify.d.mts.map +1 -0
- package/dist/transformers/minify.mjs +24 -0
- package/dist/transformers/minify.mjs.map +1 -0
- package/dist/transformers/purgeCSS.d.mts +23 -0
- package/dist/transformers/purgeCSS.d.mts.map +1 -0
- package/dist/transformers/purgeCSS.mjs +66 -0
- package/dist/transformers/purgeCSS.mjs.map +1 -0
- package/dist/transformers/removeAttributes.d.mts +31 -0
- package/dist/transformers/removeAttributes.d.mts.map +1 -0
- package/dist/transformers/removeAttributes.mjs +63 -0
- package/dist/transformers/removeAttributes.mjs.map +1 -0
- package/dist/transformers/replaceStrings.d.mts +16 -0
- package/dist/transformers/replaceStrings.d.mts.map +1 -0
- package/dist/transformers/replaceStrings.mjs +19 -0
- package/dist/transformers/replaceStrings.mjs.map +1 -0
- package/dist/transformers/safeClassNames.d.mts +22 -0
- package/dist/transformers/safeClassNames.d.mts.map +1 -0
- package/dist/transformers/safeClassNames.mjs +103 -0
- package/dist/transformers/safeClassNames.mjs.map +1 -0
- package/dist/transformers/shorthandCSS.d.mts +24 -0
- package/dist/transformers/shorthandCSS.d.mts.map +1 -0
- package/dist/transformers/shorthandCSS.mjs +48 -0
- package/dist/transformers/shorthandCSS.mjs.map +1 -0
- package/dist/transformers/tailwindcss.d.mts +20 -0
- package/dist/transformers/tailwindcss.d.mts.map +1 -0
- package/dist/transformers/tailwindcss.mjs +136 -0
- package/dist/transformers/tailwindcss.mjs.map +1 -0
- package/dist/transformers/urlQuery.d.mts +24 -0
- package/dist/transformers/urlQuery.d.mts.map +1 -0
- package/dist/transformers/urlQuery.mjs +65 -0
- package/dist/transformers/urlQuery.mjs.map +1 -0
- package/dist/types/config.d.mts +129 -0
- package/dist/types/config.d.mts.map +1 -0
- package/dist/types/config.mjs +1 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.mjs +1 -0
- package/dist/utils/ast/index.d.mts +4 -0
- package/dist/utils/ast/index.mjs +5 -0
- package/dist/utils/ast/parser.d.mts +7 -0
- package/dist/utils/ast/parser.d.mts.map +1 -0
- package/dist/utils/ast/parser.mjs +15 -0
- package/dist/utils/ast/parser.mjs.map +1 -0
- package/dist/utils/ast/serializer.d.mts +7 -0
- package/dist/utils/ast/serializer.d.mts.map +1 -0
- package/dist/utils/ast/serializer.mjs +13 -0
- package/dist/utils/ast/serializer.mjs.map +1 -0
- package/dist/utils/ast/walker.d.mts +7 -0
- package/dist/utils/ast/walker.d.mts.map +1 -0
- package/dist/utils/ast/walker.mjs +12 -0
- package/dist/utils/ast/walker.mjs.map +1 -0
- package/dist/utils/url.d.mts +8 -0
- package/dist/utils/url.d.mts.map +1 -0
- package/dist/utils/url.mjs +32 -0
- package/dist/utils/url.mjs.map +1 -0
- package/node_modules/@clack/core/CHANGELOG.md +257 -0
- package/node_modules/@clack/core/LICENSE +9 -0
- package/node_modules/@clack/core/README.md +22 -0
- package/node_modules/@clack/core/dist/index.cjs +15 -0
- package/node_modules/@clack/core/dist/index.cjs.map +1 -0
- package/node_modules/@clack/core/dist/index.d.cts +211 -0
- package/node_modules/@clack/core/dist/index.d.mts +211 -0
- package/node_modules/@clack/core/dist/index.d.ts +211 -0
- package/node_modules/@clack/core/dist/index.mjs +15 -0
- package/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/node_modules/@clack/core/package.json +62 -0
- package/node_modules/@clack/prompts/CHANGELOG.md +412 -0
- package/node_modules/@clack/prompts/LICENSE +9 -0
- package/node_modules/@clack/prompts/README.md +207 -0
- package/node_modules/@clack/prompts/dist/index.cjs +87 -0
- package/node_modules/@clack/prompts/dist/index.cjs.map +1 -0
- package/node_modules/@clack/prompts/dist/index.d.cts +165 -0
- package/node_modules/@clack/prompts/dist/index.d.mts +165 -0
- package/node_modules/@clack/prompts/dist/index.d.ts +165 -0
- package/node_modules/@clack/prompts/dist/index.mjs +87 -0
- package/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/node_modules/@clack/prompts/package.json +61 -0
- package/node_modules/@maizzle/cli/LICENSE +21 -0
- package/node_modules/@maizzle/cli/README.md +58 -0
- package/node_modules/@maizzle/cli/dist/commands/make/component.d.mts +4 -0
- package/node_modules/@maizzle/cli/dist/commands/make/component.mjs +31 -0
- package/node_modules/@maizzle/cli/dist/commands/make/config.d.mts +4 -0
- package/node_modules/@maizzle/cli/dist/commands/make/config.mjs +21 -0
- package/node_modules/@maizzle/cli/dist/commands/make/layout.d.mts +4 -0
- package/node_modules/@maizzle/cli/dist/commands/make/layout.mjs +31 -0
- package/node_modules/@maizzle/cli/dist/commands/make/scaffold.d.mts +5 -0
- package/node_modules/@maizzle/cli/dist/commands/make/scaffold.mjs +28 -0
- package/node_modules/@maizzle/cli/dist/commands/make/stubs/component.vue +9 -0
- package/node_modules/@maizzle/cli/dist/commands/make/stubs/config.ts +9 -0
- package/node_modules/@maizzle/cli/dist/commands/make/stubs/layout.vue +39 -0
- package/node_modules/@maizzle/cli/dist/commands/make/stubs/template.vue +8 -0
- package/node_modules/@maizzle/cli/dist/commands/make/template.d.mts +4 -0
- package/node_modules/@maizzle/cli/dist/commands/make/template.mjs +31 -0
- package/node_modules/@maizzle/cli/dist/index.d.mts +8 -0
- package/node_modules/@maizzle/cli/dist/index.mjs +42 -0
- package/node_modules/@maizzle/cli/package.json +59 -0
- package/node_modules/citty/LICENSE +36 -0
- package/node_modules/citty/README.md +134 -0
- package/node_modules/citty/dist/index.cjs +475 -0
- package/node_modules/citty/dist/index.d.cts +80 -0
- package/node_modules/citty/dist/index.d.mts +80 -0
- package/node_modules/citty/dist/index.d.ts +80 -0
- package/node_modules/citty/dist/index.mjs +463 -0
- package/node_modules/citty/package.json +49 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1149 -0
- package/node_modules/commander/esm.mjs +16 -0
- package/node_modules/commander/index.js +24 -0
- package/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/commander/lib/command.js +2662 -0
- package/node_modules/commander/lib/error.js +39 -0
- package/node_modules/commander/lib/help.js +709 -0
- package/node_modules/commander/lib/option.js +367 -0
- package/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/commander/package-support.json +16 -0
- package/node_modules/commander/package.json +82 -0
- package/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/commander/typings/index.d.ts +1045 -0
- package/node_modules/consola/LICENSE +47 -0
- package/node_modules/consola/README.md +352 -0
- package/node_modules/consola/basic.d.ts +1 -0
- package/node_modules/consola/browser.d.ts +1 -0
- package/node_modules/consola/core.d.ts +1 -0
- package/node_modules/consola/dist/basic.cjs +32 -0
- package/node_modules/consola/dist/basic.d.cts +23 -0
- package/node_modules/consola/dist/basic.d.mts +21 -0
- package/node_modules/consola/dist/basic.d.ts +23 -0
- package/node_modules/consola/dist/basic.mjs +24 -0
- package/node_modules/consola/dist/browser.cjs +84 -0
- package/node_modules/consola/dist/browser.d.cts +23 -0
- package/node_modules/consola/dist/browser.d.mts +21 -0
- package/node_modules/consola/dist/browser.d.ts +23 -0
- package/node_modules/consola/dist/browser.mjs +76 -0
- package/node_modules/consola/dist/chunks/prompt.cjs +288 -0
- package/node_modules/consola/dist/chunks/prompt.mjs +280 -0
- package/node_modules/consola/dist/core.cjs +517 -0
- package/node_modules/consola/dist/core.d.cts +459 -0
- package/node_modules/consola/dist/core.d.mts +459 -0
- package/node_modules/consola/dist/core.d.ts +459 -0
- package/node_modules/consola/dist/core.mjs +512 -0
- package/node_modules/consola/dist/index.cjs +663 -0
- package/node_modules/consola/dist/index.d.cts +24 -0
- package/node_modules/consola/dist/index.d.mts +22 -0
- package/node_modules/consola/dist/index.d.ts +24 -0
- package/node_modules/consola/dist/index.mjs +651 -0
- package/node_modules/consola/dist/shared/consola.DCGIlDNP.cjs +75 -0
- package/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/node_modules/consola/dist/shared/consola.DwRq1yyg.cjs +312 -0
- package/node_modules/consola/dist/utils.cjs +64 -0
- package/node_modules/consola/dist/utils.d.cts +286 -0
- package/node_modules/consola/dist/utils.d.mts +286 -0
- package/node_modules/consola/dist/utils.d.ts +286 -0
- package/node_modules/consola/dist/utils.mjs +54 -0
- package/node_modules/consola/lib/index.cjs +10 -0
- package/node_modules/consola/package.json +136 -0
- package/node_modules/consola/utils.d.ts +1 -0
- package/node_modules/create-maizzle/README.md +86 -0
- package/node_modules/create-maizzle/bin/create-maizzle.mjs +4 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/CHANGELOG.md +340 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/LICENSE +9 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/README.md +22 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.d.mts +349 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs +11 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/package.json +60 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/CHANGELOG.md +576 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/LICENSE +9 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/README.md +270 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.d.mts +391 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs +137 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/package.json +65 -0
- package/node_modules/create-maizzle/package.json +47 -0
- package/node_modules/create-maizzle/src/index.js +242 -0
- package/node_modules/defu/LICENSE +21 -0
- package/node_modules/defu/README.md +171 -0
- package/node_modules/defu/dist/defu.cjs +77 -0
- package/node_modules/defu/dist/defu.d.cts +31 -0
- package/node_modules/defu/dist/defu.d.mts +29 -0
- package/node_modules/defu/dist/defu.d.ts +31 -0
- package/node_modules/defu/dist/defu.mjs +69 -0
- package/node_modules/defu/lib/defu.cjs +10 -0
- package/node_modules/defu/lib/defu.d.cts +12 -0
- package/node_modules/defu/package.json +48 -0
- package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/index.js +171 -0
- package/node_modules/fast-string-truncated-width/dist/types.d.ts +22 -0
- package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/utils.js +15 -0
- package/node_modules/fast-string-truncated-width/license +21 -0
- package/node_modules/fast-string-truncated-width/package.json +35 -0
- package/node_modules/fast-string-truncated-width/readme.md +60 -0
- package/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-width/dist/index.js +14 -0
- package/node_modules/fast-string-width/license +21 -0
- package/node_modules/fast-string-width/package.json +34 -0
- package/node_modules/fast-string-width/readme.md +45 -0
- package/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/node_modules/fast-wrap-ansi/README.md +26 -0
- package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/node_modules/fast-wrap-ansi/lib/main.js +216 -0
- package/node_modules/fast-wrap-ansi/lib/main.js.map +1 -0
- package/node_modules/fast-wrap-ansi/package.json +51 -0
- package/node_modules/giget/LICENSE +184 -0
- package/node_modules/giget/README.md +248 -0
- package/node_modules/giget/dist/cli.mjs +112 -0
- package/node_modules/giget/dist/index.d.mts +49 -0
- package/node_modules/giget/dist/index.mjs +22 -0
- package/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +468 -0
- package/node_modules/giget/package.json +62 -0
- package/node_modules/node-fetch-native/LICENSE +114 -0
- package/node_modules/node-fetch-native/README.md +225 -0
- package/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +2 -0
- package/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +2 -0
- package/node_modules/node-fetch-native/dist/index.cjs +1 -0
- package/node_modules/node-fetch-native/dist/index.mjs +1 -0
- package/node_modules/node-fetch-native/dist/native.cjs +1 -0
- package/node_modules/node-fetch-native/dist/native.mjs +1 -0
- package/node_modules/node-fetch-native/dist/node.cjs +19 -0
- package/node_modules/node-fetch-native/dist/node.mjs +19 -0
- package/node_modules/node-fetch-native/dist/polyfill.cjs +1 -0
- package/node_modules/node-fetch-native/dist/polyfill.mjs +1 -0
- package/node_modules/node-fetch-native/dist/proxy-stub.cjs +1 -0
- package/node_modules/node-fetch-native/dist/proxy-stub.mjs +1 -0
- package/node_modules/node-fetch-native/dist/proxy.cjs +58 -0
- package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +1 -0
- package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +1 -0
- package/node_modules/node-fetch-native/index.d.ts +1 -0
- 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 +11 -0
- package/node_modules/node-fetch-native/lib/index.d.cts +10 -0
- package/node_modules/node-fetch-native/lib/index.d.mts +10 -0
- package/node_modules/node-fetch-native/lib/index.d.ts +10 -0
- package/node_modules/node-fetch-native/lib/native.cjs +11 -0
- package/node_modules/node-fetch-native/lib/polyfill.d.cts +1 -0
- package/node_modules/node-fetch-native/lib/polyfill.d.mts +1 -0
- package/node_modules/node-fetch-native/lib/polyfill.d.ts +1 -0
- package/node_modules/node-fetch-native/lib/proxy.d.ts +32 -0
- package/node_modules/node-fetch-native/node.d.ts +1 -0
- package/node_modules/node-fetch-native/package.json +138 -0
- package/node_modules/node-fetch-native/polyfill.d.ts +1 -0
- package/node_modules/node-fetch-native/proxy.d.ts +1 -0
- package/node_modules/nypm/LICENSE +21 -0
- package/node_modules/nypm/README.md +152 -0
- package/node_modules/nypm/dist/cli.d.mts +1 -0
- package/node_modules/nypm/dist/cli.mjs +460 -0
- package/node_modules/nypm/dist/index.d.mts +209 -0
- package/node_modules/nypm/dist/index.mjs +423 -0
- package/node_modules/nypm/node_modules/citty/LICENSE +21 -0
- package/node_modules/nypm/node_modules/citty/README.md +231 -0
- package/node_modules/nypm/node_modules/citty/dist/THIRD-PARTY-LICENSES.md +33 -0
- package/node_modules/nypm/node_modules/citty/dist/_chunks/libs/scule.mjs +70 -0
- package/node_modules/nypm/node_modules/citty/dist/index.d.mts +112 -0
- package/node_modules/nypm/node_modules/citty/dist/index.mjs +425 -0
- package/node_modules/nypm/node_modules/citty/package.json +42 -0
- package/node_modules/nypm/package.json +54 -0
- package/node_modules/pathe/LICENSE +70 -0
- package/node_modules/pathe/README.md +73 -0
- package/node_modules/pathe/dist/index.cjs +39 -0
- package/node_modules/pathe/dist/index.d.cts +47 -0
- package/node_modules/pathe/dist/index.d.mts +47 -0
- package/node_modules/pathe/dist/index.d.ts +47 -0
- package/node_modules/pathe/dist/index.mjs +19 -0
- package/node_modules/pathe/dist/shared/pathe.BSlhyZSM.cjs +266 -0
- package/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +249 -0
- package/node_modules/pathe/dist/utils.cjs +82 -0
- package/node_modules/pathe/dist/utils.d.cts +32 -0
- package/node_modules/pathe/dist/utils.d.mts +32 -0
- package/node_modules/pathe/dist/utils.d.ts +32 -0
- package/node_modules/pathe/dist/utils.mjs +77 -0
- package/node_modules/pathe/package.json +61 -0
- package/node_modules/pathe/utils.d.ts +1 -0
- package/node_modules/picocolors/LICENSE +15 -0
- package/node_modules/picocolors/README.md +21 -0
- package/node_modules/picocolors/package.json +25 -0
- package/node_modules/picocolors/picocolors.browser.js +4 -0
- package/node_modules/picocolors/picocolors.d.ts +5 -0
- package/node_modules/picocolors/picocolors.js +75 -0
- package/node_modules/picocolors/types.d.ts +51 -0
- package/node_modules/sisteransi/license +21 -0
- package/node_modules/sisteransi/package.json +34 -0
- package/node_modules/sisteransi/readme.md +113 -0
- package/node_modules/sisteransi/src/index.js +58 -0
- package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/node_modules/tinyexec/LICENSE +21 -0
- package/node_modules/tinyexec/README.md +269 -0
- package/node_modules/tinyexec/dist/LICENSES.txt +83 -0
- package/node_modules/tinyexec/dist/main.d.mts +71 -0
- package/node_modules/tinyexec/dist/main.mjs +642 -0
- package/node_modules/tinyexec/package.json +62 -0
- package/package.json +74 -74
- package/CHANGELOG.md +0 -764
- package/bin/maizzle +0 -5
- package/src/commands/build.js +0 -348
- package/src/commands/serve.js +0 -3
- package/src/generators/plaintext.js +0 -222
- package/src/generators/render.js +0 -129
- package/src/index.js +0 -49
- package/src/posthtml/defaultComponentsConfig.js +0 -19
- package/src/posthtml/defaultConfig.js +0 -14
- package/src/posthtml/index.js +0 -102
- package/src/posthtml/plugins/combineMediaQueries.js +0 -42
- package/src/posthtml/plugins/envAttributes.js +0 -32
- package/src/posthtml/plugins/envTags.js +0 -33
- package/src/posthtml/plugins/expandLinkTag.js +0 -59
- package/src/posthtml/plugins/postcss/compileCss.js +0 -129
- package/src/posthtml/plugins/removeRawStyleAttributes.js +0 -30
- package/src/server/client.js +0 -182
- package/src/server/index.js +0 -464
- package/src/server/routes/hmr.js +0 -26
- package/src/server/routes/index.js +0 -77
- package/src/server/views/404.html +0 -59
- package/src/server/views/error.html +0 -83
- package/src/server/views/index.html +0 -172
- package/src/server/websockets.js +0 -27
- package/src/transformers/addAttributes.js +0 -29
- package/src/transformers/attributeToStyle.js +0 -90
- package/src/transformers/baseUrl.js +0 -154
- package/src/transformers/core.js +0 -32
- package/src/transformers/filters/defaultFilters.js +0 -146
- package/src/transformers/filters/index.js +0 -18
- package/src/transformers/index.js +0 -259
- package/src/transformers/inline.js +0 -306
- package/src/transformers/markdown.js +0 -26
- package/src/transformers/minify.js +0 -27
- package/src/transformers/posthtmlMso.js +0 -14
- package/src/transformers/prettify.js +0 -29
- package/src/transformers/preventWidows.js +0 -37
- package/src/transformers/purge.js +0 -56
- package/src/transformers/removeAttributes.js +0 -55
- package/src/transformers/replaceStrings.js +0 -37
- package/src/transformers/safeClassNames.js +0 -29
- package/src/transformers/shorthandCss.js +0 -20
- package/src/transformers/sixHex.js +0 -30
- package/src/transformers/template.js +0 -26
- package/src/transformers/urlParameters.js +0 -20
- package/src/transformers/useAttributeSizes.js +0 -63
- package/src/utils/getConfigByFilePath.js +0 -143
- package/src/utils/node.js +0 -68
- package/src/utils/string.js +0 -186
- package/types/build.d.ts +0 -166
- package/types/config.d.ts +0 -638
- package/types/css/combineMediaQueries.d.ts +0 -90
- package/types/css/inline.d.ts +0 -218
- package/types/css/purge.d.ts +0 -125
- package/types/events.d.ts +0 -153
- package/types/index.d.ts +0 -232
- package/types/markdown.d.ts +0 -33
- package/types/minify.d.ts +0 -138
- package/types/plaintext.d.ts +0 -56
- package/types/posthtml.d.ts +0 -162
- package/types/render.d.ts +0 -13
- package/types/urlParameters.d.ts +0 -40
- package/types/widowWords.d.ts +0 -38
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { computed, createStaticVNode } from 'vue'
|
|
3
|
+
import { normalizeToPixels } from './utils.ts'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'Vml',
|
|
7
|
+
props: {
|
|
8
|
+
width: {
|
|
9
|
+
type: [String, Number],
|
|
10
|
+
default: '600px'
|
|
11
|
+
},
|
|
12
|
+
height: {
|
|
13
|
+
type: [String, Number],
|
|
14
|
+
default: null
|
|
15
|
+
},
|
|
16
|
+
type: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'frame'
|
|
19
|
+
},
|
|
20
|
+
sizes: String,
|
|
21
|
+
origin: String,
|
|
22
|
+
position: String,
|
|
23
|
+
aspect: String,
|
|
24
|
+
color: String,
|
|
25
|
+
inset: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: '0,0,0,0'
|
|
28
|
+
},
|
|
29
|
+
stroke: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'f'
|
|
32
|
+
},
|
|
33
|
+
strokecolor: String,
|
|
34
|
+
fill: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: 't'
|
|
37
|
+
},
|
|
38
|
+
fillcolor: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: 'none'
|
|
41
|
+
},
|
|
42
|
+
src: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: 'https://via.placeholder.com/600x400'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
setup(props, { slots }) {
|
|
48
|
+
const before = computed(() => {
|
|
49
|
+
const width = normalizeToPixels(props.width)
|
|
50
|
+
|
|
51
|
+
const rectAttrs = [
|
|
52
|
+
`fill="${props.fillcolor ? 't' : props.fill}"`,
|
|
53
|
+
`stroke="${props.strokecolor ? 't' : props.stroke}"`,
|
|
54
|
+
`style="width: ${width};${props.height ? ` height: ${normalizeToPixels(props.height)};` : ''}"`,
|
|
55
|
+
props.strokecolor ? `strokecolor="${props.strokecolor}"` : '',
|
|
56
|
+
props.fillcolor ? `fillcolor="${props.fillcolor}"` : ''
|
|
57
|
+
].filter(Boolean).join(' ')
|
|
58
|
+
|
|
59
|
+
const fillAttrs = [
|
|
60
|
+
`type="${props.type}"`,
|
|
61
|
+
`src="${props.src}"`,
|
|
62
|
+
props.sizes ? `sizes="${props.sizes}"` : '',
|
|
63
|
+
props.aspect ? `aspect="${props.aspect}"` : '',
|
|
64
|
+
props.origin ? `origin="${props.origin}"` : '',
|
|
65
|
+
props.position ? `position="${props.position}"` : '',
|
|
66
|
+
props.color ? `color="${props.color}"` : ''
|
|
67
|
+
].filter(Boolean).join(' ')
|
|
68
|
+
|
|
69
|
+
return [
|
|
70
|
+
`<!--[if mso]>`,
|
|
71
|
+
`<v:rect xmlns:v="urn:schemas-microsoft-com:vml" ${rectAttrs}>`,
|
|
72
|
+
`<v:fill ${fillAttrs} />`,
|
|
73
|
+
`<v:textbox inset="${props.inset}" style="mso-fit-shape-to-text: true">`,
|
|
74
|
+
`<div><![endif]-->`
|
|
75
|
+
].join('')
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
const after = computed(() => {
|
|
79
|
+
return `<!--[if mso]></div></v:textbox></v:rect><![endif]-->`
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
return () => [
|
|
83
|
+
createStaticVNode(before.value, 1),
|
|
84
|
+
slots.default?.(),
|
|
85
|
+
createStaticVNode(after.value, 1)
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</script>
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { defineComponent, h, Fragment } from 'vue'
|
|
3
|
+
import queryString from 'query-string'
|
|
4
|
+
import isUrl from 'is-url-superb'
|
|
5
|
+
|
|
6
|
+
const defaultTags: Record<string, string[]> = {
|
|
7
|
+
a: ['href'],
|
|
8
|
+
img: ['src', 'srcset'],
|
|
9
|
+
video: ['src', 'poster'],
|
|
10
|
+
source: ['src', 'srcset'],
|
|
11
|
+
link: ['href'],
|
|
12
|
+
script: ['src'],
|
|
13
|
+
object: ['data'],
|
|
14
|
+
embed: ['src'],
|
|
15
|
+
iframe: ['src'],
|
|
16
|
+
'v:image': ['src'],
|
|
17
|
+
'v:fill': ['src'],
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const urlAttributes = [...new Set(Object.values(defaultTags).flat())]
|
|
21
|
+
|
|
22
|
+
function isAbsoluteUrl(url: string): boolean {
|
|
23
|
+
if (!url) return true
|
|
24
|
+
|
|
25
|
+
return url.startsWith('//') || url.startsWith('#') || url.startsWith('?') || isUrl(url)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function processSrcset(srcset: string, baseUrl: string): string {
|
|
29
|
+
return srcset.split(',').map(entry => {
|
|
30
|
+
const parts = entry.trim().split(/\s+/)
|
|
31
|
+
|
|
32
|
+
if (parts[0] && !isAbsoluteUrl(parts[0])) {
|
|
33
|
+
parts[0] = baseUrl + parts[0]
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return parts.join(' ')
|
|
37
|
+
}).join(', ')
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// ─── Base URL helpers ────────────────────────────────────────────────────────
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Join a base URL and a relative path, normalising slashes between them so
|
|
44
|
+
* neither the user nor the template author needs to worry about trailing /
|
|
45
|
+
* on the base or leading / on the path.
|
|
46
|
+
*
|
|
47
|
+
* Examples:
|
|
48
|
+
* joinUrl('https://example.com', 'about') → 'https://example.com/about'
|
|
49
|
+
* joinUrl('https://example.com/', '/about') → 'https://example.com/about'
|
|
50
|
+
* joinUrl('https://cdn.example.com/assets', 'image.jpg') → 'https://cdn.example.com/assets/image.jpg'
|
|
51
|
+
*/
|
|
52
|
+
function joinUrl(base: string, path: string): string {
|
|
53
|
+
return base.replace(/\/+$/, '') + '/' + path.replace(/^\/+/, '')
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function applyBaseUrl(attrs: string[], props: Record<string, any> | null, baseUrl: string): Record<string, any> | null {
|
|
57
|
+
if (!props) return props
|
|
58
|
+
|
|
59
|
+
let newProps: Record<string, any> | undefined
|
|
60
|
+
|
|
61
|
+
for (const attr of attrs) {
|
|
62
|
+
const value = props[attr]
|
|
63
|
+
|
|
64
|
+
if (typeof value !== 'string' || isAbsoluteUrl(value)) continue
|
|
65
|
+
|
|
66
|
+
if (!newProps) newProps = { ...props }
|
|
67
|
+
|
|
68
|
+
newProps[attr] = attr === 'srcset'
|
|
69
|
+
? processSrcset(value, baseUrl.replace(/\/+$/, '') + '/')
|
|
70
|
+
: joinUrl(baseUrl, value)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return newProps ?? props
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// ─── Query parameter helpers ──────────────────────────────────────────────────
|
|
77
|
+
|
|
78
|
+
function applyQueryParams(attrs: string[], props: Record<string, any> | null, params: Record<string, unknown>): Record<string, any> | null {
|
|
79
|
+
if (!props) return props
|
|
80
|
+
|
|
81
|
+
let newProps: Record<string, any> | undefined
|
|
82
|
+
|
|
83
|
+
for (const attr of attrs) {
|
|
84
|
+
const value = props[attr]
|
|
85
|
+
|
|
86
|
+
if (typeof value !== 'string' || !value) continue
|
|
87
|
+
|
|
88
|
+
const updated = queryString.stringifyUrl(
|
|
89
|
+
{ url: value, query: params as queryString.StringifiableRecord },
|
|
90
|
+
{ encode: false },
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
if (updated === value) continue
|
|
94
|
+
|
|
95
|
+
if (!newProps) newProps = { ...props }
|
|
96
|
+
|
|
97
|
+
newProps[attr] = updated
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return newProps ?? props
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// ─── VNode walker ─────────────────────────────────────────────────────────────
|
|
104
|
+
|
|
105
|
+
function processVNode(vnode: any, baseUrl: string | undefined, params: Record<string, unknown> | undefined): any {
|
|
106
|
+
if (vnode == null || typeof vnode !== 'object') return vnode
|
|
107
|
+
|
|
108
|
+
if (vnode.type === Fragment) {
|
|
109
|
+
return h(
|
|
110
|
+
Fragment,
|
|
111
|
+
null,
|
|
112
|
+
Array.isArray(vnode.children)
|
|
113
|
+
? vnode.children.map((child: any) => processVNode(child, baseUrl, params))
|
|
114
|
+
: vnode.children,
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (typeof vnode.type === 'string') {
|
|
119
|
+
const attrs = defaultTags[vnode.type]
|
|
120
|
+
let newProps = vnode.props
|
|
121
|
+
|
|
122
|
+
if (attrs) {
|
|
123
|
+
if (baseUrl) newProps = applyBaseUrl(attrs, newProps, baseUrl)
|
|
124
|
+
if (params) newProps = applyQueryParams(attrs, newProps, params)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const newChildren = Array.isArray(vnode.children)
|
|
128
|
+
? vnode.children.map((child: any) => processVNode(child, baseUrl, params))
|
|
129
|
+
: vnode.children
|
|
130
|
+
|
|
131
|
+
return h(vnode.type, newProps, newChildren)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Component VNode — rewrite any URL-like props before the component renders
|
|
135
|
+
if (typeof vnode.type === 'object' || typeof vnode.type === 'function') {
|
|
136
|
+
let newProps = vnode.props
|
|
137
|
+
|
|
138
|
+
if (baseUrl) newProps = applyBaseUrl(urlAttributes, newProps, baseUrl)
|
|
139
|
+
if (params) newProps = applyQueryParams(urlAttributes, newProps, params)
|
|
140
|
+
|
|
141
|
+
return h(vnode.type, newProps, vnode.children)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return vnode
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Maizzle component that rewrites URL attributes in all child elements.
|
|
149
|
+
*
|
|
150
|
+
* - `base` — optional base URL prepended to all relative URLs
|
|
151
|
+
* - `parameters` — optional query string (e.g. `"utm_source=foo&bar=baz"`)
|
|
152
|
+
* appended to all URLs
|
|
153
|
+
*
|
|
154
|
+
* @see https://maizzle.com/docs/components/with-url
|
|
155
|
+
*/
|
|
156
|
+
export default defineComponent({
|
|
157
|
+
name: 'WithUrl',
|
|
158
|
+
|
|
159
|
+
props: {
|
|
160
|
+
/**
|
|
161
|
+
* Base URL to prepend to all relative URLs found in child elements.
|
|
162
|
+
*/
|
|
163
|
+
base: {
|
|
164
|
+
type: String,
|
|
165
|
+
default: undefined,
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Query parameters to append to all URLs found in child elements.
|
|
170
|
+
* Provide as a query string, e.g. `"utm_source=foo&bar=baz"`.
|
|
171
|
+
*/
|
|
172
|
+
parameters: {
|
|
173
|
+
type: String,
|
|
174
|
+
default: undefined,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
setup(props, { slots }) {
|
|
179
|
+
return () => {
|
|
180
|
+
const params = props.parameters
|
|
181
|
+
? queryString.parse(props.parameters, { decode: false })
|
|
182
|
+
: undefined
|
|
183
|
+
|
|
184
|
+
return (slots.default?.() ?? []).map(
|
|
185
|
+
(vnode: any) => processVNode(vnode, props.base, params),
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
})
|
|
190
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.mts","names":[],"sources":["../../src/components/utils.ts"],"mappings":";iBAAgB,iBAAA,CAAkB,KAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/components/utils.ts
|
|
2
|
+
function normalizeToPixels(value) {
|
|
3
|
+
if (typeof value === "number" || Number.isFinite(Number(value))) return `${value}px`;
|
|
4
|
+
return value;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { normalizeToPixels };
|
|
9
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":[],"sources":["../../src/components/utils.ts"],"sourcesContent":["export function normalizeToPixels(value: string | number): string {\n if (typeof value === 'number' || Number.isFinite(Number(value))) {\n return `${value}px`\n }\n return value\n}\n"],"mappings":";AAAA,SAAgB,kBAAkB,OAAgC;AAChE,KAAI,OAAO,UAAU,YAAY,OAAO,SAAS,OAAO,MAAM,CAAC,CAC7D,QAAO,GAAG,MAAM;AAElB,QAAO"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MaizzleConfig } from "../types/config.mjs";
|
|
2
|
+
//#region src/composables/defineConfig.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Define Maizzle config.
|
|
5
|
+
*
|
|
6
|
+
* Works in both contexts:
|
|
7
|
+
* - In maizzle.config.ts: typed identity function, returns the config as-is
|
|
8
|
+
* - In Vue SFC <script setup>: merges with the global config and provides
|
|
9
|
+
* the result to child components via useConfig()
|
|
10
|
+
*/
|
|
11
|
+
declare function defineConfig(data?: Partial<MaizzleConfig>): MaizzleConfig;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { defineConfig };
|
|
14
|
+
//# sourceMappingURL=defineConfig.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineConfig.d.mts","names":[],"sources":["../../src/composables/defineConfig.ts"],"mappings":";;;;;AAqBA;;;;;iBAAgB,YAAA,CAAa,IAAA,GAAM,OAAA,CAAQ,aAAA,IAAsB,aAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { MaizzleConfigKey } from "./useConfig.mjs";
|
|
2
|
+
import { RenderContextKey } from "./renderContext.mjs";
|
|
3
|
+
import { createDefu } from "defu";
|
|
4
|
+
import { getCurrentInstance, inject, provide } from "vue";
|
|
5
|
+
|
|
6
|
+
//#region src/composables/defineConfig.ts
|
|
7
|
+
const merge = createDefu((obj, key, value) => {
|
|
8
|
+
if (Array.isArray(obj[key])) {
|
|
9
|
+
obj[key] = value;
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Define Maizzle config.
|
|
15
|
+
*
|
|
16
|
+
* Works in both contexts:
|
|
17
|
+
* - In maizzle.config.ts: typed identity function, returns the config as-is
|
|
18
|
+
* - In Vue SFC <script setup>: merges with the global config and provides
|
|
19
|
+
* the result to child components via useConfig()
|
|
20
|
+
*/
|
|
21
|
+
function defineConfig(data = {}) {
|
|
22
|
+
if (getCurrentInstance()) {
|
|
23
|
+
const merged = merge(data, inject(MaizzleConfigKey, {}));
|
|
24
|
+
const ctx = inject(RenderContextKey);
|
|
25
|
+
if (ctx) ctx.sfcConfig = merged;
|
|
26
|
+
provide(MaizzleConfigKey, merged);
|
|
27
|
+
return merged;
|
|
28
|
+
}
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { defineConfig };
|
|
34
|
+
//# sourceMappingURL=defineConfig.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineConfig.mjs","names":[],"sources":["../../src/composables/defineConfig.ts"],"sourcesContent":["import { getCurrentInstance, inject, provide } from 'vue'\nimport { createDefu } from 'defu'\nimport { MaizzleConfigKey } from './useConfig.ts'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nconst merge = createDefu((obj, key, value) => {\n if (Array.isArray(obj[key])) {\n obj[key] = value\n return true\n }\n})\n\n/**\n * Define Maizzle config.\n *\n * Works in both contexts:\n * - In maizzle.config.ts: typed identity function, returns the config as-is\n * - In Vue SFC <script setup>: merges with the global config and provides\n * the result to child components via useConfig()\n */\nexport function defineConfig(data: Partial<MaizzleConfig> = {}): MaizzleConfig {\n // Inside a Vue SFC — merge with global config and provide to children\n if (getCurrentInstance()) {\n const globalConfig = inject(MaizzleConfigKey, {} as MaizzleConfig)\n const merged = merge(data, globalConfig) as MaizzleConfig\n\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.sfcConfig = merged\n\n provide(MaizzleConfigKey, merged)\n\n return merged\n }\n\n // Outside Vue (maizzle.config.ts) — just return the config\n return data as MaizzleConfig\n}\n"],"mappings":";;;;;;AAMA,MAAM,QAAQ,YAAY,KAAK,KAAK,UAAU;AAC5C,KAAI,MAAM,QAAQ,IAAI,KAAK,EAAE;AAC3B,MAAI,OAAO;AACX,SAAO;;EAET;;;;;;;;;AAUF,SAAgB,aAAa,OAA+B,EAAE,EAAiB;AAE7E,KAAI,oBAAoB,EAAE;EAExB,MAAM,SAAS,MAAM,MADA,OAAO,kBAAkB,EAAE,CAAkB,CAC1B;EAExC,MAAM,MAAM,OAAO,iBAAiB;AACpC,MAAI,IAAK,KAAI,YAAY;AAEzB,UAAQ,kBAAkB,OAAO;AAEjC,SAAO;;AAIT,QAAO"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MaizzleConfig } from "../types/config.mjs";
|
|
2
|
+
import { EventMap, EventName } from "../events/index.mjs";
|
|
3
|
+
import { UsePlaintextOptions } from "./usePlaintext.mjs";
|
|
4
|
+
import { InjectionKey } from "vue";
|
|
5
|
+
|
|
6
|
+
//#region src/composables/renderContext.d.ts
|
|
7
|
+
interface RenderContext {
|
|
8
|
+
doctype?: string;
|
|
9
|
+
sfcConfig?: MaizzleConfig;
|
|
10
|
+
sfcEventHandlers: Array<{
|
|
11
|
+
name: EventName;
|
|
12
|
+
handler: EventMap[EventName];
|
|
13
|
+
}>;
|
|
14
|
+
plaintext?: UsePlaintextOptions;
|
|
15
|
+
}
|
|
16
|
+
declare const RenderContextKey: InjectionKey<RenderContext>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { RenderContext, RenderContextKey };
|
|
19
|
+
//# sourceMappingURL=renderContext.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderContext.d.mts","names":[],"sources":["../../src/composables/renderContext.ts"],"mappings":";;;;;;UAKiB,aAAA;EACf,OAAA;EACA,SAAA,GAAY,aAAA;EACZ,gBAAA,EAAkB,KAAA;IAAQ,IAAA,EAAM,SAAA;IAAW,OAAA,EAAS,QAAA,CAAS,SAAA;EAAA;EAC7D,SAAA,GAAY,mBAAA;AAAA;AAAA,cAGD,gBAAA,EAAkB,YAAA,CAAa,aAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderContext.mjs","names":[],"sources":["../../src/composables/renderContext.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\nimport type { MaizzleConfig } from '../types/index.ts'\nimport type { EventName, EventMap } from '../events/index.ts'\nimport type { UsePlaintextOptions } from './usePlaintext.ts'\n\nexport interface RenderContext {\n doctype?: string\n sfcConfig?: MaizzleConfig\n sfcEventHandlers: Array<{ name: EventName; handler: EventMap[EventName] }>\n plaintext?: UsePlaintextOptions\n}\n\nexport const RenderContextKey: InjectionKey<RenderContext> = Symbol('RenderContext')\n"],"mappings":";AAYA,MAAa,mBAAgD,OAAO,gBAAgB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MaizzleConfig } from "../types/config.mjs";
|
|
2
|
+
import { InjectionKey } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/composables/useConfig.d.ts
|
|
5
|
+
declare const MaizzleConfigKey: InjectionKey<MaizzleConfig>;
|
|
6
|
+
declare function useConfig(): MaizzleConfig;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { MaizzleConfigKey, useConfig };
|
|
9
|
+
//# sourceMappingURL=useConfig.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConfig.d.mts","names":[],"sources":["../../src/composables/useConfig.ts"],"mappings":";;;;cAIa,gBAAA,EAAkB,YAAA,CAAa,aAAA;AAAA,iBAE5B,SAAA,CAAA,GAAa,aAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { inject } from "vue";
|
|
2
|
+
|
|
3
|
+
//#region src/composables/useConfig.ts
|
|
4
|
+
const MaizzleConfigKey = Symbol("MaizzleConfig");
|
|
5
|
+
function useConfig() {
|
|
6
|
+
const config = inject(MaizzleConfigKey);
|
|
7
|
+
if (!config) throw new Error("useConfig() requires the Maizzle plugin to provide config. Make sure you are using it inside a Maizzle template.");
|
|
8
|
+
return config;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { MaizzleConfigKey, useConfig };
|
|
13
|
+
//# sourceMappingURL=useConfig.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConfig.mjs","names":[],"sources":["../../src/composables/useConfig.ts"],"sourcesContent":["import { inject } from 'vue'\nimport type { InjectionKey } from 'vue'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nexport const MaizzleConfigKey: InjectionKey<MaizzleConfig> = Symbol('MaizzleConfig')\n\nexport function useConfig(): MaizzleConfig {\n const config = inject(MaizzleConfigKey)\n\n if (!config) {\n throw new Error('useConfig() requires the Maizzle plugin to provide config. Make sure you are using it inside a Maizzle template.')\n }\n\n return config\n}\n"],"mappings":";;;AAIA,MAAa,mBAAgD,OAAO,gBAAgB;AAEpF,SAAgB,YAA2B;CACzC,MAAM,SAAS,OAAO,iBAAiB;AAEvC,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,mHAAmH;AAGrI,QAAO"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/composables/useDoctype.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Set the doctype for the current email template.
|
|
4
|
+
*
|
|
5
|
+
* Usage in SFC <script setup>:
|
|
6
|
+
* ```ts
|
|
7
|
+
* useDoctype('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">')
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
declare function useDoctype(doctype: string): void;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { useDoctype };
|
|
13
|
+
//# sourceMappingURL=useDoctype.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDoctype.d.mts","names":[],"sources":["../../src/composables/useDoctype.ts"],"mappings":";;AAWA;;;;;;;iBAAgB,UAAA,CAAW,OAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RenderContextKey } from "./renderContext.mjs";
|
|
2
|
+
import { inject } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/composables/useDoctype.ts
|
|
5
|
+
/**
|
|
6
|
+
* Set the doctype for the current email template.
|
|
7
|
+
*
|
|
8
|
+
* Usage in SFC <script setup>:
|
|
9
|
+
* ```ts
|
|
10
|
+
* useDoctype('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">')
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
function useDoctype(doctype) {
|
|
14
|
+
const ctx = inject(RenderContextKey);
|
|
15
|
+
if (ctx) ctx.doctype = doctype;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { useDoctype };
|
|
20
|
+
//# sourceMappingURL=useDoctype.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDoctype.mjs","names":[],"sources":["../../src/composables/useDoctype.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\n\n/**\n * Set the doctype for the current email template.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useDoctype('<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">')\n * ```\n */\nexport function useDoctype(doctype: string): void {\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.doctype = doctype\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,WAAW,SAAuB;CAChD,MAAM,MAAM,OAAO,iBAAiB;AACpC,KAAI,IAAK,KAAI,UAAU"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventMap, EventName } from "../events/index.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/composables/useEvent.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Register an event handler from within an SFC's <script setup>.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```ts
|
|
9
|
+
* useEvent('beforeRender', ({ config, template }) => {
|
|
10
|
+
* return template.replace('foo', 'bar')
|
|
11
|
+
* })
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
declare function useEvent<K extends EventName>(name: K, handler: EventMap[K]): void;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { useEvent };
|
|
17
|
+
//# sourceMappingURL=useEvent.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEvent.d.mts","names":[],"sources":["../../src/composables/useEvent.ts"],"mappings":";;;;;AAcA;;;;;;;;iBAAgB,QAAA,WAAmB,SAAA,CAAA,CAAW,IAAA,EAAM,CAAA,EAAG,OAAA,EAAS,QAAA,CAAS,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RenderContextKey } from "./renderContext.mjs";
|
|
2
|
+
import { inject } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/composables/useEvent.ts
|
|
5
|
+
/**
|
|
6
|
+
* Register an event handler from within an SFC's <script setup>.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```ts
|
|
10
|
+
* useEvent('beforeRender', ({ config, template }) => {
|
|
11
|
+
* return template.replace('foo', 'bar')
|
|
12
|
+
* })
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
function useEvent(name, handler) {
|
|
16
|
+
const ctx = inject(RenderContextKey);
|
|
17
|
+
if (ctx) ctx.sfcEventHandlers.push({
|
|
18
|
+
name,
|
|
19
|
+
handler
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { useEvent };
|
|
25
|
+
//# sourceMappingURL=useEvent.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEvent.mjs","names":[],"sources":["../../src/composables/useEvent.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { EventName, EventMap } from '../events/index.ts'\n\n/**\n * Register an event handler from within an SFC's <script setup>.\n *\n * Usage:\n * ```ts\n * useEvent('beforeRender', ({ config, template }) => {\n * return template.replace('foo', 'bar')\n * })\n * ```\n */\nexport function useEvent<K extends EventName>(name: K, handler: EventMap[K]) {\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.sfcEventHandlers.push({ name, handler })\n}\n"],"mappings":";;;;;;;;;;;;;;AAcA,SAAgB,SAA8B,MAAS,SAAsB;CAC3E,MAAM,MAAM,OAAO,iBAAiB;AACpC,KAAI,IAAK,KAAI,iBAAiB,KAAK;EAAE;EAAM;EAAS,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/composables/usePlaintext.d.ts
|
|
2
|
+
interface UsePlaintextOptions {
|
|
3
|
+
extension?: string;
|
|
4
|
+
destination?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Enable plaintext generation for the current email template.
|
|
8
|
+
*
|
|
9
|
+
* Usage in SFC <script setup>:
|
|
10
|
+
* ```ts
|
|
11
|
+
* usePlaintext()
|
|
12
|
+
* usePlaintext({ extension: 'text' })
|
|
13
|
+
* usePlaintext({ destination: '/custom/path' })
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
declare function usePlaintext(options?: UsePlaintextOptions): void;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { UsePlaintextOptions, usePlaintext };
|
|
19
|
+
//# sourceMappingURL=usePlaintext.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePlaintext.d.mts","names":[],"sources":["../../src/composables/usePlaintext.ts"],"mappings":";UAGiB,mBAAA;EACf,SAAA;EACA,WAAA;AAAA;;;AAaF;;;;;;;;iBAAgB,YAAA,CAAa,OAAA,GAAU,mBAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RenderContextKey } from "./renderContext.mjs";
|
|
2
|
+
import { inject } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/composables/usePlaintext.ts
|
|
5
|
+
/**
|
|
6
|
+
* Enable plaintext generation for the current email template.
|
|
7
|
+
*
|
|
8
|
+
* Usage in SFC <script setup>:
|
|
9
|
+
* ```ts
|
|
10
|
+
* usePlaintext()
|
|
11
|
+
* usePlaintext({ extension: 'text' })
|
|
12
|
+
* usePlaintext({ destination: '/custom/path' })
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
function usePlaintext(options) {
|
|
16
|
+
const ctx = inject(RenderContextKey);
|
|
17
|
+
if (ctx) ctx.plaintext = options ?? {};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { usePlaintext };
|
|
22
|
+
//# sourceMappingURL=usePlaintext.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePlaintext.mjs","names":[],"sources":["../../src/composables/usePlaintext.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\n\nexport interface UsePlaintextOptions {\n extension?: string\n destination?: string\n}\n\n/**\n * Enable plaintext generation for the current email template.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * usePlaintext()\n * usePlaintext({ extension: 'text' })\n * usePlaintext({ destination: '/custom/path' })\n * ```\n */\nexport function usePlaintext(options?: UsePlaintextOptions): void {\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.plaintext = options ?? {}\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,SAAgB,aAAa,SAAqC;CAChE,MAAM,MAAM,OAAO,iBAAiB;AACpC,KAAI,IAAK,KAAI,YAAY,WAAW,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.mts","names":[],"sources":["../../src/config/defaults.ts"],"mappings":";;cAEa,QAAA,EAAU,aAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/config/defaults.ts
|
|
2
|
+
const defaults = {
|
|
3
|
+
content: ["emails/**/*.{vue,md}"],
|
|
4
|
+
output: {
|
|
5
|
+
path: "dist",
|
|
6
|
+
extension: "html"
|
|
7
|
+
},
|
|
8
|
+
static: {
|
|
9
|
+
source: ["public/**/*.*"],
|
|
10
|
+
destination: "public"
|
|
11
|
+
},
|
|
12
|
+
server: {
|
|
13
|
+
port: 3e3,
|
|
14
|
+
watch: []
|
|
15
|
+
},
|
|
16
|
+
css: {
|
|
17
|
+
safe: true,
|
|
18
|
+
preferUnitless: true,
|
|
19
|
+
resolveCalc: true,
|
|
20
|
+
resolveProps: true
|
|
21
|
+
},
|
|
22
|
+
html: { decodeEntities: true },
|
|
23
|
+
useTransformers: true
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { defaults };
|
|
28
|
+
//# sourceMappingURL=defaults.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.mjs","names":[],"sources":["../../src/config/defaults.ts"],"sourcesContent":["import type { MaizzleConfig } from '../types/index.ts'\n\nexport const defaults: MaizzleConfig = {\n content: ['emails/**/*.{vue,md}'],\n output: {\n path: 'dist',\n extension: 'html',\n },\n static: {\n source: ['public/**/*.*'],\n destination: 'public',\n },\n server: {\n port: 3000,\n watch: [],\n },\n css: {\n safe: true,\n preferUnitless: true,\n resolveCalc: true,\n resolveProps: true,\n },\n html: {\n decodeEntities: true,\n },\n useTransformers: true,\n}\n"],"mappings":";AAEA,MAAa,WAA0B;CACrC,SAAS,CAAC,uBAAuB;CACjC,QAAQ;EACN,MAAM;EACN,WAAW;EACZ;CACD,QAAQ;EACN,QAAQ,CAAC,gBAAgB;EACzB,aAAa;EACd;CACD,QAAQ;EACN,MAAM;EACN,OAAO,EAAE;EACV;CACD,KAAK;EACH,MAAM;EACN,gBAAgB;EAChB,aAAa;EACb,cAAc;EACf;CACD,MAAM,EACJ,gBAAgB,MACjB;CACD,iBAAiB;CAClB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MaizzleConfig } from "../types/config.mjs";
|
|
2
|
+
import { defineConfig } from "../composables/defineConfig.mjs";
|
|
3
|
+
import { defaults } from "./defaults.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/config/index.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the Maizzle config.
|
|
8
|
+
*
|
|
9
|
+
* Always loads from the config file on disk (maizzle.config.{ts,js}),
|
|
10
|
+
* then merges the programmatic config on top, then fills in defaults.
|
|
11
|
+
*/
|
|
12
|
+
declare function resolveConfig(config?: Partial<MaizzleConfig> | string, cwd?: string): Promise<MaizzleConfig>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { defaults, defineConfig, resolveConfig };
|
|
15
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/config/index.ts"],"mappings":";;;;;;;;AA8BA;;;iBAAsB,aAAA,CACpB,MAAA,GAAS,OAAA,CAAQ,aAAA,YACjB,GAAA,YACC,OAAA,CAAQ,aAAA"}
|