@vercel/geistdocs 2.14.6 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/components/command-prompt.d.ts.map +1 -1
  3. package/dist/components/command-prompt.js +59 -61
  4. package/dist/controls.d.ts +3 -40
  5. package/dist/controls.d.ts.map +1 -1
  6. package/dist/controls.js +5 -96
  7. package/dist/internal/chat-rate-limit.d.ts +10 -0
  8. package/dist/internal/chat-rate-limit.d.ts.map +1 -0
  9. package/dist/internal/chat-rate-limit.js +35 -0
  10. package/dist/internal/command-prompt-transition.d.ts +2 -0
  11. package/dist/internal/command-prompt-transition.d.ts.map +1 -0
  12. package/dist/internal/command-prompt-transition.js +17 -0
  13. package/dist/internal/controls-client.d.ts +40 -0
  14. package/dist/internal/controls-client.d.ts.map +1 -0
  15. package/dist/internal/controls-client.js +87 -0
  16. package/dist/internal/language-selector.d.ts +2 -0
  17. package/dist/internal/language-selector.d.ts.map +1 -0
  18. package/dist/internal/language-selector.js +12 -0
  19. package/dist/internal/navbar/mobile-menu.js +1 -1
  20. package/dist/internal/page-action-options.d.ts +37 -0
  21. package/dist/internal/page-action-options.d.ts.map +1 -0
  22. package/dist/internal/page-action-options.js +39 -0
  23. package/dist/internal/page-actions-client.d.ts +1 -31
  24. package/dist/internal/page-actions-client.d.ts.map +1 -1
  25. package/dist/internal/page-actions-client.js +5 -103
  26. package/dist/internal/page-actions-gate.d.ts +3 -0
  27. package/dist/internal/page-actions-gate.d.ts.map +1 -0
  28. package/dist/internal/page-actions-gate.js +15 -0
  29. package/dist/internal/provider-client.d.ts.map +1 -1
  30. package/dist/internal/provider-client.js +26 -1
  31. package/dist/internal/relative-docs-link.d.ts +7 -0
  32. package/dist/internal/relative-docs-link.d.ts.map +1 -0
  33. package/dist/internal/relative-docs-link.js +22 -0
  34. package/dist/internal/sidebar.d.ts.map +1 -1
  35. package/dist/internal/sidebar.js +1 -1
  36. package/dist/internal/toc-actions-client.d.ts +9 -0
  37. package/dist/internal/toc-actions-client.d.ts.map +1 -0
  38. package/dist/internal/toc-actions-client.js +78 -0
  39. package/dist/mdx.d.ts.map +1 -1
  40. package/dist/mdx.js +5 -2
  41. package/dist/navbar.js +1 -1
  42. package/dist/pages/changelog.js +1 -1
  43. package/dist/pages/docs.d.ts.map +1 -1
  44. package/dist/pages/docs.js +4 -3
  45. package/dist/routes/chat.d.ts +13 -4
  46. package/dist/routes/chat.d.ts.map +1 -1
  47. package/dist/routes/chat.js +7 -3
  48. package/dist/source-config.js +1 -1
  49. package/docs/agents.md +1 -1
  50. package/docs/llms.txt +24 -16
  51. package/docs/manifest.json +1 -1
  52. package/docs/pages/agent-readiness.md +1 -1
  53. package/docs/pages/ask-ai.md +19 -14
  54. package/docs/pages/provider.md +3 -0
  55. package/package.json +2 -2
  56. package/source-config.js +1 -1
  57. package/template/AGENTS.md +1 -1
  58. package/template/content/docs/agent-readiness.mdx +1 -1
  59. package/template/content/docs/ask-ai.cn.mdx +1 -1
  60. package/template/content/docs/ask-ai.mdx +19 -14
  61. package/template/content/docs/provider.mdx +3 -0
  62. package/template/package.json +1 -2
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.14.6","-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.15.0","-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});
@@ -1 +1 @@
1
- {"version":3,"file":"command-prompt.d.ts","sourceRoot":"","sources":["../../src/components/command-prompt.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,wBAAwB,EAG7B,KAAK,GAAG,EACR,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAkCf,KAAK,sBAAsB,GAAG,IAAI,CAChC,wBAAwB,CAAC,KAAK,CAAC,EAC/B,UAAU,CACX,GAAG;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EAAE,SAAS,EAChB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CA0EtC;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,CAE/C;AAED,KAAK,yBAAyB,GAAG,wBAAwB,CAAC,QAAQ,CAAC,GAAG;IACpE,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,yBAAyB,GAAG,GAAG,CAAC,OAAO,CA6BzC;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,CAQ/C;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,OAAO,EACP,QAAQ,GACT,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC;CACtD,GAAG,GAAG,CAAC,OAAO,CA8Bd;AAED,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAOhD;AAED,UAAU,yBAAyB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,QAAQ,GACT,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAwId;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,yBAAyB,GAChC,GAAG,CAAC,OAAO,GAAG,IAAI,CAEpB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,OAAO,CAsFlD"}
1
+ {"version":3,"file":"command-prompt.d.ts","sourceRoot":"","sources":["../../src/components/command-prompt.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,wBAAwB,EAG7B,KAAK,GAAG,EACR,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAmCf,KAAK,sBAAsB,GAAG,IAAI,CAChC,wBAAwB,CAAC,KAAK,CAAC,EAC/B,UAAU,CACX,GAAG;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EAAE,SAAS,EAChB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CA0EtC;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,CAE/C;AAED,KAAK,yBAAyB,GAAG,wBAAwB,CAAC,QAAQ,CAAC,GAAG;IACpE,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,yBAAyB,GAAG,GAAG,CAAC,OAAO,CA6BzC;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,CAQ/C;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,OAAO,EACP,QAAQ,GACT,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC;CACtD,GAAG,GAAG,CAAC,OAAO,CA0Bd;AAED,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAOhD;AAMD,UAAU,yBAAyB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,QAAQ,GACT,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CA+Id;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,yBAAyB,GAChC,GAAG,CAAC,OAAO,GAAG,IAAI,CAEpB;AAMD,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,OAAO,CAmClD"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { AnimatePresence, motion, useReducedMotion } from "motion/react";
4
3
  import { useSize } from "phase/react";
5
4
  import { Children, createContext, isValidElement, useContext, useEffect, useLayoutEffect, useRef, useState, } from "react";
6
5
  import { IconCheck } from "#geistdocs-assets/icons/icon-check";
7
6
  import { IconCopy } from "#geistdocs-assets/icons/icon-copy";
8
7
  import { cn } from "#geistdocs-ui/utils";
8
+ import { observeWidthTransition } from "../internal/command-prompt-transition";
9
9
  const CommandPromptContext = createContext(null);
10
10
  function useCommandPromptContext(component) {
11
11
  const context = useContext(CommandPromptContext);
@@ -88,8 +88,11 @@ export function CommandPromptTriggerDivider({ className, ...props }) {
88
88
  }
89
89
  export function CommandPromptSurface({ className, onClick, children, }) {
90
90
  const context = useCommandPromptContext("CommandPrompt.Surface");
91
- const shouldReduceMotion = useReducedMotion();
92
- return (_jsx(motion.div, { className: cn("group material-small relative flex max-w-[calc(100vw-48px)] items-center gap-1 rounded-full py-2 pr-3 pl-5 transition-colors", className), layout: true, onClick: (event) => {
91
+ return (
92
+ // biome-ignore lint/a11y/noNoninteractiveElementInteractions: pointer shortcut for CommandPrompt.Copy, which is the keyboard control
93
+ // biome-ignore lint/a11y/noStaticElementInteractions: pointer shortcut for CommandPrompt.Copy, which is the keyboard control
94
+ // biome-ignore lint/a11y/useKeyWithClickEvents: pointer shortcut for CommandPrompt.Copy, which is the keyboard control
95
+ _jsx("div", { className: cn("group material-small relative flex max-w-[calc(100vw-48px)] items-center gap-1 rounded-full py-2 pr-3 pl-5 transition-colors", className), onClick: (event) => {
93
96
  onClick?.(event);
94
97
  if (event.defaultPrevented) {
95
98
  return;
@@ -98,16 +101,16 @@ export function CommandPromptSurface({ className, onClick, children, }) {
98
101
  return;
99
102
  }
100
103
  context.copyActiveValue();
101
- }, transition: shouldReduceMotion
102
- ? { duration: 0 }
103
- : { type: "spring", bounce: 0, duration: 0.4 }, children: children }));
104
+ }, children: children }));
104
105
  }
105
106
  export function CommandPromptPrefix({ className, ...props }) {
106
107
  return (_jsx("span", { className: cn("block pr-1 text-gray-500 text-label-16-mono!", className), ...props }));
107
108
  }
109
+ // A critically damped spring that settles in 400ms, sampled into linear() stops.
110
+ const WIDTH_SPRING_EASING = "linear(0, 0.015 2%, 0.066 4.5%, 0.186 8.5%, 0.465 17%, 0.609 22.25%, 0.725 27.75%, 0.814 33.5%, 0.883 40%, 0.937 48.25%, 0.975 60.25%, 0.995 81.25%, 1)";
108
111
  export function CommandPromptViewport({ className, children, }) {
109
112
  const context = useCommandPromptContext("CommandPrompt.Viewport");
110
- const shouldReduceMotion = useReducedMotion();
113
+ const viewportRef = useRef(null);
111
114
  const { commandWidth, canShowGradient, isOverflowing, setActiveCopyValue, setCanShowGradient, setCommandWidth, setIsOverflowing, } = context;
112
115
  const { ref: measureRef } = useSize({
113
116
  onResize: ({ width }) => setCommandWidth(width),
@@ -131,46 +134,69 @@ export function CommandPromptViewport({ className, children, }) {
131
134
  .filter((child) => typeof child === "string" || typeof child === "number")
132
135
  .join("");
133
136
  const copyValue = activeItem?.copyValue ?? fallbackCopyValue;
134
- // biome-ignore lint/correctness/useExhaustiveDependencies: copyValue must reset the overflow/gradient state when the active command changes.
137
+ const previousCommandRef = useRef(null);
138
+ const [mountCopyValue] = useState(copyValue);
139
+ const [animateEnter, setAnimateEnter] = useState(false);
140
+ if (!animateEnter && copyValue !== mountCopyValue) {
141
+ setAnimateEnter(true);
142
+ }
135
143
  useLayoutEffect(() => {
144
+ const previousCommand = previousCommandRef.current;
145
+ previousCommandRef.current = { copyValue, width: commandWidth };
146
+ if (previousCommand?.copyValue === copyValue) {
147
+ return;
148
+ }
136
149
  setIsOverflowing(false);
137
- setCanShowGradient(Boolean(shouldReduceMotion));
138
- }, [copyValue, setCanShowGradient, setIsOverflowing, shouldReduceMotion]);
150
+ // Equal-width commands keep the current gate, including an in-flight transition.
151
+ if (measureRef.current?.getBoundingClientRect().width !==
152
+ previousCommand?.width) {
153
+ setCanShowGradient(false);
154
+ }
155
+ }, [
156
+ commandWidth,
157
+ copyValue,
158
+ measureRef,
159
+ setCanShowGradient,
160
+ setIsOverflowing,
161
+ ]);
162
+ useEffect(() => {
163
+ const viewport = viewportRef.current;
164
+ if (commandWidth === undefined || !viewport) {
165
+ return;
166
+ }
167
+ return observeWidthTransition(viewport, () => {
168
+ // Layout effects record a newer width before passive-effect cleanup runs.
169
+ if (previousCommandRef.current?.width === commandWidth) {
170
+ setCanShowGradient(true);
171
+ }
172
+ });
173
+ }, [commandWidth, setCanShowGradient]);
139
174
  useEffect(() => {
140
175
  setActiveCopyValue(copyValue);
141
176
  return () => {
142
177
  setIsOverflowing(false);
143
178
  };
144
179
  }, [copyValue, setActiveCopyValue, setIsOverflowing]);
145
- return (_jsxs(motion.span, { animate: commandWidth === undefined
146
- ? undefined
147
- : { width: shouldReduceMotion ? "auto" : commandWidth }, className: cn("relative block min-w-0 overflow-hidden text-gray-1000 text-label-14-mono!", className), initial: false, onAnimationComplete: () => {
148
- setCanShowGradient(true);
149
- }, transition: shouldReduceMotion
150
- ? { duration: 0 }
151
- : { type: "spring", bounce: 0, duration: 0.4 }, children: [_jsx("span", { "aria-hidden": true, className: "pointer-events-none invisible absolute whitespace-nowrap", ref: measureRef, children: command }), _jsx(AnimatePresence, { initial: false, mode: "wait", children: Children.toArray(children).map((child) => {
152
- if (!isValidElement(child)) {
153
- return null;
154
- }
155
- if (child.props.value !== context.value) {
156
- return null;
180
+ return (_jsxs("span", { className: cn("relative block min-w-0 overflow-hidden text-gray-1000 text-label-14-mono! transition-[width] duration-400 motion-reduce:w-auto! motion-reduce:transition-none", className), ref: viewportRef, style: {
181
+ width: commandWidth,
182
+ transitionTimingFunction: WIDTH_SPRING_EASING,
183
+ }, children: [_jsx("span", { "aria-hidden": true, className: "pointer-events-none invisible absolute whitespace-nowrap", ref: measureRef, children: command }), activeItem && (_jsx("span", { className: cn("block min-w-0 whitespace-nowrap py-2", animateEnter &&
184
+ "fade-in animate-in blur-in-1 duration-150 ease-[ease-out] motion-reduce:animate-none", canShowGradient && isOverflowing
185
+ ? "overflow-x-auto"
186
+ : "overflow-x-hidden", activeItem.className), ref: (element) => {
187
+ activeContentRef.current = element;
188
+ if (element) {
189
+ setIsOverflowing(element.scrollWidth > element.clientWidth);
157
190
  }
158
- return (_jsx(motion.span, { animate: { opacity: 1, filter: "blur(0px)" }, className: cn("block min-w-0 whitespace-nowrap py-2", canShowGradient && isOverflowing
159
- ? "overflow-x-auto"
160
- : "overflow-x-hidden", child.props.className), exit: { opacity: 0, filter: "blur(1px)" }, initial: { opacity: 0, filter: "blur(1px)" }, ref: (element) => {
161
- activeContentRef.current = element;
162
- if (element) {
163
- setIsOverflowing(element.scrollWidth > element.clientWidth);
164
- }
165
- }, transition: shouldReduceMotion ? { duration: 0 } : { duration: 0.15 }, children: child.props.children }, copyValue));
166
- }) }), _jsx(AnimatePresence, { children: canShowGradient && isOverflowing && (_jsx(motion.span, { animate: { opacity: 1 }, "aria-hidden": true, className: "pointer-events-none absolute top-0 right-0 bottom-0 z-10 block w-4 bg-gradient-to-r from-transparent to-background-100", exit: { opacity: 0 }, initial: { opacity: 0 }, transition: shouldReduceMotion ? { duration: 0 } : { duration: 0.2 } })) })] }));
191
+ }, children: activeItem.children }, copyValue)), _jsx("span", { "aria-hidden": true, className: cn("pointer-events-none absolute top-0 right-0 bottom-0 z-10 block w-4 bg-gradient-to-r from-transparent to-background-100 transition-opacity duration-200 ease-[ease-out] motion-reduce:transition-none", canShowGradient && isOverflowing ? "opacity-100" : "opacity-0") })] }));
167
192
  }
168
193
  export function CommandPromptContent(_props) {
169
194
  return null;
170
195
  }
196
+ const iconClassName = "absolute inset-0 flex items-center justify-center transition-[opacity,scale,filter] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none";
197
+ const hiddenIconClassName = "scale-50 opacity-0 blur-[1px]";
171
198
  export function CommandPromptCopy({ className, onClick, ...props }) {
172
199
  const context = useCommandPromptContext("CommandPrompt.Copy");
173
- const shouldReduceMotion = useReducedMotion();
174
200
  return (_jsxs("button", { "aria-label": context.copied ? "Copied" : "Copy command", className: cn("relative flex size-8 shrink-0 translate-x-0.5 cursor-pointer items-center justify-center rounded-full border-none bg-transparent text-gray-1000", "hover:!bg-gray-alpha-200 touch-manipulation transition-colors group-hover:bg-gray-alpha-100", "outline-2 outline-transparent outline-offset-2 focus-visible:outline-[var(--ds-focus-color)]", className), onClick: (event) => {
175
201
  onClick?.(event);
176
202
  if (event.defaultPrevented) {
@@ -178,33 +204,5 @@ export function CommandPromptCopy({ className, onClick, ...props }) {
178
204
  }
179
205
  event.stopPropagation();
180
206
  context.copyActiveValue();
181
- }, type: "button", ...props, children: [_jsx(AnimatePresence, { initial: false, children: !context.copied && (_jsx(motion.span, { animate: {
182
- opacity: 1,
183
- transform: "scale(1)",
184
- filter: "blur(0px)",
185
- }, className: "absolute inset-0 flex items-center justify-center", exit: {
186
- opacity: 0,
187
- transform: "scale(0.5)",
188
- filter: "blur(1px)",
189
- }, initial: {
190
- opacity: 0,
191
- transform: "scale(0.5)",
192
- filter: "blur(1px)",
193
- }, transition: shouldReduceMotion
194
- ? { duration: 0 }
195
- : { duration: 0.2, ease: [0.23, 1, 0.32, 1] }, children: _jsx(IconCopy, { className: "block", size: 16 }) }, "copy")) }), _jsx(AnimatePresence, { initial: false, children: context.copied && (_jsx(motion.span, { animate: {
196
- opacity: 1,
197
- transform: "scale(1)",
198
- filter: "blur(0px)",
199
- }, className: "absolute inset-0 flex items-center justify-center", exit: {
200
- opacity: 0,
201
- transform: "scale(0.5)",
202
- filter: "blur(1px)",
203
- }, initial: {
204
- opacity: 0,
205
- transform: "scale(0.5)",
206
- filter: "blur(1px)",
207
- }, transition: shouldReduceMotion
208
- ? { duration: 0 }
209
- : { duration: 0.2, ease: [0.23, 1, 0.32, 1] }, children: _jsx(IconCheck, { className: "block", size: 16 }) }, "check")) })] }));
207
+ }, type: "button", ...props, children: [_jsx("span", { className: cn(iconClassName, context.copied && hiddenIconClassName), children: _jsx(IconCopy, { className: "block", size: 16 }) }), _jsx("span", { className: cn(iconClassName, !context.copied && hiddenIconClassName), children: _jsx(IconCheck, { className: "block", size: 16 }) })] }));
210
208
  }
@@ -1,41 +1,4 @@
1
- import { type ReactNode } from "react";
2
- import { type GeistdocsChatController } from "./internal/chat/context";
3
- export type { GeistdocsChatController, GeistdocsChatPage, } from "./internal/chat/context";
4
- /**
5
- * Control the Ask AI chat from custom components rendered inside
6
- * `GeistdocsProvider`.
7
- */
8
- export declare const useGeistdocsChat: () => GeistdocsChatController;
9
- interface SearchButtonProps {
10
- className?: string;
11
- onClick?: () => void;
12
- }
13
- export declare const SearchButton: ({ className, onClick }: SearchButtonProps) => import("react/jsx-runtime").JSX.Element;
14
- export declare const ThemeToggle: () => import("react/jsx-runtime").JSX.Element;
15
- export declare const LanguageSelector: () => import("react/jsx-runtime").JSX.Element | null;
16
- interface AskAIButtonProps {
17
- children?: ReactNode;
18
- className?: string;
19
- disabled?: boolean;
20
- prompt?: string;
21
- size?: "tiny" | "small" | "medium" | "large" | null;
22
- variant?: "default" | "secondary" | "tertiary";
23
- }
24
- export declare const AskAIButton: ({ children, className, prompt, size, variant, ...props }: AskAIButtonProps) => import("react/jsx-runtime").JSX.Element | null;
25
- export interface AskAIUserProps {
26
- /**
27
- * The reader's avatar. Only `http(s)` URLs and root-relative paths are
28
- * rendered; other values are ignored. `null` is accepted for auth session
29
- * fields that may be empty.
30
- */
31
- avatarUrl?: string | null;
32
- /** The reader's name, used as the avatar's alt text. */
33
- name?: string | null;
34
- }
35
- /**
36
- * Identify the signed-in reader to Ask AI. Renders nothing; while mounted
37
- * with an `avatarUrl`, the reader's avatar appears beside their chat
38
- * messages. Unmount it, or pass no `avatarUrl`, to clear the reader.
39
- */
40
- export declare const AskAIUser: ({ avatarUrl, name }: AskAIUserProps) => null;
1
+ export type { AskAIUserProps, GeistdocsChatController, GeistdocsChatPage, } from "./internal/controls-client";
2
+ export { AskAIButton, AskAIUser, SearchButton, ThemeToggle, useGeistdocsChat, } from "./internal/controls-client";
3
+ export { LanguageSelector } from "./internal/language-selector";
41
4
  //# sourceMappingURL=controls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAC;AAWrE,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,yBAAyB,CAAC;AAQjC,YAAY,EACV,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAO,uBAwBnC,CAAC;AAEF,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,GAAI,wBAAwB,iBAAiB,4CAqBrE,CAAC;AAEF,eAAO,MAAM,WAAW,+CA0CvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDA+B5B,CAAC;AAEF,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;IACpD,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;CAChD;AAED,eAAO,MAAM,WAAW,GAAI,0DAOzB,gBAAgB,mDAgClB,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,qBAAqB,cAAc,SAc5D,CAAC"}
1
+ {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.tsx"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,WAAW,EACX,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC"}
package/dist/controls.js CHANGED
@@ -1,96 +1,5 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useI18n } from "fumadocs-ui/contexts/i18n";
4
- import { useSearchContext } from "fumadocs-ui/contexts/search";
5
- import { useEffect, useMemo, useState } from "react";
6
- import { IconCheck, IconLanguages, IconMoon, IconSun, } from "#geistdocs-assets/icons";
7
- import { Button } from "#geistdocs-ui/components/button";
8
- import { Kbd } from "#geistdocs-ui/components/kbd";
9
- import { useTheme } from "#geistdocs-ui/core";
10
- import { cn } from "#geistdocs-ui/utils";
11
- import { useGeistdocsChatContext, } from "./internal/chat/context";
12
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "./internal/ui/dropdown-menu";
13
- /**
14
- * Control the Ask AI chat from custom components rendered inside
15
- * `GeistdocsProvider`.
16
- */
17
- export const useGeistdocsChat = () => {
18
- const { ask, enabled, isOpen, openWithPage, setIsOpen } = useGeistdocsChatContext();
19
- return useMemo(() => ({
20
- ask,
21
- close: () => setIsOpen(false),
22
- enabled,
23
- isOpen,
24
- open: () => {
25
- if (enabled) {
26
- setIsOpen(true);
27
- }
28
- },
29
- openWithPage,
30
- toggle: () => {
31
- if (enabled) {
32
- setIsOpen((open) => !open);
33
- }
34
- },
35
- }), [ask, enabled, isOpen, openWithPage, setIsOpen]);
36
- };
37
- export const SearchButton = ({ className, onClick }) => {
38
- const { setOpenSearch } = useSearchContext();
39
- return (_jsxs("button", { className: cn("flex h-8 cursor-pointer items-center justify-between rounded-md border-0 bg-background-100 py-0 pr-1.5 pl-3.5 font-normal font-sans text-gray-1000 text-sm shadow-[0_0_0_1px_var(--ds-gray-400)] outline-none hover:bg-gray-100 focus-visible:shadow-[var(--ds-focus-ring)]", className), onClick: () => {
40
- setOpenSearch(true);
41
- onClick?.();
42
- }, type: "button", children: [_jsx("span", { className: "pr-6", children: "Search\u2026" }), _jsx(Kbd, { className: "inline-flex items-center justify-center rounded", small: true, children: "\u2318K" })] }));
43
- };
44
- export const ThemeToggle = () => {
45
- const { resolvedTheme, setTheme } = useTheme();
46
- const [mounted, setMounted] = useState(false);
47
- useEffect(() => {
48
- setMounted(true);
49
- }, []);
50
- if (!mounted) {
51
- return (_jsx(Button, { "aria-label": "Toggle Theme", shape: "square", size: "small", svgOnly: true, type: "unstyled", typeName: "button", children: _jsx("div", { className: "size-4" }) }));
52
- }
53
- const Icon = resolvedTheme === "dark" ? IconMoon : IconSun;
54
- return (_jsx(Button, { "aria-label": resolvedTheme === "dark"
55
- ? "Switch to Light Theme"
56
- : "Switch to Dark Theme", onClick: () => setTheme(resolvedTheme === "dark" ? "light" : "dark"), shape: "square", size: "small", svgOnly: true, type: "unstyled", typeName: "button", children: _jsx(Icon, { className: "size-4" }) }));
57
- };
58
- export const LanguageSelector = () => {
59
- const { locale, locales, onChange } = useI18n();
60
- if (!locales) {
61
- return null;
62
- }
63
- return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { "aria-label": "Select Language", className: "flex items-center justify-center rounded-md p-2 hover:bg-gray-alpha-100 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none active:bg-gray-alpha-300", children: [_jsx(IconLanguages, { className: "size-4.5" }), _jsx("span", { className: "sr-only", children: "Select Language" })] }), _jsx(DropdownMenuContent, { align: "end", children: locales.map((lang) => (_jsxs(DropdownMenuItem, { className: "flex cursor-pointer items-center justify-between", disabled: locale === lang.locale, onClick: () => onChange?.(lang.locale), children: [lang.name, locale === lang.locale && _jsx(IconCheck, { className: "size-4" })] }, lang.locale))) })] }));
64
- };
65
- export const AskAIButton = ({ children, className, prompt, size = "small", variant = "secondary", ...props }) => {
66
- const { enabled, isOpen, preloadChat, setIsOpen, setPrompt } = useGeistdocsChatContext();
67
- if (!enabled) {
68
- return null;
69
- }
70
- return (_jsx(Button, { className: cn("shrink-0", className), "data-geistdocs-ask-ai": "", onClick: () => {
71
- preloadChat();
72
- if (prompt) {
73
- setPrompt(prompt);
74
- setIsOpen(true);
75
- return;
76
- }
77
- setIsOpen(!isOpen);
78
- }, onFocus: preloadChat, onMouseEnter: preloadChat, size: size, typeName: "button", variant: variant, ...props, children: children ?? _jsx("span", { children: "Ask AI" }) }));
79
- };
80
- /**
81
- * Identify the signed-in reader to Ask AI. Renders nothing; while mounted
82
- * with an `avatarUrl`, the reader's avatar appears beside their chat
83
- * messages. Unmount it, or pass no `avatarUrl`, to clear the reader.
84
- */
85
- export const AskAIUser = ({ avatarUrl, name }) => {
86
- const { setUser } = useGeistdocsChatContext();
87
- useEffect(() => {
88
- if (!avatarUrl) {
89
- setUser(null);
90
- return;
91
- }
92
- setUser({ avatarUrl, name: name ?? undefined });
93
- return () => setUser(null);
94
- }, [avatarUrl, name, setUser]);
95
- return null;
96
- };
1
+ // Keep the public API server-neutral; client boundaries live on the concrete
2
+ // modules so importing search/chat controls does not include the language menu.
3
+ // biome-ignore lint/performance/noBarrelFile: preserve the public controls entrypoint while separating its client modules.
4
+ export { AskAIButton, AskAIUser, SearchButton, ThemeToggle, useGeistdocsChat, } from "./internal/controls-client";
5
+ export { LanguageSelector } from "./internal/language-selector";
@@ -0,0 +1,10 @@
1
+ export interface ChatRateLimitOptions {
2
+ /**
3
+ * Published Vercel Firewall SDK rate limit IDs to check per request.
4
+ * Must contain at least one non-empty ID. Every check must pass.
5
+ * Limits and counting windows are configured in the site's Vercel project.
6
+ */
7
+ ids: string[];
8
+ }
9
+ export declare const createChatRateLimiter: (options?: ChatRateLimitOptions) => ((request: Request) => Promise<Response | undefined>) | undefined;
10
+ //# sourceMappingURL=chat-rate-limit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-rate-limit.d.ts","sourceRoot":"","sources":["../../src/internal/chat-rate-limit.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,GAAG,EAAE,MAAM,EAAE,CAAC;CACf;AAED,eAAO,MAAM,qBAAqB,GAAI,UAAU,oBAAoB,gBAmB3C,OAAO,KAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,aA4B/D,CAAC"}
@@ -0,0 +1,35 @@
1
+ export const createChatRateLimiter = (options) => {
2
+ if (options === undefined) {
3
+ return;
4
+ }
5
+ if (!(options && Array.isArray(options.ids)) ||
6
+ options.ids.length === 0 ||
7
+ !options.ids.every((id) => typeof id === "string" && id.trim().length > 0)) {
8
+ throw new Error("createChatRoute rateLimit.ids must be a non-empty array of non-empty strings.");
9
+ }
10
+ // Snapshot and deduplicate IDs so configuration changes cannot bypass checks
11
+ // or cause the same request to consume one bucket more than once.
12
+ const ids = [...new Set(options.ids)];
13
+ return async (request) => {
14
+ try {
15
+ const { checkRateLimit } = await import("@vercel/firewall");
16
+ const results = await Promise.all(ids.map((id) => checkRateLimit(id, { request, timeout: 1000 })));
17
+ if (results.some(({ rateLimited }) => rateLimited)) {
18
+ return new Response("Too many chat requests. Please try again later.", {
19
+ status: 429,
20
+ headers: { "Cache-Control": "no-store" },
21
+ });
22
+ }
23
+ if (results.some(({ error }) => error)) {
24
+ throw new Error("Ask AI firewall rate limit rules are not configured");
25
+ }
26
+ }
27
+ catch (error) {
28
+ console.error("Ask AI rate limit check failed:", error);
29
+ return new Response("Chat is temporarily unavailable. Please try again later.", {
30
+ status: 503,
31
+ headers: { "Cache-Control": "no-store" },
32
+ });
33
+ }
34
+ };
35
+ };
@@ -0,0 +1,2 @@
1
+ export declare const observeWidthTransition: (element: HTMLElement, onSettled: () => void) => () => void;
2
+ //# sourceMappingURL=command-prompt-transition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-prompt-transition.d.ts","sourceRoot":"","sources":["../../src/internal/command-prompt-transition.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,GACjC,SAAS,WAAW,EACpB,WAAW,MAAM,IAAI,eAyBtB,CAAC"}
@@ -0,0 +1,17 @@
1
+ export const observeWidthTransition = (element, onSettled) => {
2
+ let active = true;
3
+ const transitions = element
4
+ .getAnimations()
5
+ .filter((animation) => "transitionProperty" in animation &&
6
+ animation.transitionProperty === "width");
7
+ const settle = () => {
8
+ if (active) {
9
+ onSettled();
10
+ }
11
+ };
12
+ // Reduced motion can cancel a transition without starting a replacement.
13
+ Promise.all(transitions.map((transition) => transition.finished)).then(settle, settle);
14
+ return () => {
15
+ active = false;
16
+ };
17
+ };
@@ -0,0 +1,40 @@
1
+ import { type ReactNode } from "react";
2
+ import { type GeistdocsChatController } from "./chat/context";
3
+ export type { GeistdocsChatController, GeistdocsChatPage, } from "./chat/context";
4
+ /**
5
+ * Control the Ask AI chat from custom components rendered inside
6
+ * `GeistdocsProvider`.
7
+ */
8
+ export declare const useGeistdocsChat: () => GeistdocsChatController;
9
+ interface SearchButtonProps {
10
+ className?: string;
11
+ onClick?: () => void;
12
+ }
13
+ export declare const SearchButton: ({ className, onClick }: SearchButtonProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const ThemeToggle: () => import("react/jsx-runtime").JSX.Element;
15
+ interface AskAIButtonProps {
16
+ children?: ReactNode;
17
+ className?: string;
18
+ disabled?: boolean;
19
+ prompt?: string;
20
+ size?: "tiny" | "small" | "medium" | "large" | null;
21
+ variant?: "default" | "secondary" | "tertiary";
22
+ }
23
+ export declare const AskAIButton: ({ children, className, prompt, size, variant, ...props }: AskAIButtonProps) => import("react/jsx-runtime").JSX.Element | null;
24
+ export interface AskAIUserProps {
25
+ /**
26
+ * The reader's avatar. Only `http(s)` URLs and root-relative paths are
27
+ * rendered; other values are ignored. `null` is accepted for auth session
28
+ * fields that may be empty.
29
+ */
30
+ avatarUrl?: string | null;
31
+ /** The reader's name, used as the avatar's alt text. */
32
+ name?: string | null;
33
+ }
34
+ /**
35
+ * Identify the signed-in reader to Ask AI. Renders nothing; while mounted
36
+ * with an `avatarUrl`, the reader's avatar appears beside their chat
37
+ * messages. Unmount it, or pass no `avatarUrl`, to clear the reader.
38
+ */
39
+ export declare const AskAIUser: ({ avatarUrl, name }: AskAIUserProps) => null;
40
+ //# sourceMappingURL=controls-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controls-client.d.ts","sourceRoot":"","sources":["../../src/internal/controls-client.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAC;AAMrE,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAO,uBAwBnC,CAAC;AAEF,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,GAAI,wBAAwB,iBAAiB,4CAqBrE,CAAC;AAEF,eAAO,MAAM,WAAW,+CA0CvB,CAAC;AAEF,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;IACpD,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;CAChD;AAED,eAAO,MAAM,WAAW,GAAI,0DAOzB,gBAAgB,mDAgClB,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,qBAAqB,cAAc,SAc5D,CAAC"}