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.
Files changed (250) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/dist/cache-7G6D532T.mjs +1 -0
  4. package/dist/chunk-A4HQPEPU.mjs +1 -0
  5. package/dist/chunk-BA5NH5HU.mjs +1 -0
  6. package/dist/chunk-BQCD3DWG.mjs +1 -0
  7. package/dist/chunk-H63UMKYF.mjs +1 -0
  8. package/dist/chunk-IWHRQHS7.mjs +1 -0
  9. package/dist/chunk-JZXLCA2E.mjs +1 -0
  10. package/dist/chunk-MFU7Q6WF.mjs +1 -0
  11. package/dist/chunk-QYPNX5UN.mjs +1 -0
  12. package/dist/chunk-XEAPSFMB.mjs +1 -0
  13. package/dist/client/components/mdx/index.d.mts +209 -0
  14. package/dist/client/components/mdx/index.d.ts +209 -0
  15. package/dist/client/components/mdx/index.js +1 -0
  16. package/dist/client/components/mdx/index.mjs +1 -0
  17. package/dist/client/hooks/index.d.mts +133 -0
  18. package/dist/client/hooks/index.d.ts +133 -0
  19. package/dist/client/hooks/index.js +1 -0
  20. package/dist/client/hooks/index.mjs +1 -0
  21. package/dist/client/index.d.mts +138 -298
  22. package/dist/client/index.d.ts +138 -298
  23. package/dist/client/index.js +1 -3630
  24. package/dist/client/index.mjs +1 -697
  25. package/dist/client/ssr.d.mts +7 -3
  26. package/dist/client/ssr.d.ts +7 -3
  27. package/dist/client/ssr.js +1 -2928
  28. package/dist/client/ssr.mjs +1 -33
  29. package/dist/{config-BsFQ-ErD.d.ts → config-CX4l-ZNp.d.mts} +42 -35
  30. package/dist/{config-BsFQ-ErD.d.mts → config-CX4l-ZNp.d.ts} +42 -35
  31. package/dist/node/index.d.mts +2 -4
  32. package/dist/node/index.d.ts +2 -4
  33. package/dist/node/index.js +31 -1161
  34. package/dist/node/index.mjs +31 -736
  35. package/dist/search-dialog-EB3N4TYM.mjs +1 -0
  36. package/dist/types-BuZWFT7r.d.ts +159 -0
  37. package/dist/types-CvT-SGbK.d.mts +159 -0
  38. package/dist/use-routes-5bAtAAYX.d.mts +30 -0
  39. package/dist/use-routes-BefRXY3v.d.ts +30 -0
  40. package/package.json +34 -12
  41. package/src/client/app/config-context.tsx +18 -0
  42. package/src/client/app/docs-layout.tsx +14 -0
  43. package/src/client/app/index.tsx +137 -262
  44. package/src/client/app/mdx-component.tsx +52 -0
  45. package/src/client/app/mdx-components-context.tsx +23 -0
  46. package/src/client/app/mdx-page.tsx +20 -0
  47. package/src/client/app/preload.tsx +38 -30
  48. package/src/client/app/router.tsx +30 -0
  49. package/src/client/app/scroll-handler.tsx +40 -0
  50. package/src/client/app/theme-context.tsx +75 -0
  51. package/src/client/components/default-layout.tsx +80 -0
  52. package/src/client/components/docs-layout.tsx +105 -0
  53. package/src/client/components/icons-dev.tsx +74 -0
  54. package/src/client/components/mdx/admonition.tsx +107 -0
  55. package/src/client/components/mdx/badge.tsx +41 -0
  56. package/src/client/components/mdx/button.tsx +35 -0
  57. package/src/client/components/mdx/card.tsx +124 -0
  58. package/src/client/components/mdx/code-block.tsx +119 -0
  59. package/src/client/components/mdx/component-preview.tsx +47 -0
  60. package/src/client/components/mdx/component-props.tsx +83 -0
  61. package/src/client/components/mdx/field.tsx +66 -0
  62. package/src/client/components/mdx/file-tree.tsx +287 -0
  63. package/src/client/components/mdx/hooks/use-code-block.ts +56 -0
  64. package/src/client/components/mdx/hooks/use-component-preview.ts +16 -0
  65. package/src/client/components/mdx/hooks/useTable.ts +74 -0
  66. package/src/client/components/mdx/hooks/useTabs.ts +68 -0
  67. package/src/client/components/mdx/image.tsx +23 -0
  68. package/src/client/components/mdx/index.ts +53 -0
  69. package/src/client/components/mdx/link.tsx +38 -0
  70. package/src/client/components/mdx/list.tsx +192 -0
  71. package/src/client/components/mdx/table.tsx +156 -0
  72. package/src/client/components/mdx/tabs.tsx +135 -0
  73. package/src/client/components/mdx/video.tsx +68 -0
  74. package/src/client/components/primitives/breadcrumbs.tsx +79 -0
  75. package/src/client/components/primitives/button-group.tsx +54 -0
  76. package/src/client/components/primitives/button.tsx +145 -0
  77. package/src/client/components/primitives/helpers/observer.ts +120 -0
  78. package/src/client/components/primitives/index.ts +17 -0
  79. package/src/client/components/primitives/link.tsx +122 -0
  80. package/src/client/components/primitives/menu.tsx +159 -0
  81. package/src/client/components/primitives/navbar.tsx +359 -0
  82. package/src/client/components/primitives/navigation-menu.tsx +116 -0
  83. package/src/client/components/primitives/on-this-page.tsx +461 -0
  84. package/src/client/components/primitives/page-nav.tsx +87 -0
  85. package/src/client/components/primitives/popover.tsx +47 -0
  86. package/src/client/components/primitives/search-dialog.tsx +183 -0
  87. package/src/client/components/primitives/sidebar.tsx +154 -0
  88. package/src/client/components/primitives/tabs.tsx +90 -0
  89. package/src/client/components/primitives/tooltip.tsx +83 -0
  90. package/src/client/components/primitives/types.ts +11 -0
  91. package/src/client/components/ui-base/breadcrumbs.tsx +42 -0
  92. package/src/client/components/ui-base/copy-markdown.tsx +112 -0
  93. package/src/client/components/ui-base/error-boundary.tsx +52 -0
  94. package/src/client/components/ui-base/github-stars.tsx +27 -0
  95. package/src/client/components/ui-base/head.tsx +69 -0
  96. package/src/client/components/ui-base/loading.tsx +87 -0
  97. package/src/client/components/ui-base/navbar.tsx +138 -0
  98. package/src/client/components/ui-base/not-found.tsx +24 -0
  99. package/src/client/components/ui-base/on-this-page.tsx +152 -0
  100. package/src/client/components/ui-base/page-nav.tsx +39 -0
  101. package/src/client/components/ui-base/powered-by.tsx +19 -0
  102. package/src/client/components/ui-base/progress-bar.tsx +67 -0
  103. package/src/client/components/ui-base/search-dialog.tsx +82 -0
  104. package/src/client/components/ui-base/sidebar.tsx +104 -0
  105. package/src/client/components/ui-base/tabs.tsx +65 -0
  106. package/src/client/components/ui-base/theme-toggle.tsx +32 -0
  107. package/src/client/hooks/index.ts +12 -0
  108. package/src/client/hooks/use-breadcrumbs.ts +22 -0
  109. package/src/client/hooks/use-i18n.ts +84 -0
  110. package/src/client/hooks/use-localized-to.ts +95 -0
  111. package/src/client/hooks/use-location.ts +5 -0
  112. package/src/client/hooks/use-navbar.ts +60 -0
  113. package/src/client/hooks/use-onthispage.ts +23 -0
  114. package/src/client/hooks/use-page-nav.ts +22 -0
  115. package/src/client/hooks/use-routes.ts +72 -0
  116. package/src/client/hooks/use-search.ts +71 -0
  117. package/src/client/hooks/use-sidebar.ts +49 -0
  118. package/src/client/hooks/use-tabs.ts +43 -0
  119. package/src/client/hooks/use-version.ts +78 -0
  120. package/src/client/index.ts +55 -17
  121. package/src/client/integrations/codesandbox.ts +179 -0
  122. package/src/client/ssr.tsx +27 -16
  123. package/src/client/theme/neutral.css +360 -0
  124. package/src/client/types.ts +131 -27
  125. package/src/client/utils/cn.ts +6 -0
  126. package/src/client/utils/copy-clipboard.ts +22 -0
  127. package/src/client/utils/get-base-file-path.ts +21 -0
  128. package/src/client/utils/github.ts +121 -0
  129. package/src/client/utils/use-on-change.ts +15 -0
  130. package/src/client/virtual.d.ts +24 -0
  131. package/src/node/cache.ts +156 -156
  132. package/src/node/config.ts +159 -103
  133. package/src/node/index.ts +13 -13
  134. package/src/node/mdx.ts +213 -61
  135. package/src/node/plugin/entry.ts +29 -18
  136. package/src/node/plugin/html.ts +11 -11
  137. package/src/node/plugin/index.ts +161 -84
  138. package/src/node/plugin/types.ts +2 -4
  139. package/src/node/routes/cache.ts +6 -6
  140. package/src/node/routes/index.ts +206 -113
  141. package/src/node/routes/parser.ts +102 -82
  142. package/src/node/routes/sorter.ts +15 -15
  143. package/src/node/routes/types.ts +24 -24
  144. package/src/node/ssg/index.ts +73 -47
  145. package/src/node/ssg/meta.ts +4 -4
  146. package/src/node/ssg/options.ts +5 -5
  147. package/src/node/ssg/sitemap.ts +14 -14
  148. package/src/node/utils.ts +54 -31
  149. package/tsconfig.json +25 -20
  150. package/tsup.config.ts +23 -14
  151. package/dist/PackageManagerTabs-NVT7G625.mjs +0 -99
  152. package/dist/SearchDialog-AGVF6JBO.mjs +0 -194
  153. package/dist/SearchDialog-YPDOM7Q6.css +0 -2847
  154. package/dist/Video-KNTY5BNO.mjs +0 -6
  155. package/dist/cache-KNL5B4EE.mjs +0 -12
  156. package/dist/chunk-7SFUJWTB.mjs +0 -211
  157. package/dist/chunk-FFBNU6IJ.mjs +0 -386
  158. package/dist/chunk-FMTOYQLO.mjs +0 -37
  159. package/dist/chunk-TKLQWU7H.mjs +0 -1920
  160. package/dist/chunk-Z7JHYNAS.mjs +0 -57
  161. package/dist/client/index.css +0 -2847
  162. package/dist/client/ssr.css +0 -2847
  163. package/dist/types-Dj-bfnC3.d.mts +0 -74
  164. package/dist/types-Dj-bfnC3.d.ts +0 -74
  165. package/src/client/theme/components/CodeBlock/CodeBlock.tsx +0 -61
  166. package/src/client/theme/components/CodeBlock/index.ts +0 -1
  167. package/src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx +0 -131
  168. package/src/client/theme/components/PackageManagerTabs/index.ts +0 -1
  169. package/src/client/theme/components/PackageManagerTabs/pkg-tabs.css +0 -64
  170. package/src/client/theme/components/Playground/Playground.tsx +0 -180
  171. package/src/client/theme/components/Playground/index.ts +0 -1
  172. package/src/client/theme/components/Playground/playground.css +0 -238
  173. package/src/client/theme/components/Video/Video.tsx +0 -84
  174. package/src/client/theme/components/Video/index.ts +0 -1
  175. package/src/client/theme/components/Video/video.css +0 -41
  176. package/src/client/theme/components/mdx/Admonition.tsx +0 -80
  177. package/src/client/theme/components/mdx/Badge.tsx +0 -31
  178. package/src/client/theme/components/mdx/Button.tsx +0 -50
  179. package/src/client/theme/components/mdx/Card.tsx +0 -80
  180. package/src/client/theme/components/mdx/Field.tsx +0 -60
  181. package/src/client/theme/components/mdx/FileTree.tsx +0 -229
  182. package/src/client/theme/components/mdx/List.tsx +0 -57
  183. package/src/client/theme/components/mdx/Table.tsx +0 -151
  184. package/src/client/theme/components/mdx/Tabs.tsx +0 -123
  185. package/src/client/theme/components/mdx/index.ts +0 -27
  186. package/src/client/theme/components/mdx/mdx-components.css +0 -764
  187. package/src/client/theme/icons/bun.tsx +0 -62
  188. package/src/client/theme/icons/deno.tsx +0 -20
  189. package/src/client/theme/icons/discord.tsx +0 -12
  190. package/src/client/theme/icons/github.tsx +0 -15
  191. package/src/client/theme/icons/npm.tsx +0 -13
  192. package/src/client/theme/icons/pnpm.tsx +0 -72
  193. package/src/client/theme/icons/twitter.tsx +0 -12
  194. package/src/client/theme/styles/markdown.css +0 -394
  195. package/src/client/theme/styles/variables.css +0 -175
  196. package/src/client/theme/styles.css +0 -39
  197. package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +0 -68
  198. package/src/client/theme/ui/Breadcrumbs/index.ts +0 -1
  199. package/src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx +0 -82
  200. package/src/client/theme/ui/CopyMarkdown/copy-markdown.css +0 -112
  201. package/src/client/theme/ui/CopyMarkdown/index.ts +0 -1
  202. package/src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx +0 -50
  203. package/src/client/theme/ui/ErrorBoundary/error-boundary.css +0 -55
  204. package/src/client/theme/ui/ErrorBoundary/index.ts +0 -1
  205. package/src/client/theme/ui/Footer/footer.css +0 -32
  206. package/src/client/theme/ui/Head/Head.tsx +0 -69
  207. package/src/client/theme/ui/Head/index.ts +0 -1
  208. package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +0 -125
  209. package/src/client/theme/ui/LanguageSwitcher/index.ts +0 -1
  210. package/src/client/theme/ui/LanguageSwitcher/language-switcher.css +0 -98
  211. package/src/client/theme/ui/Layout/Layout.tsx +0 -203
  212. package/src/client/theme/ui/Layout/base.css +0 -106
  213. package/src/client/theme/ui/Layout/index.ts +0 -2
  214. package/src/client/theme/ui/Layout/pagination.css +0 -72
  215. package/src/client/theme/ui/Layout/responsive.css +0 -47
  216. package/src/client/theme/ui/Link/Link.tsx +0 -392
  217. package/src/client/theme/ui/Link/LinkPreview.tsx +0 -59
  218. package/src/client/theme/ui/Link/index.ts +0 -2
  219. package/src/client/theme/ui/Link/link-preview.css +0 -48
  220. package/src/client/theme/ui/Loading/Loading.tsx +0 -10
  221. package/src/client/theme/ui/Loading/index.ts +0 -1
  222. package/src/client/theme/ui/Loading/loading.css +0 -30
  223. package/src/client/theme/ui/Navbar/GithubStars.tsx +0 -27
  224. package/src/client/theme/ui/Navbar/Navbar.tsx +0 -193
  225. package/src/client/theme/ui/Navbar/Tabs.tsx +0 -99
  226. package/src/client/theme/ui/Navbar/index.ts +0 -2
  227. package/src/client/theme/ui/Navbar/navbar.css +0 -347
  228. package/src/client/theme/ui/NotFound/NotFound.tsx +0 -19
  229. package/src/client/theme/ui/NotFound/index.ts +0 -1
  230. package/src/client/theme/ui/NotFound/not-found.css +0 -64
  231. package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +0 -244
  232. package/src/client/theme/ui/OnThisPage/index.ts +0 -1
  233. package/src/client/theme/ui/OnThisPage/toc.css +0 -152
  234. package/src/client/theme/ui/PoweredBy/PoweredBy.tsx +0 -18
  235. package/src/client/theme/ui/PoweredBy/index.ts +0 -1
  236. package/src/client/theme/ui/PoweredBy/powered-by.css +0 -76
  237. package/src/client/theme/ui/ProgressBar/ProgressBar.css +0 -17
  238. package/src/client/theme/ui/ProgressBar/ProgressBar.tsx +0 -51
  239. package/src/client/theme/ui/ProgressBar/index.ts +0 -1
  240. package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +0 -209
  241. package/src/client/theme/ui/SearchDialog/index.ts +0 -1
  242. package/src/client/theme/ui/SearchDialog/search.css +0 -152
  243. package/src/client/theme/ui/Sidebar/Sidebar.tsx +0 -244
  244. package/src/client/theme/ui/Sidebar/index.ts +0 -1
  245. package/src/client/theme/ui/Sidebar/sidebar.css +0 -230
  246. package/src/client/theme/ui/ThemeToggle/ThemeToggle.tsx +0 -69
  247. package/src/client/theme/ui/ThemeToggle/index.ts +0 -1
  248. package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +0 -136
  249. package/src/client/theme/ui/VersionSwitcher/index.ts +0 -1
  250. package/src/client/utils.ts +0 -49
@@ -1,697 +1 @@
1
- import {
2
- Breadcrumbs,
3
- CodeBlock,
4
- Head,
5
- Loading,
6
- Navbar,
7
- NotFound,
8
- OnThisPage,
9
- Sidebar,
10
- ThemeLayout,
11
- createBoltdocsApp
12
- } from "../chunk-TKLQWU7H.mjs";
13
- import {
14
- Video
15
- } from "../chunk-Z7JHYNAS.mjs";
16
- import {
17
- Bun,
18
- Deno,
19
- NPM,
20
- Pnpm
21
- } from "../chunk-7SFUJWTB.mjs";
22
- import "../chunk-FMTOYQLO.mjs";
23
-
24
- // src/client/theme/components/Playground/Playground.tsx
25
- import React, { useState, useMemo } from "react";
26
- import { LiveProvider, LiveEditor, LiveError, LivePreview } from "react-live";
27
- import { Copy, Check, Terminal, Play } from "lucide-react";
28
- import { jsx, jsxs } from "react/jsx-runtime";
29
- function prepareCode(raw) {
30
- const trimmed = (raw || "").trim();
31
- const fnMatch = trimmed.match(/export\s+default\s+function\s+(\w+)/);
32
- if (fnMatch) {
33
- const name = fnMatch[1];
34
- const code = trimmed.replace(/export\s+default\s+/, "") + `
35
-
36
- render(<${name} />);`;
37
- return { code, noInline: true };
38
- }
39
- const varMatch = trimmed.match(/export\s+default\s+(\w+)\s*;?\s*$/);
40
- if (varMatch) {
41
- const name = varMatch[1];
42
- const code = trimmed.replace(/export\s+default\s+\w+\s*;?\s*$/, "") + `
43
- render(<${name} />);`;
44
- return { code, noInline: true };
45
- }
46
- return { code: trimmed, noInline: false };
47
- }
48
- function Playground({
49
- code: propsCode,
50
- children,
51
- preview,
52
- scope = {},
53
- readonly = false,
54
- noInline: forceNoInline
55
- }) {
56
- const initialCode = useMemo(() => {
57
- let base = propsCode || "";
58
- if (!base && typeof children === "string") {
59
- base = children;
60
- }
61
- return base.trim();
62
- }, [propsCode, children]);
63
- const prepared = useMemo(() => prepareCode(initialCode), [initialCode]);
64
- const useNoInline = forceNoInline ?? prepared.noInline;
65
- const [copied, setCopied] = useState(false);
66
- const [activeCode, setActiveCode] = useState(prepared.code);
67
- const [isExpanded, setIsExpanded] = useState(false);
68
- React.useEffect(() => {
69
- setActiveCode(prepared.code);
70
- }, [prepared.code]);
71
- const handleCopy = () => {
72
- const textToCopy = !!preview ? initialCode : activeCode;
73
- navigator.clipboard.writeText(textToCopy);
74
- setCopied(true);
75
- setTimeout(() => setCopied(false), 2e3);
76
- };
77
- const extendedScope = { React, ...scope };
78
- const charLimit = 800;
79
- const isExpandable = (propsCode || initialCode).length > charLimit;
80
- const shouldTruncate = isExpandable && !isExpanded;
81
- const isStatic = !!preview;
82
- const staticTransform = (code) => {
83
- return "render(<div style={{display:'none'}} />)";
84
- };
85
- return /* @__PURE__ */ jsx("div", { className: `boltdocs-playground ${shouldTruncate ? "is-truncated" : ""}`, "data-readonly": readonly || isStatic, children: /* @__PURE__ */ jsxs("div", { className: "playground-split-container", children: [
86
- /* @__PURE__ */ jsxs("div", { className: "playground-panel playground-preview-panel", children: [
87
- /* @__PURE__ */ jsx("div", { className: "playground-panel-header", children: /* @__PURE__ */ jsxs("div", { className: "playground-panel-title", children: [
88
- /* @__PURE__ */ jsx(Play, { size: 14 }),
89
- /* @__PURE__ */ jsx("span", { children: "Preview" })
90
- ] }) }),
91
- /* @__PURE__ */ jsx("div", { className: "playground-panel-content playground-preview", children: isStatic ? preview : /* @__PURE__ */ jsxs(
92
- LiveProvider,
93
- {
94
- code: activeCode,
95
- scope: extendedScope,
96
- theme: void 0,
97
- noInline: useNoInline,
98
- children: [
99
- /* @__PURE__ */ jsx(LivePreview, {}),
100
- /* @__PURE__ */ jsx(LiveError, { className: "playground-error" })
101
- ]
102
- }
103
- ) })
104
- ] }),
105
- /* @__PURE__ */ jsxs("div", { className: "playground-panel playground-editor-panel", children: [
106
- !isStatic && /* @__PURE__ */ jsx("div", { className: "playground-panel-header", children: /* @__PURE__ */ jsxs("div", { className: "playground-panel-title", children: [
107
- /* @__PURE__ */ jsx(Terminal, { size: 14 }),
108
- /* @__PURE__ */ jsx("span", { children: readonly ? "Code Example" : "Live Editor" })
109
- ] }) }),
110
- /* @__PURE__ */ jsxs("div", { className: "playground-panel-content playground-editor", children: [
111
- /* @__PURE__ */ jsx(
112
- "button",
113
- {
114
- className: "playground-copy-btn-inner",
115
- onClick: handleCopy,
116
- title: "Copy code",
117
- children: copied ? /* @__PURE__ */ jsx(Check, { size: 14 }) : /* @__PURE__ */ jsx(Copy, { size: 14 })
118
- }
119
- ),
120
- isStatic ? /* @__PURE__ */ jsx(
121
- LiveProvider,
122
- {
123
- code: initialCode,
124
- noInline: true,
125
- transformCode: staticTransform,
126
- children: /* @__PURE__ */ jsx(LiveEditor, { disabled: true })
127
- }
128
- ) : /* @__PURE__ */ jsx(
129
- LiveProvider,
130
- {
131
- code: activeCode,
132
- scope: extendedScope,
133
- theme: void 0,
134
- noInline: useNoInline,
135
- children: /* @__PURE__ */ jsx(LiveEditor, { disabled: readonly, onChange: setActiveCode })
136
- }
137
- )
138
- ] }),
139
- isExpandable && /* @__PURE__ */ jsx("div", { className: "playground-expand-wrapper", children: /* @__PURE__ */ jsx(
140
- "button",
141
- {
142
- className: "playground-expand-btn",
143
- onClick: () => setIsExpanded(!isExpanded),
144
- children: isExpanded ? "Show less" : "Expand code"
145
- }
146
- ) })
147
- ] })
148
- ] }) });
149
- }
150
-
151
- // src/client/theme/components/mdx/Button.tsx
152
- import { jsx as jsx2 } from "react/jsx-runtime";
153
- function Button({
154
- variant = "primary",
155
- size = "md",
156
- href,
157
- children,
158
- className = "",
159
- ...rest
160
- }) {
161
- const cls = `ld-btn ld-btn--${variant} ld-btn--${size} ${className}`.trim();
162
- if (href) {
163
- return /* @__PURE__ */ jsx2(
164
- "a",
165
- {
166
- href,
167
- style: { textDecoration: "none" },
168
- className: cls,
169
- ...rest,
170
- children
171
- }
172
- );
173
- }
174
- return /* @__PURE__ */ jsx2("button", { className: cls, ...rest, children });
175
- }
176
-
177
- // src/client/theme/components/mdx/Badge.tsx
178
- import { jsx as jsx3 } from "react/jsx-runtime";
179
- function Badge({
180
- variant = "default",
181
- children,
182
- className = "",
183
- ...rest
184
- }) {
185
- return /* @__PURE__ */ jsx3(
186
- "span",
187
- {
188
- className: `ld-badge ld-badge--${variant} ${className}`.trim(),
189
- ...rest,
190
- children
191
- }
192
- );
193
- }
194
-
195
- // src/client/theme/components/mdx/Card.tsx
196
- import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
197
- function Cards({
198
- cols = 3,
199
- children,
200
- className = "",
201
- ...rest
202
- }) {
203
- return /* @__PURE__ */ jsx4("div", { className: `ld-cards ld-cards--${cols} ${className}`.trim(), ...rest, children });
204
- }
205
- function Card({
206
- title,
207
- icon,
208
- href,
209
- children,
210
- className = "",
211
- ...rest
212
- }) {
213
- const inner = /* @__PURE__ */ jsxs2(Fragment, { children: [
214
- icon && /* @__PURE__ */ jsx4("span", { className: "ld-card__icon", children: icon }),
215
- title && /* @__PURE__ */ jsx4("h3", { className: "ld-card__title", children: title }),
216
- children && /* @__PURE__ */ jsx4("div", { className: "ld-card__body", children })
217
- ] });
218
- if (href) {
219
- return /* @__PURE__ */ jsx4(
220
- "a",
221
- {
222
- href,
223
- className: `ld-card ld-card--link ${className}`.trim(),
224
- ...rest,
225
- children: inner
226
- }
227
- );
228
- }
229
- return /* @__PURE__ */ jsx4("div", { className: `ld-card ${className}`.trim(), ...rest, children: inner });
230
- }
231
-
232
- // src/client/theme/components/mdx/Tabs.tsx
233
- import { useState as useState2, Children, isValidElement, useRef } from "react";
234
- import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
235
- function Tab({ children }) {
236
- const content = typeof children === "string" ? /* @__PURE__ */ jsx5(CodeBlock, { className: "language-bash", children: /* @__PURE__ */ jsx5("code", { children: children.trim() }) }) : children;
237
- return /* @__PURE__ */ jsx5("div", { className: "ld-tab-panel", children: content });
238
- }
239
- var getIconForLabel = (label) => {
240
- const l = label.toLowerCase();
241
- if (l.includes("pnpm")) return /* @__PURE__ */ jsx5(Pnpm, {});
242
- if (l.includes("npm")) return /* @__PURE__ */ jsx5(NPM, {});
243
- if (l.includes("bun")) return /* @__PURE__ */ jsx5(Bun, {});
244
- if (l.includes("deno")) return /* @__PURE__ */ jsx5(Deno, {});
245
- return null;
246
- };
247
- function Tabs({ defaultIndex = 0, children }) {
248
- const [active, setActive] = useState2(defaultIndex);
249
- const tabRefs = useRef([]);
250
- const tabs = Children.toArray(children).filter(
251
- (child) => isValidElement(child) && child.props?.label
252
- );
253
- const handleKeyDown = (e) => {
254
- let newIndex = active;
255
- if (e.key === "ArrowRight") {
256
- newIndex = (active + 1) % tabs.length;
257
- } else if (e.key === "ArrowLeft") {
258
- newIndex = (active - 1 + tabs.length) % tabs.length;
259
- }
260
- if (newIndex !== active) {
261
- setActive(newIndex);
262
- tabRefs.current[newIndex]?.focus();
263
- }
264
- };
265
- return /* @__PURE__ */ jsxs3("div", { className: "ld-tabs", children: [
266
- /* @__PURE__ */ jsx5("div", { className: "ld-tabs__bar", role: "tablist", onKeyDown: handleKeyDown, children: tabs.map((child, i) => {
267
- const label = child.props.label;
268
- const Icon = getIconForLabel(label);
269
- return /* @__PURE__ */ jsxs3(
270
- "button",
271
- {
272
- role: "tab",
273
- "aria-selected": i === active,
274
- "aria-controls": `tabpanel-${i}`,
275
- id: `tab-${i}`,
276
- tabIndex: i === active ? 0 : -1,
277
- ref: (el) => {
278
- tabRefs.current[i] = el;
279
- },
280
- className: `ld-tabs__trigger ${i === active ? "ld-tabs__trigger--active" : ""}`,
281
- onClick: () => setActive(i),
282
- children: [
283
- Icon,
284
- /* @__PURE__ */ jsx5("span", { children: label })
285
- ]
286
- },
287
- i
288
- );
289
- }) }),
290
- /* @__PURE__ */ jsx5(
291
- "div",
292
- {
293
- className: "ld-tabs__content",
294
- role: "tabpanel",
295
- id: `tabpanel-${active}`,
296
- "aria-labelledby": `tab-${active}`,
297
- children: tabs[active]
298
- }
299
- )
300
- ] });
301
- }
302
-
303
- // src/client/theme/components/mdx/Admonition.tsx
304
- import {
305
- Info,
306
- Lightbulb,
307
- AlertTriangle,
308
- ShieldAlert,
309
- Bookmark
310
- } from "lucide-react";
311
- import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
312
- var ICON_MAP = {
313
- note: /* @__PURE__ */ jsx6(Bookmark, { size: 18 }),
314
- tip: /* @__PURE__ */ jsx6(Lightbulb, { size: 18 }),
315
- info: /* @__PURE__ */ jsx6(Info, { size: 18 }),
316
- warning: /* @__PURE__ */ jsx6(AlertTriangle, { size: 18 }),
317
- danger: /* @__PURE__ */ jsx6(ShieldAlert, { size: 18 })
318
- };
319
- var LABEL_MAP = {
320
- note: "Note",
321
- tip: "Tip",
322
- info: "Info",
323
- warning: "Warning",
324
- danger: "Danger"
325
- };
326
- function Admonition({
327
- type = "note",
328
- title,
329
- children,
330
- className = "",
331
- ...rest
332
- }) {
333
- return /* @__PURE__ */ jsxs4(
334
- "div",
335
- {
336
- className: `ld-admonition ld-admonition--${type} ${className}`.trim(),
337
- role: type === "warning" || type === "danger" ? "alert" : "note",
338
- ...rest,
339
- children: [
340
- /* @__PURE__ */ jsxs4("div", { className: "ld-admonition__header", children: [
341
- /* @__PURE__ */ jsx6("span", { className: "ld-admonition__icon", children: ICON_MAP[type] }),
342
- /* @__PURE__ */ jsx6("span", { className: "ld-admonition__title", children: title || LABEL_MAP[type] })
343
- ] }),
344
- /* @__PURE__ */ jsx6("div", { className: "ld-admonition__body", children })
345
- ]
346
- }
347
- );
348
- }
349
- var Note = (props) => /* @__PURE__ */ jsx6(Admonition, { type: "note", ...props });
350
- var Tip = (props) => /* @__PURE__ */ jsx6(Admonition, { type: "tip", ...props });
351
- var Warning = (props) => /* @__PURE__ */ jsx6(Admonition, { type: "warning", ...props });
352
- var Danger = (props) => /* @__PURE__ */ jsx6(Admonition, { type: "danger", ...props });
353
- var InfoBox = (props) => /* @__PURE__ */ jsx6(Admonition, { type: "info", ...props });
354
-
355
- // src/client/theme/components/mdx/List.tsx
356
- import React3, { Children as Children2 } from "react";
357
- import { Check as Check2, ChevronRight } from "lucide-react";
358
- import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
359
- var ICON_MAP2 = {
360
- checked: /* @__PURE__ */ jsx7(Check2, { size: 14, className: "ld-list__icon" }),
361
- arrow: /* @__PURE__ */ jsx7(ChevronRight, { size: 14, className: "ld-list__icon" })
362
- };
363
- function List({
364
- variant = "default",
365
- children,
366
- className = "",
367
- ...rest
368
- }) {
369
- if (variant === "default") {
370
- return /* @__PURE__ */ jsx7("ul", { className: `ld-list ${className}`.trim(), ...rest, children });
371
- }
372
- const icon = ICON_MAP2[variant];
373
- return /* @__PURE__ */ jsx7("ul", { className: `ld-list ld-list--${variant} ${className}`.trim(), ...rest, children: Children2.map(children, (child) => {
374
- if (!React3.isValidElement(child)) return child;
375
- return /* @__PURE__ */ jsxs5("li", { className: "ld-list__item", children: [
376
- icon,
377
- /* @__PURE__ */ jsx7("span", { className: "ld-list__text", children: child.props.children })
378
- ] });
379
- }) });
380
- }
381
-
382
- // src/client/theme/components/mdx/FileTree.tsx
383
- import React4, { Children as Children3, isValidElement as isValidElement2, useState as useState3 } from "react";
384
- import {
385
- Folder,
386
- FileText,
387
- File,
388
- FileCode,
389
- FileImage,
390
- ChevronRight as ChevronRight2
391
- } from "lucide-react";
392
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
393
- function getTextContent(node) {
394
- if (typeof node === "string") return node;
395
- if (typeof node === "number") return node.toString();
396
- if (Array.isArray(node)) return node.map(getTextContent).join("");
397
- if (isValidElement2(node)) {
398
- return getTextContent(node.props.children);
399
- }
400
- return "";
401
- }
402
- function getFileIcon(filename) {
403
- const name = filename.toLowerCase();
404
- if (name.endsWith(".ts") || name.endsWith(".tsx") || name.endsWith(".js") || name.endsWith(".jsx") || name.endsWith(".json") || name.endsWith(".mjs") || name.endsWith(".cjs") || name.endsWith(".astro") || name.endsWith(".vue") || name.endsWith(".svelte")) {
405
- return /* @__PURE__ */ jsx8(FileCode, { size: 16, strokeWidth: 2, className: "ld-file-tree__icon-file" });
406
- }
407
- if (name.endsWith(".md") || name.endsWith(".mdx") || name.endsWith(".txt")) {
408
- return /* @__PURE__ */ jsx8(FileText, { size: 16, strokeWidth: 2, className: "ld-file-tree__icon-file" });
409
- }
410
- if (name.endsWith(".png") || name.endsWith(".jpg") || name.endsWith(".jpeg") || name.endsWith(".svg") || name.endsWith(".gif")) {
411
- return /* @__PURE__ */ jsx8(
412
- FileImage,
413
- {
414
- size: 16,
415
- strokeWidth: 2,
416
- className: "ld-file-tree__icon-file"
417
- }
418
- );
419
- }
420
- return /* @__PURE__ */ jsx8(File, { size: 16, strokeWidth: 2, className: "ld-file-tree__icon-file" });
421
- }
422
- function isListElement(node, tag) {
423
- if (typeof node.type === "string") {
424
- return node.type === tag;
425
- }
426
- if (typeof node.type === "function") {
427
- return node.type.name === tag || node.type.name?.toLowerCase() === tag;
428
- }
429
- if (node.props && node.props.originalType === tag) {
430
- return true;
431
- }
432
- if (node.props && node.props.mdxType === tag) {
433
- return true;
434
- }
435
- return false;
436
- }
437
- function FolderNode({
438
- labelText,
439
- nestedNodes,
440
- depth
441
- }) {
442
- const [isOpen, setIsOpen] = useState3(true);
443
- return /* @__PURE__ */ jsxs6("li", { className: "ld-file-tree__item", children: [
444
- /* @__PURE__ */ jsxs6(
445
- "div",
446
- {
447
- className: "ld-file-tree__label ld-file-tree__label--folder",
448
- onClick: () => setIsOpen(!isOpen),
449
- style: { cursor: "pointer" },
450
- children: [
451
- /* @__PURE__ */ jsx8("span", { className: "ld-file-tree__icon ld-file-tree__icon--chevron", children: /* @__PURE__ */ jsx8(
452
- ChevronRight2,
453
- {
454
- size: 14,
455
- className: `ld-file-tree__chevron ${isOpen ? "ld-file-tree__chevron--open" : ""}`,
456
- strokeWidth: 3
457
- }
458
- ) }),
459
- /* @__PURE__ */ jsx8("span", { className: "ld-file-tree__icon", children: /* @__PURE__ */ jsx8(
460
- Folder,
461
- {
462
- size: 16,
463
- strokeWidth: 2,
464
- className: "ld-file-tree__icon-folder",
465
- fill: "currentColor",
466
- fillOpacity: 0.15
467
- }
468
- ) }),
469
- /* @__PURE__ */ jsx8("span", { className: "ld-file-tree__name", children: labelText })
470
- ]
471
- }
472
- ),
473
- isOpen && nestedNodes.length > 0 && /* @__PURE__ */ jsx8("div", { className: "ld-file-tree__nested", children: nestedNodes.map((child, index) => /* @__PURE__ */ jsx8(React4.Fragment, { children: parseNode(child, depth) }, index)) })
474
- ] });
475
- }
476
- function parseNode(node, depth = 0) {
477
- if (!isValidElement2(node)) {
478
- return node;
479
- }
480
- if (isListElement(node, "ul")) {
481
- return /* @__PURE__ */ jsx8(
482
- "ul",
483
- {
484
- className: `ld-file-tree__list ${depth === 0 ? "ld-file-tree__list--root" : ""}`,
485
- children: Children3.map(node.props.children, (child, index) => /* @__PURE__ */ jsx8(React4.Fragment, { children: parseNode(child, depth + 1) }, index))
486
- }
487
- );
488
- }
489
- if (isListElement(node, "li")) {
490
- const children = Children3.toArray(node.props.children);
491
- const nestedListIndex = children.findIndex(
492
- (child) => isValidElement2(child) && isListElement(child, "ul")
493
- );
494
- const hasNested = nestedListIndex !== -1;
495
- const labelNodes = hasNested ? children.slice(0, nestedListIndex) : children;
496
- const nestedNodes = hasNested ? children.slice(nestedListIndex) : [];
497
- const rawLabelContent = getTextContent(labelNodes).trim();
498
- const isExplicitDir = rawLabelContent.endsWith("/");
499
- const labelText = isExplicitDir ? rawLabelContent.slice(0, -1) : rawLabelContent;
500
- const isFolder = hasNested || isExplicitDir;
501
- if (isFolder) {
502
- return /* @__PURE__ */ jsx8(
503
- FolderNode,
504
- {
505
- labelText,
506
- nestedNodes,
507
- depth
508
- }
509
- );
510
- }
511
- return /* @__PURE__ */ jsx8("li", { className: "ld-file-tree__item", children: /* @__PURE__ */ jsxs6("div", { className: "ld-file-tree__label ld-file-tree__label--file", children: [
512
- /* @__PURE__ */ jsx8("span", { className: "ld-file-tree__icon ld-file-tree__icon--spacer" }),
513
- /* @__PURE__ */ jsx8("span", { className: "ld-file-tree__icon", children: getFileIcon(labelText) }),
514
- /* @__PURE__ */ jsx8("span", { className: "ld-file-tree__name", children: labelText })
515
- ] }) });
516
- }
517
- if (node.props.children) {
518
- return Children3.map(node.props.children, (child, index) => /* @__PURE__ */ jsx8(React4.Fragment, { children: parseNode(child, depth) }, index));
519
- }
520
- return node;
521
- }
522
- function FileTree({ children }) {
523
- return /* @__PURE__ */ jsx8("div", { className: "ld-file-tree", dir: "ltr", children: Children3.map(children, (child) => parseNode(child, 0)) });
524
- }
525
-
526
- // src/client/theme/components/mdx/Table.tsx
527
- import { useState as useState4, useMemo as useMemo2 } from "react";
528
- import { ChevronUp, ChevronDown, ChevronLeft, ChevronRight as ChevronRight3, ChevronsLeft, ChevronsRight } from "lucide-react";
529
- import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
530
- function Table({
531
- headers,
532
- data,
533
- children,
534
- className = "",
535
- sortable = false,
536
- paginated = false,
537
- pageSize = 10
538
- }) {
539
- const [sortConfig, setSortConfig] = useState4(null);
540
- const [currentPage, setCurrentPage] = useState4(1);
541
- const processedData = useMemo2(() => {
542
- if (!data) return [];
543
- let items = [...data];
544
- if (sortable && sortConfig !== null) {
545
- items.sort((a, b) => {
546
- const aVal = a[sortConfig.key];
547
- const bVal = b[sortConfig.key];
548
- const aStr = typeof aVal === "string" ? aVal : "";
549
- const bStr = typeof bVal === "string" ? bVal : "";
550
- if (aStr < bStr) return sortConfig.direction === "asc" ? -1 : 1;
551
- if (aStr > bStr) return sortConfig.direction === "asc" ? 1 : -1;
552
- return 0;
553
- });
554
- }
555
- return items;
556
- }, [data, sortConfig, sortable]);
557
- const totalPages = Math.ceil(processedData.length / pageSize);
558
- const paginatedData = useMemo2(() => {
559
- if (!paginated) return processedData;
560
- const start = (currentPage - 1) * pageSize;
561
- return processedData.slice(start, start + pageSize);
562
- }, [processedData, paginated, currentPage, pageSize]);
563
- const requestSort = (index) => {
564
- if (!sortable) return;
565
- let direction = "asc";
566
- if (sortConfig && sortConfig.key === index && sortConfig.direction === "asc") {
567
- direction = "desc";
568
- }
569
- setSortConfig({ key: index, direction });
570
- };
571
- const renderSortIcon = (index) => {
572
- if (!sortable) return null;
573
- if (sortConfig?.key !== index) return /* @__PURE__ */ jsx9(ChevronDown, { size: 14, className: "ld-table-sort-icon ld-table-sort-icon--hidden" });
574
- return sortConfig.direction === "asc" ? /* @__PURE__ */ jsx9(ChevronUp, { size: 14, className: "ld-table-sort-icon" }) : /* @__PURE__ */ jsx9(ChevronDown, { size: 14, className: "ld-table-sort-icon" });
575
- };
576
- const tableContent = children ? children : /* @__PURE__ */ jsxs7(Fragment2, { children: [
577
- headers && /* @__PURE__ */ jsx9("thead", { children: /* @__PURE__ */ jsx9("tr", { children: headers.map((header, i) => /* @__PURE__ */ jsx9(
578
- "th",
579
- {
580
- onClick: () => requestSort(i),
581
- className: sortable ? "ld-table-header--sortable" : "",
582
- children: /* @__PURE__ */ jsxs7("div", { className: "ld-table-header-content", children: [
583
- header,
584
- renderSortIcon(i)
585
- ] })
586
- },
587
- i
588
- )) }) }),
589
- paginatedData && /* @__PURE__ */ jsx9("tbody", { children: paginatedData.map((row, i) => /* @__PURE__ */ jsx9("tr", { children: row.map((cell, j) => /* @__PURE__ */ jsx9("td", { children: cell }, j)) }, i)) })
590
- ] });
591
- return /* @__PURE__ */ jsxs7("div", { className: `ld-table-container ${className}`.trim(), children: [
592
- /* @__PURE__ */ jsx9("div", { className: "ld-table-wrapper", children: /* @__PURE__ */ jsx9("table", { className: "ld-table", children: tableContent }) }),
593
- paginated && totalPages > 1 && /* @__PURE__ */ jsxs7("div", { className: "ld-table-pagination", children: [
594
- /* @__PURE__ */ jsxs7("div", { className: "ld-table-pagination-info", children: [
595
- "Page ",
596
- currentPage,
597
- " of ",
598
- totalPages
599
- ] }),
600
- /* @__PURE__ */ jsxs7("div", { className: "ld-table-pagination-controls", children: [
601
- /* @__PURE__ */ jsx9(
602
- "button",
603
- {
604
- onClick: () => setCurrentPage(1),
605
- disabled: currentPage === 1,
606
- className: "ld-table-pagination-btn",
607
- children: /* @__PURE__ */ jsx9(ChevronsLeft, { size: 16 })
608
- }
609
- ),
610
- /* @__PURE__ */ jsx9(
611
- "button",
612
- {
613
- onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)),
614
- disabled: currentPage === 1,
615
- className: "ld-table-pagination-btn",
616
- children: /* @__PURE__ */ jsx9(ChevronLeft, { size: 16 })
617
- }
618
- ),
619
- /* @__PURE__ */ jsx9(
620
- "button",
621
- {
622
- onClick: () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)),
623
- disabled: currentPage === totalPages,
624
- className: "ld-table-pagination-btn",
625
- children: /* @__PURE__ */ jsx9(ChevronRight3, { size: 16 })
626
- }
627
- ),
628
- /* @__PURE__ */ jsx9(
629
- "button",
630
- {
631
- onClick: () => setCurrentPage(totalPages),
632
- disabled: currentPage === totalPages,
633
- className: "ld-table-pagination-btn",
634
- children: /* @__PURE__ */ jsx9(ChevronsRight, { size: 16 })
635
- }
636
- )
637
- ] })
638
- ] })
639
- ] });
640
- }
641
-
642
- // src/client/theme/components/mdx/Field.tsx
643
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
644
- function Field({
645
- name,
646
- type,
647
- defaultValue,
648
- required = false,
649
- children,
650
- id,
651
- className = ""
652
- }) {
653
- return /* @__PURE__ */ jsxs8("div", { className: `ld-field ${className}`.trim(), id, children: [
654
- /* @__PURE__ */ jsxs8("div", { className: "ld-field__header", children: [
655
- /* @__PURE__ */ jsxs8("div", { className: "ld-field__signature", children: [
656
- /* @__PURE__ */ jsx10("code", { className: "ld-field__name", children: name }),
657
- type && /* @__PURE__ */ jsx10("span", { className: "ld-field__type-badge", children: type }),
658
- required && /* @__PURE__ */ jsx10("span", { className: "ld-field__required-badge", children: "required" })
659
- ] }),
660
- defaultValue && /* @__PURE__ */ jsxs8("div", { className: "ld-field__default", children: [
661
- /* @__PURE__ */ jsx10("span", { className: "ld-field__default-label", children: "Default:" }),
662
- /* @__PURE__ */ jsx10("code", { className: "ld-field__default-value", children: defaultValue })
663
- ] })
664
- ] }),
665
- /* @__PURE__ */ jsx10("div", { className: "ld-field__content", children })
666
- ] });
667
- }
668
- export {
669
- Admonition,
670
- Badge,
671
- Breadcrumbs,
672
- Button,
673
- Card,
674
- Cards,
675
- CodeBlock,
676
- Danger,
677
- Field,
678
- FileTree,
679
- Head,
680
- InfoBox,
681
- List,
682
- Loading,
683
- Navbar,
684
- NotFound,
685
- Note,
686
- OnThisPage,
687
- Playground,
688
- Sidebar,
689
- Tab,
690
- Table,
691
- Tabs,
692
- ThemeLayout,
693
- Tip,
694
- Video,
695
- Warning,
696
- createBoltdocsApp
697
- };
1
+ import{a as Ee,b as Oe,c as _,e as st}from"../chunk-QYPNX5UN.mjs";import{a as O,b as pe,c as ue,d as de,e as fe,f as ge,g as he,h as be,i as ve}from"../chunk-IWHRQHS7.mjs";import{A as it,B as U,a as Me,b as De,c as He,d as $e,e as Ae,f as ze,g as Ge,h as _e,i as Fe,j as Ve,k as qe,l as Ue,m as We,n as Je,o as Ye,p as Ze,q as Ke,r as Qe,s as Xe,t as je,u as et,v as tt,w as ot,x as rt,y as nt,z as at}from"../chunk-A4HQPEPU.mjs";import{b as G}from"../chunk-BA5NH5HU.mjs";import{A as ce,F as N,a as v,b as ne,d as E,e as ae,h as d,q as ie,r as se,s as me,t as y,u as x,v as F,w as k,x as le,y as V,z as q}from"../chunk-BQCD3DWG.mjs";import{b as P}from"../chunk-XEAPSFMB.mjs";import"../chunk-JZXLCA2E.mjs";import{jsx as R}from"react/jsx-runtime";function mt({children:e,className:t,style:r}){return R("div",{className:v("h-screen flex flex-col overflow-hidden bg-bg-main text-text-main",t),style:r,children:e})}function lt({children:e,className:t,style:r}){return R("div",{className:v("mx-auto flex flex-1 w-full max-w-(--breakpoint-3xl) bg-bg-main overflow-hidden",t),style:r,children:e})}function ct({children:e,className:t,style:r}){return R("main",{className:v("boltdocs-content flex-1 min-w-0 overflow-y-auto",t),style:r,children:R("div",{className:"boltdocs-page mx-auto max-w-content-max pt-4 pb-20 px-4 sm:px-8",children:e})})}function pt({children:e,className:t,style:r}){return R("div",{className:v("flex items-center justify-between mb-10",t),style:r,children:e})}function ut({children:e,className:t,style:r}){return R("div",{className:v("mt-20",t),style:r,children:e})}var C=Object.assign(mt,{Body:lt,Content:ct,ContentHeader:pt,ContentFooter:ut});import{Suspense as Lt,lazy as Tt}from"react";import{useEffect as dt,useState as ft}from"react";import{Sun as gt,Moon as ht}from"lucide-react";import{ToggleButton as bt}from"react-aria-components";import{jsx as A}from"react/jsx-runtime";function xe(){let{theme:e,toggleTheme:t}=G(),[r,o]=ft(!1);return dt(()=>{o(!0)},[]),r?A(bt,{onChange:t,className:"flex h-9 w-9 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-bg-surface hover:text-text-main","aria-label":"Toggle theme",isSelected:e==="dark",children:e==="dark"?A(gt,{size:20,className:"animate-in fade-in zoom-in duration-300"}):A(ht,{size:20,className:"animate-in fade-in zoom-in duration-300"})}):A("div",{className:"h-9 w-9"})}import{useEffect as Pt,useState as yt}from"react";var vt="https://api.github.com";async function Pe(e,t,r=vt){let o=new Headers;t&&o.append("authorization",t);let n=await(await fetch(`${r}/repos/${e}`,{headers:o})).json();return n.stargazers_count!==void 0?xt(n.stargazers_count):"0"}var xt=e=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short"}).format(e);import{jsx as ye,jsxs as Nt}from"react/jsx-runtime";function Ne({repo:e}){let[t,r]=yt(null);return Pt(()=>{e&&Pe(e).then(o=>r(o)).catch(()=>r("0"))},[e]),Nt("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-muted transition-all hover:bg-bg-main hover:border-border-strong hover:text-text-main",children:[ye(ae,{className:"h-4 w-4"}),t&&ye("span",{className:"tabular-nums",children:t})]})}import*as Ct from"lucide-react";import{jsx as B,jsxs as Ce}from"react/jsx-runtime";function Le({tabs:e,routes:t}){let{indicatorStyle:r,tabRefs:o,activeIndex:i}=fe(e,t),n=a=>{if(!a)return null;if(a.trim().startsWith("<svg"))return B("span",{className:"h-4 w-4",dangerouslySetInnerHTML:{__html:a}});let m=Ct[a];return m?B(m,{size:16}):B("img",{src:a,alt:"",className:"h-4 w-4 object-contain"})};return B("div",{className:"mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6",children:Ce(F.TabsList,{className:"border-none py-0",children:[e.map((a,m)=>{let l=m===i,h=t.find(g=>g.tab&&g.tab.toLowerCase()===a.id.toLowerCase()),c=h?h.path:"#";return Ce(ne,{href:c,ref:g=>{o.current[m]=g},className:`relative flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors outline-none ${l?"text-primary-500":"text-text-muted hover:text-text-main"}`,children:[n(a.icon),B("span",{children:a.text})]},a.id)}),B(F.TabsIndicator,{style:r})]})})}import{useLocation as St}from"react-router-dom";import{ChevronDown as Te}from"lucide-react";import{jsx as s,jsxs as I}from"react/jsx-runtime";var wt=Tt(()=>import("../search-dialog-EB3N4TYM.mjs").then(e=>({default:e.SearchDialog})));function W(){let{links:e,title:t,logo:r,logoProps:o,github:i,social:n,config:a}=pe(),{routes:m,allRoutes:l,currentVersion:h,currentLocale:c}=O(),{pathname:g}=St(),{themeConfig:w}=P(),oe=w?.tabs&&w.tabs.length>0;return I(d.NavbarRoot,{className:oe?"border-b-0":"",children:[I(d.Content,{children:[I(d.NavbarLeft,{children:[s(d.NavbarLogo,{src:r??"",alt:o?.alt||t,width:o?.width??24,height:o?.height??24}),s(d.Title,{children:t}),a.versions&&h&&s(kt,{}),s(d.Links,{children:e.map($=>s(d.Link,{...$},$.href))})]}),s(d.NavbarCenter,{children:s(Lt,{fallback:s("div",{className:"h-9 w-32 animate-pulse rounded-md bg-bg-surface"}),children:s(wt,{routes:m||[]})})}),I(d.NavbarRight,{children:[a.i18n&&c&&s(Rt,{}),s(d.Split,{}),s(xe,{}),i&&s(Ne,{repo:w?.githubRepo??""}),n.length>0&&s(d.Split,{}),s("div",{className:"flex items-center gap-1",children:n.map(({icon:$,link:re})=>s(d.Socials,{icon:$,link:re,className:"p-1.5"},re))})]})]}),g!=="/"&&oe&&a.themeConfig?.tabs&&s("div",{className:"w-full border-b border-border-subtle bg-bg-main",children:s(Le,{tabs:a.themeConfig.tabs,routes:l||m||[]})})]})}function kt(){let{currentVersionLabel:e,availableVersions:t,handleVersionChange:r}=ue();return t.length===0?null:I(N.Trigger,{children:[s(E,{variant:"outline",iconPosition:"right",icon:s(Te,{}),children:e}),s(N.Section,{items:t,children:o=>s(N.Item,{onPress:()=>r(o.value),children:o.label},`${o.value??""}`)})]})}function Rt(){let{currentLocaleLabel:e,availableLocales:t,handleLocaleChange:r}=de();return t.length===0?null:I(N.Trigger,{children:[s(E,{variant:"outline",iconPosition:"right",icon:s(Te,{}),children:e}),s(N.Section,{items:t,children:o=>s(N.Item,{onPress:()=>r(o.value),children:o.label},`${o.value??""}`)})]})}import{useState as It,useEffect as Et,useMemo as Ot}from"react";import{Zap as Bt}from"lucide-react";import{jsx as J,jsxs as Se}from"react/jsx-runtime";function we(){return J("div",{className:"rounded-full px-4 py-2 bg-gray-100 text-xs text-gray-500 flex items-center gap-1 mt-6 justify-center",children:Se("a",{href:"https://github.com/jesusalcaladev/boltdocs",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1",children:[J(Bt,{className:"powered-by-icon",size:12,fill:"currentColor"}),Se("span",{children:["Powered by ",J("strong",{children:"Boltdocs"})]})]})})}import*as Mt from"lucide-react";import{jsx as L,jsxs as Ht}from"react/jsx-runtime";function ke(e){return e&&Mt[e]||void 0}function Dt({group:e,activePath:t,getIcon:r}){let o=Ot(()=>e.routes.some(a=>a.path===t),[e.routes,t]),[i,n]=It(!0);return Et(()=>{o&&n(!0)},[o]),L(k.SidebarGroup,{title:e.title,isOpen:i,onToggle:()=>n(!i),children:e.routes.map(a=>L(k.SidebarLink,{label:a.title,href:a.path,active:t===a.path,icon:r(a.icon),badge:a.badge},a.path))})}function Y({routes:e,config:t}){let{groups:r,ungrouped:o,activePath:i}=ge(e);return Ht(k.SidebarRoot,{children:[o.length>0&&L(k.SidebarGroup,{className:"mb-6",children:o.map(n=>L(k.SidebarLink,{label:n.title,href:n.path,active:i===n.path,icon:ke(n.icon),badge:n.badge},n.path))}),r.map(n=>L(Dt,{group:n,activePath:i,getIcon:ke},n.slug)),t.themeConfig?.poweredBy&&L("div",{className:"mt-auto pt-8",children:L(we,{})})]})}import $t,{useRef as Re,useEffect as At,useState as zt,useCallback as Gt}from"react";import{Pencil as _t,CircleHelp as Ft,TextAlignStart as Vt}from"lucide-react";import{jsx as f,jsxs as T}from"react/jsx-runtime";function Z({headings:e=[],editLink:t,communityHelp:r,filePath:o}){let{headings:i}=he(e),n=$t.useMemo(()=>i.map(a=>({title:a.text,url:`#${a.id}`,depth:a.level})),[i]);return i.length===0?null:f(me,{toc:n,children:f(qt,{headings:i,editLink:t,communityHelp:r,filePath:o})})}function qt({headings:e,editLink:t,communityHelp:r,filePath:o}){let i=ie(),[n,a]=zt({opacity:0}),m=Re(null),l=Re(null);At(()=>{if(!i||!m.current)return;let c=m.current.querySelector(`a[href="#${i}"]`);c&&a({transform:`translateY(${c.offsetTop}px)`,height:`${c.offsetHeight}px`,opacity:1})},[i]);let h=Gt((c,g)=>{c.preventDefault();let w=document.getElementById(g);w&&(w.scrollIntoView({behavior:"smooth"}),window.history.pushState(null,"",`#${g}`))},[]);return T(y.OnThisPageRoot,{children:[T(y.OnThisPageHeader,{className:"flex flex-row gap-x-2",children:[f(Vt,{size:16}),"On this page"]}),f(se,{containerRef:l,children:T(y.OnThisPageContent,{className:"max-h-[450px] boltdocs-otp-scroll-area",ref:l,children:[f(y.OnThisPageIndicator,{style:n}),f("ul",{className:"relative space-y-2 border-l border-border-subtle",ref:m,children:e.map(c=>f(y.OnThisPageItem,{level:c.level,children:f(y.OnThisPageLink,{href:`#${c.id}`,active:i===c.id,onClick:g=>h(g,c.id),className:"pl-4",children:c.text})},c.id))})]})}),(t||r)&&T("div",{className:"mt-8 pt-8 border-t border-border-subtle space-y-4",children:[f("p",{className:"text-xs font-bold uppercase tracking-wider text-text-main",children:"Need help?"}),T("ul",{className:"space-y-3",children:[t&&o&&f("li",{children:T("a",{href:t.replace(":path",o),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors",children:[f(_t,{size:16}),"Edit this page"]})}),r&&f("li",{children:T("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors",children:[f(Ft,{size:16}),"Community help"]})})]})]})]})}import{useEffect as Ut}from"react";import{useLocation as Wt}from"react-router-dom";function K({siteTitle:e,siteDescription:t,routes:r}){let o=Wt();return Ut(()=>{let i=r.find(h=>h.path===o.pathname),n=i?.title,a=i?.description||t||"";document.title=n?`${n} | ${e}`:e;let m=document.querySelector('meta[name="description"]');m||(m=document.createElement("meta"),m.name="description",document.head.appendChild(m)),m.content=a,S("property","og:title",document.title),S("property","og:description",a),S("property","og:type","article"),S("property","og:url",window.location.href),S("name","twitter:card","summary"),S("name","twitter:title",document.title),S("name","twitter:description",a);let l=document.querySelector('link[rel="canonical"]');l||(l=document.createElement("link"),l.rel="canonical",document.head.appendChild(l)),l.href=window.location.origin+o.pathname},[o.pathname,e,t,r]),null}function S(e,t,r){let o=document.querySelector(`meta[${e}="${t}"]`);o||(o=document.createElement("meta"),o.setAttribute(e,t),document.head.appendChild(o)),o.content=r}import{Home as Jt}from"lucide-react";import{jsx as M,jsxs as Be}from"react/jsx-runtime";function Q(){let{crumbs:e,activeRoute:t}=be(),r=P();return e.length===0||!r.themeConfig?.breadcrumbs?null:Be(le,{children:[M(V,{children:M(q,{href:"/",children:M(Jt,{size:14})})}),e.map((o,i)=>Be(V,{children:[M(ce,{}),M(q,{href:o.href,className:v({"font-medium text-text-main":o.href===t?.path}),children:o.label})]},`crumb-${o.href}-${o.label}-${i}`))]})}import{jsx as D,jsxs as X}from"react/jsx-runtime";function j(){let{prevPage:e,nextPage:t}=ve();return!e&&!t?null:X(x.PageNavRoot,{children:[e?X(x.PageNavLink,{to:e.path,direction:"prev",children:[D(x.PageNavLink.Title,{children:"Previous"}),D(x.PageNavLink.Description,{children:e.title})]}):D("div",{}),t&&X(x.PageNavLink,{to:t.path,direction:"next",children:[D(x.PageNavLink.Title,{children:"Next"}),D(x.PageNavLink.Description,{children:t.title})]})]})}import{useEffect as Yt,useState as Zt}from"react";import{ProgressBar as Kt}from"react-aria-components";import{jsx as Ie}from"react/jsx-runtime";function ee(){let[e,t]=Zt(0);return Yt(()=>{let r=null,o,i=()=>{if(!r)return;let{scrollTop:a,scrollHeight:m,clientHeight:l}=r;if(m<=l){t(0);return}let h=a/(m-l)*100;t(Math.min(100,Math.max(0,h)))},n=()=>(r=document.querySelector(".boltdocs-content"),r?(r.addEventListener("scroll",i),i(),o&&clearInterval(o),!0):!1);return n()||(o=setInterval(n,100)),()=>{r&&r.removeEventListener("scroll",i),o&&clearInterval(o)}},[]),Ie(Kt,{value:e,"aria-label":"Reading progress",className:"fixed top-0 left-0 right-0 z-999 h-0.5 bg-transparent w-full pointer-events-none",children:({percentage:r})=>Ie("div",{className:"h-full bg-primary-500 transition-[width] duration-300 ease-out shadow-[0_0_8px_rgba(var(--primary-rgb),0.4)]",style:{width:`${r}%`}})})}import{Component as Qt}from"react";import{jsx as te,jsxs as Xt}from"react/jsx-runtime";var H=class extends Qt{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("Uncaught error in Boltdocs Layout:",t,r)}render(){return this.state.hasError?this.props.fallback||Xt("div",{className:"flex flex-col items-center justify-center min-h-[40vh] text-center gap-4 px-4",children:[te("div",{className:"text-lg font-bold text-red-400",children:"Something went wrong"}),te("p",{className:"text-sm text-text-muted max-w-md",children:this.state.error?.message||"An unexpected error occurred while rendering this page."}),te(E,{className:"rounded-lg border border-border-subtle bg-bg-surface px-5 py-2 text-sm font-medium text-text-main transition-colors hover:bg-bg-muted cursor-pointer",onPress:()=>this.setState({hasError:!1}),children:"Try again"})]}):this.props.children}};import{useLocation as jt}from"react-router-dom";import{jsx as b,jsxs as z}from"react/jsx-runtime";function eo({children:e}){let{routes:t,allRoutes:r,currentRoute:o}=O(),{pathname:i}=jt(),n=P(),m=_().CopyMarkdown||U,l=i==="/"||i==="";return z(C,{children:[b(ee,{}),b(K,{siteTitle:n.themeConfig?.title||"Boltdocs",siteDescription:n.themeConfig?.description||"",routes:r}),b(W,{}),z(C.Body,{children:[!l&&b(Y,{routes:t,config:n}),z(C.Content,{children:[!l&&z(C.ContentHeader,{children:[b(Q,{}),b(m,{mdxRaw:o?._rawContent,route:o,config:n.themeConfig?.copyMarkdown})]}),b(H,{children:e}),!l&&b(C.ContentFooter,{children:b(j,{})})]}),!l&&b(Z,{headings:o?.headings,editLink:n.themeConfig?.editLink,communityHelp:n.themeConfig?.communityHelp,filePath:o?.filePath})]})]})}export{Ue as Admonition,Fe as Badge,Q as Breadcrumbs,Me as Button,qe as Card,Ve as Cards,Xe as Caution,Ae as CodeBlock,it as ComponentPreview,at as ComponentProps,U as CopyMarkdown,Ze as Danger,eo as DefaultLayout,C as DocsLayout,H as ErrorBoundary,ot as Field,et as FileTree,K as Head,nt as Image,Qe as Important,Ke as InfoBox,rt as Link,je as List,Oe as Loading,W as Navbar,Ee as NotFound,We as Note,Z as OnThisPage,j as PageNav,ee as ProgressBar,Y as Sidebar,ze as Tab,tt as Table,Ge as Tabs,Je as Tip,_e as Video,Ye as Warning,st as createBoltdocsApp,De as defineSandbox,$e as embedSandbox,He as openSandbox,P as useConfig,_ as useMdxComponents,O as useRoutes,G as useTheme};