@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,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:ref="props.contentRef"
|
|
4
|
+
v-bind="model"
|
|
5
|
+
/>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts" setup>
|
|
9
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
10
|
+
|
|
11
|
+
const props = defineProps<VueNodeViewProps>()
|
|
12
|
+
const { getComponentProps } = useMdcEditor()
|
|
13
|
+
const { model } = getComponentProps(props, {
|
|
14
|
+
id: {
|
|
15
|
+
type: String,
|
|
16
|
+
},
|
|
17
|
+
class: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '',
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Field v-bind="model">
|
|
3
|
+
<slot />
|
|
4
|
+
</Field>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<VueNodeViewProps>()
|
|
11
|
+
const { getComponentProps } = useMdcEditor()
|
|
12
|
+
|
|
13
|
+
const { model } = getComponentProps(props, {
|
|
14
|
+
id: {
|
|
15
|
+
type: String,
|
|
16
|
+
},
|
|
17
|
+
class: {
|
|
18
|
+
type: String,
|
|
19
|
+
},
|
|
20
|
+
name: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
default: 'Field',
|
|
24
|
+
},
|
|
25
|
+
type: {
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
required: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
},
|
|
31
|
+
description: {
|
|
32
|
+
type: String,
|
|
33
|
+
},
|
|
34
|
+
defaultValue: {
|
|
35
|
+
type: String,
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FieldGroup class="[&>div>div]:divide-y">
|
|
3
|
+
<slot />
|
|
4
|
+
</FieldGroup>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
// import type { VueNodeViewProps } from 'prosekit/vue'
|
|
9
|
+
|
|
10
|
+
// const props = defineProps<VueNodeViewProps>()
|
|
11
|
+
// const { getComponentProps } = useMdcEditor()
|
|
12
|
+
|
|
13
|
+
// const { model } = getComponentProps(props, {
|
|
14
|
+
// id: {
|
|
15
|
+
// type: String,
|
|
16
|
+
// },
|
|
17
|
+
// class: {
|
|
18
|
+
// type: String,
|
|
19
|
+
// },
|
|
20
|
+
// data: {
|
|
21
|
+
// type: [String, Array, Object],
|
|
22
|
+
// },
|
|
23
|
+
// })
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Hero
|
|
3
|
+
:id="model.id"
|
|
4
|
+
:announcement="model.announcement"
|
|
5
|
+
:actions="model.actions"
|
|
6
|
+
:class="model.class"
|
|
7
|
+
>
|
|
8
|
+
<template #title>
|
|
9
|
+
<ContentSlot
|
|
10
|
+
:use="$slots.title"
|
|
11
|
+
unwrap="p"
|
|
12
|
+
/>
|
|
13
|
+
</template>
|
|
14
|
+
<template #description>
|
|
15
|
+
<ContentSlot
|
|
16
|
+
:use="$slots.description"
|
|
17
|
+
unwrap="p"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
20
|
+
<template #support>
|
|
21
|
+
<ContentSlot
|
|
22
|
+
:use="$slots.support"
|
|
23
|
+
unwrap="p"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
26
|
+
</Hero>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script setup lang="ts">
|
|
30
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
31
|
+
|
|
32
|
+
// defineProps<{
|
|
33
|
+
// announcement?: {
|
|
34
|
+
// to?: string
|
|
35
|
+
// target?: string
|
|
36
|
+
// icon?: string
|
|
37
|
+
// title: string
|
|
38
|
+
// }
|
|
39
|
+
// actions: [{
|
|
40
|
+
// name: string
|
|
41
|
+
// leftIcon?: string
|
|
42
|
+
// rightIcon?: string
|
|
43
|
+
// variant?: 'default' | 'link' | 'destructive' | 'outline' | 'secondary' | 'ghost'
|
|
44
|
+
// to: string
|
|
45
|
+
// target?: string
|
|
46
|
+
// }]
|
|
47
|
+
// }>()
|
|
48
|
+
const props = defineProps<VueNodeViewProps>()
|
|
49
|
+
const { getComponentProps } = useMdcEditor()
|
|
50
|
+
|
|
51
|
+
const { model } = getComponentProps(props, {
|
|
52
|
+
id: {
|
|
53
|
+
type: String,
|
|
54
|
+
},
|
|
55
|
+
class: {
|
|
56
|
+
type: String,
|
|
57
|
+
},
|
|
58
|
+
announcement: {
|
|
59
|
+
type: Object,
|
|
60
|
+
},
|
|
61
|
+
actions: {
|
|
62
|
+
type: Array,
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
defineSlots()
|
|
67
|
+
</script>
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
3
|
+
// import { useMdcEditor } from '#imports'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<VueNodeViewProps>()
|
|
6
|
+
const { getComponentProps } = useMdcEditor()
|
|
7
|
+
const { model, mdcAttrs } = getComponentProps(props, {
|
|
8
|
+
id: {
|
|
9
|
+
type: String,
|
|
10
|
+
},
|
|
11
|
+
class: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: '',
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: '',
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const isFullWidth = computed(() => mdcAttrs.class?.includes('full-width'))
|
|
22
|
+
const isBreakout = computed(() => mdcAttrs.class?.includes('breakout'))
|
|
23
|
+
const isDisabled = ref(false)
|
|
24
|
+
const isColorMenuOpen = ref(false)
|
|
25
|
+
|
|
26
|
+
function toggleClass(classList: string, className: string) {
|
|
27
|
+
classList ||= ''
|
|
28
|
+
|
|
29
|
+
const classes = classList.trim().split(' ')
|
|
30
|
+
|
|
31
|
+
// Add or remove class if present
|
|
32
|
+
const index = classes.indexOf(className)
|
|
33
|
+
if (index !== -1)
|
|
34
|
+
classes.splice(index, 1)
|
|
35
|
+
else
|
|
36
|
+
classes.push(className)
|
|
37
|
+
|
|
38
|
+
if (!classes.length)
|
|
39
|
+
return null
|
|
40
|
+
|
|
41
|
+
return classes.filter(c => c.length).join(' ')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function onSetColor(color: string | null) {
|
|
45
|
+
mdcAttrs.color = color
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function onSetBreakout() {
|
|
49
|
+
mdcAttrs.class = toggleClass(mdcAttrs.class, 'breakout')
|
|
50
|
+
}
|
|
51
|
+
function onSetFullWidth() {
|
|
52
|
+
mdcAttrs.class = toggleClass(mdcAttrs.class, 'full-width')
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<template>
|
|
57
|
+
<ProseSection
|
|
58
|
+
v-bind="model"
|
|
59
|
+
class="relative group"
|
|
60
|
+
>
|
|
61
|
+
<div
|
|
62
|
+
contenteditable="false"
|
|
63
|
+
class="flex absolute h-4 right-0 left-0 opacity-0 transition-opacity top-[-1px] hover:opacity-100"
|
|
64
|
+
@mouseleave="isColorMenuOpen = false"
|
|
65
|
+
>
|
|
66
|
+
<div class="border-base border-t grow-1" />
|
|
67
|
+
<div class="flex mx-2 h-6.5 items-stretch overflow-hidden shadow-none -mt-3.25 SECTION_MENU">
|
|
68
|
+
<UiEditorToggle
|
|
69
|
+
:pressed="isBreakout"
|
|
70
|
+
:disabled="isDisabled"
|
|
71
|
+
tooltip="Larger text content width"
|
|
72
|
+
@click="onSetBreakout"
|
|
73
|
+
>
|
|
74
|
+
<svg
|
|
75
|
+
width="24"
|
|
76
|
+
height="12"
|
|
77
|
+
viewBox="0 0 24 14"
|
|
78
|
+
fill="currentColor"
|
|
79
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
80
|
+
>
|
|
81
|
+
<path
|
|
82
|
+
opacity="0.3"
|
|
83
|
+
d="M18.6667 2C18.6667 2.35362 18.5262 2.69276 18.2761 2.94281C18.0261 3.19286 17.687 3.33333 17.3333 3.33333H6.66667C6.31304 3.33333 5.97391 3.19286 5.72386 2.94281C5.47381 2.69276 5.33333 2.35362 5.33333 2C5.33333 1.64638 5.47381 1.30724 5.72386 1.05719C5.97391 0.807142 6.31304 0.666666 6.66667 0.666666H17.3333C17.687 0.666666 18.0261 0.807142 18.2761 1.05719C18.5262 1.30724 18.6667 1.64638 18.6667 2ZM17.3333 14C17.687 14 18.0261 13.8595 18.2761 13.6095C18.5262 13.3594 18.6667 13.0203 18.6667 12.6667C18.6667 12.313 18.5262 11.9739 18.2761 11.7239C18.0261 11.4738 17.687 11.3333 17.3333 11.3333H6.66667C6.31304 11.3333 5.97391 11.4738 5.72386 11.7239C5.47381 11.9739 5.33333 12.313 5.33333 12.6667C5.33333 13.0203 5.47381 13.3594 5.72386 13.6095C5.97391 13.8595 6.31304 14 6.66667 14H17.3333Z"
|
|
84
|
+
fill="currentColor"
|
|
85
|
+
/>
|
|
86
|
+
<path
|
|
87
|
+
fill-rule="evenodd"
|
|
88
|
+
clip-rule="evenodd"
|
|
89
|
+
d="M24 7.33333C24 7.68695 23.8595 8.02609 23.6095 8.27614C23.3594 8.52619 23.0203 8.66667 22.6667 8.66667H1.33333C0.979711 8.66667 0.640573 8.52619 0.390524 8.27614C0.140476 8.02609 0 7.68695 0 7.33333C0 6.97971 0.140476 6.64057 0.390524 6.39052C0.640573 6.14047 0.979711 6 1.33333 6H22.6667C23.0203 6 23.3594 6.14047 23.6095 6.39052C23.8595 6.64057 24 6.97971 24 7.33333Z"
|
|
90
|
+
fill="currentColor"
|
|
91
|
+
/>
|
|
92
|
+
</svg>
|
|
93
|
+
</UiEditorToggle>
|
|
94
|
+
|
|
95
|
+
<div class="border-base border-l" />
|
|
96
|
+
|
|
97
|
+
<UiEditorToggle
|
|
98
|
+
:pressed="isFullWidth"
|
|
99
|
+
:disabled="isDisabled"
|
|
100
|
+
tooltip="Full width background"
|
|
101
|
+
@click="onSetFullWidth"
|
|
102
|
+
>
|
|
103
|
+
<svg
|
|
104
|
+
width="24"
|
|
105
|
+
height="12"
|
|
106
|
+
viewBox="0 0 24 12"
|
|
107
|
+
fill="currentColor"
|
|
108
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
109
|
+
>
|
|
110
|
+
<rect
|
|
111
|
+
width="24"
|
|
112
|
+
height="12"
|
|
113
|
+
fill="currentColor"
|
|
114
|
+
fill-opacity="0.15"
|
|
115
|
+
/>
|
|
116
|
+
<path
|
|
117
|
+
d="M16.2 3L19 6M19 6L16.2 9M19 6H5M7.8 3L5 6M5 6L7.8 9"
|
|
118
|
+
stroke="currentColor"
|
|
119
|
+
stroke-width="1.2"
|
|
120
|
+
stroke-linecap="round"
|
|
121
|
+
stroke-linejoin="round"
|
|
122
|
+
/>
|
|
123
|
+
</svg>
|
|
124
|
+
</UiEditorToggle>
|
|
125
|
+
|
|
126
|
+
<div class="border-l border-base" />
|
|
127
|
+
|
|
128
|
+
<UiEditorDropdown
|
|
129
|
+
:offset="-1"
|
|
130
|
+
:open="isColorMenuOpen"
|
|
131
|
+
@on-open-change="isColorMenuOpen = $event"
|
|
132
|
+
>
|
|
133
|
+
<UiEditorToggle
|
|
134
|
+
:pressed="!!mdcAttrs.color"
|
|
135
|
+
:disabled="isDisabled"
|
|
136
|
+
tooltip="Color"
|
|
137
|
+
:offset="5"
|
|
138
|
+
class="h-full p0 pt-[2px]"
|
|
139
|
+
@click.prevent
|
|
140
|
+
>
|
|
141
|
+
<div class="i-mdi-format-color-fill mt0.75 h-5 min-w-10 opacity-80" />
|
|
142
|
+
</UiEditorToggle>
|
|
143
|
+
|
|
144
|
+
<template #menu>
|
|
145
|
+
<label>Couleur de fond :</label>
|
|
146
|
+
<div class="flex gap-2">
|
|
147
|
+
<UiEditorToggle
|
|
148
|
+
:pressed="!mdcAttrs.color"
|
|
149
|
+
@click="onSetColor(null)"
|
|
150
|
+
>
|
|
151
|
+
<div class="h-4 overflow-hidden border w-8">
|
|
152
|
+
<div class="bg-red-500 w-10 h-[2px] translate-x-[-3px] translate-y-[5px] rotate--25 transform" />
|
|
153
|
+
</div>
|
|
154
|
+
</UiEditorToggle>
|
|
155
|
+
<UiEditorToggle
|
|
156
|
+
v-for="color in ['bg-primary-500', 'bg-secondary-500', 'bg-gray-100']"
|
|
157
|
+
:key="color"
|
|
158
|
+
:pressed="mdcAttrs.color === color"
|
|
159
|
+
@click="onSetColor(color)"
|
|
160
|
+
>
|
|
161
|
+
<div
|
|
162
|
+
class="h-4 w-8"
|
|
163
|
+
:class="color"
|
|
164
|
+
/>
|
|
165
|
+
</UiEditorToggle>
|
|
166
|
+
</div>
|
|
167
|
+
</template>
|
|
168
|
+
</UiEditorDropdown>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
<div class="grow-1 border-t border-base" />
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<div :ref="props.contentRef" />
|
|
175
|
+
|
|
176
|
+
<template #section>
|
|
177
|
+
<slot name="section" />
|
|
178
|
+
</template>
|
|
179
|
+
</ProseSection>
|
|
180
|
+
</template>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="group relative"
|
|
4
|
+
contenteditable="false"
|
|
5
|
+
>
|
|
6
|
+
<Alert
|
|
7
|
+
v-bind="{ ...model, title: undefined, noClick: true }"
|
|
8
|
+
class="[&_span.w-full]:flex [&_span.w-full]:items-center"
|
|
9
|
+
>
|
|
10
|
+
<!-- <input
|
|
11
|
+
v-model="model.prefix"
|
|
12
|
+
class="inline-block w-min outline-none focus-within:bg-muted"
|
|
13
|
+
> -->
|
|
14
|
+
<div
|
|
15
|
+
contenteditable="true"
|
|
16
|
+
class="inline-block w-min outline-none hover:bg-muted/50 focus-within:bg-muted whitespace-nowrap mr-2"
|
|
17
|
+
@input="updatePrefix"
|
|
18
|
+
v-text="model.prefix"
|
|
19
|
+
/>
|
|
20
|
+
|
|
21
|
+
<UiEditorLinkInput
|
|
22
|
+
class="inline-flex flex-1 my--2 [&>div]:w-full"
|
|
23
|
+
dropdown-classes="DROPDOWN_MENU absolute mt-8 !w-[500px]"
|
|
24
|
+
:model-value="model.to"
|
|
25
|
+
@update:model-value="updateLink"
|
|
26
|
+
/>
|
|
27
|
+
</Alert>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script lang="ts" setup>
|
|
32
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
33
|
+
|
|
34
|
+
const props = defineProps<VueNodeViewProps>()
|
|
35
|
+
const { getComponentProps } = useMdcEditor()
|
|
36
|
+
|
|
37
|
+
const { model } = getComponentProps(props, {
|
|
38
|
+
id: {
|
|
39
|
+
type: String,
|
|
40
|
+
},
|
|
41
|
+
class: {
|
|
42
|
+
type: String,
|
|
43
|
+
},
|
|
44
|
+
icon: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: 'lucide:bookmark',
|
|
47
|
+
},
|
|
48
|
+
prefix: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: 'Read more at',
|
|
51
|
+
},
|
|
52
|
+
to: {
|
|
53
|
+
type: String,
|
|
54
|
+
},
|
|
55
|
+
title: {
|
|
56
|
+
type: String,
|
|
57
|
+
},
|
|
58
|
+
target: {
|
|
59
|
+
type: String,
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
function updatePrefix(event: Event) {
|
|
64
|
+
const target = event.target as HTMLDivElement
|
|
65
|
+
model.prefix = target.innerHTML
|
|
66
|
+
}
|
|
67
|
+
function updateLink(to: string) {
|
|
68
|
+
model.to = to
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section
|
|
3
|
+
:ref="props.contentRef"
|
|
4
|
+
v-bind="model"
|
|
5
|
+
/>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts" setup>
|
|
9
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
10
|
+
|
|
11
|
+
const props = defineProps<VueNodeViewProps>()
|
|
12
|
+
const { getComponentProps } = useMdcEditor()
|
|
13
|
+
const { model } = getComponentProps(props, {
|
|
14
|
+
id: {
|
|
15
|
+
type: String,
|
|
16
|
+
},
|
|
17
|
+
class: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '',
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UiCard
|
|
3
|
+
class="divide-y overflow-hidden [&:not(:first-child)]:mt-5"
|
|
4
|
+
v-bind="model"
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
v-for="(slot, i) in $slots.default?.() ?? []"
|
|
8
|
+
:key="i"
|
|
9
|
+
>
|
|
10
|
+
<component
|
|
11
|
+
:is="slot"
|
|
12
|
+
:in-stack="true"
|
|
13
|
+
/>
|
|
14
|
+
<!-- <span :ref="props.contentRef" /> -->
|
|
15
|
+
</div>
|
|
16
|
+
</UiCard>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts" setup>
|
|
20
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
21
|
+
|
|
22
|
+
defineSlots()
|
|
23
|
+
const props = defineProps<VueNodeViewProps>()
|
|
24
|
+
|
|
25
|
+
const { getComponentProps } = useMdcEditor()
|
|
26
|
+
const { model } = getComponentProps(props, {
|
|
27
|
+
id: {
|
|
28
|
+
type: String,
|
|
29
|
+
},
|
|
30
|
+
class: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: '',
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="relative">
|
|
3
|
+
<UiEditorDropdown
|
|
4
|
+
v-model="mdcAttrs.level"
|
|
5
|
+
chevron
|
|
6
|
+
tooltip="Level"
|
|
7
|
+
placement="bottom-end"
|
|
8
|
+
:items="levels"
|
|
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">h{{ model.level }}</span>
|
|
12
|
+
</UiEditorDropdown>
|
|
13
|
+
|
|
14
|
+
<Steps
|
|
15
|
+
v-bind="model"
|
|
16
|
+
:class="levelClass[model.level]"
|
|
17
|
+
>
|
|
18
|
+
<div :ref="props.contentRef" />
|
|
19
|
+
</Steps>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts" setup>
|
|
24
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
25
|
+
|
|
26
|
+
const props = defineProps<VueNodeViewProps>()
|
|
27
|
+
|
|
28
|
+
const levels = ['1', '2', '3', '4', '5', '6']
|
|
29
|
+
const levelClass = {
|
|
30
|
+
1: '[&>div>div>div>h1]:step',
|
|
31
|
+
2: '[&>div>div>div>h2]:step',
|
|
32
|
+
3: '[&>div>div>div>h3]:step',
|
|
33
|
+
4: '[&>div>div>div>h4]:step',
|
|
34
|
+
5: '[&>div>div>div>h5]:step',
|
|
35
|
+
6: '[&>div>div>div>h6]:step',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const { getComponentProps } = useMdcEditor()
|
|
39
|
+
const { model, mdcAttrs } = getComponentProps(props, {
|
|
40
|
+
id: {
|
|
41
|
+
type: String,
|
|
42
|
+
},
|
|
43
|
+
class: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: '',
|
|
46
|
+
},
|
|
47
|
+
level: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '3',
|
|
50
|
+
validator(value: string) {
|
|
51
|
+
return levels.includes(value)
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
</script>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UiTabs
|
|
3
|
+
v-if="variant === 'separate'"
|
|
4
|
+
class="[&:not(:first-child)]:mt-5"
|
|
5
|
+
:default-value="label(($slots.default?.() ?? [])[0]?.props)"
|
|
6
|
+
>
|
|
7
|
+
<UiTabsList>
|
|
8
|
+
<UiTabsTrigger
|
|
9
|
+
v-for="(slot, i) in $slots.default?.() ?? []"
|
|
10
|
+
:key="`${i}${label(slot.props)}`"
|
|
11
|
+
:value="label(slot.props)"
|
|
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
|
+
<UiTabsContent
|
|
23
|
+
v-for="(slot, i) in $slots.default?.() ?? []"
|
|
24
|
+
:key="`${i}${label(slot.props)}`"
|
|
25
|
+
:value="label(slot.props)"
|
|
26
|
+
>
|
|
27
|
+
<component :is="slot" />
|
|
28
|
+
</UiTabsContent>
|
|
29
|
+
</UiTabs>
|
|
30
|
+
|
|
31
|
+
<UiCard v-else-if="variant === 'card'" class="[&:not(:first-child)]:mt-5">
|
|
32
|
+
<UiScrollArea>
|
|
33
|
+
<div class="relative flex overflow-x-auto border-b p-0.5 text-sm">
|
|
34
|
+
<div class="flex p-1">
|
|
35
|
+
<div
|
|
36
|
+
v-for="(slot, i) in ($slots.default?.() ?? [])"
|
|
37
|
+
:key="`${i}${label(slot.props)}`"
|
|
38
|
+
:value="label(slot.props)"
|
|
39
|
+
class="flex cursor-pointer rounded-md px-3 py-1.5 text-muted-foreground transition-all duration-75"
|
|
40
|
+
:class="[activeTabIndex === i && 'bg-muted text-primary']"
|
|
41
|
+
@mousedown.left="activeTabIndex = i"
|
|
42
|
+
>
|
|
43
|
+
<Icon
|
|
44
|
+
v-if="icon(slot?.props)"
|
|
45
|
+
:name="icon(slot?.props)!"
|
|
46
|
+
class="mr-1.5 self-center"
|
|
47
|
+
/>
|
|
48
|
+
{{ label(slot.props) }}
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
<CodeCopy
|
|
52
|
+
v-if="$slots.default?.()[activeTabIndex]?.props?.code"
|
|
53
|
+
class="ml-auto mr-3 self-center pl-2"
|
|
54
|
+
:code="$slots.default?.()[activeTabIndex]?.props?.code"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
<UiScrollBar orientation="horizontal" />
|
|
58
|
+
</UiScrollArea>
|
|
59
|
+
|
|
60
|
+
<div
|
|
61
|
+
v-for="(slot, i) in $slots.default?.() ?? []"
|
|
62
|
+
v-show="activeTabIndex === i"
|
|
63
|
+
:key="`${i}${label(slot.props)}`"
|
|
64
|
+
:value="label(slot.props)"
|
|
65
|
+
class="mt-0"
|
|
66
|
+
:class="[padded && ($slots.default?.()[activeTabIndex]?.type as any).tag !== 'pre' && 'p-3']"
|
|
67
|
+
>
|
|
68
|
+
<component :is="slot" :in-group="true" />
|
|
69
|
+
</div>
|
|
70
|
+
</UiCard>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<script setup lang="ts">
|
|
74
|
+
// import ScrollBar from '../ui/scroll-area/ScrollBar.vue'
|
|
75
|
+
|
|
76
|
+
withDefaults(defineProps<{
|
|
77
|
+
variant?: 'separate' | 'card'
|
|
78
|
+
padded?: boolean
|
|
79
|
+
}>(), {
|
|
80
|
+
variant: 'separate',
|
|
81
|
+
padded: true,
|
|
82
|
+
})
|
|
83
|
+
// const _slots = useSlots()
|
|
84
|
+
// const slots2 = _slots?.default?.() || []
|
|
85
|
+
// console.log(slots2)
|
|
86
|
+
|
|
87
|
+
const activeTabIndex = ref(0)
|
|
88
|
+
|
|
89
|
+
const iconMap = new Map(Object.entries(useConfig().value.main.codeIcon))
|
|
90
|
+
function icon(props: any) {
|
|
91
|
+
return props?.icon || iconMap.get(props?.filename?.toLowerCase()) || iconMap.get(props?.language)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function label(props: any) {
|
|
95
|
+
return props?.label || props?.filename
|
|
96
|
+
}
|
|
97
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
{{ model }}
|
|
3
|
+
<UiTabs v-bind="model">
|
|
4
|
+
<div :ref="props.contentRef" />
|
|
5
|
+
</UiTabs>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts" setup>
|
|
9
|
+
import type { VueNodeViewProps } from 'prosekit/vue'
|
|
10
|
+
|
|
11
|
+
// import { useMdcEditor } from '#imports'
|
|
12
|
+
|
|
13
|
+
const props = defineProps<VueNodeViewProps>()
|
|
14
|
+
|
|
15
|
+
const variants = ['separate', 'card']
|
|
16
|
+
|
|
17
|
+
const { getComponentProps } = useMdcEditor()
|
|
18
|
+
const { model } = getComponentProps(props, {
|
|
19
|
+
id: {
|
|
20
|
+
type: String,
|
|
21
|
+
},
|
|
22
|
+
class: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: '',
|
|
25
|
+
},
|
|
26
|
+
variant: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: 'separate',
|
|
29
|
+
validator(value: string) {
|
|
30
|
+
return variants.includes(value)
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
padded: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true,
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
</script>
|