Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve the expand and selection API's and the internal state, …
…and add a new query language JSON Query BREAKING CHANGE: - The internal state is refactored. This should not give any issues except when relying on some internal or undocumented features. - Changed the API to consistently use `undefined` instead of `null`. This involves properties `selection`, `onChange` (properties `contentErrors and `patchResult`), `onRenderContextMenu` (property `selection`), `onSelect`, and methods `validate`, and `select`. - Old deprecation messages are removed. - The API of the `expand` function is changed from `expand(callback)` to `expand(path, callback)`, and can't be used anymore for collapsing nodes. Instead, use the `collapse(path)` method for that. - The property `edit` is removed from the types `KeySelection` and `ValueSelection`, and two new types `EditKeySelection` and `EditValueSelection` are added. - The helper functions `createKeySelection` and `createValueSelection` are changed, argument `edit` is removed, and two new helper functions `createEditKeySelection` and `createEditValueSelection` are added. - The API of the component `EditableValue` requires an additional property `selection`. - Some of the class names related to selection highlighting are moved/changed. - The default query language is changed to `jsonquery`. - The vanilla editor needs to be instantiated using `createJSONEditor(...)` instead of `new JSONEditor(...)` in preparation for the upgrade to Svelte 5.
- Loading branch information