schema-components 1.20.0 → 1.22.0
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/README.md +1 -1
- package/dist/core/adapter.d.mts +28 -4
- package/dist/core/adapter.mjs +408 -71
- package/dist/core/constraints.d.mts +2 -2
- package/dist/core/constraints.mjs +0 -2
- package/dist/core/diagnostics.d.mts +1 -1
- package/dist/core/errors.d.mts +1 -1
- package/dist/core/errors.mjs +9 -15
- package/dist/core/fieldOrder.d.mts +1 -1
- package/dist/core/formats.d.mts +22 -1
- package/dist/core/formats.mjs +21 -0
- package/dist/core/limits.d.mts +2 -0
- package/dist/core/limits.mjs +23 -0
- package/dist/core/merge.d.mts +11 -2
- package/dist/core/merge.mjs +11 -0
- package/dist/core/normalise.d.mts +36 -4
- package/dist/core/normalise.mjs +2 -2
- package/dist/core/openapi30.d.mts +24 -1
- package/dist/core/openapi30.mjs +2 -2
- package/dist/core/ref.d.mts +1 -1
- package/dist/core/ref.mjs +35 -9
- package/dist/core/renderer.d.mts +1 -1
- package/dist/core/renderer.mjs +0 -2
- package/dist/core/swagger2.d.mts +1 -1
- package/dist/core/swagger2.mjs +1 -1
- package/dist/core/typeInference.d.mts +2 -2
- package/dist/core/types.d.mts +2 -2
- package/dist/core/types.mjs +1 -4
- package/dist/core/version.d.mts +1 -1
- package/dist/core/walkBuilders.d.mts +13 -5
- package/dist/core/walkBuilders.mjs +11 -3
- package/dist/core/walker.d.mts +1 -1
- package/dist/core/walker.mjs +110 -26
- package/dist/{diagnostics-CbBPsxSt.d.mts → diagnostics-D0QCYGv0.d.mts} +1 -1
- package/dist/{errors-C2iABcn9.d.mts → errors-DpFwqs5C.d.mts} +7 -11
- package/dist/html/a11y.d.mts +2 -2
- package/dist/html/a11y.mjs +10 -3
- package/dist/html/renderToHtml.d.mts +10 -3
- package/dist/html/renderToHtml.mjs +13 -3
- package/dist/html/renderToHtmlStream.d.mts +2 -2
- package/dist/html/renderers.d.mts +2 -2
- package/dist/html/renderers.mjs +1 -6
- package/dist/html/streamRenderers.d.mts +5 -4
- package/dist/html/streamRenderers.mjs +91 -30
- package/dist/limits-Cw5QZND8.d.mts +29 -0
- package/dist/{normalise-CMMEl4cd.mjs → normalise-DVEJQmF7.mjs} +791 -141
- package/dist/openapi/ApiCallbacks.d.mts +1 -1
- package/dist/openapi/ApiLinks.d.mts +1 -1
- package/dist/openapi/ApiResponseHeaders.d.mts +1 -1
- package/dist/openapi/ApiSecurity.d.mts +1 -1
- package/dist/openapi/ApiSecurity.mjs +127 -7
- package/dist/openapi/components.d.mts +175 -21
- package/dist/openapi/components.mjs +145 -21
- package/dist/openapi/parser.d.mts +1 -1
- package/dist/openapi/parser.mjs +74 -7
- package/dist/openapi/resolve.d.mts +70 -12
- package/dist/openapi/resolve.mjs +265 -42
- package/dist/react/SchemaComponent.d.mts +100 -35
- package/dist/react/SchemaComponent.mjs +66 -24
- package/dist/react/SchemaView.d.mts +3 -3
- package/dist/react/SchemaView.mjs +2 -2
- package/dist/react/fieldPath.d.mts +1 -1
- package/dist/react/headless.d.mts +1 -1
- package/dist/react/headless.mjs +1 -2
- package/dist/react/headlessRenderers.d.mts +3 -4
- package/dist/react/headlessRenderers.mjs +11 -31
- package/dist/{ref-C8JbwfiS.d.mts → ref-D-_JBZkF.d.mts} +7 -2
- package/dist/{renderer-SOIbJBtk.d.mts → renderer-BaRlQIuN.d.mts} +2 -2
- package/dist/themes/mantine.d.mts +1 -1
- package/dist/themes/mui.d.mts +1 -1
- package/dist/themes/radix.d.mts +1 -1
- package/dist/themes/shadcn.d.mts +1 -1
- package/dist/typeInference-DkcUHfaM.d.mts +982 -0
- package/dist/{types-C9zw9wbX.d.mts → types-BrRMV0en.d.mts} +15 -12
- package/package.json +1 -3
- package/dist/typeInference-CDoD_LZ_.d.mts +0 -533
- /package/dist/{version-D-u7aMfy.d.mts → version-D2jfdX6E.d.mts} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { isObject, toRecordOrUndefined } from "../core/guards.mjs";
|
|
3
|
+
import "../core/limits.mjs";
|
|
3
4
|
import { SchemaFieldError, SchemaNormalisationError, SchemaRenderError } from "../core/errors.mjs";
|
|
4
5
|
import { normaliseSchema } from "../core/adapter.mjs";
|
|
5
6
|
import { buildRenderProps, getRenderFunction, mergeResolvers } from "../core/renderer.mjs";
|
|
@@ -46,7 +47,8 @@ const globalWidgets = /* @__PURE__ */ new Map();
|
|
|
46
47
|
function registerWidget(name, render) {
|
|
47
48
|
globalWidgets.set(name, render);
|
|
48
49
|
}
|
|
49
|
-
function SchemaComponent(
|
|
50
|
+
function SchemaComponent(props) {
|
|
51
|
+
const { schema: schemaInput, ref: refInput, value, onChange, validate, onValidationError, onError, onDiagnostic, strict, fields, meta: componentMeta, readOnly, writeOnly, description, widgets: instanceWidgets, idPrefix } = props;
|
|
50
52
|
const userResolver = useContext(UserResolverContext);
|
|
51
53
|
const contextWidgets = useContext(WidgetsContext);
|
|
52
54
|
const generatedId = useId();
|
|
@@ -87,7 +89,17 @@ function SchemaComponent({ schema: schemaInput, ref: refInput, value, onChange,
|
|
|
87
89
|
}
|
|
88
90
|
const handleChange = useCallback((nextValue) => {
|
|
89
91
|
if (validate) {
|
|
90
|
-
|
|
92
|
+
let error;
|
|
93
|
+
try {
|
|
94
|
+
error = runValidation(zodSchema, jsonSchema, nextValue, onDiagnostic);
|
|
95
|
+
} catch (err) {
|
|
96
|
+
const normalised = err instanceof SchemaNormalisationError ? err : new SchemaNormalisationError(err instanceof Error ? err.message : "Fallback validation failed", schemaInput, "zod-conversion-failed", void 0, err);
|
|
97
|
+
if (onError !== void 0) {
|
|
98
|
+
onError(normalised);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
throw normalised;
|
|
102
|
+
}
|
|
91
103
|
if (error !== void 0) {
|
|
92
104
|
onValidationError?.(error);
|
|
93
105
|
dispatchFieldErrors(fields, error);
|
|
@@ -100,7 +112,10 @@ function SchemaComponent({ schema: schemaInput, ref: refInput, value, onChange,
|
|
|
100
112
|
jsonSchema,
|
|
101
113
|
onChange,
|
|
102
114
|
onValidationError,
|
|
103
|
-
fields
|
|
115
|
+
fields,
|
|
116
|
+
onDiagnostic,
|
|
117
|
+
onError,
|
|
118
|
+
schemaInput
|
|
104
119
|
]);
|
|
105
120
|
const walkOptions = {
|
|
106
121
|
componentMeta: mergedMeta,
|
|
@@ -118,13 +133,6 @@ function SchemaComponent({ schema: schemaInput, ref: refInput, value, onChange,
|
|
|
118
133
|
return renderField(tree, value ?? tree.defaultValue, handleChange, userResolver, renderChild, rootPath, instanceWidgets, contextWidgets, 0);
|
|
119
134
|
}
|
|
120
135
|
/**
|
|
121
|
-
* Default root-path sentinel used when no `idPrefix` is supplied AND the
|
|
122
|
-
* component is rendered outside a React tree (e.g. server-side bundling
|
|
123
|
-
* test harnesses). Production callers receive a `useId()`-derived prefix
|
|
124
|
-
* that is unique per instance.
|
|
125
|
-
*/
|
|
126
|
-
const ROOT_PATH = "root";
|
|
127
|
-
/**
|
|
128
136
|
* Append a child path suffix to a parent path. When the suffix is omitted
|
|
129
137
|
* (e.g. transparent wrappers like union options), the parent path is
|
|
130
138
|
* returned unchanged so the child inherits the parent's id.
|
|
@@ -145,7 +153,22 @@ function sanitisePrefix(value) {
|
|
|
145
153
|
if (sanitised.length === 0) throw new Error(`Cannot derive a DOM-safe id prefix from "${value}". Pass an explicit idPrefix prop.`);
|
|
146
154
|
return sanitised;
|
|
147
155
|
}
|
|
148
|
-
|
|
156
|
+
/**
|
|
157
|
+
* Run validation against the supplied value.
|
|
158
|
+
*
|
|
159
|
+
* Returns the validation error (Zod error or equivalent) on failure, or
|
|
160
|
+
* `undefined` when the value is valid OR when the fallback validation
|
|
161
|
+
* path was skipped because a diagnostic sink absorbed the conversion
|
|
162
|
+
* failure.
|
|
163
|
+
*
|
|
164
|
+
* Throws `SchemaNormalisationError` (kind `zod-conversion-failed`) when
|
|
165
|
+
* the JSON-Schema → Zod fallback is taken AND no diagnostic sink is
|
|
166
|
+
* wired up. The project's no-silent-fallback rule requires the failure
|
|
167
|
+
* to surface somewhere — diagnostics if the consumer opted in, an error
|
|
168
|
+
* otherwise — so the caller can route it through `onError` / an error
|
|
169
|
+
* boundary rather than have validation quietly disappear.
|
|
170
|
+
*/
|
|
171
|
+
function runValidation(zodSchema, jsonSchema, value, onDiagnostic) {
|
|
149
172
|
if (zodSchema !== void 0 && isObject(zodSchema)) {
|
|
150
173
|
const safeParseFn = zodSchema.safeParse;
|
|
151
174
|
if (isCallable(safeParseFn)) {
|
|
@@ -154,7 +177,21 @@ function runValidation(zodSchema, jsonSchema, value) {
|
|
|
154
177
|
return;
|
|
155
178
|
}
|
|
156
179
|
}
|
|
157
|
-
|
|
180
|
+
let parsed;
|
|
181
|
+
try {
|
|
182
|
+
parsed = z.fromJSONSchema(jsonSchema);
|
|
183
|
+
} catch (err) {
|
|
184
|
+
if (onDiagnostic !== void 0) {
|
|
185
|
+
onDiagnostic({
|
|
186
|
+
code: "unsupported-type",
|
|
187
|
+
message: `Skipping fallback validation: z.fromJSONSchema could not round-trip the normalised JSON Schema. Original message: ${err instanceof Error ? err.message : "z.fromJSONSchema threw a non-Error value"}`,
|
|
188
|
+
pointer: "",
|
|
189
|
+
detail: { source: "z.fromJSONSchema" }
|
|
190
|
+
});
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
throw new SchemaNormalisationError(`Fallback validation failed: z.fromJSONSchema could not round-trip the normalised JSON Schema. Original message: ${err instanceof Error ? err.message : "z.fromJSONSchema threw a non-Error value"}`, jsonSchema, "zod-conversion-failed", void 0, err);
|
|
194
|
+
}
|
|
158
195
|
if (isObject(parsed)) {
|
|
159
196
|
const safeParseFn = parsed.safeParse;
|
|
160
197
|
if (isCallable(safeParseFn)) {
|
|
@@ -163,18 +200,13 @@ function runValidation(zodSchema, jsonSchema, value) {
|
|
|
163
200
|
}
|
|
164
201
|
}
|
|
165
202
|
}
|
|
166
|
-
/** Maximum rendering depth before treating a field as recursive. */
|
|
167
|
-
const MAX_RENDER_DEPTH = 10;
|
|
168
203
|
function renderField(tree, value, onChange, userResolver, renderChild, path, instanceWidgets, contextWidgets, depth = 0) {
|
|
169
|
-
if (path.length === 0) throw new Error("renderField requires a non-empty path. Pass
|
|
170
|
-
if (depth >=
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
" (recursive)"
|
|
176
|
-
] }) });
|
|
177
|
-
}
|
|
204
|
+
if (path.length === 0) throw new Error("renderField requires a non-empty path. Pass the root path (derived from `idPrefix` or `useId()`) for the root field, and use renderChild's pathSuffix to derive child paths.");
|
|
205
|
+
if (depth >= 10) return /* @__PURE__ */ jsx("fieldset", { children: /* @__PURE__ */ jsxs("em", { children: [
|
|
206
|
+
"↻ ",
|
|
207
|
+
typeof tree.meta.description === "string" ? tree.meta.description : "schema",
|
|
208
|
+
" (recursive)"
|
|
209
|
+
] }) });
|
|
178
210
|
const componentHint = tree.meta.component;
|
|
179
211
|
if (typeof componentHint === "string") {
|
|
180
212
|
const widget = instanceWidgets?.get(componentHint) ?? contextWidgets?.get(componentHint) ?? globalWidgets.get(componentHint);
|
|
@@ -255,6 +287,16 @@ function SchemaField({ path, schema: schemaInput, ref: refInput, value, onChange
|
|
|
255
287
|
/**
|
|
256
288
|
* Dispatch Zod errors to per-field onValidationError callbacks.
|
|
257
289
|
* Walks the fields override tree and matches errors by path prefix.
|
|
290
|
+
*
|
|
291
|
+
* The `fields` parameter mirrors the runtime shape produced by
|
|
292
|
+
* `InferFields<T, Ref>` at the props boundary — either a typed
|
|
293
|
+
* `FieldOverrides<...>` tree (for narrowable schemas) or the loose
|
|
294
|
+
* `Record<string, FieldOverride>` fallback. Both reduce to the same
|
|
295
|
+
* runtime shape, and the runtime narrowing below
|
|
296
|
+
* (`toRecordOrUndefined`) handles `undefined` and non-object inputs
|
|
297
|
+
* defensively. Typing the parameter as the union — rather than the
|
|
298
|
+
* `unknown` that earlier revisions used — keeps the type contract
|
|
299
|
+
* visible to readers without changing runtime behaviour.
|
|
258
300
|
*/
|
|
259
301
|
function dispatchFieldErrors(fields, error) {
|
|
260
302
|
if (fields === void 0 || !isObject(error)) return;
|
|
@@ -286,4 +328,4 @@ function isCallable(value) {
|
|
|
286
328
|
return typeof value === "function";
|
|
287
329
|
}
|
|
288
330
|
//#endregion
|
|
289
|
-
export {
|
|
331
|
+
export { SchemaComponent, SchemaField, SchemaProvider, joinPath, registerWidget, renderField, sanitisePrefix };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Diagnostic } from "../diagnostics-
|
|
3
|
-
import { r as ComponentResolver } from "../renderer-
|
|
1
|
+
import { w as SchemaMeta } from "../types-BrRMV0en.mjs";
|
|
2
|
+
import { t as Diagnostic } from "../diagnostics-D0QCYGv0.mjs";
|
|
3
|
+
import { r as ComponentResolver } from "../renderer-BaRlQIuN.mjs";
|
|
4
4
|
import { WidgetMap } from "./SchemaComponent.mjs";
|
|
5
5
|
import { ReactNode } from "react";
|
|
6
6
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "../core/limits.mjs";
|
|
1
2
|
import { SchemaNormalisationError, SchemaRenderError } from "../core/errors.mjs";
|
|
2
3
|
import { normaliseSchema } from "../core/adapter.mjs";
|
|
3
4
|
import { buildRenderProps, getRenderFunction, mergeResolvers } from "../core/renderer.mjs";
|
|
@@ -74,10 +75,9 @@ function SchemaView({ schema: schemaInput, ref: refInput, value, fields, meta: c
|
|
|
74
75
|
};
|
|
75
76
|
const tree = walk(jsonSchema, walkOptions);
|
|
76
77
|
const userResolver = resolver !== void 0 ? mergeResolvers(resolver, headlessResolver) : headlessResolver;
|
|
77
|
-
const MAX_SERVER_DEPTH = 10;
|
|
78
78
|
const makeRenderChild = (currentDepth, parentPath) => (childTree, childValue, pathSuffix) => {
|
|
79
79
|
const childPath = joinPath(parentPath, pathSuffix);
|
|
80
|
-
if (currentDepth >=
|
|
80
|
+
if (currentDepth >= 10) return createElement("fieldset", null, createElement("em", null, `\u21bb ${typeof childTree.meta.description === "string" ? childTree.meta.description : "schema"} (recursive)`));
|
|
81
81
|
return renderFieldServer(childTree, childValue, userResolver, makeRenderChild(currentDepth + 1, childPath), childPath, widgets);
|
|
82
82
|
};
|
|
83
83
|
const renderChild = makeRenderChild(0, rootPath);
|
package/dist/react/headless.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { renderArray, renderBoolean, renderConditional, renderDiscriminatedUnion, renderEnum, renderFile, renderLiteral, renderNegation, renderNever, renderNull, renderNumber, renderObject, renderRecord,
|
|
1
|
+
import { renderArray, renderBoolean, renderConditional, renderDiscriminatedUnion, renderEnum, renderFile, renderLiteral, renderNegation, renderNever, renderNull, renderNumber, renderObject, renderRecord, renderString, renderTuple, renderUnion, renderUnknown } from "./headlessRenderers.mjs";
|
|
2
2
|
//#region src/react/headless.tsx
|
|
3
3
|
/**
|
|
4
4
|
* The headless resolver uses props.renderChild for recursive rendering.
|
|
@@ -27,7 +27,6 @@ const headlessResolver = {
|
|
|
27
27
|
negation: renderNegation,
|
|
28
28
|
literal: renderLiteral,
|
|
29
29
|
file: renderFile,
|
|
30
|
-
recursive: renderRecursive,
|
|
31
30
|
never: renderNever,
|
|
32
31
|
unknown: renderUnknown
|
|
33
32
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as RenderProps } from "../renderer-
|
|
1
|
+
import { j as WalkedField } from "../types-BrRMV0en.mjs";
|
|
2
|
+
import { l as RenderProps } from "../renderer-BaRlQIuN.mjs";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/react/headlessRenderers.d.ts
|
|
@@ -56,7 +56,6 @@ declare function renderDiscriminatedUnion(props: RenderProps): ReactNode;
|
|
|
56
56
|
*/
|
|
57
57
|
declare function discriminatedUnionValueForTab(optionLabels: readonly string[], discKey: string, newIndex: number): Record<string, string> | undefined;
|
|
58
58
|
declare function renderFile(props: RenderProps): ReactNode;
|
|
59
|
-
declare function renderRecursive(props: RenderProps): ReactNode;
|
|
60
59
|
/**
|
|
61
60
|
* Render a literal field — `z.literal("a")` or `{ const: 5 }`.
|
|
62
61
|
*
|
|
@@ -110,4 +109,4 @@ declare function renderConditional(props: RenderProps): ReactNode;
|
|
|
110
109
|
declare function renderNegation(props: RenderProps): ReactNode;
|
|
111
110
|
declare function renderUnknown(props: RenderProps): ReactNode;
|
|
112
111
|
//#endregion
|
|
113
|
-
export { defaultRecordValue, discriminatedUnionValueForTab, inputId, nextRecordKey, renameRecordKey, renderArray, renderBoolean, renderConditional, renderDiscriminatedUnion, renderEnum, renderFile, renderLiteral, renderNegation, renderNever, renderNull, renderNumber, renderObject, renderRecord,
|
|
112
|
+
export { defaultRecordValue, discriminatedUnionValueForTab, inputId, nextRecordKey, renameRecordKey, renderArray, renderBoolean, renderConditional, renderDiscriminatedUnion, renderEnum, renderFile, renderLiteral, renderNegation, renderNever, renderNull, renderNumber, renderObject, renderRecord, renderString, renderTuple, renderUnion, renderUnknown, toReactNode };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isObject } from "../core/guards.mjs";
|
|
2
|
-
import { sortFieldsByOrder } from "../core/fieldOrder.mjs";
|
|
3
2
|
import { isSafeHyperlink, isSafeMailtoAddress } from "../core/uri.mjs";
|
|
3
|
+
import { sortFieldsByOrder } from "../core/fieldOrder.mjs";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { isValidElement, useCallback, useEffect, useRef } from "react";
|
|
6
6
|
//#region src/react/headlessRenderers.tsx
|
|
@@ -25,33 +25,21 @@ function toReactNode(value) {
|
|
|
25
25
|
}
|
|
26
26
|
function formatDateTime(value) {
|
|
27
27
|
if (typeof value !== "string" || value.length === 0) return void 0;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return date.toLocaleString();
|
|
32
|
-
} catch {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
28
|
+
const date = new Date(value);
|
|
29
|
+
if (isNaN(date.getTime())) return void 0;
|
|
30
|
+
return date.toLocaleString();
|
|
35
31
|
}
|
|
36
32
|
function formatDate(value) {
|
|
37
33
|
if (typeof value !== "string" || value.length === 0) return void 0;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return date.toLocaleDateString();
|
|
42
|
-
} catch {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
34
|
+
const date = new Date(value);
|
|
35
|
+
if (isNaN(date.getTime())) return void 0;
|
|
36
|
+
return date.toLocaleDateString();
|
|
45
37
|
}
|
|
46
38
|
function formatTime(value) {
|
|
47
39
|
if (typeof value !== "string" || value.length === 0) return void 0;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return date.toLocaleTimeString();
|
|
52
|
-
} catch {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
40
|
+
const date = new Date(value);
|
|
41
|
+
if (isNaN(date.getTime())) return void 0;
|
|
42
|
+
return date.toLocaleTimeString();
|
|
55
43
|
}
|
|
56
44
|
function dateInputType(format) {
|
|
57
45
|
if (format === "date") return "date";
|
|
@@ -588,14 +576,6 @@ function renderFile(props) {
|
|
|
588
576
|
...ariaAttrs
|
|
589
577
|
});
|
|
590
578
|
}
|
|
591
|
-
function renderRecursive(props) {
|
|
592
|
-
const refTarget = props.tree.type === "recursive" ? props.tree.refTarget : "";
|
|
593
|
-
return /* @__PURE__ */ jsx("fieldset", { children: /* @__PURE__ */ jsxs("em", { children: [
|
|
594
|
-
"↻ ",
|
|
595
|
-
typeof props.meta.description === "string" ? props.meta.description : refTarget,
|
|
596
|
-
" (recursive)"
|
|
597
|
-
] }) });
|
|
598
|
-
}
|
|
599
579
|
/**
|
|
600
580
|
* Render a literal field — `z.literal("a")` or `{ const: 5 }`.
|
|
601
581
|
*
|
|
@@ -777,4 +757,4 @@ function matchUnionOption(options, value) {
|
|
|
777
757
|
if (typeof value === "object" && value !== null) return options.find((o) => o.type === "object");
|
|
778
758
|
}
|
|
779
759
|
//#endregion
|
|
780
|
-
export { defaultRecordValue, discriminatedUnionValueForTab, inputId, nextRecordKey, renameRecordKey, renderArray, renderBoolean, renderConditional, renderDiscriminatedUnion, renderEnum, renderFile, renderLiteral, renderNegation, renderNever, renderNull, renderNumber, renderObject, renderRecord,
|
|
760
|
+
export { defaultRecordValue, discriminatedUnionValueForTab, inputId, nextRecordKey, renameRecordKey, renderArray, renderBoolean, renderConditional, renderDiscriminatedUnion, renderEnum, renderFile, renderLiteral, renderNegation, renderNever, renderNull, renderNumber, renderObject, renderRecord, renderString, renderTuple, renderUnion, renderUnknown, toReactNode };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as DiagnosticsOptions } from "./diagnostics-
|
|
1
|
+
import { i as DiagnosticsOptions } from "./diagnostics-D0QCYGv0.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/core/ref.d.ts
|
|
4
4
|
/**
|
|
@@ -38,7 +38,12 @@ declare function dereference(ref: string, root: Record<string, unknown>): Record
|
|
|
38
38
|
/**
|
|
39
39
|
* Recursively scan a schema document for a `$anchor` matching the given name.
|
|
40
40
|
* Returns the schema object containing the anchor, or undefined.
|
|
41
|
+
*
|
|
42
|
+
* The optional `visited` set guards against shared object references and
|
|
43
|
+
* cycles introduced by the OpenAPI bundler's `structuredClone`-based
|
|
44
|
+
* inlining of external refs. Without it a recursive document would stack
|
|
45
|
+
* overflow before reaching the matching anchor.
|
|
41
46
|
*/
|
|
42
|
-
declare function findAnchor(node: unknown, anchorName: string): Record<string, unknown> | undefined;
|
|
47
|
+
declare function findAnchor(node: unknown, anchorName: string, visited?: WeakSet<object>): Record<string, unknown> | undefined;
|
|
43
48
|
//#endregion
|
|
44
49
|
export { findAnchor as a, dereference as i, RefOptions as n, resolveRef as o, countDistinctRefs as r, ExternalResolver as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as StringConstraints, f as FileConstraints, j as WalkedField, t as ArrayConstraints, w as SchemaMeta, x as ObjectConstraints, y as NumberConstraints } from "./types-BrRMV0en.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/core/renderer.d.ts
|
|
4
4
|
/**
|
|
@@ -140,7 +140,7 @@ interface HtmlResolver {
|
|
|
140
140
|
never?: HtmlRenderFunction;
|
|
141
141
|
unknown?: HtmlRenderFunction;
|
|
142
142
|
}
|
|
143
|
-
declare const RESOLVER_KEYS: readonly ["string", "number", "boolean", "null", "enum", "object", "array", "tuple", "record", "union", "discriminatedUnion", "conditional", "negation", "
|
|
143
|
+
declare const RESOLVER_KEYS: readonly ["string", "number", "boolean", "null", "enum", "object", "array", "tuple", "record", "union", "discriminatedUnion", "conditional", "negation", "literal", "file", "never", "unknown"];
|
|
144
144
|
type ResolverKey = (typeof RESOLVER_KEYS)[number];
|
|
145
145
|
/**
|
|
146
146
|
* Map a schema type to the resolver key that handles it.
|
package/dist/themes/mui.d.mts
CHANGED
package/dist/themes/radix.d.mts
CHANGED
package/dist/themes/shadcn.d.mts
CHANGED