@json-layout/vocabulary 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@json-layout/vocabulary",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Main JSON Layout vocabulary as JSON schemas and Typescript types. Also contains some small utility functions to validate and normalize annotations.",
5
5
  "type": "module",
6
6
  "exports": {
package/src/normalize.js CHANGED
@@ -462,7 +462,7 @@ function lighterValidationErrors (errors) {
462
462
  return errors.map(e => e.message ?? e.keyword)
463
463
  }
464
464
 
465
- const defaultOptionsKeys = ['readOnly', 'summary', 'titleDepth', 'density', 'removeAdditional', 'validateOn', 'initialValidation', 'defaultOn', 'readOnlyPropertiesMode']
465
+ const defaultOptionsKeys = ['readOnly', 'summary', 'titleDepth', 'density', 'removeAdditional', 'validateOn', 'initialValidation', 'defaultOn', 'readOnlyPropertiesMode', 'debounceInputMs']
466
466
 
467
467
  /**
468
468
  * @param {SchemaFragment} schemaFragment
@@ -69,6 +69,10 @@ export function isSectionLayout (layout) {
69
69
 
70
70
  export const compositeCompNames = ['section', 'tabs', 'vertical-tabs', 'expansion-panels', 'stepper']
71
71
 
72
+ // these components can received keybord inputs and emit blur events
73
+ // they will be debounced and validateOn=blur is applicable
74
+ export const editableCompNames = ['text-field', 'number-field', 'textarea', 'markdown']
75
+
72
76
  /** @type {(layout: CompObject) => layout is CompositeCompObject} */
73
77
  export function isCompositeLayout (layout) {
74
78
  return compositeCompNames.includes(layout.comp)
@@ -1092,6 +1092,11 @@ export default {
1092
1092
  "show"
1093
1093
  ],
1094
1094
  "default": "show"
1095
+ },
1096
+ "debounceInputMs": {
1097
+ "type": "integer",
1098
+ "minimum": 0,
1099
+ "default": 300
1095
1100
  }
1096
1101
  }
1097
1102
  }
@@ -519,6 +519,11 @@
519
519
  "type": "string",
520
520
  "enum": ["remove", "hide", "show"],
521
521
  "default": "show"
522
+ },
523
+ "debounceInputMs": {
524
+ "type": "integer",
525
+ "minimum": 0,
526
+ "default": 300
522
527
  }
523
528
  }
524
529
  }
@@ -60,6 +60,7 @@ export type StateNodeOptionsBase = StateNodeOptionsBaseLib & {
60
60
  defaultOn?: "missing" | "empty" | "never";
61
61
  autofocus?: boolean;
62
62
  readOnlyPropertiesMode?: "remove" | "hide" | "show";
63
+ debounceInputMs?: number;
63
64
  [k: string]: unknown;
64
65
  };
65
66
  export type Cols = number;