boltdocs 2.5.6 → 2.6.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 (112) hide show
  1. package/bin/boltdocs.js +2 -2
  2. package/dist/client/index.cjs +6 -0
  3. package/dist/client/{index.d.mts → index.d.cts} +134 -252
  4. package/dist/client/index.d.ts +135 -253
  5. package/dist/client/index.js +1 -1
  6. package/dist/client/theme/neutral.css +90 -50
  7. package/dist/node/cli-entry.cjs +2 -2
  8. package/dist/node/cli-entry.mjs +2 -2
  9. package/dist/node/index.cjs +1 -1
  10. package/dist/node/index.d.cts +150 -205
  11. package/dist/node/index.d.mts +150 -205
  12. package/dist/node/index.mjs +1 -1
  13. package/dist/node-BgvNl2Ay.mjs +89 -0
  14. package/dist/node-vkbb0MK7.cjs +89 -0
  15. package/dist/{package-OFZf0s2j.mjs → package-CR0HF9x3.mjs} +1 -1
  16. package/dist/{package-BY8Jd2j4.cjs → package-Dgmsc_l5.cjs} +1 -1
  17. package/dist/search-dialog-3lvKsbVG.js +6 -0
  18. package/dist/search-dialog-DMK5OpgH.cjs +6 -0
  19. package/dist/use-search-C9bxCqfF.js +6 -0
  20. package/dist/use-search-DcfZSunO.cjs +6 -0
  21. package/package.json +19 -22
  22. package/src/client/app/config-context.tsx +38 -5
  23. package/src/client/app/doc-page.tsx +34 -0
  24. package/src/client/app/mdx-component.tsx +2 -3
  25. package/src/client/app/mdx-components-context.tsx +27 -2
  26. package/src/client/app/routes-context.tsx +34 -0
  27. package/src/client/app/scroll-handler.tsx +7 -4
  28. package/src/client/app/theme-context.tsx +71 -67
  29. package/src/client/components/default-layout.tsx +13 -14
  30. package/src/client/components/docs-layout.tsx +1 -2
  31. package/src/client/components/icons-dev.tsx +36 -5
  32. package/src/client/components/mdx/admonition.tsx +11 -27
  33. package/src/client/components/mdx/badge.tsx +1 -1
  34. package/src/client/components/mdx/button.tsx +3 -3
  35. package/src/client/components/mdx/card.tsx +1 -1
  36. package/src/client/components/mdx/code-block.tsx +90 -80
  37. package/src/client/components/mdx/component-preview.tsx +1 -5
  38. package/src/client/components/mdx/component-props.tsx +1 -1
  39. package/src/client/components/mdx/field.tsx +4 -5
  40. package/src/client/components/mdx/file-tree.tsx +6 -3
  41. package/src/client/components/mdx/hooks/use-code-block.ts +2 -2
  42. package/src/client/components/mdx/image.tsx +1 -1
  43. package/src/client/components/mdx/link.tsx +2 -2
  44. package/src/client/components/mdx/list.tsx +1 -1
  45. package/src/client/components/mdx/table.tsx +1 -1
  46. package/src/client/components/mdx/tabs.tsx +1 -1
  47. package/src/client/components/primitives/breadcrumbs.tsx +1 -7
  48. package/src/client/components/primitives/button-group.tsx +1 -1
  49. package/src/client/components/primitives/button.tsx +1 -1
  50. package/src/client/components/primitives/code-block.tsx +113 -0
  51. package/src/client/components/primitives/link.tsx +23 -41
  52. package/src/client/components/primitives/menu.tsx +5 -6
  53. package/src/client/components/primitives/navbar.tsx +6 -18
  54. package/src/client/components/primitives/navigation-menu.tsx +4 -4
  55. package/src/client/components/primitives/on-this-page.tsx +6 -10
  56. package/src/client/components/primitives/page-nav.tsx +4 -9
  57. package/src/client/components/primitives/popover.tsx +1 -1
  58. package/src/client/components/primitives/search-dialog.tsx +3 -6
  59. package/src/client/components/primitives/sidebar.tsx +80 -22
  60. package/src/client/components/primitives/skeleton.tsx +1 -1
  61. package/src/client/components/primitives/tabs.tsx +4 -11
  62. package/src/client/components/primitives/tooltip.tsx +3 -3
  63. package/src/client/components/ui-base/breadcrumbs.tsx +4 -6
  64. package/src/client/components/ui-base/copy-markdown.tsx +2 -7
  65. package/src/client/components/ui-base/github-stars.tsx +2 -2
  66. package/src/client/components/ui-base/head.tsx +58 -51
  67. package/src/client/components/ui-base/loading.tsx +2 -2
  68. package/src/client/components/ui-base/navbar.tsx +12 -14
  69. package/src/client/components/ui-base/not-found.tsx +1 -1
  70. package/src/client/components/ui-base/on-this-page.tsx +6 -6
  71. package/src/client/components/ui-base/page-nav.tsx +4 -8
  72. package/src/client/components/ui-base/search-dialog.tsx +10 -8
  73. package/src/client/components/ui-base/sidebar.tsx +76 -23
  74. package/src/client/components/ui-base/tabs.tsx +9 -8
  75. package/src/client/components/ui-base/theme-toggle.tsx +2 -2
  76. package/src/client/hooks/use-i18n.ts +3 -3
  77. package/src/client/hooks/use-localized-to.ts +1 -1
  78. package/src/client/hooks/use-navbar.ts +8 -6
  79. package/src/client/hooks/use-routes.ts +19 -11
  80. package/src/client/hooks/use-search.ts +1 -1
  81. package/src/client/hooks/use-sidebar.ts +48 -2
  82. package/src/client/hooks/use-tabs.ts +6 -2
  83. package/src/client/hooks/use-version.ts +3 -3
  84. package/src/client/index.ts +22 -22
  85. package/src/client/ssg/boltdocs-shell.tsx +127 -0
  86. package/src/client/ssg/create-routes.tsx +179 -0
  87. package/src/client/ssg/index.ts +3 -0
  88. package/src/client/ssg/mdx-page.tsx +37 -0
  89. package/src/client/store/boltdocs-context.tsx +46 -99
  90. package/src/client/theme/neutral.css +90 -50
  91. package/src/client/types.ts +5 -33
  92. package/src/client/utils/react-to-text.ts +34 -0
  93. package/dist/cache-Cr8W2zgZ.cjs +0 -6
  94. package/dist/cache-DFdakSmR.mjs +0 -6
  95. package/dist/client/index.mjs +0 -6
  96. package/dist/client/ssr.cjs +0 -6
  97. package/dist/client/ssr.d.cts +0 -80
  98. package/dist/client/ssr.d.mts +0 -80
  99. package/dist/client/ssr.mjs +0 -6
  100. package/dist/node-CWXme96p.mjs +0 -73
  101. package/dist/node-VYfhzGrh.cjs +0 -73
  102. package/dist/search-dialog-BeNyI_KQ.mjs +0 -6
  103. package/dist/search-dialog-dYsCAk5S.js +0 -6
  104. package/dist/use-search-D25n0PrV.mjs +0 -6
  105. package/dist/use-search-WuzdH1cJ.js +0 -6
  106. package/src/client/app/index.tsx +0 -348
  107. package/src/client/app/mdx-page.tsx +0 -15
  108. package/src/client/app/preload.tsx +0 -66
  109. package/src/client/app/router.tsx +0 -30
  110. package/src/client/integrations/codesandbox.ts +0 -179
  111. package/src/client/integrations/index.ts +0 -1
  112. package/src/client/ssr.tsx +0 -65
@@ -1,110 +1,37 @@
1
1
 
2
- import * as _$vite from "vite";
3
- import { Plugin } from "vite";
4
- import * as _$react from "react";
5
- import React$1, { Component, ComponentPropsWithoutRef, ErrorInfo, ImgHTMLAttributes, ReactNode, RefObject } from "react";
6
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
7
2
  import * as _$react_router_dom0 from "react-router-dom";
8
3
  import { LinkProps as LinkProps$1 } from "react-router-dom";
9
- import * as _$class_variance_authority_types0 from "class-variance-authority/types";
4
+ import * as _$react from "react";
5
+ import { Component, ComponentPropsWithoutRef, ErrorInfo, ImgHTMLAttributes, ReactNode, RefObject } from "react";
6
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
10
7
  import * as RAC from "react-aria-components";
11
8
  import { LinkProps as LinkProps$2 } from "react-aria-components";
12
- import { VariantProps } from "class-variance-authority";
13
9
  import { ClassValue } from "clsx";
10
+ import { VariantProps } from "class-variance-authority";
11
+ import { Plugin } from "vite";
12
+ import { RouteRecord } from "@bdocs/ssg";
13
+ import * as _$class_variance_authority_types0 from "class-variance-authority/types";
14
14
 
15
- //#region src/node/plugins/plugin-types.d.ts
16
- /**
17
- * Permissions that a plugin can request to access specific Boltdocs capabilities.
18
- */
19
- type PluginPermission = 'fs:read' | 'fs:write' | 'vite:config' | 'mdx:remark' | 'mdx:rehype' | 'components' | 'hooks:build' | 'hooks:dev';
20
- /**
21
- * Shared context injected into every plugin lifecycle hook.
22
- */
23
- interface PluginContext {
24
- /** The full, resolved Boltdocs configuration (Readonly) */
25
- readonly config: BoltdocsConfig;
26
- /** A plugin-specific logger */
27
- readonly logger: PluginLogger;
28
- /** A shared store for dependency injection and state sharing between plugins */
29
- readonly store: PluginStore;
30
- /** Metadata about the current plugin */
31
- readonly meta: PluginMeta;
32
- }
33
- /**
34
- * Simple logger interface for plugins.
35
- */
36
- interface PluginLogger {
37
- info(message: string): void;
38
- warn(message: string): void;
39
- error(message: string | Error): void;
40
- debug(message: string): void;
41
- }
42
- /**
43
- * A shared key-value store that allows plugins to share state and configuration.
44
- */
45
- interface PluginStore {
46
- /** Get a value from the store. Keys are namespaced by plugin internally. */
47
- get<T = unknown>(pluginName: string, key: string): T | undefined;
48
- /** Set a value in the store. */
49
- set(pluginName: string, key: string, value: unknown): void;
50
- /** Check if a key exists in the store. */
51
- has(pluginName: string, key: string): boolean;
52
- }
53
- /**
54
- * Metadata for a plugin, used for identification and compatibility checks.
55
- */
56
- interface PluginMeta {
57
- /** Unique identifier for the plugin */
58
- name: string;
59
- /** Version of the plugin itself (semver) */
60
- version?: string;
61
- /** Minimum required version of Boltdocs (semver range) */
62
- boltdocsVersion?: string;
63
- }
64
- /**
65
- * Lifecycle hooks that a plugin can implement to hook into the build and dev processes.
66
- */
67
- interface PluginLifecycleHooks {
68
- /** Called before the build process starts */
69
- beforeBuild?: (ctx: PluginContext) => Promise<void> | void;
70
- /** Called after the build process finishes successfully */
71
- afterBuild?: (ctx: PluginContext) => Promise<void> | void;
72
- /** Called before the dev server starts */
73
- beforeDev?: (ctx: PluginContext) => Promise<void> | void;
74
- /** Called after the dev server is ready (configureServer) */
75
- afterDev?: (ctx: PluginContext) => Promise<void> | void;
76
- /** Called when the final Boltdocs config is resolved */
77
- configResolved?: (ctx: PluginContext, config: BoltdocsConfig) => void;
78
- /** Called when the build is closing */
79
- buildEnd?: (ctx: PluginContext) => Promise<void> | void;
80
- }
81
- //#endregion
82
- //#region src/node/config.d.ts
15
+ //#region src/shared/types.d.ts
83
16
  /**
84
17
  * Represents a single social link in the configuration.
85
18
  */
86
19
  interface BoltdocsSocialLink {
87
- /** Identifier for the icon (e.g., 'github') */
88
20
  icon: 'discord' | 'x' | 'github' | 'bluesky' | string;
89
- /** The URL the social link points to */
90
21
  link: string;
91
22
  }
92
23
  /**
93
24
  * Configuration for the site footer.
94
25
  */
95
26
  interface BoltdocsFooterConfig {
96
- /** Text to display in the footer (HTML is supported) */
97
27
  text?: string;
98
28
  }
99
29
  /**
100
- * Theme-specific configuration options governing the appearance and navigation of the site.
30
+ * Theme-specific configuration options.
101
31
  */
102
32
  interface BoltdocsThemeConfig {
103
- /** The global title of the documentation site (can be translated) */
104
33
  title?: string | Record<string, string>;
105
- /** The global description of the site (can be translated) */
106
34
  description?: string | Record<string, string>;
107
- /** URL path to the site logo or an object for light/dark versions */
108
35
  logo?: string | {
109
36
  dark: string;
110
37
  light: string;
@@ -112,190 +39,149 @@ interface BoltdocsThemeConfig {
112
39
  width?: number;
113
40
  height?: number;
114
41
  };
115
- /** Items to display in the top navigation bar */
116
42
  navbar?: Array<{
117
- /** Text to display (can be a string or a map of translations) */label: string | Record<string, string>; /** URL path or external link */
43
+ label: string | Record<string, string>;
118
44
  href: string;
119
45
  }>;
120
- /** Items to display in the sidebar, organized optionally by group URLs */
121
46
  sidebar?: Record<string, Array<{
122
47
  text: string;
123
48
  link: string;
124
49
  }>>;
125
- /** Social links to display in the navigation bar */
50
+ sidebarGroups?: Record<string, {
51
+ title?: string;
52
+ icon?: string;
53
+ }>;
126
54
  socialLinks?: BoltdocsSocialLink[];
127
- /** Site footer configuration */
128
55
  footer?: BoltdocsFooterConfig;
129
- /** Whether to show breadcrumbs navigation (default: true) */
130
56
  breadcrumbs?: boolean;
131
- /** URL template for 'Edit this page'. Use :path as a placeholder. */
132
57
  editLink?: string;
133
- /** URL for the 'Community help' link. */
134
58
  communityHelp?: string;
135
- /** The current version of the project (e.g., 'v2.8.9'). Displayed in the Navbar. */
136
59
  version?: string;
137
- /** The GitHub repository in the format 'owner/repo' to fetch and display star count. */
138
60
  githubRepo?: string;
139
- /**
140
- * URL path to the site favicon.
141
- * If not specified, the logo will be used if available.
142
- */
143
61
  favicon?: string;
144
- /**
145
- * The Open Graph image URL to display when the site is shared on social media.
146
- */
147
- ogImage?: string;
148
- /** Whether to show the 'Powered by LiteDocs' badge in the sidebar (default: true) */
149
62
  poweredBy?: boolean;
150
- /**
151
- * Top-level tabs for organizing documentation groups.
152
- * Tab discovery uses the (tab-id) directory syntax.
153
- */
154
63
  tabs?: Array<{
155
- id: string; /** Text to display (can be a string or a map of translations) */
64
+ id: string;
156
65
  text: string | Record<string, string>;
157
66
  icon?: string;
158
67
  }>;
159
- /**
160
- * The syntax highlighting theme for code blocks.
161
- * Supports any Shiki theme name (e.g., 'github-dark', 'one-dark-pro', 'aurora-x').
162
- * Can also be an object for multiple themes (e.g., { light: 'github-light', dark: 'github-dark' }).
163
- * Default: { light: 'github-light', dark: 'one-dark-pro' }
164
- */
165
- codeTheme?: string | {
166
- light: string;
167
- dark: string;
68
+ codeTheme?: ShikiTheme | {
69
+ light: ShikiTheme;
70
+ dark: ShikiTheme;
168
71
  };
169
- /**
170
- * Configuration for the 'Copy Markdown' button.
171
- * Can be a boolean or an object with text and icon.
172
- * Default: true
173
- */
174
72
  copyMarkdown?: boolean | {
175
73
  text?: string;
176
74
  icon?: string;
177
75
  };
178
76
  }
77
+ /**
78
+ * List of supported syntax highlighting themes.
79
+ */
80
+ type ShikiTheme = 'github-dark' | 'github-light' | 'tokyo-night' | 'dracula' | 'nord' | 'one-dark-pro' | 'one-light';
179
81
  /**
180
82
  * Configuration for the robots.txt file.
181
83
  */
182
84
  type BoltdocsRobotsConfig = string | {
183
- /** User-agent rules */rules?: Array<{
184
- userAgent: string; /** Paths allowed to be crawled */
185
- allow?: string | string[]; /** Paths disallowed to be crawled */
85
+ rules?: Array<{
86
+ userAgent: string;
87
+ allow?: string | string[];
186
88
  disallow?: string | string[];
187
- }>; /** Sitemaps to include in the robots.txt */
89
+ }>;
188
90
  sitemaps?: string[];
189
91
  };
190
92
  /**
191
93
  * Configuration for a specific locale.
192
94
  */
193
95
  interface BoltdocsLocaleConfig {
194
- /** The display name of the locale */
195
96
  label?: string;
196
- /** The text direction (ltr or rtl) */
197
97
  direction?: 'ltr' | 'rtl';
198
- /** The HTML lang attribute value (e.g., 'en-US') */
199
98
  htmlLang?: string;
200
- /** The calendar system to use (e.g., 'gregory') */
201
99
  calendar?: string;
202
100
  }
203
101
  /**
204
102
  * Configuration for internationalization (i18n).
205
103
  */
206
104
  interface BoltdocsI18nConfig {
207
- /** The default locale (e.g., 'en') */
208
105
  defaultLocale: string;
209
- /** Available locales and their basic display names (e.g., { en: 'English', es: 'Español' }) */
210
106
  locales: Record<string, string>;
211
- /** Detailed configuration for each locale */
212
107
  localeConfigs?: Record<string, BoltdocsLocaleConfig>;
213
108
  }
214
109
  /**
215
110
  * Configuration for a specific documentation version.
216
111
  */
217
112
  interface BoltdocsVersionConfig {
218
- /** The display name of the version (e.g., 'v2.0') */
219
113
  label: string;
220
- /** The URL path prefix for the version (e.g., '2.0') */
221
114
  path: string;
222
115
  }
223
116
  /**
224
117
  * Configuration for documentation versioning.
225
118
  */
226
119
  interface BoltdocsVersionsConfig {
227
- /** The default version path (e.g., 'v2') */
228
120
  defaultVersion: string;
229
- /**
230
- * Optional prefix for all version paths (e.g., 'v').
231
- * If set to 'v', version '1.1' will be available at '/docs/v1.1'.
232
- */
233
121
  prefix?: string;
234
- /** Available versions configurations */
235
122
  versions: BoltdocsVersionConfig[];
236
123
  }
237
124
  /**
238
- * Defines a Boltdocs plugin that can extend the build process and client-side functionality.
125
+ * Defines a Boltdocs plugin.
239
126
  */
240
127
  interface BoltdocsPlugin {
241
- /** A unique name for the plugin */
242
128
  name: string;
243
- /** Whether to run this plugin before or after default ones (optional) */
244
129
  enforce?: 'pre' | 'post';
245
- /** Version of the plugin (optional) */
246
130
  version?: string;
247
- /** Minimum compatible Boltdocs version (optional, semver range) */
248
131
  boltdocsVersion?: string;
249
- /** List of permissions this plugin requires to operate */
250
- permissions?: PluginPermission[];
251
- /** Optional remark plugins to add to the MDX pipeline */
132
+ permissions?: string[];
252
133
  remarkPlugins?: unknown[];
253
- /** Optional rehype plugins to add to the MDX pipeline */
254
134
  rehypePlugins?: unknown[];
255
- /** Optional Vite plugins to inject into the build process */
256
135
  vitePlugins?: Plugin[];
257
- /** Optional custom React components to register in MDX. Map of Name -> Module Path. */
258
136
  components?: Record<string, string>;
259
- /** Implementation of lifecycle hooks */
260
- hooks?: PluginLifecycleHooks;
137
+ hooks?: Record<string, any>;
261
138
  }
262
139
  /**
263
140
  * Configuration for security-related settings.
264
141
  */
265
142
  interface BoltdocsSecurityConfig {
266
- /** Map of standard security headers to override or supplement defaults */
267
143
  headers?: Record<string, string>;
268
- /** Whether to enable Content Security Policy (CSP) generation (default: false) */
269
144
  enableCSP?: boolean;
270
- /** Additional custom headers to inject into responses */
271
145
  customHeaders?: Record<string, string>;
272
146
  }
147
+ /**
148
+ * Configuration for SEO.
149
+ */
150
+ interface BoltdocsSeoConfig {
151
+ metatags?: Record<string, string>;
152
+ indexing?: 'all' | 'public';
153
+ thumbnails?: {
154
+ background?: string;
155
+ };
156
+ }
273
157
  /**
274
158
  * The root configuration object for Boltdocs.
275
159
  */
276
- interface BoltdocsConfig {
277
- /** The base URL of the site, used for generating the sitemap */
160
+ interface BoltdocsConfig$1 {
278
161
  siteUrl?: string;
279
- /** The root directory containing markdown documentation files (default: 'docs') */
280
162
  docsDir?: string;
281
- /** Path to a custom HomePage component */
163
+ base?: string;
282
164
  homePage?: string;
283
- /** Configuration pertaining to the UI and appearance */
284
165
  theme?: BoltdocsThemeConfig;
285
- /** Configuration for internationalization */
286
166
  i18n?: BoltdocsI18nConfig;
287
- /** Configuration for documentation versioning */
288
167
  versions?: BoltdocsVersionsConfig;
289
- /** Custom plugins for extending functionality */
290
168
  plugins?: BoltdocsPlugin[];
291
- /** Configuration for the robots.txt file */
292
169
  robots?: BoltdocsRobotsConfig;
293
- /** Security-related settings and headers */
294
170
  security?: BoltdocsSecurityConfig;
295
- /** Low-level Vite configuration overrides */
296
- vite?: _$vite.InlineConfig;
171
+ seo?: BoltdocsSeoConfig;
172
+ vite?: any;
297
173
  }
298
174
  //#endregion
175
+ //#region src/shared/config-utils.d.ts
176
+ /**
177
+ * Type-safe helper for defining Boltdocs configuration.
178
+ * This is an identity function that provides IntelliSense in both
179
+ * Node.js (config files) and client-side code (MDX examples).
180
+ *
181
+ * @param config - The Boltdocs configuration object
182
+ */
183
+ declare function defineConfig(config: BoltdocsConfig$1): BoltdocsConfig$1;
184
+ //#endregion
299
185
  //#region src/client/types.d.ts
300
186
  /**
301
187
  * Metadata provided by the server for a specific route.
@@ -341,49 +227,15 @@ interface ComponentRoute {
341
227
  };
342
228
  /** Optional icon for the route's group */
343
229
  groupIcon?: string;
230
+ /** The sub-route group this route belongs to (from folders starting with _) */
231
+ subRouteGroup?: string;
232
+ /** The nested sub-routes if this route acts as the parent of a subRouteGroup */
233
+ subRoutes?: ComponentRoute[];
344
234
  /** The extracted plain-text content of the page for search indexing */
345
235
  _content?: string;
346
236
  /** The raw markdown content of the page */
347
237
  _rawContent?: string;
348
238
  }
349
- /**
350
- * Site configuration provided by the server.
351
- */
352
- type SiteConfig = BoltdocsConfig;
353
- /**
354
- * Configuration options for initializing the Boltdocs client app.
355
- */
356
- interface CreateBoltdocsAppOptions {
357
- /** CSS selector for the DOM element where the app should mount (e.g. '#root') */
358
- target: string;
359
- /** Initial routes generated by the Vite plugin (`virtual:boltdocs-routes`) */
360
- routes: ComponentRoute[];
361
- /** The name of the documentation directory (e.g. 'docs') */
362
- docsDirName: string;
363
- /** Site configuration (`virtual:boltdocs-config`) */
364
- config: SiteConfig;
365
- /** Dynamic import mapping from `import.meta.glob` for the documentation pages */
366
- modules: Record<string, () => Promise<{
367
- default: React$1.ComponentType<any>;
368
- }>>;
369
- /** The `import.meta.hot` instance necessary for fast refresh/HMR updates */
370
- hot?: {
371
- accept: (cb?: (mod: any) => void) => void;
372
- dispose: (cb: (data: any) => void) => void;
373
- on: (event: string, cb: (data: any) => void) => void;
374
- data: any;
375
- };
376
- /** Optional custom React component to render when visiting the root path ('/') */
377
- homePage?: React$1.ComponentType;
378
- /** Custom external pages mapped by their route path */
379
- externalPages?: Record<string, React$1.ComponentType>;
380
- /** Optional custom layout for external pages */
381
- externalLayout?: React$1.ComponentType<{
382
- children: React$1.ReactNode;
383
- }>;
384
- /** Optional custom MDX components provided by plugins */
385
- components?: Record<string, React$1.ComponentType>;
386
- }
387
239
  /**
388
240
  * Tab configuration for the documentation site.
389
241
  */
@@ -410,7 +262,7 @@ interface OnThisPageProps {
410
262
  * Props for user-defined layout components (layout.tsx).
411
263
  */
412
264
  interface LayoutProps {
413
- children: React$1.ReactNode;
265
+ children: React.ReactNode;
414
266
  }
415
267
  /**
416
268
  * Unified type for navbar links.
@@ -424,41 +276,58 @@ interface NavbarLink {
424
276
  to?: string;
425
277
  }
426
278
  //#endregion
427
- //#region src/client/app/index.d.ts
279
+ //#region src/client/ssg/create-routes.d.ts
280
+ interface CreateRoutesOptions {
281
+ routesData: ComponentRoute[];
282
+ config: BoltdocsConfig$1;
283
+ mdxModules: Record<string, {
284
+ default?: React.ComponentType;
285
+ }>;
286
+ Layout: React.ComponentType<{
287
+ children: React.ReactNode;
288
+ }>;
289
+ homePage?: React.ComponentType;
290
+ externalPages?: Record<string, React.ComponentType>;
291
+ externalLayout?: React.ComponentType<{
292
+ children: React.ReactNode;
293
+ }>;
294
+ components?: Record<string, React.ComponentType>;
295
+ }
296
+ declare function createRoutes(options: CreateRoutesOptions): RouteRecord[];
297
+ //#endregion
298
+ //#region src/client/ssg/mdx-page.d.ts
428
299
  /**
429
- * Creates and mounts the Boltdocs documentation app.
430
- *
431
- * Usage:
432
- * ```tsx
433
- * import { createBoltdocsApp } from 'boltdocs/client'
434
- * import routes from 'virtual:boltdocs-routes'
435
- * import config from 'virtual:boltdocs-config'
436
- * import 'boltdocs/style.css'
437
- * import HomePage from './HomePage'
438
- *
439
- * createBoltdocsApp({
440
- * target: '#root',
441
- * routes,
442
- * config,
443
- * modules: import.meta.glob('/docs/**\/*.{md,mdx}'),
444
- * hot: import.meta.hot,
445
- * homePage: HomePage,
446
- * })
447
- * ```
300
+ * Renders an MDX page by consuming pre-loaded module data.
301
+ * Uses DocPage to ensure consistent layout and metadata application.
448
302
  */
449
- declare function createBoltdocsApp(options: CreateBoltdocsAppOptions): void;
303
+ declare function MdxPage({
304
+ MDXComponent: propMDX,
305
+ mdxComponents: propComponents
306
+ }: any): _$react_jsx_runtime0.JSX.Element | null;
307
+ //#endregion
308
+ //#region src/client/ssg/boltdocs-shell.d.ts
309
+ declare function BoltdocsShell({
310
+ config,
311
+ routes,
312
+ components
313
+ }: {
314
+ config: BoltdocsConfig$1;
315
+ routes: ComponentRoute[];
316
+ components?: Record<string, React.ComponentType>;
317
+ }): _$react_jsx_runtime0.JSX.Element;
450
318
  //#endregion
451
319
  //#region src/client/app/config-context.d.ts
452
320
  /**
453
321
  * Hook to access the Boltdocs configuration.
454
322
  */
455
- declare function useConfig(): BoltdocsConfig;
323
+ declare function useConfig(): BoltdocsConfig$1;
456
324
  //#endregion
457
325
  //#region src/client/app/theme-context.d.ts
458
326
  type Theme = 'light' | 'dark' | 'system';
327
+ type ResolvedTheme = 'light' | 'dark';
459
328
  interface ThemeContextType {
460
329
  theme: Theme;
461
- resolvedTheme: 'light' | 'dark';
330
+ resolvedTheme: ResolvedTheme;
462
331
  setTheme: (theme: Theme) => void;
463
332
  }
464
333
  declare function useTheme(): ThemeContextType;
@@ -487,12 +356,11 @@ declare function useRoutes(): {
487
356
  label: string;
488
357
  isCurrent: boolean;
489
358
  }[];
490
- config: BoltdocsConfig;
359
+ config: BoltdocsConfig$1;
491
360
  };
492
361
  //#endregion
493
362
  //#region src/client/app/mdx-components-context.d.ts
494
- type MdxComponentsType = Record<string, React.ComponentType<any>>;
495
- declare function useMdxComponents(): MdxComponentsType;
363
+ declare function useMdxComponents(): any;
496
364
  //#endregion
497
365
  //#region src/client/hooks/use-navbar.d.ts
498
366
  declare function useNavbar(): {
@@ -506,22 +374,22 @@ declare function useNavbar(): {
506
374
  };
507
375
  github: string | null;
508
376
  social: BoltdocsSocialLink[];
509
- config: BoltdocsConfig;
510
- theme: "dark" | "light" | "system";
377
+ config: BoltdocsConfig$1;
378
+ theme: Theme;
511
379
  };
512
380
  //#endregion
513
381
  //#region src/client/hooks/use-sidebar.d.ts
514
382
  declare function useSidebar(routes: ComponentRoute[]): {
515
383
  groups: {
384
+ routes: ComponentRoute[];
516
385
  slug: string;
517
386
  title: string;
518
- routes: ComponentRoute[];
519
387
  icon?: string;
520
388
  }[];
521
389
  ungrouped: ComponentRoute[];
522
390
  activeRoute: ComponentRoute | undefined;
523
391
  activePath: string;
524
- config: BoltdocsConfig;
392
+ config: BoltdocsConfig$1;
525
393
  };
526
394
  //#endregion
527
395
  //#region src/client/hooks/use-search.d.ts
@@ -639,9 +507,9 @@ declare const useLocation: () => _$react_router_dom0.Location<any>;
639
507
  * Props shared by all layout slot components.
640
508
  */
641
509
  interface SlotProps {
642
- children?: React$1.ReactNode;
510
+ children?: React.ReactNode;
643
511
  className?: string;
644
- style?: React$1.CSSProperties;
512
+ style?: React.CSSProperties;
645
513
  }
646
514
  /**
647
515
  * Horizontal flex container for sidebar + content + toc.
@@ -683,7 +551,7 @@ declare function ContentFooter({
683
551
  className,
684
552
  style
685
553
  }: SlotProps): _$react_jsx_runtime0.JSX.Element;
686
- interface DocsLayoutComponent extends React$1.FC<SlotProps> {
554
+ interface DocsLayoutComponent extends React.FC<SlotProps> {
687
555
  Body: typeof Body;
688
556
  Content: typeof Content;
689
557
  ContentMdx: typeof ContentMdx;
@@ -714,7 +582,7 @@ declare function Sidebar$1({
714
582
  config
715
583
  }: {
716
584
  routes: ComponentRoute[];
717
- config: BoltdocsConfig;
585
+ config: BoltdocsConfig$1;
718
586
  }): _$react_jsx_runtime0.JSX.Element;
719
587
  //#endregion
720
588
  //#region src/client/components/ui-base/on-this-page.d.ts
@@ -733,13 +601,14 @@ interface HeadProps {
733
601
  path: string;
734
602
  title: string;
735
603
  description?: string;
604
+ seo?: Record<string, any>;
736
605
  }>;
737
606
  }
738
607
  declare function Head({
739
608
  siteTitle,
740
609
  siteDescription,
741
610
  routes
742
- }: HeadProps): null;
611
+ }: HeadProps): _$react_jsx_runtime0.JSX.Element;
743
612
  //#endregion
744
613
  //#region src/client/components/ui-base/breadcrumbs.d.ts
745
614
  declare function Breadcrumbs(): _$react_jsx_runtime0.JSX.Element | null;
@@ -802,6 +671,7 @@ interface CodeBlockProps {
802
671
  lang?: string;
803
672
  highlightedHtml?: string;
804
673
  'data-lang'?: string;
674
+ 'data-title'?: string;
805
675
  plain?: boolean;
806
676
  [key: string]: any;
807
677
  }
@@ -905,7 +775,7 @@ declare function Badge({
905
775
  //#endregion
906
776
  //#region src/client/components/mdx/card.d.ts
907
777
  declare const cardsVariants: (props?: ({
908
- cols?: 2 | 1 | 3 | 4 | null | undefined;
778
+ cols?: 1 | 2 | 3 | 4 | null | undefined;
909
779
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
910
780
  type CardsVariants = VariantProps<typeof cardsVariants>;
911
781
  interface CardsProps extends React.HTMLAttributes<HTMLDivElement>, CardsVariants {}
@@ -957,7 +827,7 @@ declare const Caution: (props: Omit<AdmonitionProps, "type">) => _$react_jsx_run
957
827
  //#region src/client/components/mdx/list.d.ts
958
828
  declare const listVariants: (props?: ({
959
829
  variant?: "number" | "default" | "checked" | "arrow" | "bubble" | null | undefined;
960
- cols?: 2 | 1 | 3 | 4 | null | undefined;
830
+ cols?: 1 | 2 | 3 | 4 | null | undefined;
961
831
  isGrid?: boolean | null | undefined;
962
832
  dense?: boolean | null | undefined;
963
833
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
@@ -1035,7 +905,7 @@ interface LinkProps$3 extends LinkProps$2 {
1035
905
  * It uses the global navigation configuration from BoltdocsRouterProvider
1036
906
  * to handle seamless client-side transitions.
1037
907
  */
1038
- declare const Link$1: React$1.ForwardRefExoticComponent<LinkProps$3 & React$1.RefAttributes<HTMLAnchorElement>>;
908
+ declare const Link$1: _$react.ForwardRefExoticComponent<LinkProps$3 & _$react.RefAttributes<HTMLAnchorElement>>;
1039
909
  /**
1040
910
  * Props for the NavLink component, extending standard Link props.
1041
911
  */
@@ -1048,9 +918,9 @@ interface NavLinkProps extends Omit<LinkProps$3, 'className' | 'children'> {
1048
918
  /**
1049
919
  * Provides access to the active state for conditional children rendering.
1050
920
  */
1051
- children?: React$1.ReactNode | ((props: {
921
+ children?: React.ReactNode | ((props: {
1052
922
  isActive: boolean;
1053
- }) => React$1.ReactNode);
923
+ }) => React.ReactNode);
1054
924
  /**
1055
925
  * Provides access to the active state for conditional styling.
1056
926
  */
@@ -1064,7 +934,7 @@ interface NavLinkProps extends Omit<LinkProps$3, 'className' | 'children'> {
1064
934
  * It combines the Link primitive with path matching logic to determine
1065
935
  * if the link is currently active based on the browser's location.
1066
936
  */
1067
- declare const NavLink: React$1.ForwardRefExoticComponent<NavLinkProps & React$1.RefAttributes<HTMLAnchorElement>>;
937
+ declare const NavLink: _$react.ForwardRefExoticComponent<NavLinkProps & _$react.RefAttributes<HTMLAnchorElement>>;
1068
938
  //#endregion
1069
939
  //#region src/client/components/mdx/link.d.ts
1070
940
  type LinkProps = LinkProps$3 & {
@@ -1355,7 +1225,7 @@ interface ScrollProviderProps {
1355
1225
  children?: ReactNode;
1356
1226
  }
1357
1227
  interface OnThisPageContentProps extends ComponentBase {
1358
- ref?: React$1.Ref<HTMLDivElement>;
1228
+ ref?: React.Ref<HTMLDivElement>;
1359
1229
  scrollRef?: RefObject<HTMLElement | null>;
1360
1230
  }
1361
1231
  interface OnThisPageItemProps extends ComponentBase {
@@ -1364,10 +1234,10 @@ interface OnThisPageItemProps extends ComponentBase {
1364
1234
  interface OnThisPageLinkProps extends ComponentBase {
1365
1235
  href?: string;
1366
1236
  active?: boolean;
1367
- onClick?: (event: React$1.MouseEvent<HTMLAnchorElement>) => void;
1237
+ onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
1368
1238
  }
1369
1239
  interface OnThisPageIndicatorProps extends ComponentBase {
1370
- style?: React$1.CSSProperties;
1240
+ style?: React.CSSProperties;
1371
1241
  }
1372
1242
  declare function useItems(): TOCItemInfo[];
1373
1243
  declare function useActiveAnchor(): string | undefined;
@@ -1497,8 +1367,11 @@ declare const Tabs: {
1497
1367
  interface SidebarGroupProps extends ComponentBase {
1498
1368
  title?: string;
1499
1369
  icon?: React.ElementType;
1370
+ }
1371
+ interface SidebarSubGroupProps extends SidebarLinkProps {
1500
1372
  isOpen?: boolean;
1501
1373
  onToggle?: () => void;
1374
+ children?: React.ReactNode;
1502
1375
  }
1503
1376
  interface SidebarLinkProps extends ComponentBase {
1504
1377
  label: string;
@@ -1517,10 +1390,19 @@ declare const Sidebar: {
1517
1390
  children,
1518
1391
  title,
1519
1392
  icon: Icon,
1520
- isOpen,
1521
- onToggle,
1522
1393
  className
1523
1394
  }: SidebarGroupProps) => _$react_jsx_runtime0.JSX.Element;
1395
+ SubGroup: ({
1396
+ label,
1397
+ href,
1398
+ active,
1399
+ icon: Icon,
1400
+ badge,
1401
+ className,
1402
+ isOpen,
1403
+ onToggle,
1404
+ children
1405
+ }: SidebarSubGroupProps) => _$react_jsx_runtime0.JSX.Element;
1524
1406
  GroupItem: ({
1525
1407
  children,
1526
1408
  className
@@ -1675,4 +1557,4 @@ declare function Skeleton({
1675
1557
  //#region src/client/utils/cn.d.ts
1676
1558
  declare function cn(...inputs: ClassValue[]): string;
1677
1559
  //#endregion
1678
- export { Admonition, type AdmonitionProps, AnchorProvider, Badge, type BadgeProps, type BoltdocsConfig, type BoltdocsThemeConfig, Breadcrumbs, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Cards, type CardsProps, Caution, CodeBlock, ComponentPreview, type ComponentPreviewProps, ComponentProps, type ComponentPropsProps, type ComponentRoute, CopyMarkdown, type CreateBoltdocsAppOptions, Danger, DefaultLayout, DocsLayout, ErrorBoundary, Field, type FieldProps, FileTree, type FileTreeProps, Head, Image, type ImageProps, Important, InfoBox, type LayoutProps, Link, type LinkProps, List, type ListProps, Loading, Navbar, NotFound, Note, OnThisPage, PageNav, Breadcrumbs$1 as PrimitiveBreadcrumbs, Button$1 as PrimitiveButton, Link$1 as PrimitiveLink, Menu as PrimitiveMenu, NavLink as PrimitiveNavLink, Navbar$1 as PrimitiveNavbar, NavigationMenu as PrimitiveNavigationMenu, OnThisPage$1 as PrimitiveOnThisPage, PageNav$1 as PrimitivePageNav, Popover as PrimitivePopover, Sidebar as PrimitiveSidebar, Skeleton as PrimitiveSkeleton, Tabs as PrimitiveTabs, Tooltip as PrimitiveTooltip, ScrollProvider, SearchDialog as SearchDialogPrimitive, Sidebar$1 as Sidebar, Tab, type TabProps, Table, type TableProps, Tabs$1 as Tabs, type TabsProps, Tip, Video, Warning, cn, createBoltdocsApp, useActiveAnchor, useActiveAnchors, useBreadcrumbs, useConfig, useI18n, useItems, useLocalizedTo, useLocation, useMdxComponents, useNavbar, useOnThisPage, usePageNav, useRoutes, useSearch, useSidebar, useTabs, useTheme, useVersion };
1560
+ export { Admonition, type AdmonitionProps, AnchorProvider, Badge, type BadgeProps, type BoltdocsConfig$1 as BoltdocsConfig, BoltdocsShell, type BoltdocsThemeConfig, Breadcrumbs, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Cards, type CardsProps, Caution, CodeBlock, ComponentPreview, type ComponentPreviewProps, ComponentProps, type ComponentPropsProps, type ComponentRoute, CopyMarkdown, Danger, DefaultLayout, DocsLayout, ErrorBoundary, Field, type FieldProps, FileTree, type FileTreeProps, Head, Image, type ImageProps, Important, InfoBox, type LayoutProps, Link, type LinkProps, List, type ListProps, Loading, MdxPage, Navbar, NotFound, Note, OnThisPage, PageNav, Breadcrumbs$1 as PrimitiveBreadcrumbs, Button$1 as PrimitiveButton, Link$1 as PrimitiveLink, Menu as PrimitiveMenu, NavLink as PrimitiveNavLink, Navbar$1 as PrimitiveNavbar, NavigationMenu as PrimitiveNavigationMenu, OnThisPage$1 as PrimitiveOnThisPage, PageNav$1 as PrimitivePageNav, Popover as PrimitivePopover, Sidebar as PrimitiveSidebar, Skeleton as PrimitiveSkeleton, Tabs as PrimitiveTabs, Tooltip as PrimitiveTooltip, ScrollProvider, SearchDialog as SearchDialogPrimitive, Sidebar$1 as Sidebar, Tab, type TabProps, Table, type TableProps, Tabs$1 as Tabs, type TabsProps, Tip, Video, Warning, cn, createRoutes, defineConfig, useActiveAnchor, useActiveAnchors, useBreadcrumbs, useConfig, useI18n, useItems, useLocalizedTo, useLocation, useMdxComponents, useNavbar, useOnThisPage, usePageNav, useRoutes, useSearch, useSidebar, useTabs, useTheme, useVersion };