boltdocs 2.7.11 → 2.8.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 (85) hide show
  1. package/README.md +2 -54
  2. package/dist/banner-3N4Jd_L9.d.ts +100 -0
  3. package/dist/banner-MynZD_Ox.d.cts +100 -0
  4. package/dist/cache-BMUyNiiA.mjs +6 -0
  5. package/dist/cache-CKm45d2w.cjs +6 -0
  6. package/dist/client/index.cjs +782 -443
  7. package/dist/client/index.d.cts +86 -110
  8. package/dist/client/index.d.ts +87 -111
  9. package/dist/client/index.js +773 -439
  10. package/dist/client/mdx.cjs +8 -3
  11. package/dist/client/mdx.d.cts +39 -93
  12. package/dist/client/mdx.d.ts +38 -93
  13. package/dist/client/mdx.js +3 -3
  14. package/dist/client/primitives.cjs +7 -7
  15. package/dist/client/primitives.d.cts +411 -347
  16. package/dist/client/primitives.d.ts +411 -347
  17. package/dist/client/primitives.js +4 -4
  18. package/dist/client/theme/neutral.css +1 -1
  19. package/dist/{docs-layout-BXHV0xw_.cjs → docs-layout-CwCq42Zt.cjs} +95 -178
  20. package/dist/{docs-layout-DwFndmj5.js → docs-layout-Dn6S5g59.js} +99 -163
  21. package/dist/doctor-BArviV8X.cjs +28 -0
  22. package/dist/doctor-CgLA7_Uv.mjs +28 -0
  23. package/dist/{doctor-CrytFkqW.cjs → doctor-DyNUVe96.cjs} +1 -1
  24. package/dist/{routes-DP1vmWRj.cjs → doctor-aN_leTbh.mjs} +1 -1
  25. package/dist/{generator-ClVanhvi.mjs → generator-BHCrLU6h.mjs} +2 -2
  26. package/dist/{generator-CHqxiQhF.cjs → generator-CC2yHzhZ.cjs} +2 -2
  27. package/dist/{icons-dev-3cZMyt8r.cjs → icons-dev-DvJ-hh9x.cjs} +116 -111
  28. package/dist/{icons-dev-Df8OQ481.js → icons-dev-Oju24Wjp.js} +120 -114
  29. package/dist/{image-DtrI2cw3.cjs → image-Ch4-GxdO.cjs} +13 -13
  30. package/dist/{image-jxPb-2iV.js → image-Do8V9PCW.js} +13 -13
  31. package/dist/{mdx-UTTLFWJq.js → mdx-5oeCOFhH.js} +111 -81
  32. package/dist/{mdx-BdWkJTeB.cjs → mdx-BGM7LjW5.cjs} +109 -97
  33. package/dist/node/cli-entry.cjs +3 -1
  34. package/dist/node/cli-entry.mjs +3 -1
  35. package/dist/node/index.cjs +1 -1
  36. package/dist/node/index.d.cts +258 -152
  37. package/dist/node/index.d.mts +258 -150
  38. package/dist/node/index.mjs +1 -1
  39. package/dist/node/routes/worker.cjs +1 -1
  40. package/dist/node/routes/worker.mjs +1 -1
  41. package/dist/node-CefnjllX.cjs +159 -0
  42. package/dist/node-DruKROCt.mjs +159 -0
  43. package/dist/package-CmP_9rJ8.cjs +6 -0
  44. package/dist/{package-K0zsjGIz.mjs → package-DpbnBMR1.mjs} +1 -1
  45. package/dist/parser-B0YtJPDz.mjs +6 -0
  46. package/dist/parser-B7-6PyQz.cjs +6 -0
  47. package/dist/{parser-Aq8LoH-0.cjs → parser-BzB-zCkF.cjs} +1 -1
  48. package/dist/routes-ChS-zgzh.mjs +6 -0
  49. package/dist/routes-DJNJ-rTt.cjs +6 -0
  50. package/dist/routes-DiYC4nD2.cjs +6 -0
  51. package/dist/routes-rKlxFkqq.mjs +6 -0
  52. package/dist/{search-dialog-C7xuvyNk.cjs → search-dialog-BXVoecTx.cjs} +175 -78
  53. package/dist/{search-dialog-BwkDuI9R.cjs → search-dialog-BYhOov4S.cjs} +118 -7
  54. package/dist/{search-dialog-D-DDN7zJ.js → search-dialog-C09riYmx.js} +113 -8
  55. package/dist/{search-dialog-CIQg6k8c.cjs → search-dialog-CUeAfy-8.cjs} +1 -1
  56. package/dist/{search-dialog-BNF10tDl.js → search-dialog-D8gLkhUV.js} +158 -80
  57. package/dist/{search-dialog-BHuIiUC6.js → search-dialog-DHc_8FFX.js} +1 -1
  58. package/dist/{sidebar-CyZS9YOm.d.ts → sidebar-DNq4_ZAa.d.ts} +117 -51
  59. package/dist/{sidebar-CcBkrm06.d.cts → sidebar-Dlkgbxs6.d.cts} +117 -51
  60. package/dist/utils-BYITg7T5.mjs +7 -0
  61. package/dist/utils-Cjmx1hhk.cjs +7 -0
  62. package/dist/worker-pool-CtqklOXq.cjs +6 -0
  63. package/dist/worker-pool-k0DY6k8T.mjs +6 -0
  64. package/package.json +3 -3
  65. package/src/shared/config-utils.ts +4 -0
  66. package/src/shared/types.ts +52 -6
  67. package/dist/cache-Ba-DZQNH.cjs +0 -6
  68. package/dist/cache-BuMZ58L5.mjs +0 -6
  69. package/dist/cards-BakZPTz9.d.ts +0 -30
  70. package/dist/cards-CQn9mXZS.d.cts +0 -30
  71. package/dist/doctor-Be7Ly1oM.mjs +0 -21
  72. package/dist/doctor-jMxWZyLJ.cjs +0 -21
  73. package/dist/node-BSM4qcDK.cjs +0 -111
  74. package/dist/node-BspZN3R2.mjs +0 -111
  75. package/dist/package-DIIrjuWI.cjs +0 -6
  76. package/dist/parser-CdNbqN5y.cjs +0 -6
  77. package/dist/parser-nE792MLO.mjs +0 -6
  78. package/dist/rolldown-runtime-fkIsjY3S.mjs +0 -6
  79. package/dist/routes-2k3tbUmC.cjs +0 -6
  80. package/dist/routes-CpxZIsMM.mjs +0 -6
  81. package/dist/utils-CG65J0Sc.mjs +0 -7
  82. package/dist/utils-CKunkU96.cjs +0 -7
  83. package/dist/worker-pool-CGn7DrLb.mjs +0 -6
  84. package/dist/worker-pool-Crbqgw5R.cjs +0 -6
  85. /package/dist/{meta-loader-CWg2gnbY.mjs → meta-loader-DzwDFtdT.mjs} +0 -0
@@ -1,22 +1,40 @@
1
1
 
2
- import { C as BoltdocsConfig, D as BoltdocsSocialLink, E as BoltdocsMdxComponents, O as BoltdocsTypes, S as TabsProps, T as BoltdocsLocale, _ as LayoutProps, a as SidebarItem, b as SidebarProps, d as SidebarMobile, f as SidebarRoot, g as ComponentRoute, h as BoltdocsTab, i as SidebarHeader, k as BoltdocsVersion, m as ComponentBase, n as SidebarContent, s as SidebarItems, u as SidebarLinkProps, v as NavbarLink, w as BoltdocsIntegrationsConfig, x as SiteConfig, y as OnThisPageProps } from "../sidebar-CcBkrm06.cjs";
3
- import { n as Card, t as Cards } from "../cards-CQn9mXZS.cjs";
2
+ import { A as BoltdocsRoutePathWithFallback, C as SiteConfig, D as BoltdocsLocale, E as BoltdocsIntegrationsConfig, M as BoltdocsTypes, N as BoltdocsVersion, O as BoltdocsMdxComponents, S as SidebarProps, T as BoltdocsConfig, _ as CollectionPostLoaderData, b as NavbarLink, g as CollectionListLoaderData, h as BoltdocsTab, j as BoltdocsSocialLink, k as BoltdocsRoutePath, v as ComponentRoute, w as TabsProps, x as OnThisPageProps, y as LayoutProps } from "../sidebar-Dlkgbxs6.cjs";
3
+ import { a as ErrorBoundary, c as OnThisPage, i as CopyMarkdown, l as Sidebar, n as NotFound, o as PageNav, r as SearchDialog, s as Breadcrumbs, t as Banner, u as Navbar } from "../banner-MynZD_Ox.cjs";
4
4
  import * as _$react from "react";
5
- import React$1, { JSXElementConstructor, ReactNode } from "react";
5
+ import React$1, { ComponentType, JSXElementConstructor, ReactNode } from "react";
6
6
  import { RouteRecord, ViteReactSSG } from "@bdocs/ssg";
7
7
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
8
8
  import * as _$react_router_dom0 from "react-router-dom";
9
9
  import { LinkProps } from "react-router-dom";
10
10
  import { ClassValue } from "clsx";
11
11
 
12
+ //#region src/client/collections/collections-context.d.ts
13
+ interface CollectionPost$1 {
14
+ path: string;
15
+ title: string;
16
+ date?: string | Date;
17
+ excerpt?: string;
18
+ tags?: string[];
19
+ author?: string;
20
+ coverImage?: string;
21
+ filePath: string;
22
+ frontmatter?: Record<string, any>;
23
+ }
24
+ type CollectionsData = Record<string, CollectionPost$1[]>;
25
+ declare const CollectionsContext: _$react.Context<CollectionsData>;
26
+ //#endregion
12
27
  //#region src/client/ssg/create-routes.d.ts
13
28
  interface CreateRoutesOptions {
14
29
  routesData: ComponentRoute[];
30
+ collectionsData?: CollectionsData;
31
+ collectionLayouts?: Record<string, React$1.ComponentType<{
32
+ children: React$1.ReactNode;
33
+ }>>;
34
+ collectionLists?: Record<string, React$1.ComponentType>;
35
+ collectionPosts?: Record<string, React$1.ComponentType<any>>;
15
36
  config: BoltdocsConfig;
16
37
  mdxModules: Record<string, any>;
17
- Layout: React$1.ComponentType<{
18
- children: React$1.ReactNode;
19
- }>;
20
38
  externalPages?: Record<string, React$1.ComponentType>;
21
39
  externalLayout?: React$1.ComponentType<{
22
40
  children: React$1.ReactNode;
@@ -26,14 +44,23 @@ interface CreateRoutesOptions {
26
44
  declare function createRoutes(options: CreateRoutesOptions): RouteRecord[];
27
45
  //#endregion
28
46
  //#region src/client/ssg/mdx-page.d.ts
47
+ type MdxPageProps = {
48
+ MDXComponent: React.ComponentType<React.PropsWithChildren<unknown>>;
49
+ mdxComponents: Record<string, React.ComponentType<HTMLElement>>;
50
+ collectionPostComponent?: React.ComponentType<any>;
51
+ };
29
52
  /**
30
- * Renders an MDX page by consuming pre-loaded module data.
31
- * Uses DocPage to ensure consistent layout and metadata application.
53
+ * Renders an MDX page by consuming pre-loaded route data.
54
+ *
55
+ * - If the route belongs to a collection (`data.collection` is set), renders
56
+ * the custom post component if provided, else falls back to the standard DocPage.
57
+ * - Otherwise, renders the standard `DocPage` layout.
32
58
  */
33
59
  declare function MdxPage({
34
- MDXComponent: propMDX,
35
- mdxComponents: propComponents
36
- }: any): _$react_jsx_runtime0.JSX.Element | null;
60
+ MDXComponent,
61
+ mdxComponents: propComponents,
62
+ collectionPostComponent: CollectionPost
63
+ }: MdxPageProps): _$react_jsx_runtime0.JSX.Element | null;
37
64
  //#endregion
38
65
  //#region src/client/ssg/boltdocs-shell.d.ts
39
66
  declare function BoltdocsShell({
@@ -63,6 +90,13 @@ interface ThemeContextType {
63
90
  declare function useTheme(): ThemeContextType;
64
91
  //#endregion
65
92
  //#region src/client/app/mdx-components-context.d.ts
93
+ type MdxComponentsType = {
94
+ [key: string]: React.ComponentType<HTMLElement>;
95
+ } & {
96
+ Frontmatter?: Record<string, React.ComponentType<{
97
+ value: unknown;
98
+ }>>;
99
+ };
66
100
  declare function useMdxComponents(): BoltdocsMdxComponents;
67
101
  //#endregion
68
102
  //#region src/client/app/ui-context.d.ts
@@ -192,6 +226,7 @@ declare function useRoutes(): {
192
226
  routes: ComponentRoute[];
193
227
  allRoutes: ComponentRoute[];
194
228
  currentRoute: ComponentRoute | undefined;
229
+ isCollectionPage: boolean;
195
230
  currentLocale: BoltdocsLocale;
196
231
  currentVersion: BoltdocsVersion;
197
232
  };
@@ -247,110 +282,51 @@ declare function useAnalytics(options?: UseAnalyticsOptions): AnalyticsInstance;
247
282
  declare function useTrackPageView(): (path: string, title?: string) => void;
248
283
  declare function useTrackEvent(): (event: AnalyticsEvent) => void;
249
284
  //#endregion
250
- //#region src/client/components/docs-layout-default.d.ts
251
- declare const DocsLayout: any;
252
- //#endregion
253
- //#region src/client/components/ui-base/navbar.d.ts
254
- declare function Navbar(): _$react_jsx_runtime0.JSX.Element;
255
- //#endregion
256
- //#region src/client/components/ui-base/sidebar.d.ts
257
- interface SidebarProps$1 {
258
- routes: ComponentRoute[];
259
- config: BoltdocsConfig;
260
- }
261
- declare function SidebarMain({
262
- routes,
263
- config
264
- }: SidebarProps$1): _$react_jsx_runtime0.JSX.Element;
265
- declare const Sidebar: typeof SidebarMain & {
266
- Root: typeof SidebarRoot;
267
- Mobile: typeof SidebarMobile;
268
- Header: typeof SidebarHeader;
269
- Content: typeof SidebarContent;
270
- Group: ({
271
- title,
272
- icon: Icon,
273
- children,
274
- className
275
- }: {
276
- title?: string;
277
- icon?: React.ElementType;
278
- } & ComponentBase) => _$react_jsx_runtime0.JSX.Element;
279
- Link: ({
280
- label,
281
- href,
282
- active,
283
- icon: Icon,
284
- badge,
285
- className
286
- }: SidebarLinkProps) => _$react_jsx_runtime0.JSX.Element;
287
- SubGroup: ({
288
- label,
289
- href,
290
- active,
291
- icon: Icon,
292
- badge,
293
- isOpen,
294
- onToggle,
295
- children,
296
- className
297
- }: SidebarLinkProps & {
298
- isOpen: boolean;
299
- onToggle: () => void;
300
- children: _$react.ReactNode;
301
- }) => _$react_jsx_runtime0.JSX.Element;
302
- Item: typeof SidebarItem;
303
- Items: typeof SidebarItems;
304
- };
305
- //#endregion
306
- //#region src/client/components/ui-base/on-this-page.d.ts
307
- declare function OnThisPage({
308
- headings,
309
- editLink,
310
- communityHelp,
311
- filePath
312
- }: OnThisPageProps): _$react_jsx_runtime0.JSX.Element | null;
313
- //#endregion
314
- //#region src/client/components/ui-base/breadcrumbs.d.ts
315
- declare function Breadcrumbs(): _$react_jsx_runtime0.JSX.Element | null;
316
- //#endregion
317
- //#region src/client/components/ui-base/page-nav.d.ts
285
+ //#region src/client/hooks/use-headings.d.ts
318
286
  /**
319
- * Component to display the previous and next page navigation buttons.
320
- * Enhanced with subtle entrance animations, modern card layout, and hover highlights.
287
+ * Returns the headings of the current page, extracted from the route loader data.
288
+ * Useful for building custom Tables of Contents or jumping to sections.
289
+ *
290
+ * @returns An array of heading objects with level, text, and id.
321
291
  */
322
- declare function PageNav(): _$react_jsx_runtime0.JSX.Element | null;
292
+ declare function useHeadings(): {
293
+ level: number;
294
+ text: string;
295
+ id: string;
296
+ }[];
323
297
  //#endregion
324
- //#region src/client/components/ui-base/error-boundary.d.ts
325
- interface ErrorBoundaryProps {
326
- children?: ReactNode;
327
- fallback?: ReactNode;
328
- }
329
- declare function ErrorBoundary({
330
- children,
331
- fallback
332
- }: ErrorBoundaryProps): _$react_jsx_runtime0.JSX.Element;
298
+ //#region src/client/hooks/use-merged-components.d.ts
299
+ declare function useMergedComponents(propComponents?: Record<string, ComponentType<any>>): MdxComponentsType;
333
300
  //#endregion
334
- //#region src/client/components/ui-base/copy-markdown.d.ts
335
- interface CopyMarkdownProps {
336
- content?: string;
337
- mdxRaw?: string;
338
- route?: ComponentRoute;
301
+ //#region src/client/components/docs-layout-default.d.ts
302
+ interface DocsLayoutThemeProps {
303
+ children?: React.ReactNode;
339
304
  }
340
- declare function CopyMarkdown({
341
- content,
342
- mdxRaw
343
- }: CopyMarkdownProps): _$react_jsx_runtime0.JSX.Element | null;
344
- //#endregion
345
- //#region src/client/components/ui-base/search-dialog.d.ts
346
- declare function SearchDialog({
347
- routes
348
- }: {
349
- routes: ComponentRoute[];
350
- }): _$react_jsx_runtime0.JSX.Element;
305
+ declare function DocsLayoutComponent({
306
+ children
307
+ }: DocsLayoutThemeProps): _$react_jsx_runtime0.JSX.Element;
351
308
  //#endregion
352
- //#region src/client/components/ui-base/not-found.d.ts
353
- declare function NotFound(): _$react_jsx_runtime0.JSX.Element;
309
+ //#region src/client/collections/hooks.d.ts
310
+ /**
311
+ * Returns the posts of a collection.
312
+ * @param collection - The name of the collection.
313
+ * @returns The posts of the collection.
314
+ */
315
+ declare function usePosts(collection: string): CollectionPost$1[];
316
+ /**
317
+ * Returns a post by its slug.
318
+ * @param collection - The name of the collection.
319
+ * @param slug - The slug of the post.
320
+ * @returns The post with the given slug.
321
+ */
322
+ declare function usePost(collection: string, slug: string): CollectionPost$1 | undefined;
323
+ /**
324
+ * Returns the recent posts of a collection.
325
+ * @param collection - The name of the collection.
326
+ * @param count - The number of recent posts to return.
327
+ * @returns The recent posts of the collection.
328
+ */
329
+ declare function useRecentPosts(collection: string, count?: number): CollectionPost$1[];
354
330
  //#endregion
355
331
  //#region src/client/utils/cn.d.ts
356
332
  declare function cn(...inputs: ClassValue[]): string;
@@ -390,4 +366,4 @@ declare const copyToClipboard: (text: string) => Promise<boolean>;
390
366
  */
391
367
  declare function getStarsRepo(repo: string, token?: string, baseUrl?: string): Promise<string>;
392
368
  //#endregion
393
- export { BoltdocsConfig, type BoltdocsLocale, BoltdocsShell, BoltdocsTab, type BoltdocsTypes, type BoltdocsVersion, Breadcrumbs, Card, Cards, ComponentRoute, CopyMarkdown, DocsLayout, ErrorBoundary, LayoutProps, MdxPage, Navbar, NavbarLink, NotFound, OnThisPage, OnThisPageProps, PageNav, SearchDialog, Sidebar, SidebarProps, SiteConfig, TabsProps, ViteReactSSG, cn, copyToClipboard, createRoutes, getStarsRepo, getTranslated, reactToText, useAnalytics, useBreadcrumbs, useConfig, useI18n, useLocalizedTo, useLocation, useMdxComponents, useNavbar, usePageNav, useRoutes, useSearch, useSearchHighlight, useSidebar, useTabs, useTheme, useTrackEvent, useTrackPageView, useUI, useVersion };
369
+ export { Banner, BoltdocsConfig, type BoltdocsLocale, BoltdocsRoutePath, BoltdocsRoutePathWithFallback, BoltdocsShell, BoltdocsTab, type BoltdocsTypes, type BoltdocsVersion, Breadcrumbs, type CollectionListLoaderData, type CollectionPost$1 as CollectionPost, type CollectionPostLoaderData, CollectionsContext, type CollectionsData, ComponentRoute, CopyMarkdown, DocsLayoutComponent as DocsLayout, ErrorBoundary, LayoutProps, MdxPage, Navbar, NavbarLink, NotFound, OnThisPage, OnThisPageProps, PageNav, SearchDialog, Sidebar, SidebarProps, SiteConfig, TabsProps, ViteReactSSG, cn, copyToClipboard, createRoutes, getStarsRepo, getTranslated, reactToText, useAnalytics, useBreadcrumbs, useConfig, useHeadings, useI18n, useLocalizedTo, useLocation, useMdxComponents, useMergedComponents, useNavbar, usePageNav, usePost, usePosts, useRecentPosts, useRoutes, useSearch, useSearchHighlight, useSidebar, useTabs, useTheme, useTrackEvent, useTrackPageView, useUI, useVersion };
@@ -1,22 +1,40 @@
1
1
 
2
- import { C as BoltdocsConfig, D as BoltdocsSocialLink, E as BoltdocsMdxComponents, O as BoltdocsTypes, S as TabsProps, T as BoltdocsLocale, _ as LayoutProps, a as SidebarItem, b as SidebarProps, d as SidebarMobile, f as SidebarRoot, g as ComponentRoute, h as BoltdocsTab, i as SidebarHeader, k as BoltdocsVersion, m as ComponentBase, n as SidebarContent, s as SidebarItems, u as SidebarLinkProps, v as NavbarLink, w as BoltdocsIntegrationsConfig, x as SiteConfig, y as OnThisPageProps } from "../sidebar-CyZS9YOm.js";
3
- import { n as Card, t as Cards } from "../cards-BakZPTz9.js";
2
+ import { A as BoltdocsRoutePathWithFallback, C as SiteConfig, D as BoltdocsLocale, E as BoltdocsIntegrationsConfig, M as BoltdocsTypes, N as BoltdocsVersion, O as BoltdocsMdxComponents, S as SidebarProps, T as BoltdocsConfig, _ as CollectionPostLoaderData, b as NavbarLink, g as CollectionListLoaderData, h as BoltdocsTab, j as BoltdocsSocialLink, k as BoltdocsRoutePath, v as ComponentRoute, w as TabsProps, x as OnThisPageProps, y as LayoutProps } from "../sidebar-DNq4_ZAa.js";
3
+ import { a as ErrorBoundary, c as OnThisPage, i as CopyMarkdown, l as Sidebar, n as NotFound, o as PageNav, r as SearchDialog, s as Breadcrumbs, t as Banner, u as Navbar } from "../banner-3N4Jd_L9.js";
4
4
  import { RouteRecord, ViteReactSSG } from "@bdocs/ssg";
5
+ import * as _$react from "react";
6
+ import React$1, { ComponentType, JSXElementConstructor, ReactNode } from "react";
5
7
  import * as _$react_router_dom0 from "react-router-dom";
6
8
  import { LinkProps } from "react-router-dom";
7
- import * as _$react from "react";
8
- import React$1, { JSXElementConstructor, ReactNode } from "react";
9
9
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
10
10
  import { ClassValue } from "clsx";
11
11
 
12
+ //#region src/client/collections/collections-context.d.ts
13
+ interface CollectionPost$1 {
14
+ path: string;
15
+ title: string;
16
+ date?: string | Date;
17
+ excerpt?: string;
18
+ tags?: string[];
19
+ author?: string;
20
+ coverImage?: string;
21
+ filePath: string;
22
+ frontmatter?: Record<string, any>;
23
+ }
24
+ type CollectionsData = Record<string, CollectionPost$1[]>;
25
+ declare const CollectionsContext: _$react.Context<CollectionsData>;
26
+ //#endregion
12
27
  //#region src/client/ssg/create-routes.d.ts
13
28
  interface CreateRoutesOptions {
14
29
  routesData: ComponentRoute[];
30
+ collectionsData?: CollectionsData;
31
+ collectionLayouts?: Record<string, React$1.ComponentType<{
32
+ children: React$1.ReactNode;
33
+ }>>;
34
+ collectionLists?: Record<string, React$1.ComponentType>;
35
+ collectionPosts?: Record<string, React$1.ComponentType<any>>;
15
36
  config: BoltdocsConfig;
16
37
  mdxModules: Record<string, any>;
17
- Layout: React$1.ComponentType<{
18
- children: React$1.ReactNode;
19
- }>;
20
38
  externalPages?: Record<string, React$1.ComponentType>;
21
39
  externalLayout?: React$1.ComponentType<{
22
40
  children: React$1.ReactNode;
@@ -26,14 +44,23 @@ interface CreateRoutesOptions {
26
44
  declare function createRoutes(options: CreateRoutesOptions): RouteRecord[];
27
45
  //#endregion
28
46
  //#region src/client/ssg/mdx-page.d.ts
47
+ type MdxPageProps = {
48
+ MDXComponent: React.ComponentType<React.PropsWithChildren<unknown>>;
49
+ mdxComponents: Record<string, React.ComponentType<HTMLElement>>;
50
+ collectionPostComponent?: React.ComponentType<any>;
51
+ };
29
52
  /**
30
- * Renders an MDX page by consuming pre-loaded module data.
31
- * Uses DocPage to ensure consistent layout and metadata application.
53
+ * Renders an MDX page by consuming pre-loaded route data.
54
+ *
55
+ * - If the route belongs to a collection (`data.collection` is set), renders
56
+ * the custom post component if provided, else falls back to the standard DocPage.
57
+ * - Otherwise, renders the standard `DocPage` layout.
32
58
  */
33
59
  declare function MdxPage({
34
- MDXComponent: propMDX,
35
- mdxComponents: propComponents
36
- }: any): _$react_jsx_runtime0.JSX.Element | null;
60
+ MDXComponent,
61
+ mdxComponents: propComponents,
62
+ collectionPostComponent: CollectionPost
63
+ }: MdxPageProps): _$react_jsx_runtime0.JSX.Element | null;
37
64
  //#endregion
38
65
  //#region src/client/ssg/boltdocs-shell.d.ts
39
66
  declare function BoltdocsShell({
@@ -63,6 +90,13 @@ interface ThemeContextType {
63
90
  declare function useTheme(): ThemeContextType;
64
91
  //#endregion
65
92
  //#region src/client/app/mdx-components-context.d.ts
93
+ type MdxComponentsType = {
94
+ [key: string]: React.ComponentType<HTMLElement>;
95
+ } & {
96
+ Frontmatter?: Record<string, React.ComponentType<{
97
+ value: unknown;
98
+ }>>;
99
+ };
66
100
  declare function useMdxComponents(): BoltdocsMdxComponents;
67
101
  //#endregion
68
102
  //#region src/client/app/ui-context.d.ts
@@ -192,6 +226,7 @@ declare function useRoutes(): {
192
226
  routes: ComponentRoute[];
193
227
  allRoutes: ComponentRoute[];
194
228
  currentRoute: ComponentRoute | undefined;
229
+ isCollectionPage: boolean;
195
230
  currentLocale: BoltdocsLocale;
196
231
  currentVersion: BoltdocsVersion;
197
232
  };
@@ -247,110 +282,51 @@ declare function useAnalytics(options?: UseAnalyticsOptions): AnalyticsInstance;
247
282
  declare function useTrackPageView(): (path: string, title?: string) => void;
248
283
  declare function useTrackEvent(): (event: AnalyticsEvent) => void;
249
284
  //#endregion
250
- //#region src/client/components/docs-layout-default.d.ts
251
- declare const DocsLayout: any;
252
- //#endregion
253
- //#region src/client/components/ui-base/navbar.d.ts
254
- declare function Navbar(): _$react_jsx_runtime0.JSX.Element;
255
- //#endregion
256
- //#region src/client/components/ui-base/sidebar.d.ts
257
- interface SidebarProps$1 {
258
- routes: ComponentRoute[];
259
- config: BoltdocsConfig;
260
- }
261
- declare function SidebarMain({
262
- routes,
263
- config
264
- }: SidebarProps$1): _$react_jsx_runtime0.JSX.Element;
265
- declare const Sidebar: typeof SidebarMain & {
266
- Root: typeof SidebarRoot;
267
- Mobile: typeof SidebarMobile;
268
- Header: typeof SidebarHeader;
269
- Content: typeof SidebarContent;
270
- Group: ({
271
- title,
272
- icon: Icon,
273
- children,
274
- className
275
- }: {
276
- title?: string;
277
- icon?: React.ElementType;
278
- } & ComponentBase) => _$react_jsx_runtime0.JSX.Element;
279
- Link: ({
280
- label,
281
- href,
282
- active,
283
- icon: Icon,
284
- badge,
285
- className
286
- }: SidebarLinkProps) => _$react_jsx_runtime0.JSX.Element;
287
- SubGroup: ({
288
- label,
289
- href,
290
- active,
291
- icon: Icon,
292
- badge,
293
- isOpen,
294
- onToggle,
295
- children,
296
- className
297
- }: SidebarLinkProps & {
298
- isOpen: boolean;
299
- onToggle: () => void;
300
- children: _$react.ReactNode;
301
- }) => _$react_jsx_runtime0.JSX.Element;
302
- Item: typeof SidebarItem;
303
- Items: typeof SidebarItems;
304
- };
305
- //#endregion
306
- //#region src/client/components/ui-base/on-this-page.d.ts
307
- declare function OnThisPage({
308
- headings,
309
- editLink,
310
- communityHelp,
311
- filePath
312
- }: OnThisPageProps): _$react_jsx_runtime0.JSX.Element | null;
313
- //#endregion
314
- //#region src/client/components/ui-base/breadcrumbs.d.ts
315
- declare function Breadcrumbs(): _$react_jsx_runtime0.JSX.Element | null;
316
- //#endregion
317
- //#region src/client/components/ui-base/page-nav.d.ts
285
+ //#region src/client/hooks/use-headings.d.ts
318
286
  /**
319
- * Component to display the previous and next page navigation buttons.
320
- * Enhanced with subtle entrance animations, modern card layout, and hover highlights.
287
+ * Returns the headings of the current page, extracted from the route loader data.
288
+ * Useful for building custom Tables of Contents or jumping to sections.
289
+ *
290
+ * @returns An array of heading objects with level, text, and id.
321
291
  */
322
- declare function PageNav(): _$react_jsx_runtime0.JSX.Element | null;
292
+ declare function useHeadings(): {
293
+ level: number;
294
+ text: string;
295
+ id: string;
296
+ }[];
323
297
  //#endregion
324
- //#region src/client/components/ui-base/error-boundary.d.ts
325
- interface ErrorBoundaryProps {
326
- children?: ReactNode;
327
- fallback?: ReactNode;
328
- }
329
- declare function ErrorBoundary({
330
- children,
331
- fallback
332
- }: ErrorBoundaryProps): _$react_jsx_runtime0.JSX.Element;
298
+ //#region src/client/hooks/use-merged-components.d.ts
299
+ declare function useMergedComponents(propComponents?: Record<string, ComponentType<any>>): MdxComponentsType;
333
300
  //#endregion
334
- //#region src/client/components/ui-base/copy-markdown.d.ts
335
- interface CopyMarkdownProps {
336
- content?: string;
337
- mdxRaw?: string;
338
- route?: ComponentRoute;
301
+ //#region src/client/components/docs-layout-default.d.ts
302
+ interface DocsLayoutThemeProps {
303
+ children?: React.ReactNode;
339
304
  }
340
- declare function CopyMarkdown({
341
- content,
342
- mdxRaw
343
- }: CopyMarkdownProps): _$react_jsx_runtime0.JSX.Element | null;
305
+ declare function DocsLayoutComponent({
306
+ children
307
+ }: DocsLayoutThemeProps): _$react_jsx_runtime0.JSX.Element;
344
308
  //#endregion
345
- //#region src/client/components/ui-base/search-dialog.d.ts
346
- declare function SearchDialog({
347
- routes
348
- }: {
349
- routes: ComponentRoute[];
350
- }): _$react_jsx_runtime0.JSX.Element;
351
- //#endregion
352
- //#region src/client/components/ui-base/not-found.d.ts
353
- declare function NotFound(): _$react_jsx_runtime0.JSX.Element;
309
+ //#region src/client/collections/hooks.d.ts
310
+ /**
311
+ * Returns the posts of a collection.
312
+ * @param collection - The name of the collection.
313
+ * @returns The posts of the collection.
314
+ */
315
+ declare function usePosts(collection: string): CollectionPost$1[];
316
+ /**
317
+ * Returns a post by its slug.
318
+ * @param collection - The name of the collection.
319
+ * @param slug - The slug of the post.
320
+ * @returns The post with the given slug.
321
+ */
322
+ declare function usePost(collection: string, slug: string): CollectionPost$1 | undefined;
323
+ /**
324
+ * Returns the recent posts of a collection.
325
+ * @param collection - The name of the collection.
326
+ * @param count - The number of recent posts to return.
327
+ * @returns The recent posts of the collection.
328
+ */
329
+ declare function useRecentPosts(collection: string, count?: number): CollectionPost$1[];
354
330
  //#endregion
355
331
  //#region src/client/utils/cn.d.ts
356
332
  declare function cn(...inputs: ClassValue[]): string;
@@ -390,4 +366,4 @@ declare const copyToClipboard: (text: string) => Promise<boolean>;
390
366
  */
391
367
  declare function getStarsRepo(repo: string, token?: string, baseUrl?: string): Promise<string>;
392
368
  //#endregion
393
- export { BoltdocsConfig, type BoltdocsLocale, BoltdocsShell, BoltdocsTab, type BoltdocsTypes, type BoltdocsVersion, Breadcrumbs, Card, Cards, ComponentRoute, CopyMarkdown, DocsLayout, ErrorBoundary, LayoutProps, MdxPage, Navbar, NavbarLink, NotFound, OnThisPage, OnThisPageProps, PageNav, SearchDialog, Sidebar, SidebarProps, SiteConfig, TabsProps, ViteReactSSG, cn, copyToClipboard, createRoutes, getStarsRepo, getTranslated, reactToText, useAnalytics, useBreadcrumbs, useConfig, useI18n, useLocalizedTo, useLocation, useMdxComponents, useNavbar, usePageNav, useRoutes, useSearch, useSearchHighlight, useSidebar, useTabs, useTheme, useTrackEvent, useTrackPageView, useUI, useVersion };
369
+ export { Banner, BoltdocsConfig, type BoltdocsLocale, BoltdocsRoutePath, BoltdocsRoutePathWithFallback, BoltdocsShell, BoltdocsTab, type BoltdocsTypes, type BoltdocsVersion, Breadcrumbs, type CollectionListLoaderData, type CollectionPost$1 as CollectionPost, type CollectionPostLoaderData, CollectionsContext, type CollectionsData, ComponentRoute, CopyMarkdown, DocsLayoutComponent as DocsLayout, ErrorBoundary, LayoutProps, MdxPage, Navbar, NavbarLink, NotFound, OnThisPage, OnThisPageProps, PageNav, SearchDialog, Sidebar, SidebarProps, SiteConfig, TabsProps, ViteReactSSG, cn, copyToClipboard, createRoutes, getStarsRepo, getTranslated, reactToText, useAnalytics, useBreadcrumbs, useConfig, useHeadings, useI18n, useLocalizedTo, useLocation, useMdxComponents, useMergedComponents, useNavbar, usePageNav, usePost, usePosts, useRecentPosts, useRoutes, useSearch, useSearchHighlight, useSidebar, useTabs, useTheme, useTrackEvent, useTrackPageView, useUI, useVersion };