@openpkg-ts/doc-generator 0.1.0 → 0.1.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/dist/cli.js +3 -5
- package/dist/index.js +14 -16
- package/dist/react-styled.js +922 -175
- package/dist/react.js +769 -18
- package/dist/shared/{chunk-7hg53zpt.js → server-83s9r625.js} +174 -14
- package/package.json +2 -2
- package/dist/shared/chunk-e5fkh3kh.js +0 -679
- package/dist/shared/chunk-taeg9090.js +0 -171
|
@@ -1,679 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
buildSignatureString,
|
|
4
|
-
formatSchema
|
|
5
|
-
} from "./chunk-taeg9090.js";
|
|
6
|
-
|
|
7
|
-
// src/components/headless/CollapsibleMethod.tsx
|
|
8
|
-
import { useEffect, useState } from "react";
|
|
9
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
10
|
-
|
|
11
|
-
function formatReturnType(returns) {
|
|
12
|
-
if (!returns)
|
|
13
|
-
return "void";
|
|
14
|
-
return formatSchema(returns.schema);
|
|
15
|
-
}
|
|
16
|
-
function formatParamPreview(params) {
|
|
17
|
-
if (!params || params.length === 0)
|
|
18
|
-
return "";
|
|
19
|
-
if (params.length === 1)
|
|
20
|
-
return params[0].name || "arg";
|
|
21
|
-
return `${params[0].name || "arg"}, ...`;
|
|
22
|
-
}
|
|
23
|
-
function CollapsibleMethod({
|
|
24
|
-
member,
|
|
25
|
-
defaultExpanded = false,
|
|
26
|
-
className,
|
|
27
|
-
renderHeader,
|
|
28
|
-
renderContent
|
|
29
|
-
}) {
|
|
30
|
-
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
31
|
-
const sig = member.signatures?.[0];
|
|
32
|
-
const hasParams = sig?.parameters && sig.parameters.length > 0;
|
|
33
|
-
const visibility = member.visibility ?? "public";
|
|
34
|
-
const flags = member.flags;
|
|
35
|
-
const isStatic = flags?.static;
|
|
36
|
-
const isAsync = flags?.async;
|
|
37
|
-
const returnType = formatReturnType(sig?.returns);
|
|
38
|
-
const paramPreview = formatParamPreview(sig?.parameters);
|
|
39
|
-
const toggle = () => setExpanded(!expanded);
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
if (typeof window !== "undefined" && window.location.hash === `#${member.name}`) {
|
|
42
|
-
setExpanded(true);
|
|
43
|
-
}
|
|
44
|
-
}, [member.name]);
|
|
45
|
-
const badges = [];
|
|
46
|
-
if (visibility !== "public")
|
|
47
|
-
badges.push(visibility);
|
|
48
|
-
if (isStatic)
|
|
49
|
-
badges.push("static");
|
|
50
|
-
if (isAsync)
|
|
51
|
-
badges.push("async");
|
|
52
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
53
|
-
id: member.name,
|
|
54
|
-
className,
|
|
55
|
-
"data-expanded": expanded,
|
|
56
|
-
children: [
|
|
57
|
-
renderHeader ? renderHeader(member, expanded, toggle) : /* @__PURE__ */ jsxDEV("button", {
|
|
58
|
-
type: "button",
|
|
59
|
-
onClick: toggle,
|
|
60
|
-
"data-header": true,
|
|
61
|
-
children: [
|
|
62
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
63
|
-
"data-name": true,
|
|
64
|
-
children: [
|
|
65
|
-
member.name,
|
|
66
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
67
|
-
"data-params": true,
|
|
68
|
-
children: [
|
|
69
|
-
"(",
|
|
70
|
-
paramPreview,
|
|
71
|
-
")"
|
|
72
|
-
]
|
|
73
|
-
}, undefined, true, undefined, this)
|
|
74
|
-
]
|
|
75
|
-
}, undefined, true, undefined, this),
|
|
76
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
77
|
-
"data-return": true,
|
|
78
|
-
children: returnType
|
|
79
|
-
}, undefined, false, undefined, this),
|
|
80
|
-
badges.length > 0 && /* @__PURE__ */ jsxDEV("span", {
|
|
81
|
-
"data-badges": true,
|
|
82
|
-
children: badges.map((badge) => /* @__PURE__ */ jsxDEV("span", {
|
|
83
|
-
"data-badge": badge,
|
|
84
|
-
children: badge
|
|
85
|
-
}, badge, false, undefined, this))
|
|
86
|
-
}, undefined, false, undefined, this)
|
|
87
|
-
]
|
|
88
|
-
}, undefined, true, undefined, this),
|
|
89
|
-
expanded && (renderContent ? renderContent(member) : /* @__PURE__ */ jsxDEV("div", {
|
|
90
|
-
"data-content": true,
|
|
91
|
-
children: [
|
|
92
|
-
member.description && /* @__PURE__ */ jsxDEV("p", {
|
|
93
|
-
children: member.description
|
|
94
|
-
}, undefined, false, undefined, this),
|
|
95
|
-
hasParams && /* @__PURE__ */ jsxDEV("div", {
|
|
96
|
-
"data-params-section": true,
|
|
97
|
-
children: [
|
|
98
|
-
/* @__PURE__ */ jsxDEV("h4", {
|
|
99
|
-
children: "Parameters"
|
|
100
|
-
}, undefined, false, undefined, this),
|
|
101
|
-
/* @__PURE__ */ jsxDEV("ul", {
|
|
102
|
-
children: sig.parameters.map((param, index) => /* @__PURE__ */ jsxDEV("li", {
|
|
103
|
-
children: [
|
|
104
|
-
/* @__PURE__ */ jsxDEV("code", {
|
|
105
|
-
children: [
|
|
106
|
-
param.name,
|
|
107
|
-
param.required === false && "?",
|
|
108
|
-
": ",
|
|
109
|
-
formatSchema(param.schema)
|
|
110
|
-
]
|
|
111
|
-
}, undefined, true, undefined, this),
|
|
112
|
-
param.description && /* @__PURE__ */ jsxDEV("span", {
|
|
113
|
-
children: param.description
|
|
114
|
-
}, undefined, false, undefined, this)
|
|
115
|
-
]
|
|
116
|
-
}, param.name ?? index, true, undefined, this))
|
|
117
|
-
}, undefined, false, undefined, this)
|
|
118
|
-
]
|
|
119
|
-
}, undefined, true, undefined, this),
|
|
120
|
-
sig?.returns && returnType !== "void" && /* @__PURE__ */ jsxDEV("div", {
|
|
121
|
-
"data-returns-section": true,
|
|
122
|
-
children: [
|
|
123
|
-
/* @__PURE__ */ jsxDEV("h4", {
|
|
124
|
-
children: "Returns"
|
|
125
|
-
}, undefined, false, undefined, this),
|
|
126
|
-
/* @__PURE__ */ jsxDEV("code", {
|
|
127
|
-
children: returnType
|
|
128
|
-
}, undefined, false, undefined, this),
|
|
129
|
-
sig.returns.description && /* @__PURE__ */ jsxDEV("p", {
|
|
130
|
-
children: sig.returns.description
|
|
131
|
-
}, undefined, false, undefined, this)
|
|
132
|
-
]
|
|
133
|
-
}, undefined, true, undefined, this)
|
|
134
|
-
]
|
|
135
|
-
}, undefined, true, undefined, this))
|
|
136
|
-
]
|
|
137
|
-
}, undefined, true, undefined, this);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// src/components/headless/ExampleBlock.tsx
|
|
141
|
-
import { useState as useState2 } from "react";
|
|
142
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
143
|
-
|
|
144
|
-
function getExampleCode(example) {
|
|
145
|
-
if (typeof example === "string")
|
|
146
|
-
return example;
|
|
147
|
-
return example.code;
|
|
148
|
-
}
|
|
149
|
-
function getExampleTitle(example) {
|
|
150
|
-
if (typeof example === "string")
|
|
151
|
-
return;
|
|
152
|
-
return example.title;
|
|
153
|
-
}
|
|
154
|
-
function getExampleLanguage(example) {
|
|
155
|
-
if (typeof example === "string")
|
|
156
|
-
return "typescript";
|
|
157
|
-
return example.language ?? "typescript";
|
|
158
|
-
}
|
|
159
|
-
function cleanCode(code) {
|
|
160
|
-
let cleaned = code.trim();
|
|
161
|
-
if (cleaned.startsWith("```")) {
|
|
162
|
-
const lines = cleaned.split(`
|
|
163
|
-
`);
|
|
164
|
-
lines.shift();
|
|
165
|
-
if (lines[lines.length - 1] === "```") {
|
|
166
|
-
lines.pop();
|
|
167
|
-
}
|
|
168
|
-
cleaned = lines.join(`
|
|
169
|
-
`);
|
|
170
|
-
}
|
|
171
|
-
return cleaned;
|
|
172
|
-
}
|
|
173
|
-
function ExampleBlock({
|
|
174
|
-
examples,
|
|
175
|
-
className,
|
|
176
|
-
renderExample
|
|
177
|
-
}) {
|
|
178
|
-
const [activeIndex, setActiveIndex] = useState2(0);
|
|
179
|
-
if (!examples?.length)
|
|
180
|
-
return null;
|
|
181
|
-
const showTabs = examples.length > 1;
|
|
182
|
-
const currentExample = examples[activeIndex];
|
|
183
|
-
const code = cleanCode(getExampleCode(currentExample));
|
|
184
|
-
if (renderExample) {
|
|
185
|
-
return /* @__PURE__ */ jsxDEV2("div", {
|
|
186
|
-
className,
|
|
187
|
-
children: [
|
|
188
|
-
showTabs && /* @__PURE__ */ jsxDEV2("div", {
|
|
189
|
-
"data-tabs": true,
|
|
190
|
-
children: examples.map((example, index) => /* @__PURE__ */ jsxDEV2("button", {
|
|
191
|
-
type: "button",
|
|
192
|
-
onClick: () => setActiveIndex(index),
|
|
193
|
-
"data-active": activeIndex === index,
|
|
194
|
-
children: getExampleTitle(example) ?? `Example ${index + 1}`
|
|
195
|
-
}, index, false, undefined, this))
|
|
196
|
-
}, undefined, false, undefined, this),
|
|
197
|
-
renderExample(currentExample, activeIndex)
|
|
198
|
-
]
|
|
199
|
-
}, undefined, true, undefined, this);
|
|
200
|
-
}
|
|
201
|
-
return /* @__PURE__ */ jsxDEV2("div", {
|
|
202
|
-
className,
|
|
203
|
-
children: [
|
|
204
|
-
showTabs && /* @__PURE__ */ jsxDEV2("div", {
|
|
205
|
-
"data-tabs": true,
|
|
206
|
-
children: examples.map((example, index) => /* @__PURE__ */ jsxDEV2("button", {
|
|
207
|
-
type: "button",
|
|
208
|
-
onClick: () => setActiveIndex(index),
|
|
209
|
-
"data-active": activeIndex === index,
|
|
210
|
-
children: getExampleTitle(example) ?? `Example ${index + 1}`
|
|
211
|
-
}, index, false, undefined, this))
|
|
212
|
-
}, undefined, false, undefined, this),
|
|
213
|
-
/* @__PURE__ */ jsxDEV2("pre", {
|
|
214
|
-
children: /* @__PURE__ */ jsxDEV2("code", {
|
|
215
|
-
"data-language": getExampleLanguage(currentExample),
|
|
216
|
-
children: code
|
|
217
|
-
}, undefined, false, undefined, this)
|
|
218
|
-
}, undefined, false, undefined, this)
|
|
219
|
-
]
|
|
220
|
-
}, undefined, true, undefined, this);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// src/components/headless/ExpandableProperty.tsx
|
|
224
|
-
import { useState as useState3 } from "react";
|
|
225
|
-
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
226
|
-
|
|
227
|
-
function getNestedProperties(schema) {
|
|
228
|
-
if (!schema || typeof schema !== "object")
|
|
229
|
-
return null;
|
|
230
|
-
const s = schema;
|
|
231
|
-
if (s.type === "object" && s.properties && typeof s.properties === "object") {
|
|
232
|
-
return s.properties;
|
|
233
|
-
}
|
|
234
|
-
return null;
|
|
235
|
-
}
|
|
236
|
-
function getRequiredFields(schema) {
|
|
237
|
-
if (!schema || typeof schema !== "object")
|
|
238
|
-
return [];
|
|
239
|
-
const s = schema;
|
|
240
|
-
if (Array.isArray(s.required)) {
|
|
241
|
-
return s.required;
|
|
242
|
-
}
|
|
243
|
-
return [];
|
|
244
|
-
}
|
|
245
|
-
function countProperties(schema) {
|
|
246
|
-
const props = getNestedProperties(schema);
|
|
247
|
-
return props ? Object.keys(props).length : 0;
|
|
248
|
-
}
|
|
249
|
-
function NestedProperty({
|
|
250
|
-
name,
|
|
251
|
-
schema,
|
|
252
|
-
required = false,
|
|
253
|
-
depth = 0
|
|
254
|
-
}) {
|
|
255
|
-
const [expanded, setExpanded] = useState3(false);
|
|
256
|
-
const type = formatSchema(schema);
|
|
257
|
-
const nestedProps = getNestedProperties(schema);
|
|
258
|
-
const nestedCount = countProperties(schema);
|
|
259
|
-
const hasNested = nestedCount > 0;
|
|
260
|
-
const schemaObj = schema;
|
|
261
|
-
const description = schemaObj?.description;
|
|
262
|
-
return /* @__PURE__ */ jsxDEV3("div", {
|
|
263
|
-
"data-property": name,
|
|
264
|
-
"data-depth": depth,
|
|
265
|
-
children: [
|
|
266
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
267
|
-
"data-row": true,
|
|
268
|
-
children: [
|
|
269
|
-
/* @__PURE__ */ jsxDEV3("span", {
|
|
270
|
-
"data-name": true,
|
|
271
|
-
children: [
|
|
272
|
-
name,
|
|
273
|
-
!required && "?",
|
|
274
|
-
":"
|
|
275
|
-
]
|
|
276
|
-
}, undefined, true, undefined, this),
|
|
277
|
-
/* @__PURE__ */ jsxDEV3("span", {
|
|
278
|
-
"data-type": true,
|
|
279
|
-
children: hasNested ? "object" : type
|
|
280
|
-
}, undefined, false, undefined, this),
|
|
281
|
-
description && /* @__PURE__ */ jsxDEV3("span", {
|
|
282
|
-
"data-description": true,
|
|
283
|
-
children: description
|
|
284
|
-
}, undefined, false, undefined, this),
|
|
285
|
-
hasNested && /* @__PURE__ */ jsxDEV3("button", {
|
|
286
|
-
type: "button",
|
|
287
|
-
onClick: () => setExpanded(!expanded),
|
|
288
|
-
"data-expand": true,
|
|
289
|
-
children: [
|
|
290
|
-
nestedCount,
|
|
291
|
-
" properties"
|
|
292
|
-
]
|
|
293
|
-
}, undefined, true, undefined, this)
|
|
294
|
-
]
|
|
295
|
-
}, undefined, true, undefined, this),
|
|
296
|
-
hasNested && expanded && nestedProps && /* @__PURE__ */ jsxDEV3("div", {
|
|
297
|
-
"data-nested": true,
|
|
298
|
-
children: Object.entries(nestedProps).map(([propName, propSchema]) => /* @__PURE__ */ jsxDEV3(NestedProperty, {
|
|
299
|
-
name: propName,
|
|
300
|
-
schema: propSchema,
|
|
301
|
-
required: getRequiredFields(schema).includes(propName),
|
|
302
|
-
depth: depth + 1
|
|
303
|
-
}, propName, false, undefined, this))
|
|
304
|
-
}, undefined, false, undefined, this)
|
|
305
|
-
]
|
|
306
|
-
}, undefined, true, undefined, this);
|
|
307
|
-
}
|
|
308
|
-
function ExpandableProperty({
|
|
309
|
-
param,
|
|
310
|
-
depth = 0,
|
|
311
|
-
className
|
|
312
|
-
}) {
|
|
313
|
-
const [expanded, setExpanded] = useState3(false);
|
|
314
|
-
const type = formatSchema(param.schema);
|
|
315
|
-
const isOptional = param.required === false;
|
|
316
|
-
const nestedProps = getNestedProperties(param.schema);
|
|
317
|
-
const nestedCount = countProperties(param.schema);
|
|
318
|
-
const hasNested = nestedCount > 0;
|
|
319
|
-
return /* @__PURE__ */ jsxDEV3("div", {
|
|
320
|
-
className,
|
|
321
|
-
"data-param": param.name,
|
|
322
|
-
"data-depth": depth,
|
|
323
|
-
children: [
|
|
324
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
325
|
-
"data-row": true,
|
|
326
|
-
children: [
|
|
327
|
-
/* @__PURE__ */ jsxDEV3("span", {
|
|
328
|
-
"data-name": true,
|
|
329
|
-
children: [
|
|
330
|
-
param.name,
|
|
331
|
-
isOptional && "?",
|
|
332
|
-
":"
|
|
333
|
-
]
|
|
334
|
-
}, undefined, true, undefined, this),
|
|
335
|
-
/* @__PURE__ */ jsxDEV3("span", {
|
|
336
|
-
"data-type": true,
|
|
337
|
-
children: hasNested ? "object" : type
|
|
338
|
-
}, undefined, false, undefined, this),
|
|
339
|
-
param.description && /* @__PURE__ */ jsxDEV3("span", {
|
|
340
|
-
"data-description": true,
|
|
341
|
-
children: param.description
|
|
342
|
-
}, undefined, false, undefined, this),
|
|
343
|
-
hasNested && /* @__PURE__ */ jsxDEV3("button", {
|
|
344
|
-
type: "button",
|
|
345
|
-
onClick: () => setExpanded(!expanded),
|
|
346
|
-
"data-expand": true,
|
|
347
|
-
children: [
|
|
348
|
-
nestedCount,
|
|
349
|
-
" properties"
|
|
350
|
-
]
|
|
351
|
-
}, undefined, true, undefined, this)
|
|
352
|
-
]
|
|
353
|
-
}, undefined, true, undefined, this),
|
|
354
|
-
hasNested && expanded && nestedProps && /* @__PURE__ */ jsxDEV3("div", {
|
|
355
|
-
"data-nested": true,
|
|
356
|
-
children: Object.entries(nestedProps).map(([propName, propSchema]) => /* @__PURE__ */ jsxDEV3(NestedProperty, {
|
|
357
|
-
name: propName,
|
|
358
|
-
schema: propSchema,
|
|
359
|
-
required: getRequiredFields(param.schema).includes(propName),
|
|
360
|
-
depth: depth + 1
|
|
361
|
-
}, propName, false, undefined, this))
|
|
362
|
-
}, undefined, false, undefined, this)
|
|
363
|
-
]
|
|
364
|
-
}, undefined, true, undefined, this);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
// src/components/headless/MembersTable.tsx
|
|
368
|
-
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
369
|
-
|
|
370
|
-
function groupMembersByKind(members) {
|
|
371
|
-
const groups = {
|
|
372
|
-
constructors: [],
|
|
373
|
-
properties: [],
|
|
374
|
-
methods: [],
|
|
375
|
-
accessors: [],
|
|
376
|
-
other: []
|
|
377
|
-
};
|
|
378
|
-
for (const member of members) {
|
|
379
|
-
const kind = member.kind?.toLowerCase() ?? "other";
|
|
380
|
-
if (kind === "constructor") {
|
|
381
|
-
groups.constructors.push(member);
|
|
382
|
-
} else if (kind === "property" || kind === "field") {
|
|
383
|
-
groups.properties.push(member);
|
|
384
|
-
} else if (kind === "method" || kind === "function") {
|
|
385
|
-
groups.methods.push(member);
|
|
386
|
-
} else if (kind === "getter" || kind === "setter" || kind === "accessor") {
|
|
387
|
-
groups.accessors.push(member);
|
|
388
|
-
} else {
|
|
389
|
-
groups.other.push(member);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
return groups;
|
|
393
|
-
}
|
|
394
|
-
function MemberRow({ member }) {
|
|
395
|
-
const visibility = member.visibility ?? "public";
|
|
396
|
-
const flags = member.flags;
|
|
397
|
-
const isStatic = flags?.static;
|
|
398
|
-
const isAbstract = flags?.abstract;
|
|
399
|
-
const isReadonly = flags?.readonly;
|
|
400
|
-
const type = formatSchema(member.schema);
|
|
401
|
-
const sig = member.signatures?.[0];
|
|
402
|
-
let signature = "";
|
|
403
|
-
if (sig) {
|
|
404
|
-
const params = sig.parameters?.map((p) => {
|
|
405
|
-
const optional = p.required === false ? "?" : "";
|
|
406
|
-
return `${p.name}${optional}: ${formatSchema(p.schema)}`;
|
|
407
|
-
}) ?? [];
|
|
408
|
-
const returnType = formatSchema(sig.returns?.schema) ?? "void";
|
|
409
|
-
signature = `(${params.join(", ")}): ${returnType}`;
|
|
410
|
-
}
|
|
411
|
-
const badges = [];
|
|
412
|
-
if (visibility !== "public")
|
|
413
|
-
badges.push(visibility);
|
|
414
|
-
if (isStatic)
|
|
415
|
-
badges.push("static");
|
|
416
|
-
if (isAbstract)
|
|
417
|
-
badges.push("abstract");
|
|
418
|
-
if (isReadonly)
|
|
419
|
-
badges.push("readonly");
|
|
420
|
-
return /* @__PURE__ */ jsxDEV4("div", {
|
|
421
|
-
"data-member": member.name,
|
|
422
|
-
children: [
|
|
423
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
424
|
-
children: [
|
|
425
|
-
/* @__PURE__ */ jsxDEV4("code", {
|
|
426
|
-
children: [
|
|
427
|
-
member.name,
|
|
428
|
-
signature
|
|
429
|
-
]
|
|
430
|
-
}, undefined, true, undefined, this),
|
|
431
|
-
badges.length > 0 && /* @__PURE__ */ jsxDEV4("span", {
|
|
432
|
-
children: badges.map((badge) => /* @__PURE__ */ jsxDEV4("span", {
|
|
433
|
-
"data-badge": badge,
|
|
434
|
-
children: badge
|
|
435
|
-
}, badge, false, undefined, this))
|
|
436
|
-
}, undefined, false, undefined, this)
|
|
437
|
-
]
|
|
438
|
-
}, undefined, true, undefined, this),
|
|
439
|
-
!signature && type !== "unknown" && /* @__PURE__ */ jsxDEV4("code", {
|
|
440
|
-
children: type
|
|
441
|
-
}, undefined, false, undefined, this),
|
|
442
|
-
member.description && /* @__PURE__ */ jsxDEV4("p", {
|
|
443
|
-
children: member.description
|
|
444
|
-
}, undefined, false, undefined, this)
|
|
445
|
-
]
|
|
446
|
-
}, undefined, true, undefined, this);
|
|
447
|
-
}
|
|
448
|
-
function MembersTable({
|
|
449
|
-
members,
|
|
450
|
-
className,
|
|
451
|
-
groupByKind = false,
|
|
452
|
-
renderMember
|
|
453
|
-
}) {
|
|
454
|
-
if (!members?.length)
|
|
455
|
-
return null;
|
|
456
|
-
if (!groupByKind) {
|
|
457
|
-
return /* @__PURE__ */ jsxDEV4("div", {
|
|
458
|
-
className,
|
|
459
|
-
children: members.map((member, index) => renderMember ? renderMember(member, index) : /* @__PURE__ */ jsxDEV4(MemberRow, {
|
|
460
|
-
member
|
|
461
|
-
}, member.name ?? index, false, undefined, this))
|
|
462
|
-
}, undefined, false, undefined, this);
|
|
463
|
-
}
|
|
464
|
-
const groups = groupMembersByKind(members);
|
|
465
|
-
return /* @__PURE__ */ jsxDEV4("div", {
|
|
466
|
-
className,
|
|
467
|
-
children: [
|
|
468
|
-
groups.constructors.length > 0 && /* @__PURE__ */ jsxDEV4("section", {
|
|
469
|
-
"data-group": "constructors",
|
|
470
|
-
children: [
|
|
471
|
-
/* @__PURE__ */ jsxDEV4("h4", {
|
|
472
|
-
children: "Constructor"
|
|
473
|
-
}, undefined, false, undefined, this),
|
|
474
|
-
groups.constructors.map((member, index) => renderMember ? renderMember(member, index) : /* @__PURE__ */ jsxDEV4(MemberRow, {
|
|
475
|
-
member
|
|
476
|
-
}, member.name ?? index, false, undefined, this))
|
|
477
|
-
]
|
|
478
|
-
}, undefined, true, undefined, this),
|
|
479
|
-
groups.properties.length > 0 && /* @__PURE__ */ jsxDEV4("section", {
|
|
480
|
-
"data-group": "properties",
|
|
481
|
-
children: [
|
|
482
|
-
/* @__PURE__ */ jsxDEV4("h4", {
|
|
483
|
-
children: "Properties"
|
|
484
|
-
}, undefined, false, undefined, this),
|
|
485
|
-
groups.properties.map((member, index) => renderMember ? renderMember(member, index) : /* @__PURE__ */ jsxDEV4(MemberRow, {
|
|
486
|
-
member
|
|
487
|
-
}, member.name ?? index, false, undefined, this))
|
|
488
|
-
]
|
|
489
|
-
}, undefined, true, undefined, this),
|
|
490
|
-
groups.methods.length > 0 && /* @__PURE__ */ jsxDEV4("section", {
|
|
491
|
-
"data-group": "methods",
|
|
492
|
-
children: [
|
|
493
|
-
/* @__PURE__ */ jsxDEV4("h4", {
|
|
494
|
-
children: "Methods"
|
|
495
|
-
}, undefined, false, undefined, this),
|
|
496
|
-
groups.methods.map((member, index) => renderMember ? renderMember(member, index) : /* @__PURE__ */ jsxDEV4(MemberRow, {
|
|
497
|
-
member
|
|
498
|
-
}, member.name ?? index, false, undefined, this))
|
|
499
|
-
]
|
|
500
|
-
}, undefined, true, undefined, this),
|
|
501
|
-
groups.accessors.length > 0 && /* @__PURE__ */ jsxDEV4("section", {
|
|
502
|
-
"data-group": "accessors",
|
|
503
|
-
children: [
|
|
504
|
-
/* @__PURE__ */ jsxDEV4("h4", {
|
|
505
|
-
children: "Accessors"
|
|
506
|
-
}, undefined, false, undefined, this),
|
|
507
|
-
groups.accessors.map((member, index) => renderMember ? renderMember(member, index) : /* @__PURE__ */ jsxDEV4(MemberRow, {
|
|
508
|
-
member
|
|
509
|
-
}, member.name ?? index, false, undefined, this))
|
|
510
|
-
]
|
|
511
|
-
}, undefined, true, undefined, this)
|
|
512
|
-
]
|
|
513
|
-
}, undefined, true, undefined, this);
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
// src/components/headless/ParamTable.tsx
|
|
517
|
-
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
518
|
-
|
|
519
|
-
function isParameter(item) {
|
|
520
|
-
return "required" in item;
|
|
521
|
-
}
|
|
522
|
-
function ParamRow({ item, showRequired = true }) {
|
|
523
|
-
const name = item.name ?? "arg";
|
|
524
|
-
const type = formatSchema(item.schema);
|
|
525
|
-
const description = item.description ?? "";
|
|
526
|
-
const required = isParameter(item) ? item.required : true;
|
|
527
|
-
return /* @__PURE__ */ jsxDEV5("tr", {
|
|
528
|
-
children: [
|
|
529
|
-
/* @__PURE__ */ jsxDEV5("td", {
|
|
530
|
-
children: [
|
|
531
|
-
/* @__PURE__ */ jsxDEV5("code", {
|
|
532
|
-
children: name
|
|
533
|
-
}, undefined, false, undefined, this),
|
|
534
|
-
showRequired && required && /* @__PURE__ */ jsxDEV5("span", {
|
|
535
|
-
children: "*"
|
|
536
|
-
}, undefined, false, undefined, this),
|
|
537
|
-
showRequired && !required && /* @__PURE__ */ jsxDEV5("span", {
|
|
538
|
-
children: "?"
|
|
539
|
-
}, undefined, false, undefined, this)
|
|
540
|
-
]
|
|
541
|
-
}, undefined, true, undefined, this),
|
|
542
|
-
/* @__PURE__ */ jsxDEV5("td", {
|
|
543
|
-
children: /* @__PURE__ */ jsxDEV5("code", {
|
|
544
|
-
children: type
|
|
545
|
-
}, undefined, false, undefined, this)
|
|
546
|
-
}, undefined, false, undefined, this),
|
|
547
|
-
/* @__PURE__ */ jsxDEV5("td", {
|
|
548
|
-
children: description
|
|
549
|
-
}, undefined, false, undefined, this)
|
|
550
|
-
]
|
|
551
|
-
}, undefined, true, undefined, this);
|
|
552
|
-
}
|
|
553
|
-
function ParamTable({
|
|
554
|
-
items,
|
|
555
|
-
showRequired = true,
|
|
556
|
-
className,
|
|
557
|
-
renderRow
|
|
558
|
-
}) {
|
|
559
|
-
if (!items?.length)
|
|
560
|
-
return null;
|
|
561
|
-
return /* @__PURE__ */ jsxDEV5("table", {
|
|
562
|
-
className,
|
|
563
|
-
children: [
|
|
564
|
-
/* @__PURE__ */ jsxDEV5("thead", {
|
|
565
|
-
children: /* @__PURE__ */ jsxDEV5("tr", {
|
|
566
|
-
children: [
|
|
567
|
-
/* @__PURE__ */ jsxDEV5("th", {
|
|
568
|
-
children: "Name"
|
|
569
|
-
}, undefined, false, undefined, this),
|
|
570
|
-
/* @__PURE__ */ jsxDEV5("th", {
|
|
571
|
-
children: "Type"
|
|
572
|
-
}, undefined, false, undefined, this),
|
|
573
|
-
/* @__PURE__ */ jsxDEV5("th", {
|
|
574
|
-
children: "Description"
|
|
575
|
-
}, undefined, false, undefined, this)
|
|
576
|
-
]
|
|
577
|
-
}, undefined, true, undefined, this)
|
|
578
|
-
}, undefined, false, undefined, this),
|
|
579
|
-
/* @__PURE__ */ jsxDEV5("tbody", {
|
|
580
|
-
children: items.map((item, index) => renderRow ? renderRow(item, index) : /* @__PURE__ */ jsxDEV5(ParamRow, {
|
|
581
|
-
item,
|
|
582
|
-
showRequired
|
|
583
|
-
}, item.name ?? index, false, undefined, this))
|
|
584
|
-
}, undefined, false, undefined, this)
|
|
585
|
-
]
|
|
586
|
-
}, undefined, true, undefined, this);
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
// src/components/headless/Signature.tsx
|
|
590
|
-
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
591
|
-
|
|
592
|
-
function Signature({
|
|
593
|
-
export: exp,
|
|
594
|
-
signatureIndex = 0,
|
|
595
|
-
className,
|
|
596
|
-
children
|
|
597
|
-
}) {
|
|
598
|
-
const signature = buildSignatureString(exp, signatureIndex);
|
|
599
|
-
if (children) {
|
|
600
|
-
return children(signature);
|
|
601
|
-
}
|
|
602
|
-
return /* @__PURE__ */ jsxDEV6("code", {
|
|
603
|
-
className,
|
|
604
|
-
children: signature
|
|
605
|
-
}, undefined, false, undefined, this);
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
// src/components/headless/TypeTable.tsx
|
|
609
|
-
import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
|
|
610
|
-
|
|
611
|
-
function isParameter2(item) {
|
|
612
|
-
return "required" in item;
|
|
613
|
-
}
|
|
614
|
-
function TypeTable({
|
|
615
|
-
items,
|
|
616
|
-
showRequired = true,
|
|
617
|
-
className,
|
|
618
|
-
renderRow
|
|
619
|
-
}) {
|
|
620
|
-
if (!items?.length)
|
|
621
|
-
return null;
|
|
622
|
-
return /* @__PURE__ */ jsxDEV7("table", {
|
|
623
|
-
className,
|
|
624
|
-
children: [
|
|
625
|
-
/* @__PURE__ */ jsxDEV7("thead", {
|
|
626
|
-
children: /* @__PURE__ */ jsxDEV7("tr", {
|
|
627
|
-
children: [
|
|
628
|
-
/* @__PURE__ */ jsxDEV7("th", {
|
|
629
|
-
children: "Name"
|
|
630
|
-
}, undefined, false, undefined, this),
|
|
631
|
-
/* @__PURE__ */ jsxDEV7("th", {
|
|
632
|
-
children: "Type"
|
|
633
|
-
}, undefined, false, undefined, this),
|
|
634
|
-
/* @__PURE__ */ jsxDEV7("th", {
|
|
635
|
-
children: "Description"
|
|
636
|
-
}, undefined, false, undefined, this)
|
|
637
|
-
]
|
|
638
|
-
}, undefined, true, undefined, this)
|
|
639
|
-
}, undefined, false, undefined, this),
|
|
640
|
-
/* @__PURE__ */ jsxDEV7("tbody", {
|
|
641
|
-
children: items.map((item, index) => {
|
|
642
|
-
if (renderRow) {
|
|
643
|
-
return renderRow(item, index);
|
|
644
|
-
}
|
|
645
|
-
const name = item.name ?? `arg${index}`;
|
|
646
|
-
const type = formatSchema(item.schema);
|
|
647
|
-
const description = item.description ?? "";
|
|
648
|
-
const required = isParameter2(item) ? item.required : true;
|
|
649
|
-
return /* @__PURE__ */ jsxDEV7("tr", {
|
|
650
|
-
children: [
|
|
651
|
-
/* @__PURE__ */ jsxDEV7("td", {
|
|
652
|
-
children: [
|
|
653
|
-
/* @__PURE__ */ jsxDEV7("code", {
|
|
654
|
-
children: name
|
|
655
|
-
}, undefined, false, undefined, this),
|
|
656
|
-
showRequired && required && /* @__PURE__ */ jsxDEV7("span", {
|
|
657
|
-
children: "*"
|
|
658
|
-
}, undefined, false, undefined, this),
|
|
659
|
-
showRequired && !required && /* @__PURE__ */ jsxDEV7("span", {
|
|
660
|
-
children: "?"
|
|
661
|
-
}, undefined, false, undefined, this)
|
|
662
|
-
]
|
|
663
|
-
}, undefined, true, undefined, this),
|
|
664
|
-
/* @__PURE__ */ jsxDEV7("td", {
|
|
665
|
-
children: /* @__PURE__ */ jsxDEV7("code", {
|
|
666
|
-
children: type
|
|
667
|
-
}, undefined, false, undefined, this)
|
|
668
|
-
}, undefined, false, undefined, this),
|
|
669
|
-
/* @__PURE__ */ jsxDEV7("td", {
|
|
670
|
-
children: description
|
|
671
|
-
}, undefined, false, undefined, this)
|
|
672
|
-
]
|
|
673
|
-
}, name, true, undefined, this);
|
|
674
|
-
})
|
|
675
|
-
}, undefined, false, undefined, this)
|
|
676
|
-
]
|
|
677
|
-
}, undefined, true, undefined, this);
|
|
678
|
-
}
|
|
679
|
-
export { CollapsibleMethod, getExampleCode, getExampleTitle, getExampleLanguage, cleanCode, ExampleBlock, NestedProperty, ExpandableProperty, groupMembersByKind, MemberRow, MembersTable, ParamRow, ParamTable, Signature, TypeTable };
|