boltdocs 1.5.0 → 1.7.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/{PackageManagerTabs-XW3AVXVX.mjs → PackageManagerTabs-NVT7G625.mjs} +1 -1
- package/dist/{SearchDialog-CEVPEMT3.css → SearchDialog-UOAW6IR3.css} +361 -113
- package/dist/{SearchDialog-5ISK64QY.mjs → SearchDialog-YOXMFGH6.mjs} +1 -1
- package/dist/{chunk-S5G55FBI.mjs → chunk-7SFUJWTB.mjs} +4 -4
- package/dist/{chunk-FMQ4HRKZ.mjs → chunk-MULKZFVN.mjs} +873 -759
- package/dist/client/index.css +361 -113
- package/dist/client/index.d.mts +39 -8
- package/dist/client/index.d.ts +39 -8
- package/dist/client/index.js +722 -467
- package/dist/client/index.mjs +197 -58
- package/dist/client/ssr.css +361 -113
- package/dist/client/ssr.d.mts +3 -1
- package/dist/client/ssr.d.ts +3 -1
- package/dist/client/ssr.js +533 -412
- package/dist/client/ssr.mjs +3 -2
- package/dist/{config-DkZg5aCf.d.ts → config-D68h41CA.d.mts} +21 -2
- package/dist/{config-DkZg5aCf.d.mts → config-D68h41CA.d.ts} +21 -2
- package/dist/node/index.d.mts +10 -2
- package/dist/node/index.d.ts +10 -2
- package/dist/node/index.js +45 -21
- package/dist/node/index.mjs +45 -21
- package/dist/{types-DGIo1VKD.d.ts → types-CviV0GbX.d.mts} +13 -0
- package/dist/{types-DGIo1VKD.d.mts → types-CviV0GbX.d.ts} +13 -0
- package/package.json +1 -1
- package/src/client/app/index.tsx +8 -4
- package/src/client/index.ts +4 -0
- package/src/client/ssr.tsx +4 -1
- package/src/client/theme/components/mdx/FileTree.tsx +229 -0
- package/src/client/theme/components/mdx/Table.tsx +53 -0
- package/src/client/theme/components/mdx/Tabs.tsx +1 -4
- package/src/client/theme/components/mdx/index.ts +6 -0
- package/src/client/theme/components/mdx/mdx-components.css +158 -0
- package/src/client/theme/icons/pnpm.tsx +5 -5
- package/src/client/theme/styles/markdown.css +8 -3
- package/src/client/theme/styles/variables.css +10 -9
- package/src/client/theme/ui/Layout/Layout.tsx +2 -10
- package/src/client/theme/ui/Layout/base.css +15 -3
- package/src/client/theme/ui/Link/Link.tsx +2 -2
- package/src/client/theme/ui/Link/LinkPreview.tsx +9 -14
- package/src/client/theme/ui/Link/link-preview.css +30 -27
- package/src/client/theme/ui/Navbar/Navbar.tsx +65 -17
- package/src/client/theme/ui/Navbar/Tabs.tsx +74 -0
- package/src/client/theme/ui/Navbar/navbar.css +111 -5
- package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +65 -49
- package/src/client/theme/ui/OnThisPage/toc.css +30 -10
- package/src/client/theme/ui/Sidebar/Sidebar.tsx +97 -57
- package/src/client/theme/ui/Sidebar/sidebar.css +61 -67
- package/src/client/types.ts +10 -0
- package/src/node/config.ts +19 -1
- package/src/node/plugin/entry.ts +5 -1
- package/src/node/plugin/index.ts +2 -1
- package/src/node/routes/index.ts +12 -1
- package/src/node/routes/parser.ts +21 -7
- package/src/node/routes/types.ts +9 -1
- package/src/node/ssg/index.ts +2 -1
- package/src/node/ssg/options.ts +2 -0
- package/src/client/theme/icons/yarn.tsx +0 -16
package/dist/client/index.js
CHANGED
|
@@ -88,30 +88,25 @@ function LinkPreview({
|
|
|
88
88
|
x,
|
|
89
89
|
y
|
|
90
90
|
}) {
|
|
91
|
-
const [mounted, setMounted] = (0, import_react2.useState)(false);
|
|
92
91
|
const ref = (0, import_react2.useRef)(null);
|
|
93
92
|
const [position, setPosition] = (0, import_react2.useState)({ top: 0, left: 0 });
|
|
94
93
|
(0, import_react2.useEffect)(() => {
|
|
95
|
-
|
|
96
|
-
}, []);
|
|
97
|
-
(0, import_react2.useEffect)(() => {
|
|
98
|
-
if (isVisible && ref.current) {
|
|
94
|
+
if (ref.current) {
|
|
99
95
|
const rect = ref.current.getBoundingClientRect();
|
|
100
|
-
const padding =
|
|
96
|
+
const padding = 12;
|
|
101
97
|
let top = y + padding;
|
|
102
98
|
let left = x + padding;
|
|
103
|
-
if (left + rect.width > window.innerWidth) {
|
|
99
|
+
if (left + rect.width > window.innerWidth - 20) {
|
|
104
100
|
left = x - rect.width - padding;
|
|
105
101
|
}
|
|
106
|
-
if (top + rect.height > window.innerHeight) {
|
|
102
|
+
if (top + rect.height > window.innerHeight - 20) {
|
|
107
103
|
top = y - rect.height - padding;
|
|
108
104
|
}
|
|
109
105
|
setPosition({ top, left });
|
|
110
106
|
}
|
|
111
|
-
}, [
|
|
112
|
-
if (!mounted) return null;
|
|
107
|
+
}, [x, y, isVisible]);
|
|
113
108
|
return (0, import_react_dom.createPortal)(
|
|
114
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
115
110
|
"div",
|
|
116
111
|
{
|
|
117
112
|
ref,
|
|
@@ -120,10 +115,10 @@ function LinkPreview({
|
|
|
120
115
|
top: position.top,
|
|
121
116
|
left: position.left
|
|
122
117
|
},
|
|
123
|
-
children: [
|
|
118
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "boltdocs-link-preview-content", children: [
|
|
124
119
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "boltdocs-link-preview-title", children: title }),
|
|
125
120
|
summary && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "boltdocs-link-preview-summary", children: summary })
|
|
126
|
-
]
|
|
121
|
+
] })
|
|
127
122
|
}
|
|
128
123
|
),
|
|
129
124
|
document.body
|
|
@@ -293,7 +288,7 @@ var init_Link = __esm({
|
|
|
293
288
|
...rest
|
|
294
289
|
}
|
|
295
290
|
),
|
|
296
|
-
shouldShowPreview && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
291
|
+
preview.visible && shouldShowPreview && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
297
292
|
LinkPreview,
|
|
298
293
|
{
|
|
299
294
|
isVisible: preview.visible,
|
|
@@ -394,7 +389,7 @@ var init_Link = __esm({
|
|
|
394
389
|
...rest
|
|
395
390
|
}
|
|
396
391
|
),
|
|
397
|
-
shouldShowPreview && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
392
|
+
preview.visible && shouldShowPreview && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
398
393
|
LinkPreview,
|
|
399
394
|
{
|
|
400
395
|
isVisible: preview.visible,
|
|
@@ -841,6 +836,58 @@ var init_GithubStars = __esm({
|
|
|
841
836
|
}
|
|
842
837
|
});
|
|
843
838
|
|
|
839
|
+
// src/client/theme/ui/Navbar/Tabs.tsx
|
|
840
|
+
function Tabs({ tabs, routes }) {
|
|
841
|
+
const location = (0, import_react_router_dom4.useLocation)();
|
|
842
|
+
const currentRoute = routes.find((r) => r.path === location.pathname);
|
|
843
|
+
const currentTabId = currentRoute?.tab?.toLowerCase();
|
|
844
|
+
if (!tabs || tabs.length === 0) return null;
|
|
845
|
+
const renderTabIcon = (iconName) => {
|
|
846
|
+
if (!iconName) return null;
|
|
847
|
+
if (iconName.trim().startsWith("<svg")) {
|
|
848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
849
|
+
"span",
|
|
850
|
+
{
|
|
851
|
+
className: "tab-icon svg-icon",
|
|
852
|
+
dangerouslySetInnerHTML: { __html: iconName }
|
|
853
|
+
}
|
|
854
|
+
);
|
|
855
|
+
}
|
|
856
|
+
const LucideIcon = Icons[iconName];
|
|
857
|
+
if (LucideIcon) {
|
|
858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LucideIcon, { size: 16, className: "tab-icon lucide-icon" });
|
|
859
|
+
}
|
|
860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("img", { src: iconName, alt: "", className: "tab-icon img-icon" });
|
|
861
|
+
};
|
|
862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "boltdocs-tabs-container", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "boltdocs-tabs", children: tabs.map((tab, index) => {
|
|
863
|
+
const isActive = currentTabId ? currentTabId === tab.id.toLowerCase() : index === 0;
|
|
864
|
+
const firstRoute = routes.find((r) => r.tab && r.tab.toLowerCase() === tab.id.toLowerCase());
|
|
865
|
+
const linkTo = firstRoute ? firstRoute.path : "#";
|
|
866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
867
|
+
Link,
|
|
868
|
+
{
|
|
869
|
+
to: linkTo,
|
|
870
|
+
className: `boltdocs-tab-item ${isActive ? "active" : ""}`,
|
|
871
|
+
children: [
|
|
872
|
+
renderTabIcon(tab.icon),
|
|
873
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: tab.text })
|
|
874
|
+
]
|
|
875
|
+
},
|
|
876
|
+
tab.id
|
|
877
|
+
);
|
|
878
|
+
}) }) });
|
|
879
|
+
}
|
|
880
|
+
var import_react_router_dom4, Icons, import_jsx_runtime11;
|
|
881
|
+
var init_Tabs = __esm({
|
|
882
|
+
"src/client/theme/ui/Navbar/Tabs.tsx"() {
|
|
883
|
+
"use strict";
|
|
884
|
+
import_react_router_dom4 = require("react-router-dom");
|
|
885
|
+
init_Link2();
|
|
886
|
+
Icons = __toESM(require("lucide-react"));
|
|
887
|
+
import_jsx_runtime11 = require("react/jsx-runtime");
|
|
888
|
+
}
|
|
889
|
+
});
|
|
890
|
+
|
|
844
891
|
// src/client/theme/ui/SearchDialog/SearchDialog.tsx
|
|
845
892
|
function SearchDialog({ routes }) {
|
|
846
893
|
const [isOpen, setIsOpen] = (0, import_react8.useState)(false);
|
|
@@ -907,8 +954,8 @@ function SearchDialog({ routes }) {
|
|
|
907
954
|
}
|
|
908
955
|
return uniqueResults.slice(0, 10);
|
|
909
956
|
}, [routes, query]);
|
|
910
|
-
return /* @__PURE__ */ (0,
|
|
911
|
-
/* @__PURE__ */ (0,
|
|
957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
958
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
912
959
|
"div",
|
|
913
960
|
{
|
|
914
961
|
className: "navbar-search",
|
|
@@ -923,19 +970,19 @@ function SearchDialog({ routes }) {
|
|
|
923
970
|
},
|
|
924
971
|
"aria-label": "Open search dialog",
|
|
925
972
|
children: [
|
|
926
|
-
/* @__PURE__ */ (0,
|
|
973
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Search, { className: "boltdocs-search-icon", size: 18 }),
|
|
927
974
|
"Search docs...",
|
|
928
|
-
/* @__PURE__ */ (0,
|
|
975
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("kbd", { children: "\u2318K" })
|
|
929
976
|
]
|
|
930
977
|
}
|
|
931
978
|
),
|
|
932
979
|
isOpen && (0, import_react_dom2.createPortal)(
|
|
933
|
-
/* @__PURE__ */ (0,
|
|
980
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
934
981
|
"div",
|
|
935
982
|
{
|
|
936
983
|
className: "boltdocs-search-overlay",
|
|
937
984
|
onPointerDown: () => setIsOpen(false),
|
|
938
|
-
children: /* @__PURE__ */ (0,
|
|
985
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
939
986
|
"div",
|
|
940
987
|
{
|
|
941
988
|
className: "boltdocs-search-modal",
|
|
@@ -944,9 +991,9 @@ function SearchDialog({ routes }) {
|
|
|
944
991
|
"aria-label": "Search",
|
|
945
992
|
onPointerDown: (e) => e.stopPropagation(),
|
|
946
993
|
children: [
|
|
947
|
-
/* @__PURE__ */ (0,
|
|
948
|
-
/* @__PURE__ */ (0,
|
|
949
|
-
/* @__PURE__ */ (0,
|
|
994
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "boltdocs-search-header", children: [
|
|
995
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Search, { size: 18 }),
|
|
996
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
950
997
|
"input",
|
|
951
998
|
{
|
|
952
999
|
ref: inputRef,
|
|
@@ -957,7 +1004,7 @@ function SearchDialog({ routes }) {
|
|
|
957
1004
|
onChange: (e) => setQuery(e.target.value)
|
|
958
1005
|
}
|
|
959
1006
|
),
|
|
960
|
-
/* @__PURE__ */ (0,
|
|
1007
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
961
1008
|
"button",
|
|
962
1009
|
{
|
|
963
1010
|
className: "boltdocs-search-close",
|
|
@@ -967,7 +1014,7 @@ function SearchDialog({ routes }) {
|
|
|
967
1014
|
}
|
|
968
1015
|
)
|
|
969
1016
|
] }),
|
|
970
|
-
/* @__PURE__ */ (0,
|
|
1017
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "boltdocs-search-results", children: searchResults.length > 0 ? searchResults.map((result) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
971
1018
|
Link,
|
|
972
1019
|
{
|
|
973
1020
|
to: result.path === "" ? "/" : result.path,
|
|
@@ -994,15 +1041,15 @@ function SearchDialog({ routes }) {
|
|
|
994
1041
|
setIsOpen(false);
|
|
995
1042
|
},
|
|
996
1043
|
children: [
|
|
997
|
-
/* @__PURE__ */ (0,
|
|
998
|
-
result.isHeading ? /* @__PURE__ */ (0,
|
|
1044
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "boltdocs-search-result-title", children: [
|
|
1045
|
+
result.isHeading ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "heading-indicator", children: "#" }) : null,
|
|
999
1046
|
result.title
|
|
1000
1047
|
] }),
|
|
1001
|
-
result.groupTitle && /* @__PURE__ */ (0,
|
|
1048
|
+
result.groupTitle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "boltdocs-search-result-group", children: result.groupTitle })
|
|
1002
1049
|
]
|
|
1003
1050
|
},
|
|
1004
1051
|
result.path
|
|
1005
|
-
)) : /* @__PURE__ */ (0,
|
|
1052
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "boltdocs-search-empty", children: [
|
|
1006
1053
|
'No results found for "',
|
|
1007
1054
|
query,
|
|
1008
1055
|
'"'
|
|
@@ -1016,7 +1063,7 @@ function SearchDialog({ routes }) {
|
|
|
1016
1063
|
)
|
|
1017
1064
|
] });
|
|
1018
1065
|
}
|
|
1019
|
-
var import_react8, import_react_dom2, import_lucide_react4,
|
|
1066
|
+
var import_react8, import_react_dom2, import_lucide_react4, import_jsx_runtime12;
|
|
1020
1067
|
var init_SearchDialog = __esm({
|
|
1021
1068
|
"src/client/theme/ui/SearchDialog/SearchDialog.tsx"() {
|
|
1022
1069
|
"use strict";
|
|
@@ -1024,7 +1071,7 @@ var init_SearchDialog = __esm({
|
|
|
1024
1071
|
import_react_dom2 = require("react-dom");
|
|
1025
1072
|
init_Link2();
|
|
1026
1073
|
import_lucide_react4 = require("lucide-react");
|
|
1027
|
-
|
|
1074
|
+
import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1028
1075
|
}
|
|
1029
1076
|
});
|
|
1030
1077
|
|
|
@@ -1048,88 +1095,130 @@ function Navbar({
|
|
|
1048
1095
|
currentLocale,
|
|
1049
1096
|
currentVersion
|
|
1050
1097
|
}) {
|
|
1098
|
+
const location = (0, import_react_router_dom5.useLocation)();
|
|
1099
|
+
const isHomePage = location.pathname === "/";
|
|
1051
1100
|
const title = config.themeConfig?.title || "Boltdocs";
|
|
1052
1101
|
const navItems = config.themeConfig?.navbar || [];
|
|
1053
1102
|
const socialLinks = config.themeConfig?.socialLinks || [];
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1066
|
-
"img",
|
|
1067
|
-
{
|
|
1068
|
-
src: config.themeConfig.logo,
|
|
1069
|
-
alt: title,
|
|
1070
|
-
className: "navbar-logo-img"
|
|
1071
|
-
}
|
|
1072
|
-
) : null,
|
|
1073
|
-
title
|
|
1074
|
-
] }) }),
|
|
1075
|
-
config.versions && currentVersion && allRoutes ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1076
|
-
VersionSwitcher,
|
|
1103
|
+
const hasTabs = !isHomePage && config.themeConfig?.tabs && config.themeConfig.tabs.length > 0;
|
|
1104
|
+
const leftItems = navItems.filter((item) => item.position !== "right");
|
|
1105
|
+
const rightItems = navItems.filter((item) => item.position === "right");
|
|
1106
|
+
const renderNavItem = (item, i) => {
|
|
1107
|
+
const text = item.label || item.text || "";
|
|
1108
|
+
const href = item.to || item.href || item.link || "";
|
|
1109
|
+
const isExternal = href.startsWith("http") || href.startsWith("//") || href.includes("://");
|
|
1110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_router_dom5.Link, { to: href, target: isExternal ? "_blank" : void 0, children: [
|
|
1111
|
+
text,
|
|
1112
|
+
isExternal && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "navbar-external-icon", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1113
|
+
"svg",
|
|
1077
1114
|
{
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1092
|
-
import_react9.default.Suspense,
|
|
1093
|
-
{
|
|
1094
|
-
fallback: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "navbar-search-placeholder" }),
|
|
1095
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SearchDialog2, { routes: routes || [] })
|
|
1096
|
-
}
|
|
1097
|
-
),
|
|
1098
|
-
config.i18n && currentLocale && allRoutes && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1099
|
-
LanguageSwitcher,
|
|
1100
|
-
{
|
|
1101
|
-
i18n: config.i18n,
|
|
1102
|
-
currentLocale,
|
|
1103
|
-
allRoutes
|
|
1115
|
+
viewBox: "0 0 24 24",
|
|
1116
|
+
width: "13",
|
|
1117
|
+
height: "13",
|
|
1118
|
+
stroke: "currentColor",
|
|
1119
|
+
strokeWidth: "2",
|
|
1120
|
+
fill: "none",
|
|
1121
|
+
strokeLinecap: "round",
|
|
1122
|
+
strokeLinejoin: "round",
|
|
1123
|
+
children: [
|
|
1124
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
1125
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("polyline", { points: "15 3 21 3 21 9" }),
|
|
1126
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
1127
|
+
]
|
|
1104
1128
|
}
|
|
1105
|
-
)
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1129
|
+
) })
|
|
1130
|
+
] }, i);
|
|
1131
|
+
};
|
|
1132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { className: `boltdocs-navbar ${hasTabs ? "has-tabs" : ""}`, children: [
|
|
1133
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1134
|
+
"div",
|
|
1135
|
+
{
|
|
1136
|
+
className: "navbar-container",
|
|
1137
|
+
style: { height: "var(--ld-navbar-height)" },
|
|
1138
|
+
children: [
|
|
1139
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "navbar-left", children: [
|
|
1140
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "navbar-logo", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_router_dom5.Link, { to: "/", children: [
|
|
1141
|
+
config.themeConfig?.logo ? config.themeConfig.logo.trim().startsWith("<svg") ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1142
|
+
"span",
|
|
1143
|
+
{
|
|
1144
|
+
className: "navbar-logo-svg",
|
|
1145
|
+
dangerouslySetInnerHTML: {
|
|
1146
|
+
__html: config.themeConfig.logo
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1150
|
+
"img",
|
|
1151
|
+
{
|
|
1152
|
+
src: config.themeConfig.logo,
|
|
1153
|
+
alt: title,
|
|
1154
|
+
className: "navbar-logo-img"
|
|
1155
|
+
}
|
|
1156
|
+
) : null,
|
|
1157
|
+
title
|
|
1158
|
+
] }) }),
|
|
1159
|
+
config.versions && currentVersion && allRoutes ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1160
|
+
VersionSwitcher,
|
|
1161
|
+
{
|
|
1162
|
+
versions: config.versions,
|
|
1163
|
+
currentVersion,
|
|
1164
|
+
currentLocale,
|
|
1165
|
+
allRoutes
|
|
1166
|
+
}
|
|
1167
|
+
) : config.themeConfig?.version ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "navbar-version", children: [
|
|
1168
|
+
config.themeConfig.version,
|
|
1169
|
+
" ",
|
|
1170
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.ChevronDown, { size: 14 })
|
|
1171
|
+
] }) : null,
|
|
1172
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("nav", { className: "navbar-links", "aria-label": "Top Navigation Left", children: leftItems.map(renderNavItem) })
|
|
1173
|
+
] }),
|
|
1174
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "navbar-right", children: [
|
|
1175
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("nav", { className: "navbar-links", "aria-label": "Top Navigation Right", children: rightItems.map(renderNavItem) }),
|
|
1176
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react9.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "navbar-search-placeholder" }), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SearchDialog2, { routes: routes || [] }) }),
|
|
1177
|
+
config.i18n && currentLocale && allRoutes && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1178
|
+
LanguageSwitcher,
|
|
1179
|
+
{
|
|
1180
|
+
i18n: config.i18n,
|
|
1181
|
+
currentLocale,
|
|
1182
|
+
allRoutes
|
|
1183
|
+
}
|
|
1184
|
+
),
|
|
1185
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ThemeToggle, {}),
|
|
1186
|
+
config.themeConfig?.githubRepo && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GithubStars, { repo: config.themeConfig.githubRepo }),
|
|
1187
|
+
socialLinks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "navbar-divider" }),
|
|
1188
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "navbar-icons", children: socialLinks.map((link, i) => {
|
|
1189
|
+
const IconComp = ICON_MAP[link.icon.toLowerCase()];
|
|
1190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1191
|
+
"a",
|
|
1192
|
+
{
|
|
1193
|
+
href: link.link,
|
|
1194
|
+
target: "_blank",
|
|
1195
|
+
rel: "noopener noreferrer",
|
|
1196
|
+
className: "navbar-icon-btn",
|
|
1197
|
+
"aria-label": link.icon,
|
|
1198
|
+
children: IconComp ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconComp, {}) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: link.icon })
|
|
1199
|
+
},
|
|
1200
|
+
i
|
|
1201
|
+
);
|
|
1202
|
+
}) })
|
|
1203
|
+
] })
|
|
1204
|
+
]
|
|
1205
|
+
}
|
|
1206
|
+
),
|
|
1207
|
+
hasTabs && config.themeConfig?.tabs && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1208
|
+
Tabs,
|
|
1209
|
+
{
|
|
1210
|
+
tabs: config.themeConfig.tabs,
|
|
1211
|
+
routes: allRoutes || routes || []
|
|
1212
|
+
}
|
|
1213
|
+
)
|
|
1214
|
+
] });
|
|
1126
1215
|
}
|
|
1127
|
-
var import_react9, import_lucide_react5,
|
|
1216
|
+
var import_react9, import_react_router_dom5, import_lucide_react5, import_jsx_runtime13, SearchDialog2, ICON_MAP;
|
|
1128
1217
|
var init_Navbar = __esm({
|
|
1129
1218
|
"src/client/theme/ui/Navbar/Navbar.tsx"() {
|
|
1130
1219
|
"use strict";
|
|
1131
|
-
import_react9 =
|
|
1132
|
-
|
|
1220
|
+
import_react9 = require("react");
|
|
1221
|
+
import_react_router_dom5 = require("react-router-dom");
|
|
1133
1222
|
import_lucide_react5 = require("lucide-react");
|
|
1134
1223
|
init_LanguageSwitcher2();
|
|
1135
1224
|
init_VersionSwitcher2();
|
|
@@ -1137,8 +1226,9 @@ var init_Navbar = __esm({
|
|
|
1137
1226
|
init_discord();
|
|
1138
1227
|
init_twitter();
|
|
1139
1228
|
init_GithubStars();
|
|
1140
|
-
|
|
1141
|
-
|
|
1229
|
+
init_Tabs();
|
|
1230
|
+
import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1231
|
+
SearchDialog2 = (0, import_react9.lazy)(
|
|
1142
1232
|
() => Promise.resolve().then(() => (init_SearchDialog2(), SearchDialog_exports)).then((m) => ({ default: m.SearchDialog }))
|
|
1143
1233
|
);
|
|
1144
1234
|
ICON_MAP = {
|
|
@@ -1159,7 +1249,7 @@ var init_Navbar2 = __esm({
|
|
|
1159
1249
|
|
|
1160
1250
|
// src/client/theme/ui/PoweredBy/PoweredBy.tsx
|
|
1161
1251
|
function PoweredBy() {
|
|
1162
|
-
return /* @__PURE__ */ (0,
|
|
1252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "powered-by-container", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1163
1253
|
"a",
|
|
1164
1254
|
{
|
|
1165
1255
|
href: "https://github.com/jesusalcaladev/boltdocs",
|
|
@@ -1167,19 +1257,19 @@ function PoweredBy() {
|
|
|
1167
1257
|
rel: "noopener noreferrer",
|
|
1168
1258
|
className: "powered-by-link",
|
|
1169
1259
|
children: [
|
|
1170
|
-
/* @__PURE__ */ (0,
|
|
1171
|
-
/* @__PURE__ */ (0,
|
|
1172
|
-
/* @__PURE__ */ (0,
|
|
1260
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react6.Zap, { className: "powered-by-icon", size: 12, fill: "currentColor" }),
|
|
1261
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Powered by" }),
|
|
1262
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "powered-by-brand", children: "LiteDocs" })
|
|
1173
1263
|
]
|
|
1174
1264
|
}
|
|
1175
1265
|
) });
|
|
1176
1266
|
}
|
|
1177
|
-
var import_lucide_react6,
|
|
1267
|
+
var import_lucide_react6, import_jsx_runtime14;
|
|
1178
1268
|
var init_PoweredBy = __esm({
|
|
1179
1269
|
"src/client/theme/ui/PoweredBy/PoweredBy.tsx"() {
|
|
1180
1270
|
"use strict";
|
|
1181
1271
|
import_lucide_react6 = require("lucide-react");
|
|
1182
|
-
|
|
1272
|
+
import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1183
1273
|
}
|
|
1184
1274
|
});
|
|
1185
1275
|
|
|
@@ -1212,7 +1302,6 @@ function renderBadge(badgeRaw) {
|
|
|
1212
1302
|
}
|
|
1213
1303
|
}
|
|
1214
1304
|
if (!text) return null;
|
|
1215
|
-
if (!text) return null;
|
|
1216
1305
|
let typeClass = "badge-default";
|
|
1217
1306
|
const lowerText = text.toLowerCase();
|
|
1218
1307
|
if (lowerText === "new") {
|
|
@@ -1222,18 +1311,51 @@ function renderBadge(badgeRaw) {
|
|
|
1222
1311
|
} else if (lowerText === "updated") {
|
|
1223
1312
|
typeClass = "badge-updated";
|
|
1224
1313
|
}
|
|
1225
|
-
return /* @__PURE__ */ (0,
|
|
1314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `sidebar-badge ${typeClass}`, children: text });
|
|
1315
|
+
}
|
|
1316
|
+
function renderIcon(iconName, size = 16) {
|
|
1317
|
+
if (!iconName) return null;
|
|
1318
|
+
const trimmed = iconName.trim();
|
|
1319
|
+
if (trimmed.startsWith("<svg") || trimmed.includes("http")) {
|
|
1320
|
+
if (trimmed.startsWith("<svg")) {
|
|
1321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1322
|
+
"span",
|
|
1323
|
+
{
|
|
1324
|
+
className: "sidebar-icon svg-icon",
|
|
1325
|
+
dangerouslySetInnerHTML: { __html: trimmed }
|
|
1326
|
+
}
|
|
1327
|
+
);
|
|
1328
|
+
}
|
|
1329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1330
|
+
"img",
|
|
1331
|
+
{
|
|
1332
|
+
src: trimmed,
|
|
1333
|
+
className: "sidebar-icon",
|
|
1334
|
+
style: { width: size, height: size },
|
|
1335
|
+
alt: ""
|
|
1336
|
+
}
|
|
1337
|
+
);
|
|
1338
|
+
}
|
|
1339
|
+
const IconComponent = LucideIcons[iconName];
|
|
1340
|
+
if (IconComponent) {
|
|
1341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconComponent, { size, className: "sidebar-icon lucide-icon" });
|
|
1342
|
+
}
|
|
1343
|
+
return null;
|
|
1226
1344
|
}
|
|
1227
1345
|
function Sidebar({
|
|
1228
1346
|
routes,
|
|
1229
|
-
config
|
|
1230
|
-
isCollapsed,
|
|
1231
|
-
onToggle
|
|
1347
|
+
config
|
|
1232
1348
|
}) {
|
|
1233
|
-
const location = (0,
|
|
1349
|
+
const location = (0, import_react_router_dom6.useLocation)();
|
|
1350
|
+
const currentRoute = routes.find((r) => r.path === location.pathname);
|
|
1351
|
+
const activeTabId = currentRoute?.tab?.toLowerCase();
|
|
1352
|
+
const filteredRoutes = activeTabId ? routes.filter((r) => {
|
|
1353
|
+
if (!r.tab) return true;
|
|
1354
|
+
return r.tab.toLowerCase() === activeTabId;
|
|
1355
|
+
}) : routes;
|
|
1234
1356
|
const ungrouped = [];
|
|
1235
1357
|
const groupMap = /* @__PURE__ */ new Map();
|
|
1236
|
-
for (const route of
|
|
1358
|
+
for (const route of filteredRoutes) {
|
|
1237
1359
|
if (!route.group) {
|
|
1238
1360
|
ungrouped.push(route);
|
|
1239
1361
|
} else {
|
|
@@ -1241,49 +1363,41 @@ function Sidebar({
|
|
|
1241
1363
|
groupMap.set(route.group, {
|
|
1242
1364
|
slug: route.group,
|
|
1243
1365
|
title: route.groupTitle || route.group,
|
|
1244
|
-
routes: []
|
|
1366
|
+
routes: [],
|
|
1367
|
+
icon: route.groupIcon
|
|
1245
1368
|
});
|
|
1246
1369
|
}
|
|
1247
1370
|
groupMap.get(route.group).routes.push(route);
|
|
1248
1371
|
}
|
|
1249
1372
|
}
|
|
1250
1373
|
const groups = Array.from(groupMap.values());
|
|
1251
|
-
return /* @__PURE__ */ (0,
|
|
1252
|
-
|
|
1253
|
-
"
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
{
|
|
1279
|
-
group,
|
|
1280
|
-
currentPath: location.pathname
|
|
1281
|
-
},
|
|
1282
|
-
group.slug
|
|
1283
|
-
))
|
|
1284
|
-
] }),
|
|
1285
|
-
config.themeConfig?.poweredBy !== false && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PoweredBy, {})
|
|
1286
|
-
] })
|
|
1374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("aside", { className: "boltdocs-sidebar", children: [
|
|
1375
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("nav", { "aria-label": "Main Navigation", children: [
|
|
1376
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "sidebar-list", children: ungrouped.map((route) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1377
|
+
Link,
|
|
1378
|
+
{
|
|
1379
|
+
to: route.path === "" ? "/" : route.path,
|
|
1380
|
+
className: `sidebar-link ${location.pathname === route.path ? "active" : ""}`,
|
|
1381
|
+
"aria-current": location.pathname === route.path ? "page" : void 0,
|
|
1382
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-link-content", children: [
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-link-title-container", children: [
|
|
1384
|
+
renderIcon(route.icon),
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: route.title })
|
|
1386
|
+
] }),
|
|
1387
|
+
renderBadge(route.badge)
|
|
1388
|
+
] })
|
|
1389
|
+
}
|
|
1390
|
+
) }, route.path)) }),
|
|
1391
|
+
groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1392
|
+
SidebarGroupSection,
|
|
1393
|
+
{
|
|
1394
|
+
group,
|
|
1395
|
+
currentPath: location.pathname
|
|
1396
|
+
},
|
|
1397
|
+
group.slug
|
|
1398
|
+
))
|
|
1399
|
+
] }),
|
|
1400
|
+
config.themeConfig?.poweredBy !== false && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PoweredBy, {})
|
|
1287
1401
|
] });
|
|
1288
1402
|
}
|
|
1289
1403
|
function SidebarGroupSection({
|
|
@@ -1292,8 +1406,8 @@ function SidebarGroupSection({
|
|
|
1292
1406
|
}) {
|
|
1293
1407
|
const isActive = group.routes.some((r) => currentPath === r.path);
|
|
1294
1408
|
const [open, setOpen] = (0, import_react10.useState)(true);
|
|
1295
|
-
return /* @__PURE__ */ (0,
|
|
1296
|
-
/* @__PURE__ */ (0,
|
|
1409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-group", children: [
|
|
1410
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1297
1411
|
"button",
|
|
1298
1412
|
{
|
|
1299
1413
|
className: `sidebar-group-header ${isActive ? "active" : ""}`,
|
|
@@ -1301,35 +1415,39 @@ function SidebarGroupSection({
|
|
|
1301
1415
|
"aria-expanded": open,
|
|
1302
1416
|
"aria-controls": `sidebar-group-${group.slug}`,
|
|
1303
1417
|
children: [
|
|
1304
|
-
/* @__PURE__ */ (0,
|
|
1305
|
-
/* @__PURE__ */ (0,
|
|
1418
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "sidebar-group-header-content", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sidebar-group-title", children: group.title }) }),
|
|
1419
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `sidebar-group-chevron ${open ? "open" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react7.ChevronRight, { size: 16 }) })
|
|
1306
1420
|
]
|
|
1307
1421
|
}
|
|
1308
1422
|
),
|
|
1309
|
-
open && /* @__PURE__ */ (0,
|
|
1423
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "sidebar-group-list", id: `sidebar-group-${group.slug}`, children: group.routes.map((route) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1310
1424
|
Link,
|
|
1311
1425
|
{
|
|
1312
1426
|
to: route.path === "" ? "/" : route.path,
|
|
1313
1427
|
className: `sidebar-link sidebar-link-nested ${currentPath === route.path ? "active" : ""}`,
|
|
1314
1428
|
"aria-current": currentPath === route.path ? "page" : void 0,
|
|
1315
|
-
children: /* @__PURE__ */ (0,
|
|
1316
|
-
/* @__PURE__ */ (0,
|
|
1429
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-link-content", children: [
|
|
1430
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-link-title-container", children: [
|
|
1431
|
+
renderIcon(route.icon),
|
|
1432
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: route.title })
|
|
1433
|
+
] }),
|
|
1317
1434
|
renderBadge(route.badge)
|
|
1318
1435
|
] })
|
|
1319
1436
|
}
|
|
1320
1437
|
) }, route.path)) })
|
|
1321
1438
|
] });
|
|
1322
1439
|
}
|
|
1323
|
-
var import_react10,
|
|
1440
|
+
var import_react10, import_react_router_dom6, import_lucide_react7, LucideIcons, import_jsx_runtime15;
|
|
1324
1441
|
var init_Sidebar = __esm({
|
|
1325
1442
|
"src/client/theme/ui/Sidebar/Sidebar.tsx"() {
|
|
1326
1443
|
"use strict";
|
|
1327
1444
|
import_react10 = require("react");
|
|
1328
|
-
|
|
1445
|
+
import_react_router_dom6 = require("react-router-dom");
|
|
1329
1446
|
init_Link2();
|
|
1330
1447
|
init_PoweredBy2();
|
|
1331
1448
|
import_lucide_react7 = require("lucide-react");
|
|
1332
|
-
|
|
1449
|
+
LucideIcons = __toESM(require("lucide-react"));
|
|
1450
|
+
import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1333
1451
|
}
|
|
1334
1452
|
});
|
|
1335
1453
|
|
|
@@ -1348,11 +1466,12 @@ function OnThisPage({
|
|
|
1348
1466
|
communityHelp,
|
|
1349
1467
|
filePath
|
|
1350
1468
|
}) {
|
|
1351
|
-
const [activeId, setActiveId] = (0, import_react11.useState)(
|
|
1469
|
+
const [activeId, setActiveId] = (0, import_react11.useState)(null);
|
|
1352
1470
|
const [indicatorStyle, setIndicatorStyle] = (0, import_react11.useState)({});
|
|
1353
1471
|
const observerRef = (0, import_react11.useRef)(null);
|
|
1354
|
-
const location = (0,
|
|
1472
|
+
const location = (0, import_react_router_dom7.useLocation)();
|
|
1355
1473
|
const listRef = (0, import_react11.useRef)(null);
|
|
1474
|
+
const visibleIdsRef = (0, import_react11.useRef)(/* @__PURE__ */ new Set());
|
|
1356
1475
|
(0, import_react11.useEffect)(() => {
|
|
1357
1476
|
if (headings.length > 0) {
|
|
1358
1477
|
const hash = window.location.hash.substring(1);
|
|
@@ -1365,36 +1484,53 @@ function OnThisPage({
|
|
|
1365
1484
|
}, [location.pathname, headings]);
|
|
1366
1485
|
(0, import_react11.useEffect)(() => {
|
|
1367
1486
|
if (!activeId || !listRef.current) return;
|
|
1368
|
-
const
|
|
1487
|
+
const activeLink = listRef.current.querySelector(
|
|
1369
1488
|
`a[href="#${activeId}"]`
|
|
1370
1489
|
);
|
|
1371
|
-
if (
|
|
1372
|
-
const
|
|
1490
|
+
if (activeLink) {
|
|
1491
|
+
const top = activeLink.offsetTop;
|
|
1492
|
+
const height = activeLink.offsetHeight;
|
|
1373
1493
|
setIndicatorStyle({
|
|
1374
|
-
transform: `translateY(${
|
|
1375
|
-
height: `${
|
|
1494
|
+
transform: `translateY(${top}px)`,
|
|
1495
|
+
height: `${height}px`,
|
|
1376
1496
|
opacity: 1
|
|
1377
1497
|
});
|
|
1378
1498
|
}
|
|
1379
1499
|
}, [activeId, headings]);
|
|
1380
1500
|
(0, import_react11.useEffect)(() => {
|
|
1381
1501
|
if (headings.length === 0) return;
|
|
1502
|
+
visibleIdsRef.current.clear();
|
|
1382
1503
|
if (observerRef.current) {
|
|
1383
1504
|
observerRef.current.disconnect();
|
|
1384
1505
|
}
|
|
1385
1506
|
const callback = (entries) => {
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1507
|
+
entries.forEach((entry) => {
|
|
1508
|
+
if (entry.isIntersecting) {
|
|
1509
|
+
visibleIdsRef.current.add(entry.target.id);
|
|
1510
|
+
} else {
|
|
1511
|
+
visibleIdsRef.current.delete(entry.target.id);
|
|
1512
|
+
}
|
|
1513
|
+
});
|
|
1514
|
+
const firstVisible = headings.find((h) => visibleIdsRef.current.has(h.id));
|
|
1515
|
+
if (firstVisible) {
|
|
1516
|
+
setActiveId(firstVisible.id);
|
|
1517
|
+
} else {
|
|
1518
|
+
const firstEl = document.getElementById(headings[0].id);
|
|
1519
|
+
if (firstEl) {
|
|
1520
|
+
const rect = firstEl.getBoundingClientRect();
|
|
1521
|
+
if (rect.top > 200) {
|
|
1522
|
+
setActiveId(headings[0].id);
|
|
1523
|
+
return;
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1392
1526
|
}
|
|
1393
1527
|
};
|
|
1394
|
-
|
|
1395
|
-
|
|
1528
|
+
const observerOptions = {
|
|
1529
|
+
root: document.querySelector(".boltdocs-content"),
|
|
1530
|
+
rootMargin: "-20% 0px -70% 0px",
|
|
1396
1531
|
threshold: [0, 1]
|
|
1397
|
-
}
|
|
1532
|
+
};
|
|
1533
|
+
observerRef.current = new IntersectionObserver(callback, observerOptions);
|
|
1398
1534
|
const observeHeadings = () => {
|
|
1399
1535
|
headings.forEach(({ id }) => {
|
|
1400
1536
|
const el = document.getElementById(id);
|
|
@@ -1425,16 +1561,14 @@ function OnThisPage({
|
|
|
1425
1561
|
`a[href="#${activeId}"]`
|
|
1426
1562
|
);
|
|
1427
1563
|
if (activeLink) {
|
|
1428
|
-
const container = listRef.current.
|
|
1429
|
-
".boltdocs-on-this-page"
|
|
1430
|
-
);
|
|
1564
|
+
const container = listRef.current.parentElement;
|
|
1431
1565
|
if (!container) return;
|
|
1432
1566
|
const linkRect = activeLink.getBoundingClientRect();
|
|
1433
1567
|
const containerRect = container.getBoundingClientRect();
|
|
1434
1568
|
const isVisible = linkRect.top >= containerRect.top && linkRect.bottom <= containerRect.bottom;
|
|
1435
1569
|
if (!isVisible) {
|
|
1436
1570
|
activeLink.scrollIntoView({
|
|
1437
|
-
behavior: "
|
|
1571
|
+
behavior: "auto",
|
|
1438
1572
|
block: "nearest"
|
|
1439
1573
|
});
|
|
1440
1574
|
}
|
|
@@ -1461,11 +1595,11 @@ function OnThisPage({
|
|
|
1461
1595
|
[]
|
|
1462
1596
|
);
|
|
1463
1597
|
if (headings.length === 0) return null;
|
|
1464
|
-
return /* @__PURE__ */ (0,
|
|
1465
|
-
/* @__PURE__ */ (0,
|
|
1466
|
-
/* @__PURE__ */ (0,
|
|
1467
|
-
/* @__PURE__ */ (0,
|
|
1468
|
-
/* @__PURE__ */ (0,
|
|
1598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("nav", { className: "boltdocs-on-this-page", "aria-label": "Table of contents", children: [
|
|
1599
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "on-this-page-title", children: "On this page" }),
|
|
1600
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "on-this-page-container", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "on-this-page-list-container", children: [
|
|
1601
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "toc-indicator", style: indicatorStyle }),
|
|
1602
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: "on-this-page-list", ref: listRef, children: headings.map((h) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { className: h.level === 3 ? "toc-indent" : "", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1469
1603
|
"a",
|
|
1470
1604
|
{
|
|
1471
1605
|
href: `#${h.id}`,
|
|
@@ -1475,11 +1609,11 @@ function OnThisPage({
|
|
|
1475
1609
|
children: h.text
|
|
1476
1610
|
}
|
|
1477
1611
|
) }, h.id)) })
|
|
1478
|
-
] }),
|
|
1479
|
-
(editLink || communityHelp) && /* @__PURE__ */ (0,
|
|
1480
|
-
/* @__PURE__ */ (0,
|
|
1481
|
-
/* @__PURE__ */ (0,
|
|
1482
|
-
editLink && filePath && /* @__PURE__ */ (0,
|
|
1612
|
+
] }) }),
|
|
1613
|
+
(editLink || communityHelp) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "toc-help", children: [
|
|
1614
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "toc-help-title", children: "Need help?" }),
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("ul", { className: "toc-help-links", children: [
|
|
1616
|
+
editLink && filePath && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1483
1617
|
"a",
|
|
1484
1618
|
{
|
|
1485
1619
|
href: editLink.replace(":path", filePath),
|
|
@@ -1487,12 +1621,12 @@ function OnThisPage({
|
|
|
1487
1621
|
rel: "noopener noreferrer",
|
|
1488
1622
|
className: "toc-help-link",
|
|
1489
1623
|
children: [
|
|
1490
|
-
/* @__PURE__ */ (0,
|
|
1624
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.Pencil, { size: 16 }),
|
|
1491
1625
|
"Edit this page"
|
|
1492
1626
|
]
|
|
1493
1627
|
}
|
|
1494
1628
|
) }),
|
|
1495
|
-
communityHelp && /* @__PURE__ */ (0,
|
|
1629
|
+
communityHelp && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1496
1630
|
"a",
|
|
1497
1631
|
{
|
|
1498
1632
|
href: communityHelp,
|
|
@@ -1500,7 +1634,7 @@ function OnThisPage({
|
|
|
1500
1634
|
rel: "noopener noreferrer",
|
|
1501
1635
|
className: "toc-help-link",
|
|
1502
1636
|
children: [
|
|
1503
|
-
/* @__PURE__ */ (0,
|
|
1637
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.CircleHelp, { size: 16 }),
|
|
1504
1638
|
"Community help"
|
|
1505
1639
|
]
|
|
1506
1640
|
}
|
|
@@ -1509,14 +1643,14 @@ function OnThisPage({
|
|
|
1509
1643
|
] })
|
|
1510
1644
|
] });
|
|
1511
1645
|
}
|
|
1512
|
-
var import_react11,
|
|
1646
|
+
var import_react11, import_react_router_dom7, import_lucide_react8, import_jsx_runtime16;
|
|
1513
1647
|
var init_OnThisPage = __esm({
|
|
1514
1648
|
"src/client/theme/ui/OnThisPage/OnThisPage.tsx"() {
|
|
1515
1649
|
"use strict";
|
|
1516
1650
|
import_react11 = require("react");
|
|
1517
|
-
|
|
1651
|
+
import_react_router_dom7 = require("react-router-dom");
|
|
1518
1652
|
import_lucide_react8 = require("lucide-react");
|
|
1519
|
-
|
|
1653
|
+
import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1520
1654
|
}
|
|
1521
1655
|
});
|
|
1522
1656
|
|
|
@@ -1530,7 +1664,7 @@ var init_OnThisPage2 = __esm({
|
|
|
1530
1664
|
|
|
1531
1665
|
// src/client/theme/ui/Head/Head.tsx
|
|
1532
1666
|
function Head({ siteTitle, siteDescription, routes }) {
|
|
1533
|
-
const location = (0,
|
|
1667
|
+
const location = (0, import_react_router_dom8.useLocation)();
|
|
1534
1668
|
(0, import_react12.useEffect)(() => {
|
|
1535
1669
|
const currentRoute = routes.find((r) => r.path === location.pathname);
|
|
1536
1670
|
const pageTitle = currentRoute?.title;
|
|
@@ -1575,12 +1709,12 @@ function setMetaTag(attr, key, content) {
|
|
|
1575
1709
|
}
|
|
1576
1710
|
tag.content = content;
|
|
1577
1711
|
}
|
|
1578
|
-
var import_react12,
|
|
1712
|
+
var import_react12, import_react_router_dom8;
|
|
1579
1713
|
var init_Head = __esm({
|
|
1580
1714
|
"src/client/theme/ui/Head/Head.tsx"() {
|
|
1581
1715
|
"use strict";
|
|
1582
1716
|
import_react12 = require("react");
|
|
1583
|
-
|
|
1717
|
+
import_react_router_dom8 = require("react-router-dom");
|
|
1584
1718
|
}
|
|
1585
1719
|
});
|
|
1586
1720
|
|
|
@@ -1594,21 +1728,21 @@ var init_Head2 = __esm({
|
|
|
1594
1728
|
|
|
1595
1729
|
// src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx
|
|
1596
1730
|
function Breadcrumbs({ routes, config }) {
|
|
1597
|
-
const location = (0,
|
|
1731
|
+
const location = (0, import_react_router_dom9.useLocation)();
|
|
1598
1732
|
if (config.themeConfig?.breadcrumbs === false) return null;
|
|
1599
1733
|
if (location.pathname === "/") return null;
|
|
1600
1734
|
const currentRoute = routes.find((r) => r.path === location.pathname);
|
|
1601
1735
|
const groupRoute = currentRoute?.group ? routes.find((r) => r.group === currentRoute.group) : null;
|
|
1602
|
-
return /* @__PURE__ */ (0,
|
|
1603
|
-
/* @__PURE__ */ (0,
|
|
1604
|
-
/* @__PURE__ */ (0,
|
|
1605
|
-
/* @__PURE__ */ (0,
|
|
1736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("nav", { className: "boltdocs-breadcrumbs", "aria-label": "Breadcrumb", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("ol", { className: "boltdocs-breadcrumbs-list", children: [
|
|
1737
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: "boltdocs-breadcrumbs-item", children: [
|
|
1738
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Link, { to: "/", className: "boltdocs-breadcrumbs-link", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.Home, { size: 14 }) }),
|
|
1739
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "boltdocs-breadcrumbs-separator", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.ChevronRight, { size: 14 }) })
|
|
1606
1740
|
] }),
|
|
1607
|
-
currentRoute?.groupTitle && /* @__PURE__ */ (0,
|
|
1608
|
-
groupRoute ? /* @__PURE__ */ (0,
|
|
1609
|
-
/* @__PURE__ */ (0,
|
|
1741
|
+
currentRoute?.groupTitle && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: "boltdocs-breadcrumbs-item", children: [
|
|
1742
|
+
groupRoute ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Link, { to: groupRoute.path, className: "boltdocs-breadcrumbs-link", children: currentRoute.groupTitle }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "boltdocs-breadcrumbs-text", children: currentRoute.groupTitle }),
|
|
1743
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "boltdocs-breadcrumbs-separator", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.ChevronRight, { size: 14 }) })
|
|
1610
1744
|
] }),
|
|
1611
|
-
currentRoute?.title && /* @__PURE__ */ (0,
|
|
1745
|
+
currentRoute?.title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { className: "boltdocs-breadcrumbs-item", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1612
1746
|
"span",
|
|
1613
1747
|
{
|
|
1614
1748
|
className: "boltdocs-breadcrumbs-text boltdocs-breadcrumbs-active",
|
|
@@ -1618,14 +1752,14 @@ function Breadcrumbs({ routes, config }) {
|
|
|
1618
1752
|
) })
|
|
1619
1753
|
] }) });
|
|
1620
1754
|
}
|
|
1621
|
-
var
|
|
1755
|
+
var import_react_router_dom9, import_lucide_react9, import_jsx_runtime17;
|
|
1622
1756
|
var init_Breadcrumbs = __esm({
|
|
1623
1757
|
"src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx"() {
|
|
1624
1758
|
"use strict";
|
|
1625
|
-
|
|
1759
|
+
import_react_router_dom9 = require("react-router-dom");
|
|
1626
1760
|
init_Link2();
|
|
1627
1761
|
import_lucide_react9 = require("lucide-react");
|
|
1628
|
-
|
|
1762
|
+
import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1629
1763
|
}
|
|
1630
1764
|
});
|
|
1631
1765
|
|
|
@@ -1639,16 +1773,16 @@ var init_Breadcrumbs2 = __esm({
|
|
|
1639
1773
|
|
|
1640
1774
|
// src/client/theme/ui/BackgroundGradient/BackgroundGradient.tsx
|
|
1641
1775
|
function BackgroundGradient() {
|
|
1642
|
-
return /* @__PURE__ */ (0,
|
|
1643
|
-
/* @__PURE__ */ (0,
|
|
1644
|
-
/* @__PURE__ */ (0,
|
|
1776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "boltdocs-background-glow", children: [
|
|
1777
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "glow-shape glow-1" }),
|
|
1778
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "glow-shape glow-2" })
|
|
1645
1779
|
] });
|
|
1646
1780
|
}
|
|
1647
|
-
var
|
|
1781
|
+
var import_jsx_runtime18;
|
|
1648
1782
|
var init_BackgroundGradient = __esm({
|
|
1649
1783
|
"src/client/theme/ui/BackgroundGradient/BackgroundGradient.tsx"() {
|
|
1650
1784
|
"use strict";
|
|
1651
|
-
|
|
1785
|
+
import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1652
1786
|
}
|
|
1653
1787
|
});
|
|
1654
1788
|
|
|
@@ -1680,10 +1814,9 @@ function ThemeLayout({
|
|
|
1680
1814
|
className = "",
|
|
1681
1815
|
style
|
|
1682
1816
|
}) {
|
|
1683
|
-
const [isSidebarOpen, setIsSidebarOpen] = (0, import_react13.useState)(true);
|
|
1684
1817
|
const siteTitle = config.themeConfig?.title || "Boltdocs";
|
|
1685
1818
|
const siteDescription = config.themeConfig?.description || "";
|
|
1686
|
-
const location = (0,
|
|
1819
|
+
const location = (0, import_react_router_dom10.useLocation)();
|
|
1687
1820
|
const currentIndex = routes.findIndex((r) => r.path === location.pathname);
|
|
1688
1821
|
const currentRoute = routes[currentIndex];
|
|
1689
1822
|
const currentLocale = config.i18n ? currentRoute?.locale || config.i18n.defaultLocale : void 0;
|
|
@@ -1703,9 +1836,9 @@ function ThemeLayout({
|
|
|
1703
1836
|
if (prevPage?.path) preload(prevPage.path);
|
|
1704
1837
|
if (nextPage?.path) preload(nextPage.path);
|
|
1705
1838
|
}, [prevPage, nextPage, preload]);
|
|
1706
|
-
return /* @__PURE__ */ (0,
|
|
1707
|
-
background !== void 0 ? background : /* @__PURE__ */ (0,
|
|
1708
|
-
head !== void 0 ? head : /* @__PURE__ */ (0,
|
|
1839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: `boltdocs-layout ${className}`, style, children: [
|
|
1840
|
+
background !== void 0 ? background : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(BackgroundGradient, {}),
|
|
1841
|
+
head !== void 0 ? head : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1709
1842
|
Head,
|
|
1710
1843
|
{
|
|
1711
1844
|
siteTitle,
|
|
@@ -1713,7 +1846,7 @@ function ThemeLayout({
|
|
|
1713
1846
|
routes
|
|
1714
1847
|
}
|
|
1715
1848
|
),
|
|
1716
|
-
navbar !== void 0 ? navbar : /* @__PURE__ */ (0,
|
|
1849
|
+
navbar !== void 0 ? navbar : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1717
1850
|
Navbar,
|
|
1718
1851
|
{
|
|
1719
1852
|
config,
|
|
@@ -1723,74 +1856,60 @@ function ThemeLayout({
|
|
|
1723
1856
|
currentVersion
|
|
1724
1857
|
}
|
|
1725
1858
|
),
|
|
1726
|
-
/* @__PURE__ */ (0,
|
|
1727
|
-
|
|
1728
|
-
{
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1859
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "boltdocs-main-container", children: [
|
|
1860
|
+
sidebar !== void 0 ? sidebar : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Sidebar, { routes: filteredRoutes, config }),
|
|
1861
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("main", { className: "boltdocs-content", children: [
|
|
1862
|
+
breadcrumbs !== void 0 ? breadcrumbs : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Breadcrumbs, { routes: filteredRoutes, config }),
|
|
1863
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "boltdocs-page", children }),
|
|
1864
|
+
(prevPage || nextPage) && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("nav", { className: "page-nav", "aria-label": "Pagination", children: [
|
|
1865
|
+
prevPage ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1866
|
+
Link,
|
|
1733
1867
|
{
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1868
|
+
to: prevPage.path || "/",
|
|
1869
|
+
className: "page-nav-link page-nav-link--prev",
|
|
1870
|
+
children: [
|
|
1871
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "page-nav-info", children: [
|
|
1872
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "page-nav-label", children: "Previous" }),
|
|
1873
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "page-nav-title", children: prevPage.title })
|
|
1874
|
+
] }),
|
|
1875
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react10.ChevronLeft, { className: "page-nav-arrow", size: 16 })
|
|
1876
|
+
]
|
|
1738
1877
|
}
|
|
1739
|
-
),
|
|
1740
|
-
/* @__PURE__ */ (0,
|
|
1741
|
-
|
|
1742
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "boltdocs-page", children }),
|
|
1743
|
-
(prevPage || nextPage) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("nav", { className: "page-nav", "aria-label": "Pagination", children: [
|
|
1744
|
-
prevPage ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1745
|
-
Link,
|
|
1746
|
-
{
|
|
1747
|
-
to: prevPage.path || "/",
|
|
1748
|
-
className: "page-nav-link page-nav-link--prev",
|
|
1749
|
-
children: [
|
|
1750
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "page-nav-info", children: [
|
|
1751
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "page-nav-label", children: "Previous" }),
|
|
1752
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "page-nav-title", children: prevPage.title })
|
|
1753
|
-
] }),
|
|
1754
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react10.ChevronLeft, { className: "page-nav-arrow", size: 16 })
|
|
1755
|
-
]
|
|
1756
|
-
}
|
|
1757
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", {}),
|
|
1758
|
-
nextPage ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1759
|
-
Link,
|
|
1760
|
-
{
|
|
1761
|
-
to: nextPage.path || "/",
|
|
1762
|
-
className: "page-nav-link page-nav-link--next",
|
|
1763
|
-
children: [
|
|
1764
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "page-nav-info", children: [
|
|
1765
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "page-nav-label", children: "Next" }),
|
|
1766
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "page-nav-title", children: nextPage.title })
|
|
1767
|
-
] }),
|
|
1768
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react10.ChevronRight, { className: "page-nav-arrow", size: 16 })
|
|
1769
|
-
]
|
|
1770
|
-
}
|
|
1771
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", {})
|
|
1772
|
-
] })
|
|
1773
|
-
] }),
|
|
1774
|
-
toc !== void 0 ? toc : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1775
|
-
OnThisPage,
|
|
1878
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", {}),
|
|
1879
|
+
nextPage ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1880
|
+
Link,
|
|
1776
1881
|
{
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1882
|
+
to: nextPage.path || "/",
|
|
1883
|
+
className: "page-nav-link page-nav-link--next",
|
|
1884
|
+
children: [
|
|
1885
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "page-nav-info", children: [
|
|
1886
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "page-nav-label", children: "Next" }),
|
|
1887
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "page-nav-title", children: nextPage.title })
|
|
1888
|
+
] }),
|
|
1889
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react10.ChevronRight, { className: "page-nav-arrow", size: 16 })
|
|
1890
|
+
]
|
|
1781
1891
|
}
|
|
1782
|
-
)
|
|
1783
|
-
]
|
|
1784
|
-
}
|
|
1785
|
-
|
|
1892
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", {})
|
|
1893
|
+
] })
|
|
1894
|
+
] }),
|
|
1895
|
+
toc !== void 0 ? toc : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1896
|
+
OnThisPage,
|
|
1897
|
+
{
|
|
1898
|
+
headings: routes[currentIndex]?.headings,
|
|
1899
|
+
editLink: config.themeConfig?.editLink,
|
|
1900
|
+
communityHelp: config.themeConfig?.communityHelp,
|
|
1901
|
+
filePath: routes[currentIndex]?.filePath
|
|
1902
|
+
}
|
|
1903
|
+
)
|
|
1904
|
+
] })
|
|
1786
1905
|
] });
|
|
1787
1906
|
}
|
|
1788
|
-
var import_react13,
|
|
1907
|
+
var import_react13, import_react_router_dom10, import_lucide_react10, import_jsx_runtime19;
|
|
1789
1908
|
var init_Layout = __esm({
|
|
1790
1909
|
"src/client/theme/ui/Layout/Layout.tsx"() {
|
|
1791
1910
|
"use strict";
|
|
1792
1911
|
import_react13 = __toESM(require("react"));
|
|
1793
|
-
|
|
1912
|
+
import_react_router_dom10 = require("react-router-dom");
|
|
1794
1913
|
init_Link2();
|
|
1795
1914
|
import_lucide_react10 = require("lucide-react");
|
|
1796
1915
|
init_preload();
|
|
@@ -1807,7 +1926,7 @@ var init_Layout = __esm({
|
|
|
1807
1926
|
init_Breadcrumbs2();
|
|
1808
1927
|
init_BackgroundGradient2();
|
|
1809
1928
|
init_styles();
|
|
1810
|
-
|
|
1929
|
+
import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1811
1930
|
}
|
|
1812
1931
|
});
|
|
1813
1932
|
|
|
@@ -1821,23 +1940,23 @@ var init_Layout2 = __esm({
|
|
|
1821
1940
|
|
|
1822
1941
|
// src/client/theme/ui/NotFound/NotFound.tsx
|
|
1823
1942
|
function NotFound() {
|
|
1824
|
-
return /* @__PURE__ */ (0,
|
|
1825
|
-
/* @__PURE__ */ (0,
|
|
1826
|
-
/* @__PURE__ */ (0,
|
|
1827
|
-
/* @__PURE__ */ (0,
|
|
1828
|
-
/* @__PURE__ */ (0,
|
|
1829
|
-
/* @__PURE__ */ (0,
|
|
1943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "boltdocs-not-found", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "not-found-content", children: [
|
|
1944
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "not-found-code", children: "404" }),
|
|
1945
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { className: "not-found-title", children: "Page Not Found" }),
|
|
1946
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "not-found-text", children: "The page you're looking for doesn't exist or has been moved." }),
|
|
1947
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Link, { to: "/", className: "not-found-link", children: [
|
|
1948
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react11.ArrowLeft, { size: 16 }),
|
|
1830
1949
|
" Go to Home"
|
|
1831
1950
|
] })
|
|
1832
1951
|
] }) });
|
|
1833
1952
|
}
|
|
1834
|
-
var import_lucide_react11,
|
|
1953
|
+
var import_lucide_react11, import_jsx_runtime20;
|
|
1835
1954
|
var init_NotFound = __esm({
|
|
1836
1955
|
"src/client/theme/ui/NotFound/NotFound.tsx"() {
|
|
1837
1956
|
"use strict";
|
|
1838
1957
|
init_Link2();
|
|
1839
1958
|
import_lucide_react11 = require("lucide-react");
|
|
1840
|
-
|
|
1959
|
+
import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1841
1960
|
}
|
|
1842
1961
|
});
|
|
1843
1962
|
|
|
@@ -1851,16 +1970,16 @@ var init_NotFound2 = __esm({
|
|
|
1851
1970
|
|
|
1852
1971
|
// src/client/theme/ui/Loading/Loading.tsx
|
|
1853
1972
|
function Loading() {
|
|
1854
|
-
return /* @__PURE__ */ (0,
|
|
1855
|
-
/* @__PURE__ */ (0,
|
|
1856
|
-
/* @__PURE__ */ (0,
|
|
1973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "boltdocs-loading", children: [
|
|
1974
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "loading-spinner" }),
|
|
1975
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "loading-text", children: "Loading..." })
|
|
1857
1976
|
] });
|
|
1858
1977
|
}
|
|
1859
|
-
var
|
|
1978
|
+
var import_jsx_runtime21;
|
|
1860
1979
|
var init_Loading = __esm({
|
|
1861
1980
|
"src/client/theme/ui/Loading/Loading.tsx"() {
|
|
1862
1981
|
"use strict";
|
|
1863
|
-
|
|
1982
|
+
import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1864
1983
|
}
|
|
1865
1984
|
});
|
|
1866
1985
|
|
|
@@ -1882,27 +2001,27 @@ function CodeBlock({ children, ...props }) {
|
|
|
1882
2001
|
setCopied(true);
|
|
1883
2002
|
setTimeout(() => setCopied(false), 2e3);
|
|
1884
2003
|
}, []);
|
|
1885
|
-
return /* @__PURE__ */ (0,
|
|
1886
|
-
/* @__PURE__ */ (0,
|
|
2004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "code-block-wrapper", children: [
|
|
2005
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1887
2006
|
"button",
|
|
1888
2007
|
{
|
|
1889
2008
|
className: `code-block-copy ${copied ? "copied" : ""}`,
|
|
1890
2009
|
onClick: handleCopy,
|
|
1891
2010
|
"aria-label": "Copy code",
|
|
1892
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
2011
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.Copy, { size: 16 })
|
|
1893
2012
|
}
|
|
1894
2013
|
),
|
|
1895
|
-
/* @__PURE__ */ (0,
|
|
2014
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("pre", { ref: preRef, ...props, children })
|
|
1896
2015
|
] });
|
|
1897
2016
|
}
|
|
1898
|
-
var import_react14, import_lucide_react12,
|
|
2017
|
+
var import_react14, import_lucide_react12, import_jsx_runtime22;
|
|
1899
2018
|
var init_CodeBlock = __esm({
|
|
1900
2019
|
"src/client/theme/components/CodeBlock/CodeBlock.tsx"() {
|
|
1901
2020
|
"use strict";
|
|
1902
2021
|
import_react14 = require("react");
|
|
1903
2022
|
import_lucide_react12 = require("lucide-react");
|
|
1904
2023
|
init_utils();
|
|
1905
|
-
|
|
2024
|
+
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1906
2025
|
}
|
|
1907
2026
|
});
|
|
1908
2027
|
|
|
@@ -1941,7 +2060,7 @@ function Video({
|
|
|
1941
2060
|
observer.observe(el);
|
|
1942
2061
|
return () => observer.disconnect();
|
|
1943
2062
|
}, []);
|
|
1944
|
-
return /* @__PURE__ */ (0,
|
|
2063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { ref: containerRef, className: "boltdocs-video-wrapper", children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1945
2064
|
"video",
|
|
1946
2065
|
{
|
|
1947
2066
|
className: "boltdocs-video",
|
|
@@ -1956,7 +2075,7 @@ function Video({
|
|
|
1956
2075
|
"Your browser does not support the video tag."
|
|
1957
2076
|
]
|
|
1958
2077
|
}
|
|
1959
|
-
) : /* @__PURE__ */ (0,
|
|
2078
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1960
2079
|
"div",
|
|
1961
2080
|
{
|
|
1962
2081
|
className: "boltdocs-video-placeholder",
|
|
@@ -1965,12 +2084,12 @@ function Video({
|
|
|
1965
2084
|
}
|
|
1966
2085
|
) });
|
|
1967
2086
|
}
|
|
1968
|
-
var import_react15,
|
|
2087
|
+
var import_react15, import_jsx_runtime23;
|
|
1969
2088
|
var init_Video = __esm({
|
|
1970
2089
|
"src/client/theme/components/Video/Video.tsx"() {
|
|
1971
2090
|
"use strict";
|
|
1972
2091
|
import_react15 = require("react");
|
|
1973
|
-
|
|
2092
|
+
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1974
2093
|
}
|
|
1975
2094
|
});
|
|
1976
2095
|
|
|
@@ -1987,14 +2106,14 @@ var init_Video2 = __esm({
|
|
|
1987
2106
|
});
|
|
1988
2107
|
|
|
1989
2108
|
// src/client/theme/icons/npm.tsx
|
|
1990
|
-
var
|
|
2109
|
+
var import_jsx_runtime24, NPM;
|
|
1991
2110
|
var init_npm = __esm({
|
|
1992
2111
|
"src/client/theme/icons/npm.tsx"() {
|
|
1993
2112
|
"use strict";
|
|
1994
|
-
|
|
1995
|
-
NPM = (props) => /* @__PURE__ */ (0,
|
|
1996
|
-
/* @__PURE__ */ (0,
|
|
1997
|
-
/* @__PURE__ */ (0,
|
|
2113
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2114
|
+
NPM = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("svg", { ...props, viewBox: "0 0 2500 2500", children: [
|
|
2115
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { fill: "#c00", d: "M0 0h2500v2500H0z" }),
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1998
2117
|
"path",
|
|
1999
2118
|
{
|
|
2000
2119
|
fill: "#fff",
|
|
@@ -2006,69 +2125,69 @@ var init_npm = __esm({
|
|
|
2006
2125
|
});
|
|
2007
2126
|
|
|
2008
2127
|
// src/client/theme/icons/pnpm.tsx
|
|
2009
|
-
var
|
|
2128
|
+
var import_jsx_runtime25, Pnpm;
|
|
2010
2129
|
var init_pnpm = __esm({
|
|
2011
2130
|
"src/client/theme/icons/pnpm.tsx"() {
|
|
2012
2131
|
"use strict";
|
|
2013
|
-
|
|
2014
|
-
Pnpm = (props) => /* @__PURE__ */ (0,
|
|
2132
|
+
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2133
|
+
Pnpm = (props) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2015
2134
|
"svg",
|
|
2016
2135
|
{
|
|
2017
2136
|
...props,
|
|
2018
2137
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
2019
2138
|
viewBox: "76.58987244897958 44 164.00775510204068 164",
|
|
2020
2139
|
children: [
|
|
2021
|
-
/* @__PURE__ */ (0,
|
|
2022
|
-
/* @__PURE__ */ (0,
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("defs", { children: [
|
|
2141
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2023
2142
|
"path",
|
|
2024
2143
|
{
|
|
2025
2144
|
d: "M237.6 95L187.6 95L187.6 45L237.6 45L237.6 95Z",
|
|
2026
2145
|
id: "pnpm_dark__b45vdTD8hs"
|
|
2027
2146
|
}
|
|
2028
2147
|
),
|
|
2029
|
-
/* @__PURE__ */ (0,
|
|
2148
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2030
2149
|
"path",
|
|
2031
2150
|
{
|
|
2032
2151
|
d: "M182.59 95L132.59 95L132.59 45L182.59 45L182.59 95Z",
|
|
2033
2152
|
id: "pnpm_dark__a40WtxIl8d"
|
|
2034
2153
|
}
|
|
2035
2154
|
),
|
|
2036
|
-
/* @__PURE__ */ (0,
|
|
2155
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2037
2156
|
"path",
|
|
2038
2157
|
{
|
|
2039
2158
|
d: "M127.59 95L77.59 95L77.59 45L127.59 45L127.59 95Z",
|
|
2040
2159
|
id: "pnpm_dark__h2CN9AEEpe"
|
|
2041
2160
|
}
|
|
2042
2161
|
),
|
|
2043
|
-
/* @__PURE__ */ (0,
|
|
2162
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2044
2163
|
"path",
|
|
2045
2164
|
{
|
|
2046
2165
|
d: "M237.6 150L187.6 150L187.6 100L237.6 100L237.6 150Z",
|
|
2047
2166
|
id: "pnpm_dark__dqv5133G8"
|
|
2048
2167
|
}
|
|
2049
2168
|
),
|
|
2050
|
-
/* @__PURE__ */ (0,
|
|
2169
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2051
2170
|
"path",
|
|
2052
2171
|
{
|
|
2053
2172
|
d: "M182.59 150L132.59 150L132.59 100L182.59 100L182.59 150Z",
|
|
2054
2173
|
id: "pnpm_dark__b1Lv79ypvm"
|
|
2055
2174
|
}
|
|
2056
2175
|
),
|
|
2057
|
-
/* @__PURE__ */ (0,
|
|
2176
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2058
2177
|
"path",
|
|
2059
2178
|
{
|
|
2060
2179
|
d: "M182.59 205L132.59 205L132.59 155L182.59 155L182.59 205Z",
|
|
2061
2180
|
id: "pnpm_dark__hy1IZWwLX"
|
|
2062
2181
|
}
|
|
2063
2182
|
),
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2183
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2065
2184
|
"path",
|
|
2066
2185
|
{
|
|
2067
2186
|
d: "M237.6 205L187.6 205L187.6 155L237.6 155L237.6 205Z",
|
|
2068
2187
|
id: "pnpm_dark__akQfjxQes"
|
|
2069
2188
|
}
|
|
2070
2189
|
),
|
|
2071
|
-
/* @__PURE__ */ (0,
|
|
2190
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2072
2191
|
"path",
|
|
2073
2192
|
{
|
|
2074
2193
|
d: "M127.59 205L77.59 205L77.59 155L127.59 155L127.59 205Z",
|
|
@@ -2076,15 +2195,15 @@ var init_pnpm = __esm({
|
|
|
2076
2195
|
}
|
|
2077
2196
|
)
|
|
2078
2197
|
] }),
|
|
2079
|
-
/* @__PURE__ */ (0,
|
|
2080
|
-
/* @__PURE__ */ (0,
|
|
2081
|
-
/* @__PURE__ */ (0,
|
|
2082
|
-
/* @__PURE__ */ (0,
|
|
2083
|
-
/* @__PURE__ */ (0,
|
|
2084
|
-
/* @__PURE__ */ (0,
|
|
2085
|
-
/* @__PURE__ */ (0,
|
|
2086
|
-
/* @__PURE__ */ (0,
|
|
2087
|
-
/* @__PURE__ */ (0,
|
|
2198
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("g", { children: [
|
|
2199
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("use", { xlinkHref: "#pnpm_dark__b45vdTD8hs", fill: "#f9ad00" }) }),
|
|
2200
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("use", { xlinkHref: "#pnpm_dark__a40WtxIl8d", fill: "#f9ad00" }) }),
|
|
2201
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("use", { xlinkHref: "#pnpm_dark__h2CN9AEEpe", fill: "#f9ad00" }) }),
|
|
2202
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("use", { xlinkHref: "#pnpm_dark__dqv5133G8", fill: "#f9ad00" }) }),
|
|
2203
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("use", { xlinkHref: "#pnpm_dark__b1Lv79ypvm", fill: "#ffffff" }) }),
|
|
2204
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("use", { xlinkHref: "#pnpm_dark__hy1IZWwLX", fill: "#ffffff" }) }),
|
|
2205
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("use", { xlinkHref: "#pnpm_dark__akQfjxQes", fill: "#ffffff" }) }),
|
|
2206
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("use", { xlinkHref: "#pnpm_dark__bdSrwE5pk", fill: "#ffffff" }) })
|
|
2088
2207
|
] })
|
|
2089
2208
|
]
|
|
2090
2209
|
}
|
|
@@ -2093,62 +2212,62 @@ var init_pnpm = __esm({
|
|
|
2093
2212
|
});
|
|
2094
2213
|
|
|
2095
2214
|
// src/client/theme/icons/bun.tsx
|
|
2096
|
-
var
|
|
2215
|
+
var import_jsx_runtime26, Bun;
|
|
2097
2216
|
var init_bun = __esm({
|
|
2098
2217
|
"src/client/theme/icons/bun.tsx"() {
|
|
2099
2218
|
"use strict";
|
|
2100
|
-
|
|
2101
|
-
Bun = (props) => /* @__PURE__ */ (0,
|
|
2102
|
-
/* @__PURE__ */ (0,
|
|
2103
|
-
/* @__PURE__ */ (0,
|
|
2219
|
+
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2220
|
+
Bun = (props) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("svg", { ...props, viewBox: "0 0 80 70", children: [
|
|
2221
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.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" }),
|
|
2222
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2104
2223
|
"path",
|
|
2105
2224
|
{
|
|
2106
2225
|
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",
|
|
2107
2226
|
style: { fill: "#fbf0df" }
|
|
2108
2227
|
}
|
|
2109
2228
|
),
|
|
2110
|
-
/* @__PURE__ */ (0,
|
|
2229
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2111
2230
|
"path",
|
|
2112
2231
|
{
|
|
2113
2232
|
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",
|
|
2114
2233
|
style: { fill: "#f6dece" }
|
|
2115
2234
|
}
|
|
2116
2235
|
),
|
|
2117
|
-
/* @__PURE__ */ (0,
|
|
2236
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2118
2237
|
"path",
|
|
2119
2238
|
{
|
|
2120
2239
|
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",
|
|
2121
2240
|
style: { fill: "#fffefc" }
|
|
2122
2241
|
}
|
|
2123
2242
|
),
|
|
2124
|
-
/* @__PURE__ */ (0,
|
|
2243
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2125
2244
|
"path",
|
|
2126
2245
|
{
|
|
2127
2246
|
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",
|
|
2128
2247
|
style: { fill: "#ccbea7", fillRule: "evenodd" }
|
|
2129
2248
|
}
|
|
2130
2249
|
),
|
|
2131
|
-
/* @__PURE__ */ (0,
|
|
2132
|
-
/* @__PURE__ */ (0,
|
|
2133
|
-
/* @__PURE__ */ (0,
|
|
2250
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.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" }),
|
|
2251
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("g", { children: [
|
|
2252
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2134
2253
|
"path",
|
|
2135
2254
|
{
|
|
2136
2255
|
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",
|
|
2137
2256
|
style: { fill: "#b71422" }
|
|
2138
2257
|
}
|
|
2139
2258
|
),
|
|
2140
|
-
/* @__PURE__ */ (0,
|
|
2259
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2141
2260
|
"path",
|
|
2142
2261
|
{
|
|
2143
2262
|
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",
|
|
2144
2263
|
style: { fill: "#ff6164" }
|
|
2145
2264
|
}
|
|
2146
2265
|
),
|
|
2147
|
-
/* @__PURE__ */ (0,
|
|
2148
|
-
/* @__PURE__ */ (0,
|
|
2266
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.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" }),
|
|
2267
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.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" })
|
|
2149
2268
|
] }),
|
|
2150
|
-
/* @__PURE__ */ (0,
|
|
2151
|
-
/* @__PURE__ */ (0,
|
|
2269
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("g", { children: [
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2152
2271
|
"ellipse",
|
|
2153
2272
|
{
|
|
2154
2273
|
cx: "53.22",
|
|
@@ -2158,7 +2277,7 @@ var init_bun = __esm({
|
|
|
2158
2277
|
style: { fill: "#febbd0" }
|
|
2159
2278
|
}
|
|
2160
2279
|
),
|
|
2161
|
-
/* @__PURE__ */ (0,
|
|
2280
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2162
2281
|
"ellipse",
|
|
2163
2282
|
{
|
|
2164
2283
|
cx: "22.95",
|
|
@@ -2168,14 +2287,14 @@ var init_bun = __esm({
|
|
|
2168
2287
|
style: { fill: "#febbd0" }
|
|
2169
2288
|
}
|
|
2170
2289
|
),
|
|
2171
|
-
/* @__PURE__ */ (0,
|
|
2290
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2172
2291
|
"path",
|
|
2173
2292
|
{
|
|
2174
2293
|
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",
|
|
2175
2294
|
style: { fillRule: "evenodd" }
|
|
2176
2295
|
}
|
|
2177
2296
|
),
|
|
2178
|
-
/* @__PURE__ */ (0,
|
|
2297
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2179
2298
|
"path",
|
|
2180
2299
|
{
|
|
2181
2300
|
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",
|
|
@@ -2188,12 +2307,12 @@ var init_bun = __esm({
|
|
|
2188
2307
|
});
|
|
2189
2308
|
|
|
2190
2309
|
// src/client/theme/icons/deno.tsx
|
|
2191
|
-
var
|
|
2310
|
+
var import_jsx_runtime27, Deno;
|
|
2192
2311
|
var init_deno = __esm({
|
|
2193
2312
|
"src/client/theme/icons/deno.tsx"() {
|
|
2194
2313
|
"use strict";
|
|
2195
|
-
|
|
2196
|
-
Deno = (props) => /* @__PURE__ */ (0,
|
|
2314
|
+
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2315
|
+
Deno = (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2197
2316
|
"svg",
|
|
2198
2317
|
{
|
|
2199
2318
|
...props,
|
|
@@ -2203,7 +2322,7 @@ var init_deno = __esm({
|
|
|
2203
2322
|
strokeMiterlimit: "2",
|
|
2204
2323
|
clipRule: "evenodd",
|
|
2205
2324
|
viewBox: "0 0 441 441",
|
|
2206
|
-
children: /* @__PURE__ */ (0,
|
|
2325
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2207
2326
|
"path",
|
|
2208
2327
|
{
|
|
2209
2328
|
fill: "currentColor",
|
|
@@ -2258,11 +2377,11 @@ function PackageManagerTabs({
|
|
|
2258
2377
|
setCopied(true);
|
|
2259
2378
|
setTimeout(() => setCopied(false), 2e3);
|
|
2260
2379
|
}, [activeCommand]);
|
|
2261
|
-
return /* @__PURE__ */ (0,
|
|
2262
|
-
/* @__PURE__ */ (0,
|
|
2380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: `pkg-tabs-wrapper ${className}`, children: [
|
|
2381
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "pkg-tabs-header", children: MANAGERS.map((mgr) => {
|
|
2263
2382
|
const Icon = mgr.icon;
|
|
2264
2383
|
const isActive = activeTab === mgr.id;
|
|
2265
|
-
return /* @__PURE__ */ (0,
|
|
2384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2266
2385
|
"button",
|
|
2267
2386
|
{
|
|
2268
2387
|
className: `pkg-tab-btn ${isActive ? "active" : ""}`,
|
|
@@ -2270,29 +2389,29 @@ function PackageManagerTabs({
|
|
|
2270
2389
|
"aria-selected": isActive,
|
|
2271
2390
|
role: "tab",
|
|
2272
2391
|
children: [
|
|
2273
|
-
/* @__PURE__ */ (0,
|
|
2274
|
-
/* @__PURE__ */ (0,
|
|
2392
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { className: "pkg-tab-icon", width: "16", height: "16" }),
|
|
2393
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: mgr.label })
|
|
2275
2394
|
]
|
|
2276
2395
|
},
|
|
2277
2396
|
mgr.id
|
|
2278
2397
|
);
|
|
2279
2398
|
}) }),
|
|
2280
|
-
/* @__PURE__ */ (0,
|
|
2281
|
-
/* @__PURE__ */ (0,
|
|
2399
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "code-block-wrapper pkg-tabs-content", children: [
|
|
2400
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2282
2401
|
"button",
|
|
2283
2402
|
{
|
|
2284
2403
|
className: `code-block-copy ${copied ? "copied" : ""}`,
|
|
2285
2404
|
onClick: handleCopy,
|
|
2286
2405
|
type: "button",
|
|
2287
2406
|
"aria-label": "Copy code",
|
|
2288
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
2407
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react13.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react13.Copy, { size: 14 })
|
|
2289
2408
|
}
|
|
2290
2409
|
),
|
|
2291
|
-
/* @__PURE__ */ (0,
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("pre", { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("code", { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "line", children: activeCommand }) }) })
|
|
2292
2411
|
] })
|
|
2293
2412
|
] });
|
|
2294
2413
|
}
|
|
2295
|
-
var import_react16, import_lucide_react13,
|
|
2414
|
+
var import_react16, import_lucide_react13, import_jsx_runtime28, MANAGERS;
|
|
2296
2415
|
var init_PackageManagerTabs = __esm({
|
|
2297
2416
|
"src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx"() {
|
|
2298
2417
|
"use strict";
|
|
@@ -2303,7 +2422,7 @@ var init_PackageManagerTabs = __esm({
|
|
|
2303
2422
|
init_bun();
|
|
2304
2423
|
init_deno();
|
|
2305
2424
|
init_utils();
|
|
2306
|
-
|
|
2425
|
+
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2307
2426
|
MANAGERS = [
|
|
2308
2427
|
{ id: "npm", label: "npm", icon: NPM },
|
|
2309
2428
|
{ id: "pnpm", label: "pnpm", icon: Pnpm },
|
|
@@ -2332,6 +2451,7 @@ function useConfig() {
|
|
|
2332
2451
|
function AppShell({
|
|
2333
2452
|
initialRoutes,
|
|
2334
2453
|
initialConfig,
|
|
2454
|
+
docsDirName,
|
|
2335
2455
|
modules,
|
|
2336
2456
|
hot,
|
|
2337
2457
|
homePage: HomePage,
|
|
@@ -2344,14 +2464,14 @@ function AppShell({
|
|
|
2344
2464
|
(route) => !(HomePage && (route.path === "/" || route.path === ""))
|
|
2345
2465
|
).map((route) => {
|
|
2346
2466
|
const loaderKey = Object.keys(modules).find(
|
|
2347
|
-
(k) => k
|
|
2467
|
+
(k) => k === `/${docsDirName}/${route.filePath}`
|
|
2348
2468
|
);
|
|
2349
2469
|
const loader = loaderKey ? modules[loaderKey] : null;
|
|
2350
2470
|
return {
|
|
2351
2471
|
...route,
|
|
2352
2472
|
Component: import_react17.default.lazy(() => {
|
|
2353
2473
|
if (!loader)
|
|
2354
|
-
return Promise.resolve({ default: () => /* @__PURE__ */ (0,
|
|
2474
|
+
return Promise.resolve({ default: () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(NotFound, {}) });
|
|
2355
2475
|
return loader();
|
|
2356
2476
|
})
|
|
2357
2477
|
};
|
|
@@ -2369,15 +2489,15 @@ function AppShell({
|
|
|
2369
2489
|
}, [hot]);
|
|
2370
2490
|
(0, import_react17.useEffect)(() => {
|
|
2371
2491
|
setResolvedRoutes(resolveRoutes(routesInfo));
|
|
2372
|
-
}, [routesInfo, modules]);
|
|
2373
|
-
return /* @__PURE__ */ (0,
|
|
2374
|
-
/* @__PURE__ */ (0,
|
|
2375
|
-
/* @__PURE__ */ (0,
|
|
2376
|
-
HomePage && /* @__PURE__ */ (0,
|
|
2377
|
-
|
|
2492
|
+
}, [routesInfo, modules, docsDirName]);
|
|
2493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(PreloadProvider, { routes: routesInfo, modules, children: [
|
|
2494
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ScrollHandler, {}),
|
|
2495
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react_router_dom11.Routes, { children: [
|
|
2496
|
+
HomePage && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2497
|
+
import_react_router_dom11.Route,
|
|
2378
2498
|
{
|
|
2379
2499
|
path: "/",
|
|
2380
|
-
element: /* @__PURE__ */ (0,
|
|
2500
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2381
2501
|
ThemeLayout,
|
|
2382
2502
|
{
|
|
2383
2503
|
config,
|
|
@@ -2386,20 +2506,20 @@ function AppShell({
|
|
|
2386
2506
|
toc: null,
|
|
2387
2507
|
breadcrumbs: null,
|
|
2388
2508
|
...config.themeConfig?.layoutProps,
|
|
2389
|
-
children: /* @__PURE__ */ (0,
|
|
2509
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(HomePage, {})
|
|
2390
2510
|
}
|
|
2391
2511
|
)
|
|
2392
2512
|
}
|
|
2393
2513
|
),
|
|
2394
|
-
/* @__PURE__ */ (0,
|
|
2395
|
-
|
|
2514
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2515
|
+
import_react_router_dom11.Route,
|
|
2396
2516
|
{
|
|
2397
|
-
element: /* @__PURE__ */ (0,
|
|
2398
|
-
children: resolvedRoutes.map((route) => /* @__PURE__ */ (0,
|
|
2399
|
-
|
|
2517
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DocsLayout, { config, routes: routesInfo }),
|
|
2518
|
+
children: resolvedRoutes.map((route) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2519
|
+
import_react_router_dom11.Route,
|
|
2400
2520
|
{
|
|
2401
2521
|
path: route.path === "" ? "/" : route.path,
|
|
2402
|
-
element: /* @__PURE__ */ (0,
|
|
2522
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react17.default.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Loading, {}), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2403
2523
|
MdxPage,
|
|
2404
2524
|
{
|
|
2405
2525
|
Component: route.Component,
|
|
@@ -2412,17 +2532,17 @@ function AppShell({
|
|
|
2412
2532
|
},
|
|
2413
2533
|
"docs-layout"
|
|
2414
2534
|
),
|
|
2415
|
-
/* @__PURE__ */ (0,
|
|
2416
|
-
|
|
2535
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2536
|
+
import_react_router_dom11.Route,
|
|
2417
2537
|
{
|
|
2418
2538
|
path: "*",
|
|
2419
|
-
element: /* @__PURE__ */ (0,
|
|
2539
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2420
2540
|
ThemeLayout,
|
|
2421
2541
|
{
|
|
2422
2542
|
config,
|
|
2423
2543
|
routes: routesInfo,
|
|
2424
2544
|
...config.themeConfig?.layoutProps,
|
|
2425
|
-
children: /* @__PURE__ */ (0,
|
|
2545
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(NotFound, {})
|
|
2426
2546
|
}
|
|
2427
2547
|
)
|
|
2428
2548
|
}
|
|
@@ -2431,7 +2551,7 @@ function AppShell({
|
|
|
2431
2551
|
] }) });
|
|
2432
2552
|
}
|
|
2433
2553
|
function ScrollHandler() {
|
|
2434
|
-
const { pathname, hash } = (0,
|
|
2554
|
+
const { pathname, hash } = (0, import_react_router_dom11.useLocation)();
|
|
2435
2555
|
(0, import_react19.useLayoutEffect)(() => {
|
|
2436
2556
|
if (hash) {
|
|
2437
2557
|
const id = hash.replace("#", "");
|
|
@@ -2457,13 +2577,13 @@ function DocsLayout({
|
|
|
2457
2577
|
config,
|
|
2458
2578
|
routes
|
|
2459
2579
|
}) {
|
|
2460
|
-
return /* @__PURE__ */ (0,
|
|
2580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2461
2581
|
ThemeLayout,
|
|
2462
2582
|
{
|
|
2463
2583
|
config,
|
|
2464
2584
|
routes,
|
|
2465
2585
|
...config.themeConfig?.layoutProps,
|
|
2466
|
-
children: /* @__PURE__ */ (0,
|
|
2586
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_router_dom11.Outlet, {})
|
|
2467
2587
|
}
|
|
2468
2588
|
);
|
|
2469
2589
|
}
|
|
@@ -2472,21 +2592,22 @@ function MdxPage({
|
|
|
2472
2592
|
customComponents = {}
|
|
2473
2593
|
}) {
|
|
2474
2594
|
const allComponents = { ...mdxComponents, ...customComponents };
|
|
2475
|
-
return /* @__PURE__ */ (0,
|
|
2595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react18.MDXProvider, { components: allComponents, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Component, {}) });
|
|
2476
2596
|
}
|
|
2477
2597
|
function createBoltdocsApp(options) {
|
|
2478
|
-
const { target, routes, config, modules, hot, homePage } = options;
|
|
2598
|
+
const { target, routes, docsDirName, config, modules, hot, homePage } = options;
|
|
2479
2599
|
const container = document.querySelector(target);
|
|
2480
2600
|
if (!container) {
|
|
2481
2601
|
throw new Error(
|
|
2482
2602
|
`[boltdocs] Mount target "${target}" not found in document.`
|
|
2483
2603
|
);
|
|
2484
2604
|
}
|
|
2485
|
-
const app = /* @__PURE__ */ (0,
|
|
2605
|
+
const app = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react17.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_router_dom11.BrowserRouter, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2486
2606
|
AppShell,
|
|
2487
2607
|
{
|
|
2488
2608
|
initialRoutes: routes,
|
|
2489
2609
|
initialConfig: config,
|
|
2610
|
+
docsDirName,
|
|
2490
2611
|
modules,
|
|
2491
2612
|
hot,
|
|
2492
2613
|
homePage,
|
|
@@ -2496,13 +2617,13 @@ function createBoltdocsApp(options) {
|
|
|
2496
2617
|
container.innerHTML = "";
|
|
2497
2618
|
import_client.default.createRoot(container).render(app);
|
|
2498
2619
|
}
|
|
2499
|
-
var import_react17, import_client,
|
|
2620
|
+
var import_react17, import_client, import_react_router_dom11, import_react18, import_react19, import_lucide_react14, import_jsx_runtime29, ConfigContext, Video2, PackageManagerTabs2, Heading, mdxComponents;
|
|
2500
2621
|
var init_app = __esm({
|
|
2501
2622
|
"src/client/app/index.tsx"() {
|
|
2502
2623
|
"use strict";
|
|
2503
2624
|
import_react17 = __toESM(require("react"));
|
|
2504
2625
|
import_client = __toESM(require("react-dom/client"));
|
|
2505
|
-
|
|
2626
|
+
import_react_router_dom11 = require("react-router-dom");
|
|
2506
2627
|
init_Layout2();
|
|
2507
2628
|
init_NotFound2();
|
|
2508
2629
|
init_Loading2();
|
|
@@ -2511,7 +2632,7 @@ var init_app = __esm({
|
|
|
2511
2632
|
import_lucide_react14 = require("lucide-react");
|
|
2512
2633
|
init_CodeBlock2();
|
|
2513
2634
|
init_preload();
|
|
2514
|
-
|
|
2635
|
+
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2515
2636
|
ConfigContext = (0, import_react19.createContext)(null);
|
|
2516
2637
|
Video2 = (0, import_react19.lazy)(
|
|
2517
2638
|
() => Promise.resolve().then(() => (init_Video2(), Video_exports)).then((m) => ({ default: m.Video }))
|
|
@@ -2527,21 +2648,21 @@ var init_app = __esm({
|
|
|
2527
2648
|
children
|
|
2528
2649
|
}) => {
|
|
2529
2650
|
const Tag = `h${level}`;
|
|
2530
|
-
return /* @__PURE__ */ (0,
|
|
2651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Tag, { id, className: "boltdocs-heading", children: [
|
|
2531
2652
|
children,
|
|
2532
|
-
id && /* @__PURE__ */ (0,
|
|
2653
|
+
id && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("a", { href: `#${id}`, className: "header-anchor", "aria-label": "Anchor", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.Link, { size: 16 }) })
|
|
2533
2654
|
] });
|
|
2534
2655
|
};
|
|
2535
2656
|
mdxComponents = {
|
|
2536
|
-
h1: (props) => /* @__PURE__ */ (0,
|
|
2537
|
-
h2: (props) => /* @__PURE__ */ (0,
|
|
2538
|
-
h3: (props) => /* @__PURE__ */ (0,
|
|
2539
|
-
h4: (props) => /* @__PURE__ */ (0,
|
|
2540
|
-
h5: (props) => /* @__PURE__ */ (0,
|
|
2541
|
-
h6: (props) => /* @__PURE__ */ (0,
|
|
2542
|
-
pre: (props) => /* @__PURE__ */ (0,
|
|
2543
|
-
video: (props) => /* @__PURE__ */ (0,
|
|
2544
|
-
PackageManagerTabs: (props) => /* @__PURE__ */ (0,
|
|
2657
|
+
h1: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Heading, { level: 1, ...props }),
|
|
2658
|
+
h2: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Heading, { level: 2, ...props }),
|
|
2659
|
+
h3: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Heading, { level: 3, ...props }),
|
|
2660
|
+
h4: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Heading, { level: 4, ...props }),
|
|
2661
|
+
h5: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Heading, { level: 5, ...props }),
|
|
2662
|
+
h6: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Heading, { level: 6, ...props }),
|
|
2663
|
+
pre: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CodeBlock, { ...props, children: props.children }),
|
|
2664
|
+
video: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "video-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Video2, { ...props }) }),
|
|
2665
|
+
PackageManagerTabs: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "pkg-tabs-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(PackageManagerTabs2, { ...props }) })
|
|
2545
2666
|
};
|
|
2546
2667
|
}
|
|
2547
2668
|
});
|
|
@@ -2558,6 +2679,7 @@ __export(client_exports, {
|
|
|
2558
2679
|
Cards: () => Cards,
|
|
2559
2680
|
CodeBlock: () => CodeBlock,
|
|
2560
2681
|
Danger: () => Danger,
|
|
2682
|
+
FileTree: () => FileTree,
|
|
2561
2683
|
Head: () => Head,
|
|
2562
2684
|
InfoBox: () => InfoBox,
|
|
2563
2685
|
List: () => List,
|
|
@@ -2569,7 +2691,8 @@ __export(client_exports, {
|
|
|
2569
2691
|
Playground: () => Playground,
|
|
2570
2692
|
Sidebar: () => Sidebar,
|
|
2571
2693
|
Tab: () => Tab,
|
|
2572
|
-
|
|
2694
|
+
Table: () => Table,
|
|
2695
|
+
Tabs: () => Tabs2,
|
|
2573
2696
|
ThemeLayout: () => ThemeLayout,
|
|
2574
2697
|
Tip: () => Tip,
|
|
2575
2698
|
Video: () => Video,
|
|
@@ -2590,7 +2713,7 @@ init_BackgroundGradient2();
|
|
|
2590
2713
|
var import_react20 = __toESM(require("react"));
|
|
2591
2714
|
var import_react_live = require("react-live");
|
|
2592
2715
|
var import_lucide_react15 = require("lucide-react");
|
|
2593
|
-
var
|
|
2716
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2594
2717
|
function prepareCode(raw) {
|
|
2595
2718
|
const trimmed = raw.trim();
|
|
2596
2719
|
const fnMatch = trimmed.match(/export\s+default\s+function\s+(\w+)/);
|
|
@@ -2631,40 +2754,40 @@ function Playground({
|
|
|
2631
2754
|
setTimeout(() => setCopied(false), 2e3);
|
|
2632
2755
|
};
|
|
2633
2756
|
const extendedScope = { React: import_react20.default, ...scope };
|
|
2634
|
-
return /* @__PURE__ */ (0,
|
|
2757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "boltdocs-playground", "data-readonly": readonly, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2635
2758
|
import_react_live.LiveProvider,
|
|
2636
2759
|
{
|
|
2637
2760
|
code: activeCode,
|
|
2638
2761
|
scope: extendedScope,
|
|
2639
2762
|
theme: void 0,
|
|
2640
2763
|
noInline: useNoInline,
|
|
2641
|
-
children: /* @__PURE__ */ (0,
|
|
2642
|
-
/* @__PURE__ */ (0,
|
|
2643
|
-
/* @__PURE__ */ (0,
|
|
2644
|
-
/* @__PURE__ */ (0,
|
|
2645
|
-
/* @__PURE__ */ (0,
|
|
2646
|
-
/* @__PURE__ */ (0,
|
|
2764
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "playground-split-container", children: [
|
|
2765
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "playground-panel playground-editor-panel", children: [
|
|
2766
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "playground-panel-header", children: [
|
|
2767
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "playground-panel-title", children: [
|
|
2768
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react15.Terminal, { size: 14 }),
|
|
2769
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: readonly ? "Code Example" : "Live Editor" })
|
|
2647
2770
|
] }),
|
|
2648
|
-
/* @__PURE__ */ (0,
|
|
2771
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2649
2772
|
"button",
|
|
2650
2773
|
{
|
|
2651
2774
|
className: "playground-copy-btn",
|
|
2652
2775
|
onClick: handleCopy,
|
|
2653
2776
|
title: "Copy code",
|
|
2654
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
2777
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react15.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react15.Copy, { size: 14 })
|
|
2655
2778
|
}
|
|
2656
2779
|
)
|
|
2657
2780
|
] }),
|
|
2658
|
-
/* @__PURE__ */ (0,
|
|
2781
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "playground-panel-content playground-editor", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_live.LiveEditor, { disabled: readonly, onChange: setActiveCode }) })
|
|
2659
2782
|
] }),
|
|
2660
|
-
/* @__PURE__ */ (0,
|
|
2661
|
-
/* @__PURE__ */ (0,
|
|
2662
|
-
/* @__PURE__ */ (0,
|
|
2663
|
-
/* @__PURE__ */ (0,
|
|
2783
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "playground-panel playground-preview-panel", children: [
|
|
2784
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "playground-panel-header", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "playground-panel-title", children: [
|
|
2785
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react15.Play, { size: 14 }),
|
|
2786
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Preview" })
|
|
2664
2787
|
] }) }),
|
|
2665
|
-
/* @__PURE__ */ (0,
|
|
2666
|
-
/* @__PURE__ */ (0,
|
|
2667
|
-
/* @__PURE__ */ (0,
|
|
2788
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "playground-panel-content playground-preview", children: [
|
|
2789
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_live.LivePreview, {}),
|
|
2790
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_live.LiveError, { className: "playground-error" })
|
|
2668
2791
|
] })
|
|
2669
2792
|
] })
|
|
2670
2793
|
] })
|
|
@@ -2679,7 +2802,7 @@ init_CodeBlock2();
|
|
|
2679
2802
|
init_Video2();
|
|
2680
2803
|
|
|
2681
2804
|
// src/client/theme/components/mdx/Button.tsx
|
|
2682
|
-
var
|
|
2805
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2683
2806
|
function Button({
|
|
2684
2807
|
variant = "primary",
|
|
2685
2808
|
size = "md",
|
|
@@ -2690,7 +2813,7 @@ function Button({
|
|
|
2690
2813
|
}) {
|
|
2691
2814
|
const cls = `ld-btn ld-btn--${variant} ld-btn--${size} ${className}`.trim();
|
|
2692
2815
|
if (href) {
|
|
2693
|
-
return /* @__PURE__ */ (0,
|
|
2816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2694
2817
|
"a",
|
|
2695
2818
|
{
|
|
2696
2819
|
href,
|
|
@@ -2701,18 +2824,18 @@ function Button({
|
|
|
2701
2824
|
}
|
|
2702
2825
|
);
|
|
2703
2826
|
}
|
|
2704
|
-
return /* @__PURE__ */ (0,
|
|
2827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { className: cls, ...rest, children });
|
|
2705
2828
|
}
|
|
2706
2829
|
|
|
2707
2830
|
// src/client/theme/components/mdx/Badge.tsx
|
|
2708
|
-
var
|
|
2831
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2709
2832
|
function Badge({
|
|
2710
2833
|
variant = "default",
|
|
2711
2834
|
children,
|
|
2712
2835
|
className = "",
|
|
2713
2836
|
...rest
|
|
2714
2837
|
}) {
|
|
2715
|
-
return /* @__PURE__ */ (0,
|
|
2838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2716
2839
|
"span",
|
|
2717
2840
|
{
|
|
2718
2841
|
className: `ld-badge ld-badge--${variant} ${className}`.trim(),
|
|
@@ -2723,14 +2846,14 @@ function Badge({
|
|
|
2723
2846
|
}
|
|
2724
2847
|
|
|
2725
2848
|
// src/client/theme/components/mdx/Card.tsx
|
|
2726
|
-
var
|
|
2849
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2727
2850
|
function Cards({
|
|
2728
2851
|
cols = 3,
|
|
2729
2852
|
children,
|
|
2730
2853
|
className = "",
|
|
2731
2854
|
...rest
|
|
2732
2855
|
}) {
|
|
2733
|
-
return /* @__PURE__ */ (0,
|
|
2856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `ld-cards ld-cards--${cols} ${className}`.trim(), ...rest, children });
|
|
2734
2857
|
}
|
|
2735
2858
|
function Card({
|
|
2736
2859
|
title,
|
|
@@ -2740,13 +2863,13 @@ function Card({
|
|
|
2740
2863
|
className = "",
|
|
2741
2864
|
...rest
|
|
2742
2865
|
}) {
|
|
2743
|
-
const inner = /* @__PURE__ */ (0,
|
|
2744
|
-
icon && /* @__PURE__ */ (0,
|
|
2745
|
-
title && /* @__PURE__ */ (0,
|
|
2746
|
-
children && /* @__PURE__ */ (0,
|
|
2866
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
2867
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ld-card__icon", children: icon }),
|
|
2868
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h3", { className: "ld-card__title", children: title }),
|
|
2869
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ld-card__body", children })
|
|
2747
2870
|
] });
|
|
2748
2871
|
if (href) {
|
|
2749
|
-
return /* @__PURE__ */ (0,
|
|
2872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2750
2873
|
"a",
|
|
2751
2874
|
{
|
|
2752
2875
|
href,
|
|
@@ -2756,7 +2879,7 @@ function Card({
|
|
|
2756
2879
|
}
|
|
2757
2880
|
);
|
|
2758
2881
|
}
|
|
2759
|
-
return /* @__PURE__ */ (0,
|
|
2882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `ld-card ${className}`.trim(), ...rest, children: inner });
|
|
2760
2883
|
}
|
|
2761
2884
|
|
|
2762
2885
|
// src/client/theme/components/mdx/Tabs.tsx
|
|
@@ -2766,27 +2889,6 @@ init_npm();
|
|
|
2766
2889
|
init_pnpm();
|
|
2767
2890
|
init_bun();
|
|
2768
2891
|
init_deno();
|
|
2769
|
-
|
|
2770
|
-
// src/client/theme/icons/yarn.tsx
|
|
2771
|
-
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2772
|
-
var Yarn = (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("svg", { ...props, viewBox: "0 0 256 256", children: [
|
|
2773
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2774
|
-
"path",
|
|
2775
|
-
{
|
|
2776
|
-
fill: "#2C8EBB",
|
|
2777
|
-
d: "M128 0C57.307 0 0 57.307 0 128s57.307 128 128 128 128-57.307 128-128S198.693 0 128 0zm0 234.667C69.195 234.667 21.333 186.805 21.333 128S69.195 21.333 128 21.333 234.667 69.195 234.667 128 186.805 234.667 128 234.667z"
|
|
2778
|
-
}
|
|
2779
|
-
),
|
|
2780
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2781
|
-
"path",
|
|
2782
|
-
{
|
|
2783
|
-
fill: "#2C8EBB",
|
|
2784
|
-
d: "M173.045 74.053c-4.632-4.632-12.144-4.632-16.776 0L128 102.323l-28.269-28.27c-4.632-4.632-12.144-4.632-16.776 0-4.632 4.632-4.632 12.144 0 16.776L111.224 119.1l-28.269 28.269c-4.632 4.632-4.632 12.144 0 16.776 2.316 2.316 5.352 3.474 8.388 3.474s6.072-1.158 8.388-3.474L128 135.877l28.269 28.268c2.316 2.316 5.352 3.474 8.388 3.474s6.072-1.158 8.388-3.474c4.632-4.632 4.632-12.144 0-16.776L144.776 119.1l28.269-28.271 c4.632-4.632 4.632-12.144 0-16.776z"
|
|
2785
|
-
}
|
|
2786
|
-
)
|
|
2787
|
-
] });
|
|
2788
|
-
|
|
2789
|
-
// src/client/theme/components/mdx/Tabs.tsx
|
|
2790
2892
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2791
2893
|
function Tab({ children }) {
|
|
2792
2894
|
const content = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CodeBlock, { className: "language-bash", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("code", { children: children.trim() }) }) : children;
|
|
@@ -2794,14 +2896,13 @@ function Tab({ children }) {
|
|
|
2794
2896
|
}
|
|
2795
2897
|
var getIconForLabel = (label) => {
|
|
2796
2898
|
const l = label.toLowerCase();
|
|
2797
|
-
if (l.includes("npm")) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(NPM, {});
|
|
2798
2899
|
if (l.includes("pnpm")) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Pnpm, {});
|
|
2799
|
-
if (l.includes("
|
|
2900
|
+
if (l.includes("npm")) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(NPM, {});
|
|
2800
2901
|
if (l.includes("bun")) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Bun, {});
|
|
2801
2902
|
if (l.includes("deno")) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Deno, {});
|
|
2802
2903
|
return null;
|
|
2803
2904
|
};
|
|
2804
|
-
function
|
|
2905
|
+
function Tabs2({ defaultIndex = 0, children }) {
|
|
2805
2906
|
const [active, setActive] = (0, import_react21.useState)(defaultIndex);
|
|
2806
2907
|
const tabRefs = (0, import_react21.useRef)([]);
|
|
2807
2908
|
const tabs = import_react21.Children.toArray(children).filter(
|
|
@@ -2929,6 +3030,158 @@ function List({
|
|
|
2929
3030
|
] });
|
|
2930
3031
|
}) });
|
|
2931
3032
|
}
|
|
3033
|
+
|
|
3034
|
+
// src/client/theme/components/mdx/FileTree.tsx
|
|
3035
|
+
var import_react23 = __toESM(require("react"));
|
|
3036
|
+
var import_lucide_react18 = require("lucide-react");
|
|
3037
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3038
|
+
function getTextContent(node) {
|
|
3039
|
+
if (typeof node === "string") return node;
|
|
3040
|
+
if (typeof node === "number") return node.toString();
|
|
3041
|
+
if (Array.isArray(node)) return node.map(getTextContent).join("");
|
|
3042
|
+
if ((0, import_react23.isValidElement)(node)) {
|
|
3043
|
+
return getTextContent(node.props.children);
|
|
3044
|
+
}
|
|
3045
|
+
return "";
|
|
3046
|
+
}
|
|
3047
|
+
function getFileIcon(filename) {
|
|
3048
|
+
const name = filename.toLowerCase();
|
|
3049
|
+
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")) {
|
|
3050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react18.FileCode, { size: 16, strokeWidth: 2, className: "ld-file-tree__icon-file" });
|
|
3051
|
+
}
|
|
3052
|
+
if (name.endsWith(".md") || name.endsWith(".mdx") || name.endsWith(".txt")) {
|
|
3053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react18.FileText, { size: 16, strokeWidth: 2, className: "ld-file-tree__icon-file" });
|
|
3054
|
+
}
|
|
3055
|
+
if (name.endsWith(".png") || name.endsWith(".jpg") || name.endsWith(".jpeg") || name.endsWith(".svg") || name.endsWith(".gif")) {
|
|
3056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3057
|
+
import_lucide_react18.FileImage,
|
|
3058
|
+
{
|
|
3059
|
+
size: 16,
|
|
3060
|
+
strokeWidth: 2,
|
|
3061
|
+
className: "ld-file-tree__icon-file"
|
|
3062
|
+
}
|
|
3063
|
+
);
|
|
3064
|
+
}
|
|
3065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react18.File, { size: 16, strokeWidth: 2, className: "ld-file-tree__icon-file" });
|
|
3066
|
+
}
|
|
3067
|
+
function isListElement(node, tag) {
|
|
3068
|
+
if (typeof node.type === "string") {
|
|
3069
|
+
return node.type === tag;
|
|
3070
|
+
}
|
|
3071
|
+
if (typeof node.type === "function") {
|
|
3072
|
+
return node.type.name === tag || node.type.name?.toLowerCase() === tag;
|
|
3073
|
+
}
|
|
3074
|
+
if (node.props && node.props.originalType === tag) {
|
|
3075
|
+
return true;
|
|
3076
|
+
}
|
|
3077
|
+
if (node.props && node.props.mdxType === tag) {
|
|
3078
|
+
return true;
|
|
3079
|
+
}
|
|
3080
|
+
return false;
|
|
3081
|
+
}
|
|
3082
|
+
function FolderNode({
|
|
3083
|
+
labelText,
|
|
3084
|
+
nestedNodes,
|
|
3085
|
+
depth
|
|
3086
|
+
}) {
|
|
3087
|
+
const [isOpen, setIsOpen] = (0, import_react23.useState)(true);
|
|
3088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("li", { className: "ld-file-tree__item", children: [
|
|
3089
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3090
|
+
"div",
|
|
3091
|
+
{
|
|
3092
|
+
className: "ld-file-tree__label ld-file-tree__label--folder",
|
|
3093
|
+
onClick: () => setIsOpen(!isOpen),
|
|
3094
|
+
style: { cursor: "pointer" },
|
|
3095
|
+
children: [
|
|
3096
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "ld-file-tree__icon ld-file-tree__icon--chevron", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3097
|
+
import_lucide_react18.ChevronRight,
|
|
3098
|
+
{
|
|
3099
|
+
size: 14,
|
|
3100
|
+
className: `ld-file-tree__chevron ${isOpen ? "ld-file-tree__chevron--open" : ""}`,
|
|
3101
|
+
strokeWidth: 3
|
|
3102
|
+
}
|
|
3103
|
+
) }),
|
|
3104
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "ld-file-tree__icon", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3105
|
+
import_lucide_react18.Folder,
|
|
3106
|
+
{
|
|
3107
|
+
size: 16,
|
|
3108
|
+
strokeWidth: 2,
|
|
3109
|
+
className: "ld-file-tree__icon-folder",
|
|
3110
|
+
fill: "currentColor",
|
|
3111
|
+
fillOpacity: 0.15
|
|
3112
|
+
}
|
|
3113
|
+
) }),
|
|
3114
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "ld-file-tree__name", children: labelText })
|
|
3115
|
+
]
|
|
3116
|
+
}
|
|
3117
|
+
),
|
|
3118
|
+
isOpen && nestedNodes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ld-file-tree__nested", children: nestedNodes.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react23.default.Fragment, { children: parseNode(child, depth) }, index)) })
|
|
3119
|
+
] });
|
|
3120
|
+
}
|
|
3121
|
+
function parseNode(node, depth = 0) {
|
|
3122
|
+
if (!(0, import_react23.isValidElement)(node)) {
|
|
3123
|
+
return node;
|
|
3124
|
+
}
|
|
3125
|
+
if (isListElement(node, "ul")) {
|
|
3126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3127
|
+
"ul",
|
|
3128
|
+
{
|
|
3129
|
+
className: `ld-file-tree__list ${depth === 0 ? "ld-file-tree__list--root" : ""}`,
|
|
3130
|
+
children: import_react23.Children.map(node.props.children, (child, index) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react23.default.Fragment, { children: parseNode(child, depth + 1) }, index))
|
|
3131
|
+
}
|
|
3132
|
+
);
|
|
3133
|
+
}
|
|
3134
|
+
if (isListElement(node, "li")) {
|
|
3135
|
+
const children = import_react23.Children.toArray(node.props.children);
|
|
3136
|
+
const nestedListIndex = children.findIndex(
|
|
3137
|
+
(child) => (0, import_react23.isValidElement)(child) && isListElement(child, "ul")
|
|
3138
|
+
);
|
|
3139
|
+
const hasNested = nestedListIndex !== -1;
|
|
3140
|
+
const labelNodes = hasNested ? children.slice(0, nestedListIndex) : children;
|
|
3141
|
+
const nestedNodes = hasNested ? children.slice(nestedListIndex) : [];
|
|
3142
|
+
const rawLabelContent = getTextContent(labelNodes).trim();
|
|
3143
|
+
const isExplicitDir = rawLabelContent.endsWith("/");
|
|
3144
|
+
const labelText = isExplicitDir ? rawLabelContent.slice(0, -1) : rawLabelContent;
|
|
3145
|
+
const isFolder = hasNested || isExplicitDir;
|
|
3146
|
+
if (isFolder) {
|
|
3147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3148
|
+
FolderNode,
|
|
3149
|
+
{
|
|
3150
|
+
labelText,
|
|
3151
|
+
nestedNodes,
|
|
3152
|
+
depth
|
|
3153
|
+
}
|
|
3154
|
+
);
|
|
3155
|
+
}
|
|
3156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("li", { className: "ld-file-tree__item", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ld-file-tree__label ld-file-tree__label--file", children: [
|
|
3157
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "ld-file-tree__icon ld-file-tree__icon--spacer" }),
|
|
3158
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "ld-file-tree__icon", children: getFileIcon(labelText) }),
|
|
3159
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "ld-file-tree__name", children: labelText })
|
|
3160
|
+
] }) });
|
|
3161
|
+
}
|
|
3162
|
+
if (node.props.children) {
|
|
3163
|
+
return import_react23.Children.map(node.props.children, (child, index) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react23.default.Fragment, { children: parseNode(child, depth) }, index));
|
|
3164
|
+
}
|
|
3165
|
+
return node;
|
|
3166
|
+
}
|
|
3167
|
+
function FileTree({ children }) {
|
|
3168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ld-file-tree", dir: "ltr", children: import_react23.Children.map(children, (child) => parseNode(child, 0)) });
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
// src/client/theme/components/mdx/Table.tsx
|
|
3172
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3173
|
+
function Table({
|
|
3174
|
+
headers,
|
|
3175
|
+
data,
|
|
3176
|
+
children,
|
|
3177
|
+
className = ""
|
|
3178
|
+
}) {
|
|
3179
|
+
const tableContent = children ? children : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
3180
|
+
headers && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("tr", { children: headers.map((header, i) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("th", { children: header }, i)) }) }),
|
|
3181
|
+
data && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("tbody", { children: data.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("tr", { children: row.map((cell, j) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("td", { children: cell }, j)) }, i)) })
|
|
3182
|
+
] });
|
|
3183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: `ld-table-container ${className}`.trim(), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("table", { className: "ld-table", children: tableContent }) });
|
|
3184
|
+
}
|
|
2932
3185
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2933
3186
|
0 && (module.exports = {
|
|
2934
3187
|
Admonition,
|
|
@@ -2940,6 +3193,7 @@ function List({
|
|
|
2940
3193
|
Cards,
|
|
2941
3194
|
CodeBlock,
|
|
2942
3195
|
Danger,
|
|
3196
|
+
FileTree,
|
|
2943
3197
|
Head,
|
|
2944
3198
|
InfoBox,
|
|
2945
3199
|
List,
|
|
@@ -2951,6 +3205,7 @@ function List({
|
|
|
2951
3205
|
Playground,
|
|
2952
3206
|
Sidebar,
|
|
2953
3207
|
Tab,
|
|
3208
|
+
Table,
|
|
2954
3209
|
Tabs,
|
|
2955
3210
|
ThemeLayout,
|
|
2956
3211
|
Tip,
|