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.js
CHANGED
|
@@ -77,6 +77,7 @@ __export(src_exports, {
|
|
|
77
77
|
ImageCard: () => ImageCard,
|
|
78
78
|
ImageCardGrid: () => ImageCardGrid,
|
|
79
79
|
Input: () => Input,
|
|
80
|
+
LanguageSwitcher: () => LanguageSwitcher,
|
|
80
81
|
Logo: () => Logo,
|
|
81
82
|
Math: () => Math2,
|
|
82
83
|
MdxHotReload: () => MdxHotReload,
|
|
@@ -133,6 +134,7 @@ __export(src_exports, {
|
|
|
133
134
|
getConfig: () => getConfig,
|
|
134
135
|
getConfigValue: () => getConfigValue,
|
|
135
136
|
getDocBySlug: () => getDocBySlug,
|
|
137
|
+
getI18nConfig: () => getI18nConfig,
|
|
136
138
|
getVersions: () => getVersions,
|
|
137
139
|
initConfig: () => initConfig,
|
|
138
140
|
isCategoryPage: () => isCategoryPage,
|
|
@@ -816,7 +818,7 @@ async function getAllDocs(version = "v1.0.0", locale) {
|
|
|
816
818
|
originalFilePath = parts.slice(0, -1).join(".");
|
|
817
819
|
}
|
|
818
820
|
}
|
|
819
|
-
const doc = await getDocBySlug(
|
|
821
|
+
const doc = await getDocBySlug(originalFilePath, version, isLocalized ? fileLocale : void 0);
|
|
820
822
|
if (!doc) return null;
|
|
821
823
|
doc.filePath = originalFilePath;
|
|
822
824
|
const folderPath = import_path3.default.dirname(originalFilePath).replace(/\\/g, "/");
|
|
@@ -838,6 +840,10 @@ async function getAllDocs(version = "v1.0.0", locale) {
|
|
|
838
840
|
const uniqueDocs = /* @__PURE__ */ new Map();
|
|
839
841
|
const validDocs = docs.filter((doc) => doc !== null && (isDevelopment3 || !doc.meta.draft));
|
|
840
842
|
validDocs.forEach((doc) => {
|
|
843
|
+
if (locale === "all") {
|
|
844
|
+
uniqueDocs.set(doc.slug, doc);
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
841
847
|
let logicalSlug = doc.slug;
|
|
842
848
|
if (i18nConfig) {
|
|
843
849
|
const parts = logicalSlug.split("/");
|
|
@@ -1050,18 +1056,19 @@ function getCachedVersions() {
|
|
|
1050
1056
|
versionsCache.timestamp = Date.now();
|
|
1051
1057
|
return versions;
|
|
1052
1058
|
}
|
|
1053
|
-
async function getCachedAllDocs(version = "v1.0.0") {
|
|
1059
|
+
async function getCachedAllDocs(version = "v1.0.0", locale) {
|
|
1054
1060
|
initializeWatchers();
|
|
1055
|
-
const
|
|
1061
|
+
const cacheKey = locale ? `${version}:${locale}` : version;
|
|
1062
|
+
const cached = allDocsCache.get(cacheKey);
|
|
1056
1063
|
if (cached && isCacheValid(cached.timestamp)) {
|
|
1057
|
-
logCacheOperation("hit", `getAllDocs:${
|
|
1064
|
+
logCacheOperation("hit", `getAllDocs:${cacheKey}`);
|
|
1058
1065
|
return cached.data;
|
|
1059
1066
|
}
|
|
1060
|
-
logCacheOperation("miss", `getAllDocs:${
|
|
1061
|
-
const timer = new PerfTimer(`getAllDocs(${
|
|
1062
|
-
const docs = await getAllDocs(version);
|
|
1067
|
+
logCacheOperation("miss", `getAllDocs:${cacheKey}`);
|
|
1068
|
+
const timer = new PerfTimer(`getAllDocs(${cacheKey})`);
|
|
1069
|
+
const docs = await getAllDocs(version, locale);
|
|
1063
1070
|
timer.end();
|
|
1064
|
-
allDocsCache.set(
|
|
1071
|
+
allDocsCache.set(cacheKey, {
|
|
1065
1072
|
data: docs,
|
|
1066
1073
|
timestamp: Date.now()
|
|
1067
1074
|
});
|
|
@@ -2914,7 +2921,7 @@ function Frame({ src, title = "Embedded content", height = 500, width = "100%" }
|
|
|
2914
2921
|
|
|
2915
2922
|
// src/components/docs/header.tsx
|
|
2916
2923
|
var import_link7 = __toESM(require("next/link"));
|
|
2917
|
-
var
|
|
2924
|
+
var import_lucide_react19 = require("lucide-react");
|
|
2918
2925
|
|
|
2919
2926
|
// src/components/docs/version-switcher.tsx
|
|
2920
2927
|
var import_react9 = require("react");
|
|
@@ -2958,13 +2965,116 @@ function VersionSwitcher({ currentVersion, versions }) {
|
|
|
2958
2965
|
] });
|
|
2959
2966
|
}
|
|
2960
2967
|
|
|
2961
|
-
// src/components/docs/
|
|
2962
|
-
var import_lucide_react15 = require("lucide-react");
|
|
2968
|
+
// src/components/docs/language-switcher.tsx
|
|
2963
2969
|
var import_react10 = require("react");
|
|
2970
|
+
var import_lucide_react15 = require("lucide-react");
|
|
2971
|
+
var import_navigation4 = require("next/navigation");
|
|
2972
|
+
|
|
2973
|
+
// src/components/config-provider.tsx
|
|
2974
|
+
var React3 = __toESM(require("react"));
|
|
2964
2975
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2976
|
+
var ConfigContext = React3.createContext(defaultConfig);
|
|
2977
|
+
function ConfigProvider({ config, children }) {
|
|
2978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ConfigContext.Provider, { value: config, children });
|
|
2979
|
+
}
|
|
2980
|
+
function useConfig() {
|
|
2981
|
+
const config = React3.useContext(ConfigContext);
|
|
2982
|
+
if (!config) {
|
|
2983
|
+
throw new Error("useConfig must be used within a ConfigProvider");
|
|
2984
|
+
}
|
|
2985
|
+
return config;
|
|
2986
|
+
}
|
|
2987
|
+
function useConfigValue(path4) {
|
|
2988
|
+
const config = useConfig();
|
|
2989
|
+
const keys = path4.split(".");
|
|
2990
|
+
let value = config;
|
|
2991
|
+
for (const key of keys) {
|
|
2992
|
+
if (value && typeof value === "object" && key in value) {
|
|
2993
|
+
value = value[key];
|
|
2994
|
+
} else {
|
|
2995
|
+
return void 0;
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
return value;
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
// src/components/docs/language-switcher.tsx
|
|
3002
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3003
|
+
function LanguageSwitcher() {
|
|
3004
|
+
const [open, setOpen] = (0, import_react10.useState)(false);
|
|
3005
|
+
const pathname = (0, import_navigation4.usePathname)();
|
|
3006
|
+
const router = (0, import_navigation4.useRouter)();
|
|
3007
|
+
const config = useConfig();
|
|
3008
|
+
const i18n = config.features?.i18n;
|
|
3009
|
+
if (!i18n || typeof i18n === "boolean") return null;
|
|
3010
|
+
const { locales, localeNames, defaultLocale, prefixDefault } = i18n;
|
|
3011
|
+
const pathParts = pathname.split("/");
|
|
3012
|
+
const version = pathParts[2];
|
|
3013
|
+
let currentLocale = defaultLocale;
|
|
3014
|
+
if (pathParts[3] && locales.includes(pathParts[3])) {
|
|
3015
|
+
currentLocale = pathParts[3];
|
|
3016
|
+
}
|
|
3017
|
+
const handleLocaleChange = (newLocale) => {
|
|
3018
|
+
if (newLocale === currentLocale) {
|
|
3019
|
+
setOpen(false);
|
|
3020
|
+
return;
|
|
3021
|
+
}
|
|
3022
|
+
const parts = [...pathParts];
|
|
3023
|
+
const hasLocalePrefix = locales.includes(parts[3]);
|
|
3024
|
+
if (newLocale === defaultLocale && !prefixDefault) {
|
|
3025
|
+
if (hasLocalePrefix) {
|
|
3026
|
+
parts.splice(3, 1);
|
|
3027
|
+
}
|
|
3028
|
+
} else {
|
|
3029
|
+
if (hasLocalePrefix) {
|
|
3030
|
+
parts[3] = newLocale;
|
|
3031
|
+
} else {
|
|
3032
|
+
parts.splice(3, 0, newLocale);
|
|
3033
|
+
}
|
|
3034
|
+
}
|
|
3035
|
+
const newPath = parts.join("/");
|
|
3036
|
+
router.push(newPath);
|
|
3037
|
+
setOpen(false);
|
|
3038
|
+
};
|
|
3039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative", children: [
|
|
3040
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3041
|
+
"button",
|
|
3042
|
+
{
|
|
3043
|
+
onClick: () => setOpen(!open),
|
|
3044
|
+
className: "flex items-center gap-1.5 px-2 h-9 rounded-md hover:bg-muted transition-colors",
|
|
3045
|
+
"aria-label": "Switch language",
|
|
3046
|
+
children: [
|
|
3047
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Languages, { className: "h-4 w-4" }),
|
|
3048
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs font-bold uppercase", children: currentLocale }),
|
|
3049
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.ChevronDown, { className: "h-3 w-3 text-muted-foreground" })
|
|
3050
|
+
]
|
|
3051
|
+
}
|
|
3052
|
+
),
|
|
3053
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
3054
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "fixed inset-0 z-40", onClick: () => setOpen(false) }),
|
|
3055
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "absolute right-0 mt-2 w-40 bg-background border border-border rounded-md shadow-lg z-50", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "p-2", children: locales.map((locale) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3056
|
+
"button",
|
|
3057
|
+
{
|
|
3058
|
+
onClick: () => handleLocaleChange(locale),
|
|
3059
|
+
className: "flex items-center justify-between w-full px-3 py-2 text-sm text-foreground hover:bg-muted rounded-md transition-colors",
|
|
3060
|
+
children: [
|
|
3061
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: localeNames?.[locale] || locale.toUpperCase() }),
|
|
3062
|
+
currentLocale === locale && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Check, { className: "h-4 w-4 text-primary" })
|
|
3063
|
+
]
|
|
3064
|
+
},
|
|
3065
|
+
locale
|
|
3066
|
+
)) }) })
|
|
3067
|
+
] })
|
|
3068
|
+
] });
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3071
|
+
// src/components/docs/theme-toggle.tsx
|
|
3072
|
+
var import_lucide_react16 = require("lucide-react");
|
|
3073
|
+
var import_react11 = require("react");
|
|
3074
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2965
3075
|
function ThemeToggle() {
|
|
2966
|
-
const [theme, setTheme] = (0,
|
|
2967
|
-
(0,
|
|
3076
|
+
const [theme, setTheme] = (0, import_react11.useState)("dark");
|
|
3077
|
+
(0, import_react11.useEffect)(() => {
|
|
2968
3078
|
const savedTheme = localStorage.getItem("theme");
|
|
2969
3079
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
2970
3080
|
const initialTheme = savedTheme || (prefersDark ? "dark" : "light");
|
|
@@ -2977,51 +3087,51 @@ function ThemeToggle() {
|
|
|
2977
3087
|
localStorage.setItem("theme", newTheme);
|
|
2978
3088
|
document.documentElement.classList.toggle("dark", newTheme === "dark");
|
|
2979
3089
|
};
|
|
2980
|
-
return /* @__PURE__ */ (0,
|
|
3090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2981
3091
|
"button",
|
|
2982
3092
|
{
|
|
2983
3093
|
onClick: toggleTheme,
|
|
2984
3094
|
className: "flex items-center justify-center w-9 h-9 rounded-md border border-border bg-background hover:bg-accent transition-colors",
|
|
2985
3095
|
"aria-label": "Toggle theme",
|
|
2986
|
-
children: theme === "dark" ? /* @__PURE__ */ (0,
|
|
3096
|
+
children: theme === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react16.Sun, { className: "h-4 w-4 text-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react16.Moon, { className: "h-4 w-4 text-foreground" })
|
|
2987
3097
|
}
|
|
2988
3098
|
);
|
|
2989
3099
|
}
|
|
2990
3100
|
|
|
2991
3101
|
// src/components/docs/search-modal.tsx
|
|
2992
|
-
var
|
|
2993
|
-
var
|
|
2994
|
-
var
|
|
3102
|
+
var import_react12 = require("react");
|
|
3103
|
+
var import_lucide_react18 = require("lucide-react");
|
|
3104
|
+
var import_navigation5 = require("next/navigation");
|
|
2995
3105
|
|
|
2996
3106
|
// src/components/ui/dialog.tsx
|
|
2997
3107
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
2998
|
-
var
|
|
2999
|
-
var
|
|
3108
|
+
var import_lucide_react17 = require("lucide-react");
|
|
3109
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3000
3110
|
function Dialog({
|
|
3001
3111
|
...props
|
|
3002
3112
|
}) {
|
|
3003
|
-
return /* @__PURE__ */ (0,
|
|
3113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
3004
3114
|
}
|
|
3005
3115
|
function DialogTrigger({
|
|
3006
3116
|
...props
|
|
3007
3117
|
}) {
|
|
3008
|
-
return /* @__PURE__ */ (0,
|
|
3118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
3009
3119
|
}
|
|
3010
3120
|
function DialogPortal({
|
|
3011
3121
|
...props
|
|
3012
3122
|
}) {
|
|
3013
|
-
return /* @__PURE__ */ (0,
|
|
3123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
3014
3124
|
}
|
|
3015
3125
|
function DialogClose({
|
|
3016
3126
|
...props
|
|
3017
3127
|
}) {
|
|
3018
|
-
return /* @__PURE__ */ (0,
|
|
3128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
3019
3129
|
}
|
|
3020
3130
|
function DialogOverlay({
|
|
3021
3131
|
className,
|
|
3022
3132
|
...props
|
|
3023
3133
|
}) {
|
|
3024
|
-
return /* @__PURE__ */ (0,
|
|
3134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3025
3135
|
DialogPrimitive.Overlay,
|
|
3026
3136
|
{
|
|
3027
3137
|
"data-slot": "dialog-overlay",
|
|
@@ -3039,9 +3149,9 @@ function DialogContent({
|
|
|
3039
3149
|
showCloseButton = true,
|
|
3040
3150
|
...props
|
|
3041
3151
|
}) {
|
|
3042
|
-
return /* @__PURE__ */ (0,
|
|
3043
|
-
/* @__PURE__ */ (0,
|
|
3044
|
-
/* @__PURE__ */ (0,
|
|
3152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
3153
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogOverlay, {}),
|
|
3154
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3045
3155
|
DialogPrimitive.Content,
|
|
3046
3156
|
{
|
|
3047
3157
|
"data-slot": "dialog-content",
|
|
@@ -3052,14 +3162,14 @@ function DialogContent({
|
|
|
3052
3162
|
...props,
|
|
3053
3163
|
children: [
|
|
3054
3164
|
children,
|
|
3055
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
3165
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3056
3166
|
DialogPrimitive.Close,
|
|
3057
3167
|
{
|
|
3058
3168
|
"data-slot": "dialog-close",
|
|
3059
3169
|
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",
|
|
3060
3170
|
children: [
|
|
3061
|
-
/* @__PURE__ */ (0,
|
|
3062
|
-
/* @__PURE__ */ (0,
|
|
3171
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react17.XIcon, {}),
|
|
3172
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "sr-only", children: "Close" })
|
|
3063
3173
|
]
|
|
3064
3174
|
}
|
|
3065
3175
|
)
|
|
@@ -3069,7 +3179,7 @@ function DialogContent({
|
|
|
3069
3179
|
] });
|
|
3070
3180
|
}
|
|
3071
3181
|
function DialogHeader({ className, ...props }) {
|
|
3072
|
-
return /* @__PURE__ */ (0,
|
|
3182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3073
3183
|
"div",
|
|
3074
3184
|
{
|
|
3075
3185
|
"data-slot": "dialog-header",
|
|
@@ -3079,7 +3189,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
3079
3189
|
);
|
|
3080
3190
|
}
|
|
3081
3191
|
function DialogFooter({ className, ...props }) {
|
|
3082
|
-
return /* @__PURE__ */ (0,
|
|
3192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3083
3193
|
"div",
|
|
3084
3194
|
{
|
|
3085
3195
|
"data-slot": "dialog-footer",
|
|
@@ -3095,7 +3205,7 @@ function DialogTitle({
|
|
|
3095
3205
|
className,
|
|
3096
3206
|
...props
|
|
3097
3207
|
}) {
|
|
3098
|
-
return /* @__PURE__ */ (0,
|
|
3208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3099
3209
|
DialogPrimitive.Title,
|
|
3100
3210
|
{
|
|
3101
3211
|
"data-slot": "dialog-title",
|
|
@@ -3108,7 +3218,7 @@ function DialogDescription({
|
|
|
3108
3218
|
className,
|
|
3109
3219
|
...props
|
|
3110
3220
|
}) {
|
|
3111
|
-
return /* @__PURE__ */ (0,
|
|
3221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3112
3222
|
DialogPrimitive.Description,
|
|
3113
3223
|
{
|
|
3114
3224
|
"data-slot": "dialog-description",
|
|
@@ -3119,15 +3229,15 @@ function DialogDescription({
|
|
|
3119
3229
|
}
|
|
3120
3230
|
|
|
3121
3231
|
// src/components/docs/search-modal.tsx
|
|
3122
|
-
var
|
|
3232
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3123
3233
|
function SearchModal({ isOpen, onClose, config }) {
|
|
3124
|
-
const [query, setQuery] = (0,
|
|
3125
|
-
const [results, setResults] = (0,
|
|
3126
|
-
const [isLoading, setIsLoading] = (0,
|
|
3127
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3128
|
-
const router = (0,
|
|
3234
|
+
const [query, setQuery] = (0, import_react12.useState)("");
|
|
3235
|
+
const [results, setResults] = (0, import_react12.useState)([]);
|
|
3236
|
+
const [isLoading, setIsLoading] = (0, import_react12.useState)(false);
|
|
3237
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react12.useState)(0);
|
|
3238
|
+
const router = (0, import_navigation5.useRouter)();
|
|
3129
3239
|
const searchConfig = config.search;
|
|
3130
|
-
const performSearch = (0,
|
|
3240
|
+
const performSearch = (0, import_react12.useCallback)(async (searchQuery) => {
|
|
3131
3241
|
if (!searchQuery.trim() || !searchConfig?.enabled) {
|
|
3132
3242
|
setResults([]);
|
|
3133
3243
|
return;
|
|
@@ -3158,13 +3268,13 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
3158
3268
|
setIsLoading(false);
|
|
3159
3269
|
}
|
|
3160
3270
|
}, [searchConfig]);
|
|
3161
|
-
(0,
|
|
3271
|
+
(0, import_react12.useEffect)(() => {
|
|
3162
3272
|
const timer = setTimeout(() => {
|
|
3163
3273
|
performSearch(query);
|
|
3164
3274
|
}, 300);
|
|
3165
3275
|
return () => clearTimeout(timer);
|
|
3166
3276
|
}, [query, performSearch]);
|
|
3167
|
-
(0,
|
|
3277
|
+
(0, import_react12.useEffect)(() => {
|
|
3168
3278
|
const handleKeyDown = (e) => {
|
|
3169
3279
|
if (!isOpen) return;
|
|
3170
3280
|
switch (e.key) {
|
|
@@ -3190,7 +3300,7 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
3190
3300
|
window.addEventListener("keydown", handleKeyDown);
|
|
3191
3301
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
3192
3302
|
}, [isOpen, results, selectedIndex, onClose]);
|
|
3193
|
-
(0,
|
|
3303
|
+
(0, import_react12.useEffect)(() => {
|
|
3194
3304
|
if (isOpen) {
|
|
3195
3305
|
setQuery("");
|
|
3196
3306
|
setResults([]);
|
|
@@ -3211,20 +3321,20 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
3211
3321
|
if (!query2.trim()) return text;
|
|
3212
3322
|
const parts = text.split(new RegExp(`(${query2})`, "gi"));
|
|
3213
3323
|
return parts.map(
|
|
3214
|
-
(part, i) => part.toLowerCase() === query2.toLowerCase() ? /* @__PURE__ */ (0,
|
|
3324
|
+
(part, i) => part.toLowerCase() === query2.toLowerCase() ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("mark", { className: "bg-yellow-200 dark:bg-yellow-900/50 text-foreground", children: part }, i) : part
|
|
3215
3325
|
);
|
|
3216
3326
|
};
|
|
3217
|
-
return /* @__PURE__ */ (0,
|
|
3327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog, { open: isOpen, onOpenChange: onClose, modal: true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3218
3328
|
DialogContent,
|
|
3219
3329
|
{
|
|
3220
3330
|
className: "max-w-2xl p-0 gap-0 top-[10vh] translate-y-0",
|
|
3221
3331
|
showCloseButton: false,
|
|
3222
3332
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
3223
3333
|
children: [
|
|
3224
|
-
/* @__PURE__ */ (0,
|
|
3225
|
-
/* @__PURE__ */ (0,
|
|
3226
|
-
/* @__PURE__ */ (0,
|
|
3227
|
-
/* @__PURE__ */ (0,
|
|
3334
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DialogTitle, { className: "sr-only", children: "Search Documentation" }),
|
|
3335
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-border", children: [
|
|
3336
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react18.Search, { className: "h-5 w-5 text-muted-foreground shrink-0" }),
|
|
3337
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3228
3338
|
"input",
|
|
3229
3339
|
{
|
|
3230
3340
|
type: "text",
|
|
@@ -3235,30 +3345,30 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
3235
3345
|
autoFocus: true
|
|
3236
3346
|
}
|
|
3237
3347
|
),
|
|
3238
|
-
isLoading && /* @__PURE__ */ (0,
|
|
3348
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react18.Loader2, { className: "h-5 w-5 text-muted-foreground animate-spin" })
|
|
3239
3349
|
] }),
|
|
3240
|
-
/* @__PURE__ */ (0,
|
|
3241
|
-
query.trim() && results.length === 0 && !isLoading && /* @__PURE__ */ (0,
|
|
3350
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "max-h-[60vh] overflow-y-auto", children: [
|
|
3351
|
+
query.trim() && results.length === 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "px-4 py-8 text-center text-muted-foreground", children: [
|
|
3242
3352
|
'No results found for "',
|
|
3243
3353
|
query,
|
|
3244
3354
|
'"'
|
|
3245
3355
|
] }),
|
|
3246
|
-
results.length > 0 && /* @__PURE__ */ (0,
|
|
3356
|
+
results.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "py-2", children: results.map((result, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3247
3357
|
"button",
|
|
3248
3358
|
{
|
|
3249
3359
|
onClick: () => handleResultClick(result),
|
|
3250
3360
|
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"}`,
|
|
3251
3361
|
onMouseEnter: () => setSelectedIndex(index),
|
|
3252
|
-
children: /* @__PURE__ */ (0,
|
|
3253
|
-
/* @__PURE__ */ (0,
|
|
3254
|
-
/* @__PURE__ */ (0,
|
|
3255
|
-
/* @__PURE__ */ (0,
|
|
3256
|
-
result.content && /* @__PURE__ */ (0,
|
|
3257
|
-
/* @__PURE__ */ (0,
|
|
3258
|
-
/* @__PURE__ */ (0,
|
|
3259
|
-
result.category && /* @__PURE__ */ (0,
|
|
3260
|
-
/* @__PURE__ */ (0,
|
|
3261
|
-
/* @__PURE__ */ (0,
|
|
3362
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
3363
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react18.FileText, { className: "h-5 w-5 text-muted-foreground shrink-0 mt-0.5" }),
|
|
3364
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3365
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "font-medium text-foreground mb-1", children: highlightText(result.title, query) }),
|
|
3366
|
+
result.content && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "text-sm text-muted-foreground line-clamp-2", children: highlightText(result.content, query) }),
|
|
3367
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-2 mt-1 text-xs text-muted-foreground", children: [
|
|
3368
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: result.version }),
|
|
3369
|
+
result.category && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
3370
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u2022" }),
|
|
3371
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: result.category })
|
|
3262
3372
|
] })
|
|
3263
3373
|
] })
|
|
3264
3374
|
] })
|
|
@@ -3266,15 +3376,15 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
3266
3376
|
},
|
|
3267
3377
|
result.id
|
|
3268
3378
|
)) }),
|
|
3269
|
-
!query.trim() && /* @__PURE__ */ (0,
|
|
3270
|
-
/* @__PURE__ */ (0,
|
|
3271
|
-
/* @__PURE__ */ (0,
|
|
3272
|
-
/* @__PURE__ */ (0,
|
|
3273
|
-
/* @__PURE__ */ (0,
|
|
3274
|
-
/* @__PURE__ */ (0,
|
|
3275
|
-
/* @__PURE__ */ (0,
|
|
3276
|
-
/* @__PURE__ */ (0,
|
|
3277
|
-
/* @__PURE__ */ (0,
|
|
3379
|
+
!query.trim() && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "px-4 py-8 text-center text-muted-foreground text-sm", children: [
|
|
3380
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { children: "Start typing to search documentation..." }),
|
|
3381
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-4 flex items-center justify-center gap-4 text-xs", children: [
|
|
3382
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "\u2191\u2193" }),
|
|
3383
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Navigate" }),
|
|
3384
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "Enter" }),
|
|
3385
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Select" }),
|
|
3386
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "Esc" }),
|
|
3387
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Close" })
|
|
3278
3388
|
] })
|
|
3279
3389
|
] })
|
|
3280
3390
|
] })
|
|
@@ -3284,43 +3394,13 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
3284
3394
|
}
|
|
3285
3395
|
|
|
3286
3396
|
// src/components/docs/header.tsx
|
|
3287
|
-
var
|
|
3288
|
-
|
|
3289
|
-
// src/components/config-provider.tsx
|
|
3290
|
-
var React3 = __toESM(require("react"));
|
|
3291
|
-
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3292
|
-
var ConfigContext = React3.createContext(defaultConfig);
|
|
3293
|
-
function ConfigProvider({ config, children }) {
|
|
3294
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ConfigContext.Provider, { value: config, children });
|
|
3295
|
-
}
|
|
3296
|
-
function useConfig() {
|
|
3297
|
-
const config = React3.useContext(ConfigContext);
|
|
3298
|
-
if (!config) {
|
|
3299
|
-
throw new Error("useConfig must be used within a ConfigProvider");
|
|
3300
|
-
}
|
|
3301
|
-
return config;
|
|
3302
|
-
}
|
|
3303
|
-
function useConfigValue(path4) {
|
|
3304
|
-
const config = useConfig();
|
|
3305
|
-
const keys = path4.split(".");
|
|
3306
|
-
let value = config;
|
|
3307
|
-
for (const key of keys) {
|
|
3308
|
-
if (value && typeof value === "object" && key in value) {
|
|
3309
|
-
value = value[key];
|
|
3310
|
-
} else {
|
|
3311
|
-
return void 0;
|
|
3312
|
-
}
|
|
3313
|
-
}
|
|
3314
|
-
return value;
|
|
3315
|
-
}
|
|
3316
|
-
|
|
3317
|
-
// src/components/docs/header.tsx
|
|
3318
|
-
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3397
|
+
var import_react13 = require("react");
|
|
3398
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3319
3399
|
function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
3320
3400
|
const contextConfig = useConfig();
|
|
3321
3401
|
const config = configProp || contextConfig;
|
|
3322
|
-
const [searchOpen, setSearchOpen] = (0,
|
|
3323
|
-
(0,
|
|
3402
|
+
const [searchOpen, setSearchOpen] = (0, import_react13.useState)(false);
|
|
3403
|
+
(0, import_react13.useEffect)(() => {
|
|
3324
3404
|
const handleKeyDown = (e) => {
|
|
3325
3405
|
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
3326
3406
|
e.preventDefault();
|
|
@@ -3330,38 +3410,38 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
3330
3410
|
window.addEventListener("keydown", handleKeyDown);
|
|
3331
3411
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
3332
3412
|
}, []);
|
|
3333
|
-
return /* @__PURE__ */ (0,
|
|
3334
|
-
/* @__PURE__ */ (0,
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3336
|
-
/* @__PURE__ */ (0,
|
|
3413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("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: [
|
|
3414
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "container flex h-16 items-center justify-between px-2 md:px-6 mx-auto", children: [
|
|
3415
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
3416
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3337
3417
|
"button",
|
|
3338
3418
|
{
|
|
3339
3419
|
onClick: onMenuClick,
|
|
3340
3420
|
className: "lg:hidden hover:bg-muted p-2 rounded-md transition-colors",
|
|
3341
3421
|
"aria-label": "Toggle menu",
|
|
3342
|
-
children: /* @__PURE__ */ (0,
|
|
3422
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react19.Menu, { className: "h-5 w-5" })
|
|
3343
3423
|
}
|
|
3344
3424
|
),
|
|
3345
|
-
/* @__PURE__ */ (0,
|
|
3346
|
-
!config.site.hideLogo && (config.site.logo ? /* @__PURE__ */ (0,
|
|
3347
|
-
!config.site.hideTitle && /* @__PURE__ */ (0,
|
|
3425
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_link7.default, { href: "/", className: "flex items-center gap-2", children: [
|
|
3426
|
+
!config.site.hideLogo && (config.site.logo ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Logo, { logo: config.site.logo, alt: config.site.title, className: "h-12 w-auto object-contain" }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "h-8 w-8 rounded-xl bg-primary flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-primary-foreground font-bold text-lg", children: config.site.title.charAt(0).toUpperCase() }) })),
|
|
3427
|
+
!config.site.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "font-semibold text-lg text-foreground", children: config.site.title ?? "Specra" })
|
|
3348
3428
|
] })
|
|
3349
3429
|
] }),
|
|
3350
|
-
/* @__PURE__ */ (0,
|
|
3351
|
-
config.search?.enabled && /* @__PURE__ */ (0,
|
|
3430
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3431
|
+
config.search?.enabled && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3352
3432
|
"button",
|
|
3353
3433
|
{
|
|
3354
3434
|
onClick: () => setSearchOpen(true),
|
|
3355
3435
|
className: "flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:text-foreground bg-muted rounded-md transition-colors",
|
|
3356
3436
|
children: [
|
|
3357
|
-
/* @__PURE__ */ (0,
|
|
3358
|
-
/* @__PURE__ */ (0,
|
|
3359
|
-
/* @__PURE__ */ (0,
|
|
3437
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react19.Search, { className: "h-4 w-4" }),
|
|
3438
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "hidden sm:inline", children: config.search.placeholder || "Search" }),
|
|
3439
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("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" })
|
|
3360
3440
|
]
|
|
3361
3441
|
}
|
|
3362
3442
|
),
|
|
3363
|
-
config.features?.versioning && /* @__PURE__ */ (0,
|
|
3364
|
-
config.social?.github && /* @__PURE__ */ (0,
|
|
3443
|
+
config.features?.versioning && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(VersionSwitcher, { currentVersion, versions }),
|
|
3444
|
+
config.social?.github && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3365
3445
|
"a",
|
|
3366
3446
|
{
|
|
3367
3447
|
href: config.social.github,
|
|
@@ -3369,10 +3449,10 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
3369
3449
|
rel: "noopener noreferrer",
|
|
3370
3450
|
className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
|
|
3371
3451
|
"aria-label": "GitHub",
|
|
3372
|
-
children: /* @__PURE__ */ (0,
|
|
3452
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react19.Github, { className: "h-4 w-4" })
|
|
3373
3453
|
}
|
|
3374
3454
|
),
|
|
3375
|
-
config.social?.twitter && /* @__PURE__ */ (0,
|
|
3455
|
+
config.social?.twitter && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3376
3456
|
"a",
|
|
3377
3457
|
{
|
|
3378
3458
|
href: config.social.twitter,
|
|
@@ -3380,10 +3460,10 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
3380
3460
|
rel: "noopener noreferrer",
|
|
3381
3461
|
className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
|
|
3382
3462
|
"aria-label": "Twitter",
|
|
3383
|
-
children: /* @__PURE__ */ (0,
|
|
3463
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react19.Twitter, { className: "h-4 w-4" })
|
|
3384
3464
|
}
|
|
3385
3465
|
),
|
|
3386
|
-
config.social?.discord && /* @__PURE__ */ (0,
|
|
3466
|
+
config.social?.discord && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3387
3467
|
"a",
|
|
3388
3468
|
{
|
|
3389
3469
|
href: config.social.discord,
|
|
@@ -3391,26 +3471,27 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
3391
3471
|
rel: "noopener noreferrer",
|
|
3392
3472
|
className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
|
|
3393
3473
|
"aria-label": "Discord",
|
|
3394
|
-
children: /* @__PURE__ */ (0,
|
|
3474
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react19.MessageCircle, { className: "h-4 w-4" })
|
|
3395
3475
|
}
|
|
3396
3476
|
),
|
|
3397
|
-
/* @__PURE__ */ (0,
|
|
3477
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ThemeToggle, {}),
|
|
3478
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LanguageSwitcher, {})
|
|
3398
3479
|
] })
|
|
3399
3480
|
] }),
|
|
3400
|
-
/* @__PURE__ */ (0,
|
|
3481
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SearchModal, { isOpen: searchOpen, onClose: () => setSearchOpen(false), config })
|
|
3401
3482
|
] });
|
|
3402
3483
|
}
|
|
3403
3484
|
|
|
3404
3485
|
// src/components/docs/hot-reload-indicator.tsx
|
|
3405
|
-
var
|
|
3406
|
-
var
|
|
3407
|
-
var
|
|
3408
|
-
var
|
|
3486
|
+
var import_react14 = require("react");
|
|
3487
|
+
var import_navigation6 = require("next/navigation");
|
|
3488
|
+
var import_lucide_react20 = require("lucide-react");
|
|
3489
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3409
3490
|
function HotReloadIndicator() {
|
|
3410
|
-
const [isReloading, setIsReloading] = (0,
|
|
3411
|
-
const [lastReload, setLastReload] = (0,
|
|
3412
|
-
const pathname = (0,
|
|
3413
|
-
(0,
|
|
3491
|
+
const [isReloading, setIsReloading] = (0, import_react14.useState)(false);
|
|
3492
|
+
const [lastReload, setLastReload] = (0, import_react14.useState)(null);
|
|
3493
|
+
const pathname = (0, import_navigation6.usePathname)();
|
|
3494
|
+
(0, import_react14.useEffect)(() => {
|
|
3414
3495
|
if (process.env.NODE_ENV !== "development") return;
|
|
3415
3496
|
setIsReloading(true);
|
|
3416
3497
|
const timer = setTimeout(() => {
|
|
@@ -3422,7 +3503,7 @@ function HotReloadIndicator() {
|
|
|
3422
3503
|
}, 500);
|
|
3423
3504
|
return () => clearTimeout(timer);
|
|
3424
3505
|
}, [pathname]);
|
|
3425
|
-
(0,
|
|
3506
|
+
(0, import_react14.useEffect)(() => {
|
|
3426
3507
|
if (process.env.NODE_ENV !== "development") return;
|
|
3427
3508
|
const handleBeforeRefresh = () => {
|
|
3428
3509
|
setIsReloading(true);
|
|
@@ -3440,14 +3521,14 @@ function HotReloadIndicator() {
|
|
|
3440
3521
|
};
|
|
3441
3522
|
}, []);
|
|
3442
3523
|
if (process.env.NODE_ENV !== "development") return null;
|
|
3443
|
-
return /* @__PURE__ */ (0,
|
|
3444
|
-
isReloading && /* @__PURE__ */ (0,
|
|
3445
|
-
/* @__PURE__ */ (0,
|
|
3446
|
-
/* @__PURE__ */ (0,
|
|
3524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
3525
|
+
isReloading && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("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: [
|
|
3526
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react20.RefreshCw, { className: "h-4 w-4 animate-spin" }),
|
|
3527
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-sm font-medium", children: "Reloading..." })
|
|
3447
3528
|
] }),
|
|
3448
|
-
lastReload && !isReloading && /* @__PURE__ */ (0,
|
|
3449
|
-
/* @__PURE__ */ (0,
|
|
3450
|
-
/* @__PURE__ */ (0,
|
|
3529
|
+
lastReload && !isReloading && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("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: [
|
|
3530
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react20.RefreshCw, { className: "h-4 w-4" }),
|
|
3531
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "text-sm font-medium", children: [
|
|
3451
3532
|
"Updated at ",
|
|
3452
3533
|
lastReload.toLocaleTimeString()
|
|
3453
3534
|
] })
|
|
@@ -3458,7 +3539,7 @@ function HotReloadIndicator() {
|
|
|
3458
3539
|
// src/components/docs/image-card.tsx
|
|
3459
3540
|
var import_image = __toESM(require("next/image"));
|
|
3460
3541
|
var import_link8 = __toESM(require("next/link"));
|
|
3461
|
-
var
|
|
3542
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3462
3543
|
function ImageCard({
|
|
3463
3544
|
src,
|
|
3464
3545
|
alt,
|
|
@@ -3473,8 +3554,8 @@ function ImageCard({
|
|
|
3473
3554
|
video: "aspect-video",
|
|
3474
3555
|
portrait: "aspect-[3/4]"
|
|
3475
3556
|
};
|
|
3476
|
-
const content = /* @__PURE__ */ (0,
|
|
3477
|
-
/* @__PURE__ */ (0,
|
|
3557
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-0 p-0", children: [
|
|
3558
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `w-full ${aspectRatios[aspectRatio]} overflow-hidden ${title || description ? "rounded-t-xl" : "rounded-xl"} bg-muted relative`, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3478
3559
|
import_image.default,
|
|
3479
3560
|
{
|
|
3480
3561
|
src,
|
|
@@ -3484,14 +3565,14 @@ function ImageCard({
|
|
|
3484
3565
|
className: "object-cover transition-transform duration-300 group-hover:scale-105"
|
|
3485
3566
|
}
|
|
3486
3567
|
) }),
|
|
3487
|
-
(title || description) && /* @__PURE__ */ (0,
|
|
3488
|
-
title && /* @__PURE__ */ (0,
|
|
3489
|
-
description && /* @__PURE__ */ (0,
|
|
3568
|
+
(title || description) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "p-3 flex flex-col gap-1", children: [
|
|
3569
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h3", { className: `font-semibold text-foreground mb-0 no-underline ${href ? "group-hover:text-primary transition-colors" : ""}`, children: title }),
|
|
3570
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm text-muted-foreground line-clamp-2 no-underline mb-0", children: description })
|
|
3490
3571
|
] })
|
|
3491
3572
|
] });
|
|
3492
3573
|
if (href) {
|
|
3493
3574
|
const Component = external ? "a" : import_link8.default;
|
|
3494
|
-
return /* @__PURE__ */ (0,
|
|
3575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3495
3576
|
Component,
|
|
3496
3577
|
{
|
|
3497
3578
|
href,
|
|
@@ -3501,7 +3582,7 @@ function ImageCard({
|
|
|
3501
3582
|
}
|
|
3502
3583
|
);
|
|
3503
3584
|
}
|
|
3504
|
-
return /* @__PURE__ */ (0,
|
|
3585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "block rounded-xl border border-border overflow-hidden bg-card p-0", children: content });
|
|
3505
3586
|
}
|
|
3506
3587
|
function ImageCardGrid({ children, cols = 3 }) {
|
|
3507
3588
|
const gridCols = {
|
|
@@ -3510,20 +3591,20 @@ function ImageCardGrid({ children, cols = 3 }) {
|
|
|
3510
3591
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
|
|
3511
3592
|
4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
|
|
3512
3593
|
};
|
|
3513
|
-
return /* @__PURE__ */ (0,
|
|
3594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `grid ${gridCols[cols]} gap-4 my-6`, children });
|
|
3514
3595
|
}
|
|
3515
3596
|
|
|
3516
3597
|
// src/components/docs/image.tsx
|
|
3517
3598
|
var import_image2 = __toESM(require("next/image"));
|
|
3518
|
-
var
|
|
3519
|
-
var
|
|
3520
|
-
var
|
|
3599
|
+
var import_react15 = require("react");
|
|
3600
|
+
var import_lucide_react21 = require("lucide-react");
|
|
3601
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3521
3602
|
function Image({ src, alt, caption, width, height, zoom = true }) {
|
|
3522
|
-
const [isZoomed, setIsZoomed] = (0,
|
|
3523
|
-
return /* @__PURE__ */ (0,
|
|
3524
|
-
/* @__PURE__ */ (0,
|
|
3525
|
-
/* @__PURE__ */ (0,
|
|
3526
|
-
/* @__PURE__ */ (0,
|
|
3603
|
+
const [isZoomed, setIsZoomed] = (0, import_react15.useState)(false);
|
|
3604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
3605
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("figure", { className: "my-6", children: [
|
|
3606
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "relative group rounded-xl border border-border overflow-hidden bg-muted/30", children: [
|
|
3607
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3527
3608
|
import_image2.default,
|
|
3528
3609
|
{
|
|
3529
3610
|
src,
|
|
@@ -3533,34 +3614,34 @@ function Image({ src, alt, caption, width, height, zoom = true }) {
|
|
|
3533
3614
|
className: "w-full h-auto"
|
|
3534
3615
|
}
|
|
3535
3616
|
),
|
|
3536
|
-
zoom && /* @__PURE__ */ (0,
|
|
3617
|
+
zoom && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3537
3618
|
"button",
|
|
3538
3619
|
{
|
|
3539
3620
|
onClick: () => setIsZoomed(true),
|
|
3540
3621
|
className: "absolute top-3 right-3 p-2 rounded-md bg-background/80 backdrop-blur-sm border border-border opacity-0 group-hover:opacity-100 transition-opacity hover:bg-background",
|
|
3541
3622
|
"aria-label": "Zoom image",
|
|
3542
|
-
children: /* @__PURE__ */ (0,
|
|
3623
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react21.ZoomIn, { className: "h-4 w-4 text-foreground" })
|
|
3543
3624
|
}
|
|
3544
3625
|
)
|
|
3545
3626
|
] }),
|
|
3546
|
-
caption && /* @__PURE__ */ (0,
|
|
3627
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground italic", children: caption })
|
|
3547
3628
|
] }),
|
|
3548
|
-
isZoomed && /* @__PURE__ */ (0,
|
|
3629
|
+
isZoomed && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
3549
3630
|
"div",
|
|
3550
3631
|
{
|
|
3551
3632
|
className: "fixed inset-0 z-50 bg-background/95 backdrop-blur-sm flex items-center justify-center p-4",
|
|
3552
3633
|
onClick: () => setIsZoomed(false),
|
|
3553
3634
|
children: [
|
|
3554
|
-
/* @__PURE__ */ (0,
|
|
3635
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3555
3636
|
"button",
|
|
3556
3637
|
{
|
|
3557
3638
|
onClick: () => setIsZoomed(false),
|
|
3558
3639
|
className: "absolute top-4 right-4 p-2 rounded-md bg-muted hover:bg-muted/80 transition-colors",
|
|
3559
3640
|
"aria-label": "Close",
|
|
3560
|
-
children: /* @__PURE__ */ (0,
|
|
3641
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react21.X, { className: "h-5 w-5 text-foreground" })
|
|
3561
3642
|
}
|
|
3562
3643
|
),
|
|
3563
|
-
/* @__PURE__ */ (0,
|
|
3644
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "max-w-7xl max-h-[90vh] overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3564
3645
|
import_image2.default,
|
|
3565
3646
|
{
|
|
3566
3647
|
src,
|
|
@@ -3577,11 +3658,11 @@ function Image({ src, alt, caption, width, height, zoom = true }) {
|
|
|
3577
3658
|
}
|
|
3578
3659
|
|
|
3579
3660
|
// src/components/docs/math.tsx
|
|
3580
|
-
var
|
|
3581
|
-
var
|
|
3661
|
+
var import_react16 = require("react");
|
|
3662
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3582
3663
|
function Math2({ children, block = false }) {
|
|
3583
|
-
const containerRef = (0,
|
|
3584
|
-
(0,
|
|
3664
|
+
const containerRef = (0, import_react16.useRef)(null);
|
|
3665
|
+
(0, import_react16.useEffect)(() => {
|
|
3585
3666
|
const renderMath = async () => {
|
|
3586
3667
|
try {
|
|
3587
3668
|
const katex = (await import("katex")).default;
|
|
@@ -3601,7 +3682,7 @@ function Math2({ children, block = false }) {
|
|
|
3601
3682
|
renderMath();
|
|
3602
3683
|
}, [children, block]);
|
|
3603
3684
|
if (block) {
|
|
3604
|
-
return /* @__PURE__ */ (0,
|
|
3685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3605
3686
|
"div",
|
|
3606
3687
|
{
|
|
3607
3688
|
ref: containerRef,
|
|
@@ -3609,15 +3690,15 @@ function Math2({ children, block = false }) {
|
|
|
3609
3690
|
}
|
|
3610
3691
|
);
|
|
3611
3692
|
}
|
|
3612
|
-
return /* @__PURE__ */ (0,
|
|
3693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { ref: containerRef, className: "inline-block" });
|
|
3613
3694
|
}
|
|
3614
3695
|
|
|
3615
3696
|
// src/components/docs/mdx-hot-reload.tsx
|
|
3616
|
-
var
|
|
3617
|
-
var
|
|
3697
|
+
var import_react17 = require("react");
|
|
3698
|
+
var import_navigation7 = require("next/navigation");
|
|
3618
3699
|
function MdxHotReload() {
|
|
3619
|
-
const router = (0,
|
|
3620
|
-
(0,
|
|
3700
|
+
const router = (0, import_navigation7.useRouter)();
|
|
3701
|
+
(0, import_react17.useEffect)(() => {
|
|
3621
3702
|
if (process.env.NODE_ENV !== "development") return;
|
|
3622
3703
|
const eventSource = new EventSource("/api/mdx-watch");
|
|
3623
3704
|
eventSource.onmessage = (event) => {
|
|
@@ -3641,12 +3722,12 @@ function MdxHotReload() {
|
|
|
3641
3722
|
}
|
|
3642
3723
|
|
|
3643
3724
|
// src/components/docs/mermaid.tsx
|
|
3644
|
-
var
|
|
3645
|
-
var
|
|
3725
|
+
var import_react18 = require("react");
|
|
3726
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3646
3727
|
function Mermaid({ chart, caption }) {
|
|
3647
|
-
const containerRef = (0,
|
|
3648
|
-
const [error, setError] = (0,
|
|
3649
|
-
(0,
|
|
3728
|
+
const containerRef = (0, import_react18.useRef)(null);
|
|
3729
|
+
const [error, setError] = (0, import_react18.useState)(null);
|
|
3730
|
+
(0, import_react18.useEffect)(() => {
|
|
3650
3731
|
const renderChart = async () => {
|
|
3651
3732
|
try {
|
|
3652
3733
|
const mermaid = (await import("mermaid")).default;
|
|
@@ -3678,75 +3759,75 @@ function Mermaid({ chart, caption }) {
|
|
|
3678
3759
|
return () => observer.disconnect();
|
|
3679
3760
|
}, [chart]);
|
|
3680
3761
|
if (error) {
|
|
3681
|
-
return /* @__PURE__ */ (0,
|
|
3762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "my-6 p-4 rounded-xl border border-red-500/50 bg-red-500/10", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { className: "text-sm text-red-600 dark:text-red-400 font-mono", children: [
|
|
3682
3763
|
"Mermaid Error: ",
|
|
3683
3764
|
error
|
|
3684
3765
|
] }) });
|
|
3685
3766
|
}
|
|
3686
|
-
return /* @__PURE__ */ (0,
|
|
3687
|
-
/* @__PURE__ */ (0,
|
|
3767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("figure", { className: "my-6", children: [
|
|
3768
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3688
3769
|
"div",
|
|
3689
3770
|
{
|
|
3690
3771
|
ref: containerRef,
|
|
3691
3772
|
className: "flex justify-center items-center p-6 rounded-xl border border-border bg-muted/30 overflow-x-auto"
|
|
3692
3773
|
}
|
|
3693
3774
|
),
|
|
3694
|
-
caption && /* @__PURE__ */ (0,
|
|
3775
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground italic", children: caption })
|
|
3695
3776
|
] });
|
|
3696
3777
|
}
|
|
3697
3778
|
|
|
3698
3779
|
// src/components/docs/not-found-content.tsx
|
|
3699
3780
|
var import_link9 = __toESM(require("next/link"));
|
|
3700
|
-
var
|
|
3701
|
-
var
|
|
3781
|
+
var import_lucide_react22 = require("lucide-react");
|
|
3782
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3702
3783
|
function NotFoundContent({ version }) {
|
|
3703
|
-
return /* @__PURE__ */ (0,
|
|
3704
|
-
/* @__PURE__ */ (0,
|
|
3705
|
-
/* @__PURE__ */ (0,
|
|
3706
|
-
/* @__PURE__ */ (0,
|
|
3707
|
-
/* @__PURE__ */ (0,
|
|
3784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex min-h-[calc(100vh-12rem)] items-center justify-center px-4 py-12", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "w-full max-w-2xl text-center", children: [
|
|
3785
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "rounded-full bg-yellow-500/10 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react22.AlertTriangle, { className: "h-16 w-16 text-yellow-500" }) }) }),
|
|
3786
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("h1", { className: "mb-3 text-5xl font-bold tracking-tight", children: "404" }),
|
|
3787
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("h2", { className: "mb-4 text-2xl font-semibold", children: "Page Not Found" }),
|
|
3788
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: "mb-8 text-base text-muted-foreground", children: [
|
|
3708
3789
|
"The documentation page you're looking for doesn't exist or may have been moved.",
|
|
3709
|
-
/* @__PURE__ */ (0,
|
|
3790
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("br", {}),
|
|
3710
3791
|
"Try using the sidebar to find what you're looking for, or return to the documentation home."
|
|
3711
3792
|
] }),
|
|
3712
|
-
/* @__PURE__ */ (0,
|
|
3713
|
-
/* @__PURE__ */ (0,
|
|
3793
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col items-center justify-center gap-3 sm:flex-row", children: [
|
|
3794
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3714
3795
|
import_link9.default,
|
|
3715
3796
|
{
|
|
3716
3797
|
href: `/docs/${version}`,
|
|
3717
3798
|
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",
|
|
3718
3799
|
children: [
|
|
3719
|
-
/* @__PURE__ */ (0,
|
|
3800
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react22.ArrowLeft, { className: "h-4 w-4" }),
|
|
3720
3801
|
"Back to Documentation"
|
|
3721
3802
|
]
|
|
3722
3803
|
}
|
|
3723
3804
|
),
|
|
3724
|
-
/* @__PURE__ */ (0,
|
|
3805
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3725
3806
|
import_link9.default,
|
|
3726
3807
|
{
|
|
3727
3808
|
href: "/",
|
|
3728
3809
|
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",
|
|
3729
3810
|
children: [
|
|
3730
|
-
/* @__PURE__ */ (0,
|
|
3811
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react22.Home, { className: "h-4 w-4" }),
|
|
3731
3812
|
"Go to Homepage"
|
|
3732
3813
|
]
|
|
3733
3814
|
}
|
|
3734
3815
|
)
|
|
3735
3816
|
] }),
|
|
3736
|
-
/* @__PURE__ */ (0,
|
|
3737
|
-
/* @__PURE__ */ (0,
|
|
3817
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "mt-12 rounded-lg border border-border bg-muted/30 p-6", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: "text-sm text-muted-foreground", children: [
|
|
3818
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("strong", { className: "font-medium text-foreground", children: "Tip:" }),
|
|
3738
3819
|
" Use the sidebar navigation on the left to browse all available documentation pages."
|
|
3739
3820
|
] }) })
|
|
3740
3821
|
] }) });
|
|
3741
3822
|
}
|
|
3742
3823
|
|
|
3743
3824
|
// src/components/docs/search-highlight.tsx
|
|
3744
|
-
var
|
|
3745
|
-
var
|
|
3825
|
+
var import_react19 = require("react");
|
|
3826
|
+
var import_navigation8 = require("next/navigation");
|
|
3746
3827
|
function SearchHighlight() {
|
|
3747
|
-
const searchParams = (0,
|
|
3828
|
+
const searchParams = (0, import_navigation8.useSearchParams)();
|
|
3748
3829
|
const query = searchParams.get("q");
|
|
3749
|
-
(0,
|
|
3830
|
+
(0, import_react19.useEffect)(() => {
|
|
3750
3831
|
if (!query) {
|
|
3751
3832
|
document.querySelectorAll("mark.search-highlight").forEach((mark) => {
|
|
3752
3833
|
const parent = mark.parentNode;
|
|
@@ -3840,20 +3921,20 @@ function escapeRegex(string) {
|
|
|
3840
3921
|
}
|
|
3841
3922
|
|
|
3842
3923
|
// src/components/docs/sidebar-skeleton.tsx
|
|
3843
|
-
var
|
|
3924
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3844
3925
|
function SidebarSkeleton() {
|
|
3845
|
-
return /* @__PURE__ */ (0,
|
|
3846
|
-
/* @__PURE__ */ (0,
|
|
3847
|
-
/* @__PURE__ */ (0,
|
|
3926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("aside", { className: "w-64 pr-8 py-6", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "space-y-6", children: [
|
|
3927
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "px-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-5 w-32 bg-muted/50 rounded animate-pulse" }) }),
|
|
3928
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-1", children: [...Array(8)].map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3848
3929
|
"div",
|
|
3849
3930
|
{
|
|
3850
3931
|
className: "h-4 bg-muted/50 rounded animate-pulse",
|
|
3851
3932
|
style: { width: `${60 + Math.random() * 40}%` }
|
|
3852
3933
|
}
|
|
3853
3934
|
) }, i)) }),
|
|
3854
|
-
/* @__PURE__ */ (0,
|
|
3855
|
-
/* @__PURE__ */ (0,
|
|
3856
|
-
[...Array(5)].map((_, i) => /* @__PURE__ */ (0,
|
|
3935
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "space-y-1", children: [
|
|
3936
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "px-2 mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-4 w-24 bg-muted/50 rounded animate-pulse" }) }),
|
|
3937
|
+
[...Array(5)].map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3857
3938
|
"div",
|
|
3858
3939
|
{
|
|
3859
3940
|
className: "h-4 bg-muted/50 rounded animate-pulse",
|
|
@@ -3865,29 +3946,29 @@ function SidebarSkeleton() {
|
|
|
3865
3946
|
}
|
|
3866
3947
|
|
|
3867
3948
|
// src/components/docs/steps.tsx
|
|
3868
|
-
var
|
|
3949
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3869
3950
|
function Steps({ children }) {
|
|
3870
|
-
return /* @__PURE__ */ (0,
|
|
3951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "my-6 ml-4 space-y-6 [counter-reset:step]", children });
|
|
3871
3952
|
}
|
|
3872
3953
|
function Step({ title, children }) {
|
|
3873
|
-
return /* @__PURE__ */ (0,
|
|
3874
|
-
/* @__PURE__ */ (0,
|
|
3875
|
-
/* @__PURE__ */ (0,
|
|
3954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "relative pl-8 pb-6 border-l-2 border-border last:border-l-0 last:pb-0 [counter-increment:step] before:content-[counter(step)] before:absolute before:left-0 before:-translate-x-1/2 before:w-8 before:h-8 before:rounded-full before:bg-primary before:text-primary-foreground before:flex before:items-center before:justify-center before:text-sm before:font-semibold before:z-10", children: [
|
|
3955
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h3", { className: "text-lg font-semibold text-foreground", children: title }) }),
|
|
3956
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "prose prose-sm dark:prose-invert max-w-none [&>*:last-child]:mb-0", children })
|
|
3876
3957
|
] });
|
|
3877
3958
|
}
|
|
3878
3959
|
|
|
3879
3960
|
// src/components/docs/table-of-contents.tsx
|
|
3880
|
-
var
|
|
3881
|
-
var
|
|
3961
|
+
var import_react20 = require("react");
|
|
3962
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3882
3963
|
function TableOfContents({ items, config }) {
|
|
3883
|
-
const [activeId, setActiveId] = (0,
|
|
3964
|
+
const [activeId, setActiveId] = (0, import_react20.useState)("");
|
|
3884
3965
|
if (!config.navigation?.showTableOfContents) {
|
|
3885
3966
|
return null;
|
|
3886
3967
|
}
|
|
3887
3968
|
const maxDepth = config.navigation?.tocMaxDepth || 3;
|
|
3888
3969
|
const filteredItems = items.filter((item) => item.level <= maxDepth);
|
|
3889
3970
|
const hasTabGroups = config.navigation?.tabGroups && config.navigation.tabGroups.length > 0;
|
|
3890
|
-
(0,
|
|
3971
|
+
(0, import_react20.useEffect)(() => {
|
|
3891
3972
|
const observer = new IntersectionObserver(
|
|
3892
3973
|
(entries) => {
|
|
3893
3974
|
entries.forEach((entry) => {
|
|
@@ -3923,9 +4004,9 @@ function TableOfContents({ items, config }) {
|
|
|
3923
4004
|
};
|
|
3924
4005
|
const stickyTop = hasTabGroups ? "top-[7.5rem]" : "top-24";
|
|
3925
4006
|
const maxHeight = hasTabGroups ? "max-h-[calc(100vh-10rem)]" : "max-h-[calc(100vh-7rem)]";
|
|
3926
|
-
return /* @__PURE__ */ (0,
|
|
3927
|
-
/* @__PURE__ */ (0,
|
|
3928
|
-
/* @__PURE__ */ (0,
|
|
4007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("aside", { className: `w-64 hidden xl:block shrink-0 sticky ${stickyTop} self-start`, children: filteredItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: `${maxHeight} overflow-y-auto bg-muted/30 dark:bg-muted/10 rounded-2xl p-4 border border-border/50`, children: [
|
|
4008
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h3", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-4 px-2", children: "On this page" }),
|
|
4009
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("nav", { className: "space-y-1", children: filteredItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3929
4010
|
"a",
|
|
3930
4011
|
{
|
|
3931
4012
|
href: `#${item.id}`,
|
|
@@ -3939,20 +4020,20 @@ function TableOfContents({ items, config }) {
|
|
|
3939
4020
|
}
|
|
3940
4021
|
|
|
3941
4022
|
// src/components/docs/tabs.tsx
|
|
3942
|
-
var
|
|
3943
|
-
var
|
|
4023
|
+
var import_react21 = require("react");
|
|
4024
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3944
4025
|
function Tab({ children }) {
|
|
3945
|
-
return /* @__PURE__ */ (0,
|
|
4026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children });
|
|
3946
4027
|
}
|
|
3947
4028
|
function Tabs({ children, defaultValue }) {
|
|
3948
|
-
const tabs =
|
|
4029
|
+
const tabs = import_react21.Children.toArray(children).filter(import_react21.isValidElement);
|
|
3949
4030
|
const firstTabLabel = tabs[0]?.props.label || "";
|
|
3950
|
-
const [activeTab, setActiveTab] = (0,
|
|
3951
|
-
return /* @__PURE__ */ (0,
|
|
3952
|
-
/* @__PURE__ */ (0,
|
|
4031
|
+
const [activeTab, setActiveTab] = (0, import_react21.useState)(defaultValue || firstTabLabel);
|
|
4032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "my-6", children: [
|
|
4033
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex items-center gap-1 border-b border-border mb-4", children: tabs.map((tab) => {
|
|
3953
4034
|
const label = tab.props.label;
|
|
3954
4035
|
const isActive = activeTab === label;
|
|
3955
|
-
return /* @__PURE__ */ (0,
|
|
4036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3956
4037
|
"button",
|
|
3957
4038
|
{
|
|
3958
4039
|
onClick: () => setActiveTab(label),
|
|
@@ -3965,23 +4046,23 @@ function Tabs({ children, defaultValue }) {
|
|
|
3965
4046
|
tabs.map((tab) => {
|
|
3966
4047
|
const label = tab.props.label;
|
|
3967
4048
|
if (activeTab !== label) return null;
|
|
3968
|
-
return /* @__PURE__ */ (0,
|
|
4049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "prose prose-slate dark:prose-invert max-w-none [&>*:first-child]:mt-0", children: tab.props.children }, label);
|
|
3969
4050
|
})
|
|
3970
4051
|
] });
|
|
3971
4052
|
}
|
|
3972
4053
|
|
|
3973
4054
|
// src/components/docs/tooltip.tsx
|
|
3974
|
-
var
|
|
3975
|
-
var
|
|
4055
|
+
var import_react22 = require("react");
|
|
4056
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3976
4057
|
function Tooltip({ children, content, position = "top" }) {
|
|
3977
|
-
const [isVisible, setIsVisible] = (0,
|
|
4058
|
+
const [isVisible, setIsVisible] = (0, import_react22.useState)(false);
|
|
3978
4059
|
const positions = {
|
|
3979
4060
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
3980
4061
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
3981
4062
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
3982
4063
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
3983
4064
|
};
|
|
3984
|
-
return /* @__PURE__ */ (0,
|
|
4065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3985
4066
|
"span",
|
|
3986
4067
|
{
|
|
3987
4068
|
className: "relative inline-flex underline decoration-dotted cursor-help",
|
|
@@ -3989,7 +4070,7 @@ function Tooltip({ children, content, position = "top" }) {
|
|
|
3989
4070
|
onMouseLeave: () => setIsVisible(false),
|
|
3990
4071
|
children: [
|
|
3991
4072
|
children,
|
|
3992
|
-
isVisible && /* @__PURE__ */ (0,
|
|
4073
|
+
isVisible && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3993
4074
|
"span",
|
|
3994
4075
|
{
|
|
3995
4076
|
className: `absolute ${positions[position]} z-50 px-2 py-1 text-xs text-white bg-gray-900 dark:bg-gray-700 rounded whitespace-nowrap pointer-events-none`,
|
|
@@ -4002,7 +4083,7 @@ function Tooltip({ children, content, position = "top" }) {
|
|
|
4002
4083
|
}
|
|
4003
4084
|
|
|
4004
4085
|
// src/components/docs/video.tsx
|
|
4005
|
-
var
|
|
4086
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4006
4087
|
function Video({
|
|
4007
4088
|
src,
|
|
4008
4089
|
caption,
|
|
@@ -4022,8 +4103,8 @@ function Video({
|
|
|
4022
4103
|
const match = url.match(/vimeo\.com\/(\d+)/);
|
|
4023
4104
|
return match ? match[1] : null;
|
|
4024
4105
|
};
|
|
4025
|
-
return /* @__PURE__ */ (0,
|
|
4026
|
-
/* @__PURE__ */ (0,
|
|
4106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("figure", { className: "my-6", children: [
|
|
4107
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "relative rounded-xl border border-border overflow-hidden bg-muted/30", children: isYouTube ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "relative w-full", style: { paddingBottom: "56.25%" }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4027
4108
|
"iframe",
|
|
4028
4109
|
{
|
|
4029
4110
|
className: "absolute top-0 left-0 w-full h-full",
|
|
@@ -4032,7 +4113,7 @@ function Video({
|
|
|
4032
4113
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
4033
4114
|
allowFullScreen: true
|
|
4034
4115
|
}
|
|
4035
|
-
) }) : isVimeo ? /* @__PURE__ */ (0,
|
|
4116
|
+
) }) : isVimeo ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "relative w-full", style: { paddingBottom: "56.25%" }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4036
4117
|
"iframe",
|
|
4037
4118
|
{
|
|
4038
4119
|
className: "absolute top-0 left-0 w-full h-full",
|
|
@@ -4041,7 +4122,7 @@ function Video({
|
|
|
4041
4122
|
allow: "autoplay; fullscreen; picture-in-picture",
|
|
4042
4123
|
allowFullScreen: true
|
|
4043
4124
|
}
|
|
4044
|
-
) }) : /* @__PURE__ */ (0,
|
|
4125
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4045
4126
|
"video",
|
|
4046
4127
|
{
|
|
4047
4128
|
src,
|
|
@@ -4054,14 +4135,14 @@ function Video({
|
|
|
4054
4135
|
children: "Your browser does not support the video tag."
|
|
4055
4136
|
}
|
|
4056
4137
|
) }),
|
|
4057
|
-
caption && /* @__PURE__ */ (0,
|
|
4138
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground italic", children: caption })
|
|
4058
4139
|
] });
|
|
4059
4140
|
}
|
|
4060
4141
|
|
|
4061
4142
|
// src/components/docs/api/api-endpoint.tsx
|
|
4062
|
-
var
|
|
4063
|
-
var
|
|
4064
|
-
var
|
|
4143
|
+
var import_react23 = require("react");
|
|
4144
|
+
var import_lucide_react23 = require("lucide-react");
|
|
4145
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4065
4146
|
var methodColors = {
|
|
4066
4147
|
GET: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
|
|
4067
4148
|
POST: "bg-green-500/10 text-green-600 dark:text-green-400",
|
|
@@ -4070,15 +4151,15 @@ var methodColors = {
|
|
|
4070
4151
|
DELETE: "bg-red-500/10 text-red-600 dark:text-red-400"
|
|
4071
4152
|
};
|
|
4072
4153
|
function ApiEndpoint({ method, path: path4, summary, children, defaultOpen = false }) {
|
|
4073
|
-
const [isOpen, setIsOpen] = (0,
|
|
4074
|
-
return /* @__PURE__ */ (0,
|
|
4075
|
-
/* @__PURE__ */ (0,
|
|
4154
|
+
const [isOpen, setIsOpen] = (0, import_react23.useState)(defaultOpen);
|
|
4155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "not-prose mb-4 rounded-xl border border-border overflow-hidden", children: [
|
|
4156
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
4076
4157
|
"button",
|
|
4077
4158
|
{
|
|
4078
4159
|
onClick: () => setIsOpen(!isOpen),
|
|
4079
4160
|
className: "w-full flex items-center gap-3 px-4 py-3 text-left bg-muted/30 hover:bg-muted/50 transition-colors",
|
|
4080
4161
|
children: [
|
|
4081
|
-
/* @__PURE__ */ (0,
|
|
4162
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4082
4163
|
"span",
|
|
4083
4164
|
{
|
|
4084
4165
|
className: cn(
|
|
@@ -4088,10 +4169,10 @@ function ApiEndpoint({ method, path: path4, summary, children, defaultOpen = fal
|
|
|
4088
4169
|
children: method
|
|
4089
4170
|
}
|
|
4090
4171
|
),
|
|
4091
|
-
/* @__PURE__ */ (0,
|
|
4092
|
-
summary && /* @__PURE__ */ (0,
|
|
4093
|
-
/* @__PURE__ */ (0,
|
|
4094
|
-
|
|
4172
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("code", { className: "text-sm font-mono", children: path4 }),
|
|
4173
|
+
summary && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-sm text-muted-foreground ml-auto mr-2", children: summary }),
|
|
4174
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4175
|
+
import_lucide_react23.ChevronDown,
|
|
4095
4176
|
{
|
|
4096
4177
|
className: cn(
|
|
4097
4178
|
"h-5 w-5 text-muted-foreground transition-transform flex-shrink-0",
|
|
@@ -4102,34 +4183,34 @@ function ApiEndpoint({ method, path: path4, summary, children, defaultOpen = fal
|
|
|
4102
4183
|
]
|
|
4103
4184
|
}
|
|
4104
4185
|
),
|
|
4105
|
-
isOpen && children && /* @__PURE__ */ (0,
|
|
4186
|
+
isOpen && children && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "border-t border-border bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "px-4 py-4 space-y-6", children }) })
|
|
4106
4187
|
] });
|
|
4107
4188
|
}
|
|
4108
4189
|
|
|
4109
4190
|
// src/components/docs/api/api-params.tsx
|
|
4110
|
-
var
|
|
4191
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4111
4192
|
function ApiParams({ title = "Parameters", params }) {
|
|
4112
4193
|
if (!params || params.length === 0) return null;
|
|
4113
|
-
return /* @__PURE__ */ (0,
|
|
4114
|
-
/* @__PURE__ */ (0,
|
|
4115
|
-
/* @__PURE__ */ (0,
|
|
4116
|
-
/* @__PURE__ */ (0,
|
|
4117
|
-
/* @__PURE__ */ (0,
|
|
4118
|
-
/* @__PURE__ */ (0,
|
|
4119
|
-
/* @__PURE__ */ (0,
|
|
4120
|
-
/* @__PURE__ */ (0,
|
|
4121
|
-
/* @__PURE__ */ (0,
|
|
4194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "mb-6", children: [
|
|
4195
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: title }),
|
|
4196
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("table", { className: "w-full border-collapse", children: [
|
|
4197
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("tr", { className: "border-b border-border", children: [
|
|
4198
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("th", { className: "text-left py-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: "Property" }),
|
|
4199
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("th", { className: "text-left py-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: "Type" }),
|
|
4200
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("th", { className: "text-left py-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: "Required" }),
|
|
4201
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("th", { className: "text-left py-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: "Default" }),
|
|
4202
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("th", { className: "text-left py-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: "Description" })
|
|
4122
4203
|
] }) }),
|
|
4123
|
-
/* @__PURE__ */ (0,
|
|
4204
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("tbody", { children: params.map((param, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
4124
4205
|
"tr",
|
|
4125
4206
|
{
|
|
4126
4207
|
className: index !== params.length - 1 ? "border-b border-border/50" : "",
|
|
4127
4208
|
children: [
|
|
4128
|
-
/* @__PURE__ */ (0,
|
|
4129
|
-
/* @__PURE__ */ (0,
|
|
4130
|
-
/* @__PURE__ */ (0,
|
|
4131
|
-
/* @__PURE__ */ (0,
|
|
4132
|
-
/* @__PURE__ */ (0,
|
|
4209
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("td", { className: "py-2.5 px-3", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("code", { className: "text-sm font-mono text-foreground", children: param.name }) }),
|
|
4210
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("td", { className: "py-2.5 px-3", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm text-muted-foreground font-mono", children: param.type }) }),
|
|
4211
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("td", { className: "py-2.5 px-3", children: param.required ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm text-red-600 dark:text-red-400", children: "Yes" }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm text-muted-foreground", children: "No" }) }),
|
|
4212
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("td", { className: "py-2.5 px-3", children: param.default ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("code", { className: "text-sm font-mono text-muted-foreground", children: param.default }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm text-muted-foreground", children: "-" }) }),
|
|
4213
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("td", { className: "py-2.5 px-3", children: param.description ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm text-muted-foreground", children: param.description }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm text-muted-foreground", children: "-" }) })
|
|
4133
4214
|
]
|
|
4134
4215
|
},
|
|
4135
4216
|
param.name
|
|
@@ -4139,7 +4220,7 @@ function ApiParams({ title = "Parameters", params }) {
|
|
|
4139
4220
|
}
|
|
4140
4221
|
|
|
4141
4222
|
// src/components/docs/api/api-response.tsx
|
|
4142
|
-
var
|
|
4223
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4143
4224
|
var statusColors = {
|
|
4144
4225
|
"2": "text-green-600 dark:text-green-400",
|
|
4145
4226
|
"3": "text-blue-600 dark:text-blue-400",
|
|
@@ -4148,14 +4229,14 @@ var statusColors = {
|
|
|
4148
4229
|
};
|
|
4149
4230
|
function ApiResponse({ status, description, example, schema }) {
|
|
4150
4231
|
const statusClass = statusColors[String(status)[0]] || "text-muted-foreground";
|
|
4151
|
-
return /* @__PURE__ */ (0,
|
|
4152
|
-
/* @__PURE__ */ (0,
|
|
4153
|
-
/* @__PURE__ */ (0,
|
|
4154
|
-
description && /* @__PURE__ */ (0,
|
|
4232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "mb-4", children: [
|
|
4233
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
4234
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: `text-sm font-semibold ${statusClass}`, children: status }),
|
|
4235
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm text-muted-foreground", children: description })
|
|
4155
4236
|
] }),
|
|
4156
|
-
example && /* @__PURE__ */ (0,
|
|
4157
|
-
/* @__PURE__ */ (0,
|
|
4158
|
-
/* @__PURE__ */ (0,
|
|
4237
|
+
example && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "mb-3", children: [
|
|
4238
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: "Example Response" }),
|
|
4239
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4159
4240
|
CodeBlock,
|
|
4160
4241
|
{
|
|
4161
4242
|
code: typeof example === "string" ? example : JSON.stringify(example, null, 2),
|
|
@@ -4163,9 +4244,9 @@ function ApiResponse({ status, description, example, schema }) {
|
|
|
4163
4244
|
}
|
|
4164
4245
|
)
|
|
4165
4246
|
] }),
|
|
4166
|
-
schema && /* @__PURE__ */ (0,
|
|
4167
|
-
/* @__PURE__ */ (0,
|
|
4168
|
-
/* @__PURE__ */ (0,
|
|
4247
|
+
schema && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
|
|
4248
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: "Schema" }),
|
|
4249
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4169
4250
|
CodeBlock,
|
|
4170
4251
|
{
|
|
4171
4252
|
code: typeof schema === "string" ? schema : JSON.stringify(schema, null, 2),
|
|
@@ -4177,12 +4258,12 @@ function ApiResponse({ status, description, example, schema }) {
|
|
|
4177
4258
|
}
|
|
4178
4259
|
|
|
4179
4260
|
// src/components/docs/api/api-playground.tsx
|
|
4180
|
-
var
|
|
4261
|
+
var import_react24 = require("react");
|
|
4181
4262
|
|
|
4182
4263
|
// src/components/ui/button.tsx
|
|
4183
4264
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
4184
4265
|
var import_class_variance_authority = require("class-variance-authority");
|
|
4185
|
-
var
|
|
4266
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4186
4267
|
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
4187
4268
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
4188
4269
|
{
|
|
@@ -4218,7 +4299,7 @@ function Button({
|
|
|
4218
4299
|
...props
|
|
4219
4300
|
}) {
|
|
4220
4301
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
4221
|
-
return /* @__PURE__ */ (0,
|
|
4302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4222
4303
|
Comp,
|
|
4223
4304
|
{
|
|
4224
4305
|
"data-slot": "button",
|
|
@@ -4229,9 +4310,9 @@ function Button({
|
|
|
4229
4310
|
}
|
|
4230
4311
|
|
|
4231
4312
|
// src/components/ui/input.tsx
|
|
4232
|
-
var
|
|
4313
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4233
4314
|
function Input({ className, type, ...props }) {
|
|
4234
|
-
return /* @__PURE__ */ (0,
|
|
4315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4235
4316
|
"input",
|
|
4236
4317
|
{
|
|
4237
4318
|
type,
|
|
@@ -4248,9 +4329,9 @@ function Input({ className, type, ...props }) {
|
|
|
4248
4329
|
}
|
|
4249
4330
|
|
|
4250
4331
|
// src/components/ui/textarea.tsx
|
|
4251
|
-
var
|
|
4332
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4252
4333
|
function Textarea({ className, ...props }) {
|
|
4253
|
-
return /* @__PURE__ */ (0,
|
|
4334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4254
4335
|
"textarea",
|
|
4255
4336
|
{
|
|
4256
4337
|
"data-slot": "textarea",
|
|
@@ -4266,7 +4347,7 @@ function Textarea({ className, ...props }) {
|
|
|
4266
4347
|
// src/components/ui/badge.tsx
|
|
4267
4348
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
4268
4349
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
4269
|
-
var
|
|
4350
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4270
4351
|
var badgeVariants = (0, import_class_variance_authority2.cva)(
|
|
4271
4352
|
"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
4272
4353
|
{
|
|
@@ -4290,7 +4371,7 @@ function Badge2({
|
|
|
4290
4371
|
...props
|
|
4291
4372
|
}) {
|
|
4292
4373
|
const Comp = asChild ? import_react_slot2.Slot : "span";
|
|
4293
|
-
return /* @__PURE__ */ (0,
|
|
4374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4294
4375
|
Comp,
|
|
4295
4376
|
{
|
|
4296
4377
|
"data-slot": "badge",
|
|
@@ -4301,8 +4382,8 @@ function Badge2({
|
|
|
4301
4382
|
}
|
|
4302
4383
|
|
|
4303
4384
|
// src/components/docs/api/api-playground.tsx
|
|
4304
|
-
var
|
|
4305
|
-
var
|
|
4385
|
+
var import_lucide_react24 = require("lucide-react");
|
|
4386
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4306
4387
|
function ApiPlayground({
|
|
4307
4388
|
method,
|
|
4308
4389
|
path: path4,
|
|
@@ -4311,19 +4392,19 @@ function ApiPlayground({
|
|
|
4311
4392
|
defaultBody,
|
|
4312
4393
|
pathParams = []
|
|
4313
4394
|
}) {
|
|
4314
|
-
const [loading, setLoading] = (0,
|
|
4315
|
-
const [response, setResponse] = (0,
|
|
4316
|
-
const [error, setError] = (0,
|
|
4317
|
-
const [requestBody, setRequestBody] = (0,
|
|
4318
|
-
const initialHeaders = (0,
|
|
4395
|
+
const [loading, setLoading] = (0, import_react24.useState)(false);
|
|
4396
|
+
const [response, setResponse] = (0, import_react24.useState)(null);
|
|
4397
|
+
const [error, setError] = (0, import_react24.useState)(null);
|
|
4398
|
+
const [requestBody, setRequestBody] = (0, import_react24.useState)(defaultBody || "");
|
|
4399
|
+
const initialHeaders = (0, import_react24.useMemo)(() => {
|
|
4319
4400
|
const cleanHeaders = {};
|
|
4320
4401
|
Object.entries(headers).forEach(([key, value]) => {
|
|
4321
4402
|
cleanHeaders[key] = value || "";
|
|
4322
4403
|
});
|
|
4323
4404
|
return cleanHeaders;
|
|
4324
4405
|
}, [headers]);
|
|
4325
|
-
const [requestHeaders, setRequestHeaders] = (0,
|
|
4326
|
-
const extractedParams = (0,
|
|
4406
|
+
const [requestHeaders, setRequestHeaders] = (0, import_react24.useState)(JSON.stringify(initialHeaders, null, 2));
|
|
4407
|
+
const extractedParams = (0, import_react24.useMemo)(() => {
|
|
4327
4408
|
const params = {};
|
|
4328
4409
|
const pathParamPattern = /:(\w+)/g;
|
|
4329
4410
|
let match;
|
|
@@ -4340,7 +4421,7 @@ function ApiPlayground({
|
|
|
4340
4421
|
}
|
|
4341
4422
|
return params;
|
|
4342
4423
|
}, [path4, pathParams]);
|
|
4343
|
-
const [pathParamValues, setPathParamValues] = (0,
|
|
4424
|
+
const [pathParamValues, setPathParamValues] = (0, import_react24.useState)(extractedParams);
|
|
4344
4425
|
const buildUrl = () => {
|
|
4345
4426
|
let finalPath = path4;
|
|
4346
4427
|
Object.entries(pathParamValues).forEach(([key, value]) => {
|
|
@@ -4379,19 +4460,19 @@ function ApiPlayground({
|
|
|
4379
4460
|
setLoading(false);
|
|
4380
4461
|
}
|
|
4381
4462
|
};
|
|
4382
|
-
return /* @__PURE__ */ (0,
|
|
4383
|
-
/* @__PURE__ */ (0,
|
|
4384
|
-
/* @__PURE__ */ (0,
|
|
4385
|
-
Object.keys(pathParamValues).length > 0 && /* @__PURE__ */ (0,
|
|
4386
|
-
/* @__PURE__ */ (0,
|
|
4387
|
-
/* @__PURE__ */ (0,
|
|
4463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "not-prose border border-border rounded-lg overflow-hidden bg-card/30", children: [
|
|
4464
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "bg-muted/50 px-4 py-2 border-b border-border", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h4", { className: "text-sm font-semibold text-foreground", children: "API Playground" }) }),
|
|
4465
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "p-4 space-y-4", children: [
|
|
4466
|
+
Object.keys(pathParamValues).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
|
|
4467
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Path Parameters" }),
|
|
4468
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "space-y-2", children: Object.entries(pathParamValues).map(([paramName, paramValue]) => {
|
|
4388
4469
|
const paramConfig = pathParams.find((p) => p.name === paramName);
|
|
4389
|
-
return /* @__PURE__ */ (0,
|
|
4390
|
-
/* @__PURE__ */ (0,
|
|
4470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4471
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { className: "text-xs text-muted-foreground min-w-[80px]", children: [
|
|
4391
4472
|
":",
|
|
4392
4473
|
paramName
|
|
4393
4474
|
] }),
|
|
4394
|
-
/* @__PURE__ */ (0,
|
|
4475
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4395
4476
|
Input,
|
|
4396
4477
|
{
|
|
4397
4478
|
value: paramValue,
|
|
@@ -4403,16 +4484,16 @@ function ApiPlayground({
|
|
|
4403
4484
|
] }, paramName);
|
|
4404
4485
|
}) })
|
|
4405
4486
|
] }),
|
|
4406
|
-
/* @__PURE__ */ (0,
|
|
4407
|
-
/* @__PURE__ */ (0,
|
|
4408
|
-
/* @__PURE__ */ (0,
|
|
4409
|
-
/* @__PURE__ */ (0,
|
|
4410
|
-
/* @__PURE__ */ (0,
|
|
4487
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
|
|
4488
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Request URL" }),
|
|
4489
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4490
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Badge2, { variant: "outline", className: "font-mono", children: method }),
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Input, { value: buildUrl(), readOnly: true, className: "font-mono text-sm" })
|
|
4411
4492
|
] })
|
|
4412
4493
|
] }),
|
|
4413
|
-
/* @__PURE__ */ (0,
|
|
4414
|
-
/* @__PURE__ */ (0,
|
|
4415
|
-
/* @__PURE__ */ (0,
|
|
4494
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
|
|
4495
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Headers (JSON)" }),
|
|
4496
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4416
4497
|
Textarea,
|
|
4417
4498
|
{
|
|
4418
4499
|
value: requestHeaders,
|
|
@@ -4422,9 +4503,9 @@ function ApiPlayground({
|
|
|
4422
4503
|
}
|
|
4423
4504
|
)
|
|
4424
4505
|
] }),
|
|
4425
|
-
method !== "GET" && method !== "DELETE" && /* @__PURE__ */ (0,
|
|
4426
|
-
/* @__PURE__ */ (0,
|
|
4427
|
-
/* @__PURE__ */ (0,
|
|
4506
|
+
method !== "GET" && method !== "DELETE" && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
|
|
4507
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Request Body (JSON)" }),
|
|
4508
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4428
4509
|
Textarea,
|
|
4429
4510
|
{
|
|
4430
4511
|
value: requestBody,
|
|
@@ -4435,37 +4516,37 @@ function ApiPlayground({
|
|
|
4435
4516
|
}
|
|
4436
4517
|
)
|
|
4437
4518
|
] }),
|
|
4438
|
-
/* @__PURE__ */ (0,
|
|
4439
|
-
/* @__PURE__ */ (0,
|
|
4519
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Button, { onClick: handleSend, disabled: loading, className: "w-full", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
4520
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react24.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
4440
4521
|
"Sending..."
|
|
4441
|
-
] }) : /* @__PURE__ */ (0,
|
|
4442
|
-
/* @__PURE__ */ (0,
|
|
4522
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
4523
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react24.Play, { className: "mr-2 h-4 w-4" }),
|
|
4443
4524
|
"Send Request"
|
|
4444
4525
|
] }) }),
|
|
4445
|
-
response && /* @__PURE__ */ (0,
|
|
4446
|
-
/* @__PURE__ */ (0,
|
|
4526
|
+
response && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "mt-4", children: [
|
|
4527
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: [
|
|
4447
4528
|
"Response (",
|
|
4448
4529
|
response.status,
|
|
4449
4530
|
" ",
|
|
4450
4531
|
response.statusText,
|
|
4451
4532
|
")"
|
|
4452
4533
|
] }),
|
|
4453
|
-
/* @__PURE__ */ (0,
|
|
4534
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CodeBlock, { code: JSON.stringify(response.body, null, 2), language: "json" })
|
|
4454
4535
|
] }),
|
|
4455
|
-
error && /* @__PURE__ */ (0,
|
|
4536
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mt-4 p-3 bg-red-500/10 border border-red-500/20 rounded-md", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: error }) })
|
|
4456
4537
|
] })
|
|
4457
4538
|
] });
|
|
4458
4539
|
}
|
|
4459
4540
|
|
|
4460
4541
|
// src/components/docs/api/api-reference.tsx
|
|
4461
|
-
var
|
|
4462
|
-
var
|
|
4463
|
-
var
|
|
4542
|
+
var import_react25 = require("react");
|
|
4543
|
+
var import_lucide_react25 = require("lucide-react");
|
|
4544
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4464
4545
|
function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
4465
|
-
const [apiSpec, setApiSpec] = (0,
|
|
4466
|
-
const [loading, setLoading] = (0,
|
|
4467
|
-
const [error, setError] = (0,
|
|
4468
|
-
(0,
|
|
4546
|
+
const [apiSpec, setApiSpec] = (0, import_react25.useState)(null);
|
|
4547
|
+
const [loading, setLoading] = (0, import_react25.useState)(true);
|
|
4548
|
+
const [error, setError] = (0, import_react25.useState)(null);
|
|
4549
|
+
(0, import_react25.useEffect)(() => {
|
|
4469
4550
|
async function loadSpec() {
|
|
4470
4551
|
try {
|
|
4471
4552
|
const response = await fetch(spec);
|
|
@@ -4490,13 +4571,13 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
4490
4571
|
});
|
|
4491
4572
|
};
|
|
4492
4573
|
if (loading) {
|
|
4493
|
-
return /* @__PURE__ */ (0,
|
|
4494
|
-
/* @__PURE__ */ (0,
|
|
4495
|
-
/* @__PURE__ */ (0,
|
|
4574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center justify-center py-12", children: [
|
|
4575
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react25.Loader2, { className: "h-6 w-6 animate-spin text-muted-foreground" }),
|
|
4576
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "ml-2 text-muted-foreground", children: "Loading API specification..." })
|
|
4496
4577
|
] });
|
|
4497
4578
|
}
|
|
4498
4579
|
if (error) {
|
|
4499
|
-
return /* @__PURE__ */ (0,
|
|
4580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "rounded-lg border border-red-500/20 bg-red-500/10 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("p", { className: "text-sm text-red-600 dark:text-red-400", children: [
|
|
4500
4581
|
"Error: ",
|
|
4501
4582
|
error
|
|
4502
4583
|
] }) });
|
|
@@ -4504,26 +4585,26 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
4504
4585
|
if (!apiSpec) {
|
|
4505
4586
|
return null;
|
|
4506
4587
|
}
|
|
4507
|
-
return /* @__PURE__ */ (0,
|
|
4508
|
-
(apiSpec.title || apiSpec.description) && /* @__PURE__ */ (0,
|
|
4509
|
-
apiSpec.title && /* @__PURE__ */ (0,
|
|
4510
|
-
apiSpec.description && /* @__PURE__ */ (0,
|
|
4511
|
-
apiSpec.baseUrl && /* @__PURE__ */ (0,
|
|
4512
|
-
/* @__PURE__ */ (0,
|
|
4513
|
-
/* @__PURE__ */ (0,
|
|
4588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "space-y-6", children: [
|
|
4589
|
+
(apiSpec.title || apiSpec.description) && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "mb-8", children: [
|
|
4590
|
+
apiSpec.title && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h2", { className: "text-2xl font-semibold mb-2 text-foreground", children: apiSpec.title }),
|
|
4591
|
+
apiSpec.description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-muted-foreground", children: apiSpec.description }),
|
|
4592
|
+
apiSpec.baseUrl && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "mt-4", children: [
|
|
4593
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-sm font-semibold text-muted-foreground mb-1", children: "Base URL" }),
|
|
4594
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("code", { className: "text-sm px-2 py-1 bg-muted rounded", children: apiSpec.baseUrl })
|
|
4514
4595
|
] })
|
|
4515
4596
|
] }),
|
|
4516
|
-
apiSpec.auth && /* @__PURE__ */ (0,
|
|
4517
|
-
/* @__PURE__ */ (0,
|
|
4518
|
-
/* @__PURE__ */ (0,
|
|
4519
|
-
apiSpec.auth.type === "bearer" && /* @__PURE__ */ (0,
|
|
4597
|
+
apiSpec.auth && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "rounded-lg border border-border bg-card/30 p-4 mb-6", children: [
|
|
4598
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h3", { className: "text-lg font-semibold mb-2 text-foreground", children: "Authentication" }),
|
|
4599
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-sm text-muted-foreground mb-2", children: apiSpec.auth.description || `This API uses ${apiSpec.auth.type} authentication.` }),
|
|
4600
|
+
apiSpec.auth.type === "bearer" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4520
4601
|
CodeBlock,
|
|
4521
4602
|
{
|
|
4522
4603
|
code: `Authorization: ${apiSpec.auth.tokenPrefix || "Bearer"} {YOUR_TOKEN}`,
|
|
4523
4604
|
language: "bash"
|
|
4524
4605
|
}
|
|
4525
4606
|
),
|
|
4526
|
-
apiSpec.auth.type === "apiKey" && /* @__PURE__ */ (0,
|
|
4607
|
+
apiSpec.auth.type === "apiKey" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4527
4608
|
CodeBlock,
|
|
4528
4609
|
{
|
|
4529
4610
|
code: `${apiSpec.auth.headerName || "X-API-Key"}: {YOUR_API_KEY}`,
|
|
@@ -4531,7 +4612,7 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
4531
4612
|
}
|
|
4532
4613
|
)
|
|
4533
4614
|
] }),
|
|
4534
|
-
/* @__PURE__ */ (0,
|
|
4615
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Accordion, { type: "single", collapsible: true, className: "space-y-4", children: apiSpec.endpoints.map((endpoint, index) => {
|
|
4535
4616
|
const allHeaders = [
|
|
4536
4617
|
...apiSpec.globalHeaders || [],
|
|
4537
4618
|
...endpoint.headers || []
|
|
@@ -4539,39 +4620,39 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
4539
4620
|
...header,
|
|
4540
4621
|
value: interpolateEnv(header.value, apiSpec.env)
|
|
4541
4622
|
}));
|
|
4542
|
-
return /* @__PURE__ */ (0,
|
|
4623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4543
4624
|
AccordionItem,
|
|
4544
4625
|
{
|
|
4545
4626
|
value: `endpoint-${index}`,
|
|
4546
|
-
title: /* @__PURE__ */ (0,
|
|
4547
|
-
/* @__PURE__ */ (0,
|
|
4627
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
4628
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4548
4629
|
"span",
|
|
4549
4630
|
{
|
|
4550
4631
|
className: `text-xs font-semibold px-2 py-0.5 rounded ${endpoint.method === "GET" ? "bg-blue-500/10 text-blue-600 dark:text-blue-400" : endpoint.method === "POST" ? "bg-green-500/10 text-green-600 dark:text-green-400" : endpoint.method === "PUT" ? "bg-orange-500/10 text-orange-600 dark:text-orange-400" : endpoint.method === "PATCH" ? "bg-purple-500/10 text-purple-600 dark:text-purple-400" : "bg-red-500/10 text-red-600 dark:text-red-400"}`,
|
|
4551
4632
|
children: endpoint.method
|
|
4552
4633
|
}
|
|
4553
4634
|
),
|
|
4554
|
-
/* @__PURE__ */ (0,
|
|
4555
|
-
/* @__PURE__ */ (0,
|
|
4635
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("code", { className: "text-sm font-mono", children: endpoint.path }),
|
|
4636
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-sm text-muted-foreground ml-auto", children: endpoint.title })
|
|
4556
4637
|
] }),
|
|
4557
|
-
children: /* @__PURE__ */ (0,
|
|
4558
|
-
endpoint.description && /* @__PURE__ */ (0,
|
|
4559
|
-
endpoint.pathParams && endpoint.pathParams.length > 0 && /* @__PURE__ */ (0,
|
|
4560
|
-
endpoint.queryParams && endpoint.queryParams.length > 0 && /* @__PURE__ */ (0,
|
|
4561
|
-
allHeaders.length > 0 && /* @__PURE__ */ (0,
|
|
4562
|
-
/* @__PURE__ */ (0,
|
|
4563
|
-
/* @__PURE__ */ (0,
|
|
4564
|
-
/* @__PURE__ */ (0,
|
|
4565
|
-
/* @__PURE__ */ (0,
|
|
4566
|
-
/* @__PURE__ */ (0,
|
|
4638
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "space-y-6 pt-4", children: [
|
|
4639
|
+
endpoint.description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-sm text-muted-foreground", children: endpoint.description }),
|
|
4640
|
+
endpoint.pathParams && endpoint.pathParams.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ApiParams, { title: "Path Parameters", params: endpoint.pathParams }),
|
|
4641
|
+
endpoint.queryParams && endpoint.queryParams.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ApiParams, { title: "Query Parameters", params: endpoint.queryParams }),
|
|
4642
|
+
allHeaders.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
|
|
4643
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Headers" }),
|
|
4644
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "space-y-2", children: allHeaders.map((header, idx) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
4645
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4646
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("code", { className: "text-sm font-mono text-foreground", children: header.name }),
|
|
4647
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-xs text-muted-foreground", children: header.value })
|
|
4567
4648
|
] }),
|
|
4568
|
-
header.description && /* @__PURE__ */ (0,
|
|
4649
|
+
header.description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-sm text-muted-foreground", children: header.description })
|
|
4569
4650
|
] }, idx)) })
|
|
4570
4651
|
] }),
|
|
4571
|
-
endpoint.body && /* @__PURE__ */ (0,
|
|
4572
|
-
/* @__PURE__ */ (0,
|
|
4573
|
-
endpoint.body.description && /* @__PURE__ */ (0,
|
|
4574
|
-
endpoint.body.example && /* @__PURE__ */ (0,
|
|
4652
|
+
endpoint.body && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
|
|
4653
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Request Body" }),
|
|
4654
|
+
endpoint.body.description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-sm text-muted-foreground mb-2", children: endpoint.body.description }),
|
|
4655
|
+
endpoint.body.example && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4575
4656
|
CodeBlock,
|
|
4576
4657
|
{
|
|
4577
4658
|
code: typeof endpoint.body.example === "string" ? endpoint.body.example : JSON.stringify(endpoint.body.example, null, 2),
|
|
@@ -4579,9 +4660,9 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
4579
4660
|
}
|
|
4580
4661
|
)
|
|
4581
4662
|
] }),
|
|
4582
|
-
/* @__PURE__ */ (0,
|
|
4583
|
-
/* @__PURE__ */ (0,
|
|
4584
|
-
endpoint.successResponse && /* @__PURE__ */ (0,
|
|
4663
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
|
|
4664
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Responses" }),
|
|
4665
|
+
endpoint.successResponse && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4585
4666
|
ApiResponse,
|
|
4586
4667
|
{
|
|
4587
4668
|
status: endpoint.successResponse.status,
|
|
@@ -4590,7 +4671,7 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
4590
4671
|
schema: endpoint.successResponse.schema
|
|
4591
4672
|
}
|
|
4592
4673
|
),
|
|
4593
|
-
endpoint.errorResponses?.map((response, idx) => /* @__PURE__ */ (0,
|
|
4674
|
+
endpoint.errorResponses?.map((response, idx) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4594
4675
|
ApiResponse,
|
|
4595
4676
|
{
|
|
4596
4677
|
status: response.status,
|
|
@@ -4601,14 +4682,14 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
4601
4682
|
idx
|
|
4602
4683
|
))
|
|
4603
4684
|
] }),
|
|
4604
|
-
endpoint.examples && endpoint.examples.length > 0 && /* @__PURE__ */ (0,
|
|
4605
|
-
/* @__PURE__ */ (0,
|
|
4606
|
-
endpoint.examples.map((example, idx) => /* @__PURE__ */ (0,
|
|
4607
|
-
/* @__PURE__ */ (0,
|
|
4608
|
-
/* @__PURE__ */ (0,
|
|
4685
|
+
endpoint.examples && endpoint.examples.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
|
|
4686
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Examples" }),
|
|
4687
|
+
endpoint.examples.map((example, idx) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "mb-3", children: [
|
|
4688
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: example.title }),
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CodeBlock, { code: example.code, language: example.language })
|
|
4609
4690
|
] }, idx))
|
|
4610
4691
|
] }),
|
|
4611
|
-
showPlayground && /* @__PURE__ */ (0,
|
|
4692
|
+
showPlayground && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4612
4693
|
ApiPlayground,
|
|
4613
4694
|
{
|
|
4614
4695
|
method: endpoint.method,
|
|
@@ -4628,15 +4709,15 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
4628
4709
|
}
|
|
4629
4710
|
|
|
4630
4711
|
// src/components/global/version-not-found.tsx
|
|
4631
|
-
var
|
|
4712
|
+
var import_lucide_react26 = require("lucide-react");
|
|
4632
4713
|
var import_link10 = __toESM(require("next/link"));
|
|
4633
|
-
var
|
|
4714
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4634
4715
|
function VersionNotFound() {
|
|
4635
|
-
return /* @__PURE__ */ (0,
|
|
4636
|
-
/* @__PURE__ */ (0,
|
|
4637
|
-
/* @__PURE__ */ (0,
|
|
4638
|
-
/* @__PURE__ */ (0,
|
|
4639
|
-
/* @__PURE__ */ (0,
|
|
4716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex min-h-screen items-center justify-center px-4", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "text-center", children: [
|
|
4717
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react26.AlertTriangle, { className: "h-16 w-16 text-yellow-500" }) }),
|
|
4718
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h1", { className: "mb-2 text-4xl font-bold", children: "Version Not Found" }),
|
|
4719
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "mb-6 text-muted-foreground", children: "The documentation version you're looking for doesn't exist." }),
|
|
4720
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4640
4721
|
import_link10.default,
|
|
4641
4722
|
{
|
|
4642
4723
|
href: "/docs/v1.0.0",
|
|
@@ -4695,6 +4776,7 @@ function VersionNotFound() {
|
|
|
4695
4776
|
ImageCard,
|
|
4696
4777
|
ImageCardGrid,
|
|
4697
4778
|
Input,
|
|
4779
|
+
LanguageSwitcher,
|
|
4698
4780
|
Logo,
|
|
4699
4781
|
Math,
|
|
4700
4782
|
MdxHotReload,
|
|
@@ -4751,6 +4833,7 @@ function VersionNotFound() {
|
|
|
4751
4833
|
getConfig,
|
|
4752
4834
|
getConfigValue,
|
|
4753
4835
|
getDocBySlug,
|
|
4836
|
+
getI18nConfig,
|
|
4754
4837
|
getVersions,
|
|
4755
4838
|
initConfig,
|
|
4756
4839
|
isCategoryPage,
|