@vercel/geistdocs 2.14.0 → 2.14.2

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 (73) hide show
  1. package/dist/assets/icons/icon-brain.d.ts +26 -0
  2. package/dist/assets/icons/icon-brain.d.ts.map +1 -0
  3. package/dist/assets/icons/icon-brain.js +25 -0
  4. package/dist/assets/icons/icon-buildings.d.ts +26 -0
  5. package/dist/assets/icons/icon-buildings.d.ts.map +1 -0
  6. package/dist/assets/icons/icon-buildings.js +25 -0
  7. package/dist/assets/icons/icon-chart-activity.d.ts +26 -0
  8. package/dist/assets/icons/icon-chart-activity.d.ts.map +1 -0
  9. package/dist/assets/icons/icon-chart-activity.js +25 -0
  10. package/dist/assets/icons/icon-code.d.ts +26 -0
  11. package/dist/assets/icons/icon-code.d.ts.map +1 -0
  12. package/dist/assets/icons/icon-code.js +25 -0
  13. package/dist/assets/icons/icon-git-merge.d.ts +26 -0
  14. package/dist/assets/icons/icon-git-merge.d.ts.map +1 -0
  15. package/dist/assets/icons/icon-git-merge.js +25 -0
  16. package/dist/assets/icons/icon-git-pull-request.d.ts +26 -0
  17. package/dist/assets/icons/icon-git-pull-request.d.ts.map +1 -0
  18. package/dist/assets/icons/icon-git-pull-request.js +25 -0
  19. package/dist/assets/icons/icon-headset.d.ts +26 -0
  20. package/dist/assets/icons/icon-headset.d.ts.map +1 -0
  21. package/dist/assets/icons/icon-headset.js +25 -0
  22. package/dist/assets/icons/icon-magnifying-glass.d.ts +26 -0
  23. package/dist/assets/icons/icon-magnifying-glass.d.ts.map +1 -0
  24. package/dist/assets/icons/icon-magnifying-glass.js +25 -0
  25. package/dist/assets/icons/icon-target.d.ts +26 -0
  26. package/dist/assets/icons/icon-target.d.ts.map +1 -0
  27. package/dist/assets/icons/icon-target.js +26 -0
  28. package/dist/assets/icons/icon-warning.d.ts +26 -0
  29. package/dist/assets/icons/icon-warning.d.ts.map +1 -0
  30. package/dist/assets/icons/icon-warning.js +25 -0
  31. package/dist/assets/icons/index.d.ts +10 -0
  32. package/dist/assets/icons/index.d.ts.map +1 -1
  33. package/dist/assets/icons/index.js +10 -0
  34. package/dist/cli/index.js +1 -1
  35. package/dist/components/code-block-tabs.d.ts.map +1 -1
  36. package/dist/components/code-block-tabs.js +4 -1
  37. package/dist/controls.d.ts.map +1 -1
  38. package/dist/controls.js +2 -2
  39. package/dist/internal/chat/dots-spinner.d.ts.map +1 -1
  40. package/dist/internal/chat/dots-spinner.js +4 -1
  41. package/dist/internal/chat/page-attachment.js +1 -1
  42. package/dist/internal/chat/shell.d.ts.map +1 -1
  43. package/dist/internal/chat/shell.js +65 -9
  44. package/dist/internal/eve-agent.d.ts +6 -1
  45. package/dist/internal/eve-agent.d.ts.map +1 -1
  46. package/dist/internal/eve-agent.js +356 -68
  47. package/dist/internal/navbar/desktop-menu.d.ts.map +1 -1
  48. package/dist/internal/navbar/desktop-menu.js +3 -1
  49. package/dist/internal/navbar/mobile-menu.d.ts.map +1 -1
  50. package/dist/internal/navbar/mobile-menu.js +28 -9
  51. package/dist/internal/navbar/navbar-logo.d.ts +3 -2
  52. package/dist/internal/navbar/navbar-logo.d.ts.map +1 -1
  53. package/dist/internal/navbar/navbar-logo.js +6 -3
  54. package/dist/internal/navbar/use-server-panel-mount.d.ts +9 -0
  55. package/dist/internal/navbar/use-server-panel-mount.d.ts.map +1 -0
  56. package/dist/internal/navbar/use-server-panel-mount.js +11 -0
  57. package/dist/internal/provider-client.d.ts.map +1 -1
  58. package/dist/internal/provider-client.js +24 -12
  59. package/dist/internal/search.d.ts.map +1 -1
  60. package/dist/internal/search.js +36 -4
  61. package/dist/source-config.d.ts +6 -0
  62. package/dist/source-config.d.ts.map +1 -1
  63. package/dist/source-config.js +13 -0
  64. package/docs/agents.md +1 -1
  65. package/docs/llms.txt +2 -2
  66. package/docs/manifest.json +1 -1
  67. package/docs/pages/ask-ai.md +1 -1
  68. package/package.json +3 -1
  69. package/rehype-task-list-labels.d.ts +9 -0
  70. package/rehype-task-list-labels.js +52 -0
  71. package/source-config.js +14 -0
  72. package/template/content/docs/ask-ai.mdx +1 -1
  73. package/template/package.json +1 -1
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { usePathname } from "next/navigation";
4
4
  import { useMediaQuery } from "phase/react";
5
- import { useEffect, useState } from "react";
5
+ import { useEffect, useId, useRef, useState } from "react";
6
6
  import { IconChevronDownSmall } from "#geistdocs-assets/icons";
7
7
  import { ThemeSwitcher } from "#geistdocs-ui/components/theme-switcher";
8
8
  import { cn } from "#geistdocs-ui/utils";
@@ -13,7 +13,7 @@ import { groupDropdownItems } from "./desktop-menu";
13
13
  import { DEFAULT_OSS_SECTION, resolveOssProducts } from "./navbar-logo";
14
14
  import { useNavActive } from "./use-nav-active";
15
15
  function NavLink({ href, external, active, onClick, children, }) {
16
- const className = cn("flex min-h-11 items-center gap-1 rounded-md px-3 font-normal text-2xl text-gray-900 no-underline outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000", active && "text-gray-1000");
16
+ const className = cn("flex min-h-11 items-center gap-1 rounded-md px-3 font-normal text-2xl text-gray-900 no-underline outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000 focus-visible:shadow-[var(--ds-focus-ring)]", active && "text-gray-1000");
17
17
  // Inline span so the arrow baseline-aligns to the label.
18
18
  const content = (_jsxs("span", { children: [children, external ? _jsx(ExternalArrow, {}) : null] }));
19
19
  if (!external) {
@@ -23,7 +23,7 @@ function NavLink({ href, external, active, onClick, children, }) {
23
23
  }
24
24
  /** Secondary sheet link used inside collapsible groups (OSS + nav dropdowns). */
25
25
  function SubNavLink({ active, children, external, href, onClick, }) {
26
- const className = "flex items-center gap-1 rounded-md px-3 py-1.5 font-normal text-gray-1000 text-xl no-underline outline-none transition-colors hover:bg-gray-alpha-100";
26
+ const className = "flex items-center gap-1 rounded-md px-3 py-1.5 font-normal text-gray-1000 text-xl no-underline outline-none transition-colors hover:bg-gray-alpha-100 focus-visible:shadow-[var(--ds-focus-ring)]";
27
27
  if (!external) {
28
28
  return (_jsx(LocalizedLink, { "aria-current": active ? "page" : undefined, className: className, href: href, onClick: onClick, children: children }));
29
29
  }
@@ -42,22 +42,25 @@ function NavDropdownCollapsible({ dropdown, navItems, onLinkClick, }) {
42
42
  const external = item.external ?? item.href.startsWith("http");
43
43
  return (_jsx("li", { children: _jsx(SubNavLink, { active: !external && isActive(item.href), external: external, href: item.href, onClick: onLinkClick, children: _jsxs("span", { children: [item.label, external ? _jsx(ExternalArrow, {}) : null] }) }) }, item.href));
44
44
  });
45
- return (_jsxs("details", { className: "group flex flex-col", name: "geistdocs-mobile-nav", children: [_jsxs("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md px-3 font-normal text-2xl text-gray-900 outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000 [&::-webkit-details-marker]:hidden", children: [_jsx("span", { children: dropdown.label }), _jsx(IconChevronDownSmall, { className: "relative shrink-0 text-gray-700 transition-transform duration-150 group-open:rotate-180", size: 24 })] }), flat ? (_jsx("ul", { className: "flex list-none flex-col py-2", children: renderItems(dropdown.items) })) : (_jsx("div", { className: "flex flex-col gap-6 px-3 py-4", children: sections.map((section) => (_jsxs("div", { className: "flex flex-col", children: [_jsx("p", { className: "mb-2 font-mono text-gray-700 text-xs uppercase tracking-wider", children: section.heading }), _jsx("ul", { className: "-mx-3 flex list-none flex-col", children: renderItems(section.items) })] }, section.heading))) }))] }));
45
+ return (_jsxs("details", { className: "group flex flex-col", name: "geistdocs-mobile-nav", children: [_jsxs("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md px-3 font-normal text-2xl text-gray-900 outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000 focus-visible:shadow-[var(--ds-focus-ring)] [&::-webkit-details-marker]:hidden", children: [_jsx("span", { children: dropdown.label }), _jsx(IconChevronDownSmall, { className: "relative shrink-0 text-gray-700 transition-transform duration-150 group-open:rotate-180", size: 24 })] }), flat ? (_jsx("ul", { className: "flex list-none flex-col py-2", children: renderItems(dropdown.items) })) : (_jsx("div", { className: "flex flex-col gap-6 px-3 py-4", children: sections.map((section) => (_jsxs("div", { className: "flex flex-col", children: [_jsx("p", { className: "mb-2 font-mono text-gray-700 text-xs uppercase tracking-wider", children: section.heading }), _jsx("ul", { className: "-mx-3 flex list-none flex-col", children: renderItems(section.items) })] }, section.heading))) }))] }));
46
46
  }
47
47
  /** Collapsible OSS menu (`<details>`) with uppercase subsection headings. */
48
48
  function OssCollapsible({ sections, onLinkClick, }) {
49
49
  if (sections.length === 0) {
50
50
  return null;
51
51
  }
52
- return (_jsxs("details", { className: "group flex flex-col", name: "geistdocs-mobile-nav", children: [_jsxs("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md px-3 font-normal text-2xl text-gray-900 outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000 [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: ["Vercel OSS", _jsx(ExternalArrow, { className: "mt-1" })] }), _jsx(IconChevronDownSmall, { className: "relative shrink-0 text-gray-700 transition-transform duration-150 group-open:rotate-180", size: 24 })] }), _jsx("div", { className: "flex flex-col gap-6 px-3 py-4", children: sections.map((section) => (_jsxs("div", { className: "flex flex-col", children: [_jsx("p", { className: "mb-2 font-mono text-gray-700 text-xs uppercase tracking-wider", children: section.heading }), _jsx("ul", { className: "-mx-3 flex list-none flex-col", children: section.items.map((product) => (_jsx("li", { children: _jsx(SubNavLink, { external: product.external ?? product.href.startsWith("http"), href: product.href, onClick: onLinkClick, children: product.label }) }, product.href))) })] }, section.heading))) })] }));
52
+ return (_jsxs("details", { className: "group flex flex-col", name: "geistdocs-mobile-nav", children: [_jsxs("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md px-3 font-normal text-2xl text-gray-900 outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000 focus-visible:shadow-[var(--ds-focus-ring)] [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: ["Vercel OSS", _jsx(ExternalArrow, { className: "mt-1" })] }), _jsx(IconChevronDownSmall, { className: "relative shrink-0 text-gray-700 transition-transform duration-150 group-open:rotate-180", size: 24 })] }), _jsx("div", { className: "flex flex-col gap-6 px-3 py-4", children: sections.map((section) => (_jsxs("div", { className: "flex flex-col", children: [_jsx("p", { className: "mb-2 font-mono text-gray-700 text-xs uppercase tracking-wider", children: section.heading }), _jsx("ul", { className: "-mx-3 flex list-none flex-col", children: section.items.map((product) => (_jsx("li", { children: _jsx(SubNavLink, { external: product.external ?? product.href.startsWith("http"), href: product.href, onClick: onLinkClick, children: product.label }) }, product.href))) })] }, section.heading))) })] }));
53
53
  }
54
- function MobileMenuButton({ expanded, onClick, }) {
55
- return (_jsx("button", { "aria-expanded": expanded, "aria-label": expanded ? "Close menu" : "Open menu", className: "relative flex @min-[1024px]:hidden size-8 items-center justify-center rounded-full border border-gray-200 transition-colors hover:bg-gray-100", "data-slot": "mobile-menu-toggle", onClick: onClick, type: "button", children: _jsxs("span", { className: "flex flex-col items-center justify-center gap-[5px]", children: [_jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-transform duration-150", expanded && "translate-y-[3.25px] rotate-45") }), _jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-transform duration-150", expanded && "-translate-y-[3.25px] -rotate-45") })] }) }));
54
+ function MobileMenuButton({ controls, expanded, onClick, ref, }) {
55
+ return (_jsx("button", { "aria-controls": controls, "aria-expanded": expanded, "aria-label": expanded ? "Close menu" : "Open menu", className: "relative flex @min-[1024px]:hidden size-8 items-center justify-center rounded-full border border-gray-200 transition-colors hover:bg-gray-100", "data-slot": "mobile-menu-toggle", onClick: onClick, ref: ref, type: "button", children: _jsxs("span", { className: "flex flex-col items-center justify-center gap-[5px]", children: [_jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-transform duration-150", expanded && "translate-y-[3.25px] rotate-45") }), _jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-transform duration-150", expanded && "-translate-y-[3.25px] -rotate-45") })] }) }));
56
56
  }
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
60
  const isActive = useNavActive(nav);
61
+ const panelId = useId();
62
+ const toggleRef = useRef(null);
63
+ const panelRef = useRef(null);
61
64
  // Resolve the default/custom list and drop the active product here on the
62
65
  // client, where `DEFAULT_OSS_PRODUCTS` is a real array (see resolveOssProducts).
63
66
  const products = showOss
@@ -92,6 +95,11 @@ const MobileMenuState = ({ activeProduct, githubUrl, nav, ossProducts, showOss =
92
95
  const handleEscape = (e) => {
93
96
  if (e.key === "Escape" && show) {
94
97
  setShow(false);
98
+ // The closed panel is inert, so return focus to the toggle instead of
99
+ // leaving it on an element that just disappeared.
100
+ if (panelRef.current?.contains(document.activeElement)) {
101
+ toggleRef.current?.focus();
102
+ }
95
103
  }
96
104
  };
97
105
  document.addEventListener("keydown", handleEscape);
@@ -120,8 +128,19 @@ const MobileMenuState = ({ activeProduct, githubUrl, nav, ossProducts, showOss =
120
128
  };
121
129
  }, [show]);
122
130
  const close = () => setShow(false);
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
131
+ // The open panel covers the page below the navbar, so focus that leaves it
132
+ // for page content (Tab past the last control) wraps to the toggle instead.
133
+ // Moving back into the navbar, which stays visible, is left alone.
134
+ const keepFocusInMenu = (event) => {
135
+ const next = event.relatedTarget;
136
+ const navbar = event.currentTarget.closest("header");
137
+ if (!(next instanceof Node) || navbar?.contains(next)) {
138
+ return;
139
+ }
140
+ toggleRef.current?.focus();
141
+ };
142
+ return (_jsxs(_Fragment, { children: [_jsx(MobileMenuButton, { controls: panelId, expanded: show, onClick: () => setShow(!show), ref: toggleRef }), _jsx("div", { className: cn("fixed inset-0 top-16 z-40 @min-[1024px]:hidden bg-background-200", show
124
143
  ? "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, 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 }) })] })] }));
144
+ : "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 invisible opacity-0"), id: panelId, inert: !show, onBlur: keepFocusInMenu, ref: panelRef, 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
145
  };
127
146
  export const MobileMenu = (props) => (_jsx(MobileMenuState, { ...props }, usePathname()));
@@ -3,8 +3,9 @@ import type { GeistdocsNavbarBrand, GeistdocsNavbarOssProduct } from "../../conf
3
3
  export declare const DEFAULT_OSS_SECTION = "Open Source";
4
4
  export declare const DEFAULT_OSS_PRODUCTS: GeistdocsNavbarOssProduct[];
5
5
  /**
6
- * Full-bleed panel below the header used by navbar dropdowns. Rendered with
7
- * forceMount + hidden-when-closed so links stay in the server HTML.
6
+ * Full-bleed panel below the header used by navbar dropdowns. Hidden when
7
+ * closed, and force-mounted in the server HTML so links stay crawlable (see
8
+ * useServerPanelMount).
8
9
  */
9
10
  export declare const NAVBAR_PANEL_CLASSNAME = "fixed inset-x-0 top-16 z-30 w-screen bg-background-200 shadow-[0_1px_0_0_var(--ds-gray-alpha-300)] before:absolute before:inset-x-0 before:-top-3 before:h-3 before:content-[''] data-[state=closed]:hidden";
10
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"navbar-logo.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-logo.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AAIpE,OAAO,KAAK,EACV,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AAWtB,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,EAuF3D,CAAC;AAqBF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,gNAC4K,CAAC;AAIhN;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,IAAI,CAAC,yBAAyB,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACzE,2CA+BA;AAwCD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,yBAAyB,EAAE,GAAG,SAAS,EACjD,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,yBAAyB,EAAE,CAI7B;AAED,KAAK,eAAe,GAAG;IACrB,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,CACA;IACE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;IAC1C,OAAO,EAAE,KAAK,CAAC;CAChB,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB,CACJ,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,IAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CA0MjB"}
1
+ {"version":3,"file":"navbar-logo.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-logo.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AAIpE,OAAO,KAAK,EACV,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AAYtB,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,EAuF3D,CAAC;AAqBF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,gNAC4K,CAAC;AAIhN;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,IAAI,CAAC,yBAAyB,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACzE,2CA+BA;AAwCD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,yBAAyB,EAAE,GAAG,SAAS,EACjD,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,yBAAyB,EAAE,CAI7B;AAED,KAAK,eAAe,GAAG;IACrB,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,CACA;IACE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;IAC1C,OAAO,EAAE,KAAK,CAAC;CAChB,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB,CACJ,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,IAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CA2MjB"}
@@ -10,6 +10,7 @@ import { cn } from "#geistdocs-ui/utils";
10
10
  import { LocalizedLink, useLocalizedHref } from "../localized-link";
11
11
  import { NavigationMenu, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, } from "../ui/navigation-menu";
12
12
  import { NavbarBrand } from "./navbar-brand";
13
+ import { useServerPanelMount } from "./use-server-panel-mount";
13
14
  export const DEFAULT_OSS_SECTION = "Open Source";
14
15
  export const DEFAULT_OSS_PRODUCTS = [
15
16
  {
@@ -114,8 +115,9 @@ function groupOssProducts(products) {
114
115
  return sections;
115
116
  }
116
117
  /**
117
- * Full-bleed panel below the header used by navbar dropdowns. Rendered with
118
- * forceMount + hidden-when-closed so links stay in the server HTML.
118
+ * Full-bleed panel below the header used by navbar dropdowns. Hidden when
119
+ * closed, and force-mounted in the server HTML so links stay crawlable (see
120
+ * useServerPanelMount).
119
121
  */
120
122
  export const NAVBAR_PANEL_CLASSNAME = "fixed inset-x-0 top-16 z-30 w-screen bg-background-200 shadow-[0_1px_0_0_var(--ds-gray-alpha-300)] before:absolute before:inset-x-0 before:-top-3 before:h-3 before:content-[''] data-[state=closed]:hidden";
121
123
  const POINTER_LEAVE_GRACE_MS = 200;
@@ -151,6 +153,7 @@ export function NavbarLogo({ brand, className, href = "/", ...props }) {
151
153
  const featuredProducts = ossProducts.filter((product) => product.featured);
152
154
  const ossSections = groupOssProducts(ossProducts.filter((product) => !product.featured));
153
155
  const [navValue, setNavValue] = useState("");
156
+ const forceMount = useServerPanelMount();
154
157
  const logoHoveredRef = useRef(false);
155
158
  const suppressLogoHoverRef = useRef(false);
156
159
  const pointerLeaveTimeoutRef = useRef(undefined);
@@ -210,7 +213,7 @@ export function NavbarLogo({ brand, className, href = "/", ...props }) {
210
213
  event.key === "ArrowUp") {
211
214
  suppressLogoHoverRef.current = false;
212
215
  }
213
- } }), _jsx(NavigationMenuPrimitive.Content, { className: NAVBAR_PANEL_CLASSNAME, forceMount: true, onClickCapture: () => {
216
+ } }), _jsx(NavigationMenuPrimitive.Content, { className: NAVBAR_PANEL_CLASSNAME, forceMount: forceMount, onClickCapture: () => {
214
217
  cancelPointerLeave();
215
218
  logoHoveredRef.current = false;
216
219
  }, onEscapeKeyDown: () => {
@@ -0,0 +1,9 @@
1
+ /**
2
+ * `forceMount` for navbar dropdown panels: `true` during server rendering and
3
+ * hydration, so crawlers see the panel links in the HTML, then `undefined` so
4
+ * a closed panel unmounts. A mounted Radix panel, even hidden, stays the
5
+ * topmost dismissable layer and marks every Escape on the page handled,
6
+ * which stops other surfaces, like the Ask AI panel, from closing on Escape.
7
+ */
8
+ export declare const useServerPanelMount: () => true | undefined;
9
+ //# sourceMappingURL=use-server-panel-mount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-server-panel-mount.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/use-server-panel-mount.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAAO,IAAI,GAAG,SAK3C,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { useSyncExternalStore } from "react";
3
+ const subscribe = () => () => undefined;
4
+ /**
5
+ * `forceMount` for navbar dropdown panels: `true` during server rendering and
6
+ * hydration, so crawlers see the panel links in the HTML, then `undefined` so
7
+ * a closed panel unmounts. A mounted Radix panel, even hidden, stays the
8
+ * topmost dismissable layer and marks every Escape on the page handled,
9
+ * which stops other surfaces, like the Ask AI panel, from closing on Escape.
10
+ */
11
+ export const useServerPanelMount = () => useSyncExternalStore(subscribe, () => undefined, () => true);
@@ -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;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"}
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;AAmHD,eAAO,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,4CAQ9D,CAAC"}
@@ -22,18 +22,26 @@ const GeistdocsProviderInner = ({ config, search, theme: _theme, lang, ...props
22
22
  if (!enabled) {
23
23
  return;
24
24
  }
25
- const handleKeyDown = (event) => {
26
- if (event.key === "Escape" && isOpen) {
27
- event.preventDefault();
28
- // The first Escape returns an expanded desktop panel to the sidebar.
29
- if (isExpanded && !isMobile) {
30
- setIsExpanded(false);
31
- }
32
- else {
33
- setIsOpen(false);
34
- }
25
+ // Escape listens in the bubble phase and skips handled events, so a
26
+ // dialog, menu, or tooltip layered over the page closes first. Radix
27
+ // layers dismiss in the capture phase and mark the event handled.
28
+ const handleEscape = (event) => {
29
+ if (event.key !== "Escape" ||
30
+ !isOpen ||
31
+ event.defaultPrevented ||
32
+ event.isComposing) {
35
33
  return;
36
34
  }
35
+ event.preventDefault();
36
+ // The first Escape returns an expanded desktop panel to the sidebar.
37
+ if (isExpanded && !isMobile) {
38
+ setIsExpanded(false);
39
+ }
40
+ else {
41
+ setIsOpen(false);
42
+ }
43
+ };
44
+ const handleShortcut = (event) => {
37
45
  if ((event.metaKey || event.ctrlKey) &&
38
46
  !event.altKey &&
39
47
  !event.shiftKey &&
@@ -42,8 +50,12 @@ const GeistdocsProviderInner = ({ config, search, theme: _theme, lang, ...props
42
50
  setIsOpen((open) => !open);
43
51
  }
44
52
  };
45
- document.addEventListener("keydown", handleKeyDown, true);
46
- return () => document.removeEventListener("keydown", handleKeyDown, true);
53
+ document.addEventListener("keydown", handleEscape);
54
+ document.addEventListener("keydown", handleShortcut, true);
55
+ return () => {
56
+ document.removeEventListener("keydown", handleEscape);
57
+ document.removeEventListener("keydown", handleShortcut, true);
58
+ };
47
59
  }, [enabled, isExpanded, isMobile, isOpen, setIsExpanded, setIsOpen]);
48
60
  // fumadocs spreads the provider's `search.options` onto the dialog, which is
49
61
  // how a consumer reaches `tag`. Typed here so it survives the hand-off.
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/internal/search.tsx"],"names":[],"mappings":"AAIA,OAAO,EAWL,KAAK,WAAW,EAGjB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAI3D,eAAO,MAAM,qBAAqB,GAAI,4DAOnC,WAAW,GAAG;IACf;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAChD;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;CAClB,4CAuEA,CAAC"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/internal/search.tsx"],"names":[],"mappings":"AAIA,OAAO,EAWL,KAAK,WAAW,EAIjB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AA+C3D,eAAO,MAAM,qBAAqB,GAAI,4DAOnC,WAAW,GAAG;IACf;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAChD;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;CAClB,4CAqGA,CAAC"}
@@ -2,12 +2,33 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useDocsSearch } from "fumadocs-core/search/client";
4
4
  import { useOnChange } from "fumadocs-core/utils/use-on-change";
5
- import { SearchDialog as FumadocsSearchDialog, SearchDialogClose, SearchDialogContent, SearchDialogFooter, SearchDialogHeader, SearchDialogIcon, SearchDialogInput, SearchDialogList, SearchDialogListItem, SearchDialogOverlay, TagsList, TagsListItem, } from "fumadocs-ui/components/dialog/search";
5
+ import { SearchDialog as FumadocsSearchDialog, SearchDialogClose, SearchDialogContent, SearchDialogFooter, SearchDialogHeader, SearchDialogIcon, SearchDialogInput, SearchDialogList, SearchDialogListItem, SearchDialogOverlay, TagsList, TagsListItem, useSearchList, } from "fumadocs-ui/components/dialog/search";
6
6
  import { useI18n } from "fumadocs-ui/contexts/i18n";
7
- import { useState } from "react";
7
+ import { useEffect, useId, useState } from "react";
8
8
  import { getPublicPath } from "../config";
9
+ const WHITESPACE_PATTERN = /\s/g;
10
+ const getOptionId = (listId, itemId) => `${listId}-${itemId.replaceAll(WHITESPACE_PATTERN, "-")}`;
11
+ /**
12
+ * A result rendered as a real component, since fumadocs calls `Item` as a
13
+ * plain function. It reports the arrow-key selection to the input's
14
+ * `aria-activedescendant`, and follows Tab focus so Enter opens the result
15
+ * the reader focused rather than the arrow-key selection.
16
+ */
17
+ const SearchResult = ({ item, listId, onActiveChange, ...props }) => {
18
+ const { active, setActive } = useSearchList();
19
+ const id = getOptionId(listId, item.id);
20
+ const isActive = active === item.id;
21
+ useEffect(() => {
22
+ if (isActive) {
23
+ onActiveChange(id);
24
+ }
25
+ }, [id, isActive, onActiveChange]);
26
+ return (_jsx(SearchDialogListItem, { ...props, id: id, item: item, onFocus: () => setActive(item.id), role: "option" }));
27
+ };
9
28
  export const GeistdocsSearchDialog = ({ allowClear = false, basePath, onTagChange, tag, tags, ...props }) => {
10
- const { locale } = useI18n();
29
+ const { locale, text } = useI18n();
30
+ const listId = useId();
31
+ const [activeOptionId, setActiveOptionId] = useState();
11
32
  const hasTags = tags !== undefined && tags.length > 0;
12
33
  // Holds whatever scope is in force, which is not always a pill: an array scope
13
34
  // has no single pill to select, and it stays in force until a reader picks
@@ -24,7 +45,18 @@ export const GeistdocsSearchDialog = ({ allowClear = false, basePath, onTagChang
24
45
  tag: hasTags ? selected : tag,
25
46
  api: getPublicPath("/api/search", basePath),
26
47
  });
27
- return (_jsxs(FumadocsSearchDialog, { isLoading: query.isLoading, onSearchChange: setSearch, search: search, ...props, children: [_jsx(SearchDialogOverlay, { className: "bg-background-100/80 backdrop-blur-none" }), _jsxs(SearchDialogContent, { className: "w-[640px] max-w-[calc(100vw-1rem)] border-none shadow-[var(--ds-shadow-modal)]", "data-geistdocs-command-modal": true, onEscapeKeyDown: () => props.onOpenChange(false), children: [_jsxs(SearchDialogHeader, { children: [_jsx(SearchDialogIcon, {}), _jsx(SearchDialogInput, {}), _jsx(SearchDialogClose, {})] }), _jsx(SearchDialogList, { "aria-label": "Search results", Item: (itemProps) => (_jsx(SearchDialogListItem, { ...itemProps, role: "option" })), items: query.data === "empty" ? null : query.data, role: "listbox" }), hasTags ? (_jsx(SearchDialogFooter, { children: _jsx(TagsList, { allowClear: allowClear, onTagChange: (value) => {
48
+ const results = Array.isArray(query.data) ? query.data : null;
49
+ const hasResults = results !== null && results.length > 0;
50
+ let resultStatus = "";
51
+ if (results && !query.isLoading) {
52
+ resultStatus = hasResults
53
+ ? `${results.length} ${results.length === 1 ? "result" : "results"}`
54
+ : text.searchNoResult;
55
+ }
56
+ return (_jsxs(FumadocsSearchDialog, { isLoading: query.isLoading, onSearchChange: setSearch, search: search, ...props, children: [_jsx(SearchDialogOverlay, { className: "bg-background-100/80 backdrop-blur-none" }), _jsxs(SearchDialogContent, { className: "w-[640px] max-w-[calc(100vw-1rem)] border-none shadow-[var(--ds-shadow-modal)]", "data-geistdocs-command-modal": true, onEscapeKeyDown: () => props.onOpenChange(false), children: [_jsxs(SearchDialogHeader, { children: [_jsx(SearchDialogIcon, {}), _jsx(SearchDialogInput, { "aria-activedescendant": hasResults ? activeOptionId : undefined, "aria-autocomplete": "list", "aria-controls": listId, "aria-expanded": hasResults, "aria-label": text.search, role: "combobox" }), _jsx(SearchDialogClose, {}), _jsx("p", { "aria-live": "polite", className: "sr-only", role: "status", children: resultStatus })] }), _jsx(SearchDialogList, { "aria-label": hasResults ? "Search results" : undefined, Item: (itemProps) => (_jsx(SearchResult, { ...itemProps, listId: listId, onActiveChange: setActiveOptionId })), id: listId, items: query.data === "empty" ? null : query.data,
57
+ // Only a listbox while it holds options: the empty state is a
58
+ // message, announced through the status region instead.
59
+ role: hasResults ? "listbox" : undefined }), hasTags ? (_jsx(SearchDialogFooter, { children: _jsx(TagsList, { allowClear: allowClear, onTagChange: (value) => {
28
60
  setSelected(value);
29
61
  onTagChange?.(value);
30
62
  }, tag: typeof selected === "string" ? selected : undefined, children: tags.map((item) => (_jsx(TagsListItem, { value: item.value, children: item.name }, item.value))) }) })) : null] })] }));
@@ -76,6 +76,12 @@ export declare const geistdocsMetaSchema: z.ZodObject<{
76
76
  defaultOpen: z.ZodOptional<z.ZodBoolean>;
77
77
  icon: z.ZodOptional<z.ZodString>;
78
78
  }, z.core.$strip>;
79
+ /**
80
+ * Adds Geistdocs rehype plugins after the consumer's. An array is handed to
81
+ * Fumadocs, which places it among its defaults; a function receives those
82
+ * defaults and returns the final list.
83
+ */
84
+ export declare const resolveGeistdocsRehypePlugins: (consumerPlugins: DefaultMDXOptions["rehypePlugins"]) => NonNullable<DefaultMDXOptions["rehypePlugins"]>;
79
85
  export declare const defineGeistdocsSourceConfig: (config?: GeistdocsSourceConfigOptions) => import("fumadocs-mdx/config").GlobalConfig;
80
86
  export {};
81
87
  //# sourceMappingURL=source-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"source-config.d.ts","sourceRoot":"","sources":["../src/source-config.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,IAAI,oBAAoB,EAGrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,KAAK,mBAAmB,GAAG,WAAW,CACpC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAC3C,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CAC1C;AAQD;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,GACxC,UAAU,SAAS,EAAE,EACrB,kBAAiB,SAAS,EAAO,KAChC,SAAS,EAgBX,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAsG3B,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwCrC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;iBAAa,CAAC;AAE9C,eAAO,MAAM,2BAA2B,GACtC,SAAQ,4BAAiC,+CAwB1C,CAAC"}
1
+ {"version":3,"file":"source-config.d.ts","sourceRoot":"","sources":["../src/source-config.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,IAAI,oBAAoB,EAGrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,KAAK,mBAAmB,GAAG,WAAW,CACpC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAC3C,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CAC1C;AAQD;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,GACxC,UAAU,SAAS,EAAE,EACrB,kBAAiB,SAAS,EAAO,KAChC,SAAS,EAgBX,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAsG3B,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwCrC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;iBAAa,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GACxC,iBAAiB,iBAAiB,CAAC,eAAe,CAAC,KAClD,WAAW,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAKhD,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,SAAQ,4BAAiC,+CA2B1C,CAAC"}
@@ -2,6 +2,7 @@ import { remarkHeading, remarkMdxMermaid, remarkSteps, remarkStructure, } from "
2
2
  import { defineConfig as defineFumadocsConfig, frontmatterSchema, metaSchema, } from "fumadocs-mdx/config";
3
3
  import lastModified from "fumadocs-mdx/plugins/last-modified";
4
4
  import { z } from "zod";
5
+ import { rehypeTaskListLabels } from "../rehype-task-list-labels.js";
5
6
  import { remarkDetails } from "../remark-details.js";
6
7
  import { getLastModified } from "./internal/last-modified.js";
7
8
  const pluginOf = (entry) => Array.isArray(entry) ? entry[0] : entry;
@@ -163,6 +164,17 @@ export const geistdocsFrontmatterSchema = frontmatterSchema.extend({
163
164
  .optional(),
164
165
  });
165
166
  export const geistdocsMetaSchema = metaSchema;
167
+ /**
168
+ * Adds Geistdocs rehype plugins after the consumer's. An array is handed to
169
+ * Fumadocs, which places it among its defaults; a function receives those
170
+ * defaults and returns the final list.
171
+ */
172
+ export const resolveGeistdocsRehypePlugins = (consumerPlugins) => {
173
+ if (typeof consumerPlugins === "function") {
174
+ return (defaults) => [...consumerPlugins(defaults), rehypeTaskListLabels];
175
+ }
176
+ return [...(consumerPlugins ?? []), rehypeTaskListLabels];
177
+ };
166
178
  export const defineGeistdocsSourceConfig = (config = {}) => {
167
179
  const existingRemarkPlugins = Array.isArray(config.mdxOptions?.remarkPlugins)
168
180
  ? config.mdxOptions.remarkPlugins
@@ -173,6 +185,7 @@ export const defineGeistdocsSourceConfig = (config = {}) => {
173
185
  mdxOptions: {
174
186
  ...config.mdxOptions,
175
187
  remarkPlugins: (defaults) => resolveGeistdocsRemarkPlugins(defaults, existingRemarkPlugins),
188
+ rehypePlugins: resolveGeistdocsRehypePlugins(config.mdxOptions?.rehypePlugins),
176
189
  rehypeCodeOptions: {
177
190
  ...config.mdxOptions?.rehypeCodeOptions,
178
191
  themes: { light: geistShikiTheme, dark: geistShikiTheme },
package/docs/agents.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Docs
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 2.14.0 so agents can understand the installed package without web access.
3
+ These docs are bundled with `@vercel/geistdocs` 2.14.2 so agents can understand the installed package without web access.
4
4
  They are generated from `apps/template/content/docs` during the package build.
5
5
 
6
6
  ## How to use these files
package/docs/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Documentation
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 2.14.0.
3
+ These docs are bundled with `@vercel/geistdocs` 2.14.2.
4
4
  They describe how to build package-backed Geistdocs sites and how to use the package APIs from generated project adapters.
5
5
 
6
6
  ## Documentation Index
@@ -4281,7 +4281,7 @@ With eve 0.83 or newer, typing a follow-up also prepares the existing session ow
4281
4281
 
4282
4282
  Prewarming requires [`GEISTDOCS_CHAT_SECRET`](#keep-eve-sessions-across-turns-with-geistdocs_chat_secret). The route verifies the latest answer's session tag against the signed cookie before preparing an existing session. Preparation failures, older agents without support, and expired or mismatched cookies fall back to the normal send path. Leave prewarming disabled when typing a draft should not allocate a durable session before the reader sends a message.
4283
4283
 
4284
- The URL flows to `createChatRoute` through the config object you already pass in `app/api/chat/route.ts` — no route changes are required. Geistdocs speaks eve's session API directly: it starts or resumes a durable eve session, streams the agent's NDJSON events, and translates them into the same UI message stream the chat panel already renders. With `GEISTDOCS_CHAT_SECRET` set, Geistdocs continues one eve session across turns by binding it to the reader's browser with a signed, httpOnly cookie.
4284
+ The URL flows to `createChatRoute` through the config object you already pass in `app/api/chat/route.ts` — no route changes are required. Geistdocs speaks eve's session API directly: it starts or resumes a durable eve session, streams the agent's NDJSON events, and translates them into the same UI message stream the chat panel already renders. It reads both stream version 26 (eve 0.83 and older) and stream version 27 (eve 0.84 and newer), so the agent can upgrade across that boundary without a site change. With `GEISTDOCS_CHAT_SECRET` set, Geistdocs continues one eve session across turns by binding it to the reader's browser with a signed, httpOnly cookie.
4285
4285
 
4286
4286
  Eve agent mode keeps the platform-owned behavior from proxy mode:
4287
4287
 
@@ -467,5 +467,5 @@
467
467
  }
468
468
  ],
469
469
  "source": "apps/template/content/docs",
470
- "version": "2.14.0"
470
+ "version": "2.14.2"
471
471
  }
@@ -342,7 +342,7 @@ With eve 0.83 or newer, typing a follow-up also prepares the existing session ow
342
342
 
343
343
  Prewarming requires [`GEISTDOCS_CHAT_SECRET`](#keep-eve-sessions-across-turns-with-geistdocs_chat_secret). The route verifies the latest answer's session tag against the signed cookie before preparing an existing session. Preparation failures, older agents without support, and expired or mismatched cookies fall back to the normal send path. Leave prewarming disabled when typing a draft should not allocate a durable session before the reader sends a message.
344
344
 
345
- The URL flows to `createChatRoute` through the config object you already pass in `app/api/chat/route.ts` — no route changes are required. Geistdocs speaks eve's session API directly: it starts or resumes a durable eve session, streams the agent's NDJSON events, and translates them into the same UI message stream the chat panel already renders. With `GEISTDOCS_CHAT_SECRET` set, Geistdocs continues one eve session across turns by binding it to the reader's browser with a signed, httpOnly cookie.
345
+ The URL flows to `createChatRoute` through the config object you already pass in `app/api/chat/route.ts` — no route changes are required. Geistdocs speaks eve's session API directly: it starts or resumes a durable eve session, streams the agent's NDJSON events, and translates them into the same UI message stream the chat panel already renders. It reads both stream version 26 (eve 0.83 and older) and stream version 27 (eve 0.84 and newer), so the agent can upgrade across that boundary without a site change. With `GEISTDOCS_CHAT_SECRET` set, Geistdocs continues one eve session across turns by binding it to the reader's browser with a signed, httpOnly cookie.
346
346
 
347
347
  Eve agent mode keeps the platform-owned behavior from proxy mode:
348
348
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vercel/geistdocs",
3
3
  "description": "Runtime and CLI for Geistdocs projects.",
4
- "version": "2.14.0",
4
+ "version": "2.14.2",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -27,6 +27,8 @@
27
27
  "cli.js",
28
28
  "dist",
29
29
  "docs",
30
+ "rehype-task-list-labels.d.ts",
31
+ "rehype-task-list-labels.js",
30
32
  "remark-details.d.ts",
31
33
  "remark-details.js",
32
34
  "source-config.js",
@@ -0,0 +1,9 @@
1
+ interface HastNode {
2
+ children?: HastNode[];
3
+ properties?: Record<string, unknown>;
4
+ tagName?: string;
5
+ type: string;
6
+ value?: string;
7
+ }
8
+
9
+ export declare const rehypeTaskListLabels: () => (tree: HastNode) => void;
@@ -0,0 +1,52 @@
1
+ const NESTED_LIST_TAGS = new Set(["ol", "ul"]);
2
+
3
+ const hasClass = (node, name) => {
4
+ const className = node.properties?.className;
5
+ return Array.isArray(className) && className.includes(name);
6
+ };
7
+
8
+ const isTaskCheckbox = (node) =>
9
+ node.type === "element" &&
10
+ node.tagName === "input" &&
11
+ node.properties?.type === "checkbox";
12
+
13
+ // Text of a task item, without nested lists: their items label themselves.
14
+ const textOf = (node) => {
15
+ if (node.type === "text") {
16
+ return node.value ?? "";
17
+ }
18
+ if (NESTED_LIST_TAGS.has(node.tagName)) {
19
+ return "";
20
+ }
21
+ return (node.children ?? []).map(textOf).join("");
22
+ };
23
+
24
+ const visit = (node, inTaskItem) => {
25
+ const children = node.children ?? [];
26
+ const isTaskItem =
27
+ node.type === "element" &&
28
+ node.tagName === "li" &&
29
+ hasClass(node, "task-list-item");
30
+
31
+ for (const child of children) {
32
+ if (
33
+ (inTaskItem || isTaskItem) &&
34
+ isTaskCheckbox(child) &&
35
+ child.properties.ariaLabel === undefined
36
+ ) {
37
+ const label = children.map(textOf).join("").trim();
38
+ if (label) {
39
+ child.properties.ariaLabel = label;
40
+ }
41
+ }
42
+ // A loose task item wraps its checkbox in the item's first paragraph.
43
+ visit(child, isTaskItem && child.tagName === "p");
44
+ }
45
+ };
46
+
47
+ // Names GFM task-list checkboxes (`- [x] Item`) after their item text.
48
+ // remark-gfm renders a bare `<input type="checkbox" disabled>`, which screen
49
+ // readers announce as an unlabeled checkbox.
50
+ export const rehypeTaskListLabels = () => (tree) => {
51
+ visit(tree, false);
52
+ };
package/source-config.js CHANGED
@@ -15,6 +15,7 @@ import {
15
15
  } from "fumadocs-mdx/config";
16
16
  import lastModified from "fumadocs-mdx/plugins/last-modified";
17
17
  import { z } from "zod";
18
+ import { rehypeTaskListLabels } from "./rehype-task-list-labels.js";
18
19
  import { remarkDetails } from "./remark-details.js";
19
20
 
20
21
  // Mirrors src/internal/last-modified.ts. This file must stay dependency-free
@@ -272,6 +273,16 @@ export const resolveGeistdocsRemarkPlugins = (
272
273
  return list;
273
274
  };
274
275
 
276
+ // Mirrors src/source-config.ts. Geistdocs rehype plugins run after the
277
+ // consumer's: an array is handed to Fumadocs, which places it among its
278
+ // defaults; a function receives those defaults and returns the final list.
279
+ export const resolveGeistdocsRehypePlugins = (consumerPlugins) => {
280
+ if (typeof consumerPlugins === "function") {
281
+ return (defaults) => [...consumerPlugins(defaults), rehypeTaskListLabels];
282
+ }
283
+ return [...(consumerPlugins ?? []), rehypeTaskListLabels];
284
+ };
285
+
275
286
  export const defineGeistdocsSourceConfig = (config = {}) => {
276
287
  const existingRemarkPlugins = Array.isArray(config.mdxOptions?.remarkPlugins)
277
288
  ? config.mdxOptions.remarkPlugins
@@ -284,6 +295,9 @@ export const defineGeistdocsSourceConfig = (config = {}) => {
284
295
  ...config.mdxOptions,
285
296
  remarkPlugins: (defaults) =>
286
297
  resolveGeistdocsRemarkPlugins(defaults, existingRemarkPlugins),
298
+ rehypePlugins: resolveGeistdocsRehypePlugins(
299
+ config.mdxOptions?.rehypePlugins
300
+ ),
287
301
  rehypeCodeOptions: {
288
302
  ...config.mdxOptions?.rehypeCodeOptions,
289
303
  themes: { light: geistShikiTheme, dark: geistShikiTheme },
@@ -340,7 +340,7 @@ With eve 0.83 or newer, typing a follow-up also prepares the existing session ow
340
340
 
341
341
  Prewarming requires [`GEISTDOCS_CHAT_SECRET`](#keep-eve-sessions-across-turns-with-geistdocs_chat_secret). The route verifies the latest answer's session tag against the signed cookie before preparing an existing session. Preparation failures, older agents without support, and expired or mismatched cookies fall back to the normal send path. Leave prewarming disabled when typing a draft should not allocate a durable session before the reader sends a message.
342
342
 
343
- The URL flows to `createChatRoute` through the config object you already pass in `app/api/chat/route.ts` — no route changes are required. Geistdocs speaks eve's session API directly: it starts or resumes a durable eve session, streams the agent's NDJSON events, and translates them into the same UI message stream the chat panel already renders. With `GEISTDOCS_CHAT_SECRET` set, Geistdocs continues one eve session across turns by binding it to the reader's browser with a signed, httpOnly cookie.
343
+ The URL flows to `createChatRoute` through the config object you already pass in `app/api/chat/route.ts` — no route changes are required. Geistdocs speaks eve's session API directly: it starts or resumes a durable eve session, streams the agent's NDJSON events, and translates them into the same UI message stream the chat panel already renders. It reads both stream version 26 (eve 0.83 and older) and stream version 27 (eve 0.84 and newer), so the agent can upgrade across that boundary without a site change. With `GEISTDOCS_CHAT_SECRET` set, Geistdocs continues one eve session across turns by binding it to the reader's browser with a signed, httpOnly cookie.
344
344
 
345
345
  Eve agent mode keeps the platform-owned behavior from proxy mode:
346
346
 
@@ -17,7 +17,7 @@
17
17
  "@streamdown/code": "^1.0.1",
18
18
  "@vercel/agent-readability": "^0.7.0",
19
19
  "@vercel/analytics": "^1.6.1",
20
- "@vercel/geistdocs": "2.14.0",
20
+ "@vercel/geistdocs": "2.14.2",
21
21
  "@vercel/speed-insights": "^1.3.1",
22
22
  "ai": "^6.0.132",
23
23
  "clsx": "^2.1.1",