boltdocs 3.0.2 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -18
- package/dist/{adapters-DEXNIv3x.mjs → adapters-ByYY44Zy.mjs} +1 -1
- package/dist/{adapters-C5AWWGfb.cjs → adapters-DvmtpdSF.cjs} +1 -1
- package/dist/{banner-CfdalYLL.d.ts → banner-BMop1KLF.d.ts} +2 -2
- package/dist/{banner-DNSkgUsO.d.cts → banner-CVD0GugR.d.cts} +2 -2
- package/dist/cache-CO4Dy2uQ.cjs +6 -0
- package/dist/cache-Dk53iOo6.mjs +6 -0
- package/dist/chunk-BFSpntXv.mjs +6 -0
- package/dist/{chunk-Ds5LZdWN.cjs → chunk-D1Md3oWO.cjs} +1 -1
- package/dist/client/index.cjs +433 -272
- package/dist/client/index.d.cts +129 -18
- package/dist/client/index.d.ts +129 -18
- package/dist/client/index.js +337 -178
- package/dist/client/mdx.cjs +1 -1
- package/dist/client/mdx.d.cts +1 -1
- package/dist/client/mdx.d.ts +1 -1
- package/dist/client/mdx.js +1 -1
- package/dist/client/primitives.cjs +7 -7
- package/dist/client/primitives.d.cts +5 -22
- package/dist/client/primitives.d.ts +5 -22
- package/dist/client/primitives.js +4 -4
- package/dist/client/theme/neutral.css +1 -3
- package/dist/client/theme/reset.css +31 -4
- package/dist/config-BpzaPsJj.d.cts +781 -0
- package/dist/config-CCXp3aXO.mjs +7 -0
- package/dist/{config-JGkMJoJQ.cjs → config-CMd4XoFq.cjs} +1 -1
- package/dist/config-DlGoEM9D.cjs +7 -0
- package/dist/config-xtS0ZkMm.d.mts +781 -0
- package/dist/{csp-CBysWlAf.cjs → csp-CRp_3U7a.cjs} +1 -1
- package/dist/csp-oTC2ygvF.mjs +6 -0
- package/dist/{docs-layout-6FQ8__ok.js → docs-layout-BdtZ9z6s.js} +9 -28
- package/dist/{docs-layout-3TpAt6MB.cjs → docs-layout-CFWI15Id.cjs} +69 -88
- package/dist/{doctor-BR1B2Mkz.cjs → doctor-BBtmNJE0.cjs} +1 -1
- package/dist/doctor-Bv16QSrI.cjs +7 -0
- package/dist/doctor-DOAbSaiL.mjs +7 -0
- package/dist/{generator-DtUU3Cfk.cjs → generator-COepVWGi.cjs} +1 -1
- package/dist/{handler-Btd4t_67.mjs → handler-DzQae4eA.mjs} +1 -1
- package/dist/{handler-Dzf4dSnV.cjs → handler-XX7cLTqe.cjs} +1 -1
- package/dist/headers-Ddwek8K7.mjs +6 -0
- package/dist/{headers-BXKxiPUv.cjs → headers-dg4SDrjY.cjs} +1 -1
- package/dist/{image-C9md50h2.js → image-Bz87fCla.js} +2 -2
- package/dist/{image-CR6UlaI5.cjs → image-C4TlpMHn.cjs} +18 -18
- package/dist/link-2PzgTnaP.js +673 -0
- package/dist/{icons-dev-BryEFkJu.cjs → link-D1Gjkb-2.cjs} +8 -353
- package/dist/{mdx-DhyMkc35.js → mdx-BuO6a1f7.js} +199 -40
- package/dist/{mdx-DJBg5DuL.cjs → mdx-CD-tSjRG.cjs} +237 -72
- package/dist/{meta-loader-C9MKjAs0.cjs → meta-loader-Dq1zcFnh.cjs} +1 -1
- package/dist/node/cache.cjs +6 -0
- package/dist/node/cache.d.cts +84 -0
- package/dist/node/cache.d.mts +84 -0
- package/dist/node/cache.mjs +6 -0
- package/dist/node/cli-entry.cjs +6 -6
- package/dist/node/cli-entry.mjs +9 -9
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +27 -638
- package/dist/node/index.d.mts +27 -640
- package/dist/node/index.mjs +1 -1
- package/dist/node/mdx/shiki-adapter.cjs +6 -0
- package/dist/node/mdx/shiki-adapter.d.cts +51 -0
- package/dist/node/mdx/shiki-adapter.d.mts +51 -0
- package/dist/node/mdx/shiki-adapter.mjs +6 -0
- package/dist/node-BXtqM1uH.mjs +6 -0
- package/dist/node-BlVk4EVg.cjs +104 -0
- package/dist/node-DOf4zhWc.mjs +104 -0
- package/dist/node-aD1eisrR.cjs +6 -0
- package/dist/{package-CEDhVAfO.cjs → package-BcISI5-P.cjs} +1 -1
- package/dist/{package-_dCCKVvG.mjs → package-CCYEAYeA.mjs} +1 -1
- package/dist/{pages-external-CX2uyW95.cjs → pages-external-XkYIs-d5.cjs} +1 -1
- package/dist/parser-DCiEWkSk.cjs +8 -0
- package/dist/parser-qk9FIHJ7.mjs +8 -0
- package/dist/plugin-C95kvu6h.mjs +73 -0
- package/dist/plugin-DM3u2bVj.cjs +73 -0
- package/dist/routes-BW6zsk7Z.mjs +6 -0
- package/dist/routes-BgoIB5wb.cjs +6 -0
- package/dist/{routes-BajCwrvX.cjs → routes-CORVxc02.cjs} +1 -1
- package/dist/{search-dialog-D4rplZMv.cjs → search-dialog-B1NERUNx.cjs} +101 -55
- package/dist/{search-dialog-Cx7aGW3U.cjs → search-dialog-BRFno7HD.cjs} +8 -8
- package/dist/{search-dialog-DDopgbKM.js → search-dialog-BmxHiKwt.js} +2 -2
- package/dist/{search-dialog-BNdRV60O.js → search-dialog-D6TvjcuV.js} +1 -1
- package/dist/{search-dialog-DaeSPvEo.js → search-dialog-DFnlx8LO.js} +44 -4
- package/dist/{search-dialog-CW1f6dn6.cjs → search-dialog-DHqwjJuG.cjs} +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/shiki-adapter-CoQ6jyJ4.cjs +6 -0
- package/dist/shiki-adapter-D-aKw7PP.mjs +6 -0
- package/dist/sidebar-COTaMHR-.d.ts +1100 -0
- package/dist/sidebar-CrEdJuHX.d.cts +1100 -0
- package/dist/{types-generator-CYcHkDzZ.cjs → types-generator-BXhv7Ill.cjs} +1 -1
- package/dist/types-generator-bDPvUztF.mjs +26 -0
- package/dist/utils-Crm9oPcV.mjs +7 -0
- package/dist/utils-D6Xtj0FZ.cjs +7 -0
- package/package.json +26 -12
- package/src/shared/types.ts +532 -23
- package/dist/cache-DETwlACe.cjs +0 -6
- package/dist/cache-SF59enb3.mjs +0 -6
- package/dist/config-B5uVv5q4.cjs +0 -7
- package/dist/config-D3_zDkHh.mjs +0 -7
- package/dist/csp-gaZ51xzq.mjs +0 -6
- package/dist/doctor-3MheVMwd.mjs +0 -7
- package/dist/doctor-DQxLM202.cjs +0 -7
- package/dist/headers-CXyf0auY.mjs +0 -6
- package/dist/icons-dev-kJyGWNeg.js +0 -916
- package/dist/node-B9JSyEIU.mjs +0 -105
- package/dist/node-Cedquois.cjs +0 -105
- package/dist/parser-CNIPHx4s.cjs +0 -8
- package/dist/parser-D0QHIQsi.mjs +0 -8
- package/dist/plugin-WYNORxp1.cjs +0 -68
- package/dist/plugin-YWNVRpws.mjs +0 -68
- package/dist/rolldown-runtime-fkIsjY3S.mjs +0 -6
- package/dist/routes-CyrnmVuG.mjs +0 -6
- package/dist/routes-D6Tuu7Fs.cjs +0 -6
- package/dist/shiki-adapter-CGTmrR6S.cjs +0 -6
- package/dist/shiki-adapter-CXEGRnjr.mjs +0 -6
- package/dist/shiki-adapter-Mr8_oT_9.cjs +0 -6
- package/dist/sidebar-7gIifpBX.d.cts +0 -615
- package/dist/sidebar-BAKgJ-Er.d.ts +0 -615
- package/dist/types-generator-DVOnRVKU.mjs +0 -26
- package/dist/utils-B3xYMrpK.mjs +0 -7
- package/dist/utils-Bz1tG9Dg.cjs +0 -7
- /package/dist/{errors-C0Hx15Ag.mjs → errors-0zGHRLue.mjs} +0 -0
- /package/dist/{errors-Dx6JHoKE.cjs → errors-vKw8CkiX.cjs} +0 -0
- /package/dist/{index-CdJv4ocW.d.mts → index-1KsTDq4o.d.mts} +0 -0
package/dist/client/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
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-
|
|
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-
|
|
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-CrEdJuHX.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-CVD0GugR.cjs";
|
|
4
4
|
import * as _$react from "react";
|
|
5
5
|
import React$1, { ComponentType, JSXElementConstructor, ReactNode } from "react";
|
|
6
6
|
import { RouteRecord, ViteReactSSG } from "@bdocs/ssg";
|
|
@@ -22,9 +22,32 @@ interface CollectionPost$1 {
|
|
|
22
22
|
locale?: string;
|
|
23
23
|
version?: string;
|
|
24
24
|
frontmatter?: Record<string, any>;
|
|
25
|
+
lastUpdated?: string | number | Date;
|
|
26
|
+
headings?: {
|
|
27
|
+
level: number;
|
|
28
|
+
text: string;
|
|
29
|
+
id: string;
|
|
30
|
+
}[];
|
|
31
|
+
draft?: boolean;
|
|
25
32
|
}
|
|
26
33
|
type CollectionsData = Record<string, CollectionPost$1[]>;
|
|
27
34
|
declare const CollectionsContext: _$react.Context<CollectionsData>;
|
|
35
|
+
interface CurrentPostContextValue {
|
|
36
|
+
route: ComponentRoute;
|
|
37
|
+
headings: {
|
|
38
|
+
level: number;
|
|
39
|
+
text: string;
|
|
40
|
+
id: string;
|
|
41
|
+
}[];
|
|
42
|
+
collection: string;
|
|
43
|
+
}
|
|
44
|
+
declare function CurrentPostProvider({
|
|
45
|
+
value,
|
|
46
|
+
children
|
|
47
|
+
}: {
|
|
48
|
+
value: CurrentPostContextValue;
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
28
51
|
//#endregion
|
|
29
52
|
//#region src/client/ssg/create-routes.d.ts
|
|
30
53
|
interface CreateRoutesOptions {
|
|
@@ -54,8 +77,9 @@ type MdxPageProps = {
|
|
|
54
77
|
/**
|
|
55
78
|
* Renders an MDX page by consuming pre-loaded route data.
|
|
56
79
|
*
|
|
57
|
-
* - If the route belongs to a collection (`data.collection` is set),
|
|
58
|
-
* the
|
|
80
|
+
* - If the route belongs to a collection (`data.collection` is set), wraps
|
|
81
|
+
* the content with `CurrentPostProvider` so that `usePost()` (called without
|
|
82
|
+
* a slug) can read the current post's data from context.
|
|
59
83
|
* - Otherwise, renders the standard `DocPage` layout.
|
|
60
84
|
*/
|
|
61
85
|
declare function MdxPage({
|
|
@@ -95,9 +119,9 @@ declare function useTheme(): ThemeContextType;
|
|
|
95
119
|
//#endregion
|
|
96
120
|
//#region src/client/app/mdx-components-context.d.ts
|
|
97
121
|
type MdxComponentsType = {
|
|
98
|
-
[key: string]:
|
|
122
|
+
[key: string]: ComponentType<any>;
|
|
99
123
|
} & {
|
|
100
|
-
Frontmatter?: Record<string,
|
|
124
|
+
Frontmatter?: Record<string, ComponentType<{
|
|
101
125
|
value: unknown;
|
|
102
126
|
}>>;
|
|
103
127
|
};
|
|
@@ -255,6 +279,13 @@ declare global {
|
|
|
255
279
|
gtag?: (...args: unknown[]) => void;
|
|
256
280
|
dataLayer?: unknown[];
|
|
257
281
|
gtag_report_conversion?: (url?: string) => boolean;
|
|
282
|
+
posthog?: {
|
|
283
|
+
capture: (event: string, properties?: Record<string, unknown>) => void;
|
|
284
|
+
identify: (distinctId: string) => void;
|
|
285
|
+
reset: () => void;
|
|
286
|
+
opt_out_capturing: () => void;
|
|
287
|
+
opt_in_capturing: () => void;
|
|
288
|
+
};
|
|
258
289
|
}
|
|
259
290
|
}
|
|
260
291
|
interface AnalyticsEvent {
|
|
@@ -328,27 +359,110 @@ declare function useFeedback(options?: UseFeedbackOptions): {
|
|
|
328
359
|
//#endregion
|
|
329
360
|
//#region src/client/components/docs-layout-default.d.ts
|
|
330
361
|
interface DocsLayoutThemeProps {
|
|
331
|
-
children?:
|
|
362
|
+
children?: ReactNode;
|
|
332
363
|
}
|
|
364
|
+
/**
|
|
365
|
+
* Default docs layout — composes the visual primitives and delegates
|
|
366
|
+
* sub-area routing to them. Slot rendering (plugin injections at
|
|
367
|
+
* `navbar:end`, `sidebar:bottom`, `docs-content:top`, etc.) is handled
|
|
368
|
+
* internally by each primitive so the layout itself does no slot "magic".
|
|
369
|
+
*
|
|
370
|
+
* A custom layout can reuse any primitive and the slot wiring just works.
|
|
371
|
+
*/
|
|
333
372
|
declare function DocsLayoutComponent({
|
|
334
373
|
children
|
|
335
374
|
}: DocsLayoutThemeProps): _$react_jsx_runtime0.JSX.Element;
|
|
336
375
|
//#endregion
|
|
337
376
|
//#region src/client/collections/hooks.d.ts
|
|
377
|
+
interface UsePostsOptions {
|
|
378
|
+
includeDrafts?: boolean;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Returns the posts of a collection, filtered by the current locale and version.
|
|
382
|
+
* Defaults to "blog" if no collection is specified.
|
|
383
|
+
* @param collection - The name of the collection. Defaults to "blog".
|
|
384
|
+
* @param options - Options to customize the query.
|
|
385
|
+
* @param options.includeDrafts - If true, includes draft posts in the results.
|
|
386
|
+
* @returns The filtered posts of the collection.
|
|
387
|
+
*/
|
|
388
|
+
declare function usePosts(collection?: string, options?: UsePostsOptions): CollectionPost$1[];
|
|
338
389
|
/**
|
|
339
|
-
* Returns
|
|
340
|
-
*
|
|
341
|
-
* @
|
|
390
|
+
* Returns a single post from a collection.
|
|
391
|
+
*
|
|
392
|
+
* @param collection - The name of the collection (optional inside post routes).
|
|
393
|
+
* @param slug - The post slug (optional inside post routes).
|
|
394
|
+
* @returns The matching post, or undefined if not found.
|
|
342
395
|
*/
|
|
343
|
-
declare function
|
|
396
|
+
declare function usePost(): CollectionPost$1 | undefined;
|
|
344
397
|
declare function usePost(collection: string, slug: string): CollectionPost$1 | undefined;
|
|
345
398
|
/**
|
|
346
|
-
* Returns the recent posts of a collection.
|
|
347
|
-
* @param collection - The name of the collection.
|
|
399
|
+
* Returns the recent posts of a collection. Defaults to "blog".
|
|
400
|
+
* @param collection - The name of the collection. Defaults to "blog".
|
|
348
401
|
* @param count - The number of recent posts to return.
|
|
349
402
|
* @returns The recent posts of the collection.
|
|
350
403
|
*/
|
|
351
|
-
declare function useRecentPosts(collection
|
|
404
|
+
declare function useRecentPosts(collection?: string, count?: number): CollectionPost$1[];
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region src/client/components/mdx/timeline.d.ts
|
|
407
|
+
/**
|
|
408
|
+
* Variants for both dots and badges.
|
|
409
|
+
*
|
|
410
|
+
* - Semantic: `primary`, `success`, `info`, `warning`, `danger` map directly
|
|
411
|
+
* to the dot accent color and the badge pill background.
|
|
412
|
+
* - Lifecycle (alias for semantic but convenient for changelogs):
|
|
413
|
+
* `major` → primary, `minor` → success, `patch` → info,
|
|
414
|
+
* `new` → primary, `deprecated` → warning, `breaking` → danger.
|
|
415
|
+
*/
|
|
416
|
+
type TimelineVariant = 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'major' | 'minor' | 'patch' | 'new' | 'deprecated' | 'breaking';
|
|
417
|
+
interface TimelineBadgeConfig {
|
|
418
|
+
text: ReactNode;
|
|
419
|
+
variant?: TimelineVariant;
|
|
420
|
+
}
|
|
421
|
+
interface TimelineProps extends Omit<React.HTMLAttributes<HTMLOListElement>, 'children'> {
|
|
422
|
+
children?: ReactNode;
|
|
423
|
+
/** Reduce vertical padding between items. */
|
|
424
|
+
compact?: boolean;
|
|
425
|
+
}
|
|
426
|
+
interface TimelineItemProps extends Omit<React.HTMLAttributes<HTMLLIElement>, 'title' | 'children'> {
|
|
427
|
+
/** Date the entry happened. Accepts ISO string, epoch ms, or `Date` instance. */
|
|
428
|
+
date?: string | number | Date;
|
|
429
|
+
/** Headline shown beside the date. */
|
|
430
|
+
title: ReactNode;
|
|
431
|
+
/** Inline badge to the right of the title (e.g. "Major", "Breaking"). */
|
|
432
|
+
badge?: string | TimelineBadgeConfig;
|
|
433
|
+
/** Icon to render inside the dot. Falls back to a coloured filled circle. */
|
|
434
|
+
icon?: ReactNode;
|
|
435
|
+
/** Dot / badge accent colour. Defaults to `primary`. */
|
|
436
|
+
variant?: TimelineVariant;
|
|
437
|
+
/**
|
|
438
|
+
* BCP-47 locale tag used by `toLocaleDateString` for the rendered
|
|
439
|
+
* date. Defaults to `'en-US'` so server and client produce identical
|
|
440
|
+
* markup on hydration. Pass `'es'`, `'fr'`, etc. to localize.
|
|
441
|
+
*/
|
|
442
|
+
locale?: string;
|
|
443
|
+
/** Body content for the entry. Accepts Markdown/markup from MDX. */
|
|
444
|
+
children?: ReactNode;
|
|
445
|
+
}
|
|
446
|
+
declare function TimelineRoot({
|
|
447
|
+
children,
|
|
448
|
+
className,
|
|
449
|
+
compact,
|
|
450
|
+
...props
|
|
451
|
+
}: TimelineProps): _$react_jsx_runtime0.JSX.Element;
|
|
452
|
+
declare function TimelineItem({
|
|
453
|
+
date,
|
|
454
|
+
title,
|
|
455
|
+
badge,
|
|
456
|
+
icon,
|
|
457
|
+
variant,
|
|
458
|
+
locale,
|
|
459
|
+
className,
|
|
460
|
+
children,
|
|
461
|
+
...props
|
|
462
|
+
}: TimelineItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
463
|
+
declare const Timeline: typeof TimelineRoot & {
|
|
464
|
+
Item: typeof TimelineItem;
|
|
465
|
+
};
|
|
352
466
|
//#endregion
|
|
353
467
|
//#region src/client/utils/cn.d.ts
|
|
354
468
|
declare function cn(...inputs: ClassValue[]): string;
|
|
@@ -424,9 +538,6 @@ declare function useCodeBlock(props: CodeBlockProps): {
|
|
|
424
538
|
showCodeBlockFeedback: boolean;
|
|
425
539
|
rated: "up" | "down" | null;
|
|
426
540
|
handleRate: (type: "up" | "down") => Promise<void>;
|
|
427
|
-
LangIcon: _$react.ComponentType<{
|
|
428
|
-
size?: number;
|
|
429
|
-
}>;
|
|
430
541
|
};
|
|
431
542
|
//#endregion
|
|
432
|
-
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, useCodeBlock, useConfig, useFeedback, useHeadings, useI18n, useLocalizedTo, useLocation, useMdxComponents, useMergedComponents, useNavbar, usePageNav, usePost, usePosts, useRecentPosts, useRoutes, useSearch, useSearchHighlight, useSidebar, useTabs, useTheme, useTrackEvent, useTrackPageView, useUI, useVersion };
|
|
543
|
+
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, type ComponentRoute, CopyMarkdown, CurrentPostProvider, DocsLayoutComponent as DocsLayout, ErrorBoundary, LayoutProps, MdxPage, Navbar, NavbarLink, NotFound, OnThisPage, OnThisPageProps, PageNav, SearchDialog, Sidebar, SidebarProps, SiteConfig, TabsProps, Timeline, type TimelineBadgeConfig, type TimelineItemProps, type TimelineProps, type TimelineVariant, ViteReactSSG, cn, copyToClipboard, createRoutes, getStarsRepo, getTranslated, reactToText, useAnalytics, useBreadcrumbs, useCodeBlock, useConfig, useFeedback, useHeadings, useI18n, useLocalizedTo, useLocation, useMdxComponents, useMergedComponents, useNavbar, usePageNav, usePost, usePosts, useRecentPosts, useRoutes, useSearch, useSearchHighlight, useSidebar, useTabs, useTheme, useTrackEvent, useTrackPageView, useUI, useVersion };
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
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-
|
|
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-
|
|
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-COTaMHR-.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-BMop1KLF.js";
|
|
4
4
|
import { RouteRecord, ViteReactSSG } from "@bdocs/ssg";
|
|
5
5
|
import * as _$react from "react";
|
|
6
6
|
import React$1, { ComponentType, JSXElementConstructor, ReactNode } from "react";
|
|
@@ -22,9 +22,32 @@ interface CollectionPost$1 {
|
|
|
22
22
|
locale?: string;
|
|
23
23
|
version?: string;
|
|
24
24
|
frontmatter?: Record<string, any>;
|
|
25
|
+
lastUpdated?: string | number | Date;
|
|
26
|
+
headings?: {
|
|
27
|
+
level: number;
|
|
28
|
+
text: string;
|
|
29
|
+
id: string;
|
|
30
|
+
}[];
|
|
31
|
+
draft?: boolean;
|
|
25
32
|
}
|
|
26
33
|
type CollectionsData = Record<string, CollectionPost$1[]>;
|
|
27
34
|
declare const CollectionsContext: _$react.Context<CollectionsData>;
|
|
35
|
+
interface CurrentPostContextValue {
|
|
36
|
+
route: ComponentRoute;
|
|
37
|
+
headings: {
|
|
38
|
+
level: number;
|
|
39
|
+
text: string;
|
|
40
|
+
id: string;
|
|
41
|
+
}[];
|
|
42
|
+
collection: string;
|
|
43
|
+
}
|
|
44
|
+
declare function CurrentPostProvider({
|
|
45
|
+
value,
|
|
46
|
+
children
|
|
47
|
+
}: {
|
|
48
|
+
value: CurrentPostContextValue;
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
28
51
|
//#endregion
|
|
29
52
|
//#region src/client/ssg/create-routes.d.ts
|
|
30
53
|
interface CreateRoutesOptions {
|
|
@@ -54,8 +77,9 @@ type MdxPageProps = {
|
|
|
54
77
|
/**
|
|
55
78
|
* Renders an MDX page by consuming pre-loaded route data.
|
|
56
79
|
*
|
|
57
|
-
* - If the route belongs to a collection (`data.collection` is set),
|
|
58
|
-
* the
|
|
80
|
+
* - If the route belongs to a collection (`data.collection` is set), wraps
|
|
81
|
+
* the content with `CurrentPostProvider` so that `usePost()` (called without
|
|
82
|
+
* a slug) can read the current post's data from context.
|
|
59
83
|
* - Otherwise, renders the standard `DocPage` layout.
|
|
60
84
|
*/
|
|
61
85
|
declare function MdxPage({
|
|
@@ -95,9 +119,9 @@ declare function useTheme(): ThemeContextType;
|
|
|
95
119
|
//#endregion
|
|
96
120
|
//#region src/client/app/mdx-components-context.d.ts
|
|
97
121
|
type MdxComponentsType = {
|
|
98
|
-
[key: string]:
|
|
122
|
+
[key: string]: ComponentType<any>;
|
|
99
123
|
} & {
|
|
100
|
-
Frontmatter?: Record<string,
|
|
124
|
+
Frontmatter?: Record<string, ComponentType<{
|
|
101
125
|
value: unknown;
|
|
102
126
|
}>>;
|
|
103
127
|
};
|
|
@@ -255,6 +279,13 @@ declare global {
|
|
|
255
279
|
gtag?: (...args: unknown[]) => void;
|
|
256
280
|
dataLayer?: unknown[];
|
|
257
281
|
gtag_report_conversion?: (url?: string) => boolean;
|
|
282
|
+
posthog?: {
|
|
283
|
+
capture: (event: string, properties?: Record<string, unknown>) => void;
|
|
284
|
+
identify: (distinctId: string) => void;
|
|
285
|
+
reset: () => void;
|
|
286
|
+
opt_out_capturing: () => void;
|
|
287
|
+
opt_in_capturing: () => void;
|
|
288
|
+
};
|
|
258
289
|
}
|
|
259
290
|
}
|
|
260
291
|
interface AnalyticsEvent {
|
|
@@ -328,27 +359,110 @@ declare function useFeedback(options?: UseFeedbackOptions): {
|
|
|
328
359
|
//#endregion
|
|
329
360
|
//#region src/client/components/docs-layout-default.d.ts
|
|
330
361
|
interface DocsLayoutThemeProps {
|
|
331
|
-
children?:
|
|
362
|
+
children?: ReactNode;
|
|
332
363
|
}
|
|
364
|
+
/**
|
|
365
|
+
* Default docs layout — composes the visual primitives and delegates
|
|
366
|
+
* sub-area routing to them. Slot rendering (plugin injections at
|
|
367
|
+
* `navbar:end`, `sidebar:bottom`, `docs-content:top`, etc.) is handled
|
|
368
|
+
* internally by each primitive so the layout itself does no slot "magic".
|
|
369
|
+
*
|
|
370
|
+
* A custom layout can reuse any primitive and the slot wiring just works.
|
|
371
|
+
*/
|
|
333
372
|
declare function DocsLayoutComponent({
|
|
334
373
|
children
|
|
335
374
|
}: DocsLayoutThemeProps): _$react_jsx_runtime0.JSX.Element;
|
|
336
375
|
//#endregion
|
|
337
376
|
//#region src/client/collections/hooks.d.ts
|
|
377
|
+
interface UsePostsOptions {
|
|
378
|
+
includeDrafts?: boolean;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Returns the posts of a collection, filtered by the current locale and version.
|
|
382
|
+
* Defaults to "blog" if no collection is specified.
|
|
383
|
+
* @param collection - The name of the collection. Defaults to "blog".
|
|
384
|
+
* @param options - Options to customize the query.
|
|
385
|
+
* @param options.includeDrafts - If true, includes draft posts in the results.
|
|
386
|
+
* @returns The filtered posts of the collection.
|
|
387
|
+
*/
|
|
388
|
+
declare function usePosts(collection?: string, options?: UsePostsOptions): CollectionPost$1[];
|
|
338
389
|
/**
|
|
339
|
-
* Returns
|
|
340
|
-
*
|
|
341
|
-
* @
|
|
390
|
+
* Returns a single post from a collection.
|
|
391
|
+
*
|
|
392
|
+
* @param collection - The name of the collection (optional inside post routes).
|
|
393
|
+
* @param slug - The post slug (optional inside post routes).
|
|
394
|
+
* @returns The matching post, or undefined if not found.
|
|
342
395
|
*/
|
|
343
|
-
declare function
|
|
396
|
+
declare function usePost(): CollectionPost$1 | undefined;
|
|
344
397
|
declare function usePost(collection: string, slug: string): CollectionPost$1 | undefined;
|
|
345
398
|
/**
|
|
346
|
-
* Returns the recent posts of a collection.
|
|
347
|
-
* @param collection - The name of the collection.
|
|
399
|
+
* Returns the recent posts of a collection. Defaults to "blog".
|
|
400
|
+
* @param collection - The name of the collection. Defaults to "blog".
|
|
348
401
|
* @param count - The number of recent posts to return.
|
|
349
402
|
* @returns The recent posts of the collection.
|
|
350
403
|
*/
|
|
351
|
-
declare function useRecentPosts(collection
|
|
404
|
+
declare function useRecentPosts(collection?: string, count?: number): CollectionPost$1[];
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region src/client/components/mdx/timeline.d.ts
|
|
407
|
+
/**
|
|
408
|
+
* Variants for both dots and badges.
|
|
409
|
+
*
|
|
410
|
+
* - Semantic: `primary`, `success`, `info`, `warning`, `danger` map directly
|
|
411
|
+
* to the dot accent color and the badge pill background.
|
|
412
|
+
* - Lifecycle (alias for semantic but convenient for changelogs):
|
|
413
|
+
* `major` → primary, `minor` → success, `patch` → info,
|
|
414
|
+
* `new` → primary, `deprecated` → warning, `breaking` → danger.
|
|
415
|
+
*/
|
|
416
|
+
type TimelineVariant = 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'major' | 'minor' | 'patch' | 'new' | 'deprecated' | 'breaking';
|
|
417
|
+
interface TimelineBadgeConfig {
|
|
418
|
+
text: ReactNode;
|
|
419
|
+
variant?: TimelineVariant;
|
|
420
|
+
}
|
|
421
|
+
interface TimelineProps extends Omit<React.HTMLAttributes<HTMLOListElement>, 'children'> {
|
|
422
|
+
children?: ReactNode;
|
|
423
|
+
/** Reduce vertical padding between items. */
|
|
424
|
+
compact?: boolean;
|
|
425
|
+
}
|
|
426
|
+
interface TimelineItemProps extends Omit<React.HTMLAttributes<HTMLLIElement>, 'title' | 'children'> {
|
|
427
|
+
/** Date the entry happened. Accepts ISO string, epoch ms, or `Date` instance. */
|
|
428
|
+
date?: string | number | Date;
|
|
429
|
+
/** Headline shown beside the date. */
|
|
430
|
+
title: ReactNode;
|
|
431
|
+
/** Inline badge to the right of the title (e.g. "Major", "Breaking"). */
|
|
432
|
+
badge?: string | TimelineBadgeConfig;
|
|
433
|
+
/** Icon to render inside the dot. Falls back to a coloured filled circle. */
|
|
434
|
+
icon?: ReactNode;
|
|
435
|
+
/** Dot / badge accent colour. Defaults to `primary`. */
|
|
436
|
+
variant?: TimelineVariant;
|
|
437
|
+
/**
|
|
438
|
+
* BCP-47 locale tag used by `toLocaleDateString` for the rendered
|
|
439
|
+
* date. Defaults to `'en-US'` so server and client produce identical
|
|
440
|
+
* markup on hydration. Pass `'es'`, `'fr'`, etc. to localize.
|
|
441
|
+
*/
|
|
442
|
+
locale?: string;
|
|
443
|
+
/** Body content for the entry. Accepts Markdown/markup from MDX. */
|
|
444
|
+
children?: ReactNode;
|
|
445
|
+
}
|
|
446
|
+
declare function TimelineRoot({
|
|
447
|
+
children,
|
|
448
|
+
className,
|
|
449
|
+
compact,
|
|
450
|
+
...props
|
|
451
|
+
}: TimelineProps): _$react_jsx_runtime0.JSX.Element;
|
|
452
|
+
declare function TimelineItem({
|
|
453
|
+
date,
|
|
454
|
+
title,
|
|
455
|
+
badge,
|
|
456
|
+
icon,
|
|
457
|
+
variant,
|
|
458
|
+
locale,
|
|
459
|
+
className,
|
|
460
|
+
children,
|
|
461
|
+
...props
|
|
462
|
+
}: TimelineItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
463
|
+
declare const Timeline: typeof TimelineRoot & {
|
|
464
|
+
Item: typeof TimelineItem;
|
|
465
|
+
};
|
|
352
466
|
//#endregion
|
|
353
467
|
//#region src/client/utils/cn.d.ts
|
|
354
468
|
declare function cn(...inputs: ClassValue[]): string;
|
|
@@ -424,9 +538,6 @@ declare function useCodeBlock(props: CodeBlockProps): {
|
|
|
424
538
|
showCodeBlockFeedback: boolean;
|
|
425
539
|
rated: "up" | "down" | null;
|
|
426
540
|
handleRate: (type: "up" | "down") => Promise<void>;
|
|
427
|
-
LangIcon: _$react.ComponentType<{
|
|
428
|
-
size?: number;
|
|
429
|
-
}>;
|
|
430
541
|
};
|
|
431
542
|
//#endregion
|
|
432
|
-
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, useCodeBlock, useConfig, useFeedback, useHeadings, useI18n, useLocalizedTo, useLocation, useMdxComponents, useMergedComponents, useNavbar, usePageNav, usePost, usePosts, useRecentPosts, useRoutes, useSearch, useSearchHighlight, useSidebar, useTabs, useTheme, useTrackEvent, useTrackPageView, useUI, useVersion };
|
|
543
|
+
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, type ComponentRoute, CopyMarkdown, CurrentPostProvider, DocsLayoutComponent as DocsLayout, ErrorBoundary, LayoutProps, MdxPage, Navbar, NavbarLink, NotFound, OnThisPage, OnThisPageProps, PageNav, SearchDialog, Sidebar, SidebarProps, SiteConfig, TabsProps, Timeline, type TimelineBadgeConfig, type TimelineItemProps, type TimelineProps, type TimelineVariant, ViteReactSSG, cn, copyToClipboard, createRoutes, getStarsRepo, getTranslated, reactToText, useAnalytics, useBreadcrumbs, useCodeBlock, useConfig, useFeedback, useHeadings, useI18n, useLocalizedTo, useLocation, useMdxComponents, useMergedComponents, useNavbar, usePageNav, usePost, usePosts, useRecentPosts, useRoutes, useSearch, useSearchHighlight, useSidebar, useTabs, useTheme, useTrackEvent, useTrackPageView, useUI, useVersion };
|