@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,263 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UiTabs
|
|
3
|
+
v-if="variant === 'separate'"
|
|
4
|
+
v-model="activeTabIndex"
|
|
5
|
+
class="[&:not(:first-child)]:mt-5"
|
|
6
|
+
>
|
|
7
|
+
<UiTabsList>
|
|
8
|
+
<UiTabsTrigger
|
|
9
|
+
v-for="(slot, i) in $slots.default?.() ?? []"
|
|
10
|
+
:key="`${i}${label(slot.props)}`"
|
|
11
|
+
:value="i"
|
|
12
|
+
>
|
|
13
|
+
<Icon
|
|
14
|
+
v-if="icon(slot?.props)"
|
|
15
|
+
:name="icon(slot?.props)!"
|
|
16
|
+
class="mr-1.5 self-center"
|
|
17
|
+
/>
|
|
18
|
+
{{ label(slot.props) }}
|
|
19
|
+
</UiTabsTrigger>
|
|
20
|
+
</UiTabsList>
|
|
21
|
+
|
|
22
|
+
<div
|
|
23
|
+
v-for="(slot, i) in $slots.default?.() ?? []"
|
|
24
|
+
v-show="activeTabIndex === i"
|
|
25
|
+
:key="`${i}${label(slot.props)}`"
|
|
26
|
+
class="mt-2"
|
|
27
|
+
>
|
|
28
|
+
<component :is="slot" />
|
|
29
|
+
</div>
|
|
30
|
+
</UiTabs>
|
|
31
|
+
|
|
32
|
+
<UiTabs
|
|
33
|
+
v-else-if="variant === 'line'"
|
|
34
|
+
v-model="activeTabIndex"
|
|
35
|
+
class="relative mr-auto w-full [&:not(:first-child)]:mt-5"
|
|
36
|
+
>
|
|
37
|
+
<div class="flex items-center justify-between pb-3">
|
|
38
|
+
<UiTabsList
|
|
39
|
+
class="h-9 w-full justify-start rounded-none border-b bg-transparent p-0"
|
|
40
|
+
>
|
|
41
|
+
<UiTabsTrigger
|
|
42
|
+
v-for="(slot, i) in $slots.default?.() ?? []"
|
|
43
|
+
:key="`${i}${label(slot.props)}`"
|
|
44
|
+
:value="i"
|
|
45
|
+
class="relative h-9 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 font-semibold text-muted-foreground shadow-none transition-none data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none"
|
|
46
|
+
>
|
|
47
|
+
<Icon
|
|
48
|
+
v-if="icon(slot?.props)"
|
|
49
|
+
:name="icon(slot?.props)!"
|
|
50
|
+
class="mr-1.5 self-center"
|
|
51
|
+
/>
|
|
52
|
+
{{ label(slot.props) }}
|
|
53
|
+
</UiTabsTrigger>
|
|
54
|
+
</UiTabsList>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div
|
|
58
|
+
v-for="(slot, i) in $slots.default?.() ?? []"
|
|
59
|
+
v-show="activeTabIndex === i"
|
|
60
|
+
:key="`${i}${label(slot.props)}`"
|
|
61
|
+
class="relative mt-2 space-y-10"
|
|
62
|
+
>
|
|
63
|
+
<component :is="slot" />
|
|
64
|
+
</div>
|
|
65
|
+
</UiTabs>
|
|
66
|
+
|
|
67
|
+
<UiCard
|
|
68
|
+
v-else-if="variant === 'card'"
|
|
69
|
+
class="[&:not(:first-child)]:mt-5"
|
|
70
|
+
:class="[inStack && 'mb-0 rounded-none border-none shadow-none']"
|
|
71
|
+
>
|
|
72
|
+
<UiScrollArea>
|
|
73
|
+
<div class="relative flex overflow-x-auto border-b p-0.5 text-sm">
|
|
74
|
+
<div class="flex p-1">
|
|
75
|
+
<div
|
|
76
|
+
v-for="(slot, i) in $slots.default?.() ?? []"
|
|
77
|
+
:key="`${i}${label(slot.props)}`"
|
|
78
|
+
:value="label(slot.props)"
|
|
79
|
+
class="flex cursor-pointer rounded-md px-3 py-1.5 text-muted-foreground transition-all duration-75"
|
|
80
|
+
:class="[activeTabIndex === i && 'bg-muted text-primary']"
|
|
81
|
+
@mousedown.left="activeTabIndex = i"
|
|
82
|
+
>
|
|
83
|
+
<Icon
|
|
84
|
+
v-if="icon(slot?.props)"
|
|
85
|
+
:name="icon(slot?.props)!"
|
|
86
|
+
class="mr-1.5 self-center"
|
|
87
|
+
/>
|
|
88
|
+
{{ label(slot.props) }}
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
<CodeCopy
|
|
92
|
+
v-if="$slots.default?.()[activeTabIndex]?.props?.code"
|
|
93
|
+
class="ml-auto mr-3 self-center pl-2"
|
|
94
|
+
:code="$slots.default?.()[activeTabIndex]?.props?.code"
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
<ScrollBar orientation="horizontal" />
|
|
98
|
+
</UiScrollArea>
|
|
99
|
+
|
|
100
|
+
<div
|
|
101
|
+
v-for="(slot, i) in $slots.default?.() ?? []"
|
|
102
|
+
v-show="activeTabIndex === i"
|
|
103
|
+
:key="`${i}${label(slot.props)}`"
|
|
104
|
+
:value="label(slot.props)"
|
|
105
|
+
class="mt-0"
|
|
106
|
+
:class="[padded && ($slots.default?.()[activeTabIndex]?.type as any).tag !== 'pre' && 'p-3']"
|
|
107
|
+
>
|
|
108
|
+
<component
|
|
109
|
+
:is="slot"
|
|
110
|
+
:in-group="true"
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</UiCard>
|
|
114
|
+
|
|
115
|
+
<div v-else-if="variant === 'combobox'">
|
|
116
|
+
<UiPopover v-model:open="dropDownOpen">
|
|
117
|
+
<UiPopoverTrigger as-child>
|
|
118
|
+
<UiButton
|
|
119
|
+
variant="outline"
|
|
120
|
+
role="combobox"
|
|
121
|
+
:aria-expanded="dropDownOpen"
|
|
122
|
+
class="w-[200px] justify-between"
|
|
123
|
+
>
|
|
124
|
+
<div class="flex items-center">
|
|
125
|
+
<Icon
|
|
126
|
+
v-if="icon(($slots.default?.() ?? [])[activeTabIndex].props)"
|
|
127
|
+
:name="icon(($slots.default?.() ?? [])[activeTabIndex].props)!"
|
|
128
|
+
class="mr-1.5"
|
|
129
|
+
/>
|
|
130
|
+
<span>
|
|
131
|
+
{{ label(($slots.default?.() ?? [])[activeTabIndex].props) }}
|
|
132
|
+
</span>
|
|
133
|
+
</div>
|
|
134
|
+
<NuxtIcon name="lucide:chevrons-up-down" />
|
|
135
|
+
</UiButton>
|
|
136
|
+
</UiPopoverTrigger>
|
|
137
|
+
<UiPopoverContent class="w-[200px] p-0">
|
|
138
|
+
<UiCommand>
|
|
139
|
+
<UiCommandInput
|
|
140
|
+
v-if="!disableSearch"
|
|
141
|
+
class="h-9"
|
|
142
|
+
:placeholder="searchPlaceholder"
|
|
143
|
+
/>
|
|
144
|
+
<UiCommandEmpty>{{ searchEmpty }}</UiCommandEmpty>
|
|
145
|
+
<UiCommandList>
|
|
146
|
+
<UiCommandGroup>
|
|
147
|
+
<UiCommandItem
|
|
148
|
+
v-for="(slot, i) in $slots.default?.() ?? []"
|
|
149
|
+
:key="`${i}${label(slot.props)}`"
|
|
150
|
+
:value="label(slot.props) || ''"
|
|
151
|
+
@select="
|
|
152
|
+
() => {
|
|
153
|
+
activeTabIndex = i;
|
|
154
|
+
dropDownOpen = false;
|
|
155
|
+
}
|
|
156
|
+
"
|
|
157
|
+
>
|
|
158
|
+
<Icon
|
|
159
|
+
v-if="icon(slot?.props)"
|
|
160
|
+
:name="icon(slot?.props)!"
|
|
161
|
+
class="mr-1.5 self-center"
|
|
162
|
+
/>
|
|
163
|
+
{{ label(slot.props) }}
|
|
164
|
+
<NuxtIcon
|
|
165
|
+
name="lucide:check"
|
|
166
|
+
:class="
|
|
167
|
+
cn(
|
|
168
|
+
'ml-auto h-4 w-4',
|
|
169
|
+
activeTabIndex === i ? 'opacity-100' : 'opacity-0',
|
|
170
|
+
)
|
|
171
|
+
"
|
|
172
|
+
/>
|
|
173
|
+
</UiCommandItem>
|
|
174
|
+
</UiCommandGroup>
|
|
175
|
+
</UiCommandList>
|
|
176
|
+
</UiCommand>
|
|
177
|
+
</UiPopoverContent>
|
|
178
|
+
</UiPopover>
|
|
179
|
+
|
|
180
|
+
<div
|
|
181
|
+
v-for="(slot, i) in $slots.default?.() ?? []"
|
|
182
|
+
v-show="activeTabIndex === i"
|
|
183
|
+
:key="`${i}${label(slot.props)}`"
|
|
184
|
+
:value="label(slot.props)"
|
|
185
|
+
class="mt-4"
|
|
186
|
+
>
|
|
187
|
+
<component
|
|
188
|
+
:is="slot"
|
|
189
|
+
:in-group="true"
|
|
190
|
+
/>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</template>
|
|
194
|
+
|
|
195
|
+
<script setup lang="ts">
|
|
196
|
+
import ScrollBar from '../ui/scroll-area/ScrollBar.vue'
|
|
197
|
+
import { cn } from '@/lib/utils'
|
|
198
|
+
|
|
199
|
+
const { sync, slotsData } = defineProps<{
|
|
200
|
+
slotsData: { label: string, index: number }[]
|
|
201
|
+
variant?: 'separate' | 'card' | 'line' | 'combobox'
|
|
202
|
+
padded?: boolean
|
|
203
|
+
inStack?: boolean
|
|
204
|
+
disableSearch?: boolean
|
|
205
|
+
searchPlaceholder?: string
|
|
206
|
+
searchEmpty?: string
|
|
207
|
+
sync?: string
|
|
208
|
+
}>()
|
|
209
|
+
|
|
210
|
+
defineSlots()
|
|
211
|
+
|
|
212
|
+
const syncState = useCookie<{ scope: string, value?: string }[]>(
|
|
213
|
+
'tabs-sync-state',
|
|
214
|
+
{
|
|
215
|
+
default: () => [],
|
|
216
|
+
},
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
const syncScopeIndex = computed(() =>
|
|
220
|
+
syncState.value.findIndex(x => x.scope === sync),
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
const activeTabIndexData = ref(0)
|
|
224
|
+
const activeTabIndex = computed<number>({
|
|
225
|
+
get: () => {
|
|
226
|
+
if (sync === undefined || syncScopeIndex.value === -1)
|
|
227
|
+
return activeTabIndexData.value
|
|
228
|
+
|
|
229
|
+
return (
|
|
230
|
+
slotsData.find(
|
|
231
|
+
x => x.label === syncState.value[syncScopeIndex.value]?.value,
|
|
232
|
+
)?.index || activeTabIndexData.value
|
|
233
|
+
)
|
|
234
|
+
},
|
|
235
|
+
set(index: number) {
|
|
236
|
+
if (sync === undefined) {
|
|
237
|
+
activeTabIndexData.value = index
|
|
238
|
+
return
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (syncScopeIndex.value === -1)
|
|
242
|
+
syncState.value.push({ scope: sync, value: undefined })
|
|
243
|
+
|
|
244
|
+
syncState.value[syncScopeIndex.value].value = slotsData[index].label
|
|
245
|
+
activeTabIndexData.value = index
|
|
246
|
+
},
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
const iconMap = new Map(Object.entries(useConfig().value.main.codeIcon))
|
|
250
|
+
function icon(props: { icon?: string, filename?: string, language?: string }) {
|
|
251
|
+
return (
|
|
252
|
+
props?.icon
|
|
253
|
+
|| iconMap.get(props?.filename?.toLowerCase())
|
|
254
|
+
|| iconMap.get(props?.language)
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function label(props: { label?: string, filename?: string }) {
|
|
259
|
+
return props?.label || props?.filename
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const dropDownOpen = ref(false)
|
|
263
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UiCard>
|
|
3
|
+
<UiCardHeader>
|
|
4
|
+
<div
|
|
5
|
+
class="flex flex-col gap-3"
|
|
6
|
+
:class="{ 'text-center': center }"
|
|
7
|
+
>
|
|
8
|
+
<UiAvatar :class="{ 'mx-auto': center }">
|
|
9
|
+
<UiAvatarImage
|
|
10
|
+
:src="avatar"
|
|
11
|
+
:alt="name"
|
|
12
|
+
/>
|
|
13
|
+
</UiAvatar>
|
|
14
|
+
<div>
|
|
15
|
+
<div class="text-lg font-bold">
|
|
16
|
+
{{ name }}
|
|
17
|
+
</div>
|
|
18
|
+
<div class="text-sm text-muted-foreground">
|
|
19
|
+
{{ title }}
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div
|
|
23
|
+
class="flex gap-3 text-secondary-foreground"
|
|
24
|
+
:class="{ 'mx-auto': center }"
|
|
25
|
+
>
|
|
26
|
+
<NuxtLink
|
|
27
|
+
v-for="link in links"
|
|
28
|
+
:key="link.to"
|
|
29
|
+
:to="link.to"
|
|
30
|
+
:target="link.target"
|
|
31
|
+
>
|
|
32
|
+
<Icon :name="link.icon" />
|
|
33
|
+
</NuxtLink>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</UiCardHeader>
|
|
37
|
+
</UiCard>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script setup lang="ts">
|
|
41
|
+
const { center = true } = defineProps<{
|
|
42
|
+
avatar: string
|
|
43
|
+
name: string
|
|
44
|
+
title?: string
|
|
45
|
+
links?: ({
|
|
46
|
+
icon: string
|
|
47
|
+
to: string
|
|
48
|
+
target?: Target
|
|
49
|
+
})[]
|
|
50
|
+
center?: boolean
|
|
51
|
+
}>()
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="group relative">
|
|
3
|
+
<UiEditorDropdown
|
|
4
|
+
v-model="mdcAttrs.type"
|
|
5
|
+
chevron
|
|
6
|
+
tooltip="Type"
|
|
7
|
+
placement="bottom-end"
|
|
8
|
+
:items="types"
|
|
9
|
+
class="absolute right-1 top-1 z-10 opacity-25 transition-opacity group-hover:opacity-100"
|
|
10
|
+
>
|
|
11
|
+
<span class="text-xs font-mono capitalize">{{ model.type }}</span>
|
|
12
|
+
</UiEditorDropdown>
|
|
13
|
+
|
|
14
|
+
<Alert v-bind="model">
|
|
15
|
+
<div :ref="props.contentRef" />
|
|
16
|
+
</Alert>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts" setup>
|
|
21
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
22
|
+
|
|
23
|
+
const props = defineProps<VueNodeViewProps>()
|
|
24
|
+
const { getComponentProps } = useMdcEditor()
|
|
25
|
+
|
|
26
|
+
const types = ['default', 'info', 'success', 'warning', 'danger', 'primary']
|
|
27
|
+
|
|
28
|
+
const { model, mdcAttrs } = getComponentProps(props, {
|
|
29
|
+
id: {
|
|
30
|
+
type: String,
|
|
31
|
+
},
|
|
32
|
+
class: {
|
|
33
|
+
type: String,
|
|
34
|
+
},
|
|
35
|
+
title: {
|
|
36
|
+
type: String,
|
|
37
|
+
},
|
|
38
|
+
icon: {
|
|
39
|
+
type: String,
|
|
40
|
+
},
|
|
41
|
+
type: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'default',
|
|
44
|
+
validator(value: string) {
|
|
45
|
+
return types.includes(value)
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
to: {
|
|
49
|
+
type: String,
|
|
50
|
+
},
|
|
51
|
+
target: {
|
|
52
|
+
type: String,
|
|
53
|
+
},
|
|
54
|
+
external: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
},
|
|
57
|
+
})
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Badge
|
|
3
|
+
v-bind="model"
|
|
4
|
+
class="[&>div]:inline"
|
|
5
|
+
>
|
|
6
|
+
<span :ref="props.contentRef" />
|
|
7
|
+
</Badge>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts" setup>
|
|
11
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
12
|
+
|
|
13
|
+
const props = defineProps<VueNodeViewProps>()
|
|
14
|
+
|
|
15
|
+
const types = ['default', 'info', 'warning', 'success', 'danger']
|
|
16
|
+
const variants = ['default', 'secondary', 'destructive', 'outline']
|
|
17
|
+
const sizes = ['md', 'sm']
|
|
18
|
+
|
|
19
|
+
const { getComponentProps } = useMdcEditor()
|
|
20
|
+
const { model } = getComponentProps(props, {
|
|
21
|
+
id: {
|
|
22
|
+
type: String,
|
|
23
|
+
},
|
|
24
|
+
class: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: '',
|
|
27
|
+
},
|
|
28
|
+
type: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: 'default',
|
|
31
|
+
validator(value: string) {
|
|
32
|
+
return types.includes(value)
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
to: {
|
|
36
|
+
type: String,
|
|
37
|
+
},
|
|
38
|
+
target: {
|
|
39
|
+
type: String,
|
|
40
|
+
},
|
|
41
|
+
variant: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'default',
|
|
44
|
+
validator(value: string) {
|
|
45
|
+
return variants.includes(value)
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: 'md',
|
|
51
|
+
validator(value: string) {
|
|
52
|
+
return sizes.includes(value)
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
})
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Card v-bind="model">
|
|
3
|
+
<template
|
|
4
|
+
v-if="$slots.title"
|
|
5
|
+
#title
|
|
6
|
+
>
|
|
7
|
+
<ContentSlot
|
|
8
|
+
:use="$slots.title"
|
|
9
|
+
unwrap="p"
|
|
10
|
+
/>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<UiCardDescription v-if="model.description || $slots.description">
|
|
14
|
+
<template
|
|
15
|
+
v-if="$slots.description"
|
|
16
|
+
#description
|
|
17
|
+
>
|
|
18
|
+
<ContentSlot
|
|
19
|
+
:use="$slots.description"
|
|
20
|
+
unwrap="p"
|
|
21
|
+
/>
|
|
22
|
+
</template>
|
|
23
|
+
<MDC
|
|
24
|
+
v-if="model.description"
|
|
25
|
+
:value="model.description"
|
|
26
|
+
unwrap="p"
|
|
27
|
+
/>
|
|
28
|
+
</UiCardDescription>
|
|
29
|
+
|
|
30
|
+
<template
|
|
31
|
+
v-if="$slots.content"
|
|
32
|
+
#content
|
|
33
|
+
>
|
|
34
|
+
<ContentSlot
|
|
35
|
+
:use="$slots.content"
|
|
36
|
+
unwrap="p"
|
|
37
|
+
/>
|
|
38
|
+
</template>
|
|
39
|
+
<template
|
|
40
|
+
v-if="$slots.footer"
|
|
41
|
+
#footer
|
|
42
|
+
>
|
|
43
|
+
<ContentSlot
|
|
44
|
+
:use="$slots.footer"
|
|
45
|
+
unwrap="p"
|
|
46
|
+
/>
|
|
47
|
+
</template>
|
|
48
|
+
</Card>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script setup lang="ts">
|
|
52
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
53
|
+
// import { docToMarkdown, markdownToDoc } from '@unpress/mdc-prosemirror'
|
|
54
|
+
// import type { SetupContext } from 'vue'
|
|
55
|
+
|
|
56
|
+
const props = defineProps<VueNodeViewProps>()
|
|
57
|
+
|
|
58
|
+
// const _slots: SetupContext['slots'] = useSlots()
|
|
59
|
+
// // console.log(props, props.node.value.children.filter(child => child.attrs.componentName === 'title'))
|
|
60
|
+
|
|
61
|
+
// const title = computed({
|
|
62
|
+
// get: () => {
|
|
63
|
+
// const slots = _slots?.title?.() || []
|
|
64
|
+
// console.log(slots, props.node.value.children.filter(child => child.attrs.componentName === 'description'))
|
|
65
|
+
// const desc = props.node.value.children.filter(child => child.attrs.componentName === 'description')
|
|
66
|
+
// if (desc.length)
|
|
67
|
+
// return desc[0].textContent
|
|
68
|
+
|
|
69
|
+
// return ''
|
|
70
|
+
// },
|
|
71
|
+
// set: (value) => {
|
|
72
|
+
// props.node.attrs.title = markdownToDoc(value)
|
|
73
|
+
// },
|
|
74
|
+
// })
|
|
75
|
+
const { getComponentProps } = useMdcEditor()
|
|
76
|
+
|
|
77
|
+
const { model } = getComponentProps(props, {
|
|
78
|
+
id: {
|
|
79
|
+
type: String,
|
|
80
|
+
},
|
|
81
|
+
class: {
|
|
82
|
+
type: String,
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
title: {
|
|
86
|
+
type: String,
|
|
87
|
+
},
|
|
88
|
+
description: {
|
|
89
|
+
type: String,
|
|
90
|
+
},
|
|
91
|
+
content: {
|
|
92
|
+
type: String,
|
|
93
|
+
},
|
|
94
|
+
footer: {
|
|
95
|
+
type: String,
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
to: {
|
|
99
|
+
type: String,
|
|
100
|
+
},
|
|
101
|
+
target: {
|
|
102
|
+
type: String,
|
|
103
|
+
},
|
|
104
|
+
showLinkIcon: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: true,
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
icon: {
|
|
110
|
+
type: String,
|
|
111
|
+
},
|
|
112
|
+
iconSize: {
|
|
113
|
+
type: Number,
|
|
114
|
+
default: 24,
|
|
115
|
+
},
|
|
116
|
+
iconPosition: {
|
|
117
|
+
type: String,
|
|
118
|
+
default: 'left',
|
|
119
|
+
validator(value: string) {
|
|
120
|
+
return ['left', 'right', 'top', 'bottom'].includes(value)
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
media: {
|
|
125
|
+
type: String,
|
|
126
|
+
},
|
|
127
|
+
mediaPosition: {
|
|
128
|
+
type: String,
|
|
129
|
+
default: 'top',
|
|
130
|
+
validator(value: string) {
|
|
131
|
+
return ['left', 'right', 'top', 'bottom', 'cover', 'center'].includes(value)
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
inStack: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: false,
|
|
138
|
+
},
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
defineSlots()
|
|
142
|
+
</script>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="[&:not(:first-child)]:mt-5">
|
|
3
|
+
<UiEditorHorizontalControls class="mb--1">
|
|
4
|
+
<UiEditorInput
|
|
5
|
+
v-model="mdcAttrs.data"
|
|
6
|
+
input-classes="INPUT_GHOST"
|
|
7
|
+
label="Source"
|
|
8
|
+
type="text"
|
|
9
|
+
placeholder="Enter a path"
|
|
10
|
+
class="flex-grow"
|
|
11
|
+
/>
|
|
12
|
+
</UiEditorHorizontalControls>
|
|
13
|
+
|
|
14
|
+
<CardGroup
|
|
15
|
+
v-bind="mdcAttrs"
|
|
16
|
+
class="[&>div>div]:grid [&>div>div]:gap-4 [&>div>div]:md:grid-cols-2 [&>div>div>div>div]:md:h-full [&>div>div>div>div>a]:pointer-events-none"
|
|
17
|
+
:class="!mdcAttrs.data && 'block'"
|
|
18
|
+
>
|
|
19
|
+
<div
|
|
20
|
+
:ref="props.contentRef"
|
|
21
|
+
class=""
|
|
22
|
+
/>
|
|
23
|
+
</CardGroup>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
29
|
+
|
|
30
|
+
const props = defineProps<VueNodeViewProps>()
|
|
31
|
+
const { getComponentProps } = useMdcEditor()
|
|
32
|
+
|
|
33
|
+
const { mdcAttrs } = getComponentProps(props, {
|
|
34
|
+
id: {
|
|
35
|
+
type: String,
|
|
36
|
+
},
|
|
37
|
+
class: {
|
|
38
|
+
type: String,
|
|
39
|
+
},
|
|
40
|
+
data: {
|
|
41
|
+
type: [String, Array, Object],
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
// watch(() => mdcAttrs.data, async (value) => {
|
|
46
|
+
// console.log(value, 'tasta')
|
|
47
|
+
// const data = await queryContent(value).find()
|
|
48
|
+
// console.log(data)
|
|
49
|
+
// }, { immediate: true })
|
|
50
|
+
</script>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<render />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
const _slots = useSlots()
|
|
7
|
+
const Tabs = resolveComponent('Tabs')
|
|
8
|
+
function render() {
|
|
9
|
+
const slots = _slots?.default?.() || []
|
|
10
|
+
// console.log('p', slots)
|
|
11
|
+
return h(Tabs, { variant: 'card' }, () => slots)
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<render />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
7
|
+
import type { SetupContext } from 'vue'
|
|
8
|
+
|
|
9
|
+
// import { useMdcEditor } from '#imports'
|
|
10
|
+
|
|
11
|
+
const props = defineProps<VueNodeViewProps>()
|
|
12
|
+
|
|
13
|
+
// const { getComponentProps } = useMdcEditor()
|
|
14
|
+
// const { model, mdcAttrs } = getComponentProps(props, {
|
|
15
|
+
// id: {
|
|
16
|
+
// type: String,
|
|
17
|
+
// },
|
|
18
|
+
// class: {
|
|
19
|
+
// type: String,
|
|
20
|
+
// default: '',
|
|
21
|
+
// },
|
|
22
|
+
// })
|
|
23
|
+
|
|
24
|
+
const _slots: SetupContext['slots'] = useSlots()
|
|
25
|
+
function render() {
|
|
26
|
+
const slots2 = _slots?.default?.() || []
|
|
27
|
+
const Tabs = resolveComponent('Tabs')
|
|
28
|
+
// console.log(slots2, model, mdcAttrs, Tabs, props.node.value.content.content)
|
|
29
|
+
const slots = props.node.value.content.content.map((tab) => {
|
|
30
|
+
// console.log('tab', tab)
|
|
31
|
+
const filename = tab.attrs?.meta?.replace('[', '').replace(']', '')
|
|
32
|
+
return h(
|
|
33
|
+
'div',
|
|
34
|
+
{
|
|
35
|
+
class:
|
|
36
|
+
tab.attrs.attributes?.class
|
|
37
|
+
|| 'language-bash shiki shiki-themes github-light github-dark',
|
|
38
|
+
// code: 'bun run dev\n',
|
|
39
|
+
filename,
|
|
40
|
+
language: tab.attrs.language,
|
|
41
|
+
meta: filename,
|
|
42
|
+
style: '',
|
|
43
|
+
label: tab.attrs.attributes?.label,
|
|
44
|
+
},
|
|
45
|
+
slots2,
|
|
46
|
+
)
|
|
47
|
+
})
|
|
48
|
+
return h(Tabs, { variant: 'card' }, () => slots)
|
|
49
|
+
}
|
|
50
|
+
</script>
|