slate-react@0.133.0
- #6198
dd6d37fThanks @GaurangTandon! - Revert "Ignore input events dispatched by script" (#6117). Input, paste and drop events dispatched by script are handled again, as in 0.127.1.
slate-react@0.132.0
- #6190
bac6474Thanks @dylans! - TypeEditable's extra props asdivattributes (React.HTMLAttributes<HTMLDivElement>) instead oftextareaattributes. Textarea-only props such asrows,cols,maxLength,wrapandvaluenever did anything on the editor'sdiv; they now fail to type-check, so remove them.
- #6192
6bcf677Thanks @dylans! - The defaultscrollSelectionIntoViewnow scrolls just enough to reveal the caret (block: 'nearest') instead of centering it, so moving the caret with the arrow keys past the edge of the viewport no longer jumps the page by half a screen. Pass your ownscrollSelectionIntoViewto keep centering.
slate@0.132.0
- #6187
d8cdecdThanks @dylans! - AddRange.direction(range), which returns'forward','backward'or'collapsed'.Range.isForwardandRange.isBackwardare unchanged; a collapsed range still counts as forward, which is now documented.
- #6137
63134d0Thanks @cpruijsen! - Fix thePropsMergetype forTransforms.setNodesso themergeoption can return scalar property values, not just objects.
slate@0.131.0
- #6173
7850c31Thanks @dylans! -Transforms.wrapNodesandTransforms.unwrapNodesnow unhang a range by default and accepthanging, likesetNodes,insertNodes,mergeNodesandremoveNodes. A selection that ends at the start of the next block no longer wraps or unwraps that block. Passhanging: trueto keep the old behavior.
-
#6177
fdc3dacThanks @dylans! - Only refill an emptied editor when a delete runs at the selection. In 0.130,Transforms.delete(editor, { at: path })also inserted an untyped empty block when it removed the last node, which left an extra block behind in code that deletes every block and then inserts new content. Programmatic deletes with an explicitatnow act likeremoveNodesagain. -
#6176
22cf872Thanks @dylans! - FixinsertFragmentinto an editor whose only block is empty, which left an extra untyped empty block before the inserted content (a regression in 0.130). -
#6181
ec75af0Thanks @dylans! - Backspace at the start of a block that follows a list or table no longer pulls that block into the list or table. An empty previous block is now only removed in place of the merge when it's a sibling; otherwise the block merges into it as usual.
slate-react@0.131.0
- #6183
35830d7Thanks @dylans! -initialValueon<Slate>is now optional. When it's left out, the editor's existingeditor.childrenare used, for editors created and filled ahead of rendering. Leaving it out whileeditor.childrenis empty throws with a hint to passinitialValue={[]}if an empty editor is intended.
-
#6174
ae5dc30Thanks @dylans! -autoFocusnow focuses throughReactEditor.focus, which selects the start of the document when there's no selection, so you can type right away. Before, Firefox and Safari could end up focused with no selection, especially under React strict mode. -
#6182
835e185Thanks @dylans! - Ignore DOM selection changes while focus is outside the editor (unless it's read-only). Firefox moves the DOM selection of a blurred editor when its content changes, so inserting text from outside the editor, such as from a toolbar button, used to jump the selection to the start. -
#6184
7a4e15cThanks @dylans! - Keep the caret in the editor's text when the browser moves it to a spot Slate can't represent, such as below a table that ends the document after pressing ArrowDown. Typing there used to insert the character twice: once in the last cell and once as stray text outside the table. -
#6175
46cd8f9Thanks @dylans! - An emptyinitialValueis now loaded as one empty block, so the editor has somewhere to put the cursor instead of breaking. -
#6179
25f6353Thanks @dylans! - Fix clicks occasionally being undone when the editor re-renders right after them. A render inside the 100 ms selection-change throttle used to write the previous selection back to the DOM; it now applies the clicked selection instead. -
#6180
13d7c12Thanks @dylans! - Make the void spacer unselectable (user-select: none), so a selection that includes a void element no longer shows a darker band at its edge in Chromium.
slate-dom@0.131.0
-
#6186
843bfaaThanks @dylans! - Copying text inside an inline element, such as a link, now keeps that element in the copied HTML, so pasting into other apps (or HTML-based paste handlers) keeps the link. -
#6185
8cd5101Thanks @dylans! - Copying an empty line now gives one blank line in plain text instead of two.
slate-react@0.130.2
- #6171
7843bd5Thanks @dylans! - Moving whole lines by dragging or cutting no longer adds an empty line. Whole top-level blocks are now moved as blocks. Nested content, like list items and table cells, is moved without its trailing line break, so no containers get merged. Dropping text back onto its own selection is now a no-op, and drag-and-drop deletes througheditor.deleteFragment, like cut does, so plugins that guard deletion apply to both.