boltdocs 3.3.5 → 3.4.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.
- package/dist/{adapters-BKzKe2mO.mjs → adapters-BXiBWAKs.mjs} +1 -1
- package/dist/{adapters-DwDTQoCG.cjs → adapters-Czl3WtQt.cjs} +1 -1
- package/dist/{build-B672n0hL.cjs → build-CNkXRdk8.cjs} +1 -1
- package/dist/{build-BVoMHMhw.mjs → build-CqUBsXVC.mjs} +1 -1
- package/dist/client/index.cjs +245 -56
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +246 -60
- package/dist/client/mdx.cjs +1 -1
- package/dist/client/mdx.js +1 -1
- package/dist/client/primitives.cjs +5 -5
- package/dist/client/primitives.d.cts +92 -42
- package/dist/client/primitives.d.ts +101 -51
- package/dist/client/primitives.js +4 -4
- package/dist/client/router.cjs +1 -1
- package/dist/client/router.d.cts +1 -1
- package/dist/client/router.d.ts +1 -1
- package/dist/client/router.js +1 -1
- package/dist/client/theme/reset.css +41 -0
- package/dist/config-B3SEoVjG.cjs +7 -0
- package/dist/{config-PLvresCv.cjs → config-Bfakeadu.cjs} +1 -1
- package/dist/config-CTcfF-0c.mjs +7 -0
- package/dist/dev-D1DmOSjn.mjs +6 -0
- package/dist/dev-DH6cSge8.cjs +6 -0
- package/dist/{docs-layout-CbZ7LDRe.js → docs-layout-CmntYM6p.js} +46 -147
- package/dist/{docs-layout-vzfXed1Q.cjs → docs-layout-DIgxJ5c7.cjs} +23 -130
- package/dist/{doctor-DMECtdK6.cjs → doctor-BLxm2alc.cjs} +1 -1
- package/dist/{doctor-FuFY1jBz.cjs → doctor-Dd-JMTRo.cjs} +1 -1
- package/dist/{doctor-i8Qmd8DJ.mjs → doctor-DogHujrP.mjs} +1 -1
- package/dist/{image-Hnaa2bJd.cjs → image-Bke2ojW1.cjs} +3 -3
- package/dist/{image-B-NDSDuY.js → image-CaY2w0ua.js} +2 -1
- package/dist/index--xbYbT8N.d.ts +343 -0
- package/dist/{index-Bg-JtZeK.d.cts → index-B_o5y34l.d.cts} +112 -13
- package/dist/{index-B3o307nd.d.ts → index-Bx0CUd7Q.d.ts} +112 -13
- package/dist/index-RK7W_Fxy.d.cts +343 -0
- package/dist/{link-CgdI6O2o.js → link-CSe_oD8Y.js} +137 -139
- package/dist/{link-vZjmD-es.cjs → link-Xb69Oy2F.cjs} +144 -169
- package/dist/{mdx-D0Absdq5.cjs → mdx-BCOrMd-P.cjs} +68 -16
- package/dist/{mdx-BRT71V5Q.js → mdx-BijiEbkp.js} +62 -15
- package/dist/{native-nLA4Jr0T.cjs → native-BbtRkce5.cjs} +1 -1
- package/dist/node/cli-entry.cjs +1 -1
- package/dist/node/cli-entry.mjs +1 -1
- package/dist/node/highlight.d.cts +2 -2
- package/dist/node/highlight.d.mts +2 -2
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +19 -37
- package/dist/node/index.d.mts +20 -38
- package/dist/node/index.mjs +1 -1
- package/dist/node/mdx/shiki-adapter.cjs +1 -1
- package/dist/node/mdx/shiki-adapter.d.cts +7 -2
- package/dist/node/mdx/shiki-adapter.d.mts +7 -2
- package/dist/node/mdx/shiki-adapter.mjs +1 -1
- package/dist/node-BgiLCa0I.cjs +39 -0
- package/dist/node-Da3tYBHo.mjs +39 -0
- package/dist/{package-CNqjEYE1.cjs → package-D1gVs5gQ.cjs} +1 -1
- package/dist/{package-sdcKhDhe.mjs → package-YgQJn3Yh.mjs} +1 -1
- package/dist/pages-external-B_r6gvqP.cjs +6 -0
- package/dist/pages-external-jmK7AHaO.mjs +6 -0
- package/dist/{parser-CD8Oo8qh.mjs → parser-CvNZc5s3.mjs} +1 -1
- package/dist/{parser-vPaKvzLp.cjs → parser-DJLWTiO-.cjs} +1 -1
- package/dist/plugin-DW9K2fW5.mjs +69 -0
- package/dist/plugin-NwGKyTJX.cjs +69 -0
- package/dist/{plugin-context-DuSg-Hax.mjs → plugin-context-COh-cbsW.mjs} +1 -1
- package/dist/{plugin-context-CscLcXjH.cjs → plugin-context-FIHaWn6r.cjs} +2 -2
- package/dist/{plugin-lifecycle-BywrEoWK.cjs → plugin-lifecycle-D9fTRaWY.cjs} +1 -1
- package/dist/{registry-BbB6NqSv.d.cts → registry-BFmzj1yg.d.mts} +1 -1
- package/dist/{registry-sJqDv0kE.d.mts → registry-BoswPzYV.d.cts} +1 -1
- package/dist/{resolve-C5rT6B21.mjs → resolve-5puUe7eS.mjs} +1 -1
- package/dist/{resolve-BelytNYR.cjs → resolve-CF4ZLfqx.cjs} +1 -1
- package/dist/route-paths-B6ocUfNY.cjs +6 -0
- package/dist/route-paths-DyDji4bX.mjs +6 -0
- package/dist/{router-CZBxMRAH.js → router-B5e8k4qK.js} +175 -10
- package/dist/{router-C3kygdRK.cjs → router-DKC0Lu0n.cjs} +204 -9
- package/dist/{routes-C3_w9fLX.cjs → routes-D55M8UrH.cjs} +1 -1
- package/dist/routes-DdE6Lfcl.cjs +6 -0
- package/dist/routes-_I_8PQYF.mjs +6 -0
- package/dist/{search-dialog-x_qHU8ty.cjs → search-dialog-BOQRHKTb.cjs} +197 -24
- package/dist/{search-dialog-BqkzDTq2.js → search-dialog-BXil4_7P.js} +190 -29
- package/dist/search-dialog-CwlBd-Mu.cjs +747 -0
- package/dist/{search-dialog-B9mdxsUC.js → search-dialog-D3Obh3eA.js} +1 -1
- package/dist/search-dialog-DeplpVEB.js +717 -0
- package/dist/{search-dialog-DCtm2dyR.cjs → search-dialog-cHXR5zhL.cjs} +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/ssg-static-options-Br1_u9qp.mjs +6 -0
- package/dist/ssg-static-options-CVvGKM8i.cjs +6 -0
- package/dist/types-58Ac3UGI.d.cts +114 -0
- package/dist/types-BwnGf-1E.d.mts +114 -0
- package/dist/virtual-modules-C4-qxFlL.cjs +40 -0
- package/dist/virtual-modules-DiWUKJGP.mjs +40 -0
- package/package.json +8 -5
- package/src/shared/types.ts +133 -987
- package/dist/config-CrsQJHQz.cjs +0 -7
- package/dist/config-DC0nMMk7.mjs +0 -7
- package/dist/dev-B49V6O6p.mjs +0 -6
- package/dist/dev-DbuhNcF5.cjs +0 -6
- package/dist/index-CgWkOCCn.d.cts +0 -1193
- package/dist/index-CuNSD3E2.d.ts +0 -1193
- package/dist/node-BljvHMpS.cjs +0 -23
- package/dist/node-CWxGw4H4.mjs +0 -23
- package/dist/pages-external-BBw8ObVK.mjs +0 -6
- package/dist/pages-external-DPiPFxxP.cjs +0 -6
- package/dist/plugin-BPcm1cU0.mjs +0 -69
- package/dist/plugin-WUhxnpko.cjs +0 -69
- package/dist/routes-C0kb4ue6.cjs +0 -6
- package/dist/routes-C4wrLWwu.mjs +0 -6
- package/dist/search-dialog-Bp_ouN1c.cjs +0 -550
- package/dist/search-dialog-an2BNMj6.js +0 -526
- package/dist/types-Db6zToZH.d.mts +0 -975
- package/dist/types-o7iZ2BAR.d.cts +0 -975
- package/dist/virtual-modules-B2X4Ht2r.mjs +0 -39
- package/dist/virtual-modules-DPsdHKcu.cjs +0 -39
- /package/dist/{audit-CMc_ydRr.mjs → audit-CYAkXXvP.mjs} +0 -0
- /package/dist/{audit-CHkGiV3c.cjs → audit-DxCZZTuX.cjs} +0 -0
- /package/dist/{csp-BiGAG8aF.cjs → csp-B-gc2Iha.cjs} +0 -0
- /package/dist/{csp-D0BOH8ae.mjs → csp-f8DOcI_7.mjs} +0 -0
- /package/dist/{generator-BCrZL53x.cjs → generator-CBAPKY6r.cjs} +0 -0
- /package/dist/{generator-CFukoGa0.mjs → generator-MRpn-yp6.mjs} +0 -0
- /package/dist/{handler-Lex5DbvG.mjs → handler-DBZqoWt2.mjs} +0 -0
- /package/dist/{handler-Ch-Q9NAB.cjs → handler-ryZR9Q41.cjs} +0 -0
- /package/dist/{index-HAwIo4nZ.d.mts → index-CPr34I2C.d.mts} +0 -0
- /package/dist/{native-BYKMke79.mjs → native-DZ6WMwjG.mjs} +0 -0
- /package/dist/{native-BOet8hpE.cjs → native-DeKxny_T.cjs} +0 -0
- /package/dist/{update-check-BXD1atVv.mjs → update-check-BXx8te9F.mjs} +0 -0
- /package/dist/{update-check-DFQZyoSU.cjs → update-check-CiIeC7CX.cjs} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
+
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
const e=require(`./chunk-D1Md3oWO.cjs`),t=require(`./utils-ej6_SjIZ.cjs`),n=require(`./node/cache.cjs`),r=require(`./cache-CJE9nWLE.cjs`);let i=require(`node:path`);i=e.r(i);let a=require(`node:fs`);a=e.r(a);let o=require(`node:crypto`);o=e.r(o);let s=require(`@bdocs/dui`),c=require(`node:fs/promises`);c=e.r(c);let l=require(`fdir`);function u(e){return i.default.resolve(e)}function d(e,t){return o.default.createHash(`sha1`).update(`${u(e)}:${t}`).digest(`hex`).slice(0,16)}function f(e,a,o){let s=d(e,o),c=t.o();return{fingerprint:o,docCache:new n.FileCache({name:`routes-${s}`,root:a}),parserCache:new r.t(a,s),cachedFileList:null,localizedPathCache:new Map,cachedNativeDocs:null,frontmatterHashes:new Map,directoryMeta:null,cachedDirectoryMetaFiles:null,directoryMetaEntries:new Map,discoverySnapshot:null,discoverySnapshotLoaded:!1,discoverySnapshotPath:i.default.resolve(a,c.dir,`route-discovery-${s}.json`)}}function p(e,t=i.default.dirname(i.default.resolve(e))){let n=u(e),r=i.default.resolve(t),a=f(n,r,`legacy`);return{docsDir:n,cacheRoot:r,docCache:a.docCache,parserCache:a.parserCache,cachedFileList:a.cachedFileList,localizedPathCache:a.localizedPathCache,cachedNativeDocs:a.cachedNativeDocs,frontmatterHashes:a.frontmatterHashes,directoryMeta:a.directoryMeta,cachedDirectoryMetaFiles:a.cachedDirectoryMetaFiles,variants:new Map([[`legacy`,a]]),activeVariant:a,activeGenerations:new Map,generationEpoch:0,disposed:!1}}const m=new Map;function h(e,t,n=!1){if(e.disposed)throw Error(`[boltdocs] Route cache context has been disposed.`);let r=e.variants.get(t);if(!r&&(r=f(e.docsDir,e.cacheRoot,t),e.variants.set(t,r),e.variants.size>8)){for(let[n,r]of e.variants)if(!(n===t||r===e.activeVariant)&&!e.activeGenerations.has(n)){e.variants.delete(n);break}}return n&&(e.activeVariant=r,e.docCache=r.docCache,e.parserCache=r.parserCache,e.cachedFileList=r.cachedFileList,e.localizedPathCache=r.localizedPathCache,e.cachedNativeDocs=r.cachedNativeDocs,e.frontmatterHashes=r.frontmatterHashes,e.directoryMeta=r.directoryMeta,e.cachedDirectoryMetaFiles=r.cachedDirectoryMetaFiles),r}function g(e,t){e.activeVariant===t&&(e.cachedFileList=t.cachedFileList,e.cachedNativeDocs=t.cachedNativeDocs,e.frontmatterHashes=t.frontmatterHashes,e.directoryMeta=t.directoryMeta,e.cachedDirectoryMetaFiles=t.cachedDirectoryMetaFiles)}function _(e,t){return o.default.createHash(`sha1`).update(JSON.stringify({basePath:t||e?.base||`/docs`,i18n:e?.i18n,versions:e?.versions,drafts:e?.drafts,featureFlags:e?.featureFlags,fileRouting:e?.experimental?.fileRouting,sidebarGroups:e?.theme?.sidebarGroups})).digest(`hex`)}function v(e,t){let n=u(e),r=m.get(n),i=t??r;(!i||r===i)&&m.delete(n),i&&(i.disposed=!0,i.generationEpoch++,i.activeGenerations.clear(),i.variants.clear(),i.activeVariant=null,i.cachedFileList=null,i.localizedPathCache.clear(),i.cachedNativeDocs=null,i.frontmatterHashes.clear(),i.directoryMeta=null,i.cachedDirectoryMetaFiles=null)}function y(e){let t=u(e),n=m.get(t);return n||(n=p(t),m.set(t,n)),n}const b=p(i.default.resolve(process.cwd(),`docs`)),x=b.docCache;function S(e){try{a.default.rmSync(e.discoverySnapshotPath,{force:!0})}catch{}}function C(e){let t=typeof e==`string`?y(e):e??b;for(let e of t.variants.values())e.cachedFileList=null,e.localizedPathCache.clear(),e.cachedNativeDocs=null,e.frontmatterHashes.clear(),e.directoryMeta=null,e.cachedDirectoryMetaFiles=null,e.discoverySnapshot=null,e.discoverySnapshotLoaded=!1,S(e),e.docCache.invalidateAll(),e.parserCache.clear();t.cachedFileList=null,t.localizedPathCache.clear(),t.cachedNativeDocs=null,t.frontmatterHashes.clear(),t.directoryMeta=null,t.cachedDirectoryMetaFiles=null,t.generationEpoch++}function w(e,t){let n=typeof t==`string`?y(t):t??b,r=i.default.resolve(e);for(let e of n.variants.values()){for(let t of e.directoryMetaEntries.keys())i.default.resolve(t)===r&&e.directoryMetaEntries.delete(t);e.directoryMeta=null,e.cachedDirectoryMetaFiles=null,e.discoverySnapshot=null,e.discoverySnapshotLoaded=!1,S(e)}n.directoryMeta=null,n.cachedDirectoryMetaFiles=null,n.generationEpoch++}function T(e,t){let n=typeof t==`string`?y(t):t??b;for(let t of n.variants.values())t.docCache.invalidate(e),t.parserCache.invalidate(e),t.cachedNativeDocs?.[e.replace(/\\/g,`/`)]&&delete t.cachedNativeDocs[e.replace(/\\/g,`/`)],t.frontmatterHashes.delete(e);n.cachedNativeDocs=n.activeVariant?.cachedNativeDocs??null,n.frontmatterHashes.delete(e),n.generationEpoch++}function E(e){return e.sort((e,t)=>{let n=e.group?e.groupPosition??999:e.sidebarPosition??999,r=t.group?t.groupPosition??999:t.sidebarPosition??999;return n===r?!e.group&&t.group?-1:e.group&&!t.group?1:e.group&&t.group&&e.group!==t.group?(e.groupTitle||e.group).localeCompare(t.groupTitle||t.group):D(e,t):n-r})}function D(e,t){if(e.sidebarPosition!==void 0&&t.sidebarPosition!==void 0){let n=e.sidebarPosition-t.sidebarPosition;if(n!==0)return n}else if(e.sidebarPosition!==void 0)return-1;else if(t.sidebarPosition!==void 0)return 1;let n=e.title.localeCompare(t.title);return n===0?e.path.localeCompare(t.path):n}const O=new Map;function k(e){let{lastUpdated:t,...n}=e;return o.default.createHash(`md5`).update(JSON.stringify(n)).digest(`hex`)}async function A(e){try{let{data:n}=await t.d(e);return k(n)}catch{return``}}function j(e,t,n){let r=n?.frontmatterHashes??t?.frontmatterHashes??O,i=r.get(e);if(i===void 0){let a=(n?.docCache??t?.docCache??x).getStale(e);a?.route?.frontmatter&&(i=k(a.route.frontmatter),r.set(e,i))}return i}function M(e,t,n,r){(r?.frontmatterHashes??n?.frontmatterHashes??O).set(e,t)}function N(e,t,n){(n?.frontmatterHashes??t?.frontmatterHashes??O).delete(e)}const P=Symbol(`route-generation-invalidated`);async function F(e,t,n){let r=[...t].sort((e,t)=>{if(i.default.dirname(e)===i.default.dirname(t)){let n=i.default.basename(e),r=i.default.basename(t);if(n===`_meta.json`&&r===`meta.json`)return-1;if(n===`meta.json`&&r===`_meta.json`)return 1}return e.localeCompare(t)}),a=new Set(r),o=n.directoryMetaEntries;for(let e of o.keys())a.has(e)||o.delete(e);await Promise.all(r.map(async e=>{let t;try{t=await c.default.stat(e)}catch(t){o.delete(e),(0,s.warn)(`Failed to stat meta.json: ${t instanceof Error?t.message:String(t)}`);return}let n=o.get(e);if(!(n&&n.mtimeMs===t.mtimeMs&&n.size===t.size))try{let n=await c.default.readFile(e,`utf8`);o.set(e,{mtimeMs:t.mtimeMs,size:t.size,content:JSON.parse(n)})}catch(t){o.delete(e),(0,s.warn)(`Failed to read meta.json: ${t instanceof Error?t.message:String(t)}`)}}));let l={};for(let t of r){let n=o.get(t);if(!n)continue;let r=i.default.relative(e,i.default.dirname(t)).replace(/\\/g,`/`);l[r||`.`]=n.content}return l}async function I(e,n){if(!n.discoverySnapshotPath||t.o().noCache)return null;if(n.discoverySnapshotLoaded)return n.discoverySnapshot;n.discoverySnapshotLoaded=!0;try{let t=await c.default.readFile(n.discoverySnapshotPath,`utf8`),r=JSON.parse(t),a=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),o=r.files,s=r.directoryMetaFiles,l=r.directories&&typeof r.directories==`object`?Object.entries(r.directories):[],u=i.default.resolve(e),d=await c.default.realpath(u),f=e=>{let t=i.default.resolve(e);return t===u||t.startsWith(`${u}${i.default.sep}`)},p=e=>/\.(?:md|mdx)$/i.test(e),m=e=>{let t=i.default.basename(e);return t===`meta.json`||t===`_meta.json`};if(r.version!==1||!a(o)||!a(s)||!r.directories||typeof r.directories!=`object`||Array.isArray(r.directories)||o.some(e=>!f(e)||!p(e))||s.some(e=>!f(e)||!m(e))||l.some(([e,t])=>!f(e)||typeof t!=`number`||!Number.isFinite(t)))return null;let h=e=>{let t=i.default.resolve(e);return t===d||t.startsWith(`${d}${i.default.sep}`)},g=await Promise.all([...o,...s].map(async e=>{try{return(await c.default.lstat(e)).isFile()?h(await c.default.realpath(e)):!1}catch{return!1}})),_=await Promise.all(l.map(async([e,t])=>{try{let n=await c.default.stat(e);return n.isDirectory()&&n.mtimeMs===t&&h(await c.default.realpath(e))}catch{return!1}}));if(g.every(Boolean)&&_.every(Boolean)){let e={version:1,files:o,directoryMetaFiles:s,directories:Object.fromEntries(l)};return n.discoverySnapshot=e,e}}catch{}return null}async function L(e,n){if(t.o().noCache){e.discoverySnapshot=null,e.discoverySnapshotLoaded=!1;return}e.discoverySnapshot=n,e.discoverySnapshotLoaded=!0;try{await c.default.mkdir(i.default.dirname(e.discoverySnapshotPath),{recursive:!0}),await c.default.writeFile(e.discoverySnapshotPath,JSON.stringify(n))}catch{}}async function R(e,t,n){if(!n){let n=await I(e,t);if(n)return n}let r=await new l.fdir({excludeSymlinks:!0}).withFullPaths().filter(t=>{let n=i.default.basename(t),r=n===`meta.json`||n===`_meta.json`;return!(t.endsWith(`.md`)||t.endsWith(`.mdx`))&&!r?!1:!i.default.relative(e,t).replace(/\\/g,`/`).split(`/`).some(e=>e.startsWith(`_`)&&e!==`_index.md`&&e!==`_index.mdx`&&e!==`_meta.json`)}).crawl(e).withPromise(),a=r.filter(e=>{let t=i.default.basename(e);return t===`meta.json`||t===`_meta.json`}).sort((e,t)=>e.localeCompare(t)),o=r.filter(e=>e.endsWith(`.md`)||e.endsWith(`.mdx`)),s=[/index\./i,/intro/i,/getting-started/i,/readme/i],u=o.map(e=>{let t=s.findIndex(t=>t.test(i.default.basename(e)));return{file:e,score:t===-1?2**53-1:t}});u.sort((e,t)=>e.score-t.score||e.file.localeCompare(t.file));let d=u.map(({file:e})=>e),f=[...d,...a],p=new Set([i.default.resolve(e)]);for(let t of f){let n=i.default.dirname(t);for(;n.startsWith(i.default.resolve(e))&&(p.add(n),n!==i.default.resolve(e));)n=i.default.dirname(n)}let m=await Promise.all([...p].sort().map(async e=>{try{return[e,(await c.default.stat(e)).mtimeMs]}catch{return null}})),h={version:1,files:d,directoryMetaFiles:a,directories:Object.fromEntries(m.filter(e=>e!==null))};return await L(t,h),h}async function z(e,t,n){let r=Array(e.length),i=0;async function a(){for(;i<e.length;){let t=i++;r[t]=await n(e[t])}}return await Promise.all(Array.from({length:Math.min(t,e.length)},()=>a())),r}function B(e,t){w(e,t)}function V(e,t){let n=typeof t==`string`?y(t):t;if(n){let t=e.replace(/\\/g,`/`);(i.default.basename(t)===`meta.json`||i.default.basename(t)===`_meta.json`)&&w(e,n),n.cachedNativeDocs?.[t]&&delete n.cachedNativeDocs[t],T(e,n);return}T(e)}function H(e){if(e){C(e);return}C()}async function U(e,n,r,a=!1,o,s){let c=o??y(e);if(c.disposed)throw Error(`[boltdocs] Route cache context has been disposed.`);let l=_(n,r);if(s&&s.fingerprint!==l)throw Error(`[boltdocs] Route cache variant does not match the requested route configuration fingerprint.`);if(s&&c.variants.get(l)!==s)throw Error(`[boltdocs] Route cache variant does not belong to the requested route cache context.`);let u=c.activeGenerations.get(l);if(u)return u;let d=s??h(c,l),f=c.generationEpoch,p=(async()=>{let o=r||n?.base||`/docs`;await d.docCache.load();let s,l=await R(e,d,a||t.o().noCache);s=l.files.filter(r=>n?.experimental?.fileRouting?!t.u(i.default.relative(e,r)).split(`/`).includes(`pages-external`):!0);let u=l.directoryMetaFiles;d.cachedFileList=s,d.cachedDirectoryMetaFiles=u,d.directoryMeta=await F(e,u,d),g(c,d),d.docCache.pruneStale(new Set(s));let p=process.env.NODE_ENV===`test`||process.env.VITEST===`true`,m,h=!0;for(let e of s)if(!d.docCache.get(e)){h=!1;break}if(h)m=s.map(e=>{let t=d.docCache.get(e);if(!t)throw Error(`[boltdocs] Route cache entry disappeared for ${e}`);return t});else{if(!p&&!d.cachedNativeDocs)try{let{runParser:t}=await import(`@bdocs/parser`);d.cachedNativeDocs=await t(e,!0)}catch{}if(!p&&d.cachedNativeDocs!==null&&d.cachedNativeDocs){let{parseDocFileWithNative:t}=await Promise.resolve().then(()=>require(`./native-BbtRkce5.cjs`)),r=s.filter(e=>!d.cachedNativeDocs?.[e.replace(/\\/g,`/`)]);if(r.length>0)try{let{runParserFiles:t}=await import(`@bdocs/parser`),n=await t(e,r,!0);d.cachedNativeDocs={...d.cachedNativeDocs,...n}}catch{}let i=s.some(e=>!d.cachedNativeDocs?.[e.replace(/\\/g,`/`)])?(await Promise.resolve().then(()=>require(`./parser-DJLWTiO-.cjs`))).parseDocFile:void 0;m=await z(s,32,async r=>{let a=d.docCache.get(r);if(a)return a;let s=r.replace(/\\/g,`/`),c=d.cachedNativeDocs[s];if(c){let i=await t(r,c,e,o,n,d.parserCache);return d.docCache.set(r,i),i}else{if(!i)throw Error(`[boltdocs] Native parser did not return a document for ${r}`);let t=await i(r,e,o,n,d.parserCache);return d.docCache.set(r,t),t}})}else{let{parseDocFile:t}=await Promise.resolve().then(()=>require(`./parser-DJLWTiO-.cjs`));m=await z(s,32,async r=>{let i=d.docCache.get(r);if(i)return i;let a=await t(r,e,o,n,d.parserCache);return d.docCache.set(r,a),a})}}if(c.generationEpoch!==f)throw P;for(let e of m)M(e.route.componentPath,k(e.route.frontmatter||{}),c,d);d.docCache.save();let _=[],v=new Map,y=process.env.NODE_ENV||`development`,b=n?.drafts?.visible||process.env.BOLTDOCS_DRAFTS===`true`||(n?.drafts?.environments?.includes(y)??!1);for(let e of m)if(!(e.route.draft&&!b)){if(e.route.featureFlags&&n?.featureFlags){if(!e.route.featureFlags.every(e=>{let t=n.featureFlags?.[e];return t===!0||t===y}))continue}else if(e.route.featureFlags&&!n?.featureFlags)continue;if(e.inferredCollection){let t=e.inferredCollection;v.has(t)||v.set(t,[]),v.get(t).push(e)}else _.push(e)}let x=new Map,S=[],C=n?.i18n?.defaultLocale||``;for(let e of _)if(e.isGroupIndex&&e.relativeDir&&S.push(e),e.relativeDir){let n=`${e.route.locale||C}:${e.relativeDir}`,r=x.get(n);r?r.position===void 0&&e.inferredGroupPosition!==void 0&&(r.position=e.inferredGroupPosition):(r={title:t.t(e.relativeDir),position:e.inferredGroupPosition},x.set(n,r))}for(let e of S){let t=`${e.route.locale||C}:${e.relativeDir}`,n=x.get(t);e.groupMeta&&(n.title=e.groupMeta.title,e.groupMeta.position!==void 0&&(n.position=e.groupMeta.position),e.groupMeta.icon&&(n.icon=e.groupMeta.icon))}if(n?.theme?.sidebarGroups){let e=n.i18n?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[C];for(let[r,i]of Object.entries(n.theme.sidebarGroups))for(let n of e){let e=`${n}:${r}`,a=x.get(e),o;typeof i.title==`string`?o=i.title:i.title&&(o=i.title[n]||i.title[C]),a?(o&&(a.title=o),i.icon&&(a.icon=i.icon)):x.set(e,{title:o||t.t(r),icon:i.icon})}}let w=Array(_.length);for(let e=0;e<_.length;e++){let n=_[e],r=n.relativeDir,i=n.route.locale||C,a=r?`${i}:${r}`:void 0,o=a?x.get(a):void 0,s;o&&(s=typeof o.title==`string`?o.title:o.title[i]||o.title[C]),w[e]={...n.route,group:r,groupTitle:s||(r?t.t(r):void 0),groupPosition:o?.position,groupIcon:o?.icon}}let T=[];for(let[,e]of v)for(let t of e)T.push({...t.route,collection:t.inferredCollection});T.sort((e,t)=>{let n=e=>{if(!e)return-1/0;let t=new Date(e).getTime();return Number.isFinite(t)?t:-1/0},r=n(e.date),i=n(t.date)-r;return i===0?e.path.localeCompare(t.path):i});let D=w;if(n?.i18n){let e=W(w,n,o,d.localizedPathCache);D=[...w,...e]}let O=[...E(D),...T];if(c.generationEpoch!==f)throw P;return O})();c.activeGenerations.set(l,p);try{return await p}catch(t){if(t!==P)throw t;if(c.disposed)throw Error(`[boltdocs] Route cache context was disposed during generation.`);d.docCache.invalidateAll(),d.parserCache.clear(),c.activeGenerations.get(l)===p&&c.activeGenerations.delete(l);let i=0;for(;i<10;)try{return await U(e,n,r,a,c)}catch(e){if(e!==P)throw e;if(c.disposed)throw Error(`[boltdocs] Route cache context was disposed during generation.`);i++}throw Error(`[boltdocs] Route generation was repeatedly invalidated by concurrent file changes.`)}finally{c.activeGenerations.get(l)===p&&c.activeGenerations.delete(l)}}function W(e,t,n,r){let i=t.i18n;if(!i)return[];let a=i.defaultLocale,o=Array.isArray(i.locales)?i.locales:Object.keys(i.locales),s=[],c=new Map,l=[];for(let t of e){let e=t.locale||a,n=c.get(e);n||(n=new Set,c.set(e,n)),n.add(t.path),e===a&&l.push(t)}for(let e of o){if(e===a)continue;let i=c.get(e)||new Set;for(let o of l){let c=G(o.path,a,e,n,t,r);c!==o.path&&(i.has(c)||s.push({...o,path:c,locale:e}))}}return s}function G(e,t,n,r,i,a){let o=`${e}:${n}`,s=a.get(o);if(s)return s;let c=r.startsWith(`/`)?r:`/`+r,l=c;if(i?.versions){let t=i.versions.prefix||``;for(let n of i.versions.versions){let r=`${c}/${t+n.path}`;if(e.startsWith(r)){l=r;break}let i=`${c}/${n.path}`;if(e.startsWith(i)){l=i;break}}}let u=e.substring(l.length),d=`/${t}`;if(u.startsWith(d+`/`))u=`/`+n+`/`+u.substring(d.length+1);else if(u===d)u=`/`+n;else if(u===`/`||u===``)u=`/`+n;else{let e=u.startsWith(`/`)?``:`/`;u=`/`+n+e+u}let f=l+u;return a.size>2e3&&a.clear(),a.set(o,f),f}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return x}});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
+
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import{t as e}from"./chunk-BFSpntXv.mjs";import{d as t,o as n,t as r,u as i}from"./utils-8lzafE49.mjs";import{n as a}from"./pages-external-jmK7AHaO.mjs";import{FileCache as o}from"./node/cache.mjs";import{t as s}from"./cache-OY4HzIXl.mjs";import c from"node:path";import l from"node:fs";import u from"node:crypto";import{warn as d}from"@bdocs/dui";import f from"node:fs/promises";import{fdir as p}from"fdir";function m(e){return c.resolve(e)}function h(e,t){return u.createHash(`sha1`).update(`${m(e)}:${t}`).digest(`hex`).slice(0,16)}function g(e,t,r){let i=h(e,r),a=n();return{fingerprint:r,docCache:new o({name:`routes-${i}`,root:t}),parserCache:new s(t,i),cachedFileList:null,localizedPathCache:new Map,cachedNativeDocs:null,frontmatterHashes:new Map,directoryMeta:null,cachedDirectoryMetaFiles:null,directoryMetaEntries:new Map,discoverySnapshot:null,discoverySnapshotLoaded:!1,discoverySnapshotPath:c.resolve(t,a.dir,`route-discovery-${i}.json`)}}function _(e,t=c.dirname(c.resolve(e))){let n=m(e),r=c.resolve(t),i=g(n,r,`legacy`);return{docsDir:n,cacheRoot:r,docCache:i.docCache,parserCache:i.parserCache,cachedFileList:i.cachedFileList,localizedPathCache:i.localizedPathCache,cachedNativeDocs:i.cachedNativeDocs,frontmatterHashes:i.frontmatterHashes,directoryMeta:i.directoryMeta,cachedDirectoryMetaFiles:i.cachedDirectoryMetaFiles,variants:new Map([[`legacy`,i]]),activeVariant:i,activeGenerations:new Map,generationEpoch:0,disposed:!1}}const v=new Map;function y(e,t,n=!1){if(e.disposed)throw Error(`[boltdocs] Route cache context has been disposed.`);let r=e.variants.get(t);if(!r&&(r=g(e.docsDir,e.cacheRoot,t),e.variants.set(t,r),e.variants.size>8)){for(let[n,r]of e.variants)if(!(n===t||r===e.activeVariant)&&!e.activeGenerations.has(n)){e.variants.delete(n);break}}return n&&(e.activeVariant=r,e.docCache=r.docCache,e.parserCache=r.parserCache,e.cachedFileList=r.cachedFileList,e.localizedPathCache=r.localizedPathCache,e.cachedNativeDocs=r.cachedNativeDocs,e.frontmatterHashes=r.frontmatterHashes,e.directoryMeta=r.directoryMeta,e.cachedDirectoryMetaFiles=r.cachedDirectoryMetaFiles),r}function b(e,t){e.activeVariant===t&&(e.cachedFileList=t.cachedFileList,e.cachedNativeDocs=t.cachedNativeDocs,e.frontmatterHashes=t.frontmatterHashes,e.directoryMeta=t.directoryMeta,e.cachedDirectoryMetaFiles=t.cachedDirectoryMetaFiles)}function x(e,t){return u.createHash(`sha1`).update(JSON.stringify({basePath:t||e?.base||`/docs`,i18n:e?.i18n,versions:e?.versions,drafts:e?.drafts,featureFlags:e?.featureFlags,fileRouting:e?.experimental?.fileRouting,sidebarGroups:e?.theme?.sidebarGroups})).digest(`hex`)}function S(e,t){let n=m(e),r=v.get(n),i=t??r;(!i||r===i)&&v.delete(n),i&&(i.disposed=!0,i.generationEpoch++,i.activeGenerations.clear(),i.variants.clear(),i.activeVariant=null,i.cachedFileList=null,i.localizedPathCache.clear(),i.cachedNativeDocs=null,i.frontmatterHashes.clear(),i.directoryMeta=null,i.cachedDirectoryMetaFiles=null)}function C(e){let t=m(e),n=v.get(t);return n||(n=_(t),v.set(t,n)),n}const w=_(c.resolve(process.cwd(),`docs`)),T=w.docCache;function E(e){try{l.rmSync(e.discoverySnapshotPath,{force:!0})}catch{}}function D(e){let t=typeof e==`string`?C(e):e??w;for(let e of t.variants.values())e.cachedFileList=null,e.localizedPathCache.clear(),e.cachedNativeDocs=null,e.frontmatterHashes.clear(),e.directoryMeta=null,e.cachedDirectoryMetaFiles=null,e.discoverySnapshot=null,e.discoverySnapshotLoaded=!1,E(e),e.docCache.invalidateAll(),e.parserCache.clear();t.cachedFileList=null,t.localizedPathCache.clear(),t.cachedNativeDocs=null,t.frontmatterHashes.clear(),t.directoryMeta=null,t.cachedDirectoryMetaFiles=null,t.generationEpoch++}function O(e,t){let n=typeof t==`string`?C(t):t??w,r=c.resolve(e);for(let e of n.variants.values()){for(let t of e.directoryMetaEntries.keys())c.resolve(t)===r&&e.directoryMetaEntries.delete(t);e.directoryMeta=null,e.cachedDirectoryMetaFiles=null,e.discoverySnapshot=null,e.discoverySnapshotLoaded=!1,E(e)}n.directoryMeta=null,n.cachedDirectoryMetaFiles=null,n.generationEpoch++}function k(e,t){let n=typeof t==`string`?C(t):t??w;for(let t of n.variants.values())t.docCache.invalidate(e),t.parserCache.invalidate(e),t.cachedNativeDocs?.[e.replace(/\\/g,`/`)]&&delete t.cachedNativeDocs[e.replace(/\\/g,`/`)],t.frontmatterHashes.delete(e);n.cachedNativeDocs=n.activeVariant?.cachedNativeDocs??null,n.frontmatterHashes.delete(e),n.generationEpoch++}function A(e){return e.sort((e,t)=>{let n=e.group?e.groupPosition??999:e.sidebarPosition??999,r=t.group?t.groupPosition??999:t.sidebarPosition??999;return n===r?!e.group&&t.group?-1:e.group&&!t.group?1:e.group&&t.group&&e.group!==t.group?(e.groupTitle||e.group).localeCompare(t.groupTitle||t.group):j(e,t):n-r})}function j(e,t){if(e.sidebarPosition!==void 0&&t.sidebarPosition!==void 0){let n=e.sidebarPosition-t.sidebarPosition;if(n!==0)return n}else if(e.sidebarPosition!==void 0)return-1;else if(t.sidebarPosition!==void 0)return 1;let n=e.title.localeCompare(t.title);return n===0?e.path.localeCompare(t.path):n}const M=new Map;function N(e){let{lastUpdated:t,...n}=e;return u.createHash(`md5`).update(JSON.stringify(n)).digest(`hex`)}async function P(e){try{let{data:n}=await t(e);return N(n)}catch{return``}}function F(e,t,n){let r=n?.frontmatterHashes??t?.frontmatterHashes??M,i=r.get(e);if(i===void 0){let a=(n?.docCache??t?.docCache??T).getStale(e);a?.route?.frontmatter&&(i=N(a.route.frontmatter),r.set(e,i))}return i}function I(e,t,n,r){(r?.frontmatterHashes??n?.frontmatterHashes??M).set(e,t)}function L(e,t,n){(n?.frontmatterHashes??t?.frontmatterHashes??M).delete(e)}var R=e({generateRoutes:()=>J,getExternalRoutePaths:()=>a,invalidateDirectoryMetaFile:()=>G,invalidateFile:()=>K,invalidateRouteCache:()=>q});const z=Symbol(`route-generation-invalidated`);async function B(e,t,n){let r=[...t].sort((e,t)=>{if(c.dirname(e)===c.dirname(t)){let n=c.basename(e),r=c.basename(t);if(n===`_meta.json`&&r===`meta.json`)return-1;if(n===`meta.json`&&r===`_meta.json`)return 1}return e.localeCompare(t)}),i=new Set(r),a=n.directoryMetaEntries;for(let e of a.keys())i.has(e)||a.delete(e);await Promise.all(r.map(async e=>{let t;try{t=await f.stat(e)}catch(t){a.delete(e),d(`Failed to stat meta.json: ${t instanceof Error?t.message:String(t)}`);return}let n=a.get(e);if(!(n&&n.mtimeMs===t.mtimeMs&&n.size===t.size))try{let n=await f.readFile(e,`utf8`);a.set(e,{mtimeMs:t.mtimeMs,size:t.size,content:JSON.parse(n)})}catch(t){a.delete(e),d(`Failed to read meta.json: ${t instanceof Error?t.message:String(t)}`)}}));let o={};for(let t of r){let n=a.get(t);if(!n)continue;let r=c.relative(e,c.dirname(t)).replace(/\\/g,`/`);o[r||`.`]=n.content}return o}async function V(e,t){if(!t.discoverySnapshotPath||n().noCache)return null;if(t.discoverySnapshotLoaded)return t.discoverySnapshot;t.discoverySnapshotLoaded=!0;try{let n=await f.readFile(t.discoverySnapshotPath,`utf8`),r=JSON.parse(n),i=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),a=r.files,o=r.directoryMetaFiles,s=r.directories&&typeof r.directories==`object`?Object.entries(r.directories):[],l=c.resolve(e),u=await f.realpath(l),d=e=>{let t=c.resolve(e);return t===l||t.startsWith(`${l}${c.sep}`)},p=e=>/\.(?:md|mdx)$/i.test(e),m=e=>{let t=c.basename(e);return t===`meta.json`||t===`_meta.json`};if(r.version!==1||!i(a)||!i(o)||!r.directories||typeof r.directories!=`object`||Array.isArray(r.directories)||a.some(e=>!d(e)||!p(e))||o.some(e=>!d(e)||!m(e))||s.some(([e,t])=>!d(e)||typeof t!=`number`||!Number.isFinite(t)))return null;let h=e=>{let t=c.resolve(e);return t===u||t.startsWith(`${u}${c.sep}`)},g=await Promise.all([...a,...o].map(async e=>{try{return(await f.lstat(e)).isFile()?h(await f.realpath(e)):!1}catch{return!1}})),_=await Promise.all(s.map(async([e,t])=>{try{let n=await f.stat(e);return n.isDirectory()&&n.mtimeMs===t&&h(await f.realpath(e))}catch{return!1}}));if(g.every(Boolean)&&_.every(Boolean)){let e={version:1,files:a,directoryMetaFiles:o,directories:Object.fromEntries(s)};return t.discoverySnapshot=e,e}}catch{}return null}async function H(e,t){if(n().noCache){e.discoverySnapshot=null,e.discoverySnapshotLoaded=!1;return}e.discoverySnapshot=t,e.discoverySnapshotLoaded=!0;try{await f.mkdir(c.dirname(e.discoverySnapshotPath),{recursive:!0}),await f.writeFile(e.discoverySnapshotPath,JSON.stringify(t))}catch{}}async function U(e,t,n){if(!n){let n=await V(e,t);if(n)return n}let r=await new p({excludeSymlinks:!0}).withFullPaths().filter(t=>{let n=c.basename(t),r=n===`meta.json`||n===`_meta.json`;return!(t.endsWith(`.md`)||t.endsWith(`.mdx`))&&!r?!1:!c.relative(e,t).replace(/\\/g,`/`).split(`/`).some(e=>e.startsWith(`_`)&&e!==`_index.md`&&e!==`_index.mdx`&&e!==`_meta.json`)}).crawl(e).withPromise(),i=r.filter(e=>{let t=c.basename(e);return t===`meta.json`||t===`_meta.json`}).sort((e,t)=>e.localeCompare(t)),a=r.filter(e=>e.endsWith(`.md`)||e.endsWith(`.mdx`)),o=[/index\./i,/intro/i,/getting-started/i,/readme/i],s=a.map(e=>{let t=o.findIndex(t=>t.test(c.basename(e)));return{file:e,score:t===-1?2**53-1:t}});s.sort((e,t)=>e.score-t.score||e.file.localeCompare(t.file));let l=s.map(({file:e})=>e),u=[...l,...i],d=new Set([c.resolve(e)]);for(let t of u){let n=c.dirname(t);for(;n.startsWith(c.resolve(e))&&(d.add(n),n!==c.resolve(e));)n=c.dirname(n)}let m=await Promise.all([...d].sort().map(async e=>{try{return[e,(await f.stat(e)).mtimeMs]}catch{return null}})),h={version:1,files:l,directoryMetaFiles:i,directories:Object.fromEntries(m.filter(e=>e!==null))};return await H(t,h),h}async function W(e,t,n){let r=Array(e.length),i=0;async function a(){for(;i<e.length;){let t=i++;r[t]=await n(e[t])}}return await Promise.all(Array.from({length:Math.min(t,e.length)},()=>a())),r}function G(e,t){O(e,t)}function K(e,t){let n=typeof t==`string`?C(t):t;if(n){let t=e.replace(/\\/g,`/`);(c.basename(t)===`meta.json`||c.basename(t)===`_meta.json`)&&O(e,n),n.cachedNativeDocs?.[t]&&delete n.cachedNativeDocs[t],k(e,n);return}k(e)}function q(e){if(e){D(e);return}D()}async function J(e,t,a,o=!1,s,l){let u=s??C(e);if(u.disposed)throw Error(`[boltdocs] Route cache context has been disposed.`);let d=x(t,a);if(l&&l.fingerprint!==d)throw Error(`[boltdocs] Route cache variant does not match the requested route configuration fingerprint.`);if(l&&u.variants.get(d)!==l)throw Error(`[boltdocs] Route cache variant does not belong to the requested route cache context.`);let f=u.activeGenerations.get(d);if(f)return f;let p=l??y(u,d),m=u.generationEpoch,h=(async()=>{let s=a||t?.base||`/docs`;await p.docCache.load();let l,d=await U(e,p,o||n().noCache);l=d.files.filter(n=>t?.experimental?.fileRouting?!i(c.relative(e,n)).split(`/`).includes(`pages-external`):!0);let f=d.directoryMetaFiles;p.cachedFileList=l,p.cachedDirectoryMetaFiles=f,p.directoryMeta=await B(e,f,p),b(u,p),p.docCache.pruneStale(new Set(l));let h=process.env.NODE_ENV===`test`||process.env.VITEST===`true`,g,_=!0;for(let e of l)if(!p.docCache.get(e)){_=!1;break}if(_)g=l.map(e=>{let t=p.docCache.get(e);if(!t)throw Error(`[boltdocs] Route cache entry disappeared for ${e}`);return t});else{if(!h&&!p.cachedNativeDocs)try{let{runParser:t}=await import(`@bdocs/parser`);p.cachedNativeDocs=await t(e,!0)}catch{}if(!h&&p.cachedNativeDocs!==null&&p.cachedNativeDocs){let{parseDocFileWithNative:n}=await import(`./native-DZ6WMwjG.mjs`).then(e=>e.t),r=l.filter(e=>!p.cachedNativeDocs?.[e.replace(/\\/g,`/`)]);if(r.length>0)try{let{runParserFiles:t}=await import(`@bdocs/parser`),n=await t(e,r,!0);p.cachedNativeDocs={...p.cachedNativeDocs,...n}}catch{}let i=l.some(e=>!p.cachedNativeDocs?.[e.replace(/\\/g,`/`)])?(await import(`./parser-CvNZc5s3.mjs`)).parseDocFile:void 0;g=await W(l,32,async r=>{let a=p.docCache.get(r);if(a)return a;let o=r.replace(/\\/g,`/`),c=p.cachedNativeDocs[o];if(c){let i=await n(r,c,e,s,t,p.parserCache);return p.docCache.set(r,i),i}else{if(!i)throw Error(`[boltdocs] Native parser did not return a document for ${r}`);let n=await i(r,e,s,t,p.parserCache);return p.docCache.set(r,n),n}})}else{let{parseDocFile:n}=await import(`./parser-CvNZc5s3.mjs`);g=await W(l,32,async r=>{let i=p.docCache.get(r);if(i)return i;let a=await n(r,e,s,t,p.parserCache);return p.docCache.set(r,a),a})}}if(u.generationEpoch!==m)throw z;for(let e of g)I(e.route.componentPath,N(e.route.frontmatter||{}),u,p);p.docCache.save();let v=[],y=new Map,x=process.env.NODE_ENV||`development`,S=t?.drafts?.visible||process.env.BOLTDOCS_DRAFTS===`true`||(t?.drafts?.environments?.includes(x)??!1);for(let e of g)if(!(e.route.draft&&!S)){if(e.route.featureFlags&&t?.featureFlags){if(!e.route.featureFlags.every(e=>{let n=t.featureFlags?.[e];return n===!0||n===x}))continue}else if(e.route.featureFlags&&!t?.featureFlags)continue;if(e.inferredCollection){let t=e.inferredCollection;y.has(t)||y.set(t,[]),y.get(t).push(e)}else v.push(e)}let C=new Map,w=[],T=t?.i18n?.defaultLocale||``;for(let e of v)if(e.isGroupIndex&&e.relativeDir&&w.push(e),e.relativeDir){let t=`${e.route.locale||T}:${e.relativeDir}`,n=C.get(t);n?n.position===void 0&&e.inferredGroupPosition!==void 0&&(n.position=e.inferredGroupPosition):(n={title:r(e.relativeDir),position:e.inferredGroupPosition},C.set(t,n))}for(let e of w){let t=`${e.route.locale||T}:${e.relativeDir}`,n=C.get(t);e.groupMeta&&(n.title=e.groupMeta.title,e.groupMeta.position!==void 0&&(n.position=e.groupMeta.position),e.groupMeta.icon&&(n.icon=e.groupMeta.icon))}if(t?.theme?.sidebarGroups){let e=t.i18n?Array.isArray(t.i18n.locales)?t.i18n.locales:Object.keys(t.i18n.locales):[T];for(let[n,i]of Object.entries(t.theme.sidebarGroups))for(let t of e){let e=`${t}:${n}`,a=C.get(e),o;typeof i.title==`string`?o=i.title:i.title&&(o=i.title[t]||i.title[T]),a?(o&&(a.title=o),i.icon&&(a.icon=i.icon)):C.set(e,{title:o||r(n),icon:i.icon})}}let E=Array(v.length);for(let e=0;e<v.length;e++){let t=v[e],n=t.relativeDir,i=t.route.locale||T,a=n?`${i}:${n}`:void 0,o=a?C.get(a):void 0,s;o&&(s=typeof o.title==`string`?o.title:o.title[i]||o.title[T]),E[e]={...t.route,group:n,groupTitle:s||(n?r(n):void 0),groupPosition:o?.position,groupIcon:o?.icon}}let D=[];for(let[,e]of y)for(let t of e)D.push({...t.route,collection:t.inferredCollection});D.sort((e,t)=>{let n=e=>{if(!e)return-1/0;let t=new Date(e).getTime();return Number.isFinite(t)?t:-1/0},r=n(e.date),i=n(t.date)-r;return i===0?e.path.localeCompare(t.path):i});let O=E;if(t?.i18n){let e=Y(E,t,s,p.localizedPathCache);O=[...E,...e]}let k=[...A(O),...D];if(u.generationEpoch!==m)throw z;return k})();u.activeGenerations.set(d,h);try{return await h}catch(n){if(n!==z)throw n;if(u.disposed)throw Error(`[boltdocs] Route cache context was disposed during generation.`);p.docCache.invalidateAll(),p.parserCache.clear(),u.activeGenerations.get(d)===h&&u.activeGenerations.delete(d);let r=0;for(;r<10;)try{return await J(e,t,a,o,u)}catch(e){if(e!==z)throw e;if(u.disposed)throw Error(`[boltdocs] Route cache context was disposed during generation.`);r++}throw Error(`[boltdocs] Route generation was repeatedly invalidated by concurrent file changes.`)}finally{u.activeGenerations.get(d)===h&&u.activeGenerations.delete(d)}}function Y(e,t,n,r){let i=t.i18n;if(!i)return[];let a=i.defaultLocale,o=Array.isArray(i.locales)?i.locales:Object.keys(i.locales),s=[],c=new Map,l=[];for(let t of e){let e=t.locale||a,n=c.get(e);n||(n=new Set,c.set(e,n)),n.add(t.path),e===a&&l.push(t)}for(let e of o){if(e===a)continue;let i=c.get(e)||new Set;for(let o of l){let c=X(o.path,a,e,n,t,r);c!==o.path&&(i.has(c)||s.push({...o,path:c,locale:e}))}}return s}function X(e,t,n,r,i,a){let o=`${e}:${n}`,s=a.get(o);if(s)return s;let c=r.startsWith(`/`)?r:`/`+r,l=c;if(i?.versions){let t=i.versions.prefix||``;for(let n of i.versions.versions){let r=`${c}/${t+n.path}`;if(e.startsWith(r)){l=r;break}let i=`${c}/${n.path}`;if(e.startsWith(i)){l=i;break}}}let u=e.substring(l.length),d=`/${t}`;if(u.startsWith(d+`/`))u=`/`+n+`/`+u.substring(d.length+1);else if(u===d)u=`/`+n;else if(u===`/`||u===``)u=`/`+n;else{let e=u.startsWith(`/`)?``:`/`;u=`/`+n+e+u}let f=l+u;return a.size>2e3&&a.clear(),a.set(o,f),f}export{P as a,I as c,C as d,y as f,R as i,S as l,O as m,K as n,F as o,x as p,q as r,L as s,J as t,T as u};
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
const require_router = require('./router-
|
|
7
|
-
const require_link = require('./link-
|
|
6
|
+
const require_router = require('./router-DKC0Lu0n.cjs');
|
|
7
|
+
const require_link = require('./link-Xb69Oy2F.cjs');
|
|
8
8
|
let react = require("react");
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
let react_aria_components = require("react-aria-components");
|
|
11
11
|
react_aria_components = require_router.__toESM(react_aria_components);
|
|
12
12
|
|
|
13
13
|
//#region src/client/components/primitives/button.tsx
|
|
14
|
-
function Button({ ...props }) {
|
|
14
|
+
function Button$1({ ...props }) {
|
|
15
15
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Button, { ...props });
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -39,6 +39,15 @@ var ErrorBoundary = class extends react.Component {
|
|
|
39
39
|
error: null
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
|
+
prevResetKeys = [];
|
|
43
|
+
componentDidUpdate(prevProps) {
|
|
44
|
+
if (prevProps.resetKeys !== this.props.resetKeys && this.state.hasError && this.props.resetKeys?.length && this.props.resetKeys.some((key, i) => !Object.is(key, this.prevResetKeys[i]))) {
|
|
45
|
+
this.prevResetKeys = this.props.resetKeys;
|
|
46
|
+
this.resetErrorBoundary();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.prevResetKeys = this.props.resetKeys ?? [];
|
|
50
|
+
}
|
|
42
51
|
render() {
|
|
43
52
|
const { hasError, error } = this.state;
|
|
44
53
|
const { children, fallback, FallbackComponent } = this.props;
|
|
@@ -68,7 +77,7 @@ function ErrorBoundaryFallback({ error, resetErrorBoundary, className, titleClas
|
|
|
68
77
|
className: require_link.cn("text-sm text-muted max-w-sm leading-relaxed", messageClassName),
|
|
69
78
|
children: error?.message || "An unexpected error occurred while rendering this page."
|
|
70
79
|
}),
|
|
71
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
80
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button$1, {
|
|
72
81
|
className: require_link.cn("rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 cursor-pointer outline-none select-none", buttonClassName),
|
|
73
82
|
onPress: resetErrorBoundary,
|
|
74
83
|
children: "Try again"
|
|
@@ -149,13 +158,46 @@ function NavbarCenter({ children, className }) {
|
|
|
149
158
|
children
|
|
150
159
|
});
|
|
151
160
|
}
|
|
152
|
-
function NavbarLogo({ src, alt, width = 24, height = 24, className, logoClassName, href = "/" }) {
|
|
153
|
-
const config =
|
|
161
|
+
function NavbarLogo({ src, srcLight, srcDark, alt, width = 24, height = 24, className, logoClassName, logoLightClassName, logoDarkClassName, href = "/" }) {
|
|
162
|
+
const config = require_router.useConfig();
|
|
163
|
+
const light = srcLight ?? src;
|
|
164
|
+
const hasPair = Boolean(srcDark) && srcDark !== light;
|
|
165
|
+
const resolve = (value) => require_link.resolvePublicAssetUrl(value, config.base);
|
|
154
166
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_link.Link, {
|
|
155
167
|
href,
|
|
156
168
|
className: require_link.cn("flex items-center gap-2 shrink-0 outline-none", className),
|
|
157
|
-
children:
|
|
158
|
-
|
|
169
|
+
children: hasPair ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
170
|
+
react_jsx_runtime.Fragment,
|
|
171
|
+
/**
|
|
172
|
+
* Both variants are always in the DOM and CSS picks the visible one.
|
|
173
|
+
*
|
|
174
|
+
* Rendering only the active source would make the markup depend on the
|
|
175
|
+
* resolved theme, which the server cannot know: it would render one
|
|
176
|
+
* `src` while the browser renders the other, the hoisted preload `href`
|
|
177
|
+
* would no longer match, and React would throw away the server HTML
|
|
178
|
+
* with a hydration mismatch. Two elements that are identical on both
|
|
179
|
+
* sides cost one extra request-free `<img>` and remove the whole class
|
|
180
|
+
* of bug.
|
|
181
|
+
*/
|
|
182
|
+
{ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
183
|
+
src: resolve(light),
|
|
184
|
+
alt,
|
|
185
|
+
width,
|
|
186
|
+
height,
|
|
187
|
+
fetchPriority: "high",
|
|
188
|
+
"data-logo-theme": "light",
|
|
189
|
+
className: require_link.cn("h-6 w-6 object-contain dark:hidden", logoClassName, logoLightClassName)
|
|
190
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
191
|
+
src: resolve(srcDark),
|
|
192
|
+
alt,
|
|
193
|
+
width,
|
|
194
|
+
height,
|
|
195
|
+
"data-logo-theme": "dark",
|
|
196
|
+
"aria-hidden": "true",
|
|
197
|
+
className: require_link.cn("hidden h-6 w-6 object-contain dark:block", logoClassName, logoDarkClassName)
|
|
198
|
+
})] }
|
|
199
|
+
) : src ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
200
|
+
src: resolve(src),
|
|
159
201
|
alt,
|
|
160
202
|
width,
|
|
161
203
|
height,
|
|
@@ -165,17 +207,20 @@ function NavbarLogo({ src, alt, width = 24, height = 24, className, logoClassNam
|
|
|
165
207
|
});
|
|
166
208
|
}
|
|
167
209
|
function NavbarTitle({ children, className, linkClassName, href = "/" }) {
|
|
210
|
+
const titleText = typeof children === "string" || typeof children === "number" ? String(children) : void 0;
|
|
168
211
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_link.Link, {
|
|
169
212
|
href,
|
|
170
213
|
className: require_link.cn(linkClassName),
|
|
214
|
+
"aria-label": titleText ? `Go to ${titleText} home` : void 0,
|
|
171
215
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
172
216
|
className: require_link.cn("text-lg font-bold tracking-tight hidden sm:inline-block", className),
|
|
173
217
|
children
|
|
174
218
|
})
|
|
175
219
|
});
|
|
176
220
|
}
|
|
177
|
-
function NavbarLinks({ children, className }) {
|
|
221
|
+
function NavbarLinks({ children, className, label }) {
|
|
178
222
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
|
|
223
|
+
"aria-label": label,
|
|
179
224
|
className: require_link.cn("hidden md:flex items-center gap-6 text-sm font-medium", className),
|
|
180
225
|
children
|
|
181
226
|
});
|
|
@@ -184,6 +229,7 @@ function NavbarLink({ label, href, to, className, iconClassName }) {
|
|
|
184
229
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_link.Link, {
|
|
185
230
|
href,
|
|
186
231
|
target: to === "external" ? "_blank" : void 0,
|
|
232
|
+
prefetch: to === "external" ? "none" : "viewport",
|
|
187
233
|
className: require_link.cn("transition-all outline-none", className),
|
|
188
234
|
children: [label, to === "external" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
189
235
|
className: require_link.cn("ml-1 inline-block", iconClassName),
|
|
@@ -236,18 +282,20 @@ function NavbarDropdownItem({ href, label, className }) {
|
|
|
236
282
|
children: label
|
|
237
283
|
});
|
|
238
284
|
}
|
|
239
|
-
function NavbarSearchTriggerDesktop({ className, onPress, children }) {
|
|
285
|
+
function NavbarSearchTriggerDesktop({ className, onPress, children, ...props }) {
|
|
240
286
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Button, {
|
|
287
|
+
...props,
|
|
241
288
|
onPress,
|
|
242
289
|
className: require_link.cn("hidden lg:flex items-center justify-between gap-2 px-3 py-2 text-sm outline-none cursor-pointer w-full max-w-[720px]", className),
|
|
243
290
|
children
|
|
244
291
|
});
|
|
245
292
|
}
|
|
246
|
-
function NavbarSearchTriggerMobile({ className, onPress, children }) {
|
|
293
|
+
function NavbarSearchTriggerMobile({ className, onPress, children, ...props }) {
|
|
247
294
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Button, {
|
|
295
|
+
...props,
|
|
248
296
|
onPress,
|
|
249
297
|
className: require_link.cn("lg:hidden flex h-10 w-10 items-center justify-center outline-none cursor-pointer", className),
|
|
250
|
-
"aria-label": "Search",
|
|
298
|
+
"aria-label": props["aria-label"] || "Search",
|
|
251
299
|
children
|
|
252
300
|
});
|
|
253
301
|
}
|
|
@@ -330,6 +378,7 @@ function NavbarMobileMenu({ isOpen, onClose, children, className, overlayClassNa
|
|
|
330
378
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_link.X, { size: 24 })
|
|
331
379
|
})]
|
|
332
380
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
|
|
381
|
+
"aria-label": "Mobile navigation",
|
|
333
382
|
className: require_link.cn("flex-1 overflow-y-auto flex flex-col gap-4", navClassName),
|
|
334
383
|
children
|
|
335
384
|
})]
|
|
@@ -405,10 +454,123 @@ Navbar.MobileMenu = NavbarMobileMenu;
|
|
|
405
454
|
Navbar.MobileLink = NavbarMobileLink;
|
|
406
455
|
Navbar.MobileLinkItem = NavbarMobileLinkItem;
|
|
407
456
|
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region src/client/hooks/use-search-highlight.ts
|
|
459
|
+
/**
|
|
460
|
+
* Hook to highlight search terms based on the 'hl' query parameter.
|
|
461
|
+
*/
|
|
462
|
+
function useSearchHighlight(containerSelector = ".boltdocs-page") {
|
|
463
|
+
const { search } = require_router.useLocation();
|
|
464
|
+
const query = new URLSearchParams(search).get("hl");
|
|
465
|
+
(0, react.useEffect)(() => {
|
|
466
|
+
if (!query) {
|
|
467
|
+
clearHighlights(containerSelector);
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
const container = document.querySelector(containerSelector);
|
|
471
|
+
if (!container) return;
|
|
472
|
+
const target = container;
|
|
473
|
+
let rafId;
|
|
474
|
+
const observer = new MutationObserver((mutations) => {
|
|
475
|
+
if (mutations.some((m) => {
|
|
476
|
+
const addedNodes = Array.from(m.addedNodes);
|
|
477
|
+
const removedNodes = Array.from(m.removedNodes);
|
|
478
|
+
return addedNodes.some((n) => !(n instanceof HTMLElement && n.hasAttribute("data-search-highlight"))) || removedNodes.some((n) => !(n instanceof HTMLElement && n.hasAttribute("data-search-highlight")));
|
|
479
|
+
})) run();
|
|
480
|
+
});
|
|
481
|
+
function run() {
|
|
482
|
+
cancelAnimationFrame(rafId);
|
|
483
|
+
rafId = requestAnimationFrame(() => {
|
|
484
|
+
observer.disconnect();
|
|
485
|
+
clearHighlights(containerSelector);
|
|
486
|
+
const terms = (query ?? "").split(/\s+/).map((t) => t.trim()).filter((t) => t.length >= 2);
|
|
487
|
+
if (terms.length > 0) highlightTerms(target, terms);
|
|
488
|
+
observer.observe(target, {
|
|
489
|
+
childList: true,
|
|
490
|
+
subtree: true
|
|
491
|
+
});
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
run();
|
|
495
|
+
return () => {
|
|
496
|
+
cancelAnimationFrame(rafId);
|
|
497
|
+
observer.disconnect();
|
|
498
|
+
clearHighlights(containerSelector);
|
|
499
|
+
};
|
|
500
|
+
}, [query, containerSelector]);
|
|
501
|
+
}
|
|
502
|
+
function clearHighlights(selector) {
|
|
503
|
+
document.querySelectorAll(`${selector} mark[data-search-highlight]`).forEach((mark) => {
|
|
504
|
+
try {
|
|
505
|
+
const parent = mark.parentNode;
|
|
506
|
+
if (parent?.contains(mark)) {
|
|
507
|
+
const text = mark.textContent || "";
|
|
508
|
+
parent.replaceChild(document.createTextNode(text), mark);
|
|
509
|
+
}
|
|
510
|
+
} catch {}
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
function createSearchHighlightRegex(terms) {
|
|
514
|
+
const accentMap = {
|
|
515
|
+
a: "[aáàäâãåāăą]",
|
|
516
|
+
c: "[cçćč]",
|
|
517
|
+
d: "[dďđ]",
|
|
518
|
+
e: "[eéèëêėęě]",
|
|
519
|
+
g: "[gğģ]",
|
|
520
|
+
i: "[iíìïîīįı]",
|
|
521
|
+
l: "[lĺļł]",
|
|
522
|
+
n: "[nñńň]",
|
|
523
|
+
o: "[oóòöôõøōő]",
|
|
524
|
+
r: "[rřŕ]",
|
|
525
|
+
s: "[sśšş]",
|
|
526
|
+
t: "[tťţ]",
|
|
527
|
+
u: "[uúùüûūůűų]",
|
|
528
|
+
y: "[yýÿ]",
|
|
529
|
+
z: "[zžźż]"
|
|
530
|
+
};
|
|
531
|
+
const escapeTerm = (term) => [...term].map((char) => {
|
|
532
|
+
return accentMap[char.toLocaleLowerCase()] ?? char.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
533
|
+
}).join("");
|
|
534
|
+
const uniqueTerms = [...new Set(terms.map((term) => term.trim()).filter(Boolean))].sort((left, right) => right.length - left.length);
|
|
535
|
+
if (uniqueTerms.length === 0) return null;
|
|
536
|
+
return new RegExp(`(${uniqueTerms.map(escapeTerm).join("|")})`, "gi");
|
|
537
|
+
}
|
|
538
|
+
function highlightTerms(container, terms) {
|
|
539
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_TEXT, { acceptNode: (node) => {
|
|
540
|
+
const parent = node.parentElement;
|
|
541
|
+
if (parent && (parent.tagName === "SCRIPT" || parent.tagName === "STYLE" || parent.tagName === "MARK" || parent.closest("pre") || parent.closest("code"))) return NodeFilter.FILTER_REJECT;
|
|
542
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
543
|
+
} });
|
|
544
|
+
const nodes = [];
|
|
545
|
+
let node = walker.nextNode();
|
|
546
|
+
while (node) {
|
|
547
|
+
nodes.push(node);
|
|
548
|
+
node = walker.nextNode();
|
|
549
|
+
}
|
|
550
|
+
const regex = createSearchHighlightRegex(terms);
|
|
551
|
+
if (!regex) return;
|
|
552
|
+
nodes.forEach((textNode) => {
|
|
553
|
+
const text = textNode.textContent;
|
|
554
|
+
regex.lastIndex = 0;
|
|
555
|
+
if (text && regex.test(text)) {
|
|
556
|
+
const fragment = document.createDocumentFragment();
|
|
557
|
+
text.split(regex).forEach((part, index) => {
|
|
558
|
+
if (index % 2 === 1) {
|
|
559
|
+
const mark = document.createElement("mark");
|
|
560
|
+
mark.textContent = part;
|
|
561
|
+
mark.setAttribute("data-search-highlight", "true");
|
|
562
|
+
fragment.appendChild(mark);
|
|
563
|
+
} else if (part) fragment.appendChild(document.createTextNode(part));
|
|
564
|
+
});
|
|
565
|
+
if (textNode.parentNode) textNode.parentNode.replaceChild(fragment, textNode);
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
|
|
408
570
|
//#endregion
|
|
409
571
|
//#region src/client/components/primitives/search-dialog.tsx
|
|
410
572
|
/**
|
|
411
|
-
* Pure, unstyled SearchDialog Overlay (maps to
|
|
573
|
+
* Pure, unstyled SearchDialog Overlay (maps to ModalOverlay)
|
|
412
574
|
*/
|
|
413
575
|
function SearchDialog({ className, ...props }) {
|
|
414
576
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.ModalOverlay, {
|
|
@@ -417,7 +579,7 @@ function SearchDialog({ className, ...props }) {
|
|
|
417
579
|
});
|
|
418
580
|
}
|
|
419
581
|
/**
|
|
420
|
-
* Pure, unstyled SearchDialog Content (maps to
|
|
582
|
+
* Pure, unstyled SearchDialog Content (maps to Modal)
|
|
421
583
|
*/
|
|
422
584
|
function SearchDialogContent({ className, ...props }) {
|
|
423
585
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Modal, {
|
|
@@ -426,7 +588,7 @@ function SearchDialogContent({ className, ...props }) {
|
|
|
426
588
|
});
|
|
427
589
|
}
|
|
428
590
|
/**
|
|
429
|
-
* Pure, unstyled SearchDialog Dialog (maps to
|
|
591
|
+
* Pure, unstyled SearchDialog Dialog (maps to Dialog)
|
|
430
592
|
*/
|
|
431
593
|
function SearchDialogDialog({ children, className, ...props }) {
|
|
432
594
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Dialog, {
|
|
@@ -436,7 +598,7 @@ function SearchDialogDialog({ children, className, ...props }) {
|
|
|
436
598
|
});
|
|
437
599
|
}
|
|
438
600
|
/**
|
|
439
|
-
* Pure, unstyled SearchDialog Input Field (maps to
|
|
601
|
+
* Pure, unstyled SearchDialog Input Field (maps to SearchField)
|
|
440
602
|
*/
|
|
441
603
|
function SearchDialogField({ className, ...props }) {
|
|
442
604
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.SearchField, {
|
|
@@ -445,7 +607,7 @@ function SearchDialogField({ className, ...props }) {
|
|
|
445
607
|
});
|
|
446
608
|
}
|
|
447
609
|
/**
|
|
448
|
-
* Pure, unstyled SearchInput (maps to
|
|
610
|
+
* Pure, unstyled SearchInput (maps to Input)
|
|
449
611
|
*/
|
|
450
612
|
function SearchDialogSearchInput({ className, ...props }) {
|
|
451
613
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Input, {
|
|
@@ -454,7 +616,7 @@ function SearchDialogSearchInput({ className, ...props }) {
|
|
|
454
616
|
});
|
|
455
617
|
}
|
|
456
618
|
/**
|
|
457
|
-
* Pure, unstyled Clear Button (maps to
|
|
619
|
+
* Pure, unstyled Clear Button (maps to Button with slot="clear")
|
|
458
620
|
*/
|
|
459
621
|
function SearchDialogClearButton({ className, ...props }) {
|
|
460
622
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Button, {
|
|
@@ -464,13 +626,12 @@ function SearchDialogClearButton({ className, ...props }) {
|
|
|
464
626
|
});
|
|
465
627
|
}
|
|
466
628
|
/**
|
|
467
|
-
* Pure, unstyled Autocomplete container (maps to
|
|
629
|
+
* Pure, unstyled Autocomplete container (maps to Autocomplete)
|
|
468
630
|
*/
|
|
469
631
|
function SearchDialogAutocomplete({ children, className, innerClassName, ...props }) {
|
|
470
|
-
const Autocomplete = react_aria_components.Autocomplete;
|
|
471
632
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
472
633
|
className: require_link.cn("flex-1 min-h-0", className),
|
|
473
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Autocomplete, {
|
|
634
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Autocomplete, {
|
|
474
635
|
...props,
|
|
475
636
|
className: require_link.cn("flex flex-col min-h-0", innerClassName),
|
|
476
637
|
children
|
|
@@ -478,7 +639,7 @@ function SearchDialogAutocomplete({ children, className, innerClassName, ...prop
|
|
|
478
639
|
});
|
|
479
640
|
}
|
|
480
641
|
/**
|
|
481
|
-
* Pure, unstyled List Box (maps to
|
|
642
|
+
* Pure, unstyled List Box (maps to ListBox)
|
|
482
643
|
*/
|
|
483
644
|
function SearchDialogList({ children, className, ...props }) {
|
|
484
645
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.ListBox, {
|
|
@@ -488,7 +649,7 @@ function SearchDialogList({ children, className, ...props }) {
|
|
|
488
649
|
});
|
|
489
650
|
}
|
|
490
651
|
/**
|
|
491
|
-
* Pure, unstyled List Box Item (maps to
|
|
652
|
+
* Pure, unstyled List Box Item (maps to ListBoxItem)
|
|
492
653
|
*/
|
|
493
654
|
function SearchDialogItemRoot({ children, className, hintClassName, renderHint, ...props }) {
|
|
494
655
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.ListBoxItem, {
|
|
@@ -544,7 +705,7 @@ SearchDialog.Item = Object.assign(SearchDialogItemRoot, {
|
|
|
544
705
|
Object.defineProperty(exports, 'Button', {
|
|
545
706
|
enumerable: true,
|
|
546
707
|
get: function () {
|
|
547
|
-
return Button;
|
|
708
|
+
return Button$1;
|
|
548
709
|
}
|
|
549
710
|
});
|
|
550
711
|
Object.defineProperty(exports, 'ErrorBoundary', {
|
|
@@ -576,4 +737,16 @@ Object.defineProperty(exports, 'SearchDialog', {
|
|
|
576
737
|
get: function () {
|
|
577
738
|
return SearchDialog;
|
|
578
739
|
}
|
|
740
|
+
});
|
|
741
|
+
Object.defineProperty(exports, 'createSearchHighlightRegex', {
|
|
742
|
+
enumerable: true,
|
|
743
|
+
get: function () {
|
|
744
|
+
return createSearchHighlightRegex;
|
|
745
|
+
}
|
|
746
|
+
});
|
|
747
|
+
Object.defineProperty(exports, 'useSearchHighlight', {
|
|
748
|
+
enumerable: true,
|
|
749
|
+
get: function () {
|
|
750
|
+
return useSearchHighlight;
|
|
751
|
+
}
|
|
579
752
|
});
|