@vercel/geistdocs 2.14.2 → 2.14.3-canary.9417d69

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 (40) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/components/video.d.ts +2 -2
  3. package/dist/components/video.d.ts.map +1 -1
  4. package/dist/components/video.js +1 -1
  5. package/dist/config.d.ts +15 -1
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/controls.d.ts +6 -1
  8. package/dist/controls.d.ts.map +1 -1
  9. package/dist/controls.js +8 -2
  10. package/dist/internal/chat/prompt-input.d.ts.map +1 -1
  11. package/dist/internal/chat/prompt-input.js +3 -2
  12. package/dist/internal/chat/shell.d.ts.map +1 -1
  13. package/dist/internal/chat/shell.js +4 -2
  14. package/dist/internal/config-context.d.ts +2 -0
  15. package/dist/internal/config-context.d.ts.map +1 -1
  16. package/dist/internal/config-context.js +2 -0
  17. package/dist/internal/lazy-mdx-components.d.ts +21 -0
  18. package/dist/internal/lazy-mdx-components.d.ts.map +1 -0
  19. package/dist/internal/lazy-mdx-components.js +13 -0
  20. package/dist/internal/localized-link.d.ts +3 -1
  21. package/dist/internal/localized-link.d.ts.map +1 -1
  22. package/dist/internal/localized-link.js +2 -2
  23. package/dist/internal/navbar/desktop-menu.d.ts.map +1 -1
  24. package/dist/internal/navbar/desktop-menu.js +1 -1
  25. package/dist/internal/navbar/mobile-menu.d.ts.map +1 -1
  26. package/dist/internal/navbar/mobile-menu.js +3 -3
  27. package/dist/internal/navbar/navbar-logo.d.ts +7 -3
  28. package/dist/internal/navbar/navbar-logo.d.ts.map +1 -1
  29. package/dist/internal/navbar/navbar-logo.js +2 -3
  30. package/dist/mdx.d.ts.map +1 -1
  31. package/dist/mdx.js +1 -5
  32. package/dist/navbar.d.ts.map +1 -1
  33. package/dist/navbar.js +3 -1
  34. package/docs/agents.md +1 -1
  35. package/docs/llms.txt +27 -1
  36. package/docs/manifest.json +1 -1
  37. package/docs/pages/configuration.md +26 -0
  38. package/package.json +6 -6
  39. package/template/content/docs/configuration.mdx +26 -0
  40. package/template/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -4,4 +4,4 @@ import{Option as Rn,program as A}from"commander";import{access as Ke,copyFile as
4
4
  `);throw new AggregateError(i,`Mixedbread search sync did not complete:
5
5
  ${a}`)}return r},Ft=async({client:e,file:t,pollIntervalMs:n,pollTimeoutMs:r,sleep:i})=>{let s=t,o=Date.now()+r;for(;s.status==="pending"||s.status==="in_progress";){if(Date.now()>=o)throw new Error(`Mixedbread timed out while indexing file ${t.id}.`);await i(n),s=await e.retrieveStoreFile(t.id)}if(s.status!=="completed")throw new Error(`Mixedbread failed to index file ${t.id} (${s.status}).`);return s},Dt=async({client:e,desired:t,pollIntervalMs:n,pollTimeoutMs:r,sleep:i})=>{let s=await e.uploadFile({content:t.document.content,filename:`${U(t.document.id).slice(0,32)}.md`}),o;try{o=await e.createStoreFile({externalId:t.externalId,fileId:s,metadata:{...t.metadata,[g.rawFileId]:s}})}catch(a){try{await e.deleteFile(s)}catch(d){throw new AggregateError([a,d],`Mixedbread failed to attach and clean up raw file ${s}.`)}throw a}return Ft({client:e,file:o,pollIntervalMs:n,pollTimeoutMs:r,sleep:i})},Ie=async({client:e,concurrency:t=St,manifest:n,pollIntervalMs:r=_t,pollTimeoutMs:i=Tt,revision:s,revisionAncestors:o=[],revisionTimestamp:a,sleep:d=Rt})=>{let c=_e(n);if(c.provider!=="mixedbread")return{deleted:0,skipped:c.documents.length,uploaded:0};let u=c.siteId?.trim();if(!u)throw new Error("Mixedbread retrieval requires a non-empty siteId in geistdocs.tsx.");if(c.documents.length===0)throw new Error("The Geistdocs search export is empty. Refusing to remove indexed documents.");let l=c.documents.map(p=>At(p,u,s,o,a)),m=new Map(l.map(p=>[p.document.id,p])),h=(await be(e)).flatMap(p=>{let y=q(p.metadata);return y?.siteId===u?[{file:p,metadata:y}]:[]}),x=new Map,P=new Set;for(let p of h){W(p.metadata,s,a)&&P.add(p.metadata.documentId);let y=m.get(p.metadata.documentId);y&&p.metadata.contentHash===y.hash&&p.file.status==="completed"&&!x.has(p.metadata.documentId)&&x.set(p.metadata.documentId,p)}let _=l.filter(p=>!(x.has(p.document.id)||P.has(p.document.id)));await Ee(_,t,p=>Dt({client:e,desired:p,pollIntervalMs:r,pollTimeoutMs:i,sleep:d}));let b=(await be(e)).flatMap(p=>{let y=q(p.metadata);return y?.siteId===u?[{file:p,metadata:y}]:[]}),D=new Set(b.filter(({metadata:p})=>W(p,s,a)).map(({metadata:p})=>p.documentId)),ie=new Set;for(let p of l){if(D.has(p.document.id))continue;let ae=b.filter(({file:V,metadata:k})=>V.status==="completed"&&k.documentId===p.document.id&&k.contentHash===p.hash).sort((V,k)=>V.file.id.localeCompare(k.file.id))[0];ae&&ie.add(ae.file.id)}let oe=b.filter(({file:p,metadata:y})=>p.status!=="pending"&&p.status!=="in_progress"&&!W(y,s,a)&&Mt({currentRevision:s,currentRevisionAncestors:o,currentRevisionTimestamp:a,desired:m.get(y.documentId),metadata:y})&&!ie.has(p.id));return await Ee(oe,t,async({file:p,metadata:y})=>{await e.deleteFile(y.rawFileId??p.id),await e.deleteStoreFile(p.id)}),{deleted:oe.length,skipped:l.length-_.length,uploaded:_.length}};var Ot=50,$t=e=>`vercel integration add mixedbread --name docs-${e||"your-site-id"} --environment production`,ve=(e,t)=>kt("git",t,{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim(),Nt=e=>{let t=process.env.VERCEL_GIT_COMMIT_SHA?.trim(),n=[];try{n=ve(e,["rev-list",`--max-count=${Ot+1}`,t||"HEAD"]).split(`
6
6
  `).filter(Boolean)}catch{n=[]}let r=t||n[0],i;for(let s of Array.from(new Set([r,"HEAD"].filter(Boolean))))try{let o=Number(ve(e,["show","-s","--format=%ct",s]));if(Number.isFinite(o)){i=o;break}}catch{}return{revision:r,revisionAncestors:n.filter(s=>s!==r),revisionTimestamp:i}},Pe=async({allowNonProduction:e=!1,dir:t=".next"}={})=>{let n=process.cwd();Ct.loadEnvConfig(n,!1);let r=process.env.MXBAI_API_KEY?.trim(),i=process.env.MXBAI_STORE_ID?.trim();if(process.env.VERCEL_ENV!=="production"&&!e){console.log("Geistdocs search sync skipped: this is not a production Vercel build.");return}if(!!r!=!!i)throw new Error("Mixedbread is partially configured. Set both MXBAI_API_KEY and MXBAI_STORE_ID.");let s;try{s=await Te({cwd:n,outputDirectory:t})}catch(a){if(!(r||i)){console.log("Geistdocs search sync skipped: no Mixedbread credentials or static search export were found.");return}throw a}if(s.provider!=="mixedbread"){console.log("Geistdocs search sync skipped: Ask AI uses local retrieval.");return}if(!(r&&i))throw new Error(["Mixedbread retrieval is enabled, but MXBAI_API_KEY or MXBAI_STORE_ID is missing.","From the root of this site's repository, linked to the correct Vercel project, run:",$t(s.siteId)].join(`
7
- `));let o=await Ie({client:we({apiBaseUrl:process.env.MXBAI_BASE_URL,apiKey:r,storeId:i}),manifest:s,...Nt(n)});console.log(`Geistdocs search sync complete: ${o.uploaded} uploaded, ${o.deleted} deleted, ${o.skipped} unchanged.`)};import{readFileSync as Gt,writeFileSync as Ut}from"fs";import{mkdir as Lt,readFile as Z,writeFile as jt}from"fs/promises";import{dirname as Bt,extname as Vt,relative as Fe,resolve as j}from"path";import{intro as Jt,isCancel as Ht,log as I,multiselect as Xt,outro as L,spinner as Kt}from"@clack/prompts";import{glob as Yt}from"glob";import{Node as F,Project as qt,SyntaxKind as zt}from"ts-morph";var Wt="geistdocs.tsx",Qt="content/docs/**/*.mdx",ee=".translation-cache.json",Q=8,Ae=()=>({version:1,entries:{}}),Zt=async e=>{let t=await Z(e),{createHash:n}=await import("crypto");return n("sha256").update(t).digest("hex")},en=e=>{let t=j(process.cwd(),e);return Gt(t,"utf8")},Me=e=>F.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(F.isPropertyAssignment(t)){let n=t.getNameNode();if(F.isIdentifier(n)||F.isStringLiteral(n))return[n.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],tn=e=>{try{let t=new qt({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),n=en(e),s=t.createSourceFile(e,n,{overwrite:!0}).getVariableDeclarations().find(a=>a.getName()==="translations")?.getInitializer();if(!s)return[];if(F.isObjectLiteralExpression(s))return Me(s);let o=s.getFirstDescendantByKind(zt.ObjectLiteralExpression);return o?Me(o):[]}catch(t){let n=t instanceof Error?t.message:`${t}`;return I.warn(`Failed to read locales from ${e}: ${n}`),[]}},nn=async()=>{let e=await Xt({message:"Which locales should be translated?",options:[{value:"cn",label:"Chinese (cn)"},{value:"jp",label:"Japanese (jp)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"}],required:!0});return Ht(e)&&(L("Translation cancelled"),process.exit(0)),e},rn=async e=>(await Yt(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),sn=async()=>{let e=j(process.cwd(),ee);try{let t=await Z(e,"utf8"),n=JSON.parse(t);return n.version!==1||!n.entries?Ae():{version:1,entries:n.entries}}catch{return Ae()}},Re=e=>{let t=j(process.cwd(),ee),n=JSON.stringify(e,null,2);Ut(t,n,"utf8")},on=async e=>{let t=await Promise.all(e.map(async n=>[n,await Zt(n)]));return Object.fromEntries(t)},an=(e,t)=>{let n=Vt(e);return`${e.slice(0,-n.length)}.${t}${n}`},De=(e,t)=>`${Fe(process.cwd(),e)}::${t}`,cn=(e,t,n,r,i=!1)=>{let s=[],o=0;for(let a of t){let d=n[a];for(let c of e){let u=an(a,c),l=De(a,c),m=r.entries[l];if(!i&&m?.hash===d){o+=1;continue}s.push({locale:c,sourceFile:a,sourceHash:d,targetFile:u})}}return{tasks:s,skippedCount:o}},dn=async e=>{await Lt(Bt(e),{recursive:!0})},ln=async(e,t,n)=>{let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:n})});if(!r.ok){let s=await r.text();throw new Error(`API request failed (${r.status}): ${s}`)}let i=await r.json();if(!i.translation)throw new Error("API response did not include a translation");return i.translation},pn=async(e,t,n)=>{let r=await Z(e.sourceFile,"utf8"),i=await ln(t,r,e.locale);await dn(e.targetFile),await jt(e.targetFile,i,"utf8"),n.entries[De(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},ke=async(e,t)=>{Jt("Translate MDX content");let n=e??Qt,r=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",i=tn(t.config??Wt),s=await rn(n);s.length===0&&(I.error(`No MDX files found matching pattern: ${n}`),L("Translation cancelled"),process.exit(1)),I.info(`Found ${s.length} MDX file(s) matching pattern`),i.length===0&&(i=await nn());let o=j(process.cwd(),ee),a=await sn();await Re(a),I.info(`Using cache: ${o}`);let d=await on(s),{tasks:c,skippedCount:u}=cn(i,s,d,a,t.force);if(c.length===0){I.success("All translations are up to date!"),L(`Skipped ${u} file(s) (unchanged)`);return}let l=[];for(let h=0;h<c.length;h+=Q)l.push(c.slice(h,h+Q));I.info(`Processing ${c.length} translation(s) in ${l.length} batch(es) of up to ${Q}`),u>0&&I.info(`Skipped ${u} translation(s) (unchanged)`);let m=Kt();m.start("Translating content...");let f=0;for(let h of l)await Promise.all(h.map(async x=>{await pn(x,r,a),f+=1,m.message(`Translated ${f}/${c.length}: ${Fe(process.cwd(),x.targetFile)}`)})),await Re(a);m.stop("Translation complete!"),L(`Created/updated ${c.length} file(s)`)};import{access as un,copyFile as gn,mkdir as Ne,rm as re}from"fs/promises";import{dirname as mn,join as v}from"path";import{intro as fn,log as w,outro as B,spinner as Ge}from"@clack/prompts";import{glob as hn}from"glob";var wn=["**/*"],yn=["content/docs/**"],te=".geistdocs-tmp",xn=async(e,t)=>{let n=v(e,t);await re(n,{recursive:!0,force:!0}),await Ne(n,{recursive:!0})},ne=async e=>await re(e,{recursive:!0,force:!0}),Ce=async(e,t,n)=>(await hn(e,{cwd:n,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),bn=async e=>{try{return await un(e),!0}catch{return!1}},En=async(e,t,n)=>{let r=v(t,e),i=v(n,e);return await bn(r)?(await gn(r,i),{success:!0}):{success:!1,error:`Source file not found: ${r}`}},Sn=async(e,t)=>{let n=v(t,e);return await re(n,{force:!0}),{success:!0}},Oe=20,$e=async(e,t,n)=>{let r=[];for(let i=0;i<e.length;i+=n){let s=e.slice(i,i+n),o=await Promise.all(s.map(t));r.push(...o)}return r},_n=async(e,t,n,r,i)=>{let s={success:[],deleted:[],failed:[]},o=[...new Set(e.map(d=>mn(v(r,d))))];i.message(`Creating ${o.length} directories...`),await Promise.all(o.map(d=>Ne(d,{recursive:!0}))),i.message(`Updating ${e.length} files...`);let a=await $e(e,async d=>{let c=await En(d,n,r);return{file:d,...c}},Oe);for(let{file:d,success:c,error:u}of a)c?s.success.push(d):s.failed.push({file:d,error:u??"Unknown error"});if(t.length>0){i.message(`Deleting ${t.length} files...`);let d=await $e(t,async c=>{try{return await Sn(c,r),{file:c,success:!0}}catch(u){let l=u instanceof Error?u.message:`${u}`;return{file:c,success:!1,error:l}}},Oe);for(let c of d)c.success?s.deleted.push(c.file):s.failed.push({file:c.file,error:c.error})}return s},Tn=e=>{if(e.success.length>0){w.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)w.info(` \u2713 ${t}`)}if(e.deleted.length>0){w.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)w.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){w.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:n}of e.failed)w.error(` \u2717 ${t}: ${n}`)}},In=e=>e.includes("canary")?"canary":"latest",vn=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(S)}`);if(!t.ok)throw new Error(`Failed to resolve ${S}@${e}`);let r=(await t.json())["dist-tags"]?.[e];if(!r)throw new Error(`Could not find dist-tag ${e} for ${S}`);return r},Pn=async e=>{let t=await M(e),n=J(t,S);if(!n)return{currentVersion:n,nextVersion:void 0,updated:!1};let r=In(n),i=await vn(r);return n===i?{currentVersion:n,nextVersion:i,updateTag:r,updated:!1}:($(t,S,i),await O(e,t),{currentVersion:n,nextVersion:i,updateTag:r,updated:!0})},An=async(e,t,n)=>{let r=await M(e);if(!le(r,S))return!1;t&&t.length>0&&w.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),n?.sync&&w.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:i,nextVersion:s,updateTag:o,updated:a}=await Pn(e);if(!a)return w.success(i?`@vercel/geistdocs is already at ${s} (${o}).`:"No package version update was needed."),B("Package-based site is already up to date."),!0;w.info(`Bumping ${S} from ${i} to ${s} (${o})`);let d=Ge();return d.start("Installing updated package version..."),await T("pnpm",["install"],{cwd:e}),d.stop("Package update complete!"),B("Please review and test the upgraded package version."),!0},Mn=async(e,t,n,r,i)=>{let s=v(e,te),o=Ge(),a=i?.sync?s:t;o.start("Preparing template snapshot..."),i?.sync&&(await xn(e,te),await N(s)),o.message("Scanning for files...");let d=await Ce(n,r,a),c=[];if(i?.sync){o.message("Comparing with local files...");let l=await Ce(n,r,e),m=new Set(d);c=l.filter(f=>!m.has(f))}if(o.stop(`Found ${d.length} files to update`),d.length===0&&c.length===0){w.warn("No files matched the patterns. Nothing to update."),i?.sync&&await ne(s),B("Update cancelled.");return}w.info(`Patterns: ${n.length}`),w.info(`Files to update: ${d.length}`),i?.sync&&w.info(`Files to delete: ${c.length}`),o.start("Updating files...");let u=await _n(d,c,a,e,o);i?.sync&&(o.message("Cleaning up..."),await ne(s)),o.stop("Update complete!"),Tn(u),B("Please review and test the changes carefully.")},Ue=async(e,t)=>{let n=process.cwd(),r=H(),i=e&&e.length>0?e:wn,s=e&&e.length>0?[]:yn;try{if(fn("Let's update your Geistdocs project!"),await An(n,e,t))return;w.info("Template source: bundled package snapshot"),e&&e.length>0&&w.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&w.info("Sync mode enabled: will delete files removed from template"),await Mn(n,r,i,s,t)}catch(o){let a=o instanceof Error?o.message:`${o}`;try{await ne(v(n,te))}catch{}w.error(`Failed to update project: ${a}`),process.exit(1)}};A.name("geistdocs").description("CLI for Geistdocs projects").version("2.14.2","-v, --version","Output the current version");A.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").addOption(new Rn("--brand <brand>","Navbar brand").choices(["vercel","labs"]).default("vercel")).option("--disable-git","Disable git initialization").action(he);A.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(Ue);A.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(ke);var Fn=A.command("search").description("Manage the external search index used by Ask AI");Fn.command("sync").description("Sync the latest static docs export to Mixedbread").option("--dir <path>","Next.js output directory",".next").option("--allow-non-production","Run outside a production Vercel build").action(Pe);await A.parseAsync(process.argv).catch(e=>{console.error(e instanceof Error?e.message:e),process.exitCode=1});
7
+ `));let o=await Ie({client:we({apiBaseUrl:process.env.MXBAI_BASE_URL,apiKey:r,storeId:i}),manifest:s,...Nt(n)});console.log(`Geistdocs search sync complete: ${o.uploaded} uploaded, ${o.deleted} deleted, ${o.skipped} unchanged.`)};import{readFileSync as Gt,writeFileSync as Ut}from"fs";import{mkdir as Lt,readFile as Z,writeFile as jt}from"fs/promises";import{dirname as Bt,extname as Vt,relative as Fe,resolve as j}from"path";import{intro as Jt,isCancel as Ht,log as I,multiselect as Xt,outro as L,spinner as Kt}from"@clack/prompts";import{glob as Yt}from"glob";import{Node as F,Project as qt,SyntaxKind as zt}from"ts-morph";var Wt="geistdocs.tsx",Qt="content/docs/**/*.mdx",ee=".translation-cache.json",Q=8,Ae=()=>({version:1,entries:{}}),Zt=async e=>{let t=await Z(e),{createHash:n}=await import("crypto");return n("sha256").update(t).digest("hex")},en=e=>{let t=j(process.cwd(),e);return Gt(t,"utf8")},Me=e=>F.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(F.isPropertyAssignment(t)){let n=t.getNameNode();if(F.isIdentifier(n)||F.isStringLiteral(n))return[n.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],tn=e=>{try{let t=new qt({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),n=en(e),s=t.createSourceFile(e,n,{overwrite:!0}).getVariableDeclarations().find(a=>a.getName()==="translations")?.getInitializer();if(!s)return[];if(F.isObjectLiteralExpression(s))return Me(s);let o=s.getFirstDescendantByKind(zt.ObjectLiteralExpression);return o?Me(o):[]}catch(t){let n=t instanceof Error?t.message:`${t}`;return I.warn(`Failed to read locales from ${e}: ${n}`),[]}},nn=async()=>{let e=await Xt({message:"Which locales should be translated?",options:[{value:"cn",label:"Chinese (cn)"},{value:"jp",label:"Japanese (jp)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"}],required:!0});return Ht(e)&&(L("Translation cancelled"),process.exit(0)),e},rn=async e=>(await Yt(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),sn=async()=>{let e=j(process.cwd(),ee);try{let t=await Z(e,"utf8"),n=JSON.parse(t);return n.version!==1||!n.entries?Ae():{version:1,entries:n.entries}}catch{return Ae()}},Re=e=>{let t=j(process.cwd(),ee),n=JSON.stringify(e,null,2);Ut(t,n,"utf8")},on=async e=>{let t=await Promise.all(e.map(async n=>[n,await Zt(n)]));return Object.fromEntries(t)},an=(e,t)=>{let n=Vt(e);return`${e.slice(0,-n.length)}.${t}${n}`},De=(e,t)=>`${Fe(process.cwd(),e)}::${t}`,cn=(e,t,n,r,i=!1)=>{let s=[],o=0;for(let a of t){let d=n[a];for(let c of e){let u=an(a,c),l=De(a,c),m=r.entries[l];if(!i&&m?.hash===d){o+=1;continue}s.push({locale:c,sourceFile:a,sourceHash:d,targetFile:u})}}return{tasks:s,skippedCount:o}},dn=async e=>{await Lt(Bt(e),{recursive:!0})},ln=async(e,t,n)=>{let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:n})});if(!r.ok){let s=await r.text();throw new Error(`API request failed (${r.status}): ${s}`)}let i=await r.json();if(!i.translation)throw new Error("API response did not include a translation");return i.translation},pn=async(e,t,n)=>{let r=await Z(e.sourceFile,"utf8"),i=await ln(t,r,e.locale);await dn(e.targetFile),await jt(e.targetFile,i,"utf8"),n.entries[De(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},ke=async(e,t)=>{Jt("Translate MDX content");let n=e??Qt,r=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",i=tn(t.config??Wt),s=await rn(n);s.length===0&&(I.error(`No MDX files found matching pattern: ${n}`),L("Translation cancelled"),process.exit(1)),I.info(`Found ${s.length} MDX file(s) matching pattern`),i.length===0&&(i=await nn());let o=j(process.cwd(),ee),a=await sn();await Re(a),I.info(`Using cache: ${o}`);let d=await on(s),{tasks:c,skippedCount:u}=cn(i,s,d,a,t.force);if(c.length===0){I.success("All translations are up to date!"),L(`Skipped ${u} file(s) (unchanged)`);return}let l=[];for(let h=0;h<c.length;h+=Q)l.push(c.slice(h,h+Q));I.info(`Processing ${c.length} translation(s) in ${l.length} batch(es) of up to ${Q}`),u>0&&I.info(`Skipped ${u} translation(s) (unchanged)`);let m=Kt();m.start("Translating content...");let f=0;for(let h of l)await Promise.all(h.map(async x=>{await pn(x,r,a),f+=1,m.message(`Translated ${f}/${c.length}: ${Fe(process.cwd(),x.targetFile)}`)})),await Re(a);m.stop("Translation complete!"),L(`Created/updated ${c.length} file(s)`)};import{access as un,copyFile as gn,mkdir as Ne,rm as re}from"fs/promises";import{dirname as mn,join as v}from"path";import{intro as fn,log as w,outro as B,spinner as Ge}from"@clack/prompts";import{glob as hn}from"glob";var wn=["**/*"],yn=["content/docs/**"],te=".geistdocs-tmp",xn=async(e,t)=>{let n=v(e,t);await re(n,{recursive:!0,force:!0}),await Ne(n,{recursive:!0})},ne=async e=>await re(e,{recursive:!0,force:!0}),Ce=async(e,t,n)=>(await hn(e,{cwd:n,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),bn=async e=>{try{return await un(e),!0}catch{return!1}},En=async(e,t,n)=>{let r=v(t,e),i=v(n,e);return await bn(r)?(await gn(r,i),{success:!0}):{success:!1,error:`Source file not found: ${r}`}},Sn=async(e,t)=>{let n=v(t,e);return await re(n,{force:!0}),{success:!0}},Oe=20,$e=async(e,t,n)=>{let r=[];for(let i=0;i<e.length;i+=n){let s=e.slice(i,i+n),o=await Promise.all(s.map(t));r.push(...o)}return r},_n=async(e,t,n,r,i)=>{let s={success:[],deleted:[],failed:[]},o=[...new Set(e.map(d=>mn(v(r,d))))];i.message(`Creating ${o.length} directories...`),await Promise.all(o.map(d=>Ne(d,{recursive:!0}))),i.message(`Updating ${e.length} files...`);let a=await $e(e,async d=>{let c=await En(d,n,r);return{file:d,...c}},Oe);for(let{file:d,success:c,error:u}of a)c?s.success.push(d):s.failed.push({file:d,error:u??"Unknown error"});if(t.length>0){i.message(`Deleting ${t.length} files...`);let d=await $e(t,async c=>{try{return await Sn(c,r),{file:c,success:!0}}catch(u){let l=u instanceof Error?u.message:`${u}`;return{file:c,success:!1,error:l}}},Oe);for(let c of d)c.success?s.deleted.push(c.file):s.failed.push({file:c.file,error:c.error})}return s},Tn=e=>{if(e.success.length>0){w.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)w.info(` \u2713 ${t}`)}if(e.deleted.length>0){w.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)w.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){w.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:n}of e.failed)w.error(` \u2717 ${t}: ${n}`)}},In=e=>e.includes("canary")?"canary":"latest",vn=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(S)}`);if(!t.ok)throw new Error(`Failed to resolve ${S}@${e}`);let r=(await t.json())["dist-tags"]?.[e];if(!r)throw new Error(`Could not find dist-tag ${e} for ${S}`);return r},Pn=async e=>{let t=await M(e),n=J(t,S);if(!n)return{currentVersion:n,nextVersion:void 0,updated:!1};let r=In(n),i=await vn(r);return n===i?{currentVersion:n,nextVersion:i,updateTag:r,updated:!1}:($(t,S,i),await O(e,t),{currentVersion:n,nextVersion:i,updateTag:r,updated:!0})},An=async(e,t,n)=>{let r=await M(e);if(!le(r,S))return!1;t&&t.length>0&&w.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),n?.sync&&w.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:i,nextVersion:s,updateTag:o,updated:a}=await Pn(e);if(!a)return w.success(i?`@vercel/geistdocs is already at ${s} (${o}).`:"No package version update was needed."),B("Package-based site is already up to date."),!0;w.info(`Bumping ${S} from ${i} to ${s} (${o})`);let d=Ge();return d.start("Installing updated package version..."),await T("pnpm",["install"],{cwd:e}),d.stop("Package update complete!"),B("Please review and test the upgraded package version."),!0},Mn=async(e,t,n,r,i)=>{let s=v(e,te),o=Ge(),a=i?.sync?s:t;o.start("Preparing template snapshot..."),i?.sync&&(await xn(e,te),await N(s)),o.message("Scanning for files...");let d=await Ce(n,r,a),c=[];if(i?.sync){o.message("Comparing with local files...");let l=await Ce(n,r,e),m=new Set(d);c=l.filter(f=>!m.has(f))}if(o.stop(`Found ${d.length} files to update`),d.length===0&&c.length===0){w.warn("No files matched the patterns. Nothing to update."),i?.sync&&await ne(s),B("Update cancelled.");return}w.info(`Patterns: ${n.length}`),w.info(`Files to update: ${d.length}`),i?.sync&&w.info(`Files to delete: ${c.length}`),o.start("Updating files...");let u=await _n(d,c,a,e,o);i?.sync&&(o.message("Cleaning up..."),await ne(s)),o.stop("Update complete!"),Tn(u),B("Please review and test the changes carefully.")},Ue=async(e,t)=>{let n=process.cwd(),r=H(),i=e&&e.length>0?e:wn,s=e&&e.length>0?[]:yn;try{if(fn("Let's update your Geistdocs project!"),await An(n,e,t))return;w.info("Template source: bundled package snapshot"),e&&e.length>0&&w.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&w.info("Sync mode enabled: will delete files removed from template"),await Mn(n,r,i,s,t)}catch(o){let a=o instanceof Error?o.message:`${o}`;try{await ne(v(n,te))}catch{}w.error(`Failed to update project: ${a}`),process.exit(1)}};A.name("geistdocs").description("CLI for Geistdocs projects").version("2.14.3-canary.9417d69","-v, --version","Output the current version");A.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").addOption(new Rn("--brand <brand>","Navbar brand").choices(["vercel","labs"]).default("vercel")).option("--disable-git","Disable git initialization").action(he);A.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(Ue);A.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(ke);var Fn=A.command("search").description("Manage the external search index used by Ask AI");Fn.command("sync").description("Sync the latest static docs export to Mixedbread").option("--dir <path>","Next.js output directory",".next").option("--allow-non-production","Run outside a production Vercel build").action(Pe);await A.parseAsync(process.argv).catch(e=>{console.error(e instanceof Error?e.message:e),process.exitCode=1});
@@ -1,6 +1,6 @@
1
1
  import type { ComponentProps } from "react";
2
- import ReactPlayer from "react-player";
3
- type VideoProps = ComponentProps<typeof ReactPlayer>;
2
+ import type ReactPlayerComponent from "react-player";
3
+ type VideoProps = ComponentProps<typeof ReactPlayerComponent>;
4
4
  export declare const Video: (props: VideoProps) => import("react/jsx-runtime").JSX.Element;
5
5
  export {};
6
6
  //# sourceMappingURL=video.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../src/components/video.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,KAAK,UAAU,GAAG,cAAc,CAAC,OAAO,WAAW,CAAC,CAAC;AAErD,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,4CAUtC,CAAC"}
1
+ {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../src/components/video.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,oBAAoB,MAAM,cAAc,CAAC;AAGrD,KAAK,UAAU,GAAG,cAAc,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE9D,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,4CAUtC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import ReactPlayer from "react-player";
2
+ import { ReactPlayer } from "../internal/lazy-mdx-components";
3
3
  export const Video = (props) => (_jsx("div", { className: "not-prose relative mb-6 aspect-video w-full overflow-hidden rounded-lg bg-black", children: _jsx(ReactPlayer, { ...props, className: "absolute inset-0", controls: true, height: "100%", width: "100%" }) }));
package/dist/config.d.ts CHANGED
@@ -10,6 +10,12 @@ export interface GeistdocsNavLink {
10
10
  external?: boolean;
11
11
  href: string;
12
12
  label: string;
13
+ /**
14
+ * Whether the link prefetches its page when it scrolls into view. Defaults
15
+ * to `true`. Set `false` for a large page most visitors never open (a long
16
+ * changelog, for example), so every page load does not download it.
17
+ */
18
+ prefetch?: boolean;
13
19
  }
14
20
  /** A link inside a navbar dropdown. */
15
21
  export interface GeistdocsNavDropdownItem {
@@ -96,6 +102,14 @@ export interface GeistdocsAIHistoryConfig {
96
102
  */
97
103
  retentionDays?: number;
98
104
  }
105
+ export interface GeistdocsSearchConfig extends GeistdocsFeatureConfig {
106
+ /**
107
+ * Label of the search buttons in the navbar, the mobile menu, and the
108
+ * mobile docs sidebar. Blank values use the default.
109
+ * @default "Search…"
110
+ */
111
+ buttonLabel?: string;
112
+ }
99
113
  export interface GeistdocsAIConfig extends GeistdocsFeatureConfig {
100
114
  /**
101
115
  * Label of the navbar button that opens the chat. Blank values use the
@@ -270,7 +284,7 @@ export interface GeistdocsConfig {
270
284
  navbarVariant?: "oss" | "standard";
271
285
  pageActions?: GeistdocsPageActionsConfig;
272
286
  prompt?: string;
273
- search?: GeistdocsFeatureConfig;
287
+ search?: GeistdocsSearchConfig;
274
288
  /**
275
289
  * Serve the site in one language without a `[lang]` route segment. App
276
290
  * routes live directly under `app/` instead of `app/[lang]/`, the proxy
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,GAAG,SAAS,WAO7D,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,UAAU,MAAM,GAAG,SAAS,WAoBvE,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,UAAU,MAAM,GAAG,SAAS,WAavE,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,UAAU,MAAM,GAAG,SAAS,WAWtE,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,uCAAuC;AACvC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,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istdocsChatController, GeistdocsChatPage, } from "./internal/cha
8
8
  export declare const useGeistdocsChat: () => GeistdocsChatController;
9
9
  interface SearchButtonProps {
10
10
  className?: string;
11
+ /**
12
+ * Button text. Defaults to `search.buttonLabel` from the config, then
13
+ * "Search…".
14
+ */
15
+ label?: string;
11
16
  onClick?: () => void;
12
17
  }
13
- export declare const SearchButton: ({ className, onClick }: SearchButtonProps) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const SearchButton: ({ className, label, onClick, }: SearchButtonProps) => import("react/jsx-runtime").JSX.Element;
14
19
  export declare const ThemeToggle: () => import("react/jsx-runtime").JSX.Element;
15
20
  export declare const LanguageSelector: () => import("react/jsx-runtime").JSX.Element | null;
16
21
  interface AskAIButtonProps {
@@ -1 +1 @@
1
- {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAC;AAWrE,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,yBAAyB,CAAC;AAQjC,YAAY,EACV,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAO,uBAwBnC,CAAC;AAEF,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,GAAI,wBAAwB,iBAAiB,4CAqBrE,CAAC;AAEF,eAAO,MAAM,WAAW,+CA0CvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDA+B5B,CAAC;AAEF,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM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GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;IACpD,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;CAChD;AAED,eAAO,MAAM,WAAW,GAAI,0DAOzB,gBAAgB,mDAgClB,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,qBAAqB,cAAc,SAc5D,CAAC"}
package/dist/controls.js CHANGED
@@ -9,6 +9,7 @@ import { Kbd } from "#geistdocs-ui/components/kbd";
9
9
  import { useTheme } from "#geistdocs-ui/core";
10
10
  import { cn } from "#geistdocs-ui/utils";
11
11
  import { useGeistdocsChatContext, } from "./internal/chat/context";
12
+ import { useOptionalGeistdocsConfig } from "./internal/config-context";
12
13
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "./internal/ui/dropdown-menu";
13
14
  /**
14
15
  * Control the Ask AI chat from custom components rendered inside
@@ -34,12 +35,17 @@ export const useGeistdocsChat = () => {
34
35
  },
35
36
  }), [ask, enabled, isOpen, openWithPage, setIsOpen]);
36
37
  };
37
- export const SearchButton = ({ className, onClick }) => {
38
+ const DEFAULT_SEARCH_LABEL = "Search…";
39
+ export const SearchButton = ({ className, label, onClick, }) => {
38
40
  const { setOpenSearch } = useSearchContext();
41
+ const config = useOptionalGeistdocsConfig();
42
+ const text = label?.trim() ||
43
+ config?.search?.buttonLabel?.trim() ||
44
+ DEFAULT_SEARCH_LABEL;
39
45
  return (_jsxs("button", { className: cn("flex h-8 cursor-pointer items-center justify-between rounded-md border-0 bg-background-100 py-0 pr-1.5 pl-3.5 font-normal font-sans text-gray-1000 text-sm shadow-[0_0_0_1px_var(--ds-gray-400)] outline-none hover:bg-gray-100 focus-visible:shadow-[var(--ds-focus-ring)]", className), onClick: () => {
40
46
  setOpenSearch(true);
41
47
  onClick?.();
42
- }, type: "button", children: [_jsx("span", { className: "pr-6", children: "Search\u2026" }), _jsx(Kbd, { className: "inline-flex items-center justify-center rounded", small: true, children: "\u2318K" })] }));
48
+ }, type: "button", children: [_jsx("span", { className: "pr-6", children: text }), _jsx(Kbd, { className: "inline-flex items-center justify-center rounded", small: true, children: "\u2318K" })] }));
43
49
  };
44
50
  export const ThemeToggle = () => {
45
51
  const { resolvedTheme, setTheme } = useTheme();
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/prompt-input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAIf,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,GAAI,6DAO7B,oBAAoB,4CAmFtB,CAAC"}
1
+ {"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/prompt-input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAIf,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,GAAI,6DAO7B,oBAAoB,4CAoFtB,CAAC"}
@@ -5,6 +5,7 @@ import { IconArrowUp, IconStopCircle } from "#geistdocs-assets/icons";
5
5
  import { Button } from "#geistdocs-ui/components/button";
6
6
  export const ChatPromptInput = ({ onChange, onStop, onSubmit, status, textareaRef, value, }) => {
7
7
  const isGenerating = status === "submitted" || status === "streaming";
8
+ const isEmpty = value.trim().length === 0;
8
9
  const adjustHeight = useCallback(() => {
9
10
  const textarea = textareaRef.current;
10
11
  if (!textarea) {
@@ -27,11 +28,11 @@ export const ChatPromptInput = ({ onChange, onStop, onSubmit, status, textareaRe
27
28
  !event.shiftKey &&
28
29
  !event.nativeEvent.isComposing) {
29
30
  event.preventDefault();
30
- if (value.trim().length <= 3) {
31
+ if (isEmpty) {
31
32
  return;
32
33
  }
33
34
  event.currentTarget.form?.requestSubmit();
34
35
  }
35
36
  };
36
- return (_jsx("div", { className: "cursor-text rounded-[12px] border border-gray-300 border-solid pt-2 pb-2 shadow-xs transition-colors duration-250 focus-within:border-gray-500", children: _jsxs("form", { className: "flex flex-col items-center gap-2", onSubmit: onSubmit, children: [_jsx("textarea", { className: "min-h-0 w-full resize-none rounded-none border-0 bg-transparent px-4 py-2 font-sans text-copy-16 text-gray-1000 shadow-none outline-hidden ring-0 placeholder:text-gray-600 focus:outline-none focus-visible:ring-0 min-[768px]:text-copy-14", maxLength: 1000, name: "message", onChange: handleChange, onKeyDown: handleKeyDown, placeholder: "Ask a question...", ref: textareaRef, value: value }), _jsx("div", { className: "flex w-full items-center justify-end px-2", children: isGenerating && onStop ? (_jsx(Button, { className: "animate-fade-in-scale", onClick: onStop, prefix: _jsx(IconStopCircle, { className: "size-4" }), size: "small", typeName: "button", children: "Stop" })) : (_jsx(Button, { "aria-label": "Submit", className: "size-8 animate-fade-in-scale p-0", disabled: value.trim().length <= 3, shape: "square", size: "small", svgOnly: true, typeName: "submit", children: _jsx(IconArrowUp, { className: "size-4" }) })) })] }) }));
37
+ return (_jsx("div", { className: "cursor-text rounded-[12px] border border-gray-300 border-solid pt-2 pb-2 shadow-xs transition-colors duration-250 focus-within:border-gray-500", children: _jsxs("form", { className: "flex flex-col items-center gap-2", onSubmit: onSubmit, children: [_jsx("textarea", { className: "min-h-0 w-full resize-none rounded-none border-0 bg-transparent px-4 py-2 font-sans text-copy-16 text-gray-1000 shadow-none outline-hidden ring-0 placeholder:text-gray-600 focus:outline-none focus-visible:ring-0 min-[768px]:text-copy-14", maxLength: 1000, name: "message", onChange: handleChange, onKeyDown: handleKeyDown, placeholder: "Ask a question...", ref: textareaRef, value: value }), _jsx("div", { className: "flex w-full items-center justify-end px-2", children: isGenerating && onStop ? (_jsx(Button, { className: "animate-fade-in-scale", onClick: onStop, prefix: _jsx(IconStopCircle, { className: "size-4" }), size: "small", typeName: "button", children: "Stop" })) : (_jsx(Button, { "aria-label": "Submit", className: "size-8 animate-fade-in-scale p-0", disabled: isEmpty, shape: "square", size: "small", svgOnly: true, typeName: "submit", children: _jsx(IconArrowUp, { className: "size-4" }) })) })] }) }));
37
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/shell.tsx"],"names":[],"mappings":"AA6eA,eAAO,MAAM,kBAAkB,sDAiE9B,CAAC"}
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/shell.tsx"],"names":[],"mappings":"AAgfA,eAAO,MAAM,kBAAkB,sDAiE9B,CAAC"}
@@ -106,7 +106,6 @@ const GeistdocsChatPanel = ({ clearConversation, expandable, session, textareaRe
106
106
  try {
107
107
  await clearConversation();
108
108
  commands.detachPage();
109
- toast.success({ text: "Chat cleared" });
110
109
  }
111
110
  catch (error) {
112
111
  toast.error({
@@ -136,7 +135,10 @@ const GeistdocsChatPanel = ({ clearConversation, expandable, session, textareaRe
136
135
  // position is its identity.
137
136
  // biome-ignore lint/suspicious/noArrayIndexKey: text parts have no ID and only append
138
137
  _jsx(MessageContent, { children: _jsx(MessageResponse, { className: "text-wrap", children: part.text }) }, `${message.id}-${partIndex}`))), _jsx(MessageActions, { index: index, messages: messages, setMessages: setMessages, status: status })] }, message.id));
139
- }), shouldShowPendingActivity({ messages, status }) ? (_jsxs("div", { className: "h-12 animate-pulse pt-2 text-gray-900 text-sm", children: [_jsx(DotsSpinner, {}), _jsx("span", { className: "sr-only", children: "Thinking\u2026" })] })) : null] }), _jsx(ConversationScrollButton, {})] }), _jsxs("div", { className: cn("relative grid w-auto shrink-0 gap-3 whitespace-normal p-4 text-left", isExpanded && EXPANDED_COLUMN), children: [messages.length ? null : (_jsxs(_Fragment, { children: [_jsx(Suggestions, { className: "w-full cursor-text", children: suggestions.map((suggestion) => (_jsx(Suggestion, { className: "w-full", icon: suggestion.icon, onClick: handleSuggestionClick, suggestion: suggestion.text, variant: "tertiary" }, suggestion.key))) }), _jsxs("p", { className: "mb-3 whitespace-normal px-2 text-left text-gray-900 text-label-14", children: ["Tip: You can open and close chat with", _jsx(Kbd, { className: "material-base ml-1.5 text-gray-900", meta: true, small: true }), _jsx(Kbd, { className: "material-base ml-1 font-mono! text-gray-900", small: true, children: "I" })] })] })), commandState.attachedPage ? (_jsx(ChatPageAttachmentCard, { onRemove: commands.detachPage, page: commandState.attachedPage })) : null, _jsx(ChatPromptInput, { onChange: setPrompt, onStop: stop, onSubmit: (event) => {
138
+ }), shouldShowPendingActivity({ messages, status }) ? (
139
+ // Wrapped like the assistant message that replaces it, so the
140
+ // spinner stays in place when the response starts streaming.
141
+ _jsx(Message, { from: "assistant", children: _jsxs("div", { className: "h-12 animate-pulse pt-2 text-gray-900 text-sm", children: [_jsx(DotsSpinner, {}), _jsx("span", { className: "sr-only", children: "Thinking\u2026" })] }) })) : null] }), _jsx(ConversationScrollButton, {})] }), _jsxs("div", { className: cn("relative grid w-auto shrink-0 gap-3 whitespace-normal p-4 text-left", isExpanded && EXPANDED_COLUMN), children: [messages.length ? null : (_jsxs(_Fragment, { children: [_jsx(Suggestions, { className: "w-full cursor-text", children: suggestions.map((suggestion) => (_jsx(Suggestion, { className: "w-full", icon: suggestion.icon, onClick: handleSuggestionClick, suggestion: suggestion.text, variant: "tertiary" }, suggestion.key))) }), _jsxs("p", { className: "mb-3 whitespace-normal px-2 text-left text-gray-900 text-label-14", children: ["Tip: You can open and close chat with", _jsx(Kbd, { className: "material-base ml-1.5 text-gray-900", meta: true, small: true }), _jsx(Kbd, { className: "material-base ml-1 font-mono! text-gray-900", small: true, children: "I" })] })] })), commandState.attachedPage ? (_jsx(ChatPageAttachmentCard, { onRemove: commands.detachPage, page: commandState.attachedPage })) : null, _jsx(ChatPromptInput, { onChange: setPrompt, onStop: stop, onSubmit: (event) => {
140
142
  event.preventDefault();
141
143
  handleSubmit().catch((error) => {
142
144
  console.error("Failed to submit chat message:", error);
@@ -1,6 +1,8 @@
1
1
  import { type ReactNode } from "react";
2
2
  import type { GeistdocsConfig } from "../config";
3
3
  export declare const useGeistdocsConfig: () => GeistdocsConfig;
4
+ /** Like `useGeistdocsConfig`, but returns null outside a GeistdocsProvider. */
5
+ export declare const useOptionalGeistdocsConfig: () => GeistdocsConfig | null;
4
6
  interface GeistdocsConfigProviderProps {
5
7
  children: ReactNode;
6
8
  config: GeistdocsConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"config-context.d.ts","sourceRoot":"","sources":["../../src/internal/config-context.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAIjD,eAAO,MAAM,kBAAkB,QAAO,eAUrC,CAAC;AAEF,UAAU,4BAA4B;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,eAAO,MAAM,uBAAuB,GAAI,uBAGrC,4BAA4B,4CAQ9B,CAAC"}
1
+ {"version":3,"file":"config-context.d.ts","sourceRoot":"","sources":["../../src/internal/config-context.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAIjD,eAAO,MAAM,kBAAkB,QAAO,eAUrC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,0BAA0B,QAAO,eAAe,GAAG,IAC5B,CAAC;AAErC,UAAU,4BAA4B;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,eAAO,MAAM,uBAAuB,GAAI,uBAGrC,4BAA4B,4CAQ9B,CAAC"}
@@ -9,6 +9,8 @@ export const useGeistdocsConfig = () => {
9
9
  }
10
10
  return context;
11
11
  };
12
+ /** Like `useGeistdocsConfig`, but returns null outside a GeistdocsProvider. */
13
+ export const useOptionalGeistdocsConfig = () => useContext(GeistdocsConfigContext);
12
14
  export const GeistdocsConfigProvider = ({ children, config, }) => {
13
15
  const value = useMemo(() => config, [config]);
14
16
  return (_jsx(GeistdocsConfigContext.Provider, { value: value, children: children }));
@@ -0,0 +1,21 @@
1
+ import type { ComponentProps, ComponentType } from "react";
2
+ import type ReactPlayerComponent from "react-player";
3
+ import type * as TabsModule from "#geistdocs-ui/components/tabs";
4
+ import type * as CodeBlockTabsModule from "../components/code-block-tabs";
5
+ import type * as CopyPromptModule from "../components/copy-prompt";
6
+ import type * as MermaidModule from "../components/mermaid";
7
+ import type * as TabsWithChildrenModule from "../components/tabs-with-children";
8
+ type Lazy<T extends ComponentType<any>> = ComponentType<ComponentProps<T>>;
9
+ export declare const CopyPrompt: Lazy<typeof CopyPromptModule.CopyPrompt>;
10
+ export declare const Mermaid: Lazy<typeof MermaidModule.Mermaid>;
11
+ export declare const TabsWithChildren: Lazy<typeof TabsWithChildrenModule.TabsWithChildren>;
12
+ export declare const TabContent: Lazy<typeof TabsWithChildrenModule.TabContent>;
13
+ export declare const CodeBlockTabs: Lazy<typeof CodeBlockTabsModule.CodeBlockTabs>;
14
+ export declare const CompactCodeBlockTabs: Lazy<typeof CodeBlockTabsModule.CompactCodeBlockTabs>;
15
+ export declare const CodeBlockTabsList: Lazy<typeof CodeBlockTabsModule.CodeBlockTabsList>;
16
+ export declare const CodeBlockTabsTrigger: Lazy<typeof CodeBlockTabsModule.CodeBlockTabsTrigger>;
17
+ export declare const CodeBlockTab: Lazy<typeof CodeBlockTabsModule.CodeBlockTab>;
18
+ export declare const Tabs: Lazy<typeof TabsModule.Tabs>;
19
+ export declare const ReactPlayer: Lazy<typeof ReactPlayerComponent>;
20
+ export {};
21
+ //# sourceMappingURL=lazy-mdx-components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy-mdx-components.d.ts","sourceRoot":"","sources":["../../src/internal/lazy-mdx-components.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,oBAAoB,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,KAAK,UAAU,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,KAAK,mBAAmB,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,KAAK,aAAa,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,KAAK,sBAAsB,MAAM,kCAAkC,CAAC;AAShF,KAAK,IAAI,CAAC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3E,eAAO,MAAM,UAAU,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAAC,UAAU,CAE/D,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,IAAI,CAAC,OAAO,aAAa,CAAC,OAAO,CAEtD,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,IAAI,CACjC,OAAO,sBAAsB,CAAC,gBAAgB,CAG/C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,IAAI,CAAC,OAAO,sBAAsB,CAAC,UAAU,CAGnE,CAAC;AAEJ,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,OAAO,mBAAmB,CAAC,aAAa,CAGtE,CAAC;AAEJ,eAAO,MAAM,oBAAoB,EAAE,IAAI,CACrC,OAAO,mBAAmB,CAAC,oBAAoB,CAKhD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,IAAI,CAClC,OAAO,mBAAmB,CAAC,iBAAiB,CAG7C,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,IAAI,CACrC,OAAO,mBAAmB,CAAC,oBAAoB,CAKhD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,IAAI,CAAC,OAAO,mBAAmB,CAAC,YAAY,CAGpE,CAAC;AAEJ,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAAC,IAAI,CAE7C,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,IAAI,CAAC,OAAO,oBAAoB,CAEzD,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import dynamic from "next/dynamic";
3
+ export const CopyPrompt = dynamic(() => import("../components/copy-prompt").then((mod) => mod.CopyPrompt));
4
+ export const Mermaid = dynamic(() => import("../components/mermaid").then((mod) => mod.Mermaid));
5
+ export const TabsWithChildren = dynamic(() => import("../components/tabs-with-children").then((mod) => mod.TabsWithChildren));
6
+ export const TabContent = dynamic(() => import("../components/tabs-with-children").then((mod) => mod.TabContent));
7
+ export const CodeBlockTabs = dynamic(() => import("../components/code-block-tabs").then((mod) => mod.CodeBlockTabs));
8
+ export const CompactCodeBlockTabs = dynamic(() => import("../components/code-block-tabs").then((mod) => mod.CompactCodeBlockTabs));
9
+ export const CodeBlockTabsList = dynamic(() => import("../components/code-block-tabs").then((mod) => mod.CodeBlockTabsList));
10
+ export const CodeBlockTabsTrigger = dynamic(() => import("../components/code-block-tabs").then((mod) => mod.CodeBlockTabsTrigger));
11
+ export const CodeBlockTab = dynamic(() => import("../components/code-block-tabs").then((mod) => mod.CodeBlockTab));
12
+ export const Tabs = dynamic(() => import("#geistdocs-ui/components/tabs").then((mod) => mod.Tabs));
13
+ export const ReactPlayer = dynamic(() => import("react-player"));
@@ -2,12 +2,14 @@ import type { AnchorHTMLAttributes, ReactNode } from "react";
2
2
  interface LocalizedLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
3
3
  children: ReactNode;
4
4
  href: string;
5
+ /** Defaults to `true`; `false` skips viewport prefetching. */
6
+ prefetch?: boolean;
5
7
  }
6
8
  /**
7
9
  * Resolve an app-local href against the active language segment. See
8
10
  * `localizeHref` for the prefixing rules.
9
11
  */
10
12
  export declare const useLocalizedHref: (href: string) => string;
11
- export declare const LocalizedLink: ({ href, ...props }: LocalizedLinkProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const LocalizedLink: ({ href, prefetch, ...props }: LocalizedLinkProps) => import("react/jsx-runtime").JSX.Element;
12
14
  export {};
13
15
  //# sourceMappingURL=localized-link.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"localized-link.d.ts","sourceRoot":"","sources":["../../src/internal/localized-link.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI7D,UAAU,kBAAmB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,MAQ/C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,oBAAoB,kBAAkB,4CAInE,CAAC"}
1
+ {"version":3,"file":"localized-link.d.ts","sourceRoot":"","sources":["../../src/internal/localized-link.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI7D,UAAU,kBAAmB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,MAQ/C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,8BAI3B,kBAAkB,4CAIpB,CAAC"}
@@ -16,7 +16,7 @@ export const useLocalizedHref = (href) => {
16
16
  const language = typeof params?.lang === "string" ? params.lang : undefined;
17
17
  return localizeHref(href, language, defaultLanguage);
18
18
  };
19
- export const LocalizedLink = ({ href, ...props }) => {
19
+ export const LocalizedLink = ({ href, prefetch = true, ...props }) => {
20
20
  const localizedHref = useLocalizedHref(href);
21
- return _jsx(Link, { href: localizedHref, prefetch: true, ...props });
21
+ return _jsx(Link, { href: localizedHref, prefetch: prefetch, ...props });
22
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"desktop-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/desktop-menu.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAatB,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAiBD,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,wBAAwB,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,oBAAoB,GAC7B,eAAe,EAAE,CAYnB;AA+DD,eAAO,MAAM,WAAW,GAAI,sBAAsB,gBAAgB,4CAuEjE,CAAC"}
1
+ {"version":3,"file":"desktop-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/desktop-menu.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAatB,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAiBD,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,wBAAwB,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,oBAAoB,GAC7B,eAAe,EAAE,CAYnB;AA+DD,eAAO,MAAM,WAAW,GAAI,sBAAsB,gBAAgB,4CAyEjE,CAAC"}
@@ -51,5 +51,5 @@ const DropdownNavItem = ({ first, item, navItems, }) => {
51
51
  export const DesktopMenu = ({ items, className }) => {
52
52
  const isActive = useNavActive(items);
53
53
  const [navOpen, setNavOpen] = useState(false);
54
- return (_jsxs(_Fragment, { children: [_jsx(NavigationMenu, { "aria-label": "Primary navigation", delayDuration: 0, onValueChange: (value) => setNavOpen(Boolean(value)), skipDelayDuration: 0, viewport: false, children: _jsx(NavigationMenuList, { className: cn("h-16 items-stretch gap-0", className), children: items.map((item, index) => "items" in item ? (_jsx(DropdownNavItem, { first: index === 0, item: item, navItems: items }, item.label)) : (_jsx(NavigationMenuItem, { className: "flex", children: _jsx(NavigationMenuLink, { active: isActive(item.href), asChild: true, className: topLevelItemClassName(index === 0), children: item.href.startsWith("http") ? (_jsxs("a", { className: "flex flex-row items-center gap-1", href: item.href, rel: "noopener", target: "_blank", children: [item.label, _jsx(IconArrowUpRightSmall, { "aria-hidden": "true", className: cn(navOpen && "will-change-transform"), size: 12 })] })) : (_jsx(LocalizedLink, { href: item.href, children: item.label })) }) }, item.href))) }) }), _jsx("div", { "aria-hidden": "true", className: cn("pointer-events-none fixed inset-x-0 top-16 bottom-0 z-0 bg-background-200/60", navOpen ? "opacity-100" : "opacity-0") })] }));
54
+ return (_jsxs(_Fragment, { children: [_jsx(NavigationMenu, { "aria-label": "Primary navigation", delayDuration: 0, onValueChange: (value) => setNavOpen(Boolean(value)), skipDelayDuration: 0, viewport: false, children: _jsx(NavigationMenuList, { className: cn("h-16 items-stretch gap-0", className), children: items.map((item, index) => "items" in item ? (_jsx(DropdownNavItem, { first: index === 0, item: item, navItems: items }, item.label)) : (_jsx(NavigationMenuItem, { className: "flex", children: _jsx(NavigationMenuLink, { active: isActive(item.href), asChild: true, className: topLevelItemClassName(index === 0), children: item.href.startsWith("http") ? (_jsxs("a", { className: "flex flex-row items-center gap-1", href: item.href, rel: "noopener", target: "_blank", children: [item.label, _jsx(IconArrowUpRightSmall, { "aria-hidden": "true", className: cn(navOpen && "will-change-transform"), size: 12 })] })) : (_jsx(LocalizedLink, { href: item.href, prefetch: item.prefetch, children: item.label })) }) }, item.href))) }) }), _jsx("div", { "aria-hidden": "true", className: cn("pointer-events-none fixed inset-x-0 top-16 bottom-0 z-0 bg-background-200/60", navOpen ? "opacity-100" : "opacity-0") })] }));
55
55
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mobile-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/mobile-menu.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,yBAAyB,EAEzB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAQtB,UAAU,eAAe;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,EAAE,gBAAgB,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;IAC1C,4EAA4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAobD,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,4CAEhD,CAAC"}
1
+ {"version":3,"file":"mobile-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/mobile-menu.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,yBAAyB,EAEzB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAQtB,UAAU,eAAe;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,EAAE,gBAAgB,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;IAC1C,4EAA4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA2bD,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,4CAEhD,CAAC"}
@@ -12,12 +12,12 @@ import { LocalizedLink } from "../localized-link";
12
12
  import { groupDropdownItems } from "./desktop-menu";
13
13
  import { DEFAULT_OSS_SECTION, resolveOssProducts } from "./navbar-logo";
14
14
  import { useNavActive } from "./use-nav-active";
15
- function NavLink({ href, external, active, onClick, children, }) {
15
+ function NavLink({ href, external, active, onClick, prefetch, children, }) {
16
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) {
20
- return (_jsx(LocalizedLink, { "aria-current": active ? "page" : undefined, className: className, href: href, onClick: onClick, children: content }));
20
+ return (_jsx(LocalizedLink, { "aria-current": active ? "page" : undefined, className: className, href: href, onClick: onClick, prefetch: prefetch, children: content }));
21
21
  }
22
22
  return (_jsx("a", { className: className, href: href, onClick: onClick, rel: "noopener noreferrer", target: "_blank", children: content }));
23
23
  }
@@ -141,6 +141,6 @@ const MobileMenuState = ({ activeProduct, githubUrl, nav, ossProducts, showOss =
141
141
  };
142
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
143
143
  ? "pointer-events-auto opacity-100"
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 }) })] })] }));
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, prefetch: show && item.prefetch !== false, 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 }) })] })] }));
145
145
  };
146
146
  export const MobileMenu = (props) => (_jsx(MobileMenuState, { ...props }, usePathname()));
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
- import type { GeistdocsNavbarBrand, GeistdocsNavbarOssProduct } from "../../config";
2
+ import type { GeistdocsNavbarOssProduct } from "../../config";
3
3
  export declare const DEFAULT_OSS_SECTION = "Open Source";
4
4
  export declare const DEFAULT_OSS_PRODUCTS: GeistdocsNavbarOssProduct[];
5
5
  /**
@@ -25,7 +25,11 @@ export declare function PanelLink({ active, product, }: {
25
25
  */
26
26
  export declare function resolveOssProducts(products: GeistdocsNavbarOssProduct[] | undefined, activeProduct: string | undefined): GeistdocsNavbarOssProduct[];
27
27
  type NavbarLogoProps = {
28
- brand?: GeistdocsNavbarBrand;
28
+ /**
29
+ * The Vercel mark, rendered by the server navbar so its SVGs (the Labs
30
+ * wordmark is ~10 KB) stay out of this client module's bundle.
31
+ */
32
+ brandMark: ReactNode;
29
33
  className?: string;
30
34
  href?: string;
31
35
  } & ({
@@ -37,6 +41,6 @@ type NavbarLogoProps = {
37
41
  logo: ReactNode;
38
42
  variant?: "standard";
39
43
  });
40
- export declare function NavbarLogo({ brand, className, href, ...props }: NavbarLogoProps): import("react/jsx-runtime").JSX.Element;
44
+ export declare function NavbarLogo({ brandMark, className, href, ...props }: NavbarLogoProps): import("react/jsx-runtime").JSX.Element;
41
45
  export {};
42
46
  //# sourceMappingURL=navbar-logo.d.ts.map
@@ -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;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,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U,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CA2MjB"}
@@ -9,7 +9,6 @@ import { LogoEveSvg } from "#geistdocs-assets/logos";
9
9
  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
- import { NavbarBrand } from "./navbar-brand";
13
12
  import { useServerPanelMount } from "./use-server-panel-mount";
14
13
  export const DEFAULT_OSS_SECTION = "Open Source";
15
14
  export const DEFAULT_OSS_PRODUCTS = [
@@ -145,7 +144,7 @@ function OssFeaturedCard({ product }) {
145
144
  export function resolveOssProducts(products, activeProduct) {
146
145
  return (products ?? DEFAULT_OSS_PRODUCTS).filter((product) => product.id !== activeProduct && product.href !== activeProduct);
147
146
  }
148
- export function NavbarLogo({ brand, className, href = "/", ...props }) {
147
+ export function NavbarLogo({ brandMark, className, href = "/", ...props }) {
149
148
  const isOss = props.variant === "oss";
150
149
  const ossProducts = isOss
151
150
  ? resolveOssProducts(props.ossProducts, props.activeProduct)
@@ -187,7 +186,7 @@ export function NavbarLogo({ brand, className, href = "/", ...props }) {
187
186
  }
188
187
  }, [pathname]);
189
188
  useEffect(() => () => window.clearTimeout(pointerLeaveTimeoutRef.current), []);
190
- return (_jsxs("span", { className: cn("flex items-center gap-2.5", className), children: [_jsx(NavbarBrand, { brand: brand, variant: props.variant }), _jsx("div", { className: "w-5 text-center text-gray-alpha-400 text-lg dark:text-gray-600", children: _jsx(IconSlashForward, { size: 20 }) }), isOss ? (_jsxs(_Fragment, { children: [_jsx(Link, { className: "flex @min-[1024px]:hidden items-center text-gray-1000", href: localizedHref, prefetch: true, children: props.logo }), _jsxs("div", { className: "@min-[1024px]:contents hidden", children: [_jsx(NavigationMenu, { "aria-label": "Product navigation", delayDuration: 0, onValueChange: (value) => {
189
+ return (_jsxs("span", { className: cn("flex items-center gap-2.5", className), children: [brandMark, _jsx("div", { className: "w-5 text-center text-gray-alpha-400 text-lg dark:text-gray-600", children: _jsx(IconSlashForward, { size: 20 }) }), isOss ? (_jsxs(_Fragment, { children: [_jsx(Link, { className: "flex @min-[1024px]:hidden items-center text-gray-1000", href: localizedHref, prefetch: true, children: props.logo }), _jsxs("div", { className: "@min-[1024px]:contents hidden", children: [_jsx(NavigationMenu, { "aria-label": "Product navigation", delayDuration: 0, onValueChange: (value) => {
191
190
  if (value && suppressLogoHoverRef.current) {
192
191
  return;
193
192
  }
package/dist/mdx.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAgC/C,OAAO,KAAK,EAAE,4BAA4B,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAK3F,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAC1C,MAAM,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEnD,eAAO,MAAM,yBAAyB,GACpC,aAAa,sBAAsB,KAClC,sBA6DD,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAC9B,aAAa,sBAAsB,KAClC,sBAA+D,CAAC;AAEnE,eAAO,MAAM,2BAA2B,GACtC,GAAG,eAAe,KAAK,CAAC,sBAAsB,GAAG,SAAS,CAAC,KAC1D,sBACkD,CAAC"}
1
+ {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAiC/C,OAAO,KAAK,EAAE,4BAA4B,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAK3F,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAC1C,MAAM,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEnD,eAAO,MAAM,yBAAyB,GACpC,aAAa,sBAAsB,KAClC,sBA6DD,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAC9B,aAAa,sBAAsB,KAClC,sBAA+D,CAAC;AAEnE,eAAO,MAAM,2BAA2B,GACtC,GAAG,eAAe,KAAK,CAAC,sBAAsB,GAAG,SAAS,CAAC,KAC1D,sBACkD,CAAC"}
package/dist/mdx.js CHANGED
@@ -1,23 +1,19 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import defaultMdxComponents from "fumadocs-ui/mdx";
3
3
  import Link from "next/link";
4
- import { Tabs } from "#geistdocs-ui/components/tabs";
5
4
  import { cn } from "#geistdocs-ui/utils";
6
5
  import { Blockquote } from "./components/blockquote";
7
6
  import { Button } from "./components/button";
8
7
  import { Callout, CalloutContainer, CalloutDescription, CalloutTitle, } from "./components/callout";
9
8
  import { CodeBlock } from "./components/code-block";
10
- import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CompactCodeBlockTabs, } from "./components/code-block-tabs";
11
- import { CopyPrompt } from "./components/copy-prompt";
12
9
  import { Details, Summary } from "./components/details";
13
10
  import { Heading } from "./components/heading";
14
11
  import { Image } from "./components/image";
15
- import { Mermaid } from "./components/mermaid";
16
12
  import { Step, Steps } from "./components/steps";
17
13
  import { Table } from "./components/table";
18
- import { TabContent, TabsWithChildren } from "./components/tabs-with-children";
19
14
  import { TypeTable } from "./components/type-table";
20
15
  import { Video } from "./components/video";
16
+ import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CompactCodeBlockTabs, CopyPrompt, Mermaid, TabContent, Tabs, TabsWithChildren, } from "./internal/lazy-mdx-components";
21
17
  import { LocalizedLink } from "./internal/localized-link";
22
18
  import { geistShikiTheme as shikiTheme } from "./shiki-theme";
23
19
  // The source-config exports live on @vercel/geistdocs/source-config. Importing
@@ -1 +1 @@
1
- {"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../src/navbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQhD,UAAU,WAAW;IACnB,MAAM,EAAE,IAAI,CACV,eAAe,EACb,IAAI,GACJ,QAAQ,GACR,MAAM,GACN,UAAU,GACV,KAAK,GACL,qBAAqB,GACrB,aAAa,GACb,cAAc,GACd,mBAAmB,GACnB,eAAe,CAClB,CAAC;CACH;AAKD,eAAO,MAAM,MAAM,GAAI,YAAY,WAAW,4CA2E7C,CAAC"}
1
+ {"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../src/navbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAShD,UAAU,WAAW;IACnB,MAAM,EAAE,IAAI,CACV,eAAe,EACb,IAAI,GACJ,QAAQ,GACR,MAAM,GACN,UAAU,GACV,KAAK,GACL,qBAAqB,GACrB,aAAa,GACb,cAAc,GACd,mBAAmB,GACnB,eAAe,CAClB,CAAC;CACH;AAKD,eAAO,MAAM,MAAM,GAAI,YAAY,WAAW,4CA8E7C,CAAC"}
package/dist/navbar.js CHANGED
@@ -3,6 +3,7 @@ import { AskAIButton, SearchButton } from "./controls";
3
3
  import { GitHubButton, getGithubRepoUrl } from "./internal/github-button";
4
4
  import { DesktopMenu } from "./internal/navbar/desktop-menu";
5
5
  import { MobileMenu } from "./internal/navbar/mobile-menu";
6
+ import { NavbarBrand } from "./internal/navbar/navbar-brand";
6
7
  import { NavbarLogo } from "./internal/navbar/navbar-logo";
7
8
  import { NavbarShell } from "./internal/navbar/navbar-shell";
8
9
  // const SEARCH_BUTTON_CLASSES =
@@ -18,5 +19,6 @@ export const Navbar = ({ config }) => {
18
19
  // The default product list lives in a "use client" module, so it is resolved
19
20
  // and filtered inside the mobile menu.
20
21
  const activeProduct = config.navbarActiveProduct;
21
- return (_jsx(NavbarShell, { children: _jsxs("div", { className: "@container mx-auto flex w-full max-w-[1448px] justify-between px-2", children: [_jsxs("div", { className: "flex select-none flex-row items-center", children: [isOss ? (_jsx(NavbarLogo, { activeProduct: activeProduct, brand: config.navbarBrand, className: "ml-4", href: config.logoHref, logo: config.logo, ossProducts: config.navbarOssProducts, variant: "oss" })) : (_jsx(NavbarLogo, { brand: config.navbarBrand, className: "ml-4", href: config.logoHref, logo: config.logo, variant: "standard" })), _jsx(DesktopMenu, { className: "@min-[1024px]:flex hidden", items: nav })] }), _jsxs("div", { className: "mr-4 flex flex-row items-center justify-end gap-2", children: [_jsx(SearchButton, { className: "@min-[1024px]:flex hidden w-36" }), _jsx(AskAIButton, { className: "@min-[768px]:flex hidden shrink-0", size: "small", variant: "secondary", children: askLabel }), _jsx(AskAIButton, { className: "@min-[768px]:hidden", size: "small", variant: "secondary", children: askLabel }), showGithub ? (_jsx(GitHubButton, { className: "@min-[768px]:inline-flex hidden shrink-0", github: config.github })) : null, _jsx(MobileMenu, { activeProduct: activeProduct, githubUrl: githubUrl, nav: nav, ossProducts: config.navbarOssProducts, showOss: isOss })] })] }) }));
22
+ const brandMark = (_jsx(NavbarBrand, { brand: config.navbarBrand, variant: variant }));
23
+ return (_jsx(NavbarShell, { children: _jsxs("div", { className: "@container mx-auto flex w-full max-w-[1448px] justify-between px-2", children: [_jsxs("div", { className: "flex select-none flex-row items-center", children: [isOss ? (_jsx(NavbarLogo, { activeProduct: activeProduct, brandMark: brandMark, className: "ml-4", href: config.logoHref, logo: config.logo, ossProducts: config.navbarOssProducts, variant: "oss" })) : (_jsx(NavbarLogo, { brandMark: brandMark, className: "ml-4", href: config.logoHref, logo: config.logo, variant: "standard" })), _jsx(DesktopMenu, { className: "@min-[1024px]:flex hidden", items: nav })] }), _jsxs("div", { className: "mr-4 flex flex-row items-center justify-end gap-2", children: [_jsx(SearchButton, { className: "@min-[1024px]:flex hidden w-36" }), _jsx(AskAIButton, { className: "@min-[768px]:flex hidden shrink-0", size: "small", variant: "secondary", children: askLabel }), _jsx(AskAIButton, { className: "@min-[768px]:hidden", size: "small", variant: "secondary", children: askLabel }), showGithub ? (_jsx(GitHubButton, { className: "@min-[768px]:inline-flex hidden shrink-0", github: config.github })) : null, _jsx(MobileMenu, { activeProduct: activeProduct, githubUrl: githubUrl, nav: nav, ossProducts: config.navbarOssProducts, showOss: isOss })] })] }) }));
22
24
  };
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.2 so agents can understand the installed package without web access.
3
+ These docs are bundled with `@vercel/geistdocs` 2.14.3-canary.9417d69 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.2.
3
+ These docs are bundled with `@vercel/geistdocs` 2.14.3-canary.9417d69.
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
@@ -1248,6 +1248,19 @@ Labs links to [vercel.com/labs](https://vercel.com/labs) and adapts to light and
1248
1248
 
1249
1249
  For new projects, both CLIs accept `--brand labs`; omitting it or using `--brand vercel` preserves the defaults. See [Create a Labs starter](/docs/getting-started#create-a-labs-starter).
1250
1250
 
1251
+ ### Skip prefetching a navbar link
1252
+
1253
+ Navbar links prefetch their page as soon as they are visible, so a click renders it instantly. Every page load downloads those pages, so set `prefetch: false` on a link to a large page most visitors skip:
1254
+
1255
+ ```tsx title="geistdocs.tsx"
1256
+ export const nav = [
1257
+ { label: "Docs", href: "/docs" },
1258
+ { label: "Changelog", href: "/changelog", prefetch: false },
1259
+ ];
1260
+ ```
1261
+
1262
+ The page then loads when the link is clicked.
1263
+
1251
1264
  ### Group navbar links into a dropdown
1252
1265
 
1253
1266
  A `nav` entry can group related links into a dropdown. Provide `items` instead of `href`. Each item needs a `label` and an `href`, and takes an optional `section`:
@@ -1268,6 +1281,19 @@ export const nav = [
1268
1281
 
1269
1282
  On desktop, the group opens as a full-width panel below the navbar, following the vercel.com header pattern and matching the OSS products flyout. `section` values become column headings, preserving first-seen order; items without a `section` group into a column headed by the dropdown's own label. In the mobile menu, the group renders as a collapsible section. External URLs open in a new tab and show an external-link arrow.
1270
1283
 
1284
+ ### Rename the search button
1285
+
1286
+ Set `search.buttonLabel` in `defineConfig` to change the text of the search buttons in the navbar, the mobile menu, and the mobile docs sidebar:
1287
+
1288
+ ```tsx title="lib/geistdocs/config.tsx"
1289
+ export const config = defineConfig({
1290
+ // ...
1291
+ search: { buttonLabel: "search…" },
1292
+ });
1293
+ ```
1294
+
1295
+ Blank values keep the default, "Search…". A `SearchButton` you render yourself takes a `label` prop that overrides the config.
1296
+
1271
1297
  ## `defineConfig`
1272
1298
 
1273
1299
  `lib/geistdocs/config.tsx` converts your root exports into a package config. Most projects only need the generated defaults:
@@ -467,5 +467,5 @@
467
467
  }
468
468
  ],
469
469
  "source": "apps/template/content/docs",
470
- "version": "2.14.2"
470
+ "version": "2.14.3-canary.9417d69"
471
471
  }
@@ -109,6 +109,19 @@ Labs links to [vercel.com/labs](https://vercel.com/labs) and adapts to light and
109
109
 
110
110
  For new projects, both CLIs accept `--brand labs`; omitting it or using `--brand vercel` preserves the defaults. See [Create a Labs starter](/docs/getting-started#create-a-labs-starter).
111
111
 
112
+ ### Skip prefetching a navbar link
113
+
114
+ Navbar links prefetch their page as soon as they are visible, so a click renders it instantly. Every page load downloads those pages, so set `prefetch: false` on a link to a large page most visitors skip:
115
+
116
+ ```tsx title="geistdocs.tsx"
117
+ export const nav = [
118
+ { label: "Docs", href: "/docs" },
119
+ { label: "Changelog", href: "/changelog", prefetch: false },
120
+ ];
121
+ ```
122
+
123
+ The page then loads when the link is clicked.
124
+
112
125
  ### Group navbar links into a dropdown
113
126
 
114
127
  A `nav` entry can group related links into a dropdown. Provide `items` instead of `href`. Each item needs a `label` and an `href`, and takes an optional `section`:
@@ -129,6 +142,19 @@ export const nav = [
129
142
 
130
143
  On desktop, the group opens as a full-width panel below the navbar, following the vercel.com header pattern and matching the OSS products flyout. `section` values become column headings, preserving first-seen order; items without a `section` group into a column headed by the dropdown's own label. In the mobile menu, the group renders as a collapsible section. External URLs open in a new tab and show an external-link arrow.
131
144
 
145
+ ### Rename the search button
146
+
147
+ Set `search.buttonLabel` in `defineConfig` to change the text of the search buttons in the navbar, the mobile menu, and the mobile docs sidebar:
148
+
149
+ ```tsx title="lib/geistdocs/config.tsx"
150
+ export const config = defineConfig({
151
+ // ...
152
+ search: { buttonLabel: "search…" },
153
+ });
154
+ ```
155
+
156
+ Blank values keep the default, "Search…". A `SearchButton` you render yourself takes a `label` prop that overrides the config.
157
+
132
158
  ## `defineConfig`
133
159
 
134
160
  `lib/geistdocs/config.tsx` converts your root exports into a package config. Most projects only need the generated defaults:
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.2",
4
+ "version": "2.14.3-canary.9417d69",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -301,6 +301,10 @@
301
301
  "./theme.css": "./theme.css",
302
302
  "./package.json": "./package.json"
303
303
  },
304
+ "scripts": {
305
+ "build": "rm -rf dist docs template && node ./scripts/bundle-template.mjs && node ./scripts/bundle-docs.mjs && tsc -p tsconfig.runtime.json && tsup --config tsup.config.cli.ts",
306
+ "dev": "tsc -p tsconfig.runtime.json --watch --preserveWatchOutput"
307
+ },
304
308
  "dependencies": {
305
309
  "@ai-sdk/react": "^3.0.134",
306
310
  "@clack/prompts": "^0.11.0",
@@ -364,9 +368,5 @@
364
368
  "react-dom": "^19.2.3",
365
369
  "tsup": "^8.5.1",
366
370
  "typescript": "^5.9.3"
367
- },
368
- "scripts": {
369
- "build": "rm -rf dist docs template && node ./scripts/bundle-template.mjs && node ./scripts/bundle-docs.mjs && tsc -p tsconfig.runtime.json && tsup --config tsup.config.cli.ts",
370
- "dev": "tsc -p tsconfig.runtime.json --watch --preserveWatchOutput"
371
371
  }
372
- }
372
+ }
@@ -107,6 +107,19 @@ Labs links to [vercel.com/labs](https://vercel.com/labs) and adapts to light and
107
107
 
108
108
  For new projects, both CLIs accept `--brand labs`; omitting it or using `--brand vercel` preserves the defaults. See [Create a Labs starter](/docs/getting-started#create-a-labs-starter).
109
109
 
110
+ ### Skip prefetching a navbar link
111
+
112
+ Navbar links prefetch their page as soon as they are visible, so a click renders it instantly. Every page load downloads those pages, so set `prefetch: false` on a link to a large page most visitors skip:
113
+
114
+ ```tsx title="geistdocs.tsx"
115
+ export const nav = [
116
+ { label: "Docs", href: "/docs" },
117
+ { label: "Changelog", href: "/changelog", prefetch: false },
118
+ ];
119
+ ```
120
+
121
+ The page then loads when the link is clicked.
122
+
110
123
  ### Group navbar links into a dropdown
111
124
 
112
125
  A `nav` entry can group related links into a dropdown. Provide `items` instead of `href`. Each item needs a `label` and an `href`, and takes an optional `section`:
@@ -127,6 +140,19 @@ export const nav = [
127
140
 
128
141
  On desktop, the group opens as a full-width panel below the navbar, following the vercel.com header pattern and matching the OSS products flyout. `section` values become column headings, preserving first-seen order; items without a `section` group into a column headed by the dropdown's own label. In the mobile menu, the group renders as a collapsible section. External URLs open in a new tab and show an external-link arrow.
129
142
 
143
+ ### Rename the search button
144
+
145
+ Set `search.buttonLabel` in `defineConfig` to change the text of the search buttons in the navbar, the mobile menu, and the mobile docs sidebar:
146
+
147
+ ```tsx title="lib/geistdocs/config.tsx"
148
+ export const config = defineConfig({
149
+ // ...
150
+ search: { buttonLabel: "search…" },
151
+ });
152
+ ```
153
+
154
+ Blank values keep the default, "Search…". A `SearchButton` you render yourself takes a `label` prop that overrides the config.
155
+
130
156
  ## `defineConfig`
131
157
 
132
158
  `lib/geistdocs/config.tsx` converts your root exports into a package config. Most projects only need the generated defaults:
@@ -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.2",
20
+ "@vercel/geistdocs": "2.14.3-canary.9417d69",
21
21
  "@vercel/speed-insights": "^1.3.1",
22
22
  "ai": "^6.0.132",
23
23
  "clsx": "^2.1.1",