fumadocs-openapi 10.0.1 → 10.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.
@@ -1 +1 @@
1
- {"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../../src/playground/components/inputs.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAef,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAkDxD,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EAAE,MAAM,EACb,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IACD,KAAK,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,cAAc,CAAC,KAAK,CAAC,uDAwCxB;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,2CA8B7D;AA6FD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,UAAU,EACV,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG;IAC/B,KAAK,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,uDAoGA;AAED,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EAAE,MAAM,EACb,SAAS,EACT,OAAO,EACP,IAAI,EACJ,UAAU,EACV,KAAS,EACT,QAAQ,EACR,WAAkB,EAClB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,SA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AC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,kDA4KA"}
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useMemo, useState, } from 'react';
4
4
  import { ChevronDown, Plus, Trash2, X } from '../../icons.js';
5
- import { set, useController, useFieldArray, useFormContext, } from 'react-hook-form';
5
+ import { useController, useFieldArray, useFormContext } from 'react-hook-form';
6
6
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../../ui/components/select.js';
7
7
  import { Input, labelVariants } from '../../ui/components/input.js';
8
8
  import { getDefaultValue } from '../get-default-values.js';
@@ -109,17 +109,11 @@ export function FieldInput({ field, fieldName, isRequired, ...props }) {
109
109
  }, hidden: true, ...restField })] }));
110
110
  }
111
111
  if (field.type === 'boolean') {
112
- return (_jsxs(Select, { value: String(value), onValueChange: (value) => onChange(value === 'null' ? null : value === 'true'), disabled: restField.disabled, children: [_jsx(SelectTrigger, { id: fieldName, className: props.className, ...restField, children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "true", children: "True" }), _jsx(SelectItem, { value: "false", children: "False" }), !isRequired && _jsx(SelectItem, { value: "null", children: "Null" })] })] }));
112
+ return (_jsxs(Select, { value: String(value), onValueChange: (value) => onChange(value === 'undefined' ? undefined : value === 'true'), disabled: restField.disabled, children: [_jsx(SelectTrigger, { id: fieldName, className: props.className, ...restField, children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "true", children: "True" }), _jsx(SelectItem, { value: "false", children: "False" }), !isRequired && _jsx(SelectItem, { value: "undefined", children: "Unset" })] })] }));
113
113
  }
114
114
  if (field.type === 'null')
115
115
  return;
116
- return (_jsxs("div", { ...props, className: cn('flex flex-row gap-2', props.className), children: [_jsx(Input, { id: fieldName, placeholder: "Enter value", type: field.type === 'string' ? 'text' : 'number', step: field.type === 'number' ? 'any' : undefined, value: value ?? '', onChange: onChange, ...restField }), !isRequired && value !== undefined && (_jsx("button", { type: "button", onClick: () => {
117
- // TODO: react-hook-form `reset()` cannot clear default values
118
- form.reset((values) => {
119
- set(values, fieldName, undefined);
120
- return values;
121
- });
122
- }, className: "text-fd-muted-foreground", children: _jsx(X, { className: "size-4" }) }))] }));
116
+ return (_jsxs("div", { ...props, className: cn('flex flex-row gap-2', props.className), children: [_jsx(Input, { id: fieldName, placeholder: "Enter value", type: field.type === 'number' ? 'number' : 'text', step: field.type === 'number' ? 'any' : undefined, value: value ?? '', onChange: (e) => onChange(field.type === 'number' ? e.target.valueAsNumber : e.target.value), ...restField }), !isRequired && value !== undefined && (_jsx("button", { type: "button", onClick: () => onChange(undefined), className: "text-fd-muted-foreground", children: _jsx(X, { className: "size-4" }) }))] }));
123
117
  }
124
118
  export function FieldSet({ field: _field, fieldName, toolbar, name, isRequired, depth = 0, slotType, collapsible = true, ...props }) {
125
119
  const field = useResolvedSchema(_field);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-openapi",
3
- "version": "10.0.1",
3
+ "version": "10.0.2",
4
4
  "description": "Generate MDX docs for your OpenAPI spec",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -69,8 +69,8 @@
69
69
  "remark-rehype": "^11.1.2",
70
70
  "tinyglobby": "^0.2.15",
71
71
  "xml-js": "^1.6.11",
72
- "fumadocs-ui": "16.0.8",
73
- "fumadocs-core": "16.0.8"
72
+ "fumadocs-core": "16.0.8",
73
+ "fumadocs-ui": "16.0.8"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@scalar/api-client-react": "^1.3.48",
@@ -82,8 +82,8 @@
82
82
  "openapi-types": "^12.1.3",
83
83
  "tailwindcss": "^4.1.16",
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": "*",