boltdocs 2.6.1 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/bin/boltdocs.js +0 -1
  2. package/dist/cache-CQKlT4fI.mjs +6 -0
  3. package/dist/cache-DorPMFgW.cjs +6 -0
  4. package/dist/cards-BLoSiRuL.d.ts +30 -0
  5. package/dist/cards-CQn9mXZS.d.cts +30 -0
  6. package/dist/chunk-Ds5LZdWN.cjs +6 -0
  7. package/dist/client/index.cjs +1 -1
  8. package/dist/client/index.d.cts +173 -1328
  9. package/dist/client/index.d.ts +172 -1327
  10. package/dist/client/index.js +1 -1
  11. package/dist/{package-c99Cs7mD.cjs → client/mdx.cjs} +1 -1
  12. package/dist/client/mdx.d.cts +128 -0
  13. package/dist/client/mdx.d.ts +129 -0
  14. package/dist/client/mdx.js +6 -0
  15. package/dist/client/primitives.cjs +6 -0
  16. package/dist/client/primitives.d.cts +818 -0
  17. package/dist/client/primitives.d.ts +818 -0
  18. package/dist/client/primitives.js +6 -0
  19. package/dist/client/theme/neutral.css +74 -361
  20. package/dist/client/theme/reset.css +189 -0
  21. package/dist/docs-layout-BlDhcQRv.cjs +6 -0
  22. package/dist/docs-layout-BvAOWEJw.js +6 -0
  23. package/dist/doctor-BQiQhCTl.cjs +6 -0
  24. package/dist/doctor-COpf35L2.cjs +20 -0
  25. package/dist/doctor-Dh1XP7Pz.mjs +20 -0
  26. package/dist/generator-DGW6pkCC.cjs +22 -0
  27. package/dist/generator-Dv3wEmhZ.mjs +22 -0
  28. package/dist/icons-dev-CrQLjoQp.js +6 -0
  29. package/dist/icons-dev-rzdz6Lf3.cjs +6 -0
  30. package/dist/image-BkIfa9oo.js +6 -0
  31. package/dist/image-DIGjCPe6.cjs +6 -0
  32. package/dist/mdx-K0WYBAJ3.js +7 -0
  33. package/dist/mdx-hpErbRUe.cjs +7 -0
  34. package/dist/meta-loader-0gJ4PtBC.cjs +6 -0
  35. package/dist/meta-loader-9IpAHWDS.mjs +6 -0
  36. package/dist/node/cli-entry.cjs +1 -2
  37. package/dist/node/cli-entry.mjs +1 -2
  38. package/dist/node/index.cjs +1 -1
  39. package/dist/node/index.d.cts +66 -13
  40. package/dist/node/index.d.mts +66 -14
  41. package/dist/node/index.mjs +1 -1
  42. package/dist/node/routes/worker.cjs +6 -0
  43. package/dist/node/routes/worker.d.cts +2 -0
  44. package/dist/node/routes/worker.d.mts +2 -0
  45. package/dist/node/routes/worker.mjs +6 -0
  46. package/dist/node-C2nWXElP.mjs +112 -0
  47. package/dist/node-CinkUtxV.cjs +112 -0
  48. package/dist/package-BMYLDBBP.cjs +6 -0
  49. package/dist/{package-DukYeKmD.mjs → package-HegMOTL_.mjs} +1 -1
  50. package/dist/parser-Bh11BsdA.cjs +6 -0
  51. package/dist/parser-D8eQvE7N.mjs +6 -0
  52. package/dist/parser-DYRzXWmA.cjs +6 -0
  53. package/dist/routes-CHf76Ye4.cjs +6 -0
  54. package/dist/routes-CMUZGI6T.mjs +6 -0
  55. package/dist/routes-Co1mRM58.cjs +6 -0
  56. package/dist/search-dialog-BACuzoVX.cjs +6 -0
  57. package/dist/search-dialog-BKagVT17.js +6 -0
  58. package/dist/search-dialog-C8w12eUx.js +6 -0
  59. package/dist/search-dialog-CGyrozZE.cjs +6 -0
  60. package/dist/search-dialog-D26rUnJ_.cjs +6 -0
  61. package/dist/sidebar-DKvg6KOc.d.cts +491 -0
  62. package/dist/sidebar-Dr1TiRIy.d.ts +491 -0
  63. package/dist/utils-BxNAXhZZ.mjs +7 -0
  64. package/dist/utils-Clzu7jvb.cjs +7 -0
  65. package/dist/worker-pool-Bd8Y9KDv.mjs +6 -0
  66. package/dist/worker-pool-BwU8ckrg.cjs +6 -0
  67. package/package.json +27 -8
  68. package/src/client/app/doc-page.tsx +9 -5
  69. package/src/client/app/docs-layout.tsx +17 -3
  70. package/src/client/app/head.tsx +122 -0
  71. package/src/client/app/helmet-compat.tsx +36 -0
  72. package/src/client/app/mdx-component.tsx +5 -52
  73. package/src/client/app/mdx-components-context.tsx +32 -8
  74. package/src/client/app/routes-context.tsx +2 -2
  75. package/src/client/app/scroll-handler.tsx +1 -1
  76. package/src/client/app/theme-context.tsx +5 -5
  77. package/src/client/app/ui-context.tsx +42 -0
  78. package/src/client/components/docs-layout-default.tsx +85 -0
  79. package/src/client/components/icons-dev.tsx +38 -15
  80. package/src/client/components/mdx/callout.tsx +97 -0
  81. package/src/client/components/mdx/card.tsx +73 -98
  82. package/src/client/components/mdx/cards.tsx +27 -0
  83. package/src/client/components/mdx/code-block.tsx +37 -17
  84. package/src/client/components/mdx/field.tsx +24 -56
  85. package/src/client/components/mdx/image.tsx +36 -15
  86. package/src/client/components/mdx/index.ts +19 -53
  87. package/src/client/components/mdx/table.tsx +46 -148
  88. package/src/client/components/mdx/typographics.tsx +120 -0
  89. package/src/client/components/mdx/{hooks/use-code-block.ts → use-code-block.ts} +5 -7
  90. package/src/client/components/primitives/breadcrumbs.tsx +5 -24
  91. package/src/client/components/primitives/button.tsx +3 -142
  92. package/src/client/components/primitives/code-block.tsx +104 -97
  93. package/src/client/components/{docs-layout.tsx → primitives/docs-layout.tsx} +15 -24
  94. package/src/client/components/primitives/error-boundary.tsx +107 -0
  95. package/src/client/components/primitives/heading.tsx +128 -0
  96. package/src/client/components/primitives/helpers/observer.ts +62 -32
  97. package/src/client/components/primitives/image.tsx +26 -0
  98. package/src/client/components/primitives/link.tsx +50 -52
  99. package/src/client/components/primitives/menu.tsx +25 -49
  100. package/src/client/components/primitives/navbar.tsx +234 -59
  101. package/src/client/components/primitives/on-this-page.tsx +169 -40
  102. package/src/client/components/primitives/page-nav.tsx +11 -39
  103. package/src/client/components/primitives/popover.tsx +12 -30
  104. package/src/client/components/primitives/search-dialog.tsx +77 -71
  105. package/src/client/components/primitives/sidebar.tsx +312 -119
  106. package/src/client/components/primitives/skeleton.tsx +1 -1
  107. package/src/client/components/primitives/tabs.tsx +5 -16
  108. package/src/client/components/primitives/tooltip.tsx +1 -1
  109. package/src/client/components/ui-base/banner.tsx +66 -0
  110. package/src/client/components/ui-base/breadcrumbs.tsx +26 -20
  111. package/src/client/components/ui-base/copy-markdown.tsx +43 -35
  112. package/src/client/components/ui-base/error-boundary.tsx +9 -46
  113. package/src/client/components/ui-base/github-stars.tsx +5 -3
  114. package/src/client/components/ui-base/index.ts +3 -3
  115. package/src/client/components/ui-base/last-updated.tsx +27 -0
  116. package/src/client/components/ui-base/navbar.tsx +183 -89
  117. package/src/client/components/ui-base/not-found.tsx +11 -9
  118. package/src/client/components/ui-base/on-this-page.tsx +8 -104
  119. package/src/client/components/ui-base/page-nav.tsx +23 -9
  120. package/src/client/components/ui-base/search-dialog.tsx +111 -36
  121. package/src/client/components/ui-base/search-highlight.tsx +10 -0
  122. package/src/client/components/ui-base/sidebar.tsx +77 -154
  123. package/src/client/components/ui-base/tabs.tsx +20 -7
  124. package/src/client/components/ui-base/theme-toggle.tsx +88 -10
  125. package/src/client/components/ui-base/version-i18n.tsx +80 -0
  126. package/src/client/hooks/index.ts +2 -1
  127. package/src/client/hooks/use-analytics.ts +272 -0
  128. package/src/client/hooks/use-i18n.ts +120 -53
  129. package/src/client/hooks/use-localized-to.ts +70 -30
  130. package/src/client/hooks/use-navbar.ts +69 -39
  131. package/src/client/hooks/use-page-nav.ts +28 -25
  132. package/src/client/hooks/use-routes.ts +64 -81
  133. package/src/client/hooks/use-search-highlight.ts +185 -0
  134. package/src/client/hooks/use-search.ts +12 -3
  135. package/src/client/hooks/use-sidebar.ts +183 -77
  136. package/src/client/hooks/use-tabs.ts +3 -4
  137. package/src/client/hooks/use-version.ts +46 -18
  138. package/src/client/index.ts +13 -86
  139. package/src/client/mdx.ts +2 -0
  140. package/src/client/primitives.ts +19 -0
  141. package/src/client/ssg/boltdocs-shell.tsx +78 -57
  142. package/src/client/ssg/create-routes.tsx +290 -50
  143. package/src/client/ssg/mdx-page.tsx +2 -1
  144. package/src/client/store/boltdocs-context.tsx +83 -12
  145. package/src/client/theme/neutral.css +74 -361
  146. package/src/client/theme/reset.css +189 -0
  147. package/src/client/types.ts +10 -2
  148. package/src/client/utils/path.ts +9 -0
  149. package/src/client/utils/react-to-text.ts +24 -24
  150. package/src/client/virtual.d.ts +1 -1
  151. package/src/shared/types.ts +97 -21
  152. package/dist/node-CWN8U_p8.mjs +0 -88
  153. package/dist/node-D5iosYXv.cjs +0 -88
  154. package/dist/search-dialog-3lvKsbVG.js +0 -6
  155. package/dist/search-dialog-DMK5OpgH.cjs +0 -6
  156. package/dist/use-search-C9bxCqfF.js +0 -6
  157. package/dist/use-search-DcfZSunO.cjs +0 -6
  158. package/src/client/components/mdx/admonition.tsx +0 -91
  159. package/src/client/components/mdx/badge.tsx +0 -41
  160. package/src/client/components/mdx/button.tsx +0 -35
  161. package/src/client/components/mdx/component-preview.tsx +0 -37
  162. package/src/client/components/mdx/component-props.tsx +0 -83
  163. package/src/client/components/mdx/file-tree.tsx +0 -325
  164. package/src/client/components/mdx/hooks/use-component-preview.ts +0 -16
  165. package/src/client/components/mdx/hooks/useTable.ts +0 -74
  166. package/src/client/components/mdx/hooks/useTabs.ts +0 -68
  167. package/src/client/components/mdx/link.tsx +0 -38
  168. package/src/client/components/mdx/list.tsx +0 -192
  169. package/src/client/components/mdx/tabs.tsx +0 -135
  170. package/src/client/components/mdx/video.tsx +0 -68
  171. package/src/client/components/primitives/index.ts +0 -19
  172. package/src/client/components/primitives/navigation-menu.tsx +0 -114
  173. package/src/client/components/ui-base/head.tsx +0 -76
  174. package/src/client/components/ui-base/loading.tsx +0 -57
  175. package/src/client/components/ui-base/powered-by.tsx +0 -25
  176. package/src/client/hooks/use-onthispage.ts +0 -23
  177. package/src/client/utils/use-on-change.ts +0 -15
@@ -0,0 +1,491 @@
1
+
2
+ import * as React$2 from "react";
3
+ import { ComponentType, ReactNode } from "react";
4
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
5
+ import { Plugin } from "vite";
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: string;
37
+ items?: Array<{
38
+ label: string | Record<string, string>;
39
+ href: string;
40
+ }>;
41
+ }>;
42
+ sidebar?: Record<string, Array<{
43
+ text: string;
44
+ link: string;
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
+ * Defines a Boltdocs plugin.
116
+ */
117
+ interface BoltdocsPlugin {
118
+ name: string;
119
+ enforce?: 'pre' | 'post';
120
+ version?: string;
121
+ boltdocsVersion?: string;
122
+ permissions?: string[];
123
+ remarkPlugins?: unknown[];
124
+ rehypePlugins?: unknown[];
125
+ vitePlugins?: Plugin[];
126
+ components?: Record<string, string>;
127
+ hooks?: Record<string, any>;
128
+ }
129
+ /**
130
+ * Configuration for security-related settings.
131
+ */
132
+ interface BoltdocsSecurityConfig {
133
+ headers?: Record<string, string>;
134
+ enableCSP?: boolean;
135
+ customHeaders?: Record<string, string>;
136
+ }
137
+ /**
138
+ * Configuration for SEO.
139
+ */
140
+ interface BoltdocsSeoConfig {
141
+ metatags?: Record<string, string>;
142
+ indexing?: 'all' | 'public';
143
+ thumbnails?: {
144
+ background?: string;
145
+ };
146
+ }
147
+ /**
148
+ * Configuration for Google Analytics 4 (GA4).
149
+ */
150
+ interface BoltdocsGA4Config {
151
+ measurementId: string;
152
+ debug?: boolean;
153
+ anonymizeIp?: boolean;
154
+ sendPageView?: boolean;
155
+ cookieFlags?: string;
156
+ autoTrack?: {
157
+ pageViews?: boolean;
158
+ downloads?: boolean;
159
+ externalLinks?: boolean;
160
+ search?: boolean;
161
+ };
162
+ }
163
+ /**
164
+ * Configuration for Google Tag Manager (GTM).
165
+ */
166
+ interface BoltdocsGTMConfig {
167
+ tagId: string;
168
+ dataLayerName?: string;
169
+ preview?: string;
170
+ }
171
+ interface BoltdocsIntegrationsConfig {
172
+ ga4?: BoltdocsGA4Config;
173
+ gtm?: BoltdocsGTMConfig;
174
+ }
175
+ /**
176
+ * The root configuration object for Boltdocs.
177
+ */
178
+ interface BoltdocsConfig$1 {
179
+ siteUrl?: string;
180
+ docsDir?: string;
181
+ base?: string;
182
+ theme?: BoltdocsThemeConfig;
183
+ i18n?: BoltdocsI18nConfig;
184
+ versions?: BoltdocsVersionsConfig;
185
+ plugins?: BoltdocsPlugin[];
186
+ robots?: BoltdocsRobotsConfig;
187
+ security?: BoltdocsSecurityConfig;
188
+ seo?: BoltdocsSeoConfig;
189
+ integrations?: BoltdocsIntegrationsConfig;
190
+ /** Aggregated metadata from local meta.json files */
191
+ directoryMeta?: Record<string, any>;
192
+ vite?: any;
193
+ }
194
+ /**
195
+ * Global namespace for Boltdocs types that can be augmented by generated code.
196
+ * This allows for strictly typed locales and versions based on the project configuration.
197
+ */
198
+ declare global {
199
+ namespace Boltdocs {
200
+ interface Types {}
201
+ }
202
+ }
203
+ type BoltdocsTypes = Boltdocs.Types;
204
+ type BoltdocsLocale = Boltdocs.Types extends {
205
+ Locale: infer L;
206
+ } ? L : string;
207
+ type BoltdocsVersion = Boltdocs.Types extends {
208
+ Version: infer V;
209
+ } ? V : string;
210
+ type UnpackMdxComponents<T> = T extends {
211
+ default: infer D;
212
+ } ? D : T;
213
+ type TransformMdxComponents<T> = { [K in keyof T as K extends `Frontmatter_${string}` ? never : K]: T[K] } & {
214
+ Frontmatter: { [K in keyof T as K extends `Frontmatter_${infer Name}` ? Name : never]: T[K] };
215
+ };
216
+ type BoltdocsMdxComponents = Boltdocs.Types extends {
217
+ MdxComponents: infer M;
218
+ } ? TransformMdxComponents<UnpackMdxComponents<M>> : {
219
+ [key: string]: ComponentType<any>;
220
+ Frontmatter: Record<string, ComponentType<any>>;
221
+ };
222
+ //#endregion
223
+ //#region src/client/types.d.ts
224
+ /**
225
+ * Metadata provided by the server for a specific route.
226
+ * Maps closely to the `RouteMeta` type in the Node environment.
227
+ */
228
+ interface ComponentRoute {
229
+ /** The final URL path */
230
+ path: string;
231
+ /** The absolute filesystem path of the source file */
232
+ componentPath: string;
233
+ /** The page title */
234
+ title: string;
235
+ /** Explicit order in the sidebar */
236
+ sidebarPosition?: number;
237
+ /** The relative path from the docs directory */
238
+ filePath: string;
239
+ /** The group directory name */
240
+ group?: string;
241
+ /** The display title of the group */
242
+ groupTitle?: string;
243
+ /** Explicit order of the group in the sidebar */
244
+ groupPosition?: number;
245
+ /** Extracted markdown headings for search indexing */
246
+ headings?: {
247
+ level: number;
248
+ text: string;
249
+ id: string;
250
+ }[];
251
+ /** The page summary or description */
252
+ description?: string;
253
+ /** The locale this route belongs to, if i18n is configured */
254
+ locale?: string;
255
+ /** The version this route belongs to, if versioning is configured */
256
+ version?: string;
257
+ /** Optional icon to display (Lucide icon name or raw SVG) */
258
+ icon?: string;
259
+ /** The tab this route belongs to, if tabs are configured */
260
+ tab?: string;
261
+ /** Optional badge to display next to the sidebar item */
262
+ badge?: string | {
263
+ text: 'updated' | 'new' | 'deprecated';
264
+ expires?: string;
265
+ };
266
+ /** Optional icon for the route's group */
267
+ groupIcon?: string;
268
+ /** The sub-route group this route belongs to (from folders starting with _) */
269
+ subRouteGroup?: string;
270
+ /** The nested sub-routes if this route acts as the parent of a subRouteGroup */
271
+ subRoutes?: ComponentRoute[];
272
+ /** The extracted plain-text content of the page for search indexing */
273
+ _content?: string;
274
+ /** The raw markdown content of the page */
275
+ _rawContent?: string;
276
+ /** The publication date */
277
+ date?: string | Date;
278
+ /** The last updated timestamp or date */
279
+ lastUpdated?: string | number | Date;
280
+ /** Raw extensible frontmatter data for custom components and formatters */
281
+ frontmatter?: Record<string, any>;
282
+ /** Clean URL segments stripped of locale/version prefixes */
283
+ slugParts?: string[];
284
+ }
285
+ /**
286
+ * Site configuration provided by the server.
287
+ */
288
+ type SiteConfig = BoltdocsConfig;
289
+ /**
290
+ * Tab configuration for the documentation site.
291
+ */
292
+ interface BoltdocsTab {
293
+ id: string;
294
+ /** Text to display (can be a string or a map of translations) */
295
+ text: string | Record<string, string>;
296
+ icon?: string;
297
+ }
298
+ /**
299
+ * Props for the Sidebar component.
300
+ */
301
+ interface SidebarProps {
302
+ routes: ComponentRoute[];
303
+ config: BoltdocsConfig;
304
+ }
305
+ /**
306
+ * Props for the OnThisPage (TOC) component.
307
+ */
308
+ interface OnThisPageProps {
309
+ headings?: {
310
+ level: number;
311
+ text: string;
312
+ id: string;
313
+ }[];
314
+ editLink?: string;
315
+ communityHelp?: string;
316
+ filePath?: string;
317
+ }
318
+ /**
319
+ * Props for the Tabs component.
320
+ */
321
+ interface TabsProps {
322
+ tabs: BoltdocsTab[];
323
+ routes: ComponentRoute[];
324
+ }
325
+ /**
326
+ * Props for user-defined layout components (layout.tsx).
327
+ */
328
+ interface LayoutProps {
329
+ children: React$2.ReactNode;
330
+ }
331
+ /**
332
+ * Unified type for navbar links.
333
+ */
334
+ interface NavbarLink {
335
+ label: string | Record<string, string>;
336
+ href: string;
337
+ active: boolean;
338
+ to?: string;
339
+ items?: NavbarLink[];
340
+ }
341
+ //#endregion
342
+ //#region src/client/components/primitives/types.d.ts
343
+ type ComponentBase = {
344
+ className?: string;
345
+ children?: ReactNode;
346
+ };
347
+ //#endregion
348
+ //#region src/client/components/primitives/sidebar.d.ts
349
+ /**
350
+ * Desktop Sidebar Container
351
+ */
352
+ declare function SidebarRoot({
353
+ children,
354
+ className
355
+ }: ComponentBase): _$react_jsx_runtime0.JSX.Element;
356
+ /**
357
+ * Mobile Sidebar Modal
358
+ */
359
+ declare function SidebarMobile({
360
+ children,
361
+ className
362
+ }: ComponentBase): _$react_jsx_runtime0.JSX.Element;
363
+ /**
364
+ * Shared Header for Sidebar
365
+ */
366
+ declare function SidebarHeader({
367
+ children,
368
+ className
369
+ }: ComponentBase): _$react_jsx_runtime0.JSX.Element;
370
+ /**
371
+ * Scrollable Content Wrapper
372
+ */
373
+ declare function SidebarContent({
374
+ children,
375
+ className
376
+ }: ComponentBase): _$react_jsx_runtime0.JSX.Element;
377
+ /**
378
+ * Navigation Group
379
+ */
380
+ declare const SidebarGroup: ({
381
+ title,
382
+ icon: Icon,
383
+ children,
384
+ className
385
+ }: {
386
+ title?: string;
387
+ icon?: React.ElementType;
388
+ } & ComponentBase) => _$react_jsx_runtime0.JSX.Element;
389
+ /**
390
+ * Sidebar Link
391
+ */
392
+ interface SidebarLinkProps extends ComponentBase {
393
+ label: string;
394
+ href: string;
395
+ active?: boolean;
396
+ icon?: React.ElementType;
397
+ badge?: ComponentRoute['badge'];
398
+ }
399
+ declare const SidebarLink: ({
400
+ label,
401
+ href,
402
+ active,
403
+ icon: Icon,
404
+ badge,
405
+ className
406
+ }: SidebarLinkProps) => _$react_jsx_runtime0.JSX.Element;
407
+ /**
408
+ * Nested SubGroup
409
+ */
410
+ declare const SidebarSubGroup: ({
411
+ label,
412
+ href,
413
+ active,
414
+ icon: Icon,
415
+ badge,
416
+ isOpen,
417
+ onToggle,
418
+ children,
419
+ className
420
+ }: SidebarLinkProps & {
421
+ isOpen: boolean;
422
+ onToggle: () => void;
423
+ children: ReactNode;
424
+ }) => _$react_jsx_runtime0.JSX.Element;
425
+ /**
426
+ * Automated single-route rendering primitive
427
+ */
428
+ interface SidebarItemProps extends ComponentBase {
429
+ route: ComponentRoute;
430
+ activePath: string;
431
+ }
432
+ declare function SidebarItem({
433
+ route,
434
+ activePath,
435
+ className
436
+ }: SidebarItemProps): _$react_jsx_runtime0.JSX.Element;
437
+ /**
438
+ * High-level automated routes data rendering primitive
439
+ */
440
+ interface SidebarItemsProps extends ComponentBase {
441
+ routes: ComponentRoute[];
442
+ }
443
+ declare function SidebarItems({
444
+ routes,
445
+ className
446
+ }: SidebarItemsProps): _$react_jsx_runtime0.JSX.Element;
447
+ /**
448
+ * Main Sidebar Export
449
+ */
450
+ declare const Sidebar: typeof SidebarRoot & {
451
+ Root: typeof SidebarRoot;
452
+ Mobile: typeof SidebarMobile;
453
+ Header: typeof SidebarHeader;
454
+ Content: typeof SidebarContent;
455
+ Group: ({
456
+ title,
457
+ icon: Icon,
458
+ children,
459
+ className
460
+ }: {
461
+ title?: string;
462
+ icon?: React.ElementType;
463
+ } & ComponentBase) => _$react_jsx_runtime0.JSX.Element;
464
+ Link: ({
465
+ label,
466
+ href,
467
+ active,
468
+ icon: Icon,
469
+ badge,
470
+ className
471
+ }: SidebarLinkProps) => _$react_jsx_runtime0.JSX.Element;
472
+ SubGroup: ({
473
+ label,
474
+ href,
475
+ active,
476
+ icon: Icon,
477
+ badge,
478
+ isOpen,
479
+ onToggle,
480
+ children,
481
+ className
482
+ }: SidebarLinkProps & {
483
+ isOpen: boolean;
484
+ onToggle: () => void;
485
+ children: ReactNode;
486
+ }) => _$react_jsx_runtime0.JSX.Element;
487
+ Item: typeof SidebarItem;
488
+ Items: typeof SidebarItems;
489
+ };
490
+ //#endregion
491
+ export { BoltdocsConfig$1 as C, BoltdocsSocialLink as D, BoltdocsMdxComponents as E, BoltdocsTypes as O, TabsProps as S, BoltdocsLocale as T, LayoutProps as _, SidebarItem as a, SidebarProps as b, SidebarItemsProps as c, SidebarMobile as d, SidebarRoot as f, ComponentRoute as g, BoltdocsTab as h, SidebarHeader as i, BoltdocsVersion 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, NavbarLink as v, BoltdocsIntegrationsConfig as w, SiteConfig as x, OnThisPageProps as y };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ import e from"fs";import t from"isomorphic-dompurify";import{z as n}from"zod";const r=/^[a-zA-Z0-9\-_/.()]+$/,i=n.looseObject({title:n.string().max(200).optional(),description:n.string().max(500).optional(),permalink:n.string().optional(),sidebarPosition:n.number().optional(),sidebarLabel:n.string().max(100).optional(),sidebarHidden:n.boolean().optional(),hidden:n.boolean().optional(),category:n.string().max(50).optional(),order:n.number().optional(),badge:n.union([n.string().max(50),n.object({text:n.string().max(50),expires:n.string().optional()})]).optional(),icon:n.string().max(50).optional(),date:n.union([n.string(),n.date()]).optional(),lastUpdated:n.union([n.string(),n.date()]).optional(),groupTitle:n.string().max(100).optional(),groupPosition:n.number().optional(),seo:n.record(n.any()).optional()});function a(e){let t=e.trim();if(!t.startsWith(`---`))return{data:{},content:e,rawMatter:``};let n=t.indexOf(`---`,3);if(n===-1||n===3)return{data:{},content:e,rawMatter:``};let r=t.slice(3,n).trim(),i=t.slice(n+3).trim();return o(r)?{data:{},content:i,rawMatter:r}:{data:s(r),content:i,rawMatter:r}}function o(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r],a=r>0?e[r-1]:``;i===`'`&&!n&&a!==`\\`?t=!t:i===`"`&&!t&&a!==`\\`&&(n=!n)}return t||n}function s(e){let t=e.split(`
7
+ `),n={},r=0;for(;r<t.length;){let e=t[r],i=e.trim();if(!i||i.startsWith(`#`)){r++;continue}let a=i.indexOf(`:`);if(a!==-1){let o=i.slice(0,a).trim(),s=i.slice(a+1).trim();if(s===``){let i=c(t.slice(r+1),e.search(/\S|$/));i.value===void 0?r++:(n[o]=i.value,r+=i.linesConsumed)}else n[o]=l(s),r++}else r++}return n}function c(e,t){if(e.length===0)return{value:void 0,linesConsumed:0};if(e[0].trim().startsWith(`-`)){let n=[],r=0;for(;r<e.length;){let i=e[r],a=i.search(/\S|$/),o=i.trim();if(!o||o.startsWith(`#`)){r++;continue}if(o.startsWith(`-`)){let e=o.slice(1).trim();if(e.includes(`:`)){let t={},r=e.split(/,\s*/);for(let e of r){let n=e.indexOf(`:`);if(n!==-1){let r=e.slice(0,n).trim();t[r]=l(e.slice(n+1).trim())}}n.push(t)}else n.push(e)}else if(a>t&&n.length>0){let e=n[n.length-1];if(typeof e==`object`&&e){let t=e,n=o.indexOf(`:`);if(n!==-1){let e=o.slice(0,n).trim();t[e]=l(o.slice(n+1).trim())}}}else break;r++}return{value:n.length>0?n:void 0,linesConsumed:r}}let n={},r=0;for(;r<e.length;){let i=e[r],a=i.search(/\S|$/),o=i.trim();if(!o||o.startsWith(`#`)){r++;continue}if(a<=t)break;let s=o.indexOf(`:`);if(s!==-1){let e=o.slice(0,s).trim();n[e]=l(o.slice(s+1).trim())}r++}return{value:Object.keys(n).length>0?n:void 0,linesConsumed:r}}function l(e){let t=e.trim();if(t===`true`)return!0;if(t===`false`)return!1;if(t===`null`||t===`~`)return null;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`))return t.slice(1,-1);if(t.startsWith(`{`)&&t.endsWith(`}`)){let e=t.slice(1,-1).trim(),n={},r=e.split(/,\s*/);for(let e of r){let t=e.indexOf(`:`);if(t!==-1){let r=e.slice(0,t).trim();n[r]=l(e.slice(t+1).trim())}}return n}return t}var u=class e extends Error{constructor(t){super(t),this.name=`SecurityViolationError`,Object.setPrototypeOf(this,e.prototype)}},d=class e extends u{constructor(t){super(t),this.name=`PathTraversalError`,Object.setPrototypeOf(this,e.prototype)}},f=class e extends u{constructor(t){super(t),this.name=`EncodingSecurityError`,Object.setPrototypeOf(this,e.prototype)}},p=class e extends u{constructor(t){super(t),this.name=`ValidationError`,Object.setPrototypeOf(this,e.prototype)}};function m(e){return e.replace(/\\/g,`/`)}function h(e){return e.replace(/^\d+\./,``)}function g(e){let t=e.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function _(e){return/\.mdx?$/.test(e)}function v(t){try{return e.statSync(t).mtimeMs}catch{return 0}}async function y(t,n=!0){let r=``;try{r=await e.promises.readFile(t,`utf-8`);let{data:o,content:s,rawMatter:c}=a(r);if(c&&c.length>10240)throw D(`FRONTMATTER_TOO_LARGE`,`Frontmatter block exceeds size limit`,{size:c.length,file:t}),new p(`Security breach: Frontmatter size exceeds limit of 10240 bytes`);if(!n)return{data:o,content:s,raw:r};let l=i.safeParse(o),u={...l.success?l.data:{}};return u.lastUpdated||=(await e.promises.stat(t)).mtimeMs,u.title&&=w(u.title).trim(),u.description&&=w(u.description).trim(),{data:u,content:s,raw:r}}catch(e){if(e instanceof p)throw e;return{data:{},content:r,raw:r}}}function b(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function x(e){return b(e)}function S(e){let t=m(e).split(`/`).map(e=>E(h(e))).join(`/`).replace(/\/$/,``);return t=t.replace(/\.mdx?$/,``),(t===`index`||t.endsWith(`/index`))&&(t=t.replace(/index$/,``)),t.startsWith(`/`)||(t=`/`+t),t.length>1&&t.endsWith(`/`)&&(t=t.slice(0,-1)),t}function C(e){return t.sanitize(e,{ALLOWED_TAGS:`b.i.em.strong.a.p.br.code.pre.span.div.h1.h2.h3.h4.h5.h6.ul.ol.li.table.thead.tbody.tr.th.td.blockquote.hr`.split(`.`),ALLOWED_ATTR:[`href`,`title`,`target`,`class`,`id`,`src`,`alt`,`width`,`height`],FORCE_BODY:!0})}t.addHook(`afterSanitizeAttributes`,e=>{if(e.hasAttribute(`href`)){let t=e.getAttribute(`href`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`href`)}if(e.hasAttribute(`src`)){let t=e.getAttribute(`src`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`src`)}});function w(e){return e?e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,``).replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi,``).replace(/<!--[\s\S]*?-->/g,``).replace(/<[^>]+>/g,` `).replace(/\s+/g,` `).trim():``}function T(e){return e.charAt(0).toUpperCase()+e.slice(1)}function E(e){return e.replace(/[^a-zA-Z0-9\-_/.]/g,``).split(`/`).filter(e=>e!==`..`&&e!==`.`).map(e=>e.replace(/\.\.+/g,`.`)).join(`/`)}function D(e,t,n={}){let r=new Date().toISOString(),i={...n};for(let e in i)typeof i[e]==`string`&&i[e].includes(`:`)&&(i[e]=i[e].split(/[\\/]/).pop()||i[e]);console.error(`[SECURITY][${r}] TYPE: ${e} | MESSAGE: ${t} | DETAILS: ${JSON.stringify(i)}`)}function O(){return{dir:process.env.BOLTDOCS_CACHE_DIR||`.boltdocs`,noCache:process.env.BOLTDOCS_NO_CACHE===`1`,lruLimit:parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||`2000`,10),lruTTL:parseInt(process.env.BOLTDOCS_CACHE_LRU_TTL||`14400000`,10),compress:process.env.BOLTDOCS_CACHE_COMPRESS!==`0`}}export{p as _,O as a,D as c,E as d,C as f,d as g,f as h,S as i,m as l,h as m,x as n,v as o,w as p,g as r,_ as s,T as t,y as u,i as v,r as y};
@@ -0,0 +1,7 @@
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`);let t=require(`fs`);t=e.n(t);let n=require(`isomorphic-dompurify`);n=e.n(n);let r=require(`zod`);const i=/^[a-zA-Z0-9\-_/.()]+$/,a=r.z.looseObject({title:r.z.string().max(200).optional(),description:r.z.string().max(500).optional(),permalink:r.z.string().optional(),sidebarPosition:r.z.number().optional(),sidebarLabel:r.z.string().max(100).optional(),sidebarHidden:r.z.boolean().optional(),hidden:r.z.boolean().optional(),category:r.z.string().max(50).optional(),order:r.z.number().optional(),badge:r.z.union([r.z.string().max(50),r.z.object({text:r.z.string().max(50),expires:r.z.string().optional()})]).optional(),icon:r.z.string().max(50).optional(),date:r.z.union([r.z.string(),r.z.date()]).optional(),lastUpdated:r.z.union([r.z.string(),r.z.date()]).optional(),groupTitle:r.z.string().max(100).optional(),groupPosition:r.z.number().optional(),seo:r.z.record(r.z.any()).optional()});function o(e){let t=e.trim();if(!t.startsWith(`---`))return{data:{},content:e,rawMatter:``};let n=t.indexOf(`---`,3);if(n===-1||n===3)return{data:{},content:e,rawMatter:``};let r=t.slice(3,n).trim(),i=t.slice(n+3).trim();return s(r)?{data:{},content:i,rawMatter:r}:{data:c(r),content:i,rawMatter:r}}function s(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r],a=r>0?e[r-1]:``;i===`'`&&!n&&a!==`\\`?t=!t:i===`"`&&!t&&a!==`\\`&&(n=!n)}return t||n}function c(e){let t=e.split(`
7
+ `),n={},r=0;for(;r<t.length;){let e=t[r],i=e.trim();if(!i||i.startsWith(`#`)){r++;continue}let a=i.indexOf(`:`);if(a!==-1){let o=i.slice(0,a).trim(),s=i.slice(a+1).trim();if(s===``){let i=l(t.slice(r+1),e.search(/\S|$/));i.value===void 0?r++:(n[o]=i.value,r+=i.linesConsumed)}else n[o]=u(s),r++}else r++}return n}function l(e,t){if(e.length===0)return{value:void 0,linesConsumed:0};if(e[0].trim().startsWith(`-`)){let n=[],r=0;for(;r<e.length;){let i=e[r],a=i.search(/\S|$/),o=i.trim();if(!o||o.startsWith(`#`)){r++;continue}if(o.startsWith(`-`)){let e=o.slice(1).trim();if(e.includes(`:`)){let t={},r=e.split(/,\s*/);for(let e of r){let n=e.indexOf(`:`);if(n!==-1){let r=e.slice(0,n).trim();t[r]=u(e.slice(n+1).trim())}}n.push(t)}else n.push(e)}else if(a>t&&n.length>0){let e=n[n.length-1];if(typeof e==`object`&&e){let t=e,n=o.indexOf(`:`);if(n!==-1){let e=o.slice(0,n).trim();t[e]=u(o.slice(n+1).trim())}}}else break;r++}return{value:n.length>0?n:void 0,linesConsumed:r}}let n={},r=0;for(;r<e.length;){let i=e[r],a=i.search(/\S|$/),o=i.trim();if(!o||o.startsWith(`#`)){r++;continue}if(a<=t)break;let s=o.indexOf(`:`);if(s!==-1){let e=o.slice(0,s).trim();n[e]=u(o.slice(s+1).trim())}r++}return{value:Object.keys(n).length>0?n:void 0,linesConsumed:r}}function u(e){let t=e.trim();if(t===`true`)return!0;if(t===`false`)return!1;if(t===`null`||t===`~`)return null;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`))return t.slice(1,-1);if(t.startsWith(`{`)&&t.endsWith(`}`)){let e=t.slice(1,-1).trim(),n={},r=e.split(/,\s*/);for(let e of r){let t=e.indexOf(`:`);if(t!==-1){let r=e.slice(0,t).trim();n[r]=u(e.slice(t+1).trim())}}return n}return t}var d=class e extends Error{constructor(t){super(t),this.name=`SecurityViolationError`,Object.setPrototypeOf(this,e.prototype)}},f=class e extends d{constructor(t){super(t),this.name=`PathTraversalError`,Object.setPrototypeOf(this,e.prototype)}},p=class e extends d{constructor(t){super(t),this.name=`EncodingSecurityError`,Object.setPrototypeOf(this,e.prototype)}},m=class e extends d{constructor(t){super(t),this.name=`ValidationError`,Object.setPrototypeOf(this,e.prototype)}};function h(e){return e.replace(/\\/g,`/`)}function g(e){return e.replace(/^\d+\./,``)}function _(e){let t=e.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function v(e){return/\.mdx?$/.test(e)}function y(e){try{return t.default.statSync(e).mtimeMs}catch{return 0}}async function b(e,n=!0){let r=``;try{r=await t.default.promises.readFile(e,`utf-8`);let{data:i,content:s,rawMatter:c}=o(r);if(c&&c.length>10240)throw O(`FRONTMATTER_TOO_LARGE`,`Frontmatter block exceeds size limit`,{size:c.length,file:e}),new m(`Security breach: Frontmatter size exceeds limit of 10240 bytes`);if(!n)return{data:i,content:s,raw:r};let l=a.safeParse(i),u={...l.success?l.data:{}};return u.lastUpdated||=(await t.default.promises.stat(e)).mtimeMs,u.title&&=T(u.title).trim(),u.description&&=T(u.description).trim(),{data:u,content:s,raw:r}}catch(e){if(e instanceof m)throw e;return{data:{},content:r,raw:r}}}function x(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function S(e){return x(e)}function C(e){let t=h(e).split(`/`).map(e=>D(g(e))).join(`/`).replace(/\/$/,``);return t=t.replace(/\.mdx?$/,``),(t===`index`||t.endsWith(`/index`))&&(t=t.replace(/index$/,``)),t.startsWith(`/`)||(t=`/`+t),t.length>1&&t.endsWith(`/`)&&(t=t.slice(0,-1)),t}function w(e){return n.default.sanitize(e,{ALLOWED_TAGS:`b.i.em.strong.a.p.br.code.pre.span.div.h1.h2.h3.h4.h5.h6.ul.ol.li.table.thead.tbody.tr.th.td.blockquote.hr`.split(`.`),ALLOWED_ATTR:[`href`,`title`,`target`,`class`,`id`,`src`,`alt`,`width`,`height`],FORCE_BODY:!0})}n.default.addHook(`afterSanitizeAttributes`,e=>{if(e.hasAttribute(`href`)){let t=e.getAttribute(`href`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`href`)}if(e.hasAttribute(`src`)){let t=e.getAttribute(`src`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`src`)}});function T(e){return e?e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,``).replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi,``).replace(/<!--[\s\S]*?-->/g,``).replace(/<[^>]+>/g,` `).replace(/\s+/g,` `).trim():``}function E(e){return e.charAt(0).toUpperCase()+e.slice(1)}function D(e){return e.replace(/[^a-zA-Z0-9\-_/.]/g,``).split(`/`).filter(e=>e!==`..`&&e!==`.`).map(e=>e.replace(/\.\.+/g,`.`)).join(`/`)}function O(e,t,n={}){let r=new Date().toISOString(),i={...n};for(let e in i)typeof i[e]==`string`&&i[e].includes(`:`)&&(i[e]=i[e].split(/[\\/]/).pop()||i[e]);console.error(`[SECURITY][${r}] TYPE: ${e} | MESSAGE: ${t} | DETAILS: ${JSON.stringify(i)}`)}function k(){return{dir:process.env.BOLTDOCS_CACHE_DIR||`.boltdocs`,noCache:process.env.BOLTDOCS_NO_CACHE===`1`,lruLimit:parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||`2000`,10),lruTTL:parseInt(process.env.BOLTDOCS_CACHE_LRU_TTL||`14400000`,10),compress:process.env.BOLTDOCS_CACHE_COMPRESS!==`0`}}Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return i}});
@@ -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 e from"node:path";import t from"node:fs";import{fileURLToPath as n}from"node:url";import{Worker as r}from"node:worker_threads";import i from"node:os";const a=e.dirname(n(import.meta.url)),o=new class{workers=[];queue=[];activeWorkers=0;maxWorkers;maxQueueSize;constructor(e,t=2e3){this.maxWorkers=e||Math.max(1,i.cpus().length-1),this.maxQueueSize=t}idleWorkers=[];async parseFile(e,t,n,r){return this.queue.length>=this.maxQueueSize?Promise.reject(Error(`[boltdocs] WorkerPool queue is full (limit: ${this.maxQueueSize}). Too many files enqueued simultaneously. Consider increasing maxQueueSize.`)):new Promise((i,a)=>{this.queue.push({task:{type:`PARSE_FILE`,file:e,docsDir:t,basePath:n,config:r},resolve:i,reject:a}),this.processNext()})}processNext(){if(this.queue.length===0)return;let e=this.idleWorkers.pop();if(!e){if(this.activeWorkers>=this.maxWorkers)return;this.activeWorkers++;let t=this.getWorkerPath(),n=new r(t,{execArgv:t.endsWith(`.ts`)?[`--loader`,`tsx`]:[]});e=n,this.workers.push(n);let i=(e,t)=>{let n=this.workers.indexOf(e);if(n===-1)return;let r=e.currentTask;r&&(e.currentTask=null,r.reject(t||Error(`Worker terminated unexpectedly`))),this.activeWorkers--;let i=this.idleWorkers.indexOf(e);i>-1&&this.idleWorkers.splice(i,1),this.workers.splice(n,1),e.terminate(),this.processNext()};n.on(`message`,e=>{let t=n.currentTask;t&&(n.currentTask=null,e.type===`SUCCESS`?t.resolve(e.result):t.reject(Error(e.error))),this.idleWorkers.push(n),this.processNext()}),n.on(`error`,e=>{i(n,e)}),n.on(`exit`,e=>{e!==0&&i(n,Error(`Worker exited with code ${e}`))})}let{task:t,resolve:n,reject:i}=this.queue.shift();e.currentTask={resolve:n,reject:i},e.postMessage(t)}getWorkerPath(){if(import.meta.url.includes(`/dist/`)||e.extname(import.meta.url)===`.mjs`){let n=[e.resolve(a,`node/routes/worker.mjs`),e.resolve(a,`worker.mjs`),e.resolve(a,`./node/routes/worker.mjs`)];for(let e of n)if(t.existsSync(e))return e;return e.resolve(a,`node/routes/worker.mjs`)}return e.resolve(a,`worker.ts`)}async terminate(){let e=[...this.workers];await Promise.all(e.map(e=>e.terminate())),this.idleWorkers=[],this.workers=[],this.activeWorkers=0}};export{o as pool};
@@ -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-Ds5LZdWN.cjs`);let t=require(`node:path`);t=e.n(t);let n=require(`node:fs`);n=e.n(n);let r=require(`node:worker_threads`),i=require(`node:os`);i=e.n(i);let a=require(`node:url`);const o=t.default.dirname((0,a.fileURLToPath)(require(`url`).pathToFileURL(__filename).href)),s=new class{workers=[];queue=[];activeWorkers=0;maxWorkers;maxQueueSize;constructor(e,t=2e3){this.maxWorkers=e||Math.max(1,i.default.cpus().length-1),this.maxQueueSize=t}idleWorkers=[];async parseFile(e,t,n,r){return this.queue.length>=this.maxQueueSize?Promise.reject(Error(`[boltdocs] WorkerPool queue is full (limit: ${this.maxQueueSize}). Too many files enqueued simultaneously. Consider increasing maxQueueSize.`)):new Promise((i,a)=>{this.queue.push({task:{type:`PARSE_FILE`,file:e,docsDir:t,basePath:n,config:r},resolve:i,reject:a}),this.processNext()})}processNext(){if(this.queue.length===0)return;let e=this.idleWorkers.pop();if(!e){if(this.activeWorkers>=this.maxWorkers)return;this.activeWorkers++;let t=this.getWorkerPath(),n=new r.Worker(t,{execArgv:t.endsWith(`.ts`)?[`--loader`,`tsx`]:[]});e=n,this.workers.push(n);let i=(e,t)=>{let n=this.workers.indexOf(e);if(n===-1)return;let r=e.currentTask;r&&(e.currentTask=null,r.reject(t||Error(`Worker terminated unexpectedly`))),this.activeWorkers--;let i=this.idleWorkers.indexOf(e);i>-1&&this.idleWorkers.splice(i,1),this.workers.splice(n,1),e.terminate(),this.processNext()};n.on(`message`,e=>{let t=n.currentTask;t&&(n.currentTask=null,e.type===`SUCCESS`?t.resolve(e.result):t.reject(Error(e.error))),this.idleWorkers.push(n),this.processNext()}),n.on(`error`,e=>{i(n,e)}),n.on(`exit`,e=>{e!==0&&i(n,Error(`Worker exited with code ${e}`))})}let{task:t,resolve:n,reject:i}=this.queue.shift();e.currentTask={resolve:n,reject:i},e.postMessage(t)}getWorkerPath(){if(require(`url`).pathToFileURL(__filename).href.includes(`/dist/`)||t.default.extname(require(`url`).pathToFileURL(__filename).href)===`.mjs`){let e=[t.default.resolve(o,`node/routes/worker.mjs`),t.default.resolve(o,`worker.mjs`),t.default.resolve(o,`./node/routes/worker.mjs`)];for(let t of e)if(n.default.existsSync(t))return t;return t.default.resolve(o,`node/routes/worker.mjs`)}return t.default.resolve(o,`worker.ts`)}async terminate(){let e=[...this.workers];await Promise.all(e.map(e=>e.terminate())),this.idleWorkers=[],this.workers=[],this.activeWorkers=0}};exports.pool=s;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boltdocs",
3
- "version": "2.6.1",
3
+ "version": "2.7.0",
4
4
  "description": "A lightweight documentation generator for React projects.",
5
5
  "main": "dist/node/index.mjs",
6
6
  "module": "dist/node/index.mjs",
@@ -26,7 +26,18 @@
26
26
  "import": "./dist/client/index.js",
27
27
  "require": "./dist/client/index.cjs"
28
28
  },
29
- "./theme/neutral.css": "./dist/client/theme/neutral.css"
29
+ "./primitives": {
30
+ "types": "./dist/client/primitives.d.ts",
31
+ "import": "./dist/client/primitives.js",
32
+ "require": "./dist/client/primitives.cjs"
33
+ },
34
+ "./mdx": {
35
+ "types": "./dist/client/mdx.d.ts",
36
+ "import": "./dist/client/mdx.js",
37
+ "require": "./dist/client/mdx.cjs"
38
+ },
39
+ "./theme/neutral.css": "./src/client/theme/neutral.css",
40
+ "./theme/reset.css": "./src/client/theme/reset.css"
30
41
  },
31
42
  "files": [
32
43
  "dist",
@@ -49,17 +60,19 @@
49
60
  "license": "MIT",
50
61
  "dependencies": {
51
62
  "@mdx-js/rollup": "3.1.1",
52
- "@tailwindcss/vite": "4.2.2",
63
+ "@tailwindcss/vite": "4.3.0",
53
64
  "@vitejs/plugin-react": "6.0.1",
54
65
  "cac": "7.0.0",
55
66
  "class-variance-authority": "0.7.1",
56
67
  "clsx": "2.1.1",
57
- "fast-glob": "3.3.3",
68
+ "fastest-levenshtein": "^1.0.16",
69
+ "fdir": "^6.5.0",
58
70
  "flexsearch": "0.8.212",
59
71
  "github-slugger": "2.0.0",
60
- "gray-matter": "4.0.3",
61
72
  "isomorphic-dompurify": "3.7.1",
62
- "lucide-react": "0.575.0",
73
+ "lru-cache": "^11.3.6",
74
+ "lucide-react": "1.16.0",
75
+ "picomatch": "^4.0.4",
63
76
  "react-aria-components": "1.16.0",
64
77
  "react-helmet-async": "^2.0.1",
65
78
  "react-router-dom": "^7.0.0",
@@ -82,17 +95,23 @@
82
95
  "react-dom": "19.0.0"
83
96
  },
84
97
  "devDependencies": {
98
+ "@testing-library/jest-dom": "^6.6.0",
99
+ "@testing-library/react": "^16.0.0",
85
100
  "@types/node": "22.0.0",
101
+ "@types/picomatch": "^4.0.3",
86
102
  "@types/react": "19.0.0",
87
103
  "@types/react-dom": "19.0.0",
88
- "@types/react-router-dom": "5.3.3",
89
104
  "@types/semver": "7.7.1",
105
+ "jsdom": "^24.1.0",
90
106
  "tsdown": "0.21.7",
91
- "typescript": "5.9.3"
107
+ "typescript": "5.9.3",
108
+ "vitest": "^3.0.0"
92
109
  },
93
110
  "scripts": {
94
111
  "build": "tsdown --config-loader unrun",
95
112
  "dev": "tsdown --watch --config-loader unrun",
113
+ "test": "vitest run",
114
+ "test:watch": "vitest",
96
115
  "format": "pnpm exec biome format --write",
97
116
  "lint": "pnpm exec biome lint --write",
98
117
  "check": "pnpm exec biome check --write"
@@ -1,10 +1,10 @@
1
- import UserLayout from 'virtual:boltdocs-layout'
2
1
  import { useMdxComponents } from './mdx-components-context'
3
2
  import { useMemo } from 'react'
3
+ import { LastUpdated as DefaultLastUpdated } from '../components/ui-base'
4
4
 
5
5
  /**
6
- * DocPage is a layout wrapper for documentation content during SSG.
7
- * It renders the user-defined layout (or default) around the MDX content.
6
+ * DocPage renders the MDX content and page-specific metadata.
7
+ * It is rendered inside the Outlet of DocsLayout.
8
8
  */
9
9
  export function DocPage({
10
10
  route,
@@ -18,17 +18,21 @@ export function DocPage({
18
18
  // then context components (globals).
19
19
  const allComponents = useMemo(
20
20
  () => ({
21
+ LastUpdated: DefaultLastUpdated,
21
22
  ...contextComponents,
22
23
  ...propComponents,
23
24
  }),
24
25
  [contextComponents, propComponents],
25
26
  )
26
27
 
28
+ const LastUpdated = allComponents.LastUpdated || DefaultLastUpdated
29
+
27
30
  if (!Content) return null
28
31
 
29
32
  return (
30
- <UserLayout route={route}>
33
+ <>
31
34
  <Content components={allComponents} />
32
- </UserLayout>
35
+ {route?.lastUpdated && <LastUpdated date={route.lastUpdated} />}
36
+ </>
33
37
  )
34
38
  }