@lupinum/ginko-docs 0.2.2
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/LICENSE +21 -0
- package/README.md +112 -0
- package/app/app.config.ts +49 -0
- package/app/app.vue +71 -0
- package/app/assets/css/prose.css +1154 -0
- package/app/assets/css/tailwind.css +365 -0
- package/app/components/OgImage/GinkoDocs.satori.vue +117 -0
- package/app/components/content/DocumentPageShell.vue +55 -0
- package/app/components/content/Feedback.vue +97 -0
- package/app/components/content/PageMarkdownCopy.vue +102 -0
- package/app/components/mdc/MdcAccordion.vue +64 -0
- package/app/components/mdc/MdcAccordionItem.vue +51 -0
- package/app/components/mdc/MdcAlert.vue +34 -0
- package/app/components/mdc/MdcAside.vue +27 -0
- package/app/components/mdc/MdcCallout.vue +62 -0
- package/app/components/mdc/MdcCard.vue +186 -0
- package/app/components/mdc/MdcCardGroup.vue +47 -0
- package/app/components/mdc/MdcCenter.vue +71 -0
- package/app/components/mdc/MdcCodeGroup.vue +193 -0
- package/app/components/mdc/MdcColumn.vue +70 -0
- package/app/components/mdc/MdcDocImg.vue +25 -0
- package/app/components/mdc/MdcDropcap.vue +84 -0
- package/app/components/mdc/MdcError.vue +16 -0
- package/app/components/mdc/MdcField.vue +62 -0
- package/app/components/mdc/MdcFieldGroup.vue +18 -0
- package/app/components/mdc/MdcFigure.vue +51 -0
- package/app/components/mdc/MdcIdea.vue +16 -0
- package/app/components/mdc/MdcInfo.vue +16 -0
- package/app/components/mdc/MdcLayout.vue +57 -0
- package/app/components/mdc/MdcNote.vue +16 -0
- package/app/components/mdc/MdcPassage.vue +32 -0
- package/app/components/mdc/MdcQuiz.vue +281 -0
- package/app/components/mdc/MdcQuizOption.vue +91 -0
- package/app/components/mdc/MdcQuizQuestion.vue +226 -0
- package/app/components/mdc/MdcReadMore.vue +90 -0
- package/app/components/mdc/MdcReadMoreGroup.vue +18 -0
- package/app/components/mdc/MdcShortcut.vue +46 -0
- package/app/components/mdc/MdcStep.vue +42 -0
- package/app/components/mdc/MdcSteps.vue +25 -0
- package/app/components/mdc/MdcSuccess.vue +16 -0
- package/app/components/mdc/MdcTab.vue +17 -0
- package/app/components/mdc/MdcTabs.vue +132 -0
- package/app/components/mdc/MdcTimeline.vue +14 -0
- package/app/components/mdc/MdcTimelineItem.vue +49 -0
- package/app/components/mdc/MdcWarning.vue +16 -0
- package/app/components/mdc/icons.ts +10 -0
- package/app/components/prose/ProseA.vue +27 -0
- package/app/components/prose/ProseBlockquote.vue +14 -0
- package/app/components/prose/ProseCode.vue +14 -0
- package/app/components/prose/ProseEm.vue +14 -0
- package/app/components/prose/ProseH1.vue +18 -0
- package/app/components/prose/ProseH2.vue +24 -0
- package/app/components/prose/ProseH3.vue +24 -0
- package/app/components/prose/ProseH4.vue +14 -0
- package/app/components/prose/ProseHr.vue +12 -0
- package/app/components/prose/ProseImg.vue +120 -0
- package/app/components/prose/ProseLi.vue +14 -0
- package/app/components/prose/ProseOl.vue +14 -0
- package/app/components/prose/ProseP.vue +14 -0
- package/app/components/prose/ProsePre.vue +217 -0
- package/app/components/prose/ProseStrong.vue +14 -0
- package/app/components/prose/ProseTable.vue +16 -0
- package/app/components/prose/ProseTbody.vue +14 -0
- package/app/components/prose/ProseTd.vue +14 -0
- package/app/components/prose/ProseTh.vue +14 -0
- package/app/components/prose/ProseThead.vue +14 -0
- package/app/components/prose/ProseTr.vue +14 -0
- package/app/components/prose/ProseUl.vue +14 -0
- package/app/components/site/ModeToggle.vue +123 -0
- package/app/components/site/SiteBanner.vue +56 -0
- package/app/components/site/SiteFooter.vue +80 -0
- package/app/components/site/SiteHeader.vue +250 -0
- package/app/components/site/SiteInteractionLayer.vue +35 -0
- package/app/components/site/SiteLocaleSwitcher.vue +268 -0
- package/app/components/site/SiteLogoMark.vue +12 -0
- package/app/components/site/SiteSkipLink.vue +14 -0
- package/app/components/ui/accordion/Accordion.vue +15 -0
- package/app/components/ui/accordion/AccordionContent.vue +23 -0
- package/app/components/ui/accordion/AccordionItem.vue +24 -0
- package/app/components/ui/accordion/AccordionTrigger.vue +35 -0
- package/app/components/ui/accordion/index.ts +4 -0
- package/app/components/ui/alert/Alert.vue +21 -0
- package/app/components/ui/alert/AlertDescription.vue +22 -0
- package/app/components/ui/alert/AlertTitle.vue +22 -0
- package/app/components/ui/alert/index.ts +34 -0
- package/app/components/ui/badge/Badge.vue +28 -0
- package/app/components/ui/badge/index.ts +24 -0
- package/app/components/ui/button/Button.vue +31 -0
- package/app/components/ui/button/index.ts +35 -0
- package/app/components/ui/card/Card.vue +16 -0
- package/app/components/ui/card/CardAction.vue +17 -0
- package/app/components/ui/card/CardContent.vue +14 -0
- package/app/components/ui/card/CardDescription.vue +14 -0
- package/app/components/ui/card/CardFooter.vue +14 -0
- package/app/components/ui/card/CardHeader.vue +22 -0
- package/app/components/ui/card/CardTitle.vue +14 -0
- package/app/components/ui/card/card-variants.ts +15 -0
- package/app/components/ui/card/index.ts +8 -0
- package/app/components/ui/checkbox/Checkbox.vue +35 -0
- package/app/components/ui/checkbox/index.ts +1 -0
- package/app/components/ui/collapsible/Collapsible.vue +15 -0
- package/app/components/ui/collapsible/CollapsibleContent.vue +25 -0
- package/app/components/ui/collapsible/CollapsibleTrigger.vue +12 -0
- package/app/components/ui/collapsible/index.ts +3 -0
- package/app/components/ui/dialog/Dialog.vue +15 -0
- package/app/components/ui/dialog/DialogClose.vue +12 -0
- package/app/components/ui/dialog/DialogContent.vue +69 -0
- package/app/components/ui/dialog/DialogDescription.vue +21 -0
- package/app/components/ui/dialog/DialogFooter.vue +15 -0
- package/app/components/ui/dialog/DialogHeader.vue +12 -0
- package/app/components/ui/dialog/DialogOverlay.vue +26 -0
- package/app/components/ui/dialog/DialogPortal.vue +12 -0
- package/app/components/ui/dialog/DialogTitle.vue +21 -0
- package/app/components/ui/dialog/DialogTrigger.vue +12 -0
- package/app/components/ui/dialog/index.ts +10 -0
- package/app/components/ui/dropdown-menu/DropdownMenu.vue +15 -0
- package/app/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +36 -0
- package/app/components/ui/dropdown-menu/DropdownMenuContent.vue +40 -0
- package/app/components/ui/dropdown-menu/DropdownMenuGroup.vue +12 -0
- package/app/components/ui/dropdown-menu/DropdownMenuItem.vue +41 -0
- package/app/components/ui/dropdown-menu/DropdownMenuLabel.vue +25 -0
- package/app/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +15 -0
- package/app/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +37 -0
- package/app/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/app/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/app/components/ui/dropdown-menu/DropdownMenuSub.vue +15 -0
- package/app/components/ui/dropdown-menu/DropdownMenuSubContent.vue +29 -0
- package/app/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
- package/app/components/ui/dropdown-menu/DropdownMenuTrigger.vue +14 -0
- package/app/components/ui/dropdown-menu/index.ts +16 -0
- package/app/components/ui/input/Input.vue +23 -0
- package/app/components/ui/input/index.ts +1 -0
- package/app/components/ui/kbd/Kbd.vue +23 -0
- package/app/components/ui/kbd/KbdGroup.vue +14 -0
- package/app/components/ui/kbd/index.ts +22 -0
- package/app/components/ui/label/Label.vue +14 -0
- package/app/components/ui/label/index.ts +1 -0
- package/app/components/ui/scroll-area/ScrollArea.vue +39 -0
- package/app/components/ui/scroll-area/ScrollBar.vue +33 -0
- package/app/components/ui/scroll-area/index.ts +2 -0
- package/app/components/ui/separator/Separator.vue +27 -0
- package/app/components/ui/separator/index.ts +1 -0
- package/app/components/ui/sheet/Sheet.vue +15 -0
- package/app/components/ui/sheet/SheetClose.vue +12 -0
- package/app/components/ui/sheet/SheetContent.vue +59 -0
- package/app/components/ui/sheet/SheetDescription.vue +21 -0
- package/app/components/ui/sheet/SheetFooter.vue +12 -0
- package/app/components/ui/sheet/SheetHeader.vue +12 -0
- package/app/components/ui/sheet/SheetOverlay.vue +26 -0
- package/app/components/ui/sheet/SheetTitle.vue +21 -0
- package/app/components/ui/sheet/SheetTrigger.vue +12 -0
- package/app/components/ui/sheet/index.ts +8 -0
- package/app/components/ui/switch/Switch.vue +39 -0
- package/app/components/ui/switch/index.ts +1 -0
- package/app/components/ui/tabs/Tabs.vue +24 -0
- package/app/components/ui/tabs/TabsContent.vue +21 -0
- package/app/components/ui/tabs/TabsList.vue +26 -0
- package/app/components/ui/tabs/TabsTrigger.vue +28 -0
- package/app/components/ui/tabs/index.ts +4 -0
- package/app/components/ui/textarea/Textarea.vue +31 -0
- package/app/components/ui/textarea/index.ts +1 -0
- package/app/composables/site-navigation.utils.ts +80 -0
- package/app/composables/useCanonicalUrl.ts +9 -0
- package/app/composables/useContentRouteAlternates.ts +43 -0
- package/app/composables/useGinkoAnalytics.ts +37 -0
- package/app/composables/useGinkoDocsConfig.ts +6 -0
- package/app/composables/useGinkoOgImage.ts +20 -0
- package/app/composables/useLocalizedPath.ts +12 -0
- package/app/composables/useLocalizedRouteSwitch.ts +31 -0
- package/app/composables/usePageMarkdownActions.ts +79 -0
- package/app/composables/useSchemaJsonLd.ts +25 -0
- package/app/composables/useSiteNavigation.ts +86 -0
- package/app/config/site.utils.ts +36 -0
- package/app/error.vue +125 -0
- package/app/features/docs/components/DocsContributeLinks.vue +65 -0
- package/app/features/docs/components/DocsMobileToc.vue +104 -0
- package/app/features/docs/components/DocsPageContent.vue +188 -0
- package/app/features/docs/components/DocsPageNav.vue +57 -0
- package/app/features/docs/components/DocsSidebar.vue +129 -0
- package/app/features/docs/components/DocsSidebarDropdown.vue +70 -0
- package/app/features/docs/components/DocsSidebarItem.vue +169 -0
- package/app/features/docs/components/DocsSidebarList.vue +35 -0
- package/app/features/docs/components/DocsSidebarTabs.vue +35 -0
- package/app/features/docs/components/DocsToc.vue +60 -0
- package/app/features/docs/composables/useDocsEntryPath.ts +13 -0
- package/app/features/docs/composables/useDocsNavigation.ts +29 -0
- package/app/features/docs/composables/useDocsNavigationData.ts +15 -0
- package/app/features/docs/composables/useScrollspy.ts +67 -0
- package/app/features/docs/docs-navigation.ts +170 -0
- package/app/features/search/command-center.ts +156 -0
- package/app/features/search/components/SiteCommandCenter.vue +323 -0
- package/app/features/search/components/SiteSearchPageHighlight.vue +124 -0
- package/app/features/search/useCommandCenter.ts +300 -0
- package/app/layouts/blog.vue +15 -0
- package/app/layouts/default.vue +12 -0
- package/app/layouts/docs.vue +20 -0
- package/app/lib/errors.ts +84 -0
- package/app/lib/schema-org.ts +38 -0
- package/app/lib/utils.ts +7 -0
- package/app/pages/blog/[slug].vue +211 -0
- package/app/pages/blog/index.vue +106 -0
- package/app/pages/docs/[...slug].vue +10 -0
- package/app/pages/docs/index.vue +23 -0
- package/app/pages/index.vue +140 -0
- package/app/plugins/ssr-width.ts +6 -0
- package/app/utils/content.ts +56 -0
- package/app/utils/index.ts +1 -0
- package/components.ts +9 -0
- package/content.js +175 -0
- package/content.ts +148 -0
- package/i18n/i18n.config.ts +10 -0
- package/i18n/locales.ts +81 -0
- package/i18n/messages/global/banner.ts +8 -0
- package/i18n/messages/global/blog.ts +14 -0
- package/i18n/messages/global/command.ts +44 -0
- package/i18n/messages/global/docs.ts +32 -0
- package/i18n/messages/global/errors.ts +36 -0
- package/i18n/messages/global/feedback.ts +11 -0
- package/i18n/messages/global/index.ts +21 -0
- package/i18n/messages/global/nav.ts +18 -0
- package/i18n/messages/global/site.ts +4 -0
- package/i18n/messages/global/theme.ts +7 -0
- package/i18n/messages/index.ts +20 -0
- package/i18n/messages/localize.ts +35 -0
- package/i18n/messages/source.ts +5 -0
- package/i18n/routes.ts +33 -0
- package/icon-bundle.ts +141 -0
- package/index.d.ts +13 -0
- package/modules/feature-routing.ts +32 -0
- package/nuxt.config.ts +194 -0
- package/package.json +91 -0
- package/runtime/markdown/inline-code-highlight.ts +155 -0
- package/runtime/server/agent-markdown.ts +21 -0
- package/runtime/utils.ts +7 -0
- package/server/mcp/tools/get-page.ts +14 -0
- package/server/mcp/tools/list-pages.ts +10 -0
- package/server/plugins/agent-markdown.ts +6 -0
- package/shared/route-slugs.ts +5 -0
- package/shared/types/app-config.ts +100 -0
- package/tags.ts +204 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref } from "vue";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
value?: string;
|
|
8
|
+
size?: "sm" | "md";
|
|
9
|
+
class?: HTMLAttributes["class"];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
13
|
+
size: "md",
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const metaSymbol = ref("Ctrl");
|
|
17
|
+
|
|
18
|
+
// Safe from Nuxt SSR because onMounted only fires on the client
|
|
19
|
+
onMounted(() => {
|
|
20
|
+
if (typeof navigator !== "undefined" && navigator.userAgent.includes("Macintosh")) {
|
|
21
|
+
metaSymbol.value = "⌘";
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const resolvedValue = computed(() => {
|
|
26
|
+
if (props.value === "meta") return metaSymbol.value;
|
|
27
|
+
return props.value;
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<kbd
|
|
33
|
+
:class="
|
|
34
|
+
cn(
|
|
35
|
+
'pointer-events-none inline-flex w-fit items-center justify-center gap-1 rounded-sm bg-muted font-sans font-medium text-muted-foreground ring-1 ring-border select-none [&_svg:not([class*=size-])]:size-3',
|
|
36
|
+
size === 'md' ? 'h-7 min-w-7 px-1.5 text-sm' : 'h-5 min-w-5 px-1 text-xs',
|
|
37
|
+
props.class,
|
|
38
|
+
)
|
|
39
|
+
"
|
|
40
|
+
>
|
|
41
|
+
<!-- Provide a slot so users can inject custom icons instead of strings if needed -->
|
|
42
|
+
<slot>
|
|
43
|
+
{{ resolvedValue }}
|
|
44
|
+
</slot>
|
|
45
|
+
</kbd>
|
|
46
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ComputedRef, HTMLAttributes } from "vue";
|
|
3
|
+
import { computed, inject } from "vue";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
import { resolveIconifyIcon } from "./icons";
|
|
6
|
+
|
|
7
|
+
type StepsVariant = "icons" | "numbered";
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
title?: string;
|
|
11
|
+
icon?: string;
|
|
12
|
+
class?: HTMLAttributes["class"];
|
|
13
|
+
}>();
|
|
14
|
+
|
|
15
|
+
const stepsVariant = inject<ComputedRef<StepsVariant>>(
|
|
16
|
+
"mdcStepsVariant",
|
|
17
|
+
computed(() => "icons"),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const isNumbered = computed(() => stepsVariant.value === "numbered");
|
|
21
|
+
|
|
22
|
+
const iconName = computed(() => {
|
|
23
|
+
const icon = props.icon?.trim();
|
|
24
|
+
if (!icon) return "lucide:circle";
|
|
25
|
+
return resolveIconifyIcon(icon) ?? "lucide:circle";
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<div :class="cn('content-step', props.class)">
|
|
31
|
+
<div class="content-step-marker" aria-hidden="true">
|
|
32
|
+
<Icon v-if="!isNumbered" :name="iconName" class="size-3.5" />
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div class="content-step-body content-prose content-prose-trim">
|
|
36
|
+
<p v-if="title" class="content-step-title">
|
|
37
|
+
{{ title }}
|
|
38
|
+
</p>
|
|
39
|
+
<slot />
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { computed, provide } from "vue";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(
|
|
7
|
+
defineProps<{
|
|
8
|
+
variant?: "icons" | "numbered";
|
|
9
|
+
class?: HTMLAttributes["class"];
|
|
10
|
+
}>(),
|
|
11
|
+
{
|
|
12
|
+
variant: "icons",
|
|
13
|
+
},
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
const normalizedVariant = computed(() => (props.variant === "numbered" ? "numbered" : "icons"));
|
|
17
|
+
|
|
18
|
+
provide("mdcStepsVariant", normalizedVariant);
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div :class="cn('content-steps not-prose', props.class)" :data-variant="normalizedVariant">
|
|
23
|
+
<slot />
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import MdcCallout from "./MdcCallout.vue";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
title?: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
class?: HTMLAttributes["class"];
|
|
9
|
+
}>();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<MdcCallout :title="title" :icon="icon" type="success" :class="props.class">
|
|
14
|
+
<slot />
|
|
15
|
+
</MdcCallout>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({
|
|
3
|
+
inheritAttrs: false,
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
defineProps<{
|
|
7
|
+
icon?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
inGroup?: boolean;
|
|
10
|
+
}>();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div :label="label" :in-group="inGroup">
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { VNode } from "vue";
|
|
3
|
+
import { h, ref, resolveComponent, useSlots } from "vue";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
import { resolveIconifyIcon } from "./icons";
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(
|
|
8
|
+
defineProps<{
|
|
9
|
+
variant?: "separate" | "line";
|
|
10
|
+
padded?: boolean;
|
|
11
|
+
inStack?: boolean;
|
|
12
|
+
}>(),
|
|
13
|
+
{
|
|
14
|
+
variant: "separate",
|
|
15
|
+
padded: true,
|
|
16
|
+
inStack: false,
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const slots = useSlots();
|
|
21
|
+
const activeValue = ref("");
|
|
22
|
+
|
|
23
|
+
type TabItem = {
|
|
24
|
+
icon?: string;
|
|
25
|
+
label: string;
|
|
26
|
+
node: VNode;
|
|
27
|
+
value: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function getTabLabel(node: VNode, index: number) {
|
|
31
|
+
const label = node.props?.label;
|
|
32
|
+
return typeof label === "string" && label.trim().length > 0 ? label : `Tab ${index + 1}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function getTabIcon(node: VNode) {
|
|
36
|
+
const icon = node.props?.icon;
|
|
37
|
+
return typeof icon === "string" ? resolveIconifyIcon(icon) : undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getItems(): TabItem[] {
|
|
41
|
+
return (slots.default?.() ?? [])
|
|
42
|
+
.filter((node): node is VNode => Boolean(node?.type))
|
|
43
|
+
.map((node, index) => ({
|
|
44
|
+
icon: getTabIcon(node),
|
|
45
|
+
label: getTabLabel(node, index),
|
|
46
|
+
node,
|
|
47
|
+
value: getTabLabel(node, index),
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function renderTabs() {
|
|
52
|
+
const items = getItems();
|
|
53
|
+
const Icon = resolveComponent("Icon");
|
|
54
|
+
const resolvedValue = items.some((item) => item.value === activeValue.value)
|
|
55
|
+
? activeValue.value
|
|
56
|
+
: activeValue.value || items[0]?.value || "";
|
|
57
|
+
|
|
58
|
+
if (!items.length) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return h(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
class: cn("content-tabs not-prose group", props.inStack && "content-tabs-in-stack"),
|
|
66
|
+
},
|
|
67
|
+
[
|
|
68
|
+
h("div", { class: "content-tabs-header" }, [
|
|
69
|
+
h(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
class: "content-tabs-list",
|
|
73
|
+
role: "tablist",
|
|
74
|
+
},
|
|
75
|
+
items.map((item) =>
|
|
76
|
+
h(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
key: item.value,
|
|
80
|
+
type: "button",
|
|
81
|
+
role: "tab",
|
|
82
|
+
"aria-selected": resolvedValue === item.value,
|
|
83
|
+
class: cn(
|
|
84
|
+
"content-tabs-tab",
|
|
85
|
+
resolvedValue === item.value && "content-tabs-tab-active",
|
|
86
|
+
),
|
|
87
|
+
onClick: () => {
|
|
88
|
+
activeValue.value = item.value;
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
[
|
|
92
|
+
item.icon
|
|
93
|
+
? h(Icon, {
|
|
94
|
+
name: item.icon,
|
|
95
|
+
class: "content-tabs-tab-icon",
|
|
96
|
+
"aria-hidden": "true",
|
|
97
|
+
})
|
|
98
|
+
: null,
|
|
99
|
+
item.label,
|
|
100
|
+
],
|
|
101
|
+
),
|
|
102
|
+
),
|
|
103
|
+
),
|
|
104
|
+
]),
|
|
105
|
+
h(
|
|
106
|
+
"div",
|
|
107
|
+
{ class: "content-tabs-panels" },
|
|
108
|
+
items.map((item) =>
|
|
109
|
+
h(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
key: item.value,
|
|
113
|
+
value: item.value,
|
|
114
|
+
role: "tabpanel",
|
|
115
|
+
class: cn(
|
|
116
|
+
"content-tabs-content-area content-prose content-prose-trim [&>figure:only-child]:-m-4 [&>figure:only-child]:border-none",
|
|
117
|
+
props.padded ? "p-4" : "p-0",
|
|
118
|
+
),
|
|
119
|
+
style: resolvedValue === item.value ? undefined : { display: "none" },
|
|
120
|
+
},
|
|
121
|
+
[h(item.node, { inGroup: true })],
|
|
122
|
+
),
|
|
123
|
+
),
|
|
124
|
+
),
|
|
125
|
+
],
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
<template>
|
|
131
|
+
<component :is="renderTabs" />
|
|
132
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"];
|
|
7
|
+
}>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div :class="cn('not-prose mb-12 ml-4 border-l border-border pl-8', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
date?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
class?: HTMLAttributes["class"];
|
|
10
|
+
}>();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div :class="cn('relative pb-8 last:pb-0', props.class)">
|
|
15
|
+
<div
|
|
16
|
+
class="absolute top-0.5 -left-[2.45rem] flex h-5 w-5 items-center justify-center rounded-full border border-border bg-background"
|
|
17
|
+
>
|
|
18
|
+
<div class="size-2 rounded-full bg-primary" />
|
|
19
|
+
</div>
|
|
20
|
+
<div class="mb-2 flex flex-wrap items-center gap-2">
|
|
21
|
+
<span
|
|
22
|
+
v-if="date"
|
|
23
|
+
class="inline-flex items-center rounded-md border border-border bg-muted/50 px-2 py-0.5 text-xs font-medium text-muted-foreground"
|
|
24
|
+
>
|
|
25
|
+
{{ date }}
|
|
26
|
+
</span>
|
|
27
|
+
<span
|
|
28
|
+
v-if="label"
|
|
29
|
+
class="inline-flex items-center rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary"
|
|
30
|
+
>
|
|
31
|
+
{{ label }}
|
|
32
|
+
</span>
|
|
33
|
+
</div>
|
|
34
|
+
<p v-if="title" class="mb-1 font-semibold text-foreground">
|
|
35
|
+
{{ title }}
|
|
36
|
+
</p>
|
|
37
|
+
<div
|
|
38
|
+
:class="
|
|
39
|
+
cn(
|
|
40
|
+
'content-prose content-prose-trim text-muted-foreground',
|
|
41
|
+
'[&_a]:font-medium [&_a]:text-foreground [&_a]:underline [&_a]:underline-offset-4',
|
|
42
|
+
'[&_p]:my-2 [&_p]:text-pretty [&_p:first-child]:mt-0 [&_p:last-child]:mb-0',
|
|
43
|
+
)
|
|
44
|
+
"
|
|
45
|
+
>
|
|
46
|
+
<slot />
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import MdcCallout from "./MdcCallout.vue";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
title?: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
class?: HTMLAttributes["class"];
|
|
9
|
+
}>();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<MdcCallout :title="title" :icon="icon" type="warning" :class="props.class">
|
|
14
|
+
<slot />
|
|
15
|
+
</MdcCallout>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function resolveIconifyIcon(name?: string | null): string | undefined {
|
|
2
|
+
if (!name?.trim()) return undefined;
|
|
3
|
+
const n = name.trim();
|
|
4
|
+
if (n.startsWith("i-lucide-")) return `lucide:${n.slice("i-lucide-".length)}`;
|
|
5
|
+
return n.includes(":") ? n : `lucide:${n.replace(/_/g, "-").toLowerCase()}`;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function isExternalLink(to?: string | null) {
|
|
9
|
+
return Boolean(to && /^(https?:)?\/\//.test(to));
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { computed } from "vue";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
href?: string;
|
|
8
|
+
target?: string;
|
|
9
|
+
class?: HTMLAttributes["class"];
|
|
10
|
+
}>();
|
|
11
|
+
|
|
12
|
+
const isExternal = computed(
|
|
13
|
+
() => props.target === "_blank" || (props.href && /^https?:\/\//.test(props.href)),
|
|
14
|
+
);
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<NuxtLink :href="props.href || ''" :target="props.target" :class="cn(props.class)">
|
|
19
|
+
<slot />
|
|
20
|
+
<Icon
|
|
21
|
+
v-if="isExternal"
|
|
22
|
+
name="lucide:arrow-up-right"
|
|
23
|
+
class="ml-0.5 inline size-3 align-text-top"
|
|
24
|
+
aria-hidden="true"
|
|
25
|
+
/>
|
|
26
|
+
</NuxtLink>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"];
|
|
7
|
+
}>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<blockquote :class="cn(props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</blockquote>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"];
|
|
7
|
+
}>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<code :class="cn('content-code', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</code>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"];
|
|
7
|
+
}>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<em :class="cn(props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</em>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
id?: string;
|
|
7
|
+
class?: HTMLAttributes["class"];
|
|
8
|
+
}>();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<h1 :id="id" :class="cn('scroll-mt-28', props.class)">
|
|
13
|
+
<a v-if="id" :href="`#${id}`" class="inline-flex items-center gap-2">
|
|
14
|
+
<slot />
|
|
15
|
+
</a>
|
|
16
|
+
<slot v-else />
|
|
17
|
+
</h1>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
id?: string;
|
|
7
|
+
class?: HTMLAttributes["class"];
|
|
8
|
+
}>();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<h2 :id="id" :class="cn('flex scroll-mt-28 flex-row items-center gap-1.5', props.class)">
|
|
13
|
+
<a v-if="id" :href="`#${id}`" class="peer" data-card="">
|
|
14
|
+
<slot />
|
|
15
|
+
</a>
|
|
16
|
+
<Icon
|
|
17
|
+
v-if="id"
|
|
18
|
+
name="lucide:link"
|
|
19
|
+
class="size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity peer-hover:opacity-100"
|
|
20
|
+
aria-hidden="true"
|
|
21
|
+
/>
|
|
22
|
+
<slot v-else />
|
|
23
|
+
</h2>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
id?: string;
|
|
7
|
+
class?: HTMLAttributes["class"];
|
|
8
|
+
}>();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<h3 :id="id" :class="cn('flex scroll-mt-28 flex-row items-center gap-1.5', props.class)">
|
|
13
|
+
<a v-if="id" :href="`#${id}`" class="peer" data-card="">
|
|
14
|
+
<slot />
|
|
15
|
+
</a>
|
|
16
|
+
<Icon
|
|
17
|
+
v-if="id"
|
|
18
|
+
name="lucide:link"
|
|
19
|
+
class="size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity peer-hover:opacity-100"
|
|
20
|
+
aria-hidden="true"
|
|
21
|
+
/>
|
|
22
|
+
<slot v-else />
|
|
23
|
+
</h3>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"];
|
|
7
|
+
}>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<h4 :class="cn('scroll-mt-28', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</h4>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"];
|
|
7
|
+
}>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<hr :class="cn(props.class)" />
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { computed, ref } from "vue";
|
|
4
|
+
import { useI18n } from "#imports";
|
|
5
|
+
import {
|
|
6
|
+
Dialog,
|
|
7
|
+
DialogContent,
|
|
8
|
+
DialogDescription,
|
|
9
|
+
DialogTitle,
|
|
10
|
+
} from "#ginko-docs/components/ui/dialog";
|
|
11
|
+
import { useGinkoDocsConfig } from "#ginko-docs/composables/useGinkoDocsConfig";
|
|
12
|
+
import { cn } from "../../utils";
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(
|
|
15
|
+
defineProps<{
|
|
16
|
+
src?: string;
|
|
17
|
+
alt?: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
caption?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
width?: string | number;
|
|
22
|
+
height?: string | number;
|
|
23
|
+
bleed?: boolean | string;
|
|
24
|
+
aspect?: "auto" | "video" | "wide" | "square" | "portrait";
|
|
25
|
+
fit?: "cover" | "contain";
|
|
26
|
+
align?: "left" | "center" | "right";
|
|
27
|
+
class?: HTMLAttributes["class"];
|
|
28
|
+
}>(),
|
|
29
|
+
{
|
|
30
|
+
aspect: "auto",
|
|
31
|
+
fit: "cover",
|
|
32
|
+
align: "center",
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const { t } = useI18n();
|
|
37
|
+
const config = useGinkoDocsConfig();
|
|
38
|
+
const zoomEnabled = computed(() => config.images?.zoom !== false);
|
|
39
|
+
const zoomOpen = ref(false);
|
|
40
|
+
|
|
41
|
+
const shouldBleed = computed(() => props.bleed === true || props.bleed === "true");
|
|
42
|
+
|
|
43
|
+
const aspectClass = computed(() => {
|
|
44
|
+
return {
|
|
45
|
+
auto: "",
|
|
46
|
+
video: "aspect-video",
|
|
47
|
+
wide: "aspect-[21/9]",
|
|
48
|
+
square: "aspect-square",
|
|
49
|
+
portrait: "aspect-[4/5]",
|
|
50
|
+
}[props.aspect];
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const imageClass = computed(() =>
|
|
54
|
+
cn("w-full", aspectClass.value, props.fit === "contain" ? "object-contain" : "object-cover"),
|
|
55
|
+
);
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<template>
|
|
59
|
+
<figure
|
|
60
|
+
:class="cn('content-media not-prose', props.class)"
|
|
61
|
+
:data-bleed="shouldBleed ? 'true' : undefined"
|
|
62
|
+
>
|
|
63
|
+
<template v-if="src">
|
|
64
|
+
<button
|
|
65
|
+
v-if="zoomEnabled"
|
|
66
|
+
type="button"
|
|
67
|
+
class="block w-full cursor-zoom-in rounded-[inherit] focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none"
|
|
68
|
+
:aria-label="`${t('docs.zoomImage')}: ${alt ?? ''}`"
|
|
69
|
+
@click="zoomOpen = true"
|
|
70
|
+
>
|
|
71
|
+
<NuxtImg
|
|
72
|
+
:src="src"
|
|
73
|
+
:alt="alt"
|
|
74
|
+
:width="width"
|
|
75
|
+
:height="height"
|
|
76
|
+
sizes="100vw md:768px"
|
|
77
|
+
loading="lazy"
|
|
78
|
+
:class="imageClass"
|
|
79
|
+
/>
|
|
80
|
+
</button>
|
|
81
|
+
<NuxtImg
|
|
82
|
+
v-else
|
|
83
|
+
:src="src"
|
|
84
|
+
:alt="alt"
|
|
85
|
+
:width="width"
|
|
86
|
+
:height="height"
|
|
87
|
+
sizes="100vw md:768px"
|
|
88
|
+
loading="lazy"
|
|
89
|
+
:class="imageClass"
|
|
90
|
+
/>
|
|
91
|
+
</template>
|
|
92
|
+
<figcaption
|
|
93
|
+
v-if="caption || title || alt || description"
|
|
94
|
+
:class="
|
|
95
|
+
cn(
|
|
96
|
+
align === 'left' && 'text-left',
|
|
97
|
+
align === 'center' && 'text-center',
|
|
98
|
+
align === 'right' && 'text-right',
|
|
99
|
+
)
|
|
100
|
+
"
|
|
101
|
+
>
|
|
102
|
+
<span>{{ caption || title || alt }}</span>
|
|
103
|
+
<span v-if="description" class="content-media-description">
|
|
104
|
+
{{ description }}
|
|
105
|
+
</span>
|
|
106
|
+
</figcaption>
|
|
107
|
+
|
|
108
|
+
<Dialog v-if="zoomEnabled" v-model:open="zoomOpen">
|
|
109
|
+
<DialogContent
|
|
110
|
+
class="max-h-[90dvh] w-auto max-w-[min(96vw,80rem)] overflow-auto border-none bg-transparent p-0 shadow-none"
|
|
111
|
+
>
|
|
112
|
+
<DialogTitle class="sr-only">{{
|
|
113
|
+
caption || title || alt || t("docs.zoomImage")
|
|
114
|
+
}}</DialogTitle>
|
|
115
|
+
<DialogDescription v-if="description" class="sr-only">{{ description }}</DialogDescription>
|
|
116
|
+
<img :src="src" :alt="alt" class="max-h-[88dvh] w-auto rounded-lg object-contain" />
|
|
117
|
+
</DialogContent>
|
|
118
|
+
</Dialog>
|
|
119
|
+
</figure>
|
|
120
|
+
</template>
|