boltdocs 1.4.0 → 1.5.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/{SearchDialog-FBNGKRPK.mjs → SearchDialog-5ISK64QY.mjs} +1 -1
- package/dist/{SearchDialog-O3V36MXA.css → SearchDialog-CEVPEMT3.css} +54 -5
- package/dist/{cache-GQHF6BXI.mjs → cache-KNL5B4EE.mjs} +1 -1
- package/dist/{chunk-CYBWLFOG.mjs → chunk-FFBNU6IJ.mjs} +2 -1
- package/dist/{chunk-D7YBQG6H.mjs → chunk-FMQ4HRKZ.mjs} +311 -133
- package/dist/client/index.css +54 -5
- package/dist/client/index.d.mts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +624 -475
- package/dist/client/index.mjs +2 -4
- package/dist/client/ssr.css +54 -5
- package/dist/client/ssr.d.mts +1 -1
- package/dist/client/ssr.d.ts +1 -1
- package/dist/client/ssr.js +544 -395
- package/dist/client/ssr.mjs +1 -1
- package/dist/{config-BD5ZHz15.d.mts → config-DkZg5aCf.d.mts} +2 -0
- package/dist/{config-BD5ZHz15.d.ts → config-DkZg5aCf.d.ts} +2 -0
- package/dist/node/index.d.mts +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +24 -17
- package/dist/node/index.mjs +25 -19
- package/dist/{types-CvrzTbEX.d.mts → types-DGIo1VKD.d.mts} +2 -0
- package/dist/{types-CvrzTbEX.d.ts → types-DGIo1VKD.d.ts} +2 -0
- package/package.json +1 -1
- package/src/client/app/index.tsx +2 -12
- package/src/client/app/preload.tsx +3 -1
- package/src/client/theme/components/CodeBlock/CodeBlock.tsx +0 -11
- package/src/client/theme/styles/markdown.css +1 -5
- package/src/client/theme/ui/Link/Link.tsx +156 -18
- package/src/client/theme/ui/Link/LinkPreview.tsx +64 -0
- package/src/client/theme/ui/Link/link-preview.css +64 -0
- package/src/client/types.ts +2 -0
- package/src/node/config.ts +15 -6
- package/src/node/mdx.ts +11 -4
- package/src/node/routes/parser.ts +24 -2
- package/src/node/ssg/index.ts +1 -10
- package/src/node/utils.ts +4 -1
- package/dist/CodeBlock-QYIKJMEB.mjs +0 -7
- package/dist/chunk-KS5B3O6W.mjs +0 -43
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
copyToClipboard,
|
|
2
3
|
getStarsRepo
|
|
3
4
|
} from "./chunk-FMTOYQLO.mjs";
|
|
4
5
|
|
|
5
6
|
// src/client/theme/ui/Navbar/Navbar.tsx
|
|
6
|
-
import
|
|
7
|
+
import React10 from "react";
|
|
7
8
|
|
|
8
9
|
// src/client/theme/ui/Link/Link.tsx
|
|
9
|
-
import
|
|
10
|
+
import React7 from "react";
|
|
10
11
|
import {
|
|
11
12
|
Link as RouterLink,
|
|
12
13
|
NavLink as RouterNavLink,
|
|
@@ -19,7 +20,8 @@ import { createContext, useContext, useCallback } from "react";
|
|
|
19
20
|
import { jsx } from "react/jsx-runtime";
|
|
20
21
|
var PreloadContext = createContext({
|
|
21
22
|
preload: () => {
|
|
22
|
-
}
|
|
23
|
+
},
|
|
24
|
+
routes: []
|
|
23
25
|
});
|
|
24
26
|
function usePreload() {
|
|
25
27
|
return useContext(PreloadContext);
|
|
@@ -48,11 +50,11 @@ function PreloadProvider({
|
|
|
48
50
|
},
|
|
49
51
|
[routes, modules]
|
|
50
52
|
);
|
|
51
|
-
return /* @__PURE__ */ jsx(PreloadContext.Provider, { value: { preload }, children });
|
|
53
|
+
return /* @__PURE__ */ jsx(PreloadContext.Provider, { value: { preload, routes }, children });
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
// src/client/app/index.tsx
|
|
55
|
-
import
|
|
57
|
+
import React6, { useEffect as useEffect4, useState as useState6 } from "react";
|
|
56
58
|
import ReactDOM from "react-dom/client";
|
|
57
59
|
import {
|
|
58
60
|
BrowserRouter,
|
|
@@ -680,16 +682,40 @@ import {
|
|
|
680
682
|
useLayoutEffect
|
|
681
683
|
} from "react";
|
|
682
684
|
import { Link as LucideLink } from "lucide-react";
|
|
685
|
+
|
|
686
|
+
// src/client/theme/components/CodeBlock/CodeBlock.tsx
|
|
687
|
+
import { useState as useState5, useRef as useRef2, useCallback as useCallback3 } from "react";
|
|
688
|
+
import { Copy, Check } from "lucide-react";
|
|
683
689
|
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
690
|
+
function CodeBlock({ children, ...props }) {
|
|
691
|
+
const [copied, setCopied] = useState5(false);
|
|
692
|
+
const preRef = useRef2(null);
|
|
693
|
+
const handleCopy = useCallback3(async () => {
|
|
694
|
+
const code = preRef.current?.textContent || "";
|
|
695
|
+
copyToClipboard(code);
|
|
696
|
+
setCopied(true);
|
|
697
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
698
|
+
}, []);
|
|
699
|
+
return /* @__PURE__ */ jsxs10("div", { className: "code-block-wrapper", children: [
|
|
700
|
+
/* @__PURE__ */ jsx12(
|
|
701
|
+
"button",
|
|
702
|
+
{
|
|
703
|
+
className: `code-block-copy ${copied ? "copied" : ""}`,
|
|
704
|
+
onClick: handleCopy,
|
|
705
|
+
"aria-label": "Copy code",
|
|
706
|
+
children: copied ? /* @__PURE__ */ jsx12(Check, { size: 16 }) : /* @__PURE__ */ jsx12(Copy, { size: 16 })
|
|
707
|
+
}
|
|
708
|
+
),
|
|
709
|
+
/* @__PURE__ */ jsx12("pre", { ref: preRef, ...props, children })
|
|
710
|
+
] });
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
// src/client/app/index.tsx
|
|
714
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
684
715
|
var ConfigContext = createContext2(null);
|
|
685
716
|
function useConfig() {
|
|
686
717
|
return useContext2(ConfigContext);
|
|
687
718
|
}
|
|
688
|
-
var CodeBlock = lazy(
|
|
689
|
-
() => import("./CodeBlock-QYIKJMEB.mjs").then((m) => ({
|
|
690
|
-
default: m.CodeBlock
|
|
691
|
-
}))
|
|
692
|
-
);
|
|
693
719
|
var Video = lazy(
|
|
694
720
|
() => import("./Video-KNTY5BNO.mjs").then((m) => ({ default: m.Video }))
|
|
695
721
|
);
|
|
@@ -704,23 +730,21 @@ var Heading = ({
|
|
|
704
730
|
children
|
|
705
731
|
}) => {
|
|
706
732
|
const Tag = `h${level}`;
|
|
707
|
-
return /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ jsxs11(Tag, { id, className: "boltdocs-heading", children: [
|
|
708
734
|
children,
|
|
709
|
-
id && /* @__PURE__ */
|
|
735
|
+
id && /* @__PURE__ */ jsx13("a", { href: `#${id}`, className: "header-anchor", "aria-label": "Anchor", children: /* @__PURE__ */ jsx13(LucideLink, { size: 16 }) })
|
|
710
736
|
] });
|
|
711
737
|
};
|
|
712
738
|
var mdxComponents = {
|
|
713
|
-
h1: (props) => /* @__PURE__ */
|
|
714
|
-
h2: (props) => /* @__PURE__ */
|
|
715
|
-
h3: (props) => /* @__PURE__ */
|
|
716
|
-
h4: (props) => /* @__PURE__ */
|
|
717
|
-
h5: (props) => /* @__PURE__ */
|
|
718
|
-
h6: (props) => /* @__PURE__ */
|
|
719
|
-
pre: (props) => {
|
|
720
|
-
|
|
721
|
-
},
|
|
722
|
-
video: (props) => /* @__PURE__ */ jsx12(Suspense, { fallback: /* @__PURE__ */ jsx12("div", { className: "video-skeleton" }), children: /* @__PURE__ */ jsx12(Video, { ...props }) }),
|
|
723
|
-
PackageManagerTabs: (props) => /* @__PURE__ */ jsx12(Suspense, { fallback: /* @__PURE__ */ jsx12("div", { className: "pkg-tabs-skeleton" }), children: /* @__PURE__ */ jsx12(PackageManagerTabs, { ...props }) })
|
|
739
|
+
h1: (props) => /* @__PURE__ */ jsx13(Heading, { level: 1, ...props }),
|
|
740
|
+
h2: (props) => /* @__PURE__ */ jsx13(Heading, { level: 2, ...props }),
|
|
741
|
+
h3: (props) => /* @__PURE__ */ jsx13(Heading, { level: 3, ...props }),
|
|
742
|
+
h4: (props) => /* @__PURE__ */ jsx13(Heading, { level: 4, ...props }),
|
|
743
|
+
h5: (props) => /* @__PURE__ */ jsx13(Heading, { level: 5, ...props }),
|
|
744
|
+
h6: (props) => /* @__PURE__ */ jsx13(Heading, { level: 6, ...props }),
|
|
745
|
+
pre: (props) => /* @__PURE__ */ jsx13(CodeBlock, { ...props, children: props.children }),
|
|
746
|
+
video: (props) => /* @__PURE__ */ jsx13(Suspense, { fallback: /* @__PURE__ */ jsx13("div", { className: "video-skeleton" }), children: /* @__PURE__ */ jsx13(Video, { ...props }) }),
|
|
747
|
+
PackageManagerTabs: (props) => /* @__PURE__ */ jsx13(Suspense, { fallback: /* @__PURE__ */ jsx13("div", { className: "pkg-tabs-skeleton" }), children: /* @__PURE__ */ jsx13(PackageManagerTabs, { ...props }) })
|
|
724
748
|
};
|
|
725
749
|
function AppShell({
|
|
726
750
|
initialRoutes,
|
|
@@ -730,8 +754,8 @@ function AppShell({
|
|
|
730
754
|
homePage: HomePage,
|
|
731
755
|
components: customComponents = {}
|
|
732
756
|
}) {
|
|
733
|
-
const [routesInfo, setRoutesInfo] =
|
|
734
|
-
const [config] =
|
|
757
|
+
const [routesInfo, setRoutesInfo] = useState6(initialRoutes);
|
|
758
|
+
const [config] = useState6(initialConfig);
|
|
735
759
|
const resolveRoutes = (infos) => {
|
|
736
760
|
return infos.filter(
|
|
737
761
|
(route) => !(HomePage && (route.path === "/" || route.path === ""))
|
|
@@ -742,15 +766,15 @@ function AppShell({
|
|
|
742
766
|
const loader = loaderKey ? modules[loaderKey] : null;
|
|
743
767
|
return {
|
|
744
768
|
...route,
|
|
745
|
-
Component:
|
|
769
|
+
Component: React6.lazy(() => {
|
|
746
770
|
if (!loader)
|
|
747
|
-
return Promise.resolve({ default: () => /* @__PURE__ */
|
|
771
|
+
return Promise.resolve({ default: () => /* @__PURE__ */ jsx13(NotFound, {}) });
|
|
748
772
|
return loader();
|
|
749
773
|
})
|
|
750
774
|
};
|
|
751
775
|
});
|
|
752
776
|
};
|
|
753
|
-
const [resolvedRoutes, setResolvedRoutes] =
|
|
777
|
+
const [resolvedRoutes, setResolvedRoutes] = useState6(
|
|
754
778
|
() => resolveRoutes(initialRoutes)
|
|
755
779
|
);
|
|
756
780
|
useEffect4(() => {
|
|
@@ -763,14 +787,14 @@ function AppShell({
|
|
|
763
787
|
useEffect4(() => {
|
|
764
788
|
setResolvedRoutes(resolveRoutes(routesInfo));
|
|
765
789
|
}, [routesInfo, modules]);
|
|
766
|
-
return /* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
HomePage && /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ jsx13(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ jsxs11(PreloadProvider, { routes: routesInfo, modules, children: [
|
|
791
|
+
/* @__PURE__ */ jsx13(ScrollHandler, {}),
|
|
792
|
+
/* @__PURE__ */ jsxs11(Routes, { children: [
|
|
793
|
+
HomePage && /* @__PURE__ */ jsx13(
|
|
770
794
|
Route,
|
|
771
795
|
{
|
|
772
796
|
path: "/",
|
|
773
|
-
element: /* @__PURE__ */
|
|
797
|
+
element: /* @__PURE__ */ jsx13(
|
|
774
798
|
ThemeLayout,
|
|
775
799
|
{
|
|
776
800
|
config,
|
|
@@ -779,20 +803,20 @@ function AppShell({
|
|
|
779
803
|
toc: null,
|
|
780
804
|
breadcrumbs: null,
|
|
781
805
|
...config.themeConfig?.layoutProps,
|
|
782
|
-
children: /* @__PURE__ */
|
|
806
|
+
children: /* @__PURE__ */ jsx13(HomePage, {})
|
|
783
807
|
}
|
|
784
808
|
)
|
|
785
809
|
}
|
|
786
810
|
),
|
|
787
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ jsx13(
|
|
788
812
|
Route,
|
|
789
813
|
{
|
|
790
|
-
element: /* @__PURE__ */
|
|
791
|
-
children: resolvedRoutes.map((route) => /* @__PURE__ */
|
|
814
|
+
element: /* @__PURE__ */ jsx13(DocsLayout, { config, routes: routesInfo }),
|
|
815
|
+
children: resolvedRoutes.map((route) => /* @__PURE__ */ jsx13(
|
|
792
816
|
Route,
|
|
793
817
|
{
|
|
794
818
|
path: route.path === "" ? "/" : route.path,
|
|
795
|
-
element: /* @__PURE__ */
|
|
819
|
+
element: /* @__PURE__ */ jsx13(React6.Suspense, { fallback: /* @__PURE__ */ jsx13(Loading, {}), children: /* @__PURE__ */ jsx13(
|
|
796
820
|
MdxPage,
|
|
797
821
|
{
|
|
798
822
|
Component: route.Component,
|
|
@@ -805,17 +829,17 @@ function AppShell({
|
|
|
805
829
|
},
|
|
806
830
|
"docs-layout"
|
|
807
831
|
),
|
|
808
|
-
/* @__PURE__ */
|
|
832
|
+
/* @__PURE__ */ jsx13(
|
|
809
833
|
Route,
|
|
810
834
|
{
|
|
811
835
|
path: "*",
|
|
812
|
-
element: /* @__PURE__ */
|
|
836
|
+
element: /* @__PURE__ */ jsx13(
|
|
813
837
|
ThemeLayout,
|
|
814
838
|
{
|
|
815
839
|
config,
|
|
816
840
|
routes: routesInfo,
|
|
817
841
|
...config.themeConfig?.layoutProps,
|
|
818
|
-
children: /* @__PURE__ */
|
|
842
|
+
children: /* @__PURE__ */ jsx13(NotFound, {})
|
|
819
843
|
}
|
|
820
844
|
)
|
|
821
845
|
}
|
|
@@ -850,13 +874,13 @@ function DocsLayout({
|
|
|
850
874
|
config,
|
|
851
875
|
routes
|
|
852
876
|
}) {
|
|
853
|
-
return /* @__PURE__ */
|
|
877
|
+
return /* @__PURE__ */ jsx13(
|
|
854
878
|
ThemeLayout,
|
|
855
879
|
{
|
|
856
880
|
config,
|
|
857
881
|
routes,
|
|
858
882
|
...config.themeConfig?.layoutProps,
|
|
859
|
-
children: /* @__PURE__ */
|
|
883
|
+
children: /* @__PURE__ */ jsx13(Outlet, {})
|
|
860
884
|
}
|
|
861
885
|
);
|
|
862
886
|
}
|
|
@@ -865,7 +889,7 @@ function MdxPage({
|
|
|
865
889
|
customComponents = {}
|
|
866
890
|
}) {
|
|
867
891
|
const allComponents = { ...mdxComponents, ...customComponents };
|
|
868
|
-
return /* @__PURE__ */
|
|
892
|
+
return /* @__PURE__ */ jsx13(MDXProvider, { components: allComponents, children: /* @__PURE__ */ jsx13(Component, {}) });
|
|
869
893
|
}
|
|
870
894
|
function createBoltdocsApp(options) {
|
|
871
895
|
const { target, routes, config, modules, hot, homePage } = options;
|
|
@@ -875,7 +899,7 @@ function createBoltdocsApp(options) {
|
|
|
875
899
|
`[boltdocs] Mount target "${target}" not found in document.`
|
|
876
900
|
);
|
|
877
901
|
}
|
|
878
|
-
const app = /* @__PURE__ */
|
|
902
|
+
const app = /* @__PURE__ */ jsx13(React6.StrictMode, { children: /* @__PURE__ */ jsx13(BrowserRouter, { children: /* @__PURE__ */ jsx13(
|
|
879
903
|
AppShell,
|
|
880
904
|
{
|
|
881
905
|
initialRoutes: routes,
|
|
@@ -890,8 +914,61 @@ function createBoltdocsApp(options) {
|
|
|
890
914
|
ReactDOM.createRoot(container).render(app);
|
|
891
915
|
}
|
|
892
916
|
|
|
917
|
+
// src/client/theme/ui/Link/LinkPreview.tsx
|
|
918
|
+
import { useEffect as useEffect5, useState as useState7, useRef as useRef3 } from "react";
|
|
919
|
+
import { createPortal } from "react-dom";
|
|
920
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
921
|
+
function LinkPreview({
|
|
922
|
+
isVisible,
|
|
923
|
+
title,
|
|
924
|
+
summary,
|
|
925
|
+
x,
|
|
926
|
+
y
|
|
927
|
+
}) {
|
|
928
|
+
const [mounted, setMounted] = useState7(false);
|
|
929
|
+
const ref = useRef3(null);
|
|
930
|
+
const [position, setPosition] = useState7({ top: 0, left: 0 });
|
|
931
|
+
useEffect5(() => {
|
|
932
|
+
setMounted(true);
|
|
933
|
+
}, []);
|
|
934
|
+
useEffect5(() => {
|
|
935
|
+
if (isVisible && ref.current) {
|
|
936
|
+
const rect = ref.current.getBoundingClientRect();
|
|
937
|
+
const padding = 15;
|
|
938
|
+
let top = y + padding;
|
|
939
|
+
let left = x + padding;
|
|
940
|
+
if (left + rect.width > window.innerWidth) {
|
|
941
|
+
left = x - rect.width - padding;
|
|
942
|
+
}
|
|
943
|
+
if (top + rect.height > window.innerHeight) {
|
|
944
|
+
top = y - rect.height - padding;
|
|
945
|
+
}
|
|
946
|
+
setPosition({ top, left });
|
|
947
|
+
}
|
|
948
|
+
}, [isVisible, x, y]);
|
|
949
|
+
if (!mounted) return null;
|
|
950
|
+
return createPortal(
|
|
951
|
+
/* @__PURE__ */ jsxs12(
|
|
952
|
+
"div",
|
|
953
|
+
{
|
|
954
|
+
ref,
|
|
955
|
+
className: `boltdocs-link-preview ${isVisible ? "is-visible" : ""}`,
|
|
956
|
+
style: {
|
|
957
|
+
top: position.top,
|
|
958
|
+
left: position.left
|
|
959
|
+
},
|
|
960
|
+
children: [
|
|
961
|
+
/* @__PURE__ */ jsx14("span", { className: "boltdocs-link-preview-title", children: title }),
|
|
962
|
+
summary && /* @__PURE__ */ jsx14("p", { className: "boltdocs-link-preview-summary", children: summary })
|
|
963
|
+
]
|
|
964
|
+
}
|
|
965
|
+
),
|
|
966
|
+
document.body
|
|
967
|
+
);
|
|
968
|
+
}
|
|
969
|
+
|
|
893
970
|
// src/client/theme/ui/Link/Link.tsx
|
|
894
|
-
import { jsx as
|
|
971
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
895
972
|
function useLocalizedTo(to) {
|
|
896
973
|
const location = useLocation7();
|
|
897
974
|
const config = useConfig();
|
|
@@ -947,24 +1024,54 @@ function useLocalizedTo(to) {
|
|
|
947
1024
|
}
|
|
948
1025
|
return finalPath === basePath ? basePath : finalPath;
|
|
949
1026
|
}
|
|
950
|
-
var Link =
|
|
1027
|
+
var Link = React7.forwardRef(
|
|
951
1028
|
(props, ref) => {
|
|
952
1029
|
const {
|
|
953
1030
|
boltdocsPrefetch = "hover",
|
|
1031
|
+
boltdocsPreview = true,
|
|
954
1032
|
onMouseEnter,
|
|
1033
|
+
onMouseLeave,
|
|
955
1034
|
onFocus,
|
|
1035
|
+
onBlur,
|
|
956
1036
|
onClick,
|
|
957
1037
|
to,
|
|
958
1038
|
...rest
|
|
959
1039
|
} = props;
|
|
960
1040
|
const localizedTo = useLocalizedTo(to);
|
|
961
|
-
const { preload } = usePreload();
|
|
1041
|
+
const { preload, routes } = usePreload();
|
|
1042
|
+
const config = useConfig();
|
|
962
1043
|
const navigate = useNavigate();
|
|
1044
|
+
const shouldShowPreview = boltdocsPreview && config?.themeConfig?.linkPreview !== false;
|
|
1045
|
+
const [preview, setPreview] = React7.useState({ visible: false, x: 0, y: 0, title: "" });
|
|
963
1046
|
const handleMouseEnter = (e) => {
|
|
964
1047
|
onMouseEnter?.(e);
|
|
965
1048
|
if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
966
1049
|
preload(localizedTo);
|
|
967
1050
|
}
|
|
1051
|
+
if (shouldShowPreview && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
1052
|
+
const cleanPath = localizedTo.split("#")[0].split("?")[0];
|
|
1053
|
+
const route = routes.find(
|
|
1054
|
+
(r) => r.path === cleanPath || cleanPath === "/" && r.path === ""
|
|
1055
|
+
);
|
|
1056
|
+
if (route) {
|
|
1057
|
+
setPreview({
|
|
1058
|
+
visible: true,
|
|
1059
|
+
x: e.clientX,
|
|
1060
|
+
y: e.clientY,
|
|
1061
|
+
title: route.title,
|
|
1062
|
+
summary: route.description
|
|
1063
|
+
});
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
};
|
|
1067
|
+
const handleMouseMove = (e) => {
|
|
1068
|
+
if (preview.visible) {
|
|
1069
|
+
setPreview((prev) => ({ ...prev, x: e.clientX, y: e.clientY }));
|
|
1070
|
+
}
|
|
1071
|
+
};
|
|
1072
|
+
const handleMouseLeave = (e) => {
|
|
1073
|
+
onMouseLeave?.(e);
|
|
1074
|
+
setPreview((prev) => ({ ...prev, visible: false }));
|
|
968
1075
|
};
|
|
969
1076
|
const handleFocus = (e) => {
|
|
970
1077
|
onFocus?.(e);
|
|
@@ -972,50 +1079,100 @@ var Link = React6.forwardRef(
|
|
|
972
1079
|
preload(localizedTo);
|
|
973
1080
|
}
|
|
974
1081
|
};
|
|
1082
|
+
const handleBlur = (e) => {
|
|
1083
|
+
onBlur?.(e);
|
|
1084
|
+
setPreview((prev) => ({ ...prev, visible: false }));
|
|
1085
|
+
};
|
|
975
1086
|
const handleClick = (e) => {
|
|
976
1087
|
onClick?.(e);
|
|
1088
|
+
setPreview((prev) => ({ ...prev, visible: false }));
|
|
977
1089
|
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
|
|
978
1090
|
return;
|
|
979
1091
|
}
|
|
980
1092
|
if (typeof localizedTo === "string" && !localizedTo.startsWith("http")) {
|
|
981
1093
|
e.preventDefault();
|
|
982
|
-
|
|
1094
|
+
React7.startTransition(() => {
|
|
983
1095
|
navigate(localizedTo);
|
|
984
1096
|
});
|
|
985
1097
|
}
|
|
986
1098
|
};
|
|
987
|
-
return /* @__PURE__ */
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1099
|
+
return /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
1100
|
+
/* @__PURE__ */ jsx15(
|
|
1101
|
+
RouterLink,
|
|
1102
|
+
{
|
|
1103
|
+
ref,
|
|
1104
|
+
to: localizedTo,
|
|
1105
|
+
onMouseEnter: handleMouseEnter,
|
|
1106
|
+
onMouseMove: handleMouseMove,
|
|
1107
|
+
onMouseLeave: handleMouseLeave,
|
|
1108
|
+
onFocus: handleFocus,
|
|
1109
|
+
onBlur: handleBlur,
|
|
1110
|
+
onClick: handleClick,
|
|
1111
|
+
...rest
|
|
1112
|
+
}
|
|
1113
|
+
),
|
|
1114
|
+
shouldShowPreview && /* @__PURE__ */ jsx15(
|
|
1115
|
+
LinkPreview,
|
|
1116
|
+
{
|
|
1117
|
+
isVisible: preview.visible,
|
|
1118
|
+
title: preview.title,
|
|
1119
|
+
summary: preview.summary,
|
|
1120
|
+
x: preview.x,
|
|
1121
|
+
y: preview.y
|
|
1122
|
+
}
|
|
1123
|
+
)
|
|
1124
|
+
] });
|
|
998
1125
|
}
|
|
999
1126
|
);
|
|
1000
1127
|
Link.displayName = "Link";
|
|
1001
|
-
var NavLink =
|
|
1128
|
+
var NavLink = React7.forwardRef(
|
|
1002
1129
|
(props, ref) => {
|
|
1003
1130
|
const {
|
|
1004
1131
|
boltdocsPrefetch = "hover",
|
|
1132
|
+
boltdocsPreview = true,
|
|
1005
1133
|
onMouseEnter,
|
|
1134
|
+
onMouseLeave,
|
|
1006
1135
|
onFocus,
|
|
1136
|
+
onBlur,
|
|
1007
1137
|
onClick,
|
|
1008
1138
|
to,
|
|
1009
1139
|
...rest
|
|
1010
1140
|
} = props;
|
|
1011
1141
|
const localizedTo = useLocalizedTo(to);
|
|
1012
|
-
const { preload } = usePreload();
|
|
1142
|
+
const { preload, routes } = usePreload();
|
|
1143
|
+
const config = useConfig();
|
|
1013
1144
|
const navigate = useNavigate();
|
|
1145
|
+
const shouldShowPreview = boltdocsPreview && config?.themeConfig?.linkPreview !== false;
|
|
1146
|
+
const [preview, setPreview] = React7.useState({ visible: false, x: 0, y: 0, title: "" });
|
|
1014
1147
|
const handleMouseEnter = (e) => {
|
|
1015
1148
|
onMouseEnter?.(e);
|
|
1016
1149
|
if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
1017
1150
|
preload(localizedTo);
|
|
1018
1151
|
}
|
|
1152
|
+
if (shouldShowPreview && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
1153
|
+
const cleanPath = localizedTo.split("#")[0].split("?")[0];
|
|
1154
|
+
const route = routes.find(
|
|
1155
|
+
(r) => r.path === cleanPath || cleanPath === "/" && r.path === ""
|
|
1156
|
+
);
|
|
1157
|
+
if (route) {
|
|
1158
|
+
setPreview({
|
|
1159
|
+
visible: true,
|
|
1160
|
+
x: e.clientX,
|
|
1161
|
+
y: e.clientY,
|
|
1162
|
+
title: route.title,
|
|
1163
|
+
summary: route.description
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
};
|
|
1168
|
+
const handleMouseMove = (e) => {
|
|
1169
|
+
if (preview.visible) {
|
|
1170
|
+
setPreview((prev) => ({ ...prev, x: e.clientX, y: e.clientY }));
|
|
1171
|
+
}
|
|
1172
|
+
};
|
|
1173
|
+
const handleMouseLeave = (e) => {
|
|
1174
|
+
onMouseLeave?.(e);
|
|
1175
|
+
setPreview((prev) => ({ ...prev, visible: false }));
|
|
1019
1176
|
};
|
|
1020
1177
|
const handleFocus = (e) => {
|
|
1021
1178
|
onFocus?.(e);
|
|
@@ -1023,29 +1180,49 @@ var NavLink = React6.forwardRef(
|
|
|
1023
1180
|
preload(localizedTo);
|
|
1024
1181
|
}
|
|
1025
1182
|
};
|
|
1183
|
+
const handleBlur = (e) => {
|
|
1184
|
+
onBlur?.(e);
|
|
1185
|
+
setPreview((prev) => ({ ...prev, visible: false }));
|
|
1186
|
+
};
|
|
1026
1187
|
const handleClick = (e) => {
|
|
1027
1188
|
onClick?.(e);
|
|
1189
|
+
setPreview((prev) => ({ ...prev, visible: false }));
|
|
1028
1190
|
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
|
|
1029
1191
|
return;
|
|
1030
1192
|
}
|
|
1031
1193
|
if (typeof localizedTo === "string" && !localizedTo.startsWith("http")) {
|
|
1032
1194
|
e.preventDefault();
|
|
1033
|
-
|
|
1195
|
+
React7.startTransition(() => {
|
|
1034
1196
|
navigate(localizedTo);
|
|
1035
1197
|
});
|
|
1036
1198
|
}
|
|
1037
1199
|
};
|
|
1038
|
-
return /* @__PURE__ */
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1200
|
+
return /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
1201
|
+
/* @__PURE__ */ jsx15(
|
|
1202
|
+
RouterNavLink,
|
|
1203
|
+
{
|
|
1204
|
+
ref,
|
|
1205
|
+
to: localizedTo,
|
|
1206
|
+
onMouseEnter: handleMouseEnter,
|
|
1207
|
+
onMouseMove: handleMouseMove,
|
|
1208
|
+
onMouseLeave: handleMouseLeave,
|
|
1209
|
+
onFocus: handleFocus,
|
|
1210
|
+
onBlur: handleBlur,
|
|
1211
|
+
onClick: handleClick,
|
|
1212
|
+
...rest
|
|
1213
|
+
}
|
|
1214
|
+
),
|
|
1215
|
+
shouldShowPreview && /* @__PURE__ */ jsx15(
|
|
1216
|
+
LinkPreview,
|
|
1217
|
+
{
|
|
1218
|
+
isVisible: preview.visible,
|
|
1219
|
+
title: preview.title,
|
|
1220
|
+
summary: preview.summary,
|
|
1221
|
+
x: preview.x,
|
|
1222
|
+
y: preview.y
|
|
1223
|
+
}
|
|
1224
|
+
)
|
|
1225
|
+
] });
|
|
1049
1226
|
}
|
|
1050
1227
|
);
|
|
1051
1228
|
NavLink.displayName = "NavLink";
|
|
@@ -1054,10 +1231,10 @@ NavLink.displayName = "NavLink";
|
|
|
1054
1231
|
import { ChevronDown as ChevronDown3 } from "lucide-react";
|
|
1055
1232
|
|
|
1056
1233
|
// src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx
|
|
1057
|
-
import { useState as
|
|
1234
|
+
import { useState as useState8, useRef as useRef4, useEffect as useEffect6 } from "react";
|
|
1058
1235
|
import { Globe, ChevronDown } from "lucide-react";
|
|
1059
1236
|
import { useNavigate as useNavigate2, useLocation as useLocation8 } from "react-router-dom";
|
|
1060
|
-
import { jsx as
|
|
1237
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1061
1238
|
function getBaseFilePath(filePath, version, locale) {
|
|
1062
1239
|
let path = filePath;
|
|
1063
1240
|
if (version && (path === version || path.startsWith(version + "/"))) {
|
|
@@ -1073,11 +1250,11 @@ function LanguageSwitcher({
|
|
|
1073
1250
|
currentLocale,
|
|
1074
1251
|
allRoutes
|
|
1075
1252
|
}) {
|
|
1076
|
-
const [isOpen, setIsOpen] =
|
|
1077
|
-
const dropdownRef =
|
|
1253
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
1254
|
+
const dropdownRef = useRef4(null);
|
|
1078
1255
|
const navigate = useNavigate2();
|
|
1079
1256
|
const location = useLocation8();
|
|
1080
|
-
|
|
1257
|
+
useEffect6(() => {
|
|
1081
1258
|
function handleClickOutside(event) {
|
|
1082
1259
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1083
1260
|
setIsOpen(false);
|
|
@@ -1113,8 +1290,8 @@ function LanguageSwitcher({
|
|
|
1113
1290
|
}
|
|
1114
1291
|
navigate(targetPath);
|
|
1115
1292
|
};
|
|
1116
|
-
return /* @__PURE__ */
|
|
1117
|
-
/* @__PURE__ */
|
|
1293
|
+
return /* @__PURE__ */ jsxs14("div", { className: "boltdocs-language-switcher", ref: dropdownRef, children: [
|
|
1294
|
+
/* @__PURE__ */ jsxs14(
|
|
1118
1295
|
"button",
|
|
1119
1296
|
{
|
|
1120
1297
|
className: "language-btn",
|
|
@@ -1123,13 +1300,13 @@ function LanguageSwitcher({
|
|
|
1123
1300
|
"aria-expanded": isOpen,
|
|
1124
1301
|
"aria-haspopup": "listbox",
|
|
1125
1302
|
children: [
|
|
1126
|
-
/* @__PURE__ */
|
|
1127
|
-
/* @__PURE__ */
|
|
1128
|
-
/* @__PURE__ */
|
|
1303
|
+
/* @__PURE__ */ jsx16(Globe, { size: 18 }),
|
|
1304
|
+
/* @__PURE__ */ jsx16("span", { className: "language-label", children: i18n.locales[currentLocale] || currentLocale }),
|
|
1305
|
+
/* @__PURE__ */ jsx16(ChevronDown, { size: 14 })
|
|
1129
1306
|
]
|
|
1130
1307
|
}
|
|
1131
1308
|
),
|
|
1132
|
-
isOpen && /* @__PURE__ */
|
|
1309
|
+
isOpen && /* @__PURE__ */ jsx16("div", { className: "language-dropdown", children: Object.entries(i18n.locales).map(([key, label]) => /* @__PURE__ */ jsx16(
|
|
1133
1310
|
"button",
|
|
1134
1311
|
{
|
|
1135
1312
|
className: `language-option ${key === currentLocale ? "active" : ""}`,
|
|
@@ -1142,10 +1319,10 @@ function LanguageSwitcher({
|
|
|
1142
1319
|
}
|
|
1143
1320
|
|
|
1144
1321
|
// src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx
|
|
1145
|
-
import { useState as
|
|
1322
|
+
import { useState as useState9, useRef as useRef5, useEffect as useEffect7 } from "react";
|
|
1146
1323
|
import { ChevronDown as ChevronDown2 } from "lucide-react";
|
|
1147
1324
|
import { useNavigate as useNavigate3, useLocation as useLocation9 } from "react-router-dom";
|
|
1148
|
-
import { jsx as
|
|
1325
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1149
1326
|
function getBaseFilePath2(filePath, version, locale) {
|
|
1150
1327
|
let path = filePath;
|
|
1151
1328
|
if (version && (path === version || path.startsWith(version + "/"))) {
|
|
@@ -1162,11 +1339,11 @@ function VersionSwitcher({
|
|
|
1162
1339
|
currentLocale,
|
|
1163
1340
|
allRoutes
|
|
1164
1341
|
}) {
|
|
1165
|
-
const [isOpen, setIsOpen] =
|
|
1166
|
-
const dropdownRef =
|
|
1342
|
+
const [isOpen, setIsOpen] = useState9(false);
|
|
1343
|
+
const dropdownRef = useRef5(null);
|
|
1167
1344
|
const navigate = useNavigate3();
|
|
1168
1345
|
const location = useLocation9();
|
|
1169
|
-
|
|
1346
|
+
useEffect7(() => {
|
|
1170
1347
|
function handleClickOutside(event) {
|
|
1171
1348
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1172
1349
|
setIsOpen(false);
|
|
@@ -1200,14 +1377,14 @@ function VersionSwitcher({
|
|
|
1200
1377
|
}
|
|
1201
1378
|
navigate(targetPath);
|
|
1202
1379
|
};
|
|
1203
|
-
return /* @__PURE__ */
|
|
1380
|
+
return /* @__PURE__ */ jsxs15(
|
|
1204
1381
|
"div",
|
|
1205
1382
|
{
|
|
1206
1383
|
className: "boltdocs-version-switcher",
|
|
1207
1384
|
ref: dropdownRef,
|
|
1208
1385
|
style: { position: "relative", display: "flex", alignItems: "center" },
|
|
1209
1386
|
children: [
|
|
1210
|
-
/* @__PURE__ */
|
|
1387
|
+
/* @__PURE__ */ jsxs15(
|
|
1211
1388
|
"button",
|
|
1212
1389
|
{
|
|
1213
1390
|
className: "navbar-version",
|
|
@@ -1221,12 +1398,12 @@ function VersionSwitcher({
|
|
|
1221
1398
|
marginLeft: "0.5rem"
|
|
1222
1399
|
},
|
|
1223
1400
|
children: [
|
|
1224
|
-
/* @__PURE__ */
|
|
1225
|
-
/* @__PURE__ */
|
|
1401
|
+
/* @__PURE__ */ jsx17("span", { children: versions.versions[currentVersion] || currentVersion }),
|
|
1402
|
+
/* @__PURE__ */ jsx17(ChevronDown2, { size: 14 })
|
|
1226
1403
|
]
|
|
1227
1404
|
}
|
|
1228
1405
|
),
|
|
1229
|
-
isOpen && /* @__PURE__ */
|
|
1406
|
+
isOpen && /* @__PURE__ */ jsx17(
|
|
1230
1407
|
"div",
|
|
1231
1408
|
{
|
|
1232
1409
|
className: "language-dropdown",
|
|
@@ -1236,7 +1413,7 @@ function VersionSwitcher({
|
|
|
1236
1413
|
minWidth: "150px",
|
|
1237
1414
|
top: "calc(100% + 8px)"
|
|
1238
1415
|
},
|
|
1239
|
-
children: Object.entries(versions.versions).map(([key, label]) => /* @__PURE__ */
|
|
1416
|
+
children: Object.entries(versions.versions).map(([key, label]) => /* @__PURE__ */ jsx17(
|
|
1240
1417
|
"button",
|
|
1241
1418
|
{
|
|
1242
1419
|
className: `language-option ${key === currentVersion ? "active" : ""}`,
|
|
@@ -1253,13 +1430,13 @@ function VersionSwitcher({
|
|
|
1253
1430
|
}
|
|
1254
1431
|
|
|
1255
1432
|
// src/client/theme/ui/ThemeToggle/ThemeToggle.tsx
|
|
1256
|
-
import { useEffect as
|
|
1433
|
+
import { useEffect as useEffect8, useState as useState10 } from "react";
|
|
1257
1434
|
import { Sun, Moon } from "lucide-react";
|
|
1258
|
-
import { jsx as
|
|
1435
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1259
1436
|
function ThemeToggle() {
|
|
1260
|
-
const [theme, setTheme] =
|
|
1261
|
-
const [mounted, setMounted] =
|
|
1262
|
-
|
|
1437
|
+
const [theme, setTheme] = useState10("dark");
|
|
1438
|
+
const [mounted, setMounted] = useState10(false);
|
|
1439
|
+
useEffect8(() => {
|
|
1263
1440
|
setMounted(true);
|
|
1264
1441
|
const stored = localStorage.getItem("boltdocs-theme");
|
|
1265
1442
|
if (stored === "light" || stored === "dark") {
|
|
@@ -1279,7 +1456,7 @@ function ThemeToggle() {
|
|
|
1279
1456
|
mediaQuery.addEventListener("change", handleChange);
|
|
1280
1457
|
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
1281
1458
|
}, []);
|
|
1282
|
-
|
|
1459
|
+
useEffect8(() => {
|
|
1283
1460
|
if (!mounted) return;
|
|
1284
1461
|
const root = document.documentElement;
|
|
1285
1462
|
if (theme === "light") {
|
|
@@ -1296,23 +1473,23 @@ function ThemeToggle() {
|
|
|
1296
1473
|
localStorage.setItem("boltdocs-theme", newTheme);
|
|
1297
1474
|
};
|
|
1298
1475
|
if (!mounted) {
|
|
1299
|
-
return /* @__PURE__ */
|
|
1476
|
+
return /* @__PURE__ */ jsx18("button", { className: "navbar-icon-btn", "aria-label": "Toggle theme", disabled: true, children: /* @__PURE__ */ jsx18("span", { style: { width: 20, height: 20, display: "inline-block" } }) });
|
|
1300
1477
|
}
|
|
1301
|
-
return /* @__PURE__ */
|
|
1478
|
+
return /* @__PURE__ */ jsx18(
|
|
1302
1479
|
"button",
|
|
1303
1480
|
{
|
|
1304
1481
|
className: "navbar-icon-btn",
|
|
1305
1482
|
onClick: toggleTheme,
|
|
1306
1483
|
"aria-label": "Toggle theme",
|
|
1307
1484
|
title: `Switch to ${theme === "dark" ? "light" : "dark"} theme`,
|
|
1308
|
-
children: theme === "dark" ? /* @__PURE__ */
|
|
1485
|
+
children: theme === "dark" ? /* @__PURE__ */ jsx18(Sun, { size: 20 }) : /* @__PURE__ */ jsx18(Moon, { size: 20 })
|
|
1309
1486
|
}
|
|
1310
1487
|
);
|
|
1311
1488
|
}
|
|
1312
1489
|
|
|
1313
1490
|
// src/client/theme/icons/discord.tsx
|
|
1314
|
-
import { jsx as
|
|
1315
|
-
var Discord = (props) => /* @__PURE__ */
|
|
1491
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1492
|
+
var Discord = (props) => /* @__PURE__ */ jsx19("svg", { ...props, viewBox: "0 0 256 199", preserveAspectRatio: "xMidYMid", children: /* @__PURE__ */ jsx19(
|
|
1316
1493
|
"path",
|
|
1317
1494
|
{
|
|
1318
1495
|
d: "M216.856 16.597A208.502 208.502 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046-19.692-2.961-39.203-2.961-58.533 0-1.832-4.4-4.55-9.933-6.846-14.046a207.809 207.809 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161.094 161.094 0 0 0 79.735 175.3a136.413 136.413 0 0 1-21.846-10.632 108.636 108.636 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a131.66 131.66 0 0 0 5.355 4.237 136.07 136.07 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848 21.142-6.58 42.646-16.637 64.815-33.213 5.316-56.288-9.08-105.09-38.056-148.36ZM85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2c12.867 0 23.236 11.804 23.015 26.2.02 14.375-10.148 26.18-23.015 26.18Zm85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2 0 14.375-10.148 26.18-23.015 26.18Z",
|
|
@@ -1321,8 +1498,8 @@ var Discord = (props) => /* @__PURE__ */ jsx17("svg", { ...props, viewBox: "0 0
|
|
|
1321
1498
|
) });
|
|
1322
1499
|
|
|
1323
1500
|
// src/client/theme/icons/twitter.tsx
|
|
1324
|
-
import { jsx as
|
|
1325
|
-
var XformerlyTwitter = (props) => /* @__PURE__ */
|
|
1501
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1502
|
+
var XformerlyTwitter = (props) => /* @__PURE__ */ jsx20("svg", { ...props, fill: "none", viewBox: "0 0 1200 1227", children: /* @__PURE__ */ jsx20(
|
|
1326
1503
|
"path",
|
|
1327
1504
|
{
|
|
1328
1505
|
fill: "currentColor",
|
|
@@ -1331,9 +1508,9 @@ var XformerlyTwitter = (props) => /* @__PURE__ */ jsx18("svg", { ...props, fill:
|
|
|
1331
1508
|
) });
|
|
1332
1509
|
|
|
1333
1510
|
// src/client/theme/ui/Navbar/Navbar.tsx
|
|
1334
|
-
import { jsx as
|
|
1335
|
-
var SearchDialog =
|
|
1336
|
-
() => import("./SearchDialog-
|
|
1511
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1512
|
+
var SearchDialog = React10.lazy(
|
|
1513
|
+
() => import("./SearchDialog-5ISK64QY.mjs").then((m) => ({ default: m.SearchDialog }))
|
|
1337
1514
|
);
|
|
1338
1515
|
var ICON_MAP = {
|
|
1339
1516
|
discord: Discord,
|
|
@@ -1349,10 +1526,10 @@ function Navbar({
|
|
|
1349
1526
|
const title = config.themeConfig?.title || "Boltdocs";
|
|
1350
1527
|
const navItems = config.themeConfig?.navbar || [];
|
|
1351
1528
|
const socialLinks = config.themeConfig?.socialLinks || [];
|
|
1352
|
-
return /* @__PURE__ */
|
|
1353
|
-
/* @__PURE__ */
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
config.themeConfig?.logo ? config.themeConfig.logo.trim().startsWith("<svg") ? /* @__PURE__ */
|
|
1529
|
+
return /* @__PURE__ */ jsx21("header", { className: "boltdocs-navbar", children: /* @__PURE__ */ jsxs16("div", { className: "navbar-container", children: [
|
|
1530
|
+
/* @__PURE__ */ jsxs16("div", { className: "navbar-left", children: [
|
|
1531
|
+
/* @__PURE__ */ jsx21("div", { className: "navbar-logo", children: /* @__PURE__ */ jsxs16(Link, { to: "/", children: [
|
|
1532
|
+
config.themeConfig?.logo ? config.themeConfig.logo.trim().startsWith("<svg") ? /* @__PURE__ */ jsx21(
|
|
1356
1533
|
"span",
|
|
1357
1534
|
{
|
|
1358
1535
|
className: "navbar-logo-svg",
|
|
@@ -1360,7 +1537,7 @@ function Navbar({
|
|
|
1360
1537
|
__html: config.themeConfig.logo
|
|
1361
1538
|
}
|
|
1362
1539
|
}
|
|
1363
|
-
) : /* @__PURE__ */
|
|
1540
|
+
) : /* @__PURE__ */ jsx21(
|
|
1364
1541
|
"img",
|
|
1365
1542
|
{
|
|
1366
1543
|
src: config.themeConfig.logo,
|
|
@@ -1370,7 +1547,7 @@ function Navbar({
|
|
|
1370
1547
|
) : null,
|
|
1371
1548
|
title
|
|
1372
1549
|
] }) }),
|
|
1373
|
-
config.versions && currentVersion && allRoutes ? /* @__PURE__ */
|
|
1550
|
+
config.versions && currentVersion && allRoutes ? /* @__PURE__ */ jsx21(
|
|
1374
1551
|
VersionSwitcher,
|
|
1375
1552
|
{
|
|
1376
1553
|
versions: config.versions,
|
|
@@ -1378,22 +1555,22 @@ function Navbar({
|
|
|
1378
1555
|
currentLocale,
|
|
1379
1556
|
allRoutes
|
|
1380
1557
|
}
|
|
1381
|
-
) : config.themeConfig?.version ? /* @__PURE__ */
|
|
1558
|
+
) : config.themeConfig?.version ? /* @__PURE__ */ jsxs16("div", { className: "navbar-version", children: [
|
|
1382
1559
|
config.themeConfig.version,
|
|
1383
1560
|
" ",
|
|
1384
|
-
/* @__PURE__ */
|
|
1561
|
+
/* @__PURE__ */ jsx21(ChevronDown3, { size: 14 })
|
|
1385
1562
|
] }) : null,
|
|
1386
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ jsx21("nav", { className: "navbar-links", "aria-label": "Top Navigation", children: navItems.map((item, i) => /* @__PURE__ */ jsx21(Link, { to: item.link, children: item.text }, i)) })
|
|
1387
1564
|
] }),
|
|
1388
|
-
/* @__PURE__ */
|
|
1389
|
-
/* @__PURE__ */
|
|
1390
|
-
|
|
1565
|
+
/* @__PURE__ */ jsxs16("div", { className: "navbar-right", children: [
|
|
1566
|
+
/* @__PURE__ */ jsx21(
|
|
1567
|
+
React10.Suspense,
|
|
1391
1568
|
{
|
|
1392
|
-
fallback: /* @__PURE__ */
|
|
1393
|
-
children: /* @__PURE__ */
|
|
1569
|
+
fallback: /* @__PURE__ */ jsx21("div", { className: "navbar-search-placeholder" }),
|
|
1570
|
+
children: /* @__PURE__ */ jsx21(SearchDialog, { routes: routes || [] })
|
|
1394
1571
|
}
|
|
1395
1572
|
),
|
|
1396
|
-
config.i18n && currentLocale && allRoutes && /* @__PURE__ */
|
|
1573
|
+
config.i18n && currentLocale && allRoutes && /* @__PURE__ */ jsx21(
|
|
1397
1574
|
LanguageSwitcher,
|
|
1398
1575
|
{
|
|
1399
1576
|
i18n: config.i18n,
|
|
@@ -1401,12 +1578,12 @@ function Navbar({
|
|
|
1401
1578
|
allRoutes
|
|
1402
1579
|
}
|
|
1403
1580
|
),
|
|
1404
|
-
/* @__PURE__ */
|
|
1405
|
-
config.themeConfig?.githubRepo && /* @__PURE__ */
|
|
1406
|
-
socialLinks.length > 0 && /* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1581
|
+
/* @__PURE__ */ jsx21(ThemeToggle, {}),
|
|
1582
|
+
config.themeConfig?.githubRepo && /* @__PURE__ */ jsx21(GithubStars, { repo: config.themeConfig.githubRepo }),
|
|
1583
|
+
socialLinks.length > 0 && /* @__PURE__ */ jsx21("div", { className: "navbar-divider" }),
|
|
1584
|
+
/* @__PURE__ */ jsx21("div", { className: "navbar-icons", children: socialLinks.map((link, i) => {
|
|
1408
1585
|
const IconComp = ICON_MAP[link.icon.toLowerCase()];
|
|
1409
|
-
return /* @__PURE__ */
|
|
1586
|
+
return /* @__PURE__ */ jsx21(
|
|
1410
1587
|
"a",
|
|
1411
1588
|
{
|
|
1412
1589
|
href: link.link,
|
|
@@ -1414,7 +1591,7 @@ function Navbar({
|
|
|
1414
1591
|
rel: "noopener noreferrer",
|
|
1415
1592
|
className: "navbar-icon-btn",
|
|
1416
1593
|
"aria-label": link.icon,
|
|
1417
|
-
children: IconComp ? /* @__PURE__ */
|
|
1594
|
+
children: IconComp ? /* @__PURE__ */ jsx21(IconComp, {}) : /* @__PURE__ */ jsx21("span", { children: link.icon })
|
|
1418
1595
|
},
|
|
1419
1596
|
i
|
|
1420
1597
|
);
|
|
@@ -1434,6 +1611,7 @@ export {
|
|
|
1434
1611
|
ThemeLayout,
|
|
1435
1612
|
NotFound,
|
|
1436
1613
|
Loading,
|
|
1614
|
+
CodeBlock,
|
|
1437
1615
|
AppShell,
|
|
1438
1616
|
createBoltdocsApp
|
|
1439
1617
|
};
|