@vercel/geistdocs 1.25.1-canary.c58830e → 1.25.1-canary.e417a18
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.js +1 -1
- package/dist/components/callout.d.ts +13 -10
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +6 -6
- package/dist/components/code-block-tabs.d.ts.map +1 -1
- package/dist/components/code-block-tabs.js +3 -1
- package/dist/components/code-block.d.ts.map +1 -1
- package/dist/components/code-block.js +1 -1
- package/dist/components/table.d.ts +3 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +3 -0
- package/dist/internal/page-actions-client.js +1 -1
- package/dist/internal/search.d.ts.map +1 -1
- package/dist/internal/search.js +1 -1
- package/dist/internal/sidebar.d.ts.map +1 -1
- package/dist/internal/sidebar.js +17 -14
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +3 -1
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +1 -1
- package/docs/agents.md +1 -1
- package/docs/llms.txt +32 -6
- package/docs/manifest.json +1 -1
- package/docs/pages/syntax.md +31 -5
- package/package.json +1 -1
- package/template/content/docs/syntax.mdx +32 -5
- package/template/package.json +1 -1
- package/theme.css +34 -103
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.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);
|
|
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.e417a18","-v, --version","Output the current version");T.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").option("--disable-git","Disable git initialization").action(G);T.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(ee);T.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(q);T.parse(process.argv);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
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-
|
|
3
|
+
export const Blockquote = ({ className, ...props }) => (_jsx("blockquote", { className: cn("my-4 rounded-md border border-gray-300 p-3 font-normal text-copy-14 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 }));
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
type CalloutType = "info" | "warn" | "error" | "success" | "warning" | "idea";
|
|
3
|
+
interface CalloutContainerProps extends ComponentProps<"div"> {
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
type?: CalloutType;
|
|
6
|
+
}
|
|
7
|
+
type CalloutProps = Omit<CalloutContainerProps, "title"> & {
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare const Callout: ({ children, title, ...props }: CalloutProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const CalloutContainer: ({ children, className, icon, type: _type, ...props }: CalloutContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const CalloutTitle: ({ className, ...props }: ComponentProps<"p">) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const CalloutDescription: ({ className, ...props }: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
11
14
|
export {};
|
|
12
15
|
//# sourceMappingURL=callout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../src/components/callout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../src/components/callout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9E,UAAU,qBAAsB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3D,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,KAAK,YAAY,GAAG,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC,GAAG;IACzD,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,+BAA+B,YAAY,4CAKlE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,sDAM9B,qBAAqB,4CAavB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,yBAAyB,cAAc,CAAC,GAAG,CAAC,4CAExE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,yBAGhC,cAAc,CAAC,KAAK,CAAC,4CAEvB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "@vercel/geistcn/utils";
|
|
3
|
-
import {
|
|
4
|
-
export const Callout = ({
|
|
5
|
-
export const CalloutContainer = (props) => (
|
|
6
|
-
export const CalloutTitle = (props) => (_jsx(
|
|
7
|
-
export const CalloutDescription = ({ className, ...props }) => (_jsx(
|
|
3
|
+
import { IconInformation } from "@vercel/geistcn-assets/icons";
|
|
4
|
+
export const Callout = ({ children, title, ...props }) => (_jsxs(CalloutContainer, { ...props, children: [title ? _jsx(CalloutTitle, { children: title }) : null, _jsx(CalloutDescription, { children: children })] }));
|
|
5
|
+
export const CalloutContainer = ({ children, className, icon, type: _type, ...props }) => (_jsxs("div", { className: cn("my-4 flex items-start justify-start gap-3 rounded-[6px] bg-gray-100 px-4 py-3 font-normal text-copy-14 **:leading-[150%] [&_code]:text-[12px]!", className), ...props, children: [icon ?? (_jsx(IconInformation, { className: "mt-0.5 size-4 flex-none", color: "gray-900" })), _jsx("div", { className: "min-w-0 flex-1", children: children })] }));
|
|
6
|
+
export const CalloutTitle = ({ className, ...props }) => (_jsx("p", { className: cn("my-0! font-medium", className), ...props }));
|
|
7
|
+
export const CalloutDescription = ({ className, ...props }) => (_jsx("div", { className: cn("prose-no-margin", className), ...props }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-block-tabs.d.ts","sourceRoot":"","sources":["../../src/components/code-block-tabs.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,EACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEL,KAAK,cAAc,EAIpB,MAAM,OAAO,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,
|
|
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,4CA8DrD,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"}
|
|
@@ -24,7 +24,9 @@ export const CodeBlockTabs = ({ compact = false, ...props }) => {
|
|
|
24
24
|
if (!compact) {
|
|
25
25
|
return tabs;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
const selectedLabel = options.find((option) => option.value === value)?.label ??
|
|
28
|
+
options[0]?.label;
|
|
29
|
+
return (_jsxs("div", { className: "relative [&_[role=tablist]]:hidden", children: [_jsxs("div", { className: "group absolute top-2 right-12 z-2 h-8", children: [_jsxs("div", { "aria-hidden": "true", className: "flex h-full cursor-pointer items-center gap-1 whitespace-nowrap rounded-md border-none bg-background-200 px-2 py-0 font-sans text-gray-900 text-label-13 leading-none transition-colors duration-200 group-focus-within:shadow-[var(--ds-focus-ring)] group-hover:bg-gray-200", children: [_jsx("span", { children: selectedLabel }), _jsx(IconChevronDown, { size: 16 })] }), _jsx("select", { "aria-label": "Code language", className: "absolute inset-0 cursor-pointer bg-gray-100 opacity-0 outline-hidden", onChange: (event) => setValue(event.target.value), value: value, children: options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value))) })] }), tabs] }));
|
|
28
30
|
};
|
|
29
31
|
export const CompactCodeBlockTabs = (props) => _jsx(CodeBlockTabs, { ...props, compact: true });
|
|
30
32
|
export const CodeBlockTab = (props) => (_jsx(TabsContent, { ...props, className: cn("[&>div]:mb-0", props.className) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../src/components/code-block.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,UAAU,cAAc;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAuBD,eAAO,MAAM,SAAS,GAAI,mEAKvB,cAAc,
|
|
1
|
+
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../src/components/code-block.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,UAAU,cAAc;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAuBD,eAAO,MAAM,SAAS,GAAI,mEAKvB,cAAc,4CAuChB,CAAC"}
|
|
@@ -25,5 +25,5 @@ export const CodeBlock = ({ children, className, "data-line-numbers": lineNumber
|
|
|
25
25
|
const code = isValidElement(children)
|
|
26
26
|
? children.props.children
|
|
27
27
|
: children;
|
|
28
|
-
return (_jsx(CodeBlockServer, { className: cn("[&_code]:min-w-full [&_code]:border-0 [&_code]:bg-transparent [&_code]:p-0", lineNumbers !== undefined && "line-numbers", frameworkTitle && "[&_[data-section=tabs]>div:first-child]:hidden", className), filename: frameworkTitle?.title ?? title, headerActions: frameworkTitle ? (_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 text-gray-900 text-label-13", children: [_jsx("span", { className: "flex w-4 shrink-0 items-center", children: frameworkTitle.icon }), _jsx("span", { className: "truncate", children: frameworkTitle.title })] })) : undefined, hideLineNumbers: lineNumbers === undefined, children: code }));
|
|
28
|
+
return (_jsx(CodeBlockServer, { className: cn("[&_code]:min-w-full [&_code]:border-0 [&_code]:bg-transparent [&_code]:p-0", "[&_:is(.line,.highlighted-line)]:relative [&_:is(.line,.highlighted-line)]:inline-block [&_:is(.line,.highlighted-line)]:h-5 [&_:is(.line,.highlighted-line)]:w-max [&_:is(.line,.highlighted-line)]:min-w-full [&_:is(.line,.highlighted-line)]:px-5!", "[&_:is(.highlighted-line,.line.highlighted,[data-highlighted=true])]:border-l-0! [&_:is(.highlighted-line,.line.highlighted,[data-highlighted=true])]:bg-blue-300! [&_:is(.highlighted-line,.line.highlighted,[data-highlighted=true])]:shadow-[inset_2px_0_0_0_var(--ds-blue-900)]", "[&_.line[data-active=true]]:bg-amber-300! [&_.line[data-active=true]]:shadow-[inset_2px_0_0_0_var(--ds-amber-900)]", "[&_:is([data-added=true],.line.diff.add)]:bg-green-300! [&_:is([data-added=true],.line.diff.add)]:shadow-[inset_2px_0_0_0_var(--ds-green-900)]", "[&_:is([data-removed=true],.line.diff.remove)]:bg-red-300! [&_:is([data-removed=true],.line.diff.remove)]:opacity-100! [&_:is([data-removed=true],.line.diff.remove)]:shadow-[inset_2px_0_0_0_var(--ds-red-900)]", "[&_:is(.line.diff.add,.line.diff.remove)::before]:content-none!", "[&_:is([data-added=true],[data-removed=true],.line.diff.add,.line.diff.remove)::after]:pointer-events-none [&_:is([data-added=true],[data-removed=true],.line.diff.add,.line.diff.remove)::after]:absolute [&_:is([data-added=true],[data-removed=true],.line.diff.add,.line.diff.remove)::after]:inset-0 [&_:is([data-added=true],[data-removed=true],.line.diff.add,.line.diff.remove)::after]:pl-2 [&_:is([data-added=true],[data-removed=true],.line.diff.add,.line.diff.remove)::after]:font-medium", "[&_:is([data-added=true],.line.diff.add)::after]:text-green-900 [&_:is([data-added=true],.line.diff.add)::after]:content-['+']", "[&_:is([data-removed=true],.line.diff.remove)::after]:text-red-900 [&_:is([data-removed=true],.line.diff.remove)::after]:content-['-']", lineNumbers !== undefined && "line-numbers", frameworkTitle && "[&_[data-section=tabs]>div:first-child]:hidden", className), filename: frameworkTitle?.title ?? title, headerActions: frameworkTitle ? (_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 text-gray-900 text-label-13", children: [_jsx("span", { className: "flex w-4 shrink-0 items-center", children: frameworkTitle.icon }), _jsx("span", { className: "truncate", children: frameworkTitle.title })] })) : undefined, hideLineNumbers: lineNumbers === undefined, children: code }));
|
|
29
29
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/components/table.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,eAAO,MAAM,KAAK,GAAI,yBAAyB,cAAc,CAAC,OAAO,CAAC,4CAmBrE,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
3
|
+
export const Table = ({ className, ...props }) => (_jsx("div", { className: "relative overflow-auto", children: _jsx("table", { className: cn("my-[2em] w-full table-auto border-collapse border-spacing-0 rounded-none border-0 bg-transparent text-sm leading-[1.4]", "[&_td]:border-x-0 [&_td]:text-start [&_th]:border-x-0 [&_th]:text-start", "[&_thead]:border-gray-200 [&_thead]:border-b [&_thead]:bg-transparent", "[&_thead_th]:bg-transparent [&_thead_th]:pb-[0.8em] [&_thead_th]:align-bottom [&_thead_th]:text-gray-1000 [&_thead_th]:text-heading-16", "[&_thead_th:first-child]:pl-0 [&_thead_th:last-child]:pr-0 [&_thead_th]:px-[0.6em]", "[&_tbody_tr:last-child]:border-b-0 [&_tbody_tr]:border-gray-200 [&_tbody_tr]:border-b", "[&_tbody_td:first-child]:pl-0 [&_tbody_td:last-child]:pr-0 [&_tbody_td]:px-[0.6em] [&_tbody_td]:py-[0.8em] [&_tbody_td]:align-baseline", "[&_tfoot]:border-gray-200 [&_tfoot]:border-t", "[&_tfoot_td:first-child]:pl-0 [&_tfoot_td:last-child]:pr-0 [&_tfoot_td]:px-[0.6em] [&_tfoot_td]:py-[0.8em] [&_tfoot_td]:align-top", "[&_td_code]:text-[0.8125rem]", className), ...props }) }));
|
|
@@ -160,7 +160,7 @@ 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
|
-
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) => {
|
|
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 whitespace-nowrap px-3 font-medium text-sm transition-colors hover:bg-gray-100 hover:text-gray-1000 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-gray-600/50", onClick: onCopy, type: "button", children: [_jsxs("span", { className: "relative size-4", children: [_jsx(IconCopy, { className: cn("absolute inset-0 size-4 transition-all duration-200", checked ? "scale-75 opacity-0" : "scale-100 opacity-100") }), _jsx(IconCheck, { className: cn("absolute inset-0 size-4 transition-all duration-200", checked ? "scale-100 opacity-100" : "scale-75 opacity-0") })] }), _jsx("span", { children: "Copy page" })] })) : null, _jsxs(DropdownMenu, { onOpenChange: (open) => {
|
|
164
164
|
if (!open) {
|
|
165
165
|
setMenuView("main");
|
|
166
166
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/internal/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EAUL,KAAK,WAAW,EACjB,MAAM,sCAAsC,CAAC;AAI9C,eAAO,MAAM,qBAAqB,GAAI,wBAGnC,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/internal/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EAUL,KAAK,WAAW,EACjB,MAAM,sCAAsC,CAAC;AAI9C,eAAO,MAAM,qBAAqB,GAAI,wBAGnC,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,4CAwCrC,CAAC"}
|
package/dist/internal/search.js
CHANGED
|
@@ -11,5 +11,5 @@ export const GeistdocsSearchDialog = ({ basePath, ...props }) => {
|
|
|
11
11
|
locale,
|
|
12
12
|
api: getPublicPath("/api/search", basePath),
|
|
13
13
|
});
|
|
14
|
-
return (_jsxs(FumadocsSearchDialog, { isLoading: query.isLoading, onSearchChange: setSearch, search: search, ...props, children: [_jsx(SearchDialogOverlay, { className: "bg-background-100/80 backdrop-blur-none" }), _jsxs(SearchDialogContent, { className: "border-none", "data-geistdocs-command-modal": true, children: [_jsxs(SearchDialogHeader, { children: [_jsx(SearchDialogIcon, {}), _jsx(SearchDialogInput, {}), _jsx(SearchDialogClose, {})] }), _jsx(SearchDialogList, { "aria-label": "Search results", Item: (itemProps) => (_jsx(SearchDialogListItem, { ...itemProps, role: "option" })), items: query.data === "empty" ? null : query.data, role: "listbox" })] })] }));
|
|
14
|
+
return (_jsxs(FumadocsSearchDialog, { isLoading: query.isLoading, onSearchChange: setSearch, search: search, ...props, children: [_jsx(SearchDialogOverlay, { className: "bg-background-100/80 backdrop-blur-none" }), _jsxs(SearchDialogContent, { className: "border-none", "data-geistdocs-command-modal": true, onEscapeKeyDown: () => props.onOpenChange(false), children: [_jsxs(SearchDialogHeader, { children: [_jsx(SearchDialogIcon, {}), _jsx(SearchDialogInput, {}), _jsx(SearchDialogClose, {})] }), _jsx(SearchDialogList, { "aria-label": "Search results", Item: (itemProps) => (_jsx(SearchDialogListItem, { ...itemProps, role: "option" })), items: query.data === "empty" ? null : query.data, role: "listbox" })] })] }));
|
|
15
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,YAAY,CAAC;AAu6B5E,eAAO,MAAM,gBAAgB,GAAI,6BAI9B;IACD,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,4CA+DA,CAAC"}
|
package/dist/internal/sidebar.js
CHANGED
|
@@ -126,16 +126,16 @@ const useOpenedFolders = (nodes, activeUrl, openFirstLevel, scope) => {
|
|
|
126
126
|
};
|
|
127
127
|
return { manualToggleRef, opened, toggleFolder };
|
|
128
128
|
};
|
|
129
|
-
const SidebarSeparatorRow = ({ depth, item, }) => (_jsxs("li", { className: cn("mt-4 flex items-center gap-2 px-2 pt-2 pb-1 text-gray-900 text-label-13 first:mt-0 [&_svg]:size-4", depth > 0 && "ml-3"), children: [item.icon ? _jsx("span", { className: "shrink-0", children: item.icon }) : null, _jsx("span", { className: "min-w-0 truncate", children: item.name })] }));
|
|
129
|
+
const SidebarSeparatorRow = ({ depth, item, }) => (_jsxs("li", { className: cn("mt-4 flex items-center gap-2 px-2 pt-2 pb-1 font-medium text-gray-900 text-label-13 first:mt-0 [&_svg]:size-4", depth > 0 && "ml-3"), children: [item.icon ? _jsx("span", { className: "shrink-0", children: item.icon }) : null, _jsx("span", { className: "min-w-0 truncate", children: item.name })] }));
|
|
130
130
|
const SidebarTreeItems = ({ depth, nodes, parentPath, state, }) => (_jsx(_Fragment, { children: nodes.map((node, index) => (_jsx(SidebarTreeNode, { depth: depth, node: node, path: [...parentPath, index], state: state }, getSidebarNodeId(node, [...parentPath, index], state.idScope)))) }));
|
|
131
131
|
const getSidebarRowTone = (isSelected, isGroup) => {
|
|
132
132
|
if (isSelected) {
|
|
133
|
-
return "bg-gray-200 text-gray-1000
|
|
133
|
+
return "bg-gray-200 text-gray-1000";
|
|
134
134
|
}
|
|
135
135
|
if (isGroup) {
|
|
136
|
-
return "text-gray-1000 hover:bg-gray-
|
|
136
|
+
return "text-gray-1000 hover:bg-gray-100 focus-visible:bg-gray-100";
|
|
137
137
|
}
|
|
138
|
-
return "text-gray-900 hover:bg-gray-
|
|
138
|
+
return "text-gray-900 hover:bg-gray-100 hover:text-gray-1000 focus-visible:bg-gray-100 focus-visible:text-gray-1000";
|
|
139
139
|
};
|
|
140
140
|
const SidebarDisclosureIcon = ({ expanded }) => (_jsx(_Fragment, { children: expanded ? (_jsx(IconChevronDownSmall, { size: 16 })) : (_jsx(IconChevronRight, { size: 16 })) }));
|
|
141
141
|
const SidebarBadge = ({ label }) => label ? (_jsx("span", { className: cn("inline-flex h-6 max-w-24 shrink-0 items-center truncate rounded-full px-2 text-button-12", getSidebarBadgeTone(label)), children: label })) : null;
|
|
@@ -154,11 +154,13 @@ const SidebarTreeNode = ({ depth, node, path, state, }) => {
|
|
|
154
154
|
const menuId = getDomId(state.idPrefix, nodeId);
|
|
155
155
|
const labelId = `${menuId}-label`;
|
|
156
156
|
const rowClassName = cn("flex h-9 origin-left touch-manipulation flex-row items-center rounded-md pr-1 pl-2.5 motion-reduce:transition-none", getSidebarRowTone(isSelected, isGroup));
|
|
157
|
-
const content = (_jsxs(_Fragment, { children: [node.icon ? (_jsx("span", { className: "shrink-0 [&_svg]:size-4", children: node.icon })) : null, _jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-1.5 truncate text-button-14", children: [_jsx(SidebarBadge, { label: badge }), _jsx("span", { className: "min-w-0 flex-1 truncate", id: labelId, children: node.name }), isExternalSidebarItem(item) ? (_jsx(IconArrowUpRight, { className: "ml-auto size-4 shrink-0 text-gray-900" })) : null] })] }));
|
|
157
|
+
const content = (_jsxs(_Fragment, { children: [node.icon ? (_jsx("span", { className: "shrink-0 [&_svg]:size-4", children: node.icon })) : null, _jsxs("span", { className: cn("flex min-w-0 flex-1 items-center gap-1.5 truncate text-button-14", depth > 0 && "font-normal"), children: [_jsx(SidebarBadge, { label: badge }), _jsx("span", { className: "min-w-0 flex-1 truncate", id: labelId, children: node.name }), isExternalSidebarItem(item) ? (_jsx(IconArrowUpRight, { className: "ml-auto size-4 shrink-0 text-gray-900" })) : null] })] }));
|
|
158
158
|
const handleLinkClick = (event) => {
|
|
159
159
|
state.onNavigate?.();
|
|
160
|
-
if (opensOutsideCurrentPage(event, item?.external, item?.url ?? "")
|
|
161
|
-
|
|
160
|
+
if (opensOutsideCurrentPage(event, item?.external, item?.url ?? "")) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (!(folder && hasChildren && (isSelected || !isExpanded))) {
|
|
162
164
|
return;
|
|
163
165
|
}
|
|
164
166
|
state.toggleFolder(folder, path);
|
|
@@ -173,7 +175,7 @@ const SidebarTreeNode = ({ depth, node, path, state, }) => {
|
|
|
173
175
|
else {
|
|
174
176
|
primaryControl = (_jsx("span", { className: cn(rowClassName, "min-w-0 flex-1"), children: content }));
|
|
175
177
|
}
|
|
176
|
-
return (_jsxs("li", { className: cn("relative flex w-full select-none flex-col items-stretch", depth > 0 && "pl-3"), children: [_jsxs("div", { className: "relative flex w-full items-center gap-px", children: [primaryControl, item && folder && hasChildren ? (_jsx("button", { "aria-controls": menuId, "aria-expanded": isExpanded, "aria-labelledby": labelId, className: "grid
|
|
178
|
+
return (_jsxs("li", { className: cn("relative flex w-full select-none flex-col items-stretch", depth > 0 && "pl-3"), children: [_jsxs("div", { className: "relative flex w-full items-center gap-px", children: [primaryControl, item && folder && hasChildren ? (_jsx("button", { "aria-controls": menuId, "aria-expanded": isExpanded, "aria-labelledby": labelId, className: "grid h-9 w-8 flex-none cursor-pointer touch-manipulation place-content-center rounded-md bg-transparent p-0 text-gray-900 hover:bg-gray-100 focus-visible:bg-gray-100 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none motion-reduce:transition-none", onClick: () => state.toggleFolder(folder, path), type: "button", children: _jsx(SidebarDisclosureIcon, { expanded: isExpanded }) })) : null] }), folder && hasChildren && isExpanded ? (_jsx("ul", { className: "relative mt-px mb-1 flex w-full list-none flex-col gap-px p-0", id: menuId, children: _jsx(SidebarTreeItems, { depth: depth + 1, nodes: folder.children, parentPath: path, state: state }) })) : null] }));
|
|
177
179
|
};
|
|
178
180
|
const SidebarTree = ({ activeUrl, idScope, nodes, onNavigate, openFirstLevel = false, scrollActive = false, visible = true, }) => {
|
|
179
181
|
const generatedId = useId().replace(UNSAFE_ID_CHARACTERS, "");
|
|
@@ -194,7 +196,7 @@ const SidebarTree = ({ activeUrl, idScope, nodes, onNavigate, openFirstLevel = f
|
|
|
194
196
|
const SidebarRootList = ({ activeSection, activeUrl, groups, onSelect, visible, }) => {
|
|
195
197
|
const contentRef = useRef(null);
|
|
196
198
|
useActiveItemScroll(contentRef, activeUrl, visible, activeSection?.$id ?? "root");
|
|
197
|
-
return (_jsx("div", { className: "flex flex-col gap-4 px-2 pt-1 pb-2", ref: contentRef, children: groups.map((group) => (_jsxs("div", { className: "flex flex-col", children: [group.label || group.icon ? (_jsxs("div", { className: "flex items-center gap-2 px-2 pt-2 pb-1 text-gray-900 text-label-13 [&_svg]:size-4", children: [group.icon ? (_jsx("span", { className: "shrink-0", children: group.icon })) : null, _jsx("span", { className: "min-w-0 truncate", children: group.label })] })) : null, _jsx("ul", { className: "m-0 flex list-none flex-col gap-px p-0", children: group.items.map((section, index) => (_jsx(SidebarRootItem, { activeSection: activeSection, activeUrl: activeUrl, item: section, onSelect: onSelect }, getSidebarNodeId(section, [index])))) })] }, group.id))) }));
|
|
199
|
+
return (_jsx("div", { className: "flex flex-col gap-4 px-2 pt-1 pb-2", ref: contentRef, children: groups.map((group) => (_jsxs("div", { className: "flex flex-col", children: [group.label || group.icon ? (_jsxs("div", { className: "flex items-center gap-2 px-2 pt-2 pb-1 font-medium text-gray-900 text-label-13 [&_svg]:size-4", children: [group.icon ? (_jsx("span", { className: "shrink-0", children: group.icon })) : null, _jsx("span", { className: "min-w-0 truncate", children: group.label })] })) : null, _jsx("ul", { className: "m-0 flex list-none flex-col gap-px p-0", children: group.items.map((section, index) => (_jsx(SidebarRootItem, { activeSection: activeSection, activeUrl: activeUrl, item: section, onSelect: onSelect }, getSidebarNodeId(section, [index])))) })] }, group.id))) }));
|
|
198
200
|
};
|
|
199
201
|
const SidebarRootItem = ({ activeSection, activeUrl, item, onSelect, }) => {
|
|
200
202
|
const folder = item.type === "folder" ? item : null;
|
|
@@ -204,10 +206,11 @@ const SidebarRootItem = ({ activeSection, activeUrl, item, onSelect, }) => {
|
|
|
204
206
|
const separateDisclosure = hasSeparateRootDisclosure(item);
|
|
205
207
|
const isCurrentPage = linkItem?.url === activeUrl;
|
|
206
208
|
const isActive = item === activeSection || isCurrentPage;
|
|
209
|
+
const labelWeight = { folder: "font-medium", page: "font-normal" }[item.type];
|
|
207
210
|
const className = cn("flex h-9 touch-manipulation items-center gap-2 rounded-md pr-2 pl-2.5 no-underline outline-none focus-visible:shadow-[var(--ds-focus-ring)] motion-reduce:transition-none", isActive
|
|
208
|
-
? "bg-gray-200 text-gray-1000
|
|
209
|
-
: "text-gray-900 hover:bg-gray-
|
|
210
|
-
const content = (_jsxs(_Fragment, { children: [item.icon ? (_jsx("span", { className: "shrink-0 [&_svg]:size-4", children: item.icon })) : null, _jsx(SidebarBadge, { label: badge }), _jsx("span", { className: "min-w-0 flex-1 truncate text-button-14", children: item.name }), isExternalSidebarItem(linkItem) ? (_jsx(IconArrowUpRight, { className: "size-4 shrink-0 text-gray-900" })) : null, opensSection && !separateDisclosure ? (_jsx(IconChevronRight, { className: "shrink-0 text-gray-900", size: 16 })) : null] }));
|
|
211
|
+
? "bg-gray-200 text-gray-1000"
|
|
212
|
+
: "text-gray-900 hover:bg-gray-100 hover:text-gray-1000 focus-visible:bg-gray-100");
|
|
213
|
+
const content = (_jsxs(_Fragment, { children: [item.icon ? (_jsx("span", { className: "shrink-0 [&_svg]:size-4", children: item.icon })) : null, _jsx(SidebarBadge, { label: badge }), _jsx("span", { className: cn("min-w-0 flex-1 truncate text-button-14", labelWeight), children: item.name }), isExternalSidebarItem(linkItem) ? (_jsx(IconArrowUpRight, { className: "size-4 shrink-0 text-gray-900" })) : null, opensSection && !separateDisclosure ? (_jsx(IconChevronRight, { className: "shrink-0 text-gray-900", size: 16 })) : null] }));
|
|
211
214
|
let renderedItem;
|
|
212
215
|
if (linkItem) {
|
|
213
216
|
renderedItem = (_jsx(Link, { "aria-current": isCurrentPage ? "page" : undefined, className: cn(className, separateDisclosure && "min-w-0 flex-1"), "data-sidebar-active": isActive, external: linkItem.external, href: linkItem.url, onClick: folder && opensSection
|
|
@@ -224,9 +227,9 @@ const SidebarRootItem = ({ activeSection, activeUrl, item, onSelect, }) => {
|
|
|
224
227
|
else {
|
|
225
228
|
renderedItem = _jsx("span", { className: className, children: content });
|
|
226
229
|
}
|
|
227
|
-
return (_jsxs("li", { className: cn(separateDisclosure && "flex items-center gap-px"), children: [renderedItem, separateDisclosure ? (_jsx("button", { "aria-label": getRootDisclosureLabel(item.name), className: "grid size-8 flex-none cursor-pointer touch-manipulation place-content-center rounded-md bg-transparent p-0 text-gray-900 hover:bg-gray-
|
|
230
|
+
return (_jsxs("li", { className: cn(separateDisclosure && "flex items-center gap-px"), children: [renderedItem, separateDisclosure ? (_jsx("button", { "aria-label": getRootDisclosureLabel(item.name), className: "grid size-8 flex-none cursor-pointer touch-manipulation place-content-center rounded-md bg-transparent p-0 text-gray-900 hover:bg-gray-100 focus-visible:bg-gray-100 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none motion-reduce:transition-none", onClick: (event) => onSelect(item, event.currentTarget), type: "button", children: _jsx(IconChevronRight, { size: 16 }) })) : null] }));
|
|
228
231
|
};
|
|
229
|
-
const SidebarSectionHeader = ({ buttonRef, onBack, section, }) => (_jsx("div", { className: "mb-2 px-2 pt-1", children: _jsxs("button", { "aria-label": "Back to all documentation sections", className: "flex w-full cursor-pointer touch-manipulation flex-row items-center justify-between gap-1 rounded-md border-0 bg-transparent p-0 text-gray-900 hover:bg-gray-
|
|
232
|
+
const SidebarSectionHeader = ({ buttonRef, onBack, section, }) => (_jsx("div", { className: "mb-2 px-2 pt-1", children: _jsxs("button", { "aria-label": "Back to all documentation sections", className: "flex w-full cursor-pointer touch-manipulation flex-row items-center justify-between gap-1 rounded-md border-0 bg-transparent p-0 text-gray-900 hover:bg-gray-100 hover:text-gray-1000 focus-visible:bg-gray-100 focus-visible:text-gray-1000 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none motion-reduce:transition-none", onClick: onBack, ref: buttonRef, type: "button", children: [_jsx("span", { className: "grid size-9 flex-none place-content-center", children: _jsx(IconChevronRight, { className: "rotate-180", size: 16 }) }), _jsx("span", { className: "flex min-w-0 flex-1 items-center justify-center text-button-14", children: _jsx("span", { className: "truncate", children: section.name }) }), _jsx("span", { className: "size-9 flex-none" })] }) }));
|
|
230
233
|
const DesktopSectionsSidebar = ({ activeUrl, nodes, rootScope, top, }) => {
|
|
231
234
|
const groups = useMemo(() => getSidebarRootGroups(nodes), [nodes]);
|
|
232
235
|
const currentSection = useMemo(() => findActiveRootSection(nodes, activeUrl), [activeUrl, nodes]);
|
package/dist/mdx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAqB/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,sBAmDD,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
|
@@ -9,6 +9,7 @@ import { CodeBlock } from "./components/code-block";
|
|
|
9
9
|
import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CompactCodeBlockTabs, } from "./components/code-block-tabs";
|
|
10
10
|
import { CopyPrompt } from "./components/copy-prompt";
|
|
11
11
|
import { Mermaid } from "./components/mermaid";
|
|
12
|
+
import { Table } from "./components/table";
|
|
12
13
|
import { Video } from "./components/video";
|
|
13
14
|
import { LocalizedLink } from "./internal/localized-link";
|
|
14
15
|
import { geistdocsFrontmatterSchema as frontmatterSchema, geistdocsMetaSchema as metaSchema, geistShikiTheme as shikiTheme, defineGeistdocsSourceConfig as sourceConfig, } from "./source-config";
|
|
@@ -21,7 +22,8 @@ export const getGeistdocsMDXComponents = (components) => ({
|
|
|
21
22
|
...defaultMdxComponents,
|
|
22
23
|
pre: CodeBlock,
|
|
23
24
|
blockquote: Blockquote,
|
|
24
|
-
|
|
25
|
+
table: Table,
|
|
26
|
+
a: ({ children, className, href, ...props }) => typeof href === "string" && href.startsWith("/") ? (_jsx(LocalizedLink, { className: cn("font-normal text-gray-1000! underline decoration-1 decoration-gray-700 underline-offset-4 hover:text-gray-1000! hover:decoration-gray-1000 hover:opacity-100!", className), href: href, ...props, children: children })) : (_jsxs("a", { className: cn("font-normal text-gray-1000! underline decoration-1 decoration-gray-700 underline-offset-4 hover:text-gray-1000! hover:decoration-gray-1000 hover:opacity-100!", className), href: href, ...props, children: [children, typeof href === "string" && HTTP_URL.test(href) ? (_jsxs("span", { className: "whitespace-nowrap", children: ["\u00a0", _jsx("span", { className: "inline-flex -translate-y-1 align-text-bottom", children: _jsx(IconArrowUpRightSmall, { size: 16 }) })] })) : null] })),
|
|
25
27
|
CodeBlockTabs,
|
|
26
28
|
CompactCodeBlockTabs,
|
|
27
29
|
CodeBlockTabsList,
|
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":"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;
|
|
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;AAiCD,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
|
@@ -19,7 +19,7 @@ import { getPageRobots, } from "../page-visibility";
|
|
|
19
19
|
const HTTP_URL = /^https?:\/\//;
|
|
20
20
|
const PrefetchedDocsLink = ({ children, className, href, ...props }) => {
|
|
21
21
|
const external = typeof href === "string" && HTTP_URL.test(href);
|
|
22
|
-
return (_jsxs(Link, { ...props, className: cn("font-normal text-gray-1000! underline decoration-1 decoration-gray-700 underline-offset-4 hover:text-gray-1000! hover:decoration-gray-1000 hover:opacity-100!", className), href: href, prefetch: !external, children: [children, external ? (_jsx("span", { className: "inline-flex -translate-y-1 align-text-bottom", children: _jsx(IconArrowUpRightSmall, { size: 16 }) })) : null] }));
|
|
22
|
+
return (_jsxs(Link, { ...props, className: cn("font-normal text-gray-1000! underline decoration-1 decoration-gray-700 underline-offset-4 hover:text-gray-1000! hover:decoration-gray-1000 hover:opacity-100!", className), href: href, prefetch: !external, children: [children, external ? (_jsxs("span", { className: "whitespace-nowrap", children: ["\u00a0", _jsx("span", { className: "inline-flex -translate-y-1 align-text-bottom", children: _jsx(IconArrowUpRightSmall, { size: 16 }) })] })) : null] }));
|
|
23
23
|
};
|
|
24
24
|
export const resolvePageMarkdownUrl = (options) => resolveInternalPageMarkdownUrl(options);
|
|
25
25
|
const DocsTitle = ({ className, ...props }) => (_jsx(FumadocsDocsTitle, { className: cn("mb-4 text-balance", className), ...props }));
|
package/docs/agents.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Geistdocs Package Docs
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.e417a18 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.e417a18.
|
|
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
|
|
@@ -1256,11 +1256,17 @@ Headings automatically generate anchor links for navigation and deep linking.
|
|
|
1256
1256
|
|
|
1257
1257
|
Create unordered lists with `-`, `*`, or `+`:
|
|
1258
1258
|
|
|
1259
|
-
|
|
1260
|
-
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1259
|
+
```md
|
|
1260
|
+
- Install the required packages
|
|
1261
|
+
- Configure your project
|
|
1262
|
+
- Start the development server
|
|
1263
|
+
```
|
|
1264
|
+
|
|
1265
|
+
This renders as:
|
|
1266
|
+
|
|
1267
|
+
- Install the required packages
|
|
1268
|
+
- Configure your project
|
|
1269
|
+
- Start the development server
|
|
1264
1270
|
|
|
1265
1271
|
Create ordered lists with numbers:
|
|
1266
1272
|
|
|
@@ -1286,6 +1292,16 @@ This renders as:
|
|
|
1286
1292
|
|
|
1287
1293
|
> This is automatically set when deploying to Vercel.
|
|
1288
1294
|
|
|
1295
|
+
Callouts can also contain a title and lists:
|
|
1296
|
+
|
|
1297
|
+
> Note:
|
|
1298
|
+
- The `App Router` uses [React canary
|
|
1299
|
+
releases](https://react.dev/blog/2023/05/03/react-canaries) built-in, which
|
|
1300
|
+
include all the stable React 19 changes, as well as newer features being
|
|
1301
|
+
validated in frameworks, but you should still declare react and react-dom in
|
|
1302
|
+
package.json for tooling and ecosystem compatibility.
|
|
1303
|
+
- The `Pages Router` uses the React version from your `package.json`.
|
|
1304
|
+
|
|
1289
1305
|
### Links
|
|
1290
1306
|
|
|
1291
1307
|
Create links with `[text](url)`:
|
|
@@ -1334,6 +1350,16 @@ This renders as:
|
|
|
1334
1350
|
| GFM | GitHub extensions | Supported |
|
|
1335
1351
|
| MDX | JSX in Markdown | Supported |
|
|
1336
1352
|
|
|
1353
|
+
Tables can also include inline code, as commonly used for file references:
|
|
1354
|
+
|
|
1355
|
+
| File | Description |
|
|
1356
|
+
| -------------------- | ------------------------------------------------ |
|
|
1357
|
+
| `next.config.js` | Configuration file for Next.js |
|
|
1358
|
+
| `package.json` | Project dependencies and scripts |
|
|
1359
|
+
| `instrumentation.ts` | OpenTelemetry and instrumentation file |
|
|
1360
|
+
| `.env.local` | Local environment variables |
|
|
1361
|
+
| `tsconfig.json` | Configuration file for TypeScript |
|
|
1362
|
+
|
|
1337
1363
|
### Task Lists
|
|
1338
1364
|
|
|
1339
1365
|
Create interactive task lists:
|
package/docs/manifest.json
CHANGED
package/docs/pages/syntax.md
CHANGED
|
@@ -69,11 +69,17 @@ Headings automatically generate anchor links for navigation and deep linking.
|
|
|
69
69
|
|
|
70
70
|
Create unordered lists with `-`, `*`, or `+`:
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
```md
|
|
73
|
+
- Install the required packages
|
|
74
|
+
- Configure your project
|
|
75
|
+
- Start the development server
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This renders as:
|
|
79
|
+
|
|
80
|
+
- Install the required packages
|
|
81
|
+
- Configure your project
|
|
82
|
+
- Start the development server
|
|
77
83
|
|
|
78
84
|
Create ordered lists with numbers:
|
|
79
85
|
|
|
@@ -99,6 +105,16 @@ This renders as:
|
|
|
99
105
|
|
|
100
106
|
> This is automatically set when deploying to Vercel.
|
|
101
107
|
|
|
108
|
+
Callouts can also contain a title and lists:
|
|
109
|
+
|
|
110
|
+
> Note:
|
|
111
|
+
- The `App Router` uses [React canary
|
|
112
|
+
releases](https://react.dev/blog/2023/05/03/react-canaries) built-in, which
|
|
113
|
+
include all the stable React 19 changes, as well as newer features being
|
|
114
|
+
validated in frameworks, but you should still declare react and react-dom in
|
|
115
|
+
package.json for tooling and ecosystem compatibility.
|
|
116
|
+
- The `Pages Router` uses the React version from your `package.json`.
|
|
117
|
+
|
|
102
118
|
### Links
|
|
103
119
|
|
|
104
120
|
Create links with `[text](url)`:
|
|
@@ -147,6 +163,16 @@ This renders as:
|
|
|
147
163
|
| GFM | GitHub extensions | Supported |
|
|
148
164
|
| MDX | JSX in Markdown | Supported |
|
|
149
165
|
|
|
166
|
+
Tables can also include inline code, as commonly used for file references:
|
|
167
|
+
|
|
168
|
+
| File | Description |
|
|
169
|
+
| -------------------- | ------------------------------------------------ |
|
|
170
|
+
| `next.config.js` | Configuration file for Next.js |
|
|
171
|
+
| `package.json` | Project dependencies and scripts |
|
|
172
|
+
| `instrumentation.ts` | OpenTelemetry and instrumentation file |
|
|
173
|
+
| `.env.local` | Local environment variables |
|
|
174
|
+
| `tsconfig.json` | Configuration file for TypeScript |
|
|
175
|
+
|
|
150
176
|
### Task Lists
|
|
151
177
|
|
|
152
178
|
Create interactive task lists:
|
package/package.json
CHANGED
|
@@ -67,11 +67,17 @@ Headings automatically generate anchor links for navigation and deep linking.
|
|
|
67
67
|
|
|
68
68
|
Create unordered lists with `-`, `*`, or `+`:
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
```md
|
|
71
|
+
- Install the required packages
|
|
72
|
+
- Configure your project
|
|
73
|
+
- Start the development server
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
This renders as:
|
|
77
|
+
|
|
78
|
+
- Install the required packages
|
|
79
|
+
- Configure your project
|
|
80
|
+
- Start the development server
|
|
75
81
|
|
|
76
82
|
Create ordered lists with numbers:
|
|
77
83
|
|
|
@@ -97,6 +103,17 @@ This renders as:
|
|
|
97
103
|
|
|
98
104
|
<Callout>This is automatically set when deploying to Vercel.</Callout>
|
|
99
105
|
|
|
106
|
+
Callouts can also contain a title and lists:
|
|
107
|
+
|
|
108
|
+
<Callout title="Good to know">
|
|
109
|
+
- The `App Router` uses [React canary
|
|
110
|
+
releases](https://react.dev/blog/2023/05/03/react-canaries) built-in, which
|
|
111
|
+
include all the stable React 19 changes, as well as newer features being
|
|
112
|
+
validated in frameworks, but you should still declare react and react-dom in
|
|
113
|
+
package.json for tooling and ecosystem compatibility.
|
|
114
|
+
- The `Pages Router` uses the React version from your `package.json`.
|
|
115
|
+
</Callout>
|
|
116
|
+
|
|
100
117
|
### Links
|
|
101
118
|
|
|
102
119
|
Create links with `[text](url)`:
|
|
@@ -145,6 +162,16 @@ This renders as:
|
|
|
145
162
|
| GFM | GitHub extensions | Supported |
|
|
146
163
|
| MDX | JSX in Markdown | Supported |
|
|
147
164
|
|
|
165
|
+
Tables can also include inline code, as commonly used for file references:
|
|
166
|
+
|
|
167
|
+
| File | Description |
|
|
168
|
+
| -------------------- | ------------------------------------------------ |
|
|
169
|
+
| `next.config.js` | Configuration file for Next.js |
|
|
170
|
+
| `package.json` | Project dependencies and scripts |
|
|
171
|
+
| `instrumentation.ts` | OpenTelemetry and instrumentation file |
|
|
172
|
+
| `.env.local` | Local environment variables |
|
|
173
|
+
| `tsconfig.json` | Configuration file for TypeScript |
|
|
174
|
+
|
|
148
175
|
### Task Lists
|
|
149
176
|
|
|
150
177
|
Create interactive task lists:
|
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.e417a18",
|
|
23
23
|
"@vercel/speed-insights": "^1.3.1",
|
|
24
24
|
"ai": "^6.0.132",
|
|
25
25
|
"class-variance-authority": "^0.7.1",
|
package/theme.css
CHANGED
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
/* Geistdocs integration layer: package source scanning, Fumadocs mappings,
|
|
2
|
-
docs layout rules, syntax tokens, and package-specific behavior. Geistcn's
|
|
3
|
-
tailwind.css and styles.css own design tokens, utilities, typography,
|
|
4
|
-
material styles, and base resets.
|
|
5
|
-
|
|
6
|
-
The @source lines below emit every class the package's compiled components
|
|
7
|
-
and streamdown reference; they resolve relative to this file, so they work
|
|
8
|
-
when a consumer imports it. Consumers therefore only need
|
|
9
|
-
`@import "@vercel/geistdocs/theme.css";` and must not re-`@source` the
|
|
10
|
-
package dist or streamdown downstream (delete any such line you find). Add a
|
|
11
|
-
new @source here (never downstream) only when the package gains a new
|
|
12
|
-
compiled dependency. */
|
|
13
|
-
|
|
14
|
-
/* Streamdown classes for Ask AI markdown. Both paths cover the workspace and a
|
|
15
|
-
published pnpm install; Tailwind ignores whichever doesn't resolve. */
|
|
16
1
|
@source "node_modules/streamdown/dist/*.js";
|
|
17
2
|
@source "../../streamdown/dist/*.js";
|
|
18
3
|
|
|
19
|
-
/* The package's own compiled components (navbar container queries, etc.).
|
|
20
|
-
`./dist` resolves next to this file in both the workspace and an install. */
|
|
21
4
|
@source "./dist/**/*.js";
|
|
22
5
|
|
|
23
|
-
/* Monorepo dev only: also scan the package's TypeScript source so new Tailwind
|
|
24
|
-
classes hot-reload without rebuilding `dist`. `./src` exists only in the
|
|
25
|
-
workspace; a published install has no `src`, so Tailwind ignores it. */
|
|
26
6
|
@source "./src/**/*.{ts,tsx}";
|
|
27
7
|
|
|
8
|
+
button:not(:disabled, [aria-disabled="true"]) {
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
}
|
|
11
|
+
|
|
28
12
|
.prose h1 {
|
|
29
13
|
@apply text-heading-32;
|
|
30
14
|
}
|
|
@@ -46,88 +30,51 @@
|
|
|
46
30
|
@apply text-heading-14;
|
|
47
31
|
}
|
|
48
32
|
|
|
49
|
-
|
|
50
|
-
text-[1.75em] font-semibold via its own class merge, which our cn() can't
|
|
51
|
-
reliably override. Own the Geist heading style here where specificity wins;
|
|
52
|
-
tracking-tighter loosens text-heading-40's dense -2.4px. */
|
|
53
|
-
#nd-page h1:not(:where(.prose *)) {
|
|
54
|
-
@apply text-heading-40 tracking-tighter;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@layer utilities {
|
|
58
|
-
.line-numbers code {
|
|
59
|
-
counter-reset: step;
|
|
60
|
-
counter-increment: step 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.line-numbers code .line::before {
|
|
64
|
-
content: counter(step);
|
|
65
|
-
counter-increment: step;
|
|
66
|
-
@apply mr-5 inline-block w-4 shrink-0 text-right font-mono text-[13px] tabular-nums text-gray-600;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/* Match GeistCN CodeBlock's complete line-state treatment for Shiki output. */
|
|
71
|
-
[data-geist-code-block] :is(.line, .highlighted-line) {
|
|
33
|
+
.prose :is(h1, h2, h3, h4, h5, h6)[id] {
|
|
72
34
|
position: relative;
|
|
73
|
-
display: inline-block;
|
|
74
|
-
width: max-content;
|
|
75
|
-
min-width: 100%;
|
|
76
|
-
height: 20px;
|
|
77
|
-
padding: 0 20px !important;
|
|
78
35
|
}
|
|
79
36
|
|
|
80
|
-
[
|
|
81
|
-
:
|
|
82
|
-
background: var(--ds-blue-300) !important;
|
|
83
|
-
border-left: 0 !important;
|
|
84
|
-
box-shadow: inset 2px 0 0 0 var(--ds-blue-900);
|
|
37
|
+
.prose :is(h1, h2, h3, h4, h5, h6)[id] > a:first-child {
|
|
38
|
+
position: static;
|
|
85
39
|
}
|
|
86
40
|
|
|
87
|
-
[
|
|
88
|
-
|
|
89
|
-
|
|
41
|
+
.prose :is(h1, h2, h3, h4, h5, h6)[id] > a:first-child::after {
|
|
42
|
+
position: absolute;
|
|
43
|
+
inset: 0;
|
|
44
|
+
content: "";
|
|
90
45
|
}
|
|
91
46
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
box-shadow: inset 2px 0 0 0 var(--ds-green-900);
|
|
47
|
+
.prose :is(h1, h2, h3, h4, h5, h6)[id] > svg {
|
|
48
|
+
pointer-events: none;
|
|
95
49
|
}
|
|
96
50
|
|
|
97
|
-
|
|
98
|
-
|
|
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;
|
|
51
|
+
.prose :is(h1, h2, h3, h4, h5, h6)[id]:is(:hover, :focus-within) > svg {
|
|
52
|
+
opacity: 1;
|
|
103
53
|
}
|
|
104
54
|
|
|
105
|
-
|
|
106
|
-
|
|
55
|
+
.prose ul:where(:not(.not-prose, .not-prose *)) {
|
|
56
|
+
padding-left: 1.25rem;
|
|
107
57
|
}
|
|
108
58
|
|
|
109
|
-
|
|
110
|
-
:
|
|
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;
|
|
59
|
+
.prose ul > li:where(:not(.not-prose, .not-prose *)) {
|
|
60
|
+
padding-left: 0.5rem;
|
|
121
61
|
}
|
|
122
62
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
content: "+";
|
|
63
|
+
#nd-page h1:not(:where(.prose *)) {
|
|
64
|
+
@apply text-heading-40 tracking-tighter;
|
|
126
65
|
}
|
|
127
66
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
67
|
+
@layer utilities {
|
|
68
|
+
.line-numbers code {
|
|
69
|
+
counter-reset: step;
|
|
70
|
+
counter-increment: step 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.line-numbers code .line::before {
|
|
74
|
+
content: counter(step);
|
|
75
|
+
counter-increment: step;
|
|
76
|
+
@apply mr-5 inline-block w-4 shrink-0 text-right font-mono text-[13px] tabular-nums text-gray-600;
|
|
77
|
+
}
|
|
131
78
|
}
|
|
132
79
|
|
|
133
80
|
:root {
|
|
@@ -147,7 +94,6 @@
|
|
|
147
94
|
@apply hidden;
|
|
148
95
|
}
|
|
149
96
|
|
|
150
|
-
/* Shiki syntax highlighting palette - matches packages/geist code-block.module.css */
|
|
151
97
|
:root {
|
|
152
98
|
--shiki-color-text: var(--ds-gray-1000);
|
|
153
99
|
--shiki-color-background: var(--ds-background-100);
|
|
@@ -162,7 +108,6 @@
|
|
|
162
108
|
--shiki-token-link: var(--ds-green-900);
|
|
163
109
|
}
|
|
164
110
|
|
|
165
|
-
/* Override fumadocs tokens to point at the Geist scale */
|
|
166
111
|
:root {
|
|
167
112
|
--color-fd-background: var(--ds-background-100);
|
|
168
113
|
--color-fd-foreground: var(--ds-gray-1000);
|
|
@@ -183,7 +128,6 @@
|
|
|
183
128
|
--color-fd-error: var(--ds-red-800);
|
|
184
129
|
}
|
|
185
130
|
|
|
186
|
-
/* Match the fumadocs sidebar selector to the Geist scale */
|
|
187
131
|
#nd-sidebar {
|
|
188
132
|
--color-fd-accent: var(--ds-gray-100);
|
|
189
133
|
--color-fd-accent-foreground: var(--ds-gray-1000);
|
|
@@ -276,8 +220,6 @@
|
|
|
276
220
|
}
|
|
277
221
|
}
|
|
278
222
|
|
|
279
|
-
/* fumadocs hardcodes the search dialog's className, so the command modal
|
|
280
|
-
shadow is applied here via the data attribute set in search.tsx. */
|
|
281
223
|
[data-geistdocs-command-modal] {
|
|
282
224
|
box-shadow: var(--ds-shadow-modal);
|
|
283
225
|
}
|
|
@@ -304,11 +246,6 @@
|
|
|
304
246
|
right: max(1rem, env(safe-area-inset-right));
|
|
305
247
|
}
|
|
306
248
|
|
|
307
|
-
/* Keep the table of contents scrollbar hidden on every platform. The
|
|
308
|
-
mask-gradient fade on the scroll area already signals that the list scrolls,
|
|
309
|
-
so a visible bar only adds clutter. `scrollbar-width: none` covers Firefox
|
|
310
|
-
(and non-overlay contexts); the WebKit rule covers Chrome/Safari on platforms
|
|
311
|
-
that render classic, space-consuming scrollbars. */
|
|
312
249
|
#nd-toc .geistdocs-toc-scroll {
|
|
313
250
|
scrollbar-width: none;
|
|
314
251
|
}
|
|
@@ -337,9 +274,6 @@
|
|
|
337
274
|
}
|
|
338
275
|
}
|
|
339
276
|
|
|
340
|
-
/* On home routes (GeistdocsHomeLayout renders the [data-home-route] marker),
|
|
341
|
-
the navbar starts borderless and fades its bottom border in only once the
|
|
342
|
-
page is scrolled (ScrollState toggles [data-scrolled] on <html>). */
|
|
343
277
|
body:has([data-home-route]) header {
|
|
344
278
|
border-bottom-color: transparent !important;
|
|
345
279
|
transition: border-color 200ms ease;
|
|
@@ -347,15 +281,12 @@ body:has([data-home-route]) header {
|
|
|
347
281
|
html[data-scrolled] body:has([data-home-route]) header {
|
|
348
282
|
border-bottom-color: var(--ds-gray-alpha-400) !important;
|
|
349
283
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
and covers every other route too. */
|
|
353
|
-
html body
|
|
284
|
+
html
|
|
285
|
+
body
|
|
354
286
|
header:has(
|
|
355
287
|
[data-slot="navigation-menu-trigger"][data-state="open"],
|
|
356
288
|
[data-slot="mobile-menu-toggle"][aria-expanded="true"]
|
|
357
289
|
) {
|
|
358
290
|
border-bottom-color: transparent !important;
|
|
359
|
-
/* Hide instantly; the scroll-reveal fade above still applies when closed. */
|
|
360
291
|
transition: none !important;
|
|
361
292
|
}
|