specra 0.1.10 → 0.1.12
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/{chunk-WSQZILUA.mjs → chunk-WMCO2UX5.mjs} +15 -9
- package/dist/chunk-WMCO2UX5.mjs.map +1 -0
- package/dist/components/index.d.mts +3 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +462 -386
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +428 -353
- package/dist/components/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +477 -394
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +239 -162
- package/dist/index.mjs.map +1 -1
- package/dist/layouts/index.d.mts +1 -1
- package/dist/layouts/index.d.ts +1 -1
- package/dist/lib/index.d.mts +3 -3
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.js +15 -8
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +3 -1
- package/dist/{config.types-Ccp3jN5U.d.mts → mdx-ColN3Cyg.d.mts} +58 -57
- package/dist/{config.types-Ccp3jN5U.d.ts → mdx-ColN3Cyg.d.ts} +58 -57
- package/package.json +2 -2
- package/dist/chunk-WSQZILUA.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -15,12 +15,13 @@ import {
|
|
|
15
15
|
getCachedVersions,
|
|
16
16
|
getCategoryConfig,
|
|
17
17
|
getDocBySlug,
|
|
18
|
+
getI18nConfig,
|
|
18
19
|
getVersions,
|
|
19
20
|
isCategoryPage,
|
|
20
21
|
logCacheOperation,
|
|
21
22
|
logFsOperation,
|
|
22
23
|
logMemoryUsage
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-WMCO2UX5.mjs";
|
|
24
25
|
import {
|
|
25
26
|
CSP_DIRECTIVES,
|
|
26
27
|
SAFE_MDX_COMPONENTS,
|
|
@@ -914,12 +915,115 @@ function VersionSwitcher({ currentVersion, versions }) {
|
|
|
914
915
|
] });
|
|
915
916
|
}
|
|
916
917
|
|
|
918
|
+
// src/components/docs/language-switcher.tsx
|
|
919
|
+
import { useState as useState9 } from "react";
|
|
920
|
+
import { Languages, Check as Check2, ChevronDown as ChevronDown4 } from "lucide-react";
|
|
921
|
+
import { usePathname as usePathname2, useRouter as useRouter3 } from "next/navigation";
|
|
922
|
+
|
|
923
|
+
// src/components/config-provider.tsx
|
|
924
|
+
import * as React2 from "react";
|
|
925
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
926
|
+
var ConfigContext = React2.createContext(defaultConfig);
|
|
927
|
+
function ConfigProvider({ config, children }) {
|
|
928
|
+
return /* @__PURE__ */ jsx13(ConfigContext.Provider, { value: config, children });
|
|
929
|
+
}
|
|
930
|
+
function useConfig() {
|
|
931
|
+
const config = React2.useContext(ConfigContext);
|
|
932
|
+
if (!config) {
|
|
933
|
+
throw new Error("useConfig must be used within a ConfigProvider");
|
|
934
|
+
}
|
|
935
|
+
return config;
|
|
936
|
+
}
|
|
937
|
+
function useConfigValue(path) {
|
|
938
|
+
const config = useConfig();
|
|
939
|
+
const keys = path.split(".");
|
|
940
|
+
let value = config;
|
|
941
|
+
for (const key of keys) {
|
|
942
|
+
if (value && typeof value === "object" && key in value) {
|
|
943
|
+
value = value[key];
|
|
944
|
+
} else {
|
|
945
|
+
return void 0;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
return value;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// src/components/docs/language-switcher.tsx
|
|
952
|
+
import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
953
|
+
function LanguageSwitcher() {
|
|
954
|
+
const [open, setOpen] = useState9(false);
|
|
955
|
+
const pathname = usePathname2();
|
|
956
|
+
const router = useRouter3();
|
|
957
|
+
const config = useConfig();
|
|
958
|
+
const i18n = config.features?.i18n;
|
|
959
|
+
if (!i18n || typeof i18n === "boolean") return null;
|
|
960
|
+
const { locales, localeNames, defaultLocale, prefixDefault } = i18n;
|
|
961
|
+
const pathParts = pathname.split("/");
|
|
962
|
+
const version = pathParts[2];
|
|
963
|
+
let currentLocale = defaultLocale;
|
|
964
|
+
if (pathParts[3] && locales.includes(pathParts[3])) {
|
|
965
|
+
currentLocale = pathParts[3];
|
|
966
|
+
}
|
|
967
|
+
const handleLocaleChange = (newLocale) => {
|
|
968
|
+
if (newLocale === currentLocale) {
|
|
969
|
+
setOpen(false);
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
const parts = [...pathParts];
|
|
973
|
+
const hasLocalePrefix = locales.includes(parts[3]);
|
|
974
|
+
if (newLocale === defaultLocale && !prefixDefault) {
|
|
975
|
+
if (hasLocalePrefix) {
|
|
976
|
+
parts.splice(3, 1);
|
|
977
|
+
}
|
|
978
|
+
} else {
|
|
979
|
+
if (hasLocalePrefix) {
|
|
980
|
+
parts[3] = newLocale;
|
|
981
|
+
} else {
|
|
982
|
+
parts.splice(3, 0, newLocale);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
const newPath = parts.join("/");
|
|
986
|
+
router.push(newPath);
|
|
987
|
+
setOpen(false);
|
|
988
|
+
};
|
|
989
|
+
return /* @__PURE__ */ jsxs10("div", { className: "relative", children: [
|
|
990
|
+
/* @__PURE__ */ jsxs10(
|
|
991
|
+
"button",
|
|
992
|
+
{
|
|
993
|
+
onClick: () => setOpen(!open),
|
|
994
|
+
className: "flex items-center gap-1.5 px-2 h-9 rounded-md hover:bg-muted transition-colors",
|
|
995
|
+
"aria-label": "Switch language",
|
|
996
|
+
children: [
|
|
997
|
+
/* @__PURE__ */ jsx14(Languages, { className: "h-4 w-4" }),
|
|
998
|
+
/* @__PURE__ */ jsx14("span", { className: "text-xs font-bold uppercase", children: currentLocale }),
|
|
999
|
+
/* @__PURE__ */ jsx14(ChevronDown4, { className: "h-3 w-3 text-muted-foreground" })
|
|
1000
|
+
]
|
|
1001
|
+
}
|
|
1002
|
+
),
|
|
1003
|
+
open && /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
1004
|
+
/* @__PURE__ */ jsx14("div", { className: "fixed inset-0 z-40", onClick: () => setOpen(false) }),
|
|
1005
|
+
/* @__PURE__ */ jsx14("div", { className: "absolute right-0 mt-2 w-40 bg-background border border-border rounded-md shadow-lg z-50", children: /* @__PURE__ */ jsx14("div", { className: "p-2", children: locales.map((locale) => /* @__PURE__ */ jsxs10(
|
|
1006
|
+
"button",
|
|
1007
|
+
{
|
|
1008
|
+
onClick: () => handleLocaleChange(locale),
|
|
1009
|
+
className: "flex items-center justify-between w-full px-3 py-2 text-sm text-foreground hover:bg-muted rounded-md transition-colors",
|
|
1010
|
+
children: [
|
|
1011
|
+
/* @__PURE__ */ jsx14("span", { children: localeNames?.[locale] || locale.toUpperCase() }),
|
|
1012
|
+
currentLocale === locale && /* @__PURE__ */ jsx14(Check2, { className: "h-4 w-4 text-primary" })
|
|
1013
|
+
]
|
|
1014
|
+
},
|
|
1015
|
+
locale
|
|
1016
|
+
)) }) })
|
|
1017
|
+
] })
|
|
1018
|
+
] });
|
|
1019
|
+
}
|
|
1020
|
+
|
|
917
1021
|
// src/components/docs/theme-toggle.tsx
|
|
918
1022
|
import { Moon, Sun } from "lucide-react";
|
|
919
|
-
import { useEffect as useEffect5, useState as
|
|
920
|
-
import { jsx as
|
|
1023
|
+
import { useEffect as useEffect5, useState as useState10 } from "react";
|
|
1024
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
921
1025
|
function ThemeToggle() {
|
|
922
|
-
const [theme, setTheme] =
|
|
1026
|
+
const [theme, setTheme] = useState10("dark");
|
|
923
1027
|
useEffect5(() => {
|
|
924
1028
|
const savedTheme = localStorage.getItem("theme");
|
|
925
1029
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
@@ -933,51 +1037,51 @@ function ThemeToggle() {
|
|
|
933
1037
|
localStorage.setItem("theme", newTheme);
|
|
934
1038
|
document.documentElement.classList.toggle("dark", newTheme === "dark");
|
|
935
1039
|
};
|
|
936
|
-
return /* @__PURE__ */
|
|
1040
|
+
return /* @__PURE__ */ jsx15(
|
|
937
1041
|
"button",
|
|
938
1042
|
{
|
|
939
1043
|
onClick: toggleTheme,
|
|
940
1044
|
className: "flex items-center justify-center w-9 h-9 rounded-md border border-border bg-background hover:bg-accent transition-colors",
|
|
941
1045
|
"aria-label": "Toggle theme",
|
|
942
|
-
children: theme === "dark" ? /* @__PURE__ */
|
|
1046
|
+
children: theme === "dark" ? /* @__PURE__ */ jsx15(Sun, { className: "h-4 w-4 text-foreground" }) : /* @__PURE__ */ jsx15(Moon, { className: "h-4 w-4 text-foreground" })
|
|
943
1047
|
}
|
|
944
1048
|
);
|
|
945
1049
|
}
|
|
946
1050
|
|
|
947
1051
|
// src/components/docs/search-modal.tsx
|
|
948
|
-
import { useState as
|
|
1052
|
+
import { useState as useState11, useEffect as useEffect6, useCallback } from "react";
|
|
949
1053
|
import { Search, FileText, Loader2 } from "lucide-react";
|
|
950
|
-
import { useRouter as
|
|
1054
|
+
import { useRouter as useRouter4 } from "next/navigation";
|
|
951
1055
|
|
|
952
1056
|
// src/components/ui/dialog.tsx
|
|
953
1057
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
954
1058
|
import { XIcon } from "lucide-react";
|
|
955
|
-
import { jsx as
|
|
1059
|
+
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
956
1060
|
function Dialog({
|
|
957
1061
|
...props
|
|
958
1062
|
}) {
|
|
959
|
-
return /* @__PURE__ */
|
|
1063
|
+
return /* @__PURE__ */ jsx16(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
960
1064
|
}
|
|
961
1065
|
function DialogTrigger({
|
|
962
1066
|
...props
|
|
963
1067
|
}) {
|
|
964
|
-
return /* @__PURE__ */
|
|
1068
|
+
return /* @__PURE__ */ jsx16(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
965
1069
|
}
|
|
966
1070
|
function DialogPortal({
|
|
967
1071
|
...props
|
|
968
1072
|
}) {
|
|
969
|
-
return /* @__PURE__ */
|
|
1073
|
+
return /* @__PURE__ */ jsx16(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
970
1074
|
}
|
|
971
1075
|
function DialogClose({
|
|
972
1076
|
...props
|
|
973
1077
|
}) {
|
|
974
|
-
return /* @__PURE__ */
|
|
1078
|
+
return /* @__PURE__ */ jsx16(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
975
1079
|
}
|
|
976
1080
|
function DialogOverlay({
|
|
977
1081
|
className,
|
|
978
1082
|
...props
|
|
979
1083
|
}) {
|
|
980
|
-
return /* @__PURE__ */
|
|
1084
|
+
return /* @__PURE__ */ jsx16(
|
|
981
1085
|
DialogPrimitive.Overlay,
|
|
982
1086
|
{
|
|
983
1087
|
"data-slot": "dialog-overlay",
|
|
@@ -995,9 +1099,9 @@ function DialogContent({
|
|
|
995
1099
|
showCloseButton = true,
|
|
996
1100
|
...props
|
|
997
1101
|
}) {
|
|
998
|
-
return /* @__PURE__ */
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ jsxs11(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
1103
|
+
/* @__PURE__ */ jsx16(DialogOverlay, {}),
|
|
1104
|
+
/* @__PURE__ */ jsxs11(
|
|
1001
1105
|
DialogPrimitive.Content,
|
|
1002
1106
|
{
|
|
1003
1107
|
"data-slot": "dialog-content",
|
|
@@ -1008,14 +1112,14 @@ function DialogContent({
|
|
|
1008
1112
|
...props,
|
|
1009
1113
|
children: [
|
|
1010
1114
|
children,
|
|
1011
|
-
showCloseButton && /* @__PURE__ */
|
|
1115
|
+
showCloseButton && /* @__PURE__ */ jsxs11(
|
|
1012
1116
|
DialogPrimitive.Close,
|
|
1013
1117
|
{
|
|
1014
1118
|
"data-slot": "dialog-close",
|
|
1015
1119
|
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1016
1120
|
children: [
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
/* @__PURE__ */
|
|
1121
|
+
/* @__PURE__ */ jsx16(XIcon, {}),
|
|
1122
|
+
/* @__PURE__ */ jsx16("span", { className: "sr-only", children: "Close" })
|
|
1019
1123
|
]
|
|
1020
1124
|
}
|
|
1021
1125
|
)
|
|
@@ -1025,7 +1129,7 @@ function DialogContent({
|
|
|
1025
1129
|
] });
|
|
1026
1130
|
}
|
|
1027
1131
|
function DialogHeader({ className, ...props }) {
|
|
1028
|
-
return /* @__PURE__ */
|
|
1132
|
+
return /* @__PURE__ */ jsx16(
|
|
1029
1133
|
"div",
|
|
1030
1134
|
{
|
|
1031
1135
|
"data-slot": "dialog-header",
|
|
@@ -1035,7 +1139,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
1035
1139
|
);
|
|
1036
1140
|
}
|
|
1037
1141
|
function DialogFooter({ className, ...props }) {
|
|
1038
|
-
return /* @__PURE__ */
|
|
1142
|
+
return /* @__PURE__ */ jsx16(
|
|
1039
1143
|
"div",
|
|
1040
1144
|
{
|
|
1041
1145
|
"data-slot": "dialog-footer",
|
|
@@ -1051,7 +1155,7 @@ function DialogTitle({
|
|
|
1051
1155
|
className,
|
|
1052
1156
|
...props
|
|
1053
1157
|
}) {
|
|
1054
|
-
return /* @__PURE__ */
|
|
1158
|
+
return /* @__PURE__ */ jsx16(
|
|
1055
1159
|
DialogPrimitive.Title,
|
|
1056
1160
|
{
|
|
1057
1161
|
"data-slot": "dialog-title",
|
|
@@ -1064,7 +1168,7 @@ function DialogDescription({
|
|
|
1064
1168
|
className,
|
|
1065
1169
|
...props
|
|
1066
1170
|
}) {
|
|
1067
|
-
return /* @__PURE__ */
|
|
1171
|
+
return /* @__PURE__ */ jsx16(
|
|
1068
1172
|
DialogPrimitive.Description,
|
|
1069
1173
|
{
|
|
1070
1174
|
"data-slot": "dialog-description",
|
|
@@ -1075,13 +1179,13 @@ function DialogDescription({
|
|
|
1075
1179
|
}
|
|
1076
1180
|
|
|
1077
1181
|
// src/components/docs/search-modal.tsx
|
|
1078
|
-
import { Fragment as
|
|
1182
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1079
1183
|
function SearchModal({ isOpen, onClose, config }) {
|
|
1080
|
-
const [query, setQuery] =
|
|
1081
|
-
const [results, setResults] =
|
|
1082
|
-
const [isLoading, setIsLoading] =
|
|
1083
|
-
const [selectedIndex, setSelectedIndex] =
|
|
1084
|
-
const router =
|
|
1184
|
+
const [query, setQuery] = useState11("");
|
|
1185
|
+
const [results, setResults] = useState11([]);
|
|
1186
|
+
const [isLoading, setIsLoading] = useState11(false);
|
|
1187
|
+
const [selectedIndex, setSelectedIndex] = useState11(0);
|
|
1188
|
+
const router = useRouter4();
|
|
1085
1189
|
const searchConfig = config.search;
|
|
1086
1190
|
const performSearch = useCallback(async (searchQuery) => {
|
|
1087
1191
|
if (!searchQuery.trim() || !searchConfig?.enabled) {
|
|
@@ -1167,20 +1271,20 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1167
1271
|
if (!query2.trim()) return text;
|
|
1168
1272
|
const parts = text.split(new RegExp(`(${query2})`, "gi"));
|
|
1169
1273
|
return parts.map(
|
|
1170
|
-
(part, i) => part.toLowerCase() === query2.toLowerCase() ? /* @__PURE__ */
|
|
1274
|
+
(part, i) => part.toLowerCase() === query2.toLowerCase() ? /* @__PURE__ */ jsx17("mark", { className: "bg-yellow-200 dark:bg-yellow-900/50 text-foreground", children: part }, i) : part
|
|
1171
1275
|
);
|
|
1172
1276
|
};
|
|
1173
|
-
return /* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ jsx17(Dialog, { open: isOpen, onOpenChange: onClose, modal: true, children: /* @__PURE__ */ jsxs12(
|
|
1174
1278
|
DialogContent,
|
|
1175
1279
|
{
|
|
1176
1280
|
className: "max-w-2xl p-0 gap-0 top-[10vh] translate-y-0",
|
|
1177
1281
|
showCloseButton: false,
|
|
1178
1282
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
1179
1283
|
children: [
|
|
1180
|
-
/* @__PURE__ */
|
|
1181
|
-
/* @__PURE__ */
|
|
1182
|
-
/* @__PURE__ */
|
|
1183
|
-
/* @__PURE__ */
|
|
1284
|
+
/* @__PURE__ */ jsx17(DialogTitle, { className: "sr-only", children: "Search Documentation" }),
|
|
1285
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-border", children: [
|
|
1286
|
+
/* @__PURE__ */ jsx17(Search, { className: "h-5 w-5 text-muted-foreground shrink-0" }),
|
|
1287
|
+
/* @__PURE__ */ jsx17(
|
|
1184
1288
|
"input",
|
|
1185
1289
|
{
|
|
1186
1290
|
type: "text",
|
|
@@ -1191,30 +1295,30 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1191
1295
|
autoFocus: true
|
|
1192
1296
|
}
|
|
1193
1297
|
),
|
|
1194
|
-
isLoading && /* @__PURE__ */
|
|
1298
|
+
isLoading && /* @__PURE__ */ jsx17(Loader2, { className: "h-5 w-5 text-muted-foreground animate-spin" })
|
|
1195
1299
|
] }),
|
|
1196
|
-
/* @__PURE__ */
|
|
1197
|
-
query.trim() && results.length === 0 && !isLoading && /* @__PURE__ */
|
|
1300
|
+
/* @__PURE__ */ jsxs12("div", { className: "max-h-[60vh] overflow-y-auto", children: [
|
|
1301
|
+
query.trim() && results.length === 0 && !isLoading && /* @__PURE__ */ jsxs12("div", { className: "px-4 py-8 text-center text-muted-foreground", children: [
|
|
1198
1302
|
'No results found for "',
|
|
1199
1303
|
query,
|
|
1200
1304
|
'"'
|
|
1201
1305
|
] }),
|
|
1202
|
-
results.length > 0 && /* @__PURE__ */
|
|
1306
|
+
results.length > 0 && /* @__PURE__ */ jsx17("div", { className: "py-2", children: results.map((result, index) => /* @__PURE__ */ jsx17(
|
|
1203
1307
|
"button",
|
|
1204
1308
|
{
|
|
1205
1309
|
onClick: () => handleResultClick(result),
|
|
1206
1310
|
className: `w-full px-4 py-3 text-left hover:bg-muted/50 transition-colors border-l-2 ${index === selectedIndex ? "bg-muted/50 border-primary" : "border-transparent"}`,
|
|
1207
1311
|
onMouseEnter: () => setSelectedIndex(index),
|
|
1208
|
-
children: /* @__PURE__ */
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1212
|
-
result.content && /* @__PURE__ */
|
|
1213
|
-
/* @__PURE__ */
|
|
1214
|
-
/* @__PURE__ */
|
|
1215
|
-
result.category && /* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */
|
|
1312
|
+
children: /* @__PURE__ */ jsxs12("div", { className: "flex items-start gap-3", children: [
|
|
1313
|
+
/* @__PURE__ */ jsx17(FileText, { className: "h-5 w-5 text-muted-foreground shrink-0 mt-0.5" }),
|
|
1314
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex-1 min-w-0", children: [
|
|
1315
|
+
/* @__PURE__ */ jsx17("div", { className: "font-medium text-foreground mb-1", children: highlightText(result.title, query) }),
|
|
1316
|
+
result.content && /* @__PURE__ */ jsx17("div", { className: "text-sm text-muted-foreground line-clamp-2", children: highlightText(result.content, query) }),
|
|
1317
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2 mt-1 text-xs text-muted-foreground", children: [
|
|
1318
|
+
/* @__PURE__ */ jsx17("span", { children: result.version }),
|
|
1319
|
+
result.category && /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
1320
|
+
/* @__PURE__ */ jsx17("span", { children: "\u2022" }),
|
|
1321
|
+
/* @__PURE__ */ jsx17("span", { children: result.category })
|
|
1218
1322
|
] })
|
|
1219
1323
|
] })
|
|
1220
1324
|
] })
|
|
@@ -1222,15 +1326,15 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1222
1326
|
},
|
|
1223
1327
|
result.id
|
|
1224
1328
|
)) }),
|
|
1225
|
-
!query.trim() && /* @__PURE__ */
|
|
1226
|
-
/* @__PURE__ */
|
|
1227
|
-
/* @__PURE__ */
|
|
1228
|
-
/* @__PURE__ */
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
/* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1329
|
+
!query.trim() && /* @__PURE__ */ jsxs12("div", { className: "px-4 py-8 text-center text-muted-foreground text-sm", children: [
|
|
1330
|
+
/* @__PURE__ */ jsx17("p", { children: "Start typing to search documentation..." }),
|
|
1331
|
+
/* @__PURE__ */ jsxs12("div", { className: "mt-4 flex items-center justify-center gap-4 text-xs", children: [
|
|
1332
|
+
/* @__PURE__ */ jsx17("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "\u2191\u2193" }),
|
|
1333
|
+
/* @__PURE__ */ jsx17("span", { children: "Navigate" }),
|
|
1334
|
+
/* @__PURE__ */ jsx17("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "Enter" }),
|
|
1335
|
+
/* @__PURE__ */ jsx17("span", { children: "Select" }),
|
|
1336
|
+
/* @__PURE__ */ jsx17("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "Esc" }),
|
|
1337
|
+
/* @__PURE__ */ jsx17("span", { children: "Close" })
|
|
1234
1338
|
] })
|
|
1235
1339
|
] })
|
|
1236
1340
|
] })
|
|
@@ -1240,42 +1344,12 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1240
1344
|
}
|
|
1241
1345
|
|
|
1242
1346
|
// src/components/docs/header.tsx
|
|
1243
|
-
import { useState as
|
|
1244
|
-
|
|
1245
|
-
// src/components/config-provider.tsx
|
|
1246
|
-
import * as React2 from "react";
|
|
1247
|
-
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1248
|
-
var ConfigContext = React2.createContext(defaultConfig);
|
|
1249
|
-
function ConfigProvider({ config, children }) {
|
|
1250
|
-
return /* @__PURE__ */ jsx16(ConfigContext.Provider, { value: config, children });
|
|
1251
|
-
}
|
|
1252
|
-
function useConfig() {
|
|
1253
|
-
const config = React2.useContext(ConfigContext);
|
|
1254
|
-
if (!config) {
|
|
1255
|
-
throw new Error("useConfig must be used within a ConfigProvider");
|
|
1256
|
-
}
|
|
1257
|
-
return config;
|
|
1258
|
-
}
|
|
1259
|
-
function useConfigValue(path) {
|
|
1260
|
-
const config = useConfig();
|
|
1261
|
-
const keys = path.split(".");
|
|
1262
|
-
let value = config;
|
|
1263
|
-
for (const key of keys) {
|
|
1264
|
-
if (value && typeof value === "object" && key in value) {
|
|
1265
|
-
value = value[key];
|
|
1266
|
-
} else {
|
|
1267
|
-
return void 0;
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
return value;
|
|
1271
|
-
}
|
|
1272
|
-
|
|
1273
|
-
// src/components/docs/header.tsx
|
|
1274
|
-
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1347
|
+
import { useState as useState12, useEffect as useEffect7 } from "react";
|
|
1348
|
+
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1275
1349
|
function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
1276
1350
|
const contextConfig = useConfig();
|
|
1277
1351
|
const config = configProp || contextConfig;
|
|
1278
|
-
const [searchOpen, setSearchOpen] =
|
|
1352
|
+
const [searchOpen, setSearchOpen] = useState12(false);
|
|
1279
1353
|
useEffect7(() => {
|
|
1280
1354
|
const handleKeyDown = (e) => {
|
|
1281
1355
|
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
@@ -1286,38 +1360,38 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
1286
1360
|
window.addEventListener("keydown", handleKeyDown);
|
|
1287
1361
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
1288
1362
|
}, []);
|
|
1289
|
-
return /* @__PURE__ */
|
|
1290
|
-
/* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1292
|
-
/* @__PURE__ */
|
|
1363
|
+
return /* @__PURE__ */ jsxs13("header", { className: "sticky top-0 z-50 w-full border-b border-border bg-background/95 backdrop-blur supports-backdrop-filter:bg-background/60", children: [
|
|
1364
|
+
/* @__PURE__ */ jsxs13("div", { className: "container flex h-16 items-center justify-between px-2 md:px-6 mx-auto", children: [
|
|
1365
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1", children: [
|
|
1366
|
+
/* @__PURE__ */ jsx18(
|
|
1293
1367
|
"button",
|
|
1294
1368
|
{
|
|
1295
1369
|
onClick: onMenuClick,
|
|
1296
1370
|
className: "lg:hidden hover:bg-muted p-2 rounded-md transition-colors",
|
|
1297
1371
|
"aria-label": "Toggle menu",
|
|
1298
|
-
children: /* @__PURE__ */
|
|
1372
|
+
children: /* @__PURE__ */ jsx18(Menu, { className: "h-5 w-5" })
|
|
1299
1373
|
}
|
|
1300
1374
|
),
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
!config.site.hideLogo && (config.site.logo ? /* @__PURE__ */
|
|
1303
|
-
!config.site.hideTitle && /* @__PURE__ */
|
|
1375
|
+
/* @__PURE__ */ jsxs13(Link4, { href: "/", className: "flex items-center gap-2", children: [
|
|
1376
|
+
!config.site.hideLogo && (config.site.logo ? /* @__PURE__ */ jsx18(Logo, { logo: config.site.logo, alt: config.site.title, className: "h-12 w-auto object-contain" }) : /* @__PURE__ */ jsx18("div", { className: "h-8 w-8 rounded-xl bg-primary flex items-center justify-center", children: /* @__PURE__ */ jsx18("span", { className: "text-primary-foreground font-bold text-lg", children: config.site.title.charAt(0).toUpperCase() }) })),
|
|
1377
|
+
!config.site.hideTitle && /* @__PURE__ */ jsx18("span", { className: "font-semibold text-lg text-foreground", children: config.site.title ?? "Specra" })
|
|
1304
1378
|
] })
|
|
1305
1379
|
] }),
|
|
1306
|
-
/* @__PURE__ */
|
|
1307
|
-
config.search?.enabled && /* @__PURE__ */
|
|
1380
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
|
|
1381
|
+
config.search?.enabled && /* @__PURE__ */ jsxs13(
|
|
1308
1382
|
"button",
|
|
1309
1383
|
{
|
|
1310
1384
|
onClick: () => setSearchOpen(true),
|
|
1311
1385
|
className: "flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:text-foreground bg-muted rounded-md transition-colors",
|
|
1312
1386
|
children: [
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1387
|
+
/* @__PURE__ */ jsx18(Search2, { className: "h-4 w-4" }),
|
|
1388
|
+
/* @__PURE__ */ jsx18("span", { className: "hidden sm:inline", children: config.search.placeholder || "Search" }),
|
|
1389
|
+
/* @__PURE__ */ jsx18("kbd", { className: "hidden sm:inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-background px-1.5 font-mono text-xs font-medium", children: "\u2318K" })
|
|
1316
1390
|
]
|
|
1317
1391
|
}
|
|
1318
1392
|
),
|
|
1319
|
-
config.features?.versioning && /* @__PURE__ */
|
|
1320
|
-
config.social?.github && /* @__PURE__ */
|
|
1393
|
+
config.features?.versioning && /* @__PURE__ */ jsx18(VersionSwitcher, { currentVersion, versions }),
|
|
1394
|
+
config.social?.github && /* @__PURE__ */ jsx18(
|
|
1321
1395
|
"a",
|
|
1322
1396
|
{
|
|
1323
1397
|
href: config.social.github,
|
|
@@ -1325,10 +1399,10 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
1325
1399
|
rel: "noopener noreferrer",
|
|
1326
1400
|
className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
|
|
1327
1401
|
"aria-label": "GitHub",
|
|
1328
|
-
children: /* @__PURE__ */
|
|
1402
|
+
children: /* @__PURE__ */ jsx18(Github, { className: "h-4 w-4" })
|
|
1329
1403
|
}
|
|
1330
1404
|
),
|
|
1331
|
-
config.social?.twitter && /* @__PURE__ */
|
|
1405
|
+
config.social?.twitter && /* @__PURE__ */ jsx18(
|
|
1332
1406
|
"a",
|
|
1333
1407
|
{
|
|
1334
1408
|
href: config.social.twitter,
|
|
@@ -1336,10 +1410,10 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
1336
1410
|
rel: "noopener noreferrer",
|
|
1337
1411
|
className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
|
|
1338
1412
|
"aria-label": "Twitter",
|
|
1339
|
-
children: /* @__PURE__ */
|
|
1413
|
+
children: /* @__PURE__ */ jsx18(Twitter, { className: "h-4 w-4" })
|
|
1340
1414
|
}
|
|
1341
1415
|
),
|
|
1342
|
-
config.social?.discord && /* @__PURE__ */
|
|
1416
|
+
config.social?.discord && /* @__PURE__ */ jsx18(
|
|
1343
1417
|
"a",
|
|
1344
1418
|
{
|
|
1345
1419
|
href: config.social.discord,
|
|
@@ -1347,25 +1421,26 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
1347
1421
|
rel: "noopener noreferrer",
|
|
1348
1422
|
className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
|
|
1349
1423
|
"aria-label": "Discord",
|
|
1350
|
-
children: /* @__PURE__ */
|
|
1424
|
+
children: /* @__PURE__ */ jsx18(MessageCircle, { className: "h-4 w-4" })
|
|
1351
1425
|
}
|
|
1352
1426
|
),
|
|
1353
|
-
/* @__PURE__ */
|
|
1427
|
+
/* @__PURE__ */ jsx18(ThemeToggle, {}),
|
|
1428
|
+
/* @__PURE__ */ jsx18(LanguageSwitcher, {})
|
|
1354
1429
|
] })
|
|
1355
1430
|
] }),
|
|
1356
|
-
/* @__PURE__ */
|
|
1431
|
+
/* @__PURE__ */ jsx18(SearchModal, { isOpen: searchOpen, onClose: () => setSearchOpen(false), config })
|
|
1357
1432
|
] });
|
|
1358
1433
|
}
|
|
1359
1434
|
|
|
1360
1435
|
// src/components/docs/hot-reload-indicator.tsx
|
|
1361
|
-
import { useEffect as useEffect8, useState as
|
|
1362
|
-
import { usePathname as
|
|
1436
|
+
import { useEffect as useEffect8, useState as useState13 } from "react";
|
|
1437
|
+
import { usePathname as usePathname3 } from "next/navigation";
|
|
1363
1438
|
import { RefreshCw } from "lucide-react";
|
|
1364
|
-
import { Fragment as
|
|
1439
|
+
import { Fragment as Fragment5, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1365
1440
|
function HotReloadIndicator() {
|
|
1366
|
-
const [isReloading, setIsReloading] =
|
|
1367
|
-
const [lastReload, setLastReload] =
|
|
1368
|
-
const pathname =
|
|
1441
|
+
const [isReloading, setIsReloading] = useState13(false);
|
|
1442
|
+
const [lastReload, setLastReload] = useState13(null);
|
|
1443
|
+
const pathname = usePathname3();
|
|
1369
1444
|
useEffect8(() => {
|
|
1370
1445
|
if (process.env.NODE_ENV !== "development") return;
|
|
1371
1446
|
setIsReloading(true);
|
|
@@ -1396,14 +1471,14 @@ function HotReloadIndicator() {
|
|
|
1396
1471
|
};
|
|
1397
1472
|
}, []);
|
|
1398
1473
|
if (process.env.NODE_ENV !== "development") return null;
|
|
1399
|
-
return /* @__PURE__ */
|
|
1400
|
-
isReloading && /* @__PURE__ */
|
|
1401
|
-
/* @__PURE__ */
|
|
1402
|
-
/* @__PURE__ */
|
|
1474
|
+
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
1475
|
+
isReloading && /* @__PURE__ */ jsxs14("div", { className: "fixed bottom-4 right-4 z-50 flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground rounded-xl shadow-lg animate-in slide-in-from-bottom-2", children: [
|
|
1476
|
+
/* @__PURE__ */ jsx19(RefreshCw, { className: "h-4 w-4 animate-spin" }),
|
|
1477
|
+
/* @__PURE__ */ jsx19("span", { className: "text-sm font-medium", children: "Reloading..." })
|
|
1403
1478
|
] }),
|
|
1404
|
-
lastReload && !isReloading && /* @__PURE__ */
|
|
1405
|
-
/* @__PURE__ */
|
|
1406
|
-
/* @__PURE__ */
|
|
1479
|
+
lastReload && !isReloading && /* @__PURE__ */ jsxs14("div", { className: "fixed bottom-4 right-4 z-50 flex items-center gap-2 px-4 py-2 bg-green-500 text-white rounded-xl shadow-lg animate-in slide-in-from-bottom-2", children: [
|
|
1480
|
+
/* @__PURE__ */ jsx19(RefreshCw, { className: "h-4 w-4" }),
|
|
1481
|
+
/* @__PURE__ */ jsxs14("span", { className: "text-sm font-medium", children: [
|
|
1407
1482
|
"Updated at ",
|
|
1408
1483
|
lastReload.toLocaleTimeString()
|
|
1409
1484
|
] })
|
|
@@ -1413,9 +1488,9 @@ function HotReloadIndicator() {
|
|
|
1413
1488
|
|
|
1414
1489
|
// src/components/docs/mdx-hot-reload.tsx
|
|
1415
1490
|
import { useEffect as useEffect9 } from "react";
|
|
1416
|
-
import { useRouter as
|
|
1491
|
+
import { useRouter as useRouter5 } from "next/navigation";
|
|
1417
1492
|
function MdxHotReload() {
|
|
1418
|
-
const router =
|
|
1493
|
+
const router = useRouter5();
|
|
1419
1494
|
useEffect9(() => {
|
|
1420
1495
|
if (process.env.NODE_ENV !== "development") return;
|
|
1421
1496
|
const eventSource = new EventSource("/api/mdx-watch");
|
|
@@ -1442,43 +1517,43 @@ function MdxHotReload() {
|
|
|
1442
1517
|
// src/components/docs/not-found-content.tsx
|
|
1443
1518
|
import Link5 from "next/link";
|
|
1444
1519
|
import { AlertTriangle, Home, ArrowLeft } from "lucide-react";
|
|
1445
|
-
import { jsx as
|
|
1520
|
+
import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1446
1521
|
function NotFoundContent({ version }) {
|
|
1447
|
-
return /* @__PURE__ */
|
|
1448
|
-
/* @__PURE__ */
|
|
1449
|
-
/* @__PURE__ */
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */
|
|
1522
|
+
return /* @__PURE__ */ jsx20("div", { className: "flex min-h-[calc(100vh-12rem)] items-center justify-center px-4 py-12", children: /* @__PURE__ */ jsxs15("div", { className: "w-full max-w-2xl text-center", children: [
|
|
1523
|
+
/* @__PURE__ */ jsx20("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ jsx20("div", { className: "rounded-full bg-yellow-500/10 p-4", children: /* @__PURE__ */ jsx20(AlertTriangle, { className: "h-16 w-16 text-yellow-500" }) }) }),
|
|
1524
|
+
/* @__PURE__ */ jsx20("h1", { className: "mb-3 text-5xl font-bold tracking-tight", children: "404" }),
|
|
1525
|
+
/* @__PURE__ */ jsx20("h2", { className: "mb-4 text-2xl font-semibold", children: "Page Not Found" }),
|
|
1526
|
+
/* @__PURE__ */ jsxs15("p", { className: "mb-8 text-base text-muted-foreground", children: [
|
|
1452
1527
|
"The documentation page you're looking for doesn't exist or may have been moved.",
|
|
1453
|
-
/* @__PURE__ */
|
|
1528
|
+
/* @__PURE__ */ jsx20("br", {}),
|
|
1454
1529
|
"Try using the sidebar to find what you're looking for, or return to the documentation home."
|
|
1455
1530
|
] }),
|
|
1456
|
-
/* @__PURE__ */
|
|
1457
|
-
/* @__PURE__ */
|
|
1531
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col items-center justify-center gap-3 sm:flex-row", children: [
|
|
1532
|
+
/* @__PURE__ */ jsxs15(
|
|
1458
1533
|
Link5,
|
|
1459
1534
|
{
|
|
1460
1535
|
href: `/docs/${version}`,
|
|
1461
1536
|
className: "inline-flex items-center gap-2 rounded-lg bg-primary px-6 py-3 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",
|
|
1462
1537
|
children: [
|
|
1463
|
-
/* @__PURE__ */
|
|
1538
|
+
/* @__PURE__ */ jsx20(ArrowLeft, { className: "h-4 w-4" }),
|
|
1464
1539
|
"Back to Documentation"
|
|
1465
1540
|
]
|
|
1466
1541
|
}
|
|
1467
1542
|
),
|
|
1468
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ jsxs15(
|
|
1469
1544
|
Link5,
|
|
1470
1545
|
{
|
|
1471
1546
|
href: "/",
|
|
1472
1547
|
className: "inline-flex items-center gap-2 rounded-lg border border-border bg-background px-6 py-3 text-sm font-medium hover:bg-muted transition-colors",
|
|
1473
1548
|
children: [
|
|
1474
|
-
/* @__PURE__ */
|
|
1549
|
+
/* @__PURE__ */ jsx20(Home, { className: "h-4 w-4" }),
|
|
1475
1550
|
"Go to Homepage"
|
|
1476
1551
|
]
|
|
1477
1552
|
}
|
|
1478
1553
|
)
|
|
1479
1554
|
] }),
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ jsx20("div", { className: "mt-12 rounded-lg border border-border bg-muted/30 p-6", children: /* @__PURE__ */ jsxs15("p", { className: "text-sm text-muted-foreground", children: [
|
|
1556
|
+
/* @__PURE__ */ jsx20("strong", { className: "font-medium text-foreground", children: "Tip:" }),
|
|
1482
1557
|
" Use the sidebar navigation on the left to browse all available documentation pages."
|
|
1483
1558
|
] }) })
|
|
1484
1559
|
] }) });
|
|
@@ -1584,20 +1659,20 @@ function escapeRegex(string) {
|
|
|
1584
1659
|
}
|
|
1585
1660
|
|
|
1586
1661
|
// src/components/docs/sidebar-skeleton.tsx
|
|
1587
|
-
import { jsx as
|
|
1662
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1588
1663
|
function SidebarSkeleton() {
|
|
1589
|
-
return /* @__PURE__ */
|
|
1590
|
-
/* @__PURE__ */
|
|
1591
|
-
/* @__PURE__ */
|
|
1664
|
+
return /* @__PURE__ */ jsx21("aside", { className: "w-64 pr-8 py-6", children: /* @__PURE__ */ jsxs16("div", { className: "space-y-6", children: [
|
|
1665
|
+
/* @__PURE__ */ jsx21("div", { className: "px-2", children: /* @__PURE__ */ jsx21("div", { className: "h-5 w-32 bg-muted/50 rounded animate-pulse" }) }),
|
|
1666
|
+
/* @__PURE__ */ jsx21("div", { className: "space-y-1", children: [...Array(8)].map((_, i) => /* @__PURE__ */ jsx21("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsx21(
|
|
1592
1667
|
"div",
|
|
1593
1668
|
{
|
|
1594
1669
|
className: "h-4 bg-muted/50 rounded animate-pulse",
|
|
1595
1670
|
style: { width: `${60 + Math.random() * 40}%` }
|
|
1596
1671
|
}
|
|
1597
1672
|
) }, i)) }),
|
|
1598
|
-
/* @__PURE__ */
|
|
1599
|
-
/* @__PURE__ */
|
|
1600
|
-
[...Array(5)].map((_, i) => /* @__PURE__ */
|
|
1673
|
+
/* @__PURE__ */ jsxs16("div", { className: "space-y-1", children: [
|
|
1674
|
+
/* @__PURE__ */ jsx21("div", { className: "px-2 mb-2", children: /* @__PURE__ */ jsx21("div", { className: "h-4 w-24 bg-muted/50 rounded animate-pulse" }) }),
|
|
1675
|
+
[...Array(5)].map((_, i) => /* @__PURE__ */ jsx21("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsx21(
|
|
1601
1676
|
"div",
|
|
1602
1677
|
{
|
|
1603
1678
|
className: "h-4 bg-muted/50 rounded animate-pulse",
|
|
@@ -1609,10 +1684,10 @@ function SidebarSkeleton() {
|
|
|
1609
1684
|
}
|
|
1610
1685
|
|
|
1611
1686
|
// src/components/docs/table-of-contents.tsx
|
|
1612
|
-
import { useEffect as useEffect11, useState as
|
|
1613
|
-
import { jsx as
|
|
1687
|
+
import { useEffect as useEffect11, useState as useState14 } from "react";
|
|
1688
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1614
1689
|
function TableOfContents({ items, config }) {
|
|
1615
|
-
const [activeId, setActiveId] =
|
|
1690
|
+
const [activeId, setActiveId] = useState14("");
|
|
1616
1691
|
if (!config.navigation?.showTableOfContents) {
|
|
1617
1692
|
return null;
|
|
1618
1693
|
}
|
|
@@ -1655,9 +1730,9 @@ function TableOfContents({ items, config }) {
|
|
|
1655
1730
|
};
|
|
1656
1731
|
const stickyTop = hasTabGroups ? "top-[7.5rem]" : "top-24";
|
|
1657
1732
|
const maxHeight = hasTabGroups ? "max-h-[calc(100vh-10rem)]" : "max-h-[calc(100vh-7rem)]";
|
|
1658
|
-
return /* @__PURE__ */
|
|
1659
|
-
/* @__PURE__ */
|
|
1660
|
-
/* @__PURE__ */
|
|
1733
|
+
return /* @__PURE__ */ jsx22("aside", { className: `w-64 hidden xl:block shrink-0 sticky ${stickyTop} self-start`, children: filteredItems.length > 0 && /* @__PURE__ */ jsxs17("div", { className: `${maxHeight} overflow-y-auto bg-muted/30 dark:bg-muted/10 rounded-2xl p-4 border border-border/50`, children: [
|
|
1734
|
+
/* @__PURE__ */ jsx22("h3", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-4 px-2", children: "On this page" }),
|
|
1735
|
+
/* @__PURE__ */ jsx22("nav", { className: "space-y-1", children: filteredItems.map((item, index) => /* @__PURE__ */ jsx22(
|
|
1661
1736
|
"a",
|
|
1662
1737
|
{
|
|
1663
1738
|
href: `#${item.id}`,
|
|
@@ -1673,13 +1748,13 @@ function TableOfContents({ items, config }) {
|
|
|
1673
1748
|
// src/components/global/version-not-found.tsx
|
|
1674
1749
|
import { AlertTriangle as AlertTriangle2 } from "lucide-react";
|
|
1675
1750
|
import Link6 from "next/link";
|
|
1676
|
-
import { Fragment as
|
|
1751
|
+
import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1677
1752
|
function VersionNotFound() {
|
|
1678
|
-
return /* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */
|
|
1681
|
-
/* @__PURE__ */
|
|
1682
|
-
/* @__PURE__ */
|
|
1753
|
+
return /* @__PURE__ */ jsx23(Fragment6, { children: /* @__PURE__ */ jsx23("div", { className: "flex min-h-screen items-center justify-center px-4", children: /* @__PURE__ */ jsxs18("div", { className: "text-center", children: [
|
|
1754
|
+
/* @__PURE__ */ jsx23("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ jsx23(AlertTriangle2, { className: "h-16 w-16 text-yellow-500" }) }),
|
|
1755
|
+
/* @__PURE__ */ jsx23("h1", { className: "mb-2 text-4xl font-bold", children: "Version Not Found" }),
|
|
1756
|
+
/* @__PURE__ */ jsx23("p", { className: "mb-6 text-muted-foreground", children: "The documentation version you're looking for doesn't exist." }),
|
|
1757
|
+
/* @__PURE__ */ jsx23(
|
|
1683
1758
|
Link6,
|
|
1684
1759
|
{
|
|
1685
1760
|
href: "/docs/v1.0.0",
|
|
@@ -1737,6 +1812,7 @@ export {
|
|
|
1737
1812
|
ImageCard,
|
|
1738
1813
|
ImageCardGrid,
|
|
1739
1814
|
Input,
|
|
1815
|
+
LanguageSwitcher,
|
|
1740
1816
|
Logo,
|
|
1741
1817
|
Math2 as Math,
|
|
1742
1818
|
MdxHotReload,
|
|
@@ -1793,6 +1869,7 @@ export {
|
|
|
1793
1869
|
getConfig,
|
|
1794
1870
|
getConfigValue,
|
|
1795
1871
|
getDocBySlug,
|
|
1872
|
+
getI18nConfig,
|
|
1796
1873
|
getVersions,
|
|
1797
1874
|
initConfig,
|
|
1798
1875
|
isCategoryPage,
|