@assistant-ui/docs-theme 0.0.0 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +225 -0
- package/dist/action-icons.d.ts +5 -0
- package/dist/action-icons.d.ts.map +1 -0
- package/dist/action-icons.js +52 -0
- package/dist/action-icons.js.map +1 -0
- package/dist/brand.d.ts +7 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/brand.js +37 -0
- package/dist/brand.js.map +1 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +22 -0
- package/dist/config.js.map +1 -0
- package/dist/header.d.ts +12 -0
- package/dist/header.d.ts.map +1 -0
- package/dist/header.js +73 -0
- package/dist/header.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/navigation.d.ts +23 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +41 -0
- package/dist/navigation.js.map +1 -0
- package/dist/next.d.ts +29 -0
- package/dist/next.d.ts.map +1 -0
- package/dist/next.js +63 -0
- package/dist/next.js.map +1 -0
- package/dist/page-content.d.ts +12 -0
- package/dist/page-content.d.ts.map +1 -0
- package/dist/page-content.js +274 -0
- package/dist/page-content.js.map +1 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +1 -0
- package/dist/site/constants.d.ts +2 -0
- package/dist/site/constants.d.ts.map +1 -0
- package/dist/site/constants.js +5 -0
- package/dist/site/constants.js.map +1 -0
- package/dist/site/footer.d.ts +13 -0
- package/dist/site/footer.d.ts.map +1 -0
- package/dist/site/footer.js +35 -0
- package/dist/site/footer.js.map +1 -0
- package/dist/site/header.d.ts +13 -0
- package/dist/site/header.d.ts.map +1 -0
- package/dist/site/header.js +81 -0
- package/dist/site/header.js.map +1 -0
- package/dist/site/layout.d.ts +8 -0
- package/dist/site/layout.d.ts.map +1 -0
- package/dist/site/layout.js +21 -0
- package/dist/site/layout.js.map +1 -0
- package/dist/site/page.d.ts +9 -0
- package/dist/site/page.d.ts.map +1 -0
- package/dist/site/page.js +32 -0
- package/dist/site/page.js.map +1 -0
- package/dist/site/pager.d.ts +13 -0
- package/dist/site/pager.d.ts.map +1 -0
- package/dist/site/pager.js +36 -0
- package/dist/site/pager.js.map +1 -0
- package/dist/site/sidebar-navigation.d.ts +13 -0
- package/dist/site/sidebar-navigation.d.ts.map +1 -0
- package/dist/site/sidebar-navigation.js +185 -0
- package/dist/site/sidebar-navigation.js.map +1 -0
- package/dist/site/sidebar.d.ts +16 -0
- package/dist/site/sidebar.d.ts.map +1 -0
- package/dist/site/sidebar.js +46 -0
- package/dist/site/sidebar.js.map +1 -0
- package/dist/site/toc.d.ts +12 -0
- package/dist/site/toc.d.ts.map +1 -0
- package/dist/site/toc.js +92 -0
- package/dist/site/toc.js.map +1 -0
- package/dist/site/tree.d.ts +24 -0
- package/dist/site/tree.d.ts.map +1 -0
- package/dist/site/tree.js +14 -0
- package/dist/site/tree.js.map +1 -0
- package/dist/site/utils.d.ts +2 -0
- package/dist/site/utils.d.ts.map +1 -0
- package/dist/site/utils.js +5 -0
- package/dist/site/utils.js.map +1 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +9 -0
- package/package.json +101 -1
- package/src/action-icons.tsx +48 -0
- package/src/brand.tsx +36 -0
- package/src/config.ts +23 -0
- package/src/header.test.tsx +41 -0
- package/src/header.tsx +94 -0
- package/src/index.test.ts +37 -0
- package/src/index.ts +38 -0
- package/src/layout-hosts.test.tsx +98 -0
- package/src/navigation.test.ts +123 -0
- package/src/navigation.ts +61 -0
- package/src/next.test.tsx +110 -0
- package/src/next.tsx +101 -0
- package/src/page-content.test.tsx +87 -0
- package/src/page-content.tsx +416 -0
- package/src/provider.ts +1 -0
- package/src/site/constants.ts +1 -0
- package/src/site/footer.tsx +59 -0
- package/src/site/header.test.tsx +89 -0
- package/src/site/header.tsx +117 -0
- package/src/site/layout.tsx +33 -0
- package/src/site/page.tsx +38 -0
- package/src/site/pager.tsx +54 -0
- package/src/site/sidebar-navigation.test.tsx +92 -0
- package/src/site/sidebar-navigation.tsx +267 -0
- package/src/site/sidebar.tsx +77 -0
- package/src/site/toc.test.tsx +187 -0
- package/src/site/toc.tsx +118 -0
- package/src/site/tree.ts +36 -0
- package/src/site/utils.ts +2 -0
- package/src/ui.ts +19 -0
- package/styles/site.css +223 -0
- package/styles/theme.css +858 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/navigation.ts
|
|
2
|
+
const getPageNeighbors = (nodes, pathname) => {
|
|
3
|
+
const pages = [];
|
|
4
|
+
const visit = (items, section) => {
|
|
5
|
+
for (const node of items) {
|
|
6
|
+
if (node.type === "page") pages.push({
|
|
7
|
+
name: node.name,
|
|
8
|
+
url: node.url,
|
|
9
|
+
section
|
|
10
|
+
});
|
|
11
|
+
if (node.type === "folder") {
|
|
12
|
+
if (node.index) pages.push({
|
|
13
|
+
name: node.index.name,
|
|
14
|
+
url: node.index.url
|
|
15
|
+
});
|
|
16
|
+
visit(node.children, node.name);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
visit(nodes);
|
|
21
|
+
const index = pages.findIndex((page) => page.url.split(/[?#]/, 1)[0]?.replace(/\/$/, "") === pathname.replace(/\/$/, ""));
|
|
22
|
+
return {
|
|
23
|
+
current: pages[index],
|
|
24
|
+
previous: index >= 0 ? pages[index - 1] : void 0,
|
|
25
|
+
next: index >= 0 ? pages[index + 1] : void 0
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const getEditUrl = (pathname, github) => {
|
|
29
|
+
if (!github) return void 0;
|
|
30
|
+
const base = typeof github === "string" ? { url: github } : github;
|
|
31
|
+
const path = base.directory ?? "";
|
|
32
|
+
let start = 0;
|
|
33
|
+
let end = path.length;
|
|
34
|
+
while (path[start] === "/") start++;
|
|
35
|
+
while (end > start && path[end - 1] === "/") end--;
|
|
36
|
+
const directory = path.slice(start, end);
|
|
37
|
+
return `${base.url.replace(/\/$/, "")}/edit/${base.branch ?? "main"}/${directory ? `${directory}/` : ""}app${pathname.replace(/\/$/, "")}/page.mdx`;
|
|
38
|
+
};
|
|
39
|
+
export { getEditUrl, getPageNeighbors };
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.js","names":[],"sources":["../src/navigation.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { useTreeContext } from \"fumadocs-ui/contexts/tree\";\n\nexport const getPageNeighbors = (\n nodes: ReturnType<typeof useTreeContext>[\"root\"][\"children\"],\n pathname: string,\n) => {\n const pages: getPageNeighbors.Link[] = [];\n const visit = (items: typeof nodes, section?: ReactNode) => {\n for (const node of items) {\n if (node.type === \"page\")\n pages.push({ name: node.name, url: node.url, section });\n if (node.type === \"folder\") {\n if (node.index)\n pages.push({ name: node.index.name, url: node.index.url });\n visit(node.children, node.name);\n }\n }\n };\n visit(nodes);\n const index = pages.findIndex(\n (page) =>\n page.url.split(/[?#]/, 1)[0]?.replace(/\\/$/, \"\") ===\n pathname.replace(/\\/$/, \"\"),\n );\n return {\n current: pages[index],\n previous: index >= 0 ? pages[index - 1] : undefined,\n next: index >= 0 ? pages[index + 1] : undefined,\n };\n};\n\nexport namespace getPageNeighbors {\n export interface Link {\n name: ReactNode;\n url: string;\n section?: ReactNode;\n }\n}\n\nexport const getEditUrl = (pathname: string, github?: getEditUrl.Options) => {\n if (!github) return undefined;\n const base = typeof github === \"string\" ? { url: github } : github;\n const path = base.directory ?? \"\";\n let start = 0;\n let end = path.length;\n while (path[start] === \"/\") start++;\n while (end > start && path[end - 1] === \"/\") end--;\n const directory = path.slice(start, end);\n return `${base.url.replace(/\\/$/, \"\")}/edit/${base.branch ?? \"main\"}/${directory ? `${directory}/` : \"\"}app${pathname.replace(/\\/$/, \"\")}/page.mdx`;\n};\n\nexport namespace getEditUrl {\n export type Options =\n | string\n | {\n url: string;\n branch?: string;\n directory?: string;\n };\n}\n"],"mappings":";AAGA,MAAa,oBACX,OACA,aACG;CACH,MAAM,QAAiC,CAAC;CACxC,MAAM,SAAS,OAAqB,YAAwB;EAC1D,KAAK,MAAM,QAAQ,OAAO;GACxB,IAAI,KAAK,SAAS,QAChB,MAAM,KAAK;IAAE,MAAM,KAAK;IAAM,KAAK,KAAK;IAAK;GAAQ,CAAC;GACxD,IAAI,KAAK,SAAS,UAAU;IAC1B,IAAI,KAAK,OACP,MAAM,KAAK;KAAE,MAAM,KAAK,MAAM;KAAM,KAAK,KAAK,MAAM;IAAI,CAAC;IAC3D,MAAM,KAAK,UAAU,KAAK,IAAI;GAChC;EACF;CACF;CACA,MAAM,KAAK;CACX,MAAM,QAAQ,MAAM,WACjB,SACC,KAAK,IAAI,MAAM,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,OAAO,EAAE,MAC/C,SAAS,QAAQ,OAAO,EAAE,CAC9B;CACA,OAAO;EACL,SAAS,MAAM;EACf,UAAU,SAAS,IAAI,MAAM,QAAQ,KAAK,KAAA;EAC1C,MAAM,SAAS,IAAI,MAAM,QAAQ,KAAK,KAAA;CACxC;AACF;AAUA,MAAa,cAAc,UAAkB,WAAgC;CAC3E,IAAI,CAAC,QAAQ,OAAO,KAAA;CACpB,MAAM,OAAO,OAAO,WAAW,WAAW,EAAE,KAAK,OAAO,IAAI;CAC5D,MAAM,OAAO,KAAK,aAAa;CAC/B,IAAI,QAAQ;CACZ,IAAI,MAAM,KAAK;CACf,OAAO,KAAK,WAAW,KAAK;CAC5B,OAAO,MAAM,SAAS,KAAK,MAAM,OAAO,KAAK;CAC7C,MAAM,YAAY,KAAK,MAAM,OAAO,GAAG;CACvC,OAAO,GAAG,KAAK,IAAI,QAAQ,OAAO,EAAE,EAAE,QAAQ,KAAK,UAAU,OAAO,GAAG,YAAY,GAAG,UAAU,KAAK,GAAG,KAAK,SAAS,QAAQ,OAAO,EAAE,EAAE;AAC3I"}
|
package/dist/next.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { DocsLayoutProps } from "fumadocs-ui/layouts/docs";
|
|
3
|
+
import type { DocsConfig } from "@farming-labs/docs";
|
|
4
|
+
export declare const createDocsMetadata: (config: DocsConfig) => Record<string, unknown>;
|
|
5
|
+
export declare const createDocsLayout: (config: DocsConfig, options: createDocsLayout.Options) => ({ children }: {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
8
|
+
export declare namespace createDocsLayout {
|
|
9
|
+
interface Options {
|
|
10
|
+
name: string;
|
|
11
|
+
/** Active locale from the site's Farming Labs i18n configuration. */
|
|
12
|
+
locale?: string;
|
|
13
|
+
/** Custom header branding, including interactive project switchers. */
|
|
14
|
+
brand?: ReactNode;
|
|
15
|
+
/** Framework layout overrides for custom page trees and sidebar slots. */
|
|
16
|
+
layoutProps?: Partial<Omit<DocsLayoutProps, "children">>;
|
|
17
|
+
homeUrl?: string;
|
|
18
|
+
links?: readonly {
|
|
19
|
+
label: string;
|
|
20
|
+
href: string;
|
|
21
|
+
external?: boolean;
|
|
22
|
+
}[];
|
|
23
|
+
footer?: ReactNode;
|
|
24
|
+
mcpUrl?: string;
|
|
25
|
+
/** Override the repository edit link. `{path}` expands to the current page URL path. */
|
|
26
|
+
editUrl?: string;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=next.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AASrD,eAAO,MAAM,kBAAkB,GAAI,QAAQ,UAAU,4BAChB,CAAC;AAEtC,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,UAAU,EAClB,SAAS,gBAAgB,CAAC,OAAO,oBAeH;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,gCAmDtD,CAAC;AAEF,yBAAiB,gBAAgB,CAAC;IAChC,UAAiB,OAAO;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,qEAAqE;QACrE,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,uEAAuE;QACvE,KAAK,CAAC,EAAE,SAAS,CAAC;QAClB,0EAA0E;QAC1E,WAAW,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC;QACzD,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,SAAS;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE,EAAE,CAAC;QACvE,MAAM,CAAC,EAAE,SAAS,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,wFAAwF;QACxF,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;CACF"}
|
package/dist/next.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { withThemeDefaults } from "./config.js";
|
|
2
|
+
import { DocsHeader } from "./header.js";
|
|
3
|
+
import { DocsPageContent } from "./page-content.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { cloneElement } from "react";
|
|
6
|
+
import { createDocsLayout as createDocsLayout$1, createDocsMetadata as createDocsMetadata$1 } from "@farming-labs/theme";
|
|
7
|
+
// src/next.tsx
|
|
8
|
+
const createDocsMetadata = (config) => createDocsMetadata$1(config);
|
|
9
|
+
const createDocsLayout = (config, options) => {
|
|
10
|
+
const normalized = withThemeDefaults(config);
|
|
11
|
+
const DocsLayout = createDocsLayout$1({
|
|
12
|
+
...normalized,
|
|
13
|
+
theme: {
|
|
14
|
+
...normalized.theme,
|
|
15
|
+
name: "shadcn"
|
|
16
|
+
}
|
|
17
|
+
}, options.locale ? { locale: options.locale } : void 0);
|
|
18
|
+
const docsUrl = config.docsPath ?? `/${config.entry ?? "docs"}`;
|
|
19
|
+
const localizedDocsUrl = options.locale ? `${docsUrl}?lang=${encodeURIComponent(options.locale)}` : docsUrl;
|
|
20
|
+
const Layout = ({ children }) => {
|
|
21
|
+
const layout = DocsLayout({ children: /* @__PURE__ */ jsx(DocsPageContent, {
|
|
22
|
+
name: options.name,
|
|
23
|
+
github: config.github,
|
|
24
|
+
editUrl: options.editUrl,
|
|
25
|
+
mcpUrl: options.mcpUrl,
|
|
26
|
+
footer: options.footer,
|
|
27
|
+
children
|
|
28
|
+
}) });
|
|
29
|
+
const layoutProps = options.layoutProps;
|
|
30
|
+
const themedLayout = layoutProps ? cloneElement(layout, {
|
|
31
|
+
...layoutProps,
|
|
32
|
+
sidebar: layoutProps.sidebar ? {
|
|
33
|
+
...layout.props.sidebar,
|
|
34
|
+
...layoutProps.sidebar
|
|
35
|
+
} : layout.props.sidebar
|
|
36
|
+
}) : layout;
|
|
37
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
38
|
+
className: "aui-docs",
|
|
39
|
+
"data-docs-theme": "assistant-ui",
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx("a", {
|
|
42
|
+
className: "aui-docs-skip-link",
|
|
43
|
+
href: "#nd-page",
|
|
44
|
+
children: "Skip to content"
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ jsx(DocsHeader, {
|
|
47
|
+
brand: config.nav?.title ?? options.name,
|
|
48
|
+
brandSlot: options.brand,
|
|
49
|
+
homeUrl: options.homeUrl ?? (config.nav?.url && config.nav.url !== docsUrl ? config.nav.url : localizedDocsUrl),
|
|
50
|
+
docsUrl: localizedDocsUrl,
|
|
51
|
+
name: options.name,
|
|
52
|
+
links: options.links,
|
|
53
|
+
themeToggle: config.themeToggle !== false && (typeof config.themeToggle !== "object" || config.themeToggle.enabled !== false)
|
|
54
|
+
}),
|
|
55
|
+
themedLayout
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
return Layout;
|
|
60
|
+
};
|
|
61
|
+
export { createDocsLayout, createDocsMetadata };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=next.js.map
|
package/dist/next.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.js","names":["createFrameworkDocsMetadata","createFrameworkDocsLayout"],"sources":["../src/next.tsx"],"sourcesContent":["import { cloneElement, type ReactNode } from \"react\";\nimport type { DocsLayoutProps } from \"fumadocs-ui/layouts/docs\";\nimport type { DocsConfig } from \"@farming-labs/docs\";\nimport {\n createDocsLayout as createFrameworkDocsLayout,\n createDocsMetadata as createFrameworkDocsMetadata,\n} from \"@farming-labs/theme\";\nimport { withThemeDefaults } from \"./config\";\nimport { DocsHeader } from \"./header\";\nimport { DocsPageContent } from \"./page-content\";\n\nexport const createDocsMetadata = (config: DocsConfig) =>\n createFrameworkDocsMetadata(config);\n\nexport const createDocsLayout = (\n config: DocsConfig,\n options: createDocsLayout.Options,\n) => {\n const normalized = withThemeDefaults(config);\n const DocsLayout = createFrameworkDocsLayout(\n {\n ...normalized,\n // Farming Labs 0.2 uses the base preset name to label Introduction folders.\n theme: { ...normalized.theme, name: \"shadcn\" },\n },\n options.locale ? { locale: options.locale } : undefined,\n );\n const docsUrl = config.docsPath ?? `/${config.entry ?? \"docs\"}`;\n const localizedDocsUrl = options.locale\n ? `${docsUrl}?lang=${encodeURIComponent(options.locale)}`\n : docsUrl;\n const Layout = ({ children }: { children: ReactNode }) => {\n const layout = DocsLayout({\n children: (\n <DocsPageContent\n name={options.name}\n github={config.github}\n editUrl={options.editUrl}\n mcpUrl={options.mcpUrl}\n footer={options.footer}\n >\n {children}\n </DocsPageContent>\n ),\n });\n const layoutProps = options.layoutProps;\n const themedLayout = layoutProps\n ? cloneElement(layout, {\n ...layoutProps,\n sidebar: layoutProps.sidebar\n ? { ...layout.props.sidebar, ...layoutProps.sidebar }\n : layout.props.sidebar,\n })\n : layout;\n return (\n <div className=\"aui-docs\" data-docs-theme=\"assistant-ui\">\n <a className=\"aui-docs-skip-link\" href=\"#nd-page\">\n Skip to content\n </a>\n <DocsHeader\n brand={(config.nav?.title as ReactNode) ?? options.name}\n brandSlot={options.brand}\n homeUrl={\n options.homeUrl ??\n (config.nav?.url && config.nav.url !== docsUrl\n ? config.nav.url\n : localizedDocsUrl)\n }\n docsUrl={localizedDocsUrl}\n name={options.name}\n links={options.links}\n themeToggle={\n config.themeToggle !== false &&\n (typeof config.themeToggle !== \"object\" ||\n config.themeToggle.enabled !== false)\n }\n />\n {themedLayout}\n </div>\n );\n };\n return Layout;\n};\n\nexport namespace createDocsLayout {\n export interface Options {\n name: string;\n /** Active locale from the site's Farming Labs i18n configuration. */\n locale?: string;\n /** Custom header branding, including interactive project switchers. */\n brand?: ReactNode;\n /** Framework layout overrides for custom page trees and sidebar slots. */\n layoutProps?: Partial<Omit<DocsLayoutProps, \"children\">>;\n homeUrl?: string;\n links?: readonly { label: string; href: string; external?: boolean }[];\n footer?: ReactNode;\n mcpUrl?: string;\n /** Override the repository edit link. `{path}` expands to the current page URL path. */\n editUrl?: string;\n }\n}\n"],"mappings":";;;;;;;AAWA,MAAa,sBAAsB,WACjCA,qBAA4B,MAAM;AAEpC,MAAa,oBACX,QACA,YACG;CACH,MAAM,aAAa,kBAAkB,MAAM;CAC3C,MAAM,aAAaC,mBACjB;EACE,GAAG;EAEH,OAAO;GAAE,GAAG,WAAW;GAAO,MAAM;EAAS;CAC/C,GACA,QAAQ,SAAS,EAAE,QAAQ,QAAQ,OAAO,IAAI,KAAA,CAChD;CACA,MAAM,UAAU,OAAO,YAAY,IAAI,OAAO,SAAS;CACvD,MAAM,mBAAmB,QAAQ,SAC7B,GAAG,QAAQ,QAAQ,mBAAmB,QAAQ,MAAM,MACpD;CACJ,MAAM,UAAU,EAAE,eAAwC;EACxD,MAAM,SAAS,WAAW,EACxB,UACE,oBAAC,iBAAD;GACE,MAAM,QAAQ;GACd,QAAQ,OAAO;GACf,SAAS,QAAQ;GACjB,QAAQ,QAAQ;GAChB,QAAQ,QAAQ;GAEf;EACc,CAAA,EAErB,CAAC;EACD,MAAM,cAAc,QAAQ;EAC5B,MAAM,eAAe,cACjB,aAAa,QAAQ;GACnB,GAAG;GACH,SAAS,YAAY,UACjB;IAAE,GAAG,OAAO,MAAM;IAAS,GAAG,YAAY;GAAQ,IAClD,OAAO,MAAM;EACnB,CAAC,IACD;EACJ,OACE,qBAAC,OAAD;GAAK,WAAU;GAAW,mBAAgB;GAA1C,UAAA;IACE,oBAAC,KAAD;KAAG,WAAU;KAAqB,MAAK;KAAW,UAAA;IAE/C,CAAA;IACH,oBAAC,YAAD;KACE,OAAQ,OAAO,KAAK,SAAuB,QAAQ;KACnD,WAAW,QAAQ;KACnB,SACE,QAAQ,YACP,OAAO,KAAK,OAAO,OAAO,IAAI,QAAQ,UACnC,OAAO,IAAI,MACX;KAEN,SAAS;KACT,MAAM,QAAQ;KACd,OAAO,QAAQ;KACf,aACE,OAAO,gBAAgB,UACtB,OAAO,OAAO,gBAAgB,YAC7B,OAAO,YAAY,YAAY;IAEpC,CAAA;IACA;GACE;;CAET;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { getEditUrl } from "./navigation.js";
|
|
3
|
+
import type { createDocsLayout } from "./next.js";
|
|
4
|
+
export declare const DocsPageContent: ({ children, name, github, editUrl, mcpUrl, footer, }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
name: string;
|
|
7
|
+
github: getEditUrl.Options | undefined;
|
|
8
|
+
editUrl: string | undefined;
|
|
9
|
+
mcpUrl: string | undefined;
|
|
10
|
+
footer: createDocsLayout.Options["footer"];
|
|
11
|
+
}) => import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=page-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-content.d.ts","sourceRoot":"","sources":["../src/page-content.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAmBf,OAAO,EAAE,UAAU,EAAoB,wBAAqB;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAe;AAqT/C,eAAO,MAAM,eAAe,GAAI,sDAO7B;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC,OAAO,GAAG,SAAS,CAAC;IACvC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC5C,gCAgEA,CAAC"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ClaudeIcon, McpIcon, OpenAIIcon } from "./action-icons.js";
|
|
3
|
+
import { getEditUrl, getPageNeighbors } from "./navigation.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import Link from "next/link";
|
|
6
|
+
import { Check, ChevronLeft, ChevronRight, CircleAlert, Copy, FileText, MoreHorizontal, Pencil } from "lucide-react";
|
|
7
|
+
import { useEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
8
|
+
import { createPortal } from "react-dom";
|
|
9
|
+
import { usePathname } from "next/navigation";
|
|
10
|
+
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
|
|
11
|
+
import { useTreeContext } from "fumadocs-ui/contexts/tree";
|
|
12
|
+
import { useTOCItems } from "fumadocs-ui/components/toc";
|
|
13
|
+
// src/page-content.tsx
|
|
14
|
+
const documentSubscribers = /* @__PURE__ */ new Set();
|
|
15
|
+
let documentObserver;
|
|
16
|
+
const subscribeToDocument = (onChange) => {
|
|
17
|
+
documentSubscribers.add(onChange);
|
|
18
|
+
if (!documentObserver) {
|
|
19
|
+
documentObserver = new MutationObserver(() => {
|
|
20
|
+
for (const subscriber of documentSubscribers) subscriber();
|
|
21
|
+
});
|
|
22
|
+
documentObserver.observe(document.body, {
|
|
23
|
+
childList: true,
|
|
24
|
+
subtree: true
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return () => {
|
|
28
|
+
documentSubscribers.delete(onChange);
|
|
29
|
+
if (documentSubscribers.size === 0) {
|
|
30
|
+
documentObserver?.disconnect();
|
|
31
|
+
documentObserver = void 0;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const useDocumentElement = (selector) => useSyncExternalStore(subscribeToDocument, () => selector ? document.querySelector(selector) : null, () => null);
|
|
36
|
+
const subscribeToOrigin = () => () => {};
|
|
37
|
+
const getOrigin = () => window.location.origin;
|
|
38
|
+
const getServerOrigin = () => "";
|
|
39
|
+
const PageActionLabel = ({ title, description }) => /* @__PURE__ */ jsxs("span", {
|
|
40
|
+
className: "aui-docs-action-label",
|
|
41
|
+
children: [/* @__PURE__ */ jsx("span", { children: title }), /* @__PURE__ */ jsx("span", { children: description })]
|
|
42
|
+
});
|
|
43
|
+
const DocsPageControls = ({ previous, next, title, pathname, markdownUrl, siteName, editUrl, mcpUrl }) => {
|
|
44
|
+
const toc = useTOCItems();
|
|
45
|
+
const headerHost = useDocumentElement("#nd-page .fd-generated-page-header");
|
|
46
|
+
const tocHost = useDocumentElement(toc.length > 0 ? "#nd-toc" : null);
|
|
47
|
+
const [message, setMessage] = useState("");
|
|
48
|
+
const [copying, setCopying] = useState(false);
|
|
49
|
+
const origin = useSyncExternalStore(subscribeToOrigin, getOrigin, getServerOrigin);
|
|
50
|
+
const markdown = useRef(null);
|
|
51
|
+
const githubUrl = editUrl?.replaceAll("{path}", pathname);
|
|
52
|
+
const publishedUrl = `${origin}${markdownUrl}`;
|
|
53
|
+
const claudeUrl = `https://claude.ai/new?q=${encodeURIComponent(`Read ${publishedUrl} (the ${siteName} documentation page "${title}") so I can ask questions about it.`)}`;
|
|
54
|
+
const loadMarkdown = () => {
|
|
55
|
+
markdown.current ??= fetch(markdownUrl).then((response) => {
|
|
56
|
+
if (!response.ok) throw new Error("Could not load this page");
|
|
57
|
+
return response.text();
|
|
58
|
+
}).catch((error) => {
|
|
59
|
+
markdown.current = null;
|
|
60
|
+
throw error;
|
|
61
|
+
});
|
|
62
|
+
return markdown.current;
|
|
63
|
+
};
|
|
64
|
+
const copy = async (kind) => {
|
|
65
|
+
setCopying(true);
|
|
66
|
+
try {
|
|
67
|
+
const text = kind === "page" ? await loadMarkdown() : new URL(mcpUrl ?? "", window.location.origin).href;
|
|
68
|
+
await navigator.clipboard.writeText(text);
|
|
69
|
+
setMessage(kind === "page" ? "Page copied" : "MCP server URL copied");
|
|
70
|
+
} catch {
|
|
71
|
+
setMessage("Could not copy. Please try again.");
|
|
72
|
+
} finally {
|
|
73
|
+
setCopying(false);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (!message) return;
|
|
78
|
+
const timer = window.setTimeout(() => setMessage(""), 3e3);
|
|
79
|
+
return () => window.clearTimeout(timer);
|
|
80
|
+
}, [message]);
|
|
81
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
82
|
+
headerHost && createPortal(/* @__PURE__ */ jsxs("nav", {
|
|
83
|
+
className: "aui-docs-page-controls not-prose",
|
|
84
|
+
"aria-label": "Page controls",
|
|
85
|
+
children: [
|
|
86
|
+
previous ? /* @__PURE__ */ jsx(Link, {
|
|
87
|
+
href: previous.url,
|
|
88
|
+
className: "aui-docs-pager-button",
|
|
89
|
+
"aria-label": "Previous page",
|
|
90
|
+
title: typeof previous.name === "string" || typeof previous.name === "number" ? `Previous: ${previous.name}` : "Previous page",
|
|
91
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true" })
|
|
92
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
93
|
+
className: "aui-docs-pager-button",
|
|
94
|
+
"aria-label": "Previous page",
|
|
95
|
+
disabled: true,
|
|
96
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true" })
|
|
97
|
+
}),
|
|
98
|
+
next ? /* @__PURE__ */ jsx(Link, {
|
|
99
|
+
href: next.url,
|
|
100
|
+
className: "aui-docs-pager-button",
|
|
101
|
+
"aria-label": "Next page",
|
|
102
|
+
title: typeof next.name === "string" || typeof next.name === "number" ? `Next: ${next.name}` : "Next page",
|
|
103
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" })
|
|
104
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
105
|
+
className: "aui-docs-pager-button",
|
|
106
|
+
"aria-label": "Next page",
|
|
107
|
+
disabled: true,
|
|
108
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" })
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ jsxs(DropdownMenu.Root, {
|
|
111
|
+
onOpenChange: (open) => {
|
|
112
|
+
if (open) loadMarkdown().catch(() => {});
|
|
113
|
+
},
|
|
114
|
+
children: [/* @__PURE__ */ jsx(DropdownMenu.Trigger, {
|
|
115
|
+
className: "aui-docs-pager-button",
|
|
116
|
+
"aria-label": "More page actions",
|
|
117
|
+
children: /* @__PURE__ */ jsx(MoreHorizontal, { "aria-hidden": "true" })
|
|
118
|
+
}), /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsxs(DropdownMenu.Content, {
|
|
119
|
+
className: "aui-docs-actions-menu",
|
|
120
|
+
align: "end",
|
|
121
|
+
sideOffset: 4,
|
|
122
|
+
collisionPadding: 16,
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ jsxs(DropdownMenu.Item, {
|
|
125
|
+
className: "aui-docs-actions-menu-item",
|
|
126
|
+
disabled: copying,
|
|
127
|
+
onSelect: () => void copy("page"),
|
|
128
|
+
children: [/* @__PURE__ */ jsx(Copy, { "aria-hidden": "true" }), /* @__PURE__ */ jsx(PageActionLabel, {
|
|
129
|
+
title: copying ? "Copying..." : "Copy page",
|
|
130
|
+
description: "Markdown, ready to paste into an LLM"
|
|
131
|
+
})]
|
|
132
|
+
}),
|
|
133
|
+
/* @__PURE__ */ jsx(DropdownMenu.Item, {
|
|
134
|
+
className: "aui-docs-actions-menu-item",
|
|
135
|
+
asChild: true,
|
|
136
|
+
children: /* @__PURE__ */ jsxs("a", {
|
|
137
|
+
href: markdownUrl,
|
|
138
|
+
target: "_blank",
|
|
139
|
+
rel: "noreferrer noopener",
|
|
140
|
+
children: [/* @__PURE__ */ jsx(FileText, { "aria-hidden": "true" }), /* @__PURE__ */ jsx(PageActionLabel, {
|
|
141
|
+
title: "View as Markdown",
|
|
142
|
+
description: "This page as plain text"
|
|
143
|
+
})]
|
|
144
|
+
})
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ jsx(DropdownMenu.Item, {
|
|
147
|
+
className: "aui-docs-actions-menu-item",
|
|
148
|
+
asChild: true,
|
|
149
|
+
children: /* @__PURE__ */ jsxs("a", {
|
|
150
|
+
href: claudeUrl,
|
|
151
|
+
target: "_blank",
|
|
152
|
+
rel: "noreferrer noopener",
|
|
153
|
+
children: [/* @__PURE__ */ jsx(ClaudeIcon, {}), /* @__PURE__ */ jsx(PageActionLabel, {
|
|
154
|
+
title: "Open in Claude",
|
|
155
|
+
description: "Ask Claude about this page"
|
|
156
|
+
})]
|
|
157
|
+
})
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ jsx(DropdownMenu.Item, {
|
|
160
|
+
className: "aui-docs-actions-menu-item",
|
|
161
|
+
asChild: true,
|
|
162
|
+
children: /* @__PURE__ */ jsxs("a", {
|
|
163
|
+
href: "https://chatgpt.com/codex/",
|
|
164
|
+
target: "_blank",
|
|
165
|
+
rel: "noreferrer noopener",
|
|
166
|
+
children: [/* @__PURE__ */ jsx(OpenAIIcon, {}), /* @__PURE__ */ jsx(PageActionLabel, {
|
|
167
|
+
title: "Open in Codex",
|
|
168
|
+
description: "Open Codex in ChatGPT"
|
|
169
|
+
})]
|
|
170
|
+
})
|
|
171
|
+
}),
|
|
172
|
+
mcpUrl && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenu.Separator, { className: "aui-docs-actions-menu-separator" }), /* @__PURE__ */ jsxs(DropdownMenu.Item, {
|
|
173
|
+
className: "aui-docs-actions-menu-item",
|
|
174
|
+
onSelect: () => void copy("mcp"),
|
|
175
|
+
children: [/* @__PURE__ */ jsx(McpIcon, {}), /* @__PURE__ */ jsx(PageActionLabel, {
|
|
176
|
+
title: "Copy MCP server URL",
|
|
177
|
+
description: "Use these docs from any MCP client"
|
|
178
|
+
})]
|
|
179
|
+
})] })
|
|
180
|
+
]
|
|
181
|
+
}) })]
|
|
182
|
+
})
|
|
183
|
+
]
|
|
184
|
+
}), headerHost),
|
|
185
|
+
tocHost && createPortal(/* @__PURE__ */ jsxs("div", {
|
|
186
|
+
className: "aui-docs-toc-actions not-prose",
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ jsxs("button", {
|
|
189
|
+
type: "button",
|
|
190
|
+
onClick: () => void copy("page"),
|
|
191
|
+
disabled: copying,
|
|
192
|
+
children: [/* @__PURE__ */ jsx(Copy, { "aria-hidden": "true" }), copying ? "Copying..." : "Copy page"]
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ jsxs("a", {
|
|
195
|
+
href: markdownUrl,
|
|
196
|
+
target: "_blank",
|
|
197
|
+
rel: "noreferrer noopener",
|
|
198
|
+
children: [/* @__PURE__ */ jsx(FileText, { "aria-hidden": "true" }), "View as Markdown"]
|
|
199
|
+
}),
|
|
200
|
+
githubUrl && /* @__PURE__ */ jsxs("a", {
|
|
201
|
+
href: githubUrl,
|
|
202
|
+
target: "_blank",
|
|
203
|
+
rel: "noreferrer noopener",
|
|
204
|
+
children: [/* @__PURE__ */ jsx(Pencil, { "aria-hidden": "true" }), "Edit on GitHub"]
|
|
205
|
+
})
|
|
206
|
+
]
|
|
207
|
+
}), tocHost),
|
|
208
|
+
/* @__PURE__ */ jsx("output", {
|
|
209
|
+
className: "aui-docs-action-status",
|
|
210
|
+
"aria-live": "polite",
|
|
211
|
+
children: message && /* @__PURE__ */ jsxs("span", { children: [message.startsWith("Could not") ? /* @__PURE__ */ jsx(CircleAlert, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Check, { "aria-hidden": "true" }), message] })
|
|
212
|
+
})
|
|
213
|
+
] });
|
|
214
|
+
};
|
|
215
|
+
const DocsPageContent = ({ children, name, github, editUrl, mcpUrl, footer }) => {
|
|
216
|
+
const pathname = usePathname().replace(/\/$/, "");
|
|
217
|
+
const { root } = useTreeContext();
|
|
218
|
+
const { previous, next, current } = getPageNeighbors(root.children, pathname);
|
|
219
|
+
const title = current?.name;
|
|
220
|
+
const markdownUrl = `${pathname}.md${new URL(current?.url ?? pathname, "https://docs.local").search}`;
|
|
221
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
222
|
+
className: "aui-docs-page-content",
|
|
223
|
+
children: [
|
|
224
|
+
/* @__PURE__ */ jsx(DocsPageControls, {
|
|
225
|
+
pathname,
|
|
226
|
+
markdownUrl,
|
|
227
|
+
title: typeof title === "string" ? title : name,
|
|
228
|
+
siteName: name,
|
|
229
|
+
editUrl: editUrl ?? getEditUrl(pathname, github),
|
|
230
|
+
mcpUrl,
|
|
231
|
+
previous,
|
|
232
|
+
next
|
|
233
|
+
}, markdownUrl),
|
|
234
|
+
/* @__PURE__ */ jsx("div", {
|
|
235
|
+
className: "aui-docs-page-body",
|
|
236
|
+
children
|
|
237
|
+
}),
|
|
238
|
+
(previous || next) && /* @__PURE__ */ jsxs("nav", {
|
|
239
|
+
className: "aui-docs-page-navigation not-prose",
|
|
240
|
+
"aria-label": "Page navigation",
|
|
241
|
+
children: [previous ? /* @__PURE__ */ jsxs(Link, {
|
|
242
|
+
href: previous.url,
|
|
243
|
+
rel: "prev",
|
|
244
|
+
children: [/* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true" }), /* @__PURE__ */ jsxs("span", { children: [previous.section && /* @__PURE__ */ jsxs("span", {
|
|
245
|
+
className: "aui-docs-page-section",
|
|
246
|
+
children: [
|
|
247
|
+
previous.section,
|
|
248
|
+
" /",
|
|
249
|
+
" "
|
|
250
|
+
]
|
|
251
|
+
}), previous.name] })]
|
|
252
|
+
}) : /* @__PURE__ */ jsx("span", {}), next ? /* @__PURE__ */ jsxs(Link, {
|
|
253
|
+
href: next.url,
|
|
254
|
+
rel: "next",
|
|
255
|
+
children: [/* @__PURE__ */ jsxs("span", { children: [next.section && /* @__PURE__ */ jsxs("span", {
|
|
256
|
+
className: "aui-docs-page-section",
|
|
257
|
+
children: [
|
|
258
|
+
next.section,
|
|
259
|
+
" /",
|
|
260
|
+
" "
|
|
261
|
+
]
|
|
262
|
+
}), next.name] }), /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" })]
|
|
263
|
+
}) : /* @__PURE__ */ jsx("span", {})]
|
|
264
|
+
}),
|
|
265
|
+
footer && /* @__PURE__ */ jsx("footer", {
|
|
266
|
+
className: "aui-docs-legal-footer not-prose",
|
|
267
|
+
children: footer
|
|
268
|
+
})
|
|
269
|
+
]
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
export { DocsPageContent };
|
|
273
|
+
|
|
274
|
+
//# sourceMappingURL=page-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-content.js","names":[],"sources":["../src/page-content.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n useEffect,\n useRef,\n useState,\n useSyncExternalStore,\n type ReactNode,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport Link from \"next/link\";\nimport { usePathname } from \"next/navigation\";\nimport * as DropdownMenu from \"@radix-ui/react-dropdown-menu\";\nimport { useTreeContext } from \"fumadocs-ui/contexts/tree\";\nimport { useTOCItems } from \"fumadocs-ui/components/toc\";\nimport {\n Check,\n CircleAlert,\n ChevronLeft,\n ChevronRight,\n Copy,\n FileText,\n MoreHorizontal,\n Pencil,\n} from \"lucide-react\";\nimport { ClaudeIcon, McpIcon, OpenAIIcon } from \"./action-icons\";\n\nimport { getEditUrl, getPageNeighbors } from \"./navigation\";\nimport type { createDocsLayout } from \"./next\";\n\ntype PageLink = getPageNeighbors.Link;\n\nconst documentSubscribers = new Set<() => void>();\nlet documentObserver: MutationObserver | undefined;\n\nconst subscribeToDocument = (onChange: () => void) => {\n documentSubscribers.add(onChange);\n if (!documentObserver) {\n documentObserver = new MutationObserver(() => {\n for (const subscriber of documentSubscribers) subscriber();\n });\n documentObserver.observe(document.body, { childList: true, subtree: true });\n }\n return () => {\n documentSubscribers.delete(onChange);\n if (documentSubscribers.size === 0) {\n documentObserver?.disconnect();\n documentObserver = undefined;\n }\n };\n};\n\nconst useDocumentElement = (selector: string | null) =>\n useSyncExternalStore(\n subscribeToDocument,\n () => (selector ? document.querySelector<HTMLElement>(selector) : null),\n () => null,\n );\n\nconst subscribeToOrigin = () => () => {};\nconst getOrigin = () => window.location.origin;\nconst getServerOrigin = () => \"\";\n\nconst PageActionLabel = ({\n title,\n description,\n}: {\n title: string;\n description: string;\n}) => (\n <span className=\"aui-docs-action-label\">\n <span>{title}</span>\n <span>{description}</span>\n </span>\n);\n\nconst DocsPageControls = ({\n previous,\n next,\n title,\n pathname,\n markdownUrl,\n siteName,\n editUrl,\n mcpUrl,\n}: {\n previous: PageLink | undefined;\n next: PageLink | undefined;\n title: string;\n pathname: string;\n markdownUrl: string;\n siteName: string;\n editUrl: string | undefined;\n mcpUrl: string | undefined;\n}) => {\n const toc = useTOCItems();\n // The upstream Farming Labs and Fumadocs layouts supply these portal hosts.\n const headerHost = useDocumentElement(\"#nd-page .fd-generated-page-header\");\n const tocHost = useDocumentElement(toc.length > 0 ? \"#nd-toc\" : null);\n const [message, setMessage] = useState(\"\");\n const [copying, setCopying] = useState(false);\n const origin = useSyncExternalStore(\n subscribeToOrigin,\n getOrigin,\n getServerOrigin,\n );\n const markdown = useRef<Promise<string> | null>(null);\n const githubUrl = editUrl?.replaceAll(\"{path}\", pathname);\n const publishedUrl = `${origin}${markdownUrl}`;\n const claudeUrl = `https://claude.ai/new?q=${encodeURIComponent(`Read ${publishedUrl} (the ${siteName} documentation page \"${title}\") so I can ask questions about it.`)}`;\n\n const loadMarkdown = () => {\n markdown.current ??= fetch(markdownUrl)\n .then((response) => {\n if (!response.ok) throw new Error(\"Could not load this page\");\n return response.text();\n })\n .catch((error: unknown) => {\n markdown.current = null;\n throw error;\n });\n return markdown.current;\n };\n\n const copy = async (kind: \"page\" | \"mcp\") => {\n setCopying(true);\n try {\n const text =\n kind === \"page\"\n ? await loadMarkdown()\n : new URL(mcpUrl ?? \"\", window.location.origin).href;\n await navigator.clipboard.writeText(text);\n setMessage(kind === \"page\" ? \"Page copied\" : \"MCP server URL copied\");\n } catch {\n setMessage(\"Could not copy. Please try again.\");\n } finally {\n setCopying(false);\n }\n };\n\n useEffect(() => {\n if (!message) return;\n const timer = window.setTimeout(() => setMessage(\"\"), 3000);\n return () => window.clearTimeout(timer);\n }, [message]);\n\n return (\n <>\n {headerHost &&\n createPortal(\n <nav\n className=\"aui-docs-page-controls not-prose\"\n aria-label=\"Page controls\"\n >\n {previous ? (\n <Link\n href={previous.url}\n className=\"aui-docs-pager-button\"\n aria-label=\"Previous page\"\n title={\n typeof previous.name === \"string\" ||\n typeof previous.name === \"number\"\n ? `Previous: ${previous.name}`\n : \"Previous page\"\n }\n >\n <ChevronLeft aria-hidden=\"true\" />\n </Link>\n ) : (\n <button\n className=\"aui-docs-pager-button\"\n aria-label=\"Previous page\"\n disabled\n >\n <ChevronLeft aria-hidden=\"true\" />\n </button>\n )}\n {next ? (\n <Link\n href={next.url}\n className=\"aui-docs-pager-button\"\n aria-label=\"Next page\"\n title={\n typeof next.name === \"string\" || typeof next.name === \"number\"\n ? `Next: ${next.name}`\n : \"Next page\"\n }\n >\n <ChevronRight aria-hidden=\"true\" />\n </Link>\n ) : (\n <button\n className=\"aui-docs-pager-button\"\n aria-label=\"Next page\"\n disabled\n >\n <ChevronRight aria-hidden=\"true\" />\n </button>\n )}\n <DropdownMenu.Root\n onOpenChange={(open) => {\n if (open) void loadMarkdown().catch(() => {});\n }}\n >\n <DropdownMenu.Trigger\n className=\"aui-docs-pager-button\"\n aria-label=\"More page actions\"\n >\n <MoreHorizontal aria-hidden=\"true\" />\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n className=\"aui-docs-actions-menu\"\n align=\"end\"\n sideOffset={4}\n collisionPadding={16}\n >\n <DropdownMenu.Item\n className=\"aui-docs-actions-menu-item\"\n disabled={copying}\n onSelect={() => void copy(\"page\")}\n >\n <Copy aria-hidden=\"true\" />\n <PageActionLabel\n title={copying ? \"Copying...\" : \"Copy page\"}\n description=\"Markdown, ready to paste into an LLM\"\n />\n </DropdownMenu.Item>\n <DropdownMenu.Item\n className=\"aui-docs-actions-menu-item\"\n asChild\n >\n <a\n href={markdownUrl}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n >\n <FileText aria-hidden=\"true\" />\n <PageActionLabel\n title=\"View as Markdown\"\n description=\"This page as plain text\"\n />\n </a>\n </DropdownMenu.Item>\n <DropdownMenu.Item\n className=\"aui-docs-actions-menu-item\"\n asChild\n >\n <a\n href={claudeUrl}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n >\n <ClaudeIcon />\n <PageActionLabel\n title=\"Open in Claude\"\n description=\"Ask Claude about this page\"\n />\n </a>\n </DropdownMenu.Item>\n <DropdownMenu.Item\n className=\"aui-docs-actions-menu-item\"\n asChild\n >\n <a\n href=\"https://chatgpt.com/codex/\"\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n >\n <OpenAIIcon />\n <PageActionLabel\n title=\"Open in Codex\"\n description=\"Open Codex in ChatGPT\"\n />\n </a>\n </DropdownMenu.Item>\n {mcpUrl && (\n <>\n <DropdownMenu.Separator className=\"aui-docs-actions-menu-separator\" />\n <DropdownMenu.Item\n className=\"aui-docs-actions-menu-item\"\n onSelect={() => void copy(\"mcp\")}\n >\n <McpIcon />\n <PageActionLabel\n title=\"Copy MCP server URL\"\n description=\"Use these docs from any MCP client\"\n />\n </DropdownMenu.Item>\n </>\n )}\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n </nav>,\n headerHost,\n )}\n {tocHost &&\n createPortal(\n <div className=\"aui-docs-toc-actions not-prose\">\n <button\n type=\"button\"\n onClick={() => void copy(\"page\")}\n disabled={copying}\n >\n <Copy aria-hidden=\"true\" />\n {copying ? \"Copying...\" : \"Copy page\"}\n </button>\n <a href={markdownUrl} target=\"_blank\" rel=\"noreferrer noopener\">\n <FileText aria-hidden=\"true\" />\n View as Markdown\n </a>\n {githubUrl && (\n <a href={githubUrl} target=\"_blank\" rel=\"noreferrer noopener\">\n <Pencil aria-hidden=\"true\" />\n Edit on GitHub\n </a>\n )}\n </div>,\n tocHost,\n )}\n <output className=\"aui-docs-action-status\" aria-live=\"polite\">\n {message && (\n <span>\n {message.startsWith(\"Could not\") ? (\n <CircleAlert aria-hidden=\"true\" />\n ) : (\n <Check aria-hidden=\"true\" />\n )}\n {message}\n </span>\n )}\n </output>\n </>\n );\n};\n\nexport const DocsPageContent = ({\n children,\n name,\n github,\n editUrl,\n mcpUrl,\n footer,\n}: {\n children: ReactNode;\n name: string;\n github: getEditUrl.Options | undefined;\n editUrl: string | undefined;\n mcpUrl: string | undefined;\n footer: createDocsLayout.Options[\"footer\"];\n}) => {\n const pathname = usePathname().replace(/\\/$/, \"\");\n const { root } = useTreeContext();\n const { previous, next, current } = getPageNeighbors(root.children, pathname);\n const title = current?.name;\n const pageUrl = new URL(current?.url ?? pathname, \"https://docs.local\");\n const markdownUrl = `${pathname}.md${pageUrl.search}`;\n\n return (\n <div className=\"aui-docs-page-content\">\n <DocsPageControls\n key={markdownUrl}\n pathname={pathname}\n markdownUrl={markdownUrl}\n title={typeof title === \"string\" ? title : name}\n siteName={name}\n editUrl={editUrl ?? getEditUrl(pathname, github)}\n mcpUrl={mcpUrl}\n previous={previous}\n next={next}\n />\n <div className=\"aui-docs-page-body\">{children}</div>\n {(previous || next) && (\n <nav\n className=\"aui-docs-page-navigation not-prose\"\n aria-label=\"Page navigation\"\n >\n {previous ? (\n <Link href={previous.url} rel=\"prev\">\n <ChevronLeft aria-hidden=\"true\" />\n <span>\n {previous.section && (\n <span className=\"aui-docs-page-section\">\n {previous.section} /{\" \"}\n </span>\n )}\n {previous.name}\n </span>\n </Link>\n ) : (\n <span />\n )}\n {next ? (\n <Link href={next.url} rel=\"next\">\n <span>\n {next.section && (\n <span className=\"aui-docs-page-section\">\n {next.section} /{\" \"}\n </span>\n )}\n {next.name}\n </span>\n <ChevronRight aria-hidden=\"true\" />\n </Link>\n ) : (\n <span />\n )}\n </nav>\n )}\n {footer && (\n <footer className=\"aui-docs-legal-footer not-prose\">{footer}</footer>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAgCA,MAAM,sCAAsB,IAAI,IAAgB;AAChD,IAAI;AAEJ,MAAM,uBAAuB,aAAyB;CACpD,oBAAoB,IAAI,QAAQ;CAChC,IAAI,CAAC,kBAAkB;EACrB,mBAAmB,IAAI,uBAAuB;GAC5C,KAAK,MAAM,cAAc,qBAAqB,WAAW;EAC3D,CAAC;EACD,iBAAiB,QAAQ,SAAS,MAAM;GAAE,WAAW;GAAM,SAAS;EAAK,CAAC;CAC5E;CACA,aAAa;EACX,oBAAoB,OAAO,QAAQ;EACnC,IAAI,oBAAoB,SAAS,GAAG;GAClC,kBAAkB,WA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
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RootProvider } from "@farming-labs/theme";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/site/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../../src/site/constants.ts"],"sourcesContent":["export const DOCS_SIDEBAR_WIDTH = 260;\n"],"mappings":";AAAA,MAAa,qBAAqB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
type FooterItem = {
|
|
3
|
+
name: ReactNode;
|
|
4
|
+
url: string;
|
|
5
|
+
section?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
type DocsFooterProps = {
|
|
8
|
+
previous?: FooterItem | undefined;
|
|
9
|
+
next?: FooterItem | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare function DocsFooter({ previous, next }: DocsFooterProps): import("react").JSX.Element | null;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=footer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../src/site/footer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,QAAQ,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAClC,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,eAAe,sCA2C7D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
4
|
+
// src/site/footer.tsx
|
|
5
|
+
function DocsFooter({ previous, next }) {
|
|
6
|
+
if (!previous && !next) return null;
|
|
7
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
8
|
+
"aria-label": "Previous and next page",
|
|
9
|
+
className: "not-prose mt-16 flex items-center justify-between gap-4 text-sm",
|
|
10
|
+
children: [previous ? /* @__PURE__ */ jsxs(Link, {
|
|
11
|
+
href: previous.url,
|
|
12
|
+
className: "group text-muted-foreground hover:text-foreground inline-flex min-w-0 items-center gap-1.5 transition-colors",
|
|
13
|
+
children: [/* @__PURE__ */ jsx(ChevronLeft, { className: "size-4 shrink-0 transition-transform group-hover:-translate-x-0.5" }), /* @__PURE__ */ jsxs("span", {
|
|
14
|
+
className: "min-w-0 truncate",
|
|
15
|
+
children: [previous.section ? /* @__PURE__ */ jsxs("span", {
|
|
16
|
+
className: "opacity-60",
|
|
17
|
+
children: [previous.section, " / "]
|
|
18
|
+
}) : null, previous.name]
|
|
19
|
+
})]
|
|
20
|
+
}) : /* @__PURE__ */ jsx("span", {}), next ? /* @__PURE__ */ jsxs(Link, {
|
|
21
|
+
href: next.url,
|
|
22
|
+
className: "group text-muted-foreground hover:text-foreground inline-flex min-w-0 items-center gap-1.5 transition-colors",
|
|
23
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
24
|
+
className: "min-w-0 truncate",
|
|
25
|
+
children: [next.section ? /* @__PURE__ */ jsxs("span", {
|
|
26
|
+
className: "opacity-60",
|
|
27
|
+
children: [next.section, " / "]
|
|
28
|
+
}) : null, next.name]
|
|
29
|
+
}), /* @__PURE__ */ jsx(ChevronRight, { className: "size-4 shrink-0 transition-transform group-hover:translate-x-0.5" })]
|
|
30
|
+
}) : /* @__PURE__ */ jsx("span", {})]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export { DocsFooter };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","names":[],"sources":["../../src/site/footer.tsx"],"sourcesContent":["import Link from \"next/link\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\n\ntype FooterItem = {\n name: ReactNode;\n url: string;\n section?: ReactNode;\n};\n\ntype DocsFooterProps = {\n previous?: FooterItem | undefined;\n next?: FooterItem | undefined;\n};\n\nexport function DocsFooter({ previous, next }: DocsFooterProps) {\n if (!previous && !next) return null;\n\n return (\n <nav\n aria-label=\"Previous and next page\"\n className=\"not-prose mt-16 flex items-center justify-between gap-4 text-sm\"\n >\n {previous ? (\n <Link\n href={previous.url}\n className=\"group text-muted-foreground hover:text-foreground inline-flex min-w-0 items-center gap-1.5 transition-colors\"\n >\n <ChevronLeft className=\"size-4 shrink-0 transition-transform group-hover:-translate-x-0.5\" />\n <span className=\"min-w-0 truncate\">\n {previous.section ? (\n <span className=\"opacity-60\">{previous.section} / </span>\n ) : null}\n {previous.name}\n </span>\n </Link>\n ) : (\n <span />\n )}\n\n {next ? (\n <Link\n href={next.url}\n className=\"group text-muted-foreground hover:text-foreground inline-flex min-w-0 items-center gap-1.5 transition-colors\"\n >\n <span className=\"min-w-0 truncate\">\n {next.section ? (\n <span className=\"opacity-60\">{next.section} / </span>\n ) : null}\n {next.name}\n </span>\n <ChevronRight className=\"size-4 shrink-0 transition-transform group-hover:translate-x-0.5\" />\n </Link>\n ) : (\n <span />\n )}\n </nav>\n );\n}\n"],"mappings":";;;;AAeA,SAAgB,WAAW,EAAE,UAAU,QAAyB;CAC9D,IAAI,CAAC,YAAY,CAAC,MAAM,OAAO;CAE/B,OACE,qBAAC,OAAD;EACE,cAAW;EACX,WAAU;EAFZ,UAAA,CAIG,WACC,qBAAC,MAAD;GACE,MAAM,SAAS;GACf,WAAU;GAFZ,UAAA,CAIE,oBAAC,aAAD,EAAa,WAAU,oEAAqE,CAAA,GAC5F,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACG,SAAS,UACR,qBAAC,QAAD;KAAM,WAAU;KAAhB,UAAA,CAA8B,SAAS,SAAQ,KAAS;IACtD,CAAA,IAAA,MACH,SAAS,IACN;GACF,CAAA,CAAA;EAEN,CAAA,IAAA,oBAAC,QAAD,CAAO,CAAA,GAGR,OACC,qBAAC,MAAD;GACE,MAAM,KAAK;GACX,WAAU;GAFZ,UAAA,CAIE,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACG,KAAK,UACJ,qBAAC,QAAD;KAAM,WAAU;KAAhB,UAAA,CAA8B,KAAK,SAAQ,KAAS;IAClD,CAAA,IAAA,MACH,KAAK,IACF;GACN,CAAA,GAAA,oBAAC,cAAD,EAAc,WAAU,mEAAoE,CAAA,CACxF;EAEN,CAAA,IAAA,oBAAC,QAAD,CAAO,CAAA,CAEN;;AAET"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
+
export declare function DocsSiteHeader({ brand, mobileControls, condensedNavigation, desktopNavigation, mobileNavigation, navigationRoot: NavigationRoot, scrolled, }: {
|
|
3
|
+
brand: ReactNode;
|
|
4
|
+
mobileControls: ReactNode;
|
|
5
|
+
condensedNavigation: ReactNode;
|
|
6
|
+
desktopNavigation: ReactNode;
|
|
7
|
+
mobileNavigation: (close: () => void) => ReactNode;
|
|
8
|
+
navigationRoot: ComponentType<{
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}>;
|
|
11
|
+
scrolled: boolean;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/site/header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EAAE,cAAc,EAC9B,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,SAAS,CAAC;IACjB,cAAc,EAAE,SAAS,CAAC;IAC1B,mBAAmB,EAAE,SAAS,CAAC;IAC/B,iBAAiB,EAAE,SAAS,CAAC;IAC7B,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC;IACnD,cAAc,EAAE,aAAa,CAAC;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACvD,QAAQ,EAAE,OAAO,CAAC;CACnB,+BAuFA"}
|