ardo 1.2.3 → 2.0.1
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/README.md +29 -47
- package/dist/{CopyButton-BkACwxQM.d.ts → Features-C_06EvGb.d.ts} +212 -10
- package/dist/{chunk-SZVJKB3V.js → chunk-G5L4ZUTS.js} +40 -40
- package/dist/chunk-G5L4ZUTS.js.map +1 -0
- package/dist/{chunk-JKAXHFHJ.js → chunk-LUOUBO3L.js} +585 -669
- package/dist/chunk-LUOUBO3L.js.map +1 -0
- package/dist/{chunk-3U63LMDZ.js → chunk-N5CEHG2F.js} +3 -3
- package/dist/{chunk-3U63LMDZ.js.map → chunk-N5CEHG2F.js.map} +1 -1
- package/dist/chunk-OTUACKCQ.js +896 -0
- package/dist/chunk-OTUACKCQ.js.map +1 -0
- package/dist/chunk-UWAVET45.js +311 -0
- package/dist/chunk-UWAVET45.js.map +1 -0
- package/dist/chunk-ZXPAEM3M.js +854 -0
- package/dist/chunk-ZXPAEM3M.js.map +1 -0
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +1 -1
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +3 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +34 -26
- package/dist/mdx/provider.d.ts +9 -0
- package/dist/mdx/provider.js +114 -0
- package/dist/mdx/provider.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -1
- package/dist/typedoc/index.d.ts +25 -0
- package/dist/typedoc/index.js +2 -2
- package/dist/{types-C22M-Kor.d.ts → types-DchPWkJl.d.ts} +1 -1
- package/dist/ui/index.d.ts +116 -0
- package/dist/{theme → ui}/index.js +26 -12
- package/dist/ui/styles.css +2198 -0
- package/dist/vite/index.d.ts +13 -23
- package/dist/vite/index.js +5 -5
- package/package.json +23 -11
- package/dist/chunk-2JBVPO6S.js +0 -1144
- package/dist/chunk-2JBVPO6S.js.map +0 -1
- package/dist/chunk-JKAXHFHJ.js.map +0 -1
- package/dist/chunk-SZVJKB3V.js.map +0 -1
- package/dist/chunk-YN6PP526.js +0 -441
- package/dist/chunk-YN6PP526.js.map +0 -1
- package/dist/theme/index.d.ts +0 -70
- package/dist/theme/styles.css +0 -1454
- /package/dist/{theme → ui}/index.js.map +0 -0
|
@@ -0,0 +1,854 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Content
|
|
3
|
+
} from "./chunk-UWAVET45.js";
|
|
4
|
+
import {
|
|
5
|
+
useConfig,
|
|
6
|
+
usePageData,
|
|
7
|
+
useTOC,
|
|
8
|
+
useThemeConfig
|
|
9
|
+
} from "./chunk-EOV2OUTW.js";
|
|
10
|
+
|
|
11
|
+
// src/ui/Layout.tsx
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
function Layout({ header, sidebar, footer, children, className }) {
|
|
14
|
+
return /* @__PURE__ */ jsxs("div", { className: className ?? "ardo-layout", children: [
|
|
15
|
+
header,
|
|
16
|
+
/* @__PURE__ */ jsxs("div", { className: "ardo-layout-container", children: [
|
|
17
|
+
sidebar,
|
|
18
|
+
/* @__PURE__ */ jsx("main", { className: "ardo-main", children })
|
|
19
|
+
] }),
|
|
20
|
+
footer
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/ui/Header.tsx
|
|
25
|
+
import { useState as useState3 } from "react";
|
|
26
|
+
import { Link as Link2 } from "react-router";
|
|
27
|
+
|
|
28
|
+
// src/ui/components/ThemeToggle.tsx
|
|
29
|
+
import { useState, useEffect } from "react";
|
|
30
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
31
|
+
function ThemeToggle() {
|
|
32
|
+
const [theme, setTheme] = useState("system");
|
|
33
|
+
const [mounted, setMounted] = useState(false);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
setMounted(true);
|
|
36
|
+
const stored = localStorage.getItem("ardo-theme");
|
|
37
|
+
if (stored) {
|
|
38
|
+
setTheme(stored);
|
|
39
|
+
applyTheme(stored);
|
|
40
|
+
} else {
|
|
41
|
+
applyTheme("system");
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
44
|
+
const toggleTheme = () => {
|
|
45
|
+
const nextTheme = theme === "light" ? "dark" : theme === "dark" ? "system" : "light";
|
|
46
|
+
setTheme(nextTheme);
|
|
47
|
+
localStorage.setItem("ardo-theme", nextTheme);
|
|
48
|
+
applyTheme(nextTheme);
|
|
49
|
+
};
|
|
50
|
+
if (!mounted) {
|
|
51
|
+
return /* @__PURE__ */ jsx2("button", { className: "ardo-theme-toggle", "aria-label": "Toggle theme", children: /* @__PURE__ */ jsx2("span", { className: "ardo-theme-icon", children: /* @__PURE__ */ jsx2(SunIcon, {}) }) });
|
|
52
|
+
}
|
|
53
|
+
return /* @__PURE__ */ jsx2(
|
|
54
|
+
"button",
|
|
55
|
+
{
|
|
56
|
+
className: "ardo-theme-toggle",
|
|
57
|
+
onClick: toggleTheme,
|
|
58
|
+
"aria-label": `Switch to ${theme === "light" ? "dark" : theme === "dark" ? "system" : "light"} theme`,
|
|
59
|
+
children: /* @__PURE__ */ jsxs2("span", { className: "ardo-theme-icon", children: [
|
|
60
|
+
theme === "light" && /* @__PURE__ */ jsx2(SunIcon, {}),
|
|
61
|
+
theme === "dark" && /* @__PURE__ */ jsx2(MoonIcon, {}),
|
|
62
|
+
theme === "system" && /* @__PURE__ */ jsx2(SystemIcon, {})
|
|
63
|
+
] })
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
function applyTheme(theme) {
|
|
68
|
+
const root = document.documentElement;
|
|
69
|
+
if (theme === "system") {
|
|
70
|
+
const isDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
71
|
+
root.classList.toggle("dark", isDark);
|
|
72
|
+
root.classList.toggle("light", !isDark);
|
|
73
|
+
} else {
|
|
74
|
+
root.classList.toggle("dark", theme === "dark");
|
|
75
|
+
root.classList.toggle("light", theme === "light");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function SunIcon() {
|
|
79
|
+
return /* @__PURE__ */ jsxs2(
|
|
80
|
+
"svg",
|
|
81
|
+
{
|
|
82
|
+
viewBox: "0 0 24 24",
|
|
83
|
+
width: "20",
|
|
84
|
+
height: "20",
|
|
85
|
+
fill: "none",
|
|
86
|
+
stroke: "currentColor",
|
|
87
|
+
strokeWidth: "2",
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "5" }),
|
|
90
|
+
/* @__PURE__ */ jsx2("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
91
|
+
/* @__PURE__ */ jsx2("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
92
|
+
/* @__PURE__ */ jsx2("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
|
|
93
|
+
/* @__PURE__ */ jsx2("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
|
|
94
|
+
/* @__PURE__ */ jsx2("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
|
|
95
|
+
/* @__PURE__ */ jsx2("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
|
|
96
|
+
/* @__PURE__ */ jsx2("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
|
|
97
|
+
/* @__PURE__ */ jsx2("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
function MoonIcon() {
|
|
103
|
+
return /* @__PURE__ */ jsx2(
|
|
104
|
+
"svg",
|
|
105
|
+
{
|
|
106
|
+
viewBox: "0 0 24 24",
|
|
107
|
+
width: "20",
|
|
108
|
+
height: "20",
|
|
109
|
+
fill: "none",
|
|
110
|
+
stroke: "currentColor",
|
|
111
|
+
strokeWidth: "2",
|
|
112
|
+
children: /* @__PURE__ */ jsx2("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
function SystemIcon() {
|
|
117
|
+
return /* @__PURE__ */ jsxs2(
|
|
118
|
+
"svg",
|
|
119
|
+
{
|
|
120
|
+
viewBox: "0 0 24 24",
|
|
121
|
+
width: "20",
|
|
122
|
+
height: "20",
|
|
123
|
+
fill: "none",
|
|
124
|
+
stroke: "currentColor",
|
|
125
|
+
strokeWidth: "2",
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ jsx2("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2", ry: "2" }),
|
|
128
|
+
/* @__PURE__ */ jsx2("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
129
|
+
/* @__PURE__ */ jsx2("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// src/ui/components/Search.tsx
|
|
136
|
+
import { useState as useState2, useEffect as useEffect2, useRef, useMemo } from "react";
|
|
137
|
+
import { Link } from "react-router";
|
|
138
|
+
import MiniSearch from "minisearch";
|
|
139
|
+
import searchDocs from "virtual:ardo/search-index";
|
|
140
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
141
|
+
function Search() {
|
|
142
|
+
const [isOpen, setIsOpen] = useState2(false);
|
|
143
|
+
const [query, setQuery] = useState2("");
|
|
144
|
+
const [results, setResults] = useState2([]);
|
|
145
|
+
const [selectedIndex, setSelectedIndex] = useState2(0);
|
|
146
|
+
const inputRef = useRef(null);
|
|
147
|
+
const themeConfig = useThemeConfig();
|
|
148
|
+
const placeholder = themeConfig.search?.placeholder ?? "Search...";
|
|
149
|
+
useEffect2(() => {
|
|
150
|
+
const handleKeyDown2 = (e) => {
|
|
151
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
152
|
+
e.preventDefault();
|
|
153
|
+
setIsOpen(true);
|
|
154
|
+
}
|
|
155
|
+
if (e.key === "Escape") {
|
|
156
|
+
setIsOpen(false);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
document.addEventListener("keydown", handleKeyDown2);
|
|
160
|
+
return () => document.removeEventListener("keydown", handleKeyDown2);
|
|
161
|
+
}, []);
|
|
162
|
+
useEffect2(() => {
|
|
163
|
+
if (isOpen && inputRef.current) {
|
|
164
|
+
inputRef.current.focus();
|
|
165
|
+
}
|
|
166
|
+
}, [isOpen]);
|
|
167
|
+
useEffect2(() => {
|
|
168
|
+
if (!isOpen) {
|
|
169
|
+
setQuery("");
|
|
170
|
+
setResults([]);
|
|
171
|
+
setSelectedIndex(0);
|
|
172
|
+
}
|
|
173
|
+
}, [isOpen]);
|
|
174
|
+
const searchIndex = useMemo(() => {
|
|
175
|
+
const index = new MiniSearch({
|
|
176
|
+
fields: ["title", "content", "section"],
|
|
177
|
+
storeFields: ["title", "path", "section"],
|
|
178
|
+
searchOptions: {
|
|
179
|
+
boost: { title: 2 },
|
|
180
|
+
fuzzy: 0.2,
|
|
181
|
+
prefix: true
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
index.addAll(searchDocs);
|
|
185
|
+
return index;
|
|
186
|
+
}, []);
|
|
187
|
+
const handleSearch = (searchQuery) => {
|
|
188
|
+
setQuery(searchQuery);
|
|
189
|
+
if (!searchQuery.trim()) {
|
|
190
|
+
setResults([]);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
const searchResults = searchIndex.search(searchQuery).slice(0, 10);
|
|
194
|
+
setResults(searchResults);
|
|
195
|
+
setSelectedIndex(0);
|
|
196
|
+
};
|
|
197
|
+
const handleKeyDown = (e) => {
|
|
198
|
+
if (e.key === "ArrowDown") {
|
|
199
|
+
e.preventDefault();
|
|
200
|
+
setSelectedIndex((prev) => Math.min(prev + 1, results.length - 1));
|
|
201
|
+
} else if (e.key === "ArrowUp") {
|
|
202
|
+
e.preventDefault();
|
|
203
|
+
setSelectedIndex((prev) => Math.max(prev - 1, 0));
|
|
204
|
+
} else if (e.key === "Enter" && results[selectedIndex]) {
|
|
205
|
+
e.preventDefault();
|
|
206
|
+
const result = results[selectedIndex];
|
|
207
|
+
window.location.href = result.path;
|
|
208
|
+
setIsOpen(false);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
212
|
+
/* @__PURE__ */ jsxs3("button", { className: "ardo-search-button", onClick: () => setIsOpen(true), "aria-label": "Search", children: [
|
|
213
|
+
/* @__PURE__ */ jsx3(SearchIcon, {}),
|
|
214
|
+
/* @__PURE__ */ jsx3("span", { className: "ardo-search-button-text", children: placeholder }),
|
|
215
|
+
/* @__PURE__ */ jsxs3("span", { className: "ardo-search-kbd", children: [
|
|
216
|
+
/* @__PURE__ */ jsx3("kbd", { children: "\u2318" }),
|
|
217
|
+
/* @__PURE__ */ jsx3("kbd", { children: "K" })
|
|
218
|
+
] })
|
|
219
|
+
] }),
|
|
220
|
+
isOpen && /* @__PURE__ */ jsx3("div", { className: "ardo-search-modal", onClick: () => setIsOpen(false), children: /* @__PURE__ */ jsxs3("div", { className: "ardo-search-dialog", onClick: (e) => e.stopPropagation(), children: [
|
|
221
|
+
/* @__PURE__ */ jsxs3("div", { className: "ardo-search-input-wrapper", children: [
|
|
222
|
+
/* @__PURE__ */ jsx3(SearchIcon, {}),
|
|
223
|
+
/* @__PURE__ */ jsx3(
|
|
224
|
+
"input",
|
|
225
|
+
{
|
|
226
|
+
ref: inputRef,
|
|
227
|
+
type: "text",
|
|
228
|
+
className: "ardo-search-input",
|
|
229
|
+
placeholder,
|
|
230
|
+
value: query,
|
|
231
|
+
onChange: (e) => handleSearch(e.target.value),
|
|
232
|
+
onKeyDown: handleKeyDown
|
|
233
|
+
}
|
|
234
|
+
),
|
|
235
|
+
query && /* @__PURE__ */ jsx3(
|
|
236
|
+
"button",
|
|
237
|
+
{
|
|
238
|
+
className: "ardo-search-clear",
|
|
239
|
+
onClick: () => handleSearch(""),
|
|
240
|
+
"aria-label": "Clear search",
|
|
241
|
+
children: "\xD7"
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
] }),
|
|
245
|
+
results.length > 0 && /* @__PURE__ */ jsx3("ul", { className: "ardo-search-results", children: results.map((result, index) => /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsxs3(
|
|
246
|
+
Link,
|
|
247
|
+
{
|
|
248
|
+
to: result.path,
|
|
249
|
+
className: ["ardo-search-result", index === selectedIndex && "selected"].filter(Boolean).join(" "),
|
|
250
|
+
onClick: () => setIsOpen(false),
|
|
251
|
+
children: [
|
|
252
|
+
/* @__PURE__ */ jsx3("span", { className: "ardo-search-result-title", children: result.title }),
|
|
253
|
+
result.section && /* @__PURE__ */ jsx3("span", { className: "ardo-search-result-section", children: result.section })
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
) }, result.id)) }),
|
|
257
|
+
query && results.length === 0 && /* @__PURE__ */ jsxs3("div", { className: "ardo-search-no-results", children: [
|
|
258
|
+
'No results found for "',
|
|
259
|
+
query,
|
|
260
|
+
'"'
|
|
261
|
+
] }),
|
|
262
|
+
/* @__PURE__ */ jsxs3("div", { className: "ardo-search-footer", children: [
|
|
263
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
264
|
+
/* @__PURE__ */ jsx3("kbd", { children: "\u2191" }),
|
|
265
|
+
" ",
|
|
266
|
+
/* @__PURE__ */ jsx3("kbd", { children: "\u2193" }),
|
|
267
|
+
" to navigate"
|
|
268
|
+
] }),
|
|
269
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
270
|
+
/* @__PURE__ */ jsx3("kbd", { children: "\u21B5" }),
|
|
271
|
+
" to select"
|
|
272
|
+
] }),
|
|
273
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
274
|
+
/* @__PURE__ */ jsx3("kbd", { children: "esc" }),
|
|
275
|
+
" to close"
|
|
276
|
+
] })
|
|
277
|
+
] })
|
|
278
|
+
] }) })
|
|
279
|
+
] });
|
|
280
|
+
}
|
|
281
|
+
function SearchIcon() {
|
|
282
|
+
return /* @__PURE__ */ jsxs3(
|
|
283
|
+
"svg",
|
|
284
|
+
{
|
|
285
|
+
viewBox: "0 0 24 24",
|
|
286
|
+
width: "18",
|
|
287
|
+
height: "18",
|
|
288
|
+
fill: "none",
|
|
289
|
+
stroke: "currentColor",
|
|
290
|
+
strokeWidth: "2",
|
|
291
|
+
children: [
|
|
292
|
+
/* @__PURE__ */ jsx3("circle", { cx: "11", cy: "11", r: "8" }),
|
|
293
|
+
/* @__PURE__ */ jsx3("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// src/ui/Header.tsx
|
|
300
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
301
|
+
function Header({
|
|
302
|
+
logo,
|
|
303
|
+
title,
|
|
304
|
+
nav,
|
|
305
|
+
actions,
|
|
306
|
+
search = true,
|
|
307
|
+
themeToggle = true,
|
|
308
|
+
className
|
|
309
|
+
}) {
|
|
310
|
+
const [mobileMenuOpen, setMobileMenuOpen] = useState3(false);
|
|
311
|
+
return /* @__PURE__ */ jsxs4("header", { className: className ?? "ardo-header", children: [
|
|
312
|
+
/* @__PURE__ */ jsxs4("div", { className: "ardo-header-container", children: [
|
|
313
|
+
/* @__PURE__ */ jsxs4("div", { className: "ardo-header-left", children: [
|
|
314
|
+
/* @__PURE__ */ jsx4(
|
|
315
|
+
"button",
|
|
316
|
+
{
|
|
317
|
+
className: "ardo-mobile-menu-button",
|
|
318
|
+
onClick: () => setMobileMenuOpen(!mobileMenuOpen),
|
|
319
|
+
"aria-label": "Toggle menu",
|
|
320
|
+
"aria-expanded": mobileMenuOpen,
|
|
321
|
+
children: /* @__PURE__ */ jsxs4("span", { className: "ardo-hamburger", children: [
|
|
322
|
+
/* @__PURE__ */ jsx4("span", {}),
|
|
323
|
+
/* @__PURE__ */ jsx4("span", {}),
|
|
324
|
+
/* @__PURE__ */ jsx4("span", {})
|
|
325
|
+
] })
|
|
326
|
+
}
|
|
327
|
+
),
|
|
328
|
+
/* @__PURE__ */ jsxs4(Link2, { to: "/", className: "ardo-logo-link", children: [
|
|
329
|
+
logo && /* @__PURE__ */ jsx4(
|
|
330
|
+
"img",
|
|
331
|
+
{
|
|
332
|
+
src: typeof logo === "string" ? logo : logo.light,
|
|
333
|
+
alt: title ?? "Logo",
|
|
334
|
+
className: "ardo-logo"
|
|
335
|
+
}
|
|
336
|
+
),
|
|
337
|
+
title && /* @__PURE__ */ jsx4("span", { className: "ardo-site-title", children: title })
|
|
338
|
+
] })
|
|
339
|
+
] }),
|
|
340
|
+
nav && /* @__PURE__ */ jsx4("div", { className: "ardo-nav", children: nav }),
|
|
341
|
+
/* @__PURE__ */ jsxs4("div", { className: "ardo-header-right", children: [
|
|
342
|
+
search && /* @__PURE__ */ jsx4(Search, {}),
|
|
343
|
+
themeToggle && /* @__PURE__ */ jsx4(ThemeToggle, {}),
|
|
344
|
+
actions
|
|
345
|
+
] })
|
|
346
|
+
] }),
|
|
347
|
+
mobileMenuOpen && /* @__PURE__ */ jsx4("div", { className: "ardo-mobile-menu", children: /* @__PURE__ */ jsx4("nav", { className: "ardo-mobile-nav", onClick: () => setMobileMenuOpen(false), children: nav }) })
|
|
348
|
+
] });
|
|
349
|
+
}
|
|
350
|
+
function SocialLink({ href, icon, ariaLabel, className }) {
|
|
351
|
+
return /* @__PURE__ */ jsx4(
|
|
352
|
+
"a",
|
|
353
|
+
{
|
|
354
|
+
href,
|
|
355
|
+
target: "_blank",
|
|
356
|
+
rel: "noopener noreferrer",
|
|
357
|
+
className: className ?? "ardo-social-link",
|
|
358
|
+
"aria-label": ariaLabel ?? icon,
|
|
359
|
+
children: /* @__PURE__ */ jsx4(SocialIcon, { icon })
|
|
360
|
+
}
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
function SocialIcon({ icon }) {
|
|
364
|
+
const icons = {
|
|
365
|
+
github: "M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.7-2.782.604-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.463-1.11-1.463-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.163 22 16.418 22 12c0-5.523-4.477-10-10-10z",
|
|
366
|
+
twitter: "M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z",
|
|
367
|
+
discord: "M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 00.031.057 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028 14.09 14.09 0 001.226-1.994.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128 10.2 10.2 0 00.372-.292.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.01c.12.098.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z",
|
|
368
|
+
linkedin: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z",
|
|
369
|
+
youtube: "M23.498 6.186a3.016 3.016 0 00-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 00.502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 002.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 002.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z",
|
|
370
|
+
npm: "M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"
|
|
371
|
+
};
|
|
372
|
+
const path = icons[icon] || icons.github;
|
|
373
|
+
return /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "currentColor", children: /* @__PURE__ */ jsx4("path", { d: path }) });
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// src/ui/Sidebar.tsx
|
|
377
|
+
import {
|
|
378
|
+
useState as useState4,
|
|
379
|
+
Children,
|
|
380
|
+
isValidElement,
|
|
381
|
+
createContext,
|
|
382
|
+
useContext
|
|
383
|
+
} from "react";
|
|
384
|
+
import { NavLink, useLocation } from "react-router";
|
|
385
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
386
|
+
var SidebarContext = createContext({ currentPath: "" });
|
|
387
|
+
function useSidebarContext() {
|
|
388
|
+
return useContext(SidebarContext);
|
|
389
|
+
}
|
|
390
|
+
function Sidebar({ items, children, className }) {
|
|
391
|
+
const { pathname } = useLocation();
|
|
392
|
+
return /* @__PURE__ */ jsx5(SidebarContext.Provider, { value: { currentPath: pathname }, children: /* @__PURE__ */ jsx5("aside", { className: className ?? "ardo-sidebar", children: /* @__PURE__ */ jsx5("nav", { className: "ardo-sidebar-nav", children: items ? /* @__PURE__ */ jsx5(SidebarItems, { items, depth: 0 }) : /* @__PURE__ */ jsx5("ul", { className: "ardo-sidebar-list ardo-sidebar-list-0", children }) }) }) });
|
|
393
|
+
}
|
|
394
|
+
function SidebarGroup({
|
|
395
|
+
title,
|
|
396
|
+
to,
|
|
397
|
+
collapsed: initialCollapsed = false,
|
|
398
|
+
collapsible = true,
|
|
399
|
+
children,
|
|
400
|
+
className
|
|
401
|
+
}) {
|
|
402
|
+
const [collapsed, setCollapsed] = useState4(initialCollapsed);
|
|
403
|
+
const { currentPath } = useSidebarContext();
|
|
404
|
+
const isChildActive = checkChildrenActive(children, currentPath);
|
|
405
|
+
const textClassName = ["ardo-sidebar-text", isChildActive && "child-active"].filter(Boolean).join(" ");
|
|
406
|
+
const linkClassName = ["ardo-sidebar-link", isChildActive && "child-active"].filter(Boolean).join(" ");
|
|
407
|
+
const hasChildren = Children.count(children) > 0;
|
|
408
|
+
return /* @__PURE__ */ jsxs5("li", { className: className ?? "ardo-sidebar-item", children: [
|
|
409
|
+
/* @__PURE__ */ jsxs5("div", { className: "ardo-sidebar-item-header", children: [
|
|
410
|
+
to ? /* @__PURE__ */ jsx5(
|
|
411
|
+
NavLink,
|
|
412
|
+
{
|
|
413
|
+
to,
|
|
414
|
+
className: ({ isActive }) => [linkClassName, isActive && "active"].filter(Boolean).join(" "),
|
|
415
|
+
children: title
|
|
416
|
+
}
|
|
417
|
+
) : /* @__PURE__ */ jsx5(
|
|
418
|
+
"span",
|
|
419
|
+
{
|
|
420
|
+
className: textClassName,
|
|
421
|
+
onClick: () => collapsible && hasChildren && setCollapsed(!collapsed),
|
|
422
|
+
style: collapsible && hasChildren ? { cursor: "pointer" } : void 0,
|
|
423
|
+
children: title
|
|
424
|
+
}
|
|
425
|
+
),
|
|
426
|
+
collapsible && hasChildren && /* @__PURE__ */ jsx5(
|
|
427
|
+
"button",
|
|
428
|
+
{
|
|
429
|
+
className: ["ardo-sidebar-collapse", collapsed && "collapsed"].filter(Boolean).join(" "),
|
|
430
|
+
onClick: () => setCollapsed(!collapsed),
|
|
431
|
+
"aria-label": collapsed ? "Expand" : "Collapse",
|
|
432
|
+
children: /* @__PURE__ */ jsx5(
|
|
433
|
+
"svg",
|
|
434
|
+
{
|
|
435
|
+
viewBox: "0 0 24 24",
|
|
436
|
+
width: "16",
|
|
437
|
+
height: "16",
|
|
438
|
+
fill: "none",
|
|
439
|
+
stroke: "currentColor",
|
|
440
|
+
strokeWidth: "2",
|
|
441
|
+
children: /* @__PURE__ */ jsx5("path", { d: "M6 9l6 6 6-6" })
|
|
442
|
+
}
|
|
443
|
+
)
|
|
444
|
+
}
|
|
445
|
+
)
|
|
446
|
+
] }),
|
|
447
|
+
hasChildren && !collapsed && /* @__PURE__ */ jsx5("ul", { className: "ardo-sidebar-list ardo-sidebar-list-1", children })
|
|
448
|
+
] });
|
|
449
|
+
}
|
|
450
|
+
function SidebarLink({ to, children, className }) {
|
|
451
|
+
const baseClassName = className ?? "ardo-sidebar-link";
|
|
452
|
+
return /* @__PURE__ */ jsx5("li", { className: "ardo-sidebar-item", children: /* @__PURE__ */ jsx5(
|
|
453
|
+
NavLink,
|
|
454
|
+
{
|
|
455
|
+
to,
|
|
456
|
+
className: ({ isActive }) => [baseClassName, isActive && "active"].filter(Boolean).join(" "),
|
|
457
|
+
children
|
|
458
|
+
}
|
|
459
|
+
) });
|
|
460
|
+
}
|
|
461
|
+
function SidebarItems({ items, depth }) {
|
|
462
|
+
return /* @__PURE__ */ jsx5("ul", { className: `ardo-sidebar-list ardo-sidebar-list-${depth}`, children: items.map((item, index) => /* @__PURE__ */ jsx5(SidebarItemComponent, { item, depth }, index)) });
|
|
463
|
+
}
|
|
464
|
+
function SidebarItemComponent({ item, depth }) {
|
|
465
|
+
const { currentPath } = useSidebarContext();
|
|
466
|
+
const [collapsed, setCollapsed] = useState4(item.collapsed ?? false);
|
|
467
|
+
const hasChildren = item.items && item.items.length > 0;
|
|
468
|
+
const isChildActive = hasChildren && item.items.some(
|
|
469
|
+
(child) => child.link === currentPath || child.items && child.items.some((grandchild) => grandchild.link === currentPath)
|
|
470
|
+
);
|
|
471
|
+
const linkClassName = ["ardo-sidebar-link", isChildActive && "child-active"].filter(Boolean).join(" ");
|
|
472
|
+
const textClassName = ["ardo-sidebar-text", isChildActive && "child-active"].filter(Boolean).join(" ");
|
|
473
|
+
return /* @__PURE__ */ jsxs5("li", { className: "ardo-sidebar-item", children: [
|
|
474
|
+
/* @__PURE__ */ jsxs5("div", { className: "ardo-sidebar-item-header", children: [
|
|
475
|
+
item.link ? /* @__PURE__ */ jsx5(
|
|
476
|
+
NavLink,
|
|
477
|
+
{
|
|
478
|
+
to: item.link,
|
|
479
|
+
className: ({ isActive }) => [linkClassName, isActive && "active"].filter(Boolean).join(" "),
|
|
480
|
+
children: item.text
|
|
481
|
+
}
|
|
482
|
+
) : /* @__PURE__ */ jsx5("span", { className: textClassName, onClick: () => hasChildren && setCollapsed(!collapsed), children: item.text }),
|
|
483
|
+
hasChildren && /* @__PURE__ */ jsx5(
|
|
484
|
+
"button",
|
|
485
|
+
{
|
|
486
|
+
className: ["ardo-sidebar-collapse", collapsed && "collapsed"].filter(Boolean).join(" "),
|
|
487
|
+
onClick: () => setCollapsed(!collapsed),
|
|
488
|
+
"aria-label": collapsed ? "Expand" : "Collapse",
|
|
489
|
+
children: /* @__PURE__ */ jsx5(
|
|
490
|
+
"svg",
|
|
491
|
+
{
|
|
492
|
+
viewBox: "0 0 24 24",
|
|
493
|
+
width: "16",
|
|
494
|
+
height: "16",
|
|
495
|
+
fill: "none",
|
|
496
|
+
stroke: "currentColor",
|
|
497
|
+
strokeWidth: "2",
|
|
498
|
+
children: /* @__PURE__ */ jsx5("path", { d: "M6 9l6 6 6-6" })
|
|
499
|
+
}
|
|
500
|
+
)
|
|
501
|
+
}
|
|
502
|
+
)
|
|
503
|
+
] }),
|
|
504
|
+
hasChildren && !collapsed && /* @__PURE__ */ jsx5(SidebarItems, { items: item.items, depth: depth + 1 })
|
|
505
|
+
] });
|
|
506
|
+
}
|
|
507
|
+
function checkChildrenActive(children, currentPath) {
|
|
508
|
+
let isActive = false;
|
|
509
|
+
Children.forEach(children, (child) => {
|
|
510
|
+
if (isActive) return;
|
|
511
|
+
if (isValidElement(child)) {
|
|
512
|
+
if (child.type === SidebarLink && child.props.to === currentPath) {
|
|
513
|
+
isActive = true;
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
if (child.type === SidebarGroup) {
|
|
517
|
+
const groupProps = child.props;
|
|
518
|
+
if (groupProps.to === currentPath) {
|
|
519
|
+
isActive = true;
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
if (groupProps.children && checkChildrenActive(groupProps.children, currentPath)) {
|
|
523
|
+
isActive = true;
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
return isActive;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// src/ui/Footer.tsx
|
|
533
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
534
|
+
function Footer({ message, copyright, children, className }) {
|
|
535
|
+
const hasContent = message || copyright || children;
|
|
536
|
+
if (!hasContent) {
|
|
537
|
+
return null;
|
|
538
|
+
}
|
|
539
|
+
return /* @__PURE__ */ jsx6("footer", { className: className ?? "ardo-footer", children: /* @__PURE__ */ jsx6("div", { className: "ardo-footer-container", children: children ?? /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
540
|
+
message && /* @__PURE__ */ jsx6("p", { className: "ardo-footer-message", dangerouslySetInnerHTML: { __html: message } }),
|
|
541
|
+
copyright && /* @__PURE__ */ jsx6(
|
|
542
|
+
"p",
|
|
543
|
+
{
|
|
544
|
+
className: "ardo-footer-copyright",
|
|
545
|
+
dangerouslySetInnerHTML: { __html: copyright }
|
|
546
|
+
}
|
|
547
|
+
)
|
|
548
|
+
] }) }) });
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
// src/ui/Nav.tsx
|
|
552
|
+
import { useState as useState5, createContext as createContext2, useContext as useContext2 } from "react";
|
|
553
|
+
import { NavLink as RouterNavLink } from "react-router";
|
|
554
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
555
|
+
var NavContext = createContext2(null);
|
|
556
|
+
function useNavContext() {
|
|
557
|
+
return useContext2(NavContext);
|
|
558
|
+
}
|
|
559
|
+
function Nav({ children, className }) {
|
|
560
|
+
return /* @__PURE__ */ jsx7("nav", { className: className ?? "ardo-nav", children });
|
|
561
|
+
}
|
|
562
|
+
function NavLink2({
|
|
563
|
+
to,
|
|
564
|
+
href,
|
|
565
|
+
children,
|
|
566
|
+
className,
|
|
567
|
+
activeMatch: _activeMatch
|
|
568
|
+
}) {
|
|
569
|
+
const navContext = useNavContext();
|
|
570
|
+
const baseClassName = className ?? "ardo-nav-link";
|
|
571
|
+
const handleClick = () => {
|
|
572
|
+
navContext?.setMobileMenuOpen(false);
|
|
573
|
+
};
|
|
574
|
+
if (href) {
|
|
575
|
+
return /* @__PURE__ */ jsx7(
|
|
576
|
+
"a",
|
|
577
|
+
{
|
|
578
|
+
href,
|
|
579
|
+
className: baseClassName,
|
|
580
|
+
target: "_blank",
|
|
581
|
+
rel: "noopener noreferrer",
|
|
582
|
+
onClick: handleClick,
|
|
583
|
+
children
|
|
584
|
+
}
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
if (to) {
|
|
588
|
+
return /* @__PURE__ */ jsx7(
|
|
589
|
+
RouterNavLink,
|
|
590
|
+
{
|
|
591
|
+
to,
|
|
592
|
+
className: ({ isActive }) => [baseClassName, isActive && "active"].filter(Boolean).join(" "),
|
|
593
|
+
onClick: handleClick,
|
|
594
|
+
children
|
|
595
|
+
}
|
|
596
|
+
);
|
|
597
|
+
}
|
|
598
|
+
return /* @__PURE__ */ jsx7("span", { className: baseClassName, children });
|
|
599
|
+
}
|
|
600
|
+
function NavDropdown({ text, children, className }) {
|
|
601
|
+
const [open, setOpen] = useState5(false);
|
|
602
|
+
return /* @__PURE__ */ jsxs7(
|
|
603
|
+
"div",
|
|
604
|
+
{
|
|
605
|
+
className: className ?? "ardo-nav-dropdown",
|
|
606
|
+
onMouseEnter: () => setOpen(true),
|
|
607
|
+
onMouseLeave: () => setOpen(false),
|
|
608
|
+
children: [
|
|
609
|
+
/* @__PURE__ */ jsxs7("button", { className: "ardo-nav-dropdown-button", children: [
|
|
610
|
+
text,
|
|
611
|
+
/* @__PURE__ */ jsx7("span", { className: "ardo-nav-dropdown-icon", children: "\u25BC" })
|
|
612
|
+
] }),
|
|
613
|
+
open && /* @__PURE__ */ jsx7("div", { className: "ardo-nav-dropdown-menu", children })
|
|
614
|
+
]
|
|
615
|
+
}
|
|
616
|
+
);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
// src/ui/TOC.tsx
|
|
620
|
+
import { useState as useState6, useEffect as useEffect3 } from "react";
|
|
621
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
622
|
+
function TOC() {
|
|
623
|
+
const toc = useTOC();
|
|
624
|
+
const themeConfig = useThemeConfig();
|
|
625
|
+
const [activeId, setActiveId] = useState6("");
|
|
626
|
+
const label = themeConfig.outline?.label ?? "On this page";
|
|
627
|
+
useEffect3(() => {
|
|
628
|
+
if (toc.length === 0) return;
|
|
629
|
+
const headingElements = toc.map((item) => document.getElementById(item.id)).filter(Boolean);
|
|
630
|
+
if (headingElements.length === 0) return;
|
|
631
|
+
const observer = new IntersectionObserver(
|
|
632
|
+
(entries) => {
|
|
633
|
+
for (const entry of entries) {
|
|
634
|
+
if (entry.isIntersecting) {
|
|
635
|
+
setActiveId(entry.target.id);
|
|
636
|
+
break;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
rootMargin: "-80px 0px -80% 0px",
|
|
642
|
+
threshold: 0
|
|
643
|
+
}
|
|
644
|
+
);
|
|
645
|
+
headingElements.forEach((el) => el && observer.observe(el));
|
|
646
|
+
return () => {
|
|
647
|
+
headingElements.forEach((el) => el && observer.unobserve(el));
|
|
648
|
+
};
|
|
649
|
+
}, [toc]);
|
|
650
|
+
if (toc.length === 0) {
|
|
651
|
+
return null;
|
|
652
|
+
}
|
|
653
|
+
return /* @__PURE__ */ jsx8("aside", { className: "ardo-toc", children: /* @__PURE__ */ jsxs8("div", { className: "ardo-toc-container", children: [
|
|
654
|
+
/* @__PURE__ */ jsx8("h3", { className: "ardo-toc-title", children: label }),
|
|
655
|
+
/* @__PURE__ */ jsx8("nav", { className: "ardo-toc-nav", children: /* @__PURE__ */ jsx8(TOCItems, { items: toc, activeId }) })
|
|
656
|
+
] }) });
|
|
657
|
+
}
|
|
658
|
+
function TOCItems({ items, activeId }) {
|
|
659
|
+
return /* @__PURE__ */ jsx8("ul", { className: "ardo-toc-list", children: items.map((item) => /* @__PURE__ */ jsx8(TOCItemComponent, { item, activeId }, item.id)) });
|
|
660
|
+
}
|
|
661
|
+
function TOCItemComponent({ item, activeId }) {
|
|
662
|
+
const isActive = item.id === activeId;
|
|
663
|
+
const hasActiveChild = hasActiveDescendant(item, activeId);
|
|
664
|
+
return /* @__PURE__ */ jsxs8("li", { className: "ardo-toc-item", children: [
|
|
665
|
+
/* @__PURE__ */ jsx8(
|
|
666
|
+
"a",
|
|
667
|
+
{
|
|
668
|
+
href: `#${item.id}`,
|
|
669
|
+
className: [
|
|
670
|
+
`ardo-toc-link ardo-toc-link-${item.level}`,
|
|
671
|
+
isActive && "active",
|
|
672
|
+
hasActiveChild && "child-active"
|
|
673
|
+
].filter(Boolean).join(" "),
|
|
674
|
+
onClick: (e) => {
|
|
675
|
+
e.preventDefault();
|
|
676
|
+
const element = document.getElementById(item.id);
|
|
677
|
+
if (element) {
|
|
678
|
+
element.scrollIntoView({ behavior: "smooth" });
|
|
679
|
+
window.history.pushState(null, "", `#${item.id}`);
|
|
680
|
+
}
|
|
681
|
+
},
|
|
682
|
+
children: item.text
|
|
683
|
+
}
|
|
684
|
+
),
|
|
685
|
+
item.children && item.children.length > 0 && /* @__PURE__ */ jsx8(TOCItems, { items: item.children, activeId })
|
|
686
|
+
] });
|
|
687
|
+
}
|
|
688
|
+
function hasActiveDescendant(item, activeId) {
|
|
689
|
+
if (!item.children) return false;
|
|
690
|
+
for (const child of item.children) {
|
|
691
|
+
if (child.id === activeId) return true;
|
|
692
|
+
if (hasActiveDescendant(child, activeId)) return true;
|
|
693
|
+
}
|
|
694
|
+
return false;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// src/ui/DocPage.tsx
|
|
698
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
699
|
+
function DocPage({ children }) {
|
|
700
|
+
const pageData = usePageData();
|
|
701
|
+
const showToc = pageData?.frontmatter.outline !== false && pageData?.toc && pageData.toc.length > 0;
|
|
702
|
+
return /* @__PURE__ */ jsx9(Layout, { children: /* @__PURE__ */ jsxs9("div", { className: "ardo-doc-page", children: [
|
|
703
|
+
/* @__PURE__ */ jsx9(Content, { children }),
|
|
704
|
+
showToc && /* @__PURE__ */ jsx9(TOC, {})
|
|
705
|
+
] }) });
|
|
706
|
+
}
|
|
707
|
+
function DocContent({ children }) {
|
|
708
|
+
const pageData = usePageData();
|
|
709
|
+
const showToc = pageData?.frontmatter.outline !== false && pageData?.toc && pageData.toc.length > 0;
|
|
710
|
+
return /* @__PURE__ */ jsxs9("div", { className: "ardo-doc-page", children: [
|
|
711
|
+
/* @__PURE__ */ jsx9(Content, { children }),
|
|
712
|
+
showToc && /* @__PURE__ */ jsx9(TOC, {})
|
|
713
|
+
] });
|
|
714
|
+
}
|
|
715
|
+
function DocLayout({ content }) {
|
|
716
|
+
return /* @__PURE__ */ jsx9(DocPage, { children: content });
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
// src/ui/HomePage.tsx
|
|
720
|
+
import { Link as Link3 } from "react-router";
|
|
721
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
722
|
+
function HomePage() {
|
|
723
|
+
const pageData = usePageData();
|
|
724
|
+
const config = useConfig();
|
|
725
|
+
const themeConfig = useThemeConfig();
|
|
726
|
+
const hero = pageData?.frontmatter.hero;
|
|
727
|
+
const features = pageData?.frontmatter.features;
|
|
728
|
+
return /* @__PURE__ */ jsxs10("div", { className: "ardo-home", children: [
|
|
729
|
+
/* @__PURE__ */ jsx10(
|
|
730
|
+
Header,
|
|
731
|
+
{
|
|
732
|
+
logo: themeConfig.logo,
|
|
733
|
+
title: themeConfig.siteTitle !== false ? config.title : void 0,
|
|
734
|
+
nav: themeConfig.nav && themeConfig.nav.length > 0 ? /* @__PURE__ */ jsx10(Nav, { children: themeConfig.nav.map((item, index) => /* @__PURE__ */ jsx10(NavLink2, { to: item.link, children: item.text }, index)) }) : void 0,
|
|
735
|
+
actions: themeConfig.socialLinks?.map((link, index) => /* @__PURE__ */ jsx10(SocialLink, { href: link.link, icon: link.icon, ariaLabel: link.ariaLabel }, index))
|
|
736
|
+
}
|
|
737
|
+
),
|
|
738
|
+
/* @__PURE__ */ jsxs10("main", { className: "ardo-home-main", children: [
|
|
739
|
+
hero && /* @__PURE__ */ jsx10("section", { className: "ardo-hero", children: /* @__PURE__ */ jsxs10("div", { className: "ardo-hero-container", children: [
|
|
740
|
+
hero.image && /* @__PURE__ */ jsx10("div", { className: "ardo-hero-image", children: /* @__PURE__ */ jsx10(
|
|
741
|
+
"img",
|
|
742
|
+
{
|
|
743
|
+
src: typeof hero.image === "string" ? hero.image : hero.image.light,
|
|
744
|
+
alt: hero.name || config.title
|
|
745
|
+
}
|
|
746
|
+
) }),
|
|
747
|
+
/* @__PURE__ */ jsxs10("div", { className: "ardo-hero-content", children: [
|
|
748
|
+
hero.name && /* @__PURE__ */ jsx10("h1", { className: "ardo-hero-name", children: hero.name }),
|
|
749
|
+
hero.text && /* @__PURE__ */ jsx10("p", { className: "ardo-hero-text", children: hero.text }),
|
|
750
|
+
hero.tagline && /* @__PURE__ */ jsx10("p", { className: "ardo-hero-tagline", children: hero.tagline }),
|
|
751
|
+
hero.actions && hero.actions.length > 0 && /* @__PURE__ */ jsx10("div", { className: "ardo-hero-actions", children: hero.actions.map((action, index) => /* @__PURE__ */ jsx10(
|
|
752
|
+
Link3,
|
|
753
|
+
{
|
|
754
|
+
to: action.link,
|
|
755
|
+
className: `ardo-hero-action ardo-hero-action-${action.theme || "brand"}`,
|
|
756
|
+
children: action.text
|
|
757
|
+
},
|
|
758
|
+
index
|
|
759
|
+
)) })
|
|
760
|
+
] })
|
|
761
|
+
] }) }),
|
|
762
|
+
features && features.length > 0 && /* @__PURE__ */ jsx10("section", { className: "ardo-features", children: /* @__PURE__ */ jsx10("div", { className: "ardo-features-container", children: features.map((feature, index) => /* @__PURE__ */ jsxs10("div", { className: "ardo-feature", children: [
|
|
763
|
+
feature.icon && /* @__PURE__ */ jsx10("div", { className: "ardo-feature-icon", children: feature.icon }),
|
|
764
|
+
/* @__PURE__ */ jsx10("h3", { className: "ardo-feature-title", children: feature.title }),
|
|
765
|
+
/* @__PURE__ */ jsx10("p", { className: "ardo-feature-details", children: feature.details }),
|
|
766
|
+
feature.link && /* @__PURE__ */ jsx10(Link3, { to: feature.link, className: "ardo-feature-link", children: feature.linkText || "Learn more" })
|
|
767
|
+
] }, index)) }) })
|
|
768
|
+
] }),
|
|
769
|
+
/* @__PURE__ */ jsx10(Footer, {})
|
|
770
|
+
] });
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
// src/ui/components/Hero.tsx
|
|
774
|
+
import { Link as Link4 } from "react-router";
|
|
775
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
776
|
+
function Hero({ name, text, tagline, image, actions, className }) {
|
|
777
|
+
const imageUrl = typeof image === "string" ? image : image?.light;
|
|
778
|
+
const imageAlt = typeof image === "string" ? name : image?.alt ?? name;
|
|
779
|
+
return /* @__PURE__ */ jsx11("section", { className: className ?? "ardo-hero", children: /* @__PURE__ */ jsxs11("div", { className: "ardo-hero-container", children: [
|
|
780
|
+
image && /* @__PURE__ */ jsx11("div", { className: "ardo-hero-image", children: /* @__PURE__ */ jsx11("img", { src: imageUrl, alt: imageAlt }) }),
|
|
781
|
+
/* @__PURE__ */ jsxs11("div", { className: "ardo-hero-content", children: [
|
|
782
|
+
name && /* @__PURE__ */ jsx11("h1", { className: "ardo-hero-name", children: name }),
|
|
783
|
+
text && /* @__PURE__ */ jsx11("p", { className: "ardo-hero-text", children: text }),
|
|
784
|
+
tagline && /* @__PURE__ */ jsx11("p", { className: "ardo-hero-tagline", children: tagline }),
|
|
785
|
+
actions && actions.length > 0 && /* @__PURE__ */ jsx11("div", { className: "ardo-hero-actions", children: actions.map((action, index) => {
|
|
786
|
+
const link = action.link;
|
|
787
|
+
const isExternal = typeof link === "string" && (link.startsWith("http://") || link.startsWith("https://"));
|
|
788
|
+
const className2 = `ardo-hero-action ardo-hero-action-${action.theme || "brand"}`;
|
|
789
|
+
if (isExternal) {
|
|
790
|
+
return /* @__PURE__ */ jsx11(
|
|
791
|
+
"a",
|
|
792
|
+
{
|
|
793
|
+
href: link,
|
|
794
|
+
className: className2,
|
|
795
|
+
target: "_blank",
|
|
796
|
+
rel: "noopener noreferrer",
|
|
797
|
+
children: action.text
|
|
798
|
+
},
|
|
799
|
+
index
|
|
800
|
+
);
|
|
801
|
+
}
|
|
802
|
+
return /* @__PURE__ */ jsx11(Link4, { to: link, className: className2, children: action.text }, index);
|
|
803
|
+
}) })
|
|
804
|
+
] })
|
|
805
|
+
] }) });
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
// src/ui/components/Features.tsx
|
|
809
|
+
import { Link as Link5 } from "react-router";
|
|
810
|
+
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
811
|
+
function FeatureCard({ title, icon, details, link, linkText, className }) {
|
|
812
|
+
return /* @__PURE__ */ jsxs12("div", { className: className ?? "ardo-feature", children: [
|
|
813
|
+
icon && /* @__PURE__ */ jsx12("div", { className: "ardo-feature-icon", children: icon }),
|
|
814
|
+
/* @__PURE__ */ jsx12("h3", { className: "ardo-feature-title", children: title }),
|
|
815
|
+
/* @__PURE__ */ jsx12("p", { className: "ardo-feature-details", children: details }),
|
|
816
|
+
link && /* @__PURE__ */ jsx12(Link5, { to: link, className: "ardo-feature-link", children: linkText || "Learn more" })
|
|
817
|
+
] });
|
|
818
|
+
}
|
|
819
|
+
function Features({ items, title, subtitle, className }) {
|
|
820
|
+
if (!items || items.length === 0) {
|
|
821
|
+
return null;
|
|
822
|
+
}
|
|
823
|
+
return /* @__PURE__ */ jsxs12("section", { className: className ?? "ardo-features", children: [
|
|
824
|
+
(title || subtitle) && /* @__PURE__ */ jsxs12("div", { className: "ardo-features-header", children: [
|
|
825
|
+
title && /* @__PURE__ */ jsx12("h2", { className: "ardo-features-title", children: title }),
|
|
826
|
+
subtitle && /* @__PURE__ */ jsx12("p", { className: "ardo-features-subtitle", children: subtitle })
|
|
827
|
+
] }),
|
|
828
|
+
/* @__PURE__ */ jsx12("div", { className: "ardo-features-container", children: items.map((feature, index) => /* @__PURE__ */ jsx12(FeatureCard, { ...feature }, index)) })
|
|
829
|
+
] });
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
export {
|
|
833
|
+
Layout,
|
|
834
|
+
ThemeToggle,
|
|
835
|
+
Search,
|
|
836
|
+
Header,
|
|
837
|
+
SocialLink,
|
|
838
|
+
Sidebar,
|
|
839
|
+
SidebarGroup,
|
|
840
|
+
SidebarLink,
|
|
841
|
+
Footer,
|
|
842
|
+
Nav,
|
|
843
|
+
NavLink2 as NavLink,
|
|
844
|
+
NavDropdown,
|
|
845
|
+
TOC,
|
|
846
|
+
DocPage,
|
|
847
|
+
DocContent,
|
|
848
|
+
DocLayout,
|
|
849
|
+
HomePage,
|
|
850
|
+
Hero,
|
|
851
|
+
FeatureCard,
|
|
852
|
+
Features
|
|
853
|
+
};
|
|
854
|
+
//# sourceMappingURL=chunk-ZXPAEM3M.js.map
|