Currently, the new approach to do undo/redo actions does not support updates on nested list-like properties of a block, i.e., given the following structure:
The elements in content are nested, so the result of the formater would be:
op: "remove",
path: "3/data/content/1/1"
This means that element 1 would be removed from element 1 of content, this is not contemplated and currently the editorjs block API does not allow modifying data individually in the block properties, but in the whole block by means of the update function, therefore, it is necessary to make the following validations:
Identify if the operation is being performed on the block or on a property of the block.
Sanitize the data so that instead of performing a “remove, add, move” operation, a replace operation is performed.
This ensures that internal modifications are visible in the DOM.
Objective
[ ] Add support for operations on nested list-like properties of a block.
Context
Currently, the new approach to do undo/redo actions does not support updates on nested list-like properties of a block, i.e., given the following structure:
The elements in content are nested, so the result of the formater would be:
This means that element 1 would be removed from element 1 of content, this is not contemplated and currently the editorjs block API does not allow modifying data individually in the block properties, but in the whole block by means of the update function, therefore, it is necessary to make the following validations:
remove, add, move
” operation, a replace operation is performed.This ensures that internal modifications are visible in the DOM.
Objective