schema-components 1.26.1 → 1.27.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.
@@ -2,15 +2,15 @@ import { isObject, toRecordOrUndefined } from "../core/guards.mjs";
2
2
  import { emitDiagnostic } from "../core/diagnostics.mjs";
3
3
  import { extractRootMetaFromJson } from "../core/adapter.mjs";
4
4
  import { walk } from "../core/walker.mjs";
5
- import { joinPath, renderField, sanitisePrefix } from "../react/SchemaComponent.mjs";
6
5
  import { ApiCallbacks } from "./ApiCallbacks.mjs";
7
6
  import { ApiLinks } from "./ApiLinks.mjs";
8
7
  import { ApiResponseHeaders } from "./ApiResponseHeaders.mjs";
9
8
  import { ApiSecurity } from "./ApiSecurity.mjs";
10
9
  import { getExternalDocs, getLinks, getSecurityRequirements, getSecuritySchemes, getXmlInfo, listCallbacks, listWebhooks } from "./parser.mjs";
10
+ import { joinPath, renderField, sanitisePrefix } from "../react/SchemaComponent.mjs";
11
11
  import { getParsed, resolveOperationFromParsed, resolveParametersFromParsed, resolveRequestBodyFromParsed, resolveResponseFromParsed, toDoc } from "./resolve.mjs";
12
- import { useId } from "react";
13
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
+ import { useId } from "react";
14
14
  //#region src/openapi/components.tsx
15
15
  /**
16
16
  * OpenAPI React components with type-safe generics.
@@ -5,8 +5,8 @@ import { t as SchemaError } from "../errors-DQSIK4n1.mjs";
5
5
  import { l as RenderProps, r as ComponentResolver } from "../renderer-Ul9taFYp.mjs";
6
6
  import { FromJSONSchema, FromJSONSchemaMode, IsSwagger2Doc, PathOfType, RejectUnrepresentableZod, ResolveOpenAPIRef, TypeAtPath, __SchemaInferenceFellBack } from "../core/typeInference.mjs";
7
7
  import { z } from "zod";
8
- import { ReactNode } from "react";
9
8
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
9
+ import { ReactNode } from "react";
10
10
 
11
11
  //#region src/react/SchemaComponent.d.ts
12
12
  /**
@@ -8,8 +8,8 @@ import { walk } from "../core/walker.mjs";
8
8
  import { headlessResolver } from "./headless.mjs";
9
9
  import { resolvePath, resolveValue, setNestedValue } from "./fieldPath.mjs";
10
10
  import { z } from "zod";
11
- import { createContext, isValidElement, useCallback, useContext, useId, useMemo } from "react";
12
11
  import { jsx, jsxs } from "react/jsx-runtime";
12
+ import { createContext, isValidElement, useCallback, useContext, useId, useMemo } from "react";
13
13
  //#region src/react/SchemaComponent.tsx
14
14
  /**
15
15
  * <SchemaComponent> — renders UI from Zod, JSON Schema, or OpenAPI schemas.
@@ -5,8 +5,8 @@ import { buildRenderProps, getRenderFunction, mergeResolvers } from "../core/ren
5
5
  import { walk } from "../core/walker.mjs";
6
6
  import { headlessResolver } from "./headless.mjs";
7
7
  import { joinPath, sanitisePrefix } from "./SchemaComponent.mjs";
8
- import { createElement, isValidElement, useId } from "react";
9
8
  import { jsx } from "react/jsx-runtime";
9
+ import { createElement, isValidElement, useId } from "react";
10
10
  //#region src/react/SchemaView.tsx
11
11
  /**
12
12
  * React Server Component for read-only schema rendering.
@@ -7,8 +7,8 @@ import { fieldDomId, panelIdFor, tabIdFor } from "../core/idPath.mjs";
7
7
  import { matchUnionOption, resolveDiscriminatedActive } from "../core/unionMatch.mjs";
8
8
  import { displayJsonValue } from "../core/walkBuilders.mjs";
9
9
  import { buildAriaAttrs } from "./a11y.mjs";
10
- import { isValidElement, useCallback, useEffect, useRef } from "react";
11
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { isValidElement, useCallback, useEffect, useRef } from "react";
12
12
  //#region src/react/headlessRenderers.tsx
13
13
  /**
14
14
  * Headless renderer functions — one per schema type.
@@ -2,8 +2,8 @@ import { isObject } from "../core/guards.mjs";
2
2
  import { sortFieldsByOrder } from "../core/fieldOrder.mjs";
3
3
  import { inputId, toReactNode } from "../react/headlessRenderers.mjs";
4
4
  import { headlessResolver } from "../react/headless.mjs";
5
- import { isValidElement } from "react";
6
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { isValidElement } from "react";
7
7
  //#region src/themes/mui.tsx
8
8
  function ariaRequired(tree) {
9
9
  return { required: tree.isOptional === false };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "schema-components",
3
- "version": "1.26.1",
3
+ "version": "1.27.0",
4
4
  "description": "React components that render UI from Zod schemas, JSON Schema, and OpenAPI documents",
5
5
  "type": "module",
6
6
  "exports": {
@@ -41,6 +41,7 @@
41
41
  "_test:coverage": "vitest run --project=unit --coverage",
42
42
  "_build": "tsdown && cp src/html/styles.css dist/html/styles.css",
43
43
  "_typedoc": "typedoc",
44
+ "_readme": "node scripts/build-readme-inventory.mjs",
44
45
  "typecheck": "turbo run _typecheck",
45
46
  "lint": "turbo run _lint",
46
47
  "lint:fix": "turbo run _lint:fix",
@@ -49,7 +50,8 @@
49
50
  "check": "turbo run _check",
50
51
  "validate": "turbo run _validate",
51
52
  "build": "turbo run _build",
52
- "typedoc": "turbo run _typedoc"
53
+ "typedoc": "turbo run _typedoc",
54
+ "readme": "turbo run _readme"
53
55
  },
54
56
  "keywords": [
55
57
  "react",