@maizzle/framework 6.0.0-9 → 6.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/maizzle.mjs +10 -0
- package/dist/build.d.mts +19 -0
- package/dist/build.d.mts.map +1 -0
- package/dist/build.mjs +138 -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 +64 -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 +36 -0
- package/dist/render/createRenderer.d.mts.map +1 -0
- package/dist/render/createRenderer.mjs +150 -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 +43 -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 +404 -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 +146 -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 -73
- package/CHANGELOG.md +0 -770
- 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 -125
- 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,312 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const tty = require('node:tty');
|
|
4
|
+
|
|
5
|
+
function _interopNamespaceCompat(e) {
|
|
6
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
7
|
+
const n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
for (const k in e) {
|
|
10
|
+
n[k] = e[k];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
n.default = e;
|
|
14
|
+
return n;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const tty__namespace = /*#__PURE__*/_interopNamespaceCompat(tty);
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
env = {},
|
|
21
|
+
argv = [],
|
|
22
|
+
platform = ""
|
|
23
|
+
} = typeof process === "undefined" ? {} : process;
|
|
24
|
+
const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
25
|
+
const isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
26
|
+
const isWindows = platform === "win32";
|
|
27
|
+
const isDumbTerminal = env.TERM === "dumb";
|
|
28
|
+
const isCompatibleTerminal = tty__namespace && tty__namespace.isatty && tty__namespace.isatty(1) && env.TERM && !isDumbTerminal;
|
|
29
|
+
const isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
|
|
30
|
+
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
31
|
+
function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
|
|
32
|
+
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
33
|
+
}
|
|
34
|
+
function clearBleed(index, string, open, close, replace) {
|
|
35
|
+
return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
36
|
+
}
|
|
37
|
+
function filterEmpty(open, close, replace = open, at = open.length + 1) {
|
|
38
|
+
return (string) => string || !(string === "" || string === void 0) ? clearBleed(
|
|
39
|
+
("" + string).indexOf(close, at),
|
|
40
|
+
string,
|
|
41
|
+
open,
|
|
42
|
+
close,
|
|
43
|
+
replace
|
|
44
|
+
) : "";
|
|
45
|
+
}
|
|
46
|
+
function init(open, close, replace) {
|
|
47
|
+
return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
48
|
+
}
|
|
49
|
+
const colorDefs = {
|
|
50
|
+
reset: init(0, 0),
|
|
51
|
+
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
52
|
+
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
53
|
+
italic: init(3, 23),
|
|
54
|
+
underline: init(4, 24),
|
|
55
|
+
inverse: init(7, 27),
|
|
56
|
+
hidden: init(8, 28),
|
|
57
|
+
strikethrough: init(9, 29),
|
|
58
|
+
black: init(30, 39),
|
|
59
|
+
red: init(31, 39),
|
|
60
|
+
green: init(32, 39),
|
|
61
|
+
yellow: init(33, 39),
|
|
62
|
+
blue: init(34, 39),
|
|
63
|
+
magenta: init(35, 39),
|
|
64
|
+
cyan: init(36, 39),
|
|
65
|
+
white: init(37, 39),
|
|
66
|
+
gray: init(90, 39),
|
|
67
|
+
bgBlack: init(40, 49),
|
|
68
|
+
bgRed: init(41, 49),
|
|
69
|
+
bgGreen: init(42, 49),
|
|
70
|
+
bgYellow: init(43, 49),
|
|
71
|
+
bgBlue: init(44, 49),
|
|
72
|
+
bgMagenta: init(45, 49),
|
|
73
|
+
bgCyan: init(46, 49),
|
|
74
|
+
bgWhite: init(47, 49),
|
|
75
|
+
blackBright: init(90, 39),
|
|
76
|
+
redBright: init(91, 39),
|
|
77
|
+
greenBright: init(92, 39),
|
|
78
|
+
yellowBright: init(93, 39),
|
|
79
|
+
blueBright: init(94, 39),
|
|
80
|
+
magentaBright: init(95, 39),
|
|
81
|
+
cyanBright: init(96, 39),
|
|
82
|
+
whiteBright: init(97, 39),
|
|
83
|
+
bgBlackBright: init(100, 49),
|
|
84
|
+
bgRedBright: init(101, 49),
|
|
85
|
+
bgGreenBright: init(102, 49),
|
|
86
|
+
bgYellowBright: init(103, 49),
|
|
87
|
+
bgBlueBright: init(104, 49),
|
|
88
|
+
bgMagentaBright: init(105, 49),
|
|
89
|
+
bgCyanBright: init(106, 49),
|
|
90
|
+
bgWhiteBright: init(107, 49)
|
|
91
|
+
};
|
|
92
|
+
function createColors(useColor = isColorSupported) {
|
|
93
|
+
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
94
|
+
}
|
|
95
|
+
const colors = createColors();
|
|
96
|
+
function getColor(color, fallback = "reset") {
|
|
97
|
+
return colors[color] || colors[fallback];
|
|
98
|
+
}
|
|
99
|
+
function colorize(color, text) {
|
|
100
|
+
return getColor(color)(text);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const ansiRegex = [
|
|
104
|
+
String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,
|
|
105
|
+
String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`
|
|
106
|
+
].join("|");
|
|
107
|
+
function stripAnsi(text) {
|
|
108
|
+
return text.replace(new RegExp(ansiRegex, "g"), "");
|
|
109
|
+
}
|
|
110
|
+
function centerAlign(str, len, space = " ") {
|
|
111
|
+
const free = len - str.length;
|
|
112
|
+
if (free <= 0) {
|
|
113
|
+
return str;
|
|
114
|
+
}
|
|
115
|
+
const freeLeft = Math.floor(free / 2);
|
|
116
|
+
let _str = "";
|
|
117
|
+
for (let i = 0; i < len; i++) {
|
|
118
|
+
_str += i < freeLeft || i >= freeLeft + str.length ? space : str[i - freeLeft];
|
|
119
|
+
}
|
|
120
|
+
return _str;
|
|
121
|
+
}
|
|
122
|
+
function rightAlign(str, len, space = " ") {
|
|
123
|
+
const free = len - str.length;
|
|
124
|
+
if (free <= 0) {
|
|
125
|
+
return str;
|
|
126
|
+
}
|
|
127
|
+
let _str = "";
|
|
128
|
+
for (let i = 0; i < len; i++) {
|
|
129
|
+
_str += i < free ? space : str[i - free];
|
|
130
|
+
}
|
|
131
|
+
return _str;
|
|
132
|
+
}
|
|
133
|
+
function leftAlign(str, len, space = " ") {
|
|
134
|
+
let _str = "";
|
|
135
|
+
for (let i = 0; i < len; i++) {
|
|
136
|
+
_str += i < str.length ? str[i] : space;
|
|
137
|
+
}
|
|
138
|
+
return _str;
|
|
139
|
+
}
|
|
140
|
+
function align(alignment, str, len, space = " ") {
|
|
141
|
+
switch (alignment) {
|
|
142
|
+
case "left": {
|
|
143
|
+
return leftAlign(str, len, space);
|
|
144
|
+
}
|
|
145
|
+
case "right": {
|
|
146
|
+
return rightAlign(str, len, space);
|
|
147
|
+
}
|
|
148
|
+
case "center": {
|
|
149
|
+
return centerAlign(str, len, space);
|
|
150
|
+
}
|
|
151
|
+
default: {
|
|
152
|
+
return str;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const boxStylePresets = {
|
|
158
|
+
solid: {
|
|
159
|
+
tl: "\u250C",
|
|
160
|
+
tr: "\u2510",
|
|
161
|
+
bl: "\u2514",
|
|
162
|
+
br: "\u2518",
|
|
163
|
+
h: "\u2500",
|
|
164
|
+
v: "\u2502"
|
|
165
|
+
},
|
|
166
|
+
double: {
|
|
167
|
+
tl: "\u2554",
|
|
168
|
+
tr: "\u2557",
|
|
169
|
+
bl: "\u255A",
|
|
170
|
+
br: "\u255D",
|
|
171
|
+
h: "\u2550",
|
|
172
|
+
v: "\u2551"
|
|
173
|
+
},
|
|
174
|
+
doubleSingle: {
|
|
175
|
+
tl: "\u2553",
|
|
176
|
+
tr: "\u2556",
|
|
177
|
+
bl: "\u2559",
|
|
178
|
+
br: "\u255C",
|
|
179
|
+
h: "\u2500",
|
|
180
|
+
v: "\u2551"
|
|
181
|
+
},
|
|
182
|
+
doubleSingleRounded: {
|
|
183
|
+
tl: "\u256D",
|
|
184
|
+
tr: "\u256E",
|
|
185
|
+
bl: "\u2570",
|
|
186
|
+
br: "\u256F",
|
|
187
|
+
h: "\u2500",
|
|
188
|
+
v: "\u2551"
|
|
189
|
+
},
|
|
190
|
+
singleThick: {
|
|
191
|
+
tl: "\u250F",
|
|
192
|
+
tr: "\u2513",
|
|
193
|
+
bl: "\u2517",
|
|
194
|
+
br: "\u251B",
|
|
195
|
+
h: "\u2501",
|
|
196
|
+
v: "\u2503"
|
|
197
|
+
},
|
|
198
|
+
singleDouble: {
|
|
199
|
+
tl: "\u2552",
|
|
200
|
+
tr: "\u2555",
|
|
201
|
+
bl: "\u2558",
|
|
202
|
+
br: "\u255B",
|
|
203
|
+
h: "\u2550",
|
|
204
|
+
v: "\u2502"
|
|
205
|
+
},
|
|
206
|
+
singleDoubleRounded: {
|
|
207
|
+
tl: "\u256D",
|
|
208
|
+
tr: "\u256E",
|
|
209
|
+
bl: "\u2570",
|
|
210
|
+
br: "\u256F",
|
|
211
|
+
h: "\u2550",
|
|
212
|
+
v: "\u2502"
|
|
213
|
+
},
|
|
214
|
+
rounded: {
|
|
215
|
+
tl: "\u256D",
|
|
216
|
+
tr: "\u256E",
|
|
217
|
+
bl: "\u2570",
|
|
218
|
+
br: "\u256F",
|
|
219
|
+
h: "\u2500",
|
|
220
|
+
v: "\u2502"
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
const defaultStyle = {
|
|
224
|
+
borderColor: "white",
|
|
225
|
+
borderStyle: "rounded",
|
|
226
|
+
valign: "center",
|
|
227
|
+
padding: 2,
|
|
228
|
+
marginLeft: 1,
|
|
229
|
+
marginTop: 1,
|
|
230
|
+
marginBottom: 1
|
|
231
|
+
};
|
|
232
|
+
function box(text, _opts = {}) {
|
|
233
|
+
const opts = {
|
|
234
|
+
..._opts,
|
|
235
|
+
style: {
|
|
236
|
+
...defaultStyle,
|
|
237
|
+
..._opts.style
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
const textLines = text.split("\n");
|
|
241
|
+
const boxLines = [];
|
|
242
|
+
const _color = getColor(opts.style.borderColor);
|
|
243
|
+
const borderStyle = {
|
|
244
|
+
...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
|
|
245
|
+
};
|
|
246
|
+
if (_color) {
|
|
247
|
+
for (const key in borderStyle) {
|
|
248
|
+
borderStyle[key] = _color(
|
|
249
|
+
borderStyle[key]
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
|
|
254
|
+
const height = textLines.length + paddingOffset;
|
|
255
|
+
const width = Math.max(
|
|
256
|
+
...textLines.map((line) => stripAnsi(line).length),
|
|
257
|
+
opts.title ? stripAnsi(opts.title).length : 0
|
|
258
|
+
) + paddingOffset;
|
|
259
|
+
const widthOffset = width + paddingOffset;
|
|
260
|
+
const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
|
|
261
|
+
if (opts.style.marginTop > 0) {
|
|
262
|
+
boxLines.push("".repeat(opts.style.marginTop));
|
|
263
|
+
}
|
|
264
|
+
if (opts.title) {
|
|
265
|
+
const title = _color ? _color(opts.title) : opts.title;
|
|
266
|
+
const left = borderStyle.h.repeat(
|
|
267
|
+
Math.floor((width - stripAnsi(opts.title).length) / 2)
|
|
268
|
+
);
|
|
269
|
+
const right = borderStyle.h.repeat(
|
|
270
|
+
width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset
|
|
271
|
+
);
|
|
272
|
+
boxLines.push(
|
|
273
|
+
`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`
|
|
274
|
+
);
|
|
275
|
+
} else {
|
|
276
|
+
boxLines.push(
|
|
277
|
+
`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
|
|
281
|
+
for (let i = 0; i < height; i++) {
|
|
282
|
+
if (i < valignOffset || i >= valignOffset + textLines.length) {
|
|
283
|
+
boxLines.push(
|
|
284
|
+
`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`
|
|
285
|
+
);
|
|
286
|
+
} else {
|
|
287
|
+
const line = textLines[i - valignOffset];
|
|
288
|
+
const left = " ".repeat(paddingOffset);
|
|
289
|
+
const right = " ".repeat(width - stripAnsi(line).length);
|
|
290
|
+
boxLines.push(
|
|
291
|
+
`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
boxLines.push(
|
|
296
|
+
`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`
|
|
297
|
+
);
|
|
298
|
+
if (opts.style.marginBottom > 0) {
|
|
299
|
+
boxLines.push("".repeat(opts.style.marginBottom));
|
|
300
|
+
}
|
|
301
|
+
return boxLines.join("\n");
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
exports.align = align;
|
|
305
|
+
exports.box = box;
|
|
306
|
+
exports.centerAlign = centerAlign;
|
|
307
|
+
exports.colorize = colorize;
|
|
308
|
+
exports.colors = colors;
|
|
309
|
+
exports.getColor = getColor;
|
|
310
|
+
exports.leftAlign = leftAlign;
|
|
311
|
+
exports.rightAlign = rightAlign;
|
|
312
|
+
exports.stripAnsi = stripAnsi;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const box = require('./shared/consola.DwRq1yyg.cjs');
|
|
4
|
+
require('node:tty');
|
|
5
|
+
|
|
6
|
+
function formatTree(items, options) {
|
|
7
|
+
options = {
|
|
8
|
+
prefix: " ",
|
|
9
|
+
ellipsis: "...",
|
|
10
|
+
...options
|
|
11
|
+
};
|
|
12
|
+
const tree = _buildTree(items, options).join("");
|
|
13
|
+
if (options && options.color) {
|
|
14
|
+
return box.colorize(options.color, tree);
|
|
15
|
+
}
|
|
16
|
+
return tree;
|
|
17
|
+
}
|
|
18
|
+
function _buildTree(items, options) {
|
|
19
|
+
const chunks = [];
|
|
20
|
+
const total = items.length - 1;
|
|
21
|
+
for (let i = 0; i <= total; i++) {
|
|
22
|
+
const item = items[i];
|
|
23
|
+
const isItemString = typeof item === "string";
|
|
24
|
+
const isLimit = options?.maxDepth != null && options.maxDepth <= 0;
|
|
25
|
+
if (isLimit) {
|
|
26
|
+
const ellipsis = `${options.prefix}${options.ellipsis}
|
|
27
|
+
`;
|
|
28
|
+
return [
|
|
29
|
+
isItemString ? ellipsis : item.color ? box.colorize(item.color, ellipsis) : ellipsis
|
|
30
|
+
// prettier-ignore
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
const isLast = i === total;
|
|
34
|
+
const prefix = isLast ? `${options?.prefix}\u2514\u2500` : `${options?.prefix}\u251C\u2500`;
|
|
35
|
+
if (isItemString) {
|
|
36
|
+
chunks.push(`${prefix}${item}
|
|
37
|
+
`);
|
|
38
|
+
} else {
|
|
39
|
+
const log = `${prefix}${item.text}
|
|
40
|
+
`;
|
|
41
|
+
chunks.push(item.color ? box.colorize(item.color, log) : log);
|
|
42
|
+
if (item.children) {
|
|
43
|
+
const _tree = _buildTree(item.children, {
|
|
44
|
+
...options,
|
|
45
|
+
maxDepth: options?.maxDepth == null ? void 0 : options.maxDepth - 1,
|
|
46
|
+
prefix: `${options?.prefix}${isLast ? " " : "\u2502 "}`
|
|
47
|
+
});
|
|
48
|
+
chunks.push(..._tree);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return chunks;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
exports.align = box.align;
|
|
56
|
+
exports.box = box.box;
|
|
57
|
+
exports.centerAlign = box.centerAlign;
|
|
58
|
+
exports.colorize = box.colorize;
|
|
59
|
+
exports.colors = box.colors;
|
|
60
|
+
exports.getColor = box.getColor;
|
|
61
|
+
exports.leftAlign = box.leftAlign;
|
|
62
|
+
exports.rightAlign = box.rightAlign;
|
|
63
|
+
exports.stripAnsi = box.stripAnsi;
|
|
64
|
+
exports.formatTree = formatTree;
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
type BoxBorderStyle = {
|
|
2
|
+
/**
|
|
3
|
+
* Top left corner
|
|
4
|
+
* @example `┌`
|
|
5
|
+
* @example `╔`
|
|
6
|
+
* @example `╓`
|
|
7
|
+
*/
|
|
8
|
+
tl: string;
|
|
9
|
+
/**
|
|
10
|
+
* Top right corner
|
|
11
|
+
* @example `┐`
|
|
12
|
+
* @example `╗`
|
|
13
|
+
* @example `╖`
|
|
14
|
+
*/
|
|
15
|
+
tr: string;
|
|
16
|
+
/**
|
|
17
|
+
* Bottom left corner
|
|
18
|
+
* @example `└`
|
|
19
|
+
* @example `╚`
|
|
20
|
+
* @example `╙`
|
|
21
|
+
*/
|
|
22
|
+
bl: string;
|
|
23
|
+
/**
|
|
24
|
+
* Bottom right corner
|
|
25
|
+
* @example `┘`
|
|
26
|
+
* @example `╝`
|
|
27
|
+
* @example `╜`
|
|
28
|
+
*/
|
|
29
|
+
br: string;
|
|
30
|
+
/**
|
|
31
|
+
* Horizontal line
|
|
32
|
+
* @example `─`
|
|
33
|
+
* @example `═`
|
|
34
|
+
* @example `─`
|
|
35
|
+
*/
|
|
36
|
+
h: string;
|
|
37
|
+
/**
|
|
38
|
+
* Vertical line
|
|
39
|
+
* @example `│`
|
|
40
|
+
* @example `║`
|
|
41
|
+
* @example `║`
|
|
42
|
+
*/
|
|
43
|
+
v: string;
|
|
44
|
+
};
|
|
45
|
+
declare const boxStylePresets: Record<string, BoxBorderStyle>;
|
|
46
|
+
type BoxStyle = {
|
|
47
|
+
/**
|
|
48
|
+
* The border color
|
|
49
|
+
* @default 'white'
|
|
50
|
+
*/
|
|
51
|
+
borderColor: "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "magentaBright" | "cyanBright" | "whiteBright";
|
|
52
|
+
/**
|
|
53
|
+
* The border style
|
|
54
|
+
* @default 'solid'
|
|
55
|
+
* @example 'single-double-rounded'
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* {
|
|
59
|
+
* tl: '┌',
|
|
60
|
+
* tr: '┐',
|
|
61
|
+
* bl: '└',
|
|
62
|
+
* br: '┘',
|
|
63
|
+
* h: '─',
|
|
64
|
+
* v: '│',
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
borderStyle: BoxBorderStyle | keyof typeof boxStylePresets;
|
|
69
|
+
/**
|
|
70
|
+
* The vertical alignment of the text
|
|
71
|
+
* @default 'center'
|
|
72
|
+
*/
|
|
73
|
+
valign: "top" | "center" | "bottom";
|
|
74
|
+
/**
|
|
75
|
+
* The padding of the box
|
|
76
|
+
* @default 2
|
|
77
|
+
*/
|
|
78
|
+
padding: number;
|
|
79
|
+
/**
|
|
80
|
+
* The left margin of the box
|
|
81
|
+
* @default 1
|
|
82
|
+
*/
|
|
83
|
+
marginLeft: number;
|
|
84
|
+
/**
|
|
85
|
+
* The top margin of the box
|
|
86
|
+
* @default 1
|
|
87
|
+
*/
|
|
88
|
+
marginTop: number;
|
|
89
|
+
/**
|
|
90
|
+
* The top margin of the box
|
|
91
|
+
* @default 1
|
|
92
|
+
*/
|
|
93
|
+
marginBottom: number;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* The border options of the box
|
|
97
|
+
*/
|
|
98
|
+
type BoxOpts = {
|
|
99
|
+
/**
|
|
100
|
+
* Title that will be displayed on top of the box
|
|
101
|
+
* @example 'Hello World'
|
|
102
|
+
* @example 'Hello {name}'
|
|
103
|
+
*/
|
|
104
|
+
title?: string;
|
|
105
|
+
style?: Partial<BoxStyle>;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Creates a styled box with text content, customisable via options.
|
|
109
|
+
* @param {string} text - The text to display in the box.
|
|
110
|
+
* @param {BoxOpts} [_opts={}] - Optional settings for the appearance and behaviour of the box. See {@link BoxOpts}.
|
|
111
|
+
* @returns {string} The formatted box as a string, ready for printing or logging.
|
|
112
|
+
*/
|
|
113
|
+
declare function box(text: string, _opts?: BoxOpts): string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Based on https://github.com/jorgebucaran/colorette
|
|
117
|
+
* Read LICENSE file for more information
|
|
118
|
+
* https://github.com/jorgebucaran/colorette/blob/20fc196d07d0f87c61e0256eadd7831c79b24108/index.js
|
|
119
|
+
*/
|
|
120
|
+
declare const colorDefs: {
|
|
121
|
+
reset: (string: string) => string;
|
|
122
|
+
bold: (string: string) => string;
|
|
123
|
+
dim: (string: string) => string;
|
|
124
|
+
italic: (string: string) => string;
|
|
125
|
+
underline: (string: string) => string;
|
|
126
|
+
inverse: (string: string) => string;
|
|
127
|
+
hidden: (string: string) => string;
|
|
128
|
+
strikethrough: (string: string) => string;
|
|
129
|
+
black: (string: string) => string;
|
|
130
|
+
red: (string: string) => string;
|
|
131
|
+
green: (string: string) => string;
|
|
132
|
+
yellow: (string: string) => string;
|
|
133
|
+
blue: (string: string) => string;
|
|
134
|
+
magenta: (string: string) => string;
|
|
135
|
+
cyan: (string: string) => string;
|
|
136
|
+
white: (string: string) => string;
|
|
137
|
+
gray: (string: string) => string;
|
|
138
|
+
bgBlack: (string: string) => string;
|
|
139
|
+
bgRed: (string: string) => string;
|
|
140
|
+
bgGreen: (string: string) => string;
|
|
141
|
+
bgYellow: (string: string) => string;
|
|
142
|
+
bgBlue: (string: string) => string;
|
|
143
|
+
bgMagenta: (string: string) => string;
|
|
144
|
+
bgCyan: (string: string) => string;
|
|
145
|
+
bgWhite: (string: string) => string;
|
|
146
|
+
blackBright: (string: string) => string;
|
|
147
|
+
redBright: (string: string) => string;
|
|
148
|
+
greenBright: (string: string) => string;
|
|
149
|
+
yellowBright: (string: string) => string;
|
|
150
|
+
blueBright: (string: string) => string;
|
|
151
|
+
magentaBright: (string: string) => string;
|
|
152
|
+
cyanBright: (string: string) => string;
|
|
153
|
+
whiteBright: (string: string) => string;
|
|
154
|
+
bgBlackBright: (string: string) => string;
|
|
155
|
+
bgRedBright: (string: string) => string;
|
|
156
|
+
bgGreenBright: (string: string) => string;
|
|
157
|
+
bgYellowBright: (string: string) => string;
|
|
158
|
+
bgBlueBright: (string: string) => string;
|
|
159
|
+
bgMagentaBright: (string: string) => string;
|
|
160
|
+
bgCyanBright: (string: string) => string;
|
|
161
|
+
bgWhiteBright: (string: string) => string;
|
|
162
|
+
};
|
|
163
|
+
type ColorName = keyof typeof colorDefs;
|
|
164
|
+
type ColorFunction = (text: string | number) => string;
|
|
165
|
+
/**
|
|
166
|
+
* An object containing functions for colouring text. Each function corresponds to a terminal colour. See {@link ColorName} for available colours.
|
|
167
|
+
*/
|
|
168
|
+
declare const colors: Record<ColorName, ColorFunction>;
|
|
169
|
+
/**
|
|
170
|
+
* Gets a colour function by name, with an option for a fallback colour if the requested colour is not found.
|
|
171
|
+
* @param {ColorName} color - The name of the colour function to get. See {@link ColorName}.
|
|
172
|
+
* @param {ColorName} [fallback="reset"] - The name of the fallback colour function if the requested colour is not found. See {@link ColorName}.
|
|
173
|
+
* @returns {ColorFunction} The colour function that corresponds to the requested colour, or the fallback colour function. See {@link ColorFunction}.
|
|
174
|
+
*/
|
|
175
|
+
declare function getColor(color: ColorName, fallback?: ColorName): ColorFunction;
|
|
176
|
+
/**
|
|
177
|
+
* Applies a specified colour to a given text string or number.
|
|
178
|
+
* @param {ColorName} color - The colour to apply. See {@link ColorName}.
|
|
179
|
+
* @param {string | number} text - The text to colour.
|
|
180
|
+
* @returns {string} The coloured text.
|
|
181
|
+
*/
|
|
182
|
+
declare function colorize(color: ColorName, text: string | number): string;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Removes ANSI escape codes from a given string. This is particularly useful for
|
|
186
|
+
* processing text that contains formatting codes, such as colours or styles, so that the
|
|
187
|
+
* the raw text without any visual formatting.
|
|
188
|
+
*
|
|
189
|
+
* @param {string} text - The text string from which to strip the ANSI escape codes.
|
|
190
|
+
* @returns {string} The text without ANSI escape codes.
|
|
191
|
+
*/
|
|
192
|
+
declare function stripAnsi(text: string): string;
|
|
193
|
+
/**
|
|
194
|
+
* Centers a string within a specified total width, padding it with spaces or another specified character.
|
|
195
|
+
* If the string is longer than the total width, it is returned as is.
|
|
196
|
+
*
|
|
197
|
+
* @param {string} str - The string to centre.
|
|
198
|
+
* @param {number} len - The total width in which to centre the string.
|
|
199
|
+
* @param {string} [space=" "] - The character to use for padding. Defaults to a space.
|
|
200
|
+
* @returns {string} The centred string.
|
|
201
|
+
*/
|
|
202
|
+
declare function centerAlign(str: string, len: number, space?: string): string;
|
|
203
|
+
/**
|
|
204
|
+
* Right-justifies a string within a given total width, padding it with whitespace or another specified character.
|
|
205
|
+
* If the string is longer than the total width, it is returned as is.
|
|
206
|
+
*
|
|
207
|
+
* @param {string} str - The string to right-justify.
|
|
208
|
+
* @param {number} len - The total width to align the string.
|
|
209
|
+
* @param {string} [space=" "] - The character to use for padding. Defaults to a space.
|
|
210
|
+
* @returns {string} The right-justified string.
|
|
211
|
+
*/
|
|
212
|
+
declare function rightAlign(str: string, len: number, space?: string): string;
|
|
213
|
+
/**
|
|
214
|
+
* Left-aligns a string within a given total width, padding it with whitespace or another specified character on the right.
|
|
215
|
+
* If the string is longer than the total width, it is returned as is.
|
|
216
|
+
*
|
|
217
|
+
* @param {string} str - The string to align left.
|
|
218
|
+
* @param {number} len - The total width to align the string.
|
|
219
|
+
* @param {string} [space=" "] - The character to use for padding. Defaults to a space.
|
|
220
|
+
* @returns {string} The left-justified string.
|
|
221
|
+
*/
|
|
222
|
+
declare function leftAlign(str: string, len: number, space?: string): string;
|
|
223
|
+
/**
|
|
224
|
+
* Aligns a string (left, right, or centre) within a given total width, padding it with spaces or another specified character.
|
|
225
|
+
* If the string is longer than the total width, it is returned as is. This function acts as a wrapper for individual alignment functions.
|
|
226
|
+
*
|
|
227
|
+
* @param {"left" | "right" | "centre"} alignment - The desired alignment of the string.
|
|
228
|
+
* @param {string} str - The string to align.
|
|
229
|
+
* @param {number} len - The total width in which to align the string.
|
|
230
|
+
* @param {string} [space=" "] - The character to use for padding. Defaults to a space.
|
|
231
|
+
* @returns {string} The aligned string, according to the given alignment.
|
|
232
|
+
*/
|
|
233
|
+
declare function align(alignment: "left" | "right" | "center", str: string, len: number, space?: string): string;
|
|
234
|
+
|
|
235
|
+
type TreeItemObject = {
|
|
236
|
+
/**
|
|
237
|
+
* Text of the item
|
|
238
|
+
*/
|
|
239
|
+
text: string;
|
|
240
|
+
/**
|
|
241
|
+
* Children of the item
|
|
242
|
+
*/
|
|
243
|
+
children?: TreeItem[];
|
|
244
|
+
/**
|
|
245
|
+
* Color of the item
|
|
246
|
+
*/
|
|
247
|
+
color?: ColorName;
|
|
248
|
+
};
|
|
249
|
+
type TreeItem = string | TreeItemObject;
|
|
250
|
+
type TreeOptions = {
|
|
251
|
+
/**
|
|
252
|
+
* Color of the tree
|
|
253
|
+
*/
|
|
254
|
+
color?: ColorName;
|
|
255
|
+
/**
|
|
256
|
+
* Prefix of the tree
|
|
257
|
+
*
|
|
258
|
+
* @default " "
|
|
259
|
+
*/
|
|
260
|
+
prefix?: string;
|
|
261
|
+
/**
|
|
262
|
+
* The max depth of tree
|
|
263
|
+
*/
|
|
264
|
+
maxDepth?: number;
|
|
265
|
+
/**
|
|
266
|
+
* Ellipsis of the tree
|
|
267
|
+
*
|
|
268
|
+
* @default "..."
|
|
269
|
+
*/
|
|
270
|
+
ellipsis?: string;
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* Formats a hierarchical list of items into a string representing a tree structure.
|
|
274
|
+
* Each item in the tree can be a simple string or an object defining the text of the item,
|
|
275
|
+
* optional children, and colour. The tree structure can be customised with options
|
|
276
|
+
* Specify the overall colour and the prefix used for indentation and tree lines.
|
|
277
|
+
*
|
|
278
|
+
* @param {TreeItem[]} items - An array of items to include in the tree. Each item can be
|
|
279
|
+
* either a string or an object with `text', `children' and `colour' properties.
|
|
280
|
+
* @param {TreeOptions} [options] - Optional settings to customise the appearance of the tree, including
|
|
281
|
+
* the colour of the tree text and the prefix for branches. See {@link TreeOptions}.
|
|
282
|
+
* @returns {string} The formatted tree as a string, ready for printing to the console or elsewhere.
|
|
283
|
+
*/
|
|
284
|
+
declare function formatTree(items: TreeItem[], options?: TreeOptions): string;
|
|
285
|
+
|
|
286
|
+
export { type BoxBorderStyle, type BoxOpts, type BoxStyle, type ColorFunction, type ColorName, type TreeItem, type TreeItemObject, type TreeOptions, align, box, centerAlign, colorize, colors, formatTree, getColor, leftAlign, rightAlign, stripAnsi };
|