@doccov/fumadocs-adapter 0.0.1 → 0.0.2
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/CHANGELOG.md +7 -0
- package/bunup.config.ts +0 -1
- package/dist/components/index.d.ts +70 -70
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/shared/{chunk-pqaj3kdh.js → chunk-mmca4gp7.js} +653 -654
- package/package.json +1 -2
- package/src/components/api-page.tsx +3 -9
- package/src/components/class-page.tsx +3 -8
- package/src/components/code-example.tsx +6 -2
- package/src/components/collapsible-method.tsx +6 -13
- package/src/components/coverage-badge.tsx +5 -3
- package/src/components/enum-page.tsx +10 -6
- package/src/components/examples.tsx +0 -1
- package/src/components/expandable-property.tsx +5 -7
- package/src/components/function-page.tsx +7 -9
- package/src/components/index.ts +29 -44
- package/src/components/interface-page.tsx +6 -5
- package/src/components/members-section.tsx +6 -7
- package/src/components/parameter-card.tsx +2 -6
- package/src/components/type-table.tsx +6 -9
- package/src/components/variable-page.tsx +2 -7
- package/src/index.ts +3 -4
- package/src/server.ts +0 -1
- package/src/styles/docskit.css +8 -7
- package/tsconfig.json +0 -1
|
@@ -1,58 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
// src/components/parameter-card.tsx
|
|
3
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
4
|
-
|
|
5
|
-
function formatSchema(schema) {
|
|
6
|
-
if (!schema)
|
|
7
|
-
return "unknown";
|
|
8
|
-
if (typeof schema === "string")
|
|
9
|
-
return schema;
|
|
10
|
-
if (typeof schema === "object" && schema !== null) {
|
|
11
|
-
const s = schema;
|
|
12
|
-
if (s.$ref && typeof s.$ref === "string") {
|
|
13
|
-
return s.$ref.replace("#/types/", "");
|
|
14
|
-
}
|
|
15
|
-
if (s.tsType)
|
|
16
|
-
return String(s.tsType);
|
|
17
|
-
if (s.type)
|
|
18
|
-
return String(s.type);
|
|
19
|
-
}
|
|
20
|
-
return "unknown";
|
|
21
|
-
}
|
|
22
|
-
function ParameterCard({ param, spec }) {
|
|
23
|
-
const type = formatSchema(param.schema);
|
|
24
|
-
const isRequired = param.required !== false;
|
|
25
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
26
|
-
className: "rounded-lg border border-fd-border bg-fd-card/50 p-4",
|
|
27
|
-
children: [
|
|
28
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
29
|
-
className: "flex items-center gap-2 mb-1",
|
|
30
|
-
children: [
|
|
31
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
32
|
-
className: "font-mono text-sm text-fd-foreground",
|
|
33
|
-
children: param.name
|
|
34
|
-
}, undefined, false, undefined, this),
|
|
35
|
-
isRequired && /* @__PURE__ */ jsxDEV("span", {
|
|
36
|
-
className: "text-[10px] font-semibold px-1.5 py-0.5 rounded border border-fd-border bg-fd-muted text-fd-muted-foreground uppercase tracking-wide",
|
|
37
|
-
children: "Required"
|
|
38
|
-
}, undefined, false, undefined, this)
|
|
39
|
-
]
|
|
40
|
-
}, undefined, true, undefined, this),
|
|
41
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
42
|
-
className: "text-sm text-fd-muted-foreground font-mono",
|
|
43
|
-
children: type
|
|
44
|
-
}, undefined, false, undefined, this),
|
|
45
|
-
param.description && /* @__PURE__ */ jsxDEV("p", {
|
|
46
|
-
className: "text-sm text-fd-muted-foreground mt-2",
|
|
47
|
-
children: param.description
|
|
48
|
-
}, undefined, false, undefined, this)
|
|
49
|
-
]
|
|
50
|
-
}, undefined, true, undefined, this);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
2
|
// src/components/code-example.tsx
|
|
54
3
|
import { ClientDocsKitCode } from "@doccov/ui/docskit";
|
|
55
|
-
import { jsxDEV
|
|
4
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
56
5
|
|
|
57
6
|
function cleanCode(code) {
|
|
58
7
|
let cleaned = code.trim();
|
|
@@ -68,215 +17,35 @@ function cleanCode(code) {
|
|
|
68
17
|
}
|
|
69
18
|
return cleaned;
|
|
70
19
|
}
|
|
71
|
-
function CodeExample({
|
|
20
|
+
function CodeExample({
|
|
21
|
+
code,
|
|
22
|
+
filename = "example.ts",
|
|
23
|
+
language = "typescript"
|
|
24
|
+
}) {
|
|
72
25
|
const cleaned = cleanCode(code);
|
|
73
26
|
const codeblock = {
|
|
74
27
|
value: cleaned,
|
|
75
28
|
lang: language,
|
|
76
29
|
meta: `${filename} -cn`
|
|
77
30
|
};
|
|
78
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ jsxDEV(ClientDocsKitCode, {
|
|
79
32
|
codeblock,
|
|
80
33
|
className: "not-fumadocs-codeblock"
|
|
81
34
|
}, undefined, false, undefined, this);
|
|
82
35
|
}
|
|
83
36
|
|
|
84
|
-
// src/components/coverage-badge.tsx
|
|
85
|
-
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
86
|
-
|
|
87
|
-
function getScoreColor(score) {
|
|
88
|
-
if (score >= 80)
|
|
89
|
-
return "text-green-600 dark:text-green-400 bg-green-500/10 border-green-500/20";
|
|
90
|
-
if (score >= 60)
|
|
91
|
-
return "text-yellow-600 dark:text-yellow-400 bg-yellow-500/10 border-yellow-500/20";
|
|
92
|
-
return "text-red-600 dark:text-red-400 bg-red-500/10 border-red-500/20";
|
|
93
|
-
}
|
|
94
|
-
function formatSignal(signal) {
|
|
95
|
-
return signal.charAt(0).toUpperCase() + signal.slice(1);
|
|
96
|
-
}
|
|
97
|
-
function CoverageBadge({ docs, showMissing = true, showDrift = true }) {
|
|
98
|
-
const score = docs.coverageScore;
|
|
99
|
-
const hasMissing = showMissing && docs.missing && docs.missing.length > 0;
|
|
100
|
-
const hasDrift = showDrift && docs.drift && docs.drift.length > 0;
|
|
101
|
-
if (score == null && !hasMissing && !hasDrift)
|
|
102
|
-
return null;
|
|
103
|
-
return /* @__PURE__ */ jsxDEV3("div", {
|
|
104
|
-
className: "my-6 space-y-3",
|
|
105
|
-
children: [
|
|
106
|
-
score != null && /* @__PURE__ */ jsxDEV3("div", {
|
|
107
|
-
className: `inline-flex items-center gap-2 px-3 py-1.5 rounded-md border text-sm font-medium ${getScoreColor(score)}`,
|
|
108
|
-
children: [
|
|
109
|
-
/* @__PURE__ */ jsxDEV3("svg", {
|
|
110
|
-
className: "w-4 h-4",
|
|
111
|
-
fill: "none",
|
|
112
|
-
stroke: "currentColor",
|
|
113
|
-
viewBox: "0 0 24 24",
|
|
114
|
-
children: /* @__PURE__ */ jsxDEV3("path", {
|
|
115
|
-
strokeLinecap: "round",
|
|
116
|
-
strokeLinejoin: "round",
|
|
117
|
-
strokeWidth: 2,
|
|
118
|
-
d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
119
|
-
}, undefined, false, undefined, this)
|
|
120
|
-
}, undefined, false, undefined, this),
|
|
121
|
-
"Coverage: ",
|
|
122
|
-
score,
|
|
123
|
-
"%"
|
|
124
|
-
]
|
|
125
|
-
}, undefined, true, undefined, this),
|
|
126
|
-
hasMissing && /* @__PURE__ */ jsxDEV3("div", {
|
|
127
|
-
className: "rounded-md bg-yellow-500/10 border border-yellow-500/20 px-3 py-2",
|
|
128
|
-
children: [
|
|
129
|
-
/* @__PURE__ */ jsxDEV3("p", {
|
|
130
|
-
className: "text-sm font-medium text-yellow-600 dark:text-yellow-400 mb-1",
|
|
131
|
-
children: "Missing Documentation"
|
|
132
|
-
}, undefined, false, undefined, this),
|
|
133
|
-
/* @__PURE__ */ jsxDEV3("ul", {
|
|
134
|
-
className: "text-sm text-yellow-600/80 dark:text-yellow-400/80 list-disc list-inside",
|
|
135
|
-
children: docs.missing.map((signal) => /* @__PURE__ */ jsxDEV3("li", {
|
|
136
|
-
children: formatSignal(signal)
|
|
137
|
-
}, signal, false, undefined, this))
|
|
138
|
-
}, undefined, false, undefined, this)
|
|
139
|
-
]
|
|
140
|
-
}, undefined, true, undefined, this),
|
|
141
|
-
hasDrift && /* @__PURE__ */ jsxDEV3("div", {
|
|
142
|
-
className: "rounded-md bg-red-500/10 border border-red-500/20 px-3 py-2",
|
|
143
|
-
children: [
|
|
144
|
-
/* @__PURE__ */ jsxDEV3("p", {
|
|
145
|
-
className: "text-sm font-medium text-red-600 dark:text-red-400 mb-1",
|
|
146
|
-
children: "Documentation Drift"
|
|
147
|
-
}, undefined, false, undefined, this),
|
|
148
|
-
/* @__PURE__ */ jsxDEV3("ul", {
|
|
149
|
-
className: "text-sm text-red-600/80 dark:text-red-400/80 space-y-1",
|
|
150
|
-
children: docs.drift.map((drift, index) => /* @__PURE__ */ jsxDEV3("li", {
|
|
151
|
-
className: "flex flex-col",
|
|
152
|
-
children: [
|
|
153
|
-
/* @__PURE__ */ jsxDEV3("span", {
|
|
154
|
-
className: "font-medium",
|
|
155
|
-
children: drift.type
|
|
156
|
-
}, undefined, false, undefined, this),
|
|
157
|
-
/* @__PURE__ */ jsxDEV3("span", {
|
|
158
|
-
className: "text-xs opacity-80",
|
|
159
|
-
children: drift.issue
|
|
160
|
-
}, undefined, false, undefined, this),
|
|
161
|
-
drift.suggestion && /* @__PURE__ */ jsxDEV3("span", {
|
|
162
|
-
className: "text-xs text-fd-muted-foreground mt-0.5",
|
|
163
|
-
children: [
|
|
164
|
-
"Suggestion: ",
|
|
165
|
-
drift.suggestion
|
|
166
|
-
]
|
|
167
|
-
}, undefined, true, undefined, this)
|
|
168
|
-
]
|
|
169
|
-
}, index, true, undefined, this))
|
|
170
|
-
}, undefined, false, undefined, this)
|
|
171
|
-
]
|
|
172
|
-
}, undefined, true, undefined, this)
|
|
173
|
-
]
|
|
174
|
-
}, undefined, true, undefined, this);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// src/components/function-page.tsx
|
|
178
|
-
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
179
|
-
|
|
180
|
-
function formatSchema2(schema) {
|
|
181
|
-
if (!schema)
|
|
182
|
-
return "unknown";
|
|
183
|
-
if (typeof schema === "string")
|
|
184
|
-
return schema;
|
|
185
|
-
if (typeof schema === "object" && schema !== null) {
|
|
186
|
-
const s = schema;
|
|
187
|
-
if (s.$ref && typeof s.$ref === "string") {
|
|
188
|
-
return s.$ref.replace("#/types/", "");
|
|
189
|
-
}
|
|
190
|
-
if (s.tsType)
|
|
191
|
-
return String(s.tsType);
|
|
192
|
-
if (s.type)
|
|
193
|
-
return String(s.type);
|
|
194
|
-
}
|
|
195
|
-
return "unknown";
|
|
196
|
-
}
|
|
197
|
-
function FunctionPage({ export: exp, spec }) {
|
|
198
|
-
const sig = exp.signatures?.[0];
|
|
199
|
-
const hasExamples = exp.examples && exp.examples.length > 0;
|
|
200
|
-
const hasParams = sig?.parameters && sig.parameters.length > 0;
|
|
201
|
-
return /* @__PURE__ */ jsxDEV4("div", {
|
|
202
|
-
className: "space-y-6 not-prose",
|
|
203
|
-
children: [
|
|
204
|
-
exp.description && /* @__PURE__ */ jsxDEV4("p", {
|
|
205
|
-
className: "text-fd-muted-foreground leading-relaxed",
|
|
206
|
-
children: exp.description
|
|
207
|
-
}, undefined, false, undefined, this),
|
|
208
|
-
sig?.returns && /* @__PURE__ */ jsxDEV4("p", {
|
|
209
|
-
className: "text-fd-muted-foreground text-sm",
|
|
210
|
-
children: [
|
|
211
|
-
/* @__PURE__ */ jsxDEV4("span", {
|
|
212
|
-
className: "font-medium text-fd-foreground",
|
|
213
|
-
children: "Returns:"
|
|
214
|
-
}, undefined, false, undefined, this),
|
|
215
|
-
" ",
|
|
216
|
-
sig.returns.description || `A ${sig.returns.tsType ?? formatSchema2(sig.returns.schema)}`
|
|
217
|
-
]
|
|
218
|
-
}, undefined, true, undefined, this),
|
|
219
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
220
|
-
className: "not-prose",
|
|
221
|
-
style: {
|
|
222
|
-
display: hasExamples ? "grid" : "block",
|
|
223
|
-
gridTemplateColumns: hasExamples ? "repeat(2, minmax(0, 1fr))" : undefined,
|
|
224
|
-
gap: "2rem",
|
|
225
|
-
alignItems: "start"
|
|
226
|
-
},
|
|
227
|
-
children: [
|
|
228
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
229
|
-
className: "space-y-6",
|
|
230
|
-
children: hasParams && /* @__PURE__ */ jsxDEV4("div", {
|
|
231
|
-
children: [
|
|
232
|
-
/* @__PURE__ */ jsxDEV4("h3", {
|
|
233
|
-
className: "text-sm font-semibold uppercase tracking-wide text-fd-muted-foreground mb-4",
|
|
234
|
-
children: "Parameters"
|
|
235
|
-
}, undefined, false, undefined, this),
|
|
236
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
237
|
-
className: "space-y-3",
|
|
238
|
-
children: sig.parameters.map((param, index) => /* @__PURE__ */ jsxDEV4(ParameterCard, {
|
|
239
|
-
param,
|
|
240
|
-
spec
|
|
241
|
-
}, param.name ?? index, false, undefined, this))
|
|
242
|
-
}, undefined, false, undefined, this)
|
|
243
|
-
]
|
|
244
|
-
}, undefined, true, undefined, this)
|
|
245
|
-
}, undefined, false, undefined, this),
|
|
246
|
-
hasExamples && /* @__PURE__ */ jsxDEV4("div", {
|
|
247
|
-
style: { position: "sticky", top: "5rem" },
|
|
248
|
-
children: [
|
|
249
|
-
/* @__PURE__ */ jsxDEV4("h3", {
|
|
250
|
-
className: "text-sm font-semibold uppercase tracking-wide text-fd-muted-foreground mb-4",
|
|
251
|
-
children: "Example"
|
|
252
|
-
}, undefined, false, undefined, this),
|
|
253
|
-
/* @__PURE__ */ jsxDEV4(CodeExample, {
|
|
254
|
-
code: exp.examples[0],
|
|
255
|
-
filename: `${exp.name.toLowerCase().replace(/[^a-z0-9]/g, "-")}.ts`
|
|
256
|
-
}, undefined, false, undefined, this)
|
|
257
|
-
]
|
|
258
|
-
}, undefined, true, undefined, this)
|
|
259
|
-
]
|
|
260
|
-
}, undefined, true, undefined, this),
|
|
261
|
-
exp.docs && /* @__PURE__ */ jsxDEV4(CoverageBadge, {
|
|
262
|
-
docs: exp.docs
|
|
263
|
-
}, undefined, false, undefined, this)
|
|
264
|
-
]
|
|
265
|
-
}, undefined, true, undefined, this);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
37
|
// src/components/expandable-property.tsx
|
|
269
38
|
import { useState } from "react";
|
|
270
|
-
import { jsxDEV as
|
|
39
|
+
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
271
40
|
|
|
272
41
|
function ChevronIcon({ expanded }) {
|
|
273
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ jsxDEV2("svg", {
|
|
274
43
|
width: "12",
|
|
275
44
|
height: "12",
|
|
276
45
|
viewBox: "0 0 12 12",
|
|
277
46
|
fill: "none",
|
|
278
47
|
className: `transition-transform duration-200 ${expanded ? "rotate-90" : ""}`,
|
|
279
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ jsxDEV2("path", {
|
|
280
49
|
d: "M4.5 2.5L8 6L4.5 9.5",
|
|
281
50
|
stroke: "currentColor",
|
|
282
51
|
strokeWidth: "1.5",
|
|
@@ -295,7 +64,7 @@ function formatType(schema) {
|
|
|
295
64
|
if (s.tsType && typeof s.tsType === "string") {
|
|
296
65
|
const tsType = s.tsType;
|
|
297
66
|
if (tsType.length > 80) {
|
|
298
|
-
return tsType.slice(0, 77)
|
|
67
|
+
return `${tsType.slice(0, 77)}...`;
|
|
299
68
|
}
|
|
300
69
|
return tsType;
|
|
301
70
|
}
|
|
@@ -305,7 +74,7 @@ function formatType(schema) {
|
|
|
305
74
|
if (s.enum && Array.isArray(s.enum)) {
|
|
306
75
|
const enumVals = s.enum.map((v) => JSON.stringify(v)).join(" | ");
|
|
307
76
|
if (enumVals.length > 50)
|
|
308
|
-
return enumVals.slice(0, 47)
|
|
77
|
+
return `${enumVals.slice(0, 47)}...`;
|
|
309
78
|
return enumVals;
|
|
310
79
|
}
|
|
311
80
|
if (s.anyOf && Array.isArray(s.anyOf)) {
|
|
@@ -352,19 +121,19 @@ function NestedProperty({ name, schema, required = false, depth = 0 }) {
|
|
|
352
121
|
const hasNested = nestedCount > 0;
|
|
353
122
|
const schemaObj = schema;
|
|
354
123
|
const description = schemaObj?.description;
|
|
355
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ jsxDEV2("div", {
|
|
356
125
|
className: "flex flex-col border-b border-fd-border last:border-0",
|
|
357
126
|
children: [
|
|
358
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
359
128
|
className: "flex flex-row items-start gap-2 py-2.5 px-3",
|
|
360
129
|
children: [
|
|
361
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
362
131
|
className: "flex-1 min-w-0",
|
|
363
132
|
children: [
|
|
364
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
365
134
|
className: "flex items-baseline gap-2 flex-wrap",
|
|
366
135
|
children: [
|
|
367
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
368
137
|
className: "font-mono text-sm font-medium text-fd-foreground",
|
|
369
138
|
children: [
|
|
370
139
|
name,
|
|
@@ -372,28 +141,28 @@ function NestedProperty({ name, schema, required = false, depth = 0 }) {
|
|
|
372
141
|
":"
|
|
373
142
|
]
|
|
374
143
|
}, undefined, true, undefined, this),
|
|
375
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
376
145
|
className: "font-mono text-sm text-fd-muted-foreground",
|
|
377
146
|
children: hasNested ? "object" : type
|
|
378
147
|
}, undefined, false, undefined, this)
|
|
379
148
|
]
|
|
380
149
|
}, undefined, true, undefined, this),
|
|
381
|
-
description && /* @__PURE__ */
|
|
150
|
+
description && /* @__PURE__ */ jsxDEV2("p", {
|
|
382
151
|
className: "text-sm text-fd-muted-foreground mt-0.5 leading-relaxed",
|
|
383
152
|
children: description
|
|
384
153
|
}, undefined, false, undefined, this)
|
|
385
154
|
]
|
|
386
155
|
}, undefined, true, undefined, this),
|
|
387
|
-
hasNested && /* @__PURE__ */
|
|
156
|
+
hasNested && /* @__PURE__ */ jsxDEV2("button", {
|
|
388
157
|
onClick: () => setExpanded(!expanded),
|
|
389
158
|
className: `flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded-md
|
|
390
159
|
bg-fd-muted text-fd-muted-foreground hover:bg-fd-accent hover:text-fd-accent-foreground
|
|
391
160
|
transition-colors cursor-pointer shrink-0`,
|
|
392
161
|
children: [
|
|
393
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ jsxDEV2(ChevronIcon, {
|
|
394
163
|
expanded
|
|
395
164
|
}, undefined, false, undefined, this),
|
|
396
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
397
166
|
children: [
|
|
398
167
|
nestedCount,
|
|
399
168
|
" properties"
|
|
@@ -403,9 +172,9 @@ function NestedProperty({ name, schema, required = false, depth = 0 }) {
|
|
|
403
172
|
}, undefined, true, undefined, this)
|
|
404
173
|
]
|
|
405
174
|
}, undefined, true, undefined, this),
|
|
406
|
-
hasNested && expanded && nestedProps && /* @__PURE__ */
|
|
175
|
+
hasNested && expanded && nestedProps && /* @__PURE__ */ jsxDEV2("div", {
|
|
407
176
|
className: "mx-3 mb-3 rounded-lg border border-fd-border bg-fd-card/50 overflow-hidden",
|
|
408
|
-
children: Object.entries(nestedProps).map(([propName, propSchema]) => /* @__PURE__ */
|
|
177
|
+
children: Object.entries(nestedProps).map(([propName, propSchema]) => /* @__PURE__ */ jsxDEV2(NestedProperty, {
|
|
409
178
|
name: propName,
|
|
410
179
|
schema: propSchema,
|
|
411
180
|
required: getRequiredFields(schema).includes(propName),
|
|
@@ -422,19 +191,19 @@ function ExpandableProperty({ param, depth = 0 }) {
|
|
|
422
191
|
const nestedProps = getNestedProperties(param.schema);
|
|
423
192
|
const nestedCount = countProperties(param.schema);
|
|
424
193
|
const hasNested = nestedCount > 0;
|
|
425
|
-
return /* @__PURE__ */
|
|
194
|
+
return /* @__PURE__ */ jsxDEV2("div", {
|
|
426
195
|
className: "flex flex-col border-b border-fd-border last:border-0",
|
|
427
196
|
children: [
|
|
428
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
429
198
|
className: "flex flex-row items-start gap-2 py-3",
|
|
430
199
|
children: [
|
|
431
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
432
201
|
className: "flex-1 min-w-0",
|
|
433
202
|
children: [
|
|
434
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
435
204
|
className: "flex items-baseline gap-2 flex-wrap",
|
|
436
205
|
children: [
|
|
437
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
438
207
|
className: "font-mono text-sm font-medium text-fd-foreground",
|
|
439
208
|
children: [
|
|
440
209
|
param.name,
|
|
@@ -442,28 +211,28 @@ function ExpandableProperty({ param, depth = 0 }) {
|
|
|
442
211
|
":"
|
|
443
212
|
]
|
|
444
213
|
}, undefined, true, undefined, this),
|
|
445
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
446
215
|
className: "font-mono text-sm text-fd-muted-foreground",
|
|
447
216
|
children: hasNested ? "object" : type
|
|
448
217
|
}, undefined, false, undefined, this)
|
|
449
218
|
]
|
|
450
219
|
}, undefined, true, undefined, this),
|
|
451
|
-
param.description && /* @__PURE__ */
|
|
220
|
+
param.description && /* @__PURE__ */ jsxDEV2("p", {
|
|
452
221
|
className: "text-sm text-fd-muted-foreground mt-1 leading-relaxed",
|
|
453
222
|
children: param.description
|
|
454
223
|
}, undefined, false, undefined, this)
|
|
455
224
|
]
|
|
456
225
|
}, undefined, true, undefined, this),
|
|
457
|
-
hasNested && /* @__PURE__ */
|
|
226
|
+
hasNested && /* @__PURE__ */ jsxDEV2("button", {
|
|
458
227
|
onClick: () => setExpanded(!expanded),
|
|
459
228
|
className: `flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded-md
|
|
460
229
|
bg-fd-muted text-fd-muted-foreground hover:bg-fd-accent hover:text-fd-accent-foreground
|
|
461
230
|
transition-colors cursor-pointer shrink-0`,
|
|
462
231
|
children: [
|
|
463
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ jsxDEV2(ChevronIcon, {
|
|
464
233
|
expanded
|
|
465
234
|
}, undefined, false, undefined, this),
|
|
466
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
467
236
|
children: [
|
|
468
237
|
nestedCount,
|
|
469
238
|
" properties"
|
|
@@ -473,9 +242,9 @@ function ExpandableProperty({ param, depth = 0 }) {
|
|
|
473
242
|
}, undefined, true, undefined, this)
|
|
474
243
|
]
|
|
475
244
|
}, undefined, true, undefined, this),
|
|
476
|
-
hasNested && expanded && nestedProps && /* @__PURE__ */
|
|
245
|
+
hasNested && expanded && nestedProps && /* @__PURE__ */ jsxDEV2("div", {
|
|
477
246
|
className: "ml-4 mb-3 rounded-lg border border-fd-border bg-fd-card/50 overflow-hidden",
|
|
478
|
-
children: Object.entries(nestedProps).map(([propName, propSchema]) => /* @__PURE__ */
|
|
247
|
+
children: Object.entries(nestedProps).map(([propName, propSchema]) => /* @__PURE__ */ jsxDEV2(NestedProperty, {
|
|
479
248
|
name: propName,
|
|
480
249
|
schema: propSchema,
|
|
481
250
|
required: getRequiredFields(param.schema).includes(propName),
|
|
@@ -487,17 +256,17 @@ function ExpandableProperty({ param, depth = 0 }) {
|
|
|
487
256
|
}
|
|
488
257
|
|
|
489
258
|
// src/components/collapsible-method.tsx
|
|
490
|
-
import { useState as useState2
|
|
491
|
-
import { jsxDEV as
|
|
259
|
+
import { useEffect, useState as useState2 } from "react";
|
|
260
|
+
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
492
261
|
|
|
493
262
|
function ChevronIcon2({ expanded }) {
|
|
494
|
-
return /* @__PURE__ */
|
|
263
|
+
return /* @__PURE__ */ jsxDEV3("svg", {
|
|
495
264
|
width: "16",
|
|
496
265
|
height: "16",
|
|
497
266
|
viewBox: "0 0 16 16",
|
|
498
267
|
fill: "none",
|
|
499
268
|
className: `transition-transform duration-200 ${expanded ? "rotate-90" : ""}`,
|
|
500
|
-
children: /* @__PURE__ */
|
|
269
|
+
children: /* @__PURE__ */ jsxDEV3("path", {
|
|
501
270
|
d: "M6 4L10 8L6 12",
|
|
502
271
|
stroke: "currentColor",
|
|
503
272
|
strokeWidth: "1.5",
|
|
@@ -506,7 +275,7 @@ function ChevronIcon2({ expanded }) {
|
|
|
506
275
|
}, undefined, false, undefined, this)
|
|
507
276
|
}, undefined, false, undefined, this);
|
|
508
277
|
}
|
|
509
|
-
function
|
|
278
|
+
function formatSchema(schema) {
|
|
510
279
|
if (!schema)
|
|
511
280
|
return "unknown";
|
|
512
281
|
if (typeof schema === "string")
|
|
@@ -519,7 +288,7 @@ function formatSchema3(schema) {
|
|
|
519
288
|
if (s.tsType) {
|
|
520
289
|
const tsType = String(s.tsType);
|
|
521
290
|
if (tsType.length > 40)
|
|
522
|
-
return tsType.slice(0, 37)
|
|
291
|
+
return `${tsType.slice(0, 37)}...`;
|
|
523
292
|
return tsType;
|
|
524
293
|
}
|
|
525
294
|
if (s.type)
|
|
@@ -533,10 +302,10 @@ function formatReturnType(returns) {
|
|
|
533
302
|
if (returns.tsType) {
|
|
534
303
|
const t = returns.tsType;
|
|
535
304
|
if (t.length > 40)
|
|
536
|
-
return t.slice(0, 37)
|
|
305
|
+
return `${t.slice(0, 37)}...`;
|
|
537
306
|
return t;
|
|
538
307
|
}
|
|
539
|
-
return
|
|
308
|
+
return formatSchema(returns.schema);
|
|
540
309
|
}
|
|
541
310
|
function formatParamPreview(params) {
|
|
542
311
|
if (!params || params.length === 0)
|
|
@@ -561,28 +330,28 @@ function CollapsibleMethod({ member, defaultExpanded = false }) {
|
|
|
561
330
|
setExpanded(true);
|
|
562
331
|
}
|
|
563
332
|
}, [member.name]);
|
|
564
|
-
return /* @__PURE__ */
|
|
333
|
+
return /* @__PURE__ */ jsxDEV3("div", {
|
|
565
334
|
id: member.name,
|
|
566
335
|
className: "scroll-mt-20 border-b border-fd-border last:border-0",
|
|
567
336
|
children: [
|
|
568
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ jsxDEV3("button", {
|
|
569
338
|
onClick: () => setExpanded(!expanded),
|
|
570
339
|
className: "w-full flex items-center gap-3 py-4 px-1 text-left hover:bg-fd-muted/30 transition-colors cursor-pointer group",
|
|
571
340
|
children: [
|
|
572
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
573
342
|
className: "text-fd-muted-foreground group-hover:text-fd-foreground transition-colors",
|
|
574
|
-
children: /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ jsxDEV3(ChevronIcon2, {
|
|
575
344
|
expanded
|
|
576
345
|
}, undefined, false, undefined, this)
|
|
577
346
|
}, undefined, false, undefined, this),
|
|
578
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
579
348
|
className: "flex-1 min-w-0 flex items-baseline gap-2 flex-wrap",
|
|
580
349
|
children: [
|
|
581
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
582
351
|
className: "font-mono text-sm font-semibold text-fd-foreground",
|
|
583
352
|
children: [
|
|
584
353
|
member.name,
|
|
585
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
586
355
|
className: "text-fd-muted-foreground font-normal",
|
|
587
356
|
children: [
|
|
588
357
|
"(",
|
|
@@ -592,28 +361,28 @@ function CollapsibleMethod({ member, defaultExpanded = false }) {
|
|
|
592
361
|
}, undefined, true, undefined, this)
|
|
593
362
|
]
|
|
594
363
|
}, undefined, true, undefined, this),
|
|
595
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
596
365
|
className: "text-fd-muted-foreground",
|
|
597
366
|
children: "→"
|
|
598
367
|
}, undefined, false, undefined, this),
|
|
599
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
600
369
|
className: "font-mono text-sm text-fd-muted-foreground truncate",
|
|
601
370
|
children: returnType
|
|
602
371
|
}, undefined, false, undefined, this)
|
|
603
372
|
]
|
|
604
373
|
}, undefined, true, undefined, this),
|
|
605
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
606
375
|
className: "flex gap-1.5 shrink-0",
|
|
607
376
|
children: [
|
|
608
|
-
visibility !== "public" && /* @__PURE__ */
|
|
377
|
+
visibility !== "public" && /* @__PURE__ */ jsxDEV3("span", {
|
|
609
378
|
className: "text-xs px-1.5 py-0.5 rounded bg-fd-muted text-fd-muted-foreground",
|
|
610
379
|
children: visibility
|
|
611
380
|
}, undefined, false, undefined, this),
|
|
612
|
-
isStatic && /* @__PURE__ */
|
|
381
|
+
isStatic && /* @__PURE__ */ jsxDEV3("span", {
|
|
613
382
|
className: "text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-600 dark:text-blue-400",
|
|
614
383
|
children: "static"
|
|
615
384
|
}, undefined, false, undefined, this),
|
|
616
|
-
isAsync && /* @__PURE__ */
|
|
385
|
+
isAsync && /* @__PURE__ */ jsxDEV3("span", {
|
|
617
386
|
className: "text-xs px-1.5 py-0.5 rounded bg-purple-500/10 text-purple-600 dark:text-purple-400",
|
|
618
387
|
children: "async"
|
|
619
388
|
}, undefined, false, undefined, this)
|
|
@@ -621,42 +390,42 @@ function CollapsibleMethod({ member, defaultExpanded = false }) {
|
|
|
621
390
|
}, undefined, true, undefined, this)
|
|
622
391
|
]
|
|
623
392
|
}, undefined, true, undefined, this),
|
|
624
|
-
expanded && /* @__PURE__ */
|
|
393
|
+
expanded && /* @__PURE__ */ jsxDEV3("div", {
|
|
625
394
|
className: "pb-6 pl-8 pr-4",
|
|
626
395
|
children: [
|
|
627
|
-
member.description && /* @__PURE__ */
|
|
396
|
+
member.description && /* @__PURE__ */ jsxDEV3("p", {
|
|
628
397
|
className: "text-fd-muted-foreground mb-4 leading-relaxed",
|
|
629
398
|
children: member.description
|
|
630
399
|
}, undefined, false, undefined, this),
|
|
631
|
-
hasParams && /* @__PURE__ */
|
|
400
|
+
hasParams && /* @__PURE__ */ jsxDEV3("div", {
|
|
632
401
|
className: "mb-4",
|
|
633
402
|
children: [
|
|
634
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
635
404
|
className: "text-xs uppercase tracking-wide text-fd-muted-foreground font-medium block mb-2",
|
|
636
405
|
children: "Parameters"
|
|
637
406
|
}, undefined, false, undefined, this),
|
|
638
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
639
408
|
className: "border-l-2 border-fd-border pl-4",
|
|
640
|
-
children: sig.parameters.map((param, index) => /* @__PURE__ */
|
|
409
|
+
children: sig.parameters.map((param, index) => /* @__PURE__ */ jsxDEV3(ExpandableProperty, {
|
|
641
410
|
param
|
|
642
411
|
}, param.name ?? index, false, undefined, this))
|
|
643
412
|
}, undefined, false, undefined, this)
|
|
644
413
|
]
|
|
645
414
|
}, undefined, true, undefined, this),
|
|
646
|
-
sig?.returns && returnType !== "void" && /* @__PURE__ */
|
|
415
|
+
sig?.returns && returnType !== "void" && /* @__PURE__ */ jsxDEV3("div", {
|
|
647
416
|
children: [
|
|
648
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
649
418
|
className: "text-xs uppercase tracking-wide text-fd-muted-foreground font-medium block mb-2",
|
|
650
419
|
children: "Returns"
|
|
651
420
|
}, undefined, false, undefined, this),
|
|
652
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
653
422
|
className: "border-l-2 border-fd-border pl-4 py-2",
|
|
654
423
|
children: [
|
|
655
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
656
425
|
className: "font-mono text-sm text-fd-muted-foreground",
|
|
657
|
-
children: sig.returns.tsType ||
|
|
426
|
+
children: sig.returns.tsType || formatSchema(sig.returns.schema)
|
|
658
427
|
}, undefined, false, undefined, this),
|
|
659
|
-
returnDescription && /* @__PURE__ */
|
|
428
|
+
returnDescription && /* @__PURE__ */ jsxDEV3("p", {
|
|
660
429
|
className: "text-sm text-fd-muted-foreground mt-1 leading-relaxed",
|
|
661
430
|
children: returnDescription
|
|
662
431
|
}, undefined, false, undefined, this)
|
|
@@ -670,64 +439,157 @@ function CollapsibleMethod({ member, defaultExpanded = false }) {
|
|
|
670
439
|
}, undefined, true, undefined, this);
|
|
671
440
|
}
|
|
672
441
|
|
|
673
|
-
// src/components/
|
|
674
|
-
import { jsxDEV as
|
|
442
|
+
// src/components/coverage-badge.tsx
|
|
443
|
+
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
675
444
|
|
|
676
|
-
function
|
|
677
|
-
if (
|
|
678
|
-
return "
|
|
679
|
-
if (
|
|
680
|
-
return
|
|
681
|
-
|
|
682
|
-
const s = schema;
|
|
683
|
-
if (s.$ref && typeof s.$ref === "string") {
|
|
684
|
-
return s.$ref.replace("#/types/", "");
|
|
685
|
-
}
|
|
686
|
-
if (s.tsType)
|
|
687
|
-
return String(s.tsType);
|
|
688
|
-
if (s.type)
|
|
689
|
-
return String(s.type);
|
|
690
|
-
}
|
|
691
|
-
return "unknown";
|
|
445
|
+
function getScoreColor(score) {
|
|
446
|
+
if (score >= 80)
|
|
447
|
+
return "text-green-600 dark:text-green-400 bg-green-500/10 border-green-500/20";
|
|
448
|
+
if (score >= 60)
|
|
449
|
+
return "text-yellow-600 dark:text-yellow-400 bg-yellow-500/10 border-yellow-500/20";
|
|
450
|
+
return "text-red-600 dark:text-red-400 bg-red-500/10 border-red-500/20";
|
|
692
451
|
}
|
|
693
|
-
function
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
const
|
|
698
|
-
const
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
452
|
+
function formatSignal(signal) {
|
|
453
|
+
return signal.charAt(0).toUpperCase() + signal.slice(1);
|
|
454
|
+
}
|
|
455
|
+
function CoverageBadge({ docs, showMissing = true, showDrift = true }) {
|
|
456
|
+
const score = docs.coverageScore;
|
|
457
|
+
const hasMissing = showMissing && docs.missing && docs.missing.length > 0;
|
|
458
|
+
const hasDrift = showDrift && docs.drift && docs.drift.length > 0;
|
|
459
|
+
if (score == null && !hasMissing && !hasDrift)
|
|
460
|
+
return null;
|
|
461
|
+
return /* @__PURE__ */ jsxDEV4("div", {
|
|
462
|
+
className: "my-6 space-y-3",
|
|
463
|
+
children: [
|
|
464
|
+
score != null && /* @__PURE__ */ jsxDEV4("div", {
|
|
465
|
+
className: `inline-flex items-center gap-2 px-3 py-1.5 rounded-md border text-sm font-medium ${getScoreColor(score)}`,
|
|
466
|
+
children: [
|
|
467
|
+
/* @__PURE__ */ jsxDEV4("svg", {
|
|
468
|
+
className: "w-4 h-4",
|
|
469
|
+
fill: "none",
|
|
470
|
+
stroke: "currentColor",
|
|
471
|
+
viewBox: "0 0 24 24",
|
|
472
|
+
children: /* @__PURE__ */ jsxDEV4("path", {
|
|
473
|
+
strokeLinecap: "round",
|
|
474
|
+
strokeLinejoin: "round",
|
|
475
|
+
strokeWidth: 2,
|
|
476
|
+
d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
477
|
+
}, undefined, false, undefined, this)
|
|
478
|
+
}, undefined, false, undefined, this),
|
|
479
|
+
"Coverage: ",
|
|
480
|
+
score,
|
|
481
|
+
"%"
|
|
482
|
+
]
|
|
483
|
+
}, undefined, true, undefined, this),
|
|
484
|
+
hasMissing && /* @__PURE__ */ jsxDEV4("div", {
|
|
485
|
+
className: "rounded-md bg-yellow-500/10 border border-yellow-500/20 px-3 py-2",
|
|
486
|
+
children: [
|
|
487
|
+
/* @__PURE__ */ jsxDEV4("p", {
|
|
488
|
+
className: "text-sm font-medium text-yellow-600 dark:text-yellow-400 mb-1",
|
|
489
|
+
children: "Missing Documentation"
|
|
490
|
+
}, undefined, false, undefined, this),
|
|
491
|
+
/* @__PURE__ */ jsxDEV4("ul", {
|
|
492
|
+
className: "text-sm text-yellow-600/80 dark:text-yellow-400/80 list-disc list-inside",
|
|
493
|
+
children: docs.missing.map((signal) => /* @__PURE__ */ jsxDEV4("li", {
|
|
494
|
+
children: formatSignal(signal)
|
|
495
|
+
}, signal, false, undefined, this))
|
|
496
|
+
}, undefined, false, undefined, this)
|
|
497
|
+
]
|
|
498
|
+
}, undefined, true, undefined, this),
|
|
499
|
+
hasDrift && /* @__PURE__ */ jsxDEV4("div", {
|
|
500
|
+
className: "rounded-md bg-red-500/10 border border-red-500/20 px-3 py-2",
|
|
501
|
+
children: [
|
|
502
|
+
/* @__PURE__ */ jsxDEV4("p", {
|
|
503
|
+
className: "text-sm font-medium text-red-600 dark:text-red-400 mb-1",
|
|
504
|
+
children: "Documentation Drift"
|
|
505
|
+
}, undefined, false, undefined, this),
|
|
506
|
+
/* @__PURE__ */ jsxDEV4("ul", {
|
|
507
|
+
className: "text-sm text-red-600/80 dark:text-red-400/80 space-y-1",
|
|
508
|
+
children: docs.drift.map((drift, index) => /* @__PURE__ */ jsxDEV4("li", {
|
|
509
|
+
className: "flex flex-col",
|
|
510
|
+
children: [
|
|
511
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
512
|
+
className: "font-medium",
|
|
513
|
+
children: drift.type
|
|
514
|
+
}, undefined, false, undefined, this),
|
|
515
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
516
|
+
className: "text-xs opacity-80",
|
|
517
|
+
children: drift.issue
|
|
518
|
+
}, undefined, false, undefined, this),
|
|
519
|
+
drift.suggestion && /* @__PURE__ */ jsxDEV4("span", {
|
|
520
|
+
className: "text-xs text-fd-muted-foreground mt-0.5",
|
|
521
|
+
children: [
|
|
522
|
+
"Suggestion: ",
|
|
523
|
+
drift.suggestion
|
|
524
|
+
]
|
|
525
|
+
}, undefined, true, undefined, this)
|
|
526
|
+
]
|
|
527
|
+
}, index, true, undefined, this))
|
|
528
|
+
}, undefined, false, undefined, this)
|
|
529
|
+
]
|
|
530
|
+
}, undefined, true, undefined, this)
|
|
531
|
+
]
|
|
532
|
+
}, undefined, true, undefined, this);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// src/components/class-page.tsx
|
|
536
|
+
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
537
|
+
|
|
538
|
+
function formatSchema2(schema) {
|
|
539
|
+
if (!schema)
|
|
540
|
+
return "unknown";
|
|
541
|
+
if (typeof schema === "string")
|
|
542
|
+
return schema;
|
|
543
|
+
if (typeof schema === "object" && schema !== null) {
|
|
544
|
+
const s = schema;
|
|
545
|
+
if (s.$ref && typeof s.$ref === "string") {
|
|
546
|
+
return s.$ref.replace("#/types/", "");
|
|
547
|
+
}
|
|
548
|
+
if (s.tsType)
|
|
549
|
+
return String(s.tsType);
|
|
550
|
+
if (s.type)
|
|
551
|
+
return String(s.type);
|
|
552
|
+
}
|
|
553
|
+
return "unknown";
|
|
554
|
+
}
|
|
555
|
+
function PropertyItem({ member }) {
|
|
556
|
+
const visibility = member.visibility ?? "public";
|
|
557
|
+
const flags = member.flags;
|
|
558
|
+
const isStatic = flags?.static;
|
|
559
|
+
const isReadonly = flags?.readonly;
|
|
560
|
+
const type = formatSchema2(member.schema);
|
|
561
|
+
return /* @__PURE__ */ jsxDEV5("div", {
|
|
562
|
+
className: "py-3 border-b border-fd-border last:border-0",
|
|
563
|
+
children: [
|
|
564
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
565
|
+
className: "flex items-baseline gap-2 flex-wrap",
|
|
566
|
+
children: [
|
|
567
|
+
/* @__PURE__ */ jsxDEV5("span", {
|
|
568
|
+
className: "font-semibold text-fd-foreground",
|
|
569
|
+
children: [
|
|
570
|
+
member.name,
|
|
571
|
+
":"
|
|
710
572
|
]
|
|
711
573
|
}, undefined, true, undefined, this),
|
|
712
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ jsxDEV5("span", {
|
|
713
575
|
className: "text-fd-muted-foreground font-mono text-sm",
|
|
714
576
|
children: type
|
|
715
577
|
}, undefined, false, undefined, this),
|
|
716
|
-
visibility !== "public" && /* @__PURE__ */
|
|
578
|
+
visibility !== "public" && /* @__PURE__ */ jsxDEV5("span", {
|
|
717
579
|
className: "text-xs px-1.5 py-0.5 rounded bg-fd-muted text-fd-muted-foreground",
|
|
718
580
|
children: visibility
|
|
719
581
|
}, undefined, false, undefined, this),
|
|
720
|
-
isStatic && /* @__PURE__ */
|
|
582
|
+
isStatic && /* @__PURE__ */ jsxDEV5("span", {
|
|
721
583
|
className: "text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-600 dark:text-blue-400",
|
|
722
584
|
children: "static"
|
|
723
585
|
}, undefined, false, undefined, this),
|
|
724
|
-
isReadonly && /* @__PURE__ */
|
|
586
|
+
isReadonly && /* @__PURE__ */ jsxDEV5("span", {
|
|
725
587
|
className: "text-xs px-1.5 py-0.5 rounded bg-purple-500/10 text-purple-600 dark:text-purple-400",
|
|
726
588
|
children: "readonly"
|
|
727
589
|
}, undefined, false, undefined, this)
|
|
728
590
|
]
|
|
729
591
|
}, undefined, true, undefined, this),
|
|
730
|
-
member.description && /* @__PURE__ */
|
|
592
|
+
member.description && /* @__PURE__ */ jsxDEV5("p", {
|
|
731
593
|
className: "text-sm text-fd-muted-foreground mt-1",
|
|
732
594
|
children: member.description
|
|
733
595
|
}, undefined, false, undefined, this)
|
|
@@ -741,16 +603,16 @@ function ClassPage({ export: exp, spec }) {
|
|
|
741
603
|
const methods = exp.members?.filter((m) => m.kind === "method") ?? [];
|
|
742
604
|
const constructorSig = constructors[0]?.signatures?.[0];
|
|
743
605
|
const constructorParams = constructorSig?.parameters ?? [];
|
|
744
|
-
return /* @__PURE__ */
|
|
606
|
+
return /* @__PURE__ */ jsxDEV5("div", {
|
|
745
607
|
className: "space-y-8",
|
|
746
608
|
children: [
|
|
747
|
-
exp.description && /* @__PURE__ */
|
|
609
|
+
exp.description && /* @__PURE__ */ jsxDEV5("p", {
|
|
748
610
|
className: "text-fd-muted-foreground text-lg leading-relaxed",
|
|
749
611
|
children: exp.description
|
|
750
612
|
}, undefined, false, undefined, this),
|
|
751
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
752
614
|
className: "rounded-lg border border-fd-border bg-fd-muted/30 p-4 overflow-x-auto",
|
|
753
|
-
children: /* @__PURE__ */
|
|
615
|
+
children: /* @__PURE__ */ jsxDEV5("code", {
|
|
754
616
|
className: "font-mono text-sm text-fd-foreground whitespace-pre",
|
|
755
617
|
children: [
|
|
756
618
|
"class ",
|
|
@@ -760,50 +622,50 @@ function ClassPage({ export: exp, spec }) {
|
|
|
760
622
|
]
|
|
761
623
|
}, undefined, true, undefined, this)
|
|
762
624
|
}, undefined, false, undefined, this),
|
|
763
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
764
626
|
className: `grid gap-8 ${hasExamples ? "lg:grid-cols-2" : "grid-cols-1"}`,
|
|
765
627
|
children: [
|
|
766
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
767
629
|
className: "space-y-8",
|
|
768
630
|
children: [
|
|
769
|
-
constructorParams.length > 0 && /* @__PURE__ */
|
|
631
|
+
constructorParams.length > 0 && /* @__PURE__ */ jsxDEV5("section", {
|
|
770
632
|
children: [
|
|
771
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ jsxDEV5("h3", {
|
|
772
634
|
className: "text-sm font-semibold uppercase tracking-wide text-fd-muted-foreground mb-4",
|
|
773
635
|
children: "Constructor"
|
|
774
636
|
}, undefined, false, undefined, this),
|
|
775
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
776
638
|
className: "ml-2 border-l-2 border-fd-border pl-4",
|
|
777
|
-
children: constructorParams.map((param, index) => /* @__PURE__ */
|
|
639
|
+
children: constructorParams.map((param, index) => /* @__PURE__ */ jsxDEV5(ExpandableProperty, {
|
|
778
640
|
param
|
|
779
641
|
}, param.name ?? index, false, undefined, this))
|
|
780
642
|
}, undefined, false, undefined, this)
|
|
781
643
|
]
|
|
782
644
|
}, undefined, true, undefined, this),
|
|
783
|
-
methods.length > 0 && /* @__PURE__ */
|
|
645
|
+
methods.length > 0 && /* @__PURE__ */ jsxDEV5("section", {
|
|
784
646
|
children: [
|
|
785
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ jsxDEV5("h3", {
|
|
786
648
|
className: "text-sm font-semibold uppercase tracking-wide text-fd-muted-foreground mb-4",
|
|
787
649
|
children: "Methods"
|
|
788
650
|
}, undefined, false, undefined, this),
|
|
789
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
790
652
|
className: "rounded-lg border border-fd-border overflow-hidden",
|
|
791
|
-
children: methods.map((member, index) => /* @__PURE__ */
|
|
653
|
+
children: methods.map((member, index) => /* @__PURE__ */ jsxDEV5(CollapsibleMethod, {
|
|
792
654
|
member,
|
|
793
655
|
defaultExpanded: index === 0
|
|
794
656
|
}, member.name ?? index, false, undefined, this))
|
|
795
657
|
}, undefined, false, undefined, this)
|
|
796
658
|
]
|
|
797
659
|
}, undefined, true, undefined, this),
|
|
798
|
-
properties.length > 0 && /* @__PURE__ */
|
|
660
|
+
properties.length > 0 && /* @__PURE__ */ jsxDEV5("section", {
|
|
799
661
|
children: [
|
|
800
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ jsxDEV5("h3", {
|
|
801
663
|
className: "text-sm font-semibold uppercase tracking-wide text-fd-muted-foreground mb-4",
|
|
802
664
|
children: "Properties"
|
|
803
665
|
}, undefined, false, undefined, this),
|
|
804
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
805
667
|
className: "rounded-lg border border-fd-border bg-fd-card px-4",
|
|
806
|
-
children: properties.map((member, index) => /* @__PURE__ */
|
|
668
|
+
children: properties.map((member, index) => /* @__PURE__ */ jsxDEV5(PropertyItem, {
|
|
807
669
|
member
|
|
808
670
|
}, member.name ?? index, false, undefined, this))
|
|
809
671
|
}, undefined, false, undefined, this)
|
|
@@ -811,14 +673,14 @@ function ClassPage({ export: exp, spec }) {
|
|
|
811
673
|
}, undefined, true, undefined, this)
|
|
812
674
|
]
|
|
813
675
|
}, undefined, true, undefined, this),
|
|
814
|
-
hasExamples && /* @__PURE__ */
|
|
676
|
+
hasExamples && /* @__PURE__ */ jsxDEV5("div", {
|
|
815
677
|
className: "lg:sticky lg:top-20 lg:self-start",
|
|
816
678
|
children: [
|
|
817
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ jsxDEV5("h3", {
|
|
818
680
|
className: "text-sm font-semibold uppercase tracking-wide text-fd-muted-foreground mb-4",
|
|
819
681
|
children: "Example"
|
|
820
682
|
}, undefined, false, undefined, this),
|
|
821
|
-
/* @__PURE__ */
|
|
683
|
+
/* @__PURE__ */ jsxDEV5(CodeExample, {
|
|
822
684
|
code: exp.examples[0],
|
|
823
685
|
filename: `${exp.name.toLowerCase()}.ts`
|
|
824
686
|
}, undefined, false, undefined, this)
|
|
@@ -826,16 +688,100 @@ function ClassPage({ export: exp, spec }) {
|
|
|
826
688
|
}, undefined, true, undefined, this)
|
|
827
689
|
]
|
|
828
690
|
}, undefined, true, undefined, this),
|
|
829
|
-
exp.docs && /* @__PURE__ */
|
|
691
|
+
exp.docs && /* @__PURE__ */ jsxDEV5(CoverageBadge, {
|
|
830
692
|
docs: exp.docs
|
|
831
693
|
}, undefined, false, undefined, this)
|
|
832
694
|
]
|
|
833
695
|
}, undefined, true, undefined, this);
|
|
834
696
|
}
|
|
835
697
|
|
|
698
|
+
// src/components/examples.tsx
|
|
699
|
+
import { useState as useState3 } from "react";
|
|
700
|
+
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
701
|
+
|
|
702
|
+
function CopyButton({ text }) {
|
|
703
|
+
const [copied, setCopied] = useState3(false);
|
|
704
|
+
const handleCopy = async () => {
|
|
705
|
+
await navigator.clipboard.writeText(text);
|
|
706
|
+
setCopied(true);
|
|
707
|
+
setTimeout(() => setCopied(false), 2000);
|
|
708
|
+
};
|
|
709
|
+
return /* @__PURE__ */ jsxDEV6("button", {
|
|
710
|
+
type: "button",
|
|
711
|
+
onClick: handleCopy,
|
|
712
|
+
className: "absolute top-2 right-2 p-1.5 rounded-md bg-fd-secondary hover:bg-fd-accent text-fd-muted-foreground hover:text-fd-foreground transition-colors opacity-0 group-hover:opacity-100",
|
|
713
|
+
"aria-label": "Copy code",
|
|
714
|
+
children: copied ? /* @__PURE__ */ jsxDEV6("svg", {
|
|
715
|
+
className: "w-4 h-4",
|
|
716
|
+
fill: "none",
|
|
717
|
+
stroke: "currentColor",
|
|
718
|
+
viewBox: "0 0 24 24",
|
|
719
|
+
children: /* @__PURE__ */ jsxDEV6("path", {
|
|
720
|
+
strokeLinecap: "round",
|
|
721
|
+
strokeLinejoin: "round",
|
|
722
|
+
strokeWidth: 2,
|
|
723
|
+
d: "M5 13l4 4L19 7"
|
|
724
|
+
}, undefined, false, undefined, this)
|
|
725
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV6("svg", {
|
|
726
|
+
className: "w-4 h-4",
|
|
727
|
+
fill: "none",
|
|
728
|
+
stroke: "currentColor",
|
|
729
|
+
viewBox: "0 0 24 24",
|
|
730
|
+
children: /* @__PURE__ */ jsxDEV6("path", {
|
|
731
|
+
strokeLinecap: "round",
|
|
732
|
+
strokeLinejoin: "round",
|
|
733
|
+
strokeWidth: 2,
|
|
734
|
+
d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"
|
|
735
|
+
}, undefined, false, undefined, this)
|
|
736
|
+
}, undefined, false, undefined, this)
|
|
737
|
+
}, undefined, false, undefined, this);
|
|
738
|
+
}
|
|
739
|
+
function ExamplesSection({ examples }) {
|
|
740
|
+
const [activeIndex, setActiveIndex] = useState3(0);
|
|
741
|
+
if (!examples?.length)
|
|
742
|
+
return null;
|
|
743
|
+
const showTabs = examples.length > 1;
|
|
744
|
+
return /* @__PURE__ */ jsxDEV6("div", {
|
|
745
|
+
className: "my-6",
|
|
746
|
+
children: [
|
|
747
|
+
/* @__PURE__ */ jsxDEV6("h3", {
|
|
748
|
+
className: "text-lg font-semibold mb-3",
|
|
749
|
+
children: "Examples"
|
|
750
|
+
}, undefined, false, undefined, this),
|
|
751
|
+
showTabs && /* @__PURE__ */ jsxDEV6("div", {
|
|
752
|
+
className: "flex gap-1 mb-2 border-b border-fd-border",
|
|
753
|
+
children: examples.map((_, index) => /* @__PURE__ */ jsxDEV6("button", {
|
|
754
|
+
type: "button",
|
|
755
|
+
onClick: () => setActiveIndex(index),
|
|
756
|
+
className: `px-3 py-1.5 text-sm font-medium transition-colors ${activeIndex === index ? "text-fd-primary border-b-2 border-fd-primary -mb-px" : "text-fd-muted-foreground hover:text-fd-foreground"}`,
|
|
757
|
+
children: [
|
|
758
|
+
"Example ",
|
|
759
|
+
index + 1
|
|
760
|
+
]
|
|
761
|
+
}, index, true, undefined, this))
|
|
762
|
+
}, undefined, false, undefined, this),
|
|
763
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
764
|
+
className: "group relative",
|
|
765
|
+
children: [
|
|
766
|
+
/* @__PURE__ */ jsxDEV6("pre", {
|
|
767
|
+
className: "overflow-x-auto rounded-lg border border-fd-border bg-fd-secondary p-4",
|
|
768
|
+
children: /* @__PURE__ */ jsxDEV6("code", {
|
|
769
|
+
className: "font-mono text-sm text-fd-foreground whitespace-pre",
|
|
770
|
+
children: examples[activeIndex]
|
|
771
|
+
}, undefined, false, undefined, this)
|
|
772
|
+
}, undefined, false, undefined, this),
|
|
773
|
+
/* @__PURE__ */ jsxDEV6(CopyButton, {
|
|
774
|
+
text: examples[activeIndex]
|
|
775
|
+
}, undefined, false, undefined, this)
|
|
776
|
+
]
|
|
777
|
+
}, undefined, true, undefined, this)
|
|
778
|
+
]
|
|
779
|
+
}, undefined, true, undefined, this);
|
|
780
|
+
}
|
|
781
|
+
|
|
836
782
|
// src/components/signature.tsx
|
|
837
783
|
import { ClientDocsKitCode as ClientDocsKitCode2 } from "@doccov/ui/docskit";
|
|
838
|
-
import { jsxDEV as
|
|
784
|
+
import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
|
|
839
785
|
|
|
840
786
|
function formatTypeParameters(typeParams) {
|
|
841
787
|
if (!typeParams?.length)
|
|
@@ -855,12 +801,12 @@ function formatParameters(sig) {
|
|
|
855
801
|
return "()";
|
|
856
802
|
const params = sig.parameters.map((p) => {
|
|
857
803
|
const optional = p.required === false ? "?" : "";
|
|
858
|
-
const type =
|
|
804
|
+
const type = formatSchema3(p.schema);
|
|
859
805
|
return `${p.name}${optional}: ${type}`;
|
|
860
806
|
});
|
|
861
807
|
return `(${params.join(", ")})`;
|
|
862
808
|
}
|
|
863
|
-
function
|
|
809
|
+
function formatSchema3(schema) {
|
|
864
810
|
if (!schema)
|
|
865
811
|
return "unknown";
|
|
866
812
|
if (typeof schema === "string")
|
|
@@ -882,7 +828,7 @@ function formatReturnType2(sig) {
|
|
|
882
828
|
return "void";
|
|
883
829
|
if (sig.returns.tsType)
|
|
884
830
|
return sig.returns.tsType;
|
|
885
|
-
return
|
|
831
|
+
return formatSchema3(sig.returns.schema);
|
|
886
832
|
}
|
|
887
833
|
function buildSignatureString(exp, sigIndex = 0) {
|
|
888
834
|
const sig = exp.signatures?.[sigIndex];
|
|
@@ -903,14 +849,14 @@ function buildSignatureString(exp, sigIndex = 0) {
|
|
|
903
849
|
return `interface ${exp.name}${typeParams}${ext}`;
|
|
904
850
|
}
|
|
905
851
|
case "type": {
|
|
906
|
-
const typeValue = typeof exp.type === "string" ? exp.type :
|
|
852
|
+
const typeValue = typeof exp.type === "string" ? exp.type : formatSchema3(exp.schema);
|
|
907
853
|
return `type ${exp.name}${typeParams} = ${typeValue}`;
|
|
908
854
|
}
|
|
909
855
|
case "enum": {
|
|
910
856
|
return `enum ${exp.name}`;
|
|
911
857
|
}
|
|
912
858
|
case "variable": {
|
|
913
|
-
const typeValue = typeof exp.type === "string" ? exp.type :
|
|
859
|
+
const typeValue = typeof exp.type === "string" ? exp.type : formatSchema3(exp.schema);
|
|
914
860
|
return `const ${exp.name}: ${typeValue}`;
|
|
915
861
|
}
|
|
916
862
|
default:
|
|
@@ -924,16 +870,16 @@ function Signature({ export: exp, signatureIndex = 0 }) {
|
|
|
924
870
|
lang: "typescript",
|
|
925
871
|
meta: "c"
|
|
926
872
|
};
|
|
927
|
-
return /* @__PURE__ */
|
|
873
|
+
return /* @__PURE__ */ jsxDEV7("div", {
|
|
928
874
|
className: "not-prose",
|
|
929
875
|
children: [
|
|
930
|
-
/* @__PURE__ */
|
|
876
|
+
/* @__PURE__ */ jsxDEV7(ClientDocsKitCode2, {
|
|
931
877
|
codeblock
|
|
932
878
|
}, undefined, false, undefined, this),
|
|
933
|
-
exp.deprecated && /* @__PURE__ */
|
|
879
|
+
exp.deprecated && /* @__PURE__ */ jsxDEV7("div", {
|
|
934
880
|
className: "mt-2 rounded-md bg-yellow-500/10 border border-yellow-500/20 px-3 py-2 text-sm text-yellow-600 dark:text-yellow-400",
|
|
935
881
|
children: [
|
|
936
|
-
/* @__PURE__ */
|
|
882
|
+
/* @__PURE__ */ jsxDEV7("strong", {
|
|
937
883
|
children: "Deprecated:"
|
|
938
884
|
}, undefined, false, undefined, this),
|
|
939
885
|
" This export is deprecated."
|
|
@@ -943,255 +889,409 @@ function Signature({ export: exp, signatureIndex = 0 }) {
|
|
|
943
889
|
}, undefined, true, undefined, this);
|
|
944
890
|
}
|
|
945
891
|
|
|
946
|
-
// src/components/
|
|
947
|
-
import { jsxDEV as
|
|
892
|
+
// src/components/enum-page.tsx
|
|
893
|
+
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
|
948
894
|
|
|
949
|
-
function
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
children: items.map((item, index) => {
|
|
999
|
-
const name = item.name ?? `arg${index}`;
|
|
1000
|
-
const type = formatSchema6(item.schema);
|
|
1001
|
-
const description = item.description ?? "";
|
|
1002
|
-
const required = isParameter(item) ? item.required : true;
|
|
1003
|
-
return /* @__PURE__ */ jsxDEV9("tr", {
|
|
1004
|
-
className: "border-b border-fd-border last:border-0",
|
|
1005
|
-
children: [
|
|
1006
|
-
/* @__PURE__ */ jsxDEV9("td", {
|
|
1007
|
-
className: "py-2 px-3 align-top",
|
|
1008
|
-
children: [
|
|
1009
|
-
/* @__PURE__ */ jsxDEV9("code", {
|
|
1010
|
-
className: "text-fd-primary font-mono text-xs bg-fd-secondary px-1.5 py-0.5 rounded",
|
|
1011
|
-
children: name
|
|
1012
|
-
}, undefined, false, undefined, this),
|
|
1013
|
-
showRequired && required && /* @__PURE__ */ jsxDEV9("span", {
|
|
1014
|
-
className: "ml-1 text-red-500 text-xs",
|
|
1015
|
-
children: "*"
|
|
1016
|
-
}, undefined, false, undefined, this),
|
|
1017
|
-
showRequired && !required && /* @__PURE__ */ jsxDEV9("span", {
|
|
1018
|
-
className: "ml-1 text-fd-muted-foreground text-xs",
|
|
1019
|
-
children: "?"
|
|
1020
|
-
}, undefined, false, undefined, this)
|
|
1021
|
-
]
|
|
1022
|
-
}, undefined, true, undefined, this),
|
|
1023
|
-
/* @__PURE__ */ jsxDEV9("td", {
|
|
1024
|
-
className: "py-2 px-3 align-top",
|
|
1025
|
-
children: /* @__PURE__ */ jsxDEV9("code", {
|
|
1026
|
-
className: "font-mono text-xs text-fd-muted-foreground",
|
|
1027
|
-
children: type
|
|
1028
|
-
}, undefined, false, undefined, this)
|
|
895
|
+
function EnumPage({ export: exp, spec }) {
|
|
896
|
+
const members = exp.members ?? [];
|
|
897
|
+
return /* @__PURE__ */ jsxDEV8("div", {
|
|
898
|
+
className: "space-y-6",
|
|
899
|
+
children: [
|
|
900
|
+
exp.description && /* @__PURE__ */ jsxDEV8("p", {
|
|
901
|
+
className: "text-fd-muted-foreground text-base leading-relaxed",
|
|
902
|
+
children: exp.description
|
|
903
|
+
}, undefined, false, undefined, this),
|
|
904
|
+
/* @__PURE__ */ jsxDEV8("section", {
|
|
905
|
+
children: [
|
|
906
|
+
/* @__PURE__ */ jsxDEV8("h2", {
|
|
907
|
+
className: "text-xl font-semibold mb-2",
|
|
908
|
+
children: "Declaration"
|
|
909
|
+
}, undefined, false, undefined, this),
|
|
910
|
+
/* @__PURE__ */ jsxDEV8(Signature, {
|
|
911
|
+
export: exp
|
|
912
|
+
}, undefined, false, undefined, this)
|
|
913
|
+
]
|
|
914
|
+
}, undefined, true, undefined, this),
|
|
915
|
+
members.length > 0 && /* @__PURE__ */ jsxDEV8("section", {
|
|
916
|
+
children: [
|
|
917
|
+
/* @__PURE__ */ jsxDEV8("h2", {
|
|
918
|
+
className: "text-xl font-semibold mb-2",
|
|
919
|
+
children: "Members"
|
|
920
|
+
}, undefined, false, undefined, this),
|
|
921
|
+
/* @__PURE__ */ jsxDEV8("div", {
|
|
922
|
+
className: "overflow-x-auto",
|
|
923
|
+
children: /* @__PURE__ */ jsxDEV8("table", {
|
|
924
|
+
className: "w-full text-sm border-collapse",
|
|
925
|
+
children: [
|
|
926
|
+
/* @__PURE__ */ jsxDEV8("thead", {
|
|
927
|
+
children: /* @__PURE__ */ jsxDEV8("tr", {
|
|
928
|
+
className: "border-b border-fd-border",
|
|
929
|
+
children: [
|
|
930
|
+
/* @__PURE__ */ jsxDEV8("th", {
|
|
931
|
+
className: "text-left py-2 px-3 font-medium text-fd-muted-foreground",
|
|
932
|
+
children: "Name"
|
|
933
|
+
}, undefined, false, undefined, this),
|
|
934
|
+
/* @__PURE__ */ jsxDEV8("th", {
|
|
935
|
+
className: "text-left py-2 px-3 font-medium text-fd-muted-foreground",
|
|
936
|
+
children: "Value"
|
|
937
|
+
}, undefined, false, undefined, this),
|
|
938
|
+
/* @__PURE__ */ jsxDEV8("th", {
|
|
939
|
+
className: "text-left py-2 px-3 font-medium text-fd-muted-foreground",
|
|
940
|
+
children: "Description"
|
|
941
|
+
}, undefined, false, undefined, this)
|
|
942
|
+
]
|
|
943
|
+
}, undefined, true, undefined, this)
|
|
1029
944
|
}, undefined, false, undefined, this),
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
|
|
1032
|
-
|
|
945
|
+
/* @__PURE__ */ jsxDEV8("tbody", {
|
|
946
|
+
children: members.map((member, index) => {
|
|
947
|
+
const value = member.schema !== undefined ? typeof member.schema === "object" && member.schema !== null ? member.schema.const ?? member.schema.default ?? "-" : member.schema : "-";
|
|
948
|
+
return /* @__PURE__ */ jsxDEV8("tr", {
|
|
949
|
+
className: "border-b border-fd-border last:border-0",
|
|
950
|
+
children: [
|
|
951
|
+
/* @__PURE__ */ jsxDEV8("td", {
|
|
952
|
+
className: "py-2 px-3 align-top",
|
|
953
|
+
children: /* @__PURE__ */ jsxDEV8("code", {
|
|
954
|
+
className: "text-fd-primary font-mono text-xs bg-fd-secondary px-1.5 py-0.5 rounded",
|
|
955
|
+
children: member.name
|
|
956
|
+
}, undefined, false, undefined, this)
|
|
957
|
+
}, undefined, false, undefined, this),
|
|
958
|
+
/* @__PURE__ */ jsxDEV8("td", {
|
|
959
|
+
className: "py-2 px-3 align-top",
|
|
960
|
+
children: /* @__PURE__ */ jsxDEV8("code", {
|
|
961
|
+
className: "font-mono text-xs text-fd-muted-foreground",
|
|
962
|
+
children: String(value)
|
|
963
|
+
}, undefined, false, undefined, this)
|
|
964
|
+
}, undefined, false, undefined, this),
|
|
965
|
+
/* @__PURE__ */ jsxDEV8("td", {
|
|
966
|
+
className: "py-2 px-3 align-top text-fd-muted-foreground",
|
|
967
|
+
children: member.description ?? ""
|
|
968
|
+
}, undefined, false, undefined, this)
|
|
969
|
+
]
|
|
970
|
+
}, member.name ?? index, true, undefined, this);
|
|
971
|
+
})
|
|
1033
972
|
}, undefined, false, undefined, this)
|
|
1034
973
|
]
|
|
1035
|
-
},
|
|
1036
|
-
})
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
974
|
+
}, undefined, true, undefined, this)
|
|
975
|
+
}, undefined, false, undefined, this)
|
|
976
|
+
]
|
|
977
|
+
}, undefined, true, undefined, this),
|
|
978
|
+
exp.examples && exp.examples.length > 0 && /* @__PURE__ */ jsxDEV8(ExamplesSection, {
|
|
979
|
+
examples: exp.examples
|
|
980
|
+
}, undefined, false, undefined, this),
|
|
981
|
+
exp.docs && /* @__PURE__ */ jsxDEV8(CoverageBadge, {
|
|
982
|
+
docs: exp.docs
|
|
983
|
+
}, undefined, false, undefined, this)
|
|
984
|
+
]
|
|
985
|
+
}, undefined, true, undefined, this);
|
|
1041
986
|
}
|
|
1042
987
|
|
|
1043
|
-
// src/components/
|
|
1044
|
-
import {
|
|
1045
|
-
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
|
988
|
+
// src/components/parameter-card.tsx
|
|
989
|
+
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
|
1046
990
|
|
|
1047
|
-
function
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
991
|
+
function formatSchema4(schema) {
|
|
992
|
+
if (!schema)
|
|
993
|
+
return "unknown";
|
|
994
|
+
if (typeof schema === "string")
|
|
995
|
+
return schema;
|
|
996
|
+
if (typeof schema === "object" && schema !== null) {
|
|
997
|
+
const s = schema;
|
|
998
|
+
if (s.$ref && typeof s.$ref === "string") {
|
|
999
|
+
return s.$ref.replace("#/types/", "");
|
|
1000
|
+
}
|
|
1001
|
+
if (s.tsType)
|
|
1002
|
+
return String(s.tsType);
|
|
1003
|
+
if (s.type)
|
|
1004
|
+
return String(s.type);
|
|
1005
|
+
}
|
|
1006
|
+
return "unknown";
|
|
1007
|
+
}
|
|
1008
|
+
function ParameterCard({ param, spec }) {
|
|
1009
|
+
const type = formatSchema4(param.schema);
|
|
1010
|
+
const isRequired = param.required !== false;
|
|
1011
|
+
return /* @__PURE__ */ jsxDEV9("div", {
|
|
1012
|
+
className: "rounded-lg border border-fd-border bg-fd-card/50 p-4",
|
|
1013
|
+
children: [
|
|
1014
|
+
/* @__PURE__ */ jsxDEV9("div", {
|
|
1015
|
+
className: "flex items-center gap-2 mb-1",
|
|
1016
|
+
children: [
|
|
1017
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
1018
|
+
className: "font-mono text-sm text-fd-foreground",
|
|
1019
|
+
children: param.name
|
|
1020
|
+
}, undefined, false, undefined, this),
|
|
1021
|
+
isRequired && /* @__PURE__ */ jsxDEV9("span", {
|
|
1022
|
+
className: "text-[10px] font-semibold px-1.5 py-0.5 rounded border border-fd-border bg-fd-muted text-fd-muted-foreground uppercase tracking-wide",
|
|
1023
|
+
children: "Required"
|
|
1024
|
+
}, undefined, false, undefined, this)
|
|
1025
|
+
]
|
|
1026
|
+
}, undefined, true, undefined, this),
|
|
1027
|
+
/* @__PURE__ */ jsxDEV9("div", {
|
|
1028
|
+
className: "text-sm text-fd-muted-foreground font-mono",
|
|
1029
|
+
children: type
|
|
1030
|
+
}, undefined, false, undefined, this),
|
|
1031
|
+
param.description && /* @__PURE__ */ jsxDEV9("p", {
|
|
1032
|
+
className: "text-sm text-fd-muted-foreground mt-2",
|
|
1033
|
+
children: param.description
|
|
1080
1034
|
}, undefined, false, undefined, this)
|
|
1081
|
-
|
|
1082
|
-
}, undefined,
|
|
1035
|
+
]
|
|
1036
|
+
}, undefined, true, undefined, this);
|
|
1083
1037
|
}
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1038
|
+
|
|
1039
|
+
// src/components/function-page.tsx
|
|
1040
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
|
1041
|
+
|
|
1042
|
+
function formatSchema5(schema) {
|
|
1043
|
+
if (!schema)
|
|
1044
|
+
return "unknown";
|
|
1045
|
+
if (typeof schema === "string")
|
|
1046
|
+
return schema;
|
|
1047
|
+
if (typeof schema === "object" && schema !== null) {
|
|
1048
|
+
const s = schema;
|
|
1049
|
+
if (s.$ref && typeof s.$ref === "string") {
|
|
1050
|
+
return s.$ref.replace("#/types/", "");
|
|
1051
|
+
}
|
|
1052
|
+
if (s.tsType)
|
|
1053
|
+
return String(s.tsType);
|
|
1054
|
+
if (s.type)
|
|
1055
|
+
return String(s.type);
|
|
1056
|
+
}
|
|
1057
|
+
return "unknown";
|
|
1058
|
+
}
|
|
1059
|
+
function FunctionPage({ export: exp, spec }) {
|
|
1060
|
+
const sig = exp.signatures?.[0];
|
|
1061
|
+
const hasExamples = exp.examples && exp.examples.length > 0;
|
|
1062
|
+
const hasParams = sig?.parameters && sig.parameters.length > 0;
|
|
1089
1063
|
return /* @__PURE__ */ jsxDEV10("div", {
|
|
1090
|
-
className: "
|
|
1064
|
+
className: "space-y-6 not-prose",
|
|
1091
1065
|
children: [
|
|
1092
|
-
/* @__PURE__ */ jsxDEV10("
|
|
1093
|
-
className: "text-
|
|
1094
|
-
children:
|
|
1095
|
-
}, undefined, false, undefined, this),
|
|
1096
|
-
showTabs && /* @__PURE__ */ jsxDEV10("div", {
|
|
1097
|
-
className: "flex gap-1 mb-2 border-b border-fd-border",
|
|
1098
|
-
children: examples.map((_, index) => /* @__PURE__ */ jsxDEV10("button", {
|
|
1099
|
-
type: "button",
|
|
1100
|
-
onClick: () => setActiveIndex(index),
|
|
1101
|
-
className: `px-3 py-1.5 text-sm font-medium transition-colors ${activeIndex === index ? "text-fd-primary border-b-2 border-fd-primary -mb-px" : "text-fd-muted-foreground hover:text-fd-foreground"}`,
|
|
1102
|
-
children: [
|
|
1103
|
-
"Example ",
|
|
1104
|
-
index + 1
|
|
1105
|
-
]
|
|
1106
|
-
}, index, true, undefined, this))
|
|
1066
|
+
exp.description && /* @__PURE__ */ jsxDEV10("p", {
|
|
1067
|
+
className: "text-fd-muted-foreground leading-relaxed",
|
|
1068
|
+
children: exp.description
|
|
1107
1069
|
}, undefined, false, undefined, this),
|
|
1070
|
+
sig?.returns && /* @__PURE__ */ jsxDEV10("p", {
|
|
1071
|
+
className: "text-fd-muted-foreground text-sm",
|
|
1072
|
+
children: [
|
|
1073
|
+
/* @__PURE__ */ jsxDEV10("span", {
|
|
1074
|
+
className: "font-medium text-fd-foreground",
|
|
1075
|
+
children: "Returns:"
|
|
1076
|
+
}, undefined, false, undefined, this),
|
|
1077
|
+
" ",
|
|
1078
|
+
sig.returns.description || `A ${sig.returns.tsType ?? formatSchema5(sig.returns.schema)}`
|
|
1079
|
+
]
|
|
1080
|
+
}, undefined, true, undefined, this),
|
|
1108
1081
|
/* @__PURE__ */ jsxDEV10("div", {
|
|
1109
|
-
className: "
|
|
1082
|
+
className: "not-prose",
|
|
1083
|
+
style: {
|
|
1084
|
+
display: hasExamples ? "grid" : "block",
|
|
1085
|
+
gridTemplateColumns: hasExamples ? "repeat(2, minmax(0, 1fr))" : undefined,
|
|
1086
|
+
gap: "2rem",
|
|
1087
|
+
alignItems: "start"
|
|
1088
|
+
},
|
|
1110
1089
|
children: [
|
|
1111
|
-
/* @__PURE__ */ jsxDEV10("
|
|
1112
|
-
className: "
|
|
1113
|
-
children: /* @__PURE__ */ jsxDEV10("
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1090
|
+
/* @__PURE__ */ jsxDEV10("div", {
|
|
1091
|
+
className: "space-y-6",
|
|
1092
|
+
children: hasParams && /* @__PURE__ */ jsxDEV10("div", {
|
|
1093
|
+
children: [
|
|
1094
|
+
/* @__PURE__ */ jsxDEV10("h3", {
|
|
1095
|
+
className: "text-sm font-semibold uppercase tracking-wide text-fd-muted-foreground mb-4",
|
|
1096
|
+
children: "Parameters"
|
|
1097
|
+
}, undefined, false, undefined, this),
|
|
1098
|
+
/* @__PURE__ */ jsxDEV10("div", {
|
|
1099
|
+
className: "space-y-3",
|
|
1100
|
+
children: sig.parameters.map((param, index) => /* @__PURE__ */ jsxDEV10(ParameterCard, {
|
|
1101
|
+
param,
|
|
1102
|
+
spec
|
|
1103
|
+
}, param.name ?? index, false, undefined, this))
|
|
1104
|
+
}, undefined, false, undefined, this)
|
|
1105
|
+
]
|
|
1106
|
+
}, undefined, true, undefined, this)
|
|
1117
1107
|
}, undefined, false, undefined, this),
|
|
1118
|
-
/* @__PURE__ */ jsxDEV10(
|
|
1119
|
-
|
|
1120
|
-
|
|
1108
|
+
hasExamples && /* @__PURE__ */ jsxDEV10("div", {
|
|
1109
|
+
style: { position: "sticky", top: "5rem" },
|
|
1110
|
+
children: [
|
|
1111
|
+
/* @__PURE__ */ jsxDEV10("h3", {
|
|
1112
|
+
className: "text-sm font-semibold uppercase tracking-wide text-fd-muted-foreground mb-4",
|
|
1113
|
+
children: "Example"
|
|
1114
|
+
}, undefined, false, undefined, this),
|
|
1115
|
+
/* @__PURE__ */ jsxDEV10(CodeExample, {
|
|
1116
|
+
code: exp.examples[0],
|
|
1117
|
+
filename: `${exp.name.toLowerCase().replace(/[^a-z0-9]/g, "-")}.ts`
|
|
1118
|
+
}, undefined, false, undefined, this)
|
|
1119
|
+
]
|
|
1120
|
+
}, undefined, true, undefined, this)
|
|
1121
1121
|
]
|
|
1122
|
-
}, undefined, true, undefined, this)
|
|
1122
|
+
}, undefined, true, undefined, this),
|
|
1123
|
+
exp.docs && /* @__PURE__ */ jsxDEV10(CoverageBadge, {
|
|
1124
|
+
docs: exp.docs
|
|
1125
|
+
}, undefined, false, undefined, this)
|
|
1123
1126
|
]
|
|
1124
1127
|
}, undefined, true, undefined, this);
|
|
1125
1128
|
}
|
|
1126
1129
|
|
|
1127
|
-
// src/components/
|
|
1130
|
+
// src/components/type-table.tsx
|
|
1128
1131
|
import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
|
|
1129
1132
|
|
|
1133
|
+
function formatSchema6(schema) {
|
|
1134
|
+
if (!schema)
|
|
1135
|
+
return "unknown";
|
|
1136
|
+
if (typeof schema === "string")
|
|
1137
|
+
return schema;
|
|
1138
|
+
if (typeof schema === "object" && schema !== null) {
|
|
1139
|
+
const s = schema;
|
|
1140
|
+
if (s.$ref && typeof s.$ref === "string") {
|
|
1141
|
+
const refName = s.$ref.replace("#/types/", "");
|
|
1142
|
+
return refName;
|
|
1143
|
+
}
|
|
1144
|
+
if (s.type)
|
|
1145
|
+
return String(s.type);
|
|
1146
|
+
if (s.tsType)
|
|
1147
|
+
return String(s.tsType);
|
|
1148
|
+
}
|
|
1149
|
+
return "unknown";
|
|
1150
|
+
}
|
|
1151
|
+
function isParameter(item) {
|
|
1152
|
+
return "required" in item;
|
|
1153
|
+
}
|
|
1154
|
+
function TypeTable({ items, showRequired = true }) {
|
|
1155
|
+
if (!items?.length)
|
|
1156
|
+
return null;
|
|
1157
|
+
return /* @__PURE__ */ jsxDEV11("div", {
|
|
1158
|
+
className: "my-4 overflow-x-auto",
|
|
1159
|
+
children: /* @__PURE__ */ jsxDEV11("table", {
|
|
1160
|
+
className: "w-full text-sm border-collapse",
|
|
1161
|
+
children: [
|
|
1162
|
+
/* @__PURE__ */ jsxDEV11("thead", {
|
|
1163
|
+
children: /* @__PURE__ */ jsxDEV11("tr", {
|
|
1164
|
+
className: "border-b border-fd-border",
|
|
1165
|
+
children: [
|
|
1166
|
+
/* @__PURE__ */ jsxDEV11("th", {
|
|
1167
|
+
className: "text-left py-2 px-3 font-medium text-fd-muted-foreground",
|
|
1168
|
+
children: "Name"
|
|
1169
|
+
}, undefined, false, undefined, this),
|
|
1170
|
+
/* @__PURE__ */ jsxDEV11("th", {
|
|
1171
|
+
className: "text-left py-2 px-3 font-medium text-fd-muted-foreground",
|
|
1172
|
+
children: "Type"
|
|
1173
|
+
}, undefined, false, undefined, this),
|
|
1174
|
+
/* @__PURE__ */ jsxDEV11("th", {
|
|
1175
|
+
className: "text-left py-2 px-3 font-medium text-fd-muted-foreground",
|
|
1176
|
+
children: "Description"
|
|
1177
|
+
}, undefined, false, undefined, this)
|
|
1178
|
+
]
|
|
1179
|
+
}, undefined, true, undefined, this)
|
|
1180
|
+
}, undefined, false, undefined, this),
|
|
1181
|
+
/* @__PURE__ */ jsxDEV11("tbody", {
|
|
1182
|
+
children: items.map((item, index) => {
|
|
1183
|
+
const name = item.name ?? `arg${index}`;
|
|
1184
|
+
const type = formatSchema6(item.schema);
|
|
1185
|
+
const description = item.description ?? "";
|
|
1186
|
+
const required = isParameter(item) ? item.required : true;
|
|
1187
|
+
return /* @__PURE__ */ jsxDEV11("tr", {
|
|
1188
|
+
className: "border-b border-fd-border last:border-0",
|
|
1189
|
+
children: [
|
|
1190
|
+
/* @__PURE__ */ jsxDEV11("td", {
|
|
1191
|
+
className: "py-2 px-3 align-top",
|
|
1192
|
+
children: [
|
|
1193
|
+
/* @__PURE__ */ jsxDEV11("code", {
|
|
1194
|
+
className: "text-fd-primary font-mono text-xs bg-fd-secondary px-1.5 py-0.5 rounded",
|
|
1195
|
+
children: name
|
|
1196
|
+
}, undefined, false, undefined, this),
|
|
1197
|
+
showRequired && required && /* @__PURE__ */ jsxDEV11("span", {
|
|
1198
|
+
className: "ml-1 text-red-500 text-xs",
|
|
1199
|
+
children: "*"
|
|
1200
|
+
}, undefined, false, undefined, this),
|
|
1201
|
+
showRequired && !required && /* @__PURE__ */ jsxDEV11("span", {
|
|
1202
|
+
className: "ml-1 text-fd-muted-foreground text-xs",
|
|
1203
|
+
children: "?"
|
|
1204
|
+
}, undefined, false, undefined, this)
|
|
1205
|
+
]
|
|
1206
|
+
}, undefined, true, undefined, this),
|
|
1207
|
+
/* @__PURE__ */ jsxDEV11("td", {
|
|
1208
|
+
className: "py-2 px-3 align-top",
|
|
1209
|
+
children: /* @__PURE__ */ jsxDEV11("code", {
|
|
1210
|
+
className: "font-mono text-xs text-fd-muted-foreground",
|
|
1211
|
+
children: type
|
|
1212
|
+
}, undefined, false, undefined, this)
|
|
1213
|
+
}, undefined, false, undefined, this),
|
|
1214
|
+
/* @__PURE__ */ jsxDEV11("td", {
|
|
1215
|
+
className: "py-2 px-3 align-top text-fd-muted-foreground",
|
|
1216
|
+
children: description
|
|
1217
|
+
}, undefined, false, undefined, this)
|
|
1218
|
+
]
|
|
1219
|
+
}, name, true, undefined, this);
|
|
1220
|
+
})
|
|
1221
|
+
}, undefined, false, undefined, this)
|
|
1222
|
+
]
|
|
1223
|
+
}, undefined, true, undefined, this)
|
|
1224
|
+
}, undefined, false, undefined, this);
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
// src/components/interface-page.tsx
|
|
1228
|
+
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
|
1229
|
+
|
|
1130
1230
|
function InterfacePage({ export: exp, spec }) {
|
|
1131
1231
|
const properties = exp.members?.filter((m) => m.kind === "property" || m.kind === "field" || !m.kind);
|
|
1132
1232
|
const methods = exp.members?.filter((m) => m.kind === "method" || m.kind === "function");
|
|
1133
|
-
return /* @__PURE__ */
|
|
1233
|
+
return /* @__PURE__ */ jsxDEV12("div", {
|
|
1134
1234
|
className: "space-y-6",
|
|
1135
1235
|
children: [
|
|
1136
|
-
exp.description && /* @__PURE__ */
|
|
1236
|
+
exp.description && /* @__PURE__ */ jsxDEV12("p", {
|
|
1137
1237
|
className: "text-fd-muted-foreground text-base leading-relaxed",
|
|
1138
1238
|
children: exp.description
|
|
1139
1239
|
}, undefined, false, undefined, this),
|
|
1140
|
-
/* @__PURE__ */
|
|
1240
|
+
/* @__PURE__ */ jsxDEV12("section", {
|
|
1141
1241
|
children: [
|
|
1142
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ jsxDEV12("h2", {
|
|
1143
1243
|
className: "text-xl font-semibold mb-2",
|
|
1144
1244
|
children: "Declaration"
|
|
1145
1245
|
}, undefined, false, undefined, this),
|
|
1146
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ jsxDEV12(Signature, {
|
|
1147
1247
|
export: exp
|
|
1148
1248
|
}, undefined, false, undefined, this)
|
|
1149
1249
|
]
|
|
1150
1250
|
}, undefined, true, undefined, this),
|
|
1151
|
-
exp.extends && /* @__PURE__ */
|
|
1251
|
+
exp.extends && /* @__PURE__ */ jsxDEV12("section", {
|
|
1152
1252
|
children: [
|
|
1153
|
-
/* @__PURE__ */
|
|
1253
|
+
/* @__PURE__ */ jsxDEV12("h2", {
|
|
1154
1254
|
className: "text-xl font-semibold mb-2",
|
|
1155
1255
|
children: "Extends"
|
|
1156
1256
|
}, undefined, false, undefined, this),
|
|
1157
|
-
/* @__PURE__ */
|
|
1257
|
+
/* @__PURE__ */ jsxDEV12("div", {
|
|
1158
1258
|
className: "rounded-lg border border-fd-border bg-fd-card p-4",
|
|
1159
|
-
children: /* @__PURE__ */
|
|
1259
|
+
children: /* @__PURE__ */ jsxDEV12("code", {
|
|
1160
1260
|
className: "font-mono text-sm text-fd-primary",
|
|
1161
1261
|
children: exp.extends
|
|
1162
1262
|
}, undefined, false, undefined, this)
|
|
1163
1263
|
}, undefined, false, undefined, this)
|
|
1164
1264
|
]
|
|
1165
1265
|
}, undefined, true, undefined, this),
|
|
1166
|
-
properties && properties.length > 0 && /* @__PURE__ */
|
|
1266
|
+
properties && properties.length > 0 && /* @__PURE__ */ jsxDEV12("section", {
|
|
1167
1267
|
children: [
|
|
1168
|
-
/* @__PURE__ */
|
|
1268
|
+
/* @__PURE__ */ jsxDEV12("h2", {
|
|
1169
1269
|
className: "text-xl font-semibold mb-2",
|
|
1170
1270
|
children: "Properties"
|
|
1171
1271
|
}, undefined, false, undefined, this),
|
|
1172
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ jsxDEV12(TypeTable, {
|
|
1173
1273
|
items: properties,
|
|
1174
1274
|
spec,
|
|
1175
1275
|
showRequired: true
|
|
1176
1276
|
}, undefined, false, undefined, this)
|
|
1177
1277
|
]
|
|
1178
1278
|
}, undefined, true, undefined, this),
|
|
1179
|
-
methods && methods.length > 0 && /* @__PURE__ */
|
|
1279
|
+
methods && methods.length > 0 && /* @__PURE__ */ jsxDEV12("section", {
|
|
1180
1280
|
children: [
|
|
1181
|
-
/* @__PURE__ */
|
|
1281
|
+
/* @__PURE__ */ jsxDEV12("h2", {
|
|
1182
1282
|
className: "text-xl font-semibold mb-2",
|
|
1183
1283
|
children: "Methods"
|
|
1184
1284
|
}, undefined, false, undefined, this),
|
|
1185
|
-
/* @__PURE__ */
|
|
1285
|
+
/* @__PURE__ */ jsxDEV12("div", {
|
|
1186
1286
|
className: "space-y-4",
|
|
1187
1287
|
children: methods.map((method, index) => {
|
|
1188
1288
|
const sig = method.signatures?.[0];
|
|
1189
1289
|
const params = sig?.parameters ?? [];
|
|
1190
1290
|
const returnType = sig?.returns?.tsType ?? "void";
|
|
1191
|
-
return /* @__PURE__ */
|
|
1291
|
+
return /* @__PURE__ */ jsxDEV12("div", {
|
|
1192
1292
|
className: "rounded-lg border border-fd-border p-4",
|
|
1193
1293
|
children: [
|
|
1194
|
-
/* @__PURE__ */
|
|
1294
|
+
/* @__PURE__ */ jsxDEV12("code", {
|
|
1195
1295
|
className: "font-mono text-sm text-fd-primary",
|
|
1196
1296
|
children: [
|
|
1197
1297
|
method.name,
|
|
@@ -1205,7 +1305,7 @@ function InterfacePage({ export: exp, spec }) {
|
|
|
1205
1305
|
returnType
|
|
1206
1306
|
]
|
|
1207
1307
|
}, undefined, true, undefined, this),
|
|
1208
|
-
method.description && /* @__PURE__ */
|
|
1308
|
+
method.description && /* @__PURE__ */ jsxDEV12("p", {
|
|
1209
1309
|
className: "text-sm text-fd-muted-foreground mt-2",
|
|
1210
1310
|
children: method.description
|
|
1211
1311
|
}, undefined, false, undefined, this)
|
|
@@ -1215,102 +1315,6 @@ function InterfacePage({ export: exp, spec }) {
|
|
|
1215
1315
|
}, undefined, false, undefined, this)
|
|
1216
1316
|
]
|
|
1217
1317
|
}, undefined, true, undefined, this),
|
|
1218
|
-
exp.examples && exp.examples.length > 0 && /* @__PURE__ */ jsxDEV11(ExamplesSection, {
|
|
1219
|
-
examples: exp.examples
|
|
1220
|
-
}, undefined, false, undefined, this),
|
|
1221
|
-
exp.docs && /* @__PURE__ */ jsxDEV11(CoverageBadge, {
|
|
1222
|
-
docs: exp.docs
|
|
1223
|
-
}, undefined, false, undefined, this)
|
|
1224
|
-
]
|
|
1225
|
-
}, undefined, true, undefined, this);
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
// src/components/enum-page.tsx
|
|
1229
|
-
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
|
1230
|
-
|
|
1231
|
-
function EnumPage({ export: exp, spec }) {
|
|
1232
|
-
const members = exp.members ?? [];
|
|
1233
|
-
return /* @__PURE__ */ jsxDEV12("div", {
|
|
1234
|
-
className: "space-y-6",
|
|
1235
|
-
children: [
|
|
1236
|
-
exp.description && /* @__PURE__ */ jsxDEV12("p", {
|
|
1237
|
-
className: "text-fd-muted-foreground text-base leading-relaxed",
|
|
1238
|
-
children: exp.description
|
|
1239
|
-
}, undefined, false, undefined, this),
|
|
1240
|
-
/* @__PURE__ */ jsxDEV12("section", {
|
|
1241
|
-
children: [
|
|
1242
|
-
/* @__PURE__ */ jsxDEV12("h2", {
|
|
1243
|
-
className: "text-xl font-semibold mb-2",
|
|
1244
|
-
children: "Declaration"
|
|
1245
|
-
}, undefined, false, undefined, this),
|
|
1246
|
-
/* @__PURE__ */ jsxDEV12(Signature, {
|
|
1247
|
-
export: exp
|
|
1248
|
-
}, undefined, false, undefined, this)
|
|
1249
|
-
]
|
|
1250
|
-
}, undefined, true, undefined, this),
|
|
1251
|
-
members.length > 0 && /* @__PURE__ */ jsxDEV12("section", {
|
|
1252
|
-
children: [
|
|
1253
|
-
/* @__PURE__ */ jsxDEV12("h2", {
|
|
1254
|
-
className: "text-xl font-semibold mb-2",
|
|
1255
|
-
children: "Members"
|
|
1256
|
-
}, undefined, false, undefined, this),
|
|
1257
|
-
/* @__PURE__ */ jsxDEV12("div", {
|
|
1258
|
-
className: "overflow-x-auto",
|
|
1259
|
-
children: /* @__PURE__ */ jsxDEV12("table", {
|
|
1260
|
-
className: "w-full text-sm border-collapse",
|
|
1261
|
-
children: [
|
|
1262
|
-
/* @__PURE__ */ jsxDEV12("thead", {
|
|
1263
|
-
children: /* @__PURE__ */ jsxDEV12("tr", {
|
|
1264
|
-
className: "border-b border-fd-border",
|
|
1265
|
-
children: [
|
|
1266
|
-
/* @__PURE__ */ jsxDEV12("th", {
|
|
1267
|
-
className: "text-left py-2 px-3 font-medium text-fd-muted-foreground",
|
|
1268
|
-
children: "Name"
|
|
1269
|
-
}, undefined, false, undefined, this),
|
|
1270
|
-
/* @__PURE__ */ jsxDEV12("th", {
|
|
1271
|
-
className: "text-left py-2 px-3 font-medium text-fd-muted-foreground",
|
|
1272
|
-
children: "Value"
|
|
1273
|
-
}, undefined, false, undefined, this),
|
|
1274
|
-
/* @__PURE__ */ jsxDEV12("th", {
|
|
1275
|
-
className: "text-left py-2 px-3 font-medium text-fd-muted-foreground",
|
|
1276
|
-
children: "Description"
|
|
1277
|
-
}, undefined, false, undefined, this)
|
|
1278
|
-
]
|
|
1279
|
-
}, undefined, true, undefined, this)
|
|
1280
|
-
}, undefined, false, undefined, this),
|
|
1281
|
-
/* @__PURE__ */ jsxDEV12("tbody", {
|
|
1282
|
-
children: members.map((member, index) => {
|
|
1283
|
-
const value = member.schema !== undefined ? typeof member.schema === "object" && member.schema !== null ? member.schema.const ?? member.schema.default ?? "-" : member.schema : "-";
|
|
1284
|
-
return /* @__PURE__ */ jsxDEV12("tr", {
|
|
1285
|
-
className: "border-b border-fd-border last:border-0",
|
|
1286
|
-
children: [
|
|
1287
|
-
/* @__PURE__ */ jsxDEV12("td", {
|
|
1288
|
-
className: "py-2 px-3 align-top",
|
|
1289
|
-
children: /* @__PURE__ */ jsxDEV12("code", {
|
|
1290
|
-
className: "text-fd-primary font-mono text-xs bg-fd-secondary px-1.5 py-0.5 rounded",
|
|
1291
|
-
children: member.name
|
|
1292
|
-
}, undefined, false, undefined, this)
|
|
1293
|
-
}, undefined, false, undefined, this),
|
|
1294
|
-
/* @__PURE__ */ jsxDEV12("td", {
|
|
1295
|
-
className: "py-2 px-3 align-top",
|
|
1296
|
-
children: /* @__PURE__ */ jsxDEV12("code", {
|
|
1297
|
-
className: "font-mono text-xs text-fd-muted-foreground",
|
|
1298
|
-
children: String(value)
|
|
1299
|
-
}, undefined, false, undefined, this)
|
|
1300
|
-
}, undefined, false, undefined, this),
|
|
1301
|
-
/* @__PURE__ */ jsxDEV12("td", {
|
|
1302
|
-
className: "py-2 px-3 align-top text-fd-muted-foreground",
|
|
1303
|
-
children: member.description ?? ""
|
|
1304
|
-
}, undefined, false, undefined, this)
|
|
1305
|
-
]
|
|
1306
|
-
}, member.name ?? index, true, undefined, this);
|
|
1307
|
-
})
|
|
1308
|
-
}, undefined, false, undefined, this)
|
|
1309
|
-
]
|
|
1310
|
-
}, undefined, true, undefined, this)
|
|
1311
|
-
}, undefined, false, undefined, this)
|
|
1312
|
-
]
|
|
1313
|
-
}, undefined, true, undefined, this),
|
|
1314
1318
|
exp.examples && exp.examples.length > 0 && /* @__PURE__ */ jsxDEV12(ExamplesSection, {
|
|
1315
1319
|
examples: exp.examples
|
|
1316
1320
|
}, undefined, false, undefined, this),
|
|
@@ -1473,11 +1477,6 @@ function APIPage({ spec, instance, id }) {
|
|
|
1473
1477
|
return /* @__PURE__ */ jsxDEV14(EnumPage, {
|
|
1474
1478
|
...pageProps
|
|
1475
1479
|
}, undefined, false, undefined, this);
|
|
1476
|
-
case "variable":
|
|
1477
|
-
case "namespace":
|
|
1478
|
-
case "module":
|
|
1479
|
-
case "reference":
|
|
1480
|
-
case "external":
|
|
1481
1480
|
default:
|
|
1482
1481
|
return /* @__PURE__ */ jsxDEV14(VariablePage, {
|
|
1483
1482
|
...pageProps
|
|
@@ -1485,4 +1484,4 @@ function APIPage({ spec, instance, id }) {
|
|
|
1485
1484
|
}
|
|
1486
1485
|
}
|
|
1487
1486
|
|
|
1488
|
-
export {
|
|
1487
|
+
export { CodeExample, NestedProperty, ExpandableProperty, CollapsibleMethod, CoverageBadge, ClassPage, ExamplesSection, Signature, EnumPage, ParameterCard, FunctionPage, TypeTable, InterfacePage, VariablePage, APIPage };
|