@lupinum/ginko-docs 0.4.0-rc.8 → 0.4.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/CHANGELOG.md +78 -0
- package/LICENSE +1 -1
- package/README.md +206 -54
- package/app/app.config.ts +42 -55
- package/app/assets/docs.css +555 -0
- package/app/components/DocsBanner.vue +29 -0
- package/app/components/DocsExample.vue +43 -0
- package/app/components/DocsFooter.vue +19 -0
- package/app/components/DocsHeader.vue +112 -0
- package/app/components/DocsLanding.vue +55 -0
- package/app/components/DocsLanguage.vue +29 -0
- package/app/components/DocsNavTree.vue +38 -0
- package/app/components/DocsPage.vue +84 -0
- package/app/components/DocsPageActions.vue +47 -0
- package/app/components/DocsPost.vue +58 -0
- package/app/components/DocsSearch.vue +134 -0
- package/app/components/DocsShell.vue +20 -0
- package/app/components/DocsSidebar.vue +18 -0
- package/app/components/DocsTable.vue +11 -0
- package/app/components/DocsThemeToggle.vue +45 -0
- package/app/components/DocsToc.vue +73 -0
- package/app/composables/useDocs.ts +52 -0
- package/app/composables/useDocsBlog.ts +32 -0
- package/app/composables/useDocsCopy.ts +17 -0
- package/app/composables/useDocsPopover.ts +36 -0
- package/app/composables/useDocsSite.ts +10 -0
- package/app/docs-pages/blog.vue +47 -0
- package/app/docs-pages/changelog.vue +27 -0
- package/app/docs-pages/doc.vue +14 -0
- package/app/docs-pages/docs.vue +9 -0
- package/app/docs-pages/index.vue +12 -0
- package/app/docs-pages/post.vue +8 -0
- package/app/error.vue +23 -115
- package/app/layouts/default.vue +25 -7
- package/app/lib/blogTypes.ts +8 -0
- package/app/lib/docsFirst.ts +11 -0
- package/app/lib/docsInit.ts +18 -0
- package/app/lib/docsNav.ts +36 -0
- package/app/lib/docsPage.ts +44 -0
- package/app/lib/markdownComponents.ts +16 -0
- package/app/lib/previewToc.ts +18 -0
- package/dist/config.d.mts +232 -0
- package/dist/config.d.ts +232 -0
- package/dist/config.mjs +114 -0
- package/dist/pages.d.mts +5 -0
- package/dist/pages.d.ts +5 -0
- package/dist/pages.mjs +36 -0
- package/dist/shared/ginko-docs.BwbF7JBR.mjs +4 -0
- package/i18n/de.json +1 -0
- package/i18n/en.json +1 -0
- package/icons/README.md +2 -0
- package/icons/bluesky.svg +1 -0
- package/icons/claude.svg +1 -0
- package/icons/discord.svg +1 -0
- package/icons/github.svg +1 -0
- package/icons/linkedin.svg +1 -0
- package/icons/mastodon.svg +1 -0
- package/icons/openai.svg +1 -0
- package/icons/x.svg +1 -0
- package/icons/youtube.svg +1 -0
- package/nuxt.config.ts +34 -209
- package/package.json +43 -76
- package/public/_docs/fonts/LICENSE +188 -0
- package/public/_docs/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/public/_docs/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
- package/public/_docs/fonts/jetbrains-mono-latin-500-normal.woff2 +0 -0
- package/server/feeds/blog-locale.get.ts +9 -0
- package/server/feeds/blog.get.ts +4 -0
- package/server/lib/blogFeed.ts +35 -0
- package/server/lib/rss.ts +57 -0
- package/server/mcp/handler.ts +108 -0
- package/server/routes/__ginko/docs-mcp.ts +35 -0
- package/shared/paths.ts +4 -0
- package/app/app.vue +0 -98
- package/app/assets/css/prose.css +0 -3240
- package/app/assets/css/tailwind.css +0 -394
- package/app/assets/css/theme-palettes.css +0 -309
- package/app/assets/css/theme-presets.css +0 -141
- package/app/components/OgImage/GinkoDocs.satori.vue +0 -238
- package/app/components/content/DocumentPageShell.vue +0 -55
- package/app/components/content/Feedback.vue +0 -102
- package/app/components/content/ImageZoomDialog.vue +0 -84
- package/app/components/content/PageMarkdownCopy.vue +0 -104
- package/app/components/content/imageZoom.ts +0 -25
- package/app/components/mdc/MdcAccordion.vue +0 -67
- package/app/components/mdc/MdcAccordionItem.vue +0 -42
- package/app/components/mdc/MdcApi.vue +0 -159
- package/app/components/mdc/MdcAside.vue +0 -23
- package/app/components/mdc/MdcCallout.vue +0 -61
- package/app/components/mdc/MdcCard.vue +0 -175
- package/app/components/mdc/MdcCards.vue +0 -30
- package/app/components/mdc/MdcCenter.vue +0 -71
- package/app/components/mdc/MdcCodeGroup.vue +0 -197
- package/app/components/mdc/MdcCodeTree.vue +0 -234
- package/app/components/mdc/MdcCollapse.vue +0 -61
- package/app/components/mdc/MdcColumn.vue +0 -70
- package/app/components/mdc/MdcDropcap.vue +0 -84
- package/app/components/mdc/MdcError.vue +0 -23
- package/app/components/mdc/MdcExcerpt.vue +0 -26
- package/app/components/mdc/MdcFigure.vue +0 -85
- package/app/components/mdc/MdcFiles.vue +0 -120
- package/app/components/mdc/MdcIdea.vue +0 -17
- package/app/components/mdc/MdcInfo.vue +0 -17
- package/app/components/mdc/MdcInlineToc.vue +0 -51
- package/app/components/mdc/MdcKbd.vue +0 -10
- package/app/components/mdc/MdcLayout.vue +0 -57
- package/app/components/mdc/MdcNote.vue +0 -17
- package/app/components/mdc/MdcQuiz.vue +0 -241
- package/app/components/mdc/MdcQuizQuestion.vue +0 -221
- package/app/components/mdc/MdcReadMore.vue +0 -70
- package/app/components/mdc/MdcSteps.vue +0 -59
- package/app/components/mdc/MdcSuccess.vue +0 -23
- package/app/components/mdc/MdcTab.vue +0 -17
- package/app/components/mdc/MdcTabs.vue +0 -150
- package/app/components/mdc/MdcTimeline.vue +0 -17
- package/app/components/mdc/MdcTimelineItem.vue +0 -40
- package/app/components/mdc/MdcWarning.vue +0 -23
- package/app/components/mdc/api.utils.ts +0 -132
- package/app/components/mdc/code-tree.utils.ts +0 -22
- package/app/components/mdc/icons.ts +0 -10
- package/app/components/mdc/quiz.utils.ts +0 -38
- package/app/components/prose/ProseA.vue +0 -27
- package/app/components/prose/ProseBlockquote.vue +0 -30
- package/app/components/prose/ProseCode.vue +0 -14
- package/app/components/prose/ProseEm.vue +0 -14
- package/app/components/prose/ProseH1.vue +0 -18
- package/app/components/prose/ProseH2.vue +0 -29
- package/app/components/prose/ProseH3.vue +0 -29
- package/app/components/prose/ProseH4.vue +0 -29
- package/app/components/prose/ProseH5.vue +0 -15
- package/app/components/prose/ProseH6.vue +0 -15
- package/app/components/prose/ProseHr.vue +0 -12
- package/app/components/prose/ProseImg.vue +0 -55
- package/app/components/prose/ProseLi.vue +0 -14
- package/app/components/prose/ProseOl.vue +0 -14
- package/app/components/prose/ProseP.vue +0 -14
- package/app/components/prose/ProsePre.vue +0 -180
- package/app/components/prose/ProseStrong.vue +0 -14
- package/app/components/prose/ProseTable.vue +0 -18
- package/app/components/prose/ProseTbody.vue +0 -14
- package/app/components/prose/ProseTd.vue +0 -14
- package/app/components/prose/ProseTh.vue +0 -14
- package/app/components/prose/ProseThead.vue +0 -14
- package/app/components/prose/ProseTr.vue +0 -14
- package/app/components/prose/ProseUl.vue +0 -14
- package/app/components/site/ModeToggle.vue +0 -81
- package/app/components/site/SiteBanner.vue +0 -97
- package/app/components/site/SiteFooter.vue +0 -90
- package/app/components/site/SiteHeader.vue +0 -371
- package/app/components/site/SiteHeroCode.vue +0 -173
- package/app/components/site/SiteInteractionLayer.vue +0 -42
- package/app/components/site/SiteLocaleSwitcher.vue +0 -190
- package/app/components/site/SiteLogoMark.vue +0 -12
- package/app/components/site/SiteSkipLink.vue +0 -14
- package/app/components/site/SiteSocialLinks.vue +0 -33
- package/app/components/site/header-utils.ts +0 -3
- package/app/components/site/mode-toggle.utils.ts +0 -18
- package/app/components/ui/badge/Badge.vue +0 -28
- package/app/components/ui/badge/index.ts +0 -24
- package/app/components/ui/button/Button.vue +0 -31
- package/app/components/ui/button/index.ts +0 -35
- package/app/components/ui/collapsible/Collapsible.vue +0 -15
- package/app/components/ui/collapsible/CollapsibleContent.vue +0 -25
- package/app/components/ui/collapsible/CollapsibleTrigger.vue +0 -12
- package/app/components/ui/collapsible/index.ts +0 -3
- package/app/components/ui/dropdown-menu/DropdownMenu.vue +0 -15
- package/app/components/ui/dropdown-menu/DropdownMenuContent.vue +0 -50
- package/app/components/ui/dropdown-menu/DropdownMenuItem.vue +0 -41
- package/app/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +0 -15
- package/app/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +0 -37
- package/app/components/ui/dropdown-menu/DropdownMenuSeparator.vue +0 -23
- package/app/components/ui/dropdown-menu/DropdownMenuTrigger.vue +0 -14
- package/app/components/ui/dropdown-menu/index.ts +0 -7
- package/app/components/ui/kbd/Kbd.vue +0 -23
- package/app/components/ui/kbd/index.ts +0 -21
- package/app/components/ui/scroll-area/ScrollArea.vue +0 -39
- package/app/components/ui/scroll-area/ScrollBar.vue +0 -33
- package/app/components/ui/scroll-area/index.ts +0 -2
- package/app/components/ui/separator/Separator.vue +0 -27
- package/app/components/ui/separator/index.ts +0 -1
- package/app/components/ui/sheet/Sheet.vue +0 -15
- package/app/components/ui/sheet/SheetContent.vue +0 -59
- package/app/components/ui/sheet/SheetDescription.vue +0 -21
- package/app/components/ui/sheet/SheetOverlay.vue +0 -26
- package/app/components/ui/sheet/SheetTitle.vue +0 -21
- package/app/components/ui/sheet/SheetTrigger.vue +0 -12
- package/app/components/ui/sheet/index.ts +0 -5
- package/app/components/ui/tabs/Tabs.vue +0 -24
- package/app/components/ui/tabs/TabsList.vue +0 -26
- package/app/components/ui/tabs/TabsTrigger.vue +0 -28
- package/app/components/ui/tabs/index.ts +0 -3
- package/app/composables/site-navigation.utils.ts +0 -133
- package/app/composables/useCanonicalUrl.ts +0 -9
- package/app/composables/useContentRouteAlternates.ts +0 -35
- package/app/composables/useGinkoAnalytics.ts +0 -52
- package/app/composables/useGinkoDocsConfig.ts +0 -6
- package/app/composables/useGinkoOgImage.ts +0 -20
- package/app/composables/useLocalizedPath.ts +0 -12
- package/app/composables/useLocalizedRouteSwitch.ts +0 -31
- package/app/composables/useMetaKey.ts +0 -18
- package/app/composables/usePageMarkdownActions.ts +0 -79
- package/app/composables/useProseAppearance.ts +0 -24
- package/app/composables/useSchemaJsonLd.ts +0 -25
- package/app/composables/useSiteNavigation.ts +0 -64
- package/app/config/site.utils.ts +0 -36
- package/app/features/docs/components/DocsBreadcrumb.vue +0 -37
- package/app/features/docs/components/DocsContributeLinks.vue +0 -75
- package/app/features/docs/components/DocsMobileToc.vue +0 -108
- package/app/features/docs/components/DocsPageContent.vue +0 -234
- package/app/features/docs/components/DocsPageNav.vue +0 -57
- package/app/features/docs/components/DocsSidebar.vue +0 -145
- package/app/features/docs/components/DocsSidebarDropdown.vue +0 -70
- package/app/features/docs/components/DocsSidebarItem.vue +0 -122
- package/app/features/docs/components/DocsSidebarList.vue +0 -35
- package/app/features/docs/components/DocsSidebarRow.vue +0 -27
- package/app/features/docs/components/DocsSidebarTabs.vue +0 -59
- package/app/features/docs/components/DocsToc.vue +0 -106
- package/app/features/docs/composables/useDocsNavigation.ts +0 -29
- package/app/features/docs/composables/useDocsNavigationData.ts +0 -18
- package/app/features/docs/composables/useRevealActive.ts +0 -58
- package/app/features/docs/composables/useScrollspy.ts +0 -135
- package/app/features/docs/docs-navigation.ts +0 -157
- package/app/features/docs/toc-context.ts +0 -6
- package/app/features/search/command-center.ts +0 -110
- package/app/features/search/components/SiteCommandCenter.vue +0 -359
- package/app/features/search/components/SiteSearchPageHighlight.vue +0 -126
- package/app/features/search/useCommandCenter.ts +0 -292
- package/app/layouts/blog.vue +0 -15
- package/app/layouts/docs.vue +0 -20
- package/app/lib/errors.ts +0 -37
- package/app/lib/schema-org.ts +0 -38
- package/app/pages/blog/[slug].vue +0 -228
- package/app/pages/blog/index.vue +0 -130
- package/app/pages/docs/[...slug].vue +0 -10
- package/app/pages/docs/index.vue +0 -19
- package/app/pages/index.vue +0 -278
- package/app/plugins/ginko-docs-theme.ts +0 -14
- package/app/plugins/ssr-width.ts +0 -6
- package/app/utils/content.ts +0 -67
- package/app/utils/file-icons.ts +0 -90
- package/app/utils/index.ts +0 -7
- package/app/utils/repository.ts +0 -20
- package/components.ts +0 -9
- package/content-collections.ts +0 -89
- package/content.js +0 -200
- package/content.ts +0 -104
- package/i18n/i18n.config.ts +0 -10
- package/i18n/locales.ts +0 -81
- package/i18n/messages/global/banner.ts +0 -8
- package/i18n/messages/global/blog.ts +0 -18
- package/i18n/messages/global/command.ts +0 -49
- package/i18n/messages/global/docs.ts +0 -36
- package/i18n/messages/global/errors.ts +0 -36
- package/i18n/messages/global/feedback.ts +0 -11
- package/i18n/messages/global/index.ts +0 -21
- package/i18n/messages/global/nav.ts +0 -26
- package/i18n/messages/global/site.ts +0 -4
- package/i18n/messages/global/theme.ts +0 -9
- package/i18n/messages/index.ts +0 -20
- package/i18n/messages/localize.ts +0 -35
- package/i18n/routes.ts +0 -33
- package/icon-bundle.ts +0 -116
- package/index.d.ts +0 -37
- package/modules/analytics-boundary.ts +0 -23
- package/modules/feature-routing.ts +0 -68
- package/modules/syntax-highlighting.ts +0 -120
- package/public/fonts/public-sans/LICENSE +0 -93
- package/public/fonts/public-sans/README.md +0 -12
- package/public/fonts/public-sans/public-sans-400-normal-latin.woff +0 -0
- package/public/fonts/public-sans/public-sans-500-normal-latin.woff +0 -0
- package/public/fonts/public-sans/public-sans-600-normal-latin.woff +0 -0
- package/public/fonts/public-sans/public-sans-700-normal-latin.woff +0 -0
- package/runtime/generate-favicons.mjs +0 -124
- package/runtime/server/agent-markdown.ts +0 -19
- package/server/api/_ginko-docs/redirects.get.ts +0 -28
- package/server/mcp/tools/get-page.ts +0 -14
- package/server/mcp/tools/list-pages.ts +0 -10
- package/server/middleware/redirects.ts +0 -22
- package/server/plugins/agent-markdown.ts +0 -6
- package/server/plugins/sitemap-policy.ts +0 -12
- package/server/routes/.well-known/ai-catalog.json.get.ts +0 -10
- package/server/routes/[locale]/blog/rss.xml.get.ts +0 -13
- package/server/routes/blog/rss.xml.get.ts +0 -5
- package/server/routes/mcp/server-card.get.ts +0 -14
- package/server/utils/blog-feed.ts +0 -51
- package/server/utils/feed.ts +0 -70
- package/server/utils/mcp-server-card.ts +0 -45
- package/server/utils/redirects.ts +0 -38
- package/server/utils/redirects.utils.ts +0 -58
- package/server/utils/sitemap.ts +0 -45
- package/shared/route-slugs.ts +0 -5
- package/shared/theme-palettes.ts +0 -37
- package/shared/theme-presets.ts +0 -3
- package/shared/types/app-config.ts +0 -172
- package/shared/types/nuxt-config.ts +0 -14
- package/tags.ts +0 -192
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, type CSSProperties } from "vue";
|
|
3
|
-
import { cn } from "../../utils";
|
|
4
|
-
import type { HTMLAttributes } from "vue";
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(
|
|
7
|
-
defineProps<{
|
|
8
|
-
/**
|
|
9
|
-
* Drop cap spans this many line boxes (`initial-letter` size / sink).
|
|
10
|
-
* Markdown props may arrive as strings.
|
|
11
|
-
*/
|
|
12
|
-
lines?: number | string;
|
|
13
|
-
class?: HTMLAttributes["class"];
|
|
14
|
-
}>(),
|
|
15
|
-
{ lines: 2 },
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const lineCount = computed(() => {
|
|
19
|
-
const n = Math.round(Number(props.lines));
|
|
20
|
-
if (Number.isFinite(n) && n >= 2 && n <= 4) return n;
|
|
21
|
-
return 2;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const dropcapStyle = computed(
|
|
25
|
-
(): CSSProperties => ({
|
|
26
|
-
"--mdc-dropcap-lines": String(lineCount.value),
|
|
27
|
-
}),
|
|
28
|
-
);
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<template>
|
|
32
|
-
<div
|
|
33
|
-
:class="
|
|
34
|
-
cn(
|
|
35
|
-
'mdc-dropcap content-prose content-prose-trim not-prose my-6 text-pretty [&>p]:text-muted-foreground',
|
|
36
|
-
'[&>p:not(:first-of-type)]:mt-4',
|
|
37
|
-
'[&>p:first-of-type]:flow-root',
|
|
38
|
-
props.class,
|
|
39
|
-
)
|
|
40
|
-
"
|
|
41
|
-
:style="dropcapStyle"
|
|
42
|
-
>
|
|
43
|
-
<slot />
|
|
44
|
-
</div>
|
|
45
|
-
</template>
|
|
46
|
-
|
|
47
|
-
<style scoped>
|
|
48
|
-
.mdc-dropcap {
|
|
49
|
-
--mdc-dropcap-lines: 2;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.mdc-dropcap :deep(p:first-of-type)::first-letter {
|
|
53
|
-
font-weight: 600;
|
|
54
|
-
color: var(--foreground);
|
|
55
|
-
margin-inline-end: 0.15em;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* CSS Inline Layout 3: typographic alignment vs float hacks (Chrome 110+, Safari + webkit prefix). */
|
|
59
|
-
@supports (-webkit-initial-letter: 2) or (initial-letter: 1 1) {
|
|
60
|
-
.mdc-dropcap :deep(p:first-of-type)::first-letter {
|
|
61
|
-
-webkit-initial-letter: var(--mdc-dropcap-lines);
|
|
62
|
-
initial-letter: var(--mdc-dropcap-lines);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/* Firefox and legacy: float plus glyph height approximates N line boxes (`lh` ties to paragraph leading). */
|
|
67
|
-
@supports (not ((-webkit-initial-letter: 2) or (initial-letter: 1 1))) {
|
|
68
|
-
.mdc-dropcap :deep(p:first-of-type)::first-letter {
|
|
69
|
-
float: left;
|
|
70
|
-
line-height: 1;
|
|
71
|
-
margin-top: 0.08em;
|
|
72
|
-
margin-bottom: -0.06em;
|
|
73
|
-
font-size: calc(var(--mdc-dropcap-lines) * 1.325em);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@supports (font-size: 1lh) {
|
|
77
|
-
.mdc-dropcap :deep(p:first-of-type)::first-letter {
|
|
78
|
-
font-size: calc(var(--mdc-dropcap-lines) * 1lh);
|
|
79
|
-
margin-top: 0.05em;
|
|
80
|
-
margin-bottom: -0.06em;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
</style>
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
appearance?: "quiet" | "tint";
|
|
9
|
-
class?: HTMLAttributes["class"];
|
|
10
|
-
}>();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<template>
|
|
14
|
-
<MdcCallout
|
|
15
|
-
:title="title"
|
|
16
|
-
:icon="icon"
|
|
17
|
-
type="error"
|
|
18
|
-
:appearance="appearance"
|
|
19
|
-
:class="props.class"
|
|
20
|
-
>
|
|
21
|
-
<slot />
|
|
22
|
-
</MdcCallout>
|
|
23
|
-
</template>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from "vue";
|
|
3
|
-
import { useProseAppearance } from "../../composables/useProseAppearance";
|
|
4
|
-
import { cn } from "../../utils";
|
|
5
|
-
|
|
6
|
-
const props = defineProps<{
|
|
7
|
-
label?: string;
|
|
8
|
-
source?: string;
|
|
9
|
-
appearance?: "quiet" | "tint";
|
|
10
|
-
class?: HTMLAttributes["class"];
|
|
11
|
-
}>();
|
|
12
|
-
|
|
13
|
-
const appearance = useProseAppearance("excerpt", () => props.appearance);
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<template>
|
|
17
|
-
<figure :class="cn('content-excerpt not-prose', props.class)" :data-appearance="appearance">
|
|
18
|
-
<p v-if="label" class="content-excerpt-label">
|
|
19
|
-
{{ label }}
|
|
20
|
-
</p>
|
|
21
|
-
<blockquote class="content-excerpt-body content-prose content-prose-trim">
|
|
22
|
-
<slot />
|
|
23
|
-
</blockquote>
|
|
24
|
-
<figcaption v-if="source" class="content-excerpt-source">{{ source }}</figcaption>
|
|
25
|
-
</figure>
|
|
26
|
-
</template>
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from "vue";
|
|
3
|
-
import { Motion } from "motion-v";
|
|
4
|
-
import { computed } from "vue";
|
|
5
|
-
import { useI18n } from "#imports";
|
|
6
|
-
import ImageZoomDialog from "#ginko-docs/components/content/ImageZoomDialog.vue";
|
|
7
|
-
import { useGinkoDocsConfig } from "#ginko-docs/composables/useGinkoDocsConfig";
|
|
8
|
-
import { cn } from "../../utils";
|
|
9
|
-
import { useProseAppearance } from "../../composables/useProseAppearance";
|
|
10
|
-
|
|
11
|
-
const props = withDefaults(
|
|
12
|
-
defineProps<{
|
|
13
|
-
src?: string;
|
|
14
|
-
alt?: string;
|
|
15
|
-
caption?: string;
|
|
16
|
-
width?: string | number;
|
|
17
|
-
height?: string | number;
|
|
18
|
-
bleed?: boolean | string;
|
|
19
|
-
aspect?: "auto" | "video" | "wide" | "square" | "portrait";
|
|
20
|
-
fit?: "cover" | "contain";
|
|
21
|
-
zoom?: boolean | string;
|
|
22
|
-
class?: HTMLAttributes["class"];
|
|
23
|
-
appearance?: "quiet" | "tint";
|
|
24
|
-
}>(),
|
|
25
|
-
{
|
|
26
|
-
// Vue casts an absent Boolean-typed prop to false; "auto" preserves the
|
|
27
|
-
// site-wide images.zoom default unless the author overrides it.
|
|
28
|
-
zoom: "auto",
|
|
29
|
-
},
|
|
30
|
-
);
|
|
31
|
-
const appearance = useProseAppearance("figure", () => props.appearance);
|
|
32
|
-
|
|
33
|
-
const { t } = useI18n();
|
|
34
|
-
const config = useGinkoDocsConfig();
|
|
35
|
-
const zoomEnabled = computed(() => {
|
|
36
|
-
if (props.zoom === "auto") return config.images?.zoom !== false;
|
|
37
|
-
return props.zoom === true || props.zoom === "true";
|
|
38
|
-
});
|
|
39
|
-
const shouldBleed = computed(
|
|
40
|
-
() => props.bleed === true || props.bleed === "true" || props.bleed === "outside",
|
|
41
|
-
);
|
|
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 ?? "auto"];
|
|
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
|
-
:data-appearance="appearance"
|
|
63
|
-
>
|
|
64
|
-
<template v-if="src">
|
|
65
|
-
<ImageZoomDialog v-if="zoomEnabled" :src="src" :alt="alt" :label="caption">
|
|
66
|
-
<template #trigger="{ layoutId, transition }">
|
|
67
|
-
<button
|
|
68
|
-
type="button"
|
|
69
|
-
class="block w-full cursor-zoom-in rounded-[inherit] focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none"
|
|
70
|
-
:aria-label="`${t('docs.zoomImage')}: ${alt ?? ''}`"
|
|
71
|
-
>
|
|
72
|
-
<Motion as-child :layout-id="layoutId" :transition="transition">
|
|
73
|
-
<img :src="src" :alt="alt" :width="width" :height="height" :class="imageClass" />
|
|
74
|
-
</Motion>
|
|
75
|
-
</button>
|
|
76
|
-
</template>
|
|
77
|
-
</ImageZoomDialog>
|
|
78
|
-
<img v-else :src="src" :alt="alt" :width="width" :height="height" :class="imageClass" />
|
|
79
|
-
</template>
|
|
80
|
-
<slot />
|
|
81
|
-
<figcaption v-if="caption || alt">
|
|
82
|
-
{{ caption || alt }}
|
|
83
|
-
</figcaption>
|
|
84
|
-
</figure>
|
|
85
|
-
</template>
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { VNode } from "vue";
|
|
3
|
-
import { h, resolveComponent, useSlots } from "vue";
|
|
4
|
-
import { useProseAppearance } from "../../composables/useProseAppearance";
|
|
5
|
-
import { resolveFileIcon } from "../../utils/file-icons";
|
|
6
|
-
|
|
7
|
-
type FileEntry = {
|
|
8
|
-
name: string;
|
|
9
|
-
path: string;
|
|
10
|
-
children?: FileEntry[];
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const props = defineProps<{
|
|
14
|
-
active?: string;
|
|
15
|
-
annotations?: Record<string, string>;
|
|
16
|
-
appearance?: "quiet" | "tint";
|
|
17
|
-
}>();
|
|
18
|
-
|
|
19
|
-
const slots = useSlots();
|
|
20
|
-
const appearance = useProseAppearance("files", () => props.appearance);
|
|
21
|
-
|
|
22
|
-
function childrenOf(node: VNode): VNode[] {
|
|
23
|
-
if (Array.isArray(node.children)) return node.children.filter(isVNode);
|
|
24
|
-
if (node.children && typeof node.children === "object") {
|
|
25
|
-
const slot = (node.children as { default?: () => unknown }).default;
|
|
26
|
-
const children = typeof slot === "function" ? slot() : [];
|
|
27
|
-
if (Array.isArray(children)) return children.filter(isVNode);
|
|
28
|
-
return isVNode(children) ? [children] : [];
|
|
29
|
-
}
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function isVNode(value: unknown): value is VNode {
|
|
34
|
-
return value !== null && typeof value === "object" && "type" in value;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function textOf(value: unknown): string {
|
|
38
|
-
if (typeof value === "string") return value;
|
|
39
|
-
if (Array.isArray(value)) return value.map(textOf).join("");
|
|
40
|
-
if (!isVNode(value)) return "";
|
|
41
|
-
if (typeof value.children === "string") return value.children;
|
|
42
|
-
if (value.children && typeof value.children === "object") {
|
|
43
|
-
const slot = (value.children as { default?: () => unknown }).default;
|
|
44
|
-
if (typeof slot === "function") return textOf(slot());
|
|
45
|
-
}
|
|
46
|
-
return childrenOf(value).map(textOf).join("");
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function parseList(list: VNode, parent = ""): FileEntry[] {
|
|
50
|
-
return childrenOf(list)
|
|
51
|
-
.map((item) => {
|
|
52
|
-
const children = childrenOf(item);
|
|
53
|
-
const nested = children.length > 1 ? children.at(-1) : undefined;
|
|
54
|
-
const name = children
|
|
55
|
-
.filter((node) => node !== nested)
|
|
56
|
-
.map(textOf)
|
|
57
|
-
.join("")
|
|
58
|
-
.trim();
|
|
59
|
-
const path = parent ? `${parent}/${name}` : name;
|
|
60
|
-
return {
|
|
61
|
-
name,
|
|
62
|
-
path,
|
|
63
|
-
...(nested ? { children: parseList(nested, path) } : {}),
|
|
64
|
-
};
|
|
65
|
-
})
|
|
66
|
-
.filter((entry) => entry.name.length > 0);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function renderEntries(items: FileEntry[]): VNode {
|
|
70
|
-
const Icon = resolveComponent("Icon");
|
|
71
|
-
return h(
|
|
72
|
-
"ul",
|
|
73
|
-
{ class: "content-files-list" },
|
|
74
|
-
items.map((entry) => {
|
|
75
|
-
const folder = Boolean(entry.children);
|
|
76
|
-
const active = props.active === entry.path;
|
|
77
|
-
return h("li", { key: entry.path, class: "content-files-item" }, [
|
|
78
|
-
h(
|
|
79
|
-
"div",
|
|
80
|
-
{
|
|
81
|
-
class: "content-files-row",
|
|
82
|
-
"data-active": active || undefined,
|
|
83
|
-
"aria-current": active ? "true" : undefined,
|
|
84
|
-
},
|
|
85
|
-
[
|
|
86
|
-
h(Icon, {
|
|
87
|
-
name: folder ? "lucide:folder-open" : resolveFileIcon(entry.name),
|
|
88
|
-
class: "content-files-icon",
|
|
89
|
-
"aria-hidden": "true",
|
|
90
|
-
}),
|
|
91
|
-
h("span", { class: "content-files-name" }, entry.name),
|
|
92
|
-
props.annotations?.[entry.path]
|
|
93
|
-
? h("span", { class: "content-files-annotation" }, props.annotations[entry.path])
|
|
94
|
-
: null,
|
|
95
|
-
],
|
|
96
|
-
),
|
|
97
|
-
entry.children?.length ? renderEntries(entry.children) : null,
|
|
98
|
-
]);
|
|
99
|
-
}),
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function renderFiles() {
|
|
104
|
-
const list = slots.default?.()[0];
|
|
105
|
-
const entries = list ? parseList(list) : [];
|
|
106
|
-
if (!entries.length) return null;
|
|
107
|
-
return h(
|
|
108
|
-
"div",
|
|
109
|
-
{
|
|
110
|
-
class: "content-files not-prose",
|
|
111
|
-
"data-appearance": appearance.value,
|
|
112
|
-
},
|
|
113
|
-
[renderEntries(entries)],
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
</script>
|
|
117
|
-
|
|
118
|
-
<template>
|
|
119
|
-
<component :is="renderFiles" />
|
|
120
|
-
</template>
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
appearance?: "quiet" | "tint";
|
|
9
|
-
class?: HTMLAttributes["class"];
|
|
10
|
-
}>();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<template>
|
|
14
|
-
<MdcCallout :title="title" :icon="icon" type="idea" :appearance="appearance" :class="props.class">
|
|
15
|
-
<slot />
|
|
16
|
-
</MdcCallout>
|
|
17
|
-
</template>
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
appearance?: "quiet" | "tint";
|
|
9
|
-
class?: HTMLAttributes["class"];
|
|
10
|
-
}>();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<template>
|
|
14
|
-
<MdcCallout :title="title" :icon="icon" type="info" :appearance="appearance" :class="props.class">
|
|
15
|
-
<slot />
|
|
16
|
-
</MdcCallout>
|
|
17
|
-
</template>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from "vue";
|
|
3
|
-
import { computed, inject } from "vue";
|
|
4
|
-
import {
|
|
5
|
-
Collapsible,
|
|
6
|
-
CollapsibleContent,
|
|
7
|
-
CollapsibleTrigger,
|
|
8
|
-
} from "#ginko-docs/components/ui/collapsible";
|
|
9
|
-
import DocsToc from "#ginko-docs/features/docs/components/DocsToc.vue";
|
|
10
|
-
import { docsTocKey } from "#ginko-docs/features/docs/toc-context";
|
|
11
|
-
import { filterTocByDepth } from "#ginko-docs/utils/content";
|
|
12
|
-
import { useI18n } from "#imports";
|
|
13
|
-
import { cn } from "../../utils";
|
|
14
|
-
|
|
15
|
-
const props = defineProps<{
|
|
16
|
-
title?: string;
|
|
17
|
-
/** Restrict to headings up to this depth (within the page TOC depth). */
|
|
18
|
-
depth?: number;
|
|
19
|
-
open?: boolean | string;
|
|
20
|
-
class?: HTMLAttributes["class"];
|
|
21
|
-
}>();
|
|
22
|
-
|
|
23
|
-
const { t } = useI18n();
|
|
24
|
-
const pageToc = inject(docsTocKey, undefined);
|
|
25
|
-
|
|
26
|
-
const items = computed(() => {
|
|
27
|
-
const all = pageToc?.value ?? [];
|
|
28
|
-
return props.depth ? filterTocByDepth(all, props.depth) : all;
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const defaultOpen = computed(
|
|
32
|
-
() => props.open !== undefined && props.open !== false && props.open !== "false",
|
|
33
|
-
);
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<template>
|
|
37
|
-
<Collapsible
|
|
38
|
-
v-if="items.length"
|
|
39
|
-
:default-open="defaultOpen"
|
|
40
|
-
:class="cn('content-inline-toc not-prose', props.class)"
|
|
41
|
-
>
|
|
42
|
-
<CollapsibleTrigger class="content-inline-toc-trigger">
|
|
43
|
-
<Icon name="lucide:list" class="content-inline-toc-icon" aria-hidden="true" />
|
|
44
|
-
<span class="content-inline-toc-title">{{ title ?? t("docs.toc") }}</span>
|
|
45
|
-
<Icon name="lucide:chevron-down" class="content-inline-toc-chevron" aria-hidden="true" />
|
|
46
|
-
</CollapsibleTrigger>
|
|
47
|
-
<CollapsibleContent class="content-inline-toc-content">
|
|
48
|
-
<DocsToc :items="items" :show-title="false" />
|
|
49
|
-
</CollapsibleContent>
|
|
50
|
-
</Collapsible>
|
|
51
|
-
</template>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from "vue";
|
|
3
|
-
import { cn } from "../../utils";
|
|
4
|
-
|
|
5
|
-
const props = defineProps<{ class?: HTMLAttributes["class"] }>();
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<template>
|
|
9
|
-
<kbd :class="cn('content-kbd', props.class)"><slot /></kbd>
|
|
10
|
-
</template>
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, provide, type HTMLAttributes } from "vue";
|
|
3
|
-
import { cn } from "../../utils";
|
|
4
|
-
|
|
5
|
-
type ValueProp<T extends string> = T | { value?: T | string };
|
|
6
|
-
type LayoutType = "default" | "card" | "border" | "border-dashed" | "outline" | "outline-dashed";
|
|
7
|
-
|
|
8
|
-
const props = withDefaults(
|
|
9
|
-
defineProps<{
|
|
10
|
-
type?: ValueProp<LayoutType>;
|
|
11
|
-
class?: HTMLAttributes["class"];
|
|
12
|
-
}>(),
|
|
13
|
-
{
|
|
14
|
-
type: "default",
|
|
15
|
-
},
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const layoutTypeValue = computed<LayoutType>(() => {
|
|
19
|
-
if (typeof props.type === "string") return props.type;
|
|
20
|
-
return (props.type?.value as LayoutType | undefined) ?? "default";
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const layoutRowClass = "content-layout-row";
|
|
24
|
-
|
|
25
|
-
provide(
|
|
26
|
-
"mdc-layout-type",
|
|
27
|
-
computed(() => layoutTypeValue.value),
|
|
28
|
-
);
|
|
29
|
-
provide("mdc-inside-layout", true);
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<template>
|
|
33
|
-
<div :class="cn('content-layout h-full', props.class)">
|
|
34
|
-
<div v-if="layoutTypeValue === 'card'" class="w-full">
|
|
35
|
-
<div class="h-full">
|
|
36
|
-
<div :class="layoutRowClass">
|
|
37
|
-
<slot />
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
<div
|
|
42
|
-
v-else
|
|
43
|
-
:class="
|
|
44
|
-
cn(
|
|
45
|
-
layoutRowClass,
|
|
46
|
-
'h-full',
|
|
47
|
-
layoutTypeValue === 'border' && 'content-layout-row-border',
|
|
48
|
-
layoutTypeValue === 'border-dashed' && 'content-layout-row-border-dashed',
|
|
49
|
-
layoutTypeValue === 'outline' && 'content-layout-row-outline',
|
|
50
|
-
layoutTypeValue === 'outline-dashed' && 'content-layout-row-outline-dashed',
|
|
51
|
-
)
|
|
52
|
-
"
|
|
53
|
-
>
|
|
54
|
-
<slot />
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
</template>
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
appearance?: "quiet" | "tint";
|
|
9
|
-
class?: HTMLAttributes["class"];
|
|
10
|
-
}>();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<template>
|
|
14
|
-
<MdcCallout :title="title" :icon="icon" type="note" :appearance="appearance" :class="props.class">
|
|
15
|
-
<slot />
|
|
16
|
-
</MdcCallout>
|
|
17
|
-
</template>
|