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
|
@@ -1437,12 +1437,115 @@ function VersionSwitcher({ currentVersion, versions }) {
|
|
|
1437
1437
|
] });
|
|
1438
1438
|
}
|
|
1439
1439
|
|
|
1440
|
+
// src/components/docs/language-switcher.tsx
|
|
1441
|
+
import { useState as useState11 } from "react";
|
|
1442
|
+
import { Languages, Check as Check3, ChevronDown as ChevronDown5 } from "lucide-react";
|
|
1443
|
+
import { usePathname as usePathname2, useRouter as useRouter3 } from "next/navigation";
|
|
1444
|
+
|
|
1445
|
+
// src/components/config-provider.tsx
|
|
1446
|
+
import * as React3 from "react";
|
|
1447
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1448
|
+
var ConfigContext = React3.createContext(defaultConfig);
|
|
1449
|
+
function ConfigProvider({ config, children }) {
|
|
1450
|
+
return /* @__PURE__ */ jsx26(ConfigContext.Provider, { value: config, children });
|
|
1451
|
+
}
|
|
1452
|
+
function useConfig() {
|
|
1453
|
+
const config = React3.useContext(ConfigContext);
|
|
1454
|
+
if (!config) {
|
|
1455
|
+
throw new Error("useConfig must be used within a ConfigProvider");
|
|
1456
|
+
}
|
|
1457
|
+
return config;
|
|
1458
|
+
}
|
|
1459
|
+
function useConfigValue(path) {
|
|
1460
|
+
const config = useConfig();
|
|
1461
|
+
const keys = path.split(".");
|
|
1462
|
+
let value = config;
|
|
1463
|
+
for (const key of keys) {
|
|
1464
|
+
if (value && typeof value === "object" && key in value) {
|
|
1465
|
+
value = value[key];
|
|
1466
|
+
} else {
|
|
1467
|
+
return void 0;
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
return value;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
// src/components/docs/language-switcher.tsx
|
|
1474
|
+
import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1475
|
+
function LanguageSwitcher() {
|
|
1476
|
+
const [open, setOpen] = useState11(false);
|
|
1477
|
+
const pathname = usePathname2();
|
|
1478
|
+
const router = useRouter3();
|
|
1479
|
+
const config = useConfig();
|
|
1480
|
+
const i18n = config.features?.i18n;
|
|
1481
|
+
if (!i18n || typeof i18n === "boolean") return null;
|
|
1482
|
+
const { locales, localeNames, defaultLocale, prefixDefault } = i18n;
|
|
1483
|
+
const pathParts = pathname.split("/");
|
|
1484
|
+
const version = pathParts[2];
|
|
1485
|
+
let currentLocale = defaultLocale;
|
|
1486
|
+
if (pathParts[3] && locales.includes(pathParts[3])) {
|
|
1487
|
+
currentLocale = pathParts[3];
|
|
1488
|
+
}
|
|
1489
|
+
const handleLocaleChange = (newLocale) => {
|
|
1490
|
+
if (newLocale === currentLocale) {
|
|
1491
|
+
setOpen(false);
|
|
1492
|
+
return;
|
|
1493
|
+
}
|
|
1494
|
+
const parts = [...pathParts];
|
|
1495
|
+
const hasLocalePrefix = locales.includes(parts[3]);
|
|
1496
|
+
if (newLocale === defaultLocale && !prefixDefault) {
|
|
1497
|
+
if (hasLocalePrefix) {
|
|
1498
|
+
parts.splice(3, 1);
|
|
1499
|
+
}
|
|
1500
|
+
} else {
|
|
1501
|
+
if (hasLocalePrefix) {
|
|
1502
|
+
parts[3] = newLocale;
|
|
1503
|
+
} else {
|
|
1504
|
+
parts.splice(3, 0, newLocale);
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
const newPath = parts.join("/");
|
|
1508
|
+
router.push(newPath);
|
|
1509
|
+
setOpen(false);
|
|
1510
|
+
};
|
|
1511
|
+
return /* @__PURE__ */ jsxs20("div", { className: "relative", children: [
|
|
1512
|
+
/* @__PURE__ */ jsxs20(
|
|
1513
|
+
"button",
|
|
1514
|
+
{
|
|
1515
|
+
onClick: () => setOpen(!open),
|
|
1516
|
+
className: "flex items-center gap-1.5 px-2 h-9 rounded-md hover:bg-muted transition-colors",
|
|
1517
|
+
"aria-label": "Switch language",
|
|
1518
|
+
children: [
|
|
1519
|
+
/* @__PURE__ */ jsx27(Languages, { className: "h-4 w-4" }),
|
|
1520
|
+
/* @__PURE__ */ jsx27("span", { className: "text-xs font-bold uppercase", children: currentLocale }),
|
|
1521
|
+
/* @__PURE__ */ jsx27(ChevronDown5, { className: "h-3 w-3 text-muted-foreground" })
|
|
1522
|
+
]
|
|
1523
|
+
}
|
|
1524
|
+
),
|
|
1525
|
+
open && /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
1526
|
+
/* @__PURE__ */ jsx27("div", { className: "fixed inset-0 z-40", onClick: () => setOpen(false) }),
|
|
1527
|
+
/* @__PURE__ */ jsx27("div", { className: "absolute right-0 mt-2 w-40 bg-background border border-border rounded-md shadow-lg z-50", children: /* @__PURE__ */ jsx27("div", { className: "p-2", children: locales.map((locale) => /* @__PURE__ */ jsxs20(
|
|
1528
|
+
"button",
|
|
1529
|
+
{
|
|
1530
|
+
onClick: () => handleLocaleChange(locale),
|
|
1531
|
+
className: "flex items-center justify-between w-full px-3 py-2 text-sm text-foreground hover:bg-muted rounded-md transition-colors",
|
|
1532
|
+
children: [
|
|
1533
|
+
/* @__PURE__ */ jsx27("span", { children: localeNames?.[locale] || locale.toUpperCase() }),
|
|
1534
|
+
currentLocale === locale && /* @__PURE__ */ jsx27(Check3, { className: "h-4 w-4 text-primary" })
|
|
1535
|
+
]
|
|
1536
|
+
},
|
|
1537
|
+
locale
|
|
1538
|
+
)) }) })
|
|
1539
|
+
] })
|
|
1540
|
+
] });
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1440
1543
|
// src/components/docs/theme-toggle.tsx
|
|
1441
1544
|
import { Moon, Sun } from "lucide-react";
|
|
1442
|
-
import { useEffect as useEffect5, useState as
|
|
1443
|
-
import { jsx as
|
|
1545
|
+
import { useEffect as useEffect5, useState as useState12 } from "react";
|
|
1546
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1444
1547
|
function ThemeToggle() {
|
|
1445
|
-
const [theme, setTheme] =
|
|
1548
|
+
const [theme, setTheme] = useState12("dark");
|
|
1446
1549
|
useEffect5(() => {
|
|
1447
1550
|
const savedTheme = localStorage.getItem("theme");
|
|
1448
1551
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
@@ -1456,21 +1559,21 @@ function ThemeToggle() {
|
|
|
1456
1559
|
localStorage.setItem("theme", newTheme);
|
|
1457
1560
|
document.documentElement.classList.toggle("dark", newTheme === "dark");
|
|
1458
1561
|
};
|
|
1459
|
-
return /* @__PURE__ */
|
|
1562
|
+
return /* @__PURE__ */ jsx28(
|
|
1460
1563
|
"button",
|
|
1461
1564
|
{
|
|
1462
1565
|
onClick: toggleTheme,
|
|
1463
1566
|
className: "flex items-center justify-center w-9 h-9 rounded-md border border-border bg-background hover:bg-accent transition-colors",
|
|
1464
1567
|
"aria-label": "Toggle theme",
|
|
1465
|
-
children: theme === "dark" ? /* @__PURE__ */
|
|
1568
|
+
children: theme === "dark" ? /* @__PURE__ */ jsx28(Sun, { className: "h-4 w-4 text-foreground" }) : /* @__PURE__ */ jsx28(Moon, { className: "h-4 w-4 text-foreground" })
|
|
1466
1569
|
}
|
|
1467
1570
|
);
|
|
1468
1571
|
}
|
|
1469
1572
|
|
|
1470
1573
|
// src/components/docs/search-modal.tsx
|
|
1471
|
-
import { useState as
|
|
1574
|
+
import { useState as useState13, useEffect as useEffect6, useCallback } from "react";
|
|
1472
1575
|
import { Search, FileText, Loader2 } from "lucide-react";
|
|
1473
|
-
import { useRouter as
|
|
1576
|
+
import { useRouter as useRouter4 } from "next/navigation";
|
|
1474
1577
|
|
|
1475
1578
|
// src/components/ui/dialog.tsx
|
|
1476
1579
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
@@ -1484,32 +1587,32 @@ function cn(...inputs) {
|
|
|
1484
1587
|
}
|
|
1485
1588
|
|
|
1486
1589
|
// src/components/ui/dialog.tsx
|
|
1487
|
-
import { jsx as
|
|
1590
|
+
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1488
1591
|
function Dialog({
|
|
1489
1592
|
...props
|
|
1490
1593
|
}) {
|
|
1491
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ jsx29(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
1492
1595
|
}
|
|
1493
1596
|
function DialogTrigger({
|
|
1494
1597
|
...props
|
|
1495
1598
|
}) {
|
|
1496
|
-
return /* @__PURE__ */
|
|
1599
|
+
return /* @__PURE__ */ jsx29(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
1497
1600
|
}
|
|
1498
1601
|
function DialogPortal({
|
|
1499
1602
|
...props
|
|
1500
1603
|
}) {
|
|
1501
|
-
return /* @__PURE__ */
|
|
1604
|
+
return /* @__PURE__ */ jsx29(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
1502
1605
|
}
|
|
1503
1606
|
function DialogClose({
|
|
1504
1607
|
...props
|
|
1505
1608
|
}) {
|
|
1506
|
-
return /* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ jsx29(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
1507
1610
|
}
|
|
1508
1611
|
function DialogOverlay({
|
|
1509
1612
|
className,
|
|
1510
1613
|
...props
|
|
1511
1614
|
}) {
|
|
1512
|
-
return /* @__PURE__ */
|
|
1615
|
+
return /* @__PURE__ */ jsx29(
|
|
1513
1616
|
DialogPrimitive.Overlay,
|
|
1514
1617
|
{
|
|
1515
1618
|
"data-slot": "dialog-overlay",
|
|
@@ -1527,9 +1630,9 @@ function DialogContent({
|
|
|
1527
1630
|
showCloseButton = true,
|
|
1528
1631
|
...props
|
|
1529
1632
|
}) {
|
|
1530
|
-
return /* @__PURE__ */
|
|
1531
|
-
/* @__PURE__ */
|
|
1532
|
-
/* @__PURE__ */
|
|
1633
|
+
return /* @__PURE__ */ jsxs21(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
1634
|
+
/* @__PURE__ */ jsx29(DialogOverlay, {}),
|
|
1635
|
+
/* @__PURE__ */ jsxs21(
|
|
1533
1636
|
DialogPrimitive.Content,
|
|
1534
1637
|
{
|
|
1535
1638
|
"data-slot": "dialog-content",
|
|
@@ -1540,14 +1643,14 @@ function DialogContent({
|
|
|
1540
1643
|
...props,
|
|
1541
1644
|
children: [
|
|
1542
1645
|
children,
|
|
1543
|
-
showCloseButton && /* @__PURE__ */
|
|
1646
|
+
showCloseButton && /* @__PURE__ */ jsxs21(
|
|
1544
1647
|
DialogPrimitive.Close,
|
|
1545
1648
|
{
|
|
1546
1649
|
"data-slot": "dialog-close",
|
|
1547
1650
|
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",
|
|
1548
1651
|
children: [
|
|
1549
|
-
/* @__PURE__ */
|
|
1550
|
-
/* @__PURE__ */
|
|
1652
|
+
/* @__PURE__ */ jsx29(XIcon, {}),
|
|
1653
|
+
/* @__PURE__ */ jsx29("span", { className: "sr-only", children: "Close" })
|
|
1551
1654
|
]
|
|
1552
1655
|
}
|
|
1553
1656
|
)
|
|
@@ -1557,7 +1660,7 @@ function DialogContent({
|
|
|
1557
1660
|
] });
|
|
1558
1661
|
}
|
|
1559
1662
|
function DialogHeader({ className, ...props }) {
|
|
1560
|
-
return /* @__PURE__ */
|
|
1663
|
+
return /* @__PURE__ */ jsx29(
|
|
1561
1664
|
"div",
|
|
1562
1665
|
{
|
|
1563
1666
|
"data-slot": "dialog-header",
|
|
@@ -1567,7 +1670,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
1567
1670
|
);
|
|
1568
1671
|
}
|
|
1569
1672
|
function DialogFooter({ className, ...props }) {
|
|
1570
|
-
return /* @__PURE__ */
|
|
1673
|
+
return /* @__PURE__ */ jsx29(
|
|
1571
1674
|
"div",
|
|
1572
1675
|
{
|
|
1573
1676
|
"data-slot": "dialog-footer",
|
|
@@ -1583,7 +1686,7 @@ function DialogTitle({
|
|
|
1583
1686
|
className,
|
|
1584
1687
|
...props
|
|
1585
1688
|
}) {
|
|
1586
|
-
return /* @__PURE__ */
|
|
1689
|
+
return /* @__PURE__ */ jsx29(
|
|
1587
1690
|
DialogPrimitive.Title,
|
|
1588
1691
|
{
|
|
1589
1692
|
"data-slot": "dialog-title",
|
|
@@ -1596,7 +1699,7 @@ function DialogDescription({
|
|
|
1596
1699
|
className,
|
|
1597
1700
|
...props
|
|
1598
1701
|
}) {
|
|
1599
|
-
return /* @__PURE__ */
|
|
1702
|
+
return /* @__PURE__ */ jsx29(
|
|
1600
1703
|
DialogPrimitive.Description,
|
|
1601
1704
|
{
|
|
1602
1705
|
"data-slot": "dialog-description",
|
|
@@ -1607,13 +1710,13 @@ function DialogDescription({
|
|
|
1607
1710
|
}
|
|
1608
1711
|
|
|
1609
1712
|
// src/components/docs/search-modal.tsx
|
|
1610
|
-
import { Fragment as
|
|
1713
|
+
import { Fragment as Fragment5, jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1611
1714
|
function SearchModal({ isOpen, onClose, config }) {
|
|
1612
|
-
const [query, setQuery] =
|
|
1613
|
-
const [results, setResults] =
|
|
1614
|
-
const [isLoading, setIsLoading] =
|
|
1615
|
-
const [selectedIndex, setSelectedIndex] =
|
|
1616
|
-
const router =
|
|
1715
|
+
const [query, setQuery] = useState13("");
|
|
1716
|
+
const [results, setResults] = useState13([]);
|
|
1717
|
+
const [isLoading, setIsLoading] = useState13(false);
|
|
1718
|
+
const [selectedIndex, setSelectedIndex] = useState13(0);
|
|
1719
|
+
const router = useRouter4();
|
|
1617
1720
|
const searchConfig = config.search;
|
|
1618
1721
|
const performSearch = useCallback(async (searchQuery) => {
|
|
1619
1722
|
if (!searchQuery.trim() || !searchConfig?.enabled) {
|
|
@@ -1699,20 +1802,20 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1699
1802
|
if (!query2.trim()) return text;
|
|
1700
1803
|
const parts = text.split(new RegExp(`(${query2})`, "gi"));
|
|
1701
1804
|
return parts.map(
|
|
1702
|
-
(part, i) => part.toLowerCase() === query2.toLowerCase() ? /* @__PURE__ */
|
|
1805
|
+
(part, i) => part.toLowerCase() === query2.toLowerCase() ? /* @__PURE__ */ jsx30("mark", { className: "bg-yellow-200 dark:bg-yellow-900/50 text-foreground", children: part }, i) : part
|
|
1703
1806
|
);
|
|
1704
1807
|
};
|
|
1705
|
-
return /* @__PURE__ */
|
|
1808
|
+
return /* @__PURE__ */ jsx30(Dialog, { open: isOpen, onOpenChange: onClose, modal: true, children: /* @__PURE__ */ jsxs22(
|
|
1706
1809
|
DialogContent,
|
|
1707
1810
|
{
|
|
1708
1811
|
className: "max-w-2xl p-0 gap-0 top-[10vh] translate-y-0",
|
|
1709
1812
|
showCloseButton: false,
|
|
1710
1813
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
1711
1814
|
children: [
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
-
/* @__PURE__ */
|
|
1715
|
-
/* @__PURE__ */
|
|
1815
|
+
/* @__PURE__ */ jsx30(DialogTitle, { className: "sr-only", children: "Search Documentation" }),
|
|
1816
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-border", children: [
|
|
1817
|
+
/* @__PURE__ */ jsx30(Search, { className: "h-5 w-5 text-muted-foreground shrink-0" }),
|
|
1818
|
+
/* @__PURE__ */ jsx30(
|
|
1716
1819
|
"input",
|
|
1717
1820
|
{
|
|
1718
1821
|
type: "text",
|
|
@@ -1723,30 +1826,30 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1723
1826
|
autoFocus: true
|
|
1724
1827
|
}
|
|
1725
1828
|
),
|
|
1726
|
-
isLoading && /* @__PURE__ */
|
|
1829
|
+
isLoading && /* @__PURE__ */ jsx30(Loader2, { className: "h-5 w-5 text-muted-foreground animate-spin" })
|
|
1727
1830
|
] }),
|
|
1728
|
-
/* @__PURE__ */
|
|
1729
|
-
query.trim() && results.length === 0 && !isLoading && /* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ jsxs22("div", { className: "max-h-[60vh] overflow-y-auto", children: [
|
|
1832
|
+
query.trim() && results.length === 0 && !isLoading && /* @__PURE__ */ jsxs22("div", { className: "px-4 py-8 text-center text-muted-foreground", children: [
|
|
1730
1833
|
'No results found for "',
|
|
1731
1834
|
query,
|
|
1732
1835
|
'"'
|
|
1733
1836
|
] }),
|
|
1734
|
-
results.length > 0 && /* @__PURE__ */
|
|
1837
|
+
results.length > 0 && /* @__PURE__ */ jsx30("div", { className: "py-2", children: results.map((result, index) => /* @__PURE__ */ jsx30(
|
|
1735
1838
|
"button",
|
|
1736
1839
|
{
|
|
1737
1840
|
onClick: () => handleResultClick(result),
|
|
1738
1841
|
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"}`,
|
|
1739
1842
|
onMouseEnter: () => setSelectedIndex(index),
|
|
1740
|
-
children: /* @__PURE__ */
|
|
1741
|
-
/* @__PURE__ */
|
|
1742
|
-
/* @__PURE__ */
|
|
1743
|
-
/* @__PURE__ */
|
|
1744
|
-
result.content && /* @__PURE__ */
|
|
1745
|
-
/* @__PURE__ */
|
|
1746
|
-
/* @__PURE__ */
|
|
1747
|
-
result.category && /* @__PURE__ */
|
|
1748
|
-
/* @__PURE__ */
|
|
1749
|
-
/* @__PURE__ */
|
|
1843
|
+
children: /* @__PURE__ */ jsxs22("div", { className: "flex items-start gap-3", children: [
|
|
1844
|
+
/* @__PURE__ */ jsx30(FileText, { className: "h-5 w-5 text-muted-foreground shrink-0 mt-0.5" }),
|
|
1845
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex-1 min-w-0", children: [
|
|
1846
|
+
/* @__PURE__ */ jsx30("div", { className: "font-medium text-foreground mb-1", children: highlightText(result.title, query) }),
|
|
1847
|
+
result.content && /* @__PURE__ */ jsx30("div", { className: "text-sm text-muted-foreground line-clamp-2", children: highlightText(result.content, query) }),
|
|
1848
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2 mt-1 text-xs text-muted-foreground", children: [
|
|
1849
|
+
/* @__PURE__ */ jsx30("span", { children: result.version }),
|
|
1850
|
+
result.category && /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
1851
|
+
/* @__PURE__ */ jsx30("span", { children: "\u2022" }),
|
|
1852
|
+
/* @__PURE__ */ jsx30("span", { children: result.category })
|
|
1750
1853
|
] })
|
|
1751
1854
|
] })
|
|
1752
1855
|
] })
|
|
@@ -1754,15 +1857,15 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1754
1857
|
},
|
|
1755
1858
|
result.id
|
|
1756
1859
|
)) }),
|
|
1757
|
-
!query.trim() && /* @__PURE__ */
|
|
1758
|
-
/* @__PURE__ */
|
|
1759
|
-
/* @__PURE__ */
|
|
1760
|
-
/* @__PURE__ */
|
|
1761
|
-
/* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
/* @__PURE__ */
|
|
1764
|
-
/* @__PURE__ */
|
|
1765
|
-
/* @__PURE__ */
|
|
1860
|
+
!query.trim() && /* @__PURE__ */ jsxs22("div", { className: "px-4 py-8 text-center text-muted-foreground text-sm", children: [
|
|
1861
|
+
/* @__PURE__ */ jsx30("p", { children: "Start typing to search documentation..." }),
|
|
1862
|
+
/* @__PURE__ */ jsxs22("div", { className: "mt-4 flex items-center justify-center gap-4 text-xs", children: [
|
|
1863
|
+
/* @__PURE__ */ jsx30("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "\u2191\u2193" }),
|
|
1864
|
+
/* @__PURE__ */ jsx30("span", { children: "Navigate" }),
|
|
1865
|
+
/* @__PURE__ */ jsx30("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "Enter" }),
|
|
1866
|
+
/* @__PURE__ */ jsx30("span", { children: "Select" }),
|
|
1867
|
+
/* @__PURE__ */ jsx30("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "Esc" }),
|
|
1868
|
+
/* @__PURE__ */ jsx30("span", { children: "Close" })
|
|
1766
1869
|
] })
|
|
1767
1870
|
] })
|
|
1768
1871
|
] })
|
|
@@ -1772,42 +1875,12 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1772
1875
|
}
|
|
1773
1876
|
|
|
1774
1877
|
// src/components/docs/header.tsx
|
|
1775
|
-
import { useState as
|
|
1776
|
-
|
|
1777
|
-
// src/components/config-provider.tsx
|
|
1778
|
-
import * as React3 from "react";
|
|
1779
|
-
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1780
|
-
var ConfigContext = React3.createContext(defaultConfig);
|
|
1781
|
-
function ConfigProvider({ config, children }) {
|
|
1782
|
-
return /* @__PURE__ */ jsx29(ConfigContext.Provider, { value: config, children });
|
|
1783
|
-
}
|
|
1784
|
-
function useConfig() {
|
|
1785
|
-
const config = React3.useContext(ConfigContext);
|
|
1786
|
-
if (!config) {
|
|
1787
|
-
throw new Error("useConfig must be used within a ConfigProvider");
|
|
1788
|
-
}
|
|
1789
|
-
return config;
|
|
1790
|
-
}
|
|
1791
|
-
function useConfigValue(path) {
|
|
1792
|
-
const config = useConfig();
|
|
1793
|
-
const keys = path.split(".");
|
|
1794
|
-
let value = config;
|
|
1795
|
-
for (const key of keys) {
|
|
1796
|
-
if (value && typeof value === "object" && key in value) {
|
|
1797
|
-
value = value[key];
|
|
1798
|
-
} else {
|
|
1799
|
-
return void 0;
|
|
1800
|
-
}
|
|
1801
|
-
}
|
|
1802
|
-
return value;
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
// src/components/docs/header.tsx
|
|
1806
|
-
import { jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1878
|
+
import { useState as useState14, useEffect as useEffect7 } from "react";
|
|
1879
|
+
import { jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1807
1880
|
function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
1808
1881
|
const contextConfig = useConfig();
|
|
1809
1882
|
const config = configProp || contextConfig;
|
|
1810
|
-
const [searchOpen, setSearchOpen] =
|
|
1883
|
+
const [searchOpen, setSearchOpen] = useState14(false);
|
|
1811
1884
|
useEffect7(() => {
|
|
1812
1885
|
const handleKeyDown = (e) => {
|
|
1813
1886
|
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
@@ -1818,38 +1891,38 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
1818
1891
|
window.addEventListener("keydown", handleKeyDown);
|
|
1819
1892
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
1820
1893
|
}, []);
|
|
1821
|
-
return /* @__PURE__ */
|
|
1822
|
-
/* @__PURE__ */
|
|
1823
|
-
/* @__PURE__ */
|
|
1824
|
-
/* @__PURE__ */
|
|
1894
|
+
return /* @__PURE__ */ jsxs23("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: [
|
|
1895
|
+
/* @__PURE__ */ jsxs23("div", { className: "container flex h-16 items-center justify-between px-2 md:px-6 mx-auto", children: [
|
|
1896
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-1", children: [
|
|
1897
|
+
/* @__PURE__ */ jsx31(
|
|
1825
1898
|
"button",
|
|
1826
1899
|
{
|
|
1827
1900
|
onClick: onMenuClick,
|
|
1828
1901
|
className: "lg:hidden hover:bg-muted p-2 rounded-md transition-colors",
|
|
1829
1902
|
"aria-label": "Toggle menu",
|
|
1830
|
-
children: /* @__PURE__ */
|
|
1903
|
+
children: /* @__PURE__ */ jsx31(Menu, { className: "h-5 w-5" })
|
|
1831
1904
|
}
|
|
1832
1905
|
),
|
|
1833
|
-
/* @__PURE__ */
|
|
1834
|
-
!config.site.hideLogo && (config.site.logo ? /* @__PURE__ */
|
|
1835
|
-
!config.site.hideTitle && /* @__PURE__ */
|
|
1906
|
+
/* @__PURE__ */ jsxs23(Link7, { href: "/", className: "flex items-center gap-2", children: [
|
|
1907
|
+
!config.site.hideLogo && (config.site.logo ? /* @__PURE__ */ jsx31(Logo, { logo: config.site.logo, alt: config.site.title, className: "h-12 w-auto object-contain" }) : /* @__PURE__ */ jsx31("div", { className: "h-8 w-8 rounded-xl bg-primary flex items-center justify-center", children: /* @__PURE__ */ jsx31("span", { className: "text-primary-foreground font-bold text-lg", children: config.site.title.charAt(0).toUpperCase() }) })),
|
|
1908
|
+
!config.site.hideTitle && /* @__PURE__ */ jsx31("span", { className: "font-semibold text-lg text-foreground", children: config.site.title ?? "Specra" })
|
|
1836
1909
|
] })
|
|
1837
1910
|
] }),
|
|
1838
|
-
/* @__PURE__ */
|
|
1839
|
-
config.search?.enabled && /* @__PURE__ */
|
|
1911
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
|
|
1912
|
+
config.search?.enabled && /* @__PURE__ */ jsxs23(
|
|
1840
1913
|
"button",
|
|
1841
1914
|
{
|
|
1842
1915
|
onClick: () => setSearchOpen(true),
|
|
1843
1916
|
className: "flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:text-foreground bg-muted rounded-md transition-colors",
|
|
1844
1917
|
children: [
|
|
1845
|
-
/* @__PURE__ */
|
|
1846
|
-
/* @__PURE__ */
|
|
1847
|
-
/* @__PURE__ */
|
|
1918
|
+
/* @__PURE__ */ jsx31(Search2, { className: "h-4 w-4" }),
|
|
1919
|
+
/* @__PURE__ */ jsx31("span", { className: "hidden sm:inline", children: config.search.placeholder || "Search" }),
|
|
1920
|
+
/* @__PURE__ */ jsx31("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" })
|
|
1848
1921
|
]
|
|
1849
1922
|
}
|
|
1850
1923
|
),
|
|
1851
|
-
config.features?.versioning && /* @__PURE__ */
|
|
1852
|
-
config.social?.github && /* @__PURE__ */
|
|
1924
|
+
config.features?.versioning && /* @__PURE__ */ jsx31(VersionSwitcher, { currentVersion, versions }),
|
|
1925
|
+
config.social?.github && /* @__PURE__ */ jsx31(
|
|
1853
1926
|
"a",
|
|
1854
1927
|
{
|
|
1855
1928
|
href: config.social.github,
|
|
@@ -1857,10 +1930,10 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
1857
1930
|
rel: "noopener noreferrer",
|
|
1858
1931
|
className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
|
|
1859
1932
|
"aria-label": "GitHub",
|
|
1860
|
-
children: /* @__PURE__ */
|
|
1933
|
+
children: /* @__PURE__ */ jsx31(Github, { className: "h-4 w-4" })
|
|
1861
1934
|
}
|
|
1862
1935
|
),
|
|
1863
|
-
config.social?.twitter && /* @__PURE__ */
|
|
1936
|
+
config.social?.twitter && /* @__PURE__ */ jsx31(
|
|
1864
1937
|
"a",
|
|
1865
1938
|
{
|
|
1866
1939
|
href: config.social.twitter,
|
|
@@ -1868,10 +1941,10 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
1868
1941
|
rel: "noopener noreferrer",
|
|
1869
1942
|
className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
|
|
1870
1943
|
"aria-label": "Twitter",
|
|
1871
|
-
children: /* @__PURE__ */
|
|
1944
|
+
children: /* @__PURE__ */ jsx31(Twitter, { className: "h-4 w-4" })
|
|
1872
1945
|
}
|
|
1873
1946
|
),
|
|
1874
|
-
config.social?.discord && /* @__PURE__ */
|
|
1947
|
+
config.social?.discord && /* @__PURE__ */ jsx31(
|
|
1875
1948
|
"a",
|
|
1876
1949
|
{
|
|
1877
1950
|
href: config.social.discord,
|
|
@@ -1879,25 +1952,26 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
1879
1952
|
rel: "noopener noreferrer",
|
|
1880
1953
|
className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
|
|
1881
1954
|
"aria-label": "Discord",
|
|
1882
|
-
children: /* @__PURE__ */
|
|
1955
|
+
children: /* @__PURE__ */ jsx31(MessageCircle, { className: "h-4 w-4" })
|
|
1883
1956
|
}
|
|
1884
1957
|
),
|
|
1885
|
-
/* @__PURE__ */
|
|
1958
|
+
/* @__PURE__ */ jsx31(ThemeToggle, {}),
|
|
1959
|
+
/* @__PURE__ */ jsx31(LanguageSwitcher, {})
|
|
1886
1960
|
] })
|
|
1887
1961
|
] }),
|
|
1888
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ jsx31(SearchModal, { isOpen: searchOpen, onClose: () => setSearchOpen(false), config })
|
|
1889
1963
|
] });
|
|
1890
1964
|
}
|
|
1891
1965
|
|
|
1892
1966
|
// src/components/docs/hot-reload-indicator.tsx
|
|
1893
|
-
import { useEffect as useEffect8, useState as
|
|
1894
|
-
import { usePathname as
|
|
1967
|
+
import { useEffect as useEffect8, useState as useState15 } from "react";
|
|
1968
|
+
import { usePathname as usePathname3 } from "next/navigation";
|
|
1895
1969
|
import { RefreshCw } from "lucide-react";
|
|
1896
|
-
import { Fragment as
|
|
1970
|
+
import { Fragment as Fragment6, jsx as jsx32, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1897
1971
|
function HotReloadIndicator() {
|
|
1898
|
-
const [isReloading, setIsReloading] =
|
|
1899
|
-
const [lastReload, setLastReload] =
|
|
1900
|
-
const pathname =
|
|
1972
|
+
const [isReloading, setIsReloading] = useState15(false);
|
|
1973
|
+
const [lastReload, setLastReload] = useState15(null);
|
|
1974
|
+
const pathname = usePathname3();
|
|
1901
1975
|
useEffect8(() => {
|
|
1902
1976
|
if (process.env.NODE_ENV !== "development") return;
|
|
1903
1977
|
setIsReloading(true);
|
|
@@ -1928,14 +2002,14 @@ function HotReloadIndicator() {
|
|
|
1928
2002
|
};
|
|
1929
2003
|
}, []);
|
|
1930
2004
|
if (process.env.NODE_ENV !== "development") return null;
|
|
1931
|
-
return /* @__PURE__ */
|
|
1932
|
-
isReloading && /* @__PURE__ */
|
|
1933
|
-
/* @__PURE__ */
|
|
1934
|
-
/* @__PURE__ */
|
|
2005
|
+
return /* @__PURE__ */ jsxs24(Fragment6, { children: [
|
|
2006
|
+
isReloading && /* @__PURE__ */ jsxs24("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: [
|
|
2007
|
+
/* @__PURE__ */ jsx32(RefreshCw, { className: "h-4 w-4 animate-spin" }),
|
|
2008
|
+
/* @__PURE__ */ jsx32("span", { className: "text-sm font-medium", children: "Reloading..." })
|
|
1935
2009
|
] }),
|
|
1936
|
-
lastReload && !isReloading && /* @__PURE__ */
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */
|
|
2010
|
+
lastReload && !isReloading && /* @__PURE__ */ jsxs24("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: [
|
|
2011
|
+
/* @__PURE__ */ jsx32(RefreshCw, { className: "h-4 w-4" }),
|
|
2012
|
+
/* @__PURE__ */ jsxs24("span", { className: "text-sm font-medium", children: [
|
|
1939
2013
|
"Updated at ",
|
|
1940
2014
|
lastReload.toLocaleTimeString()
|
|
1941
2015
|
] })
|
|
@@ -1946,7 +2020,7 @@ function HotReloadIndicator() {
|
|
|
1946
2020
|
// src/components/docs/image-card.tsx
|
|
1947
2021
|
import NextImage from "next/image";
|
|
1948
2022
|
import Link8 from "next/link";
|
|
1949
|
-
import { jsx as
|
|
2023
|
+
import { jsx as jsx33, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1950
2024
|
function ImageCard({
|
|
1951
2025
|
src,
|
|
1952
2026
|
alt,
|
|
@@ -1961,8 +2035,8 @@ function ImageCard({
|
|
|
1961
2035
|
video: "aspect-video",
|
|
1962
2036
|
portrait: "aspect-[3/4]"
|
|
1963
2037
|
};
|
|
1964
|
-
const content = /* @__PURE__ */
|
|
1965
|
-
/* @__PURE__ */
|
|
2038
|
+
const content = /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-0 p-0", children: [
|
|
2039
|
+
/* @__PURE__ */ jsx33("div", { className: `w-full ${aspectRatios[aspectRatio]} overflow-hidden ${title || description ? "rounded-t-xl" : "rounded-xl"} bg-muted relative`, children: /* @__PURE__ */ jsx33(
|
|
1966
2040
|
NextImage,
|
|
1967
2041
|
{
|
|
1968
2042
|
src,
|
|
@@ -1972,14 +2046,14 @@ function ImageCard({
|
|
|
1972
2046
|
className: "object-cover transition-transform duration-300 group-hover:scale-105"
|
|
1973
2047
|
}
|
|
1974
2048
|
) }),
|
|
1975
|
-
(title || description) && /* @__PURE__ */
|
|
1976
|
-
title && /* @__PURE__ */
|
|
1977
|
-
description && /* @__PURE__ */
|
|
2049
|
+
(title || description) && /* @__PURE__ */ jsxs25("div", { className: "p-3 flex flex-col gap-1", children: [
|
|
2050
|
+
title && /* @__PURE__ */ jsx33("h3", { className: `font-semibold text-foreground mb-0 no-underline ${href ? "group-hover:text-primary transition-colors" : ""}`, children: title }),
|
|
2051
|
+
description && /* @__PURE__ */ jsx33("p", { className: "text-sm text-muted-foreground line-clamp-2 no-underline mb-0", children: description })
|
|
1978
2052
|
] })
|
|
1979
2053
|
] });
|
|
1980
2054
|
if (href) {
|
|
1981
2055
|
const Component = external ? "a" : Link8;
|
|
1982
|
-
return /* @__PURE__ */
|
|
2056
|
+
return /* @__PURE__ */ jsx33(
|
|
1983
2057
|
Component,
|
|
1984
2058
|
{
|
|
1985
2059
|
href,
|
|
@@ -1989,7 +2063,7 @@ function ImageCard({
|
|
|
1989
2063
|
}
|
|
1990
2064
|
);
|
|
1991
2065
|
}
|
|
1992
|
-
return /* @__PURE__ */
|
|
2066
|
+
return /* @__PURE__ */ jsx33("div", { className: "block rounded-xl border border-border overflow-hidden bg-card p-0", children: content });
|
|
1993
2067
|
}
|
|
1994
2068
|
function ImageCardGrid({ children, cols = 3 }) {
|
|
1995
2069
|
const gridCols = {
|
|
@@ -1998,20 +2072,20 @@ function ImageCardGrid({ children, cols = 3 }) {
|
|
|
1998
2072
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
|
|
1999
2073
|
4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
|
|
2000
2074
|
};
|
|
2001
|
-
return /* @__PURE__ */
|
|
2075
|
+
return /* @__PURE__ */ jsx33("div", { className: `grid ${gridCols[cols]} gap-4 my-6`, children });
|
|
2002
2076
|
}
|
|
2003
2077
|
|
|
2004
2078
|
// src/components/docs/image.tsx
|
|
2005
2079
|
import NextImage2 from "next/image";
|
|
2006
|
-
import { useState as
|
|
2080
|
+
import { useState as useState16 } from "react";
|
|
2007
2081
|
import { ZoomIn, X as X2 } from "lucide-react";
|
|
2008
|
-
import { Fragment as
|
|
2082
|
+
import { Fragment as Fragment7, jsx as jsx34, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2009
2083
|
function Image({ src, alt, caption, width, height, zoom = true }) {
|
|
2010
|
-
const [isZoomed, setIsZoomed] =
|
|
2011
|
-
return /* @__PURE__ */
|
|
2012
|
-
/* @__PURE__ */
|
|
2013
|
-
/* @__PURE__ */
|
|
2014
|
-
/* @__PURE__ */
|
|
2084
|
+
const [isZoomed, setIsZoomed] = useState16(false);
|
|
2085
|
+
return /* @__PURE__ */ jsxs26(Fragment7, { children: [
|
|
2086
|
+
/* @__PURE__ */ jsxs26("figure", { className: "my-6", children: [
|
|
2087
|
+
/* @__PURE__ */ jsxs26("div", { className: "relative group rounded-xl border border-border overflow-hidden bg-muted/30", children: [
|
|
2088
|
+
/* @__PURE__ */ jsx34(
|
|
2015
2089
|
NextImage2,
|
|
2016
2090
|
{
|
|
2017
2091
|
src,
|
|
@@ -2021,34 +2095,34 @@ function Image({ src, alt, caption, width, height, zoom = true }) {
|
|
|
2021
2095
|
className: "w-full h-auto"
|
|
2022
2096
|
}
|
|
2023
2097
|
),
|
|
2024
|
-
zoom && /* @__PURE__ */
|
|
2098
|
+
zoom && /* @__PURE__ */ jsx34(
|
|
2025
2099
|
"button",
|
|
2026
2100
|
{
|
|
2027
2101
|
onClick: () => setIsZoomed(true),
|
|
2028
2102
|
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",
|
|
2029
2103
|
"aria-label": "Zoom image",
|
|
2030
|
-
children: /* @__PURE__ */
|
|
2104
|
+
children: /* @__PURE__ */ jsx34(ZoomIn, { className: "h-4 w-4 text-foreground" })
|
|
2031
2105
|
}
|
|
2032
2106
|
)
|
|
2033
2107
|
] }),
|
|
2034
|
-
caption && /* @__PURE__ */
|
|
2108
|
+
caption && /* @__PURE__ */ jsx34("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground italic", children: caption })
|
|
2035
2109
|
] }),
|
|
2036
|
-
isZoomed && /* @__PURE__ */
|
|
2110
|
+
isZoomed && /* @__PURE__ */ jsxs26(
|
|
2037
2111
|
"div",
|
|
2038
2112
|
{
|
|
2039
2113
|
className: "fixed inset-0 z-50 bg-background/95 backdrop-blur-sm flex items-center justify-center p-4",
|
|
2040
2114
|
onClick: () => setIsZoomed(false),
|
|
2041
2115
|
children: [
|
|
2042
|
-
/* @__PURE__ */
|
|
2116
|
+
/* @__PURE__ */ jsx34(
|
|
2043
2117
|
"button",
|
|
2044
2118
|
{
|
|
2045
2119
|
onClick: () => setIsZoomed(false),
|
|
2046
2120
|
className: "absolute top-4 right-4 p-2 rounded-md bg-muted hover:bg-muted/80 transition-colors",
|
|
2047
2121
|
"aria-label": "Close",
|
|
2048
|
-
children: /* @__PURE__ */
|
|
2122
|
+
children: /* @__PURE__ */ jsx34(X2, { className: "h-5 w-5 text-foreground" })
|
|
2049
2123
|
}
|
|
2050
2124
|
),
|
|
2051
|
-
/* @__PURE__ */
|
|
2125
|
+
/* @__PURE__ */ jsx34("div", { className: "max-w-7xl max-h-[90vh] overflow-auto", children: /* @__PURE__ */ jsx34(
|
|
2052
2126
|
NextImage2,
|
|
2053
2127
|
{
|
|
2054
2128
|
src,
|
|
@@ -2066,7 +2140,7 @@ function Image({ src, alt, caption, width, height, zoom = true }) {
|
|
|
2066
2140
|
|
|
2067
2141
|
// src/components/docs/math.tsx
|
|
2068
2142
|
import { useEffect as useEffect9, useRef as useRef2 } from "react";
|
|
2069
|
-
import { jsx as
|
|
2143
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2070
2144
|
function Math2({ children, block = false }) {
|
|
2071
2145
|
const containerRef = useRef2(null);
|
|
2072
2146
|
useEffect9(() => {
|
|
@@ -2089,7 +2163,7 @@ function Math2({ children, block = false }) {
|
|
|
2089
2163
|
renderMath();
|
|
2090
2164
|
}, [children, block]);
|
|
2091
2165
|
if (block) {
|
|
2092
|
-
return /* @__PURE__ */
|
|
2166
|
+
return /* @__PURE__ */ jsx35(
|
|
2093
2167
|
"div",
|
|
2094
2168
|
{
|
|
2095
2169
|
ref: containerRef,
|
|
@@ -2097,14 +2171,14 @@ function Math2({ children, block = false }) {
|
|
|
2097
2171
|
}
|
|
2098
2172
|
);
|
|
2099
2173
|
}
|
|
2100
|
-
return /* @__PURE__ */
|
|
2174
|
+
return /* @__PURE__ */ jsx35("span", { ref: containerRef, className: "inline-block" });
|
|
2101
2175
|
}
|
|
2102
2176
|
|
|
2103
2177
|
// src/components/docs/mdx-hot-reload.tsx
|
|
2104
2178
|
import { useEffect as useEffect10 } from "react";
|
|
2105
|
-
import { useRouter as
|
|
2179
|
+
import { useRouter as useRouter5 } from "next/navigation";
|
|
2106
2180
|
function MdxHotReload() {
|
|
2107
|
-
const router =
|
|
2181
|
+
const router = useRouter5();
|
|
2108
2182
|
useEffect10(() => {
|
|
2109
2183
|
if (process.env.NODE_ENV !== "development") return;
|
|
2110
2184
|
const eventSource = new EventSource("/api/mdx-watch");
|
|
@@ -2129,11 +2203,11 @@ function MdxHotReload() {
|
|
|
2129
2203
|
}
|
|
2130
2204
|
|
|
2131
2205
|
// src/components/docs/mermaid.tsx
|
|
2132
|
-
import { useEffect as useEffect11, useRef as useRef3, useState as
|
|
2133
|
-
import { jsx as
|
|
2206
|
+
import { useEffect as useEffect11, useRef as useRef3, useState as useState17 } from "react";
|
|
2207
|
+
import { jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2134
2208
|
function Mermaid({ chart, caption }) {
|
|
2135
2209
|
const containerRef = useRef3(null);
|
|
2136
|
-
const [error, setError] =
|
|
2210
|
+
const [error, setError] = useState17(null);
|
|
2137
2211
|
useEffect11(() => {
|
|
2138
2212
|
const renderChart = async () => {
|
|
2139
2213
|
try {
|
|
@@ -2166,63 +2240,63 @@ function Mermaid({ chart, caption }) {
|
|
|
2166
2240
|
return () => observer.disconnect();
|
|
2167
2241
|
}, [chart]);
|
|
2168
2242
|
if (error) {
|
|
2169
|
-
return /* @__PURE__ */
|
|
2243
|
+
return /* @__PURE__ */ jsx36("div", { className: "my-6 p-4 rounded-xl border border-red-500/50 bg-red-500/10", children: /* @__PURE__ */ jsxs27("p", { className: "text-sm text-red-600 dark:text-red-400 font-mono", children: [
|
|
2170
2244
|
"Mermaid Error: ",
|
|
2171
2245
|
error
|
|
2172
2246
|
] }) });
|
|
2173
2247
|
}
|
|
2174
|
-
return /* @__PURE__ */
|
|
2175
|
-
/* @__PURE__ */
|
|
2248
|
+
return /* @__PURE__ */ jsxs27("figure", { className: "my-6", children: [
|
|
2249
|
+
/* @__PURE__ */ jsx36(
|
|
2176
2250
|
"div",
|
|
2177
2251
|
{
|
|
2178
2252
|
ref: containerRef,
|
|
2179
2253
|
className: "flex justify-center items-center p-6 rounded-xl border border-border bg-muted/30 overflow-x-auto"
|
|
2180
2254
|
}
|
|
2181
2255
|
),
|
|
2182
|
-
caption && /* @__PURE__ */
|
|
2256
|
+
caption && /* @__PURE__ */ jsx36("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground italic", children: caption })
|
|
2183
2257
|
] });
|
|
2184
2258
|
}
|
|
2185
2259
|
|
|
2186
2260
|
// src/components/docs/not-found-content.tsx
|
|
2187
2261
|
import Link9 from "next/link";
|
|
2188
2262
|
import { AlertTriangle as AlertTriangle2, Home, ArrowLeft } from "lucide-react";
|
|
2189
|
-
import { jsx as
|
|
2263
|
+
import { jsx as jsx37, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2190
2264
|
function NotFoundContent({ version }) {
|
|
2191
|
-
return /* @__PURE__ */
|
|
2192
|
-
/* @__PURE__ */
|
|
2193
|
-
/* @__PURE__ */
|
|
2194
|
-
/* @__PURE__ */
|
|
2195
|
-
/* @__PURE__ */
|
|
2265
|
+
return /* @__PURE__ */ jsx37("div", { className: "flex min-h-[calc(100vh-12rem)] items-center justify-center px-4 py-12", children: /* @__PURE__ */ jsxs28("div", { className: "w-full max-w-2xl text-center", children: [
|
|
2266
|
+
/* @__PURE__ */ jsx37("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ jsx37("div", { className: "rounded-full bg-yellow-500/10 p-4", children: /* @__PURE__ */ jsx37(AlertTriangle2, { className: "h-16 w-16 text-yellow-500" }) }) }),
|
|
2267
|
+
/* @__PURE__ */ jsx37("h1", { className: "mb-3 text-5xl font-bold tracking-tight", children: "404" }),
|
|
2268
|
+
/* @__PURE__ */ jsx37("h2", { className: "mb-4 text-2xl font-semibold", children: "Page Not Found" }),
|
|
2269
|
+
/* @__PURE__ */ jsxs28("p", { className: "mb-8 text-base text-muted-foreground", children: [
|
|
2196
2270
|
"The documentation page you're looking for doesn't exist or may have been moved.",
|
|
2197
|
-
/* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ jsx37("br", {}),
|
|
2198
2272
|
"Try using the sidebar to find what you're looking for, or return to the documentation home."
|
|
2199
2273
|
] }),
|
|
2200
|
-
/* @__PURE__ */
|
|
2201
|
-
/* @__PURE__ */
|
|
2274
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center justify-center gap-3 sm:flex-row", children: [
|
|
2275
|
+
/* @__PURE__ */ jsxs28(
|
|
2202
2276
|
Link9,
|
|
2203
2277
|
{
|
|
2204
2278
|
href: `/docs/${version}`,
|
|
2205
2279
|
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",
|
|
2206
2280
|
children: [
|
|
2207
|
-
/* @__PURE__ */
|
|
2281
|
+
/* @__PURE__ */ jsx37(ArrowLeft, { className: "h-4 w-4" }),
|
|
2208
2282
|
"Back to Documentation"
|
|
2209
2283
|
]
|
|
2210
2284
|
}
|
|
2211
2285
|
),
|
|
2212
|
-
/* @__PURE__ */
|
|
2286
|
+
/* @__PURE__ */ jsxs28(
|
|
2213
2287
|
Link9,
|
|
2214
2288
|
{
|
|
2215
2289
|
href: "/",
|
|
2216
2290
|
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",
|
|
2217
2291
|
children: [
|
|
2218
|
-
/* @__PURE__ */
|
|
2292
|
+
/* @__PURE__ */ jsx37(Home, { className: "h-4 w-4" }),
|
|
2219
2293
|
"Go to Homepage"
|
|
2220
2294
|
]
|
|
2221
2295
|
}
|
|
2222
2296
|
)
|
|
2223
2297
|
] }),
|
|
2224
|
-
/* @__PURE__ */
|
|
2225
|
-
/* @__PURE__ */
|
|
2298
|
+
/* @__PURE__ */ jsx37("div", { className: "mt-12 rounded-lg border border-border bg-muted/30 p-6", children: /* @__PURE__ */ jsxs28("p", { className: "text-sm text-muted-foreground", children: [
|
|
2299
|
+
/* @__PURE__ */ jsx37("strong", { className: "font-medium text-foreground", children: "Tip:" }),
|
|
2226
2300
|
" Use the sidebar navigation on the left to browse all available documentation pages."
|
|
2227
2301
|
] }) })
|
|
2228
2302
|
] }) });
|
|
@@ -2328,20 +2402,20 @@ function escapeRegex(string) {
|
|
|
2328
2402
|
}
|
|
2329
2403
|
|
|
2330
2404
|
// src/components/docs/sidebar-skeleton.tsx
|
|
2331
|
-
import { jsx as
|
|
2405
|
+
import { jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2332
2406
|
function SidebarSkeleton() {
|
|
2333
|
-
return /* @__PURE__ */
|
|
2334
|
-
/* @__PURE__ */
|
|
2335
|
-
/* @__PURE__ */
|
|
2407
|
+
return /* @__PURE__ */ jsx38("aside", { className: "w-64 pr-8 py-6", children: /* @__PURE__ */ jsxs29("div", { className: "space-y-6", children: [
|
|
2408
|
+
/* @__PURE__ */ jsx38("div", { className: "px-2", children: /* @__PURE__ */ jsx38("div", { className: "h-5 w-32 bg-muted/50 rounded animate-pulse" }) }),
|
|
2409
|
+
/* @__PURE__ */ jsx38("div", { className: "space-y-1", children: [...Array(8)].map((_, i) => /* @__PURE__ */ jsx38("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsx38(
|
|
2336
2410
|
"div",
|
|
2337
2411
|
{
|
|
2338
2412
|
className: "h-4 bg-muted/50 rounded animate-pulse",
|
|
2339
2413
|
style: { width: `${60 + Math.random() * 40}%` }
|
|
2340
2414
|
}
|
|
2341
2415
|
) }, i)) }),
|
|
2342
|
-
/* @__PURE__ */
|
|
2343
|
-
/* @__PURE__ */
|
|
2344
|
-
[...Array(5)].map((_, i) => /* @__PURE__ */
|
|
2416
|
+
/* @__PURE__ */ jsxs29("div", { className: "space-y-1", children: [
|
|
2417
|
+
/* @__PURE__ */ jsx38("div", { className: "px-2 mb-2", children: /* @__PURE__ */ jsx38("div", { className: "h-4 w-24 bg-muted/50 rounded animate-pulse" }) }),
|
|
2418
|
+
[...Array(5)].map((_, i) => /* @__PURE__ */ jsx38("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsx38(
|
|
2345
2419
|
"div",
|
|
2346
2420
|
{
|
|
2347
2421
|
className: "h-4 bg-muted/50 rounded animate-pulse",
|
|
@@ -2353,22 +2427,22 @@ function SidebarSkeleton() {
|
|
|
2353
2427
|
}
|
|
2354
2428
|
|
|
2355
2429
|
// src/components/docs/steps.tsx
|
|
2356
|
-
import { jsx as
|
|
2430
|
+
import { jsx as jsx39, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2357
2431
|
function Steps({ children }) {
|
|
2358
|
-
return /* @__PURE__ */
|
|
2432
|
+
return /* @__PURE__ */ jsx39("div", { className: "my-6 ml-4 space-y-6 [counter-reset:step]", children });
|
|
2359
2433
|
}
|
|
2360
2434
|
function Step({ title, children }) {
|
|
2361
|
-
return /* @__PURE__ */
|
|
2362
|
-
/* @__PURE__ */
|
|
2363
|
-
/* @__PURE__ */
|
|
2435
|
+
return /* @__PURE__ */ jsxs30("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: [
|
|
2436
|
+
/* @__PURE__ */ jsx39("div", { className: "mb-2", children: /* @__PURE__ */ jsx39("h3", { className: "text-lg font-semibold text-foreground", children: title }) }),
|
|
2437
|
+
/* @__PURE__ */ jsx39("div", { className: "prose prose-sm dark:prose-invert max-w-none [&>*:last-child]:mb-0", children })
|
|
2364
2438
|
] });
|
|
2365
2439
|
}
|
|
2366
2440
|
|
|
2367
2441
|
// src/components/docs/table-of-contents.tsx
|
|
2368
|
-
import { useEffect as useEffect13, useState as
|
|
2369
|
-
import { jsx as
|
|
2442
|
+
import { useEffect as useEffect13, useState as useState18 } from "react";
|
|
2443
|
+
import { jsx as jsx40, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2370
2444
|
function TableOfContents({ items, config }) {
|
|
2371
|
-
const [activeId, setActiveId] =
|
|
2445
|
+
const [activeId, setActiveId] = useState18("");
|
|
2372
2446
|
if (!config.navigation?.showTableOfContents) {
|
|
2373
2447
|
return null;
|
|
2374
2448
|
}
|
|
@@ -2411,9 +2485,9 @@ function TableOfContents({ items, config }) {
|
|
|
2411
2485
|
};
|
|
2412
2486
|
const stickyTop = hasTabGroups ? "top-[7.5rem]" : "top-24";
|
|
2413
2487
|
const maxHeight = hasTabGroups ? "max-h-[calc(100vh-10rem)]" : "max-h-[calc(100vh-7rem)]";
|
|
2414
|
-
return /* @__PURE__ */
|
|
2415
|
-
/* @__PURE__ */
|
|
2416
|
-
/* @__PURE__ */
|
|
2488
|
+
return /* @__PURE__ */ jsx40("aside", { className: `w-64 hidden xl:block shrink-0 sticky ${stickyTop} self-start`, children: filteredItems.length > 0 && /* @__PURE__ */ jsxs31("div", { className: `${maxHeight} overflow-y-auto bg-muted/30 dark:bg-muted/10 rounded-2xl p-4 border border-border/50`, children: [
|
|
2489
|
+
/* @__PURE__ */ jsx40("h3", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-4 px-2", children: "On this page" }),
|
|
2490
|
+
/* @__PURE__ */ jsx40("nav", { className: "space-y-1", children: filteredItems.map((item, index) => /* @__PURE__ */ jsx40(
|
|
2417
2491
|
"a",
|
|
2418
2492
|
{
|
|
2419
2493
|
href: `#${item.id}`,
|
|
@@ -2427,20 +2501,20 @@ function TableOfContents({ items, config }) {
|
|
|
2427
2501
|
}
|
|
2428
2502
|
|
|
2429
2503
|
// src/components/docs/tabs.tsx
|
|
2430
|
-
import { useState as
|
|
2431
|
-
import { Fragment as
|
|
2504
|
+
import { useState as useState19, Children, isValidElement as isValidElement3 } from "react";
|
|
2505
|
+
import { Fragment as Fragment8, jsx as jsx41, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2432
2506
|
function Tab({ children }) {
|
|
2433
|
-
return /* @__PURE__ */
|
|
2507
|
+
return /* @__PURE__ */ jsx41(Fragment8, { children });
|
|
2434
2508
|
}
|
|
2435
2509
|
function Tabs({ children, defaultValue }) {
|
|
2436
2510
|
const tabs = Children.toArray(children).filter(isValidElement3);
|
|
2437
2511
|
const firstTabLabel = tabs[0]?.props.label || "";
|
|
2438
|
-
const [activeTab, setActiveTab] =
|
|
2439
|
-
return /* @__PURE__ */
|
|
2440
|
-
/* @__PURE__ */
|
|
2512
|
+
const [activeTab, setActiveTab] = useState19(defaultValue || firstTabLabel);
|
|
2513
|
+
return /* @__PURE__ */ jsxs32("div", { className: "my-6", children: [
|
|
2514
|
+
/* @__PURE__ */ jsx41("div", { className: "flex items-center gap-1 border-b border-border mb-4", children: tabs.map((tab) => {
|
|
2441
2515
|
const label = tab.props.label;
|
|
2442
2516
|
const isActive = activeTab === label;
|
|
2443
|
-
return /* @__PURE__ */
|
|
2517
|
+
return /* @__PURE__ */ jsx41(
|
|
2444
2518
|
"button",
|
|
2445
2519
|
{
|
|
2446
2520
|
onClick: () => setActiveTab(label),
|
|
@@ -2453,23 +2527,23 @@ function Tabs({ children, defaultValue }) {
|
|
|
2453
2527
|
tabs.map((tab) => {
|
|
2454
2528
|
const label = tab.props.label;
|
|
2455
2529
|
if (activeTab !== label) return null;
|
|
2456
|
-
return /* @__PURE__ */
|
|
2530
|
+
return /* @__PURE__ */ jsx41("div", { className: "prose prose-slate dark:prose-invert max-w-none [&>*:first-child]:mt-0", children: tab.props.children }, label);
|
|
2457
2531
|
})
|
|
2458
2532
|
] });
|
|
2459
2533
|
}
|
|
2460
2534
|
|
|
2461
2535
|
// src/components/docs/tooltip.tsx
|
|
2462
|
-
import { useState as
|
|
2463
|
-
import { jsx as
|
|
2536
|
+
import { useState as useState20 } from "react";
|
|
2537
|
+
import { jsx as jsx42, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2464
2538
|
function Tooltip({ children, content, position = "top" }) {
|
|
2465
|
-
const [isVisible, setIsVisible] =
|
|
2539
|
+
const [isVisible, setIsVisible] = useState20(false);
|
|
2466
2540
|
const positions = {
|
|
2467
2541
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
2468
2542
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
2469
2543
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
2470
2544
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
2471
2545
|
};
|
|
2472
|
-
return /* @__PURE__ */
|
|
2546
|
+
return /* @__PURE__ */ jsxs33(
|
|
2473
2547
|
"span",
|
|
2474
2548
|
{
|
|
2475
2549
|
className: "relative inline-flex underline decoration-dotted cursor-help",
|
|
@@ -2477,7 +2551,7 @@ function Tooltip({ children, content, position = "top" }) {
|
|
|
2477
2551
|
onMouseLeave: () => setIsVisible(false),
|
|
2478
2552
|
children: [
|
|
2479
2553
|
children,
|
|
2480
|
-
isVisible && /* @__PURE__ */
|
|
2554
|
+
isVisible && /* @__PURE__ */ jsx42(
|
|
2481
2555
|
"span",
|
|
2482
2556
|
{
|
|
2483
2557
|
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`,
|
|
@@ -2490,7 +2564,7 @@ function Tooltip({ children, content, position = "top" }) {
|
|
|
2490
2564
|
}
|
|
2491
2565
|
|
|
2492
2566
|
// src/components/docs/video.tsx
|
|
2493
|
-
import { jsx as
|
|
2567
|
+
import { jsx as jsx43, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2494
2568
|
function Video({
|
|
2495
2569
|
src,
|
|
2496
2570
|
caption,
|
|
@@ -2510,8 +2584,8 @@ function Video({
|
|
|
2510
2584
|
const match = url.match(/vimeo\.com\/(\d+)/);
|
|
2511
2585
|
return match ? match[1] : null;
|
|
2512
2586
|
};
|
|
2513
|
-
return /* @__PURE__ */
|
|
2514
|
-
/* @__PURE__ */
|
|
2587
|
+
return /* @__PURE__ */ jsxs34("figure", { className: "my-6", children: [
|
|
2588
|
+
/* @__PURE__ */ jsx43("div", { className: "relative rounded-xl border border-border overflow-hidden bg-muted/30", children: isYouTube ? /* @__PURE__ */ jsx43("div", { className: "relative w-full", style: { paddingBottom: "56.25%" }, children: /* @__PURE__ */ jsx43(
|
|
2515
2589
|
"iframe",
|
|
2516
2590
|
{
|
|
2517
2591
|
className: "absolute top-0 left-0 w-full h-full",
|
|
@@ -2520,7 +2594,7 @@ function Video({
|
|
|
2520
2594
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
2521
2595
|
allowFullScreen: true
|
|
2522
2596
|
}
|
|
2523
|
-
) }) : isVimeo ? /* @__PURE__ */
|
|
2597
|
+
) }) : isVimeo ? /* @__PURE__ */ jsx43("div", { className: "relative w-full", style: { paddingBottom: "56.25%" }, children: /* @__PURE__ */ jsx43(
|
|
2524
2598
|
"iframe",
|
|
2525
2599
|
{
|
|
2526
2600
|
className: "absolute top-0 left-0 w-full h-full",
|
|
@@ -2529,7 +2603,7 @@ function Video({
|
|
|
2529
2603
|
allow: "autoplay; fullscreen; picture-in-picture",
|
|
2530
2604
|
allowFullScreen: true
|
|
2531
2605
|
}
|
|
2532
|
-
) }) : /* @__PURE__ */
|
|
2606
|
+
) }) : /* @__PURE__ */ jsx43(
|
|
2533
2607
|
"video",
|
|
2534
2608
|
{
|
|
2535
2609
|
src,
|
|
@@ -2542,14 +2616,14 @@ function Video({
|
|
|
2542
2616
|
children: "Your browser does not support the video tag."
|
|
2543
2617
|
}
|
|
2544
2618
|
) }),
|
|
2545
|
-
caption && /* @__PURE__ */
|
|
2619
|
+
caption && /* @__PURE__ */ jsx43("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground italic", children: caption })
|
|
2546
2620
|
] });
|
|
2547
2621
|
}
|
|
2548
2622
|
|
|
2549
2623
|
// src/components/docs/api/api-endpoint.tsx
|
|
2550
|
-
import { useState as
|
|
2551
|
-
import { ChevronDown as
|
|
2552
|
-
import { jsx as
|
|
2624
|
+
import { useState as useState21 } from "react";
|
|
2625
|
+
import { ChevronDown as ChevronDown6 } from "lucide-react";
|
|
2626
|
+
import { jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2553
2627
|
var methodColors = {
|
|
2554
2628
|
GET: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
|
|
2555
2629
|
POST: "bg-green-500/10 text-green-600 dark:text-green-400",
|
|
@@ -2558,15 +2632,15 @@ var methodColors = {
|
|
|
2558
2632
|
DELETE: "bg-red-500/10 text-red-600 dark:text-red-400"
|
|
2559
2633
|
};
|
|
2560
2634
|
function ApiEndpoint({ method, path, summary, children, defaultOpen = false }) {
|
|
2561
|
-
const [isOpen, setIsOpen] =
|
|
2562
|
-
return /* @__PURE__ */
|
|
2563
|
-
/* @__PURE__ */
|
|
2635
|
+
const [isOpen, setIsOpen] = useState21(defaultOpen);
|
|
2636
|
+
return /* @__PURE__ */ jsxs35("div", { className: "not-prose mb-4 rounded-xl border border-border overflow-hidden", children: [
|
|
2637
|
+
/* @__PURE__ */ jsxs35(
|
|
2564
2638
|
"button",
|
|
2565
2639
|
{
|
|
2566
2640
|
onClick: () => setIsOpen(!isOpen),
|
|
2567
2641
|
className: "w-full flex items-center gap-3 px-4 py-3 text-left bg-muted/30 hover:bg-muted/50 transition-colors",
|
|
2568
2642
|
children: [
|
|
2569
|
-
/* @__PURE__ */
|
|
2643
|
+
/* @__PURE__ */ jsx44(
|
|
2570
2644
|
"span",
|
|
2571
2645
|
{
|
|
2572
2646
|
className: cn(
|
|
@@ -2576,10 +2650,10 @@ function ApiEndpoint({ method, path, summary, children, defaultOpen = false }) {
|
|
|
2576
2650
|
children: method
|
|
2577
2651
|
}
|
|
2578
2652
|
),
|
|
2579
|
-
/* @__PURE__ */
|
|
2580
|
-
summary && /* @__PURE__ */
|
|
2581
|
-
/* @__PURE__ */
|
|
2582
|
-
|
|
2653
|
+
/* @__PURE__ */ jsx44("code", { className: "text-sm font-mono", children: path }),
|
|
2654
|
+
summary && /* @__PURE__ */ jsx44("span", { className: "text-sm text-muted-foreground ml-auto mr-2", children: summary }),
|
|
2655
|
+
/* @__PURE__ */ jsx44(
|
|
2656
|
+
ChevronDown6,
|
|
2583
2657
|
{
|
|
2584
2658
|
className: cn(
|
|
2585
2659
|
"h-5 w-5 text-muted-foreground transition-transform flex-shrink-0",
|
|
@@ -2590,34 +2664,34 @@ function ApiEndpoint({ method, path, summary, children, defaultOpen = false }) {
|
|
|
2590
2664
|
]
|
|
2591
2665
|
}
|
|
2592
2666
|
),
|
|
2593
|
-
isOpen && children && /* @__PURE__ */
|
|
2667
|
+
isOpen && children && /* @__PURE__ */ jsx44("div", { className: "border-t border-border bg-background", children: /* @__PURE__ */ jsx44("div", { className: "px-4 py-4 space-y-6", children }) })
|
|
2594
2668
|
] });
|
|
2595
2669
|
}
|
|
2596
2670
|
|
|
2597
2671
|
// src/components/docs/api/api-params.tsx
|
|
2598
|
-
import { jsx as
|
|
2672
|
+
import { jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2599
2673
|
function ApiParams({ title = "Parameters", params }) {
|
|
2600
2674
|
if (!params || params.length === 0) return null;
|
|
2601
|
-
return /* @__PURE__ */
|
|
2602
|
-
/* @__PURE__ */
|
|
2603
|
-
/* @__PURE__ */
|
|
2604
|
-
/* @__PURE__ */
|
|
2605
|
-
/* @__PURE__ */
|
|
2606
|
-
/* @__PURE__ */
|
|
2607
|
-
/* @__PURE__ */
|
|
2608
|
-
/* @__PURE__ */
|
|
2609
|
-
/* @__PURE__ */
|
|
2675
|
+
return /* @__PURE__ */ jsxs36("div", { className: "mb-6", children: [
|
|
2676
|
+
/* @__PURE__ */ jsx45("h4", { className: "text-sm font-semibold text-foreground mb-3", children: title }),
|
|
2677
|
+
/* @__PURE__ */ jsx45("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs36("table", { className: "w-full border-collapse", children: [
|
|
2678
|
+
/* @__PURE__ */ jsx45("thead", { children: /* @__PURE__ */ jsxs36("tr", { className: "border-b border-border", children: [
|
|
2679
|
+
/* @__PURE__ */ jsx45("th", { className: "text-left py-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: "Property" }),
|
|
2680
|
+
/* @__PURE__ */ jsx45("th", { className: "text-left py-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: "Type" }),
|
|
2681
|
+
/* @__PURE__ */ jsx45("th", { className: "text-left py-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: "Required" }),
|
|
2682
|
+
/* @__PURE__ */ jsx45("th", { className: "text-left py-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: "Default" }),
|
|
2683
|
+
/* @__PURE__ */ jsx45("th", { className: "text-left py-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: "Description" })
|
|
2610
2684
|
] }) }),
|
|
2611
|
-
/* @__PURE__ */
|
|
2685
|
+
/* @__PURE__ */ jsx45("tbody", { children: params.map((param, index) => /* @__PURE__ */ jsxs36(
|
|
2612
2686
|
"tr",
|
|
2613
2687
|
{
|
|
2614
2688
|
className: index !== params.length - 1 ? "border-b border-border/50" : "",
|
|
2615
2689
|
children: [
|
|
2616
|
-
/* @__PURE__ */
|
|
2617
|
-
/* @__PURE__ */
|
|
2618
|
-
/* @__PURE__ */
|
|
2619
|
-
/* @__PURE__ */
|
|
2620
|
-
/* @__PURE__ */
|
|
2690
|
+
/* @__PURE__ */ jsx45("td", { className: "py-2.5 px-3", children: /* @__PURE__ */ jsx45("code", { className: "text-sm font-mono text-foreground", children: param.name }) }),
|
|
2691
|
+
/* @__PURE__ */ jsx45("td", { className: "py-2.5 px-3", children: /* @__PURE__ */ jsx45("span", { className: "text-sm text-muted-foreground font-mono", children: param.type }) }),
|
|
2692
|
+
/* @__PURE__ */ jsx45("td", { className: "py-2.5 px-3", children: param.required ? /* @__PURE__ */ jsx45("span", { className: "text-sm text-red-600 dark:text-red-400", children: "Yes" }) : /* @__PURE__ */ jsx45("span", { className: "text-sm text-muted-foreground", children: "No" }) }),
|
|
2693
|
+
/* @__PURE__ */ jsx45("td", { className: "py-2.5 px-3", children: param.default ? /* @__PURE__ */ jsx45("code", { className: "text-sm font-mono text-muted-foreground", children: param.default }) : /* @__PURE__ */ jsx45("span", { className: "text-sm text-muted-foreground", children: "-" }) }),
|
|
2694
|
+
/* @__PURE__ */ jsx45("td", { className: "py-2.5 px-3", children: param.description ? /* @__PURE__ */ jsx45("span", { className: "text-sm text-muted-foreground", children: param.description }) : /* @__PURE__ */ jsx45("span", { className: "text-sm text-muted-foreground", children: "-" }) })
|
|
2621
2695
|
]
|
|
2622
2696
|
},
|
|
2623
2697
|
param.name
|
|
@@ -2627,7 +2701,7 @@ function ApiParams({ title = "Parameters", params }) {
|
|
|
2627
2701
|
}
|
|
2628
2702
|
|
|
2629
2703
|
// src/components/docs/api/api-response.tsx
|
|
2630
|
-
import { jsx as
|
|
2704
|
+
import { jsx as jsx46, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
2631
2705
|
var statusColors = {
|
|
2632
2706
|
"2": "text-green-600 dark:text-green-400",
|
|
2633
2707
|
"3": "text-blue-600 dark:text-blue-400",
|
|
@@ -2636,14 +2710,14 @@ var statusColors = {
|
|
|
2636
2710
|
};
|
|
2637
2711
|
function ApiResponse({ status, description, example, schema }) {
|
|
2638
2712
|
const statusClass = statusColors[String(status)[0]] || "text-muted-foreground";
|
|
2639
|
-
return /* @__PURE__ */
|
|
2640
|
-
/* @__PURE__ */
|
|
2641
|
-
/* @__PURE__ */
|
|
2642
|
-
description && /* @__PURE__ */
|
|
2713
|
+
return /* @__PURE__ */ jsxs37("div", { className: "mb-4", children: [
|
|
2714
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
2715
|
+
/* @__PURE__ */ jsx46("span", { className: `text-sm font-semibold ${statusClass}`, children: status }),
|
|
2716
|
+
description && /* @__PURE__ */ jsx46("span", { className: "text-sm text-muted-foreground", children: description })
|
|
2643
2717
|
] }),
|
|
2644
|
-
example && /* @__PURE__ */
|
|
2645
|
-
/* @__PURE__ */
|
|
2646
|
-
/* @__PURE__ */
|
|
2718
|
+
example && /* @__PURE__ */ jsxs37("div", { className: "mb-3", children: [
|
|
2719
|
+
/* @__PURE__ */ jsx46("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: "Example Response" }),
|
|
2720
|
+
/* @__PURE__ */ jsx46(
|
|
2647
2721
|
CodeBlock,
|
|
2648
2722
|
{
|
|
2649
2723
|
code: typeof example === "string" ? example : JSON.stringify(example, null, 2),
|
|
@@ -2651,9 +2725,9 @@ function ApiResponse({ status, description, example, schema }) {
|
|
|
2651
2725
|
}
|
|
2652
2726
|
)
|
|
2653
2727
|
] }),
|
|
2654
|
-
schema && /* @__PURE__ */
|
|
2655
|
-
/* @__PURE__ */
|
|
2656
|
-
/* @__PURE__ */
|
|
2728
|
+
schema && /* @__PURE__ */ jsxs37("div", { children: [
|
|
2729
|
+
/* @__PURE__ */ jsx46("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: "Schema" }),
|
|
2730
|
+
/* @__PURE__ */ jsx46(
|
|
2657
2731
|
CodeBlock,
|
|
2658
2732
|
{
|
|
2659
2733
|
code: typeof schema === "string" ? schema : JSON.stringify(schema, null, 2),
|
|
@@ -2665,12 +2739,12 @@ function ApiResponse({ status, description, example, schema }) {
|
|
|
2665
2739
|
}
|
|
2666
2740
|
|
|
2667
2741
|
// src/components/docs/api/api-playground.tsx
|
|
2668
|
-
import { useState as
|
|
2742
|
+
import { useState as useState22, useMemo } from "react";
|
|
2669
2743
|
|
|
2670
2744
|
// src/components/ui/button.tsx
|
|
2671
2745
|
import { Slot } from "@radix-ui/react-slot";
|
|
2672
2746
|
import { cva } from "class-variance-authority";
|
|
2673
|
-
import { jsx as
|
|
2747
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2674
2748
|
var buttonVariants = cva(
|
|
2675
2749
|
"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",
|
|
2676
2750
|
{
|
|
@@ -2706,7 +2780,7 @@ function Button({
|
|
|
2706
2780
|
...props
|
|
2707
2781
|
}) {
|
|
2708
2782
|
const Comp = asChild ? Slot : "button";
|
|
2709
|
-
return /* @__PURE__ */
|
|
2783
|
+
return /* @__PURE__ */ jsx47(
|
|
2710
2784
|
Comp,
|
|
2711
2785
|
{
|
|
2712
2786
|
"data-slot": "button",
|
|
@@ -2717,9 +2791,9 @@ function Button({
|
|
|
2717
2791
|
}
|
|
2718
2792
|
|
|
2719
2793
|
// src/components/ui/input.tsx
|
|
2720
|
-
import { jsx as
|
|
2794
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
2721
2795
|
function Input({ className, type, ...props }) {
|
|
2722
|
-
return /* @__PURE__ */
|
|
2796
|
+
return /* @__PURE__ */ jsx48(
|
|
2723
2797
|
"input",
|
|
2724
2798
|
{
|
|
2725
2799
|
type,
|
|
@@ -2736,9 +2810,9 @@ function Input({ className, type, ...props }) {
|
|
|
2736
2810
|
}
|
|
2737
2811
|
|
|
2738
2812
|
// src/components/ui/textarea.tsx
|
|
2739
|
-
import { jsx as
|
|
2813
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
2740
2814
|
function Textarea({ className, ...props }) {
|
|
2741
|
-
return /* @__PURE__ */
|
|
2815
|
+
return /* @__PURE__ */ jsx49(
|
|
2742
2816
|
"textarea",
|
|
2743
2817
|
{
|
|
2744
2818
|
"data-slot": "textarea",
|
|
@@ -2754,7 +2828,7 @@ function Textarea({ className, ...props }) {
|
|
|
2754
2828
|
// src/components/ui/badge.tsx
|
|
2755
2829
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
2756
2830
|
import { cva as cva2 } from "class-variance-authority";
|
|
2757
|
-
import { jsx as
|
|
2831
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
2758
2832
|
var badgeVariants = cva2(
|
|
2759
2833
|
"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",
|
|
2760
2834
|
{
|
|
@@ -2778,7 +2852,7 @@ function Badge2({
|
|
|
2778
2852
|
...props
|
|
2779
2853
|
}) {
|
|
2780
2854
|
const Comp = asChild ? Slot2 : "span";
|
|
2781
|
-
return /* @__PURE__ */
|
|
2855
|
+
return /* @__PURE__ */ jsx50(
|
|
2782
2856
|
Comp,
|
|
2783
2857
|
{
|
|
2784
2858
|
"data-slot": "badge",
|
|
@@ -2790,7 +2864,7 @@ function Badge2({
|
|
|
2790
2864
|
|
|
2791
2865
|
// src/components/docs/api/api-playground.tsx
|
|
2792
2866
|
import { Play, Loader2 as Loader22 } from "lucide-react";
|
|
2793
|
-
import { Fragment as
|
|
2867
|
+
import { Fragment as Fragment9, jsx as jsx51, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
2794
2868
|
function ApiPlayground({
|
|
2795
2869
|
method,
|
|
2796
2870
|
path,
|
|
@@ -2799,10 +2873,10 @@ function ApiPlayground({
|
|
|
2799
2873
|
defaultBody,
|
|
2800
2874
|
pathParams = []
|
|
2801
2875
|
}) {
|
|
2802
|
-
const [loading, setLoading] =
|
|
2803
|
-
const [response, setResponse] =
|
|
2804
|
-
const [error, setError] =
|
|
2805
|
-
const [requestBody, setRequestBody] =
|
|
2876
|
+
const [loading, setLoading] = useState22(false);
|
|
2877
|
+
const [response, setResponse] = useState22(null);
|
|
2878
|
+
const [error, setError] = useState22(null);
|
|
2879
|
+
const [requestBody, setRequestBody] = useState22(defaultBody || "");
|
|
2806
2880
|
const initialHeaders = useMemo(() => {
|
|
2807
2881
|
const cleanHeaders = {};
|
|
2808
2882
|
Object.entries(headers).forEach(([key, value]) => {
|
|
@@ -2810,7 +2884,7 @@ function ApiPlayground({
|
|
|
2810
2884
|
});
|
|
2811
2885
|
return cleanHeaders;
|
|
2812
2886
|
}, [headers]);
|
|
2813
|
-
const [requestHeaders, setRequestHeaders] =
|
|
2887
|
+
const [requestHeaders, setRequestHeaders] = useState22(JSON.stringify(initialHeaders, null, 2));
|
|
2814
2888
|
const extractedParams = useMemo(() => {
|
|
2815
2889
|
const params = {};
|
|
2816
2890
|
const pathParamPattern = /:(\w+)/g;
|
|
@@ -2828,7 +2902,7 @@ function ApiPlayground({
|
|
|
2828
2902
|
}
|
|
2829
2903
|
return params;
|
|
2830
2904
|
}, [path, pathParams]);
|
|
2831
|
-
const [pathParamValues, setPathParamValues] =
|
|
2905
|
+
const [pathParamValues, setPathParamValues] = useState22(extractedParams);
|
|
2832
2906
|
const buildUrl = () => {
|
|
2833
2907
|
let finalPath = path;
|
|
2834
2908
|
Object.entries(pathParamValues).forEach(([key, value]) => {
|
|
@@ -2867,19 +2941,19 @@ function ApiPlayground({
|
|
|
2867
2941
|
setLoading(false);
|
|
2868
2942
|
}
|
|
2869
2943
|
};
|
|
2870
|
-
return /* @__PURE__ */
|
|
2871
|
-
/* @__PURE__ */
|
|
2872
|
-
/* @__PURE__ */
|
|
2873
|
-
Object.keys(pathParamValues).length > 0 && /* @__PURE__ */
|
|
2874
|
-
/* @__PURE__ */
|
|
2875
|
-
/* @__PURE__ */
|
|
2944
|
+
return /* @__PURE__ */ jsxs38("div", { className: "not-prose border border-border rounded-lg overflow-hidden bg-card/30", children: [
|
|
2945
|
+
/* @__PURE__ */ jsx51("div", { className: "bg-muted/50 px-4 py-2 border-b border-border", children: /* @__PURE__ */ jsx51("h4", { className: "text-sm font-semibold text-foreground", children: "API Playground" }) }),
|
|
2946
|
+
/* @__PURE__ */ jsxs38("div", { className: "p-4 space-y-4", children: [
|
|
2947
|
+
Object.keys(pathParamValues).length > 0 && /* @__PURE__ */ jsxs38("div", { children: [
|
|
2948
|
+
/* @__PURE__ */ jsx51("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Path Parameters" }),
|
|
2949
|
+
/* @__PURE__ */ jsx51("div", { className: "space-y-2", children: Object.entries(pathParamValues).map(([paramName, paramValue]) => {
|
|
2876
2950
|
const paramConfig = pathParams.find((p) => p.name === paramName);
|
|
2877
|
-
return /* @__PURE__ */
|
|
2878
|
-
/* @__PURE__ */
|
|
2951
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-2", children: [
|
|
2952
|
+
/* @__PURE__ */ jsxs38("span", { className: "text-xs text-muted-foreground min-w-[80px]", children: [
|
|
2879
2953
|
":",
|
|
2880
2954
|
paramName
|
|
2881
2955
|
] }),
|
|
2882
|
-
/* @__PURE__ */
|
|
2956
|
+
/* @__PURE__ */ jsx51(
|
|
2883
2957
|
Input,
|
|
2884
2958
|
{
|
|
2885
2959
|
value: paramValue,
|
|
@@ -2891,16 +2965,16 @@ function ApiPlayground({
|
|
|
2891
2965
|
] }, paramName);
|
|
2892
2966
|
}) })
|
|
2893
2967
|
] }),
|
|
2894
|
-
/* @__PURE__ */
|
|
2895
|
-
/* @__PURE__ */
|
|
2896
|
-
/* @__PURE__ */
|
|
2897
|
-
/* @__PURE__ */
|
|
2898
|
-
/* @__PURE__ */
|
|
2968
|
+
/* @__PURE__ */ jsxs38("div", { children: [
|
|
2969
|
+
/* @__PURE__ */ jsx51("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Request URL" }),
|
|
2970
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-2", children: [
|
|
2971
|
+
/* @__PURE__ */ jsx51(Badge2, { variant: "outline", className: "font-mono", children: method }),
|
|
2972
|
+
/* @__PURE__ */ jsx51(Input, { value: buildUrl(), readOnly: true, className: "font-mono text-sm" })
|
|
2899
2973
|
] })
|
|
2900
2974
|
] }),
|
|
2901
|
-
/* @__PURE__ */
|
|
2902
|
-
/* @__PURE__ */
|
|
2903
|
-
/* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ jsxs38("div", { children: [
|
|
2976
|
+
/* @__PURE__ */ jsx51("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Headers (JSON)" }),
|
|
2977
|
+
/* @__PURE__ */ jsx51(
|
|
2904
2978
|
Textarea,
|
|
2905
2979
|
{
|
|
2906
2980
|
value: requestHeaders,
|
|
@@ -2910,9 +2984,9 @@ function ApiPlayground({
|
|
|
2910
2984
|
}
|
|
2911
2985
|
)
|
|
2912
2986
|
] }),
|
|
2913
|
-
method !== "GET" && method !== "DELETE" && /* @__PURE__ */
|
|
2914
|
-
/* @__PURE__ */
|
|
2915
|
-
/* @__PURE__ */
|
|
2987
|
+
method !== "GET" && method !== "DELETE" && /* @__PURE__ */ jsxs38("div", { children: [
|
|
2988
|
+
/* @__PURE__ */ jsx51("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Request Body (JSON)" }),
|
|
2989
|
+
/* @__PURE__ */ jsx51(
|
|
2916
2990
|
Textarea,
|
|
2917
2991
|
{
|
|
2918
2992
|
value: requestBody,
|
|
@@ -2923,30 +2997,30 @@ function ApiPlayground({
|
|
|
2923
2997
|
}
|
|
2924
2998
|
)
|
|
2925
2999
|
] }),
|
|
2926
|
-
/* @__PURE__ */
|
|
2927
|
-
/* @__PURE__ */
|
|
3000
|
+
/* @__PURE__ */ jsx51(Button, { onClick: handleSend, disabled: loading, className: "w-full", children: loading ? /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
3001
|
+
/* @__PURE__ */ jsx51(Loader22, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2928
3002
|
"Sending..."
|
|
2929
|
-
] }) : /* @__PURE__ */
|
|
2930
|
-
/* @__PURE__ */
|
|
3003
|
+
] }) : /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
3004
|
+
/* @__PURE__ */ jsx51(Play, { className: "mr-2 h-4 w-4" }),
|
|
2931
3005
|
"Send Request"
|
|
2932
3006
|
] }) }),
|
|
2933
|
-
response && /* @__PURE__ */
|
|
2934
|
-
/* @__PURE__ */
|
|
3007
|
+
response && /* @__PURE__ */ jsxs38("div", { className: "mt-4", children: [
|
|
3008
|
+
/* @__PURE__ */ jsxs38("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: [
|
|
2935
3009
|
"Response (",
|
|
2936
3010
|
response.status,
|
|
2937
3011
|
" ",
|
|
2938
3012
|
response.statusText,
|
|
2939
3013
|
")"
|
|
2940
3014
|
] }),
|
|
2941
|
-
/* @__PURE__ */
|
|
3015
|
+
/* @__PURE__ */ jsx51(CodeBlock, { code: JSON.stringify(response.body, null, 2), language: "json" })
|
|
2942
3016
|
] }),
|
|
2943
|
-
error && /* @__PURE__ */
|
|
3017
|
+
error && /* @__PURE__ */ jsx51("div", { className: "mt-4 p-3 bg-red-500/10 border border-red-500/20 rounded-md", children: /* @__PURE__ */ jsx51("p", { className: "text-sm text-red-600 dark:text-red-400", children: error }) })
|
|
2944
3018
|
] })
|
|
2945
3019
|
] });
|
|
2946
3020
|
}
|
|
2947
3021
|
|
|
2948
3022
|
// src/components/docs/api/api-reference.tsx
|
|
2949
|
-
import { useState as
|
|
3023
|
+
import { useState as useState23, useEffect as useEffect14 } from "react";
|
|
2950
3024
|
|
|
2951
3025
|
// src/lib/parsers/specra-parser.ts
|
|
2952
3026
|
var SpecraParser = class {
|
|
@@ -3398,11 +3472,11 @@ function parseApiSpec(input, parserType = "auto") {
|
|
|
3398
3472
|
|
|
3399
3473
|
// src/components/docs/api/api-reference.tsx
|
|
3400
3474
|
import { Loader2 as Loader23 } from "lucide-react";
|
|
3401
|
-
import { jsx as
|
|
3475
|
+
import { jsx as jsx52, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3402
3476
|
function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
3403
|
-
const [apiSpec, setApiSpec] =
|
|
3404
|
-
const [loading, setLoading] =
|
|
3405
|
-
const [error, setError] =
|
|
3477
|
+
const [apiSpec, setApiSpec] = useState23(null);
|
|
3478
|
+
const [loading, setLoading] = useState23(true);
|
|
3479
|
+
const [error, setError] = useState23(null);
|
|
3406
3480
|
useEffect14(() => {
|
|
3407
3481
|
async function loadSpec() {
|
|
3408
3482
|
try {
|
|
@@ -3428,13 +3502,13 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3428
3502
|
});
|
|
3429
3503
|
};
|
|
3430
3504
|
if (loading) {
|
|
3431
|
-
return /* @__PURE__ */
|
|
3432
|
-
/* @__PURE__ */
|
|
3433
|
-
/* @__PURE__ */
|
|
3505
|
+
return /* @__PURE__ */ jsxs39("div", { className: "flex items-center justify-center py-12", children: [
|
|
3506
|
+
/* @__PURE__ */ jsx52(Loader23, { className: "h-6 w-6 animate-spin text-muted-foreground" }),
|
|
3507
|
+
/* @__PURE__ */ jsx52("span", { className: "ml-2 text-muted-foreground", children: "Loading API specification..." })
|
|
3434
3508
|
] });
|
|
3435
3509
|
}
|
|
3436
3510
|
if (error) {
|
|
3437
|
-
return /* @__PURE__ */
|
|
3511
|
+
return /* @__PURE__ */ jsx52("div", { className: "rounded-lg border border-red-500/20 bg-red-500/10 p-4", children: /* @__PURE__ */ jsxs39("p", { className: "text-sm text-red-600 dark:text-red-400", children: [
|
|
3438
3512
|
"Error: ",
|
|
3439
3513
|
error
|
|
3440
3514
|
] }) });
|
|
@@ -3442,26 +3516,26 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3442
3516
|
if (!apiSpec) {
|
|
3443
3517
|
return null;
|
|
3444
3518
|
}
|
|
3445
|
-
return /* @__PURE__ */
|
|
3446
|
-
(apiSpec.title || apiSpec.description) && /* @__PURE__ */
|
|
3447
|
-
apiSpec.title && /* @__PURE__ */
|
|
3448
|
-
apiSpec.description && /* @__PURE__ */
|
|
3449
|
-
apiSpec.baseUrl && /* @__PURE__ */
|
|
3450
|
-
/* @__PURE__ */
|
|
3451
|
-
/* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ jsxs39("div", { className: "space-y-6", children: [
|
|
3520
|
+
(apiSpec.title || apiSpec.description) && /* @__PURE__ */ jsxs39("div", { className: "mb-8", children: [
|
|
3521
|
+
apiSpec.title && /* @__PURE__ */ jsx52("h2", { className: "text-2xl font-semibold mb-2 text-foreground", children: apiSpec.title }),
|
|
3522
|
+
apiSpec.description && /* @__PURE__ */ jsx52("p", { className: "text-muted-foreground", children: apiSpec.description }),
|
|
3523
|
+
apiSpec.baseUrl && /* @__PURE__ */ jsxs39("div", { className: "mt-4", children: [
|
|
3524
|
+
/* @__PURE__ */ jsx52("p", { className: "text-sm font-semibold text-muted-foreground mb-1", children: "Base URL" }),
|
|
3525
|
+
/* @__PURE__ */ jsx52("code", { className: "text-sm px-2 py-1 bg-muted rounded", children: apiSpec.baseUrl })
|
|
3452
3526
|
] })
|
|
3453
3527
|
] }),
|
|
3454
|
-
apiSpec.auth && /* @__PURE__ */
|
|
3455
|
-
/* @__PURE__ */
|
|
3456
|
-
/* @__PURE__ */
|
|
3457
|
-
apiSpec.auth.type === "bearer" && /* @__PURE__ */
|
|
3528
|
+
apiSpec.auth && /* @__PURE__ */ jsxs39("div", { className: "rounded-lg border border-border bg-card/30 p-4 mb-6", children: [
|
|
3529
|
+
/* @__PURE__ */ jsx52("h3", { className: "text-lg font-semibold mb-2 text-foreground", children: "Authentication" }),
|
|
3530
|
+
/* @__PURE__ */ jsx52("p", { className: "text-sm text-muted-foreground mb-2", children: apiSpec.auth.description || `This API uses ${apiSpec.auth.type} authentication.` }),
|
|
3531
|
+
apiSpec.auth.type === "bearer" && /* @__PURE__ */ jsx52(
|
|
3458
3532
|
CodeBlock,
|
|
3459
3533
|
{
|
|
3460
3534
|
code: `Authorization: ${apiSpec.auth.tokenPrefix || "Bearer"} {YOUR_TOKEN}`,
|
|
3461
3535
|
language: "bash"
|
|
3462
3536
|
}
|
|
3463
3537
|
),
|
|
3464
|
-
apiSpec.auth.type === "apiKey" && /* @__PURE__ */
|
|
3538
|
+
apiSpec.auth.type === "apiKey" && /* @__PURE__ */ jsx52(
|
|
3465
3539
|
CodeBlock,
|
|
3466
3540
|
{
|
|
3467
3541
|
code: `${apiSpec.auth.headerName || "X-API-Key"}: {YOUR_API_KEY}`,
|
|
@@ -3469,7 +3543,7 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3469
3543
|
}
|
|
3470
3544
|
)
|
|
3471
3545
|
] }),
|
|
3472
|
-
/* @__PURE__ */
|
|
3546
|
+
/* @__PURE__ */ jsx52(Accordion, { type: "single", collapsible: true, className: "space-y-4", children: apiSpec.endpoints.map((endpoint, index) => {
|
|
3473
3547
|
const allHeaders = [
|
|
3474
3548
|
...apiSpec.globalHeaders || [],
|
|
3475
3549
|
...endpoint.headers || []
|
|
@@ -3477,39 +3551,39 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3477
3551
|
...header,
|
|
3478
3552
|
value: interpolateEnv(header.value, apiSpec.env)
|
|
3479
3553
|
}));
|
|
3480
|
-
return /* @__PURE__ */
|
|
3554
|
+
return /* @__PURE__ */ jsx52(
|
|
3481
3555
|
AccordionItem,
|
|
3482
3556
|
{
|
|
3483
3557
|
value: `endpoint-${index}`,
|
|
3484
|
-
title: /* @__PURE__ */
|
|
3485
|
-
/* @__PURE__ */
|
|
3558
|
+
title: /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-3", children: [
|
|
3559
|
+
/* @__PURE__ */ jsx52(
|
|
3486
3560
|
"span",
|
|
3487
3561
|
{
|
|
3488
3562
|
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"}`,
|
|
3489
3563
|
children: endpoint.method
|
|
3490
3564
|
}
|
|
3491
3565
|
),
|
|
3492
|
-
/* @__PURE__ */
|
|
3493
|
-
/* @__PURE__ */
|
|
3566
|
+
/* @__PURE__ */ jsx52("code", { className: "text-sm font-mono", children: endpoint.path }),
|
|
3567
|
+
/* @__PURE__ */ jsx52("span", { className: "text-sm text-muted-foreground ml-auto", children: endpoint.title })
|
|
3494
3568
|
] }),
|
|
3495
|
-
children: /* @__PURE__ */
|
|
3496
|
-
endpoint.description && /* @__PURE__ */
|
|
3497
|
-
endpoint.pathParams && endpoint.pathParams.length > 0 && /* @__PURE__ */
|
|
3498
|
-
endpoint.queryParams && endpoint.queryParams.length > 0 && /* @__PURE__ */
|
|
3499
|
-
allHeaders.length > 0 && /* @__PURE__ */
|
|
3500
|
-
/* @__PURE__ */
|
|
3501
|
-
/* @__PURE__ */
|
|
3502
|
-
/* @__PURE__ */
|
|
3503
|
-
/* @__PURE__ */
|
|
3504
|
-
/* @__PURE__ */
|
|
3569
|
+
children: /* @__PURE__ */ jsxs39("div", { className: "space-y-6 pt-4", children: [
|
|
3570
|
+
endpoint.description && /* @__PURE__ */ jsx52("p", { className: "text-sm text-muted-foreground", children: endpoint.description }),
|
|
3571
|
+
endpoint.pathParams && endpoint.pathParams.length > 0 && /* @__PURE__ */ jsx52(ApiParams, { title: "Path Parameters", params: endpoint.pathParams }),
|
|
3572
|
+
endpoint.queryParams && endpoint.queryParams.length > 0 && /* @__PURE__ */ jsx52(ApiParams, { title: "Query Parameters", params: endpoint.queryParams }),
|
|
3573
|
+
allHeaders.length > 0 && /* @__PURE__ */ jsxs39("div", { children: [
|
|
3574
|
+
/* @__PURE__ */ jsx52("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Headers" }),
|
|
3575
|
+
/* @__PURE__ */ jsx52("div", { className: "space-y-2", children: allHeaders.map((header, idx) => /* @__PURE__ */ jsxs39("div", { className: "flex flex-col gap-1", children: [
|
|
3576
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2", children: [
|
|
3577
|
+
/* @__PURE__ */ jsx52("code", { className: "text-sm font-mono text-foreground", children: header.name }),
|
|
3578
|
+
/* @__PURE__ */ jsx52("span", { className: "text-xs text-muted-foreground", children: header.value })
|
|
3505
3579
|
] }),
|
|
3506
|
-
header.description && /* @__PURE__ */
|
|
3580
|
+
header.description && /* @__PURE__ */ jsx52("p", { className: "text-sm text-muted-foreground", children: header.description })
|
|
3507
3581
|
] }, idx)) })
|
|
3508
3582
|
] }),
|
|
3509
|
-
endpoint.body && /* @__PURE__ */
|
|
3510
|
-
/* @__PURE__ */
|
|
3511
|
-
endpoint.body.description && /* @__PURE__ */
|
|
3512
|
-
endpoint.body.example && /* @__PURE__ */
|
|
3583
|
+
endpoint.body && /* @__PURE__ */ jsxs39("div", { children: [
|
|
3584
|
+
/* @__PURE__ */ jsx52("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Request Body" }),
|
|
3585
|
+
endpoint.body.description && /* @__PURE__ */ jsx52("p", { className: "text-sm text-muted-foreground mb-2", children: endpoint.body.description }),
|
|
3586
|
+
endpoint.body.example && /* @__PURE__ */ jsx52(
|
|
3513
3587
|
CodeBlock,
|
|
3514
3588
|
{
|
|
3515
3589
|
code: typeof endpoint.body.example === "string" ? endpoint.body.example : JSON.stringify(endpoint.body.example, null, 2),
|
|
@@ -3517,9 +3591,9 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3517
3591
|
}
|
|
3518
3592
|
)
|
|
3519
3593
|
] }),
|
|
3520
|
-
/* @__PURE__ */
|
|
3521
|
-
/* @__PURE__ */
|
|
3522
|
-
endpoint.successResponse && /* @__PURE__ */
|
|
3594
|
+
/* @__PURE__ */ jsxs39("div", { children: [
|
|
3595
|
+
/* @__PURE__ */ jsx52("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Responses" }),
|
|
3596
|
+
endpoint.successResponse && /* @__PURE__ */ jsx52(
|
|
3523
3597
|
ApiResponse,
|
|
3524
3598
|
{
|
|
3525
3599
|
status: endpoint.successResponse.status,
|
|
@@ -3528,7 +3602,7 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3528
3602
|
schema: endpoint.successResponse.schema
|
|
3529
3603
|
}
|
|
3530
3604
|
),
|
|
3531
|
-
endpoint.errorResponses?.map((response, idx) => /* @__PURE__ */
|
|
3605
|
+
endpoint.errorResponses?.map((response, idx) => /* @__PURE__ */ jsx52(
|
|
3532
3606
|
ApiResponse,
|
|
3533
3607
|
{
|
|
3534
3608
|
status: response.status,
|
|
@@ -3539,14 +3613,14 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3539
3613
|
idx
|
|
3540
3614
|
))
|
|
3541
3615
|
] }),
|
|
3542
|
-
endpoint.examples && endpoint.examples.length > 0 && /* @__PURE__ */
|
|
3543
|
-
/* @__PURE__ */
|
|
3544
|
-
endpoint.examples.map((example, idx) => /* @__PURE__ */
|
|
3545
|
-
/* @__PURE__ */
|
|
3546
|
-
/* @__PURE__ */
|
|
3616
|
+
endpoint.examples && endpoint.examples.length > 0 && /* @__PURE__ */ jsxs39("div", { children: [
|
|
3617
|
+
/* @__PURE__ */ jsx52("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Examples" }),
|
|
3618
|
+
endpoint.examples.map((example, idx) => /* @__PURE__ */ jsxs39("div", { className: "mb-3", children: [
|
|
3619
|
+
/* @__PURE__ */ jsx52("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: example.title }),
|
|
3620
|
+
/* @__PURE__ */ jsx52(CodeBlock, { code: example.code, language: example.language })
|
|
3547
3621
|
] }, idx))
|
|
3548
3622
|
] }),
|
|
3549
|
-
showPlayground && /* @__PURE__ */
|
|
3623
|
+
showPlayground && /* @__PURE__ */ jsx52(
|
|
3550
3624
|
ApiPlayground,
|
|
3551
3625
|
{
|
|
3552
3626
|
method: endpoint.method,
|
|
@@ -3568,13 +3642,13 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3568
3642
|
// src/components/global/version-not-found.tsx
|
|
3569
3643
|
import { AlertTriangle as AlertTriangle3 } from "lucide-react";
|
|
3570
3644
|
import Link10 from "next/link";
|
|
3571
|
-
import { Fragment as
|
|
3645
|
+
import { Fragment as Fragment10, jsx as jsx53, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3572
3646
|
function VersionNotFound() {
|
|
3573
|
-
return /* @__PURE__ */
|
|
3574
|
-
/* @__PURE__ */
|
|
3575
|
-
/* @__PURE__ */
|
|
3576
|
-
/* @__PURE__ */
|
|
3577
|
-
/* @__PURE__ */
|
|
3647
|
+
return /* @__PURE__ */ jsx53(Fragment10, { children: /* @__PURE__ */ jsx53("div", { className: "flex min-h-screen items-center justify-center px-4", children: /* @__PURE__ */ jsxs40("div", { className: "text-center", children: [
|
|
3648
|
+
/* @__PURE__ */ jsx53("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ jsx53(AlertTriangle3, { className: "h-16 w-16 text-yellow-500" }) }),
|
|
3649
|
+
/* @__PURE__ */ jsx53("h1", { className: "mb-2 text-4xl font-bold", children: "Version Not Found" }),
|
|
3650
|
+
/* @__PURE__ */ jsx53("p", { className: "mb-6 text-muted-foreground", children: "The documentation version you're looking for doesn't exist." }),
|
|
3651
|
+
/* @__PURE__ */ jsx53(
|
|
3578
3652
|
Link10,
|
|
3579
3653
|
{
|
|
3580
3654
|
href: "/docs/v1.0.0",
|
|
@@ -3631,6 +3705,7 @@ export {
|
|
|
3631
3705
|
ImageCard,
|
|
3632
3706
|
ImageCardGrid,
|
|
3633
3707
|
Input,
|
|
3708
|
+
LanguageSwitcher,
|
|
3634
3709
|
Logo,
|
|
3635
3710
|
Math2 as Math,
|
|
3636
3711
|
MdxHotReload,
|