@vercel/geistdocs 1.25.1-canary.eec231d → 1.25.1-canary.fb7a9dd

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 (112) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/components/code-block-tabs.js +1 -1
  3. package/dist/components/code-block.d.ts.map +1 -1
  4. package/dist/components/code-block.js +1 -1
  5. package/dist/components/copy-prompt.js +1 -1
  6. package/dist/components/image.d.ts +19 -0
  7. package/dist/components/image.d.ts.map +1 -0
  8. package/dist/components/image.js +9 -0
  9. package/dist/components/steps.d.ts +9 -0
  10. package/dist/components/steps.d.ts.map +1 -0
  11. package/dist/components/steps.js +9 -0
  12. package/dist/internal/chat/activity.d.ts +20 -0
  13. package/dist/internal/chat/activity.d.ts.map +1 -0
  14. package/dist/internal/chat/activity.js +43 -0
  15. package/dist/internal/chat/message-metadata.d.ts.map +1 -1
  16. package/dist/internal/chat/message-metadata.js +15 -30
  17. package/dist/internal/chat/message-sources.d.ts +3 -0
  18. package/dist/internal/chat/message-sources.d.ts.map +1 -0
  19. package/dist/internal/chat/message-sources.js +23 -0
  20. package/dist/internal/chat/message.d.ts.map +1 -1
  21. package/dist/internal/chat/message.js +44 -10
  22. package/dist/internal/chat/shell.d.ts.map +1 -1
  23. package/dist/internal/chat/shell.js +7 -2
  24. package/dist/internal/chat/source-chunks.d.ts +9 -0
  25. package/dist/internal/chat/source-chunks.d.ts.map +1 -0
  26. package/dist/internal/chat/source-chunks.js +7 -0
  27. package/dist/internal/chat/sources.d.ts +1 -1
  28. package/dist/internal/chat/sources.d.ts.map +1 -1
  29. package/dist/internal/chat/sources.js +6 -3
  30. package/dist/internal/link-href.d.ts +13 -0
  31. package/dist/internal/link-href.d.ts.map +1 -0
  32. package/dist/internal/link-href.js +51 -0
  33. package/dist/internal/mdx-to-markdown.d.ts +3 -0
  34. package/dist/internal/mdx-to-markdown.d.ts.map +1 -0
  35. package/dist/internal/mdx-to-markdown.js +166 -0
  36. package/dist/internal/mousedown-navigation-utils.d.ts +5 -0
  37. package/dist/internal/mousedown-navigation-utils.d.ts.map +1 -0
  38. package/dist/internal/mousedown-navigation-utils.js +95 -0
  39. package/dist/internal/mousedown-navigation.d.ts +10 -0
  40. package/dist/internal/mousedown-navigation.d.ts.map +1 -0
  41. package/dist/internal/mousedown-navigation.js +42 -0
  42. package/dist/internal/navbar/navbar-shell.d.ts.map +1 -1
  43. package/dist/internal/navbar/navbar-shell.js +2 -1
  44. package/dist/internal/provider-client.d.ts.map +1 -1
  45. package/dist/internal/provider-client.js +1 -11
  46. package/dist/internal/react-node-text.d.ts +4 -0
  47. package/dist/internal/react-node-text.d.ts.map +1 -0
  48. package/dist/internal/react-node-text.js +11 -0
  49. package/dist/internal/search.js +1 -1
  50. package/dist/internal/sidebar-tree.d.ts.map +1 -1
  51. package/dist/internal/sidebar-tree.js +6 -1
  52. package/dist/internal/sidebar.d.ts.map +1 -1
  53. package/dist/internal/sidebar.js +15 -14
  54. package/dist/internal/table-of-contents-visibility.d.ts +27 -0
  55. package/dist/internal/table-of-contents-visibility.d.ts.map +1 -0
  56. package/dist/internal/table-of-contents-visibility.js +15 -0
  57. package/dist/internal/toc-items.d.ts.map +1 -1
  58. package/dist/internal/toc-items.js +2 -1
  59. package/dist/mdx.d.ts +1 -0
  60. package/dist/mdx.d.ts.map +1 -1
  61. package/dist/mdx.js +5 -0
  62. package/dist/page.d.ts +35 -0
  63. package/dist/page.d.ts.map +1 -0
  64. package/dist/page.js +26 -0
  65. package/dist/pages/docs.d.ts +6 -0
  66. package/dist/pages/docs.d.ts.map +1 -1
  67. package/dist/pages/docs.js +28 -15
  68. package/dist/routes/chat.d.ts.map +1 -1
  69. package/dist/routes/chat.js +30 -13
  70. package/dist/routes/llms.d.ts +1 -1
  71. package/dist/routes/llms.d.ts.map +1 -1
  72. package/dist/routes/llms.js +12 -2
  73. package/dist/source-config.d.ts +11 -0
  74. package/dist/source-config.d.ts.map +1 -1
  75. package/dist/source-config.js +21 -2
  76. package/dist/source.d.ts +10 -1
  77. package/dist/source.d.ts.map +1 -1
  78. package/dist/source.js +75 -34
  79. package/dist/versions.js +2 -2
  80. package/docs/agents.md +6 -3
  81. package/docs/llms.txt +464 -28
  82. package/docs/manifest.json +30 -3
  83. package/docs/pages/components/steps.md +129 -0
  84. package/docs/pages/deployment.md +30 -5
  85. package/docs/pages/getting-started.md +38 -12
  86. package/docs/pages/guides/hidden-outline.md +31 -0
  87. package/docs/pages/guides/nested-navigation.md +1 -1
  88. package/docs/pages/md.md +24 -5
  89. package/docs/pages/migration-2.md +106 -0
  90. package/docs/pages/migration.md +5 -2
  91. package/docs/pages/syntax.md +42 -0
  92. package/docs/pages/table-of-contents.md +40 -0
  93. package/docs/sitemap.md +5 -2
  94. package/package.json +19 -5
  95. package/source-config.js +38 -2
  96. package/template/app/[lang]/docs/custom-page/page.tsx +49 -0
  97. package/template/content/docs/components/meta.json +4 -0
  98. package/template/content/docs/components/steps.mdx +125 -0
  99. package/template/content/docs/deployment.mdx +31 -6
  100. package/template/content/docs/getting-started.mdx +39 -13
  101. package/template/content/docs/guides/hidden-outline.mdx +28 -0
  102. package/template/content/docs/guides/meta.json +1 -1
  103. package/template/content/docs/guides/nested-navigation.mdx +1 -1
  104. package/template/content/docs/md.mdx +24 -5
  105. package/template/content/docs/meta.json +3 -0
  106. package/template/content/docs/migration-2.mdx +106 -0
  107. package/template/content/docs/migration.mdx +5 -1
  108. package/template/content/docs/syntax.mdx +42 -0
  109. package/template/content/docs/table-of-contents.mdx +40 -0
  110. package/template/next.config.ts +9 -0
  111. package/template/package.json +4 -4
  112. package/theme.css +56 -4
@@ -0,0 +1,51 @@
1
+ const HTTP_URL = /^https?:\/\//;
2
+ const normalizeBasePath = (basePath) => {
3
+ if (!(basePath && basePath !== "/")) {
4
+ return "";
5
+ }
6
+ return `/${basePath.replace(/^\/+|\/+$/g, "")}`;
7
+ };
8
+ /**
9
+ * Treat an absolute URL on the configured production origin as app-local.
10
+ * Keeping the path, query, and hash makes canonical links navigate internally
11
+ * on production domains and previews alike.
12
+ */
13
+ export const resolveLinkHref = (href, siteUrl) => {
14
+ if (!HTTP_URL.test(href)) {
15
+ return { external: false, href };
16
+ }
17
+ if (!siteUrl) {
18
+ return { external: true, href };
19
+ }
20
+ try {
21
+ const url = new URL(href);
22
+ const site = new URL(siteUrl);
23
+ if (url.origin === site.origin) {
24
+ return {
25
+ external: false,
26
+ href: `${url.pathname}${url.search}${url.hash}`,
27
+ };
28
+ }
29
+ }
30
+ catch {
31
+ // Preserve the existing external treatment for malformed absolute URLs.
32
+ }
33
+ return { external: true, href };
34
+ };
35
+ /** Strip the Next.js base path before handing an href to `next/link`. */
36
+ export const stripBasePathFromHref = (href, basePath) => {
37
+ const prefix = normalizeBasePath(basePath);
38
+ if (!prefix) {
39
+ return href;
40
+ }
41
+ if (href === prefix) {
42
+ return "/";
43
+ }
44
+ if (href.startsWith(`${prefix}/`)) {
45
+ return href.slice(prefix.length);
46
+ }
47
+ if (href.startsWith(`${prefix}?`) || href.startsWith(`${prefix}#`)) {
48
+ return `/${href.slice(prefix.length)}`;
49
+ }
50
+ return href;
51
+ };
@@ -0,0 +1,3 @@
1
+ /** Convert authored MDX into component-free, agent-readable Markdown. */
2
+ export declare const mdxToMarkdown: (source: string) => Promise<string>;
3
+ //# sourceMappingURL=mdx-to-markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdx-to-markdown.d.ts","sourceRoot":"","sources":["../../src/internal/mdx-to-markdown.ts"],"names":[],"mappings":"AAiNA,yEAAyE;AACzE,eAAO,MAAM,aAAa,GAAU,QAAQ,MAAM,oBACF,CAAC"}
@@ -0,0 +1,166 @@
1
+ import remarkFrontmatter from "remark-frontmatter";
2
+ import remarkGfm from "remark-gfm";
3
+ import remarkMdx from "remark-mdx";
4
+ import remarkParse from "remark-parse";
5
+ import remarkStringify from "remark-stringify";
6
+ import { unified } from "unified";
7
+ const getAttribute = (node, name) => {
8
+ const attribute = node.attributes?.find((entry) => entry.type === "mdxJsxAttribute" && entry.name === name);
9
+ if (!attribute) {
10
+ return undefined;
11
+ }
12
+ if (typeof attribute.value === "string") {
13
+ return attribute.value;
14
+ }
15
+ const expression = attribute.value?.value?.trim();
16
+ if (!expression) {
17
+ return undefined;
18
+ }
19
+ try {
20
+ const parsed = JSON.parse(expression);
21
+ return typeof parsed === "string" ? parsed : undefined;
22
+ }
23
+ catch {
24
+ return undefined;
25
+ }
26
+ };
27
+ const paragraph = (value) => ({
28
+ children: [{ type: "text", value }],
29
+ type: "paragraph",
30
+ });
31
+ const OMITTED_NODE_TYPES = new Set([
32
+ "mdxFlowExpression",
33
+ "mdxTextExpression",
34
+ "mdxjsEsm",
35
+ "yaml",
36
+ ]);
37
+ const OMITTED_COMPONENTS = new Set([
38
+ "CodeBlockTabsList",
39
+ "CodeBlockTabsTrigger",
40
+ ]);
41
+ const imageNodes = (node) => {
42
+ const nodes = [];
43
+ const alt = getAttribute(node, "alt") ?? "";
44
+ const source = getAttribute(node, "srcLight") ?? getAttribute(node, "src");
45
+ if (source) {
46
+ nodes.push({
47
+ children: [{ alt, type: "image", url: source }],
48
+ type: "paragraph",
49
+ });
50
+ }
51
+ const caption = getAttribute(node, "caption");
52
+ if (caption) {
53
+ nodes.push(paragraph(caption));
54
+ }
55
+ return nodes;
56
+ };
57
+ const calloutNode = (node) => {
58
+ const title = getAttribute(node, "title");
59
+ const heading = title
60
+ ? [
61
+ {
62
+ children: [
63
+ {
64
+ children: [{ type: "text", value: `${title}:` }],
65
+ type: "strong",
66
+ },
67
+ ],
68
+ type: "paragraph",
69
+ },
70
+ ]
71
+ : [];
72
+ return {
73
+ children: [...heading, ...(node.children ?? [])],
74
+ type: "blockquote",
75
+ };
76
+ };
77
+ const replaceComponent = (node) => {
78
+ if (OMITTED_COMPONENTS.has(node.name ?? "")) {
79
+ return [];
80
+ }
81
+ if (node.name === "Check" || node.name === "Cross") {
82
+ return [{ type: "text", value: node.name === "Check" ? "✓" : "✗" }];
83
+ }
84
+ if (node.name === "Image") {
85
+ return imageNodes(node);
86
+ }
87
+ if (node.name === "Callout") {
88
+ return [calloutNode(node)];
89
+ }
90
+ const text = getAttribute(node, "text");
91
+ if ((node.name === "CopyPrompt" || node.name === "Prompt") && text) {
92
+ return [paragraph(text)];
93
+ }
94
+ // Presentation-only components (including CodeBlockTabs and CodeBlockTab)
95
+ // should not leak into agent-readable Markdown. Their meaningful children
96
+ // remain in document order, so every tab's fenced code is written out.
97
+ return node.children ?? [];
98
+ };
99
+ const isJsxElement = (node) => node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement";
100
+ // Steps exist in two shapes: the `Steps`/`Step` components authored in MDX and
101
+ // the `div.fd-steps`/`div.fd-step` output that remarkSteps emits for numbered
102
+ // headings. Both flatten to their content with the step number restored on
103
+ // each step heading so the Markdown reads as the author wrote it.
104
+ const isStepsNode = (node) => isJsxElement(node) &&
105
+ (node.name === "Steps" ||
106
+ (node.name === "div" && getAttribute(node, "className") === "fd-steps"));
107
+ const isStepNode = (node) => isJsxElement(node) &&
108
+ (node.name === "Step" ||
109
+ (node.name === "div" && getAttribute(node, "className") === "fd-step"));
110
+ const stepsNodes = (node) => {
111
+ let index = 0;
112
+ return (node.children ?? []).flatMap((child) => {
113
+ if (!isStepNode(child)) {
114
+ return cleanNode(child);
115
+ }
116
+ index += 1;
117
+ const content = (child.children ?? []).flatMap(cleanNode);
118
+ const heading = content.find((entry) => entry.type === "heading");
119
+ if (heading) {
120
+ heading.children = [
121
+ { type: "text", value: `${index}. ` },
122
+ ...(heading.children ?? []),
123
+ ];
124
+ }
125
+ return content;
126
+ });
127
+ };
128
+ const cleanNode = (node) => {
129
+ if (OMITTED_NODE_TYPES.has(node.type)) {
130
+ return [];
131
+ }
132
+ if (isStepsNode(node)) {
133
+ return stepsNodes(node);
134
+ }
135
+ if (node.children) {
136
+ node.children = node.children.flatMap(cleanNode);
137
+ }
138
+ if (!isJsxElement(node)) {
139
+ return [node];
140
+ }
141
+ // Native HTML can carry meaning Markdown has no equivalent for (`details`,
142
+ // `summary`, media, and so on). Keep it; only component-shaped JSX is a
143
+ // presentation abstraction that needs flattening.
144
+ if (node.name && node.name === node.name.toLowerCase()) {
145
+ return [node];
146
+ }
147
+ return replaceComponent(node);
148
+ };
149
+ const cleanChildren = (parent) => {
150
+ parent.children = (parent.children ?? []).flatMap(cleanNode);
151
+ };
152
+ const cleanMdx = () => (tree) => {
153
+ cleanChildren(tree);
154
+ };
155
+ const processor = unified()
156
+ .use(remarkParse)
157
+ .use(remarkGfm)
158
+ .use(remarkMdx)
159
+ .use(remarkFrontmatter, ["yaml"])
160
+ .use(cleanMdx)
161
+ .use(remarkStringify, {
162
+ bullet: "-",
163
+ fences: true,
164
+ });
165
+ /** Convert authored MDX into component-free, agent-readable Markdown. */
166
+ export const mdxToMarkdown = async (source) => String(await processor.process(source)).trim();
@@ -0,0 +1,5 @@
1
+ import type { PointerEvent as ReactPointerEvent } from "react";
2
+ export declare const getMouseDownRouterHref: (href: string, basePath: string | undefined) => string;
3
+ export declare const findMouseDownNavigationAnchor: (target: EventTarget | null, boundary: EventTarget | null) => HTMLAnchorElement | null;
4
+ export declare const shouldNavigateOnPointerDown: (event: ReactPointerEvent, anchor: HTMLAnchorElement) => boolean;
5
+ //# sourceMappingURL=mousedown-navigation-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mousedown-navigation-utils.d.ts","sourceRoot":"","sources":["../../src/internal/mousedown-navigation-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAwB/D,eAAO,MAAM,sBAAsB,GACjC,MAAM,MAAM,EACZ,UAAU,MAAM,GAAG,SAAS,WAoB7B,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACxC,QAAQ,WAAW,GAAG,IAAI,EAC1B,UAAU,WAAW,GAAG,IAAI,KAC3B,iBAAiB,GAAG,IAWtB,CAAC;AAyBF,eAAO,MAAM,2BAA2B,GACtC,OAAO,iBAAiB,EACxB,QAAQ,iBAAiB,YA0C1B,CAAC"}
@@ -0,0 +1,95 @@
1
+ const TRAILING_SLASH_PATTERN = /\/$/;
2
+ const normalizeRouterBasePath = (basePath) => {
3
+ if (!basePath || basePath === "/") {
4
+ return "";
5
+ }
6
+ const normalized = basePath.startsWith("/") ? basePath : `/${basePath}`;
7
+ return normalized.replace(TRAILING_SLASH_PATTERN, "");
8
+ };
9
+ const NESTED_CONTROL_TAGS = new Set([
10
+ "BUTTON",
11
+ "INPUT",
12
+ "LABEL",
13
+ "SELECT",
14
+ "SUMMARY",
15
+ "TEXTAREA",
16
+ ]);
17
+ const HANDLED_KEY = "__geistdocsMouseDownNavigationHandled";
18
+ export const getMouseDownRouterHref = (href, basePath) => {
19
+ const normalizedBasePath = normalizeRouterBasePath(basePath);
20
+ if (!normalizedBasePath) {
21
+ return href;
22
+ }
23
+ try {
24
+ const url = new URL(href, window.location.origin);
25
+ if (url.pathname === normalizedBasePath) {
26
+ return `/${url.search}${url.hash}`;
27
+ }
28
+ if (url.pathname.startsWith(`${normalizedBasePath}/`)) {
29
+ return `${url.pathname.slice(normalizedBasePath.length)}${url.search}${url.hash}`;
30
+ }
31
+ }
32
+ catch {
33
+ return href;
34
+ }
35
+ return href;
36
+ };
37
+ export const findMouseDownNavigationAnchor = (target, boundary) => {
38
+ let element = target;
39
+ while (element && element !== boundary) {
40
+ if (element.tagName === "A") {
41
+ return element;
42
+ }
43
+ element = element.parentElement;
44
+ }
45
+ return null;
46
+ };
47
+ const startsOnNestedControl = (target, anchor) => {
48
+ if (anchor.hasAttribute("data-no-mousedown-nav")) {
49
+ return true;
50
+ }
51
+ let element = target;
52
+ while (element && element !== anchor) {
53
+ if (element.hasAttribute("data-no-mousedown-nav") ||
54
+ NESTED_CONTROL_TAGS.has(element.tagName) ||
55
+ element.getAttribute("role") === "button") {
56
+ return true;
57
+ }
58
+ element = element.parentElement;
59
+ }
60
+ return false;
61
+ };
62
+ export const shouldNavigateOnPointerDown = (event, anchor) => {
63
+ if (event.defaultPrevented ||
64
+ event.button !== 0 ||
65
+ event.pointerType !== "mouse" ||
66
+ event.altKey ||
67
+ event.ctrlKey ||
68
+ event.metaKey ||
69
+ event.shiftKey ||
70
+ startsOnNestedControl(event.target, anchor)) {
71
+ return false;
72
+ }
73
+ const nativeEvent = event.nativeEvent;
74
+ if (nativeEvent[HANDLED_KEY] === true) {
75
+ return false;
76
+ }
77
+ const target = anchor.getAttribute("target");
78
+ if ((target && target !== "_self") || anchor.hasAttribute("download")) {
79
+ return false;
80
+ }
81
+ const href = anchor.getAttribute("href");
82
+ if (!href || href.startsWith("#")) {
83
+ return false;
84
+ }
85
+ try {
86
+ if (new URL(href, window.location.origin).origin !== window.location.origin) {
87
+ return false;
88
+ }
89
+ }
90
+ catch {
91
+ return false;
92
+ }
93
+ nativeEvent[HANDLED_KEY] = true;
94
+ return true;
95
+ };
@@ -0,0 +1,10 @@
1
+ import { type ReactNode } from "react";
2
+ /**
3
+ * Starts same-origin mouse navigation on pointer down, matching Vercel's
4
+ * marketing navbar behavior. Browser click behavior remains the fallback for
5
+ * keyboard activation, touch, modified clicks, downloads, and external links.
6
+ */
7
+ export declare const MouseDownNavigation: ({ children }: {
8
+ children: ReactNode;
9
+ }) => import("react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=mousedown-navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mousedown-navigation.d.ts","sourceRoot":"","sources":["../../src/internal/mousedown-navigation.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAQf;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAkDxE,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useRouter } from "next/navigation";
4
+ import { useCallback, useRef, } from "react";
5
+ import { useGeistdocsConfig } from "./config-context";
6
+ import { findMouseDownNavigationAnchor, getMouseDownRouterHref, shouldNavigateOnPointerDown, } from "./mousedown-navigation-utils";
7
+ /**
8
+ * Starts same-origin mouse navigation on pointer down, matching Vercel's
9
+ * marketing navbar behavior. Browser click behavior remains the fallback for
10
+ * keyboard activation, touch, modified clicks, downloads, and external links.
11
+ */
12
+ export const MouseDownNavigation = ({ children }) => {
13
+ const router = useRouter();
14
+ const { basePath } = useGeistdocsConfig();
15
+ const navigated = useRef(false);
16
+ const onPointerDownCapture = useCallback((event) => {
17
+ // A drag-off has no follow-up click inside this wrapper. Clear stale
18
+ // state at the beginning of every pointer interaction.
19
+ navigated.current = false;
20
+ const anchor = findMouseDownNavigationAnchor(event.target, event.currentTarget);
21
+ if (!(anchor && shouldNavigateOnPointerDown(event, anchor))) {
22
+ return;
23
+ }
24
+ const href = anchor.getAttribute("href");
25
+ if (!href) {
26
+ return;
27
+ }
28
+ navigated.current = true;
29
+ router.push(getMouseDownRouterHref(href, basePath), {
30
+ scroll: anchor.getAttribute("data-scroll") !== "false",
31
+ });
32
+ }, [basePath, router]);
33
+ const onClickCapture = useCallback((event) => {
34
+ if (navigated.current) {
35
+ // Prevent Next.js/the browser from navigating a second time without
36
+ // stopping propagation, so click handlers and analytics still run.
37
+ event.preventDefault();
38
+ navigated.current = false;
39
+ }
40
+ }, []);
41
+ return (_jsx("div", { onClickCapture: onClickCapture, onPointerDownCapture: onPointerDownCapture, style: { display: "contents" }, children: children }));
42
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"navbar-shell.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-shell.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAK5D,eAAO,MAAM,WAAW,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAqBhE,CAAC"}
1
+ {"version":3,"file":"navbar-shell.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-shell.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAM5D,eAAO,MAAM,WAAW,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAqBhE,CAAC"}
@@ -2,6 +2,7 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { cn } from "@vercel/geistcn/utils";
4
4
  import { useEffect, useState } from "react";
5
+ import { MouseDownNavigation } from "../mousedown-navigation";
5
6
  // Sticky navbar shell that reveals its bottom divider (a box-shadow, so it
6
7
  // doesn't consume the 64px content row) only once the page is scrolled —
7
8
  // matching the vercel.com header.
@@ -13,5 +14,5 @@ export const NavbarShell = ({ children }) => {
13
14
  window.addEventListener("scroll", onScroll, { passive: true });
14
15
  return () => window.removeEventListener("scroll", onScroll);
15
16
  }, []);
16
- return (_jsx("header", { className: cn("sticky top-0 z-40 flex h-16 justify-center bg-background-200 transition-shadow motion-reduce:transition-none", scrolled && "shadow-[0_1px_0_0_var(--ds-gray-alpha-400)]"), "data-scrolled": scrolled ? "" : undefined, children: children }));
17
+ return (_jsx("header", { className: cn("sticky top-0 z-40 flex h-16 justify-center bg-background-200 transition-shadow motion-reduce:transition-none", scrolled && "shadow-[0_1px_0_0_var(--ds-gray-alpha-400)]"), "data-scrolled": scrolled ? "" : undefined, children: _jsx(MouseDownNavigation, { children: children }) }));
17
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"provider-client.d.ts","sourceRoot":"","sources":["../../src/internal/provider-client.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAejD,MAAM,WAAW,sBACf,SAAQ,cAAc,CAAC,OAAO,YAAY,CAAC;IAC3C,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA0FD,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":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAcjD,MAAM,WAAW,sBACf,SAAQ,cAAc,CAAC,OAAO,YAAY,CAAC;IAC3C,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAgFD,eAAO,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,4CAQ9D,CAAC"}
@@ -11,23 +11,13 @@ import { GeistdocsConfigProvider } from "./config-context";
11
11
  import { createGeistdocsI18n } from "./i18n";
12
12
  import { GeistdocsSearchDialog } from "./search";
13
13
  import { useIsMobile } from "./use-mobile";
14
- const chatShellImport = () => import("./chat/shell");
15
- const GeistdocsChatShell = lazy(() => chatShellImport().then(({ GeistdocsChatShell: Component }) => ({
14
+ const GeistdocsChatShell = lazy(() => import("./chat/shell").then(({ GeistdocsChatShell: Component }) => ({
16
15
  default: Component,
17
16
  })));
18
17
  const GeistdocsProviderInner = ({ config, search, theme: _theme, lang, ...props }) => {
19
18
  const { i18n, i18nProvider } = createGeistdocsI18n(config);
20
19
  const { enabled, hasBeenOpened, isOpen, setIsOpen } = useGeistdocsChat();
21
20
  const isMobile = useIsMobile();
22
- useEffect(() => {
23
- if (!enabled) {
24
- return;
25
- }
26
- const idle = window.requestIdleCallback(() => {
27
- chatShellImport().catch(() => undefined);
28
- });
29
- return () => window.cancelIdleCallback(idle);
30
- }, [enabled]);
31
21
  useEffect(() => {
32
22
  if (!enabled) {
33
23
  return;
@@ -0,0 +1,4 @@
1
+ import { type ReactNode } from "react";
2
+ /** Flatten heading presentation markup into the text shown in navigation. */
3
+ export declare const reactNodeToText: (node: ReactNode) => string;
4
+ //# sourceMappingURL=react-node-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-node-text.d.ts","sourceRoot":"","sources":["../../src/internal/react-node-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjE,6EAA6E;AAC7E,eAAO,MAAM,eAAe,GAAI,MAAM,SAAS,KAAG,MAUjD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Children, isValidElement } from "react";
2
+ /** Flatten heading presentation markup into the text shown in navigation. */
3
+ export const reactNodeToText = (node) => {
4
+ if (typeof node === "string" || typeof node === "number") {
5
+ return String(node);
6
+ }
7
+ if (isValidElement(node)) {
8
+ return reactNodeToText(node.props.children);
9
+ }
10
+ return Children.toArray(node).map(reactNodeToText).join("");
11
+ };
@@ -11,5 +11,5 @@ export const GeistdocsSearchDialog = ({ basePath, ...props }) => {
11
11
  locale,
12
12
  api: getPublicPath("/api/search", basePath),
13
13
  });
14
- 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: "border-none", "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" })] })] }));
14
+ 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" })] })] }));
15
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar-tree.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;CAAE,CAAC,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,eAAO,MAAM,mBAAmB,GAC9B,MAAM,IAAI,GAAG,SAAS,KACrB,MAAM,GAAG,SAGX,CAAC;AAaF,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,KAAG,MACa,CAAC;AAElE,eAAO,MAAM,qBAAqB,GAAI,MAAM,IAAI,GAAG,SAAS,KAAG,OACE,CAAC;AAElE,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,KAAG,OAC3B,CAAC;AAEzB,eAAO,MAAM,yBAAyB,GACpC,MAAM,kBAAkB,KACvB,IAAI,IAAI,MAGwB,CAAC;AAEpC,eAAO,MAAM,gBAAgB,GAC3B,MAAM,IAAI,EACV,MAAM,MAAM,EAAE,EACd,cAAiB,KAChB,MAAuD,CAAC;AAE3D,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,EAAE,KAAK,MAAM,KAAG,OAczD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,OAAO,IAAI,EAAE,EACb,WAAW,MAAM,GAAG,SAAS,KAC5B,MAAM,GAAG,IAgBX,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,GAAG,IAAI,KAAG,IAAI,EAsBnE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,OAAO,IAAI,EAAE,KAAG,gBAAgB,EA8BpE,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,OAAO,IAAI,EAAE,EACb,WAAW,MAAM,GAAG,SAAS,EAC7B,wBAAsB,EACtB,cAAiB,KAChB,MAAM,EAyBR,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,QAAQ,MAAM,EACd,YAAY,MAAM,EAAE,EACpB,cAAiB,KAChB,MAAM,EAiBR,CAAC"}
1
+ {"version":3,"file":"sidebar-tree.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;CAAE,CAAC,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,eAAO,MAAM,mBAAmB,GAC9B,MAAM,IAAI,GAAG,SAAS,KACrB,MAAM,GAAG,SAGX,CAAC;AAiBF,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,KAAG,MAGhB,CAAC;AAErC,eAAO,MAAM,qBAAqB,GAAI,MAAM,IAAI,GAAG,SAAS,KAAG,OACE,CAAC;AAElE,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,KAAG,OAC3B,CAAC;AAEzB,eAAO,MAAM,yBAAyB,GACpC,MAAM,kBAAkB,KACvB,IAAI,IAAI,MAGwB,CAAC;AAEpC,eAAO,MAAM,gBAAgB,GAC3B,MAAM,IAAI,EACV,MAAM,MAAM,EAAE,EACd,cAAiB,KAChB,MAAuD,CAAC;AAE3D,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,EAAE,KAAK,MAAM,KAAG,OAczD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,OAAO,IAAI,EAAE,EACb,WAAW,MAAM,GAAG,SAAS,KAC5B,MAAM,GAAG,IAgBX,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,GAAG,IAAI,KAAG,IAAI,EAsBnE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,OAAO,IAAI,EAAE,KAAG,gBAAgB,EA8BpE,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,OAAO,IAAI,EAAE,EACb,WAAW,MAAM,GAAG,SAAS,EAC7B,wBAAsB,EACtB,cAAiB,KAChB,MAAM,EAyBR,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,QAAQ,MAAM,EACd,YAAY,MAAM,EAAE,EACpB,cAAiB,KAChB,MAAM,EAiBR,CAAC"}
@@ -14,7 +14,12 @@ const METHOD_BADGE_TONES = {
14
14
  POST: "bg-blue-200 text-blue-1000",
15
15
  PUT: "bg-amber-200 text-amber-1000",
16
16
  };
17
- export const getSidebarBadgeTone = (label) => METHOD_BADGE_TONES[label] ?? "bg-gray-alpha-400 text-gray-1000";
17
+ const STATUS_BADGE_TONES = {
18
+ New: "bg-blue-200 text-blue-900",
19
+ };
20
+ export const getSidebarBadgeTone = (label) => STATUS_BADGE_TONES[label] ??
21
+ METHOD_BADGE_TONES[label] ??
22
+ "bg-gray-alpha-400 text-gray-1000";
18
23
  export const isExternalSidebarItem = (item) => Boolean(item && (item.external || EXTERNAL_URL.test(item.url)));
19
24
  export const isExternalSidebarUrl = (url) => EXTERNAL_URL.test(url);
20
25
  export const hasSeparateRootDisclosure = (node) => node.type === "folder" &&
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,YAAY,CAAC;AA28B5E,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":"AAmBA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,YAAY,CAAC;AAk9B5E,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"}
@@ -10,6 +10,7 @@ import { useSize } from "phase/react";
10
10
  import { useEffect, useId, useLayoutEffect, useMemo, useRef, useState, } from "react";
11
11
  import { SearchButton } from "../controls";
12
12
  import { useGeistdocsSidebar } from "../sidebar";
13
+ import { MouseDownNavigation } from "./mousedown-navigation";
13
14
  import { SIDEBAR_DESKTOP_MIN_WIDTH } from "./sidebar-responsive";
14
15
  import { findActiveRootSection, getDescendantFolderIds, getInitialOpenFolderIds, getSidebarBadgeTone, getSidebarItemBadge, getSidebarNodeId, getSidebarRootGroups, getSidebarSectionItems, hasSeparateRootDisclosure, isExternalSidebarItem, isExternalSidebarUrl, } from "./sidebar-tree";
15
16
  const UNSAFE_ID_CHARACTERS = /[^a-zA-Z0-9_-]/g;
@@ -315,27 +316,27 @@ const DesktopSectionsSidebar = ({ activeUrl, nodes, rootScope, top, }) => {
315
316
  shouldFocusRootRef.current = false;
316
317
  }
317
318
  }, [sectionShown]);
318
- return (_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-placeholder": true, children: _jsx("aside", { className: "h-full w-[300px] pr-3 text-gray-900", children: _jsxs("nav", { "aria-label": "Documentation", className: "geistdocs-sidebar-scroll h-full w-full overflow-auto overflow-x-hidden px-1 pt-14 pb-1 outline-none", "data-geistdocs-sidebar-scroll": true, ref: navRef, children: [top ? _jsx("div", { className: "px-2 pb-3", children: top }) : null, _jsxs("div", { className: "relative overflow-hidden", children: [_jsx("div", { className: cn("geistdocs-sidebar-pane", rootHidden &&
319
- "pointer-events-none absolute inset-x-0 top-0 opacity-0 [transform:translateX(-8px)] motion-reduce:invisible"), "data-sidebar-pane": "root", inert: rootHidden || undefined, children: _jsx(SidebarRootList, { activeSection: activeSection, activeUrl: activeUrl, groups: groups, onSelect: (section, trigger) => {
320
- returnFocusRef.current = trigger;
321
- shouldFocusSectionRef.current = true;
322
- setSelectedSection(section);
323
- setView("section");
324
- }, visible: !rootHidden }) }), activeSection ? (_jsxs("div", { className: cn("geistdocs-sidebar-pane", sectionHidden &&
325
- "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: () => {
326
- shouldFocusRootRef.current = true;
327
- setSelectedSection(null);
328
- setView("root");
329
- }, section: activeSection }), _jsx("div", { className: "px-2", children: _jsx(SidebarTree, { activeUrl: activeUrl, idScope: sectionScope, nodes: sectionItems, openFirstLevel: true, scrollActive: true, visible: !sectionHidden }) })] })) : null] })] }) }) }));
319
+ return (_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-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-1 pt-14 pb-1 outline-none", "data-geistdocs-sidebar-scroll": true, ref: navRef, children: [top ? _jsx("div", { className: "px-2 pb-3", children: top }) : null, _jsxs("div", { className: "relative overflow-hidden", children: [_jsx("div", { className: cn("geistdocs-sidebar-pane", rootHidden &&
320
+ "pointer-events-none absolute inset-x-0 top-0 opacity-0 [transform:translateX(-8px)] motion-reduce:invisible"), "data-sidebar-pane": "root", inert: rootHidden || undefined, children: _jsx(SidebarRootList, { activeSection: activeSection, activeUrl: activeUrl, groups: groups, onSelect: (section, trigger) => {
321
+ returnFocusRef.current = trigger;
322
+ shouldFocusSectionRef.current = true;
323
+ setSelectedSection(section);
324
+ setView("section");
325
+ }, visible: !rootHidden }) }), activeSection ? (_jsxs("div", { className: cn("geistdocs-sidebar-pane", sectionHidden &&
326
+ "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: () => {
327
+ shouldFocusRootRef.current = true;
328
+ setSelectedSection(null);
329
+ setView("root");
330
+ }, section: activeSection }), _jsx("div", { className: "px-2", children: _jsx(SidebarTree, { activeUrl: activeUrl, idScope: sectionScope, nodes: sectionItems, openFirstLevel: true, scrollActive: true, visible: !sectionHidden }) })] })) : null] })] }) }) }) }));
330
331
  };
331
- 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: _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 })] }) }) }));
332
+ 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 })] }) }) }) }));
332
333
  const DesktopSidebar = ({ mode, ...props }) => {
333
334
  if (mode === "tree") {
334
335
  return _jsx(DesktopTreeSidebar, { ...props });
335
336
  }
336
337
  return _jsx(DesktopSectionsSidebar, { ...props });
337
338
  };
338
- const MobileSidebar = ({ activeUrl, idScope, nodes, onOpenChange, open, top, }) => (_jsx(Sheet, { onOpenChange: onOpenChange, open: open, children: _jsxs(SheetContent, { className: "w-full gap-0 bg-background-200 p-0 sm:max-w-none", "data-geistdocs-mobile-sidebar": true, noOverlay: true, side: "left", children: [_jsxs(SheetHeader, { className: "h-16 shrink-0 justify-center border-b px-4 py-0", children: [_jsx(SheetTitle, { className: "text-label-16", children: "Browse" }), _jsx(SheetDescription, { className: "sr-only", children: "Navigation for the documentation." })] }), _jsxs("nav", { "aria-label": "Documentation", className: "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 })] })] }) }));
339
+ const MobileSidebar = ({ activeUrl, idScope, nodes, onOpenChange, open, top, }) => (_jsx(Sheet, { onOpenChange: onOpenChange, open: open, children: _jsxs(SheetContent, { className: "w-full gap-0 bg-background-200 p-0 sm:max-w-none", "data-geistdocs-mobile-sidebar": true, noOverlay: true, side: "left", children: [_jsxs(SheetHeader, { className: "h-16 shrink-0 justify-center border-b px-4 py-0", children: [_jsx(SheetTitle, { className: "text-label-16", children: "Browse" }), _jsx(SheetDescription, { className: "sr-only", children: "Navigation for the documentation." })] }), _jsx(MouseDownNavigation, { children: _jsxs("nav", { "aria-label": "Documentation", className: "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 })] }) })] }) }));
339
340
  export const GeistdocsSidebar = ({ mode = "sections", showDesktop = true, top, }) => {
340
341
  const { root, full } = useTreeContext();
341
342
  const { isOpen, setIsOpen } = useGeistdocsSidebar();
@@ -0,0 +1,27 @@
1
+ export interface TableOfContentsVisibilityInput {
2
+ /** App-level `tableOfContent.enabled` passed to `createDocsPage`. */
3
+ appEnabled?: boolean;
4
+ /**
5
+ * Fumadocs' `full` frontmatter. Geistdocs has one axis, `tableOfContents`,
6
+ * and reads `full: true` as an alias for `tableOfContents: false`.
7
+ */
8
+ full?: boolean;
9
+ /** Frontmatter `tableOfContents`; the page's explicit choice. */
10
+ pageEnabled?: boolean;
11
+ }
12
+ /**
13
+ * Decide whether a page shows the "On this page" outline. The page's own
14
+ * frontmatter wins, then the app-level option, then the `full` alias. A page
15
+ * without an outline gives its content the outline's column as well.
16
+ */
17
+ export declare const resolveTableOfContentsEnabled: ({ appEnabled, full, pageEnabled, }: TableOfContentsVisibilityInput) => boolean;
18
+ /**
19
+ * The outline decision for a page: whether the column renders, and the items
20
+ * it shows. A hidden outline yields no items so every surface (desktop
21
+ * column, mobile bar) reads the same list.
22
+ */
23
+ export declare const resolveTableOfContents: <T>(toc: T[] | undefined, input: TableOfContentsVisibilityInput) => {
24
+ enabled: boolean;
25
+ items: T[];
26
+ };
27
+ //# sourceMappingURL=table-of-contents-visibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-of-contents-visibility.d.ts","sourceRoot":"","sources":["../../src/internal/table-of-contents-visibility.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,8BAA8B;IAC7C,qEAAqE;IACrE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,iEAAiE;IACjE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GAAI,oCAI3C,8BAA8B,KAAG,OACA,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,EACtC,KAAK,CAAC,EAAE,GAAG,SAAS,EACpB,OAAO,8BAA8B,KACpC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,CAAC,EAAE,CAAA;CAGhC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Decide whether a page shows the "On this page" outline. The page's own
3
+ * frontmatter wins, then the app-level option, then the `full` alias. A page
4
+ * without an outline gives its content the outline's column as well.
5
+ */
6
+ export const resolveTableOfContentsEnabled = ({ appEnabled, full = false, pageEnabled, }) => pageEnabled ?? appEnabled ?? !full;
7
+ /**
8
+ * The outline decision for a page: whether the column renders, and the items
9
+ * it shows. A hidden outline yields no items so every surface (desktop
10
+ * column, mobile bar) reads the same list.
11
+ */
12
+ export const resolveTableOfContents = (toc, input) => {
13
+ const enabled = resolveTableOfContentsEnabled(input);
14
+ return { enabled, items: enabled ? (toc ?? []) : [] };
15
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"toc-items.d.ts","sourceRoot":"","sources":["../../src/internal/toc-items.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAsCf,eAAO,MAAM,QAAQ,GAAI,yBAAyB,cAAc,CAAC,KAAK,CAAC,4CA2FtE,CAAC"}
1
+ {"version":3,"file":"toc-items.d.ts","sourceRoot":"","sources":["../../src/internal/toc-items.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAuCf,eAAO,MAAM,QAAQ,GAAI,yBAAyB,cAAc,CAAC,KAAK,CAAC,4CA2FtE,CAAC"}