@vercel/geistdocs 1.25.1-canary.738f050 → 1.25.1-canary.984aaa9

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 (37) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/components/code-block-tabs.d.ts.map +1 -1
  3. package/dist/components/code-block-tabs.js +3 -1
  4. package/dist/components/code-block.d.ts.map +1 -1
  5. package/dist/components/code-block.js +1 -1
  6. package/dist/components/copy-prompt.d.ts +2 -1
  7. package/dist/components/copy-prompt.d.ts.map +1 -1
  8. package/dist/components/copy-prompt.js +2 -2
  9. package/dist/components/heading.d.ts +7 -0
  10. package/dist/components/heading.d.ts.map +1 -0
  11. package/dist/components/heading.js +14 -0
  12. package/dist/components/table.d.ts +3 -0
  13. package/dist/components/table.d.ts.map +1 -0
  14. package/dist/components/table.js +3 -0
  15. package/dist/controls.js +1 -1
  16. package/dist/internal/page-actions-client.d.ts.map +1 -1
  17. package/dist/internal/page-actions-client.js +32 -11
  18. package/dist/internal/search.d.ts.map +1 -1
  19. package/dist/internal/search.js +1 -1
  20. package/dist/internal/sidebar.d.ts.map +1 -1
  21. package/dist/internal/sidebar.js +17 -14
  22. package/dist/internal/table-of-contents.d.ts.map +1 -1
  23. package/dist/internal/table-of-contents.js +1 -1
  24. package/dist/internal/ui/dropdown-menu.js +6 -6
  25. package/dist/mdx.d.ts.map +1 -1
  26. package/dist/mdx.js +10 -1
  27. package/dist/pages/docs.d.ts.map +1 -1
  28. package/dist/pages/docs.js +1 -1
  29. package/docs/agents.md +1 -1
  30. package/docs/llms.txt +46 -1
  31. package/docs/manifest.json +1 -1
  32. package/docs/pages/syntax.md +45 -0
  33. package/package.json +1 -1
  34. package/template/app/styles/geistdocs.css +1 -1
  35. package/template/content/docs/syntax.mdx +49 -0
  36. package/template/package.json +1 -1
  37. package/theme.css +33 -60
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.25.1-canary.738f050","-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.25.1-canary.984aaa9","-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);
@@ -1 +1 @@
1
- {"version":3,"file":"code-block-tabs.d.ts","sourceRoot":"","sources":["../../src/components/code-block-tabs.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,EACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEL,KAAK,cAAc,EAIpB,MAAM,OAAO,CA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7 +24,9 @@ export const CodeBlockTabs = ({ compact = false, ...props }) => {
24
24
  if (!compact) {
25
25
  return tabs;
26
26
  }
27
- return (_jsxs("div", { className: "relative [&_[role=tablist]]:hidden", children: [_jsxs("label", { className: "absolute top-2 right-12 z-2", children: [_jsx("span", { className: "sr-only", children: "Code language" }), _jsx("select", { "aria-label": "Code language", className: "h-8 cursor-pointer appearance-none rounded-md border-0 bg-transparent py-0 pr-7 pl-2 text-gray-900 text-label-13 outline-none transition-colors duration-150 ease-[cubic-bezier(0.175,0.885,0.32,1.1)] hover:bg-gray-200 focus-visible:shadow-[var(--ds-focus-ring)] motion-reduce:transition-none", onChange: (event) => setValue(event.target.value), value: value, children: options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value))) }), _jsx("span", { className: "pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-gray-900", children: _jsx(IconChevronDown, { size: 16 }) })] }), tabs] }));
27
+ const selectedLabel = options.find((option) => option.value === value)?.label ??
28
+ options[0]?.label;
29
+ return (_jsxs("div", { className: "relative [&_[role=tablist]]:hidden", children: [_jsxs("div", { className: "group absolute top-2 right-12 z-2 h-8", children: [_jsxs("div", { "aria-hidden": "true", className: "flex h-full cursor-pointer items-center gap-1 whitespace-nowrap rounded-md border-none bg-background-200 px-2 py-0 font-sans text-gray-900 text-label-13 leading-none transition-colors duration-200 group-focus-within:shadow-[var(--ds-focus-ring)] group-hover:bg-gray-200", children: [_jsx("span", { children: selectedLabel }), _jsx(IconChevronDown, { size: 16 })] }), _jsx("select", { "aria-label": "Code language", className: "absolute inset-0 cursor-pointer bg-gray-100 opacity-0 outline-hidden", onChange: (event) => setValue(event.target.value), value: value, children: options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value))) })] }), tabs] }));
28
30
  };
29
31
  export const CompactCodeBlockTabs = (props) => _jsx(CodeBlockTabs, { ...props, compact: true });
30
32
  export const CodeBlockTab = (props) => (_jsx(TabsContent, { ...props, className: cn("[&>div]:mb-0", props.className) }));
@@ -1 +1 @@
1
- {"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../src/components/code-block.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,UAAU,cAAc;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAuBD,eAAO,MAAM,SAAS,GAAI,mEAKvB,cAAc,4CA8BhB,CAAC"}
1
+ {"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../src/components/code-block.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,UAAU,cAAc;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAuBD,eAAO,MAAM,SAAS,GAAI,mEAKvB,cAAc,4CAuChB,CAAC"}
@@ -25,5 +25,5 @@ export const CodeBlock = ({ children, className, "data-line-numbers": lineNumber
25
25
  const code = isValidElement(children)
26
26
  ? children.props.children
27
27
  : children;
28
- return (_jsx(CodeBlockServer, { className: cn("[&_code]:min-w-full [&_code]:border-0 [&_code]:bg-transparent [&_code]:p-0", lineNumbers !== undefined && "line-numbers", frameworkTitle && "[&_[data-section=tabs]>div:first-child]:hidden", className), filename: frameworkTitle?.title ?? title, headerActions: frameworkTitle ? (_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 text-gray-900 text-label-13", children: [_jsx("span", { className: "flex w-4 shrink-0 items-center", children: frameworkTitle.icon }), _jsx("span", { className: "truncate", children: frameworkTitle.title })] })) : undefined, hideLineNumbers: lineNumbers === undefined, children: code }));
28
+ return (_jsx(CodeBlockServer, { className: cn("[&_code]:min-w-full [&_code]:border-0 [&_code]:bg-transparent [&_code]:p-0", "[&_:is(.line,.highlighted-line)]:relative [&_:is(.line,.highlighted-line)]:inline-block [&_:is(.line,.highlighted-line)]:h-5 [&_:is(.line,.highlighted-line)]:w-max [&_:is(.line,.highlighted-line)]:min-w-full [&_:is(.line,.highlighted-line)]:px-5!", "[&_:is(.highlighted-line,.line.highlighted,[data-highlighted=true])]:border-l-0! [&_:is(.highlighted-line,.line.highlighted,[data-highlighted=true])]:bg-blue-300! [&_:is(.highlighted-line,.line.highlighted,[data-highlighted=true])]:shadow-[inset_2px_0_0_0_var(--ds-blue-900)]", "[&_.line[data-active=true]]:bg-amber-300! [&_.line[data-active=true]]:shadow-[inset_2px_0_0_0_var(--ds-amber-900)]", "[&_:is([data-added=true],.line.diff.add)]:bg-green-300! [&_:is([data-added=true],.line.diff.add)]:shadow-[inset_2px_0_0_0_var(--ds-green-900)]", "[&_:is([data-removed=true],.line.diff.remove)]:bg-red-300! [&_:is([data-removed=true],.line.diff.remove)]:opacity-100! [&_:is([data-removed=true],.line.diff.remove)]:shadow-[inset_2px_0_0_0_var(--ds-red-900)]", "[&_:is(.line.diff.add,.line.diff.remove)::before]:content-none!", "[&_:is([data-added=true],[data-removed=true],.line.diff.add,.line.diff.remove)::after]:pointer-events-none [&_:is([data-added=true],[data-removed=true],.line.diff.add,.line.diff.remove)::after]:absolute [&_:is([data-added=true],[data-removed=true],.line.diff.add,.line.diff.remove)::after]:inset-0 [&_:is([data-added=true],[data-removed=true],.line.diff.add,.line.diff.remove)::after]:pl-2 [&_:is([data-added=true],[data-removed=true],.line.diff.add,.line.diff.remove)::after]:font-medium", "[&_:is([data-added=true],.line.diff.add)::after]:text-green-900 [&_:is([data-added=true],.line.diff.add)::after]:content-['+']", "[&_:is([data-removed=true],.line.diff.remove)::after]:text-red-900 [&_:is([data-removed=true],.line.diff.remove)::after]:content-['-']", lineNumbers !== undefined && "line-numbers", frameworkTitle && "[&_[data-section=tabs]>div:first-child]:hidden", className), filename: frameworkTitle?.title ?? title, headerActions: frameworkTitle ? (_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 text-gray-900 text-label-13", children: [_jsx("span", { className: "flex w-4 shrink-0 items-center", children: frameworkTitle.icon }), _jsx("span", { className: "truncate", children: frameworkTitle.title })] })) : undefined, hideLineNumbers: lineNumbers === undefined, children: code }));
29
29
  };
@@ -2,10 +2,11 @@ import { type ReactNode } from "react";
2
2
  interface CopyPromptProps {
3
3
  children?: ReactNode;
4
4
  className?: string;
5
+ collapsible?: boolean;
5
6
  projectOnly?: boolean;
6
7
  text: string;
7
8
  title?: string;
8
9
  }
9
- export declare const CopyPrompt: ({ children, className, projectOnly, text, title, }: CopyPromptProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const CopyPrompt: ({ children, className, collapsible, projectOnly, text, title, }: CopyPromptProps) => import("react/jsx-runtime").JSX.Element;
10
11
  export {};
11
12
  //# sourceMappingURL=copy-prompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"copy-prompt.d.ts","sourceRoot":"","sources":["../../src/components/copy-prompt.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AASjD,UAAU,eAAe;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqBD,eAAO,MAAM,UAAU,GAAI,oDAMxB,eAAe,4CAoIjB,CAAC"}
1
+ {"version":3,"file":"copy-prompt.d.ts","sourceRoot":"","sources":["../../src/components/copy-prompt.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AASjD,UAAU,eAAe;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqBD,eAAO,MAAM,UAAU,GAAI,iEAOxB,eAAe,4CAqIjB,CAAC"}
@@ -20,7 +20,7 @@ const getPlatformUrl = (platform, prompt) => {
20
20
  return encoded;
21
21
  }
22
22
  };
23
- export const CopyPrompt = ({ children, className, projectOnly = false, text, title = "Prompt for coding agents", }) => {
23
+ export const CopyPrompt = ({ children, className, collapsible = false, projectOnly = false, text, title = "Prompt for coding agents", }) => {
24
24
  const [isCopied, setIsCopied] = useState(false);
25
25
  const [isExpanded, setIsExpanded] = useState(false);
26
26
  const copy = async () => {
@@ -49,7 +49,7 @@ export const CopyPrompt = ({ children, className, projectOnly = false, text, tit
49
49
  ]),
50
50
  { icon: _jsx(CursorLogo, {}), label: "Open in Cursor", platform: "Cursor" },
51
51
  ];
52
- return (_jsx("div", { className: cn("not-prose my-4 mb-10 hidden w-full md:block", className), children: _jsxs("div", { className: "rounded-md border border-gray-400 bg-background-100", children: [_jsx("div", { className: "min-h-12 rounded-t-md border-gray-400 border-b bg-background-200 py-2 pr-2 pl-4", children: _jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsx("div", { className: "flex items-center gap-2 text-gray-900 text-label-13", children: title }), _jsxs("div", { className: "inline-flex shrink-0 overflow-hidden rounded-md border bg-background-100", children: [_jsxs("button", { className: "inline-flex h-8 items-center gap-1.5 px-3 font-medium text-sm transition-colors hover:bg-gray-100 hover:text-gray-1000 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-gray-600/50", onClick: copy, type: "button", children: [_jsxs("span", { className: "relative size-4", children: [_jsx(CopyPromptIcon, { className: cn("absolute inset-0 transition-all duration-200", isCopied ? "scale-75 opacity-0" : "scale-100 opacity-100") }), _jsx(IconCheck, { className: cn("absolute inset-0 size-4 transition-all duration-200", isCopied ? "scale-100 opacity-100" : "scale-75 opacity-0") })] }), _jsx("span", { children: "Copy" })] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { "aria-label": "Copy prompt actions", className: "inline-flex h-8 w-8 items-center justify-center border-l transition-colors hover:bg-gray-100 hover:text-gray-1000 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-gray-600/50", type: "button", children: _jsx(IconChevronDown, { className: "size-4" }) }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-60", children: menuItems.map((item, index) => (_jsxs("div", { children: [index === 1 ? _jsx(DropdownMenuSeparator, {}) : null, _jsxs(DropdownMenuItem, { onClick: () => openPlatform(item.platform), children: [item.icon, _jsx("span", { className: "flex-1", children: item.label }), _jsx(IconExternal, { className: "size-4" })] })] }, item.platform))) })] })] })] }) }), _jsxs("div", { className: "relative isolate rounded-b-md bg-background-100 p-4 pb-5", children: [_jsxs("div", { className: "relative overflow-hidden", children: [_jsx("div", { className: cn("break-words text-gray-900 text-sm leading-relaxed [&_a]:font-normal [&_a]:text-gray-1000 [&_a]:no-underline hover:[&_a]:underline [&_code]:rounded [&_code]:bg-gray-100 [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.9em]", isExpanded ? "" : "line-clamp-2", isExpanded ? "whitespace-pre-wrap" : ""), children: children ?? text }), isExpanded ? null : (_jsx("div", { className: "pointer-events-none absolute inset-0 bg-linear-to-b from-transparent via-transparent to-background-100" }))] }), _jsx("div", { className: "absolute left-1/2 -translate-x-1/2 translate-y-1/5", children: _jsxs(Button, { className: "mt-0 h-7 rounded-full bg-background-100 px-2 text-gray-900 text-xs shadow-(--ds-shadow-border-medium) hover:text-gray-1000 [&>span]:inline-flex [&>span]:items-center [&>span]:gap-1", onClick: () => setIsExpanded((current) => !current), size: "small", typeName: "button", variant: "secondary", children: [isExpanded ? (_jsx(IconChevronUp, { className: "size-3.5" })) : (_jsx(IconChevronDown, { className: "size-3.5" })), isExpanded ? "Show less" : "Show more"] }) })] })] }) }));
52
+ return (_jsx("div", { className: cn("not-prose my-4 mb-10 hidden w-full md:block", className), children: _jsxs("div", { className: "rounded-md border border-gray-400 bg-background-100", children: [_jsx("div", { className: "min-h-12 rounded-t-md border-gray-400 border-b bg-background-200 py-2 pr-2 pl-4", children: _jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsx("div", { className: "flex items-center gap-2 text-gray-900 text-label-13", children: title }), _jsxs("div", { className: "inline-flex shrink-0 overflow-hidden rounded-md border bg-background-100", children: [_jsxs("button", { className: "inline-flex h-8 items-center gap-1.5 px-3 font-medium text-sm transition-colors hover:bg-gray-100 hover:text-gray-1000 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-gray-600/50", onClick: copy, type: "button", children: [_jsxs("span", { className: "relative size-4", children: [_jsx(CopyPromptIcon, { className: cn("absolute inset-0 transition-all duration-200", isCopied ? "scale-75 opacity-0" : "scale-100 opacity-100") }), _jsx(IconCheck, { className: cn("absolute inset-0 size-4 transition-all duration-200", isCopied ? "scale-100 opacity-100" : "scale-75 opacity-0") })] }), _jsx("span", { children: "Copy" })] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { "aria-label": "Copy prompt actions", className: "inline-flex h-8 w-8 items-center justify-center border-l transition-colors hover:bg-gray-100 hover:text-gray-1000 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-gray-600/50", type: "button", children: _jsx(IconChevronDown, { className: "size-4" }) }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-60", children: menuItems.map((item, index) => (_jsxs("div", { children: [index === 1 ? _jsx(DropdownMenuSeparator, {}) : null, _jsxs(DropdownMenuItem, { onClick: () => openPlatform(item.platform), children: [item.icon, _jsx("span", { className: "flex-1", children: item.label }), _jsx(IconExternal, { className: "size-4" })] })] }, item.platform))) })] })] })] }) }), _jsxs("div", { className: "relative isolate rounded-b-md bg-background-100 p-4 pb-5", children: [_jsxs("div", { className: "relative overflow-hidden", children: [_jsx("div", { className: cn("break-words text-gray-900 text-sm leading-relaxed [&_a]:font-normal [&_a]:text-gray-1000 [&_a]:no-underline hover:[&_a]:underline [&_code]:rounded [&_code]:bg-gray-100 [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.9em]", collapsible && !isExpanded ? "line-clamp-2" : ""), children: children ?? text }), collapsible && !isExpanded ? (_jsx("div", { className: "pointer-events-none absolute inset-0 bg-linear-to-b from-transparent via-transparent to-background-100" })) : null] }), collapsible ? (_jsx("div", { className: "absolute left-1/2 -translate-x-1/2 translate-y-1/5", children: _jsxs(Button, { className: "mt-0 h-7 rounded-full bg-background-100 px-2 text-gray-900 text-xs shadow-(--ds-shadow-border-medium) hover:text-gray-1000 [&>span]:inline-flex [&>span]:items-center [&>span]:gap-1", onClick: () => setIsExpanded((current) => !current), size: "small", typeName: "button", variant: "secondary", children: [isExpanded ? (_jsx(IconChevronUp, { className: "size-3.5" })) : (_jsx(IconChevronDown, { className: "size-3.5" })), isExpanded ? "Show less" : "Show more"] }) })) : null] })] }) }));
53
53
  };
54
54
  const CopyPromptIcon = ({ className }) => (_jsxs("svg", { "aria-hidden": true, className: className, fill: "none", height: "16", viewBox: "0 0 16 16", width: "16", children: [_jsx("title", { children: "Copy prompt" }), _jsx("path", { d: "M6.75 14a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m3.75 0a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m3.75 0a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-7.5-3.25a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m7.5 0a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5M8.25.5C9.22.5 10 1.28 10 2.25V3H8.5v-.75A.25.25 0 0 0 8.25 2h-5.5a.25.25 0 0 0-.25.25v7.5c0 .14.11.25.25.25H4.5v1.5H2.75C1.78 11.5 1 10.72 1 9.75v-7.5C1 1.28 1.78.5 2.75.5zm-1.5 7.25a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m7.5 0a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5M6.75 4.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m3.75 0a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m3.75 0a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5", fill: "currentColor" })] }));
55
55
  const V0Logo = () => (_jsxs("svg", { "aria-hidden": true, className: "size-4", fill: "none", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("title", { children: "v0" }), _jsx("path", { d: "M6.1 9.46V5.52h1.52v5.03c0 .59-.48 1.07-1.07 1.07-.28 0-.56-.11-.76-.31L0 5.52h2.15zM16 10.1h-1.52V6.6l-3.5 3.5h3.5v1.52h-3.96a2.14 2.14 0 0 1-2.14-2.14V5.52H9.9v3.5l3.5-3.5H9.9V4h3.96C15.04 4 16 4.96 16 6.14z", fill: "currentColor" })] }));
@@ -0,0 +1,7 @@
1
+ import { type ComponentProps, type ElementType } from "react";
2
+ type HeadingProps = ComponentProps<"h1"> & {
3
+ as: ElementType;
4
+ };
5
+ export declare const Heading: ({ as, children, className, id, ...props }: HeadingProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
6
+ export {};
7
+ //# sourceMappingURL=heading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/components/heading.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAiB,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAE7E,KAAK,YAAY,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG;IACzC,EAAE,EAAE,WAAW,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,2CAMrB,YAAY,2FAqBd,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "@vercel/geistcn/utils";
3
+ import { IconLink } from "@vercel/geistcn-assets/icons";
4
+ import { createElement } from "react";
5
+ export const Heading = ({ as, children, className, id, ...props }) => {
6
+ if (!id) {
7
+ return createElement(as, { className, ...props }, children);
8
+ }
9
+ return createElement(as, {
10
+ className: cn("flex scroll-m-28 flex-row items-center gap-2", className),
11
+ id,
12
+ ...props,
13
+ }, _jsx("a", { className: "peer", "data-card": "", href: `#${id}`, children: children }), _jsx(IconLink, { "aria-hidden": "true", className: "size-3.5 shrink-0 opacity-0 transition-opacity peer-hover:opacity-100", color: "gray-900" }));
14
+ };
@@ -0,0 +1,3 @@
1
+ import type { ComponentProps } from "react";
2
+ export declare const Table: ({ className, ...props }: ComponentProps<"table">) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/components/table.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,eAAO,MAAM,KAAK,GAAI,yBAAyB,cAAc,CAAC,OAAO,CAAC,4CAmBrE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "@vercel/geistcn/utils";
3
+ export const Table = ({ className, ...props }) => (_jsx("div", { className: "relative overflow-auto", children: _jsx("table", { className: cn("my-[2em] w-full table-auto border-collapse border-spacing-0 rounded-none border-0 bg-transparent text-sm leading-[1.4]", "[&_td]:border-x-0 [&_td]:text-start [&_th]:border-x-0 [&_th]:text-start", "[&_thead]:border-gray-200 [&_thead]:border-b [&_thead]:bg-transparent", "[&_thead_th]:bg-transparent [&_thead_th]:pb-[0.8em] [&_thead_th]:align-bottom [&_thead_th]:text-gray-1000 [&_thead_th]:text-heading-16", "[&_thead_th:first-child]:pl-0 [&_thead_th:last-child]:pr-0 [&_thead_th]:px-[0.6em]", "[&_tbody_tr:last-child]:border-b-0 [&_tbody_tr]:border-gray-200 [&_tbody_tr]:border-b", "[&_tbody_td:first-child]:pl-0 [&_tbody_td:last-child]:pr-0 [&_tbody_td]:px-[0.6em] [&_tbody_td]:py-[0.8em] [&_tbody_td]:align-baseline", "[&_tfoot]:border-gray-200 [&_tfoot]:border-t", "[&_tfoot_td:first-child]:pl-0 [&_tfoot_td:last-child]:pr-0 [&_tfoot_td]:px-[0.6em] [&_tfoot_td]:py-[0.8em] [&_tfoot_td]:align-top", "[&_td_code]:text-[0.8125rem]", className), ...props }) }));
package/dist/controls.js CHANGED
@@ -12,7 +12,7 @@ import { useGeistdocsChat } from "./internal/chat/context";
12
12
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "./internal/ui/dropdown-menu";
13
13
  export const SearchButton = ({ className, onClick }) => {
14
14
  const { setOpenSearch } = useSearchContext();
15
- return (_jsxs("button", { className: cn("flex h-8 cursor-pointer items-center justify-between rounded-md border-0 bg-background-100 px-1.5 py-0 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-focus-ring", className), onClick: () => {
15
+ 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-focus-ring", className), onClick: () => {
16
16
  setOpenSearch(true);
17
17
  onClick?.();
18
18
  }, 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" })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"page-actions-client.d.ts","sourceRoot":"","sources":["../../src/internal/page-actions-client.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAKL,KAAK,SAAS,EAMf,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IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,EAAE,CAAC;CAC3B;AAurBD,eAAO,MAAM,oBAAoB,GAAI,yBAIlC,gBAAgB,mDAmHlB,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,2BAG7C,oCAAoC,4CAiBtC,CAAC"}
@@ -17,6 +17,26 @@ const actionClassName = "group flex min-h-8 w-full min-w-0 touch-manipulation it
17
17
  // Inline page-action link (icon + label) used in the mobile action row.
18
18
  const inlineActionClassName = "group flex touch-manipulation items-center gap-1.5 whitespace-nowrap text-gray-900 text-label-12 font-medium transition-colors hover:text-gray-1000 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-offset-2 focus-visible:ring-offset-background-100 motion-reduce:transition-none [&_svg]:size-3.5 [&_svg]:shrink-0";
19
19
  const DEFAULT_EDIT_PATH = "content/docs/{path}";
20
+ const markdownRequests = new Map();
21
+ const getMarkdown = (url) => {
22
+ const cached = markdownRequests.get(url);
23
+ if (cached) {
24
+ return cached;
25
+ }
26
+ const request = fetch(url)
27
+ .then((response) => {
28
+ if (!response.ok) {
29
+ throw new Error(`Failed to fetch markdown from ${url}`);
30
+ }
31
+ return response.text();
32
+ })
33
+ .catch((error) => {
34
+ markdownRequests.delete(url);
35
+ throw error;
36
+ });
37
+ markdownRequests.set(url, request);
38
+ return request;
39
+ };
20
40
  const trimSlashes = (value) => value.replace(/^\/+|\/+$/g, "");
21
41
  const resolveEditPath = ({ editPath = DEFAULT_EDIT_PATH, path, }) => {
22
42
  const pagePath = trimSlashes(path);
@@ -153,14 +173,18 @@ const FeedbackAction = ({ siteId }) => {
153
173
  };
154
174
  // The mobile action row: three primary actions rendered inline below the
155
175
  // page description.
156
- const InlinePageActions = ({ askAIEnabled, checked, copyEnabled, onAskAI, onCopy, onViewMarkdown, }) => {
176
+ const InlinePageActions = ({ askAIEnabled, checked, copyEnabled, onAskAI, onCopy, onPrefetchMarkdown, onViewMarkdown, }) => {
157
177
  const CopyStateIcon = checked ? IconCheck : IconCopy;
158
- return (_jsxs("div", { className: "flex items-center gap-3 border-b pb-3 text-label-12", children: [copyEnabled ? (_jsxs(_Fragment, { children: [_jsxs("button", { className: inlineActionClassName, onClick: onCopy, type: "button", children: [_jsx(CopyStateIcon, {}), _jsx("span", { children: checked ? "Copied" : "Copy for LLM" })] }), _jsx("span", { "aria-hidden": "true", className: "h-4 w-px shrink-0 bg-gray-alpha-400 max-sm:hidden" }), _jsxs("button", { className: cn(inlineActionClassName, "max-sm:hidden"), onClick: onViewMarkdown, type: "button", children: [_jsx(IconAcronymMarkdown, { "aria-hidden": "true" }), _jsx("span", { children: "View Markdown" })] })] })) : null, copyEnabled && askAIEnabled ? (_jsx("span", { "aria-hidden": "true", className: "h-4 w-px shrink-0 bg-gray-alpha-400" })) : null, askAIEnabled ? (_jsxs("button", { className: inlineActionClassName, onClick: onAskAI, type: "button", children: [_jsx(IconMessage, {}), _jsx("span", { children: "Ask AI about this page" })] })) : null] }));
178
+ let copyLabel = "Copy for LLM";
179
+ if (checked) {
180
+ copyLabel = "Copied";
181
+ }
182
+ return (_jsxs("div", { className: "flex items-center gap-3 border-b pb-3 text-label-12", children: [copyEnabled ? (_jsxs(_Fragment, { children: [_jsxs("button", { className: inlineActionClassName, onClick: onCopy, onFocus: onPrefetchMarkdown, onPointerEnter: onPrefetchMarkdown, type: "button", children: [_jsx(CopyStateIcon, {}), _jsx("span", { children: copyLabel })] }), _jsx("span", { "aria-hidden": "true", className: "h-4 w-px shrink-0 bg-gray-alpha-400 max-sm:hidden" }), _jsxs("button", { className: cn(inlineActionClassName, "max-sm:hidden"), onClick: onViewMarkdown, type: "button", children: [_jsx(IconAcronymMarkdown, { "aria-hidden": "true" }), _jsx("span", { children: "View Markdown" })] })] })) : null, copyEnabled && askAIEnabled ? (_jsx("span", { "aria-hidden": "true", className: "h-4 w-px shrink-0 bg-gray-alpha-400" })) : null, askAIEnabled ? (_jsxs("button", { className: inlineActionClassName, onClick: onAskAI, type: "button", children: [_jsx(IconMessage, {}), _jsx("span", { children: "Ask AI about this page" })] })) : null] }));
159
183
  };
160
184
  // The desktop action control: a compact copy button plus an actions dropdown,
161
185
  // aligned beside the page title.
162
- const DesktopPageActions = ({ askAIEnabled, checked, copyEnabled, editSourceEnabled, editSourceUrl, isMobile, menuView, onAskAI, onCopy, onViewMarkdown, openInChatEnabled, openInChatRef, otherProviders, providersBackRef, query, setMenuView, v0Provider, }) => {
163
- return (_jsxs("div", { className: "inline-flex shrink-0 overflow-hidden rounded-md border border-gray-400 bg-background-100", children: [copyEnabled ? (_jsxs("button", { "aria-label": "Copy page", className: "inline-flex h-8 touch-manipulation items-center gap-1.5 px-3 font-medium text-sm transition-colors hover:bg-gray-100 hover:text-gray-1000 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-gray-600/50", onClick: onCopy, type: "button", children: [_jsxs("span", { className: "relative size-4", children: [_jsx(IconCopy, { className: cn("absolute inset-0 size-4 transition-all duration-200", checked ? "scale-75 opacity-0" : "scale-100 opacity-100") }), _jsx(IconCheck, { className: cn("absolute inset-0 size-4 transition-all duration-200", checked ? "scale-100 opacity-100" : "scale-75 opacity-0") })] }), _jsx("span", { children: "Copy page" })] })) : null, _jsxs(DropdownMenu, { onOpenChange: (open) => {
186
+ const DesktopPageActions = ({ askAIEnabled, checked, copyEnabled, editSourceEnabled, editSourceUrl, isMobile, menuView, onAskAI, onCopy, onPrefetchMarkdown, onViewMarkdown, openInChatEnabled, openInChatRef, otherProviders, providersBackRef, query, setMenuView, v0Provider, }) => {
187
+ return (_jsxs("div", { className: "inline-flex shrink-0 overflow-hidden rounded-md border border-gray-400 bg-background-100", children: [copyEnabled ? (_jsxs("button", { "aria-label": "Copy page", className: "inline-flex h-8 touch-manipulation items-center gap-1.5 whitespace-nowrap px-3 font-medium text-sm transition-colors hover:bg-gray-100 hover:text-gray-1000 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-gray-600/50", onClick: onCopy, onFocus: onPrefetchMarkdown, onPointerEnter: onPrefetchMarkdown, type: "button", children: [_jsxs("span", { className: "relative size-4", children: [_jsx(IconCopy, { className: cn("absolute inset-0 size-4 transition-all duration-200", checked ? "scale-75 opacity-0" : "scale-100 opacity-100") }), _jsx(IconCheck, { className: cn("absolute inset-0 size-4 transition-all duration-200", checked ? "scale-100 opacity-100" : "scale-75 opacity-0") })] }), _jsx("span", { children: "Copy page" })] })) : null, _jsxs(DropdownMenu, { onOpenChange: (open) => {
164
188
  if (!open) {
165
189
  setMenuView("main");
166
190
  }
@@ -179,12 +203,9 @@ export const GeistdocsPageActions = ({ config, page, only, }) => {
179
203
  const openInChatRef = useRef(null);
180
204
  const providersBackRef = useRef(null);
181
205
  const markdownUrl = page.markdownUrl;
182
- const fetchMarkdown = async () => {
183
- const response = await fetch(markdownUrl);
184
- if (!response.ok) {
185
- throw new Error(`Failed to fetch markdown from ${markdownUrl}`);
186
- }
187
- return await response.text();
206
+ const fetchMarkdown = () => getMarkdown(markdownUrl);
207
+ const prefetchMarkdown = () => {
208
+ getMarkdown(markdownUrl).catch(() => undefined);
188
209
  };
189
210
  const [checked, handleCopy] = useCopyButton(async () => {
190
211
  await navigator.clipboard.writeText(await fetchMarkdown());
@@ -235,7 +256,7 @@ export const GeistdocsPageActions = ({ config, page, only, }) => {
235
256
  // Desktop variant aligns beside the title (self-end); the mobile variant is
236
257
  // rendered below the description and left-aligned.
237
258
  const rootClassName = only === "mobile" ? "@min-[961px]:hidden" : "self-end @max-[960px]:hidden";
238
- return (_jsxs("div", { className: rootClassName, children: [showDesktop ? (_jsx(DesktopPageActions, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, editSourceEnabled: editSourceEnabled, editSourceUrl: editSourceUrl, isMobile: isMobile, menuView: menuView, onAskAI: onAskAI, onCopy: handleCopy, onViewMarkdown: handleViewMarkdown, openInChatEnabled: openInChatEnabled, openInChatRef: openInChatRef, otherProviders: otherProviders, providersBackRef: providersBackRef, query: query, setMenuView: setMenuView, v0Provider: v0Provider })) : null, showMobile && (copyEnabled || askAIEnabled) ? (_jsx(InlinePageActions, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, onAskAI: onAskAI, onCopy: handleCopy, onViewMarkdown: handleViewMarkdown })) : null, _jsx("span", { "aria-live": "polite", className: "sr-only", children: checked ? "Page copied" : "" })] }));
259
+ return (_jsxs("div", { className: rootClassName, children: [showDesktop ? (_jsx(DesktopPageActions, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, editSourceEnabled: editSourceEnabled, editSourceUrl: editSourceUrl, isMobile: isMobile, menuView: menuView, onAskAI: onAskAI, onCopy: handleCopy, onPrefetchMarkdown: prefetchMarkdown, onViewMarkdown: handleViewMarkdown, openInChatEnabled: openInChatEnabled, openInChatRef: openInChatRef, otherProviders: otherProviders, providersBackRef: providersBackRef, query: query, setMenuView: setMenuView, v0Provider: v0Provider })) : null, showMobile && (copyEnabled || askAIEnabled) ? (_jsx(InlinePageActions, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, onAskAI: onAskAI, onCopy: handleCopy, onPrefetchMarkdown: prefetchMarkdown, onViewMarkdown: handleViewMarkdown })) : null, _jsx("span", { "aria-live": "polite", className: "sr-only", children: checked ? "Page copied" : "" })] }));
239
260
  };
240
261
  export const GeistdocsTableOfContentsActions = ({ config, extraActions, }) => {
241
262
  const actions = [];
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/internal/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EAUL,KAAK,WAAW,EACjB,MAAM,sCAAsC,CAAC;AAI9C,eAAO,MAAM,qBAAqB,GAAI,wBAGnC,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,4CAoCrC,CAAC"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/internal/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EAUL,KAAK,WAAW,EACjB,MAAM,sCAAsC,CAAC;AAI9C,eAAO,MAAM,qBAAqB,GAAI,wBAGnC,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,4CAwCrC,CAAC"}
@@ -11,5 +11,5 @@ export const GeistdocsSearchDialog = ({ basePath, ...props }) => {
11
11
  locale,
12
12
  api: getPublicPath("/api/search", basePath),
13
13
  });
14
- return (_jsxs(FumadocsSearchDialog, { isLoading: query.isLoading, onSearchChange: setSearch, search: search, ...props, children: [_jsx(SearchDialogOverlay, { className: "bg-background-100/80 backdrop-blur-none" }), _jsxs(SearchDialogContent, { className: "border-none", "data-geistdocs-command-modal": true, children: [_jsxs(SearchDialogHeader, { children: [_jsx(SearchDialogIcon, {}), _jsx(SearchDialogInput, {}), _jsx(SearchDialogClose, {})] }), _jsx(SearchDialogList, { "aria-label": "Search results", Item: (itemProps) => (_jsx(SearchDialogListItem, { ...itemProps, role: "option" })), items: query.data === "empty" ? null : query.data, role: "listbox" })] })] }));
14
+ return (_jsxs(FumadocsSearchDialog, { isLoading: query.isLoading, onSearchChange: setSearch, search: search, ...props, children: [_jsx(SearchDialogOverlay, { className: "bg-background-100/80 backdrop-blur-none" }), _jsxs(SearchDialogContent, { className: "border-none", "data-geistdocs-command-modal": true, onEscapeKeyDown: () => props.onOpenChange(false), children: [_jsxs(SearchDialogHeader, { children: [_jsx(SearchDialogIcon, {}), _jsx(SearchDialogInput, {}), _jsx(SearchDialogClose, {})] }), _jsx(SearchDialogList, { "aria-label": "Search results", Item: (itemProps) => (_jsx(SearchDialogListItem, { ...itemProps, role: "option" })), items: query.data === "empty" ? null : query.data, role: "listbox" })] })] }));
15
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,YAAY,CAAC;AA85B5E,eAAO,MAAM,gBAAgB,GAAI,6BAI9B;IACD,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,4CA+DA,CAAC"}
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,YAAY,CAAC;AAu6B5E,eAAO,MAAM,gBAAgB,GAAI,6BAI9B;IACD,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,4CA+DA,CAAC"}
@@ -126,16 +126,16 @@ const useOpenedFolders = (nodes, activeUrl, openFirstLevel, scope) => {
126
126
  };
127
127
  return { manualToggleRef, opened, toggleFolder };
128
128
  };
129
- const SidebarSeparatorRow = ({ depth, item, }) => (_jsxs("li", { className: cn("mt-4 flex items-center gap-2 px-2 pt-2 pb-1 text-gray-900 text-label-13 first:mt-0 [&_svg]:size-4", depth > 0 && "ml-3"), children: [item.icon ? _jsx("span", { className: "shrink-0", children: item.icon }) : null, _jsx("span", { className: "min-w-0 truncate", children: item.name })] }));
129
+ const SidebarSeparatorRow = ({ depth, item, }) => (_jsxs("li", { className: cn("mt-4 flex items-center gap-2 px-2 pt-2 pb-1 font-medium text-gray-900 text-label-13 first:mt-0 [&_svg]:size-4", depth > 0 && "ml-3"), children: [item.icon ? _jsx("span", { className: "shrink-0", children: item.icon }) : null, _jsx("span", { className: "min-w-0 truncate", children: item.name })] }));
130
130
  const SidebarTreeItems = ({ depth, nodes, parentPath, state, }) => (_jsx(_Fragment, { children: nodes.map((node, index) => (_jsx(SidebarTreeNode, { depth: depth, node: node, path: [...parentPath, index], state: state }, getSidebarNodeId(node, [...parentPath, index], state.idScope)))) }));
131
131
  const getSidebarRowTone = (isSelected, isGroup) => {
132
132
  if (isSelected) {
133
- return "bg-gray-200 text-gray-1000 active:bg-gray-300";
133
+ return "bg-gray-200 text-gray-1000";
134
134
  }
135
135
  if (isGroup) {
136
- return "text-gray-1000 hover:bg-gray-alpha-100 focus-visible:bg-gray-alpha-100 active:bg-gray-alpha-300";
136
+ return "text-gray-1000 hover:bg-gray-100 focus-visible:bg-gray-100";
137
137
  }
138
- return "text-gray-900 hover:bg-gray-alpha-100 hover:text-gray-1000 focus-visible:bg-gray-alpha-100 focus-visible:text-gray-1000 active:bg-gray-alpha-300";
138
+ return "text-gray-900 hover:bg-gray-100 hover:text-gray-1000 focus-visible:bg-gray-100 focus-visible:text-gray-1000";
139
139
  };
140
140
  const SidebarDisclosureIcon = ({ expanded }) => (_jsx(_Fragment, { children: expanded ? (_jsx(IconChevronDownSmall, { size: 16 })) : (_jsx(IconChevronRight, { size: 16 })) }));
141
141
  const SidebarBadge = ({ label }) => label ? (_jsx("span", { className: cn("inline-flex h-6 max-w-24 shrink-0 items-center truncate rounded-full px-2 text-button-12", getSidebarBadgeTone(label)), children: label })) : null;
@@ -154,11 +154,13 @@ const SidebarTreeNode = ({ depth, node, path, state, }) => {
154
154
  const menuId = getDomId(state.idPrefix, nodeId);
155
155
  const labelId = `${menuId}-label`;
156
156
  const rowClassName = cn("flex h-9 origin-left touch-manipulation flex-row items-center rounded-md pr-1 pl-2.5 motion-reduce:transition-none", getSidebarRowTone(isSelected, isGroup));
157
- const content = (_jsxs(_Fragment, { children: [node.icon ? (_jsx("span", { className: "shrink-0 [&_svg]:size-4", children: node.icon })) : null, _jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-1.5 truncate text-button-14", children: [_jsx(SidebarBadge, { label: badge }), _jsx("span", { className: "min-w-0 flex-1 truncate", id: labelId, children: node.name }), isExternalSidebarItem(item) ? (_jsx(IconArrowUpRight, { className: "ml-auto size-4 shrink-0 text-gray-900" })) : null] })] }));
157
+ const content = (_jsxs(_Fragment, { children: [node.icon ? (_jsx("span", { className: "shrink-0 [&_svg]:size-4", children: node.icon })) : null, _jsxs("span", { className: cn("flex min-w-0 flex-1 items-center gap-1.5 truncate text-button-14", depth > 0 && "font-normal"), children: [_jsx(SidebarBadge, { label: badge }), _jsx("span", { className: "min-w-0 flex-1 truncate", id: labelId, children: node.name }), isExternalSidebarItem(item) ? (_jsx(IconArrowUpRight, { className: "ml-auto size-4 shrink-0 text-gray-900" })) : null] })] }));
158
158
  const handleLinkClick = (event) => {
159
159
  state.onNavigate?.();
160
- if (opensOutsideCurrentPage(event, item?.external, item?.url ?? "") ||
161
- !(folder && hasChildren && (isSelected || !isExpanded))) {
160
+ if (opensOutsideCurrentPage(event, item?.external, item?.url ?? "")) {
161
+ return;
162
+ }
163
+ if (!(folder && hasChildren && (isSelected || !isExpanded))) {
162
164
  return;
163
165
  }
164
166
  state.toggleFolder(folder, path);
@@ -173,7 +175,7 @@ const SidebarTreeNode = ({ depth, node, path, state, }) => {
173
175
  else {
174
176
  primaryControl = (_jsx("span", { className: cn(rowClassName, "min-w-0 flex-1"), children: content }));
175
177
  }
176
- return (_jsxs("li", { className: cn("relative flex w-full select-none flex-col items-stretch", depth > 0 && "pl-3"), children: [_jsxs("div", { className: "relative flex w-full items-center gap-px", children: [primaryControl, item && folder && hasChildren ? (_jsx("button", { "aria-controls": menuId, "aria-expanded": isExpanded, "aria-labelledby": labelId, className: "grid size-8 flex-none cursor-pointer touch-manipulation place-content-center rounded-md bg-transparent p-0 text-gray-900 hover:bg-gray-alpha-100 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none active:bg-gray-alpha-300 motion-reduce:transition-none", onClick: () => state.toggleFolder(folder, path), type: "button", children: _jsx(SidebarDisclosureIcon, { expanded: isExpanded }) })) : null] }), folder && hasChildren && isExpanded ? (_jsx("ul", { className: "relative mt-px mb-1 flex w-full list-none flex-col gap-px p-0", id: menuId, children: _jsx(SidebarTreeItems, { depth: depth + 1, nodes: folder.children, parentPath: path, state: state }) })) : null] }));
178
+ return (_jsxs("li", { className: cn("relative flex w-full select-none flex-col items-stretch", depth > 0 && "pl-3"), children: [_jsxs("div", { className: "relative flex w-full items-center gap-px", children: [primaryControl, item && folder && hasChildren ? (_jsx("button", { "aria-controls": menuId, "aria-expanded": isExpanded, "aria-labelledby": labelId, className: "grid h-9 w-8 flex-none cursor-pointer touch-manipulation place-content-center rounded-md bg-transparent p-0 text-gray-900 hover:bg-gray-100 focus-visible:bg-gray-100 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none motion-reduce:transition-none", onClick: () => state.toggleFolder(folder, path), type: "button", children: _jsx(SidebarDisclosureIcon, { expanded: isExpanded }) })) : null] }), folder && hasChildren && isExpanded ? (_jsx("ul", { className: "relative mt-px mb-1 flex w-full list-none flex-col gap-px p-0", id: menuId, children: _jsx(SidebarTreeItems, { depth: depth + 1, nodes: folder.children, parentPath: path, state: state }) })) : null] }));
177
179
  };
178
180
  const SidebarTree = ({ activeUrl, idScope, nodes, onNavigate, openFirstLevel = false, scrollActive = false, visible = true, }) => {
179
181
  const generatedId = useId().replace(UNSAFE_ID_CHARACTERS, "");
@@ -194,7 +196,7 @@ const SidebarTree = ({ activeUrl, idScope, nodes, onNavigate, openFirstLevel = f
194
196
  const SidebarRootList = ({ activeSection, activeUrl, groups, onSelect, visible, }) => {
195
197
  const contentRef = useRef(null);
196
198
  useActiveItemScroll(contentRef, activeUrl, visible, activeSection?.$id ?? "root");
197
- return (_jsx("div", { className: "flex flex-col gap-4 px-2 pt-1 pb-2", ref: contentRef, children: groups.map((group) => (_jsxs("div", { className: "flex flex-col", children: [group.label || group.icon ? (_jsxs("div", { className: "flex items-center gap-2 px-2 pt-2 pb-1 text-gray-900 text-label-13 [&_svg]:size-4", children: [group.icon ? (_jsx("span", { className: "shrink-0", children: group.icon })) : null, _jsx("span", { className: "min-w-0 truncate", children: group.label })] })) : null, _jsx("ul", { className: "m-0 flex list-none flex-col gap-px p-0", children: group.items.map((section, index) => (_jsx(SidebarRootItem, { activeSection: activeSection, activeUrl: activeUrl, item: section, onSelect: onSelect }, getSidebarNodeId(section, [index])))) })] }, group.id))) }));
199
+ return (_jsx("div", { className: "flex flex-col gap-4 px-2 pt-1 pb-2", ref: contentRef, children: groups.map((group) => (_jsxs("div", { className: "flex flex-col", children: [group.label || group.icon ? (_jsxs("div", { className: "flex items-center gap-2 px-2 pt-2 pb-1 font-medium text-gray-900 text-label-13 [&_svg]:size-4", children: [group.icon ? (_jsx("span", { className: "shrink-0", children: group.icon })) : null, _jsx("span", { className: "min-w-0 truncate", children: group.label })] })) : null, _jsx("ul", { className: "m-0 flex list-none flex-col gap-px p-0", children: group.items.map((section, index) => (_jsx(SidebarRootItem, { activeSection: activeSection, activeUrl: activeUrl, item: section, onSelect: onSelect }, getSidebarNodeId(section, [index])))) })] }, group.id))) }));
198
200
  };
199
201
  const SidebarRootItem = ({ activeSection, activeUrl, item, onSelect, }) => {
200
202
  const folder = item.type === "folder" ? item : null;
@@ -204,10 +206,11 @@ const SidebarRootItem = ({ activeSection, activeUrl, item, onSelect, }) => {
204
206
  const separateDisclosure = hasSeparateRootDisclosure(item);
205
207
  const isCurrentPage = linkItem?.url === activeUrl;
206
208
  const isActive = item === activeSection || isCurrentPage;
209
+ const labelWeight = { folder: "font-medium", page: "font-normal" }[item.type];
207
210
  const className = cn("flex h-9 touch-manipulation items-center gap-2 rounded-md pr-2 pl-2.5 no-underline outline-none focus-visible:shadow-[var(--ds-focus-ring)] motion-reduce:transition-none", isActive
208
- ? "bg-gray-200 text-gray-1000 active:bg-gray-300"
209
- : "text-gray-900 hover:bg-gray-alpha-100 hover:text-gray-1000 active:bg-gray-alpha-300");
210
- const content = (_jsxs(_Fragment, { children: [item.icon ? (_jsx("span", { className: "shrink-0 [&_svg]:size-4", children: item.icon })) : null, _jsx(SidebarBadge, { label: badge }), _jsx("span", { className: "min-w-0 flex-1 truncate text-button-14", children: item.name }), isExternalSidebarItem(linkItem) ? (_jsx(IconArrowUpRight, { className: "size-4 shrink-0 text-gray-900" })) : null, opensSection && !separateDisclosure ? (_jsx(IconChevronRight, { className: "shrink-0 text-gray-900", size: 16 })) : null] }));
211
+ ? "bg-gray-200 text-gray-1000"
212
+ : "text-gray-900 hover:bg-gray-100 hover:text-gray-1000 focus-visible:bg-gray-100");
213
+ const content = (_jsxs(_Fragment, { children: [item.icon ? (_jsx("span", { className: "shrink-0 [&_svg]:size-4", children: item.icon })) : null, _jsx(SidebarBadge, { label: badge }), _jsx("span", { className: cn("min-w-0 flex-1 truncate text-button-14", labelWeight), children: item.name }), isExternalSidebarItem(linkItem) ? (_jsx(IconArrowUpRight, { className: "size-4 shrink-0 text-gray-900" })) : null, opensSection && !separateDisclosure ? (_jsx(IconChevronRight, { className: "shrink-0 text-gray-900", size: 16 })) : null] }));
211
214
  let renderedItem;
212
215
  if (linkItem) {
213
216
  renderedItem = (_jsx(Link, { "aria-current": isCurrentPage ? "page" : undefined, className: cn(className, separateDisclosure && "min-w-0 flex-1"), "data-sidebar-active": isActive, external: linkItem.external, href: linkItem.url, onClick: folder && opensSection
@@ -224,9 +227,9 @@ const SidebarRootItem = ({ activeSection, activeUrl, item, onSelect, }) => {
224
227
  else {
225
228
  renderedItem = _jsx("span", { className: className, children: content });
226
229
  }
227
- return (_jsxs("li", { className: cn(separateDisclosure && "flex items-center gap-px"), children: [renderedItem, separateDisclosure ? (_jsx("button", { "aria-label": getRootDisclosureLabel(item.name), className: "grid size-8 flex-none cursor-pointer touch-manipulation place-content-center rounded-md bg-transparent p-0 text-gray-900 hover:bg-gray-alpha-100 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none active:bg-gray-alpha-300 motion-reduce:transition-none", onClick: (event) => onSelect(item, event.currentTarget), type: "button", children: _jsx(IconChevronRight, { size: 16 }) })) : null] }));
230
+ return (_jsxs("li", { className: cn(separateDisclosure && "flex items-center gap-px"), children: [renderedItem, separateDisclosure ? (_jsx("button", { "aria-label": getRootDisclosureLabel(item.name), className: "grid size-8 flex-none cursor-pointer touch-manipulation place-content-center rounded-md bg-transparent p-0 text-gray-900 hover:bg-gray-100 focus-visible:bg-gray-100 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none motion-reduce:transition-none", onClick: (event) => onSelect(item, event.currentTarget), type: "button", children: _jsx(IconChevronRight, { size: 16 }) })) : null] }));
228
231
  };
229
- const SidebarSectionHeader = ({ buttonRef, onBack, section, }) => (_jsx("div", { className: "mb-2 px-2 pt-1", children: _jsxs("button", { "aria-label": "Back to all documentation sections", className: "flex w-full cursor-pointer touch-manipulation flex-row items-center justify-between gap-1 rounded-md border-0 bg-transparent p-0 text-gray-900 hover:bg-gray-alpha-100 hover:text-gray-1000 focus-visible:bg-gray-alpha-100 focus-visible:text-gray-1000 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none active:bg-gray-alpha-300 motion-reduce:transition-none", onClick: onBack, ref: buttonRef, type: "button", children: [_jsx("span", { className: "grid size-9 flex-none place-content-center", children: _jsx(IconChevronRight, { className: "rotate-180", size: 16 }) }), _jsx("span", { className: "flex min-w-0 flex-1 items-center justify-center text-button-14", children: _jsx("span", { className: "truncate", children: section.name }) }), _jsx("span", { className: "size-9 flex-none" })] }) }));
232
+ const SidebarSectionHeader = ({ buttonRef, onBack, section, }) => (_jsx("div", { className: "mb-2 px-2 pt-1", children: _jsxs("button", { "aria-label": "Back to all documentation sections", className: "flex w-full cursor-pointer touch-manipulation flex-row items-center justify-between gap-1 rounded-md border-0 bg-transparent p-0 text-gray-900 hover:bg-gray-100 hover:text-gray-1000 focus-visible:bg-gray-100 focus-visible:text-gray-1000 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none motion-reduce:transition-none", onClick: onBack, ref: buttonRef, type: "button", children: [_jsx("span", { className: "grid size-9 flex-none place-content-center", children: _jsx(IconChevronRight, { className: "rotate-180", size: 16 }) }), _jsx("span", { className: "flex min-w-0 flex-1 items-center justify-center text-button-14", children: _jsx("span", { className: "truncate", children: section.name }) }), _jsx("span", { className: "size-9 flex-none" })] }) }));
230
233
  const DesktopSectionsSidebar = ({ activeUrl, nodes, rootScope, top, }) => {
231
234
  const groups = useMemo(() => getSidebarRootGroups(nodes), [nodes]);
232
235
  const currentSection = useMemo(() => findActiveRootSection(nodes, activeUrl), [activeUrl, nodes]);
@@ -1 +1 @@
1
- {"version":3,"file":"table-of-contents.d.ts","sourceRoot":"","sources":["../../src/internal/table-of-contents.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,UAAU,6BAA6B;IACrC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,GAAG,EAAE,eAAe,CAAC;CACtB;AAED,eAAO,MAAM,wBAAwB,GAAI,0BAItC,6BAA6B,4CAqB/B,CAAC"}
1
+ {"version":3,"file":"table-of-contents.d.ts","sourceRoot":"","sources":["../../src/internal/table-of-contents.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,UAAU,6BAA6B;IACrC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,GAAG,EAAE,eAAe,CAAC;CACtB;AAED,eAAO,MAAM,wBAAwB,GAAI,0BAItC,6BAA6B,4CAwB/B,CAAC"}
@@ -2,4 +2,4 @@
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { TOCScrollArea } from "fumadocs-ui/components/toc/index";
4
4
  import { TOCItems } from "./toc-items";
5
- export const GeistdocsTableOfContents = ({ footer, header, toc, }) => (_jsx("aside", { "aria-label": "Page navigation", className: "sticky top-(--fd-docs-row-1) hidden h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] w-(--fd-toc-width) flex-col pt-14 pr-4 pb-2 [grid-area:toc] xl:flex", id: "nd-toc", children: _jsxs("nav", { "aria-label": "On this page", className: "flex min-h-0 flex-1 flex-col", children: [header, toc.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "mb-2 font-medium text-gray-1000 text-sm", children: "On this page" }), _jsx(TOCScrollArea, { className: "geistdocs-toc-scroll", children: _jsx(TOCItems, {}) })] })) : null, footer] }) }));
5
+ export const GeistdocsTableOfContents = ({ footer, header, toc, }) => (_jsx("aside", { "aria-label": "Page navigation", className: "sticky top-(--fd-docs-row-1) hidden h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] w-(--fd-toc-width) flex-col pt-14 pr-4 pb-2 [grid-area:toc] xl:flex", id: "nd-toc", children: _jsxs("nav", { "aria-label": "On this page", className: "ml-0.5 flex min-h-0 flex-1 flex-col", children: [header, toc.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "mb-2 font-medium text-gray-1000 text-sm", children: "On this page" }), _jsx(TOCScrollArea, { className: "geistdocs-toc-scroll", children: _jsx(TOCItems, {}) })] })) : null, footer] }) }));
@@ -10,10 +10,10 @@ export function DropdownMenuTrigger(props) {
10
10
  return (_jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props }));
11
11
  }
12
12
  export function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
13
- return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { className: cn("data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 material-menu z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden overscroll-contain p-1 text-gray-1000 data-[state=closed]:animate-out motion-reduce:animate-none", className), "data-slot": "dropdown-menu-content", sideOffset: sideOffset, ...props }) }));
13
+ return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { className: cn("data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 material-menu z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden overscroll-contain p-(--ds-popover-padding) text-gray-1000 data-[state=closed]:animate-out motion-reduce:animate-none", className), "data-slot": "dropdown-menu-content", sideOffset: sideOffset, ...props }) }));
14
14
  }
15
15
  export function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
16
- return (_jsx(DropdownMenuPrimitive.Item, { className: cn("data-[variant=destructive]:*:[svg]:!text-red-800 relative flex cursor-default touch-manipulation select-none items-center gap-2 rounded-sm px-2 py-1.5 text-label-14 outline-hidden focus:bg-gray-100 focus:text-gray-1000 data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-red-800 data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-red-800/10 data-[variant=destructive]:focus:text-red-800 dark:data-[variant=destructive]:focus:bg-red-800/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-gray-900 [&_svg]:pointer-events-none [&_svg]:shrink-0", className), "data-inset": inset, "data-slot": "dropdown-menu-item", "data-variant": variant, ...props }));
16
+ return (_jsx(DropdownMenuPrimitive.Item, { className: cn("data-[variant=destructive]:*:[svg]:!text-red-800 relative flex cursor-default touch-manipulation select-none items-center gap-2 rounded-(--ds-popover-row-radius) px-2 py-1.5 text-label-14 outline-hidden focus:bg-gray-100 focus:text-gray-1000 data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-red-800 data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-red-800/10 data-[variant=destructive]:focus:text-red-800 dark:data-[variant=destructive]:focus:bg-red-800/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-gray-900 [&_svg]:pointer-events-none [&_svg]:shrink-0", className), "data-inset": inset, "data-slot": "dropdown-menu-item", "data-variant": variant, ...props }));
17
17
  }
18
18
  export function DropdownMenuLabel({ className, inset, ...props }) {
19
19
  return (_jsx(DropdownMenuPrimitive.Label, { className: cn("px-2 py-1.5 font-medium text-sm data-[inset]:pl-8", className), "data-inset": inset, "data-slot": "dropdown-menu-label", ...props }));
@@ -22,20 +22,20 @@ export function DropdownMenuSeparator({ className, ...props }) {
22
22
  return (_jsx(DropdownMenuPrimitive.Separator, { className: cn("-mx-1 my-1 h-px bg-gray-alpha-400", className), "data-slot": "dropdown-menu-separator", ...props }));
23
23
  }
24
24
  export function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
25
- return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { checked: checked, className: cn("relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-gray-100 focus:text-gray-1000 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className), "data-slot": "dropdown-menu-checkbox-item", ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(IconCheck, { className: "size-4" }) }) }), children] }));
25
+ return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { checked: checked, className: cn("relative flex cursor-default select-none items-center gap-2 rounded-(--ds-popover-row-radius) py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-gray-100 focus:text-gray-1000 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className), "data-slot": "dropdown-menu-checkbox-item", ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(IconCheck, { className: "size-4" }) }) }), children] }));
26
26
  }
27
27
  export function DropdownMenuRadioGroup(props) {
28
28
  return (_jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
29
29
  }
30
30
  export function DropdownMenuRadioItem({ className, children, ...props }) {
31
- return (_jsxs(DropdownMenuPrimitive.RadioItem, { className: cn("relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-gray-100 focus:text-gray-1000 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className), "data-slot": "dropdown-menu-radio-item", ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(IconCircle, { className: "size-2 fill-current" }) }) }), children] }));
31
+ return (_jsxs(DropdownMenuPrimitive.RadioItem, { className: cn("relative flex cursor-default select-none items-center gap-2 rounded-(--ds-popover-row-radius) py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-gray-100 focus:text-gray-1000 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className), "data-slot": "dropdown-menu-radio-item", ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(IconCircle, { className: "size-2 fill-current" }) }) }), children] }));
32
32
  }
33
33
  export function DropdownMenuSub(props) {
34
34
  return _jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
35
35
  }
36
36
  export function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
37
- return (_jsxs(DropdownMenuPrimitive.SubTrigger, { className: cn("flex cursor-default touch-manipulation select-none items-center gap-2 rounded-sm px-2 py-1.5 text-label-14 outline-hidden focus:bg-gray-100 focus:text-gray-1000 data-[state=open]:bg-gray-100 data-[inset]:pl-8 data-[state=open]:text-gray-1000 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-gray-900 [&_svg]:pointer-events-none [&_svg]:shrink-0", className), "data-inset": inset, "data-slot": "dropdown-menu-sub-trigger", ...props, children: [children, _jsx(IconChevronRight, { className: "ml-auto size-4" })] }));
37
+ return (_jsxs(DropdownMenuPrimitive.SubTrigger, { className: cn("flex cursor-default touch-manipulation select-none items-center gap-2 rounded-(--ds-popover-row-radius) px-2 py-1.5 text-label-14 outline-hidden focus:bg-gray-100 focus:text-gray-1000 data-[state=open]:bg-gray-100 data-[inset]:pl-8 data-[state=open]:text-gray-1000 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-gray-900 [&_svg]:pointer-events-none [&_svg]:shrink-0", className), "data-inset": inset, "data-slot": "dropdown-menu-sub-trigger", ...props, children: [children, _jsx(IconChevronRight, { className: "ml-auto size-4" })] }));
38
38
  }
39
39
  export function DropdownMenuSubContent({ className, ...props }) {
40
- return (_jsx(DropdownMenuPrimitive.SubContent, { className: cn("data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 material-menu z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden overscroll-contain p-1 text-gray-1000 data-[state=closed]:animate-out motion-reduce:animate-none", className), "data-slot": "dropdown-menu-sub-content", ...props }));
40
+ return (_jsx(DropdownMenuPrimitive.SubContent, { className: cn("data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 material-menu z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden overscroll-contain p-(--ds-popover-padding) text-gray-1000 data-[state=closed]:animate-out motion-reduce:animate-none", className), "data-slot": "dropdown-menu-sub-content", ...props }));
41
41
  }
package/dist/mdx.d.ts.map CHANGED
@@ -1 +1 @@
1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B,CAAC;AAI/D,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEnD,eAAO,MAAM,yBAAyB,GACpC,aAAa,sBAAsB,KAClC,sBAyDD,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
@@ -8,7 +8,9 @@ import { Callout, CalloutContainer, CalloutDescription, CalloutTitle, } from "./
8
8
  import { CodeBlock } from "./components/code-block";
9
9
  import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CompactCodeBlockTabs, } from "./components/code-block-tabs";
10
10
  import { CopyPrompt } from "./components/copy-prompt";
11
+ import { Heading } from "./components/heading";
11
12
  import { Mermaid } from "./components/mermaid";
13
+ import { Table } from "./components/table";
12
14
  import { Video } from "./components/video";
13
15
  import { LocalizedLink } from "./internal/localized-link";
14
16
  import { geistdocsFrontmatterSchema as frontmatterSchema, geistdocsMetaSchema as metaSchema, geistShikiTheme as shikiTheme, defineGeistdocsSourceConfig as sourceConfig, } from "./source-config";
@@ -19,9 +21,16 @@ export const geistShikiTheme = shikiTheme;
19
21
  const HTTP_URL = /^https?:\/\//;
20
22
  export const getGeistdocsMDXComponents = (components) => ({
21
23
  ...defaultMdxComponents,
24
+ h1: (props) => _jsx(Heading, { as: "h1", ...props }),
25
+ h2: (props) => _jsx(Heading, { as: "h2", ...props }),
26
+ h3: (props) => _jsx(Heading, { as: "h3", ...props }),
27
+ h4: (props) => _jsx(Heading, { as: "h4", ...props }),
28
+ h5: (props) => _jsx(Heading, { as: "h5", ...props }),
29
+ h6: (props) => _jsx(Heading, { as: "h6", ...props }),
22
30
  pre: CodeBlock,
23
31
  blockquote: Blockquote,
24
- a: ({ children, className, href, ...props }) => typeof href === "string" && href.startsWith("/") ? (_jsx(LocalizedLink, { className: cn("font-normal text-gray-1000! underline decoration-1 decoration-gray-700 underline-offset-4 hover:text-gray-1000! hover:decoration-gray-1000 hover:opacity-100!", className), href: href, ...props, children: children })) : (_jsxs("a", { className: cn("font-normal text-gray-1000! underline decoration-1 decoration-gray-700 underline-offset-4 hover:text-gray-1000! hover:decoration-gray-1000 hover:opacity-100!", className), href: href, ...props, children: [children, typeof href === "string" && HTTP_URL.test(href) ? (_jsx("span", { className: "inline-flex -translate-y-1 align-text-bottom", children: _jsx(IconArrowUpRightSmall, { size: 16 }) })) : null] })),
32
+ table: Table,
33
+ a: ({ children, className, href, ...props }) => typeof href === "string" && href.startsWith("/") ? (_jsx(LocalizedLink, { className: cn("font-normal text-gray-1000! underline decoration-1 decoration-gray-700 underline-offset-4 hover:text-gray-1000! hover:decoration-gray-1000 hover:opacity-100!", className), href: href, ...props, children: children })) : (_jsxs("a", { className: cn("font-normal text-gray-1000! underline decoration-1 decoration-gray-700 underline-offset-4 hover:text-gray-1000! hover:decoration-gray-1000 hover:opacity-100!", className), href: href, ...props, children: [children, typeof href === "string" && HTTP_URL.test(href) ? (_jsxs("span", { className: "whitespace-nowrap", children: ["\u00a0", _jsx("span", { className: "inline-flex -translate-y-1 align-text-bottom", children: _jsx(IconArrowUpRightSmall, { size: 16 }) })] })) : null] })),
25
34
  CodeBlockTabs,
26
35
  CompactCodeBlockTabs,
27
36
  CodeBlockTabsList,
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/pages/docs.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,QAAQ,IAAI,gBAAgB,EAE7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;A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CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,wBAAwB,CAAC;IACrC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE;QACpB,IAAI,EAAE,YAAY,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,aAAa,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC;KACvB,KAAK,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE;QACtB,IAAI,EAAE,YAAY,CAAC;QACnB,IAAI,EAAE,aAAa,CAAC;QACpB,MAAM,EAAE,YAAY,CAAC;KACtB,KAAK,YAAY,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,qBAAqB,CAAC,EAAE,cAAc,CACpC,OAAO,gBAAgB,CACxB,CAAC,uBAAuB,CAAC,CAAC;CAC5B;AAyCD,eAAO,MAAM,cAAc,GAAI,6LAe5B,qBAAqB;wBAiMnB;QACD,MAAM,EAAE,OAAO,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC,CAAC;KACpD;;oCAcE;QACD,MAAM,EAAE,OAAO,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC,CAAC;KACpD,KAAG,OAAO,CAAC,QAAQ,CAAC;CAwDtB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAA4B,CAAC"}
@@ -19,7 +19,7 @@ import { getPageRobots, } from "../page-visibility";
19
19
  const HTTP_URL = /^https?:\/\//;
20
20
  const PrefetchedDocsLink = ({ children, className, href, ...props }) => {
21
21
  const external = typeof href === "string" && HTTP_URL.test(href);
22
- return (_jsxs(Link, { ...props, className: cn("font-normal text-gray-1000! underline decoration-1 decoration-gray-700 underline-offset-4 hover:text-gray-1000! hover:decoration-gray-1000 hover:opacity-100!", className), href: href, prefetch: !external, children: [children, external ? (_jsx("span", { className: "inline-flex -translate-y-1 align-text-bottom", children: _jsx(IconArrowUpRightSmall, { size: 16 }) })) : null] }));
22
+ return (_jsxs(Link, { ...props, className: cn("font-normal text-gray-1000! underline decoration-1 decoration-gray-700 underline-offset-4 hover:text-gray-1000! hover:decoration-gray-1000 hover:opacity-100!", className), href: href, prefetch: !external, children: [children, external ? (_jsxs("span", { className: "whitespace-nowrap", children: ["\u00a0", _jsx("span", { className: "inline-flex -translate-y-1 align-text-bottom", children: _jsx(IconArrowUpRightSmall, { size: 16 }) })] })) : null] }));
23
23
  };
24
24
  export const resolvePageMarkdownUrl = (options) => resolveInternalPageMarkdownUrl(options);
25
25
  const DocsTitle = ({ className, ...props }) => (_jsx(FumadocsDocsTitle, { className: cn("mb-4 text-balance", className), ...props }));
package/docs/agents.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Docs
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.738f050 so agents can understand the installed package without web access.
3
+ These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.984aaa9 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` 1.25.1-canary.738f050.
3
+ These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.984aaa9.
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
@@ -1302,6 +1302,41 @@ Callouts can also contain a title and lists:
1302
1302
  package.json for tooling and ecosystem compatibility.
1303
1303
  - The `Pages Router` uses the React version from your `package.json`.
1304
1304
 
1305
+ ### Copy Prompts
1306
+
1307
+ Short prompts render in full without an expansion control:
1308
+
1309
+ ```mdx
1310
+ <CopyPrompt text="Summarize this documentation page and list the key concepts.">
1311
+ Summarize this documentation page and list the key concepts.
1312
+ </CopyPrompt>
1313
+ ```
1314
+
1315
+ This renders as:
1316
+
1317
+ Summarize this documentation page and list the key concepts.
1318
+
1319
+ Long prompts initially show a preview with a **Show more** control:
1320
+
1321
+ ```mdx
1322
+ <CopyPrompt collapsible text="Write a detailed migration plan for this project.">
1323
+ Write a detailed migration plan for this project. Include prerequisites,
1324
+ implementation steps, validation, rollback guidance, and common pitfalls.
1325
+ </CopyPrompt>
1326
+ ```
1327
+
1328
+ Set the boolean `collapsible` prop when the prompt should initially render as a
1329
+ two-line preview. This renders as:
1330
+
1331
+ Review this Geistdocs project in detail. Explain how the `@vercel/geistdocs`
1332
+ package, application layouts, local adapter files, source configuration,
1333
+ `content/docs` directory, navigation metadata, MDX components, syntax
1334
+ highlighting, search routes, and deployment configuration work together.
1335
+ Then identify the safest first files to edit, describe the effect of each
1336
+ change, call out common mistakes, and propose a step-by-step plan for
1337
+ customizing the documentation site without breaking routing, generated
1338
+ Markdown, or accessibility behavior.
1339
+
1305
1340
  ### Links
1306
1341
 
1307
1342
  Create links with `[text](url)`:
@@ -1350,6 +1385,16 @@ This renders as:
1350
1385
  | GFM | GitHub extensions | Supported |
1351
1386
  | MDX | JSX in Markdown | Supported |
1352
1387
 
1388
+ Tables can also include inline code, as commonly used for file references:
1389
+
1390
+ | File | Description |
1391
+ | -------------------- | ------------------------------------------------ |
1392
+ | `next.config.js` | Configuration file for Next.js |
1393
+ | `package.json` | Project dependencies and scripts |
1394
+ | `instrumentation.ts` | OpenTelemetry and instrumentation file |
1395
+ | `.env.local` | Local environment variables |
1396
+ | `tsconfig.json` | Configuration file for TypeScript |
1397
+
1353
1398
  ### Task Lists
1354
1399
 
1355
1400
  Create interactive task lists:
@@ -199,5 +199,5 @@
199
199
  }
200
200
  ],
201
201
  "source": "apps/template/content/docs",
202
- "version": "1.25.1-canary.738f050"
202
+ "version": "1.25.1-canary.984aaa9"
203
203
  }
@@ -115,6 +115,41 @@ Callouts can also contain a title and lists:
115
115
  package.json for tooling and ecosystem compatibility.
116
116
  - The `Pages Router` uses the React version from your `package.json`.
117
117
 
118
+ ### Copy Prompts
119
+
120
+ Short prompts render in full without an expansion control:
121
+
122
+ ```mdx
123
+ <CopyPrompt text="Summarize this documentation page and list the key concepts.">
124
+ Summarize this documentation page and list the key concepts.
125
+ </CopyPrompt>
126
+ ```
127
+
128
+ This renders as:
129
+
130
+ Summarize this documentation page and list the key concepts.
131
+
132
+ Long prompts initially show a preview with a **Show more** control:
133
+
134
+ ```mdx
135
+ <CopyPrompt collapsible text="Write a detailed migration plan for this project.">
136
+ Write a detailed migration plan for this project. Include prerequisites,
137
+ implementation steps, validation, rollback guidance, and common pitfalls.
138
+ </CopyPrompt>
139
+ ```
140
+
141
+ Set the boolean `collapsible` prop when the prompt should initially render as a
142
+ two-line preview. This renders as:
143
+
144
+ Review this Geistdocs project in detail. Explain how the `@vercel/geistdocs`
145
+ package, application layouts, local adapter files, source configuration,
146
+ `content/docs` directory, navigation metadata, MDX components, syntax
147
+ highlighting, search routes, and deployment configuration work together.
148
+ Then identify the safest first files to edit, describe the effect of each
149
+ change, call out common mistakes, and propose a step-by-step plan for
150
+ customizing the documentation site without breaking routing, generated
151
+ Markdown, or accessibility behavior.
152
+
118
153
  ### Links
119
154
 
120
155
  Create links with `[text](url)`:
@@ -163,6 +198,16 @@ This renders as:
163
198
  | GFM | GitHub extensions | Supported |
164
199
  | MDX | JSX in Markdown | Supported |
165
200
 
201
+ Tables can also include inline code, as commonly used for file references:
202
+
203
+ | File | Description |
204
+ | -------------------- | ------------------------------------------------ |
205
+ | `next.config.js` | Configuration file for Next.js |
206
+ | `package.json` | Project dependencies and scripts |
207
+ | `instrumentation.ts` | OpenTelemetry and instrumentation file |
208
+ | `.env.local` | Local environment variables |
209
+ | `tsconfig.json` | Configuration file for TypeScript |
210
+
166
211
  ### Task Lists
167
212
 
168
213
  Create interactive task lists:
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": "1.25.1-canary.738f050",
4
+ "version": "1.25.1-canary.984aaa9",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -45,7 +45,7 @@
45
45
 
46
46
  /* TOC and footer links use gray-1000 */
47
47
  #nd-toc {
48
- @apply text-gray-1000 md:pl-6;
48
+ @apply text-gray-1000;
49
49
  }
50
50
 
51
51
  #nd-toc a {
@@ -114,6 +114,45 @@ Callouts can also contain a title and lists:
114
114
  - The `Pages Router` uses the React version from your `package.json`.
115
115
  </Callout>
116
116
 
117
+ ### Copy Prompts
118
+
119
+ Short prompts render in full without an expansion control:
120
+
121
+ ```mdx
122
+ <CopyPrompt text="Summarize this documentation page and list the key concepts.">
123
+ Summarize this documentation page and list the key concepts.
124
+ </CopyPrompt>
125
+ ```
126
+
127
+ This renders as:
128
+
129
+ <CopyPrompt text="Summarize this documentation page and list the key concepts.">
130
+ Summarize this documentation page and list the key concepts.
131
+ </CopyPrompt>
132
+
133
+ Long prompts initially show a preview with a **Show more** control:
134
+
135
+ ```mdx
136
+ <CopyPrompt collapsible text="Write a detailed migration plan for this project.">
137
+ Write a detailed migration plan for this project. Include prerequisites,
138
+ implementation steps, validation, rollback guidance, and common pitfalls.
139
+ </CopyPrompt>
140
+ ```
141
+
142
+ Set the boolean `collapsible` prop when the prompt should initially render as a
143
+ two-line preview. This renders as:
144
+
145
+ <CopyPrompt collapsible text="Review this Geistdocs project in detail. Explain how the @vercel/geistdocs package, application layouts, local adapter files, source configuration, content/docs directory, navigation metadata, MDX components, syntax highlighting, search routes, and deployment configuration work together. Then identify the safest first files to edit, describe the effect of each change, call out common mistakes, and propose a step-by-step plan for customizing the documentation site without breaking routing, generated Markdown, or accessibility behavior.">
146
+ Review this Geistdocs project in detail. Explain how the `@vercel/geistdocs`
147
+ package, application layouts, local adapter files, source configuration,
148
+ `content/docs` directory, navigation metadata, MDX components, syntax
149
+ highlighting, search routes, and deployment configuration work together.
150
+ Then identify the safest first files to edit, describe the effect of each
151
+ change, call out common mistakes, and propose a step-by-step plan for
152
+ customizing the documentation site without breaking routing, generated
153
+ Markdown, or accessibility behavior.
154
+ </CopyPrompt>
155
+
117
156
  ### Links
118
157
 
119
158
  Create links with `[text](url)`:
@@ -162,6 +201,16 @@ This renders as:
162
201
  | GFM | GitHub extensions | Supported |
163
202
  | MDX | JSX in Markdown | Supported |
164
203
 
204
+ Tables can also include inline code, as commonly used for file references:
205
+
206
+ | File | Description |
207
+ | -------------------- | ------------------------------------------------ |
208
+ | `next.config.js` | Configuration file for Next.js |
209
+ | `package.json` | Project dependencies and scripts |
210
+ | `instrumentation.ts` | OpenTelemetry and instrumentation file |
211
+ | `.env.local` | Local environment variables |
212
+ | `tsconfig.json` | Configuration file for TypeScript |
213
+
165
214
  ### Task Lists
166
215
 
167
216
  Create interactive task lists:
@@ -19,7 +19,7 @@
19
19
  "@vercel/analytics": "^1.6.1",
20
20
  "@vercel/geistcn": "1.0.3",
21
21
  "@vercel/geistcn-assets": "2.0.1",
22
- "@vercel/geistdocs": "1.25.1-canary.738f050",
22
+ "@vercel/geistdocs": "1.25.1-canary.984aaa9",
23
23
  "@vercel/speed-insights": "^1.3.1",
24
24
  "ai": "^6.0.132",
25
25
  "class-variance-authority": "^0.7.1",
package/theme.css CHANGED
@@ -5,6 +5,10 @@
5
5
 
6
6
  @source "./src/**/*.{ts,tsx}";
7
7
 
8
+ button:not(:disabled, [aria-disabled="true"]) {
9
+ cursor: pointer;
10
+ }
11
+
8
12
  .prose h1 {
9
13
  @apply text-heading-32;
10
14
  }
@@ -26,6 +30,28 @@
26
30
  @apply text-heading-14;
27
31
  }
28
32
 
33
+ .prose :is(h1, h2, h3, h4, h5, h6)[id] {
34
+ position: relative;
35
+ }
36
+
37
+ .prose :is(h1, h2, h3, h4, h5, h6)[id] > a:first-child {
38
+ position: static;
39
+ }
40
+
41
+ .prose :is(h1, h2, h3, h4, h5, h6)[id] > a:first-child::after {
42
+ position: absolute;
43
+ inset: 0;
44
+ content: "";
45
+ }
46
+
47
+ .prose :is(h1, h2, h3, h4, h5, h6)[id] > svg {
48
+ pointer-events: none;
49
+ }
50
+
51
+ .prose :is(h1, h2, h3, h4, h5, h6)[id]:is(:hover, :focus-within) > svg {
52
+ opacity: 1;
53
+ }
54
+
29
55
  .prose ul:where(:not(.not-prose, .not-prose *)) {
30
56
  padding-left: 1.25rem;
31
57
  }
@@ -38,6 +64,13 @@
38
64
  @apply text-heading-40 tracking-tighter;
39
65
  }
40
66
 
67
+ @media (width >= 80rem) {
68
+ #nd-page {
69
+ max-width: 780px;
70
+ transform: translateX(-20px);
71
+ }
72
+ }
73
+
41
74
  @layer utilities {
42
75
  .line-numbers code {
43
76
  counter-reset: step;
@@ -51,66 +84,6 @@
51
84
  }
52
85
  }
53
86
 
54
- [data-geist-code-block] :is(.line, .highlighted-line) {
55
- position: relative;
56
- display: inline-block;
57
- width: max-content;
58
- min-width: 100%;
59
- height: 20px;
60
- padding: 0 20px !important;
61
- }
62
-
63
- [data-geist-code-block]
64
- :is(.highlighted-line, .line.highlighted, [data-highlighted="true"]) {
65
- background: var(--ds-blue-300) !important;
66
- border-left: 0 !important;
67
- box-shadow: inset 2px 0 0 0 var(--ds-blue-900);
68
- }
69
-
70
- [data-geist-code-block] .line[data-active="true"] {
71
- background: var(--ds-amber-300) !important;
72
- box-shadow: inset 2px 0 0 0 var(--ds-amber-900);
73
- }
74
-
75
- [data-geist-code-block] :is([data-added="true"], .line.diff.add) {
76
- background: var(--ds-green-300) !important;
77
- box-shadow: inset 2px 0 0 0 var(--ds-green-900);
78
- }
79
-
80
- [data-geist-code-block] :is([data-removed="true"], .line.diff.remove) {
81
- background: oklch(94.33% 0.0369 15.0115) !important;
82
- box-shadow: inset 2px 0 0 0 var(--ds-red-900);
83
- opacity: 1 !important;
84
- }
85
-
86
- [data-geist-code-block] :is(.line.diff.add, .line.diff.remove)::before {
87
- content: none !important;
88
- }
89
-
90
- [data-geist-code-block]
91
- :is(
92
- [data-added="true"],
93
- [data-removed="true"],
94
- .line.diff.add,
95
- .line.diff.remove
96
- )::after {
97
- position: absolute;
98
- inset: 0;
99
- padding-left: 8px;
100
- font-weight: 500;
101
- pointer-events: none;
102
- }
103
-
104
- [data-geist-code-block] :is([data-added="true"], .line.diff.add)::after {
105
- color: var(--ds-green-900);
106
- content: "+";
107
- }
108
-
109
- [data-geist-code-block] :is([data-removed="true"], .line.diff.remove)::after {
110
- color: var(--ds-red-900);
111
- content: "-";
112
- }
113
-
114
87
  :root {
115
88
  --fd-layout-width: 100%;
116
89
  --fd-page-width: 100%;