boltdocs 2.4.1 → 2.5.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 (113) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cache-3FOEPC2P.mjs +1 -0
  3. package/dist/chunk-ITFGVXPE.mjs +1 -0
  4. package/dist/chunk-TP5KMRD3.mjs +1 -0
  5. package/dist/chunk-UD2LQG2M.mjs +75 -0
  6. package/dist/chunk-Y4RE5KI7.mjs +1 -0
  7. package/dist/client/index.d.mts +1225 -14
  8. package/dist/client/index.d.ts +1225 -14
  9. package/dist/client/index.js +1 -1
  10. package/dist/client/index.mjs +1 -1
  11. package/dist/client/ssr.js +1 -1
  12. package/dist/client/ssr.mjs +1 -1
  13. package/dist/node/cli-entry.js +37 -35
  14. package/dist/node/cli-entry.mjs +1 -1
  15. package/dist/node/index.d.mts +263 -1
  16. package/dist/node/index.d.ts +263 -1
  17. package/dist/node/index.js +34 -32
  18. package/dist/node/index.mjs +1 -1
  19. package/dist/package-TWC3BMZ7.mjs +1 -0
  20. package/dist/search-dialog-YBM4GYDR.mjs +1 -0
  21. package/package.json +46 -76
  22. package/src/client/components/primitives/breadcrumbs.tsx +10 -10
  23. package/src/client/components/primitives/index.ts +17 -16
  24. package/src/client/components/primitives/menu.tsx +11 -14
  25. package/src/client/components/primitives/navbar.tsx +29 -29
  26. package/src/client/components/primitives/navigation-menu.tsx +7 -9
  27. package/src/client/components/primitives/on-this-page.tsx +16 -18
  28. package/src/client/components/primitives/page-nav.tsx +10 -13
  29. package/src/client/components/primitives/search-dialog.tsx +17 -19
  30. package/src/client/components/primitives/sidebar.tsx +8 -10
  31. package/src/client/components/primitives/tabs.tsx +10 -12
  32. package/src/client/components/primitives/tooltip.tsx +3 -5
  33. package/src/client/components/ui-base/breadcrumbs.tsx +12 -15
  34. package/src/client/components/ui-base/copy-markdown.tsx +8 -10
  35. package/src/client/components/ui-base/navbar.tsx +10 -10
  36. package/src/client/components/ui-base/on-this-page.tsx +13 -12
  37. package/src/client/components/ui-base/page-nav.tsx +15 -15
  38. package/src/client/components/ui-base/search-dialog.tsx +13 -20
  39. package/src/client/components/ui-base/sidebar.tsx +9 -9
  40. package/src/client/components/ui-base/tabs.tsx +6 -7
  41. package/src/client/components/ui-base/theme-toggle.tsx +11 -11
  42. package/src/client/hooks/index.ts +12 -12
  43. package/src/client/index.ts +34 -11
  44. package/src/node/config.ts +48 -6
  45. package/src/node/errors.ts +44 -0
  46. package/src/node/index.ts +29 -2
  47. package/src/node/mdx/index.ts +9 -2
  48. package/src/node/plugin/index.ts +72 -4
  49. package/src/node/plugins/index.ts +17 -0
  50. package/src/node/plugins/plugin-errors.ts +62 -0
  51. package/src/node/plugins/plugin-lifecycle.ts +117 -0
  52. package/src/node/plugins/plugin-sandbox.ts +59 -0
  53. package/src/node/plugins/plugin-store.ts +54 -0
  54. package/src/node/plugins/plugin-types.ts +107 -0
  55. package/src/node/plugins/plugin-validator.ts +105 -0
  56. package/src/node/routes/parser.ts +35 -5
  57. package/src/node/schema/config.ts +208 -0
  58. package/src/node/schema/frontmatter.ts +17 -0
  59. package/src/node/security/constants/index.ts +10 -0
  60. package/src/node/security/csp.ts +31 -0
  61. package/src/node/security/headers.ts +27 -0
  62. package/src/node/utils.ts +153 -5
  63. package/tsup.config.ts +0 -6
  64. package/dist/base-ui/index.d.mts +0 -25
  65. package/dist/base-ui/index.d.ts +0 -25
  66. package/dist/base-ui/index.js +0 -1
  67. package/dist/base-ui/index.mjs +0 -1
  68. package/dist/cache-P6WK424C.mjs +0 -1
  69. package/dist/chunk-2DI3OGHV.mjs +0 -1
  70. package/dist/chunk-2Z5T6EAU.mjs +0 -1
  71. package/dist/chunk-64AJ5QLT.mjs +0 -1
  72. package/dist/chunk-DDX52BX4.mjs +0 -1
  73. package/dist/chunk-HRZDSFR5.mjs +0 -1
  74. package/dist/chunk-JD3RSDE4.mjs +0 -1
  75. package/dist/chunk-JZXLCA2E.mjs +0 -1
  76. package/dist/chunk-NBCYHLAA.mjs +0 -1
  77. package/dist/chunk-PPVDMDEL.mjs +0 -1
  78. package/dist/chunk-T3W44KWY.mjs +0 -1
  79. package/dist/chunk-UBE4CKOA.mjs +0 -1
  80. package/dist/chunk-UWT4AJTH.mjs +0 -73
  81. package/dist/chunk-WWJ7WKDI.mjs +0 -1
  82. package/dist/chunk-Y4RRHPXC.mjs +0 -1
  83. package/dist/client/types.d.mts +0 -3
  84. package/dist/client/types.d.ts +0 -3
  85. package/dist/client/types.js +0 -1
  86. package/dist/client/types.mjs +0 -0
  87. package/dist/copy-markdown--9yjpbyy.d.mts +0 -15
  88. package/dist/copy-markdown-l2MYkcG7.d.ts +0 -15
  89. package/dist/hooks/index.d.mts +0 -137
  90. package/dist/hooks/index.d.ts +0 -137
  91. package/dist/hooks/index.js +0 -1
  92. package/dist/hooks/index.mjs +0 -1
  93. package/dist/integrations/index.d.mts +0 -48
  94. package/dist/integrations/index.d.ts +0 -48
  95. package/dist/integrations/index.js +0 -1
  96. package/dist/integrations/index.mjs +0 -1
  97. package/dist/link-DfBwCeZc.d.mts +0 -68
  98. package/dist/link-DfBwCeZc.d.ts +0 -68
  99. package/dist/loading-BwUos0wZ.d.mts +0 -57
  100. package/dist/loading-nlnUD01v.d.ts +0 -57
  101. package/dist/mdx/index.d.mts +0 -178
  102. package/dist/mdx/index.d.ts +0 -178
  103. package/dist/mdx/index.js +0 -1
  104. package/dist/mdx/index.mjs +0 -1
  105. package/dist/primitives/index.d.mts +0 -292
  106. package/dist/primitives/index.d.ts +0 -292
  107. package/dist/primitives/index.js +0 -1
  108. package/dist/primitives/index.mjs +0 -1
  109. package/dist/search-dialog-OONKKC5H.mjs +0 -1
  110. package/dist/types-opDA2E9-.d.mts +0 -394
  111. package/dist/types-opDA2E9-.d.ts +0 -394
  112. package/dist/use-routes-DNwgTRpU.d.ts +0 -29
  113. package/dist/use-routes-DrT80Eom.d.mts +0 -29
@@ -1,73 +0,0 @@
1
- import{a as P,d as g,e as R,f as q,g as J,h as vt,i as Pt,j as H,k as rt,l as wt,m as G,n as st,o as N,p as at,q as I,r as $t,s as Ct,v as Bt}from"./chunk-Y4RRHPXC.mjs";function lt(){_.invalidateAll()}function ct(i){_.invalidate(i)}var _,kt=P(()=>{"use strict";g();Bt();_=new $t({name:"routes"})});import A from"path";import pe from"github-slugger";function St(i,n,e,d){let o=decodeURIComponent(i),s=A.resolve(o),c=A.resolve(n),m=R(A.relative(c,s));if(m.startsWith("../")||m===".."||s.includes("\0"))throw new Error(`Security breach: File is outside of docs directory or contains null bytes: ${i}`);let{data:t,content:a}=Pt(i),l=m.split("/"),u,b;if(d?.versions&&l.length>0){let M=l[0],it=d.versions.prefix||"",W=d.versions.versions.find(E=>{let nt=it+E.path;return M===nt||M===E.path});W&&(b=W.path,l=l.slice(1))}if(d?.i18n&&l.length>0){let M=l[0];d.i18n.locales[M]&&(u=M,l=l.slice(1))}let C;if(l.length>0){let M=l[0].match(/^\((.+)\)$/);M&&(C=M[1].toLowerCase(),l=l.slice(1))}let v=l.join("/"),p;t.permalink?p=t.permalink.startsWith("/")?t.permalink:`/${t.permalink}`:p=wt(v||"index.md");let r=e;b&&(r+="/"+b),u&&(r+="/"+u),C&&(r+="/"+C),r+=p==="/"?"":p,(!r||r==="")&&(r="/");let y=l[l.length-1],f=q(y),x=q(A.basename(i,A.extname(i))),B=t.sidebarPosition??J(y),h=l.length>=2?l[0]:void 0,S=h?q(h):void 0,k=l.length>=2&&/^index\.mdx?$/.test(f),V=new pe,xt=[],ae=/^(#{2,4})\s+(.+)$/gm;for(let M of a.matchAll(ae)){let it=M[1].length,W=M[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").trim(),E=G(W).trim(),nt=V.slug(E);xt.push({level:it,text:E,id:nt})}let le=t.title?G(String(t.title)):x,ot=t.description?G(String(t.description)):"";!ot&&a&&(ot=st(a.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").replace(/\s+/g," ")).trim().slice(0,160));let ce=t.badge?G(String(t.badge)):void 0,bt=t.icon?String(t.icon):void 0,de=me(a);return{route:{path:r,componentPath:i,filePath:m,title:le,description:ot,sidebarPosition:B,headings:xt,locale:u,version:b,badge:ce,icon:bt,tab:C,_content:de,_rawContent:a},relativeDir:S,isGroupIndex:k,inferredTab:C,groupMeta:k?{title:t.groupTitle||t.title||(S?N(S):""),position:t.groupPosition??t.sidebarPosition??(h?J(h):void 0),icon:bt}:void 0,inferredGroupPosition:h?J(h):void 0}}function me(i){let n=i.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/\{[^\}]+\}/g,"").replace(/[_*`]/g,"").replace(/\s+/g," ");return st(n).trim()}var Mt=P(()=>{"use strict";g();I()});function Dt(i){return i.sort((n,e)=>!n.group&&!e.group?Rt(n,e):n.group?e.group?n.group!==e.group?ue(n,e):Rt(n,e):1:-1)}function Rt(i,n){return i.sidebarPosition!==void 0&&n.sidebarPosition!==void 0?i.sidebarPosition-n.sidebarPosition:i.sidebarPosition!==void 0?-1:n.sidebarPosition!==void 0?1:i.title.localeCompare(n.title)}function ue(i,n){return i.groupPosition!==void 0&&n.groupPosition!==void 0?i.groupPosition-n.groupPosition:i.groupPosition!==void 0?-1:n.groupPosition!==void 0?1:(i.groupTitle||i.group).localeCompare(n.groupTitle||n.group)}var _t=P(()=>{"use strict";g()});import ge from"fast-glob";async function L(i,n,e="/docs",d=!0){let o=performance.now();_.load(),U.clear(),(process.env.BOLTDOCS_FORCE_REPARSE==="true"||n?.i18n)&&_.invalidateAll();let s;!d&&dt?s=dt:(s=await ge(["**/*.md","**/*.mdx"],{cwd:i,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1}),dt=s),_.pruneStale(new Set(s));let c=50,m=[],t=0;for(let p=0;p<s.length;p+=c){let r=s.slice(p,p+c),y=await Promise.all(r.map(async f=>{let x=_.get(f);if(x)return t++,x;let B=St(f,i,e,n);return _.set(f,B),B}));m.push(...y),p+c<s.length&&await new Promise(f=>setImmediate(f))}_.save();let a=new Map,l=[];for(let p of m)if(p.isGroupIndex&&p.relativeDir&&l.push(p),p.relativeDir){let r=a.get(p.relativeDir);r?(r.position===void 0&&p.inferredGroupPosition!==void 0&&(r.position=p.inferredGroupPosition),!r.icon&&p.route.icon&&(r.icon=p.route.icon)):(r={title:N(p.relativeDir),position:p.inferredGroupPosition,icon:p.route.icon},a.set(p.relativeDir,r))}for(let p of l){let r=a.get(p.relativeDir);p.groupMeta&&(r.title=p.groupMeta.title,p.groupMeta.position!==void 0&&(r.position=p.groupMeta.position),p.groupMeta.icon&&(r.icon=p.groupMeta.icon))}let u=new Array(m.length);for(let p=0;p<m.length;p++){let r=m[p],y=r.relativeDir,f=y?a.get(y):void 0;u[p]={...r.route,group:y,groupTitle:f?.title||(y?N(y):void 0),groupPosition:f?.position,groupIcon:f?.icon}}let b=u;if(n?.i18n){let p=fe(u,n,e);b=[...u,...p]}let C=Dt(b),v=performance.now()-o;return console.log(`[boltdocs] Route generation: ${v.toFixed(2)}ms (${s.length} files, ${t} cache hits)`),C}function fe(i,n,e){let d=n.i18n.defaultLocale,o=Object.keys(n.i18n.locales),s=[],c=new Map,m=[];for(let t of i){let a=t.locale||d;c.has(a)||c.set(a,new Set),c.get(a).add(t.path),a===d&&m.push(t)}for(let t of o){let a=c.get(t)||new Set;for(let l of m){let u=he(l.path,d,t,e,n);u!==l.path&&(a.has(u)||s.push({...l,path:u,locale:t}))}}return s}function he(i,n,e,d,o){let s=`${i}:${e}`,c=U.get(s);if(c)return c;let m=d;if(o?.versions){let u=o.versions.prefix||"";for(let b of o.versions.versions){let C=u+b.path;if(i.startsWith(`${d}/${C}`)){m+="/"+C;break}if(i.startsWith(`${d}/${b.path}`)){m+="/"+b.path;break}}}let t=i.substring(m.length),a=`/${n}`;if(t.startsWith(a+"/"))t="/"+e+"/"+t.substring(a.length+1);else if(t===a)t="/"+e;else if(t==="/"||t==="")t="/"+e;else{let u=t.startsWith("/")?"":"/";t="/"+e+u+t}let l=m+t;return U.size>2e3&&U.clear(),U.set(s,l),l}var dt,U,pt=P(()=>{"use strict";g();I();kt();Mt();_t();dt=null,U=new Map});import mt from"path";import ye from"fs";import{loadConfigFromFile as xe}from"vite";function be(i){return i}async function F(i,n=process.cwd()){let e=n,d={docsDir:mt.resolve(i),theme:{title:"Boltdocs",description:"A Vite documentation framework",navbar:[{label:"Home",href:"/"},{label:"Documentation",href:"/docs"}],codeTheme:{light:"github-light",dark:"github-dark"},poweredBy:!0,breadcrumbs:!0}},o={};for(let t of X){let a=mt.resolve(e,t);if(ye.existsSync(a))try{let l=await xe({command:"serve",mode:"development"},a,e);if(l){o=l.config;break}}catch(l){console.warn(`[boltdocs] Failed to load config from ${t}:`,l)}}let c={...{title:o.title,description:o.description,logo:o.logo,favicon:o.favicon,ogImage:o.ogImage,navbar:o.navbar,sidebar:o.sidebar,socialLinks:o.socialLinks,footer:o.footer,githubRepo:o.githubRepo,tabs:o.tabs,codeTheme:o.codeTheme,copyMarkdown:o.copyMarkdown,breadcrumbs:o.breadcrumbs,poweredBy:o.poweredBy,communityHelp:o.communityHelp,version:o.version,editLink:o.editLink},...o.theme||{}},m=Object.fromEntries(Object.entries(c).filter(([t,a])=>a!==void 0));return m.navbar&&(m.navbar=m.navbar.map(t=>({label:t.label||t.text||"",href:t.href||t.link||t.to||""}))),{docsDir:mt.resolve(i),homePage:o.homePage,theme:{...d.theme,...m},i18n:o.i18n,versions:o.versions,siteUrl:o.siteUrl,plugins:o.plugins||[],integrations:o.integrations,robots:o.robots,vite:o.vite}}var X,K=P(()=>{"use strict";g();X=["boltdocs.config.js","boltdocs.config.mjs","boltdocs.config.ts"]});function Tt(i,n){let e=H(n.title),d=H(n.description);return i.replace(/<title>.*?<\/title>/,`<title>${e}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${d}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${d}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${d}$2`)}var jt=P(()=>{"use strict";g();I()});function It(i,n){let e=n?.siteUrl?.replace(/\/$/,"")||"https://example.com",d=new Date().toISOString().split("T")[0],o=[{url:"/",priority:"1.0",changefreq:"daily"}];if(n?.i18n){let c=n.i18n.defaultLocale;for(let m of Object.keys(n.i18n.locales))m!==c&&o.push({url:`/${m}/`,priority:"1.0",changefreq:"daily"})}return`<?xml version="1.0" encoding="UTF-8"?>
2
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
- ${[...o,...i.map(c=>({url:c,priority:"0.8",changefreq:"weekly"}))].map(c=>` <url>
4
- <loc>${rt(e)}${rt(c.url)}</loc>
5
- <lastmod>${d}</lastmod>
6
- <changefreq>${c.changefreq}</changefreq>
7
- <priority>${c.priority}</priority>
8
- </url>`).join(`
9
- `)}
10
- </urlset>`}var Ft=P(()=>{"use strict";g();I()});function Z(i){if(typeof i.robots=="string")return i.robots;let n=i.siteUrl?.replace(/\/$/,"")||"",e=i.robots||{},d=e.rules||[{userAgent:"*",allow:"/"}],o=e.sitemaps||(n?[`${n}/sitemap.xml`]:[]),s="";for(let c of d){if(s+=`User-agent: ${c.userAgent}
11
- `,c.disallow){let m=Array.isArray(c.disallow)?c.disallow:[c.disallow];for(let t of m)s+=`Disallow: ${t}
12
- `}if(c.allow){let m=Array.isArray(c.allow)?c.allow:[c.allow];for(let t of m)s+=`Allow: ${t}
13
- `}s+=`
14
- `}for(let c of o)s+=`Sitemap: ${c}
15
- `;return s.trim()}var ut=P(()=>{"use strict";g()});import T from"fs";import j from"path";import{fileURLToPath as ve}from"url";import{createRequire as Pe}from"module";async function gt(i){let{docsDir:n,docsDirName:e,outDir:d,config:o}=i,s=await L(n,o),c=["tsx","ts","jsx","js"].map(r=>j.resolve(n,`pages-external/index.${r}`)).find(r=>T.existsSync(r));if(c)try{let r=T.readFileSync(c,"utf-8"),y=r.match(/pages\s*:\s*{([^}]+)}/s);if(y){let f=y[1].split(",").map(x=>x.split(":")[0].trim().replace(/['"]/g,"")).filter(x=>x&&x.startsWith("/"));for(let x of f)s.some(B=>B.path===x)||s.push({path:x,title:x.slice(1).charAt(0).toUpperCase()+x.slice(2),filePath:"",componentPath:"",_content:""})}r.includes("homePage")&&!s.some(f=>f.path==="/")&&s.push({path:"/",title:"Home",filePath:"",componentPath:"",_content:""})}catch(r){console.warn("[boltdocs] Failed to parse external routes for SSG:",r)}let m=j.resolve(Ht,"../client/ssr.js");if(!T.existsSync(m)){console.error("[boltdocs] SSR module not found at",m,"- Did you build the core package?");return}let t=Lt("module"),a=t.prototype.require;t.prototype.require=function(r,...y){return r.startsWith("virtual:boltdocs-")?r==="virtual:boltdocs-layout"?{__esModule:!0,default:function(x){try{let h=a.apply(this,[j.resolve(Ht,"../client/index.js")]).DefaultLayout||(({children:k})=>k);return a.apply(this,["react"]).createElement(h,x)}catch{return x.children}}}:r==="virtual:boltdocs-mdx-components"?{__esModule:!0,default:{}}:r==="virtual:boltdocs-config"?{__esModule:!0,default:o}:{__esModule:!0,default:r.includes("routes")?[]:{}}:a.apply(this,[r,...y])};let{render:l}=Lt(m);t.prototype.require=a;let u=j.join(d,"index.html");if(!T.existsSync(u)){console.warn("[boltdocs] No index.html found in outDir, skipping SSG.");return}let b=T.readFileSync(u,"utf-8");await Promise.all(s.map(async r=>{let y=at(o?.theme?.title,r.locale)||"Boltdocs",f=at(o?.theme?.description,r.locale)||"",x=`${r.title} | ${y}`,B=r.description||f,h={};h[`/${e}/${r.filePath}`]={default:()=>null};try{let S=await l({path:r.path,routes:s,config:o||{},docsDirName:e,modules:h,homePage:void 0}),k=Tt(b,{title:H(x),description:H(B)}).replace("<!--app-html-->",S).replace('<div id="root"></div>',`<div id="root">${S}</div>`),V=j.join(d,r.path);await T.promises.mkdir(V,{recursive:!0}),await T.promises.writeFile(j.join(V,"index.html"),k,"utf-8")}catch(S){console.error(`[boltdocs] Error SSR rendering route ${r.path}:`,S&&(S.stack||S))}}));let C=It(s.map(r=>r.path),o);T.writeFileSync(j.join(d,"sitemap.xml"),C,"utf-8");let v=Z(o);T.writeFileSync(j.join(d,"robots.txt"),v,"utf-8"),console.log(`[boltdocs] Generated ${s.length} static pages + sitemap.xml + robots.txt`);let{flushCache:p}=await import("./cache-P6WK424C.mjs");await p()}var we,Ht,Lt,ft=P(()=>{"use strict";g();pt();I();jt();Ft();ut();we=ve(import.meta.url),Ht=j.dirname(we),Lt=Pe(import.meta.url)});import Q from"path";import Ot from"fs";function Et(i,n){let e=i.homePage?`import HomePage from '${R(i.homePage)}';`:"",d=Q.resolve(process.cwd(),"index.css"),o=Ot.existsSync(d)?"import './index.css';":"",s=i.homePage?"homePage: HomePage,":"",c=n?.plugins?.flatMap(v=>Object.entries(v.components||{}))||[],m=c.map(([v,p])=>`import * as _comp_${v} from '${R(p)}';
16
- const ${v} = _comp_${v}.default || _comp_${v}['${v}'] || _comp_${v};`).join(`
17
- `),t=c.map(([v])=>v).join(", "),a=Q.basename(i.docsDir||"docs"),l=Q.resolve(process.cwd(),i.docsDir||"docs"),u=["tsx","ts","jsx","js"].map(v=>Q.resolve(l,`pages-external/index.${v}`)).find(v=>Ot.existsSync(v)),b=u?`import * as _external_module from '${R(u)}';`:"";return s=u?"homePage: _external_module.homePage || HomePage,":i.homePage?"homePage: HomePage,":"",`
18
- import { createBoltdocsApp as _createApp } from 'boltdocs/client';
19
- import _routes from 'virtual:boltdocs-routes';
20
- import _config from 'virtual:boltdocs-config';
21
- import _user_mdx_components from 'virtual:boltdocs-mdx-components';
22
- ${o}
23
- ${e}
24
- ${m}
25
- ${b}
26
-
27
- _createApp({
28
- target: '#root',
29
- routes: _routes,
30
- docsDirName: '${a}',
31
- config: _config,
32
- modules: import.meta.glob('/${a}/**/*.{md,mdx}'),
33
- hot: import.meta.hot,
34
- ${s}
35
- ${u?"externalPages: _external_module.pages, externalLayout: _external_module.layout,":""}
36
- components: { ${t}${t?", ":""} ...(_user_mdx_components || {}) },
37
- });
38
- `}var Gt=P(()=>{"use strict";g();I()});function Nt(i){return`<!doctype html>
39
- <html lang="en">
40
- <head>
41
- <meta charset="UTF-8" />
42
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
43
- <title>${i.theme?.title||"Boltdocs"}</title>
44
- </head>
45
- <body>
46
- <div id="root"></div>
47
- </body>
48
- </html>`}function ht(i,n){let e=n.theme,d=e?.title||"Boltdocs",o=e?.description||"",s=e?.favicon;!s&&e?.logo&&(typeof e.logo=="string"?s=e.logo:s=e.logo.light||e.logo.dark);let c=[s?`<link rel="icon" href="${s}">`:"",`<meta name="description" content="${o}">`,`<meta property="og:title" content="${d}">`,`<meta property="og:description" content="${o}">`,e?.ogImage?`<meta property="og:image" content="${e.ogImage}">`:"",'<meta property="og:type" content="website">','<meta name="twitter:card" content="summary_large_image">',`<meta name="twitter:title" content="${d}">`,`<meta name="twitter:description" content="${o}">`,e?.ogImage?`<meta name="twitter:image" content="${e.ogImage}">`:"",'<meta name="generator" content="Boltdocs">'].filter(Boolean).join(`
49
- `),m=`
50
- <script>
51
- (function() {
52
- try {
53
- var stored = localStorage.getItem("boltdocs-theme");
54
- var theme = stored || (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
55
- if (theme === "light") {
56
- document.documentElement.classList.add("theme-light");
57
- document.documentElement.dataset.theme = "light";
58
- } else {
59
- document.documentElement.classList.remove("theme-light");
60
- document.documentElement.dataset.theme = "dark";
61
- }
62
- } catch (e) {}
63
- })();
64
- </script>
65
- `;return i.includes("<title>")?i=i.replace(/<title>.*?<\/title>/,`<title>${d}</title>`):i=i.replace("</head>",` <title>${d}</title>
66
- </head>`),i=i.replace("</head>",` ${c}
67
- ${m} </head>`),!i.includes("src/main")&&!i.includes("virtual:boltdocs-entry")&&(i=i.replace("</body>",` <script type="module">import "virtual:boltdocs-entry";</script>
68
- </body>`)),i}var At=P(()=>{"use strict";g()});function Ut(i){let n=[];for(let e of i)if(n.push({id:e.path,title:e.title,content:e._content||"",url:e.path,display:e.groupTitle?`${e.groupTitle} > ${e.title}`:e.title,locale:e.locale,version:e.version}),e.headings)for(let d of e.headings)n.push({id:`${e.path}#${d.id}`,title:d.text,content:`${d.text} in ${e.title}`,url:`${e.path}#${d.id}`,display:`${e.title} > ${d.text}`,locale:e.locale,version:e.version});return n}var zt=P(()=>{"use strict";g()});var Vt=P(()=>{"use strict";g()});import{loadEnv as $e}from"vite";import{ViteImageOptimizer as Ce}from"vite-plugin-image-optimizer";import D from"path";import Wt from"fs";function qt(i={},n){let e=D.resolve(process.cwd(),i.docsDir||"docs"),d=R(e),o=n,s,c=!1,m=o?.plugins?.flatMap(t=>t.vitePlugins||[])||[];return[{name:"vite-plugin-boltdocs",enforce:"pre",async config(t,a){c=a.command==="build";let l=t.envDir||process.cwd(),u=$e(a.mode,l,"");return Object.assign(process.env,u),o||(o=await F(e)),{optimizeDeps:{include:["react","react-dom"],exclude:["boltdocs","boltdocs/client","boltdocs/hooks","boltdocs/primitives","boltdocs/base-ui","boltdocs/mdx","boltdocs/integrations","boltdocs/client/hooks","boltdocs/client/primitives"]}}},configResolved(t){s=t},configureServer(t){t.middlewares.use((r,y,f)=>{if(r.url==="/robots.txt"){let x=Z(o);y.statusCode=200,y.setHeader("Content-Type","text/plain"),y.end(x);return}f()}),t.middlewares.use(async(r,y,f)=>{let x=r.url?.split("?")[0]||"/",B=r.headers.accept||"",h=x==="/"||x.startsWith("/docs")||o.i18n&&Object.keys(o.i18n.locales).some(k=>x.startsWith(`/${k}/docs`)||x===`/${k}`)||!0,S=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(x);if(B.includes("text/html")&&!S&&h){let k=Nt(o);k=ht(k,o),k=await t.transformIndexHtml(r.url||"/",k),y.statusCode=200,y.setHeader("Content-Type","text/html"),y.end(k);return}f()});let a=X.map(r=>D.resolve(process.cwd(),r)),l=["tsx","jsx"],u=l.map(r=>D.resolve(e,`layout.${r}`)),b=["tsx","ts","jsx","js"],C=b.map(r=>D.resolve(e,`mdx-components.${r}`)),v=b.map(r=>D.resolve(e,`pages-external/index.${r}`));t.watcher.add([...a,...C,...u,...v]);let p=async(r,y)=>{try{let f=R(r);if(X.some(h=>f.endsWith(h))){t.restart();return}if(b.some(h=>f.endsWith(`mdx-components.${h}`))){let h=t.moduleGraph.getModuleById("\0virtual:boltdocs-mdx-components");h&&t.moduleGraph.invalidateModule(h),t.ws.send({type:"full-reload"});return}if(l.some(h=>f.endsWith(`layout.${h}`))){let h=t.moduleGraph.getModuleById("\0virtual:boltdocs-layout");h&&t.moduleGraph.invalidateModule(h),t.ws.send({type:"full-reload"});return}if(f.includes("/pages-external/")||f.includes("\\pages-external\\")){let h=t.moduleGraph.getModuleById("\0virtual:boltdocs-entry");h&&t.moduleGraph.invalidateModule(h),t.ws.send({type:"full-reload"});return}if(!f.startsWith(d)||!vt(f))return;if(y==="add"||y==="unlink"){lt(),o=await F(e);let h=t.moduleGraph.getModuleById("\0virtual:boltdocs-config");h&&t.moduleGraph.invalidateModule(h),t.ws.send({type:"custom",event:"boltdocs:config-update",data:{theme:o?.theme,integrations:o?.integrations,i18n:o?.i18n,versions:o?.versions,siteUrl:o?.siteUrl}})}else ct(r);let x=await L(e,o,"/docs",y!=="change"),B=t.moduleGraph.getModuleById("\0virtual:boltdocs-routes");B&&t.moduleGraph.invalidateModule(B),t.ws.send({type:"custom",event:"boltdocs:routes-update",data:x})}catch(f){console.error(`[boltdocs] HMR error during ${y} event:`,f)}};t.watcher.on("add",r=>p(r,"add")),t.watcher.on("unlink",r=>p(r,"unlink")),t.watcher.on("change",r=>p(r,"change"))},resolveId(t){if(t==="virtual:boltdocs-routes"||t==="virtual:boltdocs-config"||t==="virtual:boltdocs-entry"||t==="virtual:boltdocs-mdx-components"||t==="virtual:boltdocs-layout"||t==="virtual:boltdocs-search")return"\0"+t},async load(t){if(t==="\0virtual:boltdocs-routes"){let a=await L(e,o);return`export default ${JSON.stringify(a,null,2)};`}if(t==="\0virtual:boltdocs-config"){let a={theme:o?.theme,integrations:o?.integrations,i18n:o?.i18n,versions:o?.versions,siteUrl:o?.siteUrl,plugins:o?.plugins?.map(l=>({name:l.name}))};return`export default ${JSON.stringify(a,null,2)};`}if(t==="\0virtual:boltdocs-entry")return Et(i,o);if(t==="\0virtual:boltdocs-mdx-components"){let a=["tsx","ts","jsx","js"],l=null;for(let u of a){let b=D.resolve(e,`mdx-components.${u}`);if(Wt.existsSync(b)){l=b;break}}if(l){let u=R(l);return`import * as components from '${u}';
69
- const mdxComponents = components.default || components;
70
- export default mdxComponents;
71
- export * from '${u}';`}return"export default {};"}if(t==="\0virtual:boltdocs-layout"){let a=["tsx","jsx"],l=null;for(let u of a){let b=D.resolve(e,`layout.${u}`);if(Wt.existsSync(b)){l=b;break}}return l?`import UserLayout from '${R(l)}';
72
- export default UserLayout;`:`import { DefaultLayout } from 'boltdocs/client';
73
- export default DefaultLayout;`}if(t==="\0virtual:boltdocs-search"){let a=await L(e,o),l=Ut(a);return`export default ${JSON.stringify(l,null,2)};`}},transformIndexHtml:{order:"pre",handler(t){return ht(t,o)}},async closeBundle(){if(!c)return;let t=s?.build?.outDir?D.resolve(s.root,s.build.outDir):D.resolve(process.cwd(),"dist"),a=D.basename(e||"docs");await gt({docsDir:e,docsDirName:a,outDir:t,config:o});let{flushCache:l}=await import("./cache-P6WK424C.mjs");await l()}},Ce({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:"preset-default"}]}}),...m.filter(t=>!!t)]}var Jt=P(()=>{"use strict";g();pt();K();ft();I();Gt();At();ut();zt();Vt()});var Xt,O,Kt=P(()=>{"use strict";g();Bt();Xt="v4",O=new Ct("mdx")});import{createHighlighter as Be}from"shiki";async function tt(i){if(Y)return Y;let n=typeof i=="object"?[i.light,i.dark]:[i??"github-dark"];return["github-light","github-dark"].forEach(e=>{n.includes(e)||n.push(e)}),Y=await Be({themes:n,langs:["tsx","jsx","ts","js","json","md","mdx","css","html","bash","sh","yaml","yml"]}),Y}var Y,yt=P(()=>{"use strict";g();Y=null});import{visit as ke}from"unist-util-visit";function Zt(i){return async n=>{let e=i?.theme?.codeTheme??{light:"github-light",dark:"github-dark"},d=await tt(e);ke(n,["mdxJsxFlowElement","mdxJsxTextElement"],o=>{if(o.name!=="ComponentPreview")return;let s=o.attributes?.find(a=>a.name==="code"),c="";if(s){if(typeof s.value=="string")c=s.value;else if(s.value?.type==="mdxJsxAttributeValueExpression"){let a=s.value.value??"";c=a.match(/^[`'"]([\s\S]+)[`'"]$/)?.[1]??a}}if(!c)return;let m=typeof e=="object"?{themes:{light:e.light,dark:e.dark},lang:"tsx"}:{theme:e,lang:"tsx"},t=d.codeToHtml(c,m);o.attributes=(o.attributes??[]).filter(a=>a.name!=="highlightedHtml"),o.attributes.push({type:"mdxJsxAttribute",name:"highlightedHtml",value:t})})}}var Qt=P(()=>{"use strict";g();yt()});import{visit as Se}from"unist-util-visit";function Yt(i){return async n=>{let e=i?.theme?.codeTheme||{light:"github-light",dark:"github-dark"},d=await tt(e);Se(n,"element",o=>{if(o.tagName==="pre"&&o.children?.[0]?.tagName==="code"){let s=o.children[0],m=(s.properties?.className||[]).find(p=>p.startsWith("language-")),t=m?m.slice(9):"text",a=s.children[0]?.value||"",u=(s.data?.meta||s.properties?.metastring||"").match(/title\s*=\s*"([^"]*)"/),b=u?u[1]:void 0,C={lang:t};typeof e=="object"?C.themes={light:e.light,dark:e.dark}:C.theme=e;let v=d.codeToHtml(a,C);o.properties.dataHighlighted="true",o.properties.highlightedHtml=v,o.properties["data-lang"]=t,b&&(o.properties.title=b),o.children=[]}})}}var te=P(()=>{"use strict";g();yt()});import{visit as Me}from"unist-util-visit";function ee(){return i=>{Me(i,"code",n=>{if(n.data=n.data||{},n.data.hProperties=n.data.hProperties||{},n.lang&&(n.data.hProperties["data-lang"]=n.lang),!n.meta)return;let e=n.meta,d=e.match(/title\s*=\s*"([^"]*)"/);d&&(n.data.hProperties.title=d[1]),n.data.hProperties.metastring=e})}}var oe=P(()=>{"use strict";g()});import Re from"@mdx-js/rollup";import De from"remark-gfm";import _e from"remark-frontmatter";import Te from"rehype-slug";import je from"crypto";function ne(i,n=Re){let e=i?.plugins?.flatMap(s=>s.remarkPlugins||[])||[],d=i?.plugins?.flatMap(s=>s.rehypePlugins||[])||[],o=n({remarkPlugins:[De,_e,ee,[Zt,i],...e],rehypePlugins:[Te,[Yt,i],...d],jsxRuntime:"automatic",providerImportSource:"@mdx-js/react"});return{...o,name:"vite-plugin-boltdocs-mdx",async buildStart(){et=0,z=0,ie||(O.load(),ie=!0),o.buildStart&&await o.buildStart.call(this)},async transform(s,c,m){if(!c.endsWith(".md")&&!c.endsWith(".mdx"))return o.transform?.call(this,s,c,m);console.log(`[boltdocs] Transforming MDX: ${c}`),z++;let t=je.createHash("md5").update(s).digest("hex"),a=`${c}:${t}:${Xt}`,l=O.get(a);if(l)return et++,{code:l,map:null};let u=await o.transform.call(this,s,c,m);return u&&typeof u=="object"&&u.code&&O.set(a,u.code),u},async buildEnd(){z>0&&console.log(`[boltdocs] MDX Cache Performance: ${et}/${z} hits (${Math.round(et/z*100)||0}%)`),O.save(),await O.flush(),o.buildEnd&&await o.buildEnd.call(this)}}}var ie,et,z,re=P(()=>{"use strict";g();Kt();Qt();te();oe();ie=!1,et=0,z=0});import Ie from"@vitejs/plugin-react";import Fe from"@tailwindcss/vite";async function se(i){let n=i?.docsDir||"docs",e=await F(n),d={...i,homePage:i?.homePage||e.homePage};return[...qt(d,e),ne(e)]}async function Ri(i,n="development"){let e=await F("docs",i);return{root:i,mode:n,plugins:[Ie(),Fe(),await se({docsDir:e.docsDir,homePage:e.homePage})],...e.vite}}var He=P(()=>{g();Jt();re();K();ft();K()});export{be as a,F as b,K as c,gt as d,Nt as e,At as f,se as g,Ri as h,He as i};
@@ -1 +0,0 @@
1
- import{c as Z,g as H}from"./chunk-NBCYHLAA.mjs";import{useState as ge,useEffect as he}from"react";import{Button as ve}from"react-aria-components";import{Search as be,Sun as Ce,Moon as ye,ExternalLink as we}from"lucide-react";import{jsx as a,jsxs as x}from"react/jsx-runtime";function f(e){let{size:t=20,...o}=e;return{...o,width:t,height:t}}var q=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...f(e),children:[a("title",{children:"GitHub"}),a("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]}),Q=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...f(e),children:[a("title",{children:"Discord"}),a("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z"})]}),U=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...f(e),children:[a("title",{children:"X"}),a("path",{d:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"})]}),$t=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...f(e),children:[a("title",{children:"CodeSandbox"}),a("path",{d:"M0 24h24V0H0v2.455h21.546v19.09H2.454V0H0Z"})]}),$=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...f(e),children:[a("title",{children:"Bluesky"}),a("path",{d:"M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037-.856 3.061-3.978 3.842-6.755 3.37 4.854.826 6.089 3.562 3.422 6.299-5.065 5.196-7.28-1.304-7.847-2.97-.104-.305-.152-.448-.153-.327 0-.121-.05.022-.153.327-.568 1.666-2.782 8.166-7.847 2.97-2.667-2.737-1.432-5.473 3.422-6.3-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026"})]}),eo=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...f(e),children:[a("title",{children:"TypeScript"}),a("path",{fill:"#2563EB",d:"M3.234 9.093V7.318h8.363v1.775H8.479V17.5H6.352V9.093H3.234zm15.263 1.153c-.04-.4-.21-.712-.512-.934-.301-.222-.71-.333-1.228-.333-.351 0-.648.05-.89.149-.242.096-.427.23-.557.403a.969.969 0 0 0-.189.586.838.838 0 0 0 .115.477c.086.136.204.254.353.353.149.097.321.181.517.254.195.07.404.13.626.179l.915.219c.444.1.852.232 1.223.397.371.166.693.37.965.612.271.242.482.527.631.855.152.328.23.704.234 1.129-.004.623-.163 1.163-.478 1.62-.311.454-.762.807-1.352 1.06-.587.248-1.294.372-2.123.372-.822 0-1.538-.126-2.147-.378-.607-.252-1.081-.624-1.422-1.118-.338-.497-.516-1.112-.532-1.845h2.083c.023.342.12.627.293.855.176.226.41.397.701.513a2.8 2.8 0 0 0 1 .168c.364 0 .68-.053.949-.159a1.45 1.45 0 0 0 .631-.442c.15-.189.224-.406.224-.651a.846.846 0 0 0-.204-.577c-.132-.156-.328-.288-.586-.398a5.964 5.964 0 0 0-.94-.298l-1.109-.278c-.858-.21-1.536-.536-2.033-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.491-1.615.335-.461.794-.82 1.377-1.08.584-.258 1.247-.387 1.99-.387.755 0 1.414.13 1.978.388.567.258 1.007.618 1.322 1.079.315.46.477.994.488 1.6h-2.064z"})]}),to=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...f(e),children:[a("title",{children:"JavaScript"}),a("path",{fill:"#F59E0B",d:"M8.383 7.318h2.127v7.1c0 .656-.147 1.226-.442 1.71a2.924 2.924 0 01-1.218 1.118c-.52.262-1.125.393-1.815.393-.613 0-1.17-.107-1.67-.323a2.67 2.67 0 01-1.183-.994c-.292-.448-.436-1.01-.433-1.686h2.143c.006.269.061.5.164.691.106.19.25.335.432.438.186.1.405.15.657.15.265 0 .488-.057.67-.17.186-.116.327-.285.423-.507.096-.222.145-.496.145-.82v-7.1zm9.43 2.928c-.04-.4-.21-.712-.511-.934-.302-.222-.711-.333-1.228-.333-.352 0-.648.05-.89.149-.242.096-.428.23-.557.403a.969.969 0 00-.19.586.838.838 0 00.115.477c.087.136.204.254.353.353.15.097.322.181.517.254.196.07.405.13.627.179l.915.219c.444.1.851.232 1.223.397.37.166.692.37.964.612s.482.527.631.855a2.7 2.7 0 01.234 1.129c-.003.623-.162 1.163-.477 1.62-.312.454-.763.807-1.353 1.06-.586.248-1.294.372-2.122.372-.822 0-1.538-.126-2.148-.378-.607-.252-1.08-.624-1.422-1.118-.338-.497-.515-1.112-.532-1.845h2.083c.023.342.121.627.293.855.176.226.41.397.702.513.295.112.628.168.999.168.364 0 .68-.053.95-.159.271-.106.482-.253.63-.442.15-.189.224-.406.224-.651a.846.846 0 00-.203-.577c-.133-.156-.329-.288-.587-.398a5.964 5.964 0 00-.94-.298l-1.108-.278c-.859-.21-1.537-.536-2.034-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.492-1.615.334-.461.793-.82 1.377-1.08.583-.258 1.246-.387 1.989-.387.755 0 1.415.13 1.978.388.567.258 1.008.618 1.323 1.079.314.46.477.994.487 1.6h-2.063z"})]}),oo=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...f(e),children:[a("title",{children:"JSON"}),a("path",{fill:"#F59E0B",d:"M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z"})]}),ro=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...f(e),children:[a("title",{children:"CSS"}),a("path",{fill:"#0EA5E9",d:"M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z"})]}),no=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...f(e),children:[a("title",{children:"HTML"}),a("path",{fill:"#EA580C",d:"M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z"})]});var so=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...f(e),children:[a("title",{children:"React"}),a("path",{fill:"#0E8ADC",d:"M12 13.677a1.677 1.677 0 100-3.354 1.677 1.677 0 000 3.354z"}),a("path",{stroke:"#0E8ADC",d:"M12 15.436c4.97 0 9-1.538 9-3.436s-4.03-3.436-9-3.436S3 10.102 3 12s4.03 3.436 9 3.436z"}),a("path",{stroke:"#0E8ADC",d:"M9.024 13.718c2.485 4.305 5.832 7.025 7.476 6.076 1.644-.949.961-5.208-1.524-9.512C12.491 5.977 9.144 3.257 7.5 4.206c-1.644.949-.961 5.208 1.524 9.512z"}),a("path",{stroke:"#0E8ADC",d:"M9.024 10.282c-2.485 4.304-3.168 8.563-1.524 9.512 1.644.95 4.99-1.771 7.476-6.076 2.485-4.304 3.168-8.563 1.524-9.512-1.644-.95-4.99 1.771-7.476 6.076z"})]}),ao=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...f(e),children:[a("title",{children:"Markdown"}),a("path",{fill:"#60A5FA",d:"M3 15.714V8h2.323l2.322 2.836L9.968 8h2.322v7.714H9.968V11.29l-2.323 2.836-2.322-2.836v4.424H3zm14.516 0l-3.484-3.743h2.323V8h2.322v3.97H21l-3.484 3.744z"})]}),io=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 25 24",...f(e),children:[a("title",{children:"Shell"}),a("path",{stroke:"#14B8A6",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4.336 17l6-6-6-6M12.336 19h8"})]}),lo=e=>x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...f(e),children:[a("title",{children:"YAML"}),a("path",{fill:"#A78BFA",d:"M6.533 5.864h2.755l2.654 5.011h.113l2.654-5.011h2.756l-4.245 7.522V17.5h-2.443v-4.114L6.533 5.864z"})]});import{jsx as l,jsxs as L}from"react/jsx-runtime";var Ne=({children:e,className:t,...o})=>l("header",{className:n("boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md",t),...o,children:e}),Re=({children:e,className:t})=>l("div",{className:n("mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6",t),children:e}),Pe=({children:e,className:t})=>l("div",{className:n("flex flex-1 items-center justify-start gap-4 min-w-0",t),children:e}),Ae=({children:e,className:t})=>l("div",{className:n("flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0",t),children:e}),Te=({children:e,className:t})=>l("div",{className:n("hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full",t),children:e}),ke=({src:e,alt:t,width:o=24,height:r=24,className:s})=>l(y,{href:"/",className:n("flex items-center gap-2 shrink-0 outline-none",s),children:e?l("img",{src:e,alt:t,width:o,height:r,className:"h-6 w-6 object-contain"}):null}),Be=({children:e,className:t})=>l(y,{href:"/",children:l("span",{className:n("text-lg font-bold tracking-tight hidden sm:inline-block",t),children:e})}),Se=({children:e,className:t})=>l("nav",{className:n("hidden md:flex items-center gap-6 text-sm font-medium",t),children:e}),Ie=({label:e,href:t,active:o,to:r,className:s})=>L(y,{href:t,target:r==="external"?"_blank":void 0,className:n("transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm",{"text-primary-500":o,"text-text-muted hover:text-text-main":!o},s),children:[e,r==="external"&&l("span",{className:"ml-1 inline-block",children:l(we,{size:12})})]}),Le=({className:e,onPress:t})=>{let[o,r]=ge(!1),s=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return he(()=>{r(!0)},[]),L(ve,{onPress:t,className:n("flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer","transition-all duration-200 hover:border-border-strong hover:text-text-main hover:bg-bg-muted hover:shadow-sm active:scale-[0.98]","focus-visible:ring-2 focus-visible:ring-primary-500/30","w-full max-w-[720px] justify-between",e),children:[L("div",{className:"flex items-center gap-2",children:[l(be,{size:16}),l("span",{className:"hidden sm:inline-block",children:"Search docs..."})]}),L("div",{className:"hidden sm:flex items-center gap-1 pointer-events-none select-none",children:[l("kbd",{className:"flex h-5 items-center justify-center rounded border border-border-subtle bg-bg-main px-1.5 font-mono text-[10px] font-medium",children:s?"\u2318":"Ctrl"}),l("kbd",{className:"flex h-5 w-5 items-center justify-center rounded border border-border-subtle bg-bg-main font-mono text-[10px] font-medium",children:"K"})]})]})},Me=({className:e,theme:t,onThemeChange:o})=>l(te,{isSelected:t==="dark",onChange:o,className:n("rounded-md p-2 text-text-muted outline-none cursor-pointer","transition-all duration-300 hover:bg-bg-surface hover:text-text-main hover:rotate-12 active:scale-90","focus-visible:ring-2 focus-visible:ring-primary-500/30",e),"aria-label":"Toggle theme",children:t==="dark"?l(Ce,{size:20}):l(ye,{size:20})}),Oe=({name:e})=>{if(e==="github")return l(q,{});if(e==="discord")return l(Q,{});if(e==="x")return l(U,{});if(e==="bluesky")return l($,{})},ze=({icon:e,link:t,className:o})=>l(y,{href:t,target:"_blank",rel:"noopener noreferrer",className:n("rounded-md p-2 text-text-muted outline-none transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",o),children:l(Oe,{name:e})}),Ee=({className:e})=>l(ee,{orientation:"vertical",className:n("h-6 w-px bg-border-subtle mx-1",e)}),xo={NavbarRoot:Ne,NavbarLeft:Pe,NavbarRight:Ae,NavbarCenter:Te,NavbarLogo:ke,Title:Be,Links:Se,Link:Ie,SearchTrigger:Le,Theme:Me,Socials:ze,Split:Ee,Content:Re};import*as k from"react-aria-components";import{ChevronDown as wo}from"lucide-react";import{clsx as De}from"clsx";import{twMerge as He}from"tailwind-merge";function n(...e){return He(De(e))}import{Fragment as To,jsx as Po,jsxs as Ao}from"react/jsx-runtime";import*as d from"react-aria-components";import{Search as Ve,Hash as We,FileText as Fe,CornerDownLeft as Ge}from"lucide-react";import{Fragment as Qe,jsx as p,jsxs as V}from"react/jsx-runtime";var je=({children:e,isOpen:t,onOpenChange:o,className:r})=>p(d.ModalOverlay,{isOpen:t,onOpenChange:o,isDismissable:!0,className:n("fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20","entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out"),children:p(d.Modal,{className:n("mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95",r),children:p(d.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),Je=({children:e,className:t,onSelectionChange:o,...r})=>p("div",{className:t,children:p(d.Autocomplete,{...r,onSelectionChange:o,className:"flex flex-col min-h-0",children:e})}),Ke=({className:e,...t})=>V(d.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[p(Ve,{className:"h-5 w-5 text-text-muted"}),p(d.Input,{...t,className:n("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),p("div",{className:"flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted",children:p("kbd",{className:"font-sans",children:"ESC"})})]}),Xe=({children:e,className:t,...o})=>p(d.ListBox,{...o,className:n("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),_e=({children:e,className:t,...o})=>p(d.ListBoxItem,{...o,className:n("group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors","text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white",t),children:r=>V(Qe,{children:[e,(r.isFocused||r.isSelected)&&V("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[p("span",{className:"text-[10px]",children:"Select"}),p(Ge,{size:10})]})]})}),Ye=({isHeading:e,className:t})=>p("div",{className:n("shrink-0",t),children:e?p(We,{size:18}):p(Fe,{size:18})}),Ze=({children:e,className:t})=>p("span",{className:n("block font-medium truncate flex-1 text-sm",t),children:e}),qe=({children:e,className:t})=>p("span",{className:n("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),Io={Root:je,Autocomplete:Je,Input:Ke,List:Xe,Item:Object.assign(_e,{Icon:Ye,Title:Ze,Bio:qe})};import{createContext as re,use as F,useEffect as G,useImperativeHandle as et,useMemo as j,useRef as ne,useState as se}from"react";import tt from"scroll-into-view-if-needed";import{useEffect as Ue,useRef as $e}from"react";function oe(e,t){let o=$e(e);Ue(()=>{o.current!==e&&(t(e),o.current=e)},[e,t])}function W(e){return e.startsWith("#")?e.slice(1):null}var M=class{items=[];single=!1;observer=null;onChange;callback(t){if(t.length===0)return;for(let r of t){let s=this.items.find(i=>i.id===r.target.id);if(s){s.active=r.isIntersecting;let i=100;s.fallback=!r.isIntersecting&&r.boundingClientRect.top<i}}let o=-1;for(let r=this.items.length-1;r>=0;r--)if(this.items[r].fallback){o=r;break}o===-1&&this.items.length>0&&(o=0),this.items=this.items.map((r,s)=>({...r,active:s===o,t:s===o?Date.now():r.t})),this.onChange?.()}setItems(t){let o=this.observer;if(o)for(let r of this.items){let s=document.getElementById(r.id);s&&o.unobserve(s)}this.items=[];for(let r of t){let s=W(r.url);s&&this.items.push({id:s,active:!1,fallback:!1,t:0,original:r})}this.watchItems(),typeof window<"u"&&(setTimeout(()=>this.watchItems(),100),setTimeout(()=>this.watchItems(),500),setTimeout(()=>this.watchItems(),1e3)),this.onChange?.()}watch(t){this.observer||(this.observer=new IntersectionObserver(this.callback.bind(this),t),this.watchItems())}watchItems(){if(this.observer)for(let t of this.items){let o=document.getElementById(t.id);o&&this.observer.observe(o)}}unwatch(){this.observer?.disconnect(),this.observer=null}};import{jsx as w}from"react/jsx-runtime";var J=re(null),ae=re(null);function ie(){let e=F(J);if(!e)throw new Error("Component must be used under the <AnchorProvider /> component.");return e}function jo(){let e=ie();return j(()=>{let t;for(let o of e)o.active&&(!t||o.t>t.t)&&(t=o);return t?.id},[e])}function Jo(){let e=ie();return j(()=>{let t=[];for(let o of e)o.active&&t.push(o.id);return t},[e])}function Ko({containerRef:e,children:t}){return w(ae.Provider,{value:e,children:t})}function Xo({toc:e,single:t=!1,children:o}){let r=j(()=>new M,[]),[s,i]=se(r.items);return r.single=t,G(()=>{r.setItems(e)},[r,e]),G(()=>(r.watch({rootMargin:"-100px 0% 0% 0%",threshold:0}),r.onChange=()=>i([...r.items]),()=>{r.unwatch()}),[r]),w(J.Provider,{value:s,children:o})}var ot=({children:e,className:t})=>w("nav",{className:n("sticky top-navbar hidden xl:flex flex-col shrink-0","w-toc","py-8 pl-6 pr-4",t),children:e}),rt=({children:e,className:t,...o})=>w("div",{className:n("mb-4 text-xs font-bold uppercase tracking-wider text-text-main",t),...o,children:e}),le=({children:e,className:t,ref:o,...r})=>{let s=ne(null);return et(o,()=>s.current),w("div",{ref:s,className:n("relative overflow-y-auto boltdocs-otp-content",t),...r,children:e})};le.displayName="OnThisPageContent";var nt=({children:e,className:t})=>w("ul",{className:n("relative space-y-1 text-sm border-l border-border-subtle",t),children:e}),st=({level:e,children:t,className:o})=>w("li",{className:n(e===3&&"pl-3",o),children:t}),at=({children:e,href:t,active:o,onClick:r,className:s})=>{let i=F(J),b=F(ae),m=t?W(t):null,g=ne(null),[h,N]=se(o);return oe(m&&i?i.find(u=>u.id===m)?.active:null,u=>{u!==null&&u!==h&&(N(!!u),u&&g.current&&b?.current&&tt(g.current,{behavior:"smooth",block:"center",inline:"center",scrollMode:"if-needed",boundary:b.current}))}),G(()=>{o!==void 0&&N(o)},[o]),w("a",{ref:g,href:t,onClick:r,"data-active":h,className:n("block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main",h?"text-primary-500 font-medium":"text-text-muted",s),children:e})},it=({style:e,className:t})=>w("div",{className:n("absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300",t),style:e}),_o={OnThisPageRoot:ot,OnThisPageHeader:rt,OnThisPageContent:le,OnThisPageList:nt,OnThisPageItem:st,OnThisPageLink:at,OnThisPageIndicator:it};import*as ce from"react-aria-components";import{ChevronLeft as lt,ChevronRight as ct}from"lucide-react";import{Fragment as gt,jsx as R,jsxs as xt}from"react/jsx-runtime";var pt=({children:e,className:t})=>R("nav",{className:n("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),mt=({children:e,to:t,direction:o,className:r})=>{let s=o==="next";return xt(ce.Link,{href:t,className:n("flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none","transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg","focus-visible:ring-2 focus-visible:ring-primary-500/30",s?"text-right justify-end":"text-left justify-start",r),children:[!s&&R(lt,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),R("div",{className:"flex flex-col gap-1 flex-1",children:e}),s&&R(ct,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},dt=({children:e,className:t})=>R("span",{className:n("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),ut=({children:e,className:t})=>R("span",{className:n("text-base font-bold text-text-main truncate",t),children:e}),ft=({children:e})=>R(gt,{children:e}),Uo={PageNavRoot:pt,PageNavLink:Object.assign(mt,{Title:dt,Description:ut,Icon:ft})};import{jsx as B}from"react/jsx-runtime";var ht=({children:e,className:t="",...o})=>B("div",{className:n("w-full",t),...o,children:e}),vt=({children:e,className:t=""})=>B("div",{role:"tablist",className:n("relative flex flex-row items-center border-b border-border-subtle",t),children:e}),bt=({children:e,id:t,selected:o,className:r="",...s})=>B("button",{role:"tab","aria-selected":o,className:n("flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors outline-none cursor-pointer bg-transparent border-none",o?"text-primary-500":"text-text-muted hover:text-text-main",r),...s,children:e}),Ct=({children:e,className:t=""})=>B("div",{className:n("p-4 outline-none",t),children:e}),yt=({className:e="",style:t})=>B("div",{className:n("absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300",e),style:t}),or={TabsRoot:ht,TabsList:vt,TabsItem:bt,TabsContent:Ct,TabsIndicator:yt};import pe from"react";import{Link as wt}from"react-aria-components";import{useLocation as Nt}from"react-router-dom";import{jsx as me}from"react/jsx-runtime";var y=pe.forwardRef((e,t)=>{let{href:o,prefetch:r="hover",onMouseEnter:s,onFocus:i,...b}=e,m=H(o??""),{preload:g}=Z();return me(wt,{...b,ref:t,href:m,onMouseEnter:u=>{s?.(u),r==="hover"&&typeof m=="string"&&m.startsWith("/")&&g(m)},onFocus:u=>{i?.(u),r==="hover"&&typeof m=="string"&&m.startsWith("/")&&g(m)}})});y.displayName="Link";var Rt=pe.forwardRef((e,t)=>{let{href:o,end:r=!1,className:s,children:i,...b}=e,m=Nt(),g=H(o??""),h=r?m.pathname===g:m.pathname.startsWith(g),N=typeof s=="function"?s({isActive:h}):n(s,h&&"active"),u=typeof i=="function"?i({isActive:h}):i;return me(y,{...b,ref:t,href:o,className:N,children:u})});Rt.displayName="NavLink";import*as de from"react-aria-components";import{ChevronRight as Pt}from"lucide-react";import{jsx as C,jsxs as O}from"react/jsx-runtime";var At=({badge:e})=>{let t={new:"bg-primary-500/20 text-primary-500",updated:"bg-gray-500/20 text-gray-500",deprecated:"bg-red-500/20 text-red-500"};if(typeof e=="object"&&e?.expires){let r=new Date(e.expires),s=new Date,i=r.getTime()-s.getTime();if(Math.ceil(i/(1e3*60*60*24))===0)return null}let o=typeof e=="string"?e:e?.text;return C("span",{className:n("ml-auto flex h-4.5 items-center rounded-full text-[9px] font-medium px-1.5 py-0.5 text-center whitespace-nowrap",t[o]||t.new),children:o})},Tt=({children:e,className:t})=>C("aside",{className:n("boltdocs-sidebar sticky top-navbar hidden lg:flex flex-col shrink-0","w-sidebar h-full","overflow-y-auto border-r border-border-subtle bg-bg-main","py-6 px-4",t),children:C("nav",{className:"flex-1 space-y-6",children:e})}),kt=({children:e,title:t,icon:o,isOpen:r=!0,onToggle:s,className:i})=>O("div",{className:n("space-y-1",i),children:[t&&O(de.Button,{onPress:s,className:n("flex w-full items-center justify-between px-2 py-1.5 text-xs font-bold uppercase tracking-wider outline-none cursor-pointer","text-text-muted hover:text-text-main transition-colors","focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md"),children:[O("div",{className:"flex items-center gap-2",children:[o&&C(o,{size:14}),t]}),C(Pt,{size:14,className:n("transition-transform duration-200",r&&"rotate-90")})]}),r&&C("div",{className:"space-y-0.5",children:e})]}),Bt=({children:e,className:t})=>C("div",{className:n(t),children:e}),St=({label:e,href:t,active:o,icon:r,badge:s,className:i})=>O(y,{href:t,className:n("group flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none","transition-all duration-200 ease-in-out","focus-visible:ring-2 focus-visible:ring-primary-500/30",o?"bg-primary-500/10 text-primary-500 font-medium":"text-text-muted hover:bg-bg-surface hover:text-text-main hover:translate-x-1",i),children:[r&&C(r,{size:16,className:n(o?"text-primary-500":"text-text-muted group-hover:text-text-main")}),C("span",{className:"truncate",children:e}),s&&C(At,{badge:s})]}),gr={SidebarRoot:Tt,SidebarGroup:kt,SidebarGroupItem:Bt,SidebarLink:St};import{Breadcrumb as It,Breadcrumbs as Lt,Link as Mt}from"react-aria-components";import{ChevronRight as Ot}from"lucide-react";import{jsx as z}from"react/jsx-runtime";var wr=({children:e,className:t,...o})=>z(Lt,{className:n("flex items-center gap-1.5 pl-0! mb-0 text-sm text-text-muted",t),...o,children:e}),Nr=({children:e,className:t,...o})=>z(It,{className:n("flex items-center mb-0 gap-1.5",t),...o,children:e}),Rr=({children:e,href:t,className:o,...r})=>z(Mt,{href:t,className:n("transition-colors outline-none hover:text-text-main focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm","current:font-medium current:text-text-main current:pointer-events-none cursor-pointer",o),...r,children:e}),Pr=({className:e})=>z(Ot,{size:14,className:n("shrink-0 text-text-dim",e)});import*as E from"react-aria-components";import{cva as zt}from"class-variance-authority";import{Fragment as Et,jsx as P,jsxs as Dt}from"react/jsx-runtime";var ue=zt("flex flex-row items-center justify-center w-auto font-semibold tracking-tight no-underline whitespace-nowrap select-none outline-none transition-all duration-200 cursor-pointer pressed:scale-[0.97] hover:-translate-y-px leading-none",{variants:{variant:{primary:"bg-primary-500 text-white shadow-md hover:brightness-110 hover:shadow-lg",secondary:"bg-bg-surface text-text-main border border-border-subtle hover:bg-bg-muted hover:border-border-strong",outline:"bg-transparent text-text-main border border-border-strong hover:bg-bg-surface hover:border-primary-500",ghost:"bg-transparent text-text-muted hover:bg-bg-surface hover:text-text-main",danger:"bg-[var(--color-danger-500)]/10 text-[var(--color-danger-500)] border border-[var(--color-danger-500)]/20 hover:bg-[var(--color-danger-500)]/15",success:"bg-[var(--color-success-500)]/10 text-[var(--color-success-500)] border border-[var(--color-success-500)]/20 hover:bg-[var(--color-success-500)]/15",warning:"bg-[var(--color-warning-500)]/10 text-[var(--color-warning-500)] border border-[var(--color-warning-500)]/20 hover:bg-[var(--color-warning-500)]/15",info:"bg-[var(--color-info-500)]/10 text-[var(--color-info-500)] border border-[var(--color-info-500)]/20 hover:bg-[var(--color-info-500)]/15",subtle:"bg-primary-500/10 text-primary-500 hover:bg-primary-500/20",link:"bg-transparent text-primary-500 !p-0 !min-h-0 hover:underline"},size:{sm:"min-h-8 px-3.5 text-[0.8125rem] gap-1.5",md:"min-h-10 px-5 text-[0.9375rem] gap-2",lg:"min-h-12 px-7 text-[1.05rem] gap-2.5"},rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},iconSize:{sm:"w-8 h-8 p-0",md:"w-10 h-10 p-0",lg:"w-12 h-12 p-0"},disabled:{true:"opacity-50 cursor-not-allowed pointer-events-none",false:null}},defaultVariants:{variant:"primary",size:"md",rounded:"md"}}),Sr=({href:e,icon:t,iconPosition:o="left",isIconOnly:r,children:s,className:i,variant:b,size:m,rounded:g,iconSize:h,disabled:N,...u})=>{let D=r||!s&&!!t,Y=D?P("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):Dt(Et,{children:[t&&o==="left"&&P("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),P("span",{className:"flex items-center",children:s}),t&&o==="right"&&P("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?P(E.Link,{href:e,className:n(ue({variant:b,size:m,rounded:g,iconSize:D?h:void 0,disabled:N}),i),...u,children:Y}):P(E.Button,{className:n(ue({variant:b,size:m,rounded:g,iconSize:D?h:void 0,disabled:N}),i),...u,children:Y})};import{jsx as Ht}from"react/jsx-runtime";var Or=({children:e,className:t,vertical:o=!1})=>Ht("div",{className:n("inline-flex",o?"flex-col":"flex-row",!o&&["[&>*:not(:first-child)]:-ml-px","[&>*:first-child]:rounded-r-none","[&>*:last-child]:rounded-l-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-l-full","[&>*:last-child]:rounded-r-full"],t?.includes("rounded-xl")&&["[&>*:first-child]:rounded-l-xl","[&>*:last-child]:rounded-r-xl"],t?.includes("rounded-lg")&&["[&>*:first-child]:rounded-l-lg","[&>*:last-child]:rounded-r-lg"]],o&&["[&>*:not(:first-child)]:-mt-px","[&>*:first-child]:rounded-b-none","[&>*:last-child]:rounded-t-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-t-full","[&>*:last-child]:rounded-b-full"]],t),children:e});import{Check as Wt,ChevronRight as Ft,Dot as Gt}from"lucide-react";import fe from"react";import*as c from"react-aria-components";import*as A from"react-aria-components";import{jsx as K,jsxs as Vt}from"react/jsx-runtime";var X=({children:e,className:t,showArrow:o,...r})=>Vt(A.Popover,{offset:8,...r,className:A.composeRenderProps(t,s=>n("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none transition-none",s)),children:[o&&K(A.OverlayArrow,{className:"group",children:K("svg",{viewBox:"0 0 12 12",className:"block h-3 w-3 fill-bg-surface/80 stroke-border-subtle group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90","aria-hidden":"true",children:K("path",{d:"M0 0 L6 6 L12 0"})})}),e]});import{Fragment as Zt,jsx as v,jsxs as S}from"react/jsx-runtime";function jt(e){let[t,o]=fe.Children.toArray(e.children).slice(0,2);return S(c.MenuTrigger,{...e,children:[t,v(X,{placement:e.placement,className:"min-w-35",children:o})]})}function Jt(e){let[t,o]=fe.Children.toArray(e.children).slice(0,2);return S(c.SubmenuTrigger,{...e,children:[t,v(X,{offset:-4,crossOffset:-4,children:o})]})}function Kt(e){return v(c.Menu,{...e,className:c.composeRenderProps(e.className,t=>n("p-1.5 outline-none max-h-[inherit] overflow-auto max-w-75",t))})}function Xt(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return v(c.MenuItem,{...e,textValue:t,className:c.composeRenderProps(e.className,(o,{isFocused:r,isPressed:s,isDisabled:i})=>n("group relative flex flex-row items-center gap-2 px-2 py-1 rounded-lg outline-none cursor-default hover:cursor-pointer transition-none","text-text-main text-[12px]",{"bg-bg-surface-elevated text-primary-600 ring-1 ring-border-strong/5":r,"bg-bg-surface-elevanted":s,"opacity-40 grayscale pointer-events-none":i},o)),children:c.composeRenderProps(e.children,(o,{selectionMode:r,isSelected:s,hasSubmenu:i})=>S(Zt,{children:[r!=="none"&&S("span",{className:"flex items-center size-4 shrink-0 justify-center",children:[s&&r==="multiple"&&v(Wt,{className:"size-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),s&&r==="single"&&v(Gt,{className:"size-5 text-primary-500 animate-in zoom-in-50 duration-200"})]}),v("div",{className:"flex flex-row w-full transition-colors items-center gap-2 py-1 px-1",children:o}),i&&v(Ft,{className:"size-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}function _t({title:e,...t}){return S(c.MenuSection,{...t,className:n("flex flex-col gap-0.5",t.className),children:[e&&v(c.Header,{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none",children:e}),v(c.Collection,{items:t.items,children:t.children})]})}function Yt(e){return v(c.Separator,{...e,className:"mx-2 my-1.5 border-t border-border-subtle/50"})}var Jr={Root:Kt,Item:Xt,Trigger:jt,SubTrigger:Jt,Section:_t,Separator:Yt};import*as T from"react-aria-components";import{Fragment as Qt,jsx as I,jsxs as _}from"react/jsx-runtime";var qt=({className:e,children:t,...o})=>I(T.Tooltip,{...o,offset:8,className:r=>n("group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none","data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100","data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75","data-[placement=top]:slide-in-from-bottom-1","data-[placement=bottom]:slide-in-from-top-1","data-[placement=left]:slide-in-from-right-1","data-[placement=right]:slide-in-from-left-1",typeof e=="function"?e(r):e),children:r=>_(Qt,{children:[I(T.OverlayArrow,{children:_("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-bg-surface/90 stroke-border-subtle group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90",children:[I("title",{children:"Arrow"}),I("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(r):t]})}),Yr=({content:e,children:t,delay:o=500,closeDelay:r=0,...s})=>_(T.TooltipTrigger,{delay:o,closeDelay:r,children:[t,I(qt,{...s,children:e})]});import{jsx as Ut}from"react/jsx-runtime";function Ur({className:e,variant:t="rect",...o}){return Ut("div",{className:n("animate-pulse bg-bg-muted",t==="circle"?"rounded-full":"rounded-md",e),...o})}import{Separator as ee,ToggleButton as te}from"react-aria-components";export{n as a,y as b,Rt as c,ue as d,Sr as e,q as f,$t as g,eo as h,to as i,oo as j,ro as k,no as l,so as m,ao as n,io as o,lo as p,Yr as q,Ne as r,Re as s,Pe as t,Ae as u,Te as v,ke as w,Be as x,Se as y,Ie as z,Le as A,Me as B,Oe as C,ze as D,Ee as E,xo as F,je as G,Je as H,Ke as I,Xe as J,_e as K,Ye as L,Ze as M,qe as N,ie as O,jo as P,Jo as Q,Ko as R,Xo as S,ot as T,rt as U,le as V,nt as W,st as X,at as Y,it as Z,_o as _,pt as $,mt as aa,dt as ba,ut as ca,ft as da,Uo as ea,ht as fa,vt as ga,bt as ha,Ct as ia,yt as ja,or as ka,Tt as la,kt as ma,Bt as na,St as oa,gr as pa,wr as qa,Nr as ra,Rr as sa,Pr as ta,Or as ua,X as va,jt as wa,Jt as xa,Kt as ya,Xt as za,_t as Aa,Yt as Ba,Jr as Ca,Ur as Da,ee as Ea,te as Fa};
@@ -1 +0,0 @@
1
- var E=Object.defineProperty;var y=(s,t)=>()=>(s&&(t=s(s=0)),t);var V=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports),q=(s,t)=>{for(var e in t)E(s,e,{get:t[e],enumerable:!0})};import J from"path";import{fileURLToPath as X}from"url";var u=y(()=>{"use strict"});import P from"fs";import L from"gray-matter";import O from"isomorphic-dompurify";function tt(s){return s.replace(/\\/g,"/")}function M(s){return s.replace(/^\d+\./,"")}function et(s){let t=s.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function st(s){return/\.mdx?$/.test(s)}function m(s){try{return P.statSync(s).mtimeMs}catch{return 0}}function rt(s){let t=P.readFileSync(s,"utf-8");try{let{data:e,content:r}=L(t);return{data:e,content:r}}catch{return{data:{},content:t}}}function A(s){return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function it(s){return A(s)}function nt(s){let e=s.split("/").map(M).join("/").replace(/\/$/,"");return e=e.replace(/\.mdx?$/,""),(e==="index"||e.endsWith("/index"))&&(e=e.replace(/index$/,"")),e.startsWith("/")||(e="/"+e),e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function at(s){return O.sanitize(s)}function ct(s){return O.sanitize(s,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function ot(s){return s.charAt(0).toUpperCase()+s.slice(1)}function ht(s,t){return s?typeof s=="string"?s:t&&s[t]?s[t]:Object.values(s)[0]||"":""}var _=y(()=>{"use strict";u()});import a from"fs";import o from"path";import g from"crypto";import d from"zlib";import{promisify as l}from"util";async function vt(){await h.flush()}var p,B,f,S,xt,C,N,R,j,I,x,v,h,b,z,$,K=y(()=>{u();_();p=l(a.writeFile),B=l(a.readFile),f=l(a.mkdir),S=l(a.rename),xt=l(a.unlink),C=process.env.BOLTDOCS_CACHE_DIR||".boltdocs",N="assets",R="shards",j=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||"2000",10),I=process.env.BOLTDOCS_CACHE_COMPRESS!=="0",x=class{constructor(t){this.limit=t}cache=new Map;get(t){let e=this.cache.get(t);return e!==void 0&&(this.cache.delete(t),this.cache.set(t,e)),e}set(t,e){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.limit){let r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(t,e)}get size(){return this.cache.size}clear(){this.cache.clear()}},v=class{queue=Promise.resolve();pendingCount=0;add(t){this.pendingCount++,this.queue=this.queue.then(t).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}},h=new v,b=class{entries=new Map;cachePath=null;compress;constructor(t={}){if(this.compress=t.compress!==void 0?t.compress:I,t.name){let e=t.root||process.cwd(),r=this.compress?"json.gz":"json";this.cachePath=o.resolve(e,C,`${t.name}.${r}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&!(!this.cachePath||!a.existsSync(this.cachePath)))try{let t=a.readFileSync(this.cachePath);this.cachePath.endsWith(".gz")&&(t=d.gunzipSync(t));let e=JSON.parse(t.toString("utf-8"));this.entries=new Map(Object.entries(e))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1"||!this.cachePath)return;let t=Object.fromEntries(this.entries),e=JSON.stringify(t),r=this.cachePath,n=this.compress;h.add(async()=>{try{await f(o.dirname(r),{recursive:!0});let i=Buffer.from(e);n&&(i=d.gzipSync(i));let c=`${r}.${g.randomBytes(4).toString("hex")}.tmp`;await p(c,i),await S(c,r)}catch{}})}get(t){let e=this.entries.get(t);return!e||m(t)!==e.mtime?null:e.data}set(t,e){this.entries.set(t,{data:e,mtime:m(t)})}isValid(t){let e=this.entries.get(t);return e?m(t)===e.mtime:!1}invalidate(t){this.entries.delete(t)}invalidateAll(){this.entries.clear()}pruneStale(t){for(let e of this.entries.keys())t.has(e)||this.entries.delete(e)}get size(){return this.entries.size}async flush(){await h.flush()}},z=class{index=new Map;memoryCache=new x(j);baseDir;shardsDir;indexPath;constructor(t,e=process.cwd()){this.baseDir=o.resolve(e,C,`transform-${t}`),this.shardsDir=o.resolve(this.baseDir,R),this.indexPath=o.resolve(this.baseDir,"index.json")}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&a.existsSync(this.indexPath))try{let t=a.readFileSync(this.indexPath,"utf-8");this.index=new Map(Object.entries(JSON.parse(t)))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1")return;let t=JSON.stringify(Object.fromEntries(this.index)),e=this.indexPath;h.add(async()=>{await f(o.dirname(e),{recursive:!0}),await p(e,t)})}async getMany(t){let e=new Map,r=[];for(let n of t){let i=this.memoryCache.get(n);i?e.set(n,i):this.index.has(n)&&r.push(n)}if(r.length>0){let n=await Promise.all(r.map(async i=>{let c=this.index.get(i),T=o.resolve(this.shardsDir,`${c}.gz`);try{let w=await B(T),D=d.gunzipSync(w).toString("utf-8");return this.memoryCache.set(i,D),{key:i,val:D}}catch{return null}}));for(let i of n)i&&e.set(i.key,i.val)}return e}get(t){let e=this.memoryCache.get(t);if(e)return e;let r=this.index.get(t);if(!r)return null;let n=o.resolve(this.shardsDir,`${r}.gz`);if(!a.existsSync(n))return null;try{let i=a.readFileSync(n),c=d.gunzipSync(i).toString("utf-8");return this.memoryCache.set(t,c),c}catch{return null}}set(t,e){let r=g.createHash("md5").update(e).digest("hex");this.index.set(t,r),this.memoryCache.set(t,e);let n=o.resolve(this.shardsDir,`${r}.gz`);h.add(async()=>{if(a.existsSync(n))return;await f(this.shardsDir,{recursive:!0});let i=d.gzipSync(Buffer.from(e)),c=`${n}.${g.randomBytes(4).toString("hex")}.tmp`;await p(c,i),await S(c,n)})}get size(){return this.index.size}async flush(){await h.flush()}},$=class{assetsDir;constructor(t=process.cwd()){this.assetsDir=o.resolve(t,C,N)}getFileHash(t){return g.createHash("md5").update(a.readFileSync(t)).digest("hex")}get(t,e){if(!a.existsSync(t))return null;let r=this.getFileHash(t),n=this.getCachedPath(t,`${e}-${r}`);return a.existsSync(n)?n:null}set(t,e,r){let n=this.getFileHash(t),i=this.getCachedPath(t,`${e}-${n}`);h.add(async()=>{await f(this.assetsDir,{recursive:!0});let c=`${i}.${g.randomBytes(4).toString("hex")}.tmp`;await p(c,r),await S(c,i)})}getCachedPath(t,e){let r=o.extname(t),n=o.basename(t,r),i=e.replace(/[^a-z0-9]/gi,"-").toLowerCase();return o.join(this.assetsDir,`${n}.${i}${r}`)}clear(){a.existsSync(this.assetsDir)&&a.rmSync(this.assetsDir,{recursive:!0,force:!0})}async flush(){await h.flush()}}});export{y as a,V as b,q as c,u as d,tt as e,M as f,et as g,st as h,rt as i,A as j,it as k,nt as l,at as m,ct as n,ot as o,ht as p,_ as q,b as r,z as s,$ as t,vt as u,K as v};
@@ -1,3 +0,0 @@
1
- import 'react';
2
- export { a as BoltdocsTab, C as ComponentRoute, b as CreateBoltdocsAppOptions, L as LayoutProps, N as NavbarLink, O as OnThisPageProps, S as SandboxEmbedOptions, d as SandboxFile, e as SandboxFiles, f as SandboxOptions, h as SidebarProps, i as SiteConfig, T as TabsProps } from '../types-opDA2E9-.mjs';
3
- import 'vite';
@@ -1,3 +0,0 @@
1
- import 'react';
2
- export { a as BoltdocsTab, C as ComponentRoute, b as CreateBoltdocsAppOptions, L as LayoutProps, N as NavbarLink, O as OnThisPageProps, S as SandboxEmbedOptions, d as SandboxFile, e as SandboxFiles, f as SandboxOptions, h as SidebarProps, i as SiteConfig, T as TabsProps } from '../types-opDA2E9-.js';
3
- import 'vite';
@@ -1 +0,0 @@
1
- "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var d=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of a(e))!g.call(t,n)&&n!==r&&i(t,n,{get:()=>e[n],enumerable:!(o=s(e,n))||o.enumerable});return t};var c=t=>d(i({},"__esModule",{value:!0}),t);var p={};module.exports=c(p);
File without changes
@@ -1,15 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as ComponentRoute } from './types-opDA2E9-.mjs';
3
-
4
- interface CopyMarkdownProps {
5
- content?: string;
6
- mdxRaw?: string;
7
- route?: ComponentRoute;
8
- config?: boolean | {
9
- text?: string;
10
- icon?: string;
11
- };
12
- }
13
- declare function CopyMarkdown({ content, mdxRaw, config }: CopyMarkdownProps): react_jsx_runtime.JSX.Element | null;
14
-
15
- export { CopyMarkdown as C, type CopyMarkdownProps as a };
@@ -1,15 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as ComponentRoute } from './types-opDA2E9-.js';
3
-
4
- interface CopyMarkdownProps {
5
- content?: string;
6
- mdxRaw?: string;
7
- route?: ComponentRoute;
8
- config?: boolean | {
9
- text?: string;
10
- icon?: string;
11
- };
12
- }
13
- declare function CopyMarkdown({ content, mdxRaw, config }: CopyMarkdownProps): react_jsx_runtime.JSX.Element | null;
14
-
15
- export { CopyMarkdown as C, type CopyMarkdownProps as a };
@@ -1,137 +0,0 @@
1
- import { N as NavbarLink, g as BoltdocsSocialLink, B as BoltdocsConfig, C as ComponentRoute, a as BoltdocsTab } from '../types-opDA2E9-.mjs';
2
- import * as React$1 from 'react';
3
- export { u as useRoutes } from '../use-routes-DrT80Eom.mjs';
4
- import * as react_router_dom from 'react-router-dom';
5
- import { LinkProps } from 'react-router-dom';
6
- import 'vite';
7
-
8
- declare function useNavbar(): {
9
- links: NavbarLink[];
10
- title: string;
11
- logo: any;
12
- logoProps: {
13
- alt: any;
14
- width: any;
15
- height: any;
16
- };
17
- github: string | null;
18
- social: BoltdocsSocialLink[];
19
- config: BoltdocsConfig;
20
- theme: "light" | "dark" | "system";
21
- };
22
-
23
- declare function useSidebar(routes: ComponentRoute[]): {
24
- groups: {
25
- slug: string;
26
- title: string;
27
- routes: ComponentRoute[];
28
- icon?: string;
29
- }[];
30
- ungrouped: ComponentRoute[];
31
- activeRoute: ComponentRoute | undefined;
32
- activePath: string;
33
- config: BoltdocsConfig;
34
- };
35
-
36
- declare function useSearch(routes: ComponentRoute[]): {
37
- isOpen: boolean;
38
- setIsOpen: React$1.Dispatch<React$1.SetStateAction<boolean>>;
39
- query: string;
40
- setQuery: React$1.Dispatch<React$1.SetStateAction<string>>;
41
- list: any[];
42
- input: {
43
- value: string;
44
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
45
- };
46
- };
47
-
48
- interface Heading {
49
- id: string;
50
- text: string;
51
- level: number;
52
- }
53
- /**
54
- * Hook to manage and provide current page headings for the OnThisPage component.
55
- */
56
- declare function useOnThisPage(headings?: Heading[]): {
57
- headings: Heading[];
58
- activeId: string | null;
59
- setActiveId: React$1.Dispatch<React$1.SetStateAction<string | null>>;
60
- };
61
-
62
- declare function useTabs(tabs?: BoltdocsTab[], routes?: ComponentRoute[]): {
63
- tabs: BoltdocsTab[];
64
- activeIndex: number;
65
- indicatorStyle: React$1.CSSProperties;
66
- tabRefs: React$1.RefObject<(HTMLAnchorElement | null)[]>;
67
- activeTabId: string | undefined;
68
- };
69
-
70
- interface VersionOption {
71
- key: string;
72
- label: string;
73
- value: string;
74
- isCurrent: boolean;
75
- }
76
- interface UseVersionReturn {
77
- currentVersion: string | undefined;
78
- currentVersionLabel: string | undefined;
79
- availableVersions: VersionOption[];
80
- handleVersionChange: (version: string) => void;
81
- }
82
- /**
83
- * Hook to manage and switch between different versions of the documentation.
84
- */
85
- declare function useVersion(): UseVersionReturn;
86
-
87
- interface LocaleOption {
88
- key: string;
89
- label: string;
90
- value: string;
91
- isCurrent: boolean;
92
- }
93
- interface UseI18nReturn {
94
- currentLocale: string | undefined;
95
- currentLocaleLabel: string | undefined;
96
- availableLocales: LocaleOption[];
97
- handleLocaleChange: (locale: string) => void;
98
- }
99
- /**
100
- * Hook to manage and switch between different locales (languages) of the documentation.
101
- */
102
- declare function useI18n(): UseI18nReturn;
103
-
104
- /**
105
- * Hook to manage the previous and next button functionality for documentation pages.
106
- * Intelligent: respects current locale, version, and tab to keep navigation logical.
107
- */
108
- declare function usePageNav(): {
109
- prevPage: null;
110
- nextPage: null;
111
- currentRoute: null;
112
- } | {
113
- prevPage: ComponentRoute | null;
114
- nextPage: ComponentRoute | null;
115
- currentRoute: ComponentRoute;
116
- };
117
-
118
- /**
119
- * Hook to generate breadcrumbs based on the current active route.
120
- */
121
- declare function useBreadcrumbs(): {
122
- crumbs: {
123
- label: string;
124
- href?: string;
125
- }[];
126
- activeRoute: ComponentRoute | undefined;
127
- };
128
-
129
- /**
130
- * Hook to automatically localize a path based on the current version and locale context.
131
- * It ensures that navigation preserves the active version and language across the entire site.
132
- */
133
- declare function useLocalizedTo(to: LinkProps['to']): react_router_dom.To;
134
-
135
- declare const useLocation: () => react_router_dom.Location<any>;
136
-
137
- export { type LocaleOption, type UseI18nReturn, type UseVersionReturn, type VersionOption, useBreadcrumbs, useI18n, useLocalizedTo, useLocation, useNavbar, useOnThisPage, usePageNav, useSearch, useSidebar, useTabs, useVersion };
@@ -1,137 +0,0 @@
1
- import { N as NavbarLink, g as BoltdocsSocialLink, B as BoltdocsConfig, C as ComponentRoute, a as BoltdocsTab } from '../types-opDA2E9-.js';
2
- import * as React$1 from 'react';
3
- export { u as useRoutes } from '../use-routes-DNwgTRpU.js';
4
- import * as react_router_dom from 'react-router-dom';
5
- import { LinkProps } from 'react-router-dom';
6
- import 'vite';
7
-
8
- declare function useNavbar(): {
9
- links: NavbarLink[];
10
- title: string;
11
- logo: any;
12
- logoProps: {
13
- alt: any;
14
- width: any;
15
- height: any;
16
- };
17
- github: string | null;
18
- social: BoltdocsSocialLink[];
19
- config: BoltdocsConfig;
20
- theme: "light" | "dark" | "system";
21
- };
22
-
23
- declare function useSidebar(routes: ComponentRoute[]): {
24
- groups: {
25
- slug: string;
26
- title: string;
27
- routes: ComponentRoute[];
28
- icon?: string;
29
- }[];
30
- ungrouped: ComponentRoute[];
31
- activeRoute: ComponentRoute | undefined;
32
- activePath: string;
33
- config: BoltdocsConfig;
34
- };
35
-
36
- declare function useSearch(routes: ComponentRoute[]): {
37
- isOpen: boolean;
38
- setIsOpen: React$1.Dispatch<React$1.SetStateAction<boolean>>;
39
- query: string;
40
- setQuery: React$1.Dispatch<React$1.SetStateAction<string>>;
41
- list: any[];
42
- input: {
43
- value: string;
44
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
45
- };
46
- };
47
-
48
- interface Heading {
49
- id: string;
50
- text: string;
51
- level: number;
52
- }
53
- /**
54
- * Hook to manage and provide current page headings for the OnThisPage component.
55
- */
56
- declare function useOnThisPage(headings?: Heading[]): {
57
- headings: Heading[];
58
- activeId: string | null;
59
- setActiveId: React$1.Dispatch<React$1.SetStateAction<string | null>>;
60
- };
61
-
62
- declare function useTabs(tabs?: BoltdocsTab[], routes?: ComponentRoute[]): {
63
- tabs: BoltdocsTab[];
64
- activeIndex: number;
65
- indicatorStyle: React$1.CSSProperties;
66
- tabRefs: React$1.RefObject<(HTMLAnchorElement | null)[]>;
67
- activeTabId: string | undefined;
68
- };
69
-
70
- interface VersionOption {
71
- key: string;
72
- label: string;
73
- value: string;
74
- isCurrent: boolean;
75
- }
76
- interface UseVersionReturn {
77
- currentVersion: string | undefined;
78
- currentVersionLabel: string | undefined;
79
- availableVersions: VersionOption[];
80
- handleVersionChange: (version: string) => void;
81
- }
82
- /**
83
- * Hook to manage and switch between different versions of the documentation.
84
- */
85
- declare function useVersion(): UseVersionReturn;
86
-
87
- interface LocaleOption {
88
- key: string;
89
- label: string;
90
- value: string;
91
- isCurrent: boolean;
92
- }
93
- interface UseI18nReturn {
94
- currentLocale: string | undefined;
95
- currentLocaleLabel: string | undefined;
96
- availableLocales: LocaleOption[];
97
- handleLocaleChange: (locale: string) => void;
98
- }
99
- /**
100
- * Hook to manage and switch between different locales (languages) of the documentation.
101
- */
102
- declare function useI18n(): UseI18nReturn;
103
-
104
- /**
105
- * Hook to manage the previous and next button functionality for documentation pages.
106
- * Intelligent: respects current locale, version, and tab to keep navigation logical.
107
- */
108
- declare function usePageNav(): {
109
- prevPage: null;
110
- nextPage: null;
111
- currentRoute: null;
112
- } | {
113
- prevPage: ComponentRoute | null;
114
- nextPage: ComponentRoute | null;
115
- currentRoute: ComponentRoute;
116
- };
117
-
118
- /**
119
- * Hook to generate breadcrumbs based on the current active route.
120
- */
121
- declare function useBreadcrumbs(): {
122
- crumbs: {
123
- label: string;
124
- href?: string;
125
- }[];
126
- activeRoute: ComponentRoute | undefined;
127
- };
128
-
129
- /**
130
- * Hook to automatically localize a path based on the current version and locale context.
131
- * It ensures that navigation preserves the active version and language across the entire site.
132
- */
133
- declare function useLocalizedTo(to: LinkProps['to']): react_router_dom.To;
134
-
135
- declare const useLocation: () => react_router_dom.Location<any>;
136
-
137
- export { type LocaleOption, type UseI18nReturn, type UseVersionReturn, type VersionOption, useBreadcrumbs, useI18n, useLocalizedTo, useLocation, useNavbar, useOnThisPage, usePageNav, useSearch, useSidebar, useTabs, useVersion };
@@ -1 +0,0 @@
1
- "use strict";var ee=Object.create;var $=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var se=(e,t)=>{for(var r in t)$(e,r,{get:t[r],enumerable:!0})},A=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of oe(t))!re.call(e,i)&&i!==r&&$(e,i,{get:()=>t[i],enumerable:!(o=te(t,i))||o.enumerable});return e};var ie=(e,t,r)=>(r=e!=null?ee(ne(e)):{},A(t||!e||!e.__esModule?$(r,"default",{value:e,enumerable:!0}):r,e)),ae=e=>A($({},"__esModule",{value:!0}),e);var Pe={};se(Pe,{useBreadcrumbs:()=>Ce,useI18n:()=>xe,useLocalizedTo:()=>Re,useLocation:()=>ye,useNavbar:()=>pe,useOnThisPage:()=>ge,usePageNav:()=>Le,useRoutes:()=>x,useSearch:()=>he,useSidebar:()=>me,useTabs:()=>ve,useVersion:()=>be});module.exports=ae(Pe);var U=require("react-router-dom");var E=require("react"),ce=(0,E.createContext)(null);function C(){let e=(0,E.use)(ce);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}var I=require("react"),ue=require("react/jsx-runtime"),le=(0,I.createContext)(void 0);function j(){let e=(0,I.use)(le);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function W(e,t){return e?typeof e=="string"?e:t&&e[t]?e[t]:Object.values(e)[0]||"":""}var z=require("react-router-dom");var k=require("react"),de=require("react/jsx-runtime"),fe=(0,k.createContext)({preload:()=>{},routes:[]});function D(){return(0,k.use)(fe)}var F=require("zustand"),O=require("zustand/middleware"),R=(0,F.create)()((0,O.persist)(e=>({currentLocale:void 0,currentVersion:void 0,hasHydrated:!1,setLocale:t=>e({currentLocale:t}),setVersion:t=>e({currentVersion:t}),setHasHydrated:t=>e({hasHydrated:t})}),{name:"boltdocs-storage",storage:(0,O.createJSONStorage)(()=>localStorage),partialize:e=>({currentLocale:e.currentLocale,currentVersion:e.currentVersion}),onRehydrateStorage:()=>e=>{e?.setHasHydrated(!0)}}));function x(){let{routes:e}=D(),t=C(),r=(0,z.useLocation)(),o=R(s=>s.currentLocale),i=R(s=>s.currentVersion),a=R(s=>s.hasHydrated),m=e.find(s=>s.path===r.pathname),u=t.i18n?m?.locale||(a?o:void 0)||t.i18n.defaultLocale:void 0,l=t.versions?m?.version||(a?i:void 0)||t.versions.defaultVersion:void 0,g=e.filter(s=>{let b=t.i18n?(s.locale||t.i18n.defaultLocale)===u:!0,T=t.versions?(s.version||t.versions.defaultVersion)===l:!0;if(!(b&&T))return!1;let S=t.i18n;if(S){let B=!!m?.locale,M=!!s.locale;if(e.some(L=>L!==s&&L.filePath===s.filePath&&L.version===s.version&&(L.locale||S.defaultLocale)===(s.locale||S.defaultLocale))&&B!==M)return!1}return!0}),n=t.i18n?.localeConfigs?.[u]?.label||t.i18n?.locales[u]||u,h=t.versions?.versions.find(s=>s.path===l)?.label||l,f=t.i18n?Object.entries(t.i18n.locales).map(([s,b])=>{let T=t.i18n?.localeConfigs?.[s];return{key:s,label:T?.label||b,isCurrent:s===u}}):[],p=t.versions?t.versions.versions.map(s=>({key:s.path,label:s.label,isCurrent:s.path===l})):[];return{routes:g,allRoutes:e,currentRoute:m,currentLocale:u,currentLocaleLabel:n,availableLocales:f,currentVersion:l,currentVersionLabel:h,availableVersions:p,config:t}}function pe(){let e=C(),{theme:t}=j(),r=(0,U.useLocation)(),{currentLocale:o}=x(),i=e.theme||{},a=W(i.title,o)||"Boltdocs",m=i.navbar||[],u=i.socialLinks||[],l=i.githubRepo,g=m.map(f=>{let p=f.href||f.to||f.link||"",s=b=>{let T=r.pathname;if(T===b)return!0;if(!b||b==="/")return T==="/";let S=H=>{let L=H.split("/").filter(Boolean),V=0;return e.i18n?.locales&&L[V]&&e.i18n.locales[L[V]]&&V++,e.versions?.versions&&L[V]&&e.versions.versions.some(_=>_.path===L[V])&&V++,L.slice(V)},B=S(b),M=S(T);return B.length===0?M.length===0:M.length<B.length?!1:B.every((H,L)=>M[L]===H)};return{label:W(f.label||f.text,o),href:p,active:s(p),to:p.startsWith("http")||p.startsWith("//")?"external":void 0}}),c=i.logo,n=c?typeof c=="string"?c:t==="dark"?c.dark:c.light:null,d={alt:(c&&typeof c=="object"?c.alt:void 0)||a,width:c&&typeof c=="object"?c.width:void 0,height:c&&typeof c=="object"?c.height:void 0},h=l?`https://github.com/${l}`:null;return{links:g,title:a,logo:n,logoProps:d,github:h,social:u,config:e,theme:t}}var Q=require("react-router-dom");function me(e){let t=C(),r=(0,Q.useLocation)(),o=n=>n.endsWith("/")&&n.length>1?n.slice(0,-1):n,i=o(r.pathname),a=e.find(n=>o(n.path)===i),m=a?.tab?.toLowerCase(),u=m?e.filter(n=>!n.tab||n.tab.toLowerCase()===m):e,l=[],g=new Map;for(let n of u)n.group?(g.has(n.group)||g.set(n.group,{slug:n.group,title:n.groupTitle||n.group,routes:[],icon:n.groupIcon}),g.get(n.group).routes.push(n)):l.push(n);return{groups:Array.from(g.values()),ungrouped:l,activeRoute:a,activePath:i,config:t}}var y=require("react"),X=require("flexsearch");var N=ie(require("virtual:boltdocs-search"));function he(e){let{currentLocale:t,currentVersion:r}=x(),[o,i]=(0,y.useState)(!1),[a,m]=(0,y.useState)(""),[u,l]=(0,y.useState)(null);(0,y.useEffect)(()=>{if(!o||u)return;let c=new X.Index({preset:"match",tokenize:"full",resolution:9,cache:!0});for(let n of N.default)c.add(n.id,`${n.title} ${n.content}`);l(c)},[o,u]);let g=(0,y.useMemo)(()=>{if(!a)return e.filter(h=>{let f=!t||h.locale===t,p=!r||h.version===r;return f&&p}).slice(0,10).map(h=>({id:h.path,title:h.title,path:h.path,bio:h.description||"",groupTitle:h.groupTitle}));if(!u)return[];let c=u.search(a,{limit:20,suggest:!0}),n=[],d=new Set;for(let h of c){let f=N.default.find(b=>b.id===h);if(!f)continue;let p=!t||f.locale===t,s=!r||f.version===r;!p||!s||d.has(f.url)||(d.add(f.url),n.push({id:f.url,title:f.title,path:f.url,bio:f.display,groupTitle:f.display.split(" > ")[0],isHeading:f.url.includes("#")}))}return n.slice(0,10)},[a,u,t,r,e]);return{isOpen:o,setIsOpen:i,query:a,setQuery:m,list:g,input:{value:a,onChange:c=>m(c.target.value)}}}var q=require("react");function ge(e=[]){let[t,r]=(0,q.useState)(null);return{headings:e,activeId:t,setActiveId:r}}var J=require("react-router-dom"),w=require("react");function ve(e=[],t=[]){let r=(0,J.useLocation)(),o=(0,w.useRef)([]),[i,a]=(0,w.useState)({opacity:0,transform:"translateX(0) scaleX(0)",width:0}),u=t.find(c=>c.path===r.pathname)?.tab?.toLowerCase(),l=e.findIndex(c=>c.id.toLowerCase()===u),g=l===-1?0:l;return(0,w.useEffect)(()=>{let c=o.current[g];c&&a({opacity:1,width:c.offsetWidth,transform:`translateX(${c.offsetLeft}px)`})},[g,e.length,r.pathname]),{tabs:e,activeIndex:g,indicatorStyle:i,tabRefs:o,activeTabId:u}}var K=require("react-router-dom");function P(e,t,r){let o=e;return t&&(o===t||o.startsWith(t+"/"))&&(o=o===t?"index.md":o.slice(t.length+1)),r&&(o===r||o.startsWith(r+"/"))&&(o=o===r?"index.md":o.slice(r.length+1)),o}function be(){let e=(0,K.useNavigate)(),t=x(),{allRoutes:r,currentRoute:o,currentVersion:i,currentLocale:a,config:m}=t,u=m.versions,l=R(n=>n.setVersion),g=n=>{if(!u||n===i)return;l(n);let d=`/docs/${n}`;if(o){let h=P(o.filePath,o.version,o.locale),f=r.find(p=>P(p.filePath,p.version,p.locale)===h&&(p.version||u.defaultVersion)===n&&(a?p.locale===a:!p.locale));if(f)d=f.path;else{let p=r.find(s=>P(s.filePath,s.version,s.locale)==="index.md"&&(s.version||u.defaultVersion)===n&&(a?s.locale===a:!s.locale));d=p?p.path:`/docs/${n}${a?`/${a}`:""}`}}e(d)},c=t.availableVersions.map(n=>({...n,label:n.label,value:n.key}));return{currentVersion:i,currentVersionLabel:t.currentVersionLabel,availableVersions:c,handleVersionChange:g}}var G=require("react-router-dom");function xe(){let e=(0,G.useNavigate)(),t=x(),{allRoutes:r,currentRoute:o,currentLocale:i,config:a}=t,m=a.i18n,u=R(d=>d.setLocale),l=d=>{if(!m||d===i)return;u(d);let h="/";if(o){let f=P(o.filePath,o.version,o.locale),p=r.find(s=>P(s.filePath,s.version,s.locale)===f&&(s.locale||m.defaultLocale)===d&&s.version===o.version);if(p)h=p.path;else{let s=r.find(b=>P(b.filePath,b.version,b.locale)==="index.md"&&(b.locale||m.defaultLocale)===d&&b.version===o.version);h=s?s.path:d===m.defaultLocale?o.version?`/${o.version}`:"/":o.version?`/${o.version}/${d}`:`/${d}`}}else{let f=r.find(p=>(p.filePath==="index.mdx"||p.filePath==="index.md")&&(p.locale||m.defaultLocale)===d&&!p.version);f?h=f.path:h=d===m.defaultLocale?"/":`/${d}`}e(h)},c=a.i18n?.localeConfigs?.[i]?.label||a.i18n?.locales[i]||i,n=a.i18n?Object.entries(a.i18n.locales).map(([d,h])=>{let f=a.i18n?.localeConfigs?.[d];return{key:d,label:f?.label||h,value:d,isCurrent:d===i}}):[];return{currentLocale:i,currentLocaleLabel:c,availableLocales:n,handleLocaleChange:l}}var Y=require("react-router-dom");function Le(){let{routes:e,currentRoute:t}=x(),r=(0,Y.useLocation)();if(!t)return{prevPage:null,nextPage:null,currentRoute:null};let o=t.tab?.toLowerCase(),i=o?e.filter(l=>l.tab?.toLowerCase()===o):e.filter(l=>!l.tab),a=i.findIndex(l=>l.path===r.pathname),m=a>0?i[a-1]:null,u=a!==-1&&a<i.length-1?i[a+1]:null;return{prevPage:m,nextPage:u,currentRoute:t}}function Ce(){let{currentRoute:e}=x(),t=[];return e&&(e.groupTitle&&t.push({label:e.groupTitle}),t.push({label:e.title,href:e.path})),{crumbs:t,activeRoute:e}}function Re(e){let t=C(),{currentLocale:r,currentVersion:o}=x();if(!t||typeof e!="string"||e.startsWith("http")||e.startsWith("//"))return e;let i=t.i18n,a=t.versions;if(!i&&!a)return e;let m=e.startsWith("/docs"),u=e.split("/").filter(Boolean),l=0;u[l]==="docs"&&l++,a&&u.length>l&&a.versions.find(h=>h.path===u[l])&&l++,i&&u.length>l&&i.locales[u[l]]&&l++;let g=u.slice(l),c=[];m&&(c.push("docs"),a&&o&&c.push(o)),i&&r&&r!==i.defaultLocale&&c.push(r),c.push(...g);let n=`/${c.join("/")}`;return n.length>1&&n.endsWith("/")?n.slice(0,-1):n||"/"}var Z=require("react-router-dom"),ye=()=>(0,Z.useLocation)();
@@ -1 +0,0 @@
1
- import{a as l}from"../chunk-DDX52BX4.mjs";import{b as c,c as d,d as f,e as g,f as h,g as i,h as j,i as k}from"../chunk-HRZDSFR5.mjs";import"../chunk-JD3RSDE4.mjs";import{a as e}from"../chunk-2Z5T6EAU.mjs";import{f as a,g as b}from"../chunk-NBCYHLAA.mjs";import"../chunk-JZXLCA2E.mjs";export{k as useBreadcrumbs,i as useI18n,b as useLocalizedTo,l as useLocation,c as useNavbar,f as useOnThisPage,j as usePageNav,a as useRoutes,e as useSearch,d as useSidebar,g as useTabs,h as useVersion};