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/components/index.js
CHANGED
|
@@ -77,6 +77,7 @@ __export(components_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,
|
|
@@ -1504,7 +1505,7 @@ function Frame({ src, title = "Embedded content", height = 500, width = "100%" }
|
|
|
1504
1505
|
|
|
1505
1506
|
// src/components/docs/header.tsx
|
|
1506
1507
|
var import_link7 = __toESM(require("next/link"));
|
|
1507
|
-
var
|
|
1508
|
+
var import_lucide_react19 = require("lucide-react");
|
|
1508
1509
|
|
|
1509
1510
|
// src/components/docs/version-switcher.tsx
|
|
1510
1511
|
var import_react9 = require("react");
|
|
@@ -1548,13 +1549,116 @@ function VersionSwitcher({ currentVersion, versions }) {
|
|
|
1548
1549
|
] });
|
|
1549
1550
|
}
|
|
1550
1551
|
|
|
1551
|
-
// src/components/docs/
|
|
1552
|
-
var import_lucide_react15 = require("lucide-react");
|
|
1552
|
+
// src/components/docs/language-switcher.tsx
|
|
1553
1553
|
var import_react10 = require("react");
|
|
1554
|
+
var import_lucide_react15 = require("lucide-react");
|
|
1555
|
+
var import_navigation4 = require("next/navigation");
|
|
1556
|
+
|
|
1557
|
+
// src/components/config-provider.tsx
|
|
1558
|
+
var React3 = __toESM(require("react"));
|
|
1554
1559
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1560
|
+
var ConfigContext = React3.createContext(defaultConfig);
|
|
1561
|
+
function ConfigProvider({ config, children }) {
|
|
1562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ConfigContext.Provider, { value: config, children });
|
|
1563
|
+
}
|
|
1564
|
+
function useConfig() {
|
|
1565
|
+
const config = React3.useContext(ConfigContext);
|
|
1566
|
+
if (!config) {
|
|
1567
|
+
throw new Error("useConfig must be used within a ConfigProvider");
|
|
1568
|
+
}
|
|
1569
|
+
return config;
|
|
1570
|
+
}
|
|
1571
|
+
function useConfigValue(path) {
|
|
1572
|
+
const config = useConfig();
|
|
1573
|
+
const keys = path.split(".");
|
|
1574
|
+
let value = config;
|
|
1575
|
+
for (const key of keys) {
|
|
1576
|
+
if (value && typeof value === "object" && key in value) {
|
|
1577
|
+
value = value[key];
|
|
1578
|
+
} else {
|
|
1579
|
+
return void 0;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
return value;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
// src/components/docs/language-switcher.tsx
|
|
1586
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1587
|
+
function LanguageSwitcher() {
|
|
1588
|
+
const [open, setOpen] = (0, import_react10.useState)(false);
|
|
1589
|
+
const pathname = (0, import_navigation4.usePathname)();
|
|
1590
|
+
const router = (0, import_navigation4.useRouter)();
|
|
1591
|
+
const config = useConfig();
|
|
1592
|
+
const i18n = config.features?.i18n;
|
|
1593
|
+
if (!i18n || typeof i18n === "boolean") return null;
|
|
1594
|
+
const { locales, localeNames, defaultLocale, prefixDefault } = i18n;
|
|
1595
|
+
const pathParts = pathname.split("/");
|
|
1596
|
+
const version = pathParts[2];
|
|
1597
|
+
let currentLocale = defaultLocale;
|
|
1598
|
+
if (pathParts[3] && locales.includes(pathParts[3])) {
|
|
1599
|
+
currentLocale = pathParts[3];
|
|
1600
|
+
}
|
|
1601
|
+
const handleLocaleChange = (newLocale) => {
|
|
1602
|
+
if (newLocale === currentLocale) {
|
|
1603
|
+
setOpen(false);
|
|
1604
|
+
return;
|
|
1605
|
+
}
|
|
1606
|
+
const parts = [...pathParts];
|
|
1607
|
+
const hasLocalePrefix = locales.includes(parts[3]);
|
|
1608
|
+
if (newLocale === defaultLocale && !prefixDefault) {
|
|
1609
|
+
if (hasLocalePrefix) {
|
|
1610
|
+
parts.splice(3, 1);
|
|
1611
|
+
}
|
|
1612
|
+
} else {
|
|
1613
|
+
if (hasLocalePrefix) {
|
|
1614
|
+
parts[3] = newLocale;
|
|
1615
|
+
} else {
|
|
1616
|
+
parts.splice(3, 0, newLocale);
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
const newPath = parts.join("/");
|
|
1620
|
+
router.push(newPath);
|
|
1621
|
+
setOpen(false);
|
|
1622
|
+
};
|
|
1623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative", children: [
|
|
1624
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1625
|
+
"button",
|
|
1626
|
+
{
|
|
1627
|
+
onClick: () => setOpen(!open),
|
|
1628
|
+
className: "flex items-center gap-1.5 px-2 h-9 rounded-md hover:bg-muted transition-colors",
|
|
1629
|
+
"aria-label": "Switch language",
|
|
1630
|
+
children: [
|
|
1631
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Languages, { className: "h-4 w-4" }),
|
|
1632
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs font-bold uppercase", children: currentLocale }),
|
|
1633
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.ChevronDown, { className: "h-3 w-3 text-muted-foreground" })
|
|
1634
|
+
]
|
|
1635
|
+
}
|
|
1636
|
+
),
|
|
1637
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
1638
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "fixed inset-0 z-40", onClick: () => setOpen(false) }),
|
|
1639
|
+
/* @__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)(
|
|
1640
|
+
"button",
|
|
1641
|
+
{
|
|
1642
|
+
onClick: () => handleLocaleChange(locale),
|
|
1643
|
+
className: "flex items-center justify-between w-full px-3 py-2 text-sm text-foreground hover:bg-muted rounded-md transition-colors",
|
|
1644
|
+
children: [
|
|
1645
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: localeNames?.[locale] || locale.toUpperCase() }),
|
|
1646
|
+
currentLocale === locale && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Check, { className: "h-4 w-4 text-primary" })
|
|
1647
|
+
]
|
|
1648
|
+
},
|
|
1649
|
+
locale
|
|
1650
|
+
)) }) })
|
|
1651
|
+
] })
|
|
1652
|
+
] });
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
// src/components/docs/theme-toggle.tsx
|
|
1656
|
+
var import_lucide_react16 = require("lucide-react");
|
|
1657
|
+
var import_react11 = require("react");
|
|
1658
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1555
1659
|
function ThemeToggle() {
|
|
1556
|
-
const [theme, setTheme] = (0,
|
|
1557
|
-
(0,
|
|
1660
|
+
const [theme, setTheme] = (0, import_react11.useState)("dark");
|
|
1661
|
+
(0, import_react11.useEffect)(() => {
|
|
1558
1662
|
const savedTheme = localStorage.getItem("theme");
|
|
1559
1663
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1560
1664
|
const initialTheme = savedTheme || (prefersDark ? "dark" : "light");
|
|
@@ -1567,25 +1671,25 @@ function ThemeToggle() {
|
|
|
1567
1671
|
localStorage.setItem("theme", newTheme);
|
|
1568
1672
|
document.documentElement.classList.toggle("dark", newTheme === "dark");
|
|
1569
1673
|
};
|
|
1570
|
-
return /* @__PURE__ */ (0,
|
|
1674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1571
1675
|
"button",
|
|
1572
1676
|
{
|
|
1573
1677
|
onClick: toggleTheme,
|
|
1574
1678
|
className: "flex items-center justify-center w-9 h-9 rounded-md border border-border bg-background hover:bg-accent transition-colors",
|
|
1575
1679
|
"aria-label": "Toggle theme",
|
|
1576
|
-
children: theme === "dark" ? /* @__PURE__ */ (0,
|
|
1680
|
+
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" })
|
|
1577
1681
|
}
|
|
1578
1682
|
);
|
|
1579
1683
|
}
|
|
1580
1684
|
|
|
1581
1685
|
// src/components/docs/search-modal.tsx
|
|
1582
|
-
var
|
|
1583
|
-
var
|
|
1584
|
-
var
|
|
1686
|
+
var import_react12 = require("react");
|
|
1687
|
+
var import_lucide_react18 = require("lucide-react");
|
|
1688
|
+
var import_navigation5 = require("next/navigation");
|
|
1585
1689
|
|
|
1586
1690
|
// src/components/ui/dialog.tsx
|
|
1587
1691
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
1588
|
-
var
|
|
1692
|
+
var import_lucide_react17 = require("lucide-react");
|
|
1589
1693
|
|
|
1590
1694
|
// src/lib/utils.ts
|
|
1591
1695
|
var import_clsx = require("clsx");
|
|
@@ -1595,32 +1699,32 @@ function cn(...inputs) {
|
|
|
1595
1699
|
}
|
|
1596
1700
|
|
|
1597
1701
|
// src/components/ui/dialog.tsx
|
|
1598
|
-
var
|
|
1702
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1599
1703
|
function Dialog({
|
|
1600
1704
|
...props
|
|
1601
1705
|
}) {
|
|
1602
|
-
return /* @__PURE__ */ (0,
|
|
1706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
1603
1707
|
}
|
|
1604
1708
|
function DialogTrigger({
|
|
1605
1709
|
...props
|
|
1606
1710
|
}) {
|
|
1607
|
-
return /* @__PURE__ */ (0,
|
|
1711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
1608
1712
|
}
|
|
1609
1713
|
function DialogPortal({
|
|
1610
1714
|
...props
|
|
1611
1715
|
}) {
|
|
1612
|
-
return /* @__PURE__ */ (0,
|
|
1716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
1613
1717
|
}
|
|
1614
1718
|
function DialogClose({
|
|
1615
1719
|
...props
|
|
1616
1720
|
}) {
|
|
1617
|
-
return /* @__PURE__ */ (0,
|
|
1721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
1618
1722
|
}
|
|
1619
1723
|
function DialogOverlay({
|
|
1620
1724
|
className,
|
|
1621
1725
|
...props
|
|
1622
1726
|
}) {
|
|
1623
|
-
return /* @__PURE__ */ (0,
|
|
1727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1624
1728
|
DialogPrimitive.Overlay,
|
|
1625
1729
|
{
|
|
1626
1730
|
"data-slot": "dialog-overlay",
|
|
@@ -1638,9 +1742,9 @@ function DialogContent({
|
|
|
1638
1742
|
showCloseButton = true,
|
|
1639
1743
|
...props
|
|
1640
1744
|
}) {
|
|
1641
|
-
return /* @__PURE__ */ (0,
|
|
1642
|
-
/* @__PURE__ */ (0,
|
|
1643
|
-
/* @__PURE__ */ (0,
|
|
1745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
1746
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogOverlay, {}),
|
|
1747
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1644
1748
|
DialogPrimitive.Content,
|
|
1645
1749
|
{
|
|
1646
1750
|
"data-slot": "dialog-content",
|
|
@@ -1651,14 +1755,14 @@ function DialogContent({
|
|
|
1651
1755
|
...props,
|
|
1652
1756
|
children: [
|
|
1653
1757
|
children,
|
|
1654
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
1758
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1655
1759
|
DialogPrimitive.Close,
|
|
1656
1760
|
{
|
|
1657
1761
|
"data-slot": "dialog-close",
|
|
1658
1762
|
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",
|
|
1659
1763
|
children: [
|
|
1660
|
-
/* @__PURE__ */ (0,
|
|
1661
|
-
/* @__PURE__ */ (0,
|
|
1764
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react17.XIcon, {}),
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "sr-only", children: "Close" })
|
|
1662
1766
|
]
|
|
1663
1767
|
}
|
|
1664
1768
|
)
|
|
@@ -1668,7 +1772,7 @@ function DialogContent({
|
|
|
1668
1772
|
] });
|
|
1669
1773
|
}
|
|
1670
1774
|
function DialogHeader({ className, ...props }) {
|
|
1671
|
-
return /* @__PURE__ */ (0,
|
|
1775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1672
1776
|
"div",
|
|
1673
1777
|
{
|
|
1674
1778
|
"data-slot": "dialog-header",
|
|
@@ -1678,7 +1782,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
1678
1782
|
);
|
|
1679
1783
|
}
|
|
1680
1784
|
function DialogFooter({ className, ...props }) {
|
|
1681
|
-
return /* @__PURE__ */ (0,
|
|
1785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1682
1786
|
"div",
|
|
1683
1787
|
{
|
|
1684
1788
|
"data-slot": "dialog-footer",
|
|
@@ -1694,7 +1798,7 @@ function DialogTitle({
|
|
|
1694
1798
|
className,
|
|
1695
1799
|
...props
|
|
1696
1800
|
}) {
|
|
1697
|
-
return /* @__PURE__ */ (0,
|
|
1801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1698
1802
|
DialogPrimitive.Title,
|
|
1699
1803
|
{
|
|
1700
1804
|
"data-slot": "dialog-title",
|
|
@@ -1707,7 +1811,7 @@ function DialogDescription({
|
|
|
1707
1811
|
className,
|
|
1708
1812
|
...props
|
|
1709
1813
|
}) {
|
|
1710
|
-
return /* @__PURE__ */ (0,
|
|
1814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1711
1815
|
DialogPrimitive.Description,
|
|
1712
1816
|
{
|
|
1713
1817
|
"data-slot": "dialog-description",
|
|
@@ -1718,15 +1822,15 @@ function DialogDescription({
|
|
|
1718
1822
|
}
|
|
1719
1823
|
|
|
1720
1824
|
// src/components/docs/search-modal.tsx
|
|
1721
|
-
var
|
|
1825
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1722
1826
|
function SearchModal({ isOpen, onClose, config }) {
|
|
1723
|
-
const [query, setQuery] = (0,
|
|
1724
|
-
const [results, setResults] = (0,
|
|
1725
|
-
const [isLoading, setIsLoading] = (0,
|
|
1726
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
1727
|
-
const router = (0,
|
|
1827
|
+
const [query, setQuery] = (0, import_react12.useState)("");
|
|
1828
|
+
const [results, setResults] = (0, import_react12.useState)([]);
|
|
1829
|
+
const [isLoading, setIsLoading] = (0, import_react12.useState)(false);
|
|
1830
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react12.useState)(0);
|
|
1831
|
+
const router = (0, import_navigation5.useRouter)();
|
|
1728
1832
|
const searchConfig = config.search;
|
|
1729
|
-
const performSearch = (0,
|
|
1833
|
+
const performSearch = (0, import_react12.useCallback)(async (searchQuery) => {
|
|
1730
1834
|
if (!searchQuery.trim() || !searchConfig?.enabled) {
|
|
1731
1835
|
setResults([]);
|
|
1732
1836
|
return;
|
|
@@ -1757,13 +1861,13 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1757
1861
|
setIsLoading(false);
|
|
1758
1862
|
}
|
|
1759
1863
|
}, [searchConfig]);
|
|
1760
|
-
(0,
|
|
1864
|
+
(0, import_react12.useEffect)(() => {
|
|
1761
1865
|
const timer = setTimeout(() => {
|
|
1762
1866
|
performSearch(query);
|
|
1763
1867
|
}, 300);
|
|
1764
1868
|
return () => clearTimeout(timer);
|
|
1765
1869
|
}, [query, performSearch]);
|
|
1766
|
-
(0,
|
|
1870
|
+
(0, import_react12.useEffect)(() => {
|
|
1767
1871
|
const handleKeyDown = (e) => {
|
|
1768
1872
|
if (!isOpen) return;
|
|
1769
1873
|
switch (e.key) {
|
|
@@ -1789,7 +1893,7 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1789
1893
|
window.addEventListener("keydown", handleKeyDown);
|
|
1790
1894
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
1791
1895
|
}, [isOpen, results, selectedIndex, onClose]);
|
|
1792
|
-
(0,
|
|
1896
|
+
(0, import_react12.useEffect)(() => {
|
|
1793
1897
|
if (isOpen) {
|
|
1794
1898
|
setQuery("");
|
|
1795
1899
|
setResults([]);
|
|
@@ -1810,20 +1914,20 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1810
1914
|
if (!query2.trim()) return text;
|
|
1811
1915
|
const parts = text.split(new RegExp(`(${query2})`, "gi"));
|
|
1812
1916
|
return parts.map(
|
|
1813
|
-
(part, i) => part.toLowerCase() === query2.toLowerCase() ? /* @__PURE__ */ (0,
|
|
1917
|
+
(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
|
|
1814
1918
|
);
|
|
1815
1919
|
};
|
|
1816
|
-
return /* @__PURE__ */ (0,
|
|
1920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog, { open: isOpen, onOpenChange: onClose, modal: true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
1817
1921
|
DialogContent,
|
|
1818
1922
|
{
|
|
1819
1923
|
className: "max-w-2xl p-0 gap-0 top-[10vh] translate-y-0",
|
|
1820
1924
|
showCloseButton: false,
|
|
1821
1925
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
1822
1926
|
children: [
|
|
1823
|
-
/* @__PURE__ */ (0,
|
|
1824
|
-
/* @__PURE__ */ (0,
|
|
1825
|
-
/* @__PURE__ */ (0,
|
|
1826
|
-
/* @__PURE__ */ (0,
|
|
1927
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DialogTitle, { className: "sr-only", children: "Search Documentation" }),
|
|
1928
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-border", children: [
|
|
1929
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react18.Search, { className: "h-5 w-5 text-muted-foreground shrink-0" }),
|
|
1930
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1827
1931
|
"input",
|
|
1828
1932
|
{
|
|
1829
1933
|
type: "text",
|
|
@@ -1834,30 +1938,30 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1834
1938
|
autoFocus: true
|
|
1835
1939
|
}
|
|
1836
1940
|
),
|
|
1837
|
-
isLoading && /* @__PURE__ */ (0,
|
|
1941
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react18.Loader2, { className: "h-5 w-5 text-muted-foreground animate-spin" })
|
|
1838
1942
|
] }),
|
|
1839
|
-
/* @__PURE__ */ (0,
|
|
1840
|
-
query.trim() && results.length === 0 && !isLoading && /* @__PURE__ */ (0,
|
|
1943
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "max-h-[60vh] overflow-y-auto", children: [
|
|
1944
|
+
query.trim() && results.length === 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "px-4 py-8 text-center text-muted-foreground", children: [
|
|
1841
1945
|
'No results found for "',
|
|
1842
1946
|
query,
|
|
1843
1947
|
'"'
|
|
1844
1948
|
] }),
|
|
1845
|
-
results.length > 0 && /* @__PURE__ */ (0,
|
|
1949
|
+
results.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "py-2", children: results.map((result, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1846
1950
|
"button",
|
|
1847
1951
|
{
|
|
1848
1952
|
onClick: () => handleResultClick(result),
|
|
1849
1953
|
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"}`,
|
|
1850
1954
|
onMouseEnter: () => setSelectedIndex(index),
|
|
1851
|
-
children: /* @__PURE__ */ (0,
|
|
1852
|
-
/* @__PURE__ */ (0,
|
|
1853
|
-
/* @__PURE__ */ (0,
|
|
1854
|
-
/* @__PURE__ */ (0,
|
|
1855
|
-
result.content && /* @__PURE__ */ (0,
|
|
1856
|
-
/* @__PURE__ */ (0,
|
|
1857
|
-
/* @__PURE__ */ (0,
|
|
1858
|
-
result.category && /* @__PURE__ */ (0,
|
|
1859
|
-
/* @__PURE__ */ (0,
|
|
1860
|
-
/* @__PURE__ */ (0,
|
|
1955
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
1956
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react18.FileText, { className: "h-5 w-5 text-muted-foreground shrink-0 mt-0.5" }),
|
|
1957
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
1958
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "font-medium text-foreground mb-1", children: highlightText(result.title, query) }),
|
|
1959
|
+
result.content && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "text-sm text-muted-foreground line-clamp-2", children: highlightText(result.content, query) }),
|
|
1960
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-2 mt-1 text-xs text-muted-foreground", children: [
|
|
1961
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: result.version }),
|
|
1962
|
+
result.category && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
1963
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u2022" }),
|
|
1964
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: result.category })
|
|
1861
1965
|
] })
|
|
1862
1966
|
] })
|
|
1863
1967
|
] })
|
|
@@ -1865,15 +1969,15 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1865
1969
|
},
|
|
1866
1970
|
result.id
|
|
1867
1971
|
)) }),
|
|
1868
|
-
!query.trim() && /* @__PURE__ */ (0,
|
|
1869
|
-
/* @__PURE__ */ (0,
|
|
1870
|
-
/* @__PURE__ */ (0,
|
|
1871
|
-
/* @__PURE__ */ (0,
|
|
1872
|
-
/* @__PURE__ */ (0,
|
|
1873
|
-
/* @__PURE__ */ (0,
|
|
1874
|
-
/* @__PURE__ */ (0,
|
|
1875
|
-
/* @__PURE__ */ (0,
|
|
1876
|
-
/* @__PURE__ */ (0,
|
|
1972
|
+
!query.trim() && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "px-4 py-8 text-center text-muted-foreground text-sm", children: [
|
|
1973
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { children: "Start typing to search documentation..." }),
|
|
1974
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-4 flex items-center justify-center gap-4 text-xs", children: [
|
|
1975
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "\u2191\u2193" }),
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Navigate" }),
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "Enter" }),
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Select" }),
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "Esc" }),
|
|
1980
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Close" })
|
|
1877
1981
|
] })
|
|
1878
1982
|
] })
|
|
1879
1983
|
] })
|
|
@@ -1883,43 +1987,13 @@ function SearchModal({ isOpen, onClose, config }) {
|
|
|
1883
1987
|
}
|
|
1884
1988
|
|
|
1885
1989
|
// src/components/docs/header.tsx
|
|
1886
|
-
var
|
|
1887
|
-
|
|
1888
|
-
// src/components/config-provider.tsx
|
|
1889
|
-
var React3 = __toESM(require("react"));
|
|
1890
|
-
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1891
|
-
var ConfigContext = React3.createContext(defaultConfig);
|
|
1892
|
-
function ConfigProvider({ config, children }) {
|
|
1893
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ConfigContext.Provider, { value: config, children });
|
|
1894
|
-
}
|
|
1895
|
-
function useConfig() {
|
|
1896
|
-
const config = React3.useContext(ConfigContext);
|
|
1897
|
-
if (!config) {
|
|
1898
|
-
throw new Error("useConfig must be used within a ConfigProvider");
|
|
1899
|
-
}
|
|
1900
|
-
return config;
|
|
1901
|
-
}
|
|
1902
|
-
function useConfigValue(path) {
|
|
1903
|
-
const config = useConfig();
|
|
1904
|
-
const keys = path.split(".");
|
|
1905
|
-
let value = config;
|
|
1906
|
-
for (const key of keys) {
|
|
1907
|
-
if (value && typeof value === "object" && key in value) {
|
|
1908
|
-
value = value[key];
|
|
1909
|
-
} else {
|
|
1910
|
-
return void 0;
|
|
1911
|
-
}
|
|
1912
|
-
}
|
|
1913
|
-
return value;
|
|
1914
|
-
}
|
|
1915
|
-
|
|
1916
|
-
// src/components/docs/header.tsx
|
|
1917
|
-
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1990
|
+
var import_react13 = require("react");
|
|
1991
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1918
1992
|
function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
1919
1993
|
const contextConfig = useConfig();
|
|
1920
1994
|
const config = configProp || contextConfig;
|
|
1921
|
-
const [searchOpen, setSearchOpen] = (0,
|
|
1922
|
-
(0,
|
|
1995
|
+
const [searchOpen, setSearchOpen] = (0, import_react13.useState)(false);
|
|
1996
|
+
(0, import_react13.useEffect)(() => {
|
|
1923
1997
|
const handleKeyDown = (e) => {
|
|
1924
1998
|
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
1925
1999
|
e.preventDefault();
|
|
@@ -1929,38 +2003,38 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
1929
2003
|
window.addEventListener("keydown", handleKeyDown);
|
|
1930
2004
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
1931
2005
|
}, []);
|
|
1932
|
-
return /* @__PURE__ */ (0,
|
|
1933
|
-
/* @__PURE__ */ (0,
|
|
1934
|
-
/* @__PURE__ */ (0,
|
|
1935
|
-
/* @__PURE__ */ (0,
|
|
2006
|
+
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: [
|
|
2007
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "container flex h-16 items-center justify-between px-2 md:px-6 mx-auto", children: [
|
|
2008
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
2009
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1936
2010
|
"button",
|
|
1937
2011
|
{
|
|
1938
2012
|
onClick: onMenuClick,
|
|
1939
2013
|
className: "lg:hidden hover:bg-muted p-2 rounded-md transition-colors",
|
|
1940
2014
|
"aria-label": "Toggle menu",
|
|
1941
|
-
children: /* @__PURE__ */ (0,
|
|
2015
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react19.Menu, { className: "h-5 w-5" })
|
|
1942
2016
|
}
|
|
1943
2017
|
),
|
|
1944
|
-
/* @__PURE__ */ (0,
|
|
1945
|
-
!config.site.hideLogo && (config.site.logo ? /* @__PURE__ */ (0,
|
|
1946
|
-
!config.site.hideTitle && /* @__PURE__ */ (0,
|
|
2018
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_link7.default, { href: "/", className: "flex items-center gap-2", children: [
|
|
2019
|
+
!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() }) })),
|
|
2020
|
+
!config.site.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "font-semibold text-lg text-foreground", children: config.site.title ?? "Specra" })
|
|
1947
2021
|
] })
|
|
1948
2022
|
] }),
|
|
1949
|
-
/* @__PURE__ */ (0,
|
|
1950
|
-
config.search?.enabled && /* @__PURE__ */ (0,
|
|
2023
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2024
|
+
config.search?.enabled && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1951
2025
|
"button",
|
|
1952
2026
|
{
|
|
1953
2027
|
onClick: () => setSearchOpen(true),
|
|
1954
2028
|
className: "flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:text-foreground bg-muted rounded-md transition-colors",
|
|
1955
2029
|
children: [
|
|
1956
|
-
/* @__PURE__ */ (0,
|
|
1957
|
-
/* @__PURE__ */ (0,
|
|
1958
|
-
/* @__PURE__ */ (0,
|
|
2030
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react19.Search, { className: "h-4 w-4" }),
|
|
2031
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "hidden sm:inline", children: config.search.placeholder || "Search" }),
|
|
2032
|
+
/* @__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" })
|
|
1959
2033
|
]
|
|
1960
2034
|
}
|
|
1961
2035
|
),
|
|
1962
|
-
config.features?.versioning && /* @__PURE__ */ (0,
|
|
1963
|
-
config.social?.github && /* @__PURE__ */ (0,
|
|
2036
|
+
config.features?.versioning && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(VersionSwitcher, { currentVersion, versions }),
|
|
2037
|
+
config.social?.github && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1964
2038
|
"a",
|
|
1965
2039
|
{
|
|
1966
2040
|
href: config.social.github,
|
|
@@ -1968,10 +2042,10 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
1968
2042
|
rel: "noopener noreferrer",
|
|
1969
2043
|
className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
|
|
1970
2044
|
"aria-label": "GitHub",
|
|
1971
|
-
children: /* @__PURE__ */ (0,
|
|
2045
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react19.Github, { className: "h-4 w-4" })
|
|
1972
2046
|
}
|
|
1973
2047
|
),
|
|
1974
|
-
config.social?.twitter && /* @__PURE__ */ (0,
|
|
2048
|
+
config.social?.twitter && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1975
2049
|
"a",
|
|
1976
2050
|
{
|
|
1977
2051
|
href: config.social.twitter,
|
|
@@ -1979,10 +2053,10 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
1979
2053
|
rel: "noopener noreferrer",
|
|
1980
2054
|
className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
|
|
1981
2055
|
"aria-label": "Twitter",
|
|
1982
|
-
children: /* @__PURE__ */ (0,
|
|
2056
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react19.Twitter, { className: "h-4 w-4" })
|
|
1983
2057
|
}
|
|
1984
2058
|
),
|
|
1985
|
-
config.social?.discord && /* @__PURE__ */ (0,
|
|
2059
|
+
config.social?.discord && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1986
2060
|
"a",
|
|
1987
2061
|
{
|
|
1988
2062
|
href: config.social.discord,
|
|
@@ -1990,26 +2064,27 @@ function Header({ currentVersion, versions, onMenuClick, config: configProp }) {
|
|
|
1990
2064
|
rel: "noopener noreferrer",
|
|
1991
2065
|
className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
|
|
1992
2066
|
"aria-label": "Discord",
|
|
1993
|
-
children: /* @__PURE__ */ (0,
|
|
2067
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react19.MessageCircle, { className: "h-4 w-4" })
|
|
1994
2068
|
}
|
|
1995
2069
|
),
|
|
1996
|
-
/* @__PURE__ */ (0,
|
|
2070
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ThemeToggle, {}),
|
|
2071
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LanguageSwitcher, {})
|
|
1997
2072
|
] })
|
|
1998
2073
|
] }),
|
|
1999
|
-
/* @__PURE__ */ (0,
|
|
2074
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SearchModal, { isOpen: searchOpen, onClose: () => setSearchOpen(false), config })
|
|
2000
2075
|
] });
|
|
2001
2076
|
}
|
|
2002
2077
|
|
|
2003
2078
|
// src/components/docs/hot-reload-indicator.tsx
|
|
2004
|
-
var
|
|
2005
|
-
var
|
|
2006
|
-
var
|
|
2007
|
-
var
|
|
2079
|
+
var import_react14 = require("react");
|
|
2080
|
+
var import_navigation6 = require("next/navigation");
|
|
2081
|
+
var import_lucide_react20 = require("lucide-react");
|
|
2082
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2008
2083
|
function HotReloadIndicator() {
|
|
2009
|
-
const [isReloading, setIsReloading] = (0,
|
|
2010
|
-
const [lastReload, setLastReload] = (0,
|
|
2011
|
-
const pathname = (0,
|
|
2012
|
-
(0,
|
|
2084
|
+
const [isReloading, setIsReloading] = (0, import_react14.useState)(false);
|
|
2085
|
+
const [lastReload, setLastReload] = (0, import_react14.useState)(null);
|
|
2086
|
+
const pathname = (0, import_navigation6.usePathname)();
|
|
2087
|
+
(0, import_react14.useEffect)(() => {
|
|
2013
2088
|
if (process.env.NODE_ENV !== "development") return;
|
|
2014
2089
|
setIsReloading(true);
|
|
2015
2090
|
const timer = setTimeout(() => {
|
|
@@ -2021,7 +2096,7 @@ function HotReloadIndicator() {
|
|
|
2021
2096
|
}, 500);
|
|
2022
2097
|
return () => clearTimeout(timer);
|
|
2023
2098
|
}, [pathname]);
|
|
2024
|
-
(0,
|
|
2099
|
+
(0, import_react14.useEffect)(() => {
|
|
2025
2100
|
if (process.env.NODE_ENV !== "development") return;
|
|
2026
2101
|
const handleBeforeRefresh = () => {
|
|
2027
2102
|
setIsReloading(true);
|
|
@@ -2039,14 +2114,14 @@ function HotReloadIndicator() {
|
|
|
2039
2114
|
};
|
|
2040
2115
|
}, []);
|
|
2041
2116
|
if (process.env.NODE_ENV !== "development") return null;
|
|
2042
|
-
return /* @__PURE__ */ (0,
|
|
2043
|
-
isReloading && /* @__PURE__ */ (0,
|
|
2044
|
-
/* @__PURE__ */ (0,
|
|
2045
|
-
/* @__PURE__ */ (0,
|
|
2117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
2118
|
+
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: [
|
|
2119
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react20.RefreshCw, { className: "h-4 w-4 animate-spin" }),
|
|
2120
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-sm font-medium", children: "Reloading..." })
|
|
2046
2121
|
] }),
|
|
2047
|
-
lastReload && !isReloading && /* @__PURE__ */ (0,
|
|
2048
|
-
/* @__PURE__ */ (0,
|
|
2049
|
-
/* @__PURE__ */ (0,
|
|
2122
|
+
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: [
|
|
2123
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react20.RefreshCw, { className: "h-4 w-4" }),
|
|
2124
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "text-sm font-medium", children: [
|
|
2050
2125
|
"Updated at ",
|
|
2051
2126
|
lastReload.toLocaleTimeString()
|
|
2052
2127
|
] })
|
|
@@ -2057,7 +2132,7 @@ function HotReloadIndicator() {
|
|
|
2057
2132
|
// src/components/docs/image-card.tsx
|
|
2058
2133
|
var import_image = __toESM(require("next/image"));
|
|
2059
2134
|
var import_link8 = __toESM(require("next/link"));
|
|
2060
|
-
var
|
|
2135
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2061
2136
|
function ImageCard({
|
|
2062
2137
|
src,
|
|
2063
2138
|
alt,
|
|
@@ -2072,8 +2147,8 @@ function ImageCard({
|
|
|
2072
2147
|
video: "aspect-video",
|
|
2073
2148
|
portrait: "aspect-[3/4]"
|
|
2074
2149
|
};
|
|
2075
|
-
const content = /* @__PURE__ */ (0,
|
|
2076
|
-
/* @__PURE__ */ (0,
|
|
2150
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-0 p-0", children: [
|
|
2151
|
+
/* @__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)(
|
|
2077
2152
|
import_image.default,
|
|
2078
2153
|
{
|
|
2079
2154
|
src,
|
|
@@ -2083,14 +2158,14 @@ function ImageCard({
|
|
|
2083
2158
|
className: "object-cover transition-transform duration-300 group-hover:scale-105"
|
|
2084
2159
|
}
|
|
2085
2160
|
) }),
|
|
2086
|
-
(title || description) && /* @__PURE__ */ (0,
|
|
2087
|
-
title && /* @__PURE__ */ (0,
|
|
2088
|
-
description && /* @__PURE__ */ (0,
|
|
2161
|
+
(title || description) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "p-3 flex flex-col gap-1", children: [
|
|
2162
|
+
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 }),
|
|
2163
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm text-muted-foreground line-clamp-2 no-underline mb-0", children: description })
|
|
2089
2164
|
] })
|
|
2090
2165
|
] });
|
|
2091
2166
|
if (href) {
|
|
2092
2167
|
const Component = external ? "a" : import_link8.default;
|
|
2093
|
-
return /* @__PURE__ */ (0,
|
|
2168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2094
2169
|
Component,
|
|
2095
2170
|
{
|
|
2096
2171
|
href,
|
|
@@ -2100,7 +2175,7 @@ function ImageCard({
|
|
|
2100
2175
|
}
|
|
2101
2176
|
);
|
|
2102
2177
|
}
|
|
2103
|
-
return /* @__PURE__ */ (0,
|
|
2178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "block rounded-xl border border-border overflow-hidden bg-card p-0", children: content });
|
|
2104
2179
|
}
|
|
2105
2180
|
function ImageCardGrid({ children, cols = 3 }) {
|
|
2106
2181
|
const gridCols = {
|
|
@@ -2109,20 +2184,20 @@ function ImageCardGrid({ children, cols = 3 }) {
|
|
|
2109
2184
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
|
|
2110
2185
|
4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
|
|
2111
2186
|
};
|
|
2112
|
-
return /* @__PURE__ */ (0,
|
|
2187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `grid ${gridCols[cols]} gap-4 my-6`, children });
|
|
2113
2188
|
}
|
|
2114
2189
|
|
|
2115
2190
|
// src/components/docs/image.tsx
|
|
2116
2191
|
var import_image2 = __toESM(require("next/image"));
|
|
2117
|
-
var
|
|
2118
|
-
var
|
|
2119
|
-
var
|
|
2192
|
+
var import_react15 = require("react");
|
|
2193
|
+
var import_lucide_react21 = require("lucide-react");
|
|
2194
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2120
2195
|
function Image({ src, alt, caption, width, height, zoom = true }) {
|
|
2121
|
-
const [isZoomed, setIsZoomed] = (0,
|
|
2122
|
-
return /* @__PURE__ */ (0,
|
|
2123
|
-
/* @__PURE__ */ (0,
|
|
2124
|
-
/* @__PURE__ */ (0,
|
|
2125
|
-
/* @__PURE__ */ (0,
|
|
2196
|
+
const [isZoomed, setIsZoomed] = (0, import_react15.useState)(false);
|
|
2197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
2198
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("figure", { className: "my-6", children: [
|
|
2199
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "relative group rounded-xl border border-border overflow-hidden bg-muted/30", children: [
|
|
2200
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2126
2201
|
import_image2.default,
|
|
2127
2202
|
{
|
|
2128
2203
|
src,
|
|
@@ -2132,34 +2207,34 @@ function Image({ src, alt, caption, width, height, zoom = true }) {
|
|
|
2132
2207
|
className: "w-full h-auto"
|
|
2133
2208
|
}
|
|
2134
2209
|
),
|
|
2135
|
-
zoom && /* @__PURE__ */ (0,
|
|
2210
|
+
zoom && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2136
2211
|
"button",
|
|
2137
2212
|
{
|
|
2138
2213
|
onClick: () => setIsZoomed(true),
|
|
2139
2214
|
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",
|
|
2140
2215
|
"aria-label": "Zoom image",
|
|
2141
|
-
children: /* @__PURE__ */ (0,
|
|
2216
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react21.ZoomIn, { className: "h-4 w-4 text-foreground" })
|
|
2142
2217
|
}
|
|
2143
2218
|
)
|
|
2144
2219
|
] }),
|
|
2145
|
-
caption && /* @__PURE__ */ (0,
|
|
2220
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground italic", children: caption })
|
|
2146
2221
|
] }),
|
|
2147
|
-
isZoomed && /* @__PURE__ */ (0,
|
|
2222
|
+
isZoomed && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2148
2223
|
"div",
|
|
2149
2224
|
{
|
|
2150
2225
|
className: "fixed inset-0 z-50 bg-background/95 backdrop-blur-sm flex items-center justify-center p-4",
|
|
2151
2226
|
onClick: () => setIsZoomed(false),
|
|
2152
2227
|
children: [
|
|
2153
|
-
/* @__PURE__ */ (0,
|
|
2228
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2154
2229
|
"button",
|
|
2155
2230
|
{
|
|
2156
2231
|
onClick: () => setIsZoomed(false),
|
|
2157
2232
|
className: "absolute top-4 right-4 p-2 rounded-md bg-muted hover:bg-muted/80 transition-colors",
|
|
2158
2233
|
"aria-label": "Close",
|
|
2159
|
-
children: /* @__PURE__ */ (0,
|
|
2234
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react21.X, { className: "h-5 w-5 text-foreground" })
|
|
2160
2235
|
}
|
|
2161
2236
|
),
|
|
2162
|
-
/* @__PURE__ */ (0,
|
|
2237
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "max-w-7xl max-h-[90vh] overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2163
2238
|
import_image2.default,
|
|
2164
2239
|
{
|
|
2165
2240
|
src,
|
|
@@ -2176,11 +2251,11 @@ function Image({ src, alt, caption, width, height, zoom = true }) {
|
|
|
2176
2251
|
}
|
|
2177
2252
|
|
|
2178
2253
|
// src/components/docs/math.tsx
|
|
2179
|
-
var
|
|
2180
|
-
var
|
|
2254
|
+
var import_react16 = require("react");
|
|
2255
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2181
2256
|
function Math2({ children, block = false }) {
|
|
2182
|
-
const containerRef = (0,
|
|
2183
|
-
(0,
|
|
2257
|
+
const containerRef = (0, import_react16.useRef)(null);
|
|
2258
|
+
(0, import_react16.useEffect)(() => {
|
|
2184
2259
|
const renderMath = async () => {
|
|
2185
2260
|
try {
|
|
2186
2261
|
const katex = (await import("katex")).default;
|
|
@@ -2200,7 +2275,7 @@ function Math2({ children, block = false }) {
|
|
|
2200
2275
|
renderMath();
|
|
2201
2276
|
}, [children, block]);
|
|
2202
2277
|
if (block) {
|
|
2203
|
-
return /* @__PURE__ */ (0,
|
|
2278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2204
2279
|
"div",
|
|
2205
2280
|
{
|
|
2206
2281
|
ref: containerRef,
|
|
@@ -2208,15 +2283,15 @@ function Math2({ children, block = false }) {
|
|
|
2208
2283
|
}
|
|
2209
2284
|
);
|
|
2210
2285
|
}
|
|
2211
|
-
return /* @__PURE__ */ (0,
|
|
2286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { ref: containerRef, className: "inline-block" });
|
|
2212
2287
|
}
|
|
2213
2288
|
|
|
2214
2289
|
// src/components/docs/mdx-hot-reload.tsx
|
|
2215
|
-
var
|
|
2216
|
-
var
|
|
2290
|
+
var import_react17 = require("react");
|
|
2291
|
+
var import_navigation7 = require("next/navigation");
|
|
2217
2292
|
function MdxHotReload() {
|
|
2218
|
-
const router = (0,
|
|
2219
|
-
(0,
|
|
2293
|
+
const router = (0, import_navigation7.useRouter)();
|
|
2294
|
+
(0, import_react17.useEffect)(() => {
|
|
2220
2295
|
if (process.env.NODE_ENV !== "development") return;
|
|
2221
2296
|
const eventSource = new EventSource("/api/mdx-watch");
|
|
2222
2297
|
eventSource.onmessage = (event) => {
|
|
@@ -2240,12 +2315,12 @@ function MdxHotReload() {
|
|
|
2240
2315
|
}
|
|
2241
2316
|
|
|
2242
2317
|
// src/components/docs/mermaid.tsx
|
|
2243
|
-
var
|
|
2244
|
-
var
|
|
2318
|
+
var import_react18 = require("react");
|
|
2319
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2245
2320
|
function Mermaid({ chart, caption }) {
|
|
2246
|
-
const containerRef = (0,
|
|
2247
|
-
const [error, setError] = (0,
|
|
2248
|
-
(0,
|
|
2321
|
+
const containerRef = (0, import_react18.useRef)(null);
|
|
2322
|
+
const [error, setError] = (0, import_react18.useState)(null);
|
|
2323
|
+
(0, import_react18.useEffect)(() => {
|
|
2249
2324
|
const renderChart = async () => {
|
|
2250
2325
|
try {
|
|
2251
2326
|
const mermaid = (await import("mermaid")).default;
|
|
@@ -2277,75 +2352,75 @@ function Mermaid({ chart, caption }) {
|
|
|
2277
2352
|
return () => observer.disconnect();
|
|
2278
2353
|
}, [chart]);
|
|
2279
2354
|
if (error) {
|
|
2280
|
-
return /* @__PURE__ */ (0,
|
|
2355
|
+
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: [
|
|
2281
2356
|
"Mermaid Error: ",
|
|
2282
2357
|
error
|
|
2283
2358
|
] }) });
|
|
2284
2359
|
}
|
|
2285
|
-
return /* @__PURE__ */ (0,
|
|
2286
|
-
/* @__PURE__ */ (0,
|
|
2360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("figure", { className: "my-6", children: [
|
|
2361
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2287
2362
|
"div",
|
|
2288
2363
|
{
|
|
2289
2364
|
ref: containerRef,
|
|
2290
2365
|
className: "flex justify-center items-center p-6 rounded-xl border border-border bg-muted/30 overflow-x-auto"
|
|
2291
2366
|
}
|
|
2292
2367
|
),
|
|
2293
|
-
caption && /* @__PURE__ */ (0,
|
|
2368
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground italic", children: caption })
|
|
2294
2369
|
] });
|
|
2295
2370
|
}
|
|
2296
2371
|
|
|
2297
2372
|
// src/components/docs/not-found-content.tsx
|
|
2298
2373
|
var import_link9 = __toESM(require("next/link"));
|
|
2299
|
-
var
|
|
2300
|
-
var
|
|
2374
|
+
var import_lucide_react22 = require("lucide-react");
|
|
2375
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2301
2376
|
function NotFoundContent({ version }) {
|
|
2302
|
-
return /* @__PURE__ */ (0,
|
|
2303
|
-
/* @__PURE__ */ (0,
|
|
2304
|
-
/* @__PURE__ */ (0,
|
|
2305
|
-
/* @__PURE__ */ (0,
|
|
2306
|
-
/* @__PURE__ */ (0,
|
|
2377
|
+
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: [
|
|
2378
|
+
/* @__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" }) }) }),
|
|
2379
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("h1", { className: "mb-3 text-5xl font-bold tracking-tight", children: "404" }),
|
|
2380
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("h2", { className: "mb-4 text-2xl font-semibold", children: "Page Not Found" }),
|
|
2381
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: "mb-8 text-base text-muted-foreground", children: [
|
|
2307
2382
|
"The documentation page you're looking for doesn't exist or may have been moved.",
|
|
2308
|
-
/* @__PURE__ */ (0,
|
|
2383
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("br", {}),
|
|
2309
2384
|
"Try using the sidebar to find what you're looking for, or return to the documentation home."
|
|
2310
2385
|
] }),
|
|
2311
|
-
/* @__PURE__ */ (0,
|
|
2312
|
-
/* @__PURE__ */ (0,
|
|
2386
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col items-center justify-center gap-3 sm:flex-row", children: [
|
|
2387
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2313
2388
|
import_link9.default,
|
|
2314
2389
|
{
|
|
2315
2390
|
href: `/docs/${version}`,
|
|
2316
2391
|
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",
|
|
2317
2392
|
children: [
|
|
2318
|
-
/* @__PURE__ */ (0,
|
|
2393
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react22.ArrowLeft, { className: "h-4 w-4" }),
|
|
2319
2394
|
"Back to Documentation"
|
|
2320
2395
|
]
|
|
2321
2396
|
}
|
|
2322
2397
|
),
|
|
2323
|
-
/* @__PURE__ */ (0,
|
|
2398
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2324
2399
|
import_link9.default,
|
|
2325
2400
|
{
|
|
2326
2401
|
href: "/",
|
|
2327
2402
|
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",
|
|
2328
2403
|
children: [
|
|
2329
|
-
/* @__PURE__ */ (0,
|
|
2404
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react22.Home, { className: "h-4 w-4" }),
|
|
2330
2405
|
"Go to Homepage"
|
|
2331
2406
|
]
|
|
2332
2407
|
}
|
|
2333
2408
|
)
|
|
2334
2409
|
] }),
|
|
2335
|
-
/* @__PURE__ */ (0,
|
|
2336
|
-
/* @__PURE__ */ (0,
|
|
2410
|
+
/* @__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: [
|
|
2411
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("strong", { className: "font-medium text-foreground", children: "Tip:" }),
|
|
2337
2412
|
" Use the sidebar navigation on the left to browse all available documentation pages."
|
|
2338
2413
|
] }) })
|
|
2339
2414
|
] }) });
|
|
2340
2415
|
}
|
|
2341
2416
|
|
|
2342
2417
|
// src/components/docs/search-highlight.tsx
|
|
2343
|
-
var
|
|
2344
|
-
var
|
|
2418
|
+
var import_react19 = require("react");
|
|
2419
|
+
var import_navigation8 = require("next/navigation");
|
|
2345
2420
|
function SearchHighlight() {
|
|
2346
|
-
const searchParams = (0,
|
|
2421
|
+
const searchParams = (0, import_navigation8.useSearchParams)();
|
|
2347
2422
|
const query = searchParams.get("q");
|
|
2348
|
-
(0,
|
|
2423
|
+
(0, import_react19.useEffect)(() => {
|
|
2349
2424
|
if (!query) {
|
|
2350
2425
|
document.querySelectorAll("mark.search-highlight").forEach((mark) => {
|
|
2351
2426
|
const parent = mark.parentNode;
|
|
@@ -2439,20 +2514,20 @@ function escapeRegex(string) {
|
|
|
2439
2514
|
}
|
|
2440
2515
|
|
|
2441
2516
|
// src/components/docs/sidebar-skeleton.tsx
|
|
2442
|
-
var
|
|
2517
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2443
2518
|
function SidebarSkeleton() {
|
|
2444
|
-
return /* @__PURE__ */ (0,
|
|
2445
|
-
/* @__PURE__ */ (0,
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2519
|
+
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: [
|
|
2520
|
+
/* @__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" }) }),
|
|
2521
|
+
/* @__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)(
|
|
2447
2522
|
"div",
|
|
2448
2523
|
{
|
|
2449
2524
|
className: "h-4 bg-muted/50 rounded animate-pulse",
|
|
2450
2525
|
style: { width: `${60 + Math.random() * 40}%` }
|
|
2451
2526
|
}
|
|
2452
2527
|
) }, i)) }),
|
|
2453
|
-
/* @__PURE__ */ (0,
|
|
2454
|
-
/* @__PURE__ */ (0,
|
|
2455
|
-
[...Array(5)].map((_, i) => /* @__PURE__ */ (0,
|
|
2528
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "space-y-1", children: [
|
|
2529
|
+
/* @__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" }) }),
|
|
2530
|
+
[...Array(5)].map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2456
2531
|
"div",
|
|
2457
2532
|
{
|
|
2458
2533
|
className: "h-4 bg-muted/50 rounded animate-pulse",
|
|
@@ -2464,29 +2539,29 @@ function SidebarSkeleton() {
|
|
|
2464
2539
|
}
|
|
2465
2540
|
|
|
2466
2541
|
// src/components/docs/steps.tsx
|
|
2467
|
-
var
|
|
2542
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2468
2543
|
function Steps({ children }) {
|
|
2469
|
-
return /* @__PURE__ */ (0,
|
|
2544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "my-6 ml-4 space-y-6 [counter-reset:step]", children });
|
|
2470
2545
|
}
|
|
2471
2546
|
function Step({ title, children }) {
|
|
2472
|
-
return /* @__PURE__ */ (0,
|
|
2473
|
-
/* @__PURE__ */ (0,
|
|
2474
|
-
/* @__PURE__ */ (0,
|
|
2547
|
+
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: [
|
|
2548
|
+
/* @__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 }) }),
|
|
2549
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "prose prose-sm dark:prose-invert max-w-none [&>*:last-child]:mb-0", children })
|
|
2475
2550
|
] });
|
|
2476
2551
|
}
|
|
2477
2552
|
|
|
2478
2553
|
// src/components/docs/table-of-contents.tsx
|
|
2479
|
-
var
|
|
2480
|
-
var
|
|
2554
|
+
var import_react20 = require("react");
|
|
2555
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2481
2556
|
function TableOfContents({ items, config }) {
|
|
2482
|
-
const [activeId, setActiveId] = (0,
|
|
2557
|
+
const [activeId, setActiveId] = (0, import_react20.useState)("");
|
|
2483
2558
|
if (!config.navigation?.showTableOfContents) {
|
|
2484
2559
|
return null;
|
|
2485
2560
|
}
|
|
2486
2561
|
const maxDepth = config.navigation?.tocMaxDepth || 3;
|
|
2487
2562
|
const filteredItems = items.filter((item) => item.level <= maxDepth);
|
|
2488
2563
|
const hasTabGroups = config.navigation?.tabGroups && config.navigation.tabGroups.length > 0;
|
|
2489
|
-
(0,
|
|
2564
|
+
(0, import_react20.useEffect)(() => {
|
|
2490
2565
|
const observer = new IntersectionObserver(
|
|
2491
2566
|
(entries) => {
|
|
2492
2567
|
entries.forEach((entry) => {
|
|
@@ -2522,9 +2597,9 @@ function TableOfContents({ items, config }) {
|
|
|
2522
2597
|
};
|
|
2523
2598
|
const stickyTop = hasTabGroups ? "top-[7.5rem]" : "top-24";
|
|
2524
2599
|
const maxHeight = hasTabGroups ? "max-h-[calc(100vh-10rem)]" : "max-h-[calc(100vh-7rem)]";
|
|
2525
|
-
return /* @__PURE__ */ (0,
|
|
2526
|
-
/* @__PURE__ */ (0,
|
|
2527
|
-
/* @__PURE__ */ (0,
|
|
2600
|
+
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: [
|
|
2601
|
+
/* @__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" }),
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("nav", { className: "space-y-1", children: filteredItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2528
2603
|
"a",
|
|
2529
2604
|
{
|
|
2530
2605
|
href: `#${item.id}`,
|
|
@@ -2538,20 +2613,20 @@ function TableOfContents({ items, config }) {
|
|
|
2538
2613
|
}
|
|
2539
2614
|
|
|
2540
2615
|
// src/components/docs/tabs.tsx
|
|
2541
|
-
var
|
|
2542
|
-
var
|
|
2616
|
+
var import_react21 = require("react");
|
|
2617
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2543
2618
|
function Tab({ children }) {
|
|
2544
|
-
return /* @__PURE__ */ (0,
|
|
2619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children });
|
|
2545
2620
|
}
|
|
2546
2621
|
function Tabs({ children, defaultValue }) {
|
|
2547
|
-
const tabs =
|
|
2622
|
+
const tabs = import_react21.Children.toArray(children).filter(import_react21.isValidElement);
|
|
2548
2623
|
const firstTabLabel = tabs[0]?.props.label || "";
|
|
2549
|
-
const [activeTab, setActiveTab] = (0,
|
|
2550
|
-
return /* @__PURE__ */ (0,
|
|
2551
|
-
/* @__PURE__ */ (0,
|
|
2624
|
+
const [activeTab, setActiveTab] = (0, import_react21.useState)(defaultValue || firstTabLabel);
|
|
2625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "my-6", children: [
|
|
2626
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex items-center gap-1 border-b border-border mb-4", children: tabs.map((tab) => {
|
|
2552
2627
|
const label = tab.props.label;
|
|
2553
2628
|
const isActive = activeTab === label;
|
|
2554
|
-
return /* @__PURE__ */ (0,
|
|
2629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2555
2630
|
"button",
|
|
2556
2631
|
{
|
|
2557
2632
|
onClick: () => setActiveTab(label),
|
|
@@ -2564,23 +2639,23 @@ function Tabs({ children, defaultValue }) {
|
|
|
2564
2639
|
tabs.map((tab) => {
|
|
2565
2640
|
const label = tab.props.label;
|
|
2566
2641
|
if (activeTab !== label) return null;
|
|
2567
|
-
return /* @__PURE__ */ (0,
|
|
2642
|
+
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);
|
|
2568
2643
|
})
|
|
2569
2644
|
] });
|
|
2570
2645
|
}
|
|
2571
2646
|
|
|
2572
2647
|
// src/components/docs/tooltip.tsx
|
|
2573
|
-
var
|
|
2574
|
-
var
|
|
2648
|
+
var import_react22 = require("react");
|
|
2649
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2575
2650
|
function Tooltip({ children, content, position = "top" }) {
|
|
2576
|
-
const [isVisible, setIsVisible] = (0,
|
|
2651
|
+
const [isVisible, setIsVisible] = (0, import_react22.useState)(false);
|
|
2577
2652
|
const positions = {
|
|
2578
2653
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
2579
2654
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
2580
2655
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
2581
2656
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
2582
2657
|
};
|
|
2583
|
-
return /* @__PURE__ */ (0,
|
|
2658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2584
2659
|
"span",
|
|
2585
2660
|
{
|
|
2586
2661
|
className: "relative inline-flex underline decoration-dotted cursor-help",
|
|
@@ -2588,7 +2663,7 @@ function Tooltip({ children, content, position = "top" }) {
|
|
|
2588
2663
|
onMouseLeave: () => setIsVisible(false),
|
|
2589
2664
|
children: [
|
|
2590
2665
|
children,
|
|
2591
|
-
isVisible && /* @__PURE__ */ (0,
|
|
2666
|
+
isVisible && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2592
2667
|
"span",
|
|
2593
2668
|
{
|
|
2594
2669
|
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`,
|
|
@@ -2601,7 +2676,7 @@ function Tooltip({ children, content, position = "top" }) {
|
|
|
2601
2676
|
}
|
|
2602
2677
|
|
|
2603
2678
|
// src/components/docs/video.tsx
|
|
2604
|
-
var
|
|
2679
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2605
2680
|
function Video({
|
|
2606
2681
|
src,
|
|
2607
2682
|
caption,
|
|
@@ -2621,8 +2696,8 @@ function Video({
|
|
|
2621
2696
|
const match = url.match(/vimeo\.com\/(\d+)/);
|
|
2622
2697
|
return match ? match[1] : null;
|
|
2623
2698
|
};
|
|
2624
|
-
return /* @__PURE__ */ (0,
|
|
2625
|
-
/* @__PURE__ */ (0,
|
|
2699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("figure", { className: "my-6", children: [
|
|
2700
|
+
/* @__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)(
|
|
2626
2701
|
"iframe",
|
|
2627
2702
|
{
|
|
2628
2703
|
className: "absolute top-0 left-0 w-full h-full",
|
|
@@ -2631,7 +2706,7 @@ function Video({
|
|
|
2631
2706
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
2632
2707
|
allowFullScreen: true
|
|
2633
2708
|
}
|
|
2634
|
-
) }) : isVimeo ? /* @__PURE__ */ (0,
|
|
2709
|
+
) }) : isVimeo ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "relative w-full", style: { paddingBottom: "56.25%" }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2635
2710
|
"iframe",
|
|
2636
2711
|
{
|
|
2637
2712
|
className: "absolute top-0 left-0 w-full h-full",
|
|
@@ -2640,7 +2715,7 @@ function Video({
|
|
|
2640
2715
|
allow: "autoplay; fullscreen; picture-in-picture",
|
|
2641
2716
|
allowFullScreen: true
|
|
2642
2717
|
}
|
|
2643
|
-
) }) : /* @__PURE__ */ (0,
|
|
2718
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2644
2719
|
"video",
|
|
2645
2720
|
{
|
|
2646
2721
|
src,
|
|
@@ -2653,14 +2728,14 @@ function Video({
|
|
|
2653
2728
|
children: "Your browser does not support the video tag."
|
|
2654
2729
|
}
|
|
2655
2730
|
) }),
|
|
2656
|
-
caption && /* @__PURE__ */ (0,
|
|
2731
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground italic", children: caption })
|
|
2657
2732
|
] });
|
|
2658
2733
|
}
|
|
2659
2734
|
|
|
2660
2735
|
// src/components/docs/api/api-endpoint.tsx
|
|
2661
|
-
var
|
|
2662
|
-
var
|
|
2663
|
-
var
|
|
2736
|
+
var import_react23 = require("react");
|
|
2737
|
+
var import_lucide_react23 = require("lucide-react");
|
|
2738
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2664
2739
|
var methodColors = {
|
|
2665
2740
|
GET: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
|
|
2666
2741
|
POST: "bg-green-500/10 text-green-600 dark:text-green-400",
|
|
@@ -2669,15 +2744,15 @@ var methodColors = {
|
|
|
2669
2744
|
DELETE: "bg-red-500/10 text-red-600 dark:text-red-400"
|
|
2670
2745
|
};
|
|
2671
2746
|
function ApiEndpoint({ method, path, summary, children, defaultOpen = false }) {
|
|
2672
|
-
const [isOpen, setIsOpen] = (0,
|
|
2673
|
-
return /* @__PURE__ */ (0,
|
|
2674
|
-
/* @__PURE__ */ (0,
|
|
2747
|
+
const [isOpen, setIsOpen] = (0, import_react23.useState)(defaultOpen);
|
|
2748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "not-prose mb-4 rounded-xl border border-border overflow-hidden", children: [
|
|
2749
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
2675
2750
|
"button",
|
|
2676
2751
|
{
|
|
2677
2752
|
onClick: () => setIsOpen(!isOpen),
|
|
2678
2753
|
className: "w-full flex items-center gap-3 px-4 py-3 text-left bg-muted/30 hover:bg-muted/50 transition-colors",
|
|
2679
2754
|
children: [
|
|
2680
|
-
/* @__PURE__ */ (0,
|
|
2755
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2681
2756
|
"span",
|
|
2682
2757
|
{
|
|
2683
2758
|
className: cn(
|
|
@@ -2687,10 +2762,10 @@ function ApiEndpoint({ method, path, summary, children, defaultOpen = false }) {
|
|
|
2687
2762
|
children: method
|
|
2688
2763
|
}
|
|
2689
2764
|
),
|
|
2690
|
-
/* @__PURE__ */ (0,
|
|
2691
|
-
summary && /* @__PURE__ */ (0,
|
|
2692
|
-
/* @__PURE__ */ (0,
|
|
2693
|
-
|
|
2765
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("code", { className: "text-sm font-mono", children: path }),
|
|
2766
|
+
summary && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-sm text-muted-foreground ml-auto mr-2", children: summary }),
|
|
2767
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2768
|
+
import_lucide_react23.ChevronDown,
|
|
2694
2769
|
{
|
|
2695
2770
|
className: cn(
|
|
2696
2771
|
"h-5 w-5 text-muted-foreground transition-transform flex-shrink-0",
|
|
@@ -2701,34 +2776,34 @@ function ApiEndpoint({ method, path, summary, children, defaultOpen = false }) {
|
|
|
2701
2776
|
]
|
|
2702
2777
|
}
|
|
2703
2778
|
),
|
|
2704
|
-
isOpen && children && /* @__PURE__ */ (0,
|
|
2779
|
+
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 }) })
|
|
2705
2780
|
] });
|
|
2706
2781
|
}
|
|
2707
2782
|
|
|
2708
2783
|
// src/components/docs/api/api-params.tsx
|
|
2709
|
-
var
|
|
2784
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2710
2785
|
function ApiParams({ title = "Parameters", params }) {
|
|
2711
2786
|
if (!params || params.length === 0) return null;
|
|
2712
|
-
return /* @__PURE__ */ (0,
|
|
2713
|
-
/* @__PURE__ */ (0,
|
|
2714
|
-
/* @__PURE__ */ (0,
|
|
2715
|
-
/* @__PURE__ */ (0,
|
|
2716
|
-
/* @__PURE__ */ (0,
|
|
2717
|
-
/* @__PURE__ */ (0,
|
|
2718
|
-
/* @__PURE__ */ (0,
|
|
2719
|
-
/* @__PURE__ */ (0,
|
|
2720
|
-
/* @__PURE__ */ (0,
|
|
2787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "mb-6", children: [
|
|
2788
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: title }),
|
|
2789
|
+
/* @__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: [
|
|
2790
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("tr", { className: "border-b border-border", children: [
|
|
2791
|
+
/* @__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" }),
|
|
2792
|
+
/* @__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" }),
|
|
2793
|
+
/* @__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" }),
|
|
2794
|
+
/* @__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" }),
|
|
2795
|
+
/* @__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" })
|
|
2721
2796
|
] }) }),
|
|
2722
|
-
/* @__PURE__ */ (0,
|
|
2797
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("tbody", { children: params.map((param, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
2723
2798
|
"tr",
|
|
2724
2799
|
{
|
|
2725
2800
|
className: index !== params.length - 1 ? "border-b border-border/50" : "",
|
|
2726
2801
|
children: [
|
|
2727
|
-
/* @__PURE__ */ (0,
|
|
2728
|
-
/* @__PURE__ */ (0,
|
|
2729
|
-
/* @__PURE__ */ (0,
|
|
2730
|
-
/* @__PURE__ */ (0,
|
|
2731
|
-
/* @__PURE__ */ (0,
|
|
2802
|
+
/* @__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 }) }),
|
|
2803
|
+
/* @__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 }) }),
|
|
2804
|
+
/* @__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" }) }),
|
|
2805
|
+
/* @__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: "-" }) }),
|
|
2806
|
+
/* @__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: "-" }) })
|
|
2732
2807
|
]
|
|
2733
2808
|
},
|
|
2734
2809
|
param.name
|
|
@@ -2738,7 +2813,7 @@ function ApiParams({ title = "Parameters", params }) {
|
|
|
2738
2813
|
}
|
|
2739
2814
|
|
|
2740
2815
|
// src/components/docs/api/api-response.tsx
|
|
2741
|
-
var
|
|
2816
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2742
2817
|
var statusColors = {
|
|
2743
2818
|
"2": "text-green-600 dark:text-green-400",
|
|
2744
2819
|
"3": "text-blue-600 dark:text-blue-400",
|
|
@@ -2747,14 +2822,14 @@ var statusColors = {
|
|
|
2747
2822
|
};
|
|
2748
2823
|
function ApiResponse({ status, description, example, schema }) {
|
|
2749
2824
|
const statusClass = statusColors[String(status)[0]] || "text-muted-foreground";
|
|
2750
|
-
return /* @__PURE__ */ (0,
|
|
2751
|
-
/* @__PURE__ */ (0,
|
|
2752
|
-
/* @__PURE__ */ (0,
|
|
2753
|
-
description && /* @__PURE__ */ (0,
|
|
2825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "mb-4", children: [
|
|
2826
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
2827
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: `text-sm font-semibold ${statusClass}`, children: status }),
|
|
2828
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm text-muted-foreground", children: description })
|
|
2754
2829
|
] }),
|
|
2755
|
-
example && /* @__PURE__ */ (0,
|
|
2756
|
-
/* @__PURE__ */ (0,
|
|
2757
|
-
/* @__PURE__ */ (0,
|
|
2830
|
+
example && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "mb-3", children: [
|
|
2831
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: "Example Response" }),
|
|
2832
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2758
2833
|
CodeBlock,
|
|
2759
2834
|
{
|
|
2760
2835
|
code: typeof example === "string" ? example : JSON.stringify(example, null, 2),
|
|
@@ -2762,9 +2837,9 @@ function ApiResponse({ status, description, example, schema }) {
|
|
|
2762
2837
|
}
|
|
2763
2838
|
)
|
|
2764
2839
|
] }),
|
|
2765
|
-
schema && /* @__PURE__ */ (0,
|
|
2766
|
-
/* @__PURE__ */ (0,
|
|
2767
|
-
/* @__PURE__ */ (0,
|
|
2840
|
+
schema && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
|
|
2841
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: "Schema" }),
|
|
2842
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2768
2843
|
CodeBlock,
|
|
2769
2844
|
{
|
|
2770
2845
|
code: typeof schema === "string" ? schema : JSON.stringify(schema, null, 2),
|
|
@@ -2776,12 +2851,12 @@ function ApiResponse({ status, description, example, schema }) {
|
|
|
2776
2851
|
}
|
|
2777
2852
|
|
|
2778
2853
|
// src/components/docs/api/api-playground.tsx
|
|
2779
|
-
var
|
|
2854
|
+
var import_react24 = require("react");
|
|
2780
2855
|
|
|
2781
2856
|
// src/components/ui/button.tsx
|
|
2782
2857
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
2783
2858
|
var import_class_variance_authority = require("class-variance-authority");
|
|
2784
|
-
var
|
|
2859
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2785
2860
|
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
2786
2861
|
"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",
|
|
2787
2862
|
{
|
|
@@ -2817,7 +2892,7 @@ function Button({
|
|
|
2817
2892
|
...props
|
|
2818
2893
|
}) {
|
|
2819
2894
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
2820
|
-
return /* @__PURE__ */ (0,
|
|
2895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2821
2896
|
Comp,
|
|
2822
2897
|
{
|
|
2823
2898
|
"data-slot": "button",
|
|
@@ -2828,9 +2903,9 @@ function Button({
|
|
|
2828
2903
|
}
|
|
2829
2904
|
|
|
2830
2905
|
// src/components/ui/input.tsx
|
|
2831
|
-
var
|
|
2906
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2832
2907
|
function Input({ className, type, ...props }) {
|
|
2833
|
-
return /* @__PURE__ */ (0,
|
|
2908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2834
2909
|
"input",
|
|
2835
2910
|
{
|
|
2836
2911
|
type,
|
|
@@ -2847,9 +2922,9 @@ function Input({ className, type, ...props }) {
|
|
|
2847
2922
|
}
|
|
2848
2923
|
|
|
2849
2924
|
// src/components/ui/textarea.tsx
|
|
2850
|
-
var
|
|
2925
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2851
2926
|
function Textarea({ className, ...props }) {
|
|
2852
|
-
return /* @__PURE__ */ (0,
|
|
2927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2853
2928
|
"textarea",
|
|
2854
2929
|
{
|
|
2855
2930
|
"data-slot": "textarea",
|
|
@@ -2865,7 +2940,7 @@ function Textarea({ className, ...props }) {
|
|
|
2865
2940
|
// src/components/ui/badge.tsx
|
|
2866
2941
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
2867
2942
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
2868
|
-
var
|
|
2943
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2869
2944
|
var badgeVariants = (0, import_class_variance_authority2.cva)(
|
|
2870
2945
|
"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",
|
|
2871
2946
|
{
|
|
@@ -2889,7 +2964,7 @@ function Badge2({
|
|
|
2889
2964
|
...props
|
|
2890
2965
|
}) {
|
|
2891
2966
|
const Comp = asChild ? import_react_slot2.Slot : "span";
|
|
2892
|
-
return /* @__PURE__ */ (0,
|
|
2967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2893
2968
|
Comp,
|
|
2894
2969
|
{
|
|
2895
2970
|
"data-slot": "badge",
|
|
@@ -2900,8 +2975,8 @@ function Badge2({
|
|
|
2900
2975
|
}
|
|
2901
2976
|
|
|
2902
2977
|
// src/components/docs/api/api-playground.tsx
|
|
2903
|
-
var
|
|
2904
|
-
var
|
|
2978
|
+
var import_lucide_react24 = require("lucide-react");
|
|
2979
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2905
2980
|
function ApiPlayground({
|
|
2906
2981
|
method,
|
|
2907
2982
|
path,
|
|
@@ -2910,19 +2985,19 @@ function ApiPlayground({
|
|
|
2910
2985
|
defaultBody,
|
|
2911
2986
|
pathParams = []
|
|
2912
2987
|
}) {
|
|
2913
|
-
const [loading, setLoading] = (0,
|
|
2914
|
-
const [response, setResponse] = (0,
|
|
2915
|
-
const [error, setError] = (0,
|
|
2916
|
-
const [requestBody, setRequestBody] = (0,
|
|
2917
|
-
const initialHeaders = (0,
|
|
2988
|
+
const [loading, setLoading] = (0, import_react24.useState)(false);
|
|
2989
|
+
const [response, setResponse] = (0, import_react24.useState)(null);
|
|
2990
|
+
const [error, setError] = (0, import_react24.useState)(null);
|
|
2991
|
+
const [requestBody, setRequestBody] = (0, import_react24.useState)(defaultBody || "");
|
|
2992
|
+
const initialHeaders = (0, import_react24.useMemo)(() => {
|
|
2918
2993
|
const cleanHeaders = {};
|
|
2919
2994
|
Object.entries(headers).forEach(([key, value]) => {
|
|
2920
2995
|
cleanHeaders[key] = value || "";
|
|
2921
2996
|
});
|
|
2922
2997
|
return cleanHeaders;
|
|
2923
2998
|
}, [headers]);
|
|
2924
|
-
const [requestHeaders, setRequestHeaders] = (0,
|
|
2925
|
-
const extractedParams = (0,
|
|
2999
|
+
const [requestHeaders, setRequestHeaders] = (0, import_react24.useState)(JSON.stringify(initialHeaders, null, 2));
|
|
3000
|
+
const extractedParams = (0, import_react24.useMemo)(() => {
|
|
2926
3001
|
const params = {};
|
|
2927
3002
|
const pathParamPattern = /:(\w+)/g;
|
|
2928
3003
|
let match;
|
|
@@ -2939,7 +3014,7 @@ function ApiPlayground({
|
|
|
2939
3014
|
}
|
|
2940
3015
|
return params;
|
|
2941
3016
|
}, [path, pathParams]);
|
|
2942
|
-
const [pathParamValues, setPathParamValues] = (0,
|
|
3017
|
+
const [pathParamValues, setPathParamValues] = (0, import_react24.useState)(extractedParams);
|
|
2943
3018
|
const buildUrl = () => {
|
|
2944
3019
|
let finalPath = path;
|
|
2945
3020
|
Object.entries(pathParamValues).forEach(([key, value]) => {
|
|
@@ -2978,19 +3053,19 @@ function ApiPlayground({
|
|
|
2978
3053
|
setLoading(false);
|
|
2979
3054
|
}
|
|
2980
3055
|
};
|
|
2981
|
-
return /* @__PURE__ */ (0,
|
|
2982
|
-
/* @__PURE__ */ (0,
|
|
2983
|
-
/* @__PURE__ */ (0,
|
|
2984
|
-
Object.keys(pathParamValues).length > 0 && /* @__PURE__ */ (0,
|
|
2985
|
-
/* @__PURE__ */ (0,
|
|
2986
|
-
/* @__PURE__ */ (0,
|
|
3056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "not-prose border border-border rounded-lg overflow-hidden bg-card/30", children: [
|
|
3057
|
+
/* @__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" }) }),
|
|
3058
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "p-4 space-y-4", children: [
|
|
3059
|
+
Object.keys(pathParamValues).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
|
|
3060
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Path Parameters" }),
|
|
3061
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "space-y-2", children: Object.entries(pathParamValues).map(([paramName, paramValue]) => {
|
|
2987
3062
|
const paramConfig = pathParams.find((p) => p.name === paramName);
|
|
2988
|
-
return /* @__PURE__ */ (0,
|
|
2989
|
-
/* @__PURE__ */ (0,
|
|
3063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { className: "text-xs text-muted-foreground min-w-[80px]", children: [
|
|
2990
3065
|
":",
|
|
2991
3066
|
paramName
|
|
2992
3067
|
] }),
|
|
2993
|
-
/* @__PURE__ */ (0,
|
|
3068
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2994
3069
|
Input,
|
|
2995
3070
|
{
|
|
2996
3071
|
value: paramValue,
|
|
@@ -3002,16 +3077,16 @@ function ApiPlayground({
|
|
|
3002
3077
|
] }, paramName);
|
|
3003
3078
|
}) })
|
|
3004
3079
|
] }),
|
|
3005
|
-
/* @__PURE__ */ (0,
|
|
3006
|
-
/* @__PURE__ */ (0,
|
|
3007
|
-
/* @__PURE__ */ (0,
|
|
3008
|
-
/* @__PURE__ */ (0,
|
|
3009
|
-
/* @__PURE__ */ (0,
|
|
3080
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
|
|
3081
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Request URL" }),
|
|
3082
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3083
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Badge2, { variant: "outline", className: "font-mono", children: method }),
|
|
3084
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Input, { value: buildUrl(), readOnly: true, className: "font-mono text-sm" })
|
|
3010
3085
|
] })
|
|
3011
3086
|
] }),
|
|
3012
|
-
/* @__PURE__ */ (0,
|
|
3013
|
-
/* @__PURE__ */ (0,
|
|
3014
|
-
/* @__PURE__ */ (0,
|
|
3087
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
|
|
3088
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Headers (JSON)" }),
|
|
3089
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3015
3090
|
Textarea,
|
|
3016
3091
|
{
|
|
3017
3092
|
value: requestHeaders,
|
|
@@ -3021,9 +3096,9 @@ function ApiPlayground({
|
|
|
3021
3096
|
}
|
|
3022
3097
|
)
|
|
3023
3098
|
] }),
|
|
3024
|
-
method !== "GET" && method !== "DELETE" && /* @__PURE__ */ (0,
|
|
3025
|
-
/* @__PURE__ */ (0,
|
|
3026
|
-
/* @__PURE__ */ (0,
|
|
3099
|
+
method !== "GET" && method !== "DELETE" && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
|
|
3100
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Request Body (JSON)" }),
|
|
3101
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3027
3102
|
Textarea,
|
|
3028
3103
|
{
|
|
3029
3104
|
value: requestBody,
|
|
@@ -3034,30 +3109,30 @@ function ApiPlayground({
|
|
|
3034
3109
|
}
|
|
3035
3110
|
)
|
|
3036
3111
|
] }),
|
|
3037
|
-
/* @__PURE__ */ (0,
|
|
3038
|
-
/* @__PURE__ */ (0,
|
|
3112
|
+
/* @__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: [
|
|
3113
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react24.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
3039
3114
|
"Sending..."
|
|
3040
|
-
] }) : /* @__PURE__ */ (0,
|
|
3041
|
-
/* @__PURE__ */ (0,
|
|
3115
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
3116
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react24.Play, { className: "mr-2 h-4 w-4" }),
|
|
3042
3117
|
"Send Request"
|
|
3043
3118
|
] }) }),
|
|
3044
|
-
response && /* @__PURE__ */ (0,
|
|
3045
|
-
/* @__PURE__ */ (0,
|
|
3119
|
+
response && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "mt-4", children: [
|
|
3120
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: [
|
|
3046
3121
|
"Response (",
|
|
3047
3122
|
response.status,
|
|
3048
3123
|
" ",
|
|
3049
3124
|
response.statusText,
|
|
3050
3125
|
")"
|
|
3051
3126
|
] }),
|
|
3052
|
-
/* @__PURE__ */ (0,
|
|
3127
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CodeBlock, { code: JSON.stringify(response.body, null, 2), language: "json" })
|
|
3053
3128
|
] }),
|
|
3054
|
-
error && /* @__PURE__ */ (0,
|
|
3129
|
+
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 }) })
|
|
3055
3130
|
] })
|
|
3056
3131
|
] });
|
|
3057
3132
|
}
|
|
3058
3133
|
|
|
3059
3134
|
// src/components/docs/api/api-reference.tsx
|
|
3060
|
-
var
|
|
3135
|
+
var import_react25 = require("react");
|
|
3061
3136
|
|
|
3062
3137
|
// src/lib/parsers/specra-parser.ts
|
|
3063
3138
|
var SpecraParser = class {
|
|
@@ -3508,13 +3583,13 @@ function parseApiSpec(input, parserType = "auto") {
|
|
|
3508
3583
|
}
|
|
3509
3584
|
|
|
3510
3585
|
// src/components/docs/api/api-reference.tsx
|
|
3511
|
-
var
|
|
3512
|
-
var
|
|
3586
|
+
var import_lucide_react25 = require("lucide-react");
|
|
3587
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3513
3588
|
function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
3514
|
-
const [apiSpec, setApiSpec] = (0,
|
|
3515
|
-
const [loading, setLoading] = (0,
|
|
3516
|
-
const [error, setError] = (0,
|
|
3517
|
-
(0,
|
|
3589
|
+
const [apiSpec, setApiSpec] = (0, import_react25.useState)(null);
|
|
3590
|
+
const [loading, setLoading] = (0, import_react25.useState)(true);
|
|
3591
|
+
const [error, setError] = (0, import_react25.useState)(null);
|
|
3592
|
+
(0, import_react25.useEffect)(() => {
|
|
3518
3593
|
async function loadSpec() {
|
|
3519
3594
|
try {
|
|
3520
3595
|
const response = await fetch(spec);
|
|
@@ -3539,13 +3614,13 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3539
3614
|
});
|
|
3540
3615
|
};
|
|
3541
3616
|
if (loading) {
|
|
3542
|
-
return /* @__PURE__ */ (0,
|
|
3543
|
-
/* @__PURE__ */ (0,
|
|
3544
|
-
/* @__PURE__ */ (0,
|
|
3617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center justify-center py-12", children: [
|
|
3618
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react25.Loader2, { className: "h-6 w-6 animate-spin text-muted-foreground" }),
|
|
3619
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "ml-2 text-muted-foreground", children: "Loading API specification..." })
|
|
3545
3620
|
] });
|
|
3546
3621
|
}
|
|
3547
3622
|
if (error) {
|
|
3548
|
-
return /* @__PURE__ */ (0,
|
|
3623
|
+
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: [
|
|
3549
3624
|
"Error: ",
|
|
3550
3625
|
error
|
|
3551
3626
|
] }) });
|
|
@@ -3553,26 +3628,26 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3553
3628
|
if (!apiSpec) {
|
|
3554
3629
|
return null;
|
|
3555
3630
|
}
|
|
3556
|
-
return /* @__PURE__ */ (0,
|
|
3557
|
-
(apiSpec.title || apiSpec.description) && /* @__PURE__ */ (0,
|
|
3558
|
-
apiSpec.title && /* @__PURE__ */ (0,
|
|
3559
|
-
apiSpec.description && /* @__PURE__ */ (0,
|
|
3560
|
-
apiSpec.baseUrl && /* @__PURE__ */ (0,
|
|
3561
|
-
/* @__PURE__ */ (0,
|
|
3562
|
-
/* @__PURE__ */ (0,
|
|
3631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "space-y-6", children: [
|
|
3632
|
+
(apiSpec.title || apiSpec.description) && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "mb-8", children: [
|
|
3633
|
+
apiSpec.title && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h2", { className: "text-2xl font-semibold mb-2 text-foreground", children: apiSpec.title }),
|
|
3634
|
+
apiSpec.description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-muted-foreground", children: apiSpec.description }),
|
|
3635
|
+
apiSpec.baseUrl && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "mt-4", children: [
|
|
3636
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-sm font-semibold text-muted-foreground mb-1", children: "Base URL" }),
|
|
3637
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("code", { className: "text-sm px-2 py-1 bg-muted rounded", children: apiSpec.baseUrl })
|
|
3563
3638
|
] })
|
|
3564
3639
|
] }),
|
|
3565
|
-
apiSpec.auth && /* @__PURE__ */ (0,
|
|
3566
|
-
/* @__PURE__ */ (0,
|
|
3567
|
-
/* @__PURE__ */ (0,
|
|
3568
|
-
apiSpec.auth.type === "bearer" && /* @__PURE__ */ (0,
|
|
3640
|
+
apiSpec.auth && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "rounded-lg border border-border bg-card/30 p-4 mb-6", children: [
|
|
3641
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h3", { className: "text-lg font-semibold mb-2 text-foreground", children: "Authentication" }),
|
|
3642
|
+
/* @__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.` }),
|
|
3643
|
+
apiSpec.auth.type === "bearer" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3569
3644
|
CodeBlock,
|
|
3570
3645
|
{
|
|
3571
3646
|
code: `Authorization: ${apiSpec.auth.tokenPrefix || "Bearer"} {YOUR_TOKEN}`,
|
|
3572
3647
|
language: "bash"
|
|
3573
3648
|
}
|
|
3574
3649
|
),
|
|
3575
|
-
apiSpec.auth.type === "apiKey" && /* @__PURE__ */ (0,
|
|
3650
|
+
apiSpec.auth.type === "apiKey" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3576
3651
|
CodeBlock,
|
|
3577
3652
|
{
|
|
3578
3653
|
code: `${apiSpec.auth.headerName || "X-API-Key"}: {YOUR_API_KEY}`,
|
|
@@ -3580,7 +3655,7 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3580
3655
|
}
|
|
3581
3656
|
)
|
|
3582
3657
|
] }),
|
|
3583
|
-
/* @__PURE__ */ (0,
|
|
3658
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Accordion, { type: "single", collapsible: true, className: "space-y-4", children: apiSpec.endpoints.map((endpoint, index) => {
|
|
3584
3659
|
const allHeaders = [
|
|
3585
3660
|
...apiSpec.globalHeaders || [],
|
|
3586
3661
|
...endpoint.headers || []
|
|
@@ -3588,39 +3663,39 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3588
3663
|
...header,
|
|
3589
3664
|
value: interpolateEnv(header.value, apiSpec.env)
|
|
3590
3665
|
}));
|
|
3591
|
-
return /* @__PURE__ */ (0,
|
|
3666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3592
3667
|
AccordionItem,
|
|
3593
3668
|
{
|
|
3594
3669
|
value: `endpoint-${index}`,
|
|
3595
|
-
title: /* @__PURE__ */ (0,
|
|
3596
|
-
/* @__PURE__ */ (0,
|
|
3670
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3671
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3597
3672
|
"span",
|
|
3598
3673
|
{
|
|
3599
3674
|
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"}`,
|
|
3600
3675
|
children: endpoint.method
|
|
3601
3676
|
}
|
|
3602
3677
|
),
|
|
3603
|
-
/* @__PURE__ */ (0,
|
|
3604
|
-
/* @__PURE__ */ (0,
|
|
3678
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("code", { className: "text-sm font-mono", children: endpoint.path }),
|
|
3679
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-sm text-muted-foreground ml-auto", children: endpoint.title })
|
|
3605
3680
|
] }),
|
|
3606
|
-
children: /* @__PURE__ */ (0,
|
|
3607
|
-
endpoint.description && /* @__PURE__ */ (0,
|
|
3608
|
-
endpoint.pathParams && endpoint.pathParams.length > 0 && /* @__PURE__ */ (0,
|
|
3609
|
-
endpoint.queryParams && endpoint.queryParams.length > 0 && /* @__PURE__ */ (0,
|
|
3610
|
-
allHeaders.length > 0 && /* @__PURE__ */ (0,
|
|
3611
|
-
/* @__PURE__ */ (0,
|
|
3612
|
-
/* @__PURE__ */ (0,
|
|
3613
|
-
/* @__PURE__ */ (0,
|
|
3614
|
-
/* @__PURE__ */ (0,
|
|
3615
|
-
/* @__PURE__ */ (0,
|
|
3681
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "space-y-6 pt-4", children: [
|
|
3682
|
+
endpoint.description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-sm text-muted-foreground", children: endpoint.description }),
|
|
3683
|
+
endpoint.pathParams && endpoint.pathParams.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ApiParams, { title: "Path Parameters", params: endpoint.pathParams }),
|
|
3684
|
+
endpoint.queryParams && endpoint.queryParams.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ApiParams, { title: "Query Parameters", params: endpoint.queryParams }),
|
|
3685
|
+
allHeaders.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
|
|
3686
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Headers" }),
|
|
3687
|
+
/* @__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: [
|
|
3688
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3689
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("code", { className: "text-sm font-mono text-foreground", children: header.name }),
|
|
3690
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-xs text-muted-foreground", children: header.value })
|
|
3616
3691
|
] }),
|
|
3617
|
-
header.description && /* @__PURE__ */ (0,
|
|
3692
|
+
header.description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-sm text-muted-foreground", children: header.description })
|
|
3618
3693
|
] }, idx)) })
|
|
3619
3694
|
] }),
|
|
3620
|
-
endpoint.body && /* @__PURE__ */ (0,
|
|
3621
|
-
/* @__PURE__ */ (0,
|
|
3622
|
-
endpoint.body.description && /* @__PURE__ */ (0,
|
|
3623
|
-
endpoint.body.example && /* @__PURE__ */ (0,
|
|
3695
|
+
endpoint.body && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
|
|
3696
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Request Body" }),
|
|
3697
|
+
endpoint.body.description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-sm text-muted-foreground mb-2", children: endpoint.body.description }),
|
|
3698
|
+
endpoint.body.example && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3624
3699
|
CodeBlock,
|
|
3625
3700
|
{
|
|
3626
3701
|
code: typeof endpoint.body.example === "string" ? endpoint.body.example : JSON.stringify(endpoint.body.example, null, 2),
|
|
@@ -3628,9 +3703,9 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3628
3703
|
}
|
|
3629
3704
|
)
|
|
3630
3705
|
] }),
|
|
3631
|
-
/* @__PURE__ */ (0,
|
|
3632
|
-
/* @__PURE__ */ (0,
|
|
3633
|
-
endpoint.successResponse && /* @__PURE__ */ (0,
|
|
3706
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
|
|
3707
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Responses" }),
|
|
3708
|
+
endpoint.successResponse && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3634
3709
|
ApiResponse,
|
|
3635
3710
|
{
|
|
3636
3711
|
status: endpoint.successResponse.status,
|
|
@@ -3639,7 +3714,7 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3639
3714
|
schema: endpoint.successResponse.schema
|
|
3640
3715
|
}
|
|
3641
3716
|
),
|
|
3642
|
-
endpoint.errorResponses?.map((response, idx) => /* @__PURE__ */ (0,
|
|
3717
|
+
endpoint.errorResponses?.map((response, idx) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3643
3718
|
ApiResponse,
|
|
3644
3719
|
{
|
|
3645
3720
|
status: response.status,
|
|
@@ -3650,14 +3725,14 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3650
3725
|
idx
|
|
3651
3726
|
))
|
|
3652
3727
|
] }),
|
|
3653
|
-
endpoint.examples && endpoint.examples.length > 0 && /* @__PURE__ */ (0,
|
|
3654
|
-
/* @__PURE__ */ (0,
|
|
3655
|
-
endpoint.examples.map((example, idx) => /* @__PURE__ */ (0,
|
|
3656
|
-
/* @__PURE__ */ (0,
|
|
3657
|
-
/* @__PURE__ */ (0,
|
|
3728
|
+
endpoint.examples && endpoint.examples.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
|
|
3729
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Examples" }),
|
|
3730
|
+
endpoint.examples.map((example, idx) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "mb-3", children: [
|
|
3731
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: example.title }),
|
|
3732
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CodeBlock, { code: example.code, language: example.language })
|
|
3658
3733
|
] }, idx))
|
|
3659
3734
|
] }),
|
|
3660
|
-
showPlayground && /* @__PURE__ */ (0,
|
|
3735
|
+
showPlayground && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3661
3736
|
ApiPlayground,
|
|
3662
3737
|
{
|
|
3663
3738
|
method: endpoint.method,
|
|
@@ -3677,15 +3752,15 @@ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
|
|
|
3677
3752
|
}
|
|
3678
3753
|
|
|
3679
3754
|
// src/components/global/version-not-found.tsx
|
|
3680
|
-
var
|
|
3755
|
+
var import_lucide_react26 = require("lucide-react");
|
|
3681
3756
|
var import_link10 = __toESM(require("next/link"));
|
|
3682
|
-
var
|
|
3757
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3683
3758
|
function VersionNotFound() {
|
|
3684
|
-
return /* @__PURE__ */ (0,
|
|
3685
|
-
/* @__PURE__ */ (0,
|
|
3686
|
-
/* @__PURE__ */ (0,
|
|
3687
|
-
/* @__PURE__ */ (0,
|
|
3688
|
-
/* @__PURE__ */ (0,
|
|
3759
|
+
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: [
|
|
3760
|
+
/* @__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" }) }),
|
|
3761
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h1", { className: "mb-2 text-4xl font-bold", children: "Version Not Found" }),
|
|
3762
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "mb-6 text-muted-foreground", children: "The documentation version you're looking for doesn't exist." }),
|
|
3763
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3689
3764
|
import_link10.default,
|
|
3690
3765
|
{
|
|
3691
3766
|
href: "/docs/v1.0.0",
|
|
@@ -3743,6 +3818,7 @@ function VersionNotFound() {
|
|
|
3743
3818
|
ImageCard,
|
|
3744
3819
|
ImageCardGrid,
|
|
3745
3820
|
Input,
|
|
3821
|
+
LanguageSwitcher,
|
|
3746
3822
|
Logo,
|
|
3747
3823
|
Math,
|
|
3748
3824
|
MdxHotReload,
|