boltdocs 1.10.2 → 2.0.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.
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/dist/cache-7G6D532T.mjs +1 -0
- package/dist/chunk-A4HQPEPU.mjs +1 -0
- package/dist/chunk-BA5NH5HU.mjs +1 -0
- package/dist/chunk-BQCD3DWG.mjs +1 -0
- package/dist/chunk-H63UMKYF.mjs +1 -0
- package/dist/chunk-IWHRQHS7.mjs +1 -0
- package/dist/chunk-JZXLCA2E.mjs +1 -0
- package/dist/chunk-MFU7Q6WF.mjs +1 -0
- package/dist/chunk-QYPNX5UN.mjs +1 -0
- package/dist/chunk-XEAPSFMB.mjs +1 -0
- package/dist/client/components/mdx/index.d.mts +209 -0
- package/dist/client/components/mdx/index.d.ts +209 -0
- package/dist/client/components/mdx/index.js +1 -0
- package/dist/client/components/mdx/index.mjs +1 -0
- package/dist/client/hooks/index.d.mts +133 -0
- package/dist/client/hooks/index.d.ts +133 -0
- package/dist/client/hooks/index.js +1 -0
- package/dist/client/hooks/index.mjs +1 -0
- package/dist/client/index.d.mts +138 -298
- package/dist/client/index.d.ts +138 -298
- package/dist/client/index.js +1 -3630
- package/dist/client/index.mjs +1 -697
- package/dist/client/ssr.d.mts +7 -3
- package/dist/client/ssr.d.ts +7 -3
- package/dist/client/ssr.js +1 -2928
- package/dist/client/ssr.mjs +1 -33
- package/dist/{config-BsFQ-ErD.d.ts → config-CX4l-ZNp.d.mts} +42 -35
- package/dist/{config-BsFQ-ErD.d.mts → config-CX4l-ZNp.d.ts} +42 -35
- package/dist/node/index.d.mts +2 -4
- package/dist/node/index.d.ts +2 -4
- package/dist/node/index.js +31 -1161
- package/dist/node/index.mjs +31 -736
- package/dist/search-dialog-EB3N4TYM.mjs +1 -0
- package/dist/types-BuZWFT7r.d.ts +159 -0
- package/dist/types-CvT-SGbK.d.mts +159 -0
- package/dist/use-routes-5bAtAAYX.d.mts +30 -0
- package/dist/use-routes-BefRXY3v.d.ts +30 -0
- package/package.json +34 -12
- package/src/client/app/config-context.tsx +18 -0
- package/src/client/app/docs-layout.tsx +14 -0
- package/src/client/app/index.tsx +137 -262
- package/src/client/app/mdx-component.tsx +52 -0
- package/src/client/app/mdx-components-context.tsx +23 -0
- package/src/client/app/mdx-page.tsx +20 -0
- package/src/client/app/preload.tsx +38 -30
- package/src/client/app/router.tsx +30 -0
- package/src/client/app/scroll-handler.tsx +40 -0
- package/src/client/app/theme-context.tsx +75 -0
- package/src/client/components/default-layout.tsx +80 -0
- package/src/client/components/docs-layout.tsx +105 -0
- package/src/client/components/icons-dev.tsx +74 -0
- package/src/client/components/mdx/admonition.tsx +107 -0
- package/src/client/components/mdx/badge.tsx +41 -0
- package/src/client/components/mdx/button.tsx +35 -0
- package/src/client/components/mdx/card.tsx +124 -0
- package/src/client/components/mdx/code-block.tsx +119 -0
- package/src/client/components/mdx/component-preview.tsx +47 -0
- package/src/client/components/mdx/component-props.tsx +83 -0
- package/src/client/components/mdx/field.tsx +66 -0
- package/src/client/components/mdx/file-tree.tsx +287 -0
- package/src/client/components/mdx/hooks/use-code-block.ts +56 -0
- package/src/client/components/mdx/hooks/use-component-preview.ts +16 -0
- package/src/client/components/mdx/hooks/useTable.ts +74 -0
- package/src/client/components/mdx/hooks/useTabs.ts +68 -0
- package/src/client/components/mdx/image.tsx +23 -0
- package/src/client/components/mdx/index.ts +53 -0
- package/src/client/components/mdx/link.tsx +38 -0
- package/src/client/components/mdx/list.tsx +192 -0
- package/src/client/components/mdx/table.tsx +156 -0
- package/src/client/components/mdx/tabs.tsx +135 -0
- package/src/client/components/mdx/video.tsx +68 -0
- package/src/client/components/primitives/breadcrumbs.tsx +79 -0
- package/src/client/components/primitives/button-group.tsx +54 -0
- package/src/client/components/primitives/button.tsx +145 -0
- package/src/client/components/primitives/helpers/observer.ts +120 -0
- package/src/client/components/primitives/index.ts +17 -0
- package/src/client/components/primitives/link.tsx +122 -0
- package/src/client/components/primitives/menu.tsx +159 -0
- package/src/client/components/primitives/navbar.tsx +359 -0
- package/src/client/components/primitives/navigation-menu.tsx +116 -0
- package/src/client/components/primitives/on-this-page.tsx +461 -0
- package/src/client/components/primitives/page-nav.tsx +87 -0
- package/src/client/components/primitives/popover.tsx +47 -0
- package/src/client/components/primitives/search-dialog.tsx +183 -0
- package/src/client/components/primitives/sidebar.tsx +154 -0
- package/src/client/components/primitives/tabs.tsx +90 -0
- package/src/client/components/primitives/tooltip.tsx +83 -0
- package/src/client/components/primitives/types.ts +11 -0
- package/src/client/components/ui-base/breadcrumbs.tsx +42 -0
- package/src/client/components/ui-base/copy-markdown.tsx +112 -0
- package/src/client/components/ui-base/error-boundary.tsx +52 -0
- package/src/client/components/ui-base/github-stars.tsx +27 -0
- package/src/client/components/ui-base/head.tsx +69 -0
- package/src/client/components/ui-base/loading.tsx +87 -0
- package/src/client/components/ui-base/navbar.tsx +138 -0
- package/src/client/components/ui-base/not-found.tsx +24 -0
- package/src/client/components/ui-base/on-this-page.tsx +152 -0
- package/src/client/components/ui-base/page-nav.tsx +39 -0
- package/src/client/components/ui-base/powered-by.tsx +19 -0
- package/src/client/components/ui-base/progress-bar.tsx +67 -0
- package/src/client/components/ui-base/search-dialog.tsx +82 -0
- package/src/client/components/ui-base/sidebar.tsx +104 -0
- package/src/client/components/ui-base/tabs.tsx +65 -0
- package/src/client/components/ui-base/theme-toggle.tsx +32 -0
- package/src/client/hooks/index.ts +12 -0
- package/src/client/hooks/use-breadcrumbs.ts +22 -0
- package/src/client/hooks/use-i18n.ts +84 -0
- package/src/client/hooks/use-localized-to.ts +95 -0
- package/src/client/hooks/use-location.ts +5 -0
- package/src/client/hooks/use-navbar.ts +60 -0
- package/src/client/hooks/use-onthispage.ts +23 -0
- package/src/client/hooks/use-page-nav.ts +22 -0
- package/src/client/hooks/use-routes.ts +72 -0
- package/src/client/hooks/use-search.ts +71 -0
- package/src/client/hooks/use-sidebar.ts +49 -0
- package/src/client/hooks/use-tabs.ts +43 -0
- package/src/client/hooks/use-version.ts +78 -0
- package/src/client/index.ts +55 -17
- package/src/client/integrations/codesandbox.ts +179 -0
- package/src/client/ssr.tsx +27 -16
- package/src/client/theme/neutral.css +360 -0
- package/src/client/types.ts +131 -27
- package/src/client/utils/cn.ts +6 -0
- package/src/client/utils/copy-clipboard.ts +22 -0
- package/src/client/utils/get-base-file-path.ts +21 -0
- package/src/client/utils/github.ts +121 -0
- package/src/client/utils/use-on-change.ts +15 -0
- package/src/client/virtual.d.ts +24 -0
- package/src/node/cache.ts +156 -156
- package/src/node/config.ts +159 -103
- package/src/node/index.ts +13 -13
- package/src/node/mdx.ts +213 -61
- package/src/node/plugin/entry.ts +29 -18
- package/src/node/plugin/html.ts +11 -11
- package/src/node/plugin/index.ts +161 -84
- package/src/node/plugin/types.ts +2 -4
- package/src/node/routes/cache.ts +6 -6
- package/src/node/routes/index.ts +206 -113
- package/src/node/routes/parser.ts +102 -82
- package/src/node/routes/sorter.ts +15 -15
- package/src/node/routes/types.ts +24 -24
- package/src/node/ssg/index.ts +73 -47
- package/src/node/ssg/meta.ts +4 -4
- package/src/node/ssg/options.ts +5 -5
- package/src/node/ssg/sitemap.ts +14 -14
- package/src/node/utils.ts +54 -31
- package/tsconfig.json +25 -20
- package/tsup.config.ts +23 -14
- package/dist/PackageManagerTabs-NVT7G625.mjs +0 -99
- package/dist/SearchDialog-AGVF6JBO.mjs +0 -194
- package/dist/SearchDialog-YPDOM7Q6.css +0 -2847
- package/dist/Video-KNTY5BNO.mjs +0 -6
- package/dist/cache-KNL5B4EE.mjs +0 -12
- package/dist/chunk-7SFUJWTB.mjs +0 -211
- package/dist/chunk-FFBNU6IJ.mjs +0 -386
- package/dist/chunk-FMTOYQLO.mjs +0 -37
- package/dist/chunk-TKLQWU7H.mjs +0 -1920
- package/dist/chunk-Z7JHYNAS.mjs +0 -57
- package/dist/client/index.css +0 -2847
- package/dist/client/ssr.css +0 -2847
- package/dist/types-Dj-bfnC3.d.mts +0 -74
- package/dist/types-Dj-bfnC3.d.ts +0 -74
- package/src/client/theme/components/CodeBlock/CodeBlock.tsx +0 -61
- package/src/client/theme/components/CodeBlock/index.ts +0 -1
- package/src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx +0 -131
- package/src/client/theme/components/PackageManagerTabs/index.ts +0 -1
- package/src/client/theme/components/PackageManagerTabs/pkg-tabs.css +0 -64
- package/src/client/theme/components/Playground/Playground.tsx +0 -180
- package/src/client/theme/components/Playground/index.ts +0 -1
- package/src/client/theme/components/Playground/playground.css +0 -238
- package/src/client/theme/components/Video/Video.tsx +0 -84
- package/src/client/theme/components/Video/index.ts +0 -1
- package/src/client/theme/components/Video/video.css +0 -41
- package/src/client/theme/components/mdx/Admonition.tsx +0 -80
- package/src/client/theme/components/mdx/Badge.tsx +0 -31
- package/src/client/theme/components/mdx/Button.tsx +0 -50
- package/src/client/theme/components/mdx/Card.tsx +0 -80
- package/src/client/theme/components/mdx/Field.tsx +0 -60
- package/src/client/theme/components/mdx/FileTree.tsx +0 -229
- package/src/client/theme/components/mdx/List.tsx +0 -57
- package/src/client/theme/components/mdx/Table.tsx +0 -151
- package/src/client/theme/components/mdx/Tabs.tsx +0 -123
- package/src/client/theme/components/mdx/index.ts +0 -27
- package/src/client/theme/components/mdx/mdx-components.css +0 -764
- package/src/client/theme/icons/bun.tsx +0 -62
- package/src/client/theme/icons/deno.tsx +0 -20
- package/src/client/theme/icons/discord.tsx +0 -12
- package/src/client/theme/icons/github.tsx +0 -15
- package/src/client/theme/icons/npm.tsx +0 -13
- package/src/client/theme/icons/pnpm.tsx +0 -72
- package/src/client/theme/icons/twitter.tsx +0 -12
- package/src/client/theme/styles/markdown.css +0 -394
- package/src/client/theme/styles/variables.css +0 -175
- package/src/client/theme/styles.css +0 -39
- package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +0 -68
- package/src/client/theme/ui/Breadcrumbs/index.ts +0 -1
- package/src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx +0 -82
- package/src/client/theme/ui/CopyMarkdown/copy-markdown.css +0 -112
- package/src/client/theme/ui/CopyMarkdown/index.ts +0 -1
- package/src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx +0 -50
- package/src/client/theme/ui/ErrorBoundary/error-boundary.css +0 -55
- package/src/client/theme/ui/ErrorBoundary/index.ts +0 -1
- package/src/client/theme/ui/Footer/footer.css +0 -32
- package/src/client/theme/ui/Head/Head.tsx +0 -69
- package/src/client/theme/ui/Head/index.ts +0 -1
- package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +0 -125
- package/src/client/theme/ui/LanguageSwitcher/index.ts +0 -1
- package/src/client/theme/ui/LanguageSwitcher/language-switcher.css +0 -98
- package/src/client/theme/ui/Layout/Layout.tsx +0 -203
- package/src/client/theme/ui/Layout/base.css +0 -106
- package/src/client/theme/ui/Layout/index.ts +0 -2
- package/src/client/theme/ui/Layout/pagination.css +0 -72
- package/src/client/theme/ui/Layout/responsive.css +0 -47
- package/src/client/theme/ui/Link/Link.tsx +0 -392
- package/src/client/theme/ui/Link/LinkPreview.tsx +0 -59
- package/src/client/theme/ui/Link/index.ts +0 -2
- package/src/client/theme/ui/Link/link-preview.css +0 -48
- package/src/client/theme/ui/Loading/Loading.tsx +0 -10
- package/src/client/theme/ui/Loading/index.ts +0 -1
- package/src/client/theme/ui/Loading/loading.css +0 -30
- package/src/client/theme/ui/Navbar/GithubStars.tsx +0 -27
- package/src/client/theme/ui/Navbar/Navbar.tsx +0 -193
- package/src/client/theme/ui/Navbar/Tabs.tsx +0 -99
- package/src/client/theme/ui/Navbar/index.ts +0 -2
- package/src/client/theme/ui/Navbar/navbar.css +0 -347
- package/src/client/theme/ui/NotFound/NotFound.tsx +0 -19
- package/src/client/theme/ui/NotFound/index.ts +0 -1
- package/src/client/theme/ui/NotFound/not-found.css +0 -64
- package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +0 -244
- package/src/client/theme/ui/OnThisPage/index.ts +0 -1
- package/src/client/theme/ui/OnThisPage/toc.css +0 -152
- package/src/client/theme/ui/PoweredBy/PoweredBy.tsx +0 -18
- package/src/client/theme/ui/PoweredBy/index.ts +0 -1
- package/src/client/theme/ui/PoweredBy/powered-by.css +0 -76
- package/src/client/theme/ui/ProgressBar/ProgressBar.css +0 -17
- package/src/client/theme/ui/ProgressBar/ProgressBar.tsx +0 -51
- package/src/client/theme/ui/ProgressBar/index.ts +0 -1
- package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +0 -209
- package/src/client/theme/ui/SearchDialog/index.ts +0 -1
- package/src/client/theme/ui/SearchDialog/search.css +0 -152
- package/src/client/theme/ui/Sidebar/Sidebar.tsx +0 -244
- package/src/client/theme/ui/Sidebar/index.ts +0 -1
- package/src/client/theme/ui/Sidebar/sidebar.css +0 -230
- package/src/client/theme/ui/ThemeToggle/ThemeToggle.tsx +0 -69
- package/src/client/theme/ui/ThemeToggle/index.ts +0 -1
- package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +0 -136
- package/src/client/theme/ui/VersionSwitcher/index.ts +0 -1
- package/src/client/utils.ts +0 -49
package/dist/client/index.d.mts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { B as BoltdocsConfig } from '../config-
|
|
2
|
-
export { a as BoltdocsThemeConfig } from '../config-
|
|
3
|
-
import {
|
|
1
|
+
import { B as BoltdocsConfig } from '../config-CX4l-ZNp.mjs';
|
|
2
|
+
export { a as BoltdocsThemeConfig } from '../config-CX4l-ZNp.mjs';
|
|
3
|
+
import { a as CreateBoltdocsAppOptions, C as ComponentRoute, O as OnThisPageProps, S as SandboxOptions } from '../types-CvT-SGbK.mjs';
|
|
4
|
+
export { L as LayoutProps, b as SandboxEmbedOptions, c as SandboxFile, d as SandboxFiles } from '../types-CvT-SGbK.mjs';
|
|
5
|
+
export { u as useRoutes } from '../use-routes-5bAtAAYX.mjs';
|
|
6
|
+
import * as React$1 from 'react';
|
|
7
|
+
import React__default, { Component, ReactNode, ErrorInfo } from 'react';
|
|
4
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
|
|
9
|
+
export { Admonition, AdmonitionProps, Badge, BadgeProps, Button, ButtonProps, Card, CardProps, Cards, CardsProps, Caution, CodeBlock, ComponentPreview, ComponentPreviewProps, ComponentProps, ComponentPropsProps, CopyMarkdown, Danger, Field, FieldProps, FileTree, FileTreeProps, Image, ImageProps, Important, InfoBox, Link, LinkProps, List, ListProps, Note, Tab, TabProps, Table, TableProps, Tabs, TabsProps, Tip, Video, Warning } from './components/mdx/index.mjs';
|
|
6
10
|
import 'vite';
|
|
11
|
+
import 'class-variance-authority/types';
|
|
12
|
+
import 'react-aria-components';
|
|
13
|
+
import 'class-variance-authority';
|
|
7
14
|
|
|
8
|
-
declare global {
|
|
9
|
-
interface ImportMeta {
|
|
10
|
-
env: Record<string, any>;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
15
|
/**
|
|
14
16
|
* Creates and mounts the Boltdocs documentation app.
|
|
15
17
|
*
|
|
@@ -34,54 +36,82 @@ declare global {
|
|
|
34
36
|
declare function createBoltdocsApp(options: CreateBoltdocsAppOptions): void;
|
|
35
37
|
|
|
36
38
|
/**
|
|
37
|
-
*
|
|
39
|
+
* Hook to access the Boltdocs configuration.
|
|
38
40
|
*/
|
|
39
|
-
declare function
|
|
40
|
-
config: BoltdocsConfig;
|
|
41
|
-
routes?: ComponentRoute[];
|
|
42
|
-
allRoutes?: ComponentRoute[];
|
|
43
|
-
currentLocale?: string;
|
|
44
|
-
currentVersion?: string;
|
|
45
|
-
}): react_jsx_runtime.JSX.Element;
|
|
41
|
+
declare function useConfig(): BoltdocsConfig;
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
43
|
+
type Theme = 'light' | 'dark';
|
|
44
|
+
interface ThemeContextType {
|
|
45
|
+
theme: Theme;
|
|
46
|
+
toggleTheme: () => void;
|
|
47
|
+
setTheme: (theme: Theme) => void;
|
|
48
|
+
}
|
|
49
|
+
declare function useTheme(): ThemeContextType;
|
|
50
|
+
|
|
51
|
+
type MdxComponentsType = Record<string, React__default.ComponentType<any>>;
|
|
52
|
+
declare function useMdxComponents(): MdxComponentsType;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Props shared by all layout slot components.
|
|
56
|
+
*/
|
|
57
|
+
interface SlotProps {
|
|
58
|
+
children?: React__default.ReactNode;
|
|
59
|
+
className?: string;
|
|
60
|
+
style?: React__default.CSSProperties;
|
|
60
61
|
}
|
|
61
62
|
/**
|
|
62
|
-
*
|
|
63
|
-
* Groups documentation routes logically based on the `group` property.
|
|
64
|
-
* Highlights the active link based on the current URL path.
|
|
63
|
+
* Root layout shell. Renders a full-height flex column.
|
|
65
64
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* Usage:
|
|
66
|
+
* ```tsx
|
|
67
|
+
* <DocsLayout>
|
|
68
|
+
* <Navbar />
|
|
69
|
+
* <DocsLayout.Body>...</DocsLayout.Body>
|
|
70
|
+
* </DocsLayout>
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare function DocsLayoutRoot({ children, className, style }: SlotProps): react_jsx_runtime.JSX.Element;
|
|
74
|
+
/**
|
|
75
|
+
* Horizontal flex container for sidebar + content + toc.
|
|
68
76
|
*/
|
|
77
|
+
declare function Body({ children, className, style }: SlotProps): react_jsx_runtime.JSX.Element;
|
|
78
|
+
/**
|
|
79
|
+
* Main scrollable content area.
|
|
80
|
+
*/
|
|
81
|
+
declare function Content({ children, className, style }: SlotProps): react_jsx_runtime.JSX.Element;
|
|
82
|
+
/**
|
|
83
|
+
* Content header row (breadcrumbs + copy markdown).
|
|
84
|
+
*/
|
|
85
|
+
declare function ContentHeader({ children, className, style }: SlotProps): react_jsx_runtime.JSX.Element;
|
|
86
|
+
/**
|
|
87
|
+
* Footer area inside the content section (page nav).
|
|
88
|
+
*/
|
|
89
|
+
declare function ContentFooter({ children, className, style }: SlotProps): react_jsx_runtime.JSX.Element;
|
|
90
|
+
declare const DocsLayout: typeof DocsLayoutRoot & {
|
|
91
|
+
Body: typeof Body;
|
|
92
|
+
Content: typeof Content;
|
|
93
|
+
ContentHeader: typeof ContentHeader;
|
|
94
|
+
ContentFooter: typeof ContentFooter;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
interface LayoutProps {
|
|
98
|
+
children: React.ReactNode;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The built-in default layout for Boltdocs.
|
|
102
|
+
* Users who create their own `layout.tsx` can import the same building blocks
|
|
103
|
+
* and rearrange, wrap, or replace any section.
|
|
104
|
+
*/
|
|
105
|
+
declare function DefaultLayout({ children }: LayoutProps): react_jsx_runtime.JSX.Element;
|
|
106
|
+
|
|
107
|
+
declare function Navbar(): react_jsx_runtime.JSX.Element;
|
|
108
|
+
|
|
69
109
|
declare function Sidebar({ routes, config, }: {
|
|
70
|
-
routes:
|
|
110
|
+
routes: ComponentRoute[];
|
|
71
111
|
config: BoltdocsConfig;
|
|
72
112
|
}): react_jsx_runtime.JSX.Element;
|
|
73
113
|
|
|
74
|
-
|
|
75
|
-
id: string;
|
|
76
|
-
text: string;
|
|
77
|
-
level: number;
|
|
78
|
-
}
|
|
79
|
-
declare function OnThisPage({ headings, editLink, communityHelp, filePath, }: {
|
|
80
|
-
headings?: TocHeading[];
|
|
81
|
-
editLink?: string;
|
|
82
|
-
communityHelp?: string;
|
|
83
|
-
filePath?: string;
|
|
84
|
-
}): react_jsx_runtime.JSX.Element | null;
|
|
114
|
+
declare function OnThisPage({ headings: rawHeadings, editLink, communityHelp, filePath, }: OnThisPageProps): react_jsx_runtime.JSX.Element | null;
|
|
85
115
|
|
|
86
116
|
interface HeadProps {
|
|
87
117
|
siteTitle: string;
|
|
@@ -94,279 +124,89 @@ interface HeadProps {
|
|
|
94
124
|
}
|
|
95
125
|
declare function Head({ siteTitle, siteDescription, routes }: HeadProps): null;
|
|
96
126
|
|
|
97
|
-
|
|
98
|
-
routes: ComponentRoute[];
|
|
99
|
-
config: BoltdocsConfig;
|
|
100
|
-
}
|
|
101
|
-
declare function Breadcrumbs({ routes, config }: BreadcrumbsProps): react_jsx_runtime.JSX.Element | null;
|
|
127
|
+
declare function Breadcrumbs(): react_jsx_runtime.JSX.Element | null;
|
|
102
128
|
|
|
103
|
-
interface ThemeLayoutProps {
|
|
104
|
-
config: BoltdocsConfig;
|
|
105
|
-
routes: ComponentRoute[];
|
|
106
|
-
children: React.ReactNode;
|
|
107
|
-
/** Custom navbar component (slots) */
|
|
108
|
-
navbar?: React.ReactNode;
|
|
109
|
-
/** Custom sidebar component (slots) */
|
|
110
|
-
sidebar?: React.ReactNode;
|
|
111
|
-
/** Custom table of contents (OnThisPage) component (slots) */
|
|
112
|
-
toc?: React.ReactNode;
|
|
113
|
-
/** Custom background component (slots) */
|
|
114
|
-
background?: React.ReactNode;
|
|
115
|
-
/** Custom head/metadata component (slots) */
|
|
116
|
-
head?: React.ReactNode;
|
|
117
|
-
/** Custom breadcrumbs component (slots) */
|
|
118
|
-
breadcrumbs?: React.ReactNode;
|
|
119
|
-
/** Custom class name for the root layout element */
|
|
120
|
-
className?: string;
|
|
121
|
-
/** Custom styles for the root layout element */
|
|
122
|
-
style?: React.CSSProperties;
|
|
123
|
-
}
|
|
124
129
|
/**
|
|
125
|
-
*
|
|
126
|
-
* Integrates the Navbar, Sidebar, and OnThisPage components into a cohesive shell.
|
|
127
|
-
* It also manages mobile interaction states like the sidebar overlay toggle.
|
|
128
|
-
*
|
|
129
|
-
* @param config - The global Boltdocs configuration object
|
|
130
|
-
* @param routes - The array of available doc routes (used to render the sidebar)
|
|
131
|
-
*/
|
|
132
|
-
declare function ThemeLayout({ config, routes, children, navbar, sidebar, toc, background, head, breadcrumbs, className, style, }: ThemeLayoutProps): react_jsx_runtime.JSX.Element;
|
|
133
|
-
|
|
134
|
-
interface PlaygroundProps {
|
|
135
|
-
code?: string;
|
|
136
|
-
children?: string | React.ReactNode;
|
|
137
|
-
preview?: React.ReactNode;
|
|
138
|
-
scope?: Record<string, any>;
|
|
139
|
-
readonly?: boolean;
|
|
140
|
-
noInline?: boolean;
|
|
141
|
-
}
|
|
142
|
-
declare function Playground({ code: propsCode, children, preview, scope, readonly, noInline: forceNoInline, }: PlaygroundProps): react_jsx_runtime.JSX.Element;
|
|
143
|
-
|
|
144
|
-
declare function NotFound(): react_jsx_runtime.JSX.Element;
|
|
145
|
-
|
|
146
|
-
declare function Loading(): react_jsx_runtime.JSX.Element;
|
|
147
|
-
|
|
148
|
-
interface CodeBlockProps {
|
|
149
|
-
children?: React.ReactNode;
|
|
150
|
-
className?: string;
|
|
151
|
-
[key: string]: any;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* A specialized wrapper for code snippets compiled from MDX blocks.
|
|
155
|
-
* Provides syntax highlighting styling scaffolding and a "Copy to Clipboard" button.
|
|
156
|
-
*/
|
|
157
|
-
declare function CodeBlock({ children, ...props }: CodeBlockProps): react_jsx_runtime.JSX.Element;
|
|
158
|
-
|
|
159
|
-
interface VideoProps {
|
|
160
|
-
/** Video source URL */
|
|
161
|
-
src?: string;
|
|
162
|
-
/** Poster/thumbnail image URL */
|
|
163
|
-
poster?: string;
|
|
164
|
-
/** Alt text for accessibility */
|
|
165
|
-
alt?: string;
|
|
166
|
-
/** Show native video controls (default: true) */
|
|
167
|
-
controls?: boolean;
|
|
168
|
-
/** Preload strategy (default: 'none') */
|
|
169
|
-
preload?: string;
|
|
170
|
-
/** Children (e.g. <source> elements) */
|
|
171
|
-
children?: React.ReactNode;
|
|
172
|
-
/** Allow any additional HTML video attributes */
|
|
173
|
-
[key: string]: any;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Optimized video component with lazy loading via IntersectionObserver.
|
|
177
|
-
* The `<video>` element is only rendered once it enters the viewport,
|
|
178
|
-
* preventing unnecessary network downloads on initial page load.
|
|
179
|
-
*
|
|
180
|
-
* Usage in MDX:
|
|
181
|
-
* ```mdx
|
|
182
|
-
* <video src="/demo.mp4" poster="/demo-thumb.jpg" />
|
|
183
|
-
* ```
|
|
130
|
+
* Component to display the previous and next page navigation buttons.
|
|
184
131
|
*/
|
|
185
|
-
declare function
|
|
132
|
+
declare function PageNav(): react_jsx_runtime.JSX.Element | null;
|
|
186
133
|
|
|
187
|
-
type ButtonProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
188
|
-
/** Visual variant */
|
|
189
|
-
variant?: "primary" | "secondary" | "outline" | "ghost";
|
|
190
|
-
/** Size */
|
|
191
|
-
size?: "sm" | "md" | "lg";
|
|
192
|
-
/** If provided, renders as a link */
|
|
193
|
-
href?: string;
|
|
194
|
-
children: React.ReactNode;
|
|
195
|
-
};
|
|
196
134
|
/**
|
|
197
|
-
* A
|
|
135
|
+
* A reading progress bar component that tracks the scroll position
|
|
136
|
+
* within the Boltdocs content area.
|
|
198
137
|
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
* <Button variant="secondary" href="https://github.com">GitHub</Button>
|
|
202
|
-
* ```
|
|
138
|
+
* It utilizes react-aria-components for accessibility and is fixed
|
|
139
|
+
* to the top of the viewport for a premium, non-intrusive UI experience.
|
|
203
140
|
*/
|
|
204
|
-
declare function
|
|
141
|
+
declare function ProgressBar(): react_jsx_runtime.JSX.Element;
|
|
205
142
|
|
|
206
|
-
interface
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
children: React.ReactNode;
|
|
143
|
+
interface Props {
|
|
144
|
+
children?: ReactNode;
|
|
145
|
+
fallback?: ReactNode;
|
|
210
146
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
* ```mdx
|
|
215
|
-
* <Badge variant="success">Stable</Badge>
|
|
216
|
-
* <Badge variant="warning">Beta</Badge>
|
|
217
|
-
* ```
|
|
218
|
-
*/
|
|
219
|
-
declare function Badge({ variant, children, className, ...rest }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
220
|
-
|
|
221
|
-
interface CardsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
222
|
-
/** Number of columns (defaults to 3) */
|
|
223
|
-
cols?: 1 | 2 | 3 | 4;
|
|
224
|
-
children: React.ReactNode;
|
|
147
|
+
interface State {
|
|
148
|
+
hasError: boolean;
|
|
149
|
+
error?: Error;
|
|
225
150
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
* <Card title="Fast" icon="⚡">Instant HMR.</Card>
|
|
232
|
-
* <Card title="Simple" icon="📁">File-system routing.</Card>
|
|
233
|
-
* </Cards>
|
|
234
|
-
* ```
|
|
235
|
-
*/
|
|
236
|
-
declare function Cards({ cols, children, className, ...rest }: CardsProps): react_jsx_runtime.JSX.Element;
|
|
237
|
-
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
238
|
-
/** Card heading */
|
|
239
|
-
title?: string;
|
|
240
|
-
/** Emoji or icon string displayed above the title */
|
|
241
|
-
icon?: React.ReactNode;
|
|
242
|
-
/** If provided, the entire card becomes a link */
|
|
243
|
-
href?: string;
|
|
244
|
-
children?: React.ReactNode;
|
|
151
|
+
declare class ErrorBoundary extends Component<Props, State> {
|
|
152
|
+
state: State;
|
|
153
|
+
static getDerivedStateFromError(error: Error): State;
|
|
154
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
155
|
+
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
245
156
|
}
|
|
246
|
-
/**
|
|
247
|
-
* Individual feature/info card.
|
|
248
|
-
*/
|
|
249
|
-
declare function Card({ title, icon, href, children, className, ...rest }: CardProps): react_jsx_runtime.JSX.Element;
|
|
250
157
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
label: string;
|
|
254
|
-
children: React.ReactNode;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* A single tab panel. Must be used inside `<Tabs>`.
|
|
258
|
-
*
|
|
259
|
-
* ```mdx
|
|
260
|
-
* <Tab label="npm">npm install boltdocs</Tab>
|
|
261
|
-
* ```
|
|
262
|
-
*/
|
|
263
|
-
declare function Tab({ children }: TabProps): react_jsx_runtime.JSX.Element;
|
|
264
|
-
interface TabsProps {
|
|
265
|
-
/** Which tab index is initially active (0-based, default 0) */
|
|
266
|
-
defaultIndex?: number;
|
|
267
|
-
children: React.ReactNode;
|
|
268
|
-
}
|
|
158
|
+
declare function NotFound(): react_jsx_runtime.JSX.Element;
|
|
159
|
+
|
|
269
160
|
/**
|
|
270
|
-
*
|
|
161
|
+
* A premium loading component that includes an SVG fill animation
|
|
162
|
+
* and a synchronized progress indicator.
|
|
271
163
|
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
* <Tab label="npm">npm install boltdocs</Tab>
|
|
275
|
-
* <Tab label="pnpm">pnpm add boltdocs</Tab>
|
|
276
|
-
* </Tabs>
|
|
277
|
-
* ```
|
|
164
|
+
* It features a glassmorphism container and a Bolt-style SVG logo
|
|
165
|
+
* with a dynamic fill effect.
|
|
278
166
|
*/
|
|
279
|
-
declare function
|
|
167
|
+
declare function Loading(): react_jsx_runtime.JSX.Element;
|
|
280
168
|
|
|
281
|
-
interface AdmonitionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
282
|
-
/** Admonition type — controls color and icon */
|
|
283
|
-
type?: "note" | "tip" | "info" | "warning" | "danger";
|
|
284
|
-
/** Override the default title */
|
|
285
|
-
title?: string;
|
|
286
|
-
children: React.ReactNode;
|
|
287
|
-
}
|
|
288
169
|
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
* ```mdx
|
|
292
|
-
* <Admonition type="warning" title="Breaking Change">
|
|
293
|
-
* This API has changed in v2.
|
|
294
|
-
* </Admonition>
|
|
295
|
-
* ```
|
|
170
|
+
* Helper to define a sandbox and get a URL for the CodeSandbox Define API.
|
|
171
|
+
* Uses the official SDK `getParameters` for proper LZ-string compression.
|
|
296
172
|
*/
|
|
297
|
-
declare function
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
declare const InfoBox: (props: Omit<AdmonitionProps, "type">) => react_jsx_runtime.JSX.Element;
|
|
303
|
-
|
|
304
|
-
interface ListProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
305
|
-
/** Visual variant */
|
|
306
|
-
variant?: "checked" | "arrow" | "default";
|
|
307
|
-
children: React.ReactNode;
|
|
308
|
-
}
|
|
173
|
+
declare function defineSandbox(options: SandboxOptions): {
|
|
174
|
+
parameters: string;
|
|
175
|
+
url: string;
|
|
176
|
+
options: SandboxOptions;
|
|
177
|
+
};
|
|
309
178
|
/**
|
|
310
|
-
*
|
|
179
|
+
* CORE API: Open a CodeSandbox using a form POST to the Define API.
|
|
311
180
|
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
interface FileTreeProps {
|
|
323
|
-
children: React.ReactNode;
|
|
324
|
-
}
|
|
181
|
+
* Uses a hidden form + POST which avoids URL length limits and is the
|
|
182
|
+
* recommended approach from CodeSandbox documentation. The SDK's
|
|
183
|
+
* `getParameters` handles LZ-string compression internally.
|
|
184
|
+
*/
|
|
185
|
+
declare function openSandbox(options: SandboxOptions): {
|
|
186
|
+
parameters: string;
|
|
187
|
+
url: string;
|
|
188
|
+
options: SandboxOptions;
|
|
189
|
+
};
|
|
325
190
|
/**
|
|
326
|
-
*
|
|
191
|
+
* Generate an embeddable iframe URL for a CodeSandbox.
|
|
192
|
+
*
|
|
193
|
+
* This gives you more control than `openSandbox` — you can embed the sandbox
|
|
194
|
+
* inline on the page rather than opening a new tab. The returned URL can be
|
|
195
|
+
* used as the `src` of an `<iframe>`.
|
|
327
196
|
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
* </FileTree>
|
|
197
|
+
* @example
|
|
198
|
+
* ```tsx
|
|
199
|
+
* const url = embedSandbox({
|
|
200
|
+
* files: { "index.js": { content: "console.log('hello')" } },
|
|
201
|
+
* embed: { view: "editor", theme: "dark" },
|
|
202
|
+
* }).url;
|
|
203
|
+
* // url → "https://codesandbox.io/api/v1/sandboxes/define?parameters=…&embed=1&view=editor&theme=dark"
|
|
336
204
|
* ```
|
|
337
205
|
*/
|
|
338
|
-
declare function
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
children?: React.ReactNode;
|
|
344
|
-
className?: string;
|
|
345
|
-
sortable?: boolean;
|
|
346
|
-
paginated?: boolean;
|
|
347
|
-
pageSize?: number;
|
|
348
|
-
}
|
|
349
|
-
declare function Table({ headers, data, children, className, sortable, paginated, pageSize, }: TableProps): react_jsx_runtime.JSX.Element;
|
|
350
|
-
|
|
351
|
-
interface FieldProps {
|
|
352
|
-
/** The name of the property or field */
|
|
353
|
-
name: string;
|
|
354
|
-
/** The data type of the field (e.g., "string", "number", "boolean") */
|
|
355
|
-
type?: string;
|
|
356
|
-
/** The default value if not provided */
|
|
357
|
-
defaultValue?: string;
|
|
358
|
-
/** Whether the field is required */
|
|
359
|
-
required?: boolean;
|
|
360
|
-
/** Description or additional content */
|
|
361
|
-
children: React.ReactNode;
|
|
362
|
-
/** Optional anchor ID for linking */
|
|
363
|
-
id?: string;
|
|
364
|
-
/** Optional extra class name */
|
|
365
|
-
className?: string;
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* A highly aesthetic and readable component for documenting API fields/properties.
|
|
369
|
-
*/
|
|
370
|
-
declare function Field({ name, type, defaultValue, required, children, id, className, }: FieldProps): react_jsx_runtime.JSX.Element;
|
|
206
|
+
declare function embedSandbox(options: SandboxOptions): {
|
|
207
|
+
parameters: string;
|
|
208
|
+
url: string;
|
|
209
|
+
options: SandboxOptions;
|
|
210
|
+
};
|
|
371
211
|
|
|
372
|
-
export {
|
|
212
|
+
export { BoltdocsConfig, Breadcrumbs, ComponentRoute, CreateBoltdocsAppOptions, DefaultLayout, DocsLayout, ErrorBoundary, Head, Loading, Navbar, NotFound, OnThisPage, PageNav, ProgressBar, SandboxOptions, Sidebar, createBoltdocsApp, defineSandbox, embedSandbox, openSandbox, useConfig, useMdxComponents, useTheme };
|