github ianstormtaylor/slate slate-history@0.144.0

2 hours ago

Minor Changes

  • #6323 075a4a0 Thanks @dylans! - Undo and redo now account for changes applied with HistoryEditor.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 64b036b Thanks @dylans! - Add Transforms.setChildren(editor, children) and the overridable editor.setChildren method, which apply an outside document through Slate operations instead of replacing editor.children. Unchanged nodes are kept, matched by identity or deep equality; shared nodes move with move_node; and text changes become insert_text/remove_text, so the selection, refs and history stay valid.

    withHistory records each setChildren call as one undo step, separate from typing before and after it.

    BaseEditor now requires setChildren. createEditor supplies it, but editors built by hand and test mocks must add it.

Don't miss a new slate release

NewReleases is sending notifications on new releases.