@cratis/components 4.27.0 → 4.28.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.
Files changed (52) hide show
  1. package/compat-manifest.json +11 -11
  2. package/dist/esm/SchemaEditor/SchemaEditor.d.ts +4 -1
  3. package/dist/esm/SchemaEditor/SchemaEditor.d.ts.map +1 -1
  4. package/dist/esm/SchemaEditor/SchemaEditor.js.map +1 -1
  5. package/dist/esm/SchemaEditor/SchemaEditorLabels.d.ts +6 -0
  6. package/dist/esm/SchemaEditor/SchemaEditorLabels.d.ts.map +1 -1
  7. package/dist/esm/SchemaEditor/SchemaEditorLabels.js.map +1 -1
  8. package/dist/esm/SchemaEditor/Tree/GeneratedToggle.d.ts +11 -0
  9. package/dist/esm/SchemaEditor/Tree/GeneratedToggle.d.ts.map +1 -0
  10. package/dist/esm/SchemaEditor/Tree/GeneratedToggle.js +24 -0
  11. package/dist/esm/SchemaEditor/Tree/GeneratedToggle.js.map +1 -0
  12. package/dist/esm/SchemaEditor/Tree/Property.d.ts +6 -0
  13. package/dist/esm/SchemaEditor/Tree/Property.d.ts.map +1 -1
  14. package/dist/esm/SchemaEditor/Tree/Property.js.map +1 -1
  15. package/dist/esm/SchemaEditor/Tree/SchemaEditorContext.d.ts +2 -0
  16. package/dist/esm/SchemaEditor/Tree/SchemaEditorContext.d.ts.map +1 -1
  17. package/dist/esm/SchemaEditor/Tree/SchemaEditorContext.js.map +1 -1
  18. package/dist/esm/SchemaEditor/Tree/SchemaEditorParts.d.ts +2 -0
  19. package/dist/esm/SchemaEditor/Tree/SchemaEditorParts.d.ts.map +1 -1
  20. package/dist/esm/SchemaEditor/Tree/SchemaEditorParts.js.map +1 -1
  21. package/dist/esm/SchemaEditor/Tree/SchemaOrderedProperty.d.ts +12 -0
  22. package/dist/esm/SchemaEditor/Tree/SchemaOrderedProperty.d.ts.map +1 -0
  23. package/dist/esm/SchemaEditor/Tree/SchemaOrderedProperty.js +13 -0
  24. package/dist/esm/SchemaEditor/Tree/SchemaOrderedProperty.js.map +1 -0
  25. package/dist/esm/SchemaEditor/Tree/SchemaPropertyRow.d.ts.map +1 -1
  26. package/dist/esm/SchemaEditor/Tree/SchemaPropertyRow.js +2 -2
  27. package/dist/esm/SchemaEditor/Tree/SchemaPropertyRow.js.map +1 -1
  28. package/dist/esm/SchemaEditor/Tree/TreeSchemaEditor.d.ts +8 -1
  29. package/dist/esm/SchemaEditor/Tree/TreeSchemaEditor.d.ts.map +1 -1
  30. package/dist/esm/SchemaEditor/Tree/TreeSchemaEditor.js +15 -11
  31. package/dist/esm/SchemaEditor/Tree/TreeSchemaEditor.js.map +1 -1
  32. package/dist/esm/SchemaEditor/Tree/schemaConversion.d.ts +15 -3
  33. package/dist/esm/SchemaEditor/Tree/schemaConversion.d.ts.map +1 -1
  34. package/dist/esm/SchemaEditor/Tree/schemaConversion.js +83 -27
  35. package/dist/esm/SchemaEditor/Tree/schemaConversion.js.map +1 -1
  36. package/dist/esm/SchemaEditor/Tree/schemaInOriginalOrder.d.ts +3 -0
  37. package/dist/esm/SchemaEditor/Tree/schemaInOriginalOrder.d.ts.map +1 -0
  38. package/dist/esm/SchemaEditor/Tree/schemaInOriginalOrder.js +7 -0
  39. package/dist/esm/SchemaEditor/Tree/schemaInOriginalOrder.js.map +1 -0
  40. package/dist/esm/SchemaEditor/defaultSchemaEditorLabels.d.ts.map +1 -1
  41. package/dist/esm/SchemaEditor/defaultSchemaEditorLabels.js +3 -0
  42. package/dist/esm/SchemaEditor/defaultSchemaEditorLabels.js.map +1 -1
  43. package/dist/esm/SchemaEditor/index.d.ts +1 -1
  44. package/dist/esm/SchemaEditor/index.d.ts.map +1 -1
  45. package/dist/esm/SchemaEditor/index.js +1 -1
  46. package/dist/esm/styles.SchemaEditor.css +7 -10
  47. package/dist/esm/styles.css +7 -10
  48. package/dist/esm/types/parts.d.ts +2 -1
  49. package/dist/esm/types/parts.d.ts.map +1 -1
  50. package/dist/esm/types/parts.js +2 -1
  51. package/dist/esm/types/parts.js.map +1 -1
  52. package/package.json +1 -1
@@ -68,7 +68,7 @@
68
68
  {
69
69
  "name": "@cratis/components",
70
70
  "role": "core",
71
- "version": "4.27.0",
71
+ "version": "4.28.0",
72
72
  "releaseMajorRange": ">=4 <5",
73
73
  "independentRelease": false,
74
74
  "private": false,
@@ -92,7 +92,7 @@
92
92
  {
93
93
  "name": "@cratis/eslint-plugin-components",
94
94
  "role": "eslint",
95
- "version": "4.27.0",
95
+ "version": "4.28.0",
96
96
  "releaseMajorRange": ">=4 <5",
97
97
  "independentRelease": false,
98
98
  "private": false,
@@ -105,7 +105,7 @@
105
105
  {
106
106
  "name": "@cratis/components.migrator",
107
107
  "role": "migrator",
108
- "version": "4.27.0",
108
+ "version": "4.28.0",
109
109
  "releaseMajorRange": ">=4 <5",
110
110
  "independentRelease": false,
111
111
  "private": false,
@@ -116,13 +116,13 @@
116
116
  {
117
117
  "name": "@cratis/components.conformance",
118
118
  "role": "conformance",
119
- "version": "4.27.0",
119
+ "version": "4.28.0",
120
120
  "releaseMajorRange": ">=4 <5",
121
121
  "independentRelease": false,
122
122
  "private": false,
123
123
  "packageAccess": "public",
124
124
  "peerDependencies": {
125
- "@cratis/components": "4.27.0",
125
+ "@cratis/components": "4.28.0",
126
126
  "react": "^19.0.0",
127
127
  "react-dom": "^19.0.0"
128
128
  },
@@ -132,13 +132,13 @@
132
132
  {
133
133
  "name": "@cratis/components.mui",
134
134
  "role": "renderer-adapter",
135
- "version": "4.27.0",
135
+ "version": "4.28.0",
136
136
  "releaseMajorRange": ">=4 <5",
137
137
  "independentRelease": false,
138
138
  "private": false,
139
139
  "packageAccess": "public",
140
140
  "peerDependencies": {
141
- "@cratis/components": "4.27.0",
141
+ "@cratis/components": "4.28.0",
142
142
  "@emotion/react": ">=11.5 <12",
143
143
  "@emotion/styled": ">=11.11 <12",
144
144
  "@mui/material": ">=9 <10",
@@ -188,13 +188,13 @@
188
188
  {
189
189
  "name": "@cratis/components.primereact",
190
190
  "role": "renderer-adapter",
191
- "version": "4.27.0",
191
+ "version": "4.28.0",
192
192
  "releaseMajorRange": ">=4 <5",
193
193
  "independentRelease": false,
194
194
  "private": false,
195
195
  "packageAccess": "public",
196
196
  "peerDependencies": {
197
- "@cratis/components": "4.27.0",
197
+ "@cratis/components": "4.28.0",
198
198
  "@primereact/core": ">=11 <12",
199
199
  "@primereact/ui": ">=11 <12",
200
200
  "@primeuix/themes": ">=3 <4",
@@ -256,13 +256,13 @@
256
256
  {
257
257
  "name": "@cratis/components.primereact10",
258
258
  "role": "renderer-adapter",
259
- "version": "4.27.0",
259
+ "version": "4.28.0",
260
260
  "releaseMajorRange": ">=4 <5",
261
261
  "independentRelease": false,
262
262
  "private": false,
263
263
  "packageAccess": "public",
264
264
  "peerDependencies": {
265
- "@cratis/components": "4.27.0",
265
+ "@cratis/components": "4.28.0",
266
266
  "primereact": ">=10.9.9 <11",
267
267
  "react": "^19.0.0",
268
268
  "react-dom": "^19.0.0"
@@ -9,7 +9,10 @@ import type { Property } from './Tree/Property.js';
9
9
  import { type TreeSchemaEditorProps } from './Tree/TreeSchemaEditor.js';
10
10
  export { defaultSchemaEditorLabels };
11
11
  export type { SchemaEditorLabels };
12
- /** Properties of the tree layout the table layout has no counterpart for. They are ignored when `layout` is `'table'`. */
12
+ /**
13
+ * Properties of the tree layout the table layout has no counterpart for, including allowGeneratedProperty
14
+ * and onSetGeneratedProperty. They are ignored when `layout` is `'table'`.
15
+ */
13
16
  type TreeOnlyProps = Omit<TreeSchemaEditorProps, 'schema' | 'onChange' | 'labels' | 'className' | 'allowKeyProperty' | 'allowRequired' | 'readOnly' | 'isPropertyProtected' | 'validatePropertyName' | 'onPropertyRemoved' | 'onPropertyRenamed' | 'header' | 'footer'>;
14
17
  /**
15
18
  * Props for {@link SchemaEditor}.
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaEditor.d.ts","sourceRoot":"","sources":["../../../SchemaEditor/SchemaEditor.tsx"],"names":[],"mappings":"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nB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,SAAS,CAAC;CACtB;AAsvBD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,YAAY,UAAW,iBAAiB,gCAC2C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaEditor.js","sources":["../../../SchemaEditor/SchemaEditor.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState, useEffect, useMemo, useCallback } from 'react';\nimport { Button } from '../Common/Button';\nimport { Checkbox } from '../Common/Checkbox';\nimport { DataTableCore } from '../DataTables/DataTableCore';\nimport { Column } from '../DataTables/Column';\nimport { ActionMenubar, type ActionMenuItem } from '../Common/ActionMenubar';\nimport { Tooltip } from '../Common/Tooltip';\nimport { Message } from '../Display/Message';\nimport * as faIcons from 'react-icons/fa6';\nimport { NameCell } from './NameCell';\nimport { TypeCell } from './TypeCell';\nimport type { ReactNode } from 'react';\nimport type { ChangeHandler } from '../types/ChangeHandler';\nimport type { JsonSchema, JsonSchemaProperty } from '../types/JsonSchema';\nimport { type TypeFormat, DEFAULT_TYPE_FORMATS } from '../types/TypeFormat';\nimport { validatePropertyName, buildBreadcrumbItems } from './schemaHelpers';\nimport { defaultSchemaEditorLabels } from './defaultSchemaEditorLabels';\nimport type { SchemaEditorLabels } from './SchemaEditorLabels';\n\nimport type { SchemaEditorLayout } from './SchemaEditorLayout';\nimport type { Property } from './Tree/Property';\nimport { jsonSchemaToProperties, KEY_KEYWORD } from './Tree/schemaConversion';\nimport { TreeSchemaEditor, type TreeSchemaEditorProps } from './Tree/TreeSchemaEditor';\n\nexport { defaultSchemaEditorLabels };\nexport type { SchemaEditorLabels };\n\n/** Properties of the tree layout the table layout has no counterpart for. They are ignored when `layout` is `'table'`. */\ntype TreeOnlyProps = Omit<\n TreeSchemaEditorProps,\n | 'schema'\n | 'onChange'\n | 'labels'\n | 'className'\n | 'allowKeyProperty'\n | 'allowRequired'\n | 'readOnly'\n | 'isPropertyProtected'\n | 'validatePropertyName'\n | 'onPropertyRemoved'\n | 'onPropertyRenamed'\n | 'header'\n | 'footer'\n>;\n\nconst emptySchema: JsonSchema = {};\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\n/**\n * Recursively validates that a parsed schema node, its required names, and every nested\n * `properties`, `definitions`, and `items` schema match the supported object shape. A JSON-valid\n * document can still contain malformed nested values (for example `properties.foo: null`,\n * `required: {}`, or `items: \"string\"`) that later code dereferences as schema data; those are\n * rejected here rather than crashing downstream.\n */\nconst isValidSchemaNode = (node: unknown): node is JsonSchema => {\n if (!isPlainObject(node)) {\n return false;\n }\n\n if (\n node.required !== undefined &&\n (!Array.isArray(node.required) ||\n !node.required.every((propertyName) => typeof propertyName === 'string'))\n ) {\n return false;\n }\n\n for (const nestedSchemas of [node.properties, node.definitions]) {\n if (nestedSchemas === undefined) continue;\n if (!isPlainObject(nestedSchemas)) return false;\n for (const nestedSchema of Object.values(nestedSchemas)) {\n if (!isValidSchemaNode(nestedSchema)) return false;\n }\n }\n\n if (node.items !== undefined && !isValidSchemaNode(node.items)) {\n return false;\n }\n\n return true;\n};\n\nconst cloneSchema = (schema: JsonSchema): JsonSchema | undefined => {\n try {\n const serializedSchema = JSON.stringify(schema);\n if (serializedSchema === undefined) return undefined;\n\n const parsedSchema: unknown = JSON.parse(serializedSchema);\n if (!isValidSchemaNode(parsedSchema)) {\n return undefined;\n }\n\n return parsedSchema;\n } catch {\n return undefined;\n }\n};\n\n/** Follows a drill-down path (property names and `$items`) to the schema it points at. */\nconst findSchemaAtPath = (root: JsonSchema, path: string[]): JsonSchema | undefined => {\n let target: JsonSchema | JsonSchemaProperty = root;\n for (const segment of path) {\n if (target.type === 'array' && segment === '$items') {\n target = target.items || {};\n } else if (target.properties && target.properties[segment]) {\n target = target.properties[segment];\n } else {\n return undefined;\n }\n }\n return target as unknown as JsonSchema;\n};\n\nconst asJsonSchema = (property: JsonSchemaProperty): JsonSchema => {\n // SAFETY: A nested \"object\" property has the same editable shape as a schema —\n // `properties`, `items`, and `required` all mean the same thing on both types.\n return property as unknown as JsonSchema;\n};\n\nconst asJsonSchemaProperty = (schema: JsonSchema): JsonSchemaProperty => {\n // SAFETY: The inverse of asJsonSchema; the shapes are structurally interchangeable.\n return schema as unknown as JsonSchemaProperty;\n};\n\n/**\n * Props for {@link SchemaEditor}.\n */\nexport interface SchemaEditorProps extends TreeOnlyProps {\n /**\n * Which editor to render. `'table'` (the default) is the breadcrumb-navigated table with an Edit, Save and\n * Cancel workflow; `'tree'` is the inline tree editor that applies every edit live. See the layout notes in\n * the documentation for the props each layout honors.\n */\n layout?: SchemaEditorLayout;\n\n /**\n * The JSON Schema being viewed or edited. Required unless the tree layout is controlled through\n * `properties`.\n */\n schema?: JsonSchema;\n\n /** Optional event-type label displayed in the editor header. */\n eventTypeName?: string;\n\n /** When false, the Edit action remains visible but cannot enter edit mode; defaults to `true`. */\n canEdit?: boolean;\n\n /**\n * When {@link canEdit} is false, this string is shown as a tooltip on an\n * inert Edit action to explain why editing is unavailable.\n */\n canNotEditReason?: string;\n\n /** Invoked with the updated schema and optional metadata after any structural change. */\n onChange?: ChangeHandler<JsonSchema>;\n\n /** Invoked when the user activates the Save action. */\n onSave?: () => void;\n\n /** Invoked when the user activates the Cancel action. */\n onCancel?: () => void;\n\n /** Initial edit-mode state; defaults to `false` (read-only). */\n editMode?: boolean;\n\n /** When true, hides the Save menu item even while in edit mode. */\n saveDisabled?: boolean;\n\n /** When true, hides the Cancel menu item even while in edit mode. */\n cancelDisabled?: boolean;\n\n /**\n * Override the list of selectable type formats per JSON Schema type. Each\n * entry contributes options to the type-format dropdown shown in edit\n * mode. Defaults to {@link DEFAULT_TYPE_FORMATS}.\n */\n typeFormats?: TypeFormat[];\n\n /**\n * Extra CSS class names appended to the editor root. Combined with the\n * default `schema-editor` class. For fine-grained styling of internal\n * Components controls, use product tokens and stable Cratis parts.\n */\n className?: string;\n\n /** Override any user-facing string (for localization). See {@link SchemaEditorLabels}. */\n labels?: Partial<SchemaEditorLabels>;\n\n /**\n * Offers the key toggle (`x-key`, at most one property per object). In the table layout this adds a Key\n * column, editable in edit mode; a function enables the column for every row. In the tree layout it is\n * offered on every property, or per property when a function is given.\n */\n allowKeyProperty?: TreeSchemaEditorProps['allowKeyProperty'];\n\n /**\n * Offers the toggle for whether a property must be present (the `required` list). In the table layout this\n * adds a Required column, editable in edit mode.\n */\n allowRequired?: boolean;\n\n /** Offers no edits at all. Tree layout only: the table layout is read-only until Edit is chosen, controlled by `canEdit`. */\n readOnly?: boolean;\n\n /** Decides which properties can be neither renamed nor removed. By default none. Both layouts. */\n isPropertyProtected?: (property: Property) => boolean;\n\n /**\n * Extra check of a new name, after the editor has rejected blank, reserved and duplicate names. Return the\n * message to show, or `undefined` to accept the name. Both layouts.\n */\n validatePropertyName?: (name: string, property: Property, siblings: Property[]) => string | undefined;\n\n /** Called after a property was removed, with the property and everything nested under it. Both layouts. */\n onPropertyRemoved?: (property: Property) => void;\n\n /** Called after a property was renamed, with the renamed property and the name it had. Both layouts. */\n onPropertyRenamed?: (property: Property, previousName: string) => void;\n\n /** Content above the editor, for example the title of the schema. Both layouts. */\n header?: ReactNode;\n\n /** Content below the properties, for example further actions. Both layouts. */\n footer?: ReactNode;\n}\n\n/**\n * A breadcrumb-navigated editor for JSON Schemas. Lets users browse nested\n * `object` and `array` property definitions, add or remove properties, change\n * types and formats, and validate naming rules in place. Designed to drive\n * UIs around event payload schemas and similar structural documents.\n *\n * The editor composes a Cratis data table, action toolbar, and form widgets\n * internally. Restyle it through semantic tokens, the editor root `className`,\n * and documented `data-cratis-part` values rather than a provider preset.\n *\n * @param props - {@link SchemaEditorProps}.\n */\nconst TableSchemaEditor = ({\n schema: suppliedSchema,\n eventTypeName = '',\n canEdit = true,\n canNotEditReason,\n onChange,\n onSave,\n onCancel,\n editMode,\n saveDisabled = false,\n cancelDisabled = false,\n typeFormats = DEFAULT_TYPE_FORMATS,\n className,\n labels,\n allowKeyProperty,\n allowRequired,\n isPropertyProtected,\n validatePropertyName: validateCustomPropertyName,\n onPropertyRemoved,\n onPropertyRenamed,\n header,\n footer,\n}: SchemaEditorProps) => {\n const schema = suppliedSchema ?? emptySchema;\n const l = useMemo(() => ({ ...defaultSchemaEditorLabels, ...labels }) as Required<SchemaEditorLabels>, [labels]);\n const showKey = allowKeyProperty !== undefined && allowKeyProperty !== false;\n const showRequired = allowRequired === true;\n const [currentPath, setCurrentPath] = useState<string[]>([]);\n const [properties, setProperties] = useState<JsonSchemaProperty[]>([]);\n const [initialParsedSchema] = useState<JsonSchema | undefined>(() =>\n cloneSchema(schema),\n );\n const [currentSchema, setCurrentSchema] = useState<JsonSchema>(\n initialParsedSchema ?? {},\n );\n const [isEditMode, setIsEditMode] = useState(editMode ?? false);\n const [initialSchema, setInitialSchema] = useState<JsonSchema>(\n initialParsedSchema ?? {},\n );\n const [schemaJsonIsInvalid, setSchemaJsonIsInvalid] = useState(\n initialParsedSchema === undefined,\n );\n const [validationErrors, setValidationErrors] = useState<Record<string, string>>({});\n\n useEffect(() => {\n if (!isEditMode) {\n setCurrentPath([]);\n }\n }, [isEditMode]);\n\n const validateAllProperties = useCallback(\n (properties: JsonSchemaProperty[], level: Property[] = []) => {\n const errors: Record<string, string> = {};\n\n properties.forEach((prop) => {\n let error = validatePropertyName(prop.name ?? '', prop.id!, properties);\n if (!error && validateCustomPropertyName) {\n const property = level.find((candidate) => candidate.name === prop.name);\n if (property) {\n error = validateCustomPropertyName(property.name, property, level);\n }\n }\n if (error) {\n errors[prop.id!] = error;\n }\n });\n\n setValidationErrors(errors);\n return Object.keys(errors).length === 0;\n },\n [validatePropertyName, validateCustomPropertyName],\n );\n\n useEffect(() => {\n const parsedSchema = cloneSchema(schema);\n if (!parsedSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n setSchemaJsonIsInvalid(false);\n setCurrentSchema(parsedSchema);\n setInitialSchema(parsedSchema);\n }, [schema]);\n\n useEffect(() => {\n loadPropertiesForCurrentPath();\n }, [currentPath, currentSchema, isEditMode]);\n\n const loadPropertiesForCurrentPath = () => {\n let targetSchema: JsonSchema | JsonSchemaProperty = currentSchema;\n\n for (const segment of currentPath) {\n if (targetSchema.type === 'array' && segment === '$items') {\n targetSchema = targetSchema.items || {};\n } else if (targetSchema.properties && targetSchema.properties[segment]) {\n targetSchema = targetSchema.properties[segment] as\n JsonSchema | JsonSchemaProperty;\n } else {\n return;\n }\n }\n\n const schemaProps: JsonSchemaProperty[] = [];\n if (targetSchema.properties) {\n let idCounter = 0;\n for (const [name, property] of Object.entries(targetSchema.properties)) {\n schemaProps.push({\n id: `prop-${currentPath.join('-')}-${idCounter++}`,\n name,\n type: property.type || 'string',\n format: property.format,\n description: property.description,\n items: property.items,\n properties: property.properties,\n // A property's own `required` array (populated when its `type`\n // is \"object\") lists which of *its* properties are required.\n // It is scoped to this property alone — never to the parent\n // schema's `required` array — and is carried through verbatim\n // so navigating into it (see asJsonSchema) sees it intact.\n required: property.required,\n });\n }\n }\n\n setProperties(schemaProps);\n if (isEditMode) {\n validateAllProperties(schemaProps, jsonSchemaToProperties(targetSchema as unknown as JsonSchema));\n }\n };\n\n const updateSchemaAtPath = useCallback(\n (path: string[], updater: (schema: JsonSchema) => JsonSchema) => {\n const newSchema = cloneSchema(currentSchema);\n if (!newSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n if (path.length === 0) {\n const updated = updater(newSchema);\n setCurrentSchema(updated);\n onChange?.(updated, { source: 'user' });\n return;\n }\n\n let targetSchema = newSchema;\n for (let i = 0; i < path.length - 1; i++) {\n const segment = path[i];\n if (targetSchema.type === 'array' && segment === '$items') {\n if (!targetSchema.items) {\n targetSchema.items = { type: 'object', properties: {} };\n }\n targetSchema = targetSchema.items;\n } else if (targetSchema.properties && targetSchema.properties[segment]) {\n targetSchema = asJsonSchema(targetSchema.properties[segment]);\n }\n }\n\n const lastSegment = path[path.length - 1];\n if (targetSchema.type === 'array' && lastSegment === '$items') {\n targetSchema.items = updater(targetSchema.items || {});\n } else {\n if (!targetSchema.properties) {\n targetSchema.properties = {};\n }\n const propertySchema = targetSchema.properties[lastSegment];\n targetSchema.properties[lastSegment] = asJsonSchemaProperty(\n updater(propertySchema ? asJsonSchema(propertySchema) : {}),\n );\n }\n\n setCurrentSchema(newSchema);\n onChange?.(newSchema, { source: 'user' });\n },\n [currentSchema, onChange],\n );\n\n const addProperty = useCallback(() => {\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n let newName = 'newProperty';\n let counter = 1;\n while (newProps[newName]) {\n newName = `newProperty${counter++}`;\n }\n newProps[newName] = { type: 'string' };\n return { ...schema, properties: newProps };\n });\n }, [currentPath, updateSchemaAtPath]);\n\n /** The editable view of the properties at the current path, for the host callbacks. */\n const getLevelProperties = useCallback(\n () => jsonSchemaToProperties(findSchemaAtPath(currentSchema, currentPath)),\n [currentSchema, currentPath],\n );\n\n const isProtected = useCallback(\n (propertyName: string) => {\n if (!isPropertyProtected) return false;\n const property = getLevelProperties().find((candidate) => candidate.name === propertyName);\n return property !== undefined && isPropertyProtected(property);\n },\n [isPropertyProtected, getLevelProperties],\n );\n\n const removeProperty = useCallback(\n (propertyName: string) => {\n const removed = getLevelProperties().find((candidate) => candidate.name === propertyName);\n if (removed && isPropertyProtected?.(removed)) return;\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n delete newProps[propertyName];\n\n // Deleting a property must also drop it from this schema's own\n // `required` array, or the array keeps naming a property that no\n // longer exists in `properties`.\n const updated: JsonSchema = { ...schema, properties: newProps };\n if (schema.required?.includes(propertyName)) {\n updated.required = schema.required.filter(\n (name) => name !== propertyName,\n );\n }\n\n return updated;\n });\n if (removed) onPropertyRemoved?.(removed);\n },\n [currentPath, updateSchemaAtPath, getLevelProperties, isPropertyProtected, onPropertyRemoved],\n );\n\n const setRequired = useCallback(\n (propertyName: string, isRequired: boolean) => {\n updateSchemaAtPath(currentPath, (schema) => {\n const others = (schema.required ?? []).filter((name) => name !== propertyName);\n const required = isRequired ? [...others, propertyName] : others;\n const updated: JsonSchema = { ...schema };\n if (required.length > 0) {\n updated.required = required;\n } else {\n delete updated.required;\n }\n return updated;\n });\n },\n [currentPath, updateSchemaAtPath],\n );\n\n const setKey = useCallback(\n (propertyName: string) => {\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps: Record<string, JsonSchemaProperty> = {};\n for (const [name, property] of Object.entries(schema.properties || {})) {\n const { [KEY_KEYWORD]: previousKey, ...rest } = property as JsonSchemaProperty & Record<string, unknown>;\n const makeKey = name === propertyName && previousKey !== true;\n newProps[name] = (makeKey ? { ...rest, [KEY_KEYWORD]: true } : rest) as JsonSchemaProperty;\n }\n return { ...schema, properties: newProps };\n });\n },\n [currentPath, updateSchemaAtPath],\n );\n\n const updateProperty = useCallback(\n (\n oldName: string,\n field: keyof JsonSchemaProperty,\n value: unknown,\n additionalUpdates?: Partial<JsonSchemaProperty>,\n ) => {\n let renamed: Property | undefined;\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n const prop = { ...(newProps[oldName] || {}) };\n\n let newRequired = schema.required;\n\n if (field === 'name') {\n const newName = value as string;\n if (newName !== oldName && !newProps[newName] && !isProtected(oldName)) {\n renamed = jsonSchemaToProperties({ properties: { [newName]: prop } })[0];\n newProps[newName] = prop;\n delete newProps[oldName];\n\n // Renaming a required property must keep the `required`\n // array pointing at the new name, or it goes stale and\n // silently references a property that no longer exists.\n if (schema.required?.includes(oldName)) {\n newRequired = schema.required.map((name) =>\n name === oldName ? newName : name,\n );\n }\n }\n } else if (field === 'type') {\n prop.type = value as string;\n // A concept belongs to the type it was chosen for; the table offers no concepts.\n delete (prop as Record<string, unknown>)['x-concept'];\n if (value === 'array') {\n prop.items = { type: 'string' };\n delete prop.format;\n // Only an \"object\" property has a meaningful `required`\n // array of its own; any prior one is now stale.\n delete prop.required;\n } else if (value === 'object') {\n prop.properties = {};\n delete prop.format;\n delete prop.items;\n // Starting fresh with empty `properties`, so any prior\n // `required` array (naming properties that no longer\n // exist here) would be stale.\n delete prop.required;\n } else {\n delete prop.items;\n delete prop.properties;\n delete prop.required;\n }\n\n if (additionalUpdates) {\n if ('format' in additionalUpdates) {\n if (additionalUpdates.format) {\n prop.format = additionalUpdates.format as string;\n } else {\n delete prop.format;\n }\n }\n }\n\n newProps[oldName] = prop;\n } else if (field === 'format') {\n if (value && value !== 'none') {\n prop.format = value as string;\n } else {\n delete prop.format;\n }\n newProps[oldName] = prop;\n }\n\n return { ...schema, properties: newProps, required: newRequired };\n });\n if (renamed) onPropertyRenamed?.(renamed, oldName);\n },\n [currentPath, updateSchemaAtPath, isProtected, onPropertyRenamed],\n );\n\n const updateArrayItemType = useCallback(\n (propertyName: string, itemType: string) => {\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n const prop = { ...(newProps[propertyName] || {}) };\n\n if (itemType === 'object') {\n prop.items = { type: 'object', properties: {} };\n } else if (itemType === 'array') {\n prop.items = { type: 'array', items: { type: 'string' } };\n } else {\n prop.items = { type: itemType };\n }\n\n newProps[propertyName] = prop;\n return { ...schema, properties: newProps };\n });\n },\n [currentPath, updateSchemaAtPath],\n );\n\n const navigateToProperty = useCallback(\n (propertyName: string) => {\n setCurrentPath([...currentPath, propertyName]);\n },\n [currentPath],\n );\n\n const navigateToArrayItems = useCallback(\n (propertyName: string) => {\n setCurrentPath([...currentPath, propertyName, '$items']);\n },\n [currentPath],\n );\n\n const navigateBack = useCallback(() => {\n if (currentPath.length > 0) {\n setCurrentPath(currentPath.slice(0, -1));\n }\n }, [currentPath]);\n\n const navigateToBreadcrumb = useCallback(\n (index: number) => {\n const items = getBreadcrumbItems();\n setCurrentPath(items[index].path);\n },\n [currentPath, eventTypeName],\n );\n\n const handleSave = useCallback(() => {\n if (schemaJsonIsInvalid) return;\n\n onSave?.();\n setIsEditMode(false);\n }, [onSave, schemaJsonIsInvalid]);\n\n const handleCancel = useCallback(() => {\n const restoredSchema = cloneSchema(initialSchema);\n const changedSchema = cloneSchema(initialSchema);\n if (!restoredSchema || !changedSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n const hasChanges = JSON.stringify(currentSchema) !== JSON.stringify(initialSchema);\n setCurrentSchema(restoredSchema);\n if (hasChanges) {\n onChange?.(changedSchema, { source: 'reset' });\n }\n setIsEditMode(false);\n onCancel?.();\n }, [currentSchema, initialSchema, onChange, onCancel]);\n\n const handleEdit = useCallback(() => {\n if (schemaJsonIsInvalid) return;\n\n const parsedSchema = cloneSchema(currentSchema);\n if (!parsedSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n setInitialSchema(parsedSchema);\n setIsEditMode(true);\n }, [currentSchema, schemaJsonIsInvalid]);\n\n const getBreadcrumbItems = () => buildBreadcrumbItems(eventTypeName, currentPath);\n\n const getCurrentDescription = useCallback(() => {\n let targetSchema: JsonSchema | JsonSchemaProperty = currentSchema;\n\n for (const segment of currentPath) {\n if (targetSchema.type === 'array' && segment === '$items') {\n targetSchema = targetSchema.items || {};\n } else if (targetSchema.properties && targetSchema.properties[segment]) {\n targetSchema = targetSchema.properties[segment] as\n JsonSchema | JsonSchemaProperty;\n } else {\n return undefined;\n }\n }\n\n return targetSchema.description;\n }, [currentSchema, currentPath]);\n\n const hasValidationErrors =\n schemaJsonIsInvalid || Object.keys(validationErrors).length > 0;\n\n const menuItems = useMemo<ActionMenuItem[]>(\n () => [\n ...(isEditMode\n ? []\n : [\n {\n label: l.edit,\n icon: <faIcons.FaPencil className='cratis:mr-2' />,\n command:\n canEdit && !schemaJsonIsInvalid ? handleEdit : undefined,\n disabled: schemaJsonIsInvalid,\n className: canEdit ? undefined : 'edit-disabled-with-reason',\n template:\n !canEdit && canNotEditReason\n ? (item: ActionMenuItem) => (\n <Tooltip\n content={canNotEditReason}\n position='bottom'\n >\n <button\n type='button'\n aria-disabled='true'\n style={{\n border: 0,\n background: 'transparent',\n color: 'inherit',\n cursor: 'not-allowed',\n opacity: 0.6,\n display: 'inline-flex',\n alignItems: 'center',\n padding: '0.5rem 0.75rem',\n }}\n >\n {item.icon}\n <span>{item.label}</span>\n </button>\n </Tooltip>\n )\n : undefined,\n },\n ]),\n ...(isEditMode\n ? [\n ...(saveDisabled\n ? []\n : [\n {\n label: l.save,\n icon: <faIcons.FaCheck className='cratis:mr-2' />,\n command: hasValidationErrors ? undefined : handleSave,\n disabled: hasValidationErrors,\n },\n ]),\n ...(cancelDisabled\n ? []\n : [\n {\n label: l.cancel,\n icon: <faIcons.FaXmark className='cratis:mr-2' />,\n command: handleCancel,\n },\n ]),\n {\n label: l.addProperty,\n icon: <faIcons.FaPlus className='cratis:mr-2' />,\n command: schemaJsonIsInvalid ? undefined : addProperty,\n disabled: schemaJsonIsInvalid,\n },\n ]\n : []),\n ],\n [\n isEditMode,\n handleSave,\n handleCancel,\n handleEdit,\n addProperty,\n canEdit,\n canNotEditReason,\n hasValidationErrors,\n schemaJsonIsInvalid,\n saveDisabled,\n cancelDisabled,\n l,\n ],\n );\n\n const breadcrumbItems = getBreadcrumbItems();\n const isAtRoot = currentPath.length === 0;\n const currentDescription = getCurrentDescription();\n const currentLevel = findSchemaAtPath(currentSchema, currentPath);\n\n return (\n <div\n className={className ? `schema-editor ${className}` : 'schema-editor'}\n style={{ display: 'flex', flexDirection: 'column', height: '100%' }}\n >\n {header}\n <div className='cratis:px-4 cratis:py-4'>\n <div className='schema-editor-menubar'>\n <ActionMenubar aria-label={l.actions} model={menuItems} />\n </div>\n {schemaJsonIsInvalid && (\n <Message\n severity='error'\n text={l.invalidJson}\n className='cratis:mt-3'\n />\n )}\n </div>\n\n <div className='cratis:px-4 cratis:py-2 cratis-schema-editor-bottom-border'>\n <div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>\n <Tooltip content={l.navigateBack} position='top'>\n <Button\n variant='ghost'\n size='small'\n icon={<faIcons.FaArrowLeft />}\n onClick={navigateBack}\n disabled={isAtRoot}\n aria-label={l.navigateBack}\n />\n </Tooltip>\n <div\n style={{\n fontSize: '0.9rem',\n color: 'var(--cratis-text-color-secondary)',\n cursor: 'pointer',\n }}\n >\n {breadcrumbItems.map((item, index) => (\n <span key={index}>\n {index > 0 && <span className='cratis:mx-2'>&gt;</span>}\n <button\n type='button'\n onClick={() => navigateToBreadcrumb(index)}\n aria-current={\n index === breadcrumbItems.length - 1\n ? 'location'\n : undefined\n }\n style={{\n padding: 0,\n border: 0,\n background: 'transparent',\n color: 'inherit',\n font: 'inherit',\n cursor: 'pointer',\n textDecoration:\n index < breadcrumbItems.length - 1\n ? 'underline'\n : 'none',\n }}\n >\n {item.name}\n </button>\n </span>\n ))}\n </div>\n </div>\n {currentDescription && (\n <div\n style={{\n fontSize: '0.875rem',\n color: 'var(--cratis-text-color-secondary)',\n marginTop: '0.5rem',\n marginLeft: '2.5rem',\n fontStyle: 'italic',\n display: 'flex',\n alignItems: 'center',\n gap: '0.5rem',\n }}\n >\n <faIcons.FaCircleInfo />\n <span>{currentDescription}</span>\n </div>\n )}\n </div>\n\n <div style={{ flex: 1, overflow: 'auto', padding: '1rem' }}>\n <DataTableCore<JsonSchemaProperty>\n key={`${isEditMode}-${currentPath.join('/')}`}\n data={properties}\n dataKey='id'\n emptyMessage={l.emptyMessage}\n rowClassName={(rowData) => {\n if (\n !isEditMode &&\n (rowData.type === 'object' ||\n (rowData.type === 'array' &&\n rowData.items?.type === 'object'))\n ) {\n return 'cratis-schema-editor-navigable-row';\n }\n return '';\n }}\n onRowClick={(e) => {\n if (!isEditMode) {\n const rowData = e.data;\n if (rowData.name) {\n if (rowData.type === 'object') {\n navigateToProperty(rowData.name);\n } else if (\n rowData.type === 'array' &&\n rowData.items?.type === 'object'\n ) {\n navigateToArrayItems(rowData.name);\n }\n }\n }\n }}\n pt={{\n root: { style: { border: 'none' } },\n body: {\n style: {\n borderTop: '1px solid var(--cratis-surface-border)',\n },\n },\n }}\n >\n <Column\n field='name'\n header='Property'\n body={(rowData: JsonSchemaProperty) => (\n <NameCell\n rowData={rowData}\n isEditMode={isEditMode}\n onUpdate={updateProperty}\n validationError={validationErrors[rowData.id!]}\n propertyNameLabel={l.propertyName}\n isLocked={isProtected(rowData.name ?? '')}\n lockedReason={l.protectedProperty}\n />\n )}\n style={{ width: '30%' }}\n />\n {showRequired && (\n <Column\n header={l.requiredColumn}\n body={(rowData: JsonSchemaProperty) => (\n <Checkbox\n aria-label={l.requiredProperty(rowData.name ?? '')}\n checked={Boolean(currentLevel?.required?.includes(rowData.name ?? ''))}\n readOnly={!isEditMode}\n onChange={(checked) => setRequired(rowData.name ?? '', checked)}\n />\n )}\n style={{ width: '6rem' }}\n />\n )}\n {showKey && (\n <Column\n header={l.keyColumn}\n body={(rowData: JsonSchemaProperty) => (\n <Checkbox\n aria-label={l.keyProperty(rowData.name ?? '')}\n checked={isKeyProperty(currentLevel, rowData.name ?? '')}\n readOnly={!isEditMode}\n onChange={() => setKey(rowData.name ?? '')}\n />\n )}\n style={{ width: '6rem' }}\n />\n )}\n <Column\n header='Type'\n body={(rowData: JsonSchemaProperty) => (\n <TypeCell\n rowData={rowData}\n isEditMode={isEditMode}\n typeFormats={typeFormats}\n onUpdateProperty={updateProperty}\n onUpdateArrayItemType={updateArrayItemType}\n onNavigateToProperty={navigateToProperty}\n onNavigateToArrayItems={navigateToArrayItems}\n onRemoveProperty={removeProperty}\n canRemove={!isProtected(rowData.name ?? '')}\n labels={l}\n />\n )}\n style={{ width: '70%' }}\n />\n </DataTableCore>\n </div>\n {footer}\n </div>\n );\n};\n\nconst isKeyProperty = (level: JsonSchema | undefined, propertyName: string): boolean =>\n (level?.properties?.[propertyName] as Record<string, unknown> | undefined)?.[KEY_KEYWORD] === true;\n\n/**\n * Edits the properties of a JSON Schema. By default (`layout='table'`) it is a breadcrumb-navigated table: it\n * lets users browse nested `object` and `array` property definitions, add or remove properties, change types and\n * formats, and validate naming rules in place, behind an Edit, Save and Cancel workflow. With `layout='tree'` it\n * is an inline tree that shows nested properties in place and applies every edit live. Designed to drive UIs\n * around event payload schemas and similar structural documents.\n *\n * Both layouts accept `allowRequired`, `allowKeyProperty`, `isPropertyProtected`, `validatePropertyName`,\n * `onPropertyRenamed`, `onPropertyRemoved`, `header` and `footer`. The tree layout also takes concepts, controlled\n * mode, per-row slots and selection; see the documentation for the exact split.\n *\n * The table layout composes a Cratis data table, action toolbar, and form widgets internally. Restyle it through\n * semantic tokens, the editor root `className`, and documented `data-cratis-part` values rather than a provider\n * preset.\n *\n * @param props - {@link SchemaEditorProps}.\n */\nexport const SchemaEditor = (props: SchemaEditorProps) =>\n props.layout === 'tree' ? <TreeSchemaEditor {...props} /> : <TableSchemaEditor {...props} />;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;AAgDA,MAAM,WAAW,GAAe,EAAE;AAElC,MAAM,aAAa,GAAG,CAAC,KAAc,KACjC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AASxE,MAAM,iBAAiB,GAAG,CAAC,IAAa,KAAwB;AAC5D,IAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE;AACtB,QAAA,OAAO,KAAK;IAChB;AAEA,IAAA,IACI,IAAI,CAAC,QAAQ,KAAK,SAAS;SAC1B,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC1B,YAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,YAAY,KAAK,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,EAC/E;AACE,QAAA,OAAO,KAAK;IAChB;AAEA,IAAA,KAAK,MAAM,aAAa,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE;QAC7D,IAAI,aAAa,KAAK,SAAS;YAAE;AACjC,QAAA,IAAI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AAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,cAAc,EAChC,qBAAqB,EAAE,mBAAmB,EAC1C,oBAAoB,EAAE,kBAAkB,EACxC,sBAAsB,EAAE,oBAAoB,EAC5C,gBAAgB,EAAE,cAAc,EAChC,SAAS,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,EAC3C,MAAM,EAAE,CAAC,EAAA,CACX,CACL,EACD,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GACzB,CAAA,EAAA,EApGG,CAAA,EAAG,UAAU,CAAA,CAAA,EAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAqGjC,EAAA,CACd,EACL,MAAM,CAAA,EAAA,CACL;AAEd,CAAC;AAED,MAAM,aAAa,GAAG,CAAC,KAA6B,EAAE,YAAoB,KACrE,KAAK,EAAE,UAAU,GAAG,YAAY,CAAyC,GAAG,WAAW,CAAC,KAAK,IAAI;AAmB/F,MAAM,YAAY,GAAG,CAAC,KAAwB,KACjD,KAAK,CAAC,MAAM,KAAK,MAAM,GAAGA,GAAA,CAAC,gBAAgB,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI,GAAGA,GAAA,CAAC,iBAAiB,EAAA,EAAA,GAAK,KAAK;;"}
1
+ {"version":3,"file":"SchemaEditor.js","sources":["../../../SchemaEditor/SchemaEditor.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState, useEffect, useMemo, useCallback } from 'react';\nimport { Button } from '../Common/Button';\nimport { Checkbox } from '../Common/Checkbox';\nimport { DataTableCore } from '../DataTables/DataTableCore';\nimport { Column } from '../DataTables/Column';\nimport { ActionMenubar, type ActionMenuItem } from '../Common/ActionMenubar';\nimport { Tooltip } from '../Common/Tooltip';\nimport { Message } from '../Display/Message';\nimport * as faIcons from 'react-icons/fa6';\nimport { NameCell } from './NameCell';\nimport { TypeCell } from './TypeCell';\nimport type { ReactNode } from 'react';\nimport type { ChangeHandler } from '../types/ChangeHandler';\nimport type { JsonSchema, JsonSchemaProperty } from '../types/JsonSchema';\nimport { type TypeFormat, DEFAULT_TYPE_FORMATS } from '../types/TypeFormat';\nimport { validatePropertyName, buildBreadcrumbItems } from './schemaHelpers';\nimport { defaultSchemaEditorLabels } from './defaultSchemaEditorLabels';\nimport type { SchemaEditorLabels } from './SchemaEditorLabels';\n\nimport type { SchemaEditorLayout } from './SchemaEditorLayout';\nimport type { Property } from './Tree/Property';\nimport { jsonSchemaToProperties, KEY_KEYWORD } from './Tree/schemaConversion';\nimport { TreeSchemaEditor, type TreeSchemaEditorProps } from './Tree/TreeSchemaEditor';\n\nexport { defaultSchemaEditorLabels };\nexport type { SchemaEditorLabels };\n\n/**\n * Properties of the tree layout the table layout has no counterpart for, including allowGeneratedProperty\n * and onSetGeneratedProperty. They are ignored when `layout` is `'table'`.\n */\ntype TreeOnlyProps = Omit<\n TreeSchemaEditorProps,\n | 'schema'\n | 'onChange'\n | 'labels'\n | 'className'\n | 'allowKeyProperty'\n | 'allowRequired'\n | 'readOnly'\n | 'isPropertyProtected'\n | 'validatePropertyName'\n | 'onPropertyRemoved'\n | 'onPropertyRenamed'\n | 'header'\n | 'footer'\n>;\n\nconst emptySchema: JsonSchema = {};\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\n/**\n * Recursively validates that a parsed schema node, its required names, and every nested\n * `properties`, `definitions`, and `items` schema match the supported object shape. A JSON-valid\n * document can still contain malformed nested values (for example `properties.foo: null`,\n * `required: {}`, or `items: \"string\"`) that later code dereferences as schema data; those are\n * rejected here rather than crashing downstream.\n */\nconst isValidSchemaNode = (node: unknown): node is JsonSchema => {\n if (!isPlainObject(node)) {\n return false;\n }\n\n if (\n node.required !== undefined &&\n (!Array.isArray(node.required) ||\n !node.required.every((propertyName) => typeof propertyName === 'string'))\n ) {\n return false;\n }\n\n for (const nestedSchemas of [node.properties, node.definitions]) {\n if (nestedSchemas === undefined) continue;\n if (!isPlainObject(nestedSchemas)) return false;\n for (const nestedSchema of Object.values(nestedSchemas)) {\n if (!isValidSchemaNode(nestedSchema)) return false;\n }\n }\n\n if (node.items !== undefined && !isValidSchemaNode(node.items)) {\n return false;\n }\n\n return true;\n};\n\nconst cloneSchema = (schema: JsonSchema): JsonSchema | undefined => {\n try {\n const serializedSchema = JSON.stringify(schema);\n if (serializedSchema === undefined) return undefined;\n\n const parsedSchema: unknown = JSON.parse(serializedSchema);\n if (!isValidSchemaNode(parsedSchema)) {\n return undefined;\n }\n\n return parsedSchema;\n } catch {\n return undefined;\n }\n};\n\n/** Follows a drill-down path (property names and `$items`) to the schema it points at. */\nconst findSchemaAtPath = (root: JsonSchema, path: string[]): JsonSchema | undefined => {\n let target: JsonSchema | JsonSchemaProperty = root;\n for (const segment of path) {\n if (target.type === 'array' && segment === '$items') {\n target = target.items || {};\n } else if (target.properties && target.properties[segment]) {\n target = target.properties[segment];\n } else {\n return undefined;\n }\n }\n return target as unknown as JsonSchema;\n};\n\nconst asJsonSchema = (property: JsonSchemaProperty): JsonSchema => {\n // SAFETY: A nested \"object\" property has the same editable shape as a schema —\n // `properties`, `items`, and `required` all mean the same thing on both types.\n return property as unknown as JsonSchema;\n};\n\nconst asJsonSchemaProperty = (schema: JsonSchema): JsonSchemaProperty => {\n // SAFETY: The inverse of asJsonSchema; the shapes are structurally interchangeable.\n return schema as unknown as JsonSchemaProperty;\n};\n\n/**\n * Props for {@link SchemaEditor}.\n */\nexport interface SchemaEditorProps extends TreeOnlyProps {\n /**\n * Which editor to render. `'table'` (the default) is the breadcrumb-navigated table with an Edit, Save and\n * Cancel workflow; `'tree'` is the inline tree editor that applies every edit live. See the layout notes in\n * the documentation for the props each layout honors.\n */\n layout?: SchemaEditorLayout;\n\n /**\n * The JSON Schema being viewed or edited. Required unless the tree layout is controlled through\n * `properties`.\n */\n schema?: JsonSchema;\n\n /** Optional event-type label displayed in the editor header. */\n eventTypeName?: string;\n\n /** When false, the Edit action remains visible but cannot enter edit mode; defaults to `true`. */\n canEdit?: boolean;\n\n /**\n * When {@link canEdit} is false, this string is shown as a tooltip on an\n * inert Edit action to explain why editing is unavailable.\n */\n canNotEditReason?: string;\n\n /** Invoked with the updated schema and optional metadata after any structural change. */\n onChange?: ChangeHandler<JsonSchema>;\n\n /** Invoked when the user activates the Save action. */\n onSave?: () => void;\n\n /** Invoked when the user activates the Cancel action. */\n onCancel?: () => void;\n\n /** Initial edit-mode state; defaults to `false` (read-only). */\n editMode?: boolean;\n\n /** When true, hides the Save menu item even while in edit mode. */\n saveDisabled?: boolean;\n\n /** When true, hides the Cancel menu item even while in edit mode. */\n cancelDisabled?: boolean;\n\n /**\n * Override the list of selectable type formats per JSON Schema type. Each\n * entry contributes options to the type-format dropdown shown in edit\n * mode. Defaults to {@link DEFAULT_TYPE_FORMATS}.\n */\n typeFormats?: TypeFormat[];\n\n /**\n * Extra CSS class names appended to the editor root. Combined with the\n * default `schema-editor` class. For fine-grained styling of internal\n * Components controls, use product tokens and stable Cratis parts.\n */\n className?: string;\n\n /** Override any user-facing string (for localization). See {@link SchemaEditorLabels}. */\n labels?: Partial<SchemaEditorLabels>;\n\n /**\n * Offers the key toggle (`x-key`, at most one property per object). In the table layout this adds a Key\n * column, editable in edit mode; a function enables the column for every row. In the tree layout it is\n * offered on every property, or per property when a function is given.\n */\n allowKeyProperty?: TreeSchemaEditorProps['allowKeyProperty'];\n\n /**\n * Offers the toggle for whether a property must be present (the `required` list). In the table layout this\n * adds a Required column, editable in edit mode.\n */\n allowRequired?: boolean;\n\n /** Offers no edits at all. Tree layout only: the table layout is read-only until Edit is chosen, controlled by `canEdit`. */\n readOnly?: boolean;\n\n /** Decides which properties can be neither renamed nor removed. By default none. Both layouts. */\n isPropertyProtected?: (property: Property) => boolean;\n\n /**\n * Extra check of a new name, after the editor has rejected blank, reserved and duplicate names. Return the\n * message to show, or `undefined` to accept the name. Both layouts.\n */\n validatePropertyName?: (name: string, property: Property, siblings: Property[]) => string | undefined;\n\n /** Called after a property was removed, with the property and everything nested under it. Both layouts. */\n onPropertyRemoved?: (property: Property) => void;\n\n /** Called after a property was renamed, with the renamed property and the name it had. Both layouts. */\n onPropertyRenamed?: (property: Property, previousName: string) => void;\n\n /** Content above the editor, for example the title of the schema. Both layouts. */\n header?: ReactNode;\n\n /** Content below the properties, for example further actions. Both layouts. */\n footer?: ReactNode;\n}\n\n/**\n * A breadcrumb-navigated editor for JSON Schemas. Lets users browse nested\n * `object` and `array` property definitions, add or remove properties, change\n * types and formats, and validate naming rules in place. Designed to drive\n * UIs around event payload schemas and similar structural documents.\n *\n * The editor composes a Cratis data table, action toolbar, and form widgets\n * internally. Restyle it through semantic tokens, the editor root `className`,\n * and documented `data-cratis-part` values rather than a provider preset.\n *\n * @param props - {@link SchemaEditorProps}.\n */\nconst TableSchemaEditor = ({\n schema: suppliedSchema,\n eventTypeName = '',\n canEdit = true,\n canNotEditReason,\n onChange,\n onSave,\n onCancel,\n editMode,\n saveDisabled = false,\n cancelDisabled = false,\n typeFormats = DEFAULT_TYPE_FORMATS,\n className,\n labels,\n allowKeyProperty,\n allowRequired,\n isPropertyProtected,\n validatePropertyName: validateCustomPropertyName,\n onPropertyRemoved,\n onPropertyRenamed,\n header,\n footer,\n}: SchemaEditorProps) => {\n const schema = suppliedSchema ?? emptySchema;\n const l = useMemo(() => ({ ...defaultSchemaEditorLabels, ...labels }) as Required<SchemaEditorLabels>, [labels]);\n const showKey = allowKeyProperty !== undefined && allowKeyProperty !== false;\n const showRequired = allowRequired === true;\n const [currentPath, setCurrentPath] = useState<string[]>([]);\n const [properties, setProperties] = useState<JsonSchemaProperty[]>([]);\n const [initialParsedSchema] = useState<JsonSchema | undefined>(() =>\n cloneSchema(schema),\n );\n const [currentSchema, setCurrentSchema] = useState<JsonSchema>(\n initialParsedSchema ?? {},\n );\n const [isEditMode, setIsEditMode] = useState(editMode ?? false);\n const [initialSchema, setInitialSchema] = useState<JsonSchema>(\n initialParsedSchema ?? {},\n );\n const [schemaJsonIsInvalid, setSchemaJsonIsInvalid] = useState(\n initialParsedSchema === undefined,\n );\n const [validationErrors, setValidationErrors] = useState<Record<string, string>>({});\n\n useEffect(() => {\n if (!isEditMode) {\n setCurrentPath([]);\n }\n }, [isEditMode]);\n\n const validateAllProperties = useCallback(\n (properties: JsonSchemaProperty[], level: Property[] = []) => {\n const errors: Record<string, string> = {};\n\n properties.forEach((prop) => {\n let error = validatePropertyName(prop.name ?? '', prop.id!, properties);\n if (!error && validateCustomPropertyName) {\n const property = level.find((candidate) => candidate.name === prop.name);\n if (property) {\n error = validateCustomPropertyName(property.name, property, level);\n }\n }\n if (error) {\n errors[prop.id!] = error;\n }\n });\n\n setValidationErrors(errors);\n return Object.keys(errors).length === 0;\n },\n [validatePropertyName, validateCustomPropertyName],\n );\n\n useEffect(() => {\n const parsedSchema = cloneSchema(schema);\n if (!parsedSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n setSchemaJsonIsInvalid(false);\n setCurrentSchema(parsedSchema);\n setInitialSchema(parsedSchema);\n }, [schema]);\n\n useEffect(() => {\n loadPropertiesForCurrentPath();\n }, [currentPath, currentSchema, isEditMode]);\n\n const loadPropertiesForCurrentPath = () => {\n let targetSchema: JsonSchema | JsonSchemaProperty = currentSchema;\n\n for (const segment of currentPath) {\n if (targetSchema.type === 'array' && segment === '$items') {\n targetSchema = targetSchema.items || {};\n } else if (targetSchema.properties && targetSchema.properties[segment]) {\n targetSchema = targetSchema.properties[segment] as\n JsonSchema | JsonSchemaProperty;\n } else {\n return;\n }\n }\n\n const schemaProps: JsonSchemaProperty[] = [];\n if (targetSchema.properties) {\n let idCounter = 0;\n for (const [name, property] of Object.entries(targetSchema.properties)) {\n schemaProps.push({\n id: `prop-${currentPath.join('-')}-${idCounter++}`,\n name,\n type: property.type || 'string',\n format: property.format,\n description: property.description,\n items: property.items,\n properties: property.properties,\n // A property's own `required` array (populated when its `type`\n // is \"object\") lists which of *its* properties are required.\n // It is scoped to this property alone — never to the parent\n // schema's `required` array — and is carried through verbatim\n // so navigating into it (see asJsonSchema) sees it intact.\n required: property.required,\n });\n }\n }\n\n setProperties(schemaProps);\n if (isEditMode) {\n validateAllProperties(schemaProps, jsonSchemaToProperties(targetSchema as unknown as JsonSchema));\n }\n };\n\n const updateSchemaAtPath = useCallback(\n (path: string[], updater: (schema: JsonSchema) => JsonSchema) => {\n const newSchema = cloneSchema(currentSchema);\n if (!newSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n if (path.length === 0) {\n const updated = updater(newSchema);\n setCurrentSchema(updated);\n onChange?.(updated, { source: 'user' });\n return;\n }\n\n let targetSchema = newSchema;\n for (let i = 0; i < path.length - 1; i++) {\n const segment = path[i];\n if (targetSchema.type === 'array' && segment === '$items') {\n if (!targetSchema.items) {\n targetSchema.items = { type: 'object', properties: {} };\n }\n targetSchema = targetSchema.items;\n } else if (targetSchema.properties && targetSchema.properties[segment]) {\n targetSchema = asJsonSchema(targetSchema.properties[segment]);\n }\n }\n\n const lastSegment = path[path.length - 1];\n if (targetSchema.type === 'array' && lastSegment === '$items') {\n targetSchema.items = updater(targetSchema.items || {});\n } else {\n if (!targetSchema.properties) {\n targetSchema.properties = {};\n }\n const propertySchema = targetSchema.properties[lastSegment];\n targetSchema.properties[lastSegment] = asJsonSchemaProperty(\n updater(propertySchema ? asJsonSchema(propertySchema) : {}),\n );\n }\n\n setCurrentSchema(newSchema);\n onChange?.(newSchema, { source: 'user' });\n },\n [currentSchema, onChange],\n );\n\n const addProperty = useCallback(() => {\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n let newName = 'newProperty';\n let counter = 1;\n while (newProps[newName]) {\n newName = `newProperty${counter++}`;\n }\n newProps[newName] = { type: 'string' };\n return { ...schema, properties: newProps };\n });\n }, [currentPath, updateSchemaAtPath]);\n\n /** The editable view of the properties at the current path, for the host callbacks. */\n const getLevelProperties = useCallback(\n () => jsonSchemaToProperties(findSchemaAtPath(currentSchema, currentPath)),\n [currentSchema, currentPath],\n );\n\n const isProtected = useCallback(\n (propertyName: string) => {\n if (!isPropertyProtected) return false;\n const property = getLevelProperties().find((candidate) => candidate.name === propertyName);\n return property !== undefined && isPropertyProtected(property);\n },\n [isPropertyProtected, getLevelProperties],\n );\n\n const removeProperty = useCallback(\n (propertyName: string) => {\n const removed = getLevelProperties().find((candidate) => candidate.name === propertyName);\n if (removed && isPropertyProtected?.(removed)) return;\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n delete newProps[propertyName];\n\n // Deleting a property must also drop it from this schema's own\n // `required` array, or the array keeps naming a property that no\n // longer exists in `properties`.\n const updated: JsonSchema = { ...schema, properties: newProps };\n if (schema.required?.includes(propertyName)) {\n updated.required = schema.required.filter(\n (name) => name !== propertyName,\n );\n }\n\n return updated;\n });\n if (removed) onPropertyRemoved?.(removed);\n },\n [currentPath, updateSchemaAtPath, getLevelProperties, isPropertyProtected, onPropertyRemoved],\n );\n\n const setRequired = useCallback(\n (propertyName: string, isRequired: boolean) => {\n updateSchemaAtPath(currentPath, (schema) => {\n const others = (schema.required ?? []).filter((name) => name !== propertyName);\n const required = isRequired ? [...others, propertyName] : others;\n const updated: JsonSchema = { ...schema };\n if (required.length > 0) {\n updated.required = required;\n } else {\n delete updated.required;\n }\n return updated;\n });\n },\n [currentPath, updateSchemaAtPath],\n );\n\n const setKey = useCallback(\n (propertyName: string) => {\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps: Record<string, JsonSchemaProperty> = {};\n for (const [name, property] of Object.entries(schema.properties || {})) {\n const { [KEY_KEYWORD]: previousKey, ...rest } = property as JsonSchemaProperty & Record<string, unknown>;\n const makeKey = name === propertyName && previousKey !== true;\n newProps[name] = (makeKey ? { ...rest, [KEY_KEYWORD]: true } : rest) as JsonSchemaProperty;\n }\n return { ...schema, properties: newProps };\n });\n },\n [currentPath, updateSchemaAtPath],\n );\n\n const updateProperty = useCallback(\n (\n oldName: string,\n field: keyof JsonSchemaProperty,\n value: unknown,\n additionalUpdates?: Partial<JsonSchemaProperty>,\n ) => {\n let renamed: Property | undefined;\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n const prop = { ...(newProps[oldName] || {}) };\n\n let newRequired = schema.required;\n\n if (field === 'name') {\n const newName = value as string;\n if (newName !== oldName && !newProps[newName] && !isProtected(oldName)) {\n renamed = jsonSchemaToProperties({ properties: { [newName]: prop } })[0];\n newProps[newName] = prop;\n delete newProps[oldName];\n\n // Renaming a required property must keep the `required`\n // array pointing at the new name, or it goes stale and\n // silently references a property that no longer exists.\n if (schema.required?.includes(oldName)) {\n newRequired = schema.required.map((name) =>\n name === oldName ? newName : name,\n );\n }\n }\n } else if (field === 'type') {\n prop.type = value as string;\n // A concept belongs to the type it was chosen for; the table offers no concepts.\n delete (prop as Record<string, unknown>)['x-concept'];\n if (value === 'array') {\n prop.items = { type: 'string' };\n delete prop.format;\n // Only an \"object\" property has a meaningful `required`\n // array of its own; any prior one is now stale.\n delete prop.required;\n } else if (value === 'object') {\n prop.properties = {};\n delete prop.format;\n delete prop.items;\n // Starting fresh with empty `properties`, so any prior\n // `required` array (naming properties that no longer\n // exist here) would be stale.\n delete prop.required;\n } else {\n delete prop.items;\n delete prop.properties;\n delete prop.required;\n }\n\n if (additionalUpdates) {\n if ('format' in additionalUpdates) {\n if (additionalUpdates.format) {\n prop.format = additionalUpdates.format as string;\n } else {\n delete prop.format;\n }\n }\n }\n\n newProps[oldName] = prop;\n } else if (field === 'format') {\n if (value && value !== 'none') {\n prop.format = value as string;\n } else {\n delete prop.format;\n }\n newProps[oldName] = prop;\n }\n\n return { ...schema, properties: newProps, required: newRequired };\n });\n if (renamed) onPropertyRenamed?.(renamed, oldName);\n },\n [currentPath, updateSchemaAtPath, isProtected, onPropertyRenamed],\n );\n\n const updateArrayItemType = useCallback(\n (propertyName: string, itemType: string) => {\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n const prop = { ...(newProps[propertyName] || {}) };\n\n if (itemType === 'object') {\n prop.items = { type: 'object', properties: {} };\n } else if (itemType === 'array') {\n prop.items = { type: 'array', items: { type: 'string' } };\n } else {\n prop.items = { type: itemType };\n }\n\n newProps[propertyName] = prop;\n return { ...schema, properties: newProps };\n });\n },\n [currentPath, updateSchemaAtPath],\n );\n\n const navigateToProperty = useCallback(\n (propertyName: string) => {\n setCurrentPath([...currentPath, propertyName]);\n },\n [currentPath],\n );\n\n const navigateToArrayItems = useCallback(\n (propertyName: string) => {\n setCurrentPath([...currentPath, propertyName, '$items']);\n },\n [currentPath],\n );\n\n const navigateBack = useCallback(() => {\n if (currentPath.length > 0) {\n setCurrentPath(currentPath.slice(0, -1));\n }\n }, [currentPath]);\n\n const navigateToBreadcrumb = useCallback(\n (index: number) => {\n const items = getBreadcrumbItems();\n setCurrentPath(items[index].path);\n },\n [currentPath, eventTypeName],\n );\n\n const handleSave = useCallback(() => {\n if (schemaJsonIsInvalid) return;\n\n onSave?.();\n setIsEditMode(false);\n }, [onSave, schemaJsonIsInvalid]);\n\n const handleCancel = useCallback(() => {\n const restoredSchema = cloneSchema(initialSchema);\n const changedSchema = cloneSchema(initialSchema);\n if (!restoredSchema || !changedSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n const hasChanges = JSON.stringify(currentSchema) !== JSON.stringify(initialSchema);\n setCurrentSchema(restoredSchema);\n if (hasChanges) {\n onChange?.(changedSchema, { source: 'reset' });\n }\n setIsEditMode(false);\n onCancel?.();\n }, [currentSchema, initialSchema, onChange, onCancel]);\n\n const handleEdit = useCallback(() => {\n if (schemaJsonIsInvalid) return;\n\n const parsedSchema = cloneSchema(currentSchema);\n if (!parsedSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n setInitialSchema(parsedSchema);\n setIsEditMode(true);\n }, [currentSchema, schemaJsonIsInvalid]);\n\n const getBreadcrumbItems = () => buildBreadcrumbItems(eventTypeName, currentPath);\n\n const getCurrentDescription = useCallback(() => {\n let targetSchema: JsonSchema | JsonSchemaProperty = currentSchema;\n\n for (const segment of currentPath) {\n if (targetSchema.type === 'array' && segment === '$items') {\n targetSchema = targetSchema.items || {};\n } else if (targetSchema.properties && targetSchema.properties[segment]) {\n targetSchema = targetSchema.properties[segment] as\n JsonSchema | JsonSchemaProperty;\n } else {\n return undefined;\n }\n }\n\n return targetSchema.description;\n }, [currentSchema, currentPath]);\n\n const hasValidationErrors =\n schemaJsonIsInvalid || Object.keys(validationErrors).length > 0;\n\n const menuItems = useMemo<ActionMenuItem[]>(\n () => [\n ...(isEditMode\n ? []\n : [\n {\n label: l.edit,\n icon: <faIcons.FaPencil className='cratis:mr-2' />,\n command:\n canEdit && !schemaJsonIsInvalid ? handleEdit : undefined,\n disabled: schemaJsonIsInvalid,\n className: canEdit ? undefined : 'edit-disabled-with-reason',\n template:\n !canEdit && canNotEditReason\n ? (item: ActionMenuItem) => (\n <Tooltip\n content={canNotEditReason}\n position='bottom'\n >\n <button\n type='button'\n aria-disabled='true'\n style={{\n border: 0,\n background: 'transparent',\n color: 'inherit',\n cursor: 'not-allowed',\n opacity: 0.6,\n display: 'inline-flex',\n alignItems: 'center',\n padding: '0.5rem 0.75rem',\n }}\n >\n {item.icon}\n <span>{item.label}</span>\n </button>\n </Tooltip>\n )\n : undefined,\n },\n ]),\n ...(isEditMode\n ? [\n ...(saveDisabled\n ? []\n : [\n {\n label: l.save,\n icon: <faIcons.FaCheck className='cratis:mr-2' />,\n command: hasValidationErrors ? undefined : handleSave,\n disabled: hasValidationErrors,\n },\n ]),\n ...(cancelDisabled\n ? []\n : [\n {\n label: l.cancel,\n icon: <faIcons.FaXmark className='cratis:mr-2' />,\n command: handleCancel,\n },\n ]),\n {\n label: l.addProperty,\n icon: <faIcons.FaPlus className='cratis:mr-2' />,\n command: schemaJsonIsInvalid ? undefined : addProperty,\n disabled: schemaJsonIsInvalid,\n },\n ]\n : []),\n ],\n [\n isEditMode,\n handleSave,\n handleCancel,\n handleEdit,\n addProperty,\n canEdit,\n canNotEditReason,\n hasValidationErrors,\n schemaJsonIsInvalid,\n saveDisabled,\n cancelDisabled,\n l,\n ],\n );\n\n const breadcrumbItems = getBreadcrumbItems();\n const isAtRoot = currentPath.length === 0;\n const currentDescription = getCurrentDescription();\n const currentLevel = findSchemaAtPath(currentSchema, currentPath);\n\n return (\n <div\n className={className ? `schema-editor ${className}` : 'schema-editor'}\n style={{ display: 'flex', flexDirection: 'column', height: '100%' }}\n >\n {header}\n <div className='cratis:px-4 cratis:py-4'>\n <div className='schema-editor-menubar'>\n <ActionMenubar aria-label={l.actions} model={menuItems} />\n </div>\n {schemaJsonIsInvalid && (\n <Message\n severity='error'\n text={l.invalidJson}\n className='cratis:mt-3'\n />\n )}\n </div>\n\n <div className='cratis:px-4 cratis:py-2 cratis-schema-editor-bottom-border'>\n <div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>\n <Tooltip content={l.navigateBack} position='top'>\n <Button\n variant='ghost'\n size='small'\n icon={<faIcons.FaArrowLeft />}\n onClick={navigateBack}\n disabled={isAtRoot}\n aria-label={l.navigateBack}\n />\n </Tooltip>\n <div\n style={{\n fontSize: '0.9rem',\n color: 'var(--cratis-text-color-secondary)',\n cursor: 'pointer',\n }}\n >\n {breadcrumbItems.map((item, index) => (\n <span key={index}>\n {index > 0 && <span className='cratis:mx-2'>&gt;</span>}\n <button\n type='button'\n onClick={() => navigateToBreadcrumb(index)}\n aria-current={\n index === breadcrumbItems.length - 1\n ? 'location'\n : undefined\n }\n style={{\n padding: 0,\n border: 0,\n background: 'transparent',\n color: 'inherit',\n font: 'inherit',\n cursor: 'pointer',\n textDecoration:\n index < breadcrumbItems.length - 1\n ? 'underline'\n : 'none',\n }}\n >\n {item.name}\n </button>\n </span>\n ))}\n </div>\n </div>\n {currentDescription && (\n <div\n style={{\n fontSize: '0.875rem',\n color: 'var(--cratis-text-color-secondary)',\n marginTop: '0.5rem',\n marginLeft: '2.5rem',\n fontStyle: 'italic',\n display: 'flex',\n alignItems: 'center',\n gap: '0.5rem',\n }}\n >\n <faIcons.FaCircleInfo />\n <span>{currentDescription}</span>\n </div>\n )}\n </div>\n\n <div style={{ flex: 1, overflow: 'auto', padding: '1rem' }}>\n <DataTableCore<JsonSchemaProperty>\n key={`${isEditMode}-${currentPath.join('/')}`}\n data={properties}\n dataKey='id'\n emptyMessage={l.emptyMessage}\n rowClassName={(rowData) => {\n if (\n !isEditMode &&\n (rowData.type === 'object' ||\n (rowData.type === 'array' &&\n rowData.items?.type === 'object'))\n ) {\n return 'cratis-schema-editor-navigable-row';\n }\n return '';\n }}\n onRowClick={(e) => {\n if (!isEditMode) {\n const rowData = e.data;\n if (rowData.name) {\n if (rowData.type === 'object') {\n navigateToProperty(rowData.name);\n } else if (\n rowData.type === 'array' &&\n rowData.items?.type === 'object'\n ) {\n navigateToArrayItems(rowData.name);\n }\n }\n }\n }}\n pt={{\n root: { style: { border: 'none' } },\n body: {\n style: {\n borderTop: '1px solid var(--cratis-surface-border)',\n },\n },\n }}\n >\n <Column\n field='name'\n header='Property'\n body={(rowData: JsonSchemaProperty) => (\n <NameCell\n rowData={rowData}\n isEditMode={isEditMode}\n onUpdate={updateProperty}\n validationError={validationErrors[rowData.id!]}\n propertyNameLabel={l.propertyName}\n isLocked={isProtected(rowData.name ?? '')}\n lockedReason={l.protectedProperty}\n />\n )}\n style={{ width: '30%' }}\n />\n {showRequired && (\n <Column\n header={l.requiredColumn}\n body={(rowData: JsonSchemaProperty) => (\n <Checkbox\n aria-label={l.requiredProperty(rowData.name ?? '')}\n checked={Boolean(currentLevel?.required?.includes(rowData.name ?? ''))}\n readOnly={!isEditMode}\n onChange={(checked) => setRequired(rowData.name ?? '', checked)}\n />\n )}\n style={{ width: '6rem' }}\n />\n )}\n {showKey && (\n <Column\n header={l.keyColumn}\n body={(rowData: JsonSchemaProperty) => (\n <Checkbox\n aria-label={l.keyProperty(rowData.name ?? '')}\n checked={isKeyProperty(currentLevel, rowData.name ?? '')}\n readOnly={!isEditMode}\n onChange={() => setKey(rowData.name ?? '')}\n />\n )}\n style={{ width: '6rem' }}\n />\n )}\n <Column\n header='Type'\n body={(rowData: JsonSchemaProperty) => (\n <TypeCell\n rowData={rowData}\n isEditMode={isEditMode}\n typeFormats={typeFormats}\n onUpdateProperty={updateProperty}\n onUpdateArrayItemType={updateArrayItemType}\n onNavigateToProperty={navigateToProperty}\n onNavigateToArrayItems={navigateToArrayItems}\n onRemoveProperty={removeProperty}\n canRemove={!isProtected(rowData.name ?? '')}\n labels={l}\n />\n )}\n style={{ width: '70%' }}\n />\n </DataTableCore>\n </div>\n {footer}\n </div>\n );\n};\n\nconst isKeyProperty = (level: JsonSchema | undefined, propertyName: string): boolean =>\n (level?.properties?.[propertyName] as Record<string, unknown> | undefined)?.[KEY_KEYWORD] === true;\n\n/**\n * Edits the properties of a JSON Schema. By default (`layout='table'`) it is a breadcrumb-navigated table: it\n * lets users browse nested `object` and `array` property definitions, add or remove properties, change types and\n * formats, and validate naming rules in place, behind an Edit, Save and Cancel workflow. With `layout='tree'` it\n * is an inline tree that shows nested properties in place and applies every edit live. Designed to drive UIs\n * around event payload schemas and similar structural documents.\n *\n * Both layouts accept `allowRequired`, `allowKeyProperty`, `isPropertyProtected`, `validatePropertyName`,\n * `onPropertyRenamed`, `onPropertyRemoved`, `header` and `footer`. The tree layout also takes concepts, controlled\n * mode, per-row slots and selection; see the documentation for the exact split.\n *\n * The table layout composes a Cratis data table, action toolbar, and form widgets internally. Restyle it through\n * semantic tokens, the editor root `className`, and documented `data-cratis-part` values rather than a provider\n * preset.\n *\n * @param props - {@link SchemaEditorProps}.\n */\nexport const SchemaEditor = (props: SchemaEditorProps) =>\n props.layout === 'tree' ? <TreeSchemaEditor {...props} /> : <TableSchemaEditor {...props} />;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;AAmDA,MAAM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,EAAE,YAAoB,KACrE,KAAK,EAAE,UAAU,GAAG,YAAY,CAAyC,GAAG,WAAW,CAAC,KAAK,IAAI;AAmB/F,MAAM,YAAY,GAAG,CAAC,KAAwB,KACjD,KAAK,CAAC,MAAM,KAAK,MAAM,GAAGA,GAAA,CAAC,gBAAgB,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI,GAAGA,GAAA,CAAC,iBAAiB,EAAA,EAAA,GAAK,KAAK;;"}
@@ -64,6 +64,12 @@ export interface SchemaEditorLabels {
64
64
  setAsKey?: string;
65
65
  /** Tooltip of the key toggle while the property is the key. */
66
66
  isKey?: string;
67
+ /** Tree layout: accessible name of the Generated toggle. */
68
+ generatedProperty?: (propertyName: string) => string;
69
+ /** Tree layout: tooltip of the Generated toggle while the value is entered. */
70
+ setAsGenerated?: string;
71
+ /** Tree layout: tooltip of the Generated toggle while the value is generated. */
72
+ isGenerated?: string;
67
73
  /** Column header of the key column in the table layout. */
68
74
  keyColumn?: string;
69
75
  /** Column header of the required column in the table layout. */
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaEditorLabels.d.ts","sourceRoot":"","sources":["../../../SchemaEditor/SchemaEditorLabels.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAC/B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,wBAAwB,EAAE,MAAM,CAAC;IACjC,qEAAqE;IACrE,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iDAAiD;IACjD,YAAY,EAAE,MAAM,C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E,MAAM,CAAC;CAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaEditorLabels.js","sourceRoot":"","sources":["../../../SchemaEditor/SchemaEditorLabels.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * User-facing strings for {@link SchemaEditor}. Every field is optional; pass a\n * partial `labels` to override any of them (for localization). Omitted fields\n * fall back to {@link defaultSchemaEditorLabels} (English).\n */\nexport interface SchemaEditorLabels {\n /** Menu action that enters edit mode. */\n edit: string;\n /** Menu action that saves changes. */\n save: string;\n /** Menu action that cancels editing. */\n cancel: string;\n /** Menu action that adds a property. */\n addProperty: string;\n /** Accessible name for the action menubar. */\n actions: string;\n /** Accessible name and tooltip for the back button. */\n navigateBack: string;\n /** Shown when the schema has no properties. */\n emptyMessage: string;\n /** Accessible name for the \"drill into array item definition\" button. */\n navigateToItemDefinition: string;\n /** Accessible name for the \"drill into object properties\" button. */\n navigateToProperties: string;\n /** Accessible name for a property-name input. */\n propertyName: string;\n /** Accessible name for a property-type selector. */\n propertyType: string;\n /** Accessible name for an array item-type selector. */\n arrayItemType: string;\n /** Accessible name for the \"remove property\" button. */\n deleteProperty: string;\n /** Validation message shown when the schema cannot be represented as valid JSON. */\n invalidJson: string;\n\n /** Tree layout and capabilities: accessible name of the editor when the host supplies none. Default `Schema properties`. */\n schema?: string;\n /** Tree layout: accessible name of the button that adds a property to a nested object. */\n addPropertyTo?: (propertyName: string) => string;\n /** Tree layout: accessible name of the list of properties nested under a property. */\n nestedProperties?: (propertyName: string) => string;\n /** Tree layout: accessible name of the input used to rename a property. Receives the property's current name. */\n propertyNameFor?: (propertyName: string) => string;\n /** Tree layout: tooltip of the control that starts renaming a property. */\n renameHint?: string;\n /** Tree layout: accessible name of the button that removes a property. */\n deletePropertyFor?: (propertyName: string) => string;\n /** Tree layout: accessible name of the button that opens the menu of types; receives the current type's name. */\n changeType?: (propertyName: string, typeName: string) => string;\n /** Tree layout: accessible name of the menu of types. */\n propertyTypes?: string;\n /** Heading of the concepts in the menu of types. */\n concepts?: string;\n /** Disabled hint in the menu of types when concepts are enabled but none are defined. */\n noConcepts?: string;\n /** Visible text of the toggle for whether a property must be present (`allowRequired`). */\n required?: string;\n /** Accessible name of the toggle for whether a property must be present. */\n requiredProperty?: (propertyName: string) => string;\n /** Explains what the required toggle means. */\n requiredHelp?: string;\n /** Accessible name of the toggle that makes a property the key of its object (`allowKeyProperty`). */\n keyProperty?: (propertyName: string) => string;\n /** Tooltip of the key toggle while the property is not the key. */\n setAsKey?: string;\n /** Tooltip of the key toggle while the property is the key. */\n isKey?: string;\n /** Column header of the key column in the table layout. */\n keyColumn?: string;\n /** Column header of the required column in the table layout. */\n requiredColumn?: string;\n /** Why a property cannot be renamed or removed (`isPropertyProtected`). */\n protectedProperty?: string;\n /** Tree layout: validation message for a blank name. */\n nameRequired?: string;\n /** Tree layout: validation message for a name that would shadow a member every object inherits. */\n nameReserved?: (name: string) => string;\n /** Tree layout: validation message for a name a sibling already uses. */\n nameDuplicate?: (name: string) => string;\n /** Tree layout: name of the `string` type. */\n typeString?: string;\n /** Tree layout: name of the `number` type. */\n typeNumber?: string;\n /** Tree layout: name of the `boolean` type. */\n typeBoolean?: string;\n /** Tree layout: name of the `date` type. */\n typeDate?: string;\n /** Tree layout: name of the `time` type. */\n typeTime?: string;\n /** Tree layout: name of the list-of-text type. */\n typeStringArray?: string;\n /** Tree layout: name of the list-of-numbers type. */\n typeNumberArray?: string;\n /** Tree layout: name of the nested object type. */\n typeObject?: string;\n /** Tree layout: name of the list-of-objects type. */\n typeObjectArray?: string;\n}\n"]}
1
+ {"version":3,"file":"SchemaEditorLabels.js","sourceRoot":"","sources":["../../../SchemaEditor/SchemaEditorLabels.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * User-facing strings for {@link SchemaEditor}. Every field is optional; pass a\n * partial `labels` to override any of them (for localization). Omitted fields\n * fall back to {@link defaultSchemaEditorLabels} (English).\n */\nexport interface SchemaEditorLabels {\n /** Menu action that enters edit mode. */\n edit: string;\n /** Menu action that saves changes. */\n save: string;\n /** Menu action that cancels editing. */\n cancel: string;\n /** Menu action that adds a property. */\n addProperty: string;\n /** Accessible name for the action menubar. */\n actions: string;\n /** Accessible name and tooltip for the back button. */\n navigateBack: string;\n /** Shown when the schema has no properties. */\n emptyMessage: string;\n /** Accessible name for the \"drill into array item definition\" button. */\n navigateToItemDefinition: string;\n /** Accessible name for the \"drill into object properties\" button. */\n navigateToProperties: string;\n /** Accessible name for a property-name input. */\n propertyName: string;\n /** Accessible name for a property-type selector. */\n propertyType: string;\n /** Accessible name for an array item-type selector. */\n arrayItemType: string;\n /** Accessible name for the \"remove property\" button. */\n deleteProperty: string;\n /** Validation message shown when the schema cannot be represented as valid JSON. */\n invalidJson: string;\n\n /** Tree layout and capabilities: accessible name of the editor when the host supplies none. Default `Schema properties`. */\n schema?: string;\n /** Tree layout: accessible name of the button that adds a property to a nested object. */\n addPropertyTo?: (propertyName: string) => string;\n /** Tree layout: accessible name of the list of properties nested under a property. */\n nestedProperties?: (propertyName: string) => string;\n /** Tree layout: accessible name of the input used to rename a property. Receives the property's current name. */\n propertyNameFor?: (propertyName: string) => string;\n /** Tree layout: tooltip of the control that starts renaming a property. */\n renameHint?: string;\n /** Tree layout: accessible name of the button that removes a property. */\n deletePropertyFor?: (propertyName: string) => string;\n /** Tree layout: accessible name of the button that opens the menu of types; receives the current type's name. */\n changeType?: (propertyName: string, typeName: string) => string;\n /** Tree layout: accessible name of the menu of types. */\n propertyTypes?: string;\n /** Heading of the concepts in the menu of types. */\n concepts?: string;\n /** Disabled hint in the menu of types when concepts are enabled but none are defined. */\n noConcepts?: string;\n /** Visible text of the toggle for whether a property must be present (`allowRequired`). */\n required?: string;\n /** Accessible name of the toggle for whether a property must be present. */\n requiredProperty?: (propertyName: string) => string;\n /** Explains what the required toggle means. */\n requiredHelp?: string;\n /** Accessible name of the toggle that makes a property the key of its object (`allowKeyProperty`). */\n keyProperty?: (propertyName: string) => string;\n /** Tooltip of the key toggle while the property is not the key. */\n setAsKey?: string;\n /** Tooltip of the key toggle while the property is the key. */\n isKey?: string;\n /** Tree layout: accessible name of the Generated toggle. */\n generatedProperty?: (propertyName: string) => string;\n /** Tree layout: tooltip of the Generated toggle while the value is entered. */\n setAsGenerated?: string;\n /** Tree layout: tooltip of the Generated toggle while the value is generated. */\n isGenerated?: string;\n /** Column header of the key column in the table layout. */\n keyColumn?: string;\n /** Column header of the required column in the table layout. */\n requiredColumn?: string;\n /** Why a property cannot be renamed or removed (`isPropertyProtected`). */\n protectedProperty?: string;\n /** Tree layout: validation message for a blank name. */\n nameRequired?: string;\n /** Tree layout: validation message for a name that would shadow a member every object inherits. */\n nameReserved?: (name: string) => string;\n /** Tree layout: validation message for a name a sibling already uses. */\n nameDuplicate?: (name: string) => string;\n /** Tree layout: name of the `string` type. */\n typeString?: string;\n /** Tree layout: name of the `number` type. */\n typeNumber?: string;\n /** Tree layout: name of the `boolean` type. */\n typeBoolean?: string;\n /** Tree layout: name of the `date` type. */\n typeDate?: string;\n /** Tree layout: name of the `time` type. */\n typeTime?: string;\n /** Tree layout: name of the list-of-text type. */\n typeStringArray?: string;\n /** Tree layout: name of the list-of-numbers type. */\n typeNumberArray?: string;\n /** Tree layout: name of the nested object type. */\n typeObject?: string;\n /** Tree layout: name of the list-of-objects type. */\n typeObjectArray?: string;\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import type { Property } from './Property.js';
2
+ import type { SchemaPropertyContext } from './SchemaPropertyContext.js';
3
+ /** The property and its position in the tree. */
4
+ interface GeneratedToggleProps {
5
+ property: Property;
6
+ rowContext: SchemaPropertyContext;
7
+ }
8
+ /** Offers the Generated toggle, or shows a non-interactive marker for a generated value. */
9
+ export declare const GeneratedToggle: ({ property, rowContext }: GeneratedToggleProps) => import("react").JSX.Element | null;
10
+ export {};
11
+ //# sourceMappingURL=GeneratedToggle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeneratedToggle.d.ts","sourceRoot":"","sources":["../../../../SchemaEditor/Tree/GeneratedToggle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAAyB,CAAC;AAGrE,iDAAiD;AACjD,UAAU,oBAAoB;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,qBAAqB,CAAC;CACrC;AAMD,4FAA4F;AAC5F,eAAO,MAAM,eAAe,6BAA8B,oBAAoB,uCA+B7E,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { FaWandMagicSparkles } from 'react-icons/fa6';
3
+ import { useSchemaEditorContext } from './SchemaEditorContext.js';
4
+
5
+ function canToggleGenerated(context, property, rowContext) {
6
+ return !context.readOnly && context.operations.setGenerated !== undefined && context.isGeneratedAllowed(property, rowContext);
7
+ }
8
+ const GeneratedToggle = ({ property, rowContext }) => {
9
+ const context = useSchemaEditorContext();
10
+ const { labels, parts, operations } = context;
11
+ const { generated = {} } = parts ?? {};
12
+ const className = `cratis-schema-editor__toggle cratis-schema-editor__generated ${generated.className ?? ''}`;
13
+ const label = labels.generatedProperty(property.name);
14
+ const icon = jsx(FaWandMagicSparkles, { "aria-hidden": 'true' });
15
+ if (canToggleGenerated(context, property, rowContext)) {
16
+ return (jsx("button", { ...generated, type: 'button', "aria-pressed": property.isGenerated === true, "aria-label": label, title: property.isGenerated ? labels.isGenerated : labels.setAsGenerated, className: className, "data-cratis-part": 'generated', "data-pressed": property.isGenerated === true || undefined, onClick: () => operations.setGenerated?.(property.id, !property.isGenerated), children: icon }));
17
+ }
18
+ if (!property.isGenerated)
19
+ return null;
20
+ return (jsx("span", { className: className, style: { ...generated.style, cursor: 'default' }, role: 'img', "aria-label": label, title: label, "data-cratis-part": 'generated', "data-pressed": true, children: icon }));
21
+ };
22
+
23
+ export { GeneratedToggle };
24
+ //# sourceMappingURL=GeneratedToggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeneratedToggle.js","sources":["../../../../SchemaEditor/Tree/GeneratedToggle.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { FaWandMagicSparkles } from 'react-icons/fa6';\nimport type { Property } from './Property';\nimport type { SchemaPropertyContext } from './SchemaPropertyContext';\nimport { useSchemaEditorContext, type SchemaEditorContextValue } from './SchemaEditorContext';\n\n/** The property and its position in the tree. */\ninterface GeneratedToggleProps {\n property: Property;\n rowContext: SchemaPropertyContext;\n}\n\nfunction canToggleGenerated(context: SchemaEditorContextValue, property: Property, rowContext: SchemaPropertyContext): boolean {\n return !context.readOnly && context.operations.setGenerated !== undefined && context.isGeneratedAllowed(property, rowContext);\n}\n\n/** Offers the Generated toggle, or shows a non-interactive marker for a generated value. */\nexport const GeneratedToggle = ({ property, rowContext }: GeneratedToggleProps) => {\n const context = useSchemaEditorContext();\n const { labels, parts, operations } = context;\n const { generated = {} } = parts ?? {};\n const className = `cratis-schema-editor__toggle cratis-schema-editor__generated ${generated.className ?? ''}`;\n const label = labels.generatedProperty(property.name);\n const icon = <FaWandMagicSparkles aria-hidden='true' />;\n\n if (canToggleGenerated(context, property, rowContext)) {\n return (\n <button\n {...generated}\n type='button'\n aria-pressed={property.isGenerated === true}\n aria-label={label}\n title={property.isGenerated ? labels.isGenerated : labels.setAsGenerated}\n className={className}\n data-cratis-part='generated'\n data-pressed={property.isGenerated === true || undefined}\n onClick={() => operations.setGenerated?.(property.id, !property.isGenerated)}\n >\n {icon}\n </button>\n );\n }\n if (!property.isGenerated) return null;\n return (\n <span className={className} style={{ ...generated.style, cursor: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EAAE,MAAM,UAAU,CAAC,YAAY,GAAG,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAA,QAAA,EAE3E,IAAI,EAAA,CACA;IAEjB;IACA,IAAI,CAAC,QAAQ,CAAC,WAAW;AAAE,QAAA,OAAO,IAAI;AACtC,IAAA,QACIA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,GAAG,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,IAAI,EAAC,KAAK,EAAA,YAAA,EAAa,KAAK,EAAE,KAAK,EAAE,KAAK,sBAAmB,WAAW,EAAA,cAAA,EAAA,IAAA,EAAA,QAAA,EACjJ,IAAI,EAAA,CACF;AAEf;;"}
@@ -24,6 +24,12 @@ export interface Property {
24
24
  children?: Property[];
25
25
  /** Whether the property identifies its parent object. At most one property of an object is the key. */
26
26
  isKey?: boolean;
27
+ /** Whether the value is generated when the command runs rather than entered. */
28
+ isGenerated?: boolean;
29
+ /** Other `x-` keywords on this property's schema node, preserved verbatim. */
30
+ vendorKeywords?: Readonly<Record<string, unknown>>;
31
+ /** `x-` keywords on an array's items node, preserved verbatim. */
32
+ itemVendorKeywords?: Readonly<Record<string, unknown>>;
27
33
  /** Whether the property must be present in its parent object (membership in the JSON Schema `required` list). */
28
34
  isRequired?: boolean;
29
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Property.d.ts","sourceRoot":"","sources":["../../../../SchemaEditor/Tree/Property.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAgB,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACrB;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IAEb,4CAA4C;IAC5C,IAAI,EAAE,YAAY,CAAC;IAEnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEtB,uGAAuG;IACvG,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,iHAAiH;IACjH,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB"}
1
+ {"version":3,"file":"Property.d.ts","sourceRoot":"","sources":["../../../../SchemaEditor/Tree/Property.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAgB,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACrB;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IAEb,4CAA4C;IAC5C,IAAI,EAAE,YAAY,CAAC;IAEnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEtB,uGAAuG;IACvG,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,gFAAgF;IAChF,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEnD,kEAAkE;IAClE,kBAAkB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEvD,iHAAiH;IACjH,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../../SchemaEditor/Tree/Property.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { PropertyType } from './PropertyType';\n\n/**\n * One editable property of a schema. The editor works on a tree of these and converts to and from\n * JSON Schema at its boundary.\n */\nexport interface Property {\n /**\n * Identifies the property for the lifetime of an editor session. Ids are generated when a schema is\n * converted into a tree, so they are not stable across sessions: persist the {@link Property.name},\n * not the id.\n */\n id: string;\n\n /** The name of the property; the key of the property in the JSON Schema object. */\n name: string;\n\n /** The kind of value the property holds. */\n type: PropertyType;\n\n /**\n * The name of the concept this property is typed as, when it is typed as one rather than as a bare\n * primitive. The concept wraps the primitive in {@link Property.type}, so everything that reasons about\n * the type keeps working; the name is carried alongside because that is what the domain calls the value.\n */\n concept?: string;\n\n /** The properties of a nested object, or of each item of an object list. */\n children?: Property[];\n\n /** Whether the property identifies its parent object. At most one property of an object is the key. */\n isKey?: boolean;\n\n /** Whether the property must be present in its parent object (membership in the JSON Schema `required` list). */\n isRequired?: boolean;\n}\n"]}
1
+ {"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../../SchemaEditor/Tree/Property.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { PropertyType } from './PropertyType';\n\n/**\n * One editable property of a schema. The editor works on a tree of these and converts to and from\n * JSON Schema at its boundary.\n */\nexport interface Property {\n /**\n * Identifies the property for the lifetime of an editor session. Ids are generated when a schema is\n * converted into a tree, so they are not stable across sessions: persist the {@link Property.name},\n * not the id.\n */\n id: string;\n\n /** The name of the property; the key of the property in the JSON Schema object. */\n name: string;\n\n /** The kind of value the property holds. */\n type: PropertyType;\n\n /**\n * The name of the concept this property is typed as, when it is typed as one rather than as a bare\n * primitive. The concept wraps the primitive in {@link Property.type}, so everything that reasons about\n * the type keeps working; the name is carried alongside because that is what the domain calls the value.\n */\n concept?: string;\n\n /** The properties of a nested object, or of each item of an object list. */\n children?: Property[];\n\n /** Whether the property identifies its parent object. At most one property of an object is the key. */\n isKey?: boolean;\n\n /** Whether the value is generated when the command runs rather than entered. */\n isGenerated?: boolean;\n\n /** Other `x-` keywords on this property's schema node, preserved verbatim. */\n vendorKeywords?: Readonly<Record<string, unknown>>;\n\n /** `x-` keywords on an array's items node, preserved verbatim. */\n itemVendorKeywords?: Readonly<Record<string, unknown>>;\n\n /** Whether the property must be present in its parent object (membership in the JSON Schema `required` list). */\n isRequired?: boolean;\n}\n"]}
@@ -13,6 +13,7 @@ export interface SchemaEditorOperations {
13
13
  rename?: (propertyId: string, name: string) => void;
14
14
  changeType?: (propertyId: string, type: PropertyType, concept?: string) => void;
15
15
  setKey?: (propertyId: string) => void;
16
+ setGenerated?: (propertyId: string, isGenerated: boolean) => void;
16
17
  setRequired?: (propertyId: string, isRequired: boolean) => void;
17
18
  }
18
19
  /** Everything the rows of an editor share. Internal: hosts configure the editor through its props. */
@@ -26,6 +27,7 @@ export interface SchemaEditorContextValue {
26
27
  selectedPropertyId: string | null | undefined;
27
28
  onPropertyClick: ((propertyId: string) => void) | undefined;
28
29
  isKeyAllowed: (property: Property, context: SchemaPropertyContext) => boolean;
30
+ isGeneratedAllowed: (property: Property, context: SchemaPropertyContext) => boolean;
29
31
  isRequiredAllowed: boolean;
30
32
  isProtected: (property: Property) => boolean;
31
33
  validateName: ((name: string, property: Property, siblings: Property[]) => string | undefined) | undefined;