@vercel/geistdocs 1.25.1-canary.9556d32 → 1.25.1-canary.c58830e
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.
- package/dist/cli/index.js +1 -1
- package/dist/components/blockquote.d.ts +3 -0
- package/dist/components/blockquote.d.ts.map +1 -0
- package/dist/components/blockquote.js +3 -0
- package/dist/components/callout.d.ts +1 -1
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +2 -2
- package/dist/components/code-block-tabs.d.ts +5 -2
- package/dist/components/code-block-tabs.d.ts.map +1 -1
- package/dist/components/code-block-tabs.js +27 -4
- package/dist/components/code-block.d.ts +1 -1
- package/dist/components/code-block.d.ts.map +1 -1
- package/dist/components/code-block.js +27 -2
- package/dist/internal/chat/prompt-input.d.ts.map +1 -1
- package/dist/internal/chat/prompt-input.js +2 -1
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +0 -1
- package/dist/internal/search.d.ts.map +1 -1
- package/dist/internal/search.js +2 -2
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +9 -3
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +7 -2
- package/docs/agents.md +1 -1
- package/docs/llms.txt +103 -8
- package/docs/manifest.json +1 -1
- package/docs/pages/migration.md +1 -1
- package/docs/pages/syntax.md +101 -6
- package/package.json +3 -3
- package/template/content/docs/migration.mdx +1 -1
- package/template/content/docs/syntax.mdx +101 -6
- package/template/package.json +2 -2
- package/theme.css +64 -1
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.9556d32","-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.c58830e","-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);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blockquote.d.ts","sourceRoot":"","sources":["../../src/components/blockquote.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,eAAO,MAAM,UAAU,GAAI,yBAGxB,cAAc,CAAC,YAAY,CAAC,4CAY9B,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
3
|
+
export const Blockquote = ({ className, ...props }) => (_jsx("blockquote", { className: cn("my-4 rounded-md border border-gray-300 p-3 font-normal text-sm not-italic", "[&_p:last-child]:mb-0 [&_p]:mt-0 [&_p]:mb-2 [&_p]:leading-[21px]", "[&_p]:before:content-none [&_p]:after:content-none", "[&_code]:inline-block [&_code]:rounded-md [&_code]:border [&_code]:border-gray-300 [&_code]:bg-gray-100 [&_code]:px-[3px] [&_code]:py-[1.44px] [&_code]:text-xs [&_code]:leading-[14.4px]", "[&_ul]:my-2", className), ...props }));
|
|
@@ -7,6 +7,6 @@ export declare const CalloutContainer: (props: CalloutContainerProps) => import(
|
|
|
7
7
|
type CalloutTitleProps = ComponentProps<typeof CalloutTitlePrimitive>;
|
|
8
8
|
export declare const CalloutTitle: (props: CalloutTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
type CalloutDescriptionProps = ComponentProps<typeof CalloutDescriptionPrimitive>;
|
|
10
|
-
export declare const CalloutDescription: (props: CalloutDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const CalloutDescription: ({ className, ...props }: CalloutDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=callout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../src/components/callout.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,IAAI,yBAAyB,EAC7C,kBAAkB,IAAI,2BAA2B,EACjD,OAAO,IAAI,gBAAgB,EAC3B,YAAY,IAAI,qBAAqB,EACtC,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,KAAK,YAAY,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE5D,eAAO,MAAM,OAAO,GAAI,yBAAyB,YAAY,4CAQ5D,CAAC;AAEF,KAAK,qBAAqB,GAAG,cAAc,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE9E,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,4CAE5D,CAAC;AAEF,KAAK,iBAAiB,GAAG,cAAc,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEtE,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CAEpD,CAAC;AAEF,KAAK,uBAAuB,GAAG,cAAc,CAC3C,OAAO,2BAA2B,CACnC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,
|
|
1
|
+
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../src/components/callout.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,IAAI,yBAAyB,EAC7C,kBAAkB,IAAI,2BAA2B,EACjD,OAAO,IAAI,gBAAgB,EAC3B,YAAY,IAAI,qBAAqB,EACtC,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,KAAK,YAAY,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE5D,eAAO,MAAM,OAAO,GAAI,yBAAyB,YAAY,4CAQ5D,CAAC;AAEF,KAAK,qBAAqB,GAAG,cAAc,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE9E,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,4CAE5D,CAAC;AAEF,KAAK,iBAAiB,GAAG,cAAc,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEtE,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CAEpD,CAAC;AAEF,KAAK,uBAAuB,GAAG,cAAc,CAC3C,OAAO,2BAA2B,CACnC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,yBAGhC,uBAAuB,4CAKzB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "@vercel/geistcn/utils";
|
|
3
3
|
import { CalloutContainer as CalloutContainerPrimitive, CalloutDescription as CalloutDescriptionPrimitive, Callout as CalloutPrimitive, CalloutTitle as CalloutTitlePrimitive, } from "fumadocs-ui/components/callout";
|
|
4
|
-
export const Callout = ({ className, ...props }) => (_jsx(CalloutPrimitive, { className: cn("rounded-sm bg-transparent p-3! shadow-none [&_div[role='none']]:hidden", className), ...props }));
|
|
4
|
+
export const Callout = ({ className, ...props }) => (_jsx(CalloutPrimitive, { className: cn("rounded-sm bg-transparent p-3! text-gray-1000 shadow-none [&_.text-fd-muted-foreground]:text-gray-1000 [&_div[role='none']]:hidden", className), ...props }));
|
|
5
5
|
export const CalloutContainer = (props) => (_jsx(CalloutContainerPrimitive, { ...props }));
|
|
6
6
|
export const CalloutTitle = (props) => (_jsx(CalloutTitlePrimitive, { ...props }));
|
|
7
|
-
export const CalloutDescription = (props) => (_jsx(CalloutDescriptionPrimitive, { ...props }));
|
|
7
|
+
export const CalloutDescription = ({ className, ...props }) => (_jsx(CalloutDescriptionPrimitive, { className: cn("text-gray-1000", className), ...props }));
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "fumadocs-ui/components/tabs.unstyled";
|
|
2
|
-
import type
|
|
2
|
+
import { type ComponentProps } from "react";
|
|
3
3
|
export declare const CodeBlockTabsList: (props: ComponentProps<typeof TabsList>) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const CodeBlockTabsTrigger: ({ children, ...props }: ComponentProps<typeof TabsTrigger>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export declare const CodeBlockTabs: (props: ComponentProps<typeof Tabs>
|
|
5
|
+
export declare const CodeBlockTabs: ({ compact, ...props }: ComponentProps<typeof Tabs> & {
|
|
6
|
+
compact?: boolean;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const CompactCodeBlockTabs: (props: Omit<ComponentProps<typeof CodeBlockTabs>, "compact">) => import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
export declare const CodeBlockTab: (props: ComponentProps<typeof TabsContent>) => import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
//# sourceMappingURL=code-block-tabs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-block-tabs.d.ts","sourceRoot":"","sources":["../../src/components/code-block-tabs.tsx"],"names":[],"mappings":"
|
|
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,CAAC;AAEf,eAAO,MAAM,iBAAiB,GAAI,OAAO,cAAc,CAAC,OAAO,QAAQ,CAAC,4CAYvE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,wBAGlC,cAAc,CAAC,OAAO,WAAW,CAAC,4CAUpC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,uBAG3B,cAAc,CAAC,OAAO,IAAI,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,4CAuDrD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,EAAE,SAAS,CAAC,4CACrB,CAAC;AAE1C,eAAO,MAAM,YAAY,GAAI,OAAO,cAAc,CAAC,OAAO,WAAW,CAAC,4CAErE,CAAC"}
|
|
@@ -1,7 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { cn } from "@vercel/geistcn/utils";
|
|
4
|
+
import { IconChevronDown } from "@vercel/geistcn-assets/icons";
|
|
3
5
|
import { Tabs, TabsContent, TabsList, TabsTrigger, } from "fumadocs-ui/components/tabs.unstyled";
|
|
4
|
-
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { Children, isValidElement, useState, } from "react";
|
|
7
|
+
export const CodeBlockTabsList = (props) => {
|
|
8
|
+
return (_jsx(TabsList, { ...props, className: cn("mb-3 flex w-full flex-nowrap items-center overflow-x-auto pb-px text-gray-900", props.className), children: props.children }));
|
|
9
|
+
};
|
|
10
|
+
export const CodeBlockTabsTrigger = ({ children, ...props }) => (_jsx(TabsTrigger, { ...props, className: cn("flex h-8 cursor-pointer items-center rounded-md border-0 bg-transparent px-3 text-label-13 outline-0 transition-[color] duration-150 ease-[cubic-bezier(0.175,0.885,0.32,1.1)] hover:text-gray-1000 data-[state=active]:bg-gray-200 data-[state=active]:text-gray-1000 motion-reduce:transition-none", props.className), children: children }));
|
|
11
|
+
export const CodeBlockTabs = ({ compact = false, ...props }) => {
|
|
12
|
+
const [value, setValue] = useState(String(props.defaultValue ?? props.value ?? ""));
|
|
13
|
+
const options = Children.toArray(props.children)
|
|
14
|
+
.flatMap((child) => isValidElement(child)
|
|
15
|
+
? Children.toArray(child.props.children)
|
|
16
|
+
: [])
|
|
17
|
+
.filter((isValidElement))
|
|
18
|
+
.filter((child) => typeof child.props.value === "string")
|
|
19
|
+
.map((child) => ({
|
|
20
|
+
label: String(child.props.children),
|
|
21
|
+
value: child.props.value,
|
|
22
|
+
}));
|
|
23
|
+
const tabs = (_jsx(Tabs, { ...props, className: cn("not-prose", props.className), onValueChange: compact ? setValue : props.onValueChange, value: compact ? value : props.value, children: props.children }));
|
|
24
|
+
if (!compact) {
|
|
25
|
+
return tabs;
|
|
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] }));
|
|
28
|
+
};
|
|
29
|
+
export const CompactCodeBlockTabs = (props) => _jsx(CodeBlockTabs, { ...props, compact: true });
|
|
30
|
+
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":"
|
|
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,4 +1,29 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CodeBlockServer } from "@vercel/geistcn/components/code-block-server";
|
|
3
3
|
import { cn } from "@vercel/geistcn/utils";
|
|
4
|
-
|
|
4
|
+
import { LogoNextJs, LogoSvelte } from "@vercel/geistcn-assets/logos";
|
|
5
|
+
import { isValidElement } from "react";
|
|
6
|
+
const FRAMEWORK_ICONS = {
|
|
7
|
+
next: _jsx(LogoNextJs, { height: 16 }),
|
|
8
|
+
nextjs: _jsx(LogoNextJs, { height: 16 }),
|
|
9
|
+
svelte: _jsx(LogoSvelte, { height: 16 }),
|
|
10
|
+
sveltekit: _jsx(LogoSvelte, { height: 16 }),
|
|
11
|
+
};
|
|
12
|
+
const resolveFrameworkTitle = (title) => {
|
|
13
|
+
const hashIndex = title?.lastIndexOf("#") ?? -1;
|
|
14
|
+
if (!title || hashIndex === -1) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const icon = FRAMEWORK_ICONS[title.slice(hashIndex + 1).toLowerCase()];
|
|
18
|
+
if (!icon) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return { icon, title: title.slice(0, hashIndex) };
|
|
22
|
+
};
|
|
23
|
+
export const CodeBlock = ({ children, className, "data-line-numbers": lineNumbers, title, }) => {
|
|
24
|
+
const frameworkTitle = resolveFrameworkTitle(title);
|
|
25
|
+
const code = isValidElement(children)
|
|
26
|
+
? children.props.children
|
|
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 }));
|
|
29
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/prompt-input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAEf,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,GAAI,6DAO7B,oBAAoB,
|
|
1
|
+
{"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/prompt-input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAEf,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,GAAI,6DAO7B,oBAAoB,4CAmFtB,CAAC"}
|
|
@@ -14,6 +14,7 @@ export const ChatPromptInput = ({ onChange, onStop, onSubmit, status, textareaRe
|
|
|
14
14
|
const nextHeight = textarea.scrollHeight > 56 ? Math.min(textarea.scrollHeight, 200) : 56;
|
|
15
15
|
textarea.style.height = `${nextHeight}px`;
|
|
16
16
|
}, [textareaRef]);
|
|
17
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: controlled value changes must resize the textarea after React updates its DOM value.
|
|
17
18
|
useEffect(() => {
|
|
18
19
|
adjustHeight();
|
|
19
20
|
}, [adjustHeight, value]);
|
|
@@ -32,5 +33,5 @@ export const ChatPromptInput = ({ onChange, onStop, onSubmit, status, textareaRe
|
|
|
32
33
|
event.currentTarget.form?.requestSubmit();
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
|
-
return (_jsx("div", { className: "cursor-text rounded-[12px] border border-gray-300 border-solid pt-2 pb-2 shadow-xs transition-colors duration-250 focus-within:border-gray-500",
|
|
36
|
+
return (_jsx("div", { className: "cursor-text rounded-[12px] border border-gray-300 border-solid pt-2 pb-2 shadow-xs transition-colors duration-250 focus-within:border-gray-500", children: _jsxs("form", { className: "flex flex-col items-center gap-2", onSubmit: onSubmit, children: [_jsx("textarea", { className: "min-h-0 w-full resize-none rounded-none border-0 bg-transparent px-4 py-2 font-sans text-gray-1000 text-sm shadow-none outline-hidden ring-0 placeholder:text-gray-600 focus:outline-none focus-visible:ring-0", maxLength: 1000, name: "message", onChange: handleChange, onKeyDown: handleKeyDown, placeholder: "Ask a question...", ref: textareaRef, value: value }), _jsx("div", { className: "flex w-full items-center justify-end px-2", children: isGenerating && onStop ? (_jsx(Button, { className: "animate-fade-in-scale", onClick: onStop, prefix: _jsx(IconStopCircle, { className: "size-4" }), size: "small", typeName: "button", children: "Stop" })) : (_jsx(Button, { "aria-label": "Submit", className: "size-8 animate-fade-in-scale p-0", disabled: value.trim().length <= 3, shape: "square", size: "small", svgOnly: true, typeName: "submit", children: _jsx(IconArrowUp, { className: "size-4" }) })) })] }) }));
|
|
36
37
|
};
|
|
@@ -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,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAgBjD,UAAU,gBAAgB;IACxB,MAAM,EAAE,IAAI,CACV,eAAe,EACf,IAAI,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,CACxD,CAAC;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,UAAU,oCAAoC;IAC5C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,EAAE,CAAC;CAC3B;
|
|
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,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAgBjD,UAAU,gBAAgB;IACxB,MAAM,EAAE,IAAI,CACV,eAAe,EACf,IAAI,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,CACxD,CAAC;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,UAAU,oCAAoC;IAC5C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,EAAE,CAAC;CAC3B;AAkpBD,eAAO,MAAM,oBAAoB,GAAI,yBAIlC,gBAAgB,mDAqHlB,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,2BAG7C,oCAAoC,4CAiBtC,CAAC"}
|
|
@@ -160,7 +160,6 @@ const InlinePageActions = ({ askAIEnabled, checked, copyEnabled, onAskAI, onCopy
|
|
|
160
160
|
// The desktop action control: a compact copy button plus an actions dropdown,
|
|
161
161
|
// aligned beside the page title.
|
|
162
162
|
const DesktopPageActions = ({ askAIEnabled, checked, copyEnabled, editSourceEnabled, editSourceUrl, isMobile, menuView, onAskAI, onCopy, onViewMarkdown, openInChatEnabled, openInChatRef, otherProviders, providersBackRef, query, setMenuView, v0Provider, }) => {
|
|
163
|
-
const CopyStateIcon = checked ? IconCheck : IconCopy;
|
|
164
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) => {
|
|
165
164
|
if (!open) {
|
|
166
165
|
setMenuView("main");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/internal/search.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
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"}
|
package/dist/internal/search.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useDocsSearch } from "fumadocs-core/search/client";
|
|
4
|
-
import { SearchDialog as FumadocsSearchDialog, SearchDialogClose, SearchDialogContent, SearchDialogHeader, SearchDialogIcon, SearchDialogInput, SearchDialogList, SearchDialogOverlay, } from "fumadocs-ui/components/dialog/search";
|
|
4
|
+
import { SearchDialog as FumadocsSearchDialog, SearchDialogClose, SearchDialogContent, SearchDialogHeader, SearchDialogIcon, SearchDialogInput, SearchDialogList, SearchDialogListItem, SearchDialogOverlay, } from "fumadocs-ui/components/dialog/search";
|
|
5
5
|
import { useI18n } from "fumadocs-ui/contexts/i18n";
|
|
6
6
|
import { getPublicPath } from "../config";
|
|
7
7
|
export const GeistdocsSearchDialog = ({ basePath, ...props }) => {
|
|
@@ -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, { items: query.data === "empty" ? null : query.data })] })] }));
|
|
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" })] })] }));
|
|
15
15
|
};
|
package/dist/mdx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAoB/C,OAAO,EAGL,KAAK,4BAA4B,IAAI,mBAAmB,EAGzD,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,2BAA2B,8EAAe,CAAC;AACxD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAoB,CAAC;AAC5D,eAAO,MAAM,mBAAmB;;;;;;;gCAAa,CAAC;AAC9C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAC1C,MAAM,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AAI/D,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEnD,eAAO,MAAM,yBAAyB,GACpC,aAAa,sBAAsB,KAClC,sBA+CD,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAC9B,aAAa,sBAAsB,KAClC,sBAA+D,CAAC;AAEnE,eAAO,MAAM,2BAA2B,GACtC,GAAG,eAAe,KAAK,CAAC,sBAAsB,GAAG,SAAS,CAAC,KAC1D,sBACkD,CAAC"}
|
package/dist/mdx.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
3
|
+
import { IconArrowUpRightSmall } from "@vercel/geistcn-assets/icons";
|
|
2
4
|
import { TypeTable } from "fumadocs-ui/components/type-table";
|
|
3
5
|
import defaultMdxComponents from "fumadocs-ui/mdx";
|
|
6
|
+
import { Blockquote } from "./components/blockquote";
|
|
4
7
|
import { Callout, CalloutContainer, CalloutDescription, CalloutTitle, } from "./components/callout";
|
|
5
8
|
import { CodeBlock } from "./components/code-block";
|
|
6
|
-
import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, } from "./components/code-block-tabs";
|
|
9
|
+
import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CompactCodeBlockTabs, } from "./components/code-block-tabs";
|
|
7
10
|
import { CopyPrompt } from "./components/copy-prompt";
|
|
8
11
|
import { Mermaid } from "./components/mermaid";
|
|
9
12
|
import { Video } from "./components/video";
|
|
@@ -13,11 +16,14 @@ export const defineGeistdocsSourceConfig = sourceConfig;
|
|
|
13
16
|
export const geistdocsFrontmatterSchema = frontmatterSchema;
|
|
14
17
|
export const geistdocsMetaSchema = metaSchema;
|
|
15
18
|
export const geistShikiTheme = shikiTheme;
|
|
19
|
+
const HTTP_URL = /^https?:\/\//;
|
|
16
20
|
export const getGeistdocsMDXComponents = (components) => ({
|
|
17
21
|
...defaultMdxComponents,
|
|
18
22
|
pre: CodeBlock,
|
|
19
|
-
|
|
23
|
+
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] })),
|
|
20
25
|
CodeBlockTabs,
|
|
26
|
+
CompactCodeBlockTabs,
|
|
21
27
|
CodeBlockTabsList,
|
|
22
28
|
CodeBlockTabsTrigger,
|
|
23
29
|
CodeBlockTab,
|
package/dist/pages/docs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/pages/docs.tsx"],"names":[],"mappings":"
|
|
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;AACtE,OAAO,EAAE,KAAK,eAAe,EAA+B,MAAM,WAAW,CAAC;AAa9E,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,KAAK,YAAY,GAAG,qBAAqB,CAAC;AAC1C,KAAK,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAChF,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,KAAK,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AACvC,KAAK,qBAAqB,GAAG,WAAW,CACtC,cAAc,CAAC,OAAO,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CAC1D,CAAC;AAEF,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,KAAK,WAAW,GACZ,aAAa,GACb,CAAC,CAAC,OAAO,EAAE;IACT,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;CACtB,KAAK,aAAa,CAAC,CAAC;AAEzB,KAAK,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAEpE,UAAU,wBAAwB;IAChC,MAAM,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;CACpC;AA8BD,UAAU,cAAc;IACtB,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,UAAU,oBAAqB,SAAQ,cAAc;IACnD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,kBAAmB,SAAQ,oBAAoB;IACvD,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,sBAAsB,GACjC,SAAS,6BAA6B,WACI,CAAC;AAE7C,UAAU,YAAa,SAAQ,2BAA2B;IACxD,IAAI,EAAE,aAAa,CAAC;QAAE,UAAU,CAAC,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,CAAC,KAAK,CAAC,CAAC;CACrD;AAED,UAAU,qBAAqB;IAC7B,MAAM,EAAE,IAAI,CACV,eAAe,EACb,IAAI,GACJ,UAAU,GACV,UAAU,GACV,QAAQ,GACR,aAAa,GACb,QAAQ,GACR,SAAS,CACZ,CAAC;IACF,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC;IACzD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,MAAM,CAAC;IACzD,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,MAAM,CAAC;IACjD,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,MAAM,CAAC;IAC7D,GAAG,CAAC,EAAE,WAAW,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,QAAQ,CAAC;QACnB,IAAI,EAAE,aAAa,CAAC;QACpB,MAAM,EAAE,cAAc,CAAC;KACxB,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,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"}
|
package/dist/pages/docs.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "@vercel/geistcn/utils";
|
|
3
|
+
import { IconArrowUpRightSmall } from "@vercel/geistcn-assets/icons";
|
|
3
4
|
import Link from "fumadocs-core/link";
|
|
4
5
|
import { DocsBody as FumadocsDocsBody, DocsDescription as FumadocsDocsDescription, DocsPage as FumadocsDocsPage, DocsTitle as FumadocsDocsTitle, } from "fumadocs-ui/layouts/docs/page";
|
|
5
6
|
import { createRelativeLink } from "fumadocs-ui/mdx";
|
|
@@ -15,7 +16,11 @@ import { getPageFooterItems, PageFooter } from "../internal/page-footer";
|
|
|
15
16
|
import { GeistdocsTableOfContents } from "../internal/table-of-contents";
|
|
16
17
|
import { createMdxComponents } from "../mdx";
|
|
17
18
|
import { getPageRobots, } from "../page-visibility";
|
|
18
|
-
const
|
|
19
|
+
const HTTP_URL = /^https?:\/\//;
|
|
20
|
+
const PrefetchedDocsLink = ({ children, className, href, ...props }) => {
|
|
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] }));
|
|
23
|
+
};
|
|
19
24
|
export const resolvePageMarkdownUrl = (options) => resolveInternalPageMarkdownUrl(options);
|
|
20
25
|
const DocsTitle = ({ className, ...props }) => (_jsx(FumadocsDocsTitle, { className: cn("mb-4 text-balance", className), ...props }));
|
|
21
26
|
const DocsDescription = ({ className, ...props }) => (_jsx(FumadocsDocsDescription, { className: cn("text-gray-900", 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.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.c58830e 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.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.c58830e.
|
|
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
|
|
@@ -423,7 +423,7 @@ Fix unrelated build failures first. A migration is safer when the starting point
|
|
|
423
423
|
|
|
424
424
|
## Install Geistdocs
|
|
425
425
|
|
|
426
|
-
Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting.
|
|
426
|
+
Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting. Geistdocs requires Next.js 16.3.3 or later within 16.x. Earlier 16.3 releases can retain an optional catch-all route's index content after a client navigation to a child page when Cache Components and Partial Prefetching are enabled.
|
|
427
427
|
|
|
428
428
|
For an existing project, use your package manager directly:
|
|
429
429
|
|
|
@@ -1202,7 +1202,9 @@ related:
|
|
|
1202
1202
|
|
|
1203
1203
|
Geistdocs supports MDX, a superset of Markdown that allows you to use JSX components within your documentation. This guide covers all the formatting options available.
|
|
1204
1204
|
|
|
1205
|
-
Help me write a Geistdocs MDX page. Use this page as a syntax reference and
|
|
1205
|
+
Help me write a Geistdocs MDX page. Use this page as a syntax reference and
|
|
1206
|
+
create an example page with frontmatter, headings, links, a code block, a
|
|
1207
|
+
`Callout`, and a `CopyPrompt` component.
|
|
1206
1208
|
|
|
1207
1209
|
## Frontmatter
|
|
1208
1210
|
|
|
@@ -1270,7 +1272,19 @@ Create ordered lists with numbers:
|
|
|
1270
1272
|
|
|
1271
1273
|
Use `>` to create blockquotes:
|
|
1272
1274
|
|
|
1273
|
-
>
|
|
1275
|
+
> **Watch:** Learn more about how to use `next/image` → [YouTube (9 minutes)](https://youtu.be/IU_qq_c_lKA).
|
|
1276
|
+
|
|
1277
|
+
### Callouts
|
|
1278
|
+
|
|
1279
|
+
Use `<Callout>` for a highlighted informational note:
|
|
1280
|
+
|
|
1281
|
+
```mdx
|
|
1282
|
+
<Callout>This is automatically set when deploying to Vercel.</Callout>
|
|
1283
|
+
```
|
|
1284
|
+
|
|
1285
|
+
This renders as:
|
|
1286
|
+
|
|
1287
|
+
> This is automatically set when deploying to Vercel.
|
|
1274
1288
|
|
|
1275
1289
|
### Links
|
|
1276
1290
|
|
|
@@ -1279,6 +1293,15 @@ Create links with `[text](url)`:
|
|
|
1279
1293
|
- [External link](https://vercel.com)
|
|
1280
1294
|
- [Internal link](/docs/getting-started)
|
|
1281
1295
|
|
|
1296
|
+
Use an absolute `https://` or `http://` URL to mark a link as external. External
|
|
1297
|
+
links open outside the docs site and display an arrow icon. Use a root-relative
|
|
1298
|
+
path beginning with `/` for internal links:
|
|
1299
|
+
|
|
1300
|
+
```md
|
|
1301
|
+
[External link](https://vercel.com)
|
|
1302
|
+
[Internal link](/docs/getting-started)
|
|
1303
|
+
```
|
|
1304
|
+
|
|
1282
1305
|
### Images
|
|
1283
1306
|
|
|
1284
1307
|
Add images with ``:
|
|
@@ -1383,6 +1406,78 @@ export const Button = ({ children }) => {
|
|
|
1383
1406
|
};
|
|
1384
1407
|
```
|
|
1385
1408
|
|
|
1409
|
+
### Tabs and switchers
|
|
1410
|
+
|
|
1411
|
+
Use consecutive fences with `tab` metadata for code tabs that expose every
|
|
1412
|
+
option at once:
|
|
1413
|
+
|
|
1414
|
+
````md
|
|
1415
|
+
```ts tab="TypeScript" title="example.ts"
|
|
1416
|
+
export const greeting: string = "Hello from TypeScript";
|
|
1417
|
+
```
|
|
1418
|
+
|
|
1419
|
+
```js tab="JavaScript" title="example.js"
|
|
1420
|
+
export const greeting = "Hello from JavaScript";
|
|
1421
|
+
```
|
|
1422
|
+
````
|
|
1423
|
+
|
|
1424
|
+
This renders as:
|
|
1425
|
+
|
|
1426
|
+
```ts tab="TypeScript" title="example.ts"
|
|
1427
|
+
export const greeting: string = "Hello from TypeScript";
|
|
1428
|
+
```
|
|
1429
|
+
|
|
1430
|
+
```js tab="JavaScript" title="example.js"
|
|
1431
|
+
export const greeting = "Hello from JavaScript";
|
|
1432
|
+
```
|
|
1433
|
+
|
|
1434
|
+
Wrap the same fences in `<CodeBlockTabs compact>` to move the selector into the
|
|
1435
|
+
code-block header:
|
|
1436
|
+
|
|
1437
|
+
````mdx
|
|
1438
|
+
<CompactCodeBlockTabs defaultValue="TypeScript">
|
|
1439
|
+
<CodeBlockTabsList>
|
|
1440
|
+
<CodeBlockTabsTrigger value="TypeScript">TypeScript</CodeBlockTabsTrigger>
|
|
1441
|
+
<CodeBlockTabsTrigger value="JavaScript">JavaScript</CodeBlockTabsTrigger>
|
|
1442
|
+
</CodeBlockTabsList>
|
|
1443
|
+
<CodeBlockTab value="TypeScript">
|
|
1444
|
+
```ts title="example.ts"
|
|
1445
|
+
export const greeting: string = "Hello from TypeScript";
|
|
1446
|
+
```
|
|
1447
|
+
</CodeBlockTab>
|
|
1448
|
+
<CodeBlockTab value="JavaScript">
|
|
1449
|
+
```js title="example.js"
|
|
1450
|
+
export const greeting = "Hello from JavaScript";
|
|
1451
|
+
```
|
|
1452
|
+
</CodeBlockTab>
|
|
1453
|
+
</CompactCodeBlockTabs>
|
|
1454
|
+
````
|
|
1455
|
+
|
|
1456
|
+
This renders as:
|
|
1457
|
+
|
|
1458
|
+
<CompactCodeBlockTabs defaultValue="TypeScript">
|
|
1459
|
+
<CodeBlockTabsList>
|
|
1460
|
+
<CodeBlockTabsTrigger value="TypeScript">TypeScript</CodeBlockTabsTrigger>
|
|
1461
|
+
<CodeBlockTabsTrigger value="JavaScript">JavaScript</CodeBlockTabsTrigger>
|
|
1462
|
+
</CodeBlockTabsList>
|
|
1463
|
+
<CodeBlockTab value="TypeScript">
|
|
1464
|
+
```ts title="example.ts"
|
|
1465
|
+
export const greeting: string = "Hello from TypeScript";
|
|
1466
|
+
```
|
|
1467
|
+
</CodeBlockTab>
|
|
1468
|
+
<CodeBlockTab value="JavaScript">
|
|
1469
|
+
```js title="example.js"
|
|
1470
|
+
export const greeting = "Hello from JavaScript";
|
|
1471
|
+
```
|
|
1472
|
+
</CodeBlockTab>
|
|
1473
|
+
</CompactCodeBlockTabs>
|
|
1474
|
+
|
|
1475
|
+
When migrating an existing site such as next-site, translate adjacent
|
|
1476
|
+
`switcher` fences to `tab="TypeScript"` and `tab="JavaScript"`, then wrap the
|
|
1477
|
+
pair with `<CodeBlockTabs compact>`. Import `@vercel/geistdocs/styles.css` (or
|
|
1478
|
+
`theme.css` with the documented Geist dependencies) so Tailwind scans the
|
|
1479
|
+
package's compiled components and emits the tab layout utilities.
|
|
1480
|
+
|
|
1386
1481
|
### Framework icons
|
|
1387
1482
|
|
|
1388
1483
|
Append `#<framework>` to the title to show a framework logo instead of the
|
|
@@ -1391,22 +1486,22 @@ values are `#next` / `#nextjs` and `#svelte` / `#sveltekit`:
|
|
|
1391
1486
|
|
|
1392
1487
|
````md
|
|
1393
1488
|
```ts title="flags.ts#next"
|
|
1394
|
-
import { flag } from
|
|
1489
|
+
import { flag } from "flags/next";
|
|
1395
1490
|
```
|
|
1396
1491
|
|
|
1397
1492
|
```ts title="flags.ts#svelte"
|
|
1398
|
-
import { flag } from
|
|
1493
|
+
import { flag } from "flags/sveltekit";
|
|
1399
1494
|
```
|
|
1400
1495
|
````
|
|
1401
1496
|
|
|
1402
1497
|
This renders as:
|
|
1403
1498
|
|
|
1404
1499
|
```ts title="flags.ts#next"
|
|
1405
|
-
import { flag } from
|
|
1500
|
+
import { flag } from "flags/next";
|
|
1406
1501
|
```
|
|
1407
1502
|
|
|
1408
1503
|
```ts title="flags.ts#svelte"
|
|
1409
|
-
import { flag } from
|
|
1504
|
+
import { flag } from "flags/sveltekit";
|
|
1410
1505
|
```
|
|
1411
1506
|
|
|
1412
1507
|
### Line Numbers
|
package/docs/manifest.json
CHANGED
package/docs/pages/migration.md
CHANGED
|
@@ -44,7 +44,7 @@ Fix unrelated build failures first. A migration is safer when the starting point
|
|
|
44
44
|
|
|
45
45
|
## Install Geistdocs
|
|
46
46
|
|
|
47
|
-
Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting.
|
|
47
|
+
Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting. Geistdocs requires Next.js 16.3.3 or later within 16.x. Earlier 16.3 releases can retain an optional catch-all route's index content after a client navigation to a child page when Cache Components and Partial Prefetching are enabled.
|
|
48
48
|
|
|
49
49
|
For an existing project, use your package manager directly:
|
|
50
50
|
|
package/docs/pages/syntax.md
CHANGED
|
@@ -15,7 +15,9 @@ related:
|
|
|
15
15
|
|
|
16
16
|
Geistdocs supports MDX, a superset of Markdown that allows you to use JSX components within your documentation. This guide covers all the formatting options available.
|
|
17
17
|
|
|
18
|
-
Help me write a Geistdocs MDX page. Use this page as a syntax reference and
|
|
18
|
+
Help me write a Geistdocs MDX page. Use this page as a syntax reference and
|
|
19
|
+
create an example page with frontmatter, headings, links, a code block, a
|
|
20
|
+
`Callout`, and a `CopyPrompt` component.
|
|
19
21
|
|
|
20
22
|
## Frontmatter
|
|
21
23
|
|
|
@@ -83,7 +85,19 @@ Create ordered lists with numbers:
|
|
|
83
85
|
|
|
84
86
|
Use `>` to create blockquotes:
|
|
85
87
|
|
|
86
|
-
>
|
|
88
|
+
> **Watch:** Learn more about how to use `next/image` → [YouTube (9 minutes)](https://youtu.be/IU_qq_c_lKA).
|
|
89
|
+
|
|
90
|
+
### Callouts
|
|
91
|
+
|
|
92
|
+
Use `<Callout>` for a highlighted informational note:
|
|
93
|
+
|
|
94
|
+
```mdx
|
|
95
|
+
<Callout>This is automatically set when deploying to Vercel.</Callout>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
This renders as:
|
|
99
|
+
|
|
100
|
+
> This is automatically set when deploying to Vercel.
|
|
87
101
|
|
|
88
102
|
### Links
|
|
89
103
|
|
|
@@ -92,6 +106,15 @@ Create links with `[text](url)`:
|
|
|
92
106
|
- [External link](https://vercel.com)
|
|
93
107
|
- [Internal link](/docs/getting-started)
|
|
94
108
|
|
|
109
|
+
Use an absolute `https://` or `http://` URL to mark a link as external. External
|
|
110
|
+
links open outside the docs site and display an arrow icon. Use a root-relative
|
|
111
|
+
path beginning with `/` for internal links:
|
|
112
|
+
|
|
113
|
+
```md
|
|
114
|
+
[External link](https://vercel.com)
|
|
115
|
+
[Internal link](/docs/getting-started)
|
|
116
|
+
```
|
|
117
|
+
|
|
95
118
|
### Images
|
|
96
119
|
|
|
97
120
|
Add images with ``:
|
|
@@ -196,6 +219,78 @@ export const Button = ({ children }) => {
|
|
|
196
219
|
};
|
|
197
220
|
```
|
|
198
221
|
|
|
222
|
+
### Tabs and switchers
|
|
223
|
+
|
|
224
|
+
Use consecutive fences with `tab` metadata for code tabs that expose every
|
|
225
|
+
option at once:
|
|
226
|
+
|
|
227
|
+
````md
|
|
228
|
+
```ts tab="TypeScript" title="example.ts"
|
|
229
|
+
export const greeting: string = "Hello from TypeScript";
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
```js tab="JavaScript" title="example.js"
|
|
233
|
+
export const greeting = "Hello from JavaScript";
|
|
234
|
+
```
|
|
235
|
+
````
|
|
236
|
+
|
|
237
|
+
This renders as:
|
|
238
|
+
|
|
239
|
+
```ts tab="TypeScript" title="example.ts"
|
|
240
|
+
export const greeting: string = "Hello from TypeScript";
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
```js tab="JavaScript" title="example.js"
|
|
244
|
+
export const greeting = "Hello from JavaScript";
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Wrap the same fences in `<CodeBlockTabs compact>` to move the selector into the
|
|
248
|
+
code-block header:
|
|
249
|
+
|
|
250
|
+
````mdx
|
|
251
|
+
<CompactCodeBlockTabs defaultValue="TypeScript">
|
|
252
|
+
<CodeBlockTabsList>
|
|
253
|
+
<CodeBlockTabsTrigger value="TypeScript">TypeScript</CodeBlockTabsTrigger>
|
|
254
|
+
<CodeBlockTabsTrigger value="JavaScript">JavaScript</CodeBlockTabsTrigger>
|
|
255
|
+
</CodeBlockTabsList>
|
|
256
|
+
<CodeBlockTab value="TypeScript">
|
|
257
|
+
```ts title="example.ts"
|
|
258
|
+
export const greeting: string = "Hello from TypeScript";
|
|
259
|
+
```
|
|
260
|
+
</CodeBlockTab>
|
|
261
|
+
<CodeBlockTab value="JavaScript">
|
|
262
|
+
```js title="example.js"
|
|
263
|
+
export const greeting = "Hello from JavaScript";
|
|
264
|
+
```
|
|
265
|
+
</CodeBlockTab>
|
|
266
|
+
</CompactCodeBlockTabs>
|
|
267
|
+
````
|
|
268
|
+
|
|
269
|
+
This renders as:
|
|
270
|
+
|
|
271
|
+
<CompactCodeBlockTabs defaultValue="TypeScript">
|
|
272
|
+
<CodeBlockTabsList>
|
|
273
|
+
<CodeBlockTabsTrigger value="TypeScript">TypeScript</CodeBlockTabsTrigger>
|
|
274
|
+
<CodeBlockTabsTrigger value="JavaScript">JavaScript</CodeBlockTabsTrigger>
|
|
275
|
+
</CodeBlockTabsList>
|
|
276
|
+
<CodeBlockTab value="TypeScript">
|
|
277
|
+
```ts title="example.ts"
|
|
278
|
+
export const greeting: string = "Hello from TypeScript";
|
|
279
|
+
```
|
|
280
|
+
</CodeBlockTab>
|
|
281
|
+
<CodeBlockTab value="JavaScript">
|
|
282
|
+
```js title="example.js"
|
|
283
|
+
export const greeting = "Hello from JavaScript";
|
|
284
|
+
```
|
|
285
|
+
</CodeBlockTab>
|
|
286
|
+
</CompactCodeBlockTabs>
|
|
287
|
+
|
|
288
|
+
When migrating an existing site such as next-site, translate adjacent
|
|
289
|
+
`switcher` fences to `tab="TypeScript"` and `tab="JavaScript"`, then wrap the
|
|
290
|
+
pair with `<CodeBlockTabs compact>`. Import `@vercel/geistdocs/styles.css` (or
|
|
291
|
+
`theme.css` with the documented Geist dependencies) so Tailwind scans the
|
|
292
|
+
package's compiled components and emits the tab layout utilities.
|
|
293
|
+
|
|
199
294
|
### Framework icons
|
|
200
295
|
|
|
201
296
|
Append `#<framework>` to the title to show a framework logo instead of the
|
|
@@ -204,22 +299,22 @@ values are `#next` / `#nextjs` and `#svelte` / `#sveltekit`:
|
|
|
204
299
|
|
|
205
300
|
````md
|
|
206
301
|
```ts title="flags.ts#next"
|
|
207
|
-
import { flag } from
|
|
302
|
+
import { flag } from "flags/next";
|
|
208
303
|
```
|
|
209
304
|
|
|
210
305
|
```ts title="flags.ts#svelte"
|
|
211
|
-
import { flag } from
|
|
306
|
+
import { flag } from "flags/sveltekit";
|
|
212
307
|
```
|
|
213
308
|
````
|
|
214
309
|
|
|
215
310
|
This renders as:
|
|
216
311
|
|
|
217
312
|
```ts title="flags.ts#next"
|
|
218
|
-
import { flag } from
|
|
313
|
+
import { flag } from "flags/next";
|
|
219
314
|
```
|
|
220
315
|
|
|
221
316
|
```ts title="flags.ts#svelte"
|
|
222
|
-
import { flag } from
|
|
317
|
+
import { flag } from "flags/sveltekit";
|
|
223
318
|
```
|
|
224
319
|
|
|
225
320
|
### Line Numbers
|
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.
|
|
4
|
+
"version": "1.25.1-canary.c58830e",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
"zod": "^4.1.13"
|
|
225
225
|
},
|
|
226
226
|
"peerDependencies": {
|
|
227
|
-
"next": "^16.3.
|
|
227
|
+
"next": "^16.3.3",
|
|
228
228
|
"react": "^19.2.3",
|
|
229
229
|
"react-dom": "^19.2.3",
|
|
230
230
|
"tailwindcss": "^4.1.17"
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
"@types/react": "^19.2.7",
|
|
239
239
|
"@types/react-dom": "^19.2.3",
|
|
240
240
|
"mdast-util-mdx-jsx": "^3.2.0",
|
|
241
|
-
"next": "16.3.
|
|
241
|
+
"next": "16.3.3",
|
|
242
242
|
"react": "^19.2.3",
|
|
243
243
|
"react-dom": "^19.2.3",
|
|
244
244
|
"tsup": "^8.5.1",
|
|
@@ -42,7 +42,7 @@ Fix unrelated build failures first. A migration is safer when the starting point
|
|
|
42
42
|
|
|
43
43
|
## Install Geistdocs
|
|
44
44
|
|
|
45
|
-
Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting.
|
|
45
|
+
Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting. Geistdocs requires Next.js 16.3.3 or later within 16.x. Earlier 16.3 releases can retain an optional catch-all route's index content after a client navigation to a child page when Cache Components and Partial Prefetching are enabled.
|
|
46
46
|
|
|
47
47
|
For an existing project, use your package manager directly:
|
|
48
48
|
|
|
@@ -12,7 +12,9 @@ related:
|
|
|
12
12
|
Geistdocs supports MDX, a superset of Markdown that allows you to use JSX components within your documentation. This guide covers all the formatting options available.
|
|
13
13
|
|
|
14
14
|
<CopyPrompt text="Help me write a Geistdocs MDX page. Use this page as a syntax reference and create an example page with frontmatter, headings, links, a code block, a Callout, and a CopyPrompt component.">
|
|
15
|
-
Help me write a Geistdocs MDX page. Use this page as a syntax reference and
|
|
15
|
+
Help me write a Geistdocs MDX page. Use this page as a syntax reference and
|
|
16
|
+
create an example page with frontmatter, headings, links, a code block, a
|
|
17
|
+
`Callout`, and a `CopyPrompt` component.
|
|
16
18
|
</CopyPrompt>
|
|
17
19
|
|
|
18
20
|
## Frontmatter
|
|
@@ -81,7 +83,19 @@ Create ordered lists with numbers:
|
|
|
81
83
|
|
|
82
84
|
Use `>` to create blockquotes:
|
|
83
85
|
|
|
84
|
-
>
|
|
86
|
+
> **Watch:** Learn more about how to use `next/image` → [YouTube (9 minutes)](https://youtu.be/IU_qq_c_lKA).
|
|
87
|
+
|
|
88
|
+
### Callouts
|
|
89
|
+
|
|
90
|
+
Use `<Callout>` for a highlighted informational note:
|
|
91
|
+
|
|
92
|
+
```mdx
|
|
93
|
+
<Callout>This is automatically set when deploying to Vercel.</Callout>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
This renders as:
|
|
97
|
+
|
|
98
|
+
<Callout>This is automatically set when deploying to Vercel.</Callout>
|
|
85
99
|
|
|
86
100
|
### Links
|
|
87
101
|
|
|
@@ -90,6 +104,15 @@ Create links with `[text](url)`:
|
|
|
90
104
|
- [External link](https://vercel.com)
|
|
91
105
|
- [Internal link](/docs/getting-started)
|
|
92
106
|
|
|
107
|
+
Use an absolute `https://` or `http://` URL to mark a link as external. External
|
|
108
|
+
links open outside the docs site and display an arrow icon. Use a root-relative
|
|
109
|
+
path beginning with `/` for internal links:
|
|
110
|
+
|
|
111
|
+
```md
|
|
112
|
+
[External link](https://vercel.com)
|
|
113
|
+
[Internal link](/docs/getting-started)
|
|
114
|
+
```
|
|
115
|
+
|
|
93
116
|
### Images
|
|
94
117
|
|
|
95
118
|
Add images with ``:
|
|
@@ -194,6 +217,78 @@ export const Button = ({ children }) => {
|
|
|
194
217
|
};
|
|
195
218
|
```
|
|
196
219
|
|
|
220
|
+
### Tabs and switchers
|
|
221
|
+
|
|
222
|
+
Use consecutive fences with `tab` metadata for code tabs that expose every
|
|
223
|
+
option at once:
|
|
224
|
+
|
|
225
|
+
````md
|
|
226
|
+
```ts tab="TypeScript" title="example.ts"
|
|
227
|
+
export const greeting: string = "Hello from TypeScript";
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
```js tab="JavaScript" title="example.js"
|
|
231
|
+
export const greeting = "Hello from JavaScript";
|
|
232
|
+
```
|
|
233
|
+
````
|
|
234
|
+
|
|
235
|
+
This renders as:
|
|
236
|
+
|
|
237
|
+
```ts tab="TypeScript" title="example.ts"
|
|
238
|
+
export const greeting: string = "Hello from TypeScript";
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
```js tab="JavaScript" title="example.js"
|
|
242
|
+
export const greeting = "Hello from JavaScript";
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Wrap the same fences in `<CodeBlockTabs compact>` to move the selector into the
|
|
246
|
+
code-block header:
|
|
247
|
+
|
|
248
|
+
````mdx
|
|
249
|
+
<CompactCodeBlockTabs defaultValue="TypeScript">
|
|
250
|
+
<CodeBlockTabsList>
|
|
251
|
+
<CodeBlockTabsTrigger value="TypeScript">TypeScript</CodeBlockTabsTrigger>
|
|
252
|
+
<CodeBlockTabsTrigger value="JavaScript">JavaScript</CodeBlockTabsTrigger>
|
|
253
|
+
</CodeBlockTabsList>
|
|
254
|
+
<CodeBlockTab value="TypeScript">
|
|
255
|
+
```ts title="example.ts"
|
|
256
|
+
export const greeting: string = "Hello from TypeScript";
|
|
257
|
+
```
|
|
258
|
+
</CodeBlockTab>
|
|
259
|
+
<CodeBlockTab value="JavaScript">
|
|
260
|
+
```js title="example.js"
|
|
261
|
+
export const greeting = "Hello from JavaScript";
|
|
262
|
+
```
|
|
263
|
+
</CodeBlockTab>
|
|
264
|
+
</CompactCodeBlockTabs>
|
|
265
|
+
````
|
|
266
|
+
|
|
267
|
+
This renders as:
|
|
268
|
+
|
|
269
|
+
<CompactCodeBlockTabs defaultValue="TypeScript">
|
|
270
|
+
<CodeBlockTabsList>
|
|
271
|
+
<CodeBlockTabsTrigger value="TypeScript">TypeScript</CodeBlockTabsTrigger>
|
|
272
|
+
<CodeBlockTabsTrigger value="JavaScript">JavaScript</CodeBlockTabsTrigger>
|
|
273
|
+
</CodeBlockTabsList>
|
|
274
|
+
<CodeBlockTab value="TypeScript">
|
|
275
|
+
```ts title="example.ts"
|
|
276
|
+
export const greeting: string = "Hello from TypeScript";
|
|
277
|
+
```
|
|
278
|
+
</CodeBlockTab>
|
|
279
|
+
<CodeBlockTab value="JavaScript">
|
|
280
|
+
```js title="example.js"
|
|
281
|
+
export const greeting = "Hello from JavaScript";
|
|
282
|
+
```
|
|
283
|
+
</CodeBlockTab>
|
|
284
|
+
</CompactCodeBlockTabs>
|
|
285
|
+
|
|
286
|
+
When migrating an existing site such as next-site, translate adjacent
|
|
287
|
+
`switcher` fences to `tab="TypeScript"` and `tab="JavaScript"`, then wrap the
|
|
288
|
+
pair with `<CodeBlockTabs compact>`. Import `@vercel/geistdocs/styles.css` (or
|
|
289
|
+
`theme.css` with the documented Geist dependencies) so Tailwind scans the
|
|
290
|
+
package's compiled components and emits the tab layout utilities.
|
|
291
|
+
|
|
197
292
|
### Framework icons
|
|
198
293
|
|
|
199
294
|
Append `#<framework>` to the title to show a framework logo instead of the
|
|
@@ -202,22 +297,22 @@ values are `#next` / `#nextjs` and `#svelte` / `#sveltekit`:
|
|
|
202
297
|
|
|
203
298
|
````md
|
|
204
299
|
```ts title="flags.ts#next"
|
|
205
|
-
import { flag } from
|
|
300
|
+
import { flag } from "flags/next";
|
|
206
301
|
```
|
|
207
302
|
|
|
208
303
|
```ts title="flags.ts#svelte"
|
|
209
|
-
import { flag } from
|
|
304
|
+
import { flag } from "flags/sveltekit";
|
|
210
305
|
```
|
|
211
306
|
````
|
|
212
307
|
|
|
213
308
|
This renders as:
|
|
214
309
|
|
|
215
310
|
```ts title="flags.ts#next"
|
|
216
|
-
import { flag } from
|
|
311
|
+
import { flag } from "flags/next";
|
|
217
312
|
```
|
|
218
313
|
|
|
219
314
|
```ts title="flags.ts#svelte"
|
|
220
|
-
import { flag } from
|
|
315
|
+
import { flag } from "flags/sveltekit";
|
|
221
316
|
```
|
|
222
317
|
|
|
223
318
|
### Line Numbers
|
package/template/package.json
CHANGED
|
@@ -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.
|
|
22
|
+
"@vercel/geistdocs": "1.25.1-canary.c58830e",
|
|
23
23
|
"@vercel/speed-insights": "^1.3.1",
|
|
24
24
|
"ai": "^6.0.132",
|
|
25
25
|
"class-variance-authority": "^0.7.1",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"mermaid": "^11.12.2",
|
|
37
37
|
"motion": "^12.23.25",
|
|
38
38
|
"nanoid": "^5.1.6",
|
|
39
|
-
"next": "16.3.
|
|
39
|
+
"next": "16.3.3",
|
|
40
40
|
"next-themes": "^0.4.6",
|
|
41
41
|
"radix-ui": "1.6.4",
|
|
42
42
|
"react": "^19.2.3",
|
package/theme.css
CHANGED
|
@@ -63,10 +63,73 @@
|
|
|
63
63
|
.line-numbers code .line::before {
|
|
64
64
|
content: counter(step);
|
|
65
65
|
counter-increment: step;
|
|
66
|
-
@apply mr-
|
|
66
|
+
@apply mr-5 inline-block w-4 shrink-0 text-right font-mono text-[13px] tabular-nums text-gray-600;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/* Match GeistCN CodeBlock's complete line-state treatment for Shiki output. */
|
|
71
|
+
[data-geist-code-block] :is(.line, .highlighted-line) {
|
|
72
|
+
position: relative;
|
|
73
|
+
display: inline-block;
|
|
74
|
+
width: max-content;
|
|
75
|
+
min-width: 100%;
|
|
76
|
+
height: 20px;
|
|
77
|
+
padding: 0 20px !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
[data-geist-code-block]
|
|
81
|
+
:is(.highlighted-line, .line.highlighted, [data-highlighted="true"]) {
|
|
82
|
+
background: var(--ds-blue-300) !important;
|
|
83
|
+
border-left: 0 !important;
|
|
84
|
+
box-shadow: inset 2px 0 0 0 var(--ds-blue-900);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[data-geist-code-block] .line[data-active="true"] {
|
|
88
|
+
background: var(--ds-amber-300) !important;
|
|
89
|
+
box-shadow: inset 2px 0 0 0 var(--ds-amber-900);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
[data-geist-code-block] :is([data-added="true"], .line.diff.add) {
|
|
93
|
+
background: var(--ds-green-300) !important;
|
|
94
|
+
box-shadow: inset 2px 0 0 0 var(--ds-green-900);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
[data-geist-code-block] :is([data-removed="true"], .line.diff.remove) {
|
|
98
|
+
/* Current GeistCN red-300; the legacy design-system layer redefines the
|
|
99
|
+
variable to a weaker HSL value later in the cascade. */
|
|
100
|
+
background: oklch(94.33% 0.0369 15.0115) !important;
|
|
101
|
+
box-shadow: inset 2px 0 0 0 var(--ds-red-900);
|
|
102
|
+
opacity: 1 !important;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-geist-code-block] :is(.line.diff.add, .line.diff.remove)::before {
|
|
106
|
+
content: none !important;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-geist-code-block]
|
|
110
|
+
:is(
|
|
111
|
+
[data-added="true"],
|
|
112
|
+
[data-removed="true"],
|
|
113
|
+
.line.diff.add,
|
|
114
|
+
.line.diff.remove
|
|
115
|
+
)::after {
|
|
116
|
+
position: absolute;
|
|
117
|
+
inset: 0;
|
|
118
|
+
padding-left: 8px;
|
|
119
|
+
font-weight: 500;
|
|
120
|
+
pointer-events: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
[data-geist-code-block] :is([data-added="true"], .line.diff.add)::after {
|
|
124
|
+
color: var(--ds-green-900);
|
|
125
|
+
content: "+";
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
[data-geist-code-block] :is([data-removed="true"], .line.diff.remove)::after {
|
|
129
|
+
color: var(--ds-red-900);
|
|
130
|
+
content: "-";
|
|
131
|
+
}
|
|
132
|
+
|
|
70
133
|
:root {
|
|
71
134
|
--fd-layout-width: 100%;
|
|
72
135
|
--fd-page-width: 100%;
|