@vite-hub/docs 0.0.0 → 0.4.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 +456 -0
- package/dist/agent-copy-xPaWye_g.js +33 -0
- package/dist/assistant-pages-BN7hNsSZ.js +37 -0
- package/dist/assistant-shared-CWIKRtBv.d.ts +28 -0
- package/dist/assistant-shared-WzButktj.js +113 -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-CPZGnn3S.js +141 -0
- package/dist/draft-BjWmaiLn.js +45 -0
- package/dist/error-diagnostics-B_ZOy7kF.js +93 -0
- package/dist/files-UY4h1_36.js +38 -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-CMoxcwPm.d.ts +80 -0
- package/dist/manifest-ZdxLrcvt.js +434 -0
- package/dist/markdown-DUWnEMPp.js +378 -0
- package/dist/navigation.d.ts +283 -0
- package/dist/navigation.js +519 -0
- package/dist/nuxt-CAGpKl_-.d.ts +241 -0
- package/dist/nuxt.d.ts +3 -0
- package/dist/nuxt.js +1868 -0
- package/dist/page-Dx2JD3y1.d.ts +74 -0
- package/dist/page-GPt09oex.js +82 -0
- package/dist/primitive-rail.d.ts +110 -0
- package/dist/primitive-rail.js +289 -0
- package/dist/raw-BChwipz_.js +857 -0
- package/dist/redirects-CmR1yu5A.js +74 -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/McpClient.vue +170 -0
- package/dist/runtime/app/components/content/McpInstall.vue +238 -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,7 @@
|
|
|
1
|
+
import { n as DocsPageResponse } from "../../page-Dx2JD3y1.js";
|
|
2
|
+
import { EventHandler, EventHandlerRequest } from "nitro/h3";
|
|
3
|
+
//#region src/runtime/server/page.d.ts
|
|
4
|
+
/** `/api/_docs/page/docs/kv.json` is the page at `/docs/kv`. The `.json` suffix lets static hosts store every page beside its folder. */
|
|
5
|
+
declare const handler: EventHandler<EventHandlerRequest, Promise<DocsPageResponse>>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { handler as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { a as parseDocsDocument, r as readDocsPage } from "../../content-CPZGnn3S.js";
|
|
2
|
+
import { findDocsPage } from "../../navigation.js";
|
|
3
|
+
import { i as docsPageResponse } from "../../page-GPt09oex.js";
|
|
4
|
+
import manifest from "#docs/manifest";
|
|
5
|
+
import { HTTPError, defineHandler, getRouterParam } from "nitro/h3";
|
|
6
|
+
import { content } from "#docs/content";
|
|
7
|
+
//#region src/runtime/server/page.ts
|
|
8
|
+
/** `/api/_docs/page/docs/kv.json` is the page at `/docs/kv`. The `.json` suffix lets static hosts store every page beside its folder. */
|
|
9
|
+
const handler = defineHandler(async (event) => {
|
|
10
|
+
const path = `/${(getRouterParam(event, "_") ?? "").replace(/\.json$/, "")}`;
|
|
11
|
+
if (content && (content.preview.active() || content.preview.frame())) {
|
|
12
|
+
const { docsDraftResponse } = await import("../../draft-BjWmaiLn.js");
|
|
13
|
+
const draft = await docsDraftResponse(content, manifest, path, parseDocsDocument);
|
|
14
|
+
if (draft) {
|
|
15
|
+
event.res.headers.set("cache-control", "private, no-store");
|
|
16
|
+
return draft;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const found = findDocsPage(manifest, path);
|
|
20
|
+
if (!found) throw HTTPError.status(404, "Page not found");
|
|
21
|
+
const document = await readDocsPage(found.page);
|
|
22
|
+
if (document === null) throw HTTPError.status(404, "Page not found");
|
|
23
|
+
const credits = found.page.credits ? await parseDocsDocument(found.page.credits) : null;
|
|
24
|
+
return docsPageResponse(manifest, found, document, credits);
|
|
25
|
+
});
|
|
26
|
+
//#endregion
|
|
27
|
+
export { handler as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EventHandler, EventHandlerRequest } from "nitro/h3";
|
|
2
|
+
//#region src/runtime/server/raw.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* `/raw/<page>.md`: the agent copy of a page, the one that Content serves in `llms-full.txt` and the MCP server. The
|
|
5
|
+
* build prerenders the copy of every page, so static hosts serve those files first. Negotiated pages and `.md` twins
|
|
6
|
+
* fetch the copy inside the server, from this route.
|
|
7
|
+
*/
|
|
8
|
+
declare const handler: EventHandler<EventHandlerRequest, Promise<string>>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { handler as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { i as readDocsRawCopy } from "../../content-CPZGnn3S.js";
|
|
2
|
+
import { HTTPError, defineHandler } from "nitro/h3";
|
|
3
|
+
//#region src/runtime/server/raw.ts
|
|
4
|
+
/**
|
|
5
|
+
* `/raw/<page>.md`: the agent copy of a page, the one that Content serves in `llms-full.txt` and the MCP server. The
|
|
6
|
+
* build prerenders the copy of every page, so static hosts serve those files first. Negotiated pages and `.md` twins
|
|
7
|
+
* fetch the copy inside the server, from this route.
|
|
8
|
+
*/
|
|
9
|
+
const handler = defineHandler(async (event) => {
|
|
10
|
+
let path;
|
|
11
|
+
try {
|
|
12
|
+
path = decodeURIComponent(event.url.pathname);
|
|
13
|
+
} catch {
|
|
14
|
+
throw HTTPError.status(404, "Page not found");
|
|
15
|
+
}
|
|
16
|
+
const index = path.indexOf("/raw/");
|
|
17
|
+
const markdown = index < 0 || !path.endsWith(".md") ? null : await readDocsRawCopy(path.slice(index));
|
|
18
|
+
if (markdown === null) throw HTTPError.status(404, "Page not found");
|
|
19
|
+
event.res.headers.set("content-type", "text/markdown; charset=utf-8");
|
|
20
|
+
return markdown;
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { handler as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { i as DocsSearchSection } from "../../types-BhG6vGfG.js";
|
|
2
|
+
import { EventHandler, EventHandlerRequest } from "nitro/h3";
|
|
3
|
+
//#region src/runtime/server/search.d.ts
|
|
4
|
+
declare const handler: EventHandler<EventHandlerRequest, Promise<DocsSearchSection[]>>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { handler as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { r as readDocsPage } from "../../content-CPZGnn3S.js";
|
|
2
|
+
import { docsIndexedPages, docsManifestPages, docsUnindexedSearchSections } from "../../navigation.js";
|
|
3
|
+
import { a as docsSearchSections } from "../../markdown-DUWnEMPp.js";
|
|
4
|
+
import manifest from "#docs/manifest";
|
|
5
|
+
import { defineHandler } from "nitro/h3";
|
|
6
|
+
//#region src/runtime/server/search.ts
|
|
7
|
+
/** Every page split by heading, read through the Content of the page route, for the search dialog. The build prerenders it. */
|
|
8
|
+
async function buildIndex() {
|
|
9
|
+
const sections = [];
|
|
10
|
+
for (const page of docsIndexedPages(manifest)) {
|
|
11
|
+
const document = await readDocsPage(page);
|
|
12
|
+
if (!document) continue;
|
|
13
|
+
const [entry, ...headings] = docsSearchSections(page.path, page.sourceTitle, document.nodes);
|
|
14
|
+
sections.push(page.keywords.length ? {
|
|
15
|
+
...entry,
|
|
16
|
+
keywords: page.keywords
|
|
17
|
+
} : entry, ...headings);
|
|
18
|
+
}
|
|
19
|
+
sections.push(...docsUnindexedSearchSections(manifest));
|
|
20
|
+
const listed = new Set(docsManifestPages(manifest).filter((page) => page.navigation).map((page) => page.path));
|
|
21
|
+
return sections.filter((record) => listed.has(record.id.split("#")[0] ?? record.id));
|
|
22
|
+
}
|
|
23
|
+
let indexed;
|
|
24
|
+
const handler = defineHandler(() => {
|
|
25
|
+
if (import.meta.dev) return buildIndex();
|
|
26
|
+
return indexed ??= buildIndex().catch((error) => {
|
|
27
|
+
indexed = void 0;
|
|
28
|
+
throw error;
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { handler as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EventHandler, EventHandlerRequest } from "nitro/h3";
|
|
2
|
+
//#region src/runtime/server/sitemap.d.ts
|
|
3
|
+
/** The indexed pages from Content and the `sitemap` paths of the options, sorted by URL, as their canonical links name them. */
|
|
4
|
+
declare const handler: EventHandler<EventHandlerRequest, Promise<string>>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { handler as default };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { n as docsContent } from "../../content-CPZGnn3S.js";
|
|
2
|
+
import { docsCanonicalUrl } from "../../navigation.js";
|
|
3
|
+
import { useRuntimeConfig } from "nitro/runtime-config";
|
|
4
|
+
import { defineHandler } from "nitro/h3";
|
|
5
|
+
//#region ../internal/dist/sitemap.js
|
|
6
|
+
function escapeXml(value) {
|
|
7
|
+
return value.replace(/[&<>"']/g, (character) => ({
|
|
8
|
+
"&": "&",
|
|
9
|
+
"<": "<",
|
|
10
|
+
">": ">",
|
|
11
|
+
"\"": """,
|
|
12
|
+
"'": "'"
|
|
13
|
+
})[character]);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Join lists of sitemap URLs into one list sorted by URL, so the same pages always give the same file. A URL that is
|
|
17
|
+
* in more than one list is kept once, with the first `lastmod` that a list gives.
|
|
18
|
+
*/
|
|
19
|
+
function mergeSitemapUrls(...lists) {
|
|
20
|
+
const urls = /* @__PURE__ */ new Map();
|
|
21
|
+
for (const list of lists) for (const { loc, lastmod } of list) {
|
|
22
|
+
const known = urls.get(loc);
|
|
23
|
+
if (!known) urls.set(loc, lastmod ? {
|
|
24
|
+
loc,
|
|
25
|
+
lastmod
|
|
26
|
+
} : { loc });
|
|
27
|
+
else if (!known.lastmod && lastmod) known.lastmod = lastmod;
|
|
28
|
+
}
|
|
29
|
+
return [...urls.values()].sort((left, right) => left.loc < right.loc ? -1 : left.loc > right.loc ? 1 : 0);
|
|
30
|
+
}
|
|
31
|
+
/** Render a sitemaps.org `urlset` document, in the order of `entries`. */
|
|
32
|
+
function renderSitemap(entries) {
|
|
33
|
+
const urls = entries.map((entry) => ` <url>\n <loc>${escapeXml(entry.loc)}</loc>${entry.lastmod ? `\n <lastmod>${escapeXml(entry.lastmod)}</lastmod>` : ""}\n </url>`);
|
|
34
|
+
return `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n${urls.join("\n")}${urls.length ? "\n" : ""}</urlset>\n`;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/runtime/server/sitemap.ts
|
|
38
|
+
/** The indexed pages from Content and the `sitemap` paths of the options, sorted by URL, as their canonical links name them. */
|
|
39
|
+
const handler = defineHandler(async (event) => {
|
|
40
|
+
const { site, sitemap, appBase } = useRuntimeConfig().public.docs;
|
|
41
|
+
const origin = site.url || event.url.origin;
|
|
42
|
+
const mounted = `${origin}${appBase.replace(/\/+$/, "")}`;
|
|
43
|
+
const entries = (await docsContent().sitemap({ site: mounted })).map((entry) => ({
|
|
44
|
+
...entry,
|
|
45
|
+
loc: docsCanonicalUrl(origin, entry.loc.slice(mounted.length), appBase)
|
|
46
|
+
}));
|
|
47
|
+
const extra = sitemap.map((path) => ({ loc: docsCanonicalUrl(origin, path, appBase) }));
|
|
48
|
+
event.res.headers.set("content-type", "application/xml; charset=utf-8");
|
|
49
|
+
return renderSitemap(mergeSitemapUrls(entries, extra));
|
|
50
|
+
});
|
|
51
|
+
//#endregion
|
|
52
|
+
export { handler as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EventHandler, EventHandlerRequest } from "nitro/h3";
|
|
2
|
+
//#region src/runtime/server/trailing-slash.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* `/docs/kv/` moves to `/docs/kv` with a 301, the URL that the canonical link and the sitemap name. A page that also
|
|
5
|
+
* answers with a slash is a duplicate, and search engines can index the copy. Static hosts that serve the prerendered
|
|
6
|
+
* `docs/kv.html` first redirect the same way; this covers Node servers and Workers that render the page.
|
|
7
|
+
*/
|
|
8
|
+
declare const handler: EventHandler<EventHandlerRequest, Response | undefined>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { handler as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { docsCanonicalUrl, findDocsPage } from "../../navigation.js";
|
|
2
|
+
import manifest from "#docs/manifest";
|
|
3
|
+
import { useRuntimeConfig } from "nitro/runtime-config";
|
|
4
|
+
import { defineHandler } from "nitro/h3";
|
|
5
|
+
//#region src/runtime/server/trailing-slash.ts
|
|
6
|
+
/**
|
|
7
|
+
* `/docs/kv/` moves to `/docs/kv` with a 301, the URL that the canonical link and the sitemap name. A page that also
|
|
8
|
+
* answers with a slash is a duplicate, and search engines can index the copy. Static hosts that serve the prerendered
|
|
9
|
+
* `docs/kv.html` first redirect the same way; this covers Node servers and Workers that render the page.
|
|
10
|
+
*/
|
|
11
|
+
const handler = defineHandler((event) => {
|
|
12
|
+
if (event.req.method !== "GET" && event.req.method !== "HEAD") return;
|
|
13
|
+
const { pathname, search } = event.url;
|
|
14
|
+
if (pathname.length < 2 || !pathname.endsWith("/")) return;
|
|
15
|
+
const { appBase } = useRuntimeConfig().public.docs;
|
|
16
|
+
const prefix = appBase.replace(/\/+$/, "");
|
|
17
|
+
const path = prefix && pathname.startsWith(`${prefix}/`) ? pathname.slice(prefix.length) : pathname;
|
|
18
|
+
const page = findDocsPage(manifest, path)?.page;
|
|
19
|
+
if (!page) return;
|
|
20
|
+
const target = docsCanonicalUrl("", page.path, appBase);
|
|
21
|
+
if (target === pathname) return;
|
|
22
|
+
return new Response(null, {
|
|
23
|
+
status: 301,
|
|
24
|
+
headers: { location: `${target}${search}` }
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { handler as default };
|
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The docs design, after the comark-ui site: column widths, a faint grain on the page, prose, highlighted code, and the
|
|
3
|
+
* search modal. Colors, radii, fonts, and focus come from the ViteHub design system (`@vite-hub/ui/theme.css`), which
|
|
4
|
+
* the module scopes to `.vh-docs` before this file, so comark-ui's blocks, which read the Nuxt UI variables, follow along.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:root:where(.vh-docs) {
|
|
8
|
+
--ui-header-height: 3.5rem;
|
|
9
|
+
--ui-container: 90rem;
|
|
10
|
+
/* The rail is 3.5rem wide. The page panel sits next to it. The page uses the rest of the viewport. */
|
|
11
|
+
--vh-rail-width: 3.5rem;
|
|
12
|
+
--vh-panel-width: 15rem;
|
|
13
|
+
--vh-sidebar-width: calc(var(--vh-rail-width) + var(--vh-panel-width));
|
|
14
|
+
--vh-toc-width: 10rem;
|
|
15
|
+
/* The reading measure of prose. Code, tables, and examples are wider. */
|
|
16
|
+
--vh-content-width: 48rem;
|
|
17
|
+
/* T3 Code's surface grain, as comark-ui's typeset paints it: fractal noise at 3.5% opacity in a 256px tile. */
|
|
18
|
+
--vh-grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
|
|
19
|
+
--vh-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
|
|
20
|
+
/* A raised control on a muted track, such as the thumb of a segmented switch. */
|
|
21
|
+
--vh-raised: var(--ui-bg);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:root:where(.vh-docs).dark {
|
|
25
|
+
--vh-raised: var(--ui-bg-accented);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* The grain sits on the page, and on the sticky surfaces that cover it. It scrolls with them: a `fixed` background
|
|
29
|
+
would line the tiles up, but makes the browser repaint the whole page on every scrolled frame. */
|
|
30
|
+
:where(.vh-docs) body,
|
|
31
|
+
.vh-grain-surface {
|
|
32
|
+
background-color: var(--ui-bg);
|
|
33
|
+
background-image: var(--vh-grain);
|
|
34
|
+
background-repeat: repeat;
|
|
35
|
+
background-size: 256px 256px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Highlighted code carries the light colors inline and the dark colors in variables. */
|
|
39
|
+
html:where(.vh-docs) .shiki span {
|
|
40
|
+
font-style: var(--shiki-light-font-style);
|
|
41
|
+
font-weight: var(--shiki-light-font-weight);
|
|
42
|
+
text-decoration: var(--shiki-light-text-decoration);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
html:where(.vh-docs).dark .shiki span {
|
|
46
|
+
color: var(--shiki-dark) !important;
|
|
47
|
+
background-color: var(--shiki-dark-bg) !important;
|
|
48
|
+
font-style: var(--shiki-dark-font-style) !important;
|
|
49
|
+
font-weight: var(--shiki-dark-font-weight) !important;
|
|
50
|
+
text-decoration: var(--shiki-dark-text-decoration) !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Body text is the muted gray at 15px, and headings, links, and code take the strong color, as on the comark-ui site. */
|
|
54
|
+
.docs-content {
|
|
55
|
+
--tw-prose-headings: var(--ui-text-highlighted);
|
|
56
|
+
color: var(--ui-text-muted);
|
|
57
|
+
font-size: 0.9375rem;
|
|
58
|
+
line-height: 1.7;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.docs-content :where(p, li) {
|
|
62
|
+
text-wrap: pretty;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.docs-content strong {
|
|
66
|
+
color: var(--ui-text-highlighted);
|
|
67
|
+
font-weight: 500;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Steps keep the reading measure of prose. */
|
|
71
|
+
.docs-content .vh-docs-steps > :where(h3, p, ul, ol) {
|
|
72
|
+
max-width: var(--vh-content-width);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/*
|
|
76
|
+
* comark-ui draws the headings, and wraps one with an anchor in `.cl-heading`, so the space and the rule above a
|
|
77
|
+
* section go on the wrapper when there is one, and the type on the heading. A component marked `.not-prose`, such as
|
|
78
|
+
* a catalog of cards, styles its own headings.
|
|
79
|
+
*/
|
|
80
|
+
.docs-content :where(h2, h3, h4) {
|
|
81
|
+
color: var(--ui-text-highlighted);
|
|
82
|
+
scroll-margin-top: calc(var(--ui-header-height) + 1rem);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.docs-content h2:not(.not-prose *) {
|
|
86
|
+
margin: 0;
|
|
87
|
+
font-size: 1.125rem;
|
|
88
|
+
font-weight: 600;
|
|
89
|
+
letter-spacing: -0.01em;
|
|
90
|
+
line-height: 1.3;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.docs-content :is(h2:not(.cl-heading > h2), .cl-heading:has(> h2)):not(.not-prose *) {
|
|
94
|
+
margin-top: 3.5rem;
|
|
95
|
+
margin-bottom: 1rem;
|
|
96
|
+
border-top: 1px solid var(--ui-border);
|
|
97
|
+
padding-top: 1.25rem;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.docs-content h3:not(.not-prose *) {
|
|
101
|
+
margin: 0;
|
|
102
|
+
font-family: var(--font-mono);
|
|
103
|
+
font-size: 0.875rem;
|
|
104
|
+
font-weight: 500;
|
|
105
|
+
line-height: 1.5;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.docs-content :is(h3:not(.cl-heading > h3), .cl-heading:has(> h3)):not(.not-prose *) {
|
|
109
|
+
margin-top: 2.25rem;
|
|
110
|
+
margin-bottom: 0.5rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.docs-content h4:not(.not-prose *) {
|
|
114
|
+
margin: 1.5rem 0 0.5rem;
|
|
115
|
+
font-size: 0.9375rem;
|
|
116
|
+
font-weight: 600;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Inside an example the headings are part of the rendered block, not sections of the page. */
|
|
120
|
+
.docs-content .docs-example-preview :is(h2:not(.cl-heading > h2), .cl-heading:has(> h2)) {
|
|
121
|
+
margin-top: 1.5rem;
|
|
122
|
+
border-top: 0;
|
|
123
|
+
padding-top: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.docs-content h2 + p,
|
|
127
|
+
.docs-content h3 + p {
|
|
128
|
+
margin-top: 0.75rem;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* comark-ui's code blocks bring their bar and leave the frame to the page: the soft surface in a hairline ring. */
|
|
132
|
+
.docs-content .ck {
|
|
133
|
+
margin-block: 1.25rem;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
border-radius: calc(var(--ui-radius) * 2);
|
|
136
|
+
background: var(--ui-bg-muted);
|
|
137
|
+
box-shadow: inset 0 0 0 1px var(--ui-border);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.docs-content .ck > pre {
|
|
141
|
+
margin: 0;
|
|
142
|
+
overflow-x: auto;
|
|
143
|
+
background: transparent !important;
|
|
144
|
+
padding: 0.8rem 0.9rem;
|
|
145
|
+
font-size: 0.8125rem;
|
|
146
|
+
line-height: 1.6;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Inside tabs, the tab row is the top of the frame, and the block is the rest. comark-ui puts the block's buttons in the
|
|
150
|
+
tab row, above the block, so the block must not clip them. */
|
|
151
|
+
.docs-content .ct .ck {
|
|
152
|
+
margin-block: 0;
|
|
153
|
+
overflow: visible;
|
|
154
|
+
border-radius: 0 0 10px 10px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.docs-content blockquote {
|
|
158
|
+
border-left: 2px solid var(--ui-border);
|
|
159
|
+
padding-left: 1rem;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.docs-content table {
|
|
163
|
+
font-size: 0.875rem;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* Long identifiers in prose break instead of widening the page on narrow phones. */
|
|
167
|
+
.docs-content :where(p, li) > code {
|
|
168
|
+
max-width: 100%;
|
|
169
|
+
overflow-wrap: break-word;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* On a home page, the Markdown between the app's blocks keeps the reading measure and the gutter of a docs page. */
|
|
173
|
+
.vh-docs-home-prose {
|
|
174
|
+
width: 100%;
|
|
175
|
+
max-width: var(--vh-content-width);
|
|
176
|
+
margin-inline: auto;
|
|
177
|
+
padding: 0 1rem 4rem;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@media (min-width: 40rem) {
|
|
181
|
+
.vh-docs-home-prose {
|
|
182
|
+
padding-inline: 1.5rem;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Headings such as error codes have no spaces, so they break where needed on narrow phones. `anywhere`, not `break-word`, so it also works when a site puts a heading in a flex or grid item. */
|
|
187
|
+
.docs-content :where(h1, h2, h3, h4) {
|
|
188
|
+
overflow-wrap: anywhere;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* A lone identifier in a table cell, such as a tool name, stays on one line. The table scrolls sideways instead. */
|
|
192
|
+
.docs-content td > code:only-child {
|
|
193
|
+
white-space: nowrap;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.docs-content th {
|
|
197
|
+
color: var(--ui-text-highlighted);
|
|
198
|
+
font-weight: 600;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* The tabs frame the panel, so a code block inside it drops its own border and margin. */
|
|
202
|
+
.docs-content [role="tabpanel"] .code-block-wrapper {
|
|
203
|
+
margin: 0;
|
|
204
|
+
border: 0;
|
|
205
|
+
border-radius: 0;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* A note under the code keeps a rule above it and the same inset as the code. */
|
|
209
|
+
.docs-content [role="tabpanel"] .code-block-wrapper:not(:last-child) {
|
|
210
|
+
border-bottom: 1px solid var(--ui-border);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.docs-content [role="tabpanel"] > * > :where(p, ul, ol) {
|
|
214
|
+
margin: 0;
|
|
215
|
+
padding: 0.75rem 1rem;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.docs-content [role="tabpanel"] pre {
|
|
219
|
+
border-width: 0 !important;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.docs-content .vh-docs-steps {
|
|
223
|
+
margin-top: 1rem;
|
|
224
|
+
margin-bottom: 2rem;
|
|
225
|
+
padding-left: 2rem;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.docs-content .vh-docs-steps > h3 {
|
|
229
|
+
margin-top: 1.5rem;
|
|
230
|
+
margin-bottom: 0.75rem;
|
|
231
|
+
font-size: 1rem;
|
|
232
|
+
line-height: 1.5rem;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.docs-content .vh-docs-steps > h3:first-child {
|
|
236
|
+
margin-top: 0;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.docs-content .vh-docs-steps > h3::before {
|
|
240
|
+
display: inline-grid;
|
|
241
|
+
width: 1.5rem;
|
|
242
|
+
height: 1.5rem;
|
|
243
|
+
margin-left: -3rem;
|
|
244
|
+
margin-right: 0.75rem;
|
|
245
|
+
place-items: center;
|
|
246
|
+
border: 1px solid var(--ui-border);
|
|
247
|
+
border-radius: 999px;
|
|
248
|
+
background: var(--ui-bg);
|
|
249
|
+
color: var(--ui-text-muted);
|
|
250
|
+
font-size: 0.75rem;
|
|
251
|
+
font-weight: 650;
|
|
252
|
+
line-height: 1;
|
|
253
|
+
counter-increment: step;
|
|
254
|
+
content: counter(step);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.docs-content .vh-docs-steps > p {
|
|
258
|
+
margin-top: 0.5rem;
|
|
259
|
+
margin-bottom: 0.75rem;
|
|
260
|
+
color: var(--ui-text-muted);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.docs-content .vh-docs-steps .code-block-wrapper {
|
|
264
|
+
margin-top: 0.75rem;
|
|
265
|
+
margin-bottom: 1rem;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.vh-docs-search-modal:has(input:placeholder-shown) [role="listbox"] {
|
|
269
|
+
display: none;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.vh-docs-search-modal {
|
|
273
|
+
position: fixed !important;
|
|
274
|
+
top: 4.5rem !important;
|
|
275
|
+
left: 50vw !important;
|
|
276
|
+
translate: -50% 0 !important;
|
|
277
|
+
width: min(640px, calc(100vw - 1rem)) !important;
|
|
278
|
+
margin: 0 !important;
|
|
279
|
+
overflow: hidden;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.vh-docs-search-modal button[aria-label="Close"] {
|
|
283
|
+
width: 2.5rem;
|
|
284
|
+
height: 2rem;
|
|
285
|
+
border: 1px solid var(--ui-border);
|
|
286
|
+
border-radius: calc(var(--ui-radius) * 1.5);
|
|
287
|
+
color: var(--ui-text-muted);
|
|
288
|
+
font-size: 0;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.vh-docs-search-modal button[aria-label="Close"] .iconify {
|
|
292
|
+
display: none;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.vh-docs-search-modal button[aria-label="Close"]::before {
|
|
296
|
+
font-size: 0.75rem;
|
|
297
|
+
content: "ESC";
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* Group labels match the small headings of the page list. */
|
|
301
|
+
.vh-docs-search-modal [role="group"] > [data-slot="label"] {
|
|
302
|
+
padding: 0.75rem 0.625rem 0.375rem;
|
|
303
|
+
color: var(--ui-text-highlighted);
|
|
304
|
+
font-size: 0.75rem;
|
|
305
|
+
font-weight: 500;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/* A result is a path line over its heading, then the matching text, like the docs catalog cards. */
|
|
309
|
+
.vh-docs-search-modal [role="option"] {
|
|
310
|
+
align-items: flex-start;
|
|
311
|
+
gap: 0.75rem;
|
|
312
|
+
padding: 0.625rem;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.vh-docs-search-modal [role="option"] [data-slot="itemLeadingIcon"] {
|
|
316
|
+
margin-top: 0.125rem;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.vh-docs-search-modal [data-slot="itemLabel"] {
|
|
320
|
+
display: flex;
|
|
321
|
+
flex-direction: column;
|
|
322
|
+
gap: 0.125rem;
|
|
323
|
+
overflow: visible;
|
|
324
|
+
white-space: normal;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.vh-search-path {
|
|
328
|
+
overflow: hidden;
|
|
329
|
+
color: var(--ui-text-dimmed);
|
|
330
|
+
font-size: 0.75rem;
|
|
331
|
+
line-height: 1rem;
|
|
332
|
+
text-overflow: ellipsis;
|
|
333
|
+
white-space: nowrap;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.vh-search-title {
|
|
337
|
+
color: var(--ui-text-highlighted);
|
|
338
|
+
font-weight: 500;
|
|
339
|
+
line-height: 1.25rem;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.vh-docs-search-modal [role="option"] [data-slot="itemDescription"] {
|
|
343
|
+
margin-top: 0.125rem;
|
|
344
|
+
font-size: 0.8125rem;
|
|
345
|
+
line-height: 1.25rem;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.vh-docs-search-modal mark {
|
|
349
|
+
border-radius: var(--ui-radius);
|
|
350
|
+
background: color-mix(in srgb, var(--ui-text-highlighted) 12%, transparent);
|
|
351
|
+
color: inherit;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/* Keep results above the bottom edge when the viewport is short, such as a tablet or phone in landscape. */
|
|
355
|
+
@media (min-width: 641px) {
|
|
356
|
+
.vh-docs-search-modal {
|
|
357
|
+
max-height: min(70vh, calc(100dvh - 4.5rem - 0.5rem));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
@media (min-width: 641px) and (max-height: 37.5rem) {
|
|
362
|
+
.vh-docs-search-modal {
|
|
363
|
+
top: 0.5rem !important;
|
|
364
|
+
max-height: calc(100dvh - 1rem);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/* Touch screens have no Escape key, so the close button keeps its icon. It has no fill, so a 44px box looks the same. */
|
|
369
|
+
@media (pointer: coarse) {
|
|
370
|
+
.vh-docs-search-modal button[aria-label="Close"] {
|
|
371
|
+
width: 2.75rem;
|
|
372
|
+
height: 2.75rem;
|
|
373
|
+
justify-content: center;
|
|
374
|
+
border: 0;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/* Nuxt UI renders the icon as an `.iconify` span with a CSS mask, not as an inline SVG. */
|
|
378
|
+
.vh-docs-search-modal button[aria-label="Close"] .iconify {
|
|
379
|
+
display: block;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.vh-docs-search-modal button[aria-label="Close"]::before {
|
|
383
|
+
content: none;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/*
|
|
388
|
+
* Phones open search as a full screen sheet, as native search does. Before the first letter it lists
|
|
389
|
+
* the docs sections, so the sheet is never empty.
|
|
390
|
+
* Do not reset `translate` here: the CSS minifier merges `translate: none` into `transform`,
|
|
391
|
+
* so the base `translate: -50%` stayed and pushed the modal off the left edge.
|
|
392
|
+
*/
|
|
393
|
+
@media (max-width: 640px) {
|
|
394
|
+
.vh-docs-search-modal {
|
|
395
|
+
top: 0 !important;
|
|
396
|
+
width: 100vw !important;
|
|
397
|
+
/* Min and max height, because the modal's important `h-auto` utility wins over a height here. */
|
|
398
|
+
min-height: 100dvh;
|
|
399
|
+
max-height: 100dvh;
|
|
400
|
+
border: 0;
|
|
401
|
+
border-radius: 0;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.vh-docs-search-modal > [data-slot="root"],
|
|
405
|
+
.vh-docs-search-modal [role="listbox"] {
|
|
406
|
+
flex: 1 1 auto;
|
|
407
|
+
min-height: 0;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.vh-docs-search-modal:has(input:placeholder-shown) [role="listbox"] {
|
|
411
|
+
display: flex;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.vh-docs-search-modal [data-slot="input"] {
|
|
415
|
+
padding-top: env(safe-area-inset-top, 0px);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.vh-docs-search-modal [data-slot="input"] > input {
|
|
419
|
+
padding-inline-end: 5rem;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.vh-docs-search-modal [data-slot="viewport"] {
|
|
423
|
+
padding-bottom: env(safe-area-inset-bottom, 0px);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.vh-docs-search-modal button[aria-label="Close"] {
|
|
427
|
+
width: auto;
|
|
428
|
+
height: 2.75rem;
|
|
429
|
+
padding-inline: 0.5rem;
|
|
430
|
+
border: 0;
|
|
431
|
+
color: var(--ui-text-highlighted);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.vh-docs-search-modal button[aria-label="Close"] .iconify {
|
|
435
|
+
display: none;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.vh-docs-search-modal button[aria-label="Close"]::before {
|
|
439
|
+
font-size: 0.9375rem;
|
|
440
|
+
content: "Cancel";
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
:where(.vh-docs) .code-block-wrapper pre {
|
|
445
|
+
margin: 0 !important;
|
|
446
|
+
overflow-x: auto;
|
|
447
|
+
border: none !important;
|
|
448
|
+
border-radius: 0 !important;
|
|
449
|
+
padding: 0.8rem 0.9rem !important;
|
|
450
|
+
font-size: 0.8125rem;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
:where(.vh-docs) .code-block-wrapper .shiki {
|
|
454
|
+
min-height: 100%;
|
|
455
|
+
background-color: transparent !important;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
@media (prefers-reduced-motion: reduce) {
|
|
459
|
+
:where(.vh-docs) *, :where(.vh-docs) *::before, :where(.vh-docs) *::after {
|
|
460
|
+
animation-duration: 0.01ms !important;
|
|
461
|
+
animation-iteration-count: 1 !important;
|
|
462
|
+
transition-duration: 0.01ms !important;
|
|
463
|
+
}
|
|
464
|
+
}
|