Minor Changes
-
#6323
075a4a0Thanks @dylans! - Undo and redo now account for changes applied withHistoryEditor.withoutSaving. Saved steps are moved past each unsaved operation, so inserting a block above earlier typing, or inserting text before it, no longer makes undo remove the wrong characters. Steps whose content was removed, or that can no longer be applied, are dropped instead of changing other content. -
#6314
64b036bThanks @dylans! - AddTransforms.setChildren(editor, children)and the overridableeditor.setChildrenmethod, which apply an outside document through Slate operations instead of replacingeditor.children. Unchanged nodes are kept, matched by identity or deep equality; shared nodes move withmove_node; and text changes becomeinsert_text/remove_text, so the selection, refs and history stay valid.withHistoryrecords eachsetChildrencall as one undo step, separate from typing before and after it.BaseEditornow requiressetChildren.createEditorsupplies it, but editors built by hand and test mocks must add it.