@vercel/geistdocs 2.12.5 → 2.13.1-canary.dd9d47d

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.
Files changed (86) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/config.d.ts +18 -4
  3. package/dist/config.d.ts.map +1 -1
  4. package/dist/footer.js +1 -1
  5. package/dist/internal/chat/session.d.ts +2 -3
  6. package/dist/internal/chat/session.d.ts.map +1 -1
  7. package/dist/internal/chat/session.js +28 -4
  8. package/dist/internal/chat/shell.js +2 -2
  9. package/dist/internal/eve-agent-session.d.ts +5 -7
  10. package/dist/internal/eve-agent-session.d.ts.map +1 -1
  11. package/dist/internal/eve-agent-session.js +5 -8
  12. package/dist/internal/eve-agent.d.ts +11 -3
  13. package/dist/internal/eve-agent.d.ts.map +1 -1
  14. package/dist/internal/eve-agent.js +19 -4
  15. package/dist/internal/languages.d.ts +22 -1
  16. package/dist/internal/languages.d.ts.map +1 -1
  17. package/dist/internal/languages.js +32 -0
  18. package/dist/internal/lazy-search.d.ts +13 -0
  19. package/dist/internal/lazy-search.d.ts.map +1 -0
  20. package/dist/internal/lazy-search.js +61 -0
  21. package/dist/internal/navbar/desktop-menu.d.ts.map +1 -1
  22. package/dist/internal/navbar/desktop-menu.js +4 -4
  23. package/dist/internal/navbar/mobile-menu.d.ts.map +1 -1
  24. package/dist/internal/navbar/mobile-menu.js +4 -4
  25. package/dist/internal/navbar/use-nav-active.d.ts +12 -5
  26. package/dist/internal/navbar/use-nav-active.d.ts.map +1 -1
  27. package/dist/internal/navbar/use-nav-active.js +30 -14
  28. package/dist/internal/provider-client.d.ts +1 -1
  29. package/dist/internal/provider-client.d.ts.map +1 -1
  30. package/dist/internal/provider-client.js +2 -2
  31. package/dist/internal/sidebar.d.ts +3 -1
  32. package/dist/internal/sidebar.d.ts.map +1 -1
  33. package/dist/internal/sidebar.js +8 -8
  34. package/dist/layout.d.ts +7 -1
  35. package/dist/layout.d.ts.map +1 -1
  36. package/dist/layout.js +2 -2
  37. package/dist/mdx.d.ts +1 -44
  38. package/dist/mdx.d.ts.map +1 -1
  39. package/dist/mdx.js +4 -4
  40. package/dist/navbar.d.ts +1 -1
  41. package/dist/navbar.d.ts.map +1 -1
  42. package/dist/navbar.js +3 -1
  43. package/dist/pages/changelog.d.ts +7 -4
  44. package/dist/pages/changelog.d.ts.map +1 -1
  45. package/dist/pages/changelog.js +6 -4
  46. package/dist/pages/docs.d.ts +4 -2
  47. package/dist/pages/docs.d.ts.map +1 -1
  48. package/dist/pages/docs.js +15 -3
  49. package/dist/providers/public/components/toasts.d.ts +4 -4
  50. package/dist/providers/public/components/toasts.d.ts.map +1 -1
  51. package/dist/providers/public/components/toasts.js +50 -14
  52. package/dist/proxy.d.ts +1 -1
  53. package/dist/proxy.d.ts.map +1 -1
  54. package/dist/proxy.js +12 -1
  55. package/dist/routes/agents.d.ts +1 -1
  56. package/dist/routes/agents.d.ts.map +1 -1
  57. package/dist/routes/agents.js +4 -3
  58. package/dist/routes/changelog.d.ts +19 -10
  59. package/dist/routes/changelog.d.ts.map +1 -1
  60. package/dist/routes/changelog.js +11 -11
  61. package/dist/routes/chat.d.ts.map +1 -1
  62. package/dist/routes/chat.js +21 -4
  63. package/dist/routes/llms.d.ts +10 -5
  64. package/dist/routes/llms.d.ts.map +1 -1
  65. package/dist/routes/llms.js +10 -5
  66. package/dist/routes/mcp.d.ts +1 -1
  67. package/dist/routes/mcp.d.ts.map +1 -1
  68. package/dist/routes/mcp.js +2 -1
  69. package/dist/routes/openapi.d.ts +1 -1
  70. package/dist/routes/openapi.d.ts.map +1 -1
  71. package/dist/routes/openapi.js +12 -5
  72. package/dist/routes/sitemap.d.ts +5 -5
  73. package/dist/routes/sitemap.d.ts.map +1 -1
  74. package/dist/routes/sitemap.js +4 -9
  75. package/dist/source.d.ts +6 -1
  76. package/dist/source.d.ts.map +1 -1
  77. package/dist/source.js +1 -0
  78. package/docs/agents.md +1 -1
  79. package/docs/llms.txt +11 -3
  80. package/docs/manifest.json +1 -1
  81. package/docs/pages/ask-ai.md +5 -1
  82. package/docs/pages/configuration.md +5 -1
  83. package/package.json +7 -7
  84. package/template/content/docs/ask-ai.mdx +5 -1
  85. package/template/content/docs/configuration.mdx +5 -1
  86. package/template/package.json +1 -1
@@ -34,8 +34,8 @@ function SubNavLink({ active, children, external, href, onClick, }) {
34
34
  * collapsible: uppercase section headings when items declare sections, a
35
35
  * flat list when none do.
36
36
  */
37
- function NavDropdownCollapsible({ dropdown, onLinkClick, }) {
38
- const isActive = useNavActive();
37
+ function NavDropdownCollapsible({ dropdown, navItems, onLinkClick, }) {
38
+ const isActive = useNavActive(navItems);
39
39
  const sections = groupDropdownItems(dropdown);
40
40
  const flat = sections.length === 1 && sections[0].heading === dropdown.label;
41
41
  const renderItems = (items) => items.map((item) => {
@@ -57,7 +57,7 @@ function MobileMenuButton({ expanded, onClick, }) {
57
57
  const MobileMenuState = ({ activeProduct, githubUrl, nav, ossProducts, showOss = false, }) => {
58
58
  const isDesktop = useMediaQuery("(min-width: 1024px)");
59
59
  const [show, setShow] = useState(false);
60
- const isActive = useNavActive();
60
+ const isActive = useNavActive(nav);
61
61
  // Resolve the default/custom list and drop the active product here on the
62
62
  // client, where `DEFAULT_OSS_PRODUCTS` is a real array (see resolveOssProducts).
63
63
  const products = showOss
@@ -122,6 +122,6 @@ const MobileMenuState = ({ activeProduct, githubUrl, nav, ossProducts, showOss =
122
122
  const close = () => setShow(false);
123
123
  return (_jsxs(_Fragment, { children: [_jsx(MobileMenuButton, { expanded: show, onClick: () => setShow(!show) }), _jsx("div", { className: cn("fixed inset-0 top-16 z-40 @min-[1024px]:hidden bg-background-200", show
124
124
  ? "pointer-events-auto opacity-100"
125
- : "pointer-events-none opacity-0"), onClick: close }), _jsxs("div", { className: cn("fixed inset-x-0 top-16 bottom-0 z-40 @min-[1024px]:hidden overflow-y-auto bg-background-200 px-2", show ? "opacity-100" : "pointer-events-none opacity-0"), children: [_jsx("div", { className: "p-4", children: _jsx(SearchButton, { className: "w-full py-4.5", onClick: close }) }), _jsxs("nav", { className: "flex flex-col px-1", children: [nav.map((item) => "items" in item ? (_jsx(NavDropdownCollapsible, { dropdown: item, onLinkClick: close }, item.label)) : (_jsx(NavLink, { active: isActive(item.href), external: item.href.startsWith("http"), href: item.href, onClick: close, children: item.label }, item.href))), githubUrl ? (_jsx(NavLink, { external: true, href: githubUrl, onClick: close, children: "GitHub" })) : null, _jsx(OssCollapsible, { onLinkClick: close, sections: ossSections })] }), _jsx("div", { className: "mt-2 flex justify-end px-4 py-4", children: _jsx(ThemeSwitcher, { small: true }) })] })] }));
125
+ : "pointer-events-none opacity-0"), onClick: close }), _jsxs("div", { className: cn("fixed inset-x-0 top-16 bottom-0 z-40 @min-[1024px]:hidden overflow-y-auto bg-background-200 px-2", show ? "opacity-100" : "pointer-events-none opacity-0"), children: [_jsx("div", { className: "p-4", children: _jsx(SearchButton, { className: "w-full py-4.5", onClick: close }) }), _jsxs("nav", { className: "flex flex-col px-1", children: [nav.map((item) => "items" in item ? (_jsx(NavDropdownCollapsible, { dropdown: item, navItems: nav, onLinkClick: close }, item.label)) : (_jsx(NavLink, { active: isActive(item.href), external: item.href.startsWith("http"), href: item.href, onClick: close, children: item.label }, item.href))), githubUrl ? (_jsx(NavLink, { external: true, href: githubUrl, onClick: close, children: "GitHub" })) : null, _jsx(OssCollapsible, { onLinkClick: close, sections: ossSections })] }), _jsx("div", { className: "mt-2 flex justify-end px-4 py-4", children: _jsx(ThemeSwitcher, { small: true }) })] })] }));
126
126
  };
127
127
  export const MobileMenu = (props) => (_jsx(MobileMenuState, { ...props }, usePathname()));
@@ -1,8 +1,15 @@
1
+ import type { GeistdocsNavItem } from "../../config";
1
2
  /**
2
- * Returns a predicate that reports whether a top-level nav item matches the
3
- * current page. External links are never active. Internal links are active
4
- * when the current path equals the item's href or is nested beneath it, so a
5
- * top-level section stays highlighted while browsing its sub-pages.
3
+ * The href of the most specific nav item that matches the path: the path
4
+ * equals the href or is nested beneath it. External links never match. When
5
+ * nav items nest (`/docs` and `/docs/lib`), only the longest match is active,
6
+ * so `/docs/lib/models` highlights `/docs/lib` rather than both.
6
7
  */
7
- export declare const useNavActive: () => (href: string) => boolean;
8
+ export declare const getActiveNavHref: (pathname: string, hrefs: readonly string[]) => string | undefined;
9
+ /**
10
+ * Returns a predicate that reports whether a nav item is the active one for
11
+ * the current page. A section stays highlighted while browsing its
12
+ * sub-pages, unless a more specific nav item matches.
13
+ */
14
+ export declare const useNavActive: (items: readonly GeistdocsNavItem[]) => (href: string) => boolean;
8
15
  //# sourceMappingURL=use-nav-active.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-nav-active.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/use-nav-active.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,eAAO,MAAM,YAAY,SAYf,MAAM,MAAM,YAWrB,CAAC"}
1
+ {"version":3,"file":"use-nav-active.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/use-nav-active.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AASrD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,MAAM,EAChB,OAAO,SAAS,MAAM,EAAE,KACvB,MAAM,GAAG,SAeX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,SAAS,gBAAgB,EAAE,MAarD,MAAM,MAAM,YACrB,CAAC"}
@@ -1,12 +1,35 @@
1
1
  "use client";
2
2
  import { useParams, usePathname } from "next/navigation";
3
+ const getNavHrefs = (items) => items.flatMap((item) => "items" in item
4
+ ? item.items.filter((child) => !child.external).map((child) => child.href)
5
+ : [item.href]);
3
6
  /**
4
- * Returns a predicate that reports whether a top-level nav item matches the
5
- * current page. External links are never active. Internal links are active
6
- * when the current path equals the item's href or is nested beneath it, so a
7
- * top-level section stays highlighted while browsing its sub-pages.
7
+ * The href of the most specific nav item that matches the path: the path
8
+ * equals the href or is nested beneath it. External links never match. When
9
+ * nav items nest (`/docs` and `/docs/lib`), only the longest match is active,
10
+ * so `/docs/lib/models` highlights `/docs/lib` rather than both.
8
11
  */
9
- export const useNavActive = () => {
12
+ export const getActiveNavHref = (pathname, hrefs) => {
13
+ let active;
14
+ for (const href of hrefs) {
15
+ if (href.startsWith("http")) {
16
+ continue;
17
+ }
18
+ const matches = href === "/"
19
+ ? pathname === "/"
20
+ : pathname === href || pathname.startsWith(`${href}/`);
21
+ if (matches && (active === undefined || href.length > active.length)) {
22
+ active = href;
23
+ }
24
+ }
25
+ return active;
26
+ };
27
+ /**
28
+ * Returns a predicate that reports whether a nav item is the active one for
29
+ * the current page. A section stays highlighted while browsing its
30
+ * sub-pages, unless a more specific nav item matches.
31
+ */
32
+ export const useNavActive = (items) => {
10
33
  const pathname = usePathname();
11
34
  const params = useParams();
12
35
  const lang = typeof params.lang === "string" ? params.lang : null;
@@ -15,13 +38,6 @@ export const useNavActive = () => {
15
38
  const normalizedPath = lang && (pathname === `/${lang}` || pathname.startsWith(`/${lang}/`))
16
39
  ? pathname.slice(lang.length + 1) || "/"
17
40
  : pathname;
18
- return (href) => {
19
- if (href.startsWith("http")) {
20
- return false;
21
- }
22
- if (href === "/") {
23
- return normalizedPath === "/";
24
- }
25
- return normalizedPath === href || normalizedPath.startsWith(`${href}/`);
26
- };
41
+ const active = getActiveNavHref(normalizedPath, getNavHrefs(items));
42
+ return (href) => href === active;
27
43
  };
@@ -1,7 +1,7 @@
1
1
  import { RootProvider } from "fumadocs-ui/provider/next";
2
2
  import { type ComponentProps } from "react";
3
3
  import type { GeistdocsConfig } from "../config";
4
- import { GeistdocsSearchDialog } from "./search";
4
+ import type { GeistdocsSearchDialog } from "./search";
5
5
  type RootProviderSearch = NonNullable<ComponentProps<typeof RootProvider>["search"]>;
6
6
  export interface GeistdocsProviderProps extends Omit<ComponentProps<typeof RootProvider>, "search"> {
7
7
  config: GeistdocsConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"provider-client.d.ts","sourceRoot":"","sources":["../../src/internal/provider-client.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAKjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAUjD,KAAK,kBAAkB,GAAG,WAAW,CACnC,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC,QAAQ,CAAC,CAC9C,CAAC;AAEF,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,EAAE,QAAQ,CAAC;IAC3D,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG;QAC7C,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC;KACjE,CAAC;CACH;AAqGD,eAAO,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,4CAQ9D,CAAC"}
1
+ {"version":3,"file":"provider-client.d.ts","sourceRoot":"","sources":["../../src/internal/provider-client.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAMjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAUtD,KAAK,kBAAkB,GAAG,WAAW,CACnC,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC,QAAQ,CAAC,CAC9C,CAAC;AAEF,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,EAAE,QAAQ,CAAC;IAC3D,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG;QAC7C,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC;KACjE,CAAC;CACH;AAqGD,eAAO,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,4CAQ9D,CAAC"}
@@ -8,7 +8,7 @@ import { GeistdocsChatProvider, useGeistdocsChatContext } from "./chat/context";
8
8
  import { ChatLoadingSkeleton } from "./chat/loading-skeleton";
9
9
  import { GeistdocsConfigProvider } from "./config-context";
10
10
  import { createGeistdocsI18n } from "./i18n";
11
- import { GeistdocsSearchDialog } from "./search";
11
+ import { GeistdocsLazySearchDialog } from "./lazy-search";
12
12
  import { useIsMobile } from "./use-mobile";
13
13
  import { GeistdocsWebMCP } from "./webmcp-client";
14
14
  const GeistdocsChatShell = lazy(() => import("./chat/shell").then(({ GeistdocsChatShell: Component }) => ({
@@ -47,7 +47,7 @@ const GeistdocsProviderInner = ({ config, search, theme: _theme, lang, ...props
47
47
  }, [enabled, isExpanded, isMobile, isOpen, setIsExpanded, setIsOpen]);
48
48
  // fumadocs spreads the provider's `search.options` onto the dialog, which is
49
49
  // how a consumer reaches `tag`. Typed here so it survives the hand-off.
50
- const SearchDialogComponent = useCallback((searchProps) => (_jsx(GeistdocsSearchDialog, { basePath: config.basePath, ...searchProps })), [config.basePath]);
50
+ const SearchDialogComponent = useCallback((searchProps) => (_jsx(GeistdocsLazySearchDialog, { basePath: config.basePath, ...searchProps })), [config.basePath]);
51
51
  return (
52
52
  // Keyed on the <html> attribute rather than isOpen, so the open panel's
53
53
  // space is reserved before hydration too.
@@ -1,7 +1,9 @@
1
1
  import { type ReactNode } from "react";
2
2
  import { type GeistdocsSidebarMode } from "../sidebar";
3
- export declare const GeistdocsSidebar: ({ mode, showDesktop, top, }: {
3
+ export declare const GeistdocsSidebar: ({ mode, scrollToActive, showDesktop, top, }: {
4
4
  mode?: GeistdocsSidebarMode;
5
+ /** Scroll the desktop sidebar to reveal the current page on navigation. */
6
+ scrollToActive?: boolean;
5
7
  showDesktop?: boolean;
6
8
  top?: ReactNode;
7
9
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAgBf,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,YAAY,CAAC;AAi/B5E,eAAO,MAAM,gBAAgB,GAAI,6BAI9B;IACD,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,4CAiEA,CAAC"}
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAgBf,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,YAAY,CAAC;AAu/B5E,eAAO,MAAM,gBAAgB,GAAI,6CAK9B;IACD,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,2EAA2E;IAC3E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,4CAkEA,CAAC"}
@@ -213,9 +213,9 @@ const SidebarTree = ({ activeUrl, idScope, nodes, onNavigate, openFirstLevel = f
213
213
  useActiveItemScroll(listRef, activeUrl, scrollActive && visible, opened.join(":"), manualToggleRef);
214
214
  return (_jsx("ul", { className: "m-0 flex list-none flex-col gap-px p-0", ref: listRef, children: _jsx(SidebarTreeItems, { depth: 0, nodes: nodes, parentPath: [], state: state }) }));
215
215
  };
216
- const SidebarRootList = ({ activeSection, activeUrl, groups, onSelect, visible, }) => {
216
+ const SidebarRootList = ({ activeSection, activeUrl, groups, onSelect, scrollToActive, visible, }) => {
217
217
  const contentRef = useRef(null);
218
- useActiveItemScroll(contentRef, activeUrl, visible, activeSection?.$id ?? "root");
218
+ useActiveItemScroll(contentRef, activeUrl, scrollToActive && visible, activeSection?.$id ?? "root");
219
219
  return (_jsx("div", { className: "flex flex-col gap-4 px-2 pt-1 pb-2", ref: contentRef, children: groups.map((group) => (_jsxs("div", { className: "flex flex-col", children: [group.label || group.icon ? (_jsxs("div", { className: "flex items-center gap-2 px-2 pt-2 pb-1 font-medium text-gray-900 text-label-13 [&_svg]:size-4", children: [group.icon ? (_jsx("span", { className: "shrink-0", children: group.icon })) : null, _jsx("span", { className: "min-w-0 truncate", children: group.label })] })) : null, _jsx("ul", { className: "m-0 flex list-none flex-col gap-px p-0", children: group.items.map((section, index) => (_jsx(SidebarRootItem, { activeSection: activeSection, activeUrl: activeUrl, item: section, onSelect: onSelect }, getSidebarNodeId(section, [index])))) })] }, group.id))) }));
220
220
  };
221
221
  const SidebarRootItem = ({ activeSection, activeUrl, item, onSelect, }) => {
@@ -250,7 +250,7 @@ const SidebarRootItem = ({ activeSection, activeUrl, item, onSelect, }) => {
250
250
  return (_jsxs("li", { className: cn(separateDisclosure && "flex items-center gap-px"), children: [renderedItem, separateDisclosure ? (_jsx("button", { "aria-label": getRootDisclosureLabel(item.name), className: "grid size-8 flex-none cursor-pointer touch-manipulation place-content-center rounded-md bg-transparent p-0 text-gray-900 hover:bg-gray-100 focus-visible:bg-gray-100 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none motion-reduce:transition-none", onClick: (event) => onSelect(item, event.currentTarget), type: "button", children: _jsx(IconChevronRightSmall, { size: 16 }) })) : null] }));
251
251
  };
252
252
  const SidebarSectionHeader = ({ buttonRef, onBack, section, }) => (_jsx("div", { className: "mb-2 px-2 pt-1", children: _jsxs("button", { "aria-label": "Back to all documentation sections", className: "flex w-full cursor-pointer touch-manipulation flex-row items-center justify-between gap-1 rounded-md border-0 bg-transparent p-0 text-gray-900 hover:bg-gray-100 hover:text-gray-1000 focus-visible:bg-gray-100 focus-visible:text-gray-1000 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none motion-reduce:transition-none", onClick: onBack, ref: buttonRef, type: "button", children: [_jsx("span", { className: "grid size-9 flex-none place-content-center", children: _jsx(IconChevronRightSmall, { className: "rotate-180", size: 16 }) }), _jsx("span", { className: "flex min-w-0 flex-1 items-center justify-center text-button-14", children: _jsx("span", { className: "truncate", children: section.name }) }), _jsx("span", { className: "size-9 flex-none" })] }) }));
253
- const DesktopSectionsSidebar = ({ activeUrl, nodes, rootScope, top, }) => {
253
+ const DesktopSectionsSidebar = ({ activeUrl, nodes, rootScope, scrollToActive, top, }) => {
254
254
  const groups = useMemo(() => getSidebarRootGroups(nodes), [nodes]);
255
255
  const currentSection = useMemo(() => findActiveRootSection(nodes, activeUrl), [activeUrl, nodes]);
256
256
  const [selectedSection, setSelectedSection] = useState(null);
@@ -335,14 +335,14 @@ const DesktopSectionsSidebar = ({ activeUrl, nodes, rootScope, top, }) => {
335
335
  shouldFocusSectionRef.current = true;
336
336
  setSelectedSection(section);
337
337
  setView("section");
338
- }, visible: !rootHidden }) }), activeSection ? (_jsxs("div", { className: cn("geistdocs-sidebar-pane", sectionHidden &&
338
+ }, scrollToActive: scrollToActive, visible: !rootHidden }) }), activeSection ? (_jsxs("div", { className: cn("geistdocs-sidebar-pane", sectionHidden &&
339
339
  "pointer-events-none absolute inset-x-0 top-0 opacity-0 [transform:translateX(8px)] motion-reduce:invisible"), "data-sidebar-pane": "section", inert: sectionHidden || undefined, children: [_jsx(SidebarSectionHeader, { buttonRef: sectionHeaderRef, onBack: () => {
340
340
  shouldFocusRootRef.current = true;
341
341
  setSelectedSection(null);
342
342
  setView("root");
343
- }, section: activeSection }), _jsx("div", { className: "px-2", children: _jsx(SidebarTree, { activeUrl: activeUrl, idScope: sectionScope, nodes: sectionItems, openFirstLevel: true, scrollActive: true, visible: !sectionHidden }) })] })) : null] })] }) }) }) }));
343
+ }, section: activeSection }), _jsx("div", { className: "px-2", children: _jsx(SidebarTree, { activeUrl: activeUrl, idScope: sectionScope, nodes: sectionItems, openFirstLevel: true, scrollActive: scrollToActive, visible: !sectionHidden }) })] })) : null] })] }) }) }) }));
344
344
  };
345
- const DesktopTreeSidebar = ({ activeUrl, nodes, rootScope, top, }) => (_jsx("div", { className: "pointer-events-none sticky top-(--fd-docs-row-1) z-20 @min-[961px]:block hidden h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] @min-[961px]:layout:[--fd-sidebar-width:300px] [grid-area:sidebar] *:pointer-events-auto", "data-sidebar-mode": "tree", "data-sidebar-placeholder": true, children: _jsx("aside", { className: "h-full w-[300px] pr-3 text-gray-900", children: _jsx(MouseDownNavigation, { children: _jsxs("nav", { "aria-label": "Documentation", className: "geistdocs-sidebar-scroll h-full w-full overflow-auto overflow-x-hidden px-3 pt-14 pb-1 outline-none", "data-geistdocs-sidebar-scroll": true, children: [top ? _jsx("div", { className: "pb-3", children: top }) : null, _jsx(SidebarTree, { activeUrl: activeUrl, idScope: rootScope, nodes: nodes, openFirstLevel: true, scrollActive: true })] }) }) }) }));
345
+ const DesktopTreeSidebar = ({ activeUrl, nodes, rootScope, scrollToActive, top, }) => (_jsx("div", { className: "pointer-events-none sticky top-(--fd-docs-row-1) z-20 @min-[961px]:block hidden h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] @min-[961px]:layout:[--fd-sidebar-width:300px] [grid-area:sidebar] *:pointer-events-auto", "data-sidebar-mode": "tree", "data-sidebar-placeholder": true, children: _jsx("aside", { className: "h-full w-[300px] pr-3 text-gray-900", children: _jsx(MouseDownNavigation, { children: _jsxs("nav", { "aria-label": "Documentation", className: "geistdocs-sidebar-scroll h-full w-full overflow-auto overflow-x-hidden px-3 pt-14 pb-1 outline-none", "data-geistdocs-sidebar-scroll": true, children: [top ? _jsx("div", { className: "pb-3", children: top }) : null, _jsx(SidebarTree, { activeUrl: activeUrl, idScope: rootScope, nodes: nodes, openFirstLevel: true, scrollActive: scrollToActive })] }) }) }) }));
346
346
  const DesktopSidebar = ({ mode, ...props }) => {
347
347
  if (mode === "tree") {
348
348
  return _jsx(DesktopTreeSidebar, { ...props });
@@ -353,7 +353,7 @@ const MobileSidebar = ({ activeUrl, idScope, nodes, onOpenChange, open, top, })
353
353
  // A full-width slide with no fade, so the page never shows through.
354
354
  // `!` overrides the state-variant animation classes provider sheets set.
355
355
  "data-[state=closed]:fade-out-100! data-[state=open]:fade-in-100! data-[state=closed]:slide-out-to-left! data-[state=open]:slide-in-from-left! duration-300! ease-[cubic-bezier(0.32,0.72,0,1)]! motion-reduce:animate-none!"), "data-geistdocs-mobile-sidebar": true, noOverlay: true, side: "left", children: [_jsxs(SheetHeader, { className: "h-16 shrink-0 flex-row items-center justify-between gap-2 border-b px-4 py-0 text-left", children: [_jsx(SheetTitle, { className: "text-label-16", children: "Browse" }), _jsx(SheetDescription, { className: "sr-only", children: "Navigation for the documentation." }), _jsx(SheetClose, { "aria-label": "Close menu", className: "-mr-2 grid size-8 shrink-0 touch-manipulation place-items-center rounded-md text-gray-900 transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none active:bg-gray-alpha-300 motion-reduce:transition-none", children: _jsx(IconCross, { size: 16 }) })] }), _jsx(MouseDownNavigation, { children: _jsxs("nav", { "aria-label": "Documentation", className: "min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain px-2 py-3 text-gray-900", "data-geistdocs-sidebar-scroll": true, children: [_jsx("div", { className: "pb-4 [&>button]:w-full", children: _jsx(SearchButton, { onClick: () => onOpenChange(false) }) }), top ? _jsx("div", { className: "pb-4", children: top }) : null, _jsx(SidebarTree, { activeUrl: activeUrl, idScope: idScope, nodes: nodes, onNavigate: () => onOpenChange(false), scrollActive: true, visible: open })] }) })] }) }));
356
- export const GeistdocsSidebar = ({ mode = "sections", showDesktop = true, top, }) => {
356
+ export const GeistdocsSidebar = ({ mode = "sections", scrollToActive = true, showDesktop = true, top, }) => {
357
357
  const { root, full } = useTreeContext();
358
358
  const { isOpen, setIsOpen } = useGeistdocsSidebar();
359
359
  const containerRef = useRef(null);
@@ -383,5 +383,5 @@ export const GeistdocsSidebar = ({ mode = "sections", showDesktop = true, top, }
383
383
  return (_jsxs(_Fragment, { children: [_jsx("span", { hidden: true, ref: (marker) => {
384
384
  containerRef.current =
385
385
  marker?.closest("[data-geistdocs-container]") ?? null;
386
- } }), showDesktop ? (_jsx(DesktopSidebar, { activeUrl: activeUrl, mode: mode, nodes: root.children, rootScope: rootScope, top: top }, root.$id)) : null, _jsx(MobileSidebar, { activeUrl: activeUrl, idScope: rootScope, nodes: root.children, onOpenChange: setIsOpen, open: isOpen, top: top })] }));
386
+ } }), showDesktop ? (_jsx(DesktopSidebar, { activeUrl: activeUrl, mode: mode, nodes: root.children, rootScope: rootScope, scrollToActive: scrollToActive, top: top }, root.$id)) : null, _jsx(MobileSidebar, { activeUrl: activeUrl, idScope: rootScope, nodes: root.children, onOpenChange: setIsOpen, open: isOpen, top: top })] }));
387
387
  };
package/dist/layout.d.ts CHANGED
@@ -9,9 +9,15 @@ interface GeistdocsDocsLayoutProps {
9
9
  config: Pick<GeistdocsConfig, "defaultLanguage" | "translations">;
10
10
  containerProps?: ComponentProps<typeof FumadocsDocsLayout>["containerProps"];
11
11
  sidebarMode?: GeistdocsSidebarMode;
12
+ /**
13
+ * Scroll the desktop sidebar to reveal the current page when it is out of
14
+ * view after a navigation. Set false to keep the sidebar where it is.
15
+ * @default true
16
+ */
17
+ sidebarScrollToActive?: boolean;
12
18
  sidebarTop?: ReactNode;
13
19
  tree: ComponentProps<typeof FumadocsDocsLayout>["tree"];
14
20
  }
15
- export declare const GeistdocsDocsLayout: ({ config, containerProps, sidebarMode, sidebarTop, tree, children, }: GeistdocsDocsLayoutProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const GeistdocsDocsLayout: ({ config, containerProps, sidebarMode, sidebarScrollToActive, sidebarTop, tree, children, }: GeistdocsDocsLayoutProps) => import("react/jsx-runtime").JSX.Element;
16
22
  export {};
17
23
  //# sourceMappingURL=layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQhD,OAAO,EAAE,KAAK,oBAAoB,EAA4B,MAAM,WAAW,CAAC;AAEhF,eAAO,MAAM,iBAAiB,iHAA0B,CAAC;AAIzD,eAAO,MAAM,oBAAoB,+CAShC,CAAC;AAEF,UAAU,wBAAwB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,iBAAiB,GAAG,cAAc,CAAC,CAAC;IAClE,cAAc,CAAC,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC7E,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,IAAI,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;CACzD;AAED,eAAO,MAAM,mBAAmB,GAAI,sEAOjC,wBAAwB,4CAkC1B,CAAC"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQhD,OAAO,EAAE,KAAK,oBAAoB,EAA4B,MAAM,WAAW,CAAC;AAEhF,eAAO,MAAM,iBAAiB,iHAA0B,CAAC;AAIzD,eAAO,MAAM,oBAAoB,+CAShC,CAAC;AAEF,UAAU,wBAAwB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,iBAAiB,GAAG,cAAc,CAAC,CAAC;IAClE,cAAc,CAAC,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC7E,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,IAAI,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;CACzD;AAED,eAAO,MAAM,mBAAmB,GAAI,6FAQjC,wBAAwB,4CAwC1B,CAAC"}
package/dist/layout.js CHANGED
@@ -11,7 +11,7 @@ const chatOpenScript = `(function(){try{if(localStorage.getItem(${JSON.stringify
11
11
  export const GeistdocsThemeScript = () => (_jsxs(_Fragment, { children: [_jsx(GeistThemeScript, { storageKey: "geistdocs-theme" }), _jsx("script", {
12
12
  // biome-ignore lint/security/noDangerouslySetInnerHtml: the storage key and attribute are package constants; no user-authored HTML is inserted.
13
13
  dangerouslySetInnerHTML: { __html: chatOpenScript }, id: "geistdocs-chat-open-script" })] }));
14
- export const GeistdocsDocsLayout = ({ config, containerProps, sidebarMode, sidebarTop, tree, children, }) => {
14
+ export const GeistdocsDocsLayout = ({ config, containerProps, sidebarMode, sidebarScrollToActive, sidebarTop, tree, children, }) => {
15
15
  const { i18n } = createGeistdocsI18n(config);
16
16
  return (_jsx(GeistdocsSidebarProvider, { children: _jsx(FumadocsDocsLayout, { containerProps: {
17
17
  ...containerProps,
@@ -25,7 +25,7 @@ export const GeistdocsDocsLayout = ({ config, containerProps, sidebarMode, sideb
25
25
  enabled: false,
26
26
  }, sidebar: {
27
27
  collapsible: false,
28
- component: _jsx(GeistdocsSidebar, { mode: sidebarMode, top: sidebarTop }),
28
+ component: (_jsx(GeistdocsSidebar, { mode: sidebarMode, scrollToActive: sidebarScrollToActive, top: sidebarTop })),
29
29
  }, tabMode: "auto", themeSwitch: {
30
30
  enabled: false,
31
31
  }, tree: tree, children: _jsx("main", { className: "contents", children: children }) }) }));
package/dist/mdx.d.ts CHANGED
@@ -1,48 +1,5 @@
1
1
  import type { MDXComponents } from "mdx/types";
2
- import { type GeistdocsSourceConfigOptions as SourceConfigOptions } from "./source-config";
3
- export declare const defineGeistdocsSourceConfig: (config?: SourceConfigOptions) => import("fumadocs-mdx/config").GlobalConfig;
4
- export declare const geistdocsFrontmatterSchema: import("zod").ZodObject<{
5
- title: import("zod").ZodString;
6
- description: import("zod").ZodOptional<import("zod").ZodString>;
7
- icon: import("zod").ZodOptional<import("zod").ZodString>;
8
- full: import("zod").ZodOptional<import("zod").ZodBoolean>;
9
- _openapi: import("zod").ZodOptional<import("zod").ZodObject<{}, import("zod/v4/core").$loose>>;
10
- badge: import("zod").ZodOptional<import("zod").ZodString>;
11
- product: import("zod").ZodOptional<import("zod").ZodString>;
12
- navTitle: import("zod").ZodOptional<import("zod").ZodString>;
13
- url: import("zod").ZodOptional<import("zod").ZodString>;
14
- type: import("zod").ZodOptional<import("zod").ZodEnum<{
15
- conceptual: "conceptual";
16
- guide: "guide";
17
- reference: "reference";
18
- troubleshooting: "troubleshooting";
19
- integration: "integration";
20
- overview: "overview";
21
- }>>;
22
- prerequisites: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
23
- related: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
24
- summary: import("zod").ZodOptional<import("zod").ZodString>;
25
- lastModified: import("zod").ZodOptional<import("zod").ZodCoercedDate<unknown>>;
26
- internal: import("zod").ZodOptional<import("zod").ZodBoolean>;
27
- noindex: import("zod").ZodOptional<import("zod").ZodBoolean>;
28
- tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
29
- keywords: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
30
- canonical: import("zod").ZodOptional<import("zod").ZodString>;
31
- excludeFrom: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<{
32
- chat: "chat";
33
- llms: "llms";
34
- search: "search";
35
- sitemap: "sitemap";
36
- }>>>;
37
- }, import("zod/v4/core").$strip>;
38
- export declare const geistdocsMetaSchema: import("zod").ZodObject<{
39
- title: import("zod").ZodOptional<import("zod").ZodString>;
40
- pages: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
41
- description: import("zod").ZodOptional<import("zod").ZodString>;
42
- root: import("zod").ZodOptional<import("zod").ZodBoolean>;
43
- defaultOpen: import("zod").ZodOptional<import("zod").ZodBoolean>;
44
- icon: import("zod").ZodOptional<import("zod").ZodString>;
45
- }, import("zod/v4/core").$strip>;
2
+ import type { GeistdocsSourceConfigOptions as SourceConfigOptions } from "./source-config";
46
3
  export declare const geistShikiTheme: {
47
4
  name: string;
48
5
  type: "dark";
package/dist/mdx.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AA+B/C,OAAO,EAGL,KAAK,4BAA4B,IAAI,mBAAmB,EAGzD,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,2BAA2B,8EAAe,CAAC;AACxD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAoB,CAAC;AAC5D,eAAO,MAAM,mBAAmB;;;;;;;gCAAa,CAAC;AAC9C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAC1C,MAAM,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEnD,eAAO,MAAM,yBAAyB,GACpC,aAAa,sBAAsB,KAClC,sBA6DD,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAC9B,aAAa,sBAAsB,KAClC,sBAA+D,CAAC;AAEnE,eAAO,MAAM,2BAA2B,GACtC,GAAG,eAAe,KAAK,CAAC,sBAAsB,GAAG,SAAS,CAAC,KAC1D,sBACkD,CAAC"}
1
+ {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAgC/C,OAAO,KAAK,EAAE,4BAA4B,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAK3F,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAC1C,MAAM,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEnD,eAAO,MAAM,yBAAyB,GACpC,aAAa,sBAAsB,KAClC,sBA6DD,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAC9B,aAAa,sBAAsB,KAClC,sBAA+D,CAAC;AAEnE,eAAO,MAAM,2BAA2B,GACtC,GAAG,eAAe,KAAK,CAAC,sBAAsB,GAAG,SAAS,CAAC,KAC1D,sBACkD,CAAC"}
package/dist/mdx.js CHANGED
@@ -19,10 +19,10 @@ import { TabContent, TabsWithChildren } from "./components/tabs-with-children";
19
19
  import { TypeTable } from "./components/type-table";
20
20
  import { Video } from "./components/video";
21
21
  import { LocalizedLink } from "./internal/localized-link";
22
- import { geistdocsFrontmatterSchema as frontmatterSchema, geistdocsMetaSchema as metaSchema, geistShikiTheme as shikiTheme, defineGeistdocsSourceConfig as sourceConfig, } from "./source-config";
23
- export const defineGeistdocsSourceConfig = sourceConfig;
24
- export const geistdocsFrontmatterSchema = frontmatterSchema;
25
- export const geistdocsMetaSchema = metaSchema;
22
+ import { geistShikiTheme as shikiTheme } from "./shiki-theme";
23
+ // The source-config exports live on @vercel/geistdocs/source-config. Importing
24
+ // them here would pull fumadocs-mdx/config, and through it Shiki with every
25
+ // language grammar, into every server function that renders MDX.
26
26
  export const geistShikiTheme = shikiTheme;
27
27
  export const getGeistdocsMDXComponents = (components) => ({
28
28
  ...defaultMdxComponents,
package/dist/navbar.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { GeistdocsConfig } from "./config";
2
2
  interface NavbarProps {
3
- config: Pick<GeistdocsConfig, "github" | "logo" | "logoHref" | "nav" | "navbarActiveProduct" | "navbarBrand" | "navbarGithub" | "navbarOssProducts" | "navbarVariant">;
3
+ config: Pick<GeistdocsConfig, "ai" | "github" | "logo" | "logoHref" | "nav" | "navbarActiveProduct" | "navbarBrand" | "navbarGithub" | "navbarOssProducts" | "navbarVariant">;
4
4
  }
5
5
  export declare const Navbar: ({ config }: NavbarProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../src/navbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQhD,UAAU,WAAW;IACnB,MAAM,EAAE,IAAI,CACV,eAAe,EACb,QAAQ,GACR,MAAM,GACN,UAAU,GACV,KAAK,GACL,qBAAqB,GACrB,aAAa,GACb,cAAc,GACd,mBAAmB,GACnB,eAAe,CAClB,CAAC;CACH;AAKD,eAAO,MAAM,MAAM,GAAI,YAAY,WAAW,4CAqE7C,CAAC"}
1
+ {"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../src/navbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQhD,UAAU,WAAW;IACnB,MAAM,EAAE,IAAI,CACV,eAAe,EACb,IAAI,GACJ,QAAQ,GACR,MAAM,GACN,UAAU,GACV,KAAK,GACL,qBAAqB,GACrB,aAAa,GACb,cAAc,GACd,mBAAmB,GACnB,eAAe,CAClB,CAAC;CACH;AAKD,eAAO,MAAM,MAAM,GAAI,YAAY,WAAW,4CA2E7C,CAAC"}
package/dist/navbar.js CHANGED
@@ -12,9 +12,11 @@ export const Navbar = ({ config }) => {
12
12
  const variant = config.navbarVariant ?? "oss";
13
13
  const isOss = variant === "oss";
14
14
  const showGithub = config.navbarGithub?.enabled !== false;
15
+ const buttonLabel = config.ai?.buttonLabel?.trim();
16
+ const askLabel = buttonLabel ? _jsx("span", { children: buttonLabel }) : undefined;
15
17
  const githubUrl = showGithub ? getGithubRepoUrl(config.github) : null;
16
18
  // The default product list lives in a "use client" module, so it is resolved
17
19
  // and filtered inside the mobile menu.
18
20
  const activeProduct = config.navbarActiveProduct;
19
- return (_jsx(NavbarShell, { children: _jsxs("div", { className: "@container mx-auto flex w-full max-w-[1448px] justify-between px-2", children: [_jsxs("div", { className: "flex select-none flex-row items-center", children: [isOss ? (_jsx(NavbarLogo, { activeProduct: activeProduct, brand: config.navbarBrand, className: "ml-4", href: config.logoHref, logo: config.logo, ossProducts: config.navbarOssProducts, variant: "oss" })) : (_jsx(NavbarLogo, { brand: config.navbarBrand, className: "ml-4", href: config.logoHref, logo: config.logo, variant: "standard" })), _jsx(DesktopMenu, { className: "@min-[1024px]:flex hidden", items: nav })] }), _jsxs("div", { className: "mr-4 flex flex-row items-center justify-end gap-2", children: [_jsx(SearchButton, { className: "@min-[1024px]:flex hidden w-36" }), _jsx(AskAIButton, { className: "@min-[768px]:flex hidden shrink-0", size: "small", variant: "secondary" }), _jsx(AskAIButton, { className: "@min-[768px]:hidden", size: "small", variant: "secondary" }), showGithub ? (_jsx(GitHubButton, { className: "@min-[768px]:inline-flex hidden shrink-0", github: config.github })) : null, _jsx(MobileMenu, { activeProduct: activeProduct, githubUrl: githubUrl, nav: nav, ossProducts: config.navbarOssProducts, showOss: isOss })] })] }) }));
21
+ return (_jsx(NavbarShell, { children: _jsxs("div", { className: "@container mx-auto flex w-full max-w-[1448px] justify-between px-2", children: [_jsxs("div", { className: "flex select-none flex-row items-center", children: [isOss ? (_jsx(NavbarLogo, { activeProduct: activeProduct, brand: config.navbarBrand, className: "ml-4", href: config.logoHref, logo: config.logo, ossProducts: config.navbarOssProducts, variant: "oss" })) : (_jsx(NavbarLogo, { brand: config.navbarBrand, className: "ml-4", href: config.logoHref, logo: config.logo, variant: "standard" })), _jsx(DesktopMenu, { className: "@min-[1024px]:flex hidden", items: nav })] }), _jsxs("div", { className: "mr-4 flex flex-row items-center justify-end gap-2", children: [_jsx(SearchButton, { className: "@min-[1024px]:flex hidden w-36" }), _jsx(AskAIButton, { className: "@min-[768px]:flex hidden shrink-0", size: "small", variant: "secondary", children: askLabel }), _jsx(AskAIButton, { className: "@min-[768px]:hidden", size: "small", variant: "secondary", children: askLabel }), showGithub ? (_jsx(GitHubButton, { className: "@min-[768px]:inline-flex hidden shrink-0", github: config.github })) : null, _jsx(MobileMenu, { activeProduct: activeProduct, githubUrl: githubUrl, nav: nav, ossProducts: config.navbarOssProducts, showOss: isOss })] })] }) }));
20
22
  };
@@ -6,7 +6,7 @@ export interface CreateChangelogPageOptions extends ChangelogPageOptions {
6
6
  }
7
7
  interface ChangelogPageProps {
8
8
  params: Promise<{
9
- lang: string;
9
+ lang?: string;
10
10
  page?: string;
11
11
  }>;
12
12
  }
@@ -16,16 +16,19 @@ export declare const createChangelogPage: (options: CreateChangelogPageOptions)
16
16
  generateMetadata: (props: ChangelogPageProps) => Promise<Metadata>;
17
17
  generatePaginatedMetadata: (props: ChangelogPageProps) => Promise<Metadata>;
18
18
  generateStaticParams: () => {
19
- lang: string;
19
+ lang?: string;
20
20
  }[];
21
21
  generatePageParams: ({ params, }?: {
22
22
  params?: {
23
23
  lang?: string;
24
+ [param: string]: unknown;
24
25
  };
25
- }) => Promise<{
26
+ }) => Promise<(Omit<{
26
27
  lang: string;
27
28
  page: string;
28
- }[]>;
29
+ }, "lang"> & {
30
+ lang?: string;
31
+ })[]>;
29
32
  };
30
33
  export {};
31
34
  //# sourceMappingURL=changelog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/pages/changelog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EACL,KAAK,oBAAoB,EAM1B,MAAM,uBAAuB,CAAC;AAK/B,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1C;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD;AAID,eAAO,MAAM,mBAAmB,GAAI,SAAS,0BAA0B;kBAgH1C,kBAAkB;2BAgBT,kBAAkB;8BAdf,kBAAkB;uCAkBT,kBAAkB;;;;uCAO/D;QACD,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC5B;;;;CAUF,CAAC"}
1
+ {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/pages/changelog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EACL,KAAK,oBAAoB,EAM1B,MAAM,uBAAuB,CAAC;AAU/B,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1C;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnD;AAID,eAAO,MAAM,mBAAmB,GAAI,SAAS,0BAA0B;kBAkH1C,kBAAkB;2BAgBT,kBAAkB;8BAdf,kBAAkB;uCAkBT,kBAAkB;;;;uCAO/D;QACD,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;KACtD;;;;;;CAcF,CAAC"}
@@ -2,14 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { notFound, redirect } from "next/navigation";
3
3
  import { getChangelogPage, getChangelogPageParams, getChangelogPagePath, getChangelogPath, parseChangelogPage, } from "../internal/changelog";
4
4
  import { ChangelogFeed } from "../internal/changelog-feed";
5
- import { getGeistdocsLanguageConfig } from "../internal/languages";
5
+ import { getGeistdocsLanguageConfig, getLanguageStaticParams, omitLanguageParam, resolveRouteLanguage, } from "../internal/languages";
6
6
  import { GeistdocsPageActions } from "../internal/page-actions-client";
7
7
  const TRAILING_SLASH_PATTERN = /\/$/;
8
8
  export const createChangelogPage = (options) => {
9
9
  const { config, source, path = "/changelog", title = "Changelog", description = "The latest releases, improvements, and fixes.", getLang, markdownPath, dataPath, pageSize = 10, } = options;
10
10
  const { languages } = getGeistdocsLanguageConfig(config);
11
11
  const resolveLang = async ({ params }) => {
12
- const lang = getLang ? await getLang() : (await params).lang;
12
+ const lang = getLang
13
+ ? await getLang()
14
+ : resolveRouteLanguage(config, (await params).lang);
13
15
  if (!languages.includes(lang)) {
14
16
  notFound();
15
17
  }
@@ -77,8 +79,8 @@ export const createChangelogPage = (options) => {
77
79
  const { lang, page } = await resolveArchive(props);
78
80
  return metadataForPage(lang, page);
79
81
  };
80
- const generateStaticParams = () => languages.map((lang) => ({ lang }));
81
- const generatePageParams = ({ params, } = {}) => getChangelogPageParams(options, params?.lang);
82
+ const generateStaticParams = () => getLanguageStaticParams(config);
83
+ const generatePageParams = async ({ params, } = {}) => omitLanguageParam(config, await getChangelogPageParams(options, params?.lang));
82
84
  return {
83
85
  Page,
84
86
  PaginatedPage,
@@ -58,7 +58,7 @@ interface DocsPageData extends GeistdocsPageVisibilityData {
58
58
  export interface CreateDocsPageOptions<Params extends DocsPageParams = DocsPageParams> {
59
59
  /** Return false to make a page unavailable for the current route params. */
60
60
  canViewPage?: DocsPageAccessFilter<Params>;
61
- config: Pick<GeistdocsConfig, "ai" | "basePath" | "feedback" | "github" | "pageActions" | "siteId" | "siteUrl">;
61
+ config: Pick<GeistdocsConfig, "ai" | "basePath" | "defaultLanguage" | "feedback" | "github" | "pageActions" | "siteId" | "singleLanguage" | "siteUrl">;
62
62
  filterStaticParams?: (params: DocsPageParams) => boolean;
63
63
  getMarkdownUrl?: (context: MarkdownUrlContext<Params>) => string;
64
64
  getPageUrl?: (context: PageUrlContext<Params>) => string;
@@ -94,7 +94,9 @@ export declare const createDocsPage: <Params extends DocsPageParams = DocsPagePa
94
94
  params: Promise<Params>;
95
95
  }) => import("react/jsx-runtime").JSX.Element;
96
96
  getPageTree: (params: Params) => Promise<import("fumadocs-core/page-tree").Root>;
97
- generateStaticParams: () => DocsPageParams[];
97
+ generateStaticParams: () => (Omit<DocsPageParams, "lang"> & {
98
+ lang?: string;
99
+ })[];
98
100
  generateMetadata: ({ params, }: {
99
101
  params: Promise<Params>;
100
102
  }) => Promise<Metadata>;
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/pages/docs.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,QAAQ,IAAI,gBAAgB,EAE7B,MAAM,+B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AAM,cAAc,GAAI,MAAM,SAAS,cAAc,GAAG,cAAc,EAAE,0MAgB5E,qBAAqB,CAAC,MAAM,CAAC;uBAgPJ;QAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;KAAE;0BAvKlB,MAAM;;;;oCAwLtC;QACD,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;KACzB,KAAG,OAAO,CAAC,QAAQ,CAAC;CAqDtB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAA4B,CAAC"}
@@ -10,6 +10,7 @@ import { getPublicPath, withBasePath } from "../config";
10
10
  import { getDocsLinkClassName } from "../internal/docs-link-class-name";
11
11
  import { DocsPageErrorBoundary } from "../internal/docs-page-error-boundary";
12
12
  import { resolveDocumentTitle } from "../internal/document-title";
13
+ import { omitLanguageParam, resolveRouteLanguage } from "../internal/languages";
13
14
  import { resolveLinkHref, stripBasePathFromHref } from "../internal/link-href";
14
15
  import { resolvePageMarkdownUrl as resolveInternalPageMarkdownUrl } from "../internal/markdown-url.js";
15
16
  import { createPageActions as createInternalPageActions } from "../internal/page-actions";
@@ -76,6 +77,14 @@ export const createDocsPage = ({ canViewPage, config, source, mdx, pageActions =
76
77
  const hiddenUrls = new Set(access.filter(({ visible }) => !visible).map(({ page }) => page.url));
77
78
  return { tree: filterPageTree(tree, hiddenUrls), visibleUrls };
78
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
+ };
79
88
  const getPage = async (params) => {
80
89
  const page = source.source.getPage(params.slug, params.lang);
81
90
  if (!page) {
@@ -91,7 +100,7 @@ export const createDocsPage = ({ canViewPage, config, source, mdx, pageActions =
91
100
  };
92
101
  const getPageTree = async (params) => (await getAccessState(serializeParams(params))).tree;
93
102
  const PageContent = async ({ params }) => {
94
- const resolvedParams = await params;
103
+ const resolvedParams = await resolveParams(params);
95
104
  const { lang } = resolvedParams;
96
105
  const page = await getPage(resolvedParams);
97
106
  const pageTree = await getPageTree(resolvedParams);
@@ -185,10 +194,13 @@ export const createDocsPage = ({ canViewPage, config, source, mdx, pageActions =
185
194
  const Page = ({ params }) => (_jsx(DocsPageErrorBoundary, { children: _jsx(PageContent, { params: params }) }));
186
195
  const generateStaticParams = () => {
187
196
  const params = source.source.generateParams();
188
- return filterStaticParams ? params.filter(filterStaticParams) : params;
197
+ const filtered = filterStaticParams
198
+ ? params.filter(filterStaticParams)
199
+ : params;
200
+ return omitLanguageParam(config, filtered);
189
201
  };
190
202
  const generateMetadata = async ({ params, }) => {
191
- const resolvedParams = await params;
203
+ const resolvedParams = await resolveParams(params);
192
204
  const page = await getPage(resolvedParams);
193
205
  const pageTree = await getPageTree(resolvedParams);
194
206
  const data = page.data;
@@ -1,11 +1,11 @@
1
1
  interface ToastMessage {
2
2
  text: string;
3
3
  }
4
- export declare const Toasts: () => import("react/jsx-runtime").JSX.Element;
4
+ export declare const Toasts: () => import("react/jsx-runtime").JSX.Element | null;
5
5
  export declare const useToasts: () => {
6
- error: ({ text }: ToastMessage) => string | number;
7
- success: ({ text }: ToastMessage) => string | number;
8
- warning: ({ text }: ToastMessage) => string | number;
6
+ error: ({ text }: ToastMessage) => void;
7
+ success: ({ text }: ToastMessage) => void;
8
+ warning: ({ text }: ToastMessage) => void;
9
9
  };
10
10
  export {};
11
11
  //# sourceMappingURL=toasts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toasts.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/toasts.tsx"],"names":[],"mappings":"AAKA,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAcD,eAAO,MAAM,MAAM,+CAkBlB,CAAC;AAEF,eAAO,MAAM,SAAS;sBACF,YAAY;wBACV,YAAY;wBACZ,YAAY;CAChC,CAAC"}
1
+ {"version":3,"file":"toasts.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/toasts.tsx"],"names":[],"mappings":"AAKA,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAmDD,eAAO,MAAM,MAAM,sDAgClB,CAAC;AAQF,eAAO,MAAM,SAAS;sBACF,YAAY;wBACV,YAAY;wBAEZ,YAAY;CAEhC,CAAC"}