boltdocs 1.0.1 → 1.3.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/dist/{CodeBlock-37XMKCYY.mjs → CodeBlock-V3Z5EKGR.mjs} +0 -1
- package/dist/{PackageManagerTabs-4NWXLXQO.mjs → PackageManagerTabs-XEKI3L7P.mjs} +0 -2
- package/dist/{SearchDialog-FTOQZ763.mjs → SearchDialog-5EDRACEG.mjs} +1 -2
- package/dist/{SearchDialog-ZAZXYIFX.css → SearchDialog-X57WPTNN.css} +57 -129
- package/dist/{Video-I6QY4X7J.mjs → Video-KNTY5BNO.mjs} +0 -1
- package/dist/cache-EHR7SXRU.mjs +12 -0
- package/dist/chunk-GSYECEZY.mjs +381 -0
- package/dist/{chunk-ZFCOLEXN.mjs → chunk-NS7WHDYA.mjs} +234 -426
- package/dist/client/index.css +57 -129
- package/dist/client/index.d.mts +39 -8
- package/dist/client/index.d.ts +39 -8
- package/dist/client/index.js +557 -564
- package/dist/client/index.mjs +305 -18
- package/dist/client/ssr.css +57 -129
- package/dist/client/ssr.d.mts +1 -1
- package/dist/client/ssr.d.ts +1 -1
- package/dist/client/ssr.js +257 -558
- package/dist/client/ssr.mjs +1 -2
- package/dist/{config-D2XmHJYe.d.mts → config-BD5ZHz15.d.mts} +7 -0
- package/dist/{config-D2XmHJYe.d.ts → config-BD5ZHz15.d.ts} +7 -0
- package/dist/node/index.d.mts +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +457 -118
- package/dist/node/index.mjs +144 -147
- package/dist/{index-CRQKWAeo.d.mts → types-CvrzTbEX.d.mts} +1 -28
- package/dist/{index-CRQKWAeo.d.ts → types-CvrzTbEX.d.ts} +1 -28
- package/package.json +2 -2
- package/src/client/app/index.tsx +32 -110
- package/src/client/app/preload.tsx +1 -1
- package/src/client/index.ts +1 -1
- package/src/client/ssr.tsx +2 -1
- package/src/client/theme/components/Playground/Playground.tsx +40 -2
- package/src/client/theme/components/mdx/mdx-components.css +39 -20
- package/src/client/theme/styles/markdown.css +4 -4
- package/src/client/theme/styles.css +0 -1
- package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +1 -1
- package/src/client/theme/ui/Layout/Layout.tsx +3 -14
- package/src/client/theme/ui/Layout/responsive.css +0 -4
- package/src/client/theme/ui/Link/Link.tsx +52 -0
- package/src/client/theme/ui/Navbar/Navbar.tsx +1 -1
- package/src/client/theme/ui/NotFound/NotFound.tsx +0 -1
- package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +45 -2
- package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +1 -1
- package/src/client/theme/ui/Sidebar/Sidebar.tsx +44 -40
- package/src/client/theme/ui/Sidebar/sidebar.css +25 -58
- package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +1 -1
- package/src/client/types.ts +50 -0
- package/src/node/cache.ts +360 -46
- package/src/node/config.ts +7 -0
- package/src/node/mdx.ts +83 -4
- package/src/node/plugin/index.ts +3 -0
- package/src/node/routes/cache.ts +5 -1
- package/src/node/routes/index.ts +17 -2
- package/src/node/ssg/index.ts +4 -0
- package/dist/Playground-OE2OE6B6.mjs +0 -7
- package/dist/chunk-PN4GCTYG.mjs +0 -67
- package/dist/chunk-X2TDGMTR.mjs +0 -64
- package/dist/chunk-X6BYQHVC.mjs +0 -12
- package/dist/node/cli/index.d.mts +0 -1
- package/dist/node/cli/index.d.ts +0 -1
- package/dist/node/cli/index.js +0 -199
- package/dist/node/cli/index.mjs +0 -154
- package/src/client/theme/styles/home.css +0 -60
package/dist/client/ssr.js
CHANGED
|
@@ -144,11 +144,13 @@ var init_Link = __esm({
|
|
|
144
144
|
boltdocsPrefetch = "hover",
|
|
145
145
|
onMouseEnter,
|
|
146
146
|
onFocus,
|
|
147
|
+
onClick,
|
|
147
148
|
to,
|
|
148
149
|
...rest
|
|
149
150
|
} = props;
|
|
150
151
|
const localizedTo = useLocalizedTo(to);
|
|
151
152
|
const { preload } = usePreload();
|
|
153
|
+
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
152
154
|
const handleMouseEnter = (e) => {
|
|
153
155
|
onMouseEnter?.(e);
|
|
154
156
|
if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
@@ -161,6 +163,18 @@ var init_Link = __esm({
|
|
|
161
163
|
preload(localizedTo);
|
|
162
164
|
}
|
|
163
165
|
};
|
|
166
|
+
const handleClick = (e) => {
|
|
167
|
+
onClick?.(e);
|
|
168
|
+
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (typeof localizedTo === "string" && !localizedTo.startsWith("http")) {
|
|
172
|
+
e.preventDefault();
|
|
173
|
+
import_react2.default.startTransition(() => {
|
|
174
|
+
navigate(localizedTo);
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
};
|
|
164
178
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
165
179
|
import_react_router_dom.Link,
|
|
166
180
|
{
|
|
@@ -168,6 +182,7 @@ var init_Link = __esm({
|
|
|
168
182
|
to: localizedTo,
|
|
169
183
|
onMouseEnter: handleMouseEnter,
|
|
170
184
|
onFocus: handleFocus,
|
|
185
|
+
onClick: handleClick,
|
|
171
186
|
...rest
|
|
172
187
|
}
|
|
173
188
|
);
|
|
@@ -180,11 +195,13 @@ var init_Link = __esm({
|
|
|
180
195
|
boltdocsPrefetch = "hover",
|
|
181
196
|
onMouseEnter,
|
|
182
197
|
onFocus,
|
|
198
|
+
onClick,
|
|
183
199
|
to,
|
|
184
200
|
...rest
|
|
185
201
|
} = props;
|
|
186
202
|
const localizedTo = useLocalizedTo(to);
|
|
187
203
|
const { preload } = usePreload();
|
|
204
|
+
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
188
205
|
const handleMouseEnter = (e) => {
|
|
189
206
|
onMouseEnter?.(e);
|
|
190
207
|
if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
@@ -197,6 +214,18 @@ var init_Link = __esm({
|
|
|
197
214
|
preload(localizedTo);
|
|
198
215
|
}
|
|
199
216
|
};
|
|
217
|
+
const handleClick = (e) => {
|
|
218
|
+
onClick?.(e);
|
|
219
|
+
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if (typeof localizedTo === "string" && !localizedTo.startsWith("http")) {
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
import_react2.default.startTransition(() => {
|
|
225
|
+
navigate(localizedTo);
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
};
|
|
200
229
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
201
230
|
import_react_router_dom.NavLink,
|
|
202
231
|
{
|
|
@@ -204,6 +233,7 @@ var init_Link = __esm({
|
|
|
204
233
|
to: localizedTo,
|
|
205
234
|
onMouseEnter: handleMouseEnter,
|
|
206
235
|
onFocus: handleFocus,
|
|
236
|
+
onClick: handleClick,
|
|
207
237
|
...rest
|
|
208
238
|
}
|
|
209
239
|
);
|
|
@@ -1013,7 +1043,8 @@ function renderBadge(badgeRaw) {
|
|
|
1013
1043
|
function Sidebar({
|
|
1014
1044
|
routes,
|
|
1015
1045
|
config,
|
|
1016
|
-
|
|
1046
|
+
isCollapsed,
|
|
1047
|
+
onToggle
|
|
1017
1048
|
}) {
|
|
1018
1049
|
const location = (0, import_react_router_dom4.useLocation)();
|
|
1019
1050
|
const ungrouped = [];
|
|
@@ -1034,42 +1065,41 @@ function Sidebar({
|
|
|
1034
1065
|
}
|
|
1035
1066
|
const groups = Array.from(groupMap.values());
|
|
1036
1067
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("aside", { className: "boltdocs-sidebar", children: [
|
|
1037
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.
|
|
1038
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "sidebar-list", children: ungrouped.map((route) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1039
|
-
Link,
|
|
1040
|
-
{
|
|
1041
|
-
to: route.path === "" ? "/" : route.path,
|
|
1042
|
-
className: `sidebar-link ${location.pathname === route.path ? "active" : ""}`,
|
|
1043
|
-
"aria-current": location.pathname === route.path ? "page" : void 0,
|
|
1044
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "sidebar-link-content", children: [
|
|
1045
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: route.title }),
|
|
1046
|
-
renderBadge(route.badge)
|
|
1047
|
-
] })
|
|
1048
|
-
}
|
|
1049
|
-
) }, route.path)) }),
|
|
1050
|
-
groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1051
|
-
SidebarGroupSection,
|
|
1052
|
-
{
|
|
1053
|
-
group,
|
|
1054
|
-
currentPath: location.pathname
|
|
1055
|
-
},
|
|
1056
|
-
group.slug
|
|
1057
|
-
))
|
|
1058
|
-
] }),
|
|
1059
|
-
onCollapse && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "sidebar-footer", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1068
|
+
onToggle && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "sidebar-collapse", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1060
1069
|
"button",
|
|
1061
1070
|
{
|
|
1062
1071
|
className: "sidebar-collapse-btn",
|
|
1063
|
-
onClick:
|
|
1064
|
-
"aria-label": "Collapse Sidebar",
|
|
1065
|
-
title: "Collapse Sidebar",
|
|
1066
|
-
children:
|
|
1067
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.ChevronLeft, { size: 16 }),
|
|
1068
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Collapse Sidebar" })
|
|
1069
|
-
]
|
|
1072
|
+
onClick: onToggle,
|
|
1073
|
+
"aria-label": isCollapsed ? "Expand Sidebar" : "Collapse Sidebar",
|
|
1074
|
+
title: isCollapsed ? "Expand Sidebar" : "Collapse Sidebar",
|
|
1075
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.PanelLeft, { size: 18 })
|
|
1070
1076
|
}
|
|
1071
1077
|
) }),
|
|
1072
|
-
|
|
1078
|
+
!isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1079
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("nav", { "aria-label": "Main Navigation", children: [
|
|
1080
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "sidebar-list", children: ungrouped.map((route) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1081
|
+
Link,
|
|
1082
|
+
{
|
|
1083
|
+
to: route.path === "" ? "/" : route.path,
|
|
1084
|
+
className: `sidebar-link ${location.pathname === route.path ? "active" : ""}`,
|
|
1085
|
+
"aria-current": location.pathname === route.path ? "page" : void 0,
|
|
1086
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "sidebar-link-content", children: [
|
|
1087
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: route.title }),
|
|
1088
|
+
renderBadge(route.badge)
|
|
1089
|
+
] })
|
|
1090
|
+
}
|
|
1091
|
+
) }, route.path)) }),
|
|
1092
|
+
groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1093
|
+
SidebarGroupSection,
|
|
1094
|
+
{
|
|
1095
|
+
group,
|
|
1096
|
+
currentPath: location.pathname
|
|
1097
|
+
},
|
|
1098
|
+
group.slug
|
|
1099
|
+
))
|
|
1100
|
+
] }),
|
|
1101
|
+
config.themeConfig?.poweredBy !== false && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PoweredBy, {})
|
|
1102
|
+
] })
|
|
1073
1103
|
] });
|
|
1074
1104
|
}
|
|
1075
1105
|
function SidebarGroupSection({
|
|
@@ -1191,11 +1221,41 @@ function OnThisPage({
|
|
|
1191
1221
|
};
|
|
1192
1222
|
observeHeadings();
|
|
1193
1223
|
const timeoutId = setTimeout(observeHeadings, 1e3);
|
|
1224
|
+
const handleScroll = () => {
|
|
1225
|
+
const scrollPosition = window.innerHeight + window.pageYOffset;
|
|
1226
|
+
const bodyHeight = document.documentElement.scrollHeight;
|
|
1227
|
+
if (scrollPosition >= bodyHeight - 50) {
|
|
1228
|
+
setActiveId(headings[headings.length - 1].id);
|
|
1229
|
+
}
|
|
1230
|
+
};
|
|
1231
|
+
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
1194
1232
|
return () => {
|
|
1195
1233
|
observerRef.current?.disconnect();
|
|
1196
1234
|
clearTimeout(timeoutId);
|
|
1235
|
+
window.removeEventListener("scroll", handleScroll);
|
|
1197
1236
|
};
|
|
1198
1237
|
}, [headings, location.pathname]);
|
|
1238
|
+
(0, import_react10.useEffect)(() => {
|
|
1239
|
+
if (!activeId || !listRef.current) return;
|
|
1240
|
+
const activeLink = listRef.current.querySelector(
|
|
1241
|
+
`a[href="#${activeId}"]`
|
|
1242
|
+
);
|
|
1243
|
+
if (activeLink) {
|
|
1244
|
+
const container = listRef.current.closest(
|
|
1245
|
+
".boltdocs-on-this-page"
|
|
1246
|
+
);
|
|
1247
|
+
if (!container) return;
|
|
1248
|
+
const linkRect = activeLink.getBoundingClientRect();
|
|
1249
|
+
const containerRect = container.getBoundingClientRect();
|
|
1250
|
+
const isVisible = linkRect.top >= containerRect.top && linkRect.bottom <= containerRect.bottom;
|
|
1251
|
+
if (!isVisible) {
|
|
1252
|
+
activeLink.scrollIntoView({
|
|
1253
|
+
behavior: "smooth",
|
|
1254
|
+
block: "nearest"
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
}, [activeId]);
|
|
1199
1259
|
const handleClick = (0, import_react10.useCallback)(
|
|
1200
1260
|
(e, id) => {
|
|
1201
1261
|
e.preventDefault();
|
|
@@ -1489,17 +1549,8 @@ function ThemeLayout({
|
|
|
1489
1549
|
{
|
|
1490
1550
|
routes: filteredRoutes,
|
|
1491
1551
|
config,
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
),
|
|
1495
|
-
sidebar === void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1496
|
-
"button",
|
|
1497
|
-
{
|
|
1498
|
-
className: "sidebar-toggle-floating",
|
|
1499
|
-
onClick: () => setIsSidebarOpen(true),
|
|
1500
|
-
"aria-label": "Expand Sidebar",
|
|
1501
|
-
title: "Expand Sidebar",
|
|
1502
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react10.Menu, { size: 20 })
|
|
1552
|
+
isCollapsed: !isSidebarOpen,
|
|
1553
|
+
onToggle: () => setIsSidebarOpen(!isSidebarOpen)
|
|
1503
1554
|
}
|
|
1504
1555
|
),
|
|
1505
1556
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("main", { className: "boltdocs-content", children: [
|
|
@@ -1637,273 +1688,12 @@ var init_Loading2 = __esm({
|
|
|
1637
1688
|
}
|
|
1638
1689
|
});
|
|
1639
1690
|
|
|
1640
|
-
// src/client/theme/components/mdx/Button.tsx
|
|
1641
|
-
function Button({
|
|
1642
|
-
variant = "primary",
|
|
1643
|
-
size = "md",
|
|
1644
|
-
href,
|
|
1645
|
-
children,
|
|
1646
|
-
className = "",
|
|
1647
|
-
...rest
|
|
1648
|
-
}) {
|
|
1649
|
-
const cls = `ld-btn ld-btn--${variant} ld-btn--${size} ${className}`.trim();
|
|
1650
|
-
if (href) {
|
|
1651
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1652
|
-
"a",
|
|
1653
|
-
{
|
|
1654
|
-
href,
|
|
1655
|
-
style: { textDecoration: "none" },
|
|
1656
|
-
className: cls,
|
|
1657
|
-
...rest,
|
|
1658
|
-
children
|
|
1659
|
-
}
|
|
1660
|
-
);
|
|
1661
|
-
}
|
|
1662
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { className: cls, ...rest, children });
|
|
1663
|
-
}
|
|
1664
|
-
var import_jsx_runtime20;
|
|
1665
|
-
var init_Button = __esm({
|
|
1666
|
-
"src/client/theme/components/mdx/Button.tsx"() {
|
|
1667
|
-
"use strict";
|
|
1668
|
-
import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1669
|
-
}
|
|
1670
|
-
});
|
|
1671
|
-
|
|
1672
|
-
// src/client/theme/components/mdx/Badge.tsx
|
|
1673
|
-
function Badge({
|
|
1674
|
-
variant = "default",
|
|
1675
|
-
children,
|
|
1676
|
-
className = "",
|
|
1677
|
-
...rest
|
|
1678
|
-
}) {
|
|
1679
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1680
|
-
"span",
|
|
1681
|
-
{
|
|
1682
|
-
className: `ld-badge ld-badge--${variant} ${className}`.trim(),
|
|
1683
|
-
...rest,
|
|
1684
|
-
children
|
|
1685
|
-
}
|
|
1686
|
-
);
|
|
1687
|
-
}
|
|
1688
|
-
var import_jsx_runtime21;
|
|
1689
|
-
var init_Badge = __esm({
|
|
1690
|
-
"src/client/theme/components/mdx/Badge.tsx"() {
|
|
1691
|
-
"use strict";
|
|
1692
|
-
import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1693
|
-
}
|
|
1694
|
-
});
|
|
1695
|
-
|
|
1696
|
-
// src/client/theme/components/mdx/Card.tsx
|
|
1697
|
-
function Cards({
|
|
1698
|
-
cols = 3,
|
|
1699
|
-
children,
|
|
1700
|
-
className = "",
|
|
1701
|
-
...rest
|
|
1702
|
-
}) {
|
|
1703
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `ld-cards ld-cards--${cols} ${className}`.trim(), ...rest, children });
|
|
1704
|
-
}
|
|
1705
|
-
function Card({
|
|
1706
|
-
title,
|
|
1707
|
-
icon,
|
|
1708
|
-
href,
|
|
1709
|
-
children,
|
|
1710
|
-
className = "",
|
|
1711
|
-
...rest
|
|
1712
|
-
}) {
|
|
1713
|
-
const inner = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
1714
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "ld-card__icon", children: icon }),
|
|
1715
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "ld-card__title", children: title }),
|
|
1716
|
-
children && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "ld-card__body", children })
|
|
1717
|
-
] });
|
|
1718
|
-
if (href) {
|
|
1719
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1720
|
-
"a",
|
|
1721
|
-
{
|
|
1722
|
-
href,
|
|
1723
|
-
className: `ld-card ld-card--link ${className}`.trim(),
|
|
1724
|
-
...rest,
|
|
1725
|
-
children: inner
|
|
1726
|
-
}
|
|
1727
|
-
);
|
|
1728
|
-
}
|
|
1729
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `ld-card ${className}`.trim(), ...rest, children: inner });
|
|
1730
|
-
}
|
|
1731
|
-
var import_jsx_runtime22;
|
|
1732
|
-
var init_Card = __esm({
|
|
1733
|
-
"src/client/theme/components/mdx/Card.tsx"() {
|
|
1734
|
-
"use strict";
|
|
1735
|
-
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1736
|
-
}
|
|
1737
|
-
});
|
|
1738
|
-
|
|
1739
|
-
// src/client/theme/components/mdx/Tabs.tsx
|
|
1740
|
-
function Tab({ children }) {
|
|
1741
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "ld-tab-panel", children });
|
|
1742
|
-
}
|
|
1743
|
-
function Tabs({ defaultIndex = 0, children }) {
|
|
1744
|
-
const [active, setActive] = (0, import_react13.useState)(defaultIndex);
|
|
1745
|
-
const tabRefs = (0, import_react13.useRef)([]);
|
|
1746
|
-
const tabs = import_react13.Children.toArray(children).filter(
|
|
1747
|
-
(child) => (0, import_react13.isValidElement)(child) && child.props?.label
|
|
1748
|
-
);
|
|
1749
|
-
const handleKeyDown = (e) => {
|
|
1750
|
-
let newIndex = active;
|
|
1751
|
-
if (e.key === "ArrowRight") {
|
|
1752
|
-
newIndex = (active + 1) % tabs.length;
|
|
1753
|
-
} else if (e.key === "ArrowLeft") {
|
|
1754
|
-
newIndex = (active - 1 + tabs.length) % tabs.length;
|
|
1755
|
-
}
|
|
1756
|
-
if (newIndex !== active) {
|
|
1757
|
-
setActive(newIndex);
|
|
1758
|
-
tabRefs.current[newIndex]?.focus();
|
|
1759
|
-
}
|
|
1760
|
-
};
|
|
1761
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "ld-tabs", children: [
|
|
1762
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "ld-tabs__bar", role: "tablist", onKeyDown: handleKeyDown, children: tabs.map((child, i) => {
|
|
1763
|
-
const label = child.props.label;
|
|
1764
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1765
|
-
"button",
|
|
1766
|
-
{
|
|
1767
|
-
role: "tab",
|
|
1768
|
-
"aria-selected": i === active,
|
|
1769
|
-
"aria-controls": `tabpanel-${i}`,
|
|
1770
|
-
id: `tab-${i}`,
|
|
1771
|
-
tabIndex: i === active ? 0 : -1,
|
|
1772
|
-
ref: (el) => {
|
|
1773
|
-
tabRefs.current[i] = el;
|
|
1774
|
-
},
|
|
1775
|
-
className: `ld-tabs__trigger ${i === active ? "ld-tabs__trigger--active" : ""}`,
|
|
1776
|
-
onClick: () => setActive(i),
|
|
1777
|
-
children: label
|
|
1778
|
-
},
|
|
1779
|
-
i
|
|
1780
|
-
);
|
|
1781
|
-
}) }),
|
|
1782
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1783
|
-
"div",
|
|
1784
|
-
{
|
|
1785
|
-
className: "ld-tabs__content",
|
|
1786
|
-
role: "tabpanel",
|
|
1787
|
-
id: `tabpanel-${active}`,
|
|
1788
|
-
"aria-labelledby": `tab-${active}`,
|
|
1789
|
-
children: tabs[active]
|
|
1790
|
-
}
|
|
1791
|
-
)
|
|
1792
|
-
] });
|
|
1793
|
-
}
|
|
1794
|
-
var import_react13, import_jsx_runtime23;
|
|
1795
|
-
var init_Tabs = __esm({
|
|
1796
|
-
"src/client/theme/components/mdx/Tabs.tsx"() {
|
|
1797
|
-
"use strict";
|
|
1798
|
-
import_react13 = require("react");
|
|
1799
|
-
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1800
|
-
}
|
|
1801
|
-
});
|
|
1802
|
-
|
|
1803
|
-
// src/client/theme/components/mdx/Admonition.tsx
|
|
1804
|
-
function Admonition({
|
|
1805
|
-
type = "note",
|
|
1806
|
-
title,
|
|
1807
|
-
children,
|
|
1808
|
-
className = "",
|
|
1809
|
-
...rest
|
|
1810
|
-
}) {
|
|
1811
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1812
|
-
"div",
|
|
1813
|
-
{
|
|
1814
|
-
className: `ld-admonition ld-admonition--${type} ${className}`.trim(),
|
|
1815
|
-
role: type === "warning" || type === "danger" ? "alert" : "note",
|
|
1816
|
-
...rest,
|
|
1817
|
-
children: [
|
|
1818
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "ld-admonition__header", children: [
|
|
1819
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "ld-admonition__icon", children: ICON_MAP2[type] }),
|
|
1820
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "ld-admonition__title", children: title || LABEL_MAP[type] })
|
|
1821
|
-
] }),
|
|
1822
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "ld-admonition__body", children })
|
|
1823
|
-
]
|
|
1824
|
-
}
|
|
1825
|
-
);
|
|
1826
|
-
}
|
|
1827
|
-
var import_lucide_react12, import_jsx_runtime24, ICON_MAP2, LABEL_MAP, Note, Tip, Warning, Danger, InfoBox;
|
|
1828
|
-
var init_Admonition = __esm({
|
|
1829
|
-
"src/client/theme/components/mdx/Admonition.tsx"() {
|
|
1830
|
-
"use strict";
|
|
1831
|
-
import_lucide_react12 = require("lucide-react");
|
|
1832
|
-
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1833
|
-
ICON_MAP2 = {
|
|
1834
|
-
note: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Bookmark, { size: 18 }),
|
|
1835
|
-
tip: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Lightbulb, { size: 18 }),
|
|
1836
|
-
info: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Info, { size: 18 }),
|
|
1837
|
-
warning: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.AlertTriangle, { size: 18 }),
|
|
1838
|
-
danger: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.ShieldAlert, { size: 18 })
|
|
1839
|
-
};
|
|
1840
|
-
LABEL_MAP = {
|
|
1841
|
-
note: "Note",
|
|
1842
|
-
tip: "Tip",
|
|
1843
|
-
info: "Info",
|
|
1844
|
-
warning: "Warning",
|
|
1845
|
-
danger: "Danger"
|
|
1846
|
-
};
|
|
1847
|
-
Note = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Admonition, { type: "note", ...props });
|
|
1848
|
-
Tip = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Admonition, { type: "tip", ...props });
|
|
1849
|
-
Warning = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Admonition, { type: "warning", ...props });
|
|
1850
|
-
Danger = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Admonition, { type: "danger", ...props });
|
|
1851
|
-
InfoBox = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Admonition, { type: "info", ...props });
|
|
1852
|
-
}
|
|
1853
|
-
});
|
|
1854
|
-
|
|
1855
|
-
// src/client/theme/components/mdx/List.tsx
|
|
1856
|
-
function List({
|
|
1857
|
-
variant = "default",
|
|
1858
|
-
children,
|
|
1859
|
-
className = "",
|
|
1860
|
-
...rest
|
|
1861
|
-
}) {
|
|
1862
|
-
if (variant === "default") {
|
|
1863
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("ul", { className: `ld-list ${className}`.trim(), ...rest, children });
|
|
1864
|
-
}
|
|
1865
|
-
const icon = ICON_MAP3[variant];
|
|
1866
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("ul", { className: `ld-list ld-list--${variant} ${className}`.trim(), ...rest, children: import_react14.Children.map(children, (child) => {
|
|
1867
|
-
if (!import_react14.default.isValidElement(child)) return child;
|
|
1868
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("li", { className: "ld-list__item", children: [
|
|
1869
|
-
icon,
|
|
1870
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "ld-list__text", children: child.props.children })
|
|
1871
|
-
] });
|
|
1872
|
-
}) });
|
|
1873
|
-
}
|
|
1874
|
-
var import_react14, import_lucide_react13, import_jsx_runtime25, ICON_MAP3;
|
|
1875
|
-
var init_List = __esm({
|
|
1876
|
-
"src/client/theme/components/mdx/List.tsx"() {
|
|
1877
|
-
"use strict";
|
|
1878
|
-
import_react14 = __toESM(require("react"));
|
|
1879
|
-
import_lucide_react13 = require("lucide-react");
|
|
1880
|
-
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1881
|
-
ICON_MAP3 = {
|
|
1882
|
-
checked: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react13.Check, { size: 14, className: "ld-list__icon" }),
|
|
1883
|
-
arrow: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react13.ChevronRight, { size: 14, className: "ld-list__icon" })
|
|
1884
|
-
};
|
|
1885
|
-
}
|
|
1886
|
-
});
|
|
1887
|
-
|
|
1888
|
-
// src/client/theme/components/mdx/index.ts
|
|
1889
|
-
var init_mdx = __esm({
|
|
1890
|
-
"src/client/theme/components/mdx/index.ts"() {
|
|
1891
|
-
"use strict";
|
|
1892
|
-
init_Button();
|
|
1893
|
-
init_Badge();
|
|
1894
|
-
init_Card();
|
|
1895
|
-
init_Tabs();
|
|
1896
|
-
init_Admonition();
|
|
1897
|
-
init_List();
|
|
1898
|
-
}
|
|
1899
|
-
});
|
|
1900
|
-
|
|
1901
1691
|
// src/client/theme/components/CodeBlock/CodeBlock.tsx
|
|
1902
1692
|
function CodeBlock({ children, ...props }) {
|
|
1903
|
-
const [copied, setCopied] = (0,
|
|
1904
|
-
const preRef = (0,
|
|
1693
|
+
const [copied, setCopied] = (0, import_react13.useState)(false);
|
|
1694
|
+
const preRef = (0, import_react13.useRef)(null);
|
|
1905
1695
|
let language = "";
|
|
1906
|
-
if (
|
|
1696
|
+
if (import_react13.default.isValidElement(children)) {
|
|
1907
1697
|
const childProps = children.props;
|
|
1908
1698
|
language = childProps?.["data-language"] || "";
|
|
1909
1699
|
if (!language && childProps?.className) {
|
|
@@ -1911,7 +1701,7 @@ function CodeBlock({ children, ...props }) {
|
|
|
1911
1701
|
if (match) language = match[1];
|
|
1912
1702
|
}
|
|
1913
1703
|
}
|
|
1914
|
-
const handleCopy = (0,
|
|
1704
|
+
const handleCopy = (0, import_react13.useCallback)(async () => {
|
|
1915
1705
|
const code = preRef.current?.textContent || "";
|
|
1916
1706
|
try {
|
|
1917
1707
|
await navigator.clipboard.writeText(code);
|
|
@@ -1930,30 +1720,30 @@ function CodeBlock({ children, ...props }) {
|
|
|
1930
1720
|
setTimeout(() => setCopied(false), 2e3);
|
|
1931
1721
|
}
|
|
1932
1722
|
}, []);
|
|
1933
|
-
return /* @__PURE__ */ (0,
|
|
1934
|
-
/* @__PURE__ */ (0,
|
|
1935
|
-
/* @__PURE__ */ (0,
|
|
1936
|
-
/* @__PURE__ */ (0,
|
|
1723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "code-block-wrapper", children: [
|
|
1724
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "code-block-header", children: [
|
|
1725
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "code-block-lang", children: language || "code" }),
|
|
1726
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1937
1727
|
"button",
|
|
1938
1728
|
{
|
|
1939
1729
|
className: `code-block-copy ${copied ? "copied" : ""}`,
|
|
1940
1730
|
onClick: handleCopy,
|
|
1941
1731
|
type: "button",
|
|
1942
1732
|
"aria-label": "Copy code",
|
|
1943
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
1733
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Check, { size: 20 }) }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Copy, { size: 20 }) })
|
|
1944
1734
|
}
|
|
1945
1735
|
)
|
|
1946
1736
|
] }),
|
|
1947
|
-
/* @__PURE__ */ (0,
|
|
1737
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("pre", { ref: preRef, ...props, children })
|
|
1948
1738
|
] });
|
|
1949
1739
|
}
|
|
1950
|
-
var
|
|
1740
|
+
var import_react13, import_lucide_react12, import_jsx_runtime20;
|
|
1951
1741
|
var init_CodeBlock = __esm({
|
|
1952
1742
|
"src/client/theme/components/CodeBlock/CodeBlock.tsx"() {
|
|
1953
1743
|
"use strict";
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1744
|
+
import_react13 = __toESM(require("react"));
|
|
1745
|
+
import_lucide_react12 = require("lucide-react");
|
|
1746
|
+
import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1957
1747
|
}
|
|
1958
1748
|
});
|
|
1959
1749
|
|
|
@@ -1979,9 +1769,9 @@ function Video({
|
|
|
1979
1769
|
preload = "metadata",
|
|
1980
1770
|
...rest
|
|
1981
1771
|
}) {
|
|
1982
|
-
const containerRef = (0,
|
|
1983
|
-
const [isVisible, setIsVisible] = (0,
|
|
1984
|
-
(0,
|
|
1772
|
+
const containerRef = (0, import_react14.useRef)(null);
|
|
1773
|
+
const [isVisible, setIsVisible] = (0, import_react14.useState)(false);
|
|
1774
|
+
(0, import_react14.useEffect)(() => {
|
|
1985
1775
|
const el = containerRef.current;
|
|
1986
1776
|
if (!el) return;
|
|
1987
1777
|
const observer = new IntersectionObserver(
|
|
@@ -1996,7 +1786,7 @@ function Video({
|
|
|
1996
1786
|
observer.observe(el);
|
|
1997
1787
|
return () => observer.disconnect();
|
|
1998
1788
|
}, []);
|
|
1999
|
-
return /* @__PURE__ */ (0,
|
|
1789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { ref: containerRef, className: "boltdocs-video-wrapper", children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2000
1790
|
"video",
|
|
2001
1791
|
{
|
|
2002
1792
|
className: "boltdocs-video",
|
|
@@ -2011,7 +1801,7 @@ function Video({
|
|
|
2011
1801
|
"Your browser does not support the video tag."
|
|
2012
1802
|
]
|
|
2013
1803
|
}
|
|
2014
|
-
) : /* @__PURE__ */ (0,
|
|
1804
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2015
1805
|
"div",
|
|
2016
1806
|
{
|
|
2017
1807
|
className: "boltdocs-video-placeholder",
|
|
@@ -2020,12 +1810,12 @@ function Video({
|
|
|
2020
1810
|
}
|
|
2021
1811
|
) });
|
|
2022
1812
|
}
|
|
2023
|
-
var
|
|
1813
|
+
var import_react14, import_jsx_runtime21;
|
|
2024
1814
|
var init_Video = __esm({
|
|
2025
1815
|
"src/client/theme/components/Video/Video.tsx"() {
|
|
2026
1816
|
"use strict";
|
|
2027
|
-
|
|
2028
|
-
|
|
1817
|
+
import_react14 = require("react");
|
|
1818
|
+
import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2029
1819
|
}
|
|
2030
1820
|
});
|
|
2031
1821
|
|
|
@@ -2042,14 +1832,14 @@ var init_Video2 = __esm({
|
|
|
2042
1832
|
});
|
|
2043
1833
|
|
|
2044
1834
|
// src/client/theme/icons/npm.tsx
|
|
2045
|
-
var
|
|
1835
|
+
var import_jsx_runtime22, NPM;
|
|
2046
1836
|
var init_npm = __esm({
|
|
2047
1837
|
"src/client/theme/icons/npm.tsx"() {
|
|
2048
1838
|
"use strict";
|
|
2049
|
-
|
|
2050
|
-
NPM = (props) => /* @__PURE__ */ (0,
|
|
2051
|
-
/* @__PURE__ */ (0,
|
|
2052
|
-
/* @__PURE__ */ (0,
|
|
1839
|
+
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1840
|
+
NPM = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("svg", { ...props, viewBox: "0 0 2500 2500", children: [
|
|
1841
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { fill: "#c00", d: "M0 0h2500v2500H0z" }),
|
|
1842
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2053
1843
|
"path",
|
|
2054
1844
|
{
|
|
2055
1845
|
fill: "#fff",
|
|
@@ -2061,69 +1851,69 @@ var init_npm = __esm({
|
|
|
2061
1851
|
});
|
|
2062
1852
|
|
|
2063
1853
|
// src/client/theme/icons/pnpm.tsx
|
|
2064
|
-
var
|
|
1854
|
+
var import_jsx_runtime23, Pnpm;
|
|
2065
1855
|
var init_pnpm = __esm({
|
|
2066
1856
|
"src/client/theme/icons/pnpm.tsx"() {
|
|
2067
1857
|
"use strict";
|
|
2068
|
-
|
|
2069
|
-
Pnpm = (props) => /* @__PURE__ */ (0,
|
|
1858
|
+
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1859
|
+
Pnpm = (props) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2070
1860
|
"svg",
|
|
2071
1861
|
{
|
|
2072
1862
|
...props,
|
|
2073
1863
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
2074
1864
|
viewBox: "76.58987244897958 44 164.00775510204068 164",
|
|
2075
1865
|
children: [
|
|
2076
|
-
/* @__PURE__ */ (0,
|
|
2077
|
-
/* @__PURE__ */ (0,
|
|
1866
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("defs", { children: [
|
|
1867
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2078
1868
|
"path",
|
|
2079
1869
|
{
|
|
2080
1870
|
d: "M237.6 95L187.6 95L187.6 45L237.6 45L237.6 95Z",
|
|
2081
1871
|
id: "pnpm_dark__b45vdTD8hs"
|
|
2082
1872
|
}
|
|
2083
1873
|
),
|
|
2084
|
-
/* @__PURE__ */ (0,
|
|
1874
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2085
1875
|
"path",
|
|
2086
1876
|
{
|
|
2087
1877
|
d: "M182.59 95L132.59 95L132.59 45L182.59 45L182.59 95Z",
|
|
2088
1878
|
id: "pnpm_dark__a40WtxIl8d"
|
|
2089
1879
|
}
|
|
2090
1880
|
),
|
|
2091
|
-
/* @__PURE__ */ (0,
|
|
1881
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2092
1882
|
"path",
|
|
2093
1883
|
{
|
|
2094
1884
|
d: "M127.59 95L77.59 95L77.59 45L127.59 45L127.59 95Z",
|
|
2095
1885
|
id: "pnpm_dark__h2CN9AEEpe"
|
|
2096
1886
|
}
|
|
2097
1887
|
),
|
|
2098
|
-
/* @__PURE__ */ (0,
|
|
1888
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2099
1889
|
"path",
|
|
2100
1890
|
{
|
|
2101
1891
|
d: "M237.6 150L187.6 150L187.6 100L237.6 100L237.6 150Z",
|
|
2102
1892
|
id: "pnpm_dark__dqv5133G8"
|
|
2103
1893
|
}
|
|
2104
1894
|
),
|
|
2105
|
-
/* @__PURE__ */ (0,
|
|
1895
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2106
1896
|
"path",
|
|
2107
1897
|
{
|
|
2108
1898
|
d: "M182.59 150L132.59 150L132.59 100L182.59 100L182.59 150Z",
|
|
2109
1899
|
id: "pnpm_dark__b1Lv79ypvm"
|
|
2110
1900
|
}
|
|
2111
1901
|
),
|
|
2112
|
-
/* @__PURE__ */ (0,
|
|
1902
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2113
1903
|
"path",
|
|
2114
1904
|
{
|
|
2115
1905
|
d: "M182.59 205L132.59 205L132.59 155L182.59 155L182.59 205Z",
|
|
2116
1906
|
id: "pnpm_dark__hy1IZWwLX"
|
|
2117
1907
|
}
|
|
2118
1908
|
),
|
|
2119
|
-
/* @__PURE__ */ (0,
|
|
1909
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2120
1910
|
"path",
|
|
2121
1911
|
{
|
|
2122
1912
|
d: "M237.6 205L187.6 205L187.6 155L237.6 155L237.6 205Z",
|
|
2123
1913
|
id: "pnpm_dark__akQfjxQes"
|
|
2124
1914
|
}
|
|
2125
1915
|
),
|
|
2126
|
-
/* @__PURE__ */ (0,
|
|
1916
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2127
1917
|
"path",
|
|
2128
1918
|
{
|
|
2129
1919
|
d: "M127.59 205L77.59 205L77.59 155L127.59 155L127.59 205Z",
|
|
@@ -2131,15 +1921,15 @@ var init_pnpm = __esm({
|
|
|
2131
1921
|
}
|
|
2132
1922
|
)
|
|
2133
1923
|
] }),
|
|
2134
|
-
/* @__PURE__ */ (0,
|
|
2135
|
-
/* @__PURE__ */ (0,
|
|
2136
|
-
/* @__PURE__ */ (0,
|
|
2137
|
-
/* @__PURE__ */ (0,
|
|
2138
|
-
/* @__PURE__ */ (0,
|
|
2139
|
-
/* @__PURE__ */ (0,
|
|
2140
|
-
/* @__PURE__ */ (0,
|
|
2141
|
-
/* @__PURE__ */ (0,
|
|
2142
|
-
/* @__PURE__ */ (0,
|
|
1924
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("g", { children: [
|
|
1925
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("use", { xlinkHref: "#pnpm_dark__b45vdTD8hs", fill: "#f9ad00" }) }),
|
|
1926
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("use", { xlinkHref: "#pnpm_dark__a40WtxIl8d", fill: "#f9ad00" }) }),
|
|
1927
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("use", { xlinkHref: "#pnpm_dark__h2CN9AEEpe", fill: "#f9ad00" }) }),
|
|
1928
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("use", { xlinkHref: "#pnpm_dark__dqv5133G8", fill: "#f9ad00" }) }),
|
|
1929
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("use", { xlinkHref: "#pnpm_dark__b1Lv79ypvm", fill: "currentColor" }) }),
|
|
1930
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("use", { xlinkHref: "#pnpm_dark__hy1IZWwLX", fill: "currentColor" }) }),
|
|
1931
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("use", { xlinkHref: "#pnpm_dark__akQfjxQes", fill: "currentColor" }) }),
|
|
1932
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("use", { xlinkHref: "#pnpm_dark__bdSrwE5pk", fill: "currentColor" }) })
|
|
2143
1933
|
] })
|
|
2144
1934
|
]
|
|
2145
1935
|
}
|
|
@@ -2148,62 +1938,62 @@ var init_pnpm = __esm({
|
|
|
2148
1938
|
});
|
|
2149
1939
|
|
|
2150
1940
|
// src/client/theme/icons/bun.tsx
|
|
2151
|
-
var
|
|
1941
|
+
var import_jsx_runtime24, Bun;
|
|
2152
1942
|
var init_bun = __esm({
|
|
2153
1943
|
"src/client/theme/icons/bun.tsx"() {
|
|
2154
1944
|
"use strict";
|
|
2155
|
-
|
|
2156
|
-
Bun = (props) => /* @__PURE__ */ (0,
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2158
|
-
/* @__PURE__ */ (0,
|
|
1945
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1946
|
+
Bun = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("svg", { ...props, viewBox: "0 0 80 70", children: [
|
|
1947
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M71.09 20.74c-.16-.17-.33-.34-.5-.5s-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5A26.46 26.46 0 0 1 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05-11.58 0-21.94-4.23-28.83-10.86l.5.5.5.5.5.5.5.5.5.5.5.5.5.5C19.55 65.3 30.14 69.75 42 69.75c20.68 0 37.5-13.48 37.5-30 0-7.06-3.04-13.75-8.41-19.01Z" }),
|
|
1948
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2159
1949
|
"path",
|
|
2160
1950
|
{
|
|
2161
1951
|
d: "M73 35.7c0 15.21-15.67 27.54-35 27.54S3 50.91 3 35.7C3 26.27 9 17.94 18.22 13S33.18 3 38 3s8.94 4.13 19.78 10C67 17.94 73 26.27 73 35.7Z",
|
|
2162
1952
|
style: { fill: "#fbf0df" }
|
|
2163
1953
|
}
|
|
2164
1954
|
),
|
|
2165
|
-
/* @__PURE__ */ (0,
|
|
1955
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2166
1956
|
"path",
|
|
2167
1957
|
{
|
|
2168
1958
|
d: "M73 35.7a21.67 21.67 0 0 0-.8-5.78c-2.73 33.3-43.35 34.9-59.32 24.94A40 40 0 0 0 38 63.24c19.3 0 35-12.35 35-27.54Z",
|
|
2169
1959
|
style: { fill: "#f6dece" }
|
|
2170
1960
|
}
|
|
2171
1961
|
),
|
|
2172
|
-
/* @__PURE__ */ (0,
|
|
1962
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2173
1963
|
"path",
|
|
2174
1964
|
{
|
|
2175
1965
|
d: "M24.53 11.17C29 8.49 34.94 3.46 40.78 3.45A9.29 9.29 0 0 0 38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7v1.19c6.06-21.41 17.07-23.04 21.53-25.72Z",
|
|
2176
1966
|
style: { fill: "#fffefc" }
|
|
2177
1967
|
}
|
|
2178
1968
|
),
|
|
2179
|
-
/* @__PURE__ */ (0,
|
|
1969
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2180
1970
|
"path",
|
|
2181
1971
|
{
|
|
2182
1972
|
d: "M35.12 5.53A16.41 16.41 0 0 1 29.49 18c-.28.25-.06.73.3.59 3.37-1.31 7.92-5.23 6-13.14-.08-.45-.67-.33-.67.08Zm2.27 0A16.24 16.24 0 0 1 39 19c-.12.35.31.65.55.36 2.19-2.8 4.1-8.36-1.62-14.36-.29-.26-.74.14-.54.49Zm2.76-.17A16.42 16.42 0 0 1 47 17.12a.33.33 0 0 0 .65.11c.92-3.49.4-9.44-7.17-12.53-.4-.16-.66.38-.33.62Zm-18.46 10.4a16.94 16.94 0 0 0 10.47-9c.18-.36.75-.22.66.18-1.73 8-7.52 9.67-11.12 9.45-.38.01-.37-.52-.01-.63Z",
|
|
2183
1973
|
style: { fill: "#ccbea7", fillRule: "evenodd" }
|
|
2184
1974
|
}
|
|
2185
1975
|
),
|
|
2186
|
-
/* @__PURE__ */ (0,
|
|
2187
|
-
/* @__PURE__ */ (0,
|
|
2188
|
-
/* @__PURE__ */ (0,
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M38 65.75C17.32 65.75.5 52.27.5 35.7c0-10 6.18-19.33 16.53-24.92 3-1.6 5.57-3.21 7.86-4.62 1.26-.78 2.45-1.51 3.6-2.19C32 1.89 35 .5 38 .5s5.62 1.2 8.9 3.14c1 .57 2 1.19 3.07 1.87 2.49 1.54 5.3 3.28 9 5.27C69.32 16.37 75.5 25.69 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05ZM38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7c0 15.19 15.7 27.55 35 27.55S73 50.89 73 35.7c0-9.08-5.69-17.57-15.22-22.7-3.78-2-6.73-3.88-9.12-5.36-1.09-.67-2.09-1.29-3-1.84C42.63 4 40.42 3 38 3Z" }),
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("g", { children: [
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2189
1979
|
"path",
|
|
2190
1980
|
{
|
|
2191
1981
|
d: "M45.05 43a8.93 8.93 0 0 1-2.92 4.71 6.81 6.81 0 0 1-4 1.88A6.84 6.84 0 0 1 34 47.71 8.93 8.93 0 0 1 31.12 43a.72.72 0 0 1 .8-.81h12.34a.72.72 0 0 1 .79.81Z",
|
|
2192
1982
|
style: { fill: "#b71422" }
|
|
2193
1983
|
}
|
|
2194
1984
|
),
|
|
2195
|
-
/* @__PURE__ */ (0,
|
|
1985
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2196
1986
|
"path",
|
|
2197
1987
|
{
|
|
2198
1988
|
d: "M34 47.79a6.91 6.91 0 0 0 4.12 1.9 6.91 6.91 0 0 0 4.11-1.9 10.63 10.63 0 0 0 1-1.07 6.83 6.83 0 0 0-4.9-2.31 6.15 6.15 0 0 0-5 2.78c.23.21.43.41.67.6Z",
|
|
2199
1989
|
style: { fill: "#ff6164" }
|
|
2200
1990
|
}
|
|
2201
1991
|
),
|
|
2202
|
-
/* @__PURE__ */ (0,
|
|
2203
|
-
/* @__PURE__ */ (0,
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M34.16 47a5.36 5.36 0 0 1 4.19-2.08 6 6 0 0 1 4 1.69c.23-.25.45-.51.66-.77a7 7 0 0 0-4.71-1.93 6.36 6.36 0 0 0-4.89 2.36 9.53 9.53 0 0 0 .75.73Z" }),
|
|
1993
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M38.09 50.19a7.42 7.42 0 0 1-4.45-2 9.52 9.52 0 0 1-3.11-5.05 1.2 1.2 0 0 1 .26-1 1.41 1.41 0 0 1 1.13-.51h12.34a1.44 1.44 0 0 1 1.13.51 1.19 1.19 0 0 1 .25 1 9.52 9.52 0 0 1-3.11 5.05 7.42 7.42 0 0 1-4.44 2Zm-6.17-7.4c-.16 0-.2.07-.21.09a8.29 8.29 0 0 0 2.73 4.37A6.23 6.23 0 0 0 38.09 49a6.28 6.28 0 0 0 3.65-1.73 8.3 8.3 0 0 0 2.72-4.37.21.21 0 0 0-.2-.09Z" })
|
|
2204
1994
|
] }),
|
|
2205
|
-
/* @__PURE__ */ (0,
|
|
2206
|
-
/* @__PURE__ */ (0,
|
|
1995
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("g", { children: [
|
|
1996
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2207
1997
|
"ellipse",
|
|
2208
1998
|
{
|
|
2209
1999
|
cx: "53.22",
|
|
@@ -2213,7 +2003,7 @@ var init_bun = __esm({
|
|
|
2213
2003
|
style: { fill: "#febbd0" }
|
|
2214
2004
|
}
|
|
2215
2005
|
),
|
|
2216
|
-
/* @__PURE__ */ (0,
|
|
2006
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2217
2007
|
"ellipse",
|
|
2218
2008
|
{
|
|
2219
2009
|
cx: "22.95",
|
|
@@ -2223,14 +2013,14 @@ var init_bun = __esm({
|
|
|
2223
2013
|
style: { fill: "#febbd0" }
|
|
2224
2014
|
}
|
|
2225
2015
|
),
|
|
2226
|
-
/* @__PURE__ */ (0,
|
|
2016
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2227
2017
|
"path",
|
|
2228
2018
|
{
|
|
2229
2019
|
d: "M25.7 38.8a5.51 5.51 0 1 0-5.5-5.51 5.51 5.51 0 0 0 5.5 5.51Zm24.77 0A5.51 5.51 0 1 0 45 33.29a5.5 5.5 0 0 0 5.47 5.51Z",
|
|
2230
2020
|
style: { fillRule: "evenodd" }
|
|
2231
2021
|
}
|
|
2232
2022
|
),
|
|
2233
|
-
/* @__PURE__ */ (0,
|
|
2023
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2234
2024
|
"path",
|
|
2235
2025
|
{
|
|
2236
2026
|
d: "M24 33.64a2.07 2.07 0 1 0-2.06-2.07A2.07 2.07 0 0 0 24 33.64Zm24.77 0a2.07 2.07 0 1 0-2.06-2.07 2.07 2.07 0 0 0 2.04 2.07Z",
|
|
@@ -2243,12 +2033,12 @@ var init_bun = __esm({
|
|
|
2243
2033
|
});
|
|
2244
2034
|
|
|
2245
2035
|
// src/client/theme/icons/deno.tsx
|
|
2246
|
-
var
|
|
2036
|
+
var import_jsx_runtime25, Deno;
|
|
2247
2037
|
var init_deno = __esm({
|
|
2248
2038
|
"src/client/theme/icons/deno.tsx"() {
|
|
2249
2039
|
"use strict";
|
|
2250
|
-
|
|
2251
|
-
Deno = (props) => /* @__PURE__ */ (0,
|
|
2040
|
+
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2041
|
+
Deno = (props) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2252
2042
|
"svg",
|
|
2253
2043
|
{
|
|
2254
2044
|
...props,
|
|
@@ -2258,7 +2048,7 @@ var init_deno = __esm({
|
|
|
2258
2048
|
strokeMiterlimit: "2",
|
|
2259
2049
|
clipRule: "evenodd",
|
|
2260
2050
|
viewBox: "0 0 441 441",
|
|
2261
|
-
children: /* @__PURE__ */ (0,
|
|
2051
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2262
2052
|
"path",
|
|
2263
2053
|
{
|
|
2264
2054
|
fill: "currentColor",
|
|
@@ -2305,10 +2095,10 @@ function PackageManagerTabs({
|
|
|
2305
2095
|
pkg = "",
|
|
2306
2096
|
className = ""
|
|
2307
2097
|
}) {
|
|
2308
|
-
const [activeTab, setActiveTab] = (0,
|
|
2309
|
-
const [copied, setCopied] = (0,
|
|
2098
|
+
const [activeTab, setActiveTab] = (0, import_react15.useState)("npm");
|
|
2099
|
+
const [copied, setCopied] = (0, import_react15.useState)(false);
|
|
2310
2100
|
const activeCommand = getCommandForManager(activeTab, command, pkg);
|
|
2311
|
-
const handleCopy = (0,
|
|
2101
|
+
const handleCopy = (0, import_react15.useCallback)(async () => {
|
|
2312
2102
|
try {
|
|
2313
2103
|
await navigator.clipboard.writeText(activeCommand);
|
|
2314
2104
|
setCopied(true);
|
|
@@ -2326,11 +2116,11 @@ function PackageManagerTabs({
|
|
|
2326
2116
|
setTimeout(() => setCopied(false), 2e3);
|
|
2327
2117
|
}
|
|
2328
2118
|
}, [activeCommand]);
|
|
2329
|
-
return /* @__PURE__ */ (0,
|
|
2330
|
-
/* @__PURE__ */ (0,
|
|
2119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: `pkg-tabs-wrapper ${className}`, children: [
|
|
2120
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "pkg-tabs-header", children: MANAGERS.map((mgr) => {
|
|
2331
2121
|
const Icon = mgr.icon;
|
|
2332
2122
|
const isActive = activeTab === mgr.id;
|
|
2333
|
-
return /* @__PURE__ */ (0,
|
|
2123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2334
2124
|
"button",
|
|
2335
2125
|
{
|
|
2336
2126
|
className: `pkg-tab-btn ${isActive ? "active" : ""}`,
|
|
@@ -2338,42 +2128,42 @@ function PackageManagerTabs({
|
|
|
2338
2128
|
"aria-selected": isActive,
|
|
2339
2129
|
role: "tab",
|
|
2340
2130
|
children: [
|
|
2341
|
-
/* @__PURE__ */ (0,
|
|
2342
|
-
/* @__PURE__ */ (0,
|
|
2131
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { className: "pkg-tab-icon", width: "16", height: "16" }),
|
|
2132
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: mgr.label })
|
|
2343
2133
|
]
|
|
2344
2134
|
},
|
|
2345
2135
|
mgr.id
|
|
2346
2136
|
);
|
|
2347
2137
|
}) }),
|
|
2348
|
-
/* @__PURE__ */ (0,
|
|
2349
|
-
/* @__PURE__ */ (0,
|
|
2350
|
-
/* @__PURE__ */ (0,
|
|
2351
|
-
/* @__PURE__ */ (0,
|
|
2138
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "code-block-wrapper pkg-tabs-content", children: [
|
|
2139
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "code-block-header", children: [
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "code-block-lang", children: "bash" }),
|
|
2141
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2352
2142
|
"button",
|
|
2353
2143
|
{
|
|
2354
2144
|
className: `code-block-copy ${copied ? "copied" : ""}`,
|
|
2355
2145
|
onClick: handleCopy,
|
|
2356
2146
|
type: "button",
|
|
2357
2147
|
"aria-label": "Copy code",
|
|
2358
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
2148
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react13.Check, { size: 12 }) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react13.Copy, { size: 12 }) })
|
|
2359
2149
|
}
|
|
2360
2150
|
)
|
|
2361
2151
|
] }),
|
|
2362
|
-
/* @__PURE__ */ (0,
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("pre", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("code", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "line", children: activeCommand }) }) })
|
|
2363
2153
|
] })
|
|
2364
2154
|
] });
|
|
2365
2155
|
}
|
|
2366
|
-
var
|
|
2156
|
+
var import_react15, import_lucide_react13, import_jsx_runtime26, MANAGERS;
|
|
2367
2157
|
var init_PackageManagerTabs = __esm({
|
|
2368
2158
|
"src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx"() {
|
|
2369
2159
|
"use strict";
|
|
2370
|
-
|
|
2371
|
-
|
|
2160
|
+
import_react15 = require("react");
|
|
2161
|
+
import_lucide_react13 = require("lucide-react");
|
|
2372
2162
|
init_npm();
|
|
2373
2163
|
init_pnpm();
|
|
2374
2164
|
init_bun();
|
|
2375
2165
|
init_deno();
|
|
2376
|
-
|
|
2166
|
+
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2377
2167
|
MANAGERS = [
|
|
2378
2168
|
{ id: "npm", label: "npm", icon: NPM },
|
|
2379
2169
|
{ id: "pnpm", label: "pnpm", icon: Pnpm },
|
|
@@ -2395,91 +2185,9 @@ var init_PackageManagerTabs2 = __esm({
|
|
|
2395
2185
|
}
|
|
2396
2186
|
});
|
|
2397
2187
|
|
|
2398
|
-
// src/client/theme/components/Playground/Playground.tsx
|
|
2399
|
-
function Playground({
|
|
2400
|
-
code,
|
|
2401
|
-
children,
|
|
2402
|
-
scope = {},
|
|
2403
|
-
readonly = false
|
|
2404
|
-
}) {
|
|
2405
|
-
let initialCode = code || "";
|
|
2406
|
-
if (!initialCode && typeof children === "string") {
|
|
2407
|
-
initialCode = children;
|
|
2408
|
-
}
|
|
2409
|
-
const [copied, setCopied] = (0, import_react18.useState)(false);
|
|
2410
|
-
const [activeCode, setActiveCode] = (0, import_react18.useState)(initialCode.trim());
|
|
2411
|
-
const handleCopy = () => {
|
|
2412
|
-
navigator.clipboard.writeText(activeCode);
|
|
2413
|
-
setCopied(true);
|
|
2414
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
2415
|
-
};
|
|
2416
|
-
const extendedScope = { React: import_react18.default, ...scope };
|
|
2417
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boltdocs-playground", "data-readonly": readonly, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2418
|
-
import_react_live.LiveProvider,
|
|
2419
|
-
{
|
|
2420
|
-
code: activeCode,
|
|
2421
|
-
scope: extendedScope,
|
|
2422
|
-
theme: void 0,
|
|
2423
|
-
noInline: false,
|
|
2424
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "playground-split-container", children: [
|
|
2425
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "playground-panel playground-editor-panel", children: [
|
|
2426
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "playground-panel-header", children: [
|
|
2427
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "playground-panel-title", children: [
|
|
2428
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react16.Terminal, { size: 14 }),
|
|
2429
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: readonly ? "Code Example" : "Live Editor" })
|
|
2430
|
-
] }),
|
|
2431
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2432
|
-
"button",
|
|
2433
|
-
{
|
|
2434
|
-
className: "playground-copy-btn",
|
|
2435
|
-
onClick: handleCopy,
|
|
2436
|
-
title: "Copy code",
|
|
2437
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react16.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react16.Copy, { size: 14 })
|
|
2438
|
-
}
|
|
2439
|
-
)
|
|
2440
|
-
] }),
|
|
2441
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "playground-panel-content playground-editor", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_live.LiveEditor, { disabled: readonly, onChange: setActiveCode }) })
|
|
2442
|
-
] }),
|
|
2443
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "playground-panel playground-preview-panel", children: [
|
|
2444
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "playground-panel-header", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "playground-panel-title", children: [
|
|
2445
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react16.Play, { size: 14 }),
|
|
2446
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "Preview" })
|
|
2447
|
-
] }) }),
|
|
2448
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "playground-panel-content playground-preview", children: [
|
|
2449
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_live.LivePreview, {}),
|
|
2450
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_live.LiveError, { className: "playground-error" })
|
|
2451
|
-
] })
|
|
2452
|
-
] })
|
|
2453
|
-
] })
|
|
2454
|
-
}
|
|
2455
|
-
) });
|
|
2456
|
-
}
|
|
2457
|
-
var import_react18, import_react_live, import_lucide_react16, import_jsx_runtime33;
|
|
2458
|
-
var init_Playground = __esm({
|
|
2459
|
-
"src/client/theme/components/Playground/Playground.tsx"() {
|
|
2460
|
-
"use strict";
|
|
2461
|
-
import_react18 = __toESM(require("react"));
|
|
2462
|
-
import_react_live = require("react-live");
|
|
2463
|
-
import_lucide_react16 = require("lucide-react");
|
|
2464
|
-
import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2465
|
-
}
|
|
2466
|
-
});
|
|
2467
|
-
|
|
2468
|
-
// src/client/theme/components/Playground/index.ts
|
|
2469
|
-
var Playground_exports = {};
|
|
2470
|
-
__export(Playground_exports, {
|
|
2471
|
-
Playground: () => Playground
|
|
2472
|
-
});
|
|
2473
|
-
var init_Playground2 = __esm({
|
|
2474
|
-
"src/client/theme/components/Playground/index.ts"() {
|
|
2475
|
-
"use strict";
|
|
2476
|
-
init_Playground();
|
|
2477
|
-
}
|
|
2478
|
-
});
|
|
2479
|
-
|
|
2480
2188
|
// src/client/app/index.tsx
|
|
2481
2189
|
function useConfig() {
|
|
2482
|
-
return (0,
|
|
2190
|
+
return (0, import_react18.useContext)(ConfigContext);
|
|
2483
2191
|
}
|
|
2484
2192
|
function AppShell({
|
|
2485
2193
|
initialRoutes,
|
|
@@ -2489,18 +2197,10 @@ function AppShell({
|
|
|
2489
2197
|
homePage: HomePage,
|
|
2490
2198
|
components: customComponents = {}
|
|
2491
2199
|
}) {
|
|
2492
|
-
const [routesInfo, setRoutesInfo] = (0,
|
|
2493
|
-
const [config] = (0,
|
|
2494
|
-
const
|
|
2495
|
-
|
|
2496
|
-
if (hot) {
|
|
2497
|
-
hot.on("boltdocs:routes-update", (newRoutes) => {
|
|
2498
|
-
setRoutesInfo(newRoutes);
|
|
2499
|
-
});
|
|
2500
|
-
}
|
|
2501
|
-
}, [hot]);
|
|
2502
|
-
(0, import_react19.useEffect)(() => {
|
|
2503
|
-
const mapped = routesInfo.filter(
|
|
2200
|
+
const [routesInfo, setRoutesInfo] = (0, import_react16.useState)(initialRoutes);
|
|
2201
|
+
const [config] = (0, import_react16.useState)(initialConfig);
|
|
2202
|
+
const resolveRoutes = (infos) => {
|
|
2203
|
+
return infos.filter(
|
|
2504
2204
|
(route) => !(HomePage && (route.path === "/" || route.path === ""))
|
|
2505
2205
|
).map((route) => {
|
|
2506
2206
|
const loaderKey = Object.keys(modules).find(
|
|
@@ -2509,23 +2209,35 @@ function AppShell({
|
|
|
2509
2209
|
const loader = loaderKey ? modules[loaderKey] : null;
|
|
2510
2210
|
return {
|
|
2511
2211
|
...route,
|
|
2512
|
-
Component:
|
|
2212
|
+
Component: import_react16.default.lazy(() => {
|
|
2513
2213
|
if (!loader)
|
|
2514
|
-
return Promise.resolve({ default: () => /* @__PURE__ */ (0,
|
|
2214
|
+
return Promise.resolve({ default: () => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(NotFound, {}) });
|
|
2515
2215
|
return loader();
|
|
2516
2216
|
})
|
|
2517
2217
|
};
|
|
2518
2218
|
});
|
|
2519
|
-
|
|
2219
|
+
};
|
|
2220
|
+
const [resolvedRoutes, setResolvedRoutes] = (0, import_react16.useState)(
|
|
2221
|
+
() => resolveRoutes(initialRoutes)
|
|
2222
|
+
);
|
|
2223
|
+
(0, import_react16.useEffect)(() => {
|
|
2224
|
+
if (hot) {
|
|
2225
|
+
hot.on("boltdocs:routes-update", (newRoutes) => {
|
|
2226
|
+
setRoutesInfo(newRoutes);
|
|
2227
|
+
});
|
|
2228
|
+
}
|
|
2229
|
+
}, [hot]);
|
|
2230
|
+
(0, import_react16.useEffect)(() => {
|
|
2231
|
+
setResolvedRoutes(resolveRoutes(routesInfo));
|
|
2520
2232
|
}, [routesInfo, modules]);
|
|
2521
|
-
return /* @__PURE__ */ (0,
|
|
2522
|
-
/* @__PURE__ */ (0,
|
|
2523
|
-
/* @__PURE__ */ (0,
|
|
2524
|
-
HomePage && /* @__PURE__ */ (0,
|
|
2233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(PreloadProvider, { routes: routesInfo, modules, children: [
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ScrollHandler, {}),
|
|
2235
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react_router_dom9.Routes, { children: [
|
|
2236
|
+
HomePage && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2525
2237
|
import_react_router_dom9.Route,
|
|
2526
2238
|
{
|
|
2527
2239
|
path: "/",
|
|
2528
|
-
element: /* @__PURE__ */ (0,
|
|
2240
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2529
2241
|
ThemeLayout,
|
|
2530
2242
|
{
|
|
2531
2243
|
config,
|
|
@@ -2534,36 +2246,43 @@ function AppShell({
|
|
|
2534
2246
|
toc: null,
|
|
2535
2247
|
breadcrumbs: null,
|
|
2536
2248
|
...config.themeConfig?.layoutProps,
|
|
2537
|
-
children: /* @__PURE__ */ (0,
|
|
2249
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(HomePage, {})
|
|
2538
2250
|
}
|
|
2539
2251
|
)
|
|
2540
2252
|
}
|
|
2541
2253
|
),
|
|
2542
|
-
/* @__PURE__ */ (0,
|
|
2254
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2543
2255
|
import_react_router_dom9.Route,
|
|
2544
2256
|
{
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2257
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DocsLayout, { config, routes: routesInfo }),
|
|
2258
|
+
children: resolvedRoutes.map((route) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2259
|
+
import_react_router_dom9.Route,
|
|
2548
2260
|
{
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2261
|
+
path: route.path === "" ? "/" : route.path,
|
|
2262
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react16.default.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Loading, {}), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2263
|
+
MdxPage,
|
|
2264
|
+
{
|
|
2265
|
+
Component: route.Component,
|
|
2266
|
+
customComponents
|
|
2267
|
+
}
|
|
2268
|
+
) })
|
|
2269
|
+
},
|
|
2270
|
+
route.path
|
|
2271
|
+
))
|
|
2553
2272
|
},
|
|
2554
|
-
|
|
2555
|
-
)
|
|
2556
|
-
/* @__PURE__ */ (0,
|
|
2273
|
+
"docs-layout"
|
|
2274
|
+
),
|
|
2275
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2557
2276
|
import_react_router_dom9.Route,
|
|
2558
2277
|
{
|
|
2559
2278
|
path: "*",
|
|
2560
|
-
element: /* @__PURE__ */ (0,
|
|
2279
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2561
2280
|
ThemeLayout,
|
|
2562
2281
|
{
|
|
2563
2282
|
config,
|
|
2564
2283
|
routes: routesInfo,
|
|
2565
2284
|
...config.themeConfig?.layoutProps,
|
|
2566
|
-
children: /* @__PURE__ */ (0,
|
|
2285
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(NotFound, {})
|
|
2567
2286
|
}
|
|
2568
2287
|
)
|
|
2569
2288
|
}
|
|
@@ -2573,7 +2292,7 @@ function AppShell({
|
|
|
2573
2292
|
}
|
|
2574
2293
|
function ScrollHandler() {
|
|
2575
2294
|
const { pathname, hash } = (0, import_react_router_dom9.useLocation)();
|
|
2576
|
-
(0,
|
|
2295
|
+
(0, import_react18.useLayoutEffect)(() => {
|
|
2577
2296
|
if (hash) {
|
|
2578
2297
|
const id = hash.replace("#", "");
|
|
2579
2298
|
const element = document.getElementById(id);
|
|
@@ -2598,13 +2317,13 @@ function DocsLayout({
|
|
|
2598
2317
|
config,
|
|
2599
2318
|
routes
|
|
2600
2319
|
}) {
|
|
2601
|
-
return /* @__PURE__ */ (0,
|
|
2320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2602
2321
|
ThemeLayout,
|
|
2603
2322
|
{
|
|
2604
2323
|
config,
|
|
2605
2324
|
routes,
|
|
2606
2325
|
...config.themeConfig?.layoutProps,
|
|
2607
|
-
children: /* @__PURE__ */ (0,
|
|
2326
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_router_dom9.Outlet, {})
|
|
2608
2327
|
}
|
|
2609
2328
|
);
|
|
2610
2329
|
}
|
|
@@ -2613,80 +2332,60 @@ function MdxPage({
|
|
|
2613
2332
|
customComponents = {}
|
|
2614
2333
|
}) {
|
|
2615
2334
|
const allComponents = { ...mdxComponents, ...customComponents };
|
|
2616
|
-
return /* @__PURE__ */ (0,
|
|
2335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react17.MDXProvider, { components: allComponents, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Component, {}) });
|
|
2617
2336
|
}
|
|
2618
|
-
var
|
|
2337
|
+
var import_react16, import_client, import_react_router_dom9, import_react17, import_react18, import_lucide_react14, import_jsx_runtime27, ConfigContext, CodeBlock2, Video2, PackageManagerTabs2, Heading, mdxComponents;
|
|
2619
2338
|
var init_app = __esm({
|
|
2620
2339
|
"src/client/app/index.tsx"() {
|
|
2621
2340
|
"use strict";
|
|
2622
|
-
|
|
2341
|
+
import_react16 = __toESM(require("react"));
|
|
2623
2342
|
import_client = __toESM(require("react-dom/client"));
|
|
2624
2343
|
import_react_router_dom9 = require("react-router-dom");
|
|
2625
2344
|
init_Layout2();
|
|
2626
2345
|
init_NotFound2();
|
|
2627
2346
|
init_Loading2();
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
init_mdx();
|
|
2347
|
+
import_react17 = require("@mdx-js/react");
|
|
2348
|
+
import_react18 = require("react");
|
|
2349
|
+
import_lucide_react14 = require("lucide-react");
|
|
2632
2350
|
init_preload();
|
|
2633
|
-
|
|
2634
|
-
ConfigContext = (0,
|
|
2635
|
-
CodeBlock2 = (0,
|
|
2351
|
+
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2352
|
+
ConfigContext = (0, import_react18.createContext)(null);
|
|
2353
|
+
CodeBlock2 = (0, import_react18.lazy)(
|
|
2636
2354
|
() => Promise.resolve().then(() => (init_CodeBlock2(), CodeBlock_exports)).then((m) => ({
|
|
2637
2355
|
default: m.CodeBlock
|
|
2638
2356
|
}))
|
|
2639
2357
|
);
|
|
2640
|
-
Video2 = (0,
|
|
2358
|
+
Video2 = (0, import_react18.lazy)(
|
|
2641
2359
|
() => Promise.resolve().then(() => (init_Video2(), Video_exports)).then((m) => ({ default: m.Video }))
|
|
2642
2360
|
);
|
|
2643
|
-
PackageManagerTabs2 = (0,
|
|
2361
|
+
PackageManagerTabs2 = (0, import_react18.lazy)(
|
|
2644
2362
|
() => Promise.resolve().then(() => (init_PackageManagerTabs2(), PackageManagerTabs_exports)).then((m) => ({
|
|
2645
2363
|
default: m.PackageManagerTabs
|
|
2646
2364
|
}))
|
|
2647
2365
|
);
|
|
2648
|
-
Playground2 = (0, import_react21.lazy)(
|
|
2649
|
-
() => Promise.resolve().then(() => (init_Playground2(), Playground_exports)).then((m) => ({
|
|
2650
|
-
default: m.Playground
|
|
2651
|
-
}))
|
|
2652
|
-
);
|
|
2653
2366
|
Heading = ({
|
|
2654
2367
|
level,
|
|
2655
2368
|
id,
|
|
2656
2369
|
children
|
|
2657
2370
|
}) => {
|
|
2658
2371
|
const Tag = `h${level}`;
|
|
2659
|
-
return /* @__PURE__ */ (0,
|
|
2372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Tag, { id, className: "boltdocs-heading", children: [
|
|
2660
2373
|
children,
|
|
2661
|
-
id && /* @__PURE__ */ (0,
|
|
2374
|
+
id && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("a", { href: `#${id}`, className: "header-anchor", "aria-label": "Anchor", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react14.Link, { size: 16 }) })
|
|
2662
2375
|
] });
|
|
2663
2376
|
};
|
|
2664
2377
|
mdxComponents = {
|
|
2665
|
-
h1: (props) => /* @__PURE__ */ (0,
|
|
2666
|
-
h2: (props) => /* @__PURE__ */ (0,
|
|
2667
|
-
h3: (props) => /* @__PURE__ */ (0,
|
|
2668
|
-
h4: (props) => /* @__PURE__ */ (0,
|
|
2669
|
-
h5: (props) => /* @__PURE__ */ (0,
|
|
2670
|
-
h6: (props) => /* @__PURE__ */ (0,
|
|
2378
|
+
h1: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Heading, { level: 1, ...props }),
|
|
2379
|
+
h2: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Heading, { level: 2, ...props }),
|
|
2380
|
+
h3: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Heading, { level: 3, ...props }),
|
|
2381
|
+
h4: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Heading, { level: 4, ...props }),
|
|
2382
|
+
h5: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Heading, { level: 5, ...props }),
|
|
2383
|
+
h6: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Heading, { level: 6, ...props }),
|
|
2671
2384
|
pre: (props) => {
|
|
2672
|
-
return /* @__PURE__ */ (0,
|
|
2385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react18.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "code-block-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CodeBlock2, { ...props, children: props.children }) });
|
|
2673
2386
|
},
|
|
2674
|
-
video: (props) => /* @__PURE__ */ (0,
|
|
2675
|
-
PackageManagerTabs: (props) => /* @__PURE__ */ (0,
|
|
2676
|
-
Playground: (props) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react21.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "playground-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Playground2, { ...props }) }),
|
|
2677
|
-
Button,
|
|
2678
|
-
Badge,
|
|
2679
|
-
Card,
|
|
2680
|
-
Cards,
|
|
2681
|
-
Tabs,
|
|
2682
|
-
Tab,
|
|
2683
|
-
Admonition,
|
|
2684
|
-
Note,
|
|
2685
|
-
Tip,
|
|
2686
|
-
Warning,
|
|
2687
|
-
Danger,
|
|
2688
|
-
InfoBox,
|
|
2689
|
-
List
|
|
2387
|
+
video: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react18.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "video-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Video2, { ...props }) }),
|
|
2388
|
+
PackageManagerTabs: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react18.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "pkg-tabs-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(PackageManagerTabs2, { ...props }) })
|
|
2690
2389
|
};
|
|
2691
2390
|
}
|
|
2692
2391
|
});
|
|
@@ -2697,11 +2396,11 @@ __export(ssr_exports, {
|
|
|
2697
2396
|
render: () => render
|
|
2698
2397
|
});
|
|
2699
2398
|
module.exports = __toCommonJS(ssr_exports);
|
|
2700
|
-
var
|
|
2399
|
+
var import_react19 = __toESM(require("react"));
|
|
2701
2400
|
var import_server = __toESM(require("react-dom/server"));
|
|
2702
2401
|
var import_server2 = require("react-router-dom/server");
|
|
2703
2402
|
init_app();
|
|
2704
|
-
var
|
|
2403
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2705
2404
|
async function render(options) {
|
|
2706
2405
|
const { path, routes, config, modules, homePage } = options;
|
|
2707
2406
|
const resolvedModules = {};
|
|
@@ -2709,7 +2408,7 @@ async function render(options) {
|
|
|
2709
2408
|
resolvedModules[key] = () => Promise.resolve(mod);
|
|
2710
2409
|
}
|
|
2711
2410
|
const html = import_server.default.renderToString(
|
|
2712
|
-
/* @__PURE__ */ (0,
|
|
2411
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react19.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_server2.StaticRouter, { location: path, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2713
2412
|
AppShell,
|
|
2714
2413
|
{
|
|
2715
2414
|
initialRoutes: routes,
|