fumadocs-openapi 10.0.6 → 10.0.8

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.
@@ -23,7 +23,7 @@ export default function ServerSelect(props) {
23
23
  : null;
24
24
  return (_jsxs(Dialog, { open: open, onOpenChange: setOpen, children: [_jsx(DialogTrigger, { className: "text-xs p-3 py-2 bg-fd-muted text-fd-muted-foreground transition-colors truncate hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-none", children: isMounted
25
25
  ? withBase(server ? resolveServerUrl(server.url, server.variables) : '/', window.location.origin)
26
- : 'loading...' }), _jsxs(DialogContent, { ...props, children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Server URL" }), _jsx(DialogDescription, { children: "The base URL of your API endpoint." })] }), _jsxs(Select, { value: server?.url, onValueChange: setServer, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: servers.map((item) => (_jsxs(SelectItem, { value: item.url, children: [_jsx("code", { className: "text-[13px]", children: item.url }), _jsx("p", { className: "text-fd-muted-foreground", children: item.description })] }, item.url))) })] }), server?.variables && serverSchema?.variables && (_jsx(ServerSelectContent, { defaultValues: server.variables, schema: serverSchema.variables, onChange: setServerVariables }, server.url))] })] }));
26
+ : 'loading...' }), _jsxs(DialogContent, { ...props, children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Server URL" }), _jsx(DialogDescription, { children: "The base URL of your API endpoint." })] }), _jsxs(Select, { value: server?.url, onValueChange: setServer, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: servers.map((item) => (_jsxs(SelectItem, { value: item.url, children: [_jsx("code", { className: "text-[0.8125rem]", children: item.url }), _jsx("p", { className: "text-fd-muted-foreground", children: item.description })] }, item.url))) })] }), server?.variables && serverSchema?.variables && (_jsx(ServerSelectContent, { defaultValues: server.variables, schema: serverSchema.variables, onChange: setServerVariables }, server.url))] })] }));
27
27
  }
28
28
  function ServerSelectContent({ defaultValues, onChange, schema, }) {
29
29
  const form = useForm({
@@ -13,7 +13,7 @@ export default function ScalarPlayground({ path, method, spec, }) {
13
13
  useEffect(() => {
14
14
  setMounted(true);
15
15
  }, []);
16
- return (_jsxs("div", { className: cn('flex flex-row items-center gap-2.5 p-3 rounded-xl border bg-fd-card text-fd-card-foreground not-prose', mounted ? `${resolvedTheme}-mode` : null), children: [_jsx(MethodLabel, { className: "text-xs", children: method }), _jsx("code", { className: "flex-1 overflow-auto text-nowrap text-[13px] text-fd-muted-foreground", children: path }), _jsx(ApiClientModalProvider, { configuration: {
16
+ return (_jsxs("div", { className: cn('flex flex-row items-center gap-2.5 p-3 rounded-xl border bg-fd-card text-fd-card-foreground not-prose', mounted ? `${resolvedTheme}-mode` : null), children: [_jsx(MethodLabel, { className: "text-xs", children: method }), _jsx("code", { className: "flex-1 overflow-auto text-nowrap text-[0.8125rem] text-fd-muted-foreground", children: path }), _jsx(ApiClientModalProvider, { configuration: {
17
17
  theme: 'moon',
18
18
  content: spec,
19
19
  }, children: _jsx(Trigger, { path: path, method: method }) })] }));
@@ -4,7 +4,7 @@ import { cn } from 'fumadocs-ui/utils/cn';
4
4
  import { cva } from 'class-variance-authority';
5
5
  export const labelVariants = cva('text-xs font-medium text-fd-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70');
6
6
  const Input = React.forwardRef(({ className, type, ...props }, ref) => {
7
- return (_jsx("input", { type: type, className: cn('flex h-9 w-full rounded-md border bg-fd-secondary px-2 py-1.5 text-[13px] text-fd-secondary-foreground transition-colors placeholder:text-fd-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-fd-ring disabled:cursor-not-allowed disabled:opacity-50', className), ref: ref, ...props }));
7
+ return (_jsx("input", { type: type, className: cn('flex h-9 w-full rounded-md border bg-fd-secondary px-2 py-1.5 text-[0.8125rem] text-fd-secondary-foreground transition-colors placeholder:text-fd-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-fd-ring disabled:cursor-not-allowed disabled:opacity-50', className), ref: ref, ...props }));
8
8
  });
9
9
  Input.displayName = 'Input';
10
10
  export { Input };
@@ -6,7 +6,7 @@ import { cn } from 'fumadocs-ui/utils/cn';
6
6
  const Select = SelectPrimitive.Root;
7
7
  const SelectGroup = SelectPrimitive.Group;
8
8
  const SelectValue = SelectPrimitive.Value;
9
- const SelectTrigger = forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn('flex items-center w-full rounded-md border p-2 gap-2 text-start text-[13px] text-fd-secondary-foreground bg-fd-secondary hover:bg-fd-accent focus:outline-none focus:ring focus:ring-fd-ring disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: "ms-auto size-3.5 text-fd-muted-foreground shrink-0" }) })] })));
9
+ const SelectTrigger = forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn('flex items-center w-full rounded-md border p-2 gap-2 text-start text-sm text-fd-secondary-foreground bg-fd-secondary hover:bg-fd-accent focus:outline-none focus:ring focus:ring-fd-ring disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: "ms-auto size-3.5 text-fd-muted-foreground shrink-0" }) })] })));
10
10
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
11
11
  const SelectScrollUpButton = forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn('flex items-center justify-center py-1', className), ...props, children: _jsx(ChevronUp, { className: "size-4" }) })));
12
12
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
@@ -17,7 +17,7 @@ const SelectContent = forwardRef(({ className, children, position, ...props }, r
17
17
  SelectContent.displayName = SelectPrimitive.Content.displayName;
18
18
  const SelectLabel = forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Label, { ref: ref, className: cn('py-1.5 pe-2 ps-6 text-sm font-semibold', className), ...props })));
19
19
  SelectLabel.displayName = SelectPrimitive.Label.displayName;
20
- const SelectItem = forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Item, { ref: ref, className: cn('flex select-none flex-row items-center rounded-md py-1.5 px-2 text-[13px] outline-none focus:bg-fd-accent focus:text-fd-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), ...props, children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx(SelectPrimitive.ItemIndicator, { className: "ms-auto", children: _jsx(Check, { className: "size-3.5 text-fd-primary" }) })] })));
20
+ const SelectItem = forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Item, { ref: ref, className: cn('flex select-none flex-row items-center rounded-md py-1.5 px-2 text-sm outline-none focus:bg-fd-accent focus:text-fd-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), ...props, children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx(SelectPrimitive.ItemIndicator, { className: "ms-auto", children: _jsx(Check, { className: "size-3.5 text-fd-primary" }) })] })));
21
21
  SelectItem.displayName = SelectPrimitive.Item.displayName;
22
22
  const SelectSeparator = forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Separator, { ref: ref, className: cn('my-1 h-px bg-fd-muted', className), ...props })));
23
23
  SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
@@ -86,7 +86,7 @@ export async function Operation({ type = 'operation', path, method, ctx, hasHead
86
86
  callbacks: callbacksNode,
87
87
  paremeters: parameterNode,
88
88
  responses: responseNode,
89
- apiPlayground: playgroundEnabled ? (_jsx(APIPlayground, { path: path, method: method, ctx: ctx })) : (_jsxs("div", { className: "flex flex-row items-center gap-2.5 p-3 rounded-xl border bg-fd-card text-fd-card-foreground not-prose", children: [_jsx(MethodLabel, { className: "text-xs", children: method.method }), _jsx("code", { className: "flex-1 overflow-auto text-nowrap text-[13px] text-fd-muted-foreground", children: path })] })),
89
+ apiPlayground: playgroundEnabled ? (_jsx(APIPlayground, { path: path, method: method, ctx: ctx })) : (_jsxs("div", { className: "flex flex-row items-center gap-2.5 p-3 rounded-xl border bg-fd-card text-fd-card-foreground not-prose", children: [_jsx(MethodLabel, { className: "text-xs", children: method.method }), _jsx("code", { className: "flex-1 overflow-auto text-nowrap text-[0.8125rem] text-fd-muted-foreground", children: path })] })),
90
90
  apiExample: _jsx(APIExample, { method: method, ctx: ctx }),
91
91
  }, ctx, method);
92
92
  return (_jsx(OperationProviderLazy, { defaultExampleId: method['x-exclusiveCodeSample'] ?? method['x-selectedCodeSample'], route: path, examples: getAPIExamples(path, method, ctx), children: content }));
@@ -107,7 +107,7 @@ async function ResponseAccordion({ status, operation, ctx, }) {
107
107
  const response = operation.responses[status];
108
108
  const { generateTypeScriptSchema } = ctx;
109
109
  const contentTypes = response.content ? Object.entries(response.content) : [];
110
- return (_jsxs(SelectTabs, { defaultValue: contentTypes.at(0)?.[0], children: [_jsxs(AccordionHeader, { children: [_jsx(AccordionTrigger, { className: "font-mono", children: status }), contentTypes.length > 1 && (_jsx(SelectTabTrigger, { items: contentTypes.map((v) => v[0]) })), contentTypes.length === 1 && (_jsx("p", { className: "text-[13px] text-fd-muted-foreground", children: contentTypes[0][0] }))] }), _jsxs(AccordionContent, { className: "ps-4.5", children: [response.description && (_jsx("div", { className: "prose-no-margin", children: ctx.renderMarkdown(response.description) })), contentTypes?.map(async ([type, resType]) => {
110
+ return (_jsxs(SelectTabs, { defaultValue: contentTypes.at(0)?.[0], children: [_jsxs(AccordionHeader, { children: [_jsx(AccordionTrigger, { className: "font-mono", children: status }), contentTypes.length > 1 && (_jsx(SelectTabTrigger, { items: contentTypes.map((v) => v[0]) })), contentTypes.length === 1 && (_jsx("p", { className: "text-sm text-fd-muted-foreground", children: contentTypes[0][0] }))] }), _jsxs(AccordionContent, { className: "ps-4.5", children: [response.description && (_jsx("div", { className: "prose-no-margin", children: ctx.renderMarkdown(response.description) })), contentTypes?.map(async ([type, resType]) => {
111
111
  const schema = resType.schema;
112
112
  let ts;
113
113
  if (generateTypeScriptSchema) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-openapi",
3
- "version": "10.0.6",
3
+ "version": "10.0.8",
4
4
  "description": "Generate MDX docs for your OpenAPI spec",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -54,14 +54,14 @@
54
54
  "@radix-ui/react-dialog": "^1.1.15",
55
55
  "@radix-ui/react-select": "^2.2.6",
56
56
  "@radix-ui/react-slot": "^1.2.4",
57
- "@scalar/json-magic": "^0.7.0",
58
- "@scalar/openapi-parser": "0.23.0",
57
+ "@scalar/json-magic": "^0.8.1",
58
+ "@scalar/openapi-parser": "0.23.2",
59
59
  "ajv": "^8.17.1",
60
60
  "class-variance-authority": "^0.7.1",
61
61
  "github-slugger": "^2.0.0",
62
62
  "gray-matter": "^4.0.3",
63
63
  "hast-util-to-jsx-runtime": "^2.3.6",
64
- "js-yaml": "^4.1.0",
64
+ "js-yaml": "^4.1.1",
65
65
  "next-themes": "^0.4.6",
66
66
  "openapi-sampler": "^1.6.2",
67
67
  "react-hook-form": "^7.66.0",
@@ -69,21 +69,21 @@
69
69
  "remark-rehype": "^11.1.2",
70
70
  "tinyglobby": "^0.2.15",
71
71
  "xml-js": "^1.6.11",
72
- "fumadocs-core": "16.0.11",
73
- "fumadocs-ui": "16.0.11"
72
+ "fumadocs-core": "16.0.13",
73
+ "fumadocs-ui": "16.0.13"
74
74
  },
75
75
  "devDependencies": {
76
- "@scalar/api-client-react": "^1.3.48",
76
+ "@scalar/api-client-react": "^1.3.50",
77
77
  "@types/js-yaml": "^4.0.9",
78
- "@types/node": "24.10.0",
78
+ "@types/node": "24.10.1",
79
79
  "@types/openapi-sampler": "^1.0.3",
80
- "@types/react": "^19.2.2",
80
+ "@types/react": "^19.2.5",
81
81
  "json-schema-typed": "^8.0.1",
82
82
  "openapi-types": "^12.1.3",
83
- "tailwindcss": "^4.1.16",
83
+ "tailwindcss": "^4.1.17",
84
84
  "tsc-alias": "^1.8.16",
85
- "tsconfig": "0.0.0",
86
- "eslint-config-custom": "0.0.0"
85
+ "eslint-config-custom": "0.0.0",
86
+ "tsconfig": "0.0.0"
87
87
  },
88
88
  "peerDependencies": {
89
89
  "@scalar/api-client-react": "*",