@vercel/geistdocs 1.13.0 → 1.14.1

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 (81) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/config.d.ts +11 -1
  3. package/dist/config.d.ts.map +1 -1
  4. package/dist/config.js +35 -0
  5. package/dist/footer.d.ts +1 -1
  6. package/dist/footer.d.ts.map +1 -1
  7. package/dist/footer.js +1 -1
  8. package/dist/internal/chat/shell.d.ts.map +1 -1
  9. package/dist/internal/chat/shell.js +2 -1
  10. package/dist/internal/external-arrow.d.ts +11 -0
  11. package/dist/internal/external-arrow.d.ts.map +1 -0
  12. package/dist/internal/external-arrow.js +17 -0
  13. package/dist/internal/footer/rss-button.d.ts +3 -1
  14. package/dist/internal/footer/rss-button.d.ts.map +1 -1
  15. package/dist/internal/footer/rss-button.js +2 -1
  16. package/dist/internal/localized-link.d.ts.map +1 -1
  17. package/dist/internal/localized-link.js +9 -4
  18. package/dist/internal/navbar/desktop-menu.d.ts.map +1 -1
  19. package/dist/internal/navbar/desktop-menu.js +5 -1
  20. package/dist/internal/navbar/mobile-menu.d.ts +3 -2
  21. package/dist/internal/navbar/mobile-menu.d.ts.map +1 -1
  22. package/dist/internal/navbar/mobile-menu.js +60 -9
  23. package/dist/internal/navbar/navbar-logo.d.ts +3 -1
  24. package/dist/internal/navbar/navbar-logo.d.ts.map +1 -1
  25. package/dist/internal/navbar/navbar-logo.js +69 -18
  26. package/dist/internal/page-actions-client.d.ts +1 -0
  27. package/dist/internal/page-actions-client.d.ts.map +1 -1
  28. package/dist/internal/page-actions-client.js +1 -3
  29. package/dist/internal/search.d.ts.map +1 -1
  30. package/dist/internal/search.js +2 -1
  31. package/dist/internal/table-of-contents.js +1 -1
  32. package/dist/internal/version-paths.d.ts +49 -0
  33. package/dist/internal/version-paths.d.ts.map +1 -0
  34. package/dist/internal/version-paths.js +57 -0
  35. package/dist/navbar.d.ts.map +1 -1
  36. package/dist/navbar.js +5 -2
  37. package/dist/pages/docs.d.ts +25 -7
  38. package/dist/pages/docs.d.ts.map +1 -1
  39. package/dist/pages/docs.js +40 -8
  40. package/dist/proxy.d.ts +4 -3
  41. package/dist/proxy.d.ts.map +1 -1
  42. package/dist/proxy.js +124 -46
  43. package/dist/routes/agents.d.ts +1 -1
  44. package/dist/routes/agents.d.ts.map +1 -1
  45. package/dist/routes/agents.js +27 -16
  46. package/dist/routes/chat.d.ts +1 -1
  47. package/dist/routes/chat.d.ts.map +1 -1
  48. package/dist/routes/chat.js +18 -11
  49. package/dist/routes/discovery.d.ts +6 -2
  50. package/dist/routes/discovery.d.ts.map +1 -1
  51. package/dist/routes/discovery.js +6 -12
  52. package/dist/routes/sitemap.d.ts +3 -2
  53. package/dist/routes/sitemap.d.ts.map +1 -1
  54. package/dist/routes/sitemap.js +18 -5
  55. package/dist/source.d.ts +39 -2
  56. package/dist/source.d.ts.map +1 -1
  57. package/dist/source.js +111 -13
  58. package/dist/versions.d.ts +22 -2
  59. package/dist/versions.d.ts.map +1 -1
  60. package/dist/versions.js +26 -3
  61. package/docs/agents.md +1 -1
  62. package/docs/llms.txt +117 -2
  63. package/docs/manifest.json +1 -1
  64. package/docs/pages/configuration.md +23 -1
  65. package/docs/pages/md.md +4 -0
  66. package/docs/pages/migration.md +4 -0
  67. package/docs/pages/proxy.md +15 -0
  68. package/docs/pages/rss.md +2 -0
  69. package/docs/pages/versioned-docs.md +68 -0
  70. package/package.json +1 -1
  71. package/template/AGENTS.md +2 -0
  72. package/template/app/[lang]/rss.xml/route.ts +7 -3
  73. package/template/app/global.css +0 -1
  74. package/template/content/docs/configuration.mdx +23 -1
  75. package/template/content/docs/md.mdx +4 -0
  76. package/template/content/docs/migration.mdx +4 -0
  77. package/template/content/docs/proxy.mdx +15 -0
  78. package/template/content/docs/rss.mdx +2 -0
  79. package/template/content/docs/versioned-docs.mdx +68 -0
  80. package/template/package.json +1 -1
  81. package/theme.css +16 -0
package/dist/cli/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import{program as T}from"commander";import{access as ce,copyFile as le}from"fs/promises";import{join as pe}from"path";import{cancel as de,intro as ge,isCancel as ue,log as fe,outro as me,spinner as he,text as we}from"@clack/prompts";import{spawn as te}from"child_process";import{readFileSync as se}from"fs";import{cp as ne,readFile as ae,rename as re,writeFile as ie}from"fs/promises";import{join as $}from"path";import{fileURLToPath as oe}from"url";var g="@vercel/geistdocs",m=(e,t=[],s={})=>new Promise((n,a)=>{let r=te(e,t,{stdio:"inherit",...s});r.on("error",a),r.on("close",i=>{if(i===0){n();return}a(new Error(`Command failed with exit code ${i}: ${[e,...t].join(" ")}`))})}),A=["dependencies","devDependencies","optionalDependencies","peerDependencies"],_=()=>JSON.parse(se(new URL("../../package.json",import.meta.url),"utf8")).version,P=async e=>{let t=$(e,"package.json"),s=await ae(t,"utf8");return JSON.parse(s)},x=async(e,t)=>{let s=$(e,"package.json");await ie(s,`${JSON.stringify(t,null,2)}
3
- `,"utf8")},R=(e,t)=>{for(let s of A){let n=e[s];if(n&&t in n)return n[t]}},V=(e,t)=>!!R(e,t),b=(e,t,s)=>{let n=!1;for(let a of A){let r=e[a];r&&t in r&&(r[t]=s,n=!0)}return n},j=()=>oe(new URL("../../template",import.meta.url)),F=async e=>{await ne(j(),e,{recursive:!0});let t=$(e,".gitignore"),s=$(e,"_gitignore");try{await re(s,t)}catch{}};var ye=async e=>{await F(e)},Pe=async e=>{try{return await ce(e),!0}catch{return!1}},ve=async()=>{await Pe(".env.example")&&await le(".env.example",".env.local")},Te=async e=>{let t=await P(e),s=_();return b(t,g,s)?(await x(e,t),!0):!1},ke=async e=>{await m("pnpm",["install"],{cwd:e,env:process.env,stdio:"inherit"})},$e=async e=>{await m("git",["init"],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["add","."],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["commit","-m","\u2728 Initial commit"],{cwd:e,env:process.env,stdio:"inherit"})},xe=async()=>{let e=await we({message:"What is your project named?",placeholder:"my-app",validate(t){if(t.length===0)return"Please enter a project name."}});return ue(e)&&(de("Operation cancelled."),process.exit(0)),e.toString()},G=async e=>{try{ge("Let's start a Geistdocs project!");let t=process.cwd(),s=e.name||await xe(),n=he(),a=pe(t,s);n.start("Copying bundled template..."),await ye(s),n.message("Setting up environment variables..."),process.chdir(a),await ve(),n.message("Rewriting package dependency versions..."),await Te(a),n.message("Installing dependencies..."),await ke(a),e.disableGit||(n.message("Initializing Git repository..."),await $e(a)),n.stop("Project initialized successfully!"),me("Run `pnpm dev` to start the development server.")}catch(t){let s=t instanceof Error?t.message:`Failed to initialize project: ${t}`;fe.error(s),process.exit(1)}};import{readFileSync as be,writeFileSync as Fe}from"fs";import{mkdir as De,readFile as N,writeFile as Se}from"fs/promises";import{dirname as Ce,extname as Re,relative as M,resolve as S}from"path";import{intro as je,isCancel as Ee,log as h,multiselect as Ne,outro as D,spinner as Ue}from"@clack/prompts";import{glob as Oe}from"glob";import{Node as v,Project as Ie,SyntaxKind as Je}from"ts-morph";var Le="geistdocs.tsx",Ae="content/docs/**/*.mdx",U=".translation-cache.json",E=8,B=()=>({version:1,entries:{}}),_e=async e=>{let t=await N(e),{createHash:s}=await import("crypto");return s("sha256").update(t).digest("hex")},Ve=e=>{let t=S(process.cwd(),e);return be(t,"utf8")},z=e=>v.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(v.isPropertyAssignment(t)){let s=t.getNameNode();if(v.isIdentifier(s)||v.isStringLiteral(s))return[s.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],Ge=e=>{try{let t=new Ie({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),s=Ve(e),r=t.createSourceFile(e,s,{overwrite:!0}).getVariableDeclarations().find(l=>l.getName()==="translations")?.getInitializer();if(!r)return[];if(v.isObjectLiteralExpression(r))return z(r);let i=r.getFirstDescendantByKind(Je.ObjectLiteralExpression);return i?z(i):[]}catch(t){let s=t instanceof Error?t.message:`${t}`;return h.warn(`Failed to read locales from ${e}: ${s}`),[]}},Be=async()=>{let e=await Ne({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 Ee(e)&&(D("Translation cancelled"),process.exit(0)),e},ze=async e=>(await Oe(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),He=async()=>{let e=S(process.cwd(),U);try{let t=await N(e,"utf8"),s=JSON.parse(t);return s.version!==1||!s.entries?B():{version:1,entries:s.entries}}catch{return B()}},H=e=>{let t=S(process.cwd(),U),s=JSON.stringify(e,null,2);Fe(t,s,"utf8")},Me=async e=>{let t=await Promise.all(e.map(async s=>[s,await _e(s)]));return Object.fromEntries(t)},Ke=(e,t)=>{let s=Re(e);return`${e.slice(0,-s.length)}.${t}${s}`},K=(e,t)=>`${M(process.cwd(),e)}::${t}`,qe=(e,t,s,n,a=!1)=>{let r=[],i=0;for(let l of t){let c=s[l];for(let o of e){let d=Ke(l,o),u=K(l,o),f=n.entries[u];if(!a&&f?.hash===c){i+=1;continue}r.push({locale:o,sourceFile:l,sourceHash:c,targetFile:d})}}return{tasks:r,skippedCount:i}},Xe=async e=>{await De(Ce(e),{recursive:!0})},We=async(e,t,s)=>{let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:s})});if(!n.ok){let r=await n.text();throw new Error(`API request failed (${n.status}): ${r}`)}let a=await n.json();if(!a.translation)throw new Error("API response did not include a translation");return a.translation},Ye=async(e,t,s)=>{let n=await N(e.sourceFile,"utf8"),a=await We(t,n,e.locale);await Xe(e.targetFile),await Se(e.targetFile,a,"utf8"),s.entries[K(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},q=async(e,t)=>{je("Translate MDX content");let s=e??Ae,n=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",a=Ge(t.config??Le),r=await ze(s);r.length===0&&(h.error(`No MDX files found matching pattern: ${s}`),D("Translation cancelled"),process.exit(1)),h.info(`Found ${r.length} MDX file(s) matching pattern`),a.length===0&&(a=await Be());let i=S(process.cwd(),U),l=await He();await H(l),h.info(`Using cache: ${i}`);let c=await Me(r),{tasks:o,skippedCount:d}=qe(a,r,c,l,t.force);if(o.length===0){h.success("All translations are up to date!"),D(`Skipped ${d} file(s) (unchanged)`);return}let u=[];for(let y=0;y<o.length;y+=E)u.push(o.slice(y,y+E));h.info(`Processing ${o.length} translation(s) in ${u.length} batch(es) of up to ${E}`),d>0&&h.info(`Skipped ${d} translation(s) (unchanged)`);let f=Ue();f.start("Translating content...");let k=0;for(let y of u)await Promise.all(y.map(async L=>{await Ye(L,n,l),k+=1,f.message(`Translated ${k}/${o.length}: ${M(process.cwd(),L.targetFile)}`)})),await H(l);f.stop("Translation complete!"),D(`Created/updated ${o.length} file(s)`)};import{access as Ze,copyFile as Qe,mkdir as Z,rm as J}from"fs/promises";import{dirname as et,join as w}from"path";import{intro as tt,log as p,outro as C,spinner as Q}from"@clack/prompts";import{glob as st}from"glob";var nt=["**/*"],at=["content/docs/**"],O=".geistdocs-tmp",rt=async(e,t)=>{let s=w(e,t);await J(s,{recursive:!0,force:!0}),await Z(s,{recursive:!0})},I=async e=>await J(e,{recursive:!0,force:!0}),X=async(e,t,s)=>(await st(e,{cwd:s,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),it=async e=>{try{return await Ze(e),!0}catch{return!1}},ot=async(e,t,s)=>{let n=w(t,e),a=w(s,e);return await it(n)?(await Qe(n,a),{success:!0}):{success:!1,error:`Source file not found: ${n}`}},ct=async(e,t)=>{let s=w(t,e);return await J(s,{force:!0}),{success:!0}},W=20,Y=async(e,t,s)=>{let n=[];for(let a=0;a<e.length;a+=s){let r=e.slice(a,a+s),i=await Promise.all(r.map(t));n.push(...i)}return n},lt=async(e,t,s,n,a)=>{let r={success:[],deleted:[],failed:[]},i=[...new Set(e.map(c=>et(w(n,c))))];a.message(`Creating ${i.length} directories...`),await Promise.all(i.map(c=>Z(c,{recursive:!0}))),a.message(`Updating ${e.length} files...`);let l=await Y(e,async c=>{let o=await ot(c,s,n);return{file:c,...o}},W);for(let{file:c,success:o,error:d}of l)o?r.success.push(c):r.failed.push({file:c,error:d??"Unknown error"});if(t.length>0){a.message(`Deleting ${t.length} files...`);let c=await Y(t,async o=>{try{return await ct(o,n),{file:o,success:!0}}catch(d){let u=d instanceof Error?d.message:`${d}`;return{file:o,success:!1,error:u}}},W);for(let o of c)o.success?r.deleted.push(o.file):r.failed.push({file:o.file,error:o.error})}return r},pt=e=>{if(e.success.length>0){p.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)p.info(` \u2713 ${t}`)}if(e.deleted.length>0){p.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)p.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){p.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:s}of e.failed)p.error(` \u2717 ${t}: ${s}`)}},dt=e=>e.includes("canary")?"canary":"latest",gt=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(g)}`);if(!t.ok)throw new Error(`Failed to resolve ${g}@${e}`);let n=(await t.json())["dist-tags"]?.[e];if(!n)throw new Error(`Could not find dist-tag ${e} for ${g}`);return n},ut=async e=>{let t=await P(e),s=R(t,g);if(!s)return{currentVersion:s,nextVersion:void 0,updated:!1};let n=dt(s),a=await gt(n);return s===a?{currentVersion:s,nextVersion:a,updateTag:n,updated:!1}:(b(t,g,a),await x(e,t),{currentVersion:s,nextVersion:a,updateTag:n,updated:!0})},ft=async(e,t,s)=>{let n=await P(e);if(!V(n,g))return!1;t&&t.length>0&&p.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),s?.sync&&p.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:a,nextVersion:r,updateTag:i,updated:l}=await ut(e);if(!l)return p.success(a?`@vercel/geistdocs is already at ${r} (${i}).`:"No package version update was needed."),C("Package-based site is already up to date."),!0;p.info(`Bumping ${g} from ${a} to ${r} (${i})`);let c=Q();return c.start("Installing updated package version..."),await m("pnpm",["install"],{cwd:e}),c.stop("Package update complete!"),C("Please review and test the upgraded package version."),!0},mt=async(e,t,s,n,a)=>{let r=w(e,O),i=Q(),l=a?.sync?r:t;i.start("Preparing template snapshot..."),a?.sync&&(await rt(e,O),await F(r)),i.message("Scanning for files...");let c=await X(s,n,l),o=[];if(a?.sync){i.message("Comparing with local files...");let u=await X(s,n,e),f=new Set(c);o=u.filter(k=>!f.has(k))}if(i.stop(`Found ${c.length} files to update`),c.length===0&&o.length===0){p.warn("No files matched the patterns. Nothing to update."),a?.sync&&await I(r),C("Update cancelled.");return}p.info(`Patterns: ${s.length}`),p.info(`Files to update: ${c.length}`),a?.sync&&p.info(`Files to delete: ${o.length}`),i.start("Updating files...");let d=await lt(c,o,l,e,i);a?.sync&&(i.message("Cleaning up..."),await I(r)),i.stop("Update complete!"),pt(d),C("Please review and test the changes carefully.")},ee=async(e,t)=>{let s=process.cwd(),n=j(),a=e&&e.length>0?e:nt,r=e&&e.length>0?[]:at;try{if(tt("Let's update your Geistdocs project!"),await ft(s,e,t))return;p.info("Template source: bundled package snapshot"),e&&e.length>0&&p.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&p.info("Sync mode enabled: will delete files removed from template"),await mt(s,n,a,r,t)}catch(i){let l=i instanceof Error?i.message:`${i}`;try{await I(w(s,O))}catch{}p.error(`Failed to update project: ${l}`),process.exit(1)}};T.name("geistdocs").description("CLI for Geistdocs projects").version("1.13.0","-v, --version","Output the current version");T.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").option("--disable-git","Disable git initialization").action(G);T.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(ee);T.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(q);T.parse(process.argv);
3
+ `,"utf8")},R=(e,t)=>{for(let s of A){let n=e[s];if(n&&t in n)return n[t]}},V=(e,t)=>!!R(e,t),b=(e,t,s)=>{let n=!1;for(let a of A){let r=e[a];r&&t in r&&(r[t]=s,n=!0)}return n},j=()=>oe(new URL("../../template",import.meta.url)),F=async e=>{await ne(j(),e,{recursive:!0});let t=$(e,".gitignore"),s=$(e,"_gitignore");try{await re(s,t)}catch{}};var ye=async e=>{await F(e)},Pe=async e=>{try{return await ce(e),!0}catch{return!1}},ve=async()=>{await Pe(".env.example")&&await le(".env.example",".env.local")},Te=async e=>{let t=await P(e),s=_();return b(t,g,s)?(await x(e,t),!0):!1},ke=async e=>{await m("pnpm",["install"],{cwd:e,env:process.env,stdio:"inherit"})},$e=async e=>{await m("git",["init"],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["add","."],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["commit","-m","\u2728 Initial commit"],{cwd:e,env:process.env,stdio:"inherit"})},xe=async()=>{let e=await we({message:"What is your project named?",placeholder:"my-app",validate(t){if(t.length===0)return"Please enter a project name."}});return ue(e)&&(de("Operation cancelled."),process.exit(0)),e.toString()},G=async e=>{try{ge("Let's start a Geistdocs project!");let t=process.cwd(),s=e.name||await xe(),n=he(),a=pe(t,s);n.start("Copying bundled template..."),await ye(s),n.message("Setting up environment variables..."),process.chdir(a),await ve(),n.message("Rewriting package dependency versions..."),await Te(a),n.message("Installing dependencies..."),await ke(a),e.disableGit||(n.message("Initializing Git repository..."),await $e(a)),n.stop("Project initialized successfully!"),me("Run `pnpm dev` to start the development server.")}catch(t){let s=t instanceof Error?t.message:`Failed to initialize project: ${t}`;fe.error(s),process.exit(1)}};import{readFileSync as be,writeFileSync as Fe}from"fs";import{mkdir as De,readFile as N,writeFile as Se}from"fs/promises";import{dirname as Ce,extname as Re,relative as M,resolve as S}from"path";import{intro as je,isCancel as Ee,log as h,multiselect as Ne,outro as D,spinner as Ue}from"@clack/prompts";import{glob as Oe}from"glob";import{Node as v,Project as Ie,SyntaxKind as Je}from"ts-morph";var Le="geistdocs.tsx",Ae="content/docs/**/*.mdx",U=".translation-cache.json",E=8,B=()=>({version:1,entries:{}}),_e=async e=>{let t=await N(e),{createHash:s}=await import("crypto");return s("sha256").update(t).digest("hex")},Ve=e=>{let t=S(process.cwd(),e);return be(t,"utf8")},z=e=>v.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(v.isPropertyAssignment(t)){let s=t.getNameNode();if(v.isIdentifier(s)||v.isStringLiteral(s))return[s.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],Ge=e=>{try{let t=new Ie({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),s=Ve(e),r=t.createSourceFile(e,s,{overwrite:!0}).getVariableDeclarations().find(l=>l.getName()==="translations")?.getInitializer();if(!r)return[];if(v.isObjectLiteralExpression(r))return z(r);let i=r.getFirstDescendantByKind(Je.ObjectLiteralExpression);return i?z(i):[]}catch(t){let s=t instanceof Error?t.message:`${t}`;return h.warn(`Failed to read locales from ${e}: ${s}`),[]}},Be=async()=>{let e=await Ne({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 Ee(e)&&(D("Translation cancelled"),process.exit(0)),e},ze=async e=>(await Oe(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),He=async()=>{let e=S(process.cwd(),U);try{let t=await N(e,"utf8"),s=JSON.parse(t);return s.version!==1||!s.entries?B():{version:1,entries:s.entries}}catch{return B()}},H=e=>{let t=S(process.cwd(),U),s=JSON.stringify(e,null,2);Fe(t,s,"utf8")},Me=async e=>{let t=await Promise.all(e.map(async s=>[s,await _e(s)]));return Object.fromEntries(t)},Ke=(e,t)=>{let s=Re(e);return`${e.slice(0,-s.length)}.${t}${s}`},K=(e,t)=>`${M(process.cwd(),e)}::${t}`,qe=(e,t,s,n,a=!1)=>{let r=[],i=0;for(let l of t){let c=s[l];for(let o of e){let d=Ke(l,o),u=K(l,o),f=n.entries[u];if(!a&&f?.hash===c){i+=1;continue}r.push({locale:o,sourceFile:l,sourceHash:c,targetFile:d})}}return{tasks:r,skippedCount:i}},Xe=async e=>{await De(Ce(e),{recursive:!0})},We=async(e,t,s)=>{let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:s})});if(!n.ok){let r=await n.text();throw new Error(`API request failed (${n.status}): ${r}`)}let a=await n.json();if(!a.translation)throw new Error("API response did not include a translation");return a.translation},Ye=async(e,t,s)=>{let n=await N(e.sourceFile,"utf8"),a=await We(t,n,e.locale);await Xe(e.targetFile),await Se(e.targetFile,a,"utf8"),s.entries[K(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},q=async(e,t)=>{je("Translate MDX content");let s=e??Ae,n=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",a=Ge(t.config??Le),r=await ze(s);r.length===0&&(h.error(`No MDX files found matching pattern: ${s}`),D("Translation cancelled"),process.exit(1)),h.info(`Found ${r.length} MDX file(s) matching pattern`),a.length===0&&(a=await Be());let i=S(process.cwd(),U),l=await He();await H(l),h.info(`Using cache: ${i}`);let c=await Me(r),{tasks:o,skippedCount:d}=qe(a,r,c,l,t.force);if(o.length===0){h.success("All translations are up to date!"),D(`Skipped ${d} file(s) (unchanged)`);return}let u=[];for(let y=0;y<o.length;y+=E)u.push(o.slice(y,y+E));h.info(`Processing ${o.length} translation(s) in ${u.length} batch(es) of up to ${E}`),d>0&&h.info(`Skipped ${d} translation(s) (unchanged)`);let f=Ue();f.start("Translating content...");let k=0;for(let y of u)await Promise.all(y.map(async L=>{await Ye(L,n,l),k+=1,f.message(`Translated ${k}/${o.length}: ${M(process.cwd(),L.targetFile)}`)})),await H(l);f.stop("Translation complete!"),D(`Created/updated ${o.length} file(s)`)};import{access as Ze,copyFile as Qe,mkdir as Z,rm as J}from"fs/promises";import{dirname as et,join as w}from"path";import{intro as tt,log as p,outro as C,spinner as Q}from"@clack/prompts";import{glob as st}from"glob";var nt=["**/*"],at=["content/docs/**"],O=".geistdocs-tmp",rt=async(e,t)=>{let s=w(e,t);await J(s,{recursive:!0,force:!0}),await Z(s,{recursive:!0})},I=async e=>await J(e,{recursive:!0,force:!0}),X=async(e,t,s)=>(await st(e,{cwd:s,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),it=async e=>{try{return await Ze(e),!0}catch{return!1}},ot=async(e,t,s)=>{let n=w(t,e),a=w(s,e);return await it(n)?(await Qe(n,a),{success:!0}):{success:!1,error:`Source file not found: ${n}`}},ct=async(e,t)=>{let s=w(t,e);return await J(s,{force:!0}),{success:!0}},W=20,Y=async(e,t,s)=>{let n=[];for(let a=0;a<e.length;a+=s){let r=e.slice(a,a+s),i=await Promise.all(r.map(t));n.push(...i)}return n},lt=async(e,t,s,n,a)=>{let r={success:[],deleted:[],failed:[]},i=[...new Set(e.map(c=>et(w(n,c))))];a.message(`Creating ${i.length} directories...`),await Promise.all(i.map(c=>Z(c,{recursive:!0}))),a.message(`Updating ${e.length} files...`);let l=await Y(e,async c=>{let o=await ot(c,s,n);return{file:c,...o}},W);for(let{file:c,success:o,error:d}of l)o?r.success.push(c):r.failed.push({file:c,error:d??"Unknown error"});if(t.length>0){a.message(`Deleting ${t.length} files...`);let c=await Y(t,async o=>{try{return await ct(o,n),{file:o,success:!0}}catch(d){let u=d instanceof Error?d.message:`${d}`;return{file:o,success:!1,error:u}}},W);for(let o of c)o.success?r.deleted.push(o.file):r.failed.push({file:o.file,error:o.error})}return r},pt=e=>{if(e.success.length>0){p.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)p.info(` \u2713 ${t}`)}if(e.deleted.length>0){p.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)p.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){p.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:s}of e.failed)p.error(` \u2717 ${t}: ${s}`)}},dt=e=>e.includes("canary")?"canary":"latest",gt=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(g)}`);if(!t.ok)throw new Error(`Failed to resolve ${g}@${e}`);let n=(await t.json())["dist-tags"]?.[e];if(!n)throw new Error(`Could not find dist-tag ${e} for ${g}`);return n},ut=async e=>{let t=await P(e),s=R(t,g);if(!s)return{currentVersion:s,nextVersion:void 0,updated:!1};let n=dt(s),a=await gt(n);return s===a?{currentVersion:s,nextVersion:a,updateTag:n,updated:!1}:(b(t,g,a),await x(e,t),{currentVersion:s,nextVersion:a,updateTag:n,updated:!0})},ft=async(e,t,s)=>{let n=await P(e);if(!V(n,g))return!1;t&&t.length>0&&p.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),s?.sync&&p.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:a,nextVersion:r,updateTag:i,updated:l}=await ut(e);if(!l)return p.success(a?`@vercel/geistdocs is already at ${r} (${i}).`:"No package version update was needed."),C("Package-based site is already up to date."),!0;p.info(`Bumping ${g} from ${a} to ${r} (${i})`);let c=Q();return c.start("Installing updated package version..."),await m("pnpm",["install"],{cwd:e}),c.stop("Package update complete!"),C("Please review and test the upgraded package version."),!0},mt=async(e,t,s,n,a)=>{let r=w(e,O),i=Q(),l=a?.sync?r:t;i.start("Preparing template snapshot..."),a?.sync&&(await rt(e,O),await F(r)),i.message("Scanning for files...");let c=await X(s,n,l),o=[];if(a?.sync){i.message("Comparing with local files...");let u=await X(s,n,e),f=new Set(c);o=u.filter(k=>!f.has(k))}if(i.stop(`Found ${c.length} files to update`),c.length===0&&o.length===0){p.warn("No files matched the patterns. Nothing to update."),a?.sync&&await I(r),C("Update cancelled.");return}p.info(`Patterns: ${s.length}`),p.info(`Files to update: ${c.length}`),a?.sync&&p.info(`Files to delete: ${o.length}`),i.start("Updating files...");let d=await lt(c,o,l,e,i);a?.sync&&(i.message("Cleaning up..."),await I(r)),i.stop("Update complete!"),pt(d),C("Please review and test the changes carefully.")},ee=async(e,t)=>{let s=process.cwd(),n=j(),a=e&&e.length>0?e:nt,r=e&&e.length>0?[]:at;try{if(tt("Let's update your Geistdocs project!"),await ft(s,e,t))return;p.info("Template source: bundled package snapshot"),e&&e.length>0&&p.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&p.info("Sync mode enabled: will delete files removed from template"),await mt(s,n,a,r,t)}catch(i){let l=i instanceof Error?i.message:`${i}`;try{await I(w(s,O))}catch{}p.error(`Failed to update project: ${l}`),process.exit(1)}};T.name("geistdocs").description("CLI for Geistdocs projects").version("1.14.1","-v, --version","Output the current version");T.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").option("--disable-git","Disable git initialization").action(G);T.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(ee);T.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(q);T.parse(process.argv);
package/dist/config.d.ts CHANGED
@@ -1,12 +1,22 @@
1
1
  import type { ReactNode } from "react";
2
+ export declare const normalizeBasePath: (basePath: string | undefined) => string;
3
+ /** Convert an app-local path to the URL exposed by a Next.js base-path app. */
4
+ export declare const getPublicPath: (href: string, basePath: string | undefined) => string;
5
+ /** Keep public paths stable while adding a base path to app-local paths. */
6
+ export declare const withBasePath: (href: string, basePath: string | undefined) => string;
2
7
  export interface GeistdocsNavItem {
3
8
  external?: boolean;
4
9
  href: string;
5
10
  label: string;
6
11
  }
7
12
  export interface GeistdocsNavbarOssProduct {
13
+ description?: string;
14
+ external?: boolean;
15
+ featured?: boolean;
8
16
  href: string;
9
- logo: ReactNode;
17
+ label: string;
18
+ logo?: ReactNode;
19
+ section?: string;
10
20
  }
11
21
  export interface GeistdocsGithubConfig {
12
22
  branch?: string;
@@ -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;AAEvC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE1E,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAEzE,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,sBAAsB;IAC/D,MAAM,CAAC,EAAE,MAAM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AY,CAAC,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,EAAE,uBAAuB,CAAC;CACpC;AAED,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,eAAe,EAAE,QAAQ,CAAC,KAAG,CAAW,CAAC"}
package/dist/config.js CHANGED
@@ -1 +1,36 @@
1
+ const ABSOLUTE_URL_PATTERN = /^[a-z][a-z\d+.-]*:/i;
2
+ const TRAILING_SLASH_PATTERN = /\/$/;
3
+ export const normalizeBasePath = (basePath) => {
4
+ if (!basePath || basePath === "/") {
5
+ return "";
6
+ }
7
+ const normalized = basePath.startsWith("/") ? basePath : `/${basePath}`;
8
+ return normalized.replace(TRAILING_SLASH_PATTERN, "");
9
+ };
10
+ /** Convert an app-local path to the URL exposed by a Next.js base-path app. */
11
+ export const getPublicPath = (href, basePath) => {
12
+ const normalizedBasePath = normalizeBasePath(basePath);
13
+ if (!normalizedBasePath) {
14
+ return href;
15
+ }
16
+ if (!href.startsWith("/") ||
17
+ href.startsWith("//") ||
18
+ ABSOLUTE_URL_PATTERN.test(href)) {
19
+ return href;
20
+ }
21
+ if (href === "/") {
22
+ return normalizedBasePath;
23
+ }
24
+ return `${normalizedBasePath}${href}`;
25
+ };
26
+ /** Keep public paths stable while adding a base path to app-local paths. */
27
+ export const withBasePath = (href, basePath) => {
28
+ const normalizedBasePath = normalizeBasePath(basePath);
29
+ if (!normalizedBasePath ||
30
+ href === normalizedBasePath ||
31
+ href.startsWith(`${normalizedBasePath}/`)) {
32
+ return href;
33
+ }
34
+ return getPublicPath(href, normalizedBasePath);
35
+ };
1
36
  export const defineConfig = (config) => config;
package/dist/footer.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { GeistdocsConfig } from "./config";
2
2
  interface FooterProps {
3
- config: Pick<GeistdocsConfig, "github">;
3
+ config: Pick<GeistdocsConfig, "basePath" | "github">;
4
4
  copyright?: string;
5
5
  }
6
6
  export declare const Footer: ({ config, copyright, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../src/footer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD,UAAU,WAAW;IACnB,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,GAAI,wBAGpB,WAAW,4CAiBb,CAAC"}
1
+ {"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../src/footer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD,UAAU,WAAW;IACnB,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,QAAQ,CAAC,CAAC;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,GAAI,wBAGpB,WAAW,4CAiBb,CAAC"}
package/dist/footer.js CHANGED
@@ -3,4 +3,4 @@ import { SiVercel } from "@icons-pack/react-simple-icons";
3
3
  import { LanguageSelector, ThemeToggle } from "./controls";
4
4
  import { RSSButton } from "./internal/footer/rss-button";
5
5
  import { GitHubButton } from "./internal/github-button";
6
- export const Footer = ({ config, copyright = `Copyright Vercel ${new Date().getFullYear()}. All rights reserved.`, }) => (_jsx("footer", { className: "border-t px-4 py-5 md:px-6", children: _jsxs("div", { className: "mx-auto flex max-w-[1448px] flex-col items-center justify-between gap-4 sm:flex-row", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SiVercel, { className: "size-4 shrink-0" }), _jsx("p", { className: "text-center text-gray-800 text-sm sm:text-left", children: copyright })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LanguageSelector, {}), _jsx(RSSButton, {}), _jsx(GitHubButton, { github: config.github }), _jsx(ThemeToggle, {})] })] }) }));
6
+ export const Footer = ({ config, copyright = `Copyright Vercel ${new Date().getFullYear()}. All rights reserved.`, }) => (_jsx("footer", { className: "border-t px-4 py-5 md:px-6", children: _jsxs("div", { className: "mx-auto flex max-w-[1448px] flex-col items-center justify-between gap-4 sm:flex-row", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SiVercel, { className: "size-4 shrink-0" }), _jsx("p", { className: "text-center text-gray-800 text-sm sm:text-left", children: copyright })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LanguageSelector, {}), _jsx(RSSButton, { basePath: config.basePath }), _jsx(GitHubButton, { github: config.github }), _jsx(ThemeToggle, {})] })] }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/shell.tsx"],"names":[],"mappings":"AAqUA,eAAO,MAAM,kBAAkB,sDAwD9B,CAAC"}
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/shell.tsx"],"names":[],"mappings":"AAsUA,eAAO,MAAM,kBAAkB,sDAwD9B,CAAC"}
@@ -8,6 +8,7 @@ import { usePathname } from "next/navigation";
8
8
  import { Portal } from "radix-ui";
9
9
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
10
10
  import { toast } from "sonner";
11
+ import { getPublicPath } from "../../config";
11
12
  import { cn } from "../cn";
12
13
  import { Button } from "../ui/button";
13
14
  import { ButtonGroup } from "../ui/button-group";
@@ -96,7 +97,7 @@ const GeistdocsChatInner = ({ isOpen }) => {
96
97
  const { initialMessages, isLoading, saveMessages, clearMessages } = useChatPersistence(title);
97
98
  const { messages, sendMessage, status, setMessages, stop } = useChat({
98
99
  transport: new DefaultChatTransport({
99
- api: basePath ? `${basePath}/api/chat` : "/api/chat",
100
+ api: getPublicPath("/api/chat", basePath),
100
101
  prepareSendMessagesRequest: ({ body, messages }) => ({
101
102
  body: {
102
103
  ...body,
@@ -0,0 +1,11 @@
1
+ import type { CSSProperties, JSX } from "react";
2
+ /**
3
+ * External-link arrow (Geist U+2197 ↗) traced as an inline SVG, since geistdocs'
4
+ * Geist web-font subset omits the glyph. Sized in `em` with `currentColor` so it
5
+ * inherits the paired text's size, color, and baseline. See vercel/front#76299.
6
+ */
7
+ export declare function ExternalArrow({ className, style, }: {
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ }): JSX.Element;
11
+ //# sourceMappingURL=external-arrow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external-arrow.d.ts","sourceRoot":"","sources":["../../src/internal/external-arrow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGhD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,KAAK,GACN,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,GAAG,GAAG,CAAC,OAAO,CAmBd"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "./cn";
3
+ /**
4
+ * External-link arrow (Geist U+2197 ↗) traced as an inline SVG, since geistdocs'
5
+ * Geist web-font subset omits the glyph. Sized in `em` with `currentColor` so it
6
+ * inherits the paired text's size, color, and baseline. See vercel/front#76299.
7
+ */
8
+ export function ExternalArrow({ className, style, }) {
9
+ return (_jsx("svg", { "aria-hidden": "true",
10
+ // `inline-block!` beats the global `svg { display: block }` reset.
11
+ className: cn("inline-block! ml-[0.25em]", className), fill: "currentColor", role: "img", style: {
12
+ height: "1em",
13
+ verticalAlign: "baseline",
14
+ width: "1em",
15
+ ...style,
16
+ }, viewBox: "0 0 1000 1000", children: _jsx("path", { d: "M45 853 440 457H58L137 379L576 380V820L497 898V517L103 911Z" }) }));
17
+ }
@@ -1,2 +1,4 @@
1
- export declare const RSSButton: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const RSSButton: ({ basePath }: {
2
+ basePath?: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
2
4
  //# sourceMappingURL=rss-button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rss-button.d.ts","sourceRoot":"","sources":["../../../src/internal/footer/rss-button.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,+CAMrB,CAAC"}
1
+ {"version":3,"file":"rss-button.d.ts","sourceRoot":"","sources":["../../../src/internal/footer/rss-button.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,GAAI,cAAc;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,4CAW5D,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { RssIcon } from "lucide-react";
3
+ import { getPublicPath } from "../../config";
3
4
  import { Button } from "../ui/button";
4
- export const RSSButton = () => (_jsx(Button, { asChild: true, size: "icon-sm", type: "button", variant: "ghost", children: _jsx("a", { href: "/rss.xml", rel: "noopener", target: "_blank", children: _jsx(RssIcon, { className: "size-4" }) }) }));
5
+ export const RSSButton = ({ basePath }) => (_jsx(Button, { asChild: true, size: "icon-sm", type: "button", variant: "ghost", children: _jsx("a", { "aria-label": "RSS feed", href: getPublicPath("/rss.xml", basePath), rel: "noopener", target: "_blank", children: _jsx(RssIcon, { className: "size-4" }) }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"localized-link.d.ts","sourceRoot":"","sources":["../../src/internal/localized-link.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D,UAAU,kBAAmB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,aAAa,GAAI,oBAAoB,kBAAkB,4CASnE,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;AAG7D,UAAU,kBAAmB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,aAAa,GAAI,oBAAoB,kBAAkB,4CAgBnE,CAAC"}
@@ -1,13 +1,18 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import DynamicLink from "fumadocs-core/dynamic-link";
4
3
  import Link from "next/link";
5
4
  import { useParams } from "next/navigation";
5
+ import { useGeistdocsConfig } from "./config-context";
6
6
  export const LocalizedLink = ({ href, ...props }) => {
7
7
  const params = useParams();
8
- const hasLanguageParam = typeof params.lang === "string";
9
- if (hasLanguageParam && href.startsWith("/") && !href.startsWith("//")) {
10
- return _jsx(DynamicLink, { href: `/[lang]${href}`, ...props });
8
+ const { defaultLanguage = "en" } = useGeistdocsConfig();
9
+ const language = typeof params.lang === "string" ? params.lang : undefined;
10
+ if (language &&
11
+ language !== defaultLanguage &&
12
+ href.startsWith("/") &&
13
+ !href.startsWith("//")) {
14
+ const localizedHref = href === "/" ? `/${language}` : `/${language}${href}`;
15
+ return _jsx(Link, { href: localizedHref, ...props });
11
16
  }
12
17
  return _jsx(Link, { href: href, ...props });
13
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"desktop-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/desktop-menu.tsx"],"names":[],"mappings":"AAcA,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1C;AAED,eAAO,MAAM,WAAW,GAAI,sBAAsB,gBAAgB,4CAiCjE,CAAC"}
1
+ {"version":3,"file":"desktop-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/desktop-menu.tsx"],"names":[],"mappings":"AAcA,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1C;AAED,eAAO,MAAM,WAAW,GAAI,sBAAsB,gBAAgB,4CA+CjE,CAAC"}
@@ -9,5 +9,9 @@ import { useNavActive } from "./use-nav-active";
9
9
  export const DesktopMenu = ({ items, className }) => {
10
10
  const isMobile = useIsMobile();
11
11
  const isActive = useNavActive();
12
- return (_jsx(NavigationMenu, { viewport: isMobile, children: _jsx(NavigationMenuList, { className: cn("h-14 gap-4", className), children: items.map((item) => (_jsx(NavigationMenuItem, { children: _jsx(NavigationMenuLink, { active: isActive(item.href), asChild: true, className: "flex items-center text-gray-900 text-sm transition-colors duration-100 hover:text-gray-1000 data-[active]:text-gray-1000", 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", size: 12 })] })) : (_jsx(LocalizedLink, { href: item.href, children: item.label })) }) }, item.href))) }) }));
12
+ return (_jsx(NavigationMenu, { viewport: isMobile, children: _jsx(NavigationMenuList, { className: cn("h-16 items-stretch gap-0", className), children: items.map((item, index) => (_jsx(NavigationMenuItem, { className: "flex", children: _jsx(NavigationMenuLink, { active: isActive(item.href), asChild: true, className: cn("relative flex h-full items-center px-3 text-gray-900 text-sm outline-none transition-colors duration-100 before:absolute before:top-1/2 before:right-1 before:left-1 before:h-9 before:-translate-y-1/2 before:rounded-md before:content-[''] hover:text-gray-1000 focus-visible:before:ring-2 focus-visible:before:ring-blue-700 focus-visible:before:ring-inset data-[active]:text-gray-1000",
13
+ // Extra left padding on the first item keeps it clear of the
14
+ // Geistdocs trigger; the ring's left edge is pulled back to stay
15
+ // centered on the label. Inter-item spacing stays tight (px-3).
16
+ index === 0 && "pl-6 before:left-4"), 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: "will-change-transform", size: 12 })] })) : (_jsx(LocalizedLink, { href: item.href, children: item.label })) }) }, item.href))) }) }));
13
17
  };
@@ -1,8 +1,9 @@
1
- import type { GeistdocsNavItem } from "../../config";
1
+ import type { GeistdocsNavbarOssProduct, GeistdocsNavItem } from "../../config";
2
2
  interface MobileMenuProps {
3
3
  githubUrl?: string | null;
4
4
  nav: GeistdocsNavItem[];
5
+ ossProducts?: GeistdocsNavbarOssProduct[];
5
6
  }
6
- export declare const MobileMenu: ({ githubUrl, nav }: MobileMenuProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const MobileMenu: ({ githubUrl, nav, ossProducts, }: MobileMenuProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export {};
8
9
  //# sourceMappingURL=mobile-menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mobile-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/mobile-menu.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMrD,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,EAAE,gBAAgB,EAAE,CAAC;CACzB;AAmFD,eAAO,MAAM,UAAU,GAAI,oBAAoB,eAAe,4CA6E7D,CAAC"}
1
+ {"version":3,"file":"mobile-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/mobile-menu.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAQhF,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,EAAE,gBAAgB,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;CAC3C;AA2KD,eAAO,MAAM,UAAU,GAAI,kCAIxB,eAAe,4CAgHjB,CAAC"}
@@ -1,27 +1,78 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useEffect, useState } from "react";
4
- import { IconArrowUpRight } from "../../assets/icons/icon-arrow-up-right";
4
+ import { IconChevronDownSmall } from "../../assets/icons/icon-chevron-down-small";
5
5
  import { SearchButton } from "../../controls";
6
6
  import { cn } from "../cn";
7
+ import { ExternalArrow } from "../external-arrow";
7
8
  import { LocalizedLink } from "../localized-link";
9
+ import { DEFAULT_OSS_SECTION } from "./navbar-logo";
8
10
  import { useNavActive } from "./use-nav-active";
9
11
  function NavLink({ href, external, active, onClick, children, }) {
10
- const className = cn("group flex items-center justify-between rounded-md p-3 text-gray-900 transition-colors hover:bg-gray-100 hover:text-gray-1000", active && "text-gray-1000");
12
+ const className = cn("flex min-h-11 items-center gap-1 rounded-md px-3 font-normal text-2xl text-gray-900 no-underline outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000", active && "text-gray-1000");
13
+ // Inline span so the arrow baseline-aligns to the label.
14
+ const content = (_jsxs("span", { children: [children, external ? _jsx(ExternalArrow, {}) : null] }));
11
15
  if (!external) {
12
- return (_jsx(LocalizedLink, { "aria-current": active ? "page" : undefined, className: className, href: href, onClick: onClick, children: children }));
16
+ return (_jsx(LocalizedLink, { "aria-current": active ? "page" : undefined, className: className, href: href, onClick: onClick, children: content }));
13
17
  }
14
- return (_jsxs("a", { className: className, href: href, onClick: onClick, rel: "noopener", target: "_blank", children: [children, _jsx(IconArrowUpRight, { className: "text-gray-900 group-hover:text-gray-1000", size: 16 })] }));
18
+ return (_jsx("a", { className: className, href: href, onClick: onClick, rel: "noopener noreferrer", target: "_blank", children: content }));
19
+ }
20
+ function OssNavLink({ product, onClick, }) {
21
+ const external = product.external ?? product.href.startsWith("http");
22
+ const className = "flex items-center gap-1 rounded-md px-3 py-1.5 font-normal text-gray-1000 text-xl no-underline outline-none transition-colors hover:bg-gray-alpha-100";
23
+ if (!external) {
24
+ return (_jsx(LocalizedLink, { className: className, href: product.href, onClick: onClick, children: product.label }));
25
+ }
26
+ return (_jsx("a", { className: className, href: product.href, onClick: onClick, rel: "noopener noreferrer", target: "_blank", children: product.label }));
27
+ }
28
+ /** Collapsible OSS menu (`<details>`) with uppercase subsection headings. */
29
+ function OssCollapsible({ sections, onLinkClick, }) {
30
+ if (sections.length === 0) {
31
+ return null;
32
+ }
33
+ return (_jsxs("details", { className: "group flex flex-col", name: "geistdocs-mobile-nav", children: [_jsxs("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md px-3 font-normal text-2xl text-gray-900 outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000 [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: ["Vercel OSS", _jsx(ExternalArrow, { className: "mt-1" })] }), _jsx(IconChevronDownSmall, { className: "relative shrink-0 text-gray-700 transition-transform duration-150 group-open:rotate-180", size: 24 })] }), _jsx("div", { className: "flex flex-col gap-6 px-3 py-4", children: sections.map((section) => (_jsxs("div", { className: "flex flex-col", children: [_jsx("h3", { className: "mb-2 font-mono text-gray-700 text-xs uppercase tracking-wider", children: section.heading }), _jsx("ul", { className: "-mx-3 flex list-none flex-col", children: section.items.map((product) => (_jsx("li", { children: _jsx(OssNavLink, { onClick: onLinkClick, product: product }) }, product.href))) })] }, section.heading))) })] }));
15
34
  }
16
35
  function MobileMenuButton({ expanded, onClick, }) {
17
- return (_jsx("button", { "aria-expanded": expanded, "aria-label": expanded ? "Close menu" : "Open menu", className: "relative flex @min-[1024px]:hidden size-8 items-center justify-center rounded-full border border-gray-200 transition-colors hover:bg-gray-100", onClick: onClick, type: "button", children: _jsxs("span", { className: "flex flex-col items-center justify-center gap-[5px]", children: [_jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-all duration-150", expanded && "translate-y-[3.25px] rotate-45") }), _jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-all duration-150", expanded && "-translate-y-[3.25px] -rotate-45") })] }) }));
36
+ return (_jsx("button", { "aria-expanded": expanded, "aria-label": expanded ? "Close menu" : "Open menu", className: "relative flex @min-[1024px]:hidden size-8 items-center justify-center rounded-full border border-gray-200 transition-colors hover:bg-gray-100", "data-slot": "mobile-menu-toggle", onClick: onClick, type: "button", children: _jsxs("span", { className: "flex flex-col items-center justify-center gap-[5px]", children: [_jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-all duration-150", expanded && "translate-y-[3.25px] rotate-45") }), _jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-all duration-150", expanded && "-translate-y-[3.25px] -rotate-45") })] }) }));
18
37
  }
19
- export const MobileMenu = ({ githubUrl, nav }) => {
38
+ export const MobileMenu = ({ githubUrl, nav, ossProducts = [], }) => {
20
39
  const [show, setShow] = useState(false);
21
40
  const isActive = useNavActive();
41
+ // Featured products (eve) go under "Latest"; the rest group by `section`,
42
+ // preserving first-seen order (Frameworks / SDKs / Other).
43
+ const ossSections = [];
44
+ const featured = ossProducts.filter((p) => p.featured);
45
+ if (featured.length > 0) {
46
+ ossSections.push({ heading: "Latest", items: featured });
47
+ }
48
+ for (const product of ossProducts) {
49
+ if (product.featured) {
50
+ continue;
51
+ }
52
+ const heading = product.section ?? DEFAULT_OSS_SECTION;
53
+ const existing = ossSections.find((s) => s.heading === heading);
54
+ if (existing) {
55
+ existing.items.push(product);
56
+ }
57
+ else {
58
+ ossSections.push({ heading, items: [product] });
59
+ }
60
+ }
22
61
  useEffect(() => {
23
62
  setShow(false);
24
63
  }, []);
64
+ // Close the sheet when resizing up to desktop (also releases the scroll lock).
65
+ useEffect(() => {
66
+ const mq = window.matchMedia("(min-width: 1024px)");
67
+ const onChange = () => {
68
+ if (mq.matches) {
69
+ setShow(false);
70
+ }
71
+ };
72
+ onChange();
73
+ mq.addEventListener("change", onChange);
74
+ return () => mq.removeEventListener("change", onChange);
75
+ }, []);
25
76
  useEffect(() => {
26
77
  const handleEscape = (e) => {
27
78
  if (e.key === "Escape" && show) {
@@ -38,9 +89,9 @@ export const MobileMenu = ({ githubUrl, nav }) => {
38
89
  };
39
90
  }, [show]);
40
91
  const close = () => setShow(false);
41
- return (_jsxs(_Fragment, { children: [_jsx(MobileMenuButton, { expanded: show, onClick: () => setShow(!show) }), _jsx("div", { className: cn("fixed inset-0 top-16 z-40 bg-background-200 backdrop-blur-sm transition-opacity duration-200", show
92
+ return (_jsxs(_Fragment, { children: [_jsx(MobileMenuButton, { expanded: show, onClick: () => setShow(!show) }), _jsx("div", { className: cn("fixed inset-0 top-16 z-40 @min-[1024px]:hidden bg-background-200 backdrop-blur-sm transition-opacity duration-200", show
42
93
  ? "pointer-events-auto opacity-100"
43
- : "pointer-events-none opacity-0"), onClick: close }), _jsxs("div", { className: cn("fixed inset-x-0 top-16 bottom-0 z-40 overflow-y-auto bg-background-200 px-2 transition-all duration-200", show
94
+ : "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 transition-all duration-200", show
44
95
  ? "translate-y-0 opacity-100"
45
- : "pointer-events-none -translate-y-2 opacity-0"), children: [_jsx("div", { className: "p-4", children: _jsx(SearchButton, { className: "w-full", onClick: close }) }), _jsxs("nav", { className: "px-1", children: [nav.map(({ label, href }) => (_jsx(NavLink, { active: isActive(href), external: href.startsWith("http"), href: href, onClick: close, children: label }, href))), githubUrl ? (_jsx(NavLink, { external: true, href: githubUrl, onClick: close, children: "GitHub" })) : null] })] })] }));
96
+ : "pointer-events-none -translate-y-2 opacity-0"), children: [_jsx("div", { className: "p-4", children: _jsx(SearchButton, { className: "w-full", onClick: close }) }), _jsxs("nav", { className: "flex flex-col px-1", children: [nav.map(({ label, href }) => (_jsx(NavLink, { active: isActive(href), external: href.startsWith("http"), href: href, onClick: close, children: label }, href))), githubUrl ? (_jsx(NavLink, { external: true, href: githubUrl, onClick: close, children: "GitHub" })) : null, _jsx(OssCollapsible, { onLinkClick: close, sections: ossSections })] })] })] }));
46
97
  };
@@ -1,5 +1,7 @@
1
- import type { ReactNode } from "react";
1
+ import { type ReactNode } from "react";
2
2
  import type { GeistdocsNavbarOssProduct } from "../../config";
3
+ export declare const DEFAULT_OSS_SECTION = "Open Source";
4
+ export declare const DEFAULT_OSS_PRODUCTS: GeistdocsNavbarOssProduct[];
3
5
  type NavbarLogoProps = {
4
6
  className?: string;
5
7
  href?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"navbar-logo.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-logo.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAwB9D,KAAK,eAAe,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,CACA;IACE,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;CAC3C,GACD;IACE,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,SAAS,CAAC;CACjB,CACJ,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,IAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CAiEjB"}
1
+ {"version":3,"file":"navbar-logo.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-logo.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAK5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAY9D,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,EAoB3D,CAAC;AAgGF,KAAK,eAAe,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,CACA;IACE,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;CAC3C,GACD;IACE,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,SAAS,CAAC;CACjB,CACJ,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,IAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CA6IjB"}
@@ -1,32 +1,83 @@
1
1
  "use client";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import Link from "next/link";
4
+ import { useRouter } from "next/navigation";
5
+ import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui";
6
+ import { useEffect, useState } from "react";
4
7
  import { IconSlashForward } from "../../assets/icons/icon-slash-forward";
5
- import { LogoAiElements } from "../../assets/logos/logo-ai-elements";
6
- import { LogoAiSdk } from "../../assets/logos/logo-ai-sdk";
7
- import { LogoChatSdk } from "../../assets/logos/logo-chat-sdk";
8
8
  import { LogoEve } from "../../assets/logos/logo-eve";
9
- import { LogoFlagsSdk } from "../../assets/logos/logo-flags-sdk";
10
9
  import { LogoIconVercel } from "../../assets/logos/logo-icon-vercel";
11
- import { LogoTurborepo } from "../../assets/logos/logo-turborepo";
12
10
  import { LogoVercelOss } from "../../assets/logos/logo-vercel-oss";
13
- import { LogoWorkflowSdk } from "../../assets/logos/logo-workflow-sdk";
14
11
  import { cn } from "../cn";
15
- import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, } from "../ui/navigation-menu";
16
- const DEFAULT_OSS_PRODUCTS = [
17
- { href: "https://eve.dev/", logo: _jsx(LogoEve, { height: 12 }) },
18
- { href: "https://ai-sdk.dev/", logo: _jsx(LogoAiSdk, { height: 12 }) },
19
- { href: "https://flags-sdk.dev/", logo: _jsx(LogoFlagsSdk, { height: 20 }) },
20
- { href: "https://chat-sdk.dev/", logo: _jsx(LogoChatSdk, { height: 20 }) },
21
- { href: "https://workflow-sdk.dev/", logo: _jsx(LogoWorkflowSdk, { height: 12 }) },
22
- { href: "https://turborepo.dev/", logo: _jsx(LogoTurborepo, { height: 14 }) },
12
+ import { ExternalArrow } from "../external-arrow";
13
+ import { LocalizedLink } from "../localized-link";
14
+ import { NavigationMenu, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, } from "../ui/navigation-menu";
15
+ export const DEFAULT_OSS_SECTION = "Open Source";
16
+ export const DEFAULT_OSS_PRODUCTS = [
23
17
  {
24
- href: "https://elements.ai-sdk.dev/",
25
- logo: _jsx(LogoAiElements, { height: 12 }),
18
+ description: "The framework for building agents",
19
+ featured: true,
20
+ href: "https://eve.dev/",
21
+ label: "eve",
22
+ logo: _jsx(LogoEve, { height: 16 }),
26
23
  },
24
+ { href: "https://nextjs.org/", label: "Next.js", section: "Frameworks" },
25
+ { href: "https://svelte.dev/", label: "Svelte", section: "Frameworks" },
26
+ { href: "https://nuxt.com/", label: "Nuxt", section: "Frameworks" },
27
+ { href: "https://nitro.build/", label: "Nitro", section: "Frameworks" },
28
+ { href: "https://ai-sdk.dev/", label: "AI SDK", section: "SDKs" },
29
+ { href: "https://chat-sdk.dev/", label: "Chat SDK", section: "SDKs" },
30
+ { href: "https://flags-sdk.dev/", label: "Flags SDK", section: "SDKs" },
31
+ { href: "https://workflow-sdk.dev/", label: "Workflow SDK", section: "SDKs" },
32
+ { href: "https://turborepo.dev/", label: "Turborepo", section: "Other" },
33
+ { href: "https://ui.shadcn.com/", label: "Shadcn", section: "Other" },
34
+ { href: "https://swr.vercel.app/", label: "SWR", section: "Other" },
35
+ { href: "https://justbash.dev/", label: "just-bash", section: "Other" },
27
36
  ];
37
+ /** Group products into columns by `section`, preserving first-seen order. */
38
+ function groupOssProducts(products) {
39
+ const sections = [];
40
+ for (const product of products) {
41
+ const heading = product.section ?? DEFAULT_OSS_SECTION;
42
+ const existing = sections.find((section) => section.heading === heading);
43
+ if (existing) {
44
+ existing.items.push(product);
45
+ }
46
+ else {
47
+ sections.push({ heading, items: [product] });
48
+ }
49
+ }
50
+ return sections;
51
+ }
52
+ function OssProductLink({ product }) {
53
+ const external = product.external ?? product.href.startsWith("http");
54
+ const label = (_jsxs("span", { className: "inline-flex items-baseline gap-1 rounded-sm text-gray-1000 text-label-20 group-focus-visible/osslink:ring-2 group-focus-visible/osslink:ring-blue-700 group-focus-visible/osslink:ring-offset-4 group-focus-visible/osslink:ring-offset-background-200", children: [_jsx("span", { className: "decoration-1 underline-offset-[5px] group-hover/osslink:underline group-hover/osslink:decoration-gray-500", children: product.label }), external ? _jsx(ExternalArrow, {}) : null] }));
55
+ return (_jsx(NavigationMenuLink, { asChild: true, children: external ? (_jsx("a", { className: "group/osslink inline-flex w-full no-underline outline-none", href: product.href, rel: "noopener noreferrer", target: "_blank", children: label })) : (_jsx(LocalizedLink, { className: "group/osslink inline-flex w-full no-underline outline-none", href: product.href, children: label })) }));
56
+ }
57
+ function OssFeaturedCard({ product }) {
58
+ const external = product.external ?? product.href.startsWith("http");
59
+ const card = (_jsxs("span", { className: "flex h-full w-[220px] flex-col gap-3 rounded-lg border border-gray-alpha-400 bg-background-100 p-4 no-underline transition-colors hover:border-gray-alpha-500", children: [_jsx("span", { className: "flex flex-1 items-center justify-center rounded-md bg-gray-100", children: product.logo }), product.description ? (_jsxs("span", { className: "text-copy-14 text-gray-900", children: [product.description, external ? _jsx(ExternalArrow, {}) : null] })) : null] }));
60
+ return (_jsx(NavigationMenuLink, { asChild: true, children: external ? (_jsx("a", { className: "w-fit! rounded-lg no-underline outline-none focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-offset-2 focus-visible:ring-offset-background-200", href: product.href, rel: "noopener noreferrer", target: "_blank", children: card })) : (_jsx(LocalizedLink, { className: "w-fit! rounded-lg no-underline outline-none focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-offset-2 focus-visible:ring-offset-background-200", href: product.href, children: card })) }));
61
+ }
28
62
  export function NavbarLogo({ className, href = "/", ...props }) {
29
63
  const isOss = props.variant === "oss";
30
64
  const ossProducts = isOss ? (props.ossProducts ?? DEFAULT_OSS_PRODUCTS) : [];
31
- return (_jsxs("span", { className: cn("flex items-center gap-2.5", className), children: [_jsx(Link, { className: "text-gray-1000", href: isOss ? "https://vercel.com/oss" : "https://vercel.com/", rel: "noopener", target: "_blank", children: isOss ? (_jsxs(_Fragment, { children: [_jsx(LogoIconVercel, { className: "@min-[640px]:hidden", size: 20 }), _jsx(LogoVercelOss, { className: "@min-[640px]:block hidden", size: 18 })] })) : (_jsx(LogoIconVercel, { size: 20 })) }), _jsx("div", { className: "w-4 text-center text-gray-alpha-400 text-lg dark:text-gray-600", children: _jsx(IconSlashForward, {}) }), isOss ? (_jsx(NavigationMenu, { viewportClassName: "-left-5 top-4", children: _jsx(NavigationMenuList, { children: _jsxs(NavigationMenuItem, { className: "flex items-center", children: [_jsx(NavigationMenuTrigger, { className: "-m-3 flex items-center gap-1.5 p-3", children: _jsx(Link, { className: "flex items-center text-gray-1000", href: href, onClick: (e) => e.stopPropagation(), children: props.logo }) }), _jsx(NavigationMenuContent, { children: _jsx("ul", { className: "grid w-[200px] gap-0.5 p-2", children: ossProducts.map(({ href: linkHref, logo }) => (_jsx("li", { children: _jsx(NavigationMenuLink, { asChild: true, children: _jsx(Link, { className: "flex h-10 items-center gap-3 rounded-md px-3 py-2.5 text-gray-1000 text-sm outline-none transition-colors hover:bg-gray-100", href: linkHref, rel: "noopener", target: "_blank", children: logo }) }) }, linkHref))) }) })] }) }) })) : (_jsx(Link, { className: "flex items-center text-gray-1000", href: href, children: props.logo }))] }));
65
+ const featuredProducts = ossProducts.filter((product) => product.featured);
66
+ const ossSections = groupOssProducts(ossProducts.filter((product) => !product.featured));
67
+ const [navOpen, setNavOpen] = useState(false);
68
+ const router = useRouter();
69
+ // The OSS trigger navigates via router.push (it's a button, not a Link, so
70
+ // keyboard focus reaches radix), which skips next/link's automatic prefetch.
71
+ // Warm the route on mount so clicking home is as fast as the prefetched
72
+ // <Link> nav items. The standard variant's logo is a real <Link> already.
73
+ useEffect(() => {
74
+ if (isOss) {
75
+ router.prefetch(href);
76
+ }
77
+ }, [isOss, router, href]);
78
+ return (_jsxs("span", { className: cn("flex items-center gap-2.5", className), children: [_jsx(Link, { className: "relative flex items-center text-gray-1000 outline-none before:absolute before:-inset-x-1 before:top-1/2 before:h-9 before:-translate-y-1/2 before:rounded-md before:content-[''] focus-visible:before:ring-2 focus-visible:before:ring-blue-700 focus-visible:before:ring-inset", href: isOss ? "https://vercel.com/oss" : "https://vercel.com/", rel: "noopener", target: "_blank", children: isOss ? (_jsxs(_Fragment, { children: [_jsx(LogoIconVercel, { className: "@min-[640px]:hidden", size: 20 }), _jsx(LogoVercelOss, { className: "@min-[640px]:block hidden", size: 18 })] })) : (_jsx(LogoIconVercel, { size: 20 })) }), _jsx("div", { className: "w-4 text-center text-gray-alpha-400 text-lg dark:text-gray-600", children: _jsx(IconSlashForward, {}) }), isOss ? (_jsxs(_Fragment, { children: [_jsx(Link, { className: "flex @min-[1024px]:hidden items-center text-gray-1000", href: href, children: props.logo }), _jsxs("div", { className: "@min-[1024px]:contents hidden", children: [_jsx(NavigationMenu, { delayDuration: 0, onValueChange: (value) => setNavOpen(Boolean(value)), skipDelayDuration: 0, viewport: false, children: _jsx(NavigationMenuList, { className: "h-16 items-stretch", children: _jsxs(NavigationMenuItem, { className: "flex h-full items-center", children: [_jsx(NavigationMenuTrigger, { className: "relative -mx-3 flex h-full items-center gap-1.5 px-3 text-gray-1000 outline-none before:absolute before:inset-x-0 before:top-1/2 before:h-9 before:-translate-y-1/2 before:rounded-md before:content-[''] focus-visible:before:ring-2 focus-visible:before:ring-blue-700 focus-visible:before:ring-inset", onClick: (e) => {
79
+ if (e.detail !== 0) {
80
+ router.push(href);
81
+ }
82
+ }, children: props.logo }), _jsx(NavigationMenuPrimitive.Content, { className: "fixed inset-x-0 top-16 z-30 w-screen bg-background-200 shadow-[0_1px_0_0_var(--ds-gray-alpha-300)] before:absolute before:inset-x-0 before:-top-3 before:h-3 before:content-['']", children: _jsx("div", { className: "mx-auto w-full max-w-[1448px] px-2", children: _jsxs("div", { className: "flex flex-nowrap gap-x-10 pt-4 pb-6 pl-4", children: [featuredProducts.length > 0 ? (_jsxs("div", { className: "flex shrink-0 flex-col", children: [_jsx("h5", { className: "text-gray-900 text-label-14", children: "Latest" }), _jsx("div", { className: "mt-[5px] flex flex-1 gap-x-10", children: featuredProducts.map((product) => (_jsx(OssFeaturedCard, { product: product }, product.href))) })] })) : null, ossSections.map((section) => (_jsxs("div", { className: "min-w-[180px] shrink-0", children: [_jsx("h5", { className: "text-gray-900 text-label-14", children: section.heading }), _jsx("ul", { className: "mt-[5px] flex list-none flex-col", children: section.items.map((product) => (_jsx("li", { className: "flex", children: _jsx(OssProductLink, { product: product }) }, product.href))) })] }, section.heading)))] }) }) })] }) }) }), _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") })] })] })) : (_jsx(Link, { className: "flex items-center text-gray-1000", href: href, children: props.logo }))] }));
32
83
  }
@@ -3,6 +3,7 @@ import type { GeistdocsConfig } from "../config";
3
3
  interface PageActionsProps {
4
4
  config: Pick<GeistdocsConfig, "ai" | "feedback" | "github" | "pageActions" | "siteId">;
5
5
  page: {
6
+ markdownUrl: string;
6
7
  path?: string;
7
8
  url: string;
8
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"page-actions-client.d.ts","sourceRoot":"","sources":["../../src/internal/page-actions-client.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAmBjD,UAAU,gBAAgB;IACxB,MAAM,EAAE,IAAI,CACV,eAAe,EACf,IAAI,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,CACxD,CAAC;IACF,IAAI,EAAE;QACJ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,UAAU,oCAAoC;IAC5C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,EAAE,CAAC;CAC3B;AA2aD,eAAO,MAAM,oBAAoB,GAAI,kBAAkB,gBAAgB,mDAoItE,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,2BAG7C,oCAAoC,4CAiBtC,CAAC"}
1
+ {"version":3,"file":"page-actions-client.d.ts","sourceRoot":"","sources":["../../src/internal/page-actions-client.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAmBjD,UAAU,gBAAgB;IACxB,MAAM,EAAE,IAAI,CACV,eAAe,EACf,IAAI,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,CACxD,CAAC;IACF,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,UAAU,oCAAoC;IAC5C,MAAM,EAAE,IAAI,CAAC,eAAe,E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