react-json-schema-ui-editor
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -133,3 +133,3 @@ import * as react_jsx_runtime from 'react/jsx-runtime'; | ||
onChange: (value: string | number | string[]) => void; | ||
value?: string | number; | ||
value?: string | number | string[]; | ||
field: (typeof jsonSchemaPossibleFields)[number]; | ||
@@ -142,2 +142,5 @@ options?: string[]; | ||
} | ||
interface PropertyNameInputParams { | ||
propertyName: string; | ||
} | ||
interface JsonSchemaEditorProps { | ||
@@ -149,5 +152,6 @@ initialSchema?: JSONSchema7; | ||
renderRemovePropertyButton: (p: ButtonInputParams) => React.ReactNode; | ||
renderPropertyName: (p: PropertyNameInputParams) => React.ReactNode; | ||
} | ||
declare const JsonSchemaEditor: ({ initialSchema, renderInput, renderAddPropertyButton, renderRemovePropertyButton, }: JsonSchemaEditorProps) => react_jsx_runtime.JSX.Element; | ||
declare const JsonSchemaEditor: ({ initialSchema, renderInput, renderAddPropertyButton, renderRemovePropertyButton, renderPropertyName }: JsonSchemaEditorProps) => react_jsx_runtime.JSX.Element; | ||
export { type ButtonInputParams, type InputInputParams, type JSONSchema7, type JSONSchema7Array, type JSONSchema7Definition, type JSONSchema7Object, type JSONSchema7Type, type JSONSchema7TypeName, type JSONSchema7Version, JsonSchemaEditor, type JsonSchemaEditorProps, jsonSchemaAvailableTypes, jsonSchemaPossibleFieldType, jsonSchemaPossibleFields }; | ||
export { type ButtonInputParams, type InputInputParams, type JSONSchema7, type JSONSchema7Array, type JSONSchema7Definition, type JSONSchema7Object, type JSONSchema7Type, type JSONSchema7TypeName, type JSONSchema7Version, JsonSchemaEditor, type JsonSchemaEditorProps, type PropertyNameInputParams, jsonSchemaAvailableTypes, jsonSchemaPossibleFieldType, jsonSchemaPossibleFields }; |
@@ -165,7 +165,7 @@ // src/components/JsonSchemaContext.tsx | ||
renderAddPropertyButton, | ||
renderRemovePropertyButton | ||
renderRemovePropertyButton, | ||
renderPropertyName | ||
}) => { | ||
const { | ||
derived, | ||
schema, | ||
actions: { setSchemaProperty, removeSchemaProperty } | ||
@@ -183,3 +183,3 @@ } = useJsonSchemaContext(); | ||
/* @__PURE__ */ jsxs3("div", { style: { display: "flex", alignItems: "start" }, children: [ | ||
name, | ||
name && renderPropertyName && renderPropertyName({ propertyName: name }), | ||
renderInput({ | ||
@@ -212,3 +212,3 @@ onChange: (value) => { | ||
), | ||
renderInput({ | ||
currentRowState.type && !["object", "array", "boolean"].includes(currentRowState.type) && renderInput({ | ||
onChange: (value) => { | ||
@@ -252,2 +252,3 @@ setSchemaProperty(`${path}.enum`, value); | ||
renderRemovePropertyButton, | ||
renderPropertyName, | ||
path: `${path ? `${path}.` : ""}properties.${prop}`, | ||
@@ -264,2 +265,3 @@ name: prop | ||
renderRemovePropertyButton, | ||
renderPropertyName, | ||
path: `${path ? `${path}.` : ""}items`, | ||
@@ -282,3 +284,4 @@ name | ||
renderAddPropertyButton, | ||
renderRemovePropertyButton | ||
renderRemovePropertyButton, | ||
renderPropertyName | ||
}) => { | ||
@@ -290,3 +293,4 @@ return /* @__PURE__ */ jsx3(JsonSchemaContextProvider, { init: initialSchema, children: /* @__PURE__ */ jsx3( | ||
renderAddPropertyButton, | ||
renderRemovePropertyButton | ||
renderRemovePropertyButton, | ||
renderPropertyName | ||
} | ||
@@ -293,0 +297,0 @@ ) }); |
{ | ||
"name": "react-json-schema-ui-editor", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "React component to edit json schema in a UI.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68962
757