boltdocs 3.0.2 → 3.2.1

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 (123) hide show
  1. package/README.md +2 -18
  2. package/dist/{adapters-DEXNIv3x.mjs → adapters-ByYY44Zy.mjs} +1 -1
  3. package/dist/{adapters-C5AWWGfb.cjs → adapters-DvmtpdSF.cjs} +1 -1
  4. package/dist/{banner-CfdalYLL.d.ts → banner-BMop1KLF.d.ts} +2 -2
  5. package/dist/{banner-DNSkgUsO.d.cts → banner-CVD0GugR.d.cts} +2 -2
  6. package/dist/cache-CO4Dy2uQ.cjs +6 -0
  7. package/dist/cache-Dk53iOo6.mjs +6 -0
  8. package/dist/chunk-BFSpntXv.mjs +6 -0
  9. package/dist/{chunk-Ds5LZdWN.cjs → chunk-D1Md3oWO.cjs} +1 -1
  10. package/dist/client/index.cjs +433 -272
  11. package/dist/client/index.d.cts +129 -18
  12. package/dist/client/index.d.ts +129 -18
  13. package/dist/client/index.js +337 -178
  14. package/dist/client/mdx.cjs +1 -1
  15. package/dist/client/mdx.d.cts +1 -1
  16. package/dist/client/mdx.d.ts +1 -1
  17. package/dist/client/mdx.js +1 -1
  18. package/dist/client/primitives.cjs +7 -7
  19. package/dist/client/primitives.d.cts +5 -22
  20. package/dist/client/primitives.d.ts +5 -22
  21. package/dist/client/primitives.js +4 -4
  22. package/dist/client/theme/neutral.css +1 -3
  23. package/dist/client/theme/reset.css +31 -4
  24. package/dist/config-BpzaPsJj.d.cts +781 -0
  25. package/dist/config-CCXp3aXO.mjs +7 -0
  26. package/dist/{config-JGkMJoJQ.cjs → config-CMd4XoFq.cjs} +1 -1
  27. package/dist/config-DlGoEM9D.cjs +7 -0
  28. package/dist/config-xtS0ZkMm.d.mts +781 -0
  29. package/dist/{csp-CBysWlAf.cjs → csp-CRp_3U7a.cjs} +1 -1
  30. package/dist/csp-oTC2ygvF.mjs +6 -0
  31. package/dist/{docs-layout-6FQ8__ok.js → docs-layout-BdtZ9z6s.js} +9 -28
  32. package/dist/{docs-layout-3TpAt6MB.cjs → docs-layout-CFWI15Id.cjs} +69 -88
  33. package/dist/{doctor-BR1B2Mkz.cjs → doctor-BBtmNJE0.cjs} +1 -1
  34. package/dist/doctor-Bv16QSrI.cjs +7 -0
  35. package/dist/doctor-DOAbSaiL.mjs +7 -0
  36. package/dist/{generator-DtUU3Cfk.cjs → generator-COepVWGi.cjs} +1 -1
  37. package/dist/{handler-Btd4t_67.mjs → handler-DzQae4eA.mjs} +1 -1
  38. package/dist/{handler-Dzf4dSnV.cjs → handler-XX7cLTqe.cjs} +1 -1
  39. package/dist/headers-Ddwek8K7.mjs +6 -0
  40. package/dist/{headers-BXKxiPUv.cjs → headers-dg4SDrjY.cjs} +1 -1
  41. package/dist/{image-C9md50h2.js → image-Bz87fCla.js} +2 -2
  42. package/dist/{image-CR6UlaI5.cjs → image-C4TlpMHn.cjs} +18 -18
  43. package/dist/link-2PzgTnaP.js +673 -0
  44. package/dist/{icons-dev-BryEFkJu.cjs → link-D1Gjkb-2.cjs} +8 -353
  45. package/dist/{mdx-DhyMkc35.js → mdx-BuO6a1f7.js} +199 -40
  46. package/dist/{mdx-DJBg5DuL.cjs → mdx-CD-tSjRG.cjs} +237 -72
  47. package/dist/{meta-loader-C9MKjAs0.cjs → meta-loader-Dq1zcFnh.cjs} +1 -1
  48. package/dist/node/cache.cjs +6 -0
  49. package/dist/node/cache.d.cts +84 -0
  50. package/dist/node/cache.d.mts +84 -0
  51. package/dist/node/cache.mjs +6 -0
  52. package/dist/node/cli-entry.cjs +6 -6
  53. package/dist/node/cli-entry.mjs +9 -9
  54. package/dist/node/index.cjs +1 -1
  55. package/dist/node/index.d.cts +27 -638
  56. package/dist/node/index.d.mts +27 -640
  57. package/dist/node/index.mjs +1 -1
  58. package/dist/node/mdx/shiki-adapter.cjs +6 -0
  59. package/dist/node/mdx/shiki-adapter.d.cts +51 -0
  60. package/dist/node/mdx/shiki-adapter.d.mts +51 -0
  61. package/dist/node/mdx/shiki-adapter.mjs +6 -0
  62. package/dist/node-BXtqM1uH.mjs +6 -0
  63. package/dist/node-BlVk4EVg.cjs +104 -0
  64. package/dist/node-DOf4zhWc.mjs +104 -0
  65. package/dist/node-aD1eisrR.cjs +6 -0
  66. package/dist/{package-CEDhVAfO.cjs → package-BcISI5-P.cjs} +1 -1
  67. package/dist/{package-_dCCKVvG.mjs → package-CCYEAYeA.mjs} +1 -1
  68. package/dist/{pages-external-CX2uyW95.cjs → pages-external-XkYIs-d5.cjs} +1 -1
  69. package/dist/parser-DCiEWkSk.cjs +8 -0
  70. package/dist/parser-qk9FIHJ7.mjs +8 -0
  71. package/dist/plugin-C95kvu6h.mjs +73 -0
  72. package/dist/plugin-DM3u2bVj.cjs +73 -0
  73. package/dist/routes-BW6zsk7Z.mjs +6 -0
  74. package/dist/routes-BgoIB5wb.cjs +6 -0
  75. package/dist/{routes-BajCwrvX.cjs → routes-CORVxc02.cjs} +1 -1
  76. package/dist/{search-dialog-D4rplZMv.cjs → search-dialog-B1NERUNx.cjs} +101 -55
  77. package/dist/{search-dialog-Cx7aGW3U.cjs → search-dialog-BRFno7HD.cjs} +8 -8
  78. package/dist/{search-dialog-DDopgbKM.js → search-dialog-BmxHiKwt.js} +2 -2
  79. package/dist/{search-dialog-BNdRV60O.js → search-dialog-D6TvjcuV.js} +1 -1
  80. package/dist/{search-dialog-DaeSPvEo.js → search-dialog-DFnlx8LO.js} +44 -4
  81. package/dist/{search-dialog-CW1f6dn6.cjs → search-dialog-DHqwjJuG.cjs} +1 -1
  82. package/dist/server/index.cjs +1 -1
  83. package/dist/server/index.d.mts +1 -1
  84. package/dist/server/index.mjs +1 -1
  85. package/dist/shiki-adapter-CoQ6jyJ4.cjs +6 -0
  86. package/dist/shiki-adapter-D-aKw7PP.mjs +6 -0
  87. package/dist/sidebar-COTaMHR-.d.ts +1100 -0
  88. package/dist/sidebar-CrEdJuHX.d.cts +1100 -0
  89. package/dist/{types-generator-CYcHkDzZ.cjs → types-generator-BXhv7Ill.cjs} +1 -1
  90. package/dist/types-generator-bDPvUztF.mjs +26 -0
  91. package/dist/utils-Crm9oPcV.mjs +7 -0
  92. package/dist/utils-D6Xtj0FZ.cjs +7 -0
  93. package/package.json +26 -12
  94. package/src/shared/types.ts +532 -23
  95. package/dist/cache-DETwlACe.cjs +0 -6
  96. package/dist/cache-SF59enb3.mjs +0 -6
  97. package/dist/config-B5uVv5q4.cjs +0 -7
  98. package/dist/config-D3_zDkHh.mjs +0 -7
  99. package/dist/csp-gaZ51xzq.mjs +0 -6
  100. package/dist/doctor-3MheVMwd.mjs +0 -7
  101. package/dist/doctor-DQxLM202.cjs +0 -7
  102. package/dist/headers-CXyf0auY.mjs +0 -6
  103. package/dist/icons-dev-kJyGWNeg.js +0 -916
  104. package/dist/node-B9JSyEIU.mjs +0 -105
  105. package/dist/node-Cedquois.cjs +0 -105
  106. package/dist/parser-CNIPHx4s.cjs +0 -8
  107. package/dist/parser-D0QHIQsi.mjs +0 -8
  108. package/dist/plugin-WYNORxp1.cjs +0 -68
  109. package/dist/plugin-YWNVRpws.mjs +0 -68
  110. package/dist/rolldown-runtime-fkIsjY3S.mjs +0 -6
  111. package/dist/routes-CyrnmVuG.mjs +0 -6
  112. package/dist/routes-D6Tuu7Fs.cjs +0 -6
  113. package/dist/shiki-adapter-CGTmrR6S.cjs +0 -6
  114. package/dist/shiki-adapter-CXEGRnjr.mjs +0 -6
  115. package/dist/shiki-adapter-Mr8_oT_9.cjs +0 -6
  116. package/dist/sidebar-7gIifpBX.d.cts +0 -615
  117. package/dist/sidebar-BAKgJ-Er.d.ts +0 -615
  118. package/dist/types-generator-DVOnRVKU.mjs +0 -26
  119. package/dist/utils-B3xYMrpK.mjs +0 -7
  120. package/dist/utils-Bz1tG9Dg.cjs +0 -7
  121. /package/dist/{errors-C0Hx15Ag.mjs → errors-0zGHRLue.mjs} +0 -0
  122. /package/dist/{errors-Dx6JHoKE.cjs → errors-vKw8CkiX.cjs} +0 -0
  123. /package/dist/{index-CdJv4ocW.d.mts → index-1KsTDq4o.d.mts} +0 -0
@@ -1,6 +0,0 @@
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-Ds5LZdWN.cjs`),t=require(`./utils-Bz1tG9Dg.cjs`);let n=require(`@bdocs/dui`),r=require(`shiki/engine/javascript`),i=require(`shiki/core`),a=require(`@shikijs/themes/github-light`);a=e.n(a);let o=require(`@shikijs/themes/github-dark`);o=e.n(o);let s=require(`@shikijs/themes/tokyo-night`);s=e.n(s);let c=require(`@shikijs/themes/dracula`);c=e.n(c);let l=require(`@shikijs/themes/nord`);l=e.n(l);let u=require(`@shikijs/themes/one-dark-pro`);u=e.n(u);let d=require(`@shikijs/themes/one-light`);d=e.n(d);let f=require(`@shikijs/langs/html`);f=e.n(f);let p=require(`@shikijs/langs/js`);p=e.n(p);let m=require(`@shikijs/langs/ts`);m=e.n(m);let h=require(`@shikijs/langs/tsx`);h=e.n(h);let g=require(`@shikijs/langs/css`);g=e.n(g);let _=require(`@shikijs/langs/json`);_=e.n(_);let v=require(`@shikijs/langs/bash`);v=e.n(v);let y=require(`@shikijs/langs/markdown`);y=e.n(y);let b=require(`@shikijs/langs/mdx`);b=e.n(b);let x=require(`@shikijs/langs/yaml`);x=e.n(x);let S=require(`@shikijs/langs/rust`);S=e.n(S);let C=require(`@shikijs/langs/toml`);C=e.n(C);let w=require(`@shikijs/langs/csv`);w=e.n(w);const T={ROOT:`root`,ELEMENT:`element`,TEXT:`text`,COMMENT:`comment`,CODE:`code`,INLINE_CODE:`inlineCode`,HEADING:`heading`,PARAGRAPH:`paragraph`,LINK:`link`,IMAGE:`image`,LIST:`list`,LIST_ITEM:`listItem`,JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,FLOW_EXPRESSION:`mdxFlowExpression`,TEXT_EXPRESSION:`mdxTextExpression`,ESM:`mdxjsEsm`},E={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},D={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},O={LIGHT:`github-light`,DARK:`github-dark`},k={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},A=[a.default.default||a.default,o.default.default||o.default,s.default.default||s.default,c.default.default||c.default,l.default.default||l.default,u.default.default||u.default,d.default.default||d.default],j=[f.default,p.default,m.default,h.default,g.default,_.default,v.default,y.default,b.default,x.default,S.default,C.default,w.default];let M=null,N=null;const P=()=>(M??=(0,r.createJavaScriptRegexEngine)(),M),F=async e=>N||(N=(0,i.createHighlighterCore)({themes:A,langs:j,engine:P()}),N),I=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,D.LINE_NUMBERS)}}},L=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,D.WORD_WRAP)}}},R=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[E.TITLE]=t)}}),z=()=>({name:`AddLanguageProperty`,pre(e){e.properties[E.LANG]=this.options.lang||k.LANG}});function B(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var V=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:O.LIGHT,dark:O.DARK}}async getHighlighter(){return await F(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=B(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||k.LANG,meta:{__raw:i,...r},transformers:[I(),L(),R(),z()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,r,i){try{let t=await this.getHighlighter(),n=this.getOptions(r,i);return t.codeToHtml(e,n)}catch(r){return(0,n.error)(`[ShikiAdapter] Failed to render code:`,r),`<pre class="${D.FALLBACK}"><code>${t.n(e)}</code></pre>`}}};let H=null,U;function W(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(H===null||U!==t)&&(H=new V(e),U=t),H}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return V}});
@@ -1,6 +0,0 @@
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"./rolldown-runtime-fkIsjY3S.mjs";import{n as t}from"./utils-B3xYMrpK.mjs";import{error as n}from"@bdocs/dui";import{createJavaScriptRegexEngine as r}from"shiki/engine/javascript";import{createHighlighterCore as i}from"shiki/core";import a from"@shikijs/themes/github-light";import o from"@shikijs/themes/github-dark";import s from"@shikijs/themes/tokyo-night";import c from"@shikijs/themes/dracula";import l from"@shikijs/themes/nord";import u from"@shikijs/themes/one-dark-pro";import d from"@shikijs/themes/one-light";import f from"@shikijs/langs/html";import p from"@shikijs/langs/js";import m from"@shikijs/langs/ts";import h from"@shikijs/langs/tsx";import g from"@shikijs/langs/css";import _ from"@shikijs/langs/json";import v from"@shikijs/langs/bash";import y from"@shikijs/langs/markdown";import b from"@shikijs/langs/mdx";import x from"@shikijs/langs/yaml";import S from"@shikijs/langs/rust";import C from"@shikijs/langs/toml";import w from"@shikijs/langs/csv";const T={ROOT:`root`,ELEMENT:`element`,TEXT:`text`,COMMENT:`comment`,CODE:`code`,INLINE_CODE:`inlineCode`,HEADING:`heading`,PARAGRAPH:`paragraph`,LINK:`link`,IMAGE:`image`,LIST:`list`,LIST_ITEM:`listItem`,JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,FLOW_EXPRESSION:`mdxFlowExpression`,TEXT_EXPRESSION:`mdxTextExpression`,ESM:`mdxjsEsm`},E={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},D={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},O={LIGHT:`github-light`,DARK:`github-dark`},k={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},A=[a.default||a,o.default||o,s.default||s,c.default||c,l.default||l,u.default||u,d.default||d],j=[f,p,m,h,g,_,v,y,b,x,S,C,w];let M=null,N=null;const P=()=>(M??=r(),M),F=async e=>N||(N=i({themes:A,langs:j,engine:P()}),N),I=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,D.LINE_NUMBERS)}}},L=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,D.WORD_WRAP)}}},R=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[E.TITLE]=t)}}),z=()=>({name:`AddLanguageProperty`,pre(e){e.properties[E.LANG]=this.options.lang||k.LANG}});var B=e({ShikiAdapter:()=>H,getShikiAdapter:()=>G,parseMetaString:()=>V});function V(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var H=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:O.LIGHT,dark:O.DARK}}async getHighlighter(){return await F(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=V(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||k.LANG,meta:{__raw:i,...r},transformers:[I(),L(),R(),z()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,r,i){try{let t=await this.getHighlighter(),n=this.getOptions(r,i);return t.codeToHtml(e,n)}catch(r){return n(`[ShikiAdapter] Failed to render code:`,r),`<pre class="${D.FALLBACK}"><code>${t(e)}</code></pre>`}}};let U=null,W;function G(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(U===null||W!==t)&&(U=new H(e),W=t),U}export{k as a,E as i,V as n,T as o,B as r,D as s,G as t};
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- const e=require(`./shiki-adapter-CGTmrR6S.cjs`);exports.getShikiAdapter=e.n;
@@ -1,615 +0,0 @@
1
-
2
- import * as React$2 from "react";
3
- import { ComponentType, ReactNode } from "react";
4
- import { Plugin } from "vite";
5
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
6
-
7
- //#region src/shared/types.d.ts
8
- /**
9
- * Represents a single social link in the configuration.
10
- */
11
- interface BoltdocsSocialLink {
12
- icon: 'discord' | 'x' | 'github' | 'bluesky' | string;
13
- link: string;
14
- }
15
- /**
16
- * Configuration for the site footer.
17
- */
18
- interface BoltdocsFooterConfig {
19
- text?: string;
20
- }
21
- /**
22
- * Theme-specific configuration options.
23
- */
24
- interface BoltdocsThemeConfig {
25
- title?: string | Record<string, string>;
26
- description?: string | Record<string, string>;
27
- logo?: string | {
28
- dark: string;
29
- light: string;
30
- alt?: string;
31
- width?: number;
32
- height?: number;
33
- };
34
- navbar?: Array<{
35
- label: string | Record<string, string>;
36
- href: BoltdocsRoutePathWithFallback$1;
37
- items?: Array<{
38
- label: string | Record<string, string>;
39
- href: BoltdocsRoutePathWithFallback$1;
40
- }>;
41
- }>;
42
- sidebar?: Record<string, Array<{
43
- text: string;
44
- link: BoltdocsRoutePathWithFallback$1;
45
- }>>;
46
- sidebarGroups?: Record<string, {
47
- title?: string | Record<string, string>;
48
- icon?: string;
49
- }>;
50
- socialLinks?: BoltdocsSocialLink[];
51
- footer?: BoltdocsFooterConfig;
52
- editLink?: string;
53
- communityHelp?: string;
54
- version?: string;
55
- githubRepo?: string;
56
- favicon?: string;
57
- tabs?: Array<{
58
- id: string;
59
- text: string | Record<string, string>;
60
- icon?: string;
61
- }>;
62
- codeTheme?: ShikiTheme | {
63
- light: ShikiTheme;
64
- dark: ShikiTheme;
65
- };
66
- }
67
- /**
68
- * List of supported syntax highlighting themes.
69
- */
70
- type ShikiTheme = 'github-dark' | 'github-light' | 'tokyo-night' | 'dracula' | 'nord' | 'one-dark-pro' | 'one-light';
71
- /**
72
- * Configuration for the robots.txt file.
73
- */
74
- type BoltdocsRobotsConfig = string | {
75
- rules?: Array<{
76
- userAgent: string;
77
- allow?: string | string[];
78
- disallow?: string | string[];
79
- }>;
80
- sitemaps?: string[];
81
- };
82
- /**
83
- * Configuration for a specific locale.
84
- */
85
- interface BoltdocsLocaleConfig {
86
- label?: string;
87
- direction?: 'ltr' | 'rtl';
88
- htmlLang?: string;
89
- calendar?: string;
90
- }
91
- /**
92
- * Configuration for internationalization (i18n).
93
- */
94
- interface BoltdocsI18nConfig {
95
- defaultLocale: string;
96
- locales: string[] | Record<string, string>;
97
- localeConfigs?: Record<string, BoltdocsLocaleConfig>;
98
- }
99
- /**
100
- * Configuration for a specific documentation version.
101
- */
102
- interface BoltdocsVersionConfig {
103
- label: string;
104
- path: string;
105
- }
106
- /**
107
- * Configuration for documentation versioning.
108
- */
109
- interface BoltdocsVersionsConfig {
110
- defaultVersion: string;
111
- prefix?: string;
112
- versions: BoltdocsVersionConfig[];
113
- }
114
- /**
115
- * Shared badge value type used in frontmatter, RouteMeta, and ComponentRoute.
116
- */
117
- type BadgeValue = string | {
118
- text: string;
119
- expires?: string;
120
- };
121
- /**
122
- * Defines a Boltdocs plugin.
123
- *
124
- * Use the `createPlugin()` helper from the node API for full type safety and
125
- * access to lifecycle hooks.
126
- */
127
- interface BoltdocsPlugin {
128
- name: string;
129
- enforce?: 'pre' | 'post';
130
- version?: string;
131
- boltdocsVersion?: string;
132
- remarkPlugins?: unknown[];
133
- rehypePlugins?: unknown[];
134
- vitePlugins?: Plugin[];
135
- components?: Record<string, string>;
136
- /** Lifecycle hooks — use the `PluginLifecycleHooks` type from the node API. */
137
- hooks?: Record<string, (ctx: unknown) => Promise<void> | void>;
138
- }
139
- /**
140
- * Configuration for the collections (blog) feature.
141
- */
142
- interface BoltdocsCollectionsConfig {
143
- /** Number of posts per page in collection listing pages. Defaults to 10. */
144
- postsPerPage?: number;
145
- /** The name of the default collection used by BlogList when none is specified. */
146
- defaultCollection?: string;
147
- /** Date format string for rendering post dates (e.g., 'MMMM dd, yyyy'). */
148
- dateFormat?: string;
149
- /** Field to sort posts by. Defaults to 'date'. */
150
- sortBy?: 'date' | 'title' | 'sidebarPosition';
151
- }
152
- interface BoltdocsSecurityConfig {
153
- headers?: Record<string, string>;
154
- enableCSP?: boolean;
155
- customHeaders?: Record<string, string>;
156
- }
157
- interface BoltdocsVerificationConfig {
158
- google?: string;
159
- bing?: string;
160
- yandex?: string;
161
- pinterest?: string;
162
- facebook?: string;
163
- }
164
- /**
165
- * Configuration for SEO.
166
- */
167
- interface BoltdocsSeoConfig {
168
- metatags?: Record<string, string>;
169
- indexing?: 'all' | 'public';
170
- thumbnails?: {
171
- background?: string;
172
- };
173
- verification?: BoltdocsVerificationConfig;
174
- }
175
- /**
176
- * Configuration for Google Analytics 4 (GA4).
177
- */
178
- interface BoltdocsGA4Config {
179
- measurementId: string;
180
- debug?: boolean;
181
- anonymizeIp?: boolean;
182
- sendPageView?: boolean;
183
- cookieFlags?: string;
184
- autoTrack?: {
185
- pageViews?: boolean;
186
- downloads?: boolean;
187
- externalLinks?: boolean;
188
- search?: boolean;
189
- };
190
- }
191
- /**
192
- * Configuration for Google Tag Manager (GTM).
193
- */
194
- interface BoltdocsGTMConfig {
195
- tagId: string;
196
- dataLayerName?: string;
197
- preview?: string;
198
- }
199
- /**
200
- * Configuration for Algolia DocSearch.
201
- */
202
- interface BoltdocsAlgoliaConfig {
203
- appId: string;
204
- apiKey: string;
205
- indexName: string;
206
- }
207
- /**
208
- * Configuration for Giscus comments.
209
- */
210
- interface BoltdocsGiscusConfig {
211
- repo: string;
212
- repoId: string;
213
- category?: string;
214
- categoryId?: string;
215
- mapping?: 'pathname' | 'url' | 'title' | 'og:title' | 'specific' | 'number';
216
- strict?: '0' | '1' | boolean;
217
- reactionsEnabled?: '0' | '1' | boolean;
218
- emitMetadata?: '0' | '1' | boolean;
219
- inputPosition?: 'top' | 'bottom';
220
- theme?: string;
221
- darkTheme?: string;
222
- lang?: string;
223
- loading?: 'lazy' | 'eager';
224
- }
225
- /**
226
- * Configuration for custom feedback system using GitHub Discussions API.
227
- */
228
- interface BoltdocsCustomFeedbackConfig {
229
- enabled: boolean;
230
- owner: string;
231
- repo: string;
232
- categorySlug?: string;
233
- endpoint?: string;
234
- }
235
- interface BoltdocsVercelConfig {
236
- analytics?: boolean;
237
- speedInsights?: boolean;
238
- }
239
- interface BoltdocsIntegrationsConfig {
240
- analytics?: {
241
- ga4?: BoltdocsGA4Config;
242
- vercel?: BoltdocsVercelConfig;
243
- gtm?: BoltdocsGTMConfig;
244
- };
245
- search?: {
246
- algolia?: BoltdocsAlgoliaConfig;
247
- };
248
- feedback?: {
249
- giscus?: BoltdocsGiscusConfig;
250
- custom?: BoltdocsCustomFeedbackConfig;
251
- };
252
- }
253
- /**
254
- * The root configuration object for Boltdocs.
255
- */
256
- interface BoltdocsConfig$1 {
257
- siteUrl?: string;
258
- docsDir?: string;
259
- base?: string;
260
- theme?: BoltdocsThemeConfig;
261
- i18n?: BoltdocsI18nConfig;
262
- versions?: BoltdocsVersionsConfig;
263
- plugins?: BoltdocsPlugin[];
264
- collections?: BoltdocsCollectionsConfig;
265
- robots?: BoltdocsRobotsConfig;
266
- security?: BoltdocsSecurityConfig;
267
- seo?: BoltdocsSeoConfig;
268
- integrations?: BoltdocsIntegrationsConfig;
269
- directoryMeta?: Record<string, unknown>;
270
- vite?: unknown;
271
- }
272
- /**
273
- * Global namespace for Boltdocs types that can be augmented by generated code.
274
- * This allows for strictly typed locales and versions based on the project configuration.
275
- */
276
- declare global {
277
- namespace Boltdocs {
278
- interface Types {}
279
- /**
280
- * Marker interface augmented by generated code to provide strict route path typing.
281
- * When no types have been generated (e.g., before first dev server start),
282
- * keyof is never, and BoltdocsRoutePath falls back to string.
283
- */
284
- interface RoutePaths {}
285
- }
286
- }
287
- type BoltdocsTypes = Boltdocs.Types;
288
- type BoltdocsRoutePath = keyof Boltdocs.RoutePaths;
289
- type BoltdocsRoutePathWithFallback$1 = BoltdocsRoutePath extends never ? string : BoltdocsRoutePath;
290
- type BoltdocsLocale = Boltdocs.Types extends {
291
- Locale: infer L;
292
- } ? L : string;
293
- type BoltdocsVersion = Boltdocs.Types extends {
294
- Version: infer V;
295
- } ? V : string;
296
- type UnpackMdxComponents<T> = T extends {
297
- default: infer D;
298
- } ? D : T;
299
- type TransformMdxComponents<T> = { [K in keyof T as K extends `Frontmatter_${string}` ? never : K]: T[K] } & {
300
- Frontmatter: { [K in keyof T as K extends `Frontmatter_${infer Name}` ? Name : never]: T[K] };
301
- };
302
- type BoltdocsMdxComponents = Boltdocs.Types extends {
303
- MdxComponents: infer M;
304
- } ? TransformMdxComponents<UnpackMdxComponents<M>> : {
305
- [key: string]: ComponentType<any>;
306
- Frontmatter: Record<string, ComponentType<any>>;
307
- };
308
- //#endregion
309
- //#region src/client/types.d.ts
310
- /**
311
- * Metadata provided by the server for a specific route.
312
- * Maps closely to the `RouteMeta` type in the Node environment.
313
- */
314
- interface ComponentRoute {
315
- /** The final URL path */
316
- path: string;
317
- /** The absolute filesystem path of the source file */
318
- componentPath: string;
319
- /** The page title */
320
- title: string;
321
- /** Explicit order in the sidebar */
322
- sidebarPosition?: number;
323
- /** The relative path from the docs directory */
324
- filePath: string;
325
- /** The group directory name */
326
- group?: string;
327
- /** The display title of the group */
328
- groupTitle?: string;
329
- /** Explicit order of the group in the sidebar */
330
- groupPosition?: number;
331
- /** Extracted markdown headings for search indexing */
332
- headings?: {
333
- level: number;
334
- text: string;
335
- id: string;
336
- }[];
337
- /** The page summary or description */
338
- description?: string;
339
- /** The locale this route belongs to, if i18n is configured */
340
- locale?: string;
341
- /** The version this route belongs to, if versioning is configured */
342
- version?: string;
343
- /** Optional icon to display (Lucide icon name or raw SVG) */
344
- icon?: string;
345
- /** The tab this route belongs to, if tabs are configured */
346
- tab?: string;
347
- /** Optional badge to display next to the sidebar item */
348
- badge?: BadgeValue;
349
- /** Optional icon for the route's group */
350
- groupIcon?: string;
351
- /** The sub-route group this route belongs to (from folders starting with _) */
352
- subRouteGroup?: string;
353
- /** The nested sub-routes if this route acts as the parent of a subRouteGroup */
354
- subRoutes?: ComponentRoute[];
355
- /** Internal helper map for nesting routes during sidebar construction */
356
- _subMap?: Map<string, ComponentRoute>;
357
- /** The extracted plain-text content of the page for search indexing */
358
- _content?: string;
359
- /** The raw markdown content of the page */
360
- _rawContent?: string;
361
- /** The publication date */
362
- date?: string | Date;
363
- /** The last updated timestamp or date */
364
- lastUpdated?: string | number | Date;
365
- /** The collection this route belongs to (from [name] directories) */
366
- collection?: string;
367
- /** Tags for blog posts */
368
- tags?: string[];
369
- /** Author identifier for blog posts */
370
- author?: string | {
371
- name: string;
372
- avatar?: string;
373
- url?: string;
374
- image?: string;
375
- };
376
- /** Draft flag */
377
- draft?: boolean;
378
- /** Short excerpt for list displays */
379
- excerpt?: string;
380
- /** Cover image for blog posts */
381
- coverImage?: string;
382
- /** Raw extensible frontmatter data for custom components and formatters */
383
- frontmatter?: Record<string, any>;
384
- /** Clean URL segments stripped of locale/version prefixes */
385
- slugParts?: string[];
386
- /** SEO metadata for page headers */
387
- seo?: Record<string, any>;
388
- /** Flag to indicate if this is a fallback redirect route */
389
- fallback?: boolean;
390
- }
391
- /**
392
- * Site configuration provided by the server.
393
- */
394
- type SiteConfig = BoltdocsConfig;
395
- /**
396
- * Tab configuration for the documentation site.
397
- */
398
- interface BoltdocsTab {
399
- id: string;
400
- /** Text to display (can be a string or a map of translations) */
401
- text: string | Record<string, string>;
402
- icon?: string;
403
- }
404
- /**
405
- * Props for the Sidebar component.
406
- */
407
- interface SidebarProps {
408
- routes: ComponentRoute[];
409
- config: BoltdocsConfig;
410
- }
411
- /**
412
- * Props for the OnThisPage (TOC) component.
413
- */
414
- interface OnThisPageProps {
415
- headings?: {
416
- level: number;
417
- text: string;
418
- id: string;
419
- }[];
420
- editLink?: string;
421
- communityHelp?: string;
422
- filePath?: string;
423
- }
424
- /**
425
- * Props for the Tabs component.
426
- */
427
- interface TabsProps {
428
- tabs: BoltdocsTab[];
429
- routes: ComponentRoute[];
430
- }
431
- /**
432
- * Props for user-defined layout components (layout.tsx).
433
- */
434
- interface LayoutProps {
435
- children: React$2.ReactNode;
436
- }
437
- /**
438
- * Unified type for navbar links.
439
- */
440
- interface NavbarLink {
441
- label: string | Record<string, string>;
442
- href: BoltdocsRoutePathWithFallback;
443
- active: boolean;
444
- to?: string;
445
- items?: NavbarLink[];
446
- }
447
- /**
448
- * Shape of the data returned by a collection post route loader.
449
- * Consumed by `BlogPost` via `useLoaderData<CollectionPostLoaderData>()`.
450
- */
451
- interface CollectionPostLoaderData {
452
- /** Full route metadata for this post (title, date, author, tags, etc.) */
453
- route: ComponentRoute;
454
- /** The name of the collection this post belongs to (e.g. 'blog') */
455
- collection: string;
456
- /** Extracted page headings for the Table of Contents */
457
- headings: {
458
- level: number;
459
- text: string;
460
- id: string;
461
- }[];
462
- }
463
- /**
464
- * Shape of the data returned by a collection listing route loader.
465
- * Consumed by `BlogList` via `useLoaderData<CollectionListLoaderData>()`.
466
- */
467
- interface CollectionListLoaderData {
468
- /** Paginated subset of posts to display on this page */
469
- posts: Array<{
470
- path: string;
471
- title: string;
472
- date?: string | Date;
473
- excerpt?: string;
474
- tags?: string[];
475
- author?: string;
476
- coverImage?: string;
477
- filePath: string;
478
- }>;
479
- /** Total number of pages available */
480
- totalPages: number;
481
- /** Current page index (1-based) */
482
- currentPage: number;
483
- /** Collection name used to build pagination URLs (e.g. 'blog' → '/blog/page/2') */
484
- collection: string;
485
- }
486
- //#endregion
487
- //#region src/client/components/primitives/types.d.ts
488
- type ComponentBase = {
489
- className?: string;
490
- children?: ReactNode;
491
- };
492
- //#endregion
493
- //#region src/client/components/primitives/sidebar.d.ts
494
- /**
495
- * Desktop Sidebar Container
496
- */
497
- declare function SidebarRoot({
498
- children,
499
- className
500
- }: ComponentBase): _$react_jsx_runtime0.JSX.Element;
501
- /**
502
- * Mobile Sidebar Modal
503
- */
504
- declare function SidebarMobile({
505
- children,
506
- className
507
- }: ComponentBase): _$react_jsx_runtime0.JSX.Element;
508
- /**
509
- * Shared Header for Sidebar
510
- */
511
- declare function SidebarHeader({
512
- children,
513
- className
514
- }: ComponentBase): _$react_jsx_runtime0.JSX.Element;
515
- /**
516
- * Scrollable Content Wrapper
517
- */
518
- declare function SidebarContent({
519
- children,
520
- className
521
- }: ComponentBase): _$react_jsx_runtime0.JSX.Element;
522
- /**
523
- * Navigation Group
524
- */
525
- declare function SidebarGroup({
526
- title,
527
- icon: Icon,
528
- children,
529
- className,
530
- collapsible,
531
- collapsed,
532
- active
533
- }: {
534
- title?: string;
535
- icon?: React.ElementType;
536
- collapsible?: boolean;
537
- collapsed?: boolean;
538
- active?: boolean;
539
- } & ComponentBase): _$react_jsx_runtime0.JSX.Element;
540
- /**
541
- * Sidebar Link
542
- */
543
- interface SidebarLinkProps extends ComponentBase {
544
- label: string;
545
- href: BoltdocsRoutePathWithFallback$1;
546
- active?: boolean;
547
- icon?: React.ElementType;
548
- badge?: ComponentRoute['badge'];
549
- }
550
- declare function SidebarLink({
551
- label,
552
- href,
553
- active,
554
- icon: Icon,
555
- badge,
556
- className
557
- }: SidebarLinkProps): _$react_jsx_runtime0.JSX.Element;
558
- /**
559
- * Nested SubGroup
560
- */
561
- declare function SidebarSubGroup({
562
- label,
563
- href,
564
- active,
565
- icon: Icon,
566
- badge,
567
- isOpen,
568
- onToggle,
569
- children,
570
- className
571
- }: SidebarLinkProps & {
572
- isOpen: boolean;
573
- onToggle: () => void;
574
- children: ReactNode;
575
- }): _$react_jsx_runtime0.JSX.Element;
576
- /**
577
- * Automated single-route rendering primitive
578
- */
579
- interface SidebarItemProps extends ComponentBase {
580
- route: ComponentRoute;
581
- activePath: string;
582
- activeRoute?: ComponentRoute;
583
- }
584
- declare function SidebarItem({
585
- route,
586
- activePath,
587
- activeRoute,
588
- className
589
- }: SidebarItemProps): _$react_jsx_runtime0.JSX.Element;
590
- /**
591
- * High-level automated routes data rendering primitive
592
- */
593
- interface SidebarItemsProps extends ComponentBase {
594
- routes: ComponentRoute[];
595
- }
596
- declare function SidebarItems({
597
- routes,
598
- className
599
- }: SidebarItemsProps): _$react_jsx_runtime0.JSX.Element;
600
- /**
601
- * Main Sidebar Export
602
- */
603
- declare const Sidebar: typeof SidebarRoot & {
604
- Root: typeof SidebarRoot;
605
- Mobile: typeof SidebarMobile;
606
- Header: typeof SidebarHeader;
607
- Content: typeof SidebarContent;
608
- Group: typeof SidebarGroup;
609
- Link: typeof SidebarLink;
610
- SubGroup: typeof SidebarSubGroup;
611
- Item: typeof SidebarItem;
612
- Items: typeof SidebarItems;
613
- };
614
- //#endregion
615
- export { BoltdocsRoutePathWithFallback$1 as A, SiteConfig as C, BoltdocsLocale as D, BoltdocsIntegrationsConfig as E, BoltdocsTypes as M, BoltdocsVersion as N, BoltdocsMdxComponents as O, SidebarProps as S, BoltdocsConfig$1 as T, CollectionPostLoaderData as _, SidebarItem as a, NavbarLink as b, SidebarItemsProps as c, SidebarMobile as d, SidebarRoot as f, CollectionListLoaderData as g, BoltdocsTab as h, SidebarHeader as i, BoltdocsSocialLink as j, BoltdocsRoutePath as k, SidebarLink as l, ComponentBase as m, SidebarContent as n, SidebarItemProps as o, SidebarSubGroup as p, SidebarGroup as r, SidebarItems as s, Sidebar as t, SidebarLinkProps as u, ComponentRoute as v, TabsProps as w, OnThisPageProps as x, LayoutProps as y };