boltdocs 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{SearchDialog-YOXMFGH6.mjs → SearchDialog-6Z7CUAYJ.mjs} +8 -1
- package/dist/{SearchDialog-UOAW6IR3.css → SearchDialog-GOZ6X53X.css} +129 -14
- package/dist/{chunk-MULKZFVN.mjs → chunk-SFVOGJ2W.mjs} +269 -165
- package/dist/client/index.css +129 -14
- package/dist/client/index.d.mts +5 -7
- package/dist/client/index.d.ts +5 -7
- package/dist/client/index.js +586 -337
- package/dist/client/index.mjs +106 -5
- package/dist/client/ssr.css +129 -14
- package/dist/client/ssr.d.mts +1 -1
- package/dist/client/ssr.d.ts +1 -1
- package/dist/client/ssr.js +378 -230
- package/dist/client/ssr.mjs +1 -1
- package/dist/node/index.d.mts +2 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.js +4 -1
- package/dist/node/index.mjs +4 -1
- package/dist/{types-CviV0GbX.d.ts → types-BbceAHA0.d.mts} +2 -0
- package/dist/{types-CviV0GbX.d.mts → types-BbceAHA0.d.ts} +2 -0
- package/package.json +1 -1
- package/src/client/app/index.tsx +8 -7
- package/src/client/theme/components/mdx/Table.tsx +108 -10
- package/src/client/theme/components/mdx/mdx-components.css +79 -0
- package/src/client/theme/styles/variables.css +24 -0
- package/src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx +46 -0
- package/src/client/theme/ui/ErrorBoundary/index.ts +1 -0
- package/src/client/theme/ui/Layout/Layout.tsx +8 -1
- package/src/client/theme/ui/Navbar/Tabs.tsx +37 -12
- package/src/client/theme/ui/Navbar/navbar.css +26 -18
- package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +1 -8
- package/src/client/theme/ui/ProgressBar/ProgressBar.css +17 -0
- package/src/client/theme/ui/ProgressBar/ProgressBar.tsx +51 -0
- package/src/client/theme/ui/ProgressBar/index.ts +1 -0
- package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +11 -1
- package/src/client/types.ts +2 -0
- package/src/node/routes/index.ts +1 -0
- package/src/node/routes/parser.ts +11 -0
- package/src/node/routes/types.ts +2 -0
|
@@ -326,10 +326,11 @@ function GithubStars({ repo }) {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
// src/client/theme/ui/Navbar/Tabs.tsx
|
|
329
|
+
import { useEffect as useEffect10, useRef as useRef6, useState as useState12 } from "react";
|
|
329
330
|
import { useLocation as useLocation10 } from "react-router-dom";
|
|
330
331
|
|
|
331
332
|
// src/client/theme/ui/Link/Link.tsx
|
|
332
|
-
import
|
|
333
|
+
import React10 from "react";
|
|
333
334
|
import {
|
|
334
335
|
Link as RouterLink,
|
|
335
336
|
NavLink as RouterNavLink,
|
|
@@ -376,7 +377,7 @@ function PreloadProvider({
|
|
|
376
377
|
}
|
|
377
378
|
|
|
378
379
|
// src/client/app/index.tsx
|
|
379
|
-
import
|
|
380
|
+
import React9, { useEffect as useEffect8, useState as useState10 } from "react";
|
|
380
381
|
import ReactDOM from "react-dom/client";
|
|
381
382
|
import {
|
|
382
383
|
BrowserRouter,
|
|
@@ -387,7 +388,7 @@ import {
|
|
|
387
388
|
} from "react-router-dom";
|
|
388
389
|
|
|
389
390
|
// src/client/theme/ui/Layout/Layout.tsx
|
|
390
|
-
import
|
|
391
|
+
import React7 from "react";
|
|
391
392
|
import { useLocation as useLocation7 } from "react-router-dom";
|
|
392
393
|
import { ChevronLeft, ChevronRight as ChevronRight3 } from "lucide-react";
|
|
393
394
|
|
|
@@ -699,13 +700,7 @@ function OnThisPage({
|
|
|
699
700
|
e.preventDefault();
|
|
700
701
|
const el = document.getElementById(id);
|
|
701
702
|
if (el) {
|
|
702
|
-
|
|
703
|
-
const bodyRect = document.body.getBoundingClientRect().top;
|
|
704
|
-
const elementRect = el.getBoundingClientRect().top;
|
|
705
|
-
const elementPosition = elementRect - bodyRect;
|
|
706
|
-
const offsetPosition = elementPosition - offset;
|
|
707
|
-
window.scrollTo({
|
|
708
|
-
top: offsetPosition,
|
|
703
|
+
el.scrollIntoView({
|
|
709
704
|
behavior: "smooth"
|
|
710
705
|
});
|
|
711
706
|
setActiveId(id);
|
|
@@ -853,8 +848,85 @@ function BackgroundGradient() {
|
|
|
853
848
|
] });
|
|
854
849
|
}
|
|
855
850
|
|
|
851
|
+
// src/client/theme/ui/ProgressBar/ProgressBar.tsx
|
|
852
|
+
import { useEffect as useEffect7, useState as useState7 } from "react";
|
|
853
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
854
|
+
function ProgressBar() {
|
|
855
|
+
const [progress, setProgress] = useState7(0);
|
|
856
|
+
useEffect7(() => {
|
|
857
|
+
let container = null;
|
|
858
|
+
let timer;
|
|
859
|
+
const handleScroll = () => {
|
|
860
|
+
if (!container) return;
|
|
861
|
+
const { scrollTop, scrollHeight, clientHeight } = container;
|
|
862
|
+
if (scrollHeight <= clientHeight) {
|
|
863
|
+
setProgress(0);
|
|
864
|
+
return;
|
|
865
|
+
}
|
|
866
|
+
const scrollPercent = scrollTop / (scrollHeight - clientHeight) * 100;
|
|
867
|
+
setProgress(Math.min(100, Math.max(0, scrollPercent)));
|
|
868
|
+
};
|
|
869
|
+
const attachListener = () => {
|
|
870
|
+
container = document.querySelector(".boltdocs-content");
|
|
871
|
+
if (container) {
|
|
872
|
+
container.addEventListener("scroll", handleScroll);
|
|
873
|
+
handleScroll();
|
|
874
|
+
if (timer) clearInterval(timer);
|
|
875
|
+
return true;
|
|
876
|
+
}
|
|
877
|
+
return false;
|
|
878
|
+
};
|
|
879
|
+
if (!attachListener()) {
|
|
880
|
+
timer = setInterval(attachListener, 100);
|
|
881
|
+
}
|
|
882
|
+
return () => {
|
|
883
|
+
if (container) container.removeEventListener("scroll", handleScroll);
|
|
884
|
+
if (timer) clearInterval(timer);
|
|
885
|
+
};
|
|
886
|
+
}, []);
|
|
887
|
+
return /* @__PURE__ */ jsx14("div", { className: "boltdocs-progress-container", children: /* @__PURE__ */ jsx14(
|
|
888
|
+
"div",
|
|
889
|
+
{
|
|
890
|
+
className: "boltdocs-progress-bar",
|
|
891
|
+
style: { width: `${progress}%` }
|
|
892
|
+
}
|
|
893
|
+
) });
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
// src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx
|
|
897
|
+
import { Component } from "react";
|
|
898
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
899
|
+
var ErrorBoundary = class extends Component {
|
|
900
|
+
state = {
|
|
901
|
+
hasError: false
|
|
902
|
+
};
|
|
903
|
+
static getDerivedStateFromError(error) {
|
|
904
|
+
return { hasError: true, error };
|
|
905
|
+
}
|
|
906
|
+
componentDidCatch(error, errorInfo) {
|
|
907
|
+
console.error("Uncaught error in Boltdocs Layout:", error, errorInfo);
|
|
908
|
+
}
|
|
909
|
+
render() {
|
|
910
|
+
if (this.state.hasError) {
|
|
911
|
+
return this.props.fallback || /* @__PURE__ */ jsxs9("div", { className: "boltdocs-error-boundary", children: [
|
|
912
|
+
/* @__PURE__ */ jsx15("div", { className: "boltdocs-error-title", children: "Something went wrong" }),
|
|
913
|
+
/* @__PURE__ */ jsx15("p", { className: "boltdocs-error-message", children: this.state.error?.message || "An unexpected error occurred while rendering this page." }),
|
|
914
|
+
/* @__PURE__ */ jsx15(
|
|
915
|
+
"button",
|
|
916
|
+
{
|
|
917
|
+
className: "boltdocs-error-retry",
|
|
918
|
+
onClick: () => this.setState({ hasError: false }),
|
|
919
|
+
children: "Try again"
|
|
920
|
+
}
|
|
921
|
+
)
|
|
922
|
+
] });
|
|
923
|
+
}
|
|
924
|
+
return this.props.children;
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
|
|
856
928
|
// src/client/theme/ui/Layout/Layout.tsx
|
|
857
|
-
import { jsx as
|
|
929
|
+
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
858
930
|
function ThemeLayout({
|
|
859
931
|
config,
|
|
860
932
|
routes,
|
|
@@ -886,13 +958,14 @@ function ThemeLayout({
|
|
|
886
958
|
const prevPage = localIndex > 0 ? filteredRoutes[localIndex - 1] : null;
|
|
887
959
|
const nextPage = localIndex >= 0 && localIndex < filteredRoutes.length - 1 ? filteredRoutes[localIndex + 1] : null;
|
|
888
960
|
const { preload } = usePreload();
|
|
889
|
-
|
|
961
|
+
React7.useEffect(() => {
|
|
890
962
|
if (prevPage?.path) preload(prevPage.path);
|
|
891
963
|
if (nextPage?.path) preload(nextPage.path);
|
|
892
964
|
}, [prevPage, nextPage, preload]);
|
|
893
|
-
return /* @__PURE__ */
|
|
894
|
-
|
|
895
|
-
|
|
965
|
+
return /* @__PURE__ */ jsxs10("div", { className: `boltdocs-layout ${className}`, style, children: [
|
|
966
|
+
/* @__PURE__ */ jsx16(ProgressBar, {}),
|
|
967
|
+
background !== void 0 ? background : /* @__PURE__ */ jsx16(BackgroundGradient, {}),
|
|
968
|
+
head !== void 0 ? head : /* @__PURE__ */ jsx16(
|
|
896
969
|
Head,
|
|
897
970
|
{
|
|
898
971
|
siteTitle,
|
|
@@ -900,7 +973,7 @@ function ThemeLayout({
|
|
|
900
973
|
routes
|
|
901
974
|
}
|
|
902
975
|
),
|
|
903
|
-
navbar !== void 0 ? navbar : /* @__PURE__ */
|
|
976
|
+
navbar !== void 0 ? navbar : /* @__PURE__ */ jsx16(
|
|
904
977
|
Navbar,
|
|
905
978
|
{
|
|
906
979
|
config,
|
|
@@ -910,43 +983,43 @@ function ThemeLayout({
|
|
|
910
983
|
currentVersion
|
|
911
984
|
}
|
|
912
985
|
),
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
sidebar !== void 0 ? sidebar : /* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
breadcrumbs !== void 0 ? breadcrumbs : /* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
(prevPage || nextPage) && /* @__PURE__ */
|
|
919
|
-
prevPage ? /* @__PURE__ */
|
|
986
|
+
/* @__PURE__ */ jsxs10("div", { className: "boltdocs-main-container", children: [
|
|
987
|
+
sidebar !== void 0 ? sidebar : /* @__PURE__ */ jsx16(Sidebar, { routes: filteredRoutes, config }),
|
|
988
|
+
/* @__PURE__ */ jsxs10("main", { className: "boltdocs-content", children: [
|
|
989
|
+
breadcrumbs !== void 0 ? breadcrumbs : /* @__PURE__ */ jsx16(Breadcrumbs, { routes: filteredRoutes, config }),
|
|
990
|
+
/* @__PURE__ */ jsx16("div", { className: "boltdocs-page", children: /* @__PURE__ */ jsx16(ErrorBoundary, { children }) }),
|
|
991
|
+
(prevPage || nextPage) && /* @__PURE__ */ jsxs10("nav", { className: "page-nav", "aria-label": "Pagination", children: [
|
|
992
|
+
prevPage ? /* @__PURE__ */ jsxs10(
|
|
920
993
|
Link,
|
|
921
994
|
{
|
|
922
995
|
to: prevPage.path || "/",
|
|
923
996
|
className: "page-nav-link page-nav-link--prev",
|
|
924
997
|
children: [
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ jsxs10("div", { className: "page-nav-info", children: [
|
|
999
|
+
/* @__PURE__ */ jsx16("span", { className: "page-nav-label", children: "Previous" }),
|
|
1000
|
+
/* @__PURE__ */ jsx16("span", { className: "page-nav-title", children: prevPage.title })
|
|
928
1001
|
] }),
|
|
929
|
-
/* @__PURE__ */
|
|
1002
|
+
/* @__PURE__ */ jsx16(ChevronLeft, { className: "page-nav-arrow", size: 16 })
|
|
930
1003
|
]
|
|
931
1004
|
}
|
|
932
|
-
) : /* @__PURE__ */
|
|
933
|
-
nextPage ? /* @__PURE__ */
|
|
1005
|
+
) : /* @__PURE__ */ jsx16("span", {}),
|
|
1006
|
+
nextPage ? /* @__PURE__ */ jsxs10(
|
|
934
1007
|
Link,
|
|
935
1008
|
{
|
|
936
1009
|
to: nextPage.path || "/",
|
|
937
1010
|
className: "page-nav-link page-nav-link--next",
|
|
938
1011
|
children: [
|
|
939
|
-
/* @__PURE__ */
|
|
940
|
-
/* @__PURE__ */
|
|
941
|
-
/* @__PURE__ */
|
|
1012
|
+
/* @__PURE__ */ jsxs10("div", { className: "page-nav-info", children: [
|
|
1013
|
+
/* @__PURE__ */ jsx16("span", { className: "page-nav-label", children: "Next" }),
|
|
1014
|
+
/* @__PURE__ */ jsx16("span", { className: "page-nav-title", children: nextPage.title })
|
|
942
1015
|
] }),
|
|
943
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ jsx16(ChevronRight3, { className: "page-nav-arrow", size: 16 })
|
|
944
1017
|
]
|
|
945
1018
|
}
|
|
946
|
-
) : /* @__PURE__ */
|
|
1019
|
+
) : /* @__PURE__ */ jsx16("span", {})
|
|
947
1020
|
] })
|
|
948
1021
|
] }),
|
|
949
|
-
toc !== void 0 ? toc : /* @__PURE__ */
|
|
1022
|
+
toc !== void 0 ? toc : /* @__PURE__ */ jsx16(
|
|
950
1023
|
OnThisPage,
|
|
951
1024
|
{
|
|
952
1025
|
headings: routes[currentIndex]?.headings,
|
|
@@ -961,25 +1034,25 @@ function ThemeLayout({
|
|
|
961
1034
|
|
|
962
1035
|
// src/client/theme/ui/NotFound/NotFound.tsx
|
|
963
1036
|
import { ArrowLeft } from "lucide-react";
|
|
964
|
-
import { jsx as
|
|
1037
|
+
import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
965
1038
|
function NotFound() {
|
|
966
|
-
return /* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
969
|
-
/* @__PURE__ */
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
/* @__PURE__ */
|
|
1039
|
+
return /* @__PURE__ */ jsx17("div", { className: "boltdocs-not-found", children: /* @__PURE__ */ jsxs11("div", { className: "not-found-content", children: [
|
|
1040
|
+
/* @__PURE__ */ jsx17("span", { className: "not-found-code", children: "404" }),
|
|
1041
|
+
/* @__PURE__ */ jsx17("h1", { className: "not-found-title", children: "Page Not Found" }),
|
|
1042
|
+
/* @__PURE__ */ jsx17("p", { className: "not-found-text", children: "The page you're looking for doesn't exist or has been moved." }),
|
|
1043
|
+
/* @__PURE__ */ jsxs11(Link, { to: "/", className: "not-found-link", children: [
|
|
1044
|
+
/* @__PURE__ */ jsx17(ArrowLeft, { size: 16 }),
|
|
972
1045
|
" Go to Home"
|
|
973
1046
|
] })
|
|
974
1047
|
] }) });
|
|
975
1048
|
}
|
|
976
1049
|
|
|
977
1050
|
// src/client/theme/ui/Loading/Loading.tsx
|
|
978
|
-
import { jsx as
|
|
1051
|
+
import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
979
1052
|
function Loading() {
|
|
980
|
-
return /* @__PURE__ */
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
-
/* @__PURE__ */
|
|
1053
|
+
return /* @__PURE__ */ jsxs12("div", { className: "boltdocs-loading", children: [
|
|
1054
|
+
/* @__PURE__ */ jsx18("div", { className: "loading-spinner" }),
|
|
1055
|
+
/* @__PURE__ */ jsx18("p", { className: "loading-text", children: "Loading..." })
|
|
983
1056
|
] });
|
|
984
1057
|
}
|
|
985
1058
|
|
|
@@ -995,11 +1068,11 @@ import {
|
|
|
995
1068
|
import { Link as LucideLink } from "lucide-react";
|
|
996
1069
|
|
|
997
1070
|
// src/client/theme/components/CodeBlock/CodeBlock.tsx
|
|
998
|
-
import { useState as
|
|
1071
|
+
import { useState as useState9, useRef as useRef4, useCallback as useCallback3 } from "react";
|
|
999
1072
|
import { Copy, Check } from "lucide-react";
|
|
1000
|
-
import { jsx as
|
|
1073
|
+
import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1001
1074
|
function CodeBlock({ children, ...props }) {
|
|
1002
|
-
const [copied, setCopied] =
|
|
1075
|
+
const [copied, setCopied] = useState9(false);
|
|
1003
1076
|
const preRef = useRef4(null);
|
|
1004
1077
|
const handleCopy = useCallback3(async () => {
|
|
1005
1078
|
const code = preRef.current?.textContent || "";
|
|
@@ -1007,22 +1080,22 @@ function CodeBlock({ children, ...props }) {
|
|
|
1007
1080
|
setCopied(true);
|
|
1008
1081
|
setTimeout(() => setCopied(false), 2e3);
|
|
1009
1082
|
}, []);
|
|
1010
|
-
return /* @__PURE__ */
|
|
1011
|
-
/* @__PURE__ */
|
|
1083
|
+
return /* @__PURE__ */ jsxs13("div", { className: "code-block-wrapper", children: [
|
|
1084
|
+
/* @__PURE__ */ jsx19(
|
|
1012
1085
|
"button",
|
|
1013
1086
|
{
|
|
1014
1087
|
className: `code-block-copy ${copied ? "copied" : ""}`,
|
|
1015
1088
|
onClick: handleCopy,
|
|
1016
1089
|
"aria-label": "Copy code",
|
|
1017
|
-
children: copied ? /* @__PURE__ */
|
|
1090
|
+
children: copied ? /* @__PURE__ */ jsx19(Check, { size: 16 }) : /* @__PURE__ */ jsx19(Copy, { size: 16 })
|
|
1018
1091
|
}
|
|
1019
1092
|
),
|
|
1020
|
-
/* @__PURE__ */
|
|
1093
|
+
/* @__PURE__ */ jsx19("pre", { ref: preRef, ...props, children })
|
|
1021
1094
|
] });
|
|
1022
1095
|
}
|
|
1023
1096
|
|
|
1024
1097
|
// src/client/app/index.tsx
|
|
1025
|
-
import { jsx as
|
|
1098
|
+
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1026
1099
|
var ConfigContext = createContext2(null);
|
|
1027
1100
|
function useConfig() {
|
|
1028
1101
|
return useContext2(ConfigContext);
|
|
@@ -1041,21 +1114,21 @@ var Heading = ({
|
|
|
1041
1114
|
children
|
|
1042
1115
|
}) => {
|
|
1043
1116
|
const Tag = `h${level}`;
|
|
1044
|
-
return /* @__PURE__ */
|
|
1117
|
+
return /* @__PURE__ */ jsxs14(Tag, { id, className: "boltdocs-heading", children: [
|
|
1045
1118
|
children,
|
|
1046
|
-
id && /* @__PURE__ */
|
|
1119
|
+
id && /* @__PURE__ */ jsx20("a", { href: `#${id}`, className: "header-anchor", "aria-label": "Anchor", children: /* @__PURE__ */ jsx20(LucideLink, { size: 16 }) })
|
|
1047
1120
|
] });
|
|
1048
1121
|
};
|
|
1049
1122
|
var mdxComponents = {
|
|
1050
|
-
h1: (props) => /* @__PURE__ */
|
|
1051
|
-
h2: (props) => /* @__PURE__ */
|
|
1052
|
-
h3: (props) => /* @__PURE__ */
|
|
1053
|
-
h4: (props) => /* @__PURE__ */
|
|
1054
|
-
h5: (props) => /* @__PURE__ */
|
|
1055
|
-
h6: (props) => /* @__PURE__ */
|
|
1056
|
-
pre: (props) => /* @__PURE__ */
|
|
1057
|
-
video: (props) => /* @__PURE__ */
|
|
1058
|
-
PackageManagerTabs: (props) => /* @__PURE__ */
|
|
1123
|
+
h1: (props) => /* @__PURE__ */ jsx20(Heading, { level: 1, ...props }),
|
|
1124
|
+
h2: (props) => /* @__PURE__ */ jsx20(Heading, { level: 2, ...props }),
|
|
1125
|
+
h3: (props) => /* @__PURE__ */ jsx20(Heading, { level: 3, ...props }),
|
|
1126
|
+
h4: (props) => /* @__PURE__ */ jsx20(Heading, { level: 4, ...props }),
|
|
1127
|
+
h5: (props) => /* @__PURE__ */ jsx20(Heading, { level: 5, ...props }),
|
|
1128
|
+
h6: (props) => /* @__PURE__ */ jsx20(Heading, { level: 6, ...props }),
|
|
1129
|
+
pre: (props) => /* @__PURE__ */ jsx20(CodeBlock, { ...props, children: props.children }),
|
|
1130
|
+
video: (props) => /* @__PURE__ */ jsx20(Suspense, { fallback: /* @__PURE__ */ jsx20("div", { className: "video-skeleton" }), children: /* @__PURE__ */ jsx20(Video, { ...props }) }),
|
|
1131
|
+
PackageManagerTabs: (props) => /* @__PURE__ */ jsx20(Suspense, { fallback: /* @__PURE__ */ jsx20("div", { className: "pkg-tabs-skeleton" }), children: /* @__PURE__ */ jsx20(PackageManagerTabs, { ...props }) })
|
|
1059
1132
|
};
|
|
1060
1133
|
function AppShell({
|
|
1061
1134
|
initialRoutes,
|
|
@@ -1066,8 +1139,8 @@ function AppShell({
|
|
|
1066
1139
|
homePage: HomePage,
|
|
1067
1140
|
components: customComponents = {}
|
|
1068
1141
|
}) {
|
|
1069
|
-
const [routesInfo, setRoutesInfo] =
|
|
1070
|
-
const [config] =
|
|
1142
|
+
const [routesInfo, setRoutesInfo] = useState10(initialRoutes);
|
|
1143
|
+
const [config] = useState10(initialConfig);
|
|
1071
1144
|
const resolveRoutes = (infos) => {
|
|
1072
1145
|
return infos.filter(
|
|
1073
1146
|
(route) => !(HomePage && (route.path === "/" || route.path === ""))
|
|
@@ -1078,35 +1151,35 @@ function AppShell({
|
|
|
1078
1151
|
const loader = loaderKey ? modules[loaderKey] : null;
|
|
1079
1152
|
return {
|
|
1080
1153
|
...route,
|
|
1081
|
-
Component:
|
|
1154
|
+
Component: React9.lazy(() => {
|
|
1082
1155
|
if (!loader)
|
|
1083
|
-
return Promise.resolve({ default: () => /* @__PURE__ */
|
|
1156
|
+
return Promise.resolve({ default: () => /* @__PURE__ */ jsx20(NotFound, {}) });
|
|
1084
1157
|
return loader();
|
|
1085
1158
|
})
|
|
1086
1159
|
};
|
|
1087
1160
|
});
|
|
1088
1161
|
};
|
|
1089
|
-
const [resolvedRoutes, setResolvedRoutes] =
|
|
1162
|
+
const [resolvedRoutes, setResolvedRoutes] = useState10(
|
|
1090
1163
|
() => resolveRoutes(initialRoutes)
|
|
1091
1164
|
);
|
|
1092
|
-
|
|
1165
|
+
useEffect8(() => {
|
|
1093
1166
|
if (hot) {
|
|
1094
1167
|
hot.on("boltdocs:routes-update", (newRoutes) => {
|
|
1095
1168
|
setRoutesInfo(newRoutes);
|
|
1096
1169
|
});
|
|
1097
1170
|
}
|
|
1098
1171
|
}, [hot]);
|
|
1099
|
-
|
|
1172
|
+
useEffect8(() => {
|
|
1100
1173
|
setResolvedRoutes(resolveRoutes(routesInfo));
|
|
1101
1174
|
}, [routesInfo, modules, docsDirName]);
|
|
1102
|
-
return /* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
HomePage && /* @__PURE__ */
|
|
1175
|
+
return /* @__PURE__ */ jsx20(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ jsxs14(PreloadProvider, { routes: routesInfo, modules, children: [
|
|
1176
|
+
/* @__PURE__ */ jsx20(ScrollHandler, {}),
|
|
1177
|
+
/* @__PURE__ */ jsxs14(Routes, { children: [
|
|
1178
|
+
HomePage && /* @__PURE__ */ jsx20(
|
|
1106
1179
|
Route,
|
|
1107
1180
|
{
|
|
1108
1181
|
path: "/",
|
|
1109
|
-
element: /* @__PURE__ */
|
|
1182
|
+
element: /* @__PURE__ */ jsx20(
|
|
1110
1183
|
ThemeLayout,
|
|
1111
1184
|
{
|
|
1112
1185
|
config,
|
|
@@ -1115,20 +1188,20 @@ function AppShell({
|
|
|
1115
1188
|
toc: null,
|
|
1116
1189
|
breadcrumbs: null,
|
|
1117
1190
|
...config.themeConfig?.layoutProps,
|
|
1118
|
-
children: /* @__PURE__ */
|
|
1191
|
+
children: /* @__PURE__ */ jsx20(HomePage, {})
|
|
1119
1192
|
}
|
|
1120
1193
|
)
|
|
1121
1194
|
}
|
|
1122
1195
|
),
|
|
1123
|
-
/* @__PURE__ */
|
|
1196
|
+
/* @__PURE__ */ jsx20(
|
|
1124
1197
|
Route,
|
|
1125
1198
|
{
|
|
1126
|
-
element: /* @__PURE__ */
|
|
1127
|
-
children: resolvedRoutes.map((route) => /* @__PURE__ */
|
|
1199
|
+
element: /* @__PURE__ */ jsx20(DocsLayout, { config, routes: routesInfo }),
|
|
1200
|
+
children: resolvedRoutes.map((route) => /* @__PURE__ */ jsx20(
|
|
1128
1201
|
Route,
|
|
1129
1202
|
{
|
|
1130
1203
|
path: route.path === "" ? "/" : route.path,
|
|
1131
|
-
element: /* @__PURE__ */
|
|
1204
|
+
element: /* @__PURE__ */ jsx20(React9.Suspense, { fallback: /* @__PURE__ */ jsx20(Loading, {}), children: /* @__PURE__ */ jsx20(
|
|
1132
1205
|
MdxPage,
|
|
1133
1206
|
{
|
|
1134
1207
|
Component: route.Component,
|
|
@@ -1141,17 +1214,17 @@ function AppShell({
|
|
|
1141
1214
|
},
|
|
1142
1215
|
"docs-layout"
|
|
1143
1216
|
),
|
|
1144
|
-
/* @__PURE__ */
|
|
1217
|
+
/* @__PURE__ */ jsx20(
|
|
1145
1218
|
Route,
|
|
1146
1219
|
{
|
|
1147
1220
|
path: "*",
|
|
1148
|
-
element: /* @__PURE__ */
|
|
1221
|
+
element: /* @__PURE__ */ jsx20(
|
|
1149
1222
|
ThemeLayout,
|
|
1150
1223
|
{
|
|
1151
1224
|
config,
|
|
1152
1225
|
routes: routesInfo,
|
|
1153
1226
|
...config.themeConfig?.layoutProps,
|
|
1154
|
-
children: /* @__PURE__ */
|
|
1227
|
+
children: /* @__PURE__ */ jsx20(NotFound, {})
|
|
1155
1228
|
}
|
|
1156
1229
|
)
|
|
1157
1230
|
}
|
|
@@ -1162,23 +1235,25 @@ function AppShell({
|
|
|
1162
1235
|
function ScrollHandler() {
|
|
1163
1236
|
const { pathname, hash } = useLocation8();
|
|
1164
1237
|
useLayoutEffect(() => {
|
|
1238
|
+
const container = document.querySelector(".boltdocs-content");
|
|
1239
|
+
if (!container) return;
|
|
1165
1240
|
if (hash) {
|
|
1166
1241
|
const id = hash.replace("#", "");
|
|
1167
1242
|
const element = document.getElementById(id);
|
|
1168
1243
|
if (element) {
|
|
1169
1244
|
const offset = 80;
|
|
1170
|
-
const
|
|
1245
|
+
const containerRect = container.getBoundingClientRect().top;
|
|
1171
1246
|
const elementRect = element.getBoundingClientRect().top;
|
|
1172
|
-
const elementPosition = elementRect -
|
|
1173
|
-
const offsetPosition = elementPosition - offset;
|
|
1174
|
-
|
|
1247
|
+
const elementPosition = elementRect - containerRect;
|
|
1248
|
+
const offsetPosition = elementPosition - offset + container.scrollTop;
|
|
1249
|
+
container.scrollTo({
|
|
1175
1250
|
top: offsetPosition,
|
|
1176
1251
|
behavior: "smooth"
|
|
1177
1252
|
});
|
|
1178
1253
|
return;
|
|
1179
1254
|
}
|
|
1180
1255
|
}
|
|
1181
|
-
|
|
1256
|
+
container.scrollTo(0, 0);
|
|
1182
1257
|
}, [pathname, hash]);
|
|
1183
1258
|
return null;
|
|
1184
1259
|
}
|
|
@@ -1186,22 +1261,22 @@ function DocsLayout({
|
|
|
1186
1261
|
config,
|
|
1187
1262
|
routes
|
|
1188
1263
|
}) {
|
|
1189
|
-
return /* @__PURE__ */
|
|
1264
|
+
return /* @__PURE__ */ jsx20(
|
|
1190
1265
|
ThemeLayout,
|
|
1191
1266
|
{
|
|
1192
1267
|
config,
|
|
1193
1268
|
routes,
|
|
1194
1269
|
...config.themeConfig?.layoutProps,
|
|
1195
|
-
children: /* @__PURE__ */
|
|
1270
|
+
children: /* @__PURE__ */ jsx20(Outlet, {})
|
|
1196
1271
|
}
|
|
1197
1272
|
);
|
|
1198
1273
|
}
|
|
1199
1274
|
function MdxPage({
|
|
1200
|
-
Component,
|
|
1275
|
+
Component: Component2,
|
|
1201
1276
|
customComponents = {}
|
|
1202
1277
|
}) {
|
|
1203
1278
|
const allComponents = { ...mdxComponents, ...customComponents };
|
|
1204
|
-
return /* @__PURE__ */
|
|
1279
|
+
return /* @__PURE__ */ jsx20(MDXProvider, { components: allComponents, children: /* @__PURE__ */ jsx20(Component2, {}) });
|
|
1205
1280
|
}
|
|
1206
1281
|
function createBoltdocsApp(options) {
|
|
1207
1282
|
const { target, routes, docsDirName, config, modules, hot, homePage } = options;
|
|
@@ -1211,7 +1286,7 @@ function createBoltdocsApp(options) {
|
|
|
1211
1286
|
`[boltdocs] Mount target "${target}" not found in document.`
|
|
1212
1287
|
);
|
|
1213
1288
|
}
|
|
1214
|
-
const app = /* @__PURE__ */
|
|
1289
|
+
const app = /* @__PURE__ */ jsx20(React9.StrictMode, { children: /* @__PURE__ */ jsx20(BrowserRouter, { children: /* @__PURE__ */ jsx20(
|
|
1215
1290
|
AppShell,
|
|
1216
1291
|
{
|
|
1217
1292
|
initialRoutes: routes,
|
|
@@ -1228,9 +1303,9 @@ function createBoltdocsApp(options) {
|
|
|
1228
1303
|
}
|
|
1229
1304
|
|
|
1230
1305
|
// src/client/theme/ui/Link/LinkPreview.tsx
|
|
1231
|
-
import { useEffect as
|
|
1306
|
+
import { useEffect as useEffect9, useState as useState11, useRef as useRef5 } from "react";
|
|
1232
1307
|
import { createPortal } from "react-dom";
|
|
1233
|
-
import { jsx as
|
|
1308
|
+
import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1234
1309
|
function LinkPreview({
|
|
1235
1310
|
isVisible,
|
|
1236
1311
|
title,
|
|
@@ -1239,8 +1314,8 @@ function LinkPreview({
|
|
|
1239
1314
|
y
|
|
1240
1315
|
}) {
|
|
1241
1316
|
const ref = useRef5(null);
|
|
1242
|
-
const [position, setPosition] =
|
|
1243
|
-
|
|
1317
|
+
const [position, setPosition] = useState11({ top: 0, left: 0 });
|
|
1318
|
+
useEffect9(() => {
|
|
1244
1319
|
if (ref.current) {
|
|
1245
1320
|
const rect = ref.current.getBoundingClientRect();
|
|
1246
1321
|
const padding = 12;
|
|
@@ -1256,7 +1331,7 @@ function LinkPreview({
|
|
|
1256
1331
|
}
|
|
1257
1332
|
}, [x, y, isVisible]);
|
|
1258
1333
|
return createPortal(
|
|
1259
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ jsx21(
|
|
1260
1335
|
"div",
|
|
1261
1336
|
{
|
|
1262
1337
|
ref,
|
|
@@ -1265,9 +1340,9 @@ function LinkPreview({
|
|
|
1265
1340
|
top: position.top,
|
|
1266
1341
|
left: position.left
|
|
1267
1342
|
},
|
|
1268
|
-
children: /* @__PURE__ */
|
|
1269
|
-
/* @__PURE__ */
|
|
1270
|
-
summary && /* @__PURE__ */
|
|
1343
|
+
children: /* @__PURE__ */ jsxs15("div", { className: "boltdocs-link-preview-content", children: [
|
|
1344
|
+
/* @__PURE__ */ jsx21("span", { className: "boltdocs-link-preview-title", children: title }),
|
|
1345
|
+
summary && /* @__PURE__ */ jsx21("p", { className: "boltdocs-link-preview-summary", children: summary })
|
|
1271
1346
|
] })
|
|
1272
1347
|
}
|
|
1273
1348
|
),
|
|
@@ -1276,7 +1351,7 @@ function LinkPreview({
|
|
|
1276
1351
|
}
|
|
1277
1352
|
|
|
1278
1353
|
// src/client/theme/ui/Link/Link.tsx
|
|
1279
|
-
import { Fragment, jsx as
|
|
1354
|
+
import { Fragment, jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1280
1355
|
function useLocalizedTo(to) {
|
|
1281
1356
|
const location = useLocation9();
|
|
1282
1357
|
const config = useConfig();
|
|
@@ -1332,7 +1407,7 @@ function useLocalizedTo(to) {
|
|
|
1332
1407
|
}
|
|
1333
1408
|
return finalPath === basePath ? basePath : finalPath;
|
|
1334
1409
|
}
|
|
1335
|
-
var Link =
|
|
1410
|
+
var Link = React10.forwardRef(
|
|
1336
1411
|
(props, ref) => {
|
|
1337
1412
|
const {
|
|
1338
1413
|
boltdocsPrefetch = "hover",
|
|
@@ -1350,7 +1425,7 @@ var Link = React8.forwardRef(
|
|
|
1350
1425
|
const config = useConfig();
|
|
1351
1426
|
const navigate = useNavigate3();
|
|
1352
1427
|
const shouldShowPreview = boltdocsPreview && config?.themeConfig?.linkPreview !== false;
|
|
1353
|
-
const [preview, setPreview] =
|
|
1428
|
+
const [preview, setPreview] = React10.useState({ visible: false, x: 0, y: 0, title: "" });
|
|
1354
1429
|
const handleMouseEnter = (e) => {
|
|
1355
1430
|
onMouseEnter?.(e);
|
|
1356
1431
|
if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
@@ -1399,13 +1474,13 @@ var Link = React8.forwardRef(
|
|
|
1399
1474
|
}
|
|
1400
1475
|
if (typeof localizedTo === "string" && !localizedTo.startsWith("http")) {
|
|
1401
1476
|
e.preventDefault();
|
|
1402
|
-
|
|
1477
|
+
React10.startTransition(() => {
|
|
1403
1478
|
navigate(localizedTo);
|
|
1404
1479
|
});
|
|
1405
1480
|
}
|
|
1406
1481
|
};
|
|
1407
|
-
return /* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1482
|
+
return /* @__PURE__ */ jsxs16(Fragment, { children: [
|
|
1483
|
+
/* @__PURE__ */ jsx22(
|
|
1409
1484
|
RouterLink,
|
|
1410
1485
|
{
|
|
1411
1486
|
ref,
|
|
@@ -1419,7 +1494,7 @@ var Link = React8.forwardRef(
|
|
|
1419
1494
|
...rest
|
|
1420
1495
|
}
|
|
1421
1496
|
),
|
|
1422
|
-
preview.visible && shouldShowPreview && /* @__PURE__ */
|
|
1497
|
+
preview.visible && shouldShowPreview && /* @__PURE__ */ jsx22(
|
|
1423
1498
|
LinkPreview,
|
|
1424
1499
|
{
|
|
1425
1500
|
isVisible: preview.visible,
|
|
@@ -1433,7 +1508,7 @@ var Link = React8.forwardRef(
|
|
|
1433
1508
|
}
|
|
1434
1509
|
);
|
|
1435
1510
|
Link.displayName = "Link";
|
|
1436
|
-
var NavLink =
|
|
1511
|
+
var NavLink = React10.forwardRef(
|
|
1437
1512
|
(props, ref) => {
|
|
1438
1513
|
const {
|
|
1439
1514
|
boltdocsPrefetch = "hover",
|
|
@@ -1451,7 +1526,7 @@ var NavLink = React8.forwardRef(
|
|
|
1451
1526
|
const config = useConfig();
|
|
1452
1527
|
const navigate = useNavigate3();
|
|
1453
1528
|
const shouldShowPreview = boltdocsPreview && config?.themeConfig?.linkPreview !== false;
|
|
1454
|
-
const [preview, setPreview] =
|
|
1529
|
+
const [preview, setPreview] = React10.useState({ visible: false, x: 0, y: 0, title: "" });
|
|
1455
1530
|
const handleMouseEnter = (e) => {
|
|
1456
1531
|
onMouseEnter?.(e);
|
|
1457
1532
|
if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
@@ -1500,13 +1575,13 @@ var NavLink = React8.forwardRef(
|
|
|
1500
1575
|
}
|
|
1501
1576
|
if (typeof localizedTo === "string" && !localizedTo.startsWith("http")) {
|
|
1502
1577
|
e.preventDefault();
|
|
1503
|
-
|
|
1578
|
+
React10.startTransition(() => {
|
|
1504
1579
|
navigate(localizedTo);
|
|
1505
1580
|
});
|
|
1506
1581
|
}
|
|
1507
1582
|
};
|
|
1508
|
-
return /* @__PURE__ */
|
|
1509
|
-
/* @__PURE__ */
|
|
1583
|
+
return /* @__PURE__ */ jsxs16(Fragment, { children: [
|
|
1584
|
+
/* @__PURE__ */ jsx22(
|
|
1510
1585
|
RouterNavLink,
|
|
1511
1586
|
{
|
|
1512
1587
|
ref,
|
|
@@ -1520,7 +1595,7 @@ var NavLink = React8.forwardRef(
|
|
|
1520
1595
|
...rest
|
|
1521
1596
|
}
|
|
1522
1597
|
),
|
|
1523
|
-
preview.visible && shouldShowPreview && /* @__PURE__ */
|
|
1598
|
+
preview.visible && shouldShowPreview && /* @__PURE__ */ jsx22(
|
|
1524
1599
|
LinkPreview,
|
|
1525
1600
|
{
|
|
1526
1601
|
isVisible: preview.visible,
|
|
@@ -1537,16 +1612,37 @@ NavLink.displayName = "NavLink";
|
|
|
1537
1612
|
|
|
1538
1613
|
// src/client/theme/ui/Navbar/Tabs.tsx
|
|
1539
1614
|
import * as Icons from "lucide-react";
|
|
1540
|
-
import { jsx as
|
|
1615
|
+
import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1541
1616
|
function Tabs({ tabs, routes }) {
|
|
1542
1617
|
const location = useLocation10();
|
|
1618
|
+
const containerRef = useRef6(null);
|
|
1619
|
+
const tabRefs = useRef6([]);
|
|
1620
|
+
const [indicatorStyle, setIndicatorStyle] = useState12({
|
|
1621
|
+
opacity: 0,
|
|
1622
|
+
transform: "translateX(0) scaleX(0)",
|
|
1623
|
+
width: 0
|
|
1624
|
+
});
|
|
1543
1625
|
const currentRoute = routes.find((r) => r.path === location.pathname);
|
|
1544
1626
|
const currentTabId = currentRoute?.tab?.toLowerCase();
|
|
1627
|
+
const activeIndex = tabs.findIndex(
|
|
1628
|
+
(tab) => currentTabId ? currentTabId === tab.id.toLowerCase() : false
|
|
1629
|
+
);
|
|
1630
|
+
const finalActiveIndex = activeIndex === -1 ? 0 : activeIndex;
|
|
1631
|
+
useEffect10(() => {
|
|
1632
|
+
const activeTab = tabRefs.current[finalActiveIndex];
|
|
1633
|
+
if (activeTab) {
|
|
1634
|
+
setIndicatorStyle({
|
|
1635
|
+
opacity: 1,
|
|
1636
|
+
width: activeTab.offsetWidth,
|
|
1637
|
+
transform: `translateX(${activeTab.offsetLeft}px)`
|
|
1638
|
+
});
|
|
1639
|
+
}
|
|
1640
|
+
}, [finalActiveIndex, tabs, location.pathname]);
|
|
1545
1641
|
if (!tabs || tabs.length === 0) return null;
|
|
1546
1642
|
const renderTabIcon = (iconName) => {
|
|
1547
1643
|
if (!iconName) return null;
|
|
1548
1644
|
if (iconName.trim().startsWith("<svg")) {
|
|
1549
|
-
return /* @__PURE__ */
|
|
1645
|
+
return /* @__PURE__ */ jsx23(
|
|
1550
1646
|
"span",
|
|
1551
1647
|
{
|
|
1552
1648
|
className: "tab-icon svg-icon",
|
|
@@ -1556,33 +1652,41 @@ function Tabs({ tabs, routes }) {
|
|
|
1556
1652
|
}
|
|
1557
1653
|
const LucideIcon = Icons[iconName];
|
|
1558
1654
|
if (LucideIcon) {
|
|
1559
|
-
return /* @__PURE__ */
|
|
1655
|
+
return /* @__PURE__ */ jsx23(LucideIcon, { size: 16, className: "tab-icon lucide-icon" });
|
|
1560
1656
|
}
|
|
1561
|
-
return /* @__PURE__ */
|
|
1657
|
+
return /* @__PURE__ */ jsx23("img", { src: iconName, alt: "", className: "tab-icon img-icon" });
|
|
1562
1658
|
};
|
|
1563
|
-
return /* @__PURE__ */
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1659
|
+
return /* @__PURE__ */ jsx23("div", { className: "boltdocs-tabs-container", children: /* @__PURE__ */ jsxs17("div", { className: "boltdocs-tabs", ref: containerRef, children: [
|
|
1660
|
+
tabs.map((tab, index) => {
|
|
1661
|
+
const isActive = index === finalActiveIndex;
|
|
1662
|
+
const firstRoute = routes.find(
|
|
1663
|
+
(r) => r.tab && r.tab.toLowerCase() === tab.id.toLowerCase()
|
|
1664
|
+
);
|
|
1665
|
+
const linkTo = firstRoute ? firstRoute.path : "#";
|
|
1666
|
+
return /* @__PURE__ */ jsxs17(
|
|
1667
|
+
Link,
|
|
1668
|
+
{
|
|
1669
|
+
to: linkTo,
|
|
1670
|
+
ref: (el) => {
|
|
1671
|
+
tabRefs.current[index] = el;
|
|
1672
|
+
},
|
|
1673
|
+
className: `boltdocs-tab-item ${isActive ? "active" : ""}`,
|
|
1674
|
+
children: [
|
|
1675
|
+
renderTabIcon(tab.icon),
|
|
1676
|
+
/* @__PURE__ */ jsx23("span", { children: tab.text })
|
|
1677
|
+
]
|
|
1678
|
+
},
|
|
1679
|
+
tab.id
|
|
1680
|
+
);
|
|
1681
|
+
}),
|
|
1682
|
+
/* @__PURE__ */ jsx23("div", { className: "boltdocs-tab-indicator", style: indicatorStyle })
|
|
1683
|
+
] }) });
|
|
1580
1684
|
}
|
|
1581
1685
|
|
|
1582
1686
|
// src/client/theme/ui/Navbar/Navbar.tsx
|
|
1583
|
-
import { jsx as
|
|
1687
|
+
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1584
1688
|
var SearchDialog = lazy2(
|
|
1585
|
-
() => import("./SearchDialog-
|
|
1689
|
+
() => import("./SearchDialog-6Z7CUAYJ.mjs").then((m) => ({ default: m.SearchDialog }))
|
|
1586
1690
|
);
|
|
1587
1691
|
var ICON_MAP = {
|
|
1588
1692
|
discord: Discord,
|
|
@@ -1607,9 +1711,9 @@ function Navbar({
|
|
|
1607
1711
|
const text = item.label || item.text || "";
|
|
1608
1712
|
const href = item.to || item.href || item.link || "";
|
|
1609
1713
|
const isExternal = href.startsWith("http") || href.startsWith("//") || href.includes("://");
|
|
1610
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ jsxs18(Link2, { to: href, target: isExternal ? "_blank" : void 0, children: [
|
|
1611
1715
|
text,
|
|
1612
|
-
isExternal && /* @__PURE__ */
|
|
1716
|
+
isExternal && /* @__PURE__ */ jsx24("span", { className: "navbar-external-icon", children: /* @__PURE__ */ jsxs18(
|
|
1613
1717
|
"svg",
|
|
1614
1718
|
{
|
|
1615
1719
|
viewBox: "0 0 24 24",
|
|
@@ -1621,24 +1725,24 @@ function Navbar({
|
|
|
1621
1725
|
strokeLinecap: "round",
|
|
1622
1726
|
strokeLinejoin: "round",
|
|
1623
1727
|
children: [
|
|
1624
|
-
/* @__PURE__ */
|
|
1625
|
-
/* @__PURE__ */
|
|
1626
|
-
/* @__PURE__ */
|
|
1728
|
+
/* @__PURE__ */ jsx24("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
1729
|
+
/* @__PURE__ */ jsx24("polyline", { points: "15 3 21 3 21 9" }),
|
|
1730
|
+
/* @__PURE__ */ jsx24("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
1627
1731
|
]
|
|
1628
1732
|
}
|
|
1629
1733
|
) })
|
|
1630
1734
|
] }, i);
|
|
1631
1735
|
};
|
|
1632
|
-
return /* @__PURE__ */
|
|
1633
|
-
/* @__PURE__ */
|
|
1736
|
+
return /* @__PURE__ */ jsxs18("header", { className: `boltdocs-navbar ${hasTabs ? "has-tabs" : ""}`, children: [
|
|
1737
|
+
/* @__PURE__ */ jsxs18(
|
|
1634
1738
|
"div",
|
|
1635
1739
|
{
|
|
1636
1740
|
className: "navbar-container",
|
|
1637
1741
|
style: { height: "var(--ld-navbar-height)" },
|
|
1638
1742
|
children: [
|
|
1639
|
-
/* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
config.themeConfig?.logo ? config.themeConfig.logo.trim().startsWith("<svg") ? /* @__PURE__ */
|
|
1743
|
+
/* @__PURE__ */ jsxs18("div", { className: "navbar-left", children: [
|
|
1744
|
+
/* @__PURE__ */ jsx24("div", { className: "navbar-logo", children: /* @__PURE__ */ jsxs18(Link2, { to: "/", children: [
|
|
1745
|
+
config.themeConfig?.logo ? config.themeConfig.logo.trim().startsWith("<svg") ? /* @__PURE__ */ jsx24(
|
|
1642
1746
|
"span",
|
|
1643
1747
|
{
|
|
1644
1748
|
className: "navbar-logo-svg",
|
|
@@ -1646,7 +1750,7 @@ function Navbar({
|
|
|
1646
1750
|
__html: config.themeConfig.logo
|
|
1647
1751
|
}
|
|
1648
1752
|
}
|
|
1649
|
-
) : /* @__PURE__ */
|
|
1753
|
+
) : /* @__PURE__ */ jsx24(
|
|
1650
1754
|
"img",
|
|
1651
1755
|
{
|
|
1652
1756
|
src: config.themeConfig.logo,
|
|
@@ -1656,7 +1760,7 @@ function Navbar({
|
|
|
1656
1760
|
) : null,
|
|
1657
1761
|
title
|
|
1658
1762
|
] }) }),
|
|
1659
|
-
config.versions && currentVersion && allRoutes ? /* @__PURE__ */
|
|
1763
|
+
config.versions && currentVersion && allRoutes ? /* @__PURE__ */ jsx24(
|
|
1660
1764
|
VersionSwitcher,
|
|
1661
1765
|
{
|
|
1662
1766
|
versions: config.versions,
|
|
@@ -1664,17 +1768,17 @@ function Navbar({
|
|
|
1664
1768
|
currentLocale,
|
|
1665
1769
|
allRoutes
|
|
1666
1770
|
}
|
|
1667
|
-
) : config.themeConfig?.version ? /* @__PURE__ */
|
|
1771
|
+
) : config.themeConfig?.version ? /* @__PURE__ */ jsxs18("div", { className: "navbar-version", children: [
|
|
1668
1772
|
config.themeConfig.version,
|
|
1669
1773
|
" ",
|
|
1670
|
-
/* @__PURE__ */
|
|
1774
|
+
/* @__PURE__ */ jsx24(ChevronDown3, { size: 14 })
|
|
1671
1775
|
] }) : null,
|
|
1672
|
-
/* @__PURE__ */
|
|
1776
|
+
/* @__PURE__ */ jsx24("nav", { className: "navbar-links", "aria-label": "Top Navigation Left", children: leftItems.map(renderNavItem) })
|
|
1673
1777
|
] }),
|
|
1674
|
-
/* @__PURE__ */
|
|
1675
|
-
/* @__PURE__ */
|
|
1676
|
-
/* @__PURE__ */
|
|
1677
|
-
config.i18n && currentLocale && allRoutes && /* @__PURE__ */
|
|
1778
|
+
/* @__PURE__ */ jsxs18("div", { className: "navbar-right", children: [
|
|
1779
|
+
/* @__PURE__ */ jsx24("nav", { className: "navbar-links", "aria-label": "Top Navigation Right", children: rightItems.map(renderNavItem) }),
|
|
1780
|
+
/* @__PURE__ */ jsx24(Suspense2, { fallback: /* @__PURE__ */ jsx24("div", { className: "navbar-search-placeholder" }), children: /* @__PURE__ */ jsx24(SearchDialog, { routes: routes || [] }) }),
|
|
1781
|
+
config.i18n && currentLocale && allRoutes && /* @__PURE__ */ jsx24(
|
|
1678
1782
|
LanguageSwitcher,
|
|
1679
1783
|
{
|
|
1680
1784
|
i18n: config.i18n,
|
|
@@ -1682,12 +1786,12 @@ function Navbar({
|
|
|
1682
1786
|
allRoutes
|
|
1683
1787
|
}
|
|
1684
1788
|
),
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
config.themeConfig?.githubRepo && /* @__PURE__ */
|
|
1687
|
-
socialLinks.length > 0 && /* @__PURE__ */
|
|
1688
|
-
/* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ jsx24(ThemeToggle, {}),
|
|
1790
|
+
config.themeConfig?.githubRepo && /* @__PURE__ */ jsx24(GithubStars, { repo: config.themeConfig.githubRepo }),
|
|
1791
|
+
socialLinks.length > 0 && /* @__PURE__ */ jsx24("div", { className: "navbar-divider" }),
|
|
1792
|
+
/* @__PURE__ */ jsx24("div", { className: "navbar-icons", children: socialLinks.map((link, i) => {
|
|
1689
1793
|
const IconComp = ICON_MAP[link.icon.toLowerCase()];
|
|
1690
|
-
return /* @__PURE__ */
|
|
1794
|
+
return /* @__PURE__ */ jsx24(
|
|
1691
1795
|
"a",
|
|
1692
1796
|
{
|
|
1693
1797
|
href: link.link,
|
|
@@ -1695,7 +1799,7 @@ function Navbar({
|
|
|
1695
1799
|
rel: "noopener noreferrer",
|
|
1696
1800
|
className: "navbar-icon-btn",
|
|
1697
1801
|
"aria-label": link.icon,
|
|
1698
|
-
children: IconComp ? /* @__PURE__ */
|
|
1802
|
+
children: IconComp ? /* @__PURE__ */ jsx24(IconComp, {}) : /* @__PURE__ */ jsx24("span", { children: link.icon })
|
|
1699
1803
|
},
|
|
1700
1804
|
i
|
|
1701
1805
|
);
|
|
@@ -1704,7 +1808,7 @@ function Navbar({
|
|
|
1704
1808
|
]
|
|
1705
1809
|
}
|
|
1706
1810
|
),
|
|
1707
|
-
hasTabs && config.themeConfig?.tabs && /* @__PURE__ */
|
|
1811
|
+
hasTabs && config.themeConfig?.tabs && /* @__PURE__ */ jsx24(
|
|
1708
1812
|
Tabs,
|
|
1709
1813
|
{
|
|
1710
1814
|
tabs: config.themeConfig.tabs,
|