@vercel/geistdocs 1.2.3-canary.a12a9c6 → 1.2.3-canary.fd2c9a6
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/config.d.ts +46 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/footer.d.ts +8 -0
- package/dist/footer.d.ts.map +1 -0
- package/dist/footer.js +6 -0
- package/dist/home-layout.d.ts +11 -0
- package/dist/home-layout.d.ts.map +1 -0
- package/dist/home-layout.js +31 -0
- package/dist/internal/config-context.d.ts +10 -0
- package/dist/internal/config-context.d.ts.map +1 -0
- package/dist/internal/config-context.js +15 -0
- package/dist/internal/footer/github-button.d.ts +7 -0
- package/dist/internal/footer/github-button.d.ts.map +1 -0
- package/dist/internal/footer/github-button.js +10 -0
- package/dist/internal/footer/rss-button.d.ts +2 -0
- package/dist/internal/footer/rss-button.d.ts.map +1 -0
- package/dist/internal/footer/rss-button.js +4 -0
- package/dist/internal/navbar/desktop-menu.d.ts +10 -0
- package/dist/internal/navbar/desktop-menu.d.ts.map +1 -0
- package/dist/internal/navbar/desktop-menu.js +11 -0
- package/dist/internal/navbar/mobile-menu.d.ts +7 -0
- package/dist/internal/navbar/mobile-menu.d.ts.map +1 -0
- package/dist/internal/navbar/mobile-menu.js +40 -0
- package/dist/internal/navbar/navbar-logo.d.ts +16 -0
- package/dist/internal/navbar/navbar-logo.d.ts.map +1 -0
- package/dist/internal/navbar/navbar-logo.js +30 -0
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +12 -1
- package/dist/internal/page-visibility.d.ts +18 -0
- package/dist/internal/page-visibility.d.ts.map +1 -0
- package/dist/internal/page-visibility.js +24 -0
- package/dist/internal/provider-client.d.ts +1 -1
- package/dist/internal/provider-client.d.ts.map +1 -1
- package/dist/internal/provider-client.js +2 -1
- package/dist/internal/sidebar.js +1 -1
- package/dist/internal/ui/button.d.ts +1 -1
- package/dist/internal/ui/navigation-menu.d.ts +17 -0
- package/dist/internal/ui/navigation-menu.d.ts.map +1 -0
- package/dist/internal/ui/navigation-menu.js +38 -0
- package/dist/internal/ui/sonner.js +3 -3
- package/dist/mdx.d.ts +11 -0
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +8 -0
- package/dist/mobile-docs-bar.d.ts +7 -0
- package/dist/mobile-docs-bar.d.ts.map +1 -0
- package/dist/mobile-docs-bar.js +13 -0
- package/dist/navbar.d.ts +7 -0
- package/dist/navbar.d.ts.map +1 -0
- package/dist/navbar.js +10 -0
- package/dist/pages/docs.d.ts +2 -1
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +7 -2
- package/dist/proxy.d.ts +1 -1
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +28 -2
- package/dist/routes/agents.d.ts +21 -0
- package/dist/routes/agents.d.ts.map +1 -0
- package/dist/routes/agents.js +201 -0
- package/dist/routes/chat.d.ts.map +1 -1
- package/dist/routes/chat.js +12 -3
- package/dist/routes/llms.d.ts +6 -5
- package/dist/routes/llms.d.ts.map +1 -1
- package/dist/routes/llms.js +63 -12
- package/dist/routes/search.d.ts +6 -4
- package/dist/routes/search.d.ts.map +1 -1
- package/dist/routes/search.js +8 -1
- package/dist/routes/sitemap.d.ts +6 -3
- package/dist/routes/sitemap.d.ts.map +1 -1
- package/dist/routes/sitemap.js +10 -2
- package/dist/source.d.ts +8 -1
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +14 -1
- package/dist/versions.d.ts.map +1 -1
- package/dist/versions.js +34 -16
- package/package.json +23 -3
- package/template/AGENTS.md +69 -0
- package/template/app/[lang]/(home)/layout.tsx +4 -3
- package/template/app/[lang]/agents.md/route.ts +6 -0
- package/template/app/[lang]/docs/[[...slug]]/page.tsx +1 -1
- package/template/app/[lang]/layout.tsx +6 -6
- package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +1 -1
- package/template/app/[lang]/sitemap.md/route.ts +2 -2
- package/template/app/api/search/route.ts +2 -2
- package/template/content/docs/agent-readiness.mdx +103 -0
- package/template/content/docs/configuration.mdx +40 -1
- package/template/content/docs/index.mdx +1 -0
- package/template/content/docs/llms-txt.mdx +1 -0
- package/template/content/docs/md.mdx +2 -1
- package/template/content/docs/meta.json +1 -0
- package/template/content/docs/proxy.mdx +10 -1
- package/template/content/docs/theme-aware-image.mdx +1 -1
- package/template/geistdocs.tsx +26 -0
- package/template/lib/geistdocs/config.tsx +3 -0
- package/template/package.json +3 -3
- package/template/proxy.ts +0 -1
- package/template/source.config.ts +8 -0
- package/template/app/actions/feedback/emotions.ts +0 -18
- package/template/app/actions/feedback/index.ts +0 -45
- package/template/components/geistdocs/chat.tsx +0 -24
- package/template/components/geistdocs/desktop-menu.tsx +0 -52
- package/template/components/geistdocs/feedback.tsx +0 -139
- package/template/components/geistdocs/footer.tsx +0 -30
- package/template/components/geistdocs/github-button.tsx +0 -19
- package/template/components/geistdocs/home-layout.tsx +0 -46
- package/template/components/geistdocs/language-selector.tsx +0 -3
- package/template/components/geistdocs/mobile-docs-bar.tsx +0 -77
- package/template/components/geistdocs/mobile-menu.tsx +0 -150
- package/template/components/geistdocs/navbar-logo.tsx +0 -124
- package/template/components/geistdocs/navbar.tsx +0 -22
- package/template/components/geistdocs/rss-button.tsx +0 -10
- package/template/components/geistdocs/search.tsx +0 -17
- package/template/components/geistdocs/sidebar.tsx +0 -128
- package/template/components/geistdocs/theme-aware-image.tsx +0 -22
- package/template/components/geistdocs/theme-toggle.tsx +0 -3
- package/template/components/ui/card.tsx +0 -92
- package/template/components/ui/dialog.tsx +0 -143
- package/template/components/ui/input-group.tsx +0 -170
- package/template/components/ui/input.tsx +0 -21
- package/template/components/ui/navigation-menu.tsx +0 -192
- package/template/components/ui/popover.tsx +0 -48
- package/template/components/ui/separator.tsx +0 -28
- package/template/components/ui/sheet.tsx +0 -139
- package/template/components/ui/textarea.tsx +0 -18
- package/template/hooks/geistdocs/use-sidebar.ts +0 -13
- package/template/hooks/use-mobile.ts +0 -19
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { SiVercel } from "@icons-pack/react-simple-icons";
|
|
2
|
-
import { GitHubButton } from "./github-button";
|
|
3
|
-
import { LanguageSelector } from "./language-selector";
|
|
4
|
-
import { RSSButton } from "./rss-button";
|
|
5
|
-
import { ThemeToggle } from "./theme-toggle";
|
|
6
|
-
|
|
7
|
-
interface FooterProps {
|
|
8
|
-
copyright?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const Footer = ({
|
|
12
|
-
copyright = `Copyright Vercel ${new Date().getFullYear()}. All rights reserved.`,
|
|
13
|
-
}: FooterProps) => (
|
|
14
|
-
<footer className="border-t px-4 py-5 md:px-6">
|
|
15
|
-
<div className="mx-auto flex max-w-[1448px] flex-col items-center justify-between gap-4 sm:flex-row">
|
|
16
|
-
<div className="flex items-center gap-2">
|
|
17
|
-
<SiVercel className="size-4 shrink-0" />
|
|
18
|
-
<p className="text-center text-gray-800 text-sm sm:text-left">
|
|
19
|
-
{copyright}
|
|
20
|
-
</p>
|
|
21
|
-
</div>
|
|
22
|
-
<div className="flex items-center gap-2">
|
|
23
|
-
<LanguageSelector />
|
|
24
|
-
<RSSButton />
|
|
25
|
-
<GitHubButton />
|
|
26
|
-
<ThemeToggle />
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</footer>
|
|
30
|
-
);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SiGithub } from "@icons-pack/react-simple-icons";
|
|
2
|
-
import { github } from "@/geistdocs";
|
|
3
|
-
import { Button } from "../ui/button";
|
|
4
|
-
|
|
5
|
-
export const GitHubButton = () => {
|
|
6
|
-
if (!(github.owner && github.repo)) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const url = `https://github.com/${github.owner}/${github.repo}`;
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<Button asChild size="icon-sm" type="button" variant="ghost">
|
|
14
|
-
<a href={url} rel="noopener" target="_blank">
|
|
15
|
-
<SiGithub className="size-4" />
|
|
16
|
-
</a>
|
|
17
|
-
</Button>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { DocsLayout as FumadocsDocsLayout } from "fumadocs-ui/layouts/docs";
|
|
2
|
-
import type { ComponentProps, CSSProperties, ReactNode } from "react";
|
|
3
|
-
import { i18n } from "@/lib/geistdocs/i18n";
|
|
4
|
-
import { Folder, Item, Separator, Sidebar } from "./sidebar";
|
|
5
|
-
|
|
6
|
-
interface HomeLayoutProps {
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
tree: ComponentProps<typeof FumadocsDocsLayout>["tree"];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const HomeLayout = ({ tree, children }: HomeLayoutProps) => (
|
|
12
|
-
<FumadocsDocsLayout
|
|
13
|
-
containerProps={{
|
|
14
|
-
className: "p-0! max-w-full mx-0 [&_[data-sidebar-placeholder]]:hidden",
|
|
15
|
-
style: {
|
|
16
|
-
display: "flex",
|
|
17
|
-
flexDirection: "column",
|
|
18
|
-
"--fd-docs-row-1": "4rem",
|
|
19
|
-
} as CSSProperties,
|
|
20
|
-
}}
|
|
21
|
-
i18n={i18n}
|
|
22
|
-
nav={{
|
|
23
|
-
enabled: false,
|
|
24
|
-
}}
|
|
25
|
-
searchToggle={{
|
|
26
|
-
enabled: false,
|
|
27
|
-
}}
|
|
28
|
-
sidebar={{
|
|
29
|
-
className: "md:hidden",
|
|
30
|
-
collapsible: false,
|
|
31
|
-
component: <Sidebar />,
|
|
32
|
-
components: {
|
|
33
|
-
Folder,
|
|
34
|
-
Item,
|
|
35
|
-
Separator,
|
|
36
|
-
},
|
|
37
|
-
}}
|
|
38
|
-
tabMode="auto"
|
|
39
|
-
themeSwitch={{
|
|
40
|
-
enabled: false,
|
|
41
|
-
}}
|
|
42
|
-
tree={tree}
|
|
43
|
-
>
|
|
44
|
-
{children}
|
|
45
|
-
</FumadocsDocsLayout>
|
|
46
|
-
);
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { IconFileText } from "@vercel/geistdocs/assets/icons/icon-file-text";
|
|
4
|
-
import { IconMenuAlt } from "@vercel/geistdocs/assets/icons/icon-menu-alt";
|
|
5
|
-
import { useGeistdocsSidebar } from "@vercel/geistdocs/sidebar";
|
|
6
|
-
import type { TableOfContents } from "fumadocs-core/toc";
|
|
7
|
-
import { useState } from "react";
|
|
8
|
-
import {
|
|
9
|
-
Sheet,
|
|
10
|
-
SheetContent,
|
|
11
|
-
SheetDescription,
|
|
12
|
-
SheetHeader,
|
|
13
|
-
} from "@/components/ui/sheet";
|
|
14
|
-
import { cn } from "@/lib/utils";
|
|
15
|
-
|
|
16
|
-
interface MobileDocsBarProps {
|
|
17
|
-
toc?: TableOfContents;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const MobileDocsBar = ({ toc }: MobileDocsBarProps) => {
|
|
21
|
-
const { setIsOpen: setSidebarOpen } = useGeistdocsSidebar();
|
|
22
|
-
const [tocOpen, setTocOpen] = useState(false);
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<div className="sticky top-16 z-30 -mx-6 -mt-6 mb-6 flex h-[54px] items-center justify-between border-b bg-background-100 px-6 md:hidden">
|
|
26
|
-
<button
|
|
27
|
-
className="flex items-center gap-3 text-base text-gray-1000"
|
|
28
|
-
onClick={() => setSidebarOpen(true)}
|
|
29
|
-
type="button"
|
|
30
|
-
>
|
|
31
|
-
<IconMenuAlt size={16} />
|
|
32
|
-
Menu
|
|
33
|
-
</button>
|
|
34
|
-
|
|
35
|
-
{toc && toc.length > 0 && (
|
|
36
|
-
<>
|
|
37
|
-
<button
|
|
38
|
-
aria-label="Table of contents"
|
|
39
|
-
className="flex size-8 items-center justify-center rounded-md border border-gray-200 text-gray-900 transition-colors hover:bg-gray-100 hover:text-gray-1000"
|
|
40
|
-
onClick={() => setTocOpen(true)}
|
|
41
|
-
type="button"
|
|
42
|
-
>
|
|
43
|
-
<IconFileText size={16} />
|
|
44
|
-
</button>
|
|
45
|
-
|
|
46
|
-
<Sheet onOpenChange={setTocOpen} open={tocOpen}>
|
|
47
|
-
<SheetContent className="w-72 gap-0" side="right">
|
|
48
|
-
<SheetHeader>
|
|
49
|
-
<SheetDescription className="sr-only">
|
|
50
|
-
Table of contents for the current page.
|
|
51
|
-
</SheetDescription>
|
|
52
|
-
</SheetHeader>
|
|
53
|
-
<nav className="flex-1 overflow-y-auto px-4 pb-4">
|
|
54
|
-
<ul className="space-y-1">
|
|
55
|
-
{toc.map((item) => (
|
|
56
|
-
<li key={item.url}>
|
|
57
|
-
<a
|
|
58
|
-
className={cn(
|
|
59
|
-
"block rounded-md py-1.5 text-gray-900 text-sm transition-colors hover:text-gray-1000",
|
|
60
|
-
item.depth > 2 && "pl-4"
|
|
61
|
-
)}
|
|
62
|
-
href={item.url}
|
|
63
|
-
onClick={() => setTocOpen(false)}
|
|
64
|
-
>
|
|
65
|
-
{item.title}
|
|
66
|
-
</a>
|
|
67
|
-
</li>
|
|
68
|
-
))}
|
|
69
|
-
</ul>
|
|
70
|
-
</nav>
|
|
71
|
-
</SheetContent>
|
|
72
|
-
</Sheet>
|
|
73
|
-
</>
|
|
74
|
-
)}
|
|
75
|
-
</div>
|
|
76
|
-
);
|
|
77
|
-
};
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { IconArrowUpRight } from "@vercel/geistdocs/assets/icons/icon-arrow-up-right";
|
|
4
|
-
import Link from "next/link";
|
|
5
|
-
import { useEffect, useState } from "react";
|
|
6
|
-
import { nav } from "@/geistdocs";
|
|
7
|
-
import { cn } from "@/lib/utils";
|
|
8
|
-
import { SearchButton } from "./search";
|
|
9
|
-
|
|
10
|
-
function NavLink({
|
|
11
|
-
href,
|
|
12
|
-
external,
|
|
13
|
-
onClick,
|
|
14
|
-
children,
|
|
15
|
-
}: {
|
|
16
|
-
href: string;
|
|
17
|
-
external?: boolean;
|
|
18
|
-
onClick?: () => void;
|
|
19
|
-
children: React.ReactNode;
|
|
20
|
-
}) {
|
|
21
|
-
return (
|
|
22
|
-
<Link
|
|
23
|
-
className="group flex items-center justify-between rounded-md p-3 text-gray-900 transition-colors hover:bg-gray-100 hover:text-gray-1000"
|
|
24
|
-
href={href}
|
|
25
|
-
onClick={onClick}
|
|
26
|
-
rel={external ? "noopener" : undefined}
|
|
27
|
-
target={external ? "_blank" : undefined}
|
|
28
|
-
>
|
|
29
|
-
{children}
|
|
30
|
-
{external && (
|
|
31
|
-
<IconArrowUpRight
|
|
32
|
-
className="text-gray-900 group-hover:text-gray-1000"
|
|
33
|
-
size={16}
|
|
34
|
-
/>
|
|
35
|
-
)}
|
|
36
|
-
</Link>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function MobileMenuButton({
|
|
41
|
-
expanded,
|
|
42
|
-
onClick,
|
|
43
|
-
}: {
|
|
44
|
-
expanded: boolean;
|
|
45
|
-
onClick: () => void;
|
|
46
|
-
}) {
|
|
47
|
-
return (
|
|
48
|
-
<button
|
|
49
|
-
aria-expanded={expanded}
|
|
50
|
-
aria-label={expanded ? "Close menu" : "Open menu"}
|
|
51
|
-
className="relative flex size-8 items-center justify-center rounded-full border border-gray-200 transition-colors hover:bg-gray-100 lg:hidden"
|
|
52
|
-
onClick={onClick}
|
|
53
|
-
type="button"
|
|
54
|
-
>
|
|
55
|
-
<span className="flex flex-col items-center justify-center gap-[5px]">
|
|
56
|
-
<span
|
|
57
|
-
className={cn(
|
|
58
|
-
"block h-[1.5px] w-3.5 bg-gray-1000 transition-all duration-150",
|
|
59
|
-
expanded && "translate-y-[3.25px] rotate-45"
|
|
60
|
-
)}
|
|
61
|
-
/>
|
|
62
|
-
<span
|
|
63
|
-
className={cn(
|
|
64
|
-
"block h-[1.5px] w-3.5 bg-gray-1000 transition-all duration-150",
|
|
65
|
-
expanded && "-translate-y-[3.25px] -rotate-45"
|
|
66
|
-
)}
|
|
67
|
-
/>
|
|
68
|
-
</span>
|
|
69
|
-
</button>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export const MobileMenu = () => {
|
|
74
|
-
const [show, setShow] = useState(false);
|
|
75
|
-
|
|
76
|
-
// Close on route change
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
setShow(false);
|
|
79
|
-
}, []);
|
|
80
|
-
|
|
81
|
-
// Close on escape
|
|
82
|
-
useEffect(() => {
|
|
83
|
-
const handleEscape = (e: KeyboardEvent) => {
|
|
84
|
-
if (e.key === "Escape" && show) {
|
|
85
|
-
setShow(false);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
document.addEventListener("keydown", handleEscape);
|
|
89
|
-
return () => document.removeEventListener("keydown", handleEscape);
|
|
90
|
-
}, [show]);
|
|
91
|
-
|
|
92
|
-
// Lock scroll when open
|
|
93
|
-
useEffect(() => {
|
|
94
|
-
document.body.style.overflow = show ? "hidden" : "";
|
|
95
|
-
return () => {
|
|
96
|
-
document.body.style.overflow = "";
|
|
97
|
-
};
|
|
98
|
-
}, [show]);
|
|
99
|
-
|
|
100
|
-
const close = () => setShow(false);
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<>
|
|
104
|
-
<MobileMenuButton expanded={show} onClick={() => setShow(!show)} />
|
|
105
|
-
|
|
106
|
-
{/* Backdrop */}
|
|
107
|
-
{/* biome-ignore lint/a11y/noNoninteractiveElementInteractions: backdrop dismiss */}
|
|
108
|
-
{/* biome-ignore lint/a11y/noStaticElementInteractions: backdrop dismiss */}
|
|
109
|
-
{/* biome-ignore lint/a11y/useKeyWithClickEvents: backdrop dismiss */}
|
|
110
|
-
<div
|
|
111
|
-
className={cn(
|
|
112
|
-
"fixed inset-0 top-16 z-40 bg-background-200 backdrop-blur-sm transition-opacity duration-200",
|
|
113
|
-
show
|
|
114
|
-
? "pointer-events-auto opacity-100"
|
|
115
|
-
: "pointer-events-none opacity-0"
|
|
116
|
-
)}
|
|
117
|
-
onClick={close}
|
|
118
|
-
/>
|
|
119
|
-
|
|
120
|
-
{/* Popover */}
|
|
121
|
-
<div
|
|
122
|
-
className={cn(
|
|
123
|
-
"fixed inset-x-0 top-16 bottom-0 z-40 overflow-y-auto bg-background-200 px-2 transition-all duration-200",
|
|
124
|
-
show
|
|
125
|
-
? "translate-y-0 opacity-100"
|
|
126
|
-
: "pointer-events-none -translate-y-2 opacity-0"
|
|
127
|
-
)}
|
|
128
|
-
>
|
|
129
|
-
{/* Search */}
|
|
130
|
-
<div className="p-4">
|
|
131
|
-
<SearchButton className="w-full" onClick={close} />
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
{/* Navigation */}
|
|
135
|
-
<nav className="px-1">
|
|
136
|
-
{nav.map(({ label, href }) => (
|
|
137
|
-
<NavLink
|
|
138
|
-
external={href.startsWith("http")}
|
|
139
|
-
href={href}
|
|
140
|
-
key={href}
|
|
141
|
-
onClick={close}
|
|
142
|
-
>
|
|
143
|
-
{label}
|
|
144
|
-
</NavLink>
|
|
145
|
-
))}
|
|
146
|
-
</nav>
|
|
147
|
-
</div>
|
|
148
|
-
</>
|
|
149
|
-
);
|
|
150
|
-
};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { IconSlashForward } from "@vercel/geistdocs/assets/icons/icon-slash-forward";
|
|
4
|
-
import { LogoAiElements } from "@vercel/geistdocs/assets/logos/logo-ai-elements";
|
|
5
|
-
import { LogoAiSdk } from "@vercel/geistdocs/assets/logos/logo-ai-sdk";
|
|
6
|
-
import { LogoChatSdk } from "@vercel/geistdocs/assets/logos/logo-chat-sdk";
|
|
7
|
-
import { LogoFlagsSdk } from "@vercel/geistdocs/assets/logos/logo-flags-sdk";
|
|
8
|
-
import { LogoIconVercel } from "@vercel/geistdocs/assets/logos/logo-icon-vercel";
|
|
9
|
-
import { LogoStreamdown } from "@vercel/geistdocs/assets/logos/logo-streamdown";
|
|
10
|
-
import { LogoVercelOss } from "@vercel/geistdocs/assets/logos/logo-vercel-oss";
|
|
11
|
-
import { LogoWorkflowSdk } from "@vercel/geistdocs/assets/logos/logo-workflow-sdk";
|
|
12
|
-
import Link from "next/link";
|
|
13
|
-
import type { ComponentType, ReactNode } from "react";
|
|
14
|
-
import {
|
|
15
|
-
NavigationMenu,
|
|
16
|
-
NavigationMenuContent,
|
|
17
|
-
NavigationMenuItem,
|
|
18
|
-
NavigationMenuLink,
|
|
19
|
-
NavigationMenuList,
|
|
20
|
-
NavigationMenuTrigger,
|
|
21
|
-
} from "@/components/ui/navigation-menu";
|
|
22
|
-
import { cn } from "@/lib/utils";
|
|
23
|
-
|
|
24
|
-
const OSS_PRODUCT_LINKS: {
|
|
25
|
-
href: string;
|
|
26
|
-
logo: ComponentType<{ height: number }>;
|
|
27
|
-
height: number;
|
|
28
|
-
}[] = [
|
|
29
|
-
{ href: "https://ai-sdk.dev/", logo: LogoAiSdk, height: 12 },
|
|
30
|
-
{ href: "https://flags-sdk.dev/", logo: LogoFlagsSdk, height: 20 },
|
|
31
|
-
{ href: "https://chat-sdk.dev/", logo: LogoChatSdk, height: 20 },
|
|
32
|
-
{ href: "https://elements.ai-sdk.dev/", logo: LogoAiElements, height: 12 },
|
|
33
|
-
{ href: "https://workflow-sdk.dev/", logo: LogoWorkflowSdk, height: 12 },
|
|
34
|
-
{ href: "https://streamdown.ai/", logo: LogoStreamdown, height: 13 },
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
type NavbarLogoProps = {
|
|
38
|
-
className?: string;
|
|
39
|
-
/** Where the logo links to (defaults to "/") */
|
|
40
|
-
href?: string;
|
|
41
|
-
} & (
|
|
42
|
-
| {
|
|
43
|
-
variant: "oss";
|
|
44
|
-
/** Logo shown in the trigger (e.g. LogoAiSdk) */
|
|
45
|
-
logo: ReactNode;
|
|
46
|
-
}
|
|
47
|
-
| {
|
|
48
|
-
variant?: "standard";
|
|
49
|
-
/** Logo shown after the slash (e.g. product name) */
|
|
50
|
-
logo: ReactNode;
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
export function NavbarLogo({
|
|
55
|
-
className,
|
|
56
|
-
href = "/",
|
|
57
|
-
...props
|
|
58
|
-
}: NavbarLogoProps) {
|
|
59
|
-
const isOss = props.variant === "oss";
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<span className={cn("flex items-center gap-2.5", className)}>
|
|
63
|
-
<Link
|
|
64
|
-
className="text-gray-1000"
|
|
65
|
-
href={isOss ? "https://vercel.com/oss" : "https://vercel.com/"}
|
|
66
|
-
rel="noopener"
|
|
67
|
-
target="_blank"
|
|
68
|
-
>
|
|
69
|
-
{isOss ? (
|
|
70
|
-
<>
|
|
71
|
-
<LogoIconVercel className="sm:hidden" size={20} />
|
|
72
|
-
<LogoVercelOss className="hidden sm:block" size={18} />
|
|
73
|
-
</>
|
|
74
|
-
) : (
|
|
75
|
-
<LogoIconVercel size={20} />
|
|
76
|
-
)}
|
|
77
|
-
</Link>
|
|
78
|
-
<div className="w-4 text-center text-gray-alpha-400 text-lg dark:text-gray-600">
|
|
79
|
-
<IconSlashForward />
|
|
80
|
-
</div>
|
|
81
|
-
{isOss ? (
|
|
82
|
-
<NavigationMenu viewportClassName="-left-5 top-4">
|
|
83
|
-
<NavigationMenuList>
|
|
84
|
-
<NavigationMenuItem className="flex items-center">
|
|
85
|
-
<NavigationMenuTrigger className="-m-3 flex items-center gap-1.5 p-3">
|
|
86
|
-
<Link
|
|
87
|
-
className="flex items-center text-gray-1000"
|
|
88
|
-
href={href}
|
|
89
|
-
onClick={(e) => e.stopPropagation()}
|
|
90
|
-
>
|
|
91
|
-
{props.logo}
|
|
92
|
-
</Link>
|
|
93
|
-
</NavigationMenuTrigger>
|
|
94
|
-
<NavigationMenuContent>
|
|
95
|
-
<ul className="grid w-[200px] gap-0.5 p-2">
|
|
96
|
-
{OSS_PRODUCT_LINKS.map(
|
|
97
|
-
({ href, logo: ProductLogo, height }) => (
|
|
98
|
-
<li key={href}>
|
|
99
|
-
<NavigationMenuLink asChild>
|
|
100
|
-
<Link
|
|
101
|
-
className="flex h-10 items-center gap-3 rounded-md px-3 py-2.5 text-gray-1000 text-sm outline-none transition-colors hover:bg-gray-100"
|
|
102
|
-
href={href}
|
|
103
|
-
rel="noopener"
|
|
104
|
-
target="_blank"
|
|
105
|
-
>
|
|
106
|
-
<ProductLogo height={height} />
|
|
107
|
-
</Link>
|
|
108
|
-
</NavigationMenuLink>
|
|
109
|
-
</li>
|
|
110
|
-
)
|
|
111
|
-
)}
|
|
112
|
-
</ul>
|
|
113
|
-
</NavigationMenuContent>
|
|
114
|
-
</NavigationMenuItem>
|
|
115
|
-
</NavigationMenuList>
|
|
116
|
-
</NavigationMenu>
|
|
117
|
-
) : (
|
|
118
|
-
<Link className="flex items-center text-gray-1000" href={href}>
|
|
119
|
-
{props.logo}
|
|
120
|
-
</Link>
|
|
121
|
-
)}
|
|
122
|
-
</span>
|
|
123
|
-
);
|
|
124
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { basePath, Logo, nav, suggestions } from "@/geistdocs";
|
|
2
|
-
import { Chat } from "./chat";
|
|
3
|
-
import { DesktopMenu } from "./desktop-menu";
|
|
4
|
-
import { MobileMenu } from "./mobile-menu";
|
|
5
|
-
import { NavbarLogo } from "./navbar-logo";
|
|
6
|
-
import { SearchButton } from "./search";
|
|
7
|
-
|
|
8
|
-
export const Navbar = () => (
|
|
9
|
-
<header className="sticky top-0 z-40 flex h-16 justify-center border-b bg-background-200">
|
|
10
|
-
<div className="mx-auto flex w-full max-w-[1448px] justify-between px-2">
|
|
11
|
-
<div className="flex select-none flex-row items-center">
|
|
12
|
-
<NavbarLogo className="ml-4" logo={<Logo />} variant="oss" />
|
|
13
|
-
<DesktopMenu className="hidden pl-6 lg:flex" items={nav} />
|
|
14
|
-
</div>
|
|
15
|
-
<div className="mr-4 flex flex-row items-center justify-end gap-2">
|
|
16
|
-
<SearchButton className="hidden lg:flex" />
|
|
17
|
-
<Chat basePath={basePath} suggestions={suggestions} />
|
|
18
|
-
<MobileMenu />
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</header>
|
|
22
|
-
);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RssIcon } from "lucide-react";
|
|
2
|
-
import { Button } from "../ui/button";
|
|
3
|
-
|
|
4
|
-
export const RSSButton = () => (
|
|
5
|
-
<Button asChild size="icon-sm" type="button" variant="ghost">
|
|
6
|
-
<a href="/rss.xml" rel="noopener" target="_blank">
|
|
7
|
-
<RssIcon className="size-4" />
|
|
8
|
-
</a>
|
|
9
|
-
</Button>
|
|
10
|
-
);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { SearchButton as PackageSearchButton } from "@vercel/geistdocs/controls";
|
|
4
|
-
import type { ComponentProps } from "react";
|
|
5
|
-
import { cn } from "@/lib/utils";
|
|
6
|
-
|
|
7
|
-
type SearchButtonProps = ComponentProps<typeof PackageSearchButton>;
|
|
8
|
-
|
|
9
|
-
export const SearchButton = ({ className, ...props }: SearchButtonProps) => (
|
|
10
|
-
<PackageSearchButton
|
|
11
|
-
className={cn(
|
|
12
|
-
"group h-10 justify-between gap-8 pr-1.5 font-normal text-gray-800 shadow-none lg:h-8 lg:w-[150px] lg:bg-background-200 hover:lg:bg-background-200 [&_[data-slot=kbd]]:transition-colors group-hover:[&_[data-slot=kbd]]:text-gray-1000",
|
|
13
|
-
className
|
|
14
|
-
)}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
);
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import type { Node } from "fumadocs-core/page-tree";
|
|
4
|
-
import {
|
|
5
|
-
SidebarFolder,
|
|
6
|
-
SidebarFolderContent,
|
|
7
|
-
SidebarFolderLink,
|
|
8
|
-
SidebarFolderTrigger,
|
|
9
|
-
SidebarItem,
|
|
10
|
-
SidebarSeparator,
|
|
11
|
-
} from "fumadocs-ui/components/sidebar/base";
|
|
12
|
-
import type { SidebarPageTreeComponents } from "fumadocs-ui/components/sidebar/page-tree";
|
|
13
|
-
import { useTreeContext, useTreePath } from "fumadocs-ui/contexts/tree";
|
|
14
|
-
import { usePathname } from "next/navigation";
|
|
15
|
-
import { Fragment, useEffect, useRef } from "react";
|
|
16
|
-
import {
|
|
17
|
-
Sheet,
|
|
18
|
-
SheetContent,
|
|
19
|
-
SheetDescription,
|
|
20
|
-
SheetHeader,
|
|
21
|
-
SheetTitle,
|
|
22
|
-
} from "@/components/ui/sheet";
|
|
23
|
-
import { useSidebarContext } from "@/hooks/geistdocs/use-sidebar";
|
|
24
|
-
import { SearchButton } from "./search";
|
|
25
|
-
|
|
26
|
-
export const Sidebar = () => {
|
|
27
|
-
const { root } = useTreeContext();
|
|
28
|
-
const { isOpen, setIsOpen } = useSidebarContext();
|
|
29
|
-
const pathname = usePathname();
|
|
30
|
-
const previousPathname = useRef(pathname);
|
|
31
|
-
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (pathname !== previousPathname.current) {
|
|
34
|
-
setIsOpen(false);
|
|
35
|
-
previousPathname.current = pathname;
|
|
36
|
-
}
|
|
37
|
-
}, [pathname, setIsOpen]);
|
|
38
|
-
|
|
39
|
-
const renderSidebarList = (items: Node[]) =>
|
|
40
|
-
items.map((item) => {
|
|
41
|
-
if (item.type === "separator") {
|
|
42
|
-
return <Separator item={item} key={item.$id} />;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (item.type === "folder") {
|
|
46
|
-
const children = renderSidebarList(item.children);
|
|
47
|
-
return (
|
|
48
|
-
<Folder item={item} key={item.$id}>
|
|
49
|
-
{children}
|
|
50
|
-
</Folder>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return <Item item={item} key={item.$id} />;
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<div
|
|
59
|
-
className="pointer-events-none sticky top-(--fd-docs-row-1) z-20 h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] [grid-area:sidebar] *:pointer-events-auto max-md:hidden md:layout:[--fd-sidebar-width:268px]"
|
|
60
|
-
data-sidebar-placeholder
|
|
61
|
-
>
|
|
62
|
-
<div className="h-full overflow-y-auto px-4 pt-12 pb-4">
|
|
63
|
-
<Fragment key={root.$id}>{renderSidebarList(root.children)}</Fragment>
|
|
64
|
-
</div>
|
|
65
|
-
<Sheet onOpenChange={setIsOpen} open={isOpen}>
|
|
66
|
-
<SheetContent className="gap-0" side="left">
|
|
67
|
-
<SheetHeader className="mt-8">
|
|
68
|
-
<SheetTitle className="sr-only">Mobile Menu</SheetTitle>
|
|
69
|
-
<SheetDescription className="sr-only">
|
|
70
|
-
Navigation for the documentation.
|
|
71
|
-
</SheetDescription>
|
|
72
|
-
<SearchButton onClick={() => setIsOpen(false)} />
|
|
73
|
-
</SheetHeader>
|
|
74
|
-
<div className="flex-1 overflow-y-auto px-4 pb-4">
|
|
75
|
-
{renderSidebarList(root.children)}
|
|
76
|
-
</div>
|
|
77
|
-
</SheetContent>
|
|
78
|
-
</Sheet>
|
|
79
|
-
</div>
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const Folder: SidebarPageTreeComponents["Folder"] = ({
|
|
84
|
-
children,
|
|
85
|
-
item,
|
|
86
|
-
}) => {
|
|
87
|
-
const path = useTreePath();
|
|
88
|
-
const defaultOpen = item.defaultOpen ?? path.includes(item);
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<SidebarFolder defaultOpen={defaultOpen}>
|
|
92
|
-
{item.index ? (
|
|
93
|
-
<SidebarFolderLink
|
|
94
|
-
className="flex items-center gap-2 text-pretty py-1.5 text-gray-800 text-sm transition-colors hover:text-gray-1000 data-[active=true]:text-gray-1000 [&_svg]:size-3.5"
|
|
95
|
-
external={item.index.external}
|
|
96
|
-
href={item.index.url}
|
|
97
|
-
>
|
|
98
|
-
{item.icon}
|
|
99
|
-
{item.name}
|
|
100
|
-
</SidebarFolderLink>
|
|
101
|
-
) : (
|
|
102
|
-
<SidebarFolderTrigger className="flex items-center gap-2 text-pretty py-1.5 text-gray-800 text-sm transition-colors hover:text-gray-1000 [&_svg]:size-3.5">
|
|
103
|
-
{item.icon}
|
|
104
|
-
{item.name}
|
|
105
|
-
</SidebarFolderTrigger>
|
|
106
|
-
)}
|
|
107
|
-
<SidebarFolderContent className="ml-2">{children}</SidebarFolderContent>
|
|
108
|
-
</SidebarFolder>
|
|
109
|
-
);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export const Item: SidebarPageTreeComponents["Item"] = ({ item }) => (
|
|
113
|
-
<SidebarItem
|
|
114
|
-
className="block w-full truncate text-pretty py-1.5 text-gray-800 text-sm transition-colors hover:text-gray-1000 data-[active=true]:text-gray-1000"
|
|
115
|
-
external={item.external}
|
|
116
|
-
href={item.url}
|
|
117
|
-
icon={item.icon}
|
|
118
|
-
>
|
|
119
|
-
{item.name}
|
|
120
|
-
</SidebarItem>
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
export const Separator: SidebarPageTreeComponents["Separator"] = ({ item }) => (
|
|
124
|
-
<SidebarSeparator className="mt-4 mb-2 flex items-center gap-2 px-0 font-medium text-sm first-child:mt-0">
|
|
125
|
-
{item.icon}
|
|
126
|
-
{item.name}
|
|
127
|
-
</SidebarSeparator>
|
|
128
|
-
);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import Image from "next/image";
|
|
4
|
-
import { useTheme } from "next-themes";
|
|
5
|
-
import type { ComponentProps } from "react";
|
|
6
|
-
|
|
7
|
-
type ImageProps = ComponentProps<typeof Image>;
|
|
8
|
-
|
|
9
|
-
type ThemeAwareImageProps = Omit<ImageProps, "src"> & {
|
|
10
|
-
src: {
|
|
11
|
-
light: ImageProps["src"];
|
|
12
|
-
dark: ImageProps["src"];
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const ThemeAwareImage = ({ src, ...props }: ThemeAwareImageProps) => {
|
|
17
|
-
const { resolvedTheme } = useTheme();
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<Image {...props} src={resolvedTheme === "dark" ? src.dark : src.light} />
|
|
21
|
-
);
|
|
22
|
-
};
|