@vercel/geistdocs 2.15.3 → 2.15.4-canary.2a54b38
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/dist/cli/index.js +1 -1
- package/dist/internal/mdx-to-markdown.d.ts.map +1 -1
- package/dist/internal/mdx-to-markdown.js +9 -0
- package/dist/internal/page-actions-client.js +1 -1
- package/dist/internal/page-actions.d.ts +4 -4
- package/dist/internal/page-actions.d.ts.map +1 -1
- package/dist/internal/page-actions.js +6 -1
- package/dist/internal/source-loader.d.ts +28 -0
- package/dist/internal/source-loader.d.ts.map +1 -0
- package/dist/internal/source-loader.js +77 -0
- package/dist/mdx-basic.d.ts +27 -0
- package/dist/mdx-basic.d.ts.map +1 -0
- package/dist/mdx-basic.js +61 -0
- package/dist/mdx.d.ts +3 -25
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +8 -61
- package/dist/mobile-docs-bar.js +1 -1
- package/dist/navigation.d.ts +11 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +8 -0
- package/dist/next.d.ts +11 -1
- package/dist/next.d.ts.map +1 -1
- package/dist/next.js +82 -2
- package/dist/pages/docs-custom.d.ts +111 -0
- package/dist/pages/docs-custom.d.ts.map +1 -0
- package/dist/pages/docs-custom.js +250 -0
- package/dist/pages/docs.d.ts +5 -98
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +13 -250
- package/dist/source-config.d.ts +10 -1
- package/dist/source-config.d.ts.map +1 -1
- package/dist/source-config.js +21 -10
- package/dist/source.d.ts +6 -17
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +2 -75
- package/docs/agents.md +1 -1
- package/docs/llms.txt +27 -1
- package/docs/manifest.json +1 -1
- package/docs/pages/configuration.md +26 -0
- package/native-mdx/LICENSE-mdxjs-rs +22 -0
- package/native-mdx/UPSTREAM.md +16 -0
- package/native-mdx/binaries/darwin-arm64.node +0 -0
- package/native-mdx/binaries/linux-x64-gnu.node +0 -0
- package/native-mdx/data-entry.d.mts +15 -0
- package/native-mdx/data-entry.mjs +97 -0
- package/native-mdx/data-projection.mjs +205 -0
- package/native-mdx/fumadocs-adapter.mjs +36 -0
- package/native-mdx/index-emitter.mjs +34 -0
- package/native-mdx/loader-data.cjs +36 -0
- package/native-mdx/loader-mdx.cjs +9 -0
- package/native-mdx/loader-mdx.mjs +419 -0
- package/native-mdx/native-binding.cjs +27 -0
- package/native-mdx/navigation-entry.d.mts +11 -0
- package/native-mdx/navigation-entry.mjs +136 -0
- package/native-mdx/navigation-title.mjs +53 -0
- package/package.json +43 -15
- package/rehype-code-highlights.d.ts +13 -0
- package/rehype-code-highlights.js +230 -0
- package/shared-theme.css +7 -1
- package/source-config.js +27 -10
- package/template/content/docs/configuration.mdx +26 -0
- package/template/package.json +7 -4
- package/template/pnpm-workspace.yaml +3 -0
package/dist/next.js
CHANGED
|
@@ -1,6 +1,76 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
1
2
|
import { createMDX } from "fumadocs-mdx/next";
|
|
2
3
|
import { APP_ROUTE_MANIFEST_DEFINE, APP_ROUTE_MANIFEST_ENV, } from "./internal/app-route-manifest.js";
|
|
3
4
|
import { mergeRewriteRoutes, scanAppRouteManifest, } from "./internal/app-route-scanner.js";
|
|
5
|
+
const FUMADOCS_MDX_LOADER = "fumadocs-mdx/loader-mdx";
|
|
6
|
+
/** Replace only Fumadocs' MDX loader, preserving config and user rules. */
|
|
7
|
+
const replaceMdxLoader = (config, loader, mode) => {
|
|
8
|
+
const replace = (entry) => {
|
|
9
|
+
if (entry === FUMADOCS_MDX_LOADER) {
|
|
10
|
+
return { loader, options: { geistdocsMdxCompiler: mode } };
|
|
11
|
+
}
|
|
12
|
+
if (entry &&
|
|
13
|
+
typeof entry === "object" &&
|
|
14
|
+
"loader" in entry &&
|
|
15
|
+
entry.loader === FUMADOCS_MDX_LOADER) {
|
|
16
|
+
const options = "options" in entry && entry.options && typeof entry.options === "object"
|
|
17
|
+
? entry.options
|
|
18
|
+
: {};
|
|
19
|
+
return {
|
|
20
|
+
...entry,
|
|
21
|
+
loader,
|
|
22
|
+
options: { ...options, geistdocsMdxCompiler: mode },
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return entry;
|
|
26
|
+
};
|
|
27
|
+
const rules = config.turbopack?.rules;
|
|
28
|
+
const turbopack = rules
|
|
29
|
+
? {
|
|
30
|
+
...config.turbopack,
|
|
31
|
+
rules: Object.fromEntries(Object.entries(rules).map(([pattern, rule]) => {
|
|
32
|
+
if (!(rule &&
|
|
33
|
+
typeof rule === "object" &&
|
|
34
|
+
"loaders" in rule &&
|
|
35
|
+
rule.loaders)) {
|
|
36
|
+
return [pattern, rule];
|
|
37
|
+
}
|
|
38
|
+
return [pattern, { ...rule, loaders: rule.loaders.map(replace) }];
|
|
39
|
+
})),
|
|
40
|
+
}
|
|
41
|
+
: config.turbopack;
|
|
42
|
+
function rewriteRule(entry) {
|
|
43
|
+
if (!entry || typeof entry !== "object") {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const rule = entry;
|
|
47
|
+
for (const key of ["oneOf", "rules"]) {
|
|
48
|
+
if (Array.isArray(rule[key])) {
|
|
49
|
+
rewriteRules(rule[key]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (rule.loader === FUMADOCS_MDX_LOADER) {
|
|
53
|
+
Object.assign(rule, replace(rule));
|
|
54
|
+
}
|
|
55
|
+
if (Array.isArray(rule.use)) {
|
|
56
|
+
rule.use = rule.use.map(replace);
|
|
57
|
+
}
|
|
58
|
+
else if (rule.use) {
|
|
59
|
+
rule.use = replace(rule.use);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function rewriteRules(entries) {
|
|
63
|
+
for (const entry of entries) {
|
|
64
|
+
rewriteRule(entry);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const webpack = (input, context) => {
|
|
68
|
+
const output = config.webpack?.(input, context) ?? input;
|
|
69
|
+
rewriteRules(output.module?.rules ?? []);
|
|
70
|
+
return output;
|
|
71
|
+
};
|
|
72
|
+
return { ...config, turbopack, webpack };
|
|
73
|
+
};
|
|
4
74
|
const hasOwn = (value, key) => value ? Object.hasOwn(value, key) : false;
|
|
5
75
|
const assertManifestKeyIsAvailable = (config) => {
|
|
6
76
|
if (hasOwn(config.env, APP_ROUTE_MANIFEST_ENV) ||
|
|
@@ -18,9 +88,19 @@ const flattenRewrites = (rewrites) => Array.isArray(rewrites)
|
|
|
18
88
|
];
|
|
19
89
|
/** Compose Fumadocs MDX with Geistdocs App Router discovery. */
|
|
20
90
|
export const createGeistdocs = (options = {}) => {
|
|
21
|
-
const
|
|
91
|
+
const { experimentalMdxLoader, mdxCompiler = "auto", ...mdxOptions } = options;
|
|
92
|
+
if (!["auto", "native", "js"].includes(mdxCompiler)) {
|
|
93
|
+
throw new Error(`Invalid mdxCompiler: ${mdxCompiler}`);
|
|
94
|
+
}
|
|
95
|
+
const withMDX = createMDX(mdxOptions);
|
|
96
|
+
const mdxLoader = experimentalMdxLoader ??
|
|
97
|
+
process.env.GEISTDOCS_MDX_LOADER ??
|
|
98
|
+
fileURLToPath(new URL("../native-mdx/loader-mdx.cjs", import.meta.url));
|
|
22
99
|
return async (nextConfig = {}) => {
|
|
23
|
-
const
|
|
100
|
+
const withFumadocs = withMDX(await nextConfig);
|
|
101
|
+
const config = mdxCompiler === "js"
|
|
102
|
+
? withFumadocs
|
|
103
|
+
: replaceMdxLoader(withFumadocs, mdxLoader, mdxCompiler);
|
|
24
104
|
const resolvedRewrites = config.rewrites
|
|
25
105
|
? await config.rewrites()
|
|
26
106
|
: undefined;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { DocsPage as FumadocsDocsPage } from "fumadocs-ui/layouts/docs/page";
|
|
2
|
+
import type { MDXComponents } from "mdx/types";
|
|
3
|
+
import type { Metadata } from "next";
|
|
4
|
+
import { type ComponentProps, type ComponentType, type ReactNode } from "react";
|
|
5
|
+
import { NativeDocsLink } from "../components/link";
|
|
6
|
+
import { type GeistdocsConfig } from "../config";
|
|
7
|
+
import { type GeistdocsPageVisibilityData } from "../page-visibility";
|
|
8
|
+
import type { GeistdocsSourceBundle } from "../source";
|
|
9
|
+
type SourceBundle = GeistdocsSourceBundle;
|
|
10
|
+
type GeistdocsPage = NonNullable<ReturnType<SourceBundle["source"]["getPage"]>>;
|
|
11
|
+
type PageActionsBundle = ReturnType<typeof createPageActions>;
|
|
12
|
+
type DocsPageLink = MDXComponents["a"];
|
|
13
|
+
type TableOfContentOptions = NonNullable<ComponentProps<typeof FumadocsDocsPage>["tableOfContent"]>;
|
|
14
|
+
export interface DocsPageParams extends Record<string, string | string[] | undefined> {
|
|
15
|
+
lang: string;
|
|
16
|
+
slug?: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface DocsPageAccessContext<Params extends DocsPageParams = DocsPageParams> {
|
|
19
|
+
params: Params;
|
|
20
|
+
source: SourceBundle;
|
|
21
|
+
}
|
|
22
|
+
export type DocsPageAccessFilter<Params extends DocsPageParams = DocsPageParams> = (page: GeistdocsPage, context: DocsPageAccessContext<Params>) => boolean | Promise<boolean>;
|
|
23
|
+
type DocsPageMdx = MDXComponents | ((context: {
|
|
24
|
+
link: DocsPageLink;
|
|
25
|
+
page: GeistdocsPage;
|
|
26
|
+
source: SourceBundle;
|
|
27
|
+
}) => MDXComponents);
|
|
28
|
+
type OpenGraphImages = NonNullable<Metadata["openGraph"]>["images"];
|
|
29
|
+
interface DocsPageOpenGraphOptions {
|
|
30
|
+
images?: boolean | OpenGraphImages;
|
|
31
|
+
}
|
|
32
|
+
interface PageUrlContext<Params extends DocsPageParams = DocsPageParams> {
|
|
33
|
+
page: GeistdocsPage;
|
|
34
|
+
params: Params;
|
|
35
|
+
}
|
|
36
|
+
interface PublicPageUrlContext<Params extends DocsPageParams = DocsPageParams> extends PageUrlContext<Params> {
|
|
37
|
+
pageUrl: string;
|
|
38
|
+
}
|
|
39
|
+
interface MarkdownUrlContext<Params extends DocsPageParams = DocsPageParams> extends PublicPageUrlContext<Params> {
|
|
40
|
+
publicPageUrl: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ResolvePageMarkdownUrlOptions {
|
|
43
|
+
basePath?: string;
|
|
44
|
+
isRootMountedPage?: boolean;
|
|
45
|
+
pageUrl: string;
|
|
46
|
+
publicPageUrl?: string;
|
|
47
|
+
}
|
|
48
|
+
export declare const resolvePageMarkdownUrl: (options: ResolvePageMarkdownUrlOptions) => string;
|
|
49
|
+
interface DocsPageData extends GeistdocsPageVisibilityData {
|
|
50
|
+
body: ComponentType<{
|
|
51
|
+
components?: MDXComponents;
|
|
52
|
+
}>;
|
|
53
|
+
description?: string;
|
|
54
|
+
full?: boolean;
|
|
55
|
+
title: string;
|
|
56
|
+
toc: ComponentProps<typeof FumadocsDocsPage>["toc"];
|
|
57
|
+
}
|
|
58
|
+
export interface CreateDocsPageOptions<Params extends DocsPageParams = DocsPageParams> {
|
|
59
|
+
/** Return false to make a page unavailable for the current route params. */
|
|
60
|
+
canViewPage?: DocsPageAccessFilter<Params>;
|
|
61
|
+
config: Pick<GeistdocsConfig, "ai" | "basePath" | "defaultLanguage" | "feedback" | "github" | "pageActions" | "siteId" | "singleLanguage" | "siteUrl">;
|
|
62
|
+
filterStaticParams?: (params: DocsPageParams) => boolean;
|
|
63
|
+
getMarkdownUrl?: (context: MarkdownUrlContext<Params>) => string;
|
|
64
|
+
getPageUrl?: (context: PageUrlContext<Params>) => string;
|
|
65
|
+
getPublicPageUrl?: (context: PublicPageUrlContext<Params>) => string;
|
|
66
|
+
mdx?: DocsPageMdx;
|
|
67
|
+
metadata?: (context: {
|
|
68
|
+
metadata: Metadata;
|
|
69
|
+
page: GeistdocsPage;
|
|
70
|
+
params: Params;
|
|
71
|
+
}) => Metadata | Promise<Metadata>;
|
|
72
|
+
openGraph?: DocsPageOpenGraphOptions;
|
|
73
|
+
pageActions?: PageActionsBundle;
|
|
74
|
+
/** Static content skips Markdown conversion; callbacks receive full context. */
|
|
75
|
+
renderTop?: ReactNode | ((context: {
|
|
76
|
+
data: DocsPageData;
|
|
77
|
+
markdown: string;
|
|
78
|
+
markdownUrl: string;
|
|
79
|
+
page: GeistdocsPage;
|
|
80
|
+
pageUrl: string;
|
|
81
|
+
publicPageUrl: string;
|
|
82
|
+
}) => ReactNode);
|
|
83
|
+
resolveLink?: (context: {
|
|
84
|
+
link: DocsPageLink;
|
|
85
|
+
nativeLink: typeof NativeDocsLink;
|
|
86
|
+
page: GeistdocsPage;
|
|
87
|
+
source: SourceBundle;
|
|
88
|
+
}) => DocsPageLink;
|
|
89
|
+
source: SourceBundle;
|
|
90
|
+
tableOfContent?: TableOfContentOptions;
|
|
91
|
+
tableOfContentPopover?: ComponentProps<typeof FumadocsDocsPage>["tableOfContentPopover"];
|
|
92
|
+
}
|
|
93
|
+
/** A page factory with no implicit MDX registry; provide every named component. */
|
|
94
|
+
export type CreateCustomDocsPageOptions<Params extends DocsPageParams = DocsPageParams> = Omit<CreateDocsPageOptions<Params>, "mdx"> & {
|
|
95
|
+
mdx: DocsPageMdx;
|
|
96
|
+
};
|
|
97
|
+
export declare const createDocsPage: <Params extends DocsPageParams = DocsPageParams>({ canViewPage, config, source, mdx, pageActions, filterStaticParams, getMarkdownUrl, getPageUrl, getPublicPageUrl, metadata, openGraph, renderTop, resolveLink, tableOfContent, tableOfContentPopover, }: CreateCustomDocsPageOptions<Params>) => {
|
|
98
|
+
Page: ({ params }: {
|
|
99
|
+
params: Promise<Params>;
|
|
100
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
getPageTree: (params: Params) => Promise<import("fumadocs-core/page-tree").Root>;
|
|
102
|
+
generateStaticParams: () => (Omit<DocsPageParams, "lang"> & {
|
|
103
|
+
lang?: string;
|
|
104
|
+
})[];
|
|
105
|
+
generateMetadata: ({ params, }: {
|
|
106
|
+
params: Promise<Params>;
|
|
107
|
+
}) => Promise<Metadata>;
|
|
108
|
+
};
|
|
109
|
+
export declare const createPageActions: ({ config, extraActions, getExtraActions, }: import("../internal/page-actions").CreatePageActionsOptions) => import("../internal/page-actions").CreatePageActionsOptions;
|
|
110
|
+
export {};
|
|
111
|
+
//# sourceMappingURL=docs-custom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-custom.d.ts","sourceRoot":"","sources":["../../src/pages/docs-custom.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,QAAQ,IAAI,gBAAgB,EAE7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,KAAK,eAAe,EAA+B,MAAM,WAAW,CAAC;AAkB9E,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,KAAK,YAAY,GAAG,qBAAqB,CAAC;AAC1C,KAAK,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAChF,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,KAAK,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AACvC,KAAK,qBAAqB,GAAG,WAAW,CACtC,cAAc,CAAC,OAAO,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CAC1D,CAAC;AACF,MAAM,WAAW,cACf,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC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AC;AAEF,eAAO,MAAM,iBAAiB,0KAA4B,CAAC"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Link from "fumadocs-core/link";
|
|
3
|
+
import { DocsBody as FumadocsDocsBody, DocsPage as FumadocsDocsPage, DocsTitle as FumadocsDocsTitle, } from "fumadocs-ui/layouts/docs/page";
|
|
4
|
+
import { notFound } from "next/navigation";
|
|
5
|
+
import { cache, } from "react";
|
|
6
|
+
import { cn } from "#geistdocs-ui/utils";
|
|
7
|
+
import { NativeDocsLink } from "../components/link";
|
|
8
|
+
import { getPublicPath, withBasePath } from "../config";
|
|
9
|
+
import { getDocsLinkClassName } from "../internal/docs-link-class-name";
|
|
10
|
+
import { DocsPageErrorBoundary } from "../internal/docs-page-error-boundary";
|
|
11
|
+
import { resolveDocumentTitle } from "../internal/document-title";
|
|
12
|
+
import { omitLanguageParam, resolveRouteLanguage } from "../internal/languages";
|
|
13
|
+
import { resolveLinkHref, stripBasePathFromHref } from "../internal/link-href";
|
|
14
|
+
import { resolvePageMarkdownUrl as resolveInternalPageMarkdownUrl } from "../internal/markdown-url.js";
|
|
15
|
+
import { createPageActions as createInternalPageActions, resolveExtraPageActions, } from "../internal/page-actions";
|
|
16
|
+
import { GeistdocsPageActions } from "../internal/page-actions-gate";
|
|
17
|
+
import { PageBreadcrumb } from "../internal/page-breadcrumb";
|
|
18
|
+
import { getPageFooterItems, PageFooter } from "../internal/page-footer";
|
|
19
|
+
import { filterPageTree } from "../internal/page-tree-visibility";
|
|
20
|
+
import { createRelativeDocsLink } from "../internal/relative-docs-link";
|
|
21
|
+
import { GeistdocsTableOfContents } from "../internal/table-of-contents";
|
|
22
|
+
import { GeistdocsTableOfContentsActions } from "../internal/toc-actions-client";
|
|
23
|
+
import { getPageRobots, } from "../page-visibility";
|
|
24
|
+
const renderPrefetchedDocsLink = (siteUrl, basePath, { children, className, href, rel, target, ...props }) => {
|
|
25
|
+
const originalHref = String(href ?? "");
|
|
26
|
+
const resolved = resolveLinkHref(originalHref, siteUrl);
|
|
27
|
+
const linkHref = resolved.href === originalHref
|
|
28
|
+
? resolved.href
|
|
29
|
+
: stripBasePathFromHref(resolved.href, basePath);
|
|
30
|
+
return (_jsx(Link, { ...props, className: getDocsLinkClassName(className), href: linkHref, prefetch: !resolved.external, rel: resolved.external ? rel : undefined, target: resolved.external ? target : undefined, children: children }));
|
|
31
|
+
};
|
|
32
|
+
export const resolvePageMarkdownUrl = (options) => resolveInternalPageMarkdownUrl(options);
|
|
33
|
+
/**
|
|
34
|
+
* The page's visible article parts carry `data-geistdocs-article` (`title`,
|
|
35
|
+
* `body`) so tools that read the rendered HTML (docs
|
|
36
|
+
* crawlers, parity checks against the Markdown route) can select the
|
|
37
|
+
* article without depending on Fumadocs' element ids or on class names.
|
|
38
|
+
* The marked elements hold content only: page actions, breadcrumbs, the
|
|
39
|
+
* table of contents, and the previous/next footer sit outside them.
|
|
40
|
+
*/
|
|
41
|
+
const DocsTitle = ({ className, ...props }) => (_jsx(FumadocsDocsTitle, { className: cn("mb-4 text-balance", className), "data-geistdocs-article": "title", ...props }));
|
|
42
|
+
const DocsBody = ({ className, ...props }) => (_jsx(FumadocsDocsBody, { className: cn("mx-auto w-full", className), "data-geistdocs-article": "body", ...props }));
|
|
43
|
+
/** App-provided footer content below the table-of-contents actions. */
|
|
44
|
+
const TocFooterSlot = ({ children }) => children ? _jsx("div", { className: "mt-4", children: children }) : null;
|
|
45
|
+
const hasTableOfContentsActions = (config, extraActions) => config.pageActions?.scrollTop !== false ||
|
|
46
|
+
config.feedback?.enabled !== false ||
|
|
47
|
+
extraActions.length > 0;
|
|
48
|
+
const serializeParams = (params) => JSON.stringify(Object.entries(params)
|
|
49
|
+
.filter(([, value]) => value !== undefined)
|
|
50
|
+
.sort(([left], [right]) => left.localeCompare(right)));
|
|
51
|
+
export const createDocsPage = ({ canViewPage, config, source, mdx, pageActions = createInternalPageActions({ config }), filterStaticParams, getMarkdownUrl, getPageUrl, getPublicPageUrl, metadata, openGraph, renderTop, resolveLink, tableOfContent, tableOfContentPopover, }) => {
|
|
52
|
+
const DocsLink = renderPrefetchedDocsLink.bind(null, config.siteUrl, config.basePath);
|
|
53
|
+
const resolvePageUrls = (page, params) => {
|
|
54
|
+
const pageUrl = getPageUrl?.({ page, params }) ?? page.url;
|
|
55
|
+
const publicPageUrl = getPublicPageUrl?.({ page, params, pageUrl }) ??
|
|
56
|
+
getPublicPath(pageUrl, config.basePath);
|
|
57
|
+
const markdownUrl = getMarkdownUrl?.({ page, params, pageUrl, publicPageUrl }) ??
|
|
58
|
+
resolveInternalPageMarkdownUrl({
|
|
59
|
+
basePath: config.basePath,
|
|
60
|
+
isRootMountedPage: source.baseUrl === "/" && page.slugs.length === 0,
|
|
61
|
+
pageUrl,
|
|
62
|
+
publicPageUrl,
|
|
63
|
+
});
|
|
64
|
+
return { markdownUrl, pageUrl, publicPageUrl };
|
|
65
|
+
};
|
|
66
|
+
const getAccessState = cache(async (paramsKey) => {
|
|
67
|
+
const params = Object.fromEntries(JSON.parse(paramsKey));
|
|
68
|
+
const tree = source.source.getPageTree(params.lang);
|
|
69
|
+
if (!canViewPage) {
|
|
70
|
+
return { tree, visibleUrls: undefined };
|
|
71
|
+
}
|
|
72
|
+
const access = await Promise.all(source.source.getPages(params.lang).map(async (page) => ({
|
|
73
|
+
page,
|
|
74
|
+
visible: await canViewPage(page, { params, source }),
|
|
75
|
+
})));
|
|
76
|
+
const visibleUrls = new Set(access.filter(({ visible }) => visible).map(({ page }) => page.url));
|
|
77
|
+
const hiddenUrls = new Set(access.filter(({ visible }) => !visible).map(({ page }) => page.url));
|
|
78
|
+
return { tree: filterPageTree(tree, hiddenUrls), visibleUrls };
|
|
79
|
+
});
|
|
80
|
+
// Single-language apps have no [lang] segment, so params arrive without it.
|
|
81
|
+
const resolveParams = async (params) => {
|
|
82
|
+
const resolved = await params;
|
|
83
|
+
return {
|
|
84
|
+
...resolved,
|
|
85
|
+
lang: resolveRouteLanguage(config, resolved.lang),
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
const getPage = async (params) => {
|
|
89
|
+
const page = source.source.getPage(params.slug, params.lang);
|
|
90
|
+
if (!page) {
|
|
91
|
+
notFound();
|
|
92
|
+
}
|
|
93
|
+
if (canViewPage) {
|
|
94
|
+
const { visibleUrls } = await getAccessState(serializeParams(params));
|
|
95
|
+
if (!visibleUrls?.has(page.url)) {
|
|
96
|
+
notFound();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return page;
|
|
100
|
+
};
|
|
101
|
+
const getPageTree = async (params) => (await getAccessState(serializeParams(params))).tree;
|
|
102
|
+
const PageContent = async ({ params }) => {
|
|
103
|
+
const resolvedParams = await resolveParams(params);
|
|
104
|
+
const { lang } = resolvedParams;
|
|
105
|
+
const page = await getPage(resolvedParams);
|
|
106
|
+
const pageTree = await getPageTree(resolvedParams);
|
|
107
|
+
const data = page.data;
|
|
108
|
+
const MDX = data.body;
|
|
109
|
+
const defaultLink = createRelativeDocsLink(source.source, page, DocsLink);
|
|
110
|
+
const link = resolveLink
|
|
111
|
+
? resolveLink({
|
|
112
|
+
link: defaultLink,
|
|
113
|
+
nativeLink: NativeDocsLink,
|
|
114
|
+
page,
|
|
115
|
+
source,
|
|
116
|
+
})
|
|
117
|
+
: defaultLink;
|
|
118
|
+
const resolvedMdx = typeof mdx === "function" ? mdx({ link, page, source }) : mdx;
|
|
119
|
+
const { markdownUrl, pageUrl, publicPageUrl } = resolvePageUrls(page, resolvedParams);
|
|
120
|
+
const footerItems = getPageFooterItems(pageTree, page.url);
|
|
121
|
+
const pagesByUrl = getPageUrl
|
|
122
|
+
? new Map(source.source.getPages(lang).map((entry) => [entry.url, entry]))
|
|
123
|
+
: undefined;
|
|
124
|
+
const resolveFooterItem = (item) => {
|
|
125
|
+
if (!(item && getPageUrl && pagesByUrl)) {
|
|
126
|
+
return item;
|
|
127
|
+
}
|
|
128
|
+
const itemPage = pagesByUrl.get(item.url);
|
|
129
|
+
if (!itemPage) {
|
|
130
|
+
return item;
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
...item,
|
|
134
|
+
url: getPageUrl({
|
|
135
|
+
page: itemPage,
|
|
136
|
+
params: { ...resolvedParams, slug: itemPage.slugs },
|
|
137
|
+
}),
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
const resolvedFooterItems = {
|
|
141
|
+
previous: resolveFooterItem(footerItems.previous),
|
|
142
|
+
next: resolveFooterItem(footerItems.next),
|
|
143
|
+
};
|
|
144
|
+
const markdown = pageActions.getExtraActions || typeof renderTop === "function"
|
|
145
|
+
? await source.getPageMarkdown(page)
|
|
146
|
+
: undefined;
|
|
147
|
+
const footerActions = resolveExtraPageActions(pageActions, {
|
|
148
|
+
markdown: markdown ?? "",
|
|
149
|
+
page: {
|
|
150
|
+
path: page.path,
|
|
151
|
+
url: publicPageUrl,
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
const hasTocActions = hasTableOfContentsActions(pageActions.config, footerActions);
|
|
155
|
+
const hasTocLinks = Boolean(data.toc?.length);
|
|
156
|
+
// Actions stay adjacent to the table of contents; the app-provided
|
|
157
|
+
// footer (promos and other custom content) renders below them.
|
|
158
|
+
const tocFooter = (_jsxs(_Fragment, { children: [hasTocLinks && hasTocActions ? (_jsx("div", { className: "mt-4 border-gray-alpha-400 border-t pt-4", children: _jsx("nav", { "aria-label": "Page actions", className: "flex min-w-0 flex-col gap-1", children: _jsx(GeistdocsTableOfContentsActions, { config: pageActions.config, extraActions: footerActions }) }) })) : null, _jsx(TocFooterSlot, { children: tableOfContent?.footer })] }));
|
|
159
|
+
const tocComponent = tableOfContent?.component ?? (_jsx(GeistdocsTableOfContents, { footer: tocFooter, header: tableOfContent?.header, toc: data.toc ?? [] }));
|
|
160
|
+
return (_jsxs(FumadocsDocsPage, { breadcrumb: {
|
|
161
|
+
component: _jsx(PageBreadcrumb, { tree: pageTree, url: page.url }),
|
|
162
|
+
}, footer: { component: _jsx(PageFooter, { ...resolvedFooterItems }) }, full: data.full, tableOfContent: {
|
|
163
|
+
enabled: true,
|
|
164
|
+
single: true,
|
|
165
|
+
...tableOfContent,
|
|
166
|
+
component: tocComponent,
|
|
167
|
+
}, tableOfContentPopover: {
|
|
168
|
+
enabled: false,
|
|
169
|
+
...tableOfContentPopover,
|
|
170
|
+
}, toc: data.toc, children: [typeof renderTop === "function"
|
|
171
|
+
? renderTop({
|
|
172
|
+
data,
|
|
173
|
+
markdown: markdown ?? "",
|
|
174
|
+
markdownUrl,
|
|
175
|
+
page,
|
|
176
|
+
pageUrl,
|
|
177
|
+
publicPageUrl,
|
|
178
|
+
})
|
|
179
|
+
: renderTop, _jsxs("div", { className: "mb-8 flex flex-col-reverse gap-4 md:flex-row md:items-end md:justify-between", children: [_jsx(DocsTitle, { className: "mb-0 min-w-0", children: data.title }), _jsx(GeistdocsPageActions, { config: pageActions.config, only: "desktop", page: {
|
|
180
|
+
markdownUrl,
|
|
181
|
+
path: page.path,
|
|
182
|
+
title: data.title,
|
|
183
|
+
url: publicPageUrl,
|
|
184
|
+
} })] }), _jsx("div", { className: "-mt-6 mb-4 @min-[961px]:hidden", children: _jsx(GeistdocsPageActions, { config: pageActions.config, only: "mobile", page: {
|
|
185
|
+
markdownUrl,
|
|
186
|
+
path: page.path,
|
|
187
|
+
title: data.title,
|
|
188
|
+
url: publicPageUrl,
|
|
189
|
+
} }) }), _jsx(DocsBody, { children: _jsx(MDX, { components: {
|
|
190
|
+
a: link,
|
|
191
|
+
...resolvedMdx,
|
|
192
|
+
} }) })] }));
|
|
193
|
+
};
|
|
194
|
+
const Page = ({ params }) => (_jsx(DocsPageErrorBoundary, { children: _jsx(PageContent, { params: params }) }));
|
|
195
|
+
const generateStaticParams = () => {
|
|
196
|
+
const params = source.source.generateParams();
|
|
197
|
+
const filtered = filterStaticParams
|
|
198
|
+
? params.filter(filterStaticParams)
|
|
199
|
+
: params;
|
|
200
|
+
return omitLanguageParam(config, filtered);
|
|
201
|
+
};
|
|
202
|
+
const generateMetadata = async ({ params, }) => {
|
|
203
|
+
const resolvedParams = await resolveParams(params);
|
|
204
|
+
const page = await getPage(resolvedParams);
|
|
205
|
+
const pageTree = await getPageTree(resolvedParams);
|
|
206
|
+
const data = page.data;
|
|
207
|
+
const { markdownUrl, publicPageUrl } = resolvePageUrls(page, resolvedParams);
|
|
208
|
+
const openGraphImages = openGraph?.images === true
|
|
209
|
+
? source.getPageImage(page).url
|
|
210
|
+
: openGraph?.images;
|
|
211
|
+
let canonicalUrl;
|
|
212
|
+
if (data.canonical) {
|
|
213
|
+
canonicalUrl = withBasePath(data.canonical, config.basePath);
|
|
214
|
+
}
|
|
215
|
+
else if (config.siteUrl) {
|
|
216
|
+
canonicalUrl = new URL(publicPageUrl, config.siteUrl).toString();
|
|
217
|
+
}
|
|
218
|
+
const defaultMetadata = {
|
|
219
|
+
title: resolveDocumentTitle({
|
|
220
|
+
pageTitle: data.title,
|
|
221
|
+
pageUrl: page.url,
|
|
222
|
+
tree: pageTree,
|
|
223
|
+
}),
|
|
224
|
+
description: data.description,
|
|
225
|
+
keywords: data.keywords,
|
|
226
|
+
robots: getPageRobots(page),
|
|
227
|
+
...(openGraphImages ? { openGraph: { images: openGraphImages } } : {}),
|
|
228
|
+
alternates: {
|
|
229
|
+
canonical: canonicalUrl,
|
|
230
|
+
types: {
|
|
231
|
+
"text/markdown": markdownUrl,
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
return metadata
|
|
236
|
+
? await metadata({
|
|
237
|
+
metadata: defaultMetadata,
|
|
238
|
+
page,
|
|
239
|
+
params: resolvedParams,
|
|
240
|
+
})
|
|
241
|
+
: defaultMetadata;
|
|
242
|
+
};
|
|
243
|
+
return {
|
|
244
|
+
Page,
|
|
245
|
+
getPageTree,
|
|
246
|
+
generateStaticParams,
|
|
247
|
+
generateMetadata,
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
export const createPageActions = createInternalPageActions;
|
package/dist/pages/docs.d.ts
CHANGED
|
@@ -1,95 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { NativeDocsLink } from "../components/link";
|
|
6
|
-
import { type GeistdocsConfig } from "../config";
|
|
7
|
-
import { type GeistdocsPageVisibilityData } from "../page-visibility";
|
|
8
|
-
import type { GeistdocsSourceBundle } from "../source";
|
|
9
|
-
type SourceBundle = GeistdocsSourceBundle;
|
|
10
|
-
type GeistdocsPage = NonNullable<ReturnType<SourceBundle["source"]["getPage"]>>;
|
|
11
|
-
type PageActionsBundle = ReturnType<typeof createPageActions>;
|
|
12
|
-
type DocsPageLink = MDXComponents["a"];
|
|
13
|
-
type TableOfContentOptions = NonNullable<ComponentProps<typeof FumadocsDocsPage>["tableOfContent"]>;
|
|
14
|
-
export interface DocsPageParams extends Record<string, string | string[] | undefined> {
|
|
15
|
-
lang: string;
|
|
16
|
-
slug?: string[];
|
|
17
|
-
}
|
|
18
|
-
export interface DocsPageAccessContext<Params extends DocsPageParams = DocsPageParams> {
|
|
19
|
-
params: Params;
|
|
20
|
-
source: SourceBundle;
|
|
21
|
-
}
|
|
22
|
-
export type DocsPageAccessFilter<Params extends DocsPageParams = DocsPageParams> = (page: GeistdocsPage, context: DocsPageAccessContext<Params>) => boolean | Promise<boolean>;
|
|
23
|
-
type DocsPageMdx = MDXComponents | ((context: {
|
|
24
|
-
link: DocsPageLink;
|
|
25
|
-
page: GeistdocsPage;
|
|
26
|
-
source: SourceBundle;
|
|
27
|
-
}) => MDXComponents);
|
|
28
|
-
type OpenGraphImages = NonNullable<Metadata["openGraph"]>["images"];
|
|
29
|
-
interface DocsPageOpenGraphOptions {
|
|
30
|
-
images?: boolean | OpenGraphImages;
|
|
31
|
-
}
|
|
32
|
-
interface PageUrlContext<Params extends DocsPageParams = DocsPageParams> {
|
|
33
|
-
page: GeistdocsPage;
|
|
34
|
-
params: Params;
|
|
35
|
-
}
|
|
36
|
-
interface PublicPageUrlContext<Params extends DocsPageParams = DocsPageParams> extends PageUrlContext<Params> {
|
|
37
|
-
pageUrl: string;
|
|
38
|
-
}
|
|
39
|
-
interface MarkdownUrlContext<Params extends DocsPageParams = DocsPageParams> extends PublicPageUrlContext<Params> {
|
|
40
|
-
publicPageUrl: string;
|
|
41
|
-
}
|
|
42
|
-
export interface ResolvePageMarkdownUrlOptions {
|
|
43
|
-
basePath?: string;
|
|
44
|
-
isRootMountedPage?: boolean;
|
|
45
|
-
pageUrl: string;
|
|
46
|
-
publicPageUrl?: string;
|
|
47
|
-
}
|
|
48
|
-
export declare const resolvePageMarkdownUrl: (options: ResolvePageMarkdownUrlOptions) => string;
|
|
49
|
-
interface DocsPageData extends GeistdocsPageVisibilityData {
|
|
50
|
-
body: ComponentType<{
|
|
51
|
-
components?: MDXComponents;
|
|
52
|
-
}>;
|
|
53
|
-
description?: string;
|
|
54
|
-
full?: boolean;
|
|
55
|
-
title: string;
|
|
56
|
-
toc: ComponentProps<typeof FumadocsDocsPage>["toc"];
|
|
57
|
-
}
|
|
58
|
-
export interface CreateDocsPageOptions<Params extends DocsPageParams = DocsPageParams> {
|
|
59
|
-
/** Return false to make a page unavailable for the current route params. */
|
|
60
|
-
canViewPage?: DocsPageAccessFilter<Params>;
|
|
61
|
-
config: Pick<GeistdocsConfig, "ai" | "basePath" | "defaultLanguage" | "feedback" | "github" | "pageActions" | "siteId" | "singleLanguage" | "siteUrl">;
|
|
62
|
-
filterStaticParams?: (params: DocsPageParams) => boolean;
|
|
63
|
-
getMarkdownUrl?: (context: MarkdownUrlContext<Params>) => string;
|
|
64
|
-
getPageUrl?: (context: PageUrlContext<Params>) => string;
|
|
65
|
-
getPublicPageUrl?: (context: PublicPageUrlContext<Params>) => string;
|
|
66
|
-
mdx?: DocsPageMdx;
|
|
67
|
-
metadata?: (context: {
|
|
68
|
-
metadata: Metadata;
|
|
69
|
-
page: GeistdocsPage;
|
|
70
|
-
params: Params;
|
|
71
|
-
}) => Metadata | Promise<Metadata>;
|
|
72
|
-
openGraph?: DocsPageOpenGraphOptions;
|
|
73
|
-
pageActions?: PageActionsBundle;
|
|
74
|
-
renderTop?: (context: {
|
|
75
|
-
data: DocsPageData;
|
|
76
|
-
markdown: string;
|
|
77
|
-
markdownUrl: string;
|
|
78
|
-
page: GeistdocsPage;
|
|
79
|
-
pageUrl: string;
|
|
80
|
-
publicPageUrl: string;
|
|
81
|
-
}) => ReactNode;
|
|
82
|
-
resolveLink?: (context: {
|
|
83
|
-
link: DocsPageLink;
|
|
84
|
-
nativeLink: typeof NativeDocsLink;
|
|
85
|
-
page: GeistdocsPage;
|
|
86
|
-
source: SourceBundle;
|
|
87
|
-
}) => DocsPageLink;
|
|
88
|
-
source: SourceBundle;
|
|
89
|
-
tableOfContent?: TableOfContentOptions;
|
|
90
|
-
tableOfContentPopover?: ComponentProps<typeof FumadocsDocsPage>["tableOfContentPopover"];
|
|
91
|
-
}
|
|
92
|
-
export declare const createDocsPage: <Params extends DocsPageParams = DocsPageParams>({ canViewPage, config, source, mdx, pageActions, filterStaticParams, getMarkdownUrl, getPageUrl, getPublicPageUrl, metadata, openGraph, renderTop, resolveLink, tableOfContent, tableOfContentPopover, }: CreateDocsPageOptions<Params>) => {
|
|
1
|
+
import { type CreateDocsPageOptions, type DocsPageParams } from "./docs-custom";
|
|
2
|
+
export { type CreateDocsPageOptions, createPageActions, type DocsPageAccessContext, type DocsPageAccessFilter, type DocsPageParams, type ResolvePageMarkdownUrlOptions, resolvePageMarkdownUrl, } from "./docs-custom";
|
|
3
|
+
/** The default factory keeps the complete Geistdocs MDX component registry. */
|
|
4
|
+
export declare const createDocsPage: <Params extends DocsPageParams = DocsPageParams>(options: CreateDocsPageOptions<Params>) => {
|
|
93
5
|
Page: ({ params }: {
|
|
94
6
|
params: Promise<Params>;
|
|
95
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -99,11 +11,6 @@ export declare const createDocsPage: <Params extends DocsPageParams = DocsPagePa
|
|
|
99
11
|
})[];
|
|
100
12
|
generateMetadata: ({ params, }: {
|
|
101
13
|
params: Promise<Params>;
|
|
102
|
-
}) => Promise<Metadata>;
|
|
14
|
+
}) => Promise<import("next").Metadata>;
|
|
103
15
|
};
|
|
104
|
-
export declare const createPageActions: ({ config, getExtraActions, }: import("../internal/page-actions").CreatePageActionsOptions) => {
|
|
105
|
-
config: Pick<GeistdocsConfig, "ai" | "feedback" | "github" | "pageActions" | "siteId">;
|
|
106
|
-
getExtraActions: ((context: import("../internal/page-actions").PageActionRenderContext) => ReactNode[]) | undefined;
|
|
107
|
-
};
|
|
108
|
-
export {};
|
|
109
16
|
//# sourceMappingURL=docs.d.ts.map
|
package/dist/pages/docs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/pages/docs.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/pages/docs.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,6BAA6B,EAClC,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAEvB,+EAA+E;AAC/E,eAAO,MAAM,cAAc,GAAI,MAAM,SAAS,cAAc,GAAG,cAAc,EAC3E,SAAS,qBAAqB,CAAC,MAAM,CAAC;;;;;;;;;;;CAUpC,CAAC"}
|