@vercel/geistdocs 2.9.3-canary.e9299ff → 2.9.4-canary.fac303d
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/image.d.ts +1 -1
- package/dist/components/image.d.ts.map +1 -1
- package/dist/components/image.js +2 -3
- package/dist/internal/navbar/mobile-menu.d.ts +1 -1
- package/dist/internal/navbar/mobile-menu.d.ts.map +1 -1
- package/dist/internal/navbar/mobile-menu.js +3 -4
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +1 -0
- package/dist/source-config.d.ts.map +1 -1
- package/dist/source-config.js +1 -2
- package/docs/agents.md +2 -1
- package/docs/llms.txt +81 -18
- package/docs/manifest.json +10 -1
- package/docs/pages/components/index.md +15 -14
- package/docs/pages/components/table.md +59 -0
- package/docs/pages/syntax.md +1 -3
- package/docs/sitemap.md +1 -0
- package/package.json +5 -1
- package/source-config.js +1 -30
- package/template/content/docs/components/index.mdx +15 -14
- package/template/content/docs/components/meta.json +15 -14
- package/template/content/docs/components/table.mdx +55 -0
- package/template/content/docs/syntax.mdx +1 -3
- package/template/package.json +1 -1
- package/dist/internal/remark-prioritize-first-image.d.ts +0 -3
- package/dist/internal/remark-prioritize-first-image.d.ts.map +0 -1
- package/dist/internal/remark-prioritize-first-image.js +0 -19
package/dist/cli/index.js
CHANGED
|
@@ -4,4 +4,4 @@ import{Option as Rn,program as A}from"commander";import{access as Ke,copyFile as
|
|
|
4
4
|
`);throw new AggregateError(i,`Mixedbread search sync did not complete:
|
|
5
5
|
${a}`)}return r},Ft=async({client:e,file:t,pollIntervalMs:n,pollTimeoutMs:r,sleep:i})=>{let s=t,o=Date.now()+r;for(;s.status==="pending"||s.status==="in_progress";){if(Date.now()>=o)throw new Error(`Mixedbread timed out while indexing file ${t.id}.`);await i(n),s=await e.retrieveStoreFile(t.id)}if(s.status!=="completed")throw new Error(`Mixedbread failed to index file ${t.id} (${s.status}).`);return s},Dt=async({client:e,desired:t,pollIntervalMs:n,pollTimeoutMs:r,sleep:i})=>{let s=await e.uploadFile({content:t.document.content,filename:`${U(t.document.id).slice(0,32)}.md`}),o;try{o=await e.createStoreFile({externalId:t.externalId,fileId:s,metadata:{...t.metadata,[g.rawFileId]:s}})}catch(a){try{await e.deleteFile(s)}catch(d){throw new AggregateError([a,d],`Mixedbread failed to attach and clean up raw file ${s}.`)}throw a}return Ft({client:e,file:o,pollIntervalMs:n,pollTimeoutMs:r,sleep:i})},Ie=async({client:e,concurrency:t=St,manifest:n,pollIntervalMs:r=_t,pollTimeoutMs:i=Tt,revision:s,revisionAncestors:o=[],revisionTimestamp:a,sleep:d=Rt})=>{let c=_e(n);if(c.provider!=="mixedbread")return{deleted:0,skipped:c.documents.length,uploaded:0};let u=c.siteId?.trim();if(!u)throw new Error("Mixedbread retrieval requires a non-empty siteId in geistdocs.tsx.");if(c.documents.length===0)throw new Error("The Geistdocs search export is empty. Refusing to remove indexed documents.");let l=c.documents.map(p=>At(p,u,s,o,a)),m=new Map(l.map(p=>[p.document.id,p])),h=(await be(e)).flatMap(p=>{let y=q(p.metadata);return y?.siteId===u?[{file:p,metadata:y}]:[]}),x=new Map,P=new Set;for(let p of h){W(p.metadata,s,a)&&P.add(p.metadata.documentId);let y=m.get(p.metadata.documentId);y&&p.metadata.contentHash===y.hash&&p.file.status==="completed"&&!x.has(p.metadata.documentId)&&x.set(p.metadata.documentId,p)}let _=l.filter(p=>!(x.has(p.document.id)||P.has(p.document.id)));await Ee(_,t,p=>Dt({client:e,desired:p,pollIntervalMs:r,pollTimeoutMs:i,sleep:d}));let b=(await be(e)).flatMap(p=>{let y=q(p.metadata);return y?.siteId===u?[{file:p,metadata:y}]:[]}),D=new Set(b.filter(({metadata:p})=>W(p,s,a)).map(({metadata:p})=>p.documentId)),ie=new Set;for(let p of l){if(D.has(p.document.id))continue;let ae=b.filter(({file:V,metadata:k})=>V.status==="completed"&&k.documentId===p.document.id&&k.contentHash===p.hash).sort((V,k)=>V.file.id.localeCompare(k.file.id))[0];ae&&ie.add(ae.file.id)}let oe=b.filter(({file:p,metadata:y})=>p.status!=="pending"&&p.status!=="in_progress"&&!W(y,s,a)&&Mt({currentRevision:s,currentRevisionAncestors:o,currentRevisionTimestamp:a,desired:m.get(y.documentId),metadata:y})&&!ie.has(p.id));return await Ee(oe,t,async({file:p,metadata:y})=>{await e.deleteFile(y.rawFileId??p.id),await e.deleteStoreFile(p.id)}),{deleted:oe.length,skipped:l.length-_.length,uploaded:_.length}};var Ot=50,$t=e=>`vercel integration add mixedbread --name docs-${e||"your-site-id"} --environment production`,ve=(e,t)=>kt("git",t,{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim(),Nt=e=>{let t=process.env.VERCEL_GIT_COMMIT_SHA?.trim(),n=[];try{n=ve(e,["rev-list",`--max-count=${Ot+1}`,t||"HEAD"]).split(`
|
|
6
6
|
`).filter(Boolean)}catch{n=[]}let r=t||n[0],i;for(let s of Array.from(new Set([r,"HEAD"].filter(Boolean))))try{let o=Number(ve(e,["show","-s","--format=%ct",s]));if(Number.isFinite(o)){i=o;break}}catch{}return{revision:r,revisionAncestors:n.filter(s=>s!==r),revisionTimestamp:i}},Pe=async({allowNonProduction:e=!1,dir:t=".next"}={})=>{let n=process.cwd();Ct.loadEnvConfig(n,!1);let r=process.env.MXBAI_API_KEY?.trim(),i=process.env.MXBAI_STORE_ID?.trim();if(process.env.VERCEL_ENV!=="production"&&!e){console.log("Geistdocs search sync skipped: this is not a production Vercel build.");return}if(!!r!=!!i)throw new Error("Mixedbread is partially configured. Set both MXBAI_API_KEY and MXBAI_STORE_ID.");let s;try{s=await Te({cwd:n,outputDirectory:t})}catch(a){if(!(r||i)){console.log("Geistdocs search sync skipped: no Mixedbread credentials or static search export were found.");return}throw a}if(s.provider!=="mixedbread"){console.log("Geistdocs search sync skipped: Ask AI uses local retrieval.");return}if(!(r&&i))throw new Error(["Mixedbread retrieval is enabled, but MXBAI_API_KEY or MXBAI_STORE_ID is missing.","From the root of this site's repository, linked to the correct Vercel project, run:",$t(s.siteId)].join(`
|
|
7
|
-
`));let o=await Ie({client:we({apiBaseUrl:process.env.MXBAI_BASE_URL,apiKey:r,storeId:i}),manifest:s,...Nt(n)});console.log(`Geistdocs search sync complete: ${o.uploaded} uploaded, ${o.deleted} deleted, ${o.skipped} unchanged.`)};import{readFileSync as Gt,writeFileSync as Ut}from"fs";import{mkdir as Lt,readFile as Z,writeFile as jt}from"fs/promises";import{dirname as Bt,extname as Vt,relative as Fe,resolve as j}from"path";import{intro as Jt,isCancel as Ht,log as I,multiselect as Xt,outro as L,spinner as Kt}from"@clack/prompts";import{glob as Yt}from"glob";import{Node as F,Project as qt,SyntaxKind as zt}from"ts-morph";var Wt="geistdocs.tsx",Qt="content/docs/**/*.mdx",ee=".translation-cache.json",Q=8,Ae=()=>({version:1,entries:{}}),Zt=async e=>{let t=await Z(e),{createHash:n}=await import("crypto");return n("sha256").update(t).digest("hex")},en=e=>{let t=j(process.cwd(),e);return Gt(t,"utf8")},Me=e=>F.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(F.isPropertyAssignment(t)){let n=t.getNameNode();if(F.isIdentifier(n)||F.isStringLiteral(n))return[n.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],tn=e=>{try{let t=new qt({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),n=en(e),s=t.createSourceFile(e,n,{overwrite:!0}).getVariableDeclarations().find(a=>a.getName()==="translations")?.getInitializer();if(!s)return[];if(F.isObjectLiteralExpression(s))return Me(s);let o=s.getFirstDescendantByKind(zt.ObjectLiteralExpression);return o?Me(o):[]}catch(t){let n=t instanceof Error?t.message:`${t}`;return I.warn(`Failed to read locales from ${e}: ${n}`),[]}},nn=async()=>{let e=await Xt({message:"Which locales should be translated?",options:[{value:"cn",label:"Chinese (cn)"},{value:"jp",label:"Japanese (jp)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"}],required:!0});return Ht(e)&&(L("Translation cancelled"),process.exit(0)),e},rn=async e=>(await Yt(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),sn=async()=>{let e=j(process.cwd(),ee);try{let t=await Z(e,"utf8"),n=JSON.parse(t);return n.version!==1||!n.entries?Ae():{version:1,entries:n.entries}}catch{return Ae()}},Re=e=>{let t=j(process.cwd(),ee),n=JSON.stringify(e,null,2);Ut(t,n,"utf8")},on=async e=>{let t=await Promise.all(e.map(async n=>[n,await Zt(n)]));return Object.fromEntries(t)},an=(e,t)=>{let n=Vt(e);return`${e.slice(0,-n.length)}.${t}${n}`},De=(e,t)=>`${Fe(process.cwd(),e)}::${t}`,cn=(e,t,n,r,i=!1)=>{let s=[],o=0;for(let a of t){let d=n[a];for(let c of e){let u=an(a,c),l=De(a,c),m=r.entries[l];if(!i&&m?.hash===d){o+=1;continue}s.push({locale:c,sourceFile:a,sourceHash:d,targetFile:u})}}return{tasks:s,skippedCount:o}},dn=async e=>{await Lt(Bt(e),{recursive:!0})},ln=async(e,t,n)=>{let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:n})});if(!r.ok){let s=await r.text();throw new Error(`API request failed (${r.status}): ${s}`)}let i=await r.json();if(!i.translation)throw new Error("API response did not include a translation");return i.translation},pn=async(e,t,n)=>{let r=await Z(e.sourceFile,"utf8"),i=await ln(t,r,e.locale);await dn(e.targetFile),await jt(e.targetFile,i,"utf8"),n.entries[De(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},ke=async(e,t)=>{Jt("Translate MDX content");let n=e??Qt,r=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",i=tn(t.config??Wt),s=await rn(n);s.length===0&&(I.error(`No MDX files found matching pattern: ${n}`),L("Translation cancelled"),process.exit(1)),I.info(`Found ${s.length} MDX file(s) matching pattern`),i.length===0&&(i=await nn());let o=j(process.cwd(),ee),a=await sn();await Re(a),I.info(`Using cache: ${o}`);let d=await on(s),{tasks:c,skippedCount:u}=cn(i,s,d,a,t.force);if(c.length===0){I.success("All translations are up to date!"),L(`Skipped ${u} file(s) (unchanged)`);return}let l=[];for(let h=0;h<c.length;h+=Q)l.push(c.slice(h,h+Q));I.info(`Processing ${c.length} translation(s) in ${l.length} batch(es) of up to ${Q}`),u>0&&I.info(`Skipped ${u} translation(s) (unchanged)`);let m=Kt();m.start("Translating content...");let f=0;for(let h of l)await Promise.all(h.map(async x=>{await pn(x,r,a),f+=1,m.message(`Translated ${f}/${c.length}: ${Fe(process.cwd(),x.targetFile)}`)})),await Re(a);m.stop("Translation complete!"),L(`Created/updated ${c.length} file(s)`)};import{access as un,copyFile as gn,mkdir as Ne,rm as re}from"fs/promises";import{dirname as mn,join as v}from"path";import{intro as fn,log as w,outro as B,spinner as Ge}from"@clack/prompts";import{glob as hn}from"glob";var wn=["**/*"],yn=["content/docs/**"],te=".geistdocs-tmp",xn=async(e,t)=>{let n=v(e,t);await re(n,{recursive:!0,force:!0}),await Ne(n,{recursive:!0})},ne=async e=>await re(e,{recursive:!0,force:!0}),Ce=async(e,t,n)=>(await hn(e,{cwd:n,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),bn=async e=>{try{return await un(e),!0}catch{return!1}},En=async(e,t,n)=>{let r=v(t,e),i=v(n,e);return await bn(r)?(await gn(r,i),{success:!0}):{success:!1,error:`Source file not found: ${r}`}},Sn=async(e,t)=>{let n=v(t,e);return await re(n,{force:!0}),{success:!0}},Oe=20,$e=async(e,t,n)=>{let r=[];for(let i=0;i<e.length;i+=n){let s=e.slice(i,i+n),o=await Promise.all(s.map(t));r.push(...o)}return r},_n=async(e,t,n,r,i)=>{let s={success:[],deleted:[],failed:[]},o=[...new Set(e.map(d=>mn(v(r,d))))];i.message(`Creating ${o.length} directories...`),await Promise.all(o.map(d=>Ne(d,{recursive:!0}))),i.message(`Updating ${e.length} files...`);let a=await $e(e,async d=>{let c=await En(d,n,r);return{file:d,...c}},Oe);for(let{file:d,success:c,error:u}of a)c?s.success.push(d):s.failed.push({file:d,error:u??"Unknown error"});if(t.length>0){i.message(`Deleting ${t.length} files...`);let d=await $e(t,async c=>{try{return await Sn(c,r),{file:c,success:!0}}catch(u){let l=u instanceof Error?u.message:`${u}`;return{file:c,success:!1,error:l}}},Oe);for(let c of d)c.success?s.deleted.push(c.file):s.failed.push({file:c.file,error:c.error})}return s},Tn=e=>{if(e.success.length>0){w.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)w.info(` \u2713 ${t}`)}if(e.deleted.length>0){w.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)w.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){w.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:n}of e.failed)w.error(` \u2717 ${t}: ${n}`)}},In=e=>e.includes("canary")?"canary":"latest",vn=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(S)}`);if(!t.ok)throw new Error(`Failed to resolve ${S}@${e}`);let r=(await t.json())["dist-tags"]?.[e];if(!r)throw new Error(`Could not find dist-tag ${e} for ${S}`);return r},Pn=async e=>{let t=await M(e),n=J(t,S);if(!n)return{currentVersion:n,nextVersion:void 0,updated:!1};let r=In(n),i=await vn(r);return n===i?{currentVersion:n,nextVersion:i,updateTag:r,updated:!1}:($(t,S,i),await O(e,t),{currentVersion:n,nextVersion:i,updateTag:r,updated:!0})},An=async(e,t,n)=>{let r=await M(e);if(!le(r,S))return!1;t&&t.length>0&&w.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),n?.sync&&w.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:i,nextVersion:s,updateTag:o,updated:a}=await Pn(e);if(!a)return w.success(i?`@vercel/geistdocs is already at ${s} (${o}).`:"No package version update was needed."),B("Package-based site is already up to date."),!0;w.info(`Bumping ${S} from ${i} to ${s} (${o})`);let d=Ge();return d.start("Installing updated package version..."),await T("pnpm",["install"],{cwd:e}),d.stop("Package update complete!"),B("Please review and test the upgraded package version."),!0},Mn=async(e,t,n,r,i)=>{let s=v(e,te),o=Ge(),a=i?.sync?s:t;o.start("Preparing template snapshot..."),i?.sync&&(await xn(e,te),await N(s)),o.message("Scanning for files...");let d=await Ce(n,r,a),c=[];if(i?.sync){o.message("Comparing with local files...");let l=await Ce(n,r,e),m=new Set(d);c=l.filter(f=>!m.has(f))}if(o.stop(`Found ${d.length} files to update`),d.length===0&&c.length===0){w.warn("No files matched the patterns. Nothing to update."),i?.sync&&await ne(s),B("Update cancelled.");return}w.info(`Patterns: ${n.length}`),w.info(`Files to update: ${d.length}`),i?.sync&&w.info(`Files to delete: ${c.length}`),o.start("Updating files...");let u=await _n(d,c,a,e,o);i?.sync&&(o.message("Cleaning up..."),await ne(s)),o.stop("Update complete!"),Tn(u),B("Please review and test the changes carefully.")},Ue=async(e,t)=>{let n=process.cwd(),r=H(),i=e&&e.length>0?e:wn,s=e&&e.length>0?[]:yn;try{if(fn("Let's update your Geistdocs project!"),await An(n,e,t))return;w.info("Template source: bundled package snapshot"),e&&e.length>0&&w.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&w.info("Sync mode enabled: will delete files removed from template"),await Mn(n,r,i,s,t)}catch(o){let a=o instanceof Error?o.message:`${o}`;try{await ne(v(n,te))}catch{}w.error(`Failed to update project: ${a}`),process.exit(1)}};A.name("geistdocs").description("CLI for Geistdocs projects").version("2.9.3-canary.e9299ff","-v, --version","Output the current version");A.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").addOption(new Rn("--brand <brand>","Navbar brand").choices(["vercel","labs"]).default("vercel")).option("--disable-git","Disable git initialization").action(he);A.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(Ue);A.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(ke);var Fn=A.command("search").description("Manage the external search index used by Ask AI");Fn.command("sync").description("Sync the latest static docs export to Mixedbread").option("--dir <path>","Next.js output directory",".next").option("--allow-non-production","Run outside a production Vercel build").action(Pe);await A.parseAsync(process.argv).catch(e=>{console.error(e instanceof Error?e.message:e),process.exitCode=1});
|
|
7
|
+
`));let o=await Ie({client:we({apiBaseUrl:process.env.MXBAI_BASE_URL,apiKey:r,storeId:i}),manifest:s,...Nt(n)});console.log(`Geistdocs search sync complete: ${o.uploaded} uploaded, ${o.deleted} deleted, ${o.skipped} unchanged.`)};import{readFileSync as Gt,writeFileSync as Ut}from"fs";import{mkdir as Lt,readFile as Z,writeFile as jt}from"fs/promises";import{dirname as Bt,extname as Vt,relative as Fe,resolve as j}from"path";import{intro as Jt,isCancel as Ht,log as I,multiselect as Xt,outro as L,spinner as Kt}from"@clack/prompts";import{glob as Yt}from"glob";import{Node as F,Project as qt,SyntaxKind as zt}from"ts-morph";var Wt="geistdocs.tsx",Qt="content/docs/**/*.mdx",ee=".translation-cache.json",Q=8,Ae=()=>({version:1,entries:{}}),Zt=async e=>{let t=await Z(e),{createHash:n}=await import("crypto");return n("sha256").update(t).digest("hex")},en=e=>{let t=j(process.cwd(),e);return Gt(t,"utf8")},Me=e=>F.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(F.isPropertyAssignment(t)){let n=t.getNameNode();if(F.isIdentifier(n)||F.isStringLiteral(n))return[n.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],tn=e=>{try{let t=new qt({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),n=en(e),s=t.createSourceFile(e,n,{overwrite:!0}).getVariableDeclarations().find(a=>a.getName()==="translations")?.getInitializer();if(!s)return[];if(F.isObjectLiteralExpression(s))return Me(s);let o=s.getFirstDescendantByKind(zt.ObjectLiteralExpression);return o?Me(o):[]}catch(t){let n=t instanceof Error?t.message:`${t}`;return I.warn(`Failed to read locales from ${e}: ${n}`),[]}},nn=async()=>{let e=await Xt({message:"Which locales should be translated?",options:[{value:"cn",label:"Chinese (cn)"},{value:"jp",label:"Japanese (jp)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"}],required:!0});return Ht(e)&&(L("Translation cancelled"),process.exit(0)),e},rn=async e=>(await Yt(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),sn=async()=>{let e=j(process.cwd(),ee);try{let t=await Z(e,"utf8"),n=JSON.parse(t);return n.version!==1||!n.entries?Ae():{version:1,entries:n.entries}}catch{return Ae()}},Re=e=>{let t=j(process.cwd(),ee),n=JSON.stringify(e,null,2);Ut(t,n,"utf8")},on=async e=>{let t=await Promise.all(e.map(async n=>[n,await Zt(n)]));return Object.fromEntries(t)},an=(e,t)=>{let n=Vt(e);return`${e.slice(0,-n.length)}.${t}${n}`},De=(e,t)=>`${Fe(process.cwd(),e)}::${t}`,cn=(e,t,n,r,i=!1)=>{let s=[],o=0;for(let a of t){let d=n[a];for(let c of e){let u=an(a,c),l=De(a,c),m=r.entries[l];if(!i&&m?.hash===d){o+=1;continue}s.push({locale:c,sourceFile:a,sourceHash:d,targetFile:u})}}return{tasks:s,skippedCount:o}},dn=async e=>{await Lt(Bt(e),{recursive:!0})},ln=async(e,t,n)=>{let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:n})});if(!r.ok){let s=await r.text();throw new Error(`API request failed (${r.status}): ${s}`)}let i=await r.json();if(!i.translation)throw new Error("API response did not include a translation");return i.translation},pn=async(e,t,n)=>{let r=await Z(e.sourceFile,"utf8"),i=await ln(t,r,e.locale);await dn(e.targetFile),await jt(e.targetFile,i,"utf8"),n.entries[De(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},ke=async(e,t)=>{Jt("Translate MDX content");let n=e??Qt,r=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",i=tn(t.config??Wt),s=await rn(n);s.length===0&&(I.error(`No MDX files found matching pattern: ${n}`),L("Translation cancelled"),process.exit(1)),I.info(`Found ${s.length} MDX file(s) matching pattern`),i.length===0&&(i=await nn());let o=j(process.cwd(),ee),a=await sn();await Re(a),I.info(`Using cache: ${o}`);let d=await on(s),{tasks:c,skippedCount:u}=cn(i,s,d,a,t.force);if(c.length===0){I.success("All translations are up to date!"),L(`Skipped ${u} file(s) (unchanged)`);return}let l=[];for(let h=0;h<c.length;h+=Q)l.push(c.slice(h,h+Q));I.info(`Processing ${c.length} translation(s) in ${l.length} batch(es) of up to ${Q}`),u>0&&I.info(`Skipped ${u} translation(s) (unchanged)`);let m=Kt();m.start("Translating content...");let f=0;for(let h of l)await Promise.all(h.map(async x=>{await pn(x,r,a),f+=1,m.message(`Translated ${f}/${c.length}: ${Fe(process.cwd(),x.targetFile)}`)})),await Re(a);m.stop("Translation complete!"),L(`Created/updated ${c.length} file(s)`)};import{access as un,copyFile as gn,mkdir as Ne,rm as re}from"fs/promises";import{dirname as mn,join as v}from"path";import{intro as fn,log as w,outro as B,spinner as Ge}from"@clack/prompts";import{glob as hn}from"glob";var wn=["**/*"],yn=["content/docs/**"],te=".geistdocs-tmp",xn=async(e,t)=>{let n=v(e,t);await re(n,{recursive:!0,force:!0}),await Ne(n,{recursive:!0})},ne=async e=>await re(e,{recursive:!0,force:!0}),Ce=async(e,t,n)=>(await hn(e,{cwd:n,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),bn=async e=>{try{return await un(e),!0}catch{return!1}},En=async(e,t,n)=>{let r=v(t,e),i=v(n,e);return await bn(r)?(await gn(r,i),{success:!0}):{success:!1,error:`Source file not found: ${r}`}},Sn=async(e,t)=>{let n=v(t,e);return await re(n,{force:!0}),{success:!0}},Oe=20,$e=async(e,t,n)=>{let r=[];for(let i=0;i<e.length;i+=n){let s=e.slice(i,i+n),o=await Promise.all(s.map(t));r.push(...o)}return r},_n=async(e,t,n,r,i)=>{let s={success:[],deleted:[],failed:[]},o=[...new Set(e.map(d=>mn(v(r,d))))];i.message(`Creating ${o.length} directories...`),await Promise.all(o.map(d=>Ne(d,{recursive:!0}))),i.message(`Updating ${e.length} files...`);let a=await $e(e,async d=>{let c=await En(d,n,r);return{file:d,...c}},Oe);for(let{file:d,success:c,error:u}of a)c?s.success.push(d):s.failed.push({file:d,error:u??"Unknown error"});if(t.length>0){i.message(`Deleting ${t.length} files...`);let d=await $e(t,async c=>{try{return await Sn(c,r),{file:c,success:!0}}catch(u){let l=u instanceof Error?u.message:`${u}`;return{file:c,success:!1,error:l}}},Oe);for(let c of d)c.success?s.deleted.push(c.file):s.failed.push({file:c.file,error:c.error})}return s},Tn=e=>{if(e.success.length>0){w.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)w.info(` \u2713 ${t}`)}if(e.deleted.length>0){w.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)w.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){w.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:n}of e.failed)w.error(` \u2717 ${t}: ${n}`)}},In=e=>e.includes("canary")?"canary":"latest",vn=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(S)}`);if(!t.ok)throw new Error(`Failed to resolve ${S}@${e}`);let r=(await t.json())["dist-tags"]?.[e];if(!r)throw new Error(`Could not find dist-tag ${e} for ${S}`);return r},Pn=async e=>{let t=await M(e),n=J(t,S);if(!n)return{currentVersion:n,nextVersion:void 0,updated:!1};let r=In(n),i=await vn(r);return n===i?{currentVersion:n,nextVersion:i,updateTag:r,updated:!1}:($(t,S,i),await O(e,t),{currentVersion:n,nextVersion:i,updateTag:r,updated:!0})},An=async(e,t,n)=>{let r=await M(e);if(!le(r,S))return!1;t&&t.length>0&&w.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),n?.sync&&w.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:i,nextVersion:s,updateTag:o,updated:a}=await Pn(e);if(!a)return w.success(i?`@vercel/geistdocs is already at ${s} (${o}).`:"No package version update was needed."),B("Package-based site is already up to date."),!0;w.info(`Bumping ${S} from ${i} to ${s} (${o})`);let d=Ge();return d.start("Installing updated package version..."),await T("pnpm",["install"],{cwd:e}),d.stop("Package update complete!"),B("Please review and test the upgraded package version."),!0},Mn=async(e,t,n,r,i)=>{let s=v(e,te),o=Ge(),a=i?.sync?s:t;o.start("Preparing template snapshot..."),i?.sync&&(await xn(e,te),await N(s)),o.message("Scanning for files...");let d=await Ce(n,r,a),c=[];if(i?.sync){o.message("Comparing with local files...");let l=await Ce(n,r,e),m=new Set(d);c=l.filter(f=>!m.has(f))}if(o.stop(`Found ${d.length} files to update`),d.length===0&&c.length===0){w.warn("No files matched the patterns. Nothing to update."),i?.sync&&await ne(s),B("Update cancelled.");return}w.info(`Patterns: ${n.length}`),w.info(`Files to update: ${d.length}`),i?.sync&&w.info(`Files to delete: ${c.length}`),o.start("Updating files...");let u=await _n(d,c,a,e,o);i?.sync&&(o.message("Cleaning up..."),await ne(s)),o.stop("Update complete!"),Tn(u),B("Please review and test the changes carefully.")},Ue=async(e,t)=>{let n=process.cwd(),r=H(),i=e&&e.length>0?e:wn,s=e&&e.length>0?[]:yn;try{if(fn("Let's update your Geistdocs project!"),await An(n,e,t))return;w.info("Template source: bundled package snapshot"),e&&e.length>0&&w.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&w.info("Sync mode enabled: will delete files removed from template"),await Mn(n,r,i,s,t)}catch(o){let a=o instanceof Error?o.message:`${o}`;try{await ne(v(n,te))}catch{}w.error(`Failed to update project: ${a}`),process.exit(1)}};A.name("geistdocs").description("CLI for Geistdocs projects").version("2.9.4-canary.fac303d","-v, --version","Output the current version");A.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").addOption(new Rn("--brand <brand>","Navbar brand").choices(["vercel","labs"]).default("vercel")).option("--disable-git","Disable git initialization").action(he);A.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(Ue);A.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(ke);var Fn=A.command("search").description("Manage the external search index used by Ask AI");Fn.command("sync").description("Sync the latest static docs export to Mixedbread").option("--dir <path>","Next.js output directory",".next").option("--allow-non-production","Run outside a production Vercel build").action(Pe);await A.parseAsync(process.argv).catch(e=>{console.error(e instanceof Error?e.message:e),process.exitCode=1});
|
|
@@ -14,6 +14,6 @@ export type ImageProps = Omit<GeistImageProps, "srcDark" | "srcLight"> & ImageSo
|
|
|
14
14
|
figureClassName?: string;
|
|
15
15
|
};
|
|
16
16
|
/** A non-interactive documentation image with an optional caption. */
|
|
17
|
-
export declare const Image: ({ caption, className, figureClassName,
|
|
17
|
+
export declare const Image: ({ caption, className, figureClassName, src, srcDark, srcLight, ...props }: ImageProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
export {};
|
|
19
19
|
//# sourceMappingURL=image.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/components/image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAEL,KAAK,UAAU,IAAI,eAAe,EACnC,MAAM,gCAAgC,CAAC;AAGxC,KAAK,WAAW,GACZ;IACE,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,GACD;IACE,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEN,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,UAAU,CAAC,GACpE,WAAW,GAAG;IACZ,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEJ,sEAAsE;AACtE,eAAO,MAAM,KAAK,GAAI,
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/components/image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAEL,KAAK,UAAU,IAAI,eAAe,EACnC,MAAM,gCAAgC,CAAC;AAGxC,KAAK,WAAW,GACZ;IACE,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,GACD;IACE,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEN,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,UAAU,CAAC,GACpE,WAAW,GAAG;IACZ,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEJ,sEAAsE;AACtE,eAAO,MAAM,KAAK,GAAI,2EAQnB,UAAU,4CA2BZ,CAAC"}
|
package/dist/components/image.js
CHANGED
|
@@ -2,9 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Image as GeistImage, } from "#geistdocs-ui/components/image";
|
|
3
3
|
import { cn } from "#geistdocs-ui/utils";
|
|
4
4
|
/** A non-interactive documentation image with an optional caption. */
|
|
5
|
-
export const Image = ({ caption, className, figureClassName,
|
|
5
|
+
export const Image = ({ caption, className, figureClassName, src, srcDark, srcLight, ...props }) => {
|
|
6
6
|
const lightSource = srcLight ?? src;
|
|
7
7
|
const darkSource = srcDark ?? src;
|
|
8
|
-
|
|
9
|
-
return (_jsxs("figure", { className: cn("not-prose my-8 flex w-full max-w-full flex-col items-stretch justify-start gap-4", figureClassName), children: [_jsx("div", { className: "w-full", style: { aspectRatio }, children: _jsx(GeistImage, { className: cn("m-0 h-auto w-full rounded-lg border border-gray-400 bg-background-100 object-contain shadow-[var(--ds-shadow-small)]", className), height: height, srcDark: darkSource, srcLight: lightSource, width: width, ...props }) }), caption ? (_jsx("figcaption", { className: "mx-auto max-w-[640px] text-center text-copy-14 text-gray-900 max-[600px]:px-4", children: caption })) : null] }));
|
|
8
|
+
return (_jsxs("figure", { className: cn("not-prose my-8 flex w-full max-w-full flex-col items-stretch justify-start gap-4", figureClassName), children: [_jsx(GeistImage, { className: cn("m-0 w-full rounded-lg border border-gray-400 bg-background-100 object-contain shadow-[var(--ds-shadow-small)]", className), srcDark: darkSource, srcLight: lightSource, ...props }), caption ? (_jsx("figcaption", { className: "mx-auto max-w-[640px] text-center text-copy-14 text-gray-900 max-[600px]:px-4", children: caption })) : null] }));
|
|
10
9
|
};
|
|
@@ -7,6 +7,6 @@ interface MobileMenuProps {
|
|
|
7
7
|
/** Whether the OSS product section is enabled (navbar variant is "oss"). */
|
|
8
8
|
showOss?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare const MobileMenu: (
|
|
10
|
+
export declare const MobileMenu: (props: MobileMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=mobile-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/mobile-menu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mobile-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/mobile-menu.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,yBAAyB,EAEzB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAQtB,UAAU,eAAe;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,EAAE,gBAAgB,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;IAC1C,4EAA4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA2XD,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,4CAEhD,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { usePathname } from "next/navigation";
|
|
3
4
|
import { useMediaQuery } from "phase/react";
|
|
4
5
|
import { useEffect, useState } from "react";
|
|
5
6
|
import { IconChevronDownSmall } from "#geistdocs-assets/icons";
|
|
@@ -53,7 +54,7 @@ function OssCollapsible({ sections, onLinkClick, }) {
|
|
|
53
54
|
function MobileMenuButton({ expanded, onClick, }) {
|
|
54
55
|
return (_jsx("button", { "aria-expanded": expanded, "aria-label": expanded ? "Close menu" : "Open menu", className: "relative flex @min-[1024px]:hidden size-8 items-center justify-center rounded-full border border-gray-200 transition-colors hover:bg-gray-100", "data-slot": "mobile-menu-toggle", onClick: onClick, type: "button", children: _jsxs("span", { className: "flex flex-col items-center justify-center gap-[5px]", children: [_jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-transform duration-150", expanded && "translate-y-[3.25px] rotate-45") }), _jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-transform duration-150", expanded && "-translate-y-[3.25px] -rotate-45") })] }) }));
|
|
55
56
|
}
|
|
56
|
-
|
|
57
|
+
const MobileMenuState = ({ activeProduct, githubUrl, nav, ossProducts, showOss = false, }) => {
|
|
57
58
|
const isDesktop = useMediaQuery("(min-width: 1024px)");
|
|
58
59
|
const [show, setShow] = useState(false);
|
|
59
60
|
const isActive = useNavActive();
|
|
@@ -82,9 +83,6 @@ export const MobileMenu = ({ activeProduct, githubUrl, nav, ossProducts, showOss
|
|
|
82
83
|
ossSections.push({ heading, items: [product] });
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
setShow(false);
|
|
87
|
-
}, []);
|
|
88
86
|
useEffect(() => {
|
|
89
87
|
if (isDesktop) {
|
|
90
88
|
setShow(false);
|
|
@@ -110,3 +108,4 @@ export const MobileMenu = ({ activeProduct, githubUrl, nav, ossProducts, showOss
|
|
|
110
108
|
? "pointer-events-auto opacity-100"
|
|
111
109
|
: "pointer-events-none opacity-0"), onClick: close }), _jsxs("div", { className: cn("fixed inset-x-0 top-16 bottom-0 z-40 @min-[1024px]:hidden overflow-y-auto bg-background-200 px-2", show ? "opacity-100" : "pointer-events-none opacity-0"), children: [_jsx("div", { className: "p-4", children: _jsx(SearchButton, { className: "w-full py-4.5", onClick: close }) }), _jsxs("nav", { className: "flex flex-col px-1", children: [nav.map((item) => "items" in item ? (_jsx(NavDropdownCollapsible, { dropdown: item, onLinkClick: close }, item.label)) : (_jsx(NavLink, { active: isActive(item.href), external: item.href.startsWith("http"), href: item.href, onClick: close, children: item.label }, item.href))), githubUrl ? (_jsx(NavLink, { external: true, href: githubUrl, onClick: close, children: "GitHub" })) : null, _jsx(OssCollapsible, { onLinkClick: close, sections: ossSections })] }), _jsx("div", { className: "mt-2 flex justify-end px-4 py-4", children: _jsx(ThemeSwitcher, { small: true }) })] })] }));
|
|
112
110
|
};
|
|
111
|
+
export const MobileMenu = (props) => (_jsx(MobileMenuState, { ...props }, usePathname()));
|
package/dist/mdx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AA8B/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;AAE/D,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEnD,eAAO,MAAM,yBAAyB,GACpC,aAAa,sBAAsB,KAClC,
|
|
1
|
+
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AA8B/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;AAE/D,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEnD,eAAO,MAAM,yBAAyB,GACpC,aAAa,sBAAsB,KAClC,sBA6DD,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAC9B,aAAa,sBAAsB,KAClC,sBAA+D,CAAC;AAEnE,eAAO,MAAM,2BAA2B,GACtC,GAAG,eAAe,KAAK,CAAC,sBAAsB,GAAG,SAAS,CAAC,KAC1D,sBACkD,CAAC"}
|
package/dist/mdx.js
CHANGED
|
@@ -35,6 +35,7 @@ export const getGeistdocsMDXComponents = (components) => ({
|
|
|
35
35
|
pre: CodeBlock,
|
|
36
36
|
blockquote: Blockquote,
|
|
37
37
|
table: Table,
|
|
38
|
+
Table,
|
|
38
39
|
a: ({ children, className, href, ...props }) => {
|
|
39
40
|
const linkClassName = 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);
|
|
40
41
|
if (typeof href === "string" && href.startsWith("/")) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-config.d.ts","sourceRoot":"","sources":["../src/source-config.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,IAAI,oBAAoB,EAGrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"source-config.d.ts","sourceRoot":"","sources":["../src/source-config.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,IAAI,oBAAoB,EAGrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,KAAK,mBAAmB,GAAG,WAAW,CACpC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAC3C,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CAC1C;AAQD;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,GACxC,UAAU,SAAS,EAAE,EACrB,kBAAiB,SAAS,EAAO,KAChC,SAAS,EAgBX,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAsG3B,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwCrC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;iBAAa,CAAC;AAE9C,eAAO,MAAM,2BAA2B,GACtC,SAAQ,4BAAiC,+CAwB1C,CAAC"}
|
package/dist/source-config.js
CHANGED
|
@@ -4,7 +4,6 @@ import lastModified from "fumadocs-mdx/plugins/last-modified";
|
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { remarkDetails } from "../remark-details.js";
|
|
6
6
|
import { getLastModified } from "./internal/last-modified.js";
|
|
7
|
-
import { remarkPrioritizeFirstImage } from "./internal/remark-prioritize-first-image.js";
|
|
8
7
|
const pluginOf = (entry) => Array.isArray(entry) ? entry[0] : entry;
|
|
9
8
|
const indexOfPlugin = (list, plugin) => list.findIndex((entry) => pluginOf(entry) === plugin);
|
|
10
9
|
/**
|
|
@@ -20,7 +19,7 @@ export const resolveGeistdocsRemarkPlugins = (defaults, consumerPlugins = []) =>
|
|
|
20
19
|
const headingIndex = indexOfPlugin(list, remarkHeading);
|
|
21
20
|
list.splice(headingIndex === -1 ? 0 : headingIndex, 0, remarkSteps);
|
|
22
21
|
const structureIndex = indexOfPlugin(list, remarkStructure);
|
|
23
|
-
list.splice(structureIndex === -1 ? list.length : structureIndex, 0, remarkMdxMermaid, ...consumerPlugins, remarkDetails
|
|
22
|
+
list.splice(structureIndex === -1 ? list.length : structureIndex, 0, remarkMdxMermaid, ...consumerPlugins, remarkDetails);
|
|
24
23
|
return list;
|
|
25
24
|
};
|
|
26
25
|
export const geistShikiTheme = {
|
package/docs/agents.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Geistdocs Package Docs
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@vercel/geistdocs` 2.9.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 2.9.4-canary.fac303d 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
|
|
@@ -64,6 +64,7 @@ They are generated from `apps/template/content/docs` during the package build.
|
|
|
64
64
|
- [RSS](pages/rss.md): An automatically generated RSS 2.0 feed that keeps users informed when documentation is published or updated.
|
|
65
65
|
- [Scroll Area](pages/components/scroll-area.md): Compose ScrollArea and ScrollBar for constrained custom interfaces.
|
|
66
66
|
- [Steps](pages/components/steps.md): Write consecutive headings that start with a number, such as "### 1. Install", to render a numbered step list. The Steps and Step components cover cases where a heading must be wrapped in another component.
|
|
67
|
+
- [Table](pages/components/table.md): Use Table with semantic HTML table elements in application TSX and custom documentation components.
|
|
67
68
|
- [Table of contents](pages/table-of-contents.md): Geistdocs builds the "On this page" outline from your headings, indents sub-headings under their parent, and tracks the active section along a straight vertical guide rail.
|
|
68
69
|
- [Tabs](pages/components/tabs.md): Use Tabs for navigation-only controls or TabsWithChildren and TabContent for mounted content panels.
|
|
69
70
|
- [Theme Switcher](pages/components/theme-switcher.md): Use ThemeSwitcher in custom navigation, settings, and footer UI.
|
package/docs/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Geistdocs Package Documentation
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@vercel/geistdocs` 2.9.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 2.9.4-canary.fac303d.
|
|
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
|
|
@@ -47,6 +47,7 @@ They describe how to build package-backed Geistdocs sites and how to use the pac
|
|
|
47
47
|
- [RSS](pages/rss.md): An automatically generated RSS 2.0 feed that keeps users informed when documentation is published or updated.
|
|
48
48
|
- [Scroll Area](pages/components/scroll-area.md): Compose ScrollArea and ScrollBar for constrained custom interfaces.
|
|
49
49
|
- [Steps](pages/components/steps.md): Write consecutive headings that start with a number, such as "### 1. Install", to render a numbered step list. The Steps and Step components cover cases where a heading must be wrapped in another component.
|
|
50
|
+
- [Table](pages/components/table.md): Use Table with semantic HTML table elements in application TSX and custom documentation components.
|
|
50
51
|
- [Table of contents](pages/table-of-contents.md): Geistdocs builds the "On this page" outline from your headings, indents sub-headings under their parent, and tracks the active section along a straight vertical guide rail.
|
|
51
52
|
- [Tabs](pages/components/tabs.md): Use Tabs for navigation-only controls or TabsWithChildren and TabContent for mounted content panels.
|
|
52
53
|
- [Theme Switcher](pages/components/theme-switcher.md): Use ThemeSwitcher in custom navigation, settings, and footer UI.
|
|
@@ -1889,9 +1890,7 @@ Add images with ``:
|
|
|
1889
1890
|
|
|
1890
1891
|
Use `<Image>` when an image needs the standard documentation presentation and
|
|
1891
1892
|
an optional description. It uses Geistcn's image component without a lightbox
|
|
1892
|
-
or other interaction
|
|
1893
|
-
fetch priority; later images retain the browser's default lazy-loading
|
|
1894
|
-
priority:
|
|
1893
|
+
or other interaction:
|
|
1895
1894
|
|
|
1896
1895
|
```mdx
|
|
1897
1896
|
<Image
|
|
@@ -4895,30 +4894,31 @@ Internal projects using `@vercel/geistdocs-private` use the same component subpa
|
|
|
4895
4894
|
| --- | --- | --- |
|
|
4896
4895
|
| [Badge](/docs/components/badge) | `components/badge` | Compact status and category labels |
|
|
4897
4896
|
| [Button](/docs/components/button) | `components/button` | Buttons and link-style actions |
|
|
4898
|
-
| [Input](/docs/components/input) | `components/input` | Text input fields with provider-backed styling |
|
|
4899
|
-
| [Toggle](/docs/components/toggle) | `components/toggle` | Controlled boolean controls |
|
|
4900
|
-
| [Tooltip](/docs/components/tooltip) | `components/tooltip` | Contextual hover and focus labels |
|
|
4901
|
-
| [Toast](/docs/components/toast) | `components/toasts` | Global success, warning, and error notifications |
|
|
4902
|
-
| [Theme Switcher](/docs/components/theme-switcher) | `components/theme-switcher` | System, light, and dark theme selection |
|
|
4903
|
-
| [Tabs](/docs/components/tabs) | `components/tabs`, `components/tabs-with-children` | Tab navigation and mounted content panels |
|
|
4904
|
-
| [Collapsible](/docs/components/collapsible) | `components/collapsible` | Expandable content regions |
|
|
4905
|
-
| [Details](/docs/components/details) | `components/details` | Styled native disclosure elements |
|
|
4906
|
-
| [Dialog](/docs/components/dialog) | `components/dialog` | Modal search, chat, forms, and confirmations |
|
|
4907
4897
|
| [Callout](/docs/components/callout) | `components/callout` | Notices with optional titles and descriptions |
|
|
4908
4898
|
| [Code Block](/docs/components/code-block) | `components/code-block`, `components/code-block-tabs` | Highlighted code and tabbed code groups |
|
|
4899
|
+
| [Collapsible](/docs/components/collapsible) | `components/collapsible` | Expandable content regions |
|
|
4909
4900
|
| [Command Prompt](/docs/components/command-prompt) | `components/command-prompt` | Command surfaces with copy support and alternatives |
|
|
4910
4901
|
| [Copy Prompt](/docs/components/copy-prompt) | `components/copy-prompt` | Copyable prompts for agents and language models |
|
|
4902
|
+
| [Details](/docs/components/details) | `components/details` | Styled native disclosure elements |
|
|
4903
|
+
| [Dialog](/docs/components/dialog) | `components/dialog` | Modal search, chat, forms, and confirmations |
|
|
4911
4904
|
| [Dropdown Menu](/docs/components/dropdown-menu) | `components/dropdown-menu` | Accessible action menus |
|
|
4912
|
-
| [Navigation Menu](/docs/components/navigation-menu) | `components/navigation-menu` | Accessible navigation flyouts |
|
|
4913
|
-
| [Popover](/docs/components/popover) | `components/popover` | Anchored floating content |
|
|
4914
|
-
| [Scroll Area](/docs/components/scroll-area) | `components/scroll-area` | Styled overflow regions and scrollbars |
|
|
4915
4905
|
| [Image](/docs/components/image) | `components/image` | Next.js images with optional light and dark sources |
|
|
4906
|
+
| [Input](/docs/components/input) | `components/input` | Text input fields with provider-backed styling |
|
|
4916
4907
|
| [Native Link](/docs/components/link) | `components/link` | Styled anchors using browser-native navigation |
|
|
4917
4908
|
| [Mermaid](/docs/components/mermaid) | `components/mermaid` | Mermaid diagram rendering |
|
|
4918
|
-
| [
|
|
4909
|
+
| [Navigation Menu](/docs/components/navigation-menu) | `components/navigation-menu` | Accessible navigation flyouts |
|
|
4910
|
+
| [Popover](/docs/components/popover) | `components/popover` | Anchored floating content |
|
|
4911
|
+
| [Scroll Area](/docs/components/scroll-area) | `components/scroll-area` | Styled overflow regions and scrollbars |
|
|
4919
4912
|
| [Steps](/docs/components/steps) | `components/steps` | Numbered procedural content |
|
|
4913
|
+
| [Table](/docs/components/table) | `components/table` | Responsive documentation tables |
|
|
4914
|
+
| [Tabs](/docs/components/tabs) | `components/tabs`, `components/tabs-with-children` | Tab navigation and mounted content panels |
|
|
4915
|
+
| [Theme Switcher](/docs/components/theme-switcher) | `components/theme-switcher` | System, light, and dark theme selection |
|
|
4916
|
+
| [Toast](/docs/components/toast) | `components/toasts` | Global success, warning, and error notifications |
|
|
4917
|
+
| [Toggle](/docs/components/toggle) | `components/toggle` | Controlled boolean controls |
|
|
4918
|
+
| [Tooltip](/docs/components/tooltip) | `components/tooltip` | Contextual hover and focus labels |
|
|
4919
|
+
| [Video](/docs/components/video) | `components/video` | Responsive video playback |
|
|
4920
4920
|
|
|
4921
|
-
Components such as `Button`, `Callout`, `CodeBlock`, and `
|
|
4921
|
+
Components such as `Button`, `Callout`, `CodeBlock`, `Steps`, and `Table` are also included in the default MDX component map. Importing them directly is useful in React components, layouts, and custom page renderers.
|
|
4922
4922
|
|
|
4923
4923
|
|
|
4924
4924
|
---
|
|
@@ -6503,6 +6503,69 @@ Do not add a number prefix to headings inside `Step`. The component draws the co
|
|
|
6503
6503
|
In `.md` routes and `llms.txt`, each step list becomes plain numbered headings, such as `### 1. Install the CLI`, followed by the step content. This applies to steps written as headings and to steps written with `Steps` and `Step`, so agents read the same sequence without the wrapper markup.
|
|
6504
6504
|
|
|
6505
6505
|
|
|
6506
|
+
---
|
|
6507
|
+
|
|
6508
|
+
---
|
|
6509
|
+
title: Table
|
|
6510
|
+
description: Render responsive tables with documentation styling
|
|
6511
|
+
type: reference
|
|
6512
|
+
summary: Use Table with semantic HTML table elements in application TSX and custom documentation components.
|
|
6513
|
+
url: /docs/components/table
|
|
6514
|
+
source: apps/template/content/docs/components/table.mdx
|
|
6515
|
+
related:
|
|
6516
|
+
- /docs/components
|
|
6517
|
+
- /docs/syntax
|
|
6518
|
+
---
|
|
6519
|
+
|
|
6520
|
+
# Table
|
|
6521
|
+
|
|
6522
|
+
import { Table } from "@vercel/geistdocs/components/table";
|
|
6523
|
+
|
|
6524
|
+
<Table>
|
|
6525
|
+
<thead>
|
|
6526
|
+
<tr>
|
|
6527
|
+
<th scope="col">Runtime</th>
|
|
6528
|
+
<th scope="col">Region</th>
|
|
6529
|
+
</tr>
|
|
6530
|
+
</thead>
|
|
6531
|
+
<tbody>
|
|
6532
|
+
<tr>
|
|
6533
|
+
<td>Node.js</td>
|
|
6534
|
+
<td>Washington, D.C., USA</td>
|
|
6535
|
+
</tr>
|
|
6536
|
+
<tr>
|
|
6537
|
+
<td>Edge</td>
|
|
6538
|
+
<td>Global</td>
|
|
6539
|
+
</tr>
|
|
6540
|
+
</tbody>
|
|
6541
|
+
</Table>
|
|
6542
|
+
|
|
6543
|
+
```tsx
|
|
6544
|
+
import { Table } from "@vercel/geistdocs/components/table";
|
|
6545
|
+
|
|
6546
|
+
export function RuntimeTable() {
|
|
6547
|
+
return (
|
|
6548
|
+
<Table>
|
|
6549
|
+
<thead>
|
|
6550
|
+
<tr>
|
|
6551
|
+
<th scope="col">Runtime</th>
|
|
6552
|
+
<th scope="col">Region</th>
|
|
6553
|
+
</tr>
|
|
6554
|
+
</thead>
|
|
6555
|
+
<tbody>
|
|
6556
|
+
<tr>
|
|
6557
|
+
<td>Node.js</td>
|
|
6558
|
+
<td>Washington, D.C., USA</td>
|
|
6559
|
+
</tr>
|
|
6560
|
+
</tbody>
|
|
6561
|
+
</Table>
|
|
6562
|
+
);
|
|
6563
|
+
}
|
|
6564
|
+
```
|
|
6565
|
+
|
|
6566
|
+
`Table` adds Geistdocs typography and horizontal overflow behavior around a native table. It is also included in the default MDX component map, so lowercase Markdown tables receive the same presentation automatically.
|
|
6567
|
+
|
|
6568
|
+
|
|
6506
6569
|
---
|
|
6507
6570
|
|
|
6508
6571
|
---
|
package/docs/manifest.json
CHANGED
|
@@ -386,6 +386,15 @@
|
|
|
386
386
|
"type": "reference",
|
|
387
387
|
"url": "/docs/components/steps"
|
|
388
388
|
},
|
|
389
|
+
{
|
|
390
|
+
"description": "Render responsive tables with documentation styling",
|
|
391
|
+
"path": "pages/components/table.md",
|
|
392
|
+
"source": "apps/template/content/docs/components/table.mdx",
|
|
393
|
+
"summary": "Use Table with semantic HTML table elements in application TSX and custom documentation components.",
|
|
394
|
+
"title": "Table",
|
|
395
|
+
"type": "reference",
|
|
396
|
+
"url": "/docs/components/table"
|
|
397
|
+
},
|
|
389
398
|
{
|
|
390
399
|
"description": "Show an \"On this page\" outline that tracks the reader's position along a straight guide rail",
|
|
391
400
|
"path": "pages/table-of-contents.md",
|
|
@@ -458,5 +467,5 @@
|
|
|
458
467
|
}
|
|
459
468
|
],
|
|
460
469
|
"source": "apps/template/content/docs",
|
|
461
|
-
"version": "2.9.
|
|
470
|
+
"version": "2.9.4-canary.fac303d"
|
|
462
471
|
}
|
|
@@ -24,27 +24,28 @@ Internal projects using `@vercel/geistdocs-private` use the same component subpa
|
|
|
24
24
|
| --- | --- | --- |
|
|
25
25
|
| [Badge](/docs/components/badge) | `components/badge` | Compact status and category labels |
|
|
26
26
|
| [Button](/docs/components/button) | `components/button` | Buttons and link-style actions |
|
|
27
|
-
| [Input](/docs/components/input) | `components/input` | Text input fields with provider-backed styling |
|
|
28
|
-
| [Toggle](/docs/components/toggle) | `components/toggle` | Controlled boolean controls |
|
|
29
|
-
| [Tooltip](/docs/components/tooltip) | `components/tooltip` | Contextual hover and focus labels |
|
|
30
|
-
| [Toast](/docs/components/toast) | `components/toasts` | Global success, warning, and error notifications |
|
|
31
|
-
| [Theme Switcher](/docs/components/theme-switcher) | `components/theme-switcher` | System, light, and dark theme selection |
|
|
32
|
-
| [Tabs](/docs/components/tabs) | `components/tabs`, `components/tabs-with-children` | Tab navigation and mounted content panels |
|
|
33
|
-
| [Collapsible](/docs/components/collapsible) | `components/collapsible` | Expandable content regions |
|
|
34
|
-
| [Details](/docs/components/details) | `components/details` | Styled native disclosure elements |
|
|
35
|
-
| [Dialog](/docs/components/dialog) | `components/dialog` | Modal search, chat, forms, and confirmations |
|
|
36
27
|
| [Callout](/docs/components/callout) | `components/callout` | Notices with optional titles and descriptions |
|
|
37
28
|
| [Code Block](/docs/components/code-block) | `components/code-block`, `components/code-block-tabs` | Highlighted code and tabbed code groups |
|
|
29
|
+
| [Collapsible](/docs/components/collapsible) | `components/collapsible` | Expandable content regions |
|
|
38
30
|
| [Command Prompt](/docs/components/command-prompt) | `components/command-prompt` | Command surfaces with copy support and alternatives |
|
|
39
31
|
| [Copy Prompt](/docs/components/copy-prompt) | `components/copy-prompt` | Copyable prompts for agents and language models |
|
|
32
|
+
| [Details](/docs/components/details) | `components/details` | Styled native disclosure elements |
|
|
33
|
+
| [Dialog](/docs/components/dialog) | `components/dialog` | Modal search, chat, forms, and confirmations |
|
|
40
34
|
| [Dropdown Menu](/docs/components/dropdown-menu) | `components/dropdown-menu` | Accessible action menus |
|
|
41
|
-
| [Navigation Menu](/docs/components/navigation-menu) | `components/navigation-menu` | Accessible navigation flyouts |
|
|
42
|
-
| [Popover](/docs/components/popover) | `components/popover` | Anchored floating content |
|
|
43
|
-
| [Scroll Area](/docs/components/scroll-area) | `components/scroll-area` | Styled overflow regions and scrollbars |
|
|
44
35
|
| [Image](/docs/components/image) | `components/image` | Next.js images with optional light and dark sources |
|
|
36
|
+
| [Input](/docs/components/input) | `components/input` | Text input fields with provider-backed styling |
|
|
45
37
|
| [Native Link](/docs/components/link) | `components/link` | Styled anchors using browser-native navigation |
|
|
46
38
|
| [Mermaid](/docs/components/mermaid) | `components/mermaid` | Mermaid diagram rendering |
|
|
47
|
-
| [
|
|
39
|
+
| [Navigation Menu](/docs/components/navigation-menu) | `components/navigation-menu` | Accessible navigation flyouts |
|
|
40
|
+
| [Popover](/docs/components/popover) | `components/popover` | Anchored floating content |
|
|
41
|
+
| [Scroll Area](/docs/components/scroll-area) | `components/scroll-area` | Styled overflow regions and scrollbars |
|
|
48
42
|
| [Steps](/docs/components/steps) | `components/steps` | Numbered procedural content |
|
|
43
|
+
| [Table](/docs/components/table) | `components/table` | Responsive documentation tables |
|
|
44
|
+
| [Tabs](/docs/components/tabs) | `components/tabs`, `components/tabs-with-children` | Tab navigation and mounted content panels |
|
|
45
|
+
| [Theme Switcher](/docs/components/theme-switcher) | `components/theme-switcher` | System, light, and dark theme selection |
|
|
46
|
+
| [Toast](/docs/components/toast) | `components/toasts` | Global success, warning, and error notifications |
|
|
47
|
+
| [Toggle](/docs/components/toggle) | `components/toggle` | Controlled boolean controls |
|
|
48
|
+
| [Tooltip](/docs/components/tooltip) | `components/tooltip` | Contextual hover and focus labels |
|
|
49
|
+
| [Video](/docs/components/video) | `components/video` | Responsive video playback |
|
|
49
50
|
|
|
50
|
-
Components such as `Button`, `Callout`, `CodeBlock`, and `
|
|
51
|
+
Components such as `Button`, `Callout`, `CodeBlock`, `Steps`, and `Table` are also included in the default MDX component map. Importing them directly is useful in React components, layouts, and custom page renderers.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Table
|
|
3
|
+
description: Render responsive tables with documentation styling
|
|
4
|
+
type: reference
|
|
5
|
+
summary: Use Table with semantic HTML table elements in application TSX and custom documentation components.
|
|
6
|
+
url: /docs/components/table
|
|
7
|
+
source: apps/template/content/docs/components/table.mdx
|
|
8
|
+
related:
|
|
9
|
+
- /docs/components
|
|
10
|
+
- /docs/syntax
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Table
|
|
14
|
+
|
|
15
|
+
import { Table } from "@vercel/geistdocs/components/table";
|
|
16
|
+
|
|
17
|
+
<Table>
|
|
18
|
+
<thead>
|
|
19
|
+
<tr>
|
|
20
|
+
<th scope="col">Runtime</th>
|
|
21
|
+
<th scope="col">Region</th>
|
|
22
|
+
</tr>
|
|
23
|
+
</thead>
|
|
24
|
+
<tbody>
|
|
25
|
+
<tr>
|
|
26
|
+
<td>Node.js</td>
|
|
27
|
+
<td>Washington, D.C., USA</td>
|
|
28
|
+
</tr>
|
|
29
|
+
<tr>
|
|
30
|
+
<td>Edge</td>
|
|
31
|
+
<td>Global</td>
|
|
32
|
+
</tr>
|
|
33
|
+
</tbody>
|
|
34
|
+
</Table>
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { Table } from "@vercel/geistdocs/components/table";
|
|
38
|
+
|
|
39
|
+
export function RuntimeTable() {
|
|
40
|
+
return (
|
|
41
|
+
<Table>
|
|
42
|
+
<thead>
|
|
43
|
+
<tr>
|
|
44
|
+
<th scope="col">Runtime</th>
|
|
45
|
+
<th scope="col">Region</th>
|
|
46
|
+
</tr>
|
|
47
|
+
</thead>
|
|
48
|
+
<tbody>
|
|
49
|
+
<tr>
|
|
50
|
+
<td>Node.js</td>
|
|
51
|
+
<td>Washington, D.C., USA</td>
|
|
52
|
+
</tr>
|
|
53
|
+
</tbody>
|
|
54
|
+
</Table>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`Table` adds Geistdocs typography and horizontal overflow behavior around a native table. It is also included in the default MDX component map, so lowercase Markdown tables receive the same presentation automatically.
|
package/docs/pages/syntax.md
CHANGED
|
@@ -268,9 +268,7 @@ Add images with ``:
|
|
|
268
268
|
|
|
269
269
|
Use `<Image>` when an image needs the standard documentation presentation and
|
|
270
270
|
an optional description. It uses Geistcn's image component without a lightbox
|
|
271
|
-
or other interaction
|
|
272
|
-
fetch priority; later images retain the browser's default lazy-loading
|
|
273
|
-
priority:
|
|
271
|
+
or other interaction:
|
|
274
272
|
|
|
275
273
|
```mdx
|
|
276
274
|
<Image
|
package/docs/sitemap.md
CHANGED
|
@@ -45,6 +45,7 @@ Use it to choose focused page files from `docs/pages/` before reading the full `
|
|
|
45
45
|
- [RSS](pages/rss.md) | URL: /docs/rss | Type: conceptual | Summary: An automatically generated RSS 2.0 feed that keeps users informed when documentation is published or updated.
|
|
46
46
|
- [Scroll Area](pages/components/scroll-area.md) | URL: /docs/components/scroll-area | Type: reference | Summary: Compose ScrollArea and ScrollBar for constrained custom interfaces.
|
|
47
47
|
- [Steps](pages/components/steps.md) | URL: /docs/components/steps | Type: reference | Summary: Write consecutive headings that start with a number, such as "### 1. Install", to render a numbered step list. The Steps and Step components cover cases where a heading must be wrapped in another component.
|
|
48
|
+
- [Table](pages/components/table.md) | URL: /docs/components/table | Type: reference | Summary: Use Table with semantic HTML table elements in application TSX and custom documentation components.
|
|
48
49
|
- [Table of contents](pages/table-of-contents.md) | URL: /docs/table-of-contents | Type: reference | Summary: Geistdocs builds the "On this page" outline from your headings, indents sub-headings under their parent, and tracks the active section along a straight vertical guide rail.
|
|
49
50
|
- [Tabs](pages/components/tabs.md) | URL: /docs/components/tabs | Type: reference | Summary: Use Tabs for navigation-only controls or TabsWithChildren and TabContent for mounted content panels.
|
|
50
51
|
- [Theme Switcher](pages/components/theme-switcher.md) | URL: /docs/components/theme-switcher | Type: reference | Summary: Use ThemeSwitcher in custom navigation, settings, and footer UI.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/geistdocs",
|
|
3
3
|
"description": "Runtime and CLI for Geistdocs projects.",
|
|
4
|
-
"version": "2.9.
|
|
4
|
+
"version": "2.9.4-canary.fac303d",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -175,6 +175,10 @@
|
|
|
175
175
|
"types": "./dist/components/callout.d.ts",
|
|
176
176
|
"default": "./dist/components/callout.js"
|
|
177
177
|
},
|
|
178
|
+
"./components/table": {
|
|
179
|
+
"types": "./dist/components/table.d.ts",
|
|
180
|
+
"default": "./dist/components/table.js"
|
|
181
|
+
},
|
|
178
182
|
"./components/badge": {
|
|
179
183
|
"types": "./dist/providers/public/components/badge.d.ts",
|
|
180
184
|
"default": "./dist/providers/public/components/badge.js"
|
package/source-config.js
CHANGED
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
metaSchema,
|
|
15
15
|
} from "fumadocs-mdx/config";
|
|
16
16
|
import lastModified from "fumadocs-mdx/plugins/last-modified";
|
|
17
|
-
import { visit } from "unist-util-visit";
|
|
18
17
|
import { z } from "zod";
|
|
19
18
|
import { remarkDetails } from "./remark-details.js";
|
|
20
19
|
|
|
@@ -248,33 +247,6 @@ const pluginOf = (entry) => (Array.isArray(entry) ? entry[0] : entry);
|
|
|
248
247
|
const indexOfPlugin = (list, plugin) =>
|
|
249
248
|
list.findIndex((entry) => pluginOf(entry) === plugin);
|
|
250
249
|
|
|
251
|
-
const remarkPrioritizeFirstImage = () => (tree) => {
|
|
252
|
-
let foundImage = false;
|
|
253
|
-
|
|
254
|
-
visit(tree, "mdxJsxFlowElement", (node) => {
|
|
255
|
-
if (foundImage || node.name !== "Image") {
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
foundImage = true;
|
|
260
|
-
if (
|
|
261
|
-
node.attributes.some(
|
|
262
|
-
(attribute) =>
|
|
263
|
-
attribute.type === "mdxJsxAttribute" &&
|
|
264
|
-
attribute.name === "fetchPriority"
|
|
265
|
-
)
|
|
266
|
-
) {
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
node.attributes.push({
|
|
271
|
-
type: "mdxJsxAttribute",
|
|
272
|
-
name: "fetchPriority",
|
|
273
|
-
value: "high",
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
};
|
|
277
|
-
|
|
278
250
|
// Mirrors src/source-config.ts. `remarkSteps` must run before `remarkHeading`,
|
|
279
251
|
// otherwise the `1. ` prefix that marks a step heading leaks into the heading
|
|
280
252
|
// slug and table of contents. Geistdocs and consumer plugins keep their
|
|
@@ -294,8 +266,7 @@ export const resolveGeistdocsRemarkPlugins = (
|
|
|
294
266
|
0,
|
|
295
267
|
remarkMdxMermaid,
|
|
296
268
|
...consumerPlugins,
|
|
297
|
-
remarkDetails
|
|
298
|
-
remarkPrioritizeFirstImage
|
|
269
|
+
remarkDetails
|
|
299
270
|
);
|
|
300
271
|
|
|
301
272
|
return list;
|
|
@@ -20,27 +20,28 @@ Internal projects using `@vercel/geistdocs-private` use the same component subpa
|
|
|
20
20
|
| --- | --- | --- |
|
|
21
21
|
| [Badge](/docs/components/badge) | `components/badge` | Compact status and category labels |
|
|
22
22
|
| [Button](/docs/components/button) | `components/button` | Buttons and link-style actions |
|
|
23
|
-
| [Input](/docs/components/input) | `components/input` | Text input fields with provider-backed styling |
|
|
24
|
-
| [Toggle](/docs/components/toggle) | `components/toggle` | Controlled boolean controls |
|
|
25
|
-
| [Tooltip](/docs/components/tooltip) | `components/tooltip` | Contextual hover and focus labels |
|
|
26
|
-
| [Toast](/docs/components/toast) | `components/toasts` | Global success, warning, and error notifications |
|
|
27
|
-
| [Theme Switcher](/docs/components/theme-switcher) | `components/theme-switcher` | System, light, and dark theme selection |
|
|
28
|
-
| [Tabs](/docs/components/tabs) | `components/tabs`, `components/tabs-with-children` | Tab navigation and mounted content panels |
|
|
29
|
-
| [Collapsible](/docs/components/collapsible) | `components/collapsible` | Expandable content regions |
|
|
30
|
-
| [Details](/docs/components/details) | `components/details` | Styled native disclosure elements |
|
|
31
|
-
| [Dialog](/docs/components/dialog) | `components/dialog` | Modal search, chat, forms, and confirmations |
|
|
32
23
|
| [Callout](/docs/components/callout) | `components/callout` | Notices with optional titles and descriptions |
|
|
33
24
|
| [Code Block](/docs/components/code-block) | `components/code-block`, `components/code-block-tabs` | Highlighted code and tabbed code groups |
|
|
25
|
+
| [Collapsible](/docs/components/collapsible) | `components/collapsible` | Expandable content regions |
|
|
34
26
|
| [Command Prompt](/docs/components/command-prompt) | `components/command-prompt` | Command surfaces with copy support and alternatives |
|
|
35
27
|
| [Copy Prompt](/docs/components/copy-prompt) | `components/copy-prompt` | Copyable prompts for agents and language models |
|
|
28
|
+
| [Details](/docs/components/details) | `components/details` | Styled native disclosure elements |
|
|
29
|
+
| [Dialog](/docs/components/dialog) | `components/dialog` | Modal search, chat, forms, and confirmations |
|
|
36
30
|
| [Dropdown Menu](/docs/components/dropdown-menu) | `components/dropdown-menu` | Accessible action menus |
|
|
37
|
-
| [Navigation Menu](/docs/components/navigation-menu) | `components/navigation-menu` | Accessible navigation flyouts |
|
|
38
|
-
| [Popover](/docs/components/popover) | `components/popover` | Anchored floating content |
|
|
39
|
-
| [Scroll Area](/docs/components/scroll-area) | `components/scroll-area` | Styled overflow regions and scrollbars |
|
|
40
31
|
| [Image](/docs/components/image) | `components/image` | Next.js images with optional light and dark sources |
|
|
32
|
+
| [Input](/docs/components/input) | `components/input` | Text input fields with provider-backed styling |
|
|
41
33
|
| [Native Link](/docs/components/link) | `components/link` | Styled anchors using browser-native navigation |
|
|
42
34
|
| [Mermaid](/docs/components/mermaid) | `components/mermaid` | Mermaid diagram rendering |
|
|
43
|
-
| [
|
|
35
|
+
| [Navigation Menu](/docs/components/navigation-menu) | `components/navigation-menu` | Accessible navigation flyouts |
|
|
36
|
+
| [Popover](/docs/components/popover) | `components/popover` | Anchored floating content |
|
|
37
|
+
| [Scroll Area](/docs/components/scroll-area) | `components/scroll-area` | Styled overflow regions and scrollbars |
|
|
44
38
|
| [Steps](/docs/components/steps) | `components/steps` | Numbered procedural content |
|
|
39
|
+
| [Table](/docs/components/table) | `components/table` | Responsive documentation tables |
|
|
40
|
+
| [Tabs](/docs/components/tabs) | `components/tabs`, `components/tabs-with-children` | Tab navigation and mounted content panels |
|
|
41
|
+
| [Theme Switcher](/docs/components/theme-switcher) | `components/theme-switcher` | System, light, and dark theme selection |
|
|
42
|
+
| [Toast](/docs/components/toast) | `components/toasts` | Global success, warning, and error notifications |
|
|
43
|
+
| [Toggle](/docs/components/toggle) | `components/toggle` | Controlled boolean controls |
|
|
44
|
+
| [Tooltip](/docs/components/tooltip) | `components/tooltip` | Contextual hover and focus labels |
|
|
45
|
+
| [Video](/docs/components/video) | `components/video` | Responsive video playback |
|
|
45
46
|
|
|
46
|
-
Components such as `Button`, `Callout`, `CodeBlock`, and `
|
|
47
|
+
Components such as `Button`, `Callout`, `CodeBlock`, `Steps`, and `Table` are also included in the default MDX component map. Importing them directly is useful in React components, layouts, and custom page renderers.
|
|
@@ -3,27 +3,28 @@
|
|
|
3
3
|
"pages": [
|
|
4
4
|
"badge",
|
|
5
5
|
"button",
|
|
6
|
-
"input",
|
|
7
|
-
"toggle",
|
|
8
|
-
"tooltip",
|
|
9
|
-
"toast",
|
|
10
|
-
"theme-switcher",
|
|
11
|
-
"tabs",
|
|
12
|
-
"collapsible",
|
|
13
|
-
"details",
|
|
14
|
-
"dialog",
|
|
15
6
|
"callout",
|
|
16
7
|
"code-block",
|
|
8
|
+
"collapsible",
|
|
17
9
|
"command-prompt",
|
|
18
10
|
"copy-prompt",
|
|
11
|
+
"details",
|
|
12
|
+
"dialog",
|
|
19
13
|
"dropdown-menu",
|
|
20
|
-
"navigation-menu",
|
|
21
|
-
"popover",
|
|
22
|
-
"scroll-area",
|
|
23
14
|
"image",
|
|
15
|
+
"input",
|
|
24
16
|
"link",
|
|
25
17
|
"mermaid",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
18
|
+
"navigation-menu",
|
|
19
|
+
"popover",
|
|
20
|
+
"scroll-area",
|
|
21
|
+
"steps",
|
|
22
|
+
"table",
|
|
23
|
+
"tabs",
|
|
24
|
+
"theme-switcher",
|
|
25
|
+
"toast",
|
|
26
|
+
"toggle",
|
|
27
|
+
"tooltip",
|
|
28
|
+
"video"
|
|
28
29
|
]
|
|
29
30
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Table
|
|
3
|
+
description: Render responsive tables with documentation styling
|
|
4
|
+
type: reference
|
|
5
|
+
summary: Use Table with semantic HTML table elements in application TSX and custom documentation components.
|
|
6
|
+
related:
|
|
7
|
+
- /docs/components
|
|
8
|
+
- /docs/syntax
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
import { Table } from "@vercel/geistdocs/components/table";
|
|
12
|
+
|
|
13
|
+
<Table>
|
|
14
|
+
<thead>
|
|
15
|
+
<tr>
|
|
16
|
+
<th scope="col">Runtime</th>
|
|
17
|
+
<th scope="col">Region</th>
|
|
18
|
+
</tr>
|
|
19
|
+
</thead>
|
|
20
|
+
<tbody>
|
|
21
|
+
<tr>
|
|
22
|
+
<td>Node.js</td>
|
|
23
|
+
<td>Washington, D.C., USA</td>
|
|
24
|
+
</tr>
|
|
25
|
+
<tr>
|
|
26
|
+
<td>Edge</td>
|
|
27
|
+
<td>Global</td>
|
|
28
|
+
</tr>
|
|
29
|
+
</tbody>
|
|
30
|
+
</Table>
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { Table } from "@vercel/geistdocs/components/table";
|
|
34
|
+
|
|
35
|
+
export function RuntimeTable() {
|
|
36
|
+
return (
|
|
37
|
+
<Table>
|
|
38
|
+
<thead>
|
|
39
|
+
<tr>
|
|
40
|
+
<th scope="col">Runtime</th>
|
|
41
|
+
<th scope="col">Region</th>
|
|
42
|
+
</tr>
|
|
43
|
+
</thead>
|
|
44
|
+
<tbody>
|
|
45
|
+
<tr>
|
|
46
|
+
<td>Node.js</td>
|
|
47
|
+
<td>Washington, D.C., USA</td>
|
|
48
|
+
</tr>
|
|
49
|
+
</tbody>
|
|
50
|
+
</Table>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`Table` adds Geistdocs typography and horizontal overflow behavior around a native table. It is also included in the default MDX component map, so lowercase Markdown tables receive the same presentation automatically.
|
|
@@ -272,9 +272,7 @@ Add images with ``:
|
|
|
272
272
|
|
|
273
273
|
Use `<Image>` when an image needs the standard documentation presentation and
|
|
274
274
|
an optional description. It uses Geistcn's image component without a lightbox
|
|
275
|
-
or other interaction
|
|
276
|
-
fetch priority; later images retain the browser's default lazy-loading
|
|
277
|
-
priority:
|
|
275
|
+
or other interaction:
|
|
278
276
|
|
|
279
277
|
```mdx
|
|
280
278
|
<Image
|
package/template/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@streamdown/code": "^1.0.1",
|
|
18
18
|
"@vercel/agent-readability": "^0.7.0",
|
|
19
19
|
"@vercel/analytics": "^1.6.1",
|
|
20
|
-
"@vercel/geistdocs": "2.9.
|
|
20
|
+
"@vercel/geistdocs": "2.9.4-canary.fac303d",
|
|
21
21
|
"@vercel/speed-insights": "^1.3.1",
|
|
22
22
|
"ai": "^6.0.132",
|
|
23
23
|
"clsx": "^2.1.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remark-prioritize-first-image.d.ts","sourceRoot":"","sources":["../../src/internal/remark-prioritize-first-image.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAIlC,eAAO,MAAM,0BAA0B,SAEpC,MAAM,IAAI,KAAG,IAyBb,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { visit } from "unist-util-visit";
|
|
2
|
-
export const remarkPrioritizeFirstImage = () => (tree) => {
|
|
3
|
-
let foundImage = false;
|
|
4
|
-
visit(tree, "mdxJsxFlowElement", (node) => {
|
|
5
|
-
if (foundImage || node.name !== "Image") {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
foundImage = true;
|
|
9
|
-
if (node.attributes.some((attribute) => attribute.type === "mdxJsxAttribute" &&
|
|
10
|
-
attribute.name === "fetchPriority")) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
node.attributes.push({
|
|
14
|
-
type: "mdxJsxAttribute",
|
|
15
|
-
name: "fetchPriority",
|
|
16
|
-
value: "high",
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
};
|