@json-layout/vocabulary 2.13.1 → 2.13.2

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": "2.13.1",
3
+ "version": "2.13.2",
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
@@ -822,7 +822,16 @@ export function normalizeLayoutFragment (key, schemaFragment, schemaPath, option
822
822
  errors.push(err.message)
823
823
  if (err.cause && Array.isArray(err.cause)) errors.push(...err.cause)
824
824
  errors.push('failed to normalize layout, use default component')
825
- const layout = normalizeValidLayoutFragment(key, { ...schemaFragment, layout: {} }, type, nullable, schemaPath, options, schemaChild)
825
+ // Clear the keyword that was actually read, not always `layout`: a oneOf child
826
+ // takes its keyword from `oneOfLayout` and a patternProperties child from
827
+ // `patternPropertiesLayout`, so clearing `layout` left the bad value in place, the
828
+ // retry failed the same way, and the node fell through to comp "none". For a oneOf
829
+ // that is not cosmetic — a variant selector that becomes "none" stops merging its
830
+ // branch into the parent, and the data silently stops matching the state tree.
831
+ const layoutKeyword = schemaChild === 'oneOf'
832
+ ? 'oneOfLayout'
833
+ : schemaChild === 'patternProperties' ? 'patternPropertiesLayout' : 'layout'
834
+ const layout = normalizeValidLayoutFragment(key, { ...schemaFragment, [layoutKeyword]: {} }, type, nullable, schemaPath, options, schemaChild)
826
835
  return { layout, errors }
827
836
  } catch (/** @type {any} */err) {
828
837
  errors.push(err.message)
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.js"],"names":[],"mappings":"AAiyBA;;;;;;;;;GASG;AACH,6CATW,MAAM,GAAG,MAAM,kBACf,cAAc,cACd,MAAM,WACL,OAAO,YAAY,EAAE,gBAAgB,gBACtC,OAAO,GA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