fumadocs-openapi 5.11.3 → 5.11.5
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/index.d.ts +6 -1
- package/dist/server/index.d.ts +5 -1
- package/dist/server/index.js +60 -44
- package/dist/ui/client-client-B0hpK9b7.js +359 -0
- package/dist/ui/{fetcher-DLRl_kVF.js → fetcher-CsyGTBlt.js} +1 -1
- package/dist/ui/{index-client-cz-xNo9A.js → index-client-D_ZwIB_V.js} +97 -3
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.js +2 -2
- package/dist/ui/server-select-client-prQnF0hV.js +101 -0
- package/package.json +9 -9
- package/dist/ui/client-client-Co3JBILS.js +0 -538
package/dist/ui/index.d.ts
CHANGED
|
@@ -82,6 +82,10 @@ interface RenderContext {
|
|
|
82
82
|
*/
|
|
83
83
|
generateCodeSamples?: (endpoint: EndpointSample) => Awaitable<CodeSample[]>;
|
|
84
84
|
shikiOptions?: Omit<CodeToHastOptionsCommon, 'lang'> & CodeOptionsThemes<BuiltinTheme>;
|
|
85
|
+
/**
|
|
86
|
+
* Show full response schema instead of only example response & Typescript definitions
|
|
87
|
+
*/
|
|
88
|
+
showResponseSchema?: boolean;
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
interface BaseRequestField {
|
package/dist/ui/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import { cn } from 'fumadocs-ui/components/api';
|
|
|
3
3
|
import { Fragment } from 'react';
|
|
4
4
|
import { Accordions, Accordion } from 'fumadocs-ui/components/accordion';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
|
-
import {
|
|
7
|
-
export { A as APIPlayground, R as Root, u as useSchemaContext } from './client-client-
|
|
6
|
+
import { h as CopyRouteButton, i as ServerSelect } from './client-client-B0hpK9b7.js';
|
|
7
|
+
export { A as APIPlayground, R as Root, u as useSchemaContext } from './client-client-B0hpK9b7.js';
|
|
8
8
|
|
|
9
9
|
const badgeVariants = cva('rounded-xl border px-1.5 py-1 text-xs font-medium leading-[12px]', {
|
|
10
10
|
variants: {
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { e as useApiContext, f as useServerSelectContext, C as ChevronDown } from './client-client-B0hpK9b7.js';
|
|
4
|
+
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from 'fumadocs-ui/components/ui/collapsible';
|
|
5
|
+
import { S as Select, a as SelectTrigger, b as SelectValue, c as SelectContent, d as SelectItem, I as Input } from './index-client-D_ZwIB_V.js';
|
|
6
|
+
|
|
7
|
+
function ServerSelect() {
|
|
8
|
+
const { servers } = useApiContext();
|
|
9
|
+
const { server, setServer, setServerVariables } = useServerSelectContext();
|
|
10
|
+
if (servers.length <= 1) return null;
|
|
11
|
+
const schema = server ? servers.find((item)=>item.url === server.url) : undefined;
|
|
12
|
+
return /*#__PURE__*/ jsxs(Collapsible, {
|
|
13
|
+
className: "-m-2 mt-2",
|
|
14
|
+
children: [
|
|
15
|
+
/*#__PURE__*/ jsxs(CollapsibleTrigger, {
|
|
16
|
+
className: "flex w-full flex-row items-center justify-between p-2 text-xs font-medium text-fd-muted-foreground",
|
|
17
|
+
children: [
|
|
18
|
+
"Configure Server",
|
|
19
|
+
/*#__PURE__*/ jsx(ChevronDown, {
|
|
20
|
+
className: "size-4"
|
|
21
|
+
})
|
|
22
|
+
]
|
|
23
|
+
}),
|
|
24
|
+
/*#__PURE__*/ jsx(CollapsibleContent, {
|
|
25
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
26
|
+
className: "flex flex-col gap-4 p-2",
|
|
27
|
+
children: [
|
|
28
|
+
/*#__PURE__*/ jsxs(Select, {
|
|
29
|
+
value: server?.url,
|
|
30
|
+
onValueChange: setServer,
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ jsx(SelectTrigger, {
|
|
33
|
+
className: "h-auto break-all",
|
|
34
|
+
children: /*#__PURE__*/ jsx(SelectValue, {})
|
|
35
|
+
}),
|
|
36
|
+
/*#__PURE__*/ jsx(SelectContent, {
|
|
37
|
+
children: servers.map((item)=>/*#__PURE__*/ jsxs(SelectItem, {
|
|
38
|
+
value: item.url,
|
|
39
|
+
children: [
|
|
40
|
+
item.url,
|
|
41
|
+
/*#__PURE__*/ jsx("p", {
|
|
42
|
+
className: "text-start text-xs text-fd-muted-foreground",
|
|
43
|
+
children: item.description
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
}, item.url))
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
}),
|
|
50
|
+
Object.entries(schema?.variables ?? {}).map(([key, variable])=>{
|
|
51
|
+
if (!server) return;
|
|
52
|
+
const id = `fd_server_select_${key}`;
|
|
53
|
+
return /*#__PURE__*/ jsxs("fieldset", {
|
|
54
|
+
className: "flex flex-col gap-1",
|
|
55
|
+
children: [
|
|
56
|
+
/*#__PURE__*/ jsx("label", {
|
|
57
|
+
className: "font-mono text-xs text-fd-foreground",
|
|
58
|
+
htmlFor: id,
|
|
59
|
+
children: key
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ jsx("p", {
|
|
62
|
+
className: "text-xs text-fd-muted-foreground empty:hidden",
|
|
63
|
+
children: variable.description
|
|
64
|
+
}),
|
|
65
|
+
variable.enum ? /*#__PURE__*/ jsxs(Select, {
|
|
66
|
+
value: server.variables[key],
|
|
67
|
+
onValueChange: (v)=>setServerVariables({
|
|
68
|
+
...server?.variables,
|
|
69
|
+
[key]: v
|
|
70
|
+
}),
|
|
71
|
+
children: [
|
|
72
|
+
/*#__PURE__*/ jsx(SelectTrigger, {
|
|
73
|
+
id: id,
|
|
74
|
+
children: /*#__PURE__*/ jsx(SelectValue, {})
|
|
75
|
+
}),
|
|
76
|
+
/*#__PURE__*/ jsx(SelectContent, {
|
|
77
|
+
children: variable.enum.map((value)=>/*#__PURE__*/ jsx(SelectItem, {
|
|
78
|
+
value: value,
|
|
79
|
+
children: value
|
|
80
|
+
}, value))
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
}) : /*#__PURE__*/ jsx(Input, {
|
|
84
|
+
id: id,
|
|
85
|
+
value: server.variables[key],
|
|
86
|
+
onChange: (e)=>setServerVariables({
|
|
87
|
+
...server?.variables,
|
|
88
|
+
[key]: e.target.value
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
}, key);
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { ServerSelect as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "5.11.
|
|
3
|
+
"version": "5.11.5",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@fumari/json-schema-to-typescript": "^1.1.2",
|
|
35
35
|
"@radix-ui/react-select": "^2.1.4",
|
|
36
36
|
"@radix-ui/react-slot": "^1.1.1",
|
|
37
|
-
"@scalar/openapi-parser": "0.10.
|
|
37
|
+
"@scalar/openapi-parser": "0.10.3",
|
|
38
38
|
"ajv-draft-04": "^1.0.0",
|
|
39
39
|
"class-variance-authority": "^0.7.1",
|
|
40
40
|
"fast-glob": "^3.3.3",
|
|
@@ -45,18 +45,18 @@
|
|
|
45
45
|
"react-hook-form": "^7.54.2",
|
|
46
46
|
"remark": "^15.0.1",
|
|
47
47
|
"remark-rehype": "^11.1.1",
|
|
48
|
-
"shiki": "^1.
|
|
48
|
+
"shiki": "^1.27.0",
|
|
49
49
|
"xml-js": "^1.6.11",
|
|
50
|
-
"fumadocs-core": "14.7.
|
|
51
|
-
"fumadocs-ui": "14.7.
|
|
50
|
+
"fumadocs-core": "14.7.4",
|
|
51
|
+
"fumadocs-ui": "14.7.4"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/js-yaml": "^4.0.9",
|
|
55
|
-
"@types/node": "22.10.
|
|
55
|
+
"@types/node": "22.10.6",
|
|
56
56
|
"@types/openapi-sampler": "^1.0.3",
|
|
57
|
-
"@types/react": "^19.0.
|
|
58
|
-
"bunchee": "^6.
|
|
59
|
-
"lucide-react": "^0.
|
|
57
|
+
"@types/react": "^19.0.7",
|
|
58
|
+
"bunchee": "^6.3.1",
|
|
59
|
+
"lucide-react": "^0.471.1",
|
|
60
60
|
"next": "15.1.4",
|
|
61
61
|
"openapi-types": "^12.1.3",
|
|
62
62
|
"eslint-config-custom": "0.0.0",
|