@vite-hub/docs 0.0.0 → 0.3.1
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 +201 -0
- package/README.md +454 -0
- package/dist/agent-copy-BJp_Yf5d.js +33 -0
- package/dist/assistant-shared-CdtXowot.js +97 -0
- package/dist/assistant-shared-Dll_F_yy.d.ts +27 -0
- package/dist/assistant-worker.d.ts +11 -0
- package/dist/assistant-worker.js +16 -0
- package/dist/assistant.d.ts +14 -0
- package/dist/assistant.js +19 -0
- package/dist/content-9CINWiRf.js +171 -0
- package/dist/draft-DUBx--r9.js +45 -0
- package/dist/error-diagnostics-BoOsP6Y4.js +53 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +27 -0
- package/dist/link-checker-redirects.d.ts +13 -0
- package/dist/link-checker-redirects.js +25 -0
- package/dist/manifest-D66AEF8F.js +420 -0
- package/dist/manifest-Dzp5-_AJ.d.ts +74 -0
- package/dist/markdown-Cn9-4oVG.js +378 -0
- package/dist/navigation.d.ts +284 -0
- package/dist/navigation.js +520 -0
- package/dist/nuxt-B5LrERKc.d.ts +240 -0
- package/dist/nuxt.d.ts +3 -0
- package/dist/nuxt.js +1485 -0
- package/dist/page-BbmSfZO8.js +81 -0
- package/dist/page-Dx2JD3y1.d.ts +74 -0
- package/dist/primitive-rail.d.ts +110 -0
- package/dist/primitive-rail.js +284 -0
- package/dist/raw-C03EUJKw.js +851 -0
- package/dist/redirects-BrbWFSzW.js +62 -0
- package/dist/runtime/app/app.vue +11 -0
- package/dist/runtime/app/assistant/DocsAssistant.vue +81 -0
- package/dist/runtime/app/assistant/DocsAssistantOff.vue +8 -0
- package/dist/runtime/app/assistant/DocsAssistantPanel.vue +322 -0
- package/dist/runtime/app/components/AppHeader.vue +368 -0
- package/dist/runtime/app/components/AppSearch.vue +68 -0
- package/dist/runtime/app/components/DocsAppShell.vue +62 -0
- package/dist/runtime/app/components/DocsArticle.vue +184 -0
- package/dist/runtime/app/components/DocsAsideFooter.vue +94 -0
- package/dist/runtime/app/components/DocsAsideLeftBody.vue +584 -0
- package/dist/runtime/app/components/DocsAsideLeftTop.vue +132 -0
- package/dist/runtime/app/components/DocsBrandMark.vue +52 -0
- package/dist/runtime/app/components/DocsCatalogFooter.vue +129 -0
- package/dist/runtime/app/components/DocsCodePanel.vue +388 -0
- package/dist/runtime/app/components/DocsCodePre.vue +120 -0
- package/dist/runtime/app/components/DocsHeaderActions.vue +4 -0
- package/dist/runtime/app/components/DocsLanding.vue +83 -0
- package/dist/runtime/app/components/DocsMarkdown.vue +64 -0
- package/dist/runtime/app/components/DocsPage.vue +149 -0
- package/dist/runtime/app/components/DocsPageCredits.vue +41 -0
- package/dist/runtime/app/components/DocsPageHeaderLinks.vue +120 -0
- package/dist/runtime/app/components/DocsRail.vue +239 -0
- package/dist/runtime/app/components/DocsSidebarStrip.vue +81 -0
- package/dist/runtime/app/components/DocsSidebars.vue +63 -0
- package/dist/runtime/app/components/OgImage/DocsPage.takumi.vue +33 -0
- package/dist/runtime/app/components/content/AgentOnly.vue +9 -0
- package/dist/runtime/app/components/content/CodeTree.vue +203 -0
- package/dist/runtime/app/components/content/ComarkHtml.vue +31 -0
- package/dist/runtime/app/components/content/Correct.vue +17 -0
- package/dist/runtime/app/components/content/Example.vue +260 -0
- package/dist/runtime/app/components/content/ExamplePreview.vue +6 -0
- package/dist/runtime/app/components/content/Examples.vue +71 -0
- package/dist/runtime/app/components/content/Incorrect.vue +17 -0
- package/dist/runtime/app/components/content/PageList.vue +206 -0
- package/dist/runtime/app/components/content/ProductFeatureItem.vue +43 -0
- package/dist/runtime/app/components/content/ProductFeatures.vue +17 -0
- package/dist/runtime/app/components/content/TutorialStep.vue +39 -0
- package/dist/runtime/app/composables/docs-assistant-problem.ts +59 -0
- package/dist/runtime/app/composables/docs-theme.ts +15 -0
- package/dist/runtime/app/composables/docs.ts +83 -0
- package/dist/runtime/app/composables/headerActions.ts +6 -0
- package/dist/runtime/app/composables/icons.ts +14 -0
- package/dist/runtime/app/composables/seo.ts +64 -0
- package/dist/runtime/app/composables/tutorial.ts +40 -0
- package/dist/runtime/app/composables/useDocsAssistant.ts +17 -0
- package/dist/runtime/app/error.vue +88 -0
- package/dist/runtime/app/layouts/default.vue +7 -0
- package/dist/runtime/app/layouts/docs.vue +104 -0
- package/dist/runtime/app/middleware/docs-layout.ts +23 -0
- package/dist/runtime/app/pages/docs-page.vue +3 -0
- package/dist/runtime/app/plugins/comark-css.ts +14 -0
- package/dist/runtime/app/plugins/icon-stroke.ts +12 -0
- package/dist/runtime/app/plugins/theme-color.ts +18 -0
- package/dist/runtime/app/utils/docs-theme.ts +43 -0
- package/dist/runtime/app/utils/file-tree.ts +40 -0
- package/dist/runtime/server/llms.d.ts +6 -0
- package/dist/runtime/server/llms.js +7 -0
- package/dist/runtime/server/markdown.d.ts +10 -0
- package/dist/runtime/server/markdown.js +11 -0
- package/dist/runtime/server/mcp.d.ts +6 -0
- package/dist/runtime/server/mcp.js +7 -0
- package/dist/runtime/server/page.d.ts +7 -0
- package/dist/runtime/server/page.js +27 -0
- package/dist/runtime/server/raw.d.ts +10 -0
- package/dist/runtime/server/raw.js +23 -0
- package/dist/runtime/server/search.d.ts +6 -0
- package/dist/runtime/server/search.js +32 -0
- package/dist/runtime/server/sitemap.d.ts +6 -0
- package/dist/runtime/server/sitemap.js +52 -0
- package/dist/runtime/server/trailing-slash.d.ts +10 -0
- package/dist/runtime/server/trailing-slash.js +28 -0
- package/dist/runtime/theme/design.css +464 -0
- package/dist/schema-DwpXW0VZ.js +98 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.js +5 -0
- package/dist/theme-BXyu4uFL.d.ts +32 -0
- package/dist/theme-DzC8LtMH.js +237 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +2 -0
- package/dist/types-BhG6vGfG.d.ts +212 -0
- package/package.json +144 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useDocsHeaderActionsTarget } from "../composables/headerActions"
|
|
3
|
+
|
|
4
|
+
// Wide screens have no site header beside the docs sidebar, so its foot holds the repository, the community links, and
|
|
5
|
+
// the color mode button. Phones keep them in the header and its menu.
|
|
6
|
+
// A collapsed sidebar stacks them in its narrow column, as icons.
|
|
7
|
+
defineProps<{ stacked?: boolean }>()
|
|
8
|
+
const { github, site, socials } = useDocsConfig()
|
|
9
|
+
const actionsTargetId = useDocsHeaderActionsTarget()
|
|
10
|
+
const id = `docs-header-actions-${useId()}`
|
|
11
|
+
// Register only after hydration. The server and the first client render keep the action in the header.
|
|
12
|
+
onMounted(() => { actionsTargetId.value = id })
|
|
13
|
+
onBeforeUnmount(() => {
|
|
14
|
+
if (actionsTargetId.value === id) actionsTargetId.value = null
|
|
15
|
+
})
|
|
16
|
+
// Nuxt turns a `null` in runtime config into "", so only a number counts.
|
|
17
|
+
const stars = github && typeof github.stars === "number" ? new Intl.NumberFormat("en", { notation: "compact" }).format(github.stars) : null
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div class="vh-docs-aside-footer" :class="{ 'is-stacked': stacked }">
|
|
22
|
+
<div :id="id" class="contents" />
|
|
23
|
+
<a
|
|
24
|
+
v-if="github"
|
|
25
|
+
:href="github.url"
|
|
26
|
+
target="_blank"
|
|
27
|
+
rel="noopener"
|
|
28
|
+
class="vh-docs-aside-github"
|
|
29
|
+
:aria-label="stars ? `${site.name} on GitHub, ${stars} stars` : `${site.name} on GitHub`"
|
|
30
|
+
>
|
|
31
|
+
<UIcon name="i-simple-icons-github" class="size-4 shrink-0" />
|
|
32
|
+
<span v-if="stars && !stacked" class="vh-docs-aside-stars">
|
|
33
|
+
<UIcon name="i-lucide-star" class="size-3.5 shrink-0" />
|
|
34
|
+
{{ stars }}
|
|
35
|
+
</span>
|
|
36
|
+
</a>
|
|
37
|
+
<UButton
|
|
38
|
+
v-for="link in socials"
|
|
39
|
+
:key="link.to"
|
|
40
|
+
:to="link.to"
|
|
41
|
+
target="_blank"
|
|
42
|
+
:icon="link.icon"
|
|
43
|
+
:label="link.icon ? undefined : link.label"
|
|
44
|
+
color="neutral"
|
|
45
|
+
variant="ghost"
|
|
46
|
+
size="sm"
|
|
47
|
+
:aria-label="link.label"
|
|
48
|
+
/>
|
|
49
|
+
<!-- The button renders both icons and the color mode class picks one, so the server draws it too. -->
|
|
50
|
+
<UColorModeButton color="neutral" variant="ghost" size="sm" :class="{ 'ms-auto': !stacked }" />
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<style scoped>
|
|
55
|
+
.vh-docs-aside-footer {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-wrap: wrap;
|
|
58
|
+
flex: none;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 0.25rem;
|
|
61
|
+
border-top: 1px solid var(--ui-border);
|
|
62
|
+
padding: 0.5rem 0.75rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.vh-docs-aside-footer.is-stacked {
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
padding: 0.5rem 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.vh-docs-aside-github {
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
height: 1.75rem;
|
|
73
|
+
align-items: center;
|
|
74
|
+
gap: 0.5rem;
|
|
75
|
+
border-radius: var(--ui-radius);
|
|
76
|
+
padding-inline: 0.375rem;
|
|
77
|
+
color: var(--ui-text-highlighted);
|
|
78
|
+
font-size: 0.75rem;
|
|
79
|
+
font-variant-numeric: tabular-nums;
|
|
80
|
+
transition: background-color 150ms ease;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.vh-docs-aside-github:hover {
|
|
84
|
+
background: var(--ui-bg-elevated);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
.vh-docs-aside-stars {
|
|
89
|
+
display: inline-flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
gap: 0.25rem;
|
|
92
|
+
color: var(--ui-text-muted);
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DocsAppPage, DocsSidebarGroup } from "@vite-hub/docs"
|
|
3
|
+
|
|
4
|
+
import { docsCatalog, docsHasRail, docsPanelGroupWindow, docsPanelWindow, docsPanelOf, docsPanelSidebarGroups, docsRelatedSections, docsSectionHome, docsSectionPanels, docsSidebarGroup, docsSidebarGroups, docsSidebarSections, normalizeDocsPath } from "#docs/navigation"
|
|
5
|
+
|
|
6
|
+
const route = useRoute()
|
|
7
|
+
const manifest = useDocsManifest()
|
|
8
|
+
const { categories, groups, icons: iconOptions, railExclude, start } = useDocsConfig()
|
|
9
|
+
const icons = useDocsIcons()
|
|
10
|
+
const currentPath = computed(() => normalizeDocsPath(route.path))
|
|
11
|
+
const section = useDocsSection()
|
|
12
|
+
// The start section is the home of the docs, so it also lists the site pages that the header shows on the landing page.
|
|
13
|
+
const startLinks = computed(() => section.value && section.value.id === start?.section ? start.links : [])
|
|
14
|
+
const pageGroups = computed(() => section.value ? docsSidebarGroups(section.value) : [])
|
|
15
|
+
const related = computed(() => section.value ? docsRelatedSections(manifest, section.value) : [])
|
|
16
|
+
// Outside every section, for example on the catalog, the sidebar lists every section by category.
|
|
17
|
+
const catalog = docsCatalog(manifest, categories)
|
|
18
|
+
// A small site has no rail, so the sidebar lists every section with its pages on every page.
|
|
19
|
+
const rail = docsHasRail(manifest, iconOptions, groups, { categories, railExclude })
|
|
20
|
+
// Sidebar membership comes from every manifest section, including groups entirely excluded from the rail.
|
|
21
|
+
const group = computed(() => section.value ? docsSidebarGroup(manifest, section.value, groups) : null)
|
|
22
|
+
const sectionBlocks = computed(() => {
|
|
23
|
+
const sections = rail ? group.value?.sections : manifest.sections
|
|
24
|
+
return sections ? docsSidebarSections(sections) : null
|
|
25
|
+
})
|
|
26
|
+
const groupStartLinks = computed(() => start && group.value?.sections.some(candidate => candidate.id === start.section) ? start.links : [])
|
|
27
|
+
// Nuxt serializes a `null` runtime config value as "", so `start` can be a string here.
|
|
28
|
+
const siteLinks = computed(() => rail ? groupStartLinks.value : start?.links ?? [])
|
|
29
|
+
|
|
30
|
+
// A folder with `navigation.panel: true` replaces the section sidebar while the reader is inside it. The section sidebar
|
|
31
|
+
// links to each panel once.
|
|
32
|
+
const panel = computed(() => {
|
|
33
|
+
const page = section.value?.pages.find(candidate => candidate.path === currentPath.value)
|
|
34
|
+
return section.value && page ? docsPanelOf(section.value, page) : null
|
|
35
|
+
})
|
|
36
|
+
const panels = computed(() => section.value ? docsSectionPanels(section.value) : [])
|
|
37
|
+
// The site search finds a page of a long panel, so the panel has no filter of its own.
|
|
38
|
+
const panelGroups = computed(() => panel.value && section.value ? docsPanelSidebarGroups(section.value, panel.value) : [])
|
|
39
|
+
|
|
40
|
+
function isActive(path: string) {
|
|
41
|
+
return currentPath.value === normalizeDocsPath(path)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// A folded group opens itself on its own pages, so the current page stays in view.
|
|
45
|
+
// Key the active disclosure by its page so navigation also reopens a group the reader closed.
|
|
46
|
+
// Panels often list codes such as `QUEUE_BINDING_NOT_FOUND`. A code reads as code on one line, and the tooltip holds a
|
|
47
|
+
// code that the sidebar cuts.
|
|
48
|
+
function isCode(title: string) {
|
|
49
|
+
return /^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+$/.test(title)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function holdsCurrent(pageGroup: DocsSidebarGroup<DocsAppPage>) {
|
|
53
|
+
return pageGroup.pages.some(page => isActive(page.path))
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// A panel group renders its links only when the reader opens it, and the group of the current page renders the pages
|
|
57
|
+
// around it, so a page of a thousand-code panel does not carry every code. The panel Overview lists them all.
|
|
58
|
+
const shownGroups = ref(new Set<string>())
|
|
59
|
+
// Keyed by panel too, so a group the reader showed in one panel does not show the group of the same name in another.
|
|
60
|
+
function groupKey(pageGroup: DocsSidebarGroup<DocsAppPage>) {
|
|
61
|
+
return `${panel.value?.id}:${pageGroup.label || ""}`
|
|
62
|
+
}
|
|
63
|
+
// A folded group renders the window of the current page, or nothing while it is shut. A group that does not fold is
|
|
64
|
+
// always open, so without the current page it renders its first pages.
|
|
65
|
+
function panelLinks(pageGroup: DocsSidebarGroup<DocsAppPage>) {
|
|
66
|
+
if (shownGroups.value.has(groupKey(pageGroup))) return pageGroup.pages
|
|
67
|
+
if (pageGroup.fold || holdsCurrent(pageGroup)) return docsPanelGroupWindow(pageGroup.pages, currentPath.value)
|
|
68
|
+
return pageGroup.pages.slice(0, docsPanelWindow)
|
|
69
|
+
}
|
|
70
|
+
function showGroup(pageGroup: DocsSidebarGroup<DocsAppPage>) {
|
|
71
|
+
shownGroups.value = new Set([...shownGroups.value, groupKey(pageGroup)])
|
|
72
|
+
}
|
|
73
|
+
// The group of the current page opens with its window; only a group that the reader opens renders all its links.
|
|
74
|
+
function toggleGroup(pageGroup: DocsSidebarGroup<DocsAppPage>, event: Event) {
|
|
75
|
+
if (event.target instanceof HTMLDetailsElement && event.target.open && !holdsCurrent(pageGroup)) showGroup(pageGroup)
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<template>
|
|
80
|
+
<nav v-if="panel && section" class="vh-docs-sidebar-nav" :aria-label="`${panel.title} pages`">
|
|
81
|
+
<section class="vh-docs-sidebar-page-group vh-docs-sidebar-site-areas" :aria-label="`${panel.title} overview`">
|
|
82
|
+
<NuxtLink data-focus-inset :to="docsSectionHome(section)" class="vh-docs-sidebar-link vh-docs-sidebar-back">
|
|
83
|
+
<UIcon name="i-lucide-arrow-left" class="size-4 shrink-0" />
|
|
84
|
+
<span class="min-w-0">{{ section.title }}</span>
|
|
85
|
+
</NuxtLink>
|
|
86
|
+
<NuxtLink
|
|
87
|
+
:to="panel.path"
|
|
88
|
+
data-focus-inset
|
|
89
|
+
:class="['vh-docs-sidebar-link', { 'is-active': isActive(panel.path) }]"
|
|
90
|
+
:aria-current="isActive(panel.path) ? 'page' : undefined"
|
|
91
|
+
>
|
|
92
|
+
<UIcon :name="icons.page(panel)" class="size-4 shrink-0" />
|
|
93
|
+
<span class="min-w-0">{{ panel.title }}</span>
|
|
94
|
+
</NuxtLink>
|
|
95
|
+
</section>
|
|
96
|
+
|
|
97
|
+
<template v-for="pageGroup in panelGroups" :key="pageGroup.label || 'pages'">
|
|
98
|
+
<details
|
|
99
|
+
v-if="pageGroup.fold"
|
|
100
|
+
:key="holdsCurrent(pageGroup) ? currentPath : undefined"
|
|
101
|
+
class="vh-docs-sidebar-page-group vh-docs-sidebar-fold"
|
|
102
|
+
:open="holdsCurrent(pageGroup)"
|
|
103
|
+
@toggle="toggleGroup(pageGroup, $event)"
|
|
104
|
+
>
|
|
105
|
+
<summary data-focus-inset class="vh-docs-sidebar-page-group-heading">
|
|
106
|
+
<UIcon name="i-lucide-chevron-down" class="vh-docs-sidebar-fold-icon size-3 shrink-0" />
|
|
107
|
+
{{ pageGroup.label }}
|
|
108
|
+
<span class="vh-docs-sidebar-count">{{ pageGroup.pages.length }}</span>
|
|
109
|
+
</summary>
|
|
110
|
+
<NuxtLink
|
|
111
|
+
v-for="page in panelLinks(pageGroup)"
|
|
112
|
+
:key="page.path"
|
|
113
|
+
:to="page.path"
|
|
114
|
+
data-focus-inset
|
|
115
|
+
:class="['vh-docs-sidebar-link is-grouped', { 'is-active': isActive(page.path) }]"
|
|
116
|
+
:aria-current="isActive(page.path) ? 'page' : undefined"
|
|
117
|
+
>
|
|
118
|
+
<span :class="['min-w-0', { 'vh-docs-sidebar-code': isCode(page.title) }]" :title="isCode(page.title) ? page.title : undefined">{{ page.title }}</span>
|
|
119
|
+
</NuxtLink>
|
|
120
|
+
<button
|
|
121
|
+
v-if="panelLinks(pageGroup).length < pageGroup.pages.length && holdsCurrent(pageGroup)"
|
|
122
|
+
type="button"
|
|
123
|
+
data-focus-inset
|
|
124
|
+
class="vh-docs-sidebar-link is-grouped vh-docs-sidebar-show-all"
|
|
125
|
+
@click="showGroup(pageGroup)"
|
|
126
|
+
>
|
|
127
|
+
Show all {{ pageGroup.pages.length }}
|
|
128
|
+
</button>
|
|
129
|
+
</details>
|
|
130
|
+
<section v-else class="vh-docs-sidebar-page-group">
|
|
131
|
+
<h2 v-if="pageGroup.label" class="vh-docs-sidebar-page-group-heading">{{ pageGroup.label }}</h2>
|
|
132
|
+
<NuxtLink
|
|
133
|
+
v-for="page in panelLinks(pageGroup)"
|
|
134
|
+
:key="page.path"
|
|
135
|
+
:to="page.path"
|
|
136
|
+
data-focus-inset
|
|
137
|
+
:class="['vh-docs-sidebar-link', { 'is-grouped': pageGroup.label, 'is-active': isActive(page.path) }]"
|
|
138
|
+
:aria-current="isActive(page.path) ? 'page' : undefined"
|
|
139
|
+
>
|
|
140
|
+
<span :class="['min-w-0', { 'vh-docs-sidebar-code': isCode(page.title) }]" :title="isCode(page.title) ? page.title : undefined">{{ page.title }}</span>
|
|
141
|
+
</NuxtLink>
|
|
142
|
+
<button
|
|
143
|
+
v-if="panelLinks(pageGroup).length < pageGroup.pages.length"
|
|
144
|
+
type="button"
|
|
145
|
+
data-focus-inset
|
|
146
|
+
:class="['vh-docs-sidebar-link vh-docs-sidebar-show-all', { 'is-grouped': pageGroup.label }]"
|
|
147
|
+
@click="showGroup(pageGroup)"
|
|
148
|
+
>
|
|
149
|
+
Show all {{ pageGroup.pages.length }}
|
|
150
|
+
</button>
|
|
151
|
+
</section>
|
|
152
|
+
</template>
|
|
153
|
+
</nav>
|
|
154
|
+
|
|
155
|
+
<nav v-else-if="sectionBlocks" class="vh-docs-sidebar-nav" :aria-label="rail ? `${group?.title} pages` : 'Docs pages'">
|
|
156
|
+
<section v-if="siteLinks.length" class="vh-docs-sidebar-page-group vh-docs-sidebar-site-areas" aria-label="Site areas">
|
|
157
|
+
<NuxtLink
|
|
158
|
+
v-for="link in siteLinks"
|
|
159
|
+
:key="link.to"
|
|
160
|
+
:to="link.to"
|
|
161
|
+
data-focus-inset
|
|
162
|
+
:class="['vh-docs-sidebar-link', { 'is-active': isActive(link.to) }]"
|
|
163
|
+
:aria-current="isActive(link.to) ? 'page' : undefined"
|
|
164
|
+
>
|
|
165
|
+
<UIcon :name="link.icon ?? icons.page({ path: link.to, icon: null })" class="size-4 shrink-0" />
|
|
166
|
+
<span class="min-w-0">{{ link.label }}</span>
|
|
167
|
+
</NuxtLink>
|
|
168
|
+
</section>
|
|
169
|
+
<!-- A section is one row that opens its home page. Its other pages follow it, indented to its title. -->
|
|
170
|
+
<section
|
|
171
|
+
v-for="(block, index) in sectionBlocks"
|
|
172
|
+
:key="`${index}:${block.category}`"
|
|
173
|
+
class="vh-docs-sidebar-category"
|
|
174
|
+
:aria-label="block.category ?? undefined"
|
|
175
|
+
>
|
|
176
|
+
<h2 v-if="block.category" class="vh-docs-sidebar-heading">{{ block.category }}</h2>
|
|
177
|
+
<template v-for="entry in block.sections" :key="entry.section.id">
|
|
178
|
+
<NuxtLink
|
|
179
|
+
v-if="entry.home"
|
|
180
|
+
:to="entry.home.path"
|
|
181
|
+
data-focus-inset
|
|
182
|
+
:class="['vh-docs-sidebar-link', { 'is-active': isActive(entry.home.path) }]"
|
|
183
|
+
:aria-current="isActive(entry.home.path) ? 'page' : undefined"
|
|
184
|
+
>
|
|
185
|
+
<UIcon :name="icons.section(entry.section)" class="size-4 shrink-0" />
|
|
186
|
+
<span class="min-w-0">{{ entry.section.title }}</span>
|
|
187
|
+
</NuxtLink>
|
|
188
|
+
<h3 v-else class="vh-docs-sidebar-section-title">
|
|
189
|
+
<UIcon :name="icons.section(entry.section)" class="size-4 shrink-0" />
|
|
190
|
+
<span class="min-w-0">{{ entry.section.title }}</span>
|
|
191
|
+
</h3>
|
|
192
|
+
<template v-for="pageGroup in entry.groups" :key="pageGroup.label || 'pages'">
|
|
193
|
+
<details
|
|
194
|
+
v-if="pageGroup.fold"
|
|
195
|
+
:key="holdsCurrent(pageGroup) ? currentPath : undefined"
|
|
196
|
+
class="vh-docs-sidebar-fold"
|
|
197
|
+
:open="holdsCurrent(pageGroup)"
|
|
198
|
+
>
|
|
199
|
+
<summary data-focus-inset class="vh-docs-sidebar-page-group-heading is-nested">
|
|
200
|
+
<UIcon name="i-lucide-chevron-down" class="vh-docs-sidebar-fold-icon size-3 shrink-0" />
|
|
201
|
+
{{ pageGroup.label }}
|
|
202
|
+
</summary>
|
|
203
|
+
<NuxtLink
|
|
204
|
+
v-for="page in pageGroup.pages"
|
|
205
|
+
:key="page.path"
|
|
206
|
+
:to="page.path"
|
|
207
|
+
data-focus-inset
|
|
208
|
+
:class="['vh-docs-sidebar-link is-nested', { 'is-active': isActive(page.path) }]"
|
|
209
|
+
:aria-current="isActive(page.path) ? 'page' : undefined"
|
|
210
|
+
>
|
|
211
|
+
<UIcon :name="icons.page(page)" class="size-4 shrink-0" />
|
|
212
|
+
<span class="min-w-0">{{ page.title }}</span>
|
|
213
|
+
</NuxtLink>
|
|
214
|
+
</details>
|
|
215
|
+
<template v-else>
|
|
216
|
+
<h4 v-if="pageGroup.label" class="vh-docs-sidebar-page-group-heading is-nested">{{ pageGroup.label }}</h4>
|
|
217
|
+
<NuxtLink
|
|
218
|
+
v-for="page in pageGroup.pages"
|
|
219
|
+
:key="page.path"
|
|
220
|
+
:to="page.path"
|
|
221
|
+
data-focus-inset
|
|
222
|
+
:class="['vh-docs-sidebar-link is-nested', { 'is-active': isActive(page.path) }]"
|
|
223
|
+
:aria-current="isActive(page.path) ? 'page' : undefined"
|
|
224
|
+
>
|
|
225
|
+
<UIcon :name="icons.page(page)" class="size-4 shrink-0" />
|
|
226
|
+
<span class="min-w-0">{{ page.title }}</span>
|
|
227
|
+
</NuxtLink>
|
|
228
|
+
</template>
|
|
229
|
+
</template>
|
|
230
|
+
<NuxtLink
|
|
231
|
+
v-for="entryPanel in docsSectionPanels(entry.section)"
|
|
232
|
+
:key="entryPanel.page.path"
|
|
233
|
+
:to="entryPanel.page.path"
|
|
234
|
+
data-focus-inset
|
|
235
|
+
class="vh-docs-sidebar-link vh-docs-sidebar-panel-link is-nested"
|
|
236
|
+
>
|
|
237
|
+
<span class="min-w-0">{{ entryPanel.page.title }}</span>
|
|
238
|
+
<span class="vh-docs-sidebar-count">{{ entryPanel.count }}</span>
|
|
239
|
+
<UIcon name="i-lucide-chevron-right" class="size-4 shrink-0" />
|
|
240
|
+
</NuxtLink>
|
|
241
|
+
</template>
|
|
242
|
+
</section>
|
|
243
|
+
|
|
244
|
+
<section v-if="rail && related.length" class="vh-docs-sidebar-related" aria-label="Related products">
|
|
245
|
+
<h2 class="vh-docs-sidebar-heading">Related</h2>
|
|
246
|
+
<NuxtLink
|
|
247
|
+
v-for="relatedSection in related"
|
|
248
|
+
:key="relatedSection.id"
|
|
249
|
+
:to="docsSectionHome(relatedSection)"
|
|
250
|
+
data-focus-inset
|
|
251
|
+
class="vh-docs-sidebar-link"
|
|
252
|
+
>
|
|
253
|
+
<UIcon :name="icons.section(relatedSection)" class="size-4 shrink-0" />
|
|
254
|
+
<span class="min-w-0">{{ relatedSection.title }}</span>
|
|
255
|
+
</NuxtLink>
|
|
256
|
+
</section>
|
|
257
|
+
</nav>
|
|
258
|
+
|
|
259
|
+
<nav v-else-if="section" class="vh-docs-sidebar-nav" :aria-label="`${section.title} pages`">
|
|
260
|
+
<section v-if="startLinks.length" class="vh-docs-sidebar-page-group vh-docs-sidebar-site-areas" aria-label="Site areas">
|
|
261
|
+
<NuxtLink
|
|
262
|
+
v-for="link in startLinks"
|
|
263
|
+
:key="link.to"
|
|
264
|
+
:to="link.to"
|
|
265
|
+
data-focus-inset
|
|
266
|
+
:class="['vh-docs-sidebar-link', { 'is-active': isActive(link.to) }]"
|
|
267
|
+
:aria-current="isActive(link.to) ? 'page' : undefined"
|
|
268
|
+
>
|
|
269
|
+
<UIcon :name="link.icon ?? icons.page({ path: link.to, icon: null })" class="size-4 shrink-0" />
|
|
270
|
+
<span class="min-w-0">{{ link.label }}</span>
|
|
271
|
+
</NuxtLink>
|
|
272
|
+
</section>
|
|
273
|
+
|
|
274
|
+
<template v-for="pageGroup in pageGroups" :key="pageGroup.label || 'pages'">
|
|
275
|
+
<details
|
|
276
|
+
v-if="pageGroup.fold"
|
|
277
|
+
:key="holdsCurrent(pageGroup) ? currentPath : undefined"
|
|
278
|
+
class="vh-docs-sidebar-page-group vh-docs-sidebar-fold"
|
|
279
|
+
:open="holdsCurrent(pageGroup)"
|
|
280
|
+
>
|
|
281
|
+
<summary data-focus-inset class="vh-docs-sidebar-page-group-heading">
|
|
282
|
+
<UIcon name="i-lucide-chevron-down" class="vh-docs-sidebar-fold-icon size-3 shrink-0" />
|
|
283
|
+
{{ pageGroup.label }}
|
|
284
|
+
</summary>
|
|
285
|
+
<NuxtLink
|
|
286
|
+
v-for="page in pageGroup.pages"
|
|
287
|
+
:key="page.path"
|
|
288
|
+
:to="page.path"
|
|
289
|
+
data-focus-inset
|
|
290
|
+
:class="['vh-docs-sidebar-link is-grouped', { 'is-active': isActive(page.path) }]"
|
|
291
|
+
:aria-current="isActive(page.path) ? 'page' : undefined"
|
|
292
|
+
>
|
|
293
|
+
<UIcon :name="icons.page(page)" class="size-4 shrink-0" />
|
|
294
|
+
<span class="min-w-0">{{ page.title }}</span>
|
|
295
|
+
</NuxtLink>
|
|
296
|
+
</details>
|
|
297
|
+
|
|
298
|
+
<section v-else-if="pageGroup.label" class="vh-docs-sidebar-page-group">
|
|
299
|
+
<h2 class="vh-docs-sidebar-page-group-heading">{{ pageGroup.label }}</h2>
|
|
300
|
+
<NuxtLink
|
|
301
|
+
v-for="page in pageGroup.pages"
|
|
302
|
+
:key="page.path"
|
|
303
|
+
:to="page.path"
|
|
304
|
+
data-focus-inset
|
|
305
|
+
:class="['vh-docs-sidebar-link is-grouped', { 'is-active': isActive(page.path) }]"
|
|
306
|
+
:aria-current="isActive(page.path) ? 'page' : undefined"
|
|
307
|
+
>
|
|
308
|
+
<UIcon :name="icons.page(page)" class="size-4 shrink-0" />
|
|
309
|
+
<span class="min-w-0">{{ page.title }}</span>
|
|
310
|
+
</NuxtLink>
|
|
311
|
+
</section>
|
|
312
|
+
|
|
313
|
+
<template v-else>
|
|
314
|
+
<NuxtLink
|
|
315
|
+
v-for="page in pageGroup.pages"
|
|
316
|
+
:key="page.path"
|
|
317
|
+
:to="page.path"
|
|
318
|
+
data-focus-inset
|
|
319
|
+
:class="['vh-docs-sidebar-link', { 'is-active': isActive(page.path) }]"
|
|
320
|
+
:aria-current="isActive(page.path) ? 'page' : undefined"
|
|
321
|
+
>
|
|
322
|
+
<UIcon :name="icons.page(page)" class="size-4 shrink-0" />
|
|
323
|
+
<span class="min-w-0">{{ page.title }}</span>
|
|
324
|
+
</NuxtLink>
|
|
325
|
+
</template>
|
|
326
|
+
</template>
|
|
327
|
+
|
|
328
|
+
<!-- A panel is one more row of the page list, with its page count and a chevron for the sidebar it opens. -->
|
|
329
|
+
<NuxtLink
|
|
330
|
+
v-for="entry in panels"
|
|
331
|
+
:key="entry.page.path"
|
|
332
|
+
:to="entry.page.path"
|
|
333
|
+
data-focus-inset
|
|
334
|
+
class="vh-docs-sidebar-link vh-docs-sidebar-panel-link"
|
|
335
|
+
>
|
|
336
|
+
<UIcon :name="icons.page(entry.page)" class="size-4 shrink-0" />
|
|
337
|
+
<span class="min-w-0">{{ entry.page.title }}</span>
|
|
338
|
+
<span class="vh-docs-sidebar-count">{{ entry.count }}</span>
|
|
339
|
+
<UIcon name="i-lucide-chevron-right" class="size-4 shrink-0" />
|
|
340
|
+
</NuxtLink>
|
|
341
|
+
|
|
342
|
+
<section v-if="related.length" class="vh-docs-sidebar-related" aria-label="Related products">
|
|
343
|
+
<h2 class="vh-docs-sidebar-heading">Related</h2>
|
|
344
|
+
<NuxtLink
|
|
345
|
+
v-for="relatedSection in related"
|
|
346
|
+
:key="relatedSection.id"
|
|
347
|
+
:to="docsSectionHome(relatedSection)"
|
|
348
|
+
data-focus-inset
|
|
349
|
+
class="vh-docs-sidebar-link"
|
|
350
|
+
>
|
|
351
|
+
<UIcon :name="icons.section(relatedSection)" class="size-4 shrink-0" />
|
|
352
|
+
<span class="min-w-0">{{ relatedSection.title }}</span>
|
|
353
|
+
</NuxtLink>
|
|
354
|
+
</section>
|
|
355
|
+
|
|
356
|
+
</nav>
|
|
357
|
+
|
|
358
|
+
<nav v-else class="vh-docs-sidebar-nav" aria-label="All products">
|
|
359
|
+
<section v-for="group in catalog" :key="group.category" class="vh-docs-sidebar-category">
|
|
360
|
+
<h2 class="vh-docs-sidebar-heading">{{ group.category }}</h2>
|
|
361
|
+
<NuxtLink
|
|
362
|
+
v-for="catalogSection in group.sections"
|
|
363
|
+
:key="catalogSection.id"
|
|
364
|
+
:to="docsSectionHome(catalogSection)"
|
|
365
|
+
data-focus-inset
|
|
366
|
+
class="vh-docs-sidebar-link"
|
|
367
|
+
>
|
|
368
|
+
<UIcon :name="icons.section(catalogSection)" class="size-4 shrink-0" />
|
|
369
|
+
<span class="min-w-0">{{ catalogSection.title }}</span>
|
|
370
|
+
</NuxtLink>
|
|
371
|
+
</section>
|
|
372
|
+
</nav>
|
|
373
|
+
</template>
|
|
374
|
+
|
|
375
|
+
<style scoped>
|
|
376
|
+
/* The page list of the old comark-ui site: compact rows, small category headings, and a hairline that ties pages to their section. */
|
|
377
|
+
.vh-docs-sidebar-nav {
|
|
378
|
+
display: flex;
|
|
379
|
+
flex-direction: column;
|
|
380
|
+
flex: 1 1 0;
|
|
381
|
+
min-height: 0;
|
|
382
|
+
overflow-x: hidden;
|
|
383
|
+
overflow-y: auto;
|
|
384
|
+
padding: 0.25rem 1rem 2rem;
|
|
385
|
+
font-size: 0.8125rem;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.vh-docs-sidebar-page-group,
|
|
389
|
+
.vh-docs-sidebar-category,
|
|
390
|
+
.vh-docs-sidebar-site-areas {
|
|
391
|
+
display: flex;
|
|
392
|
+
flex-direction: column;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.vh-docs-sidebar-site-areas {
|
|
396
|
+
margin-bottom: 0.5rem;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.vh-docs-sidebar-page-group-heading,
|
|
400
|
+
.vh-docs-sidebar-heading {
|
|
401
|
+
display: flex;
|
|
402
|
+
align-items: center;
|
|
403
|
+
gap: 0.375rem;
|
|
404
|
+
margin: 1rem 0 0.25rem;
|
|
405
|
+
color: var(--ui-text-highlighted);
|
|
406
|
+
font-size: 0.75rem;
|
|
407
|
+
font-weight: 500;
|
|
408
|
+
line-height: 1.5;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
:is(.vh-docs-sidebar-category, .vh-docs-sidebar-page-group):first-child > :is(.vh-docs-sidebar-heading, .vh-docs-sidebar-page-group-heading):first-child {
|
|
412
|
+
margin-top: 0.25rem;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/* A long title wraps instead of being cut off. The icon stays on its first line. */
|
|
416
|
+
.vh-docs-sidebar-link {
|
|
417
|
+
display: flex;
|
|
418
|
+
align-items: flex-start;
|
|
419
|
+
gap: 0.5rem;
|
|
420
|
+
margin: 0 -0.5rem;
|
|
421
|
+
border-radius: calc(var(--ui-radius) * 1.5);
|
|
422
|
+
padding: 0.3rem 0.5rem;
|
|
423
|
+
color: var(--ui-text-muted);
|
|
424
|
+
line-height: 1.25rem;
|
|
425
|
+
transition:
|
|
426
|
+
background-color 150ms ease,
|
|
427
|
+
box-shadow 150ms ease,
|
|
428
|
+
color 150ms ease;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/* Icons stay small and quiet, so the text leads, and take the row's color when it is hovered or current. */
|
|
432
|
+
.vh-docs-sidebar-link > .iconify,
|
|
433
|
+
.vh-docs-sidebar-section-title > .iconify {
|
|
434
|
+
width: 0.875rem;
|
|
435
|
+
height: 0.875rem;
|
|
436
|
+
margin-top: 0.1875rem;
|
|
437
|
+
color: var(--ui-text-dimmed);
|
|
438
|
+
transition: color 150ms ease;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.vh-docs-sidebar-link:is(:hover, .is-active) > .iconify {
|
|
442
|
+
color: currentcolor;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/* Touch devices keep 44px tap targets at every viewport width. */
|
|
446
|
+
@media (pointer: coarse) {
|
|
447
|
+
.vh-docs-sidebar-link,
|
|
448
|
+
.vh-docs-sidebar-fold > summary {
|
|
449
|
+
min-height: 2.75rem;
|
|
450
|
+
align-items: center;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.vh-docs-sidebar-link > .iconify {
|
|
454
|
+
margin-top: 0;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/* A section's other pages hang from a hairline under its title. The current page darkens its piece of the line. */
|
|
459
|
+
.vh-docs-sidebar-link.is-nested,
|
|
460
|
+
.vh-docs-sidebar-link.is-grouped {
|
|
461
|
+
margin-left: 0.25rem;
|
|
462
|
+
border-radius: 0 calc(var(--ui-radius) * 1.5) calc(var(--ui-radius) * 1.5) 0;
|
|
463
|
+
padding-left: 0.875rem;
|
|
464
|
+
box-shadow: inset 1px 0 0 var(--ui-border);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.vh-docs-sidebar-page-group-heading.is-nested {
|
|
468
|
+
margin-top: 0.5rem;
|
|
469
|
+
padding-left: 0.75rem;
|
|
470
|
+
color: var(--ui-text-muted);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/* The rest of a long panel group, after the pages around the current one. */
|
|
474
|
+
.vh-docs-sidebar-show-all {
|
|
475
|
+
width: 100%;
|
|
476
|
+
color: var(--ui-text-muted);
|
|
477
|
+
text-align: start;
|
|
478
|
+
cursor: pointer;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/* A folded group: the summary is its heading, and its chevron points right while the group is shut. */
|
|
482
|
+
.vh-docs-sidebar-fold > summary {
|
|
483
|
+
cursor: pointer;
|
|
484
|
+
list-style: none;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.vh-docs-sidebar-fold > summary::-webkit-details-marker {
|
|
488
|
+
display: none;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.vh-docs-sidebar-fold-icon {
|
|
492
|
+
color: var(--ui-text-dimmed);
|
|
493
|
+
transition: transform 150ms ease;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.vh-docs-sidebar-fold:not([open]) .vh-docs-sidebar-fold-icon {
|
|
497
|
+
transform: rotate(-90deg);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.vh-docs-sidebar-fold:not([open]) > summary {
|
|
501
|
+
color: var(--ui-text-muted);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
@media (hover: hover) {
|
|
505
|
+
.vh-docs-sidebar-fold > summary:hover {
|
|
506
|
+
color: var(--ui-text-highlighted);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
@media (prefers-reduced-motion: reduce) {
|
|
511
|
+
.vh-docs-sidebar-fold-icon {
|
|
512
|
+
transition: none;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/* A section without a listed home page has a title row that opens nothing. */
|
|
517
|
+
.vh-docs-sidebar-section-title {
|
|
518
|
+
display: flex;
|
|
519
|
+
align-items: flex-start;
|
|
520
|
+
gap: 0.5rem;
|
|
521
|
+
margin: 0;
|
|
522
|
+
padding: 0.3rem 0;
|
|
523
|
+
color: var(--ui-text-highlighted);
|
|
524
|
+
font-size: 0.8125rem;
|
|
525
|
+
font-weight: 500;
|
|
526
|
+
line-height: 1.25rem;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/* Hover tints the row and keeps the body text. The current page takes the highlighted text, so a hovered row never looks current. */
|
|
530
|
+
@media (hover: hover) {
|
|
531
|
+
.vh-docs-sidebar-link:hover {
|
|
532
|
+
background: var(--ui-bg-elevated);
|
|
533
|
+
color: var(--ui-text);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.vh-docs-sidebar-link.is-active {
|
|
538
|
+
background: var(--ui-bg-elevated);
|
|
539
|
+
color: var(--ui-text-highlighted);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
.vh-docs-sidebar-link.is-active:is(.is-nested, .is-grouped) {
|
|
543
|
+
box-shadow: inset 1px 0 0 var(--ui-text-highlighted);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/* Related sits at the foot of the list. */
|
|
547
|
+
.vh-docs-sidebar-related {
|
|
548
|
+
display: flex;
|
|
549
|
+
flex-direction: column;
|
|
550
|
+
margin-top: auto;
|
|
551
|
+
padding-top: 0.75rem;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
.vh-docs-sidebar-panel-link {
|
|
555
|
+
align-items: center;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.vh-docs-sidebar-panel-link > .iconify {
|
|
559
|
+
margin-top: 0;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
.vh-docs-sidebar-count {
|
|
563
|
+
margin-inline-start: auto;
|
|
564
|
+
color: var(--ui-text-dimmed);
|
|
565
|
+
font-family: var(--font-mono);
|
|
566
|
+
font-size: 0.6875rem;
|
|
567
|
+
font-variant-numeric: tabular-nums;
|
|
568
|
+
letter-spacing: 0;
|
|
569
|
+
text-transform: none;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.vh-docs-sidebar-back {
|
|
573
|
+
color: var(--ui-text-dimmed);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
.vh-docs-sidebar-code {
|
|
577
|
+
overflow: hidden;
|
|
578
|
+
font-family: var(--font-mono);
|
|
579
|
+
font-size: 0.75rem;
|
|
580
|
+
letter-spacing: 0;
|
|
581
|
+
text-overflow: ellipsis;
|
|
582
|
+
white-space: nowrap;
|
|
583
|
+
}
|
|
584
|
+
</style>
|