@wordup-md/nuxt-layer-shadcn-unocss 0.2.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/.cursor/rules/active-context-rule.mdc +8 -0
- package/.cursor/rules/memory-bank-overview.mdc +17 -0
- package/.cursor/rules/product-context-rule.mdc +8 -0
- package/.cursor/rules/progress-rule.mdc +8 -0
- package/.cursor/rules/projectbrief-rule.mdc +8 -0
- package/.cursor/rules/system-patterns-rule.mdc +8 -0
- package/.cursor/rules/tech-context-rule.mdc +8 -0
- package/.cursorrules +52 -0
- package/.editorconfig +12 -0
- package/.nuxtrc +1 -0
- package/.playground/app.config.ts +189 -0
- package/.playground/assets/style.css +15 -0
- package/.playground/components/content/MdcExample.vue +81 -0
- package/.playground/components/content/MdcReplay.vue +319 -0
- package/.playground/content/1.getting-started/1.introduction.md +8 -0
- package/.playground/content/1.getting-started/2.writing/1.markdown.md +56 -0
- package/.playground/content/1.getting-started/2.writing/2.pages.md +177 -0
- package/.playground/content/1.getting-started/2.writing/3.folders.md +56 -0
- package/.playground/content/1.getting-started/2.writing/_dir.yml +3 -0
- package/.playground/content/1.getting-started/_dir.yml +3 -0
- package/.playground/content/2.content-elements/1.text-formatting.md +60 -0
- package/.playground/content/2.content-elements/10.horizontal-rule.md +25 -0
- package/.playground/content/2.content-elements/11.tables.md +25 -0
- package/.playground/content/2.content-elements/12.overview.md +93 -0
- package/.playground/content/2.content-elements/13.text-components.md +36 -0
- package/.playground/content/2.content-elements/2.headings.md +32 -0
- package/.playground/content/2.content-elements/3.paragraphs.md +39 -0
- package/.playground/content/2.content-elements/4.lists.md +37 -0
- package/.playground/content/2.content-elements/5.links.md +17 -0
- package/.playground/content/2.content-elements/6.images.md +17 -0
- package/.playground/content/2.content-elements/7.blockquotes.md +17 -0
- package/.playground/content/2.content-elements/8.code-blocks.md +141 -0
- package/.playground/content/2.content-elements/9.inline-code.md +21 -0
- package/.playground/content/2.content-elements/_dir.yml +3 -0
- package/.playground/content/2.content-elements/index.md +8 -0
- package/.playground/content/3.components/1.index.md +187 -0
- package/.playground/content/3.components/2.docs/_dir.yml +3 -0
- package/.playground/content/3.components/2.docs/alert.md +152 -0
- package/.playground/content/3.components/2.docs/badge.md +131 -0
- package/.playground/content/3.components/2.docs/button-link.md +53 -0
- package/.playground/content/3.components/2.docs/callout.md +16 -0
- package/.playground/content/3.components/2.docs/code-group.md +77 -0
- package/.playground/content/3.components/2.docs/code-snippet.md +129 -0
- package/.playground/content/3.components/2.docs/field-group.md +62 -0
- package/.playground/content/3.components/2.docs/field.md +39 -0
- package/.playground/content/3.components/2.docs/file-tree.md +144 -0
- package/.playground/content/3.components/2.docs/icon.md +94 -0
- package/.playground/content/3.components/2.docs/pm.md +67 -0
- package/.playground/content/3.components/2.docs/read-more.md +44 -0
- package/.playground/content/3.components/2.docs/shortcut.md +36 -0
- package/.playground/content/3.components/2.docs/stack.md +81 -0
- package/.playground/content/3.components/2.docs/steps.md +148 -0
- package/.playground/content/3.components/2.docs/tabs.md +375 -0
- package/.playground/content/3.components/3.page/_dir.yml +2 -0
- package/.playground/content/3.components/3.page/accordion.md +74 -0
- package/.playground/content/3.components/3.page/card-group.md +115 -0
- package/.playground/content/3.components/3.page/card.md +142 -0
- package/.playground/content/3.components/3.page/collapsible.md +61 -0
- package/.playground/content/3.components/3.page/hero-alt.md +118 -0
- package/.playground/content/3.components/3.page/hero.md +60 -0
- package/.playground/content/3.components/3.page/team-card.md +82 -0
- package/.playground/content/3.components/_dir.yml +2 -0
- package/.playground/content/4.development/1.configuration/1.overview.md +297 -0
- package/.playground/content/4.development/1.configuration/2.nuxt-content.md +105 -0
- package/.playground/content/4.development/1.configuration/3.og-image.md +86 -0
- package/.playground/content/4.development/1.configuration/4.edit-link.md +63 -0
- package/.playground/content/4.development/1.configuration/5.banner.md +52 -0
- package/.playground/content/4.development/1.configuration/6.carbon-ads.md +65 -0
- package/.playground/content/4.development/1.configuration/7.umami.md +41 -0
- package/.playground/content/4.development/1.configuration/_dir.yml +3 -0
- package/.playground/content/4.development/2.advanced/1.override.md +49 -0
- package/.playground/content/4.development/2.advanced/2.math.md +89 -0
- package/.playground/content/4.development/2.advanced/_dir.yml +3 -0
- package/.playground/content/4.development/3.themes.md +9 -0
- package/.playground/content/4.development/4.composables.md +38 -0
- package/.playground/content/4.development/5.installation.md +36 -0
- package/.playground/content/4.development/_dir.yml +3 -0
- package/.playground/content/_menu-footer.md +5 -0
- package/.playground/content/index.md +67 -0
- package/.playground/content/test-card.md +187 -0
- package/.playground/content/test.md +88 -0
- package/.playground/content/test2.md +12 -0
- package/.playground/content/test3.md +187 -0
- package/.playground/nuxt.config.ts +52 -0
- package/.playground/public/banner-preview.png +0 -0
- package/.playground/public/favicon.ico +0 -0
- package/.playground/public/front-matter-showcase/authors.png +0 -0
- package/.playground/public/front-matter-showcase/badges.png +0 -0
- package/.playground/public/front-matter-showcase/nav-badges.png +0 -0
- package/.playground/public/hero.png +0 -0
- package/.playground/public/logo-dark.svg +12 -0
- package/.playground/public/logo.svg +12 -0
- package/.playground/public/og-nuxt-seo.png +0 -0
- package/.playground/public/og-nuxt.png +0 -0
- package/.playground/public/og-shadcn-docs-dark.png +0 -0
- package/.playground/public/og-shadcn-docs.png +0 -0
- package/.playground/public/sidebar-default.png +0 -0
- package/.playground/public/sidebar-group.png +0 -0
- package/.playground/public/sidebar-tree.png +0 -0
- package/.playground/uno.config.ts +16 -0
- package/README.md +93 -0
- package/app.vue +59 -0
- package/assets/css/a11y.css +48 -0
- package/assets/css/mdc-editor.css +91 -0
- package/components/A11yModeToggle.vue +23 -0
- package/components/DarkModeToggle.vue +26 -0
- package/components/LinkIcon.vue +32 -0
- package/components/OgImage/ShadcnDocs.vue +55 -0
- package/components/ThemeCustomizer.vue +156 -0
- package/components/ThemePopover.vue +27 -0
- package/components/content/Accordion.vue +18 -0
- package/components/content/AccordionItem.vue +32 -0
- package/components/content/Alert.vue +100 -0
- package/components/content/Badge.vue +52 -0
- package/components/content/ButtonLink.vue +38 -0
- package/components/content/Callout.vue +17 -0
- package/components/content/Card.vue +173 -0
- package/components/content/CardGroup.vue +38 -0
- package/components/content/CodeCopy.vue +52 -0
- package/components/content/CodeGroup._vue +27 -0
- package/components/content/CodeSnippet._vue +78 -0
- package/components/content/Collapsible.vue +80 -0
- package/components/content/Field.vue +53 -0
- package/components/content/FieldGroup.vue +5 -0
- package/components/content/FileTree.vue +110 -0
- package/components/content/FileTreeItem.vue +64 -0
- package/components/content/FileTreeRoot.vue +27 -0
- package/components/content/Hero.vue +154 -0
- package/components/content/HeroAlt.vue +116 -0
- package/components/content/Icon.vue +69 -0
- package/components/content/Kbd.vue +20 -0
- package/components/content/PmInstall.vue +35 -0
- package/components/content/PmRun.vue +31 -0
- package/components/content/PmX.vue +31 -0
- package/components/content/ProseA.vue +21 -0
- package/components/content/ProseBlockquote.vue +5 -0
- package/components/content/ProseCode.vue +121 -0
- package/components/content/ProseCodeInline.vue +24 -0
- package/components/content/ProseEm.vue +5 -0
- package/components/content/ProseH1.vue +27 -0
- package/components/content/ProseH2.vue +22 -0
- package/components/content/ProseH3.vue +21 -0
- package/components/content/ProseH4.vue +21 -0
- package/components/content/ProseH5.vue +21 -0
- package/components/content/ProseH6.vue +21 -0
- package/components/content/ProseHr.vue +3 -0
- package/components/content/ProseImg.vue +42 -0
- package/components/content/ProseLi.vue +5 -0
- package/components/content/ProseOl.vue +5 -0
- package/components/content/ProseP.vue +5 -0
- package/components/content/ProsePre.vue +56 -0
- package/components/content/ProseSection.vue +27 -0
- package/components/content/ProseStrong.vue +5 -0
- package/components/content/ProseTable.vue +7 -0
- package/components/content/ProseTbody.vue +5 -0
- package/components/content/ProseTd.vue +5 -0
- package/components/content/ProseTh.vue +5 -0
- package/components/content/ProseThead.vue +5 -0
- package/components/content/ProseTr.vue +5 -0
- package/components/content/ProseUl.vue +5 -0
- package/components/content/ReadMore.vue +41 -0
- package/components/content/Shortcut.vue +20 -0
- package/components/content/Stack.vue +17 -0
- package/components/content/Steps.vue +23 -0
- package/components/content/Tabs.vue +52 -0
- package/components/content/TabsInner.vue +263 -0
- package/components/content/TeamCard.vue +52 -0
- package/components/content/TeamCardGroup.vue +5 -0
- package/components/content/global/AlertEditor.vue +58 -0
- package/components/content/global/BadgeEditor.vue +56 -0
- package/components/content/global/BrEditor.vue +3 -0
- package/components/content/global/CardEditor.vue +142 -0
- package/components/content/global/CardGroupEditor.vue +50 -0
- package/components/content/global/CodeGroup.vue +13 -0
- package/components/content/global/CodeGroupEditor.vue +50 -0
- package/components/content/global/DivEditor.vue +22 -0
- package/components/content/global/FieldEditor.vue +38 -0
- package/components/content/global/FieldGroupEditor.vue +24 -0
- package/components/content/global/HeroEditor.vue +67 -0
- package/components/content/global/ProseSectionEditor.vue +180 -0
- package/components/content/global/ReadMoreEditor.vue +70 -0
- package/components/content/global/SectionEditor.vue +22 -0
- package/components/content/global/StackEditor.vue +35 -0
- package/components/content/global/StepsEditor.vue +55 -0
- package/components/content/global/Tabs._vue +97 -0
- package/components/content/global/TabsEditor.vue +38 -0
- package/components/layout/Aside.vue +83 -0
- package/components/layout/AsideTree.vue +25 -0
- package/components/layout/AsideTreeItem.vue +86 -0
- package/components/layout/AsideTreeItemButton.vue +32 -0
- package/components/layout/Banner.vue +77 -0
- package/components/layout/Breadcrumb.vue +34 -0
- package/components/layout/DocsFooter.vue +6 -0
- package/components/layout/EditLink.vue +23 -0
- package/components/layout/Footer.vue +80 -0
- package/components/layout/FooterItem.vue +50 -0
- package/components/layout/FooterSubmenuItem.vue +39 -0
- package/components/layout/Header/Logo.vue +30 -0
- package/components/layout/Header/MenuItem.vue +83 -0
- package/components/layout/Header/Nav.vue +112 -0
- package/components/layout/Header/NavMobile.vue +14 -0
- package/components/layout/Header/NavMobileItem.vue +79 -0
- package/components/layout/Header/SubmenuItem.vue +39 -0
- package/components/layout/Header.vue +160 -0
- package/components/layout/LangSwitcher.vue +90 -0
- package/components/layout/MobileNav.vue +44 -0
- package/components/layout/PrevNext.vue +24 -0
- package/components/layout/PrevNextButton.vue +50 -0
- package/components/layout/SearchButton.vue +46 -0
- package/components/layout/SearchDialog.vue +217 -0
- package/components/layout/Title.vue +98 -0
- package/components/layout/Toc.vue +99 -0
- package/components/layout/TocTree.vue +42 -0
- package/components/ui/accordion/Accordion.vue +19 -0
- package/components/ui/accordion/AccordionContent.vue +24 -0
- package/components/ui/accordion/AccordionItem.vue +24 -0
- package/components/ui/accordion/AccordionTrigger.vue +39 -0
- package/components/ui/accordion/index.ts +4 -0
- package/components/ui/alert/Alert.vue +19 -0
- package/components/ui/alert/AlertDescription.vue +14 -0
- package/components/ui/alert/AlertTitle.vue +14 -0
- package/components/ui/alert/index.ts +23 -0
- package/components/ui/avatar/Avatar.vue +25 -0
- package/components/ui/avatar/AvatarFallback.vue +11 -0
- package/components/ui/avatar/AvatarImage.vue +12 -0
- package/components/ui/avatar/index.ts +24 -0
- package/components/ui/badge/Badge.vue +17 -0
- package/components/ui/badge/index.ts +71 -0
- package/components/ui/breadcrumb/Breadcrumb.vue +16 -0
- package/components/ui/breadcrumb/BreadcrumbItem.vue +16 -0
- package/components/ui/breadcrumb/BreadcrumbLink.vue +23 -0
- package/components/ui/breadcrumb/BreadcrumbList.vue +16 -0
- package/components/ui/breadcrumb/BreadcrumbPage.vue +19 -0
- package/components/ui/breadcrumb/BreadcrumbSeparator.vue +23 -0
- package/components/ui/breadcrumb/index.ts +6 -0
- package/components/ui/button/Button.vue +29 -0
- package/components/ui/button/index.ts +35 -0
- package/components/ui/card/Card.vue +21 -0
- package/components/ui/card/CardContent.vue +14 -0
- package/components/ui/card/CardDescription.vue +14 -0
- package/components/ui/card/CardFooter.vue +14 -0
- package/components/ui/card/CardHeader.vue +14 -0
- package/components/ui/card/CardTitle.vue +18 -0
- package/components/ui/card/index.ts +6 -0
- package/components/ui/collapsible/Collapsible.vue +18 -0
- package/components/ui/collapsible/CollapsibleContent.vue +14 -0
- package/components/ui/collapsible/CollapsibleTrigger.vue +11 -0
- package/components/ui/collapsible/index.ts +3 -0
- package/components/ui/command/Command.vue +89 -0
- package/components/ui/command/CommandEmpty.vue +30 -0
- package/components/ui/command/CommandGroup.vue +50 -0
- package/components/ui/command/CommandInput.vue +44 -0
- package/components/ui/command/CommandInputOnly.vue +50 -0
- package/components/ui/command/CommandItem.vue +79 -0
- package/components/ui/command/CommandList.vue +28 -0
- package/components/ui/command/CommandSeparator.vue +24 -0
- package/components/ui/command/index.ts +24 -0
- package/components/ui/dialog/Dialog.vue +14 -0
- package/components/ui/dialog/DialogClose.vue +11 -0
- package/components/ui/dialog/DialogContent.vue +52 -0
- package/components/ui/dialog/DialogDescription.vue +24 -0
- package/components/ui/dialog/DialogFooter.vue +19 -0
- package/components/ui/dialog/DialogHeader.vue +16 -0
- package/components/ui/dialog/DialogScrollContent.vue +61 -0
- package/components/ui/dialog/DialogTitle.vue +29 -0
- package/components/ui/dialog/DialogTrigger.vue +11 -0
- package/components/ui/dialog/index.ts +9 -0
- package/components/ui/input/Input.vue +27 -0
- package/components/ui/input/index.ts +1 -0
- package/components/ui/label/Label.vue +27 -0
- package/components/ui/label/index.ts +1 -0
- package/components/ui/navigation-menu/NavigationMenu.vue +33 -0
- package/components/ui/navigation-menu/NavigationMenuContent.vue +34 -0
- package/components/ui/navigation-menu/NavigationMenuIndicator.vue +24 -0
- package/components/ui/navigation-menu/NavigationMenuItem.vue +11 -0
- package/components/ui/navigation-menu/NavigationMenuLink.vue +19 -0
- package/components/ui/navigation-menu/NavigationMenuList.vue +33 -0
- package/components/ui/navigation-menu/NavigationMenuTrigger.vue +34 -0
- package/components/ui/navigation-menu/NavigationMenuViewport.vue +33 -0
- package/components/ui/navigation-menu/index.ts +14 -0
- package/components/ui/popover/Popover.vue +15 -0
- package/components/ui/popover/PopoverContent.vue +49 -0
- package/components/ui/popover/PopoverTrigger.vue +11 -0
- package/components/ui/popover/index.ts +4 -0
- package/components/ui/scroll-area/ScrollArea.vue +32 -0
- package/components/ui/scroll-area/ScrollBar.vue +41 -0
- package/components/ui/scroll-area/index.ts +2 -0
- package/components/ui/separator/Separator.vue +20 -0
- package/components/ui/separator/index.ts +1 -0
- package/components/ui/sheet/Sheet.vue +14 -0
- package/components/ui/sheet/SheetClose.vue +11 -0
- package/components/ui/sheet/SheetContent.vue +58 -0
- package/components/ui/sheet/SheetDescription.vue +22 -0
- package/components/ui/sheet/SheetFooter.vue +19 -0
- package/components/ui/sheet/SheetHeader.vue +16 -0
- package/components/ui/sheet/SheetTitle.vue +22 -0
- package/components/ui/sheet/SheetTrigger.vue +11 -0
- package/components/ui/sheet/index.ts +31 -0
- package/components/ui/slider/Slider.vue +36 -0
- package/components/ui/slider/index.ts +1 -0
- package/components/ui/tabs/Tabs.vue +15 -0
- package/components/ui/tabs/TabsContent.vue +22 -0
- package/components/ui/tabs/TabsList.vue +25 -0
- package/components/ui/tabs/TabsTrigger.vue +27 -0
- package/components/ui/tabs/index.ts +4 -0
- package/components/ui/textarea/Textarea.vue +27 -0
- package/components/ui/textarea/index.ts +1 -0
- package/components/ui/toast/Toast.vue +28 -0
- package/components/ui/toast/ToastAction.vue +22 -0
- package/components/ui/toast/ToastClose.vue +27 -0
- package/components/ui/toast/ToastDescription.vue +22 -0
- package/components/ui/toast/ToastProvider.vue +11 -0
- package/components/ui/toast/ToastTitle.vue +22 -0
- package/components/ui/toast/ToastViewport.vue +20 -0
- package/components/ui/toast/Toaster.vue +34 -0
- package/components/ui/toast/index.ts +38 -0
- package/components/ui/toast/use-toast.ts +165 -0
- package/components.json +18 -0
- package/composables/useBreadcrumb.ts +47 -0
- package/composables/useCollapsedMap.ts +3 -0
- package/composables/useConfig.ts +227 -0
- package/composables/useEditLink.ts +27 -0
- package/composables/useI18nDocs.ts +114 -0
- package/composables/useMdcMenu.ts +204 -0
- package/composables/usePm.ts +58 -0
- package/composables/useScrollspy.ts +51 -0
- package/composables/useThemes.ts +46 -0
- package/composables/useToast.ts +1 -0
- package/content/index.md +45 -0
- package/eslint.config.js +3 -0
- package/i18n/i18n.config.ts +414 -0
- package/index.d.ts +610 -0
- package/layouts/blank.vue +5 -0
- package/layouts/default.vue +9 -0
- package/layouts/editorial.vue +83 -0
- package/lib/registry/themes.ts +636 -0
- package/lib/uno-preset.ts +143 -0
- package/memory-bank/activeContext.md +17 -0
- package/memory-bank/productContext.md +21 -0
- package/memory-bank/progress.md +16 -0
- package/memory-bank/projectbrief.md +20 -0
- package/memory-bank/systemPatterns.md +25 -0
- package/memory-bank/techContext.md +29 -0
- package/modules/inject-css.ts +40 -0
- package/nuxt.config.ts +124 -0
- package/package.json +71 -0
- package/pages/[...slug].vue +109 -0
- package/pages/admin/[...slug].vue +145 -0
- package/pages/index.vue +24 -0
- package/plugins/injectCssHmr.ts +26 -0
- package/plugins/wordup.ts +130 -0
- package/public/content-doc.json +792 -0
- package/public/iconesjs.svg +4 -0
- package/scripts/buildContentDoc-cli.ts +8 -0
- package/scripts/buildContentDoc.ts +165 -0
- package/tailwind.config.js +1 -0
- package/tsconfig.json +3 -0
- package/uno.config.mjs +58 -0
- package/utils/index.ts +12 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section
|
|
3
|
+
class="hero relative mx-auto flex max-w-[980px] items-center gap-6 mb-8 py-8 md:py-12 md:pb-8 lg:py-24 lg:pb-20"
|
|
4
|
+
:class="[
|
|
5
|
+
String($attrs.class).includes('full-width') && 'w-full max-w-full',
|
|
6
|
+
['left', 'right'].includes(mediaPosition) && 'flex-row',
|
|
7
|
+
mediaPosition === 'right' && 'flex-row-reverse',
|
|
8
|
+
mediaPosition === 'bottom' && 'flex-col-reverse',
|
|
9
|
+
['cover', 'center'].includes(mediaPosition) && 'bg-opacity-0',
|
|
10
|
+
mediaPosition === 'center' && 'text-center items-center flex-row p-8',
|
|
11
|
+
]"
|
|
12
|
+
>
|
|
13
|
+
<div
|
|
14
|
+
v-if="media || $slots.media"
|
|
15
|
+
class="hero__media overflow-hidden"
|
|
16
|
+
:class="{
|
|
17
|
+
'w-5/13 shrink-0': media && (mediaPosition === 'left' || mediaPosition === 'right'),
|
|
18
|
+
'absolute inset-0': ['cover', 'center'].includes(mediaPosition),
|
|
19
|
+
}"
|
|
20
|
+
>
|
|
21
|
+
<NuxtImg
|
|
22
|
+
v-if="media"
|
|
23
|
+
:src="media"
|
|
24
|
+
class="w-full h-full object-cover"
|
|
25
|
+
/>
|
|
26
|
+
<ContentSlot
|
|
27
|
+
:use="$slots.media"
|
|
28
|
+
unwrap="p"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="hero__content flex flex-col gap-6 w-full z-1 of-hidden">
|
|
33
|
+
<NuxtLink
|
|
34
|
+
v-if="announcement"
|
|
35
|
+
:to="announcement.to"
|
|
36
|
+
:target="announcement.target"
|
|
37
|
+
class="hero__announcement inline-flex items-center rounded-lg bg-muted bg-opacity-80 px-3 py-1 text-sm font-medium mx-auto"
|
|
38
|
+
:class="String($attrs.class).includes('full-width') && 'w-max'"
|
|
39
|
+
>
|
|
40
|
+
<template v-if="announcement.icon">
|
|
41
|
+
<Icon
|
|
42
|
+
:name="announcement.icon"
|
|
43
|
+
:size="16"
|
|
44
|
+
/>
|
|
45
|
+
<UiSeparator
|
|
46
|
+
class="mx-2 h-4"
|
|
47
|
+
orientation="vertical"
|
|
48
|
+
/>
|
|
49
|
+
</template>
|
|
50
|
+
<span class="sm:hidden">{{ announcement.title }}</span>
|
|
51
|
+
<span class="hidden sm:inline">
|
|
52
|
+
{{ announcement.title }}
|
|
53
|
+
</span>
|
|
54
|
+
<NuxtIcon
|
|
55
|
+
name="lucide:arrow-right"
|
|
56
|
+
class="ml-1 size-4"
|
|
57
|
+
/>
|
|
58
|
+
</NuxtLink>
|
|
59
|
+
|
|
60
|
+
<h1 class="hero__title text-center text-3xl font-bold md:text-6xl md:leading-[1.25]">
|
|
61
|
+
<ContentSlot
|
|
62
|
+
:use="$slots.title"
|
|
63
|
+
unwrap="p"
|
|
64
|
+
/>
|
|
65
|
+
</h1>
|
|
66
|
+
|
|
67
|
+
<span
|
|
68
|
+
class="hero__description max-w-[750px] text-center text-lg text-muted-foreground sm:text-2xl"
|
|
69
|
+
:class="String($attrs.class).includes('full-width') && 'max-w-full'"
|
|
70
|
+
>
|
|
71
|
+
<ContentSlot
|
|
72
|
+
:use="$slots.description"
|
|
73
|
+
unwrap="p"
|
|
74
|
+
/>
|
|
75
|
+
</span>
|
|
76
|
+
|
|
77
|
+
<section
|
|
78
|
+
v-if="actions"
|
|
79
|
+
class="hero__actions flex w-full items-center justify-center space-x-4 py-4 md:pb-10"
|
|
80
|
+
>
|
|
81
|
+
<NuxtLink
|
|
82
|
+
v-for="(action, i) in actions"
|
|
83
|
+
:key="i"
|
|
84
|
+
:to="action.to"
|
|
85
|
+
:target="action.target"
|
|
86
|
+
>
|
|
87
|
+
<UiButton
|
|
88
|
+
:variant="action.variant"
|
|
89
|
+
size="lg"
|
|
90
|
+
>
|
|
91
|
+
<Icon
|
|
92
|
+
v-if="action.leftIcon"
|
|
93
|
+
:name="action.leftIcon"
|
|
94
|
+
class="mr-1"
|
|
95
|
+
/>
|
|
96
|
+
{{ action.name }}
|
|
97
|
+
<Icon
|
|
98
|
+
v-if="action.rightIcon"
|
|
99
|
+
:name="action.rightIcon"
|
|
100
|
+
class="ml-1"
|
|
101
|
+
/>
|
|
102
|
+
</UiButton>
|
|
103
|
+
</NuxtLink>
|
|
104
|
+
</section>
|
|
105
|
+
|
|
106
|
+
<div
|
|
107
|
+
v-if="arrowDown"
|
|
108
|
+
class="hero__arrow-down text-center mt-8"
|
|
109
|
+
>
|
|
110
|
+
<Icon
|
|
111
|
+
name="lucide:chevron-down"
|
|
112
|
+
size="64"
|
|
113
|
+
class="animate-bounce"
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</section>
|
|
118
|
+
</template>
|
|
119
|
+
|
|
120
|
+
<script setup lang="ts">
|
|
121
|
+
const {
|
|
122
|
+
mediaPosition = 'right',
|
|
123
|
+
} = defineProps<{
|
|
124
|
+
announcement?: {
|
|
125
|
+
to?: string
|
|
126
|
+
target?: Target
|
|
127
|
+
icon?: string
|
|
128
|
+
title: string
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
actions?: [
|
|
132
|
+
{
|
|
133
|
+
name: string
|
|
134
|
+
leftIcon?: string
|
|
135
|
+
rightIcon?: string
|
|
136
|
+
variant?:
|
|
137
|
+
| 'default'
|
|
138
|
+
| 'link'
|
|
139
|
+
| 'destructive'
|
|
140
|
+
| 'outline'
|
|
141
|
+
| 'secondary'
|
|
142
|
+
| 'ghost'
|
|
143
|
+
to: string
|
|
144
|
+
target?: Target
|
|
145
|
+
},
|
|
146
|
+
]
|
|
147
|
+
|
|
148
|
+
media?: string
|
|
149
|
+
mediaPosition?: 'left' | 'right' | 'top' | 'bottom' | 'cover' | 'center'
|
|
150
|
+
arrowDown?: boolean
|
|
151
|
+
}>()
|
|
152
|
+
|
|
153
|
+
defineSlots()
|
|
154
|
+
</script>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="gap-8 px-4 py-8 md:py-12 md:pb-8 lg:py-12 lg:pb-10"
|
|
4
|
+
:class="{ 'grid md:grid-cols-3': $slots.right }"
|
|
5
|
+
>
|
|
6
|
+
<section
|
|
7
|
+
class="flex flex-col items-start gap-2"
|
|
8
|
+
:class="{ 'md:col-span-2': $slots.right }"
|
|
9
|
+
>
|
|
10
|
+
<NuxtLink
|
|
11
|
+
v-if="announcement"
|
|
12
|
+
:to="announcement.to"
|
|
13
|
+
:target="announcement.target"
|
|
14
|
+
class="inline-flex items-center px-0.5 text-sm font-medium"
|
|
15
|
+
>
|
|
16
|
+
<template v-if="announcement.icon">
|
|
17
|
+
<Icon
|
|
18
|
+
:name="announcement.icon"
|
|
19
|
+
:size="16"
|
|
20
|
+
/>
|
|
21
|
+
<UiSeparator
|
|
22
|
+
class="mx-2 h-4"
|
|
23
|
+
orientation="vertical"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
26
|
+
<span class="underline-offset-4 hover:underline">{{
|
|
27
|
+
announcement.title
|
|
28
|
+
}}</span>
|
|
29
|
+
<NuxtIcon
|
|
30
|
+
name="lucide:arrow-right"
|
|
31
|
+
class="ml-1 size-4"
|
|
32
|
+
/>
|
|
33
|
+
</NuxtLink>
|
|
34
|
+
|
|
35
|
+
<h1
|
|
36
|
+
class="text-3xl font-bold leading-tight tracking-tighter md:text-4xl lg:leading-[1.1]"
|
|
37
|
+
>
|
|
38
|
+
<ContentSlot
|
|
39
|
+
:use="$slots.title"
|
|
40
|
+
unwrap="p"
|
|
41
|
+
/>
|
|
42
|
+
</h1>
|
|
43
|
+
<p class="max-w-2xl text-lg font-light text-foreground">
|
|
44
|
+
<ContentSlot
|
|
45
|
+
:use="$slots.description"
|
|
46
|
+
unwrap="p"
|
|
47
|
+
/>
|
|
48
|
+
</p>
|
|
49
|
+
|
|
50
|
+
<div class="flex w-full items-center justify-start gap-2 py-2">
|
|
51
|
+
<NuxtLink
|
|
52
|
+
v-for="(action, i) in actions"
|
|
53
|
+
:key="i"
|
|
54
|
+
:to="action.to"
|
|
55
|
+
:target="action.target"
|
|
56
|
+
>
|
|
57
|
+
<UiButton
|
|
58
|
+
:variant="action.variant"
|
|
59
|
+
size="sm"
|
|
60
|
+
>
|
|
61
|
+
<Icon
|
|
62
|
+
v-if="action.leftIcon"
|
|
63
|
+
:name="action.leftIcon"
|
|
64
|
+
class="mr-1"
|
|
65
|
+
/>
|
|
66
|
+
{{ action.name }}
|
|
67
|
+
<Icon
|
|
68
|
+
v-if="action.rightIcon"
|
|
69
|
+
:name="action.rightIcon"
|
|
70
|
+
class="ml-1"
|
|
71
|
+
/>
|
|
72
|
+
</UiButton>
|
|
73
|
+
</NuxtLink>
|
|
74
|
+
</div>
|
|
75
|
+
</section>
|
|
76
|
+
<div
|
|
77
|
+
class="mx-auto"
|
|
78
|
+
:class="{ 'order-first md:order-last': mobileRight === 'top' }"
|
|
79
|
+
>
|
|
80
|
+
<ContentSlot
|
|
81
|
+
:use="$slots.right"
|
|
82
|
+
unwrap="p"
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<script setup lang="ts">
|
|
89
|
+
defineProps<{
|
|
90
|
+
announcement?: {
|
|
91
|
+
to?: string
|
|
92
|
+
target?: Target
|
|
93
|
+
icon?: string
|
|
94
|
+
title: string
|
|
95
|
+
}
|
|
96
|
+
actions: [
|
|
97
|
+
{
|
|
98
|
+
name: string
|
|
99
|
+
leftIcon?: string
|
|
100
|
+
rightIcon?: string
|
|
101
|
+
variant?:
|
|
102
|
+
| 'default'
|
|
103
|
+
| 'link'
|
|
104
|
+
| 'destructive'
|
|
105
|
+
| 'outline'
|
|
106
|
+
| 'secondary'
|
|
107
|
+
| 'ghost'
|
|
108
|
+
to: string
|
|
109
|
+
target?: Target
|
|
110
|
+
},
|
|
111
|
+
]
|
|
112
|
+
mobileRight?: 'top' | 'bottom'
|
|
113
|
+
}>()
|
|
114
|
+
|
|
115
|
+
defineSlots()
|
|
116
|
+
</script>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
v-if="name?.endsWith('.svg')"
|
|
4
|
+
class="svg-icon"
|
|
5
|
+
:style="`--svg: url(${name}); width: ${size}px; height: ${size}px;`"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
/>
|
|
8
|
+
<!-- Iconify Icons -->
|
|
9
|
+
<NuxtIcon
|
|
10
|
+
v-else-if="isValidIcon"
|
|
11
|
+
:name
|
|
12
|
+
:size="+size"
|
|
13
|
+
:style="`min-width: ${+size + 1}px; min-height: ${+size + 1}px;`"
|
|
14
|
+
:class="$attrs.class"
|
|
15
|
+
/>
|
|
16
|
+
|
|
17
|
+
<!-- Emojis // Need v-bind to apply class in ssr mode -->
|
|
18
|
+
<span
|
|
19
|
+
v-else-if="isValidEmoji"
|
|
20
|
+
:style="`font-size: ${+size - 2}px;line-height: ${size}px;`"
|
|
21
|
+
v-bind="$attrs"
|
|
22
|
+
>
|
|
23
|
+
{{ name }}
|
|
24
|
+
</span>
|
|
25
|
+
|
|
26
|
+
<!-- Link -->
|
|
27
|
+
<NuxtImg
|
|
28
|
+
v-else
|
|
29
|
+
:src="name"
|
|
30
|
+
:style="`width: ${size}px; height: ${size}px;`"
|
|
31
|
+
:class="$attrs.class"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup lang="ts">
|
|
36
|
+
import { stringToIcon, validateIconName } from '@iconify/utils'
|
|
37
|
+
|
|
38
|
+
const { name, size = 16 } = defineProps<{
|
|
39
|
+
name: string
|
|
40
|
+
size?: number | string
|
|
41
|
+
}>()
|
|
42
|
+
|
|
43
|
+
const isValidIcon = computed(() => {
|
|
44
|
+
if (!name) return false
|
|
45
|
+
if (name.startsWith('http')) return false
|
|
46
|
+
return validateIconName(stringToIcon(name))
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const isValidEmoji = computed(() =>
|
|
50
|
+
/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g.test(
|
|
51
|
+
name,
|
|
52
|
+
),
|
|
53
|
+
)
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style scoped>
|
|
57
|
+
.svg-icon {
|
|
58
|
+
display: inline-block;
|
|
59
|
+
width: 1em;
|
|
60
|
+
height: 1em;
|
|
61
|
+
background-color: currentColor;
|
|
62
|
+
-webkit-mask-image: var(--svg);
|
|
63
|
+
mask-image: var(--svg);
|
|
64
|
+
-webkit-mask-repeat: no-repeat;
|
|
65
|
+
mask-repeat: no-repeat;
|
|
66
|
+
-webkit-mask-size: 100% 100%;
|
|
67
|
+
mask-size: 100% 100%;
|
|
68
|
+
}
|
|
69
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<kbd
|
|
3
|
+
class="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-muted font-sans font-medium"
|
|
4
|
+
:class="sizeClasses[size]"
|
|
5
|
+
>
|
|
6
|
+
<slot />
|
|
7
|
+
</kbd>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
const { size = 'sm' } = defineProps<{
|
|
12
|
+
size?: 'xs' | 'sm' | 'md'
|
|
13
|
+
}>()
|
|
14
|
+
|
|
15
|
+
const sizeClasses = {
|
|
16
|
+
xs: 'min-h-4 text-[10px] h-4 px-1',
|
|
17
|
+
sm: 'min-h-5 text-[11px] h-5 px-1',
|
|
18
|
+
md: 'min-h-6 text-[12px] h-6 px-1.5',
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MDC
|
|
3
|
+
:value="md"
|
|
4
|
+
class="[&:not(:first-child)]:mt-5"
|
|
5
|
+
/>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
const {
|
|
10
|
+
inStack = false,
|
|
11
|
+
name,
|
|
12
|
+
sync = '_pm',
|
|
13
|
+
saveDev = false,
|
|
14
|
+
noSync,
|
|
15
|
+
} = defineProps<{
|
|
16
|
+
inStack?: boolean
|
|
17
|
+
name?: string
|
|
18
|
+
sync?: string
|
|
19
|
+
saveDev?: boolean
|
|
20
|
+
noSync?: boolean
|
|
21
|
+
}>()
|
|
22
|
+
|
|
23
|
+
const md = `
|
|
24
|
+
::code-group{${inStack ? 'in-stack' : ''} ${noSync ? '' : `sync="${sync}"`}}
|
|
25
|
+
${
|
|
26
|
+
usePm().packageManagers.value.map((pm) => {
|
|
27
|
+
const code = name
|
|
28
|
+
? `${pm.command}${pm.install}${saveDev ? pm.saveDev : ''}${name}`
|
|
29
|
+
: `${pm.command}${pm.installEmpty}`
|
|
30
|
+
return `\`\`\`bash [${pm.name}]\n${code}\n\`\`\`\n`
|
|
31
|
+
}).join('\n')
|
|
32
|
+
}
|
|
33
|
+
::
|
|
34
|
+
`
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MDC
|
|
3
|
+
:value="md"
|
|
4
|
+
class="[&:not(:first-child)]:mt-5"
|
|
5
|
+
/>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
const {
|
|
10
|
+
inStack = false,
|
|
11
|
+
script,
|
|
12
|
+
sync = '_pm',
|
|
13
|
+
noSync,
|
|
14
|
+
} = defineProps<{
|
|
15
|
+
inStack?: boolean
|
|
16
|
+
script: string
|
|
17
|
+
sync?: string
|
|
18
|
+
noSync?: boolean
|
|
19
|
+
}>()
|
|
20
|
+
|
|
21
|
+
const md = `
|
|
22
|
+
::code-group{${inStack ? 'in-stack' : ''} ${noSync ? '' : `sync="${sync}"`}}
|
|
23
|
+
${
|
|
24
|
+
usePm().packageManagers.value.map((pm) => {
|
|
25
|
+
const code = `${pm.command}${pm.run}${script}`
|
|
26
|
+
return `\`\`\`bash [${pm.name}]\n${code}\n\`\`\`\n`
|
|
27
|
+
}).join('\n')
|
|
28
|
+
}
|
|
29
|
+
::
|
|
30
|
+
`
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MDC
|
|
3
|
+
:value="md"
|
|
4
|
+
class="[&:not(:first-child)]:mt-5"
|
|
5
|
+
/>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
const {
|
|
10
|
+
inStack = false,
|
|
11
|
+
command,
|
|
12
|
+
sync = '_pm',
|
|
13
|
+
noSync,
|
|
14
|
+
} = defineProps<{
|
|
15
|
+
inStack?: boolean
|
|
16
|
+
command: string
|
|
17
|
+
sync?: string
|
|
18
|
+
noSync?: boolean
|
|
19
|
+
}>()
|
|
20
|
+
|
|
21
|
+
const md = `
|
|
22
|
+
::code-group{${inStack ? 'in-stack' : ''} ${noSync ? '' : `sync="${sync}"`}}
|
|
23
|
+
${
|
|
24
|
+
usePm().packageManagers.value.map((pm) => {
|
|
25
|
+
const code = `${pm.x}${command}`
|
|
26
|
+
return `\`\`\`bash [${pm.name}]\n${code}\n\`\`\`\n`
|
|
27
|
+
}).join('\n')
|
|
28
|
+
}
|
|
29
|
+
::
|
|
30
|
+
`
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NuxtLink
|
|
3
|
+
:to="href"
|
|
4
|
+
:target="target"
|
|
5
|
+
:external="external"
|
|
6
|
+
class="font-semibold underline underline-offset-4"
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</NuxtLink>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
const {
|
|
14
|
+
href = '',
|
|
15
|
+
external = false,
|
|
16
|
+
} = defineProps<{
|
|
17
|
+
href?: string
|
|
18
|
+
target?: Target
|
|
19
|
+
external?: boolean
|
|
20
|
+
}>()
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UiCard
|
|
3
|
+
class="relative overflow-hidden [&:not(:first-child)]:mt-5 [&:not(:last-child)]:mb-5"
|
|
4
|
+
:class="[
|
|
5
|
+
inGroup && 'mb-0 rounded-t-none border-none shadow-none',
|
|
6
|
+
inStack && 'mb-0 rounded-none border-none shadow-none',
|
|
7
|
+
]"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
v-if="!inGroup && filename"
|
|
11
|
+
class="flex items-center border-b p-3 font-mono text-sm"
|
|
12
|
+
>
|
|
13
|
+
<Icon
|
|
14
|
+
v-if="icon"
|
|
15
|
+
:name="icon"
|
|
16
|
+
class="mr-1.5"
|
|
17
|
+
/>
|
|
18
|
+
<span>{{ filename }}</span>
|
|
19
|
+
<CodeCopy
|
|
20
|
+
:code
|
|
21
|
+
class="ml-auto mr-1"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<span
|
|
26
|
+
v-if="!filename"
|
|
27
|
+
class="absolute right-3 top-3 z-10"
|
|
28
|
+
>
|
|
29
|
+
<CodeCopy :code />
|
|
30
|
+
</span>
|
|
31
|
+
<div class="bg-muted/30">
|
|
32
|
+
<UiScrollArea :style="[parsedMeta.has('height') && `height: ${parsedMeta.get('height')}px`]">
|
|
33
|
+
<div
|
|
34
|
+
class="overflow-x-auto py-3 text-sm"
|
|
35
|
+
:class="[
|
|
36
|
+
!inGroup && !filename && 'inline-copy',
|
|
37
|
+
!language && 'pl-3', !inGroup,
|
|
38
|
+
parsedMeta.has('line-numbers') && 'show-line-number',
|
|
39
|
+
]"
|
|
40
|
+
>
|
|
41
|
+
<slot />
|
|
42
|
+
</div>
|
|
43
|
+
<ScrollBar orientation="horizontal" />
|
|
44
|
+
</UiScrollArea>
|
|
45
|
+
</div>
|
|
46
|
+
</UiCard>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script setup lang="ts">
|
|
50
|
+
import type { BuiltinLanguage } from 'shiki'
|
|
51
|
+
import ScrollBar from '../ui/scroll-area/ScrollBar.vue'
|
|
52
|
+
|
|
53
|
+
const {
|
|
54
|
+
code = '',
|
|
55
|
+
inGroup = false,
|
|
56
|
+
inStack = false,
|
|
57
|
+
language,
|
|
58
|
+
filename,
|
|
59
|
+
meta,
|
|
60
|
+
} = defineProps<{
|
|
61
|
+
code?: string
|
|
62
|
+
language?: BuiltinLanguage
|
|
63
|
+
filename?: string
|
|
64
|
+
inGroup?: boolean
|
|
65
|
+
inStack?: boolean
|
|
66
|
+
highlights?: number[]
|
|
67
|
+
meta?: string
|
|
68
|
+
}>()
|
|
69
|
+
|
|
70
|
+
const parsedMeta = computed(() => {
|
|
71
|
+
const split = meta?.split(' ') ?? []
|
|
72
|
+
const params = new Map<string, string | undefined>()
|
|
73
|
+
|
|
74
|
+
for (const param of split) {
|
|
75
|
+
const [key, val] = param.split('=')
|
|
76
|
+
params.set(key, val)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return params
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const iconMap = new Map(Object.entries(useConfig().value.main.codeIcon))
|
|
83
|
+
const icon = computed(() => {
|
|
84
|
+
const filenameLow = filename?.toLowerCase()
|
|
85
|
+
return parsedMeta.value.get('icon') || (filenameLow && iconMap.get(filenameLow)) || (language && iconMap.get(language))
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
// const _slots: SetupContext['slots'] = useSlots()
|
|
89
|
+
|
|
90
|
+
// const slots = _slots?.default?.() ?? []
|
|
91
|
+
// console.log(slots)
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<style>
|
|
95
|
+
.fade-enter-active {
|
|
96
|
+
transition: opacity 0.5s ease;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.fade-enter-from,
|
|
100
|
+
.fade-leave-to {
|
|
101
|
+
opacity: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.shiki .line.highlight {
|
|
105
|
+
background-color: hsl(var(--muted) / 0.9);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.shiki .line {
|
|
109
|
+
padding-left: 0.75rem;
|
|
110
|
+
padding-right: 0.75rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.inline-copy .line {
|
|
114
|
+
padding-right: 2.75rem;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.show-line-number .line::before {
|
|
118
|
+
content: attr(line);
|
|
119
|
+
@apply text-sm w-5 inline-block text-right mr-4 text-muted-foreground;
|
|
120
|
+
}
|
|
121
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<code class="inline-code relative rounded bg-muted px-[0.3rem] pt-[0.2rem] font-mono">
|
|
3
|
+
<slot />
|
|
4
|
+
</code>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<style scoped>
|
|
8
|
+
.inline-code {
|
|
9
|
+
/* :not(h1>code, h1>a>code, h2>a>code, h3>a>code, h4>a>code, h5>a>code, strong>a>code) { */
|
|
10
|
+
/* text-sm
|
|
11
|
+
font-size: 0.875rem;
|
|
12
|
+
line-height: 1.25rem;*/
|
|
13
|
+
font-size: 0.875em;
|
|
14
|
+
line-height: 1.25rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
p .inline-code {
|
|
18
|
+
vertical-align: -0.05rem;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
strong .inline-code {
|
|
22
|
+
font-weight: inherit;
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h1
|
|
3
|
+
:id
|
|
4
|
+
class="prose-h1 scroll-m-20 text-4xl font-extrabold tracking-tight text-pretty lg:text-5xl"
|
|
5
|
+
>
|
|
6
|
+
<NuxtLink
|
|
7
|
+
v-if="generate"
|
|
8
|
+
:to="`#${id}`"
|
|
9
|
+
>
|
|
10
|
+
<slot />
|
|
11
|
+
</NuxtLink>
|
|
12
|
+
<slot v-else />
|
|
13
|
+
</h1>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
const { id } = defineProps<{ id?: string }>()
|
|
18
|
+
|
|
19
|
+
const { headings } = useRuntimeConfig().public.mdc
|
|
20
|
+
const generate = computed(
|
|
21
|
+
() =>
|
|
22
|
+
id
|
|
23
|
+
&& ((typeof headings?.anchorLinks === 'boolean'
|
|
24
|
+
&& headings?.anchorLinks === true)
|
|
25
|
+
|| (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h1)),
|
|
26
|
+
)
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h2
|
|
3
|
+
:id
|
|
4
|
+
class="prose-h2 scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight transition-colors [&:not(:first-child)]:mt-10"
|
|
5
|
+
>
|
|
6
|
+
<NuxtLink
|
|
7
|
+
v-if="id && generate"
|
|
8
|
+
:to="`#${id}`"
|
|
9
|
+
>
|
|
10
|
+
<slot />
|
|
11
|
+
</NuxtLink>
|
|
12
|
+
<slot v-else />
|
|
13
|
+
</h2>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
const { id } = defineProps<{ id?: string }>()
|
|
18
|
+
|
|
19
|
+
// TODO: keep id of the heading in mdcEditor
|
|
20
|
+
const { headings } = useRuntimeConfig().public.mdc
|
|
21
|
+
const generate = computed(() => id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h2)))
|
|
22
|
+
</script>
|