ianstormtaylor/slate
 Watch   
 Star   
 Fork   
18 hours ago
slate

slate-dom@0.133.1

Patch Changes

  • #6203 e78057b Thanks @dylans! - Fall back to deleting backward by character when deleting to the start of a line has an empty range, allowing empty blocks and block starts to merge with preceding content.
18 hours ago
slate

slate@0.133.1

Patch Changes

  • #6204 94b1fcd Thanks @dylans! - Keep a valid insertion point when replacing a selection whose end node is removed: a void node for insertNodes or a read-only node for insertFragment.
1 days ago
slate

slate-react@0.133.0

Minor Changes

  • #6198 dd6d37f Thanks @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.
1 days ago
slate

slate-react@0.132.0

Minor Changes

  • #6190 bac6474 Thanks @dylans! - Type Editable's extra props as div attributes (React.HTMLAttributes<HTMLDivElement>) instead of textarea attributes. Textarea-only props such as rows, cols, maxLength, wrap and value never did anything on the editor's div; they now fail to type-check, so remove them.

Patch Changes

  • #6192 6bcf677 Thanks @dylans! - The default scrollSelectionIntoView now 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 own scrollSelectionIntoView to keep centering.
1 days ago
slate

slate@0.132.0

Minor Changes

  • #6187 d8cdecd Thanks @dylans! - Add Range.direction(range), which returns 'forward', 'backward' or 'collapsed'. Range.isForward and Range.isBackward are unchanged; a collapsed range still counts as forward, which is now documented.

Patch Changes

  • #6137 63134d0 Thanks @cpruijsen! - Fix the PropsMerge type for Transforms.setNodes so the merge option can return scalar property values, not just objects.
1 days ago
slate

slate-dom@0.132.0

Patch Changes

  • #6191 edda8d0 Thanks @dylans! - Copying text that contains inline voids, such as mentions, no longer puts each void on its own line in plain text.
2 days ago
slate

slate@0.131.0

Minor Changes

  • #6173 7850c31 Thanks @dylans! - Transforms.wrapNodes and Transforms.unwrapNodes now unhang a range by default and accept hanging, like setNodes, insertNodes, mergeNodes and removeNodes. A selection that ends at the start of the next block no longer wraps or unwraps that block. Pass hanging: true to keep the old behavior.

Patch Changes

  • #6177 fdc3dac Thanks @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 explicit at now act like removeNodes again.

  • #6176 22cf872 Thanks @dylans! - Fix insertFragment into an editor whose only block is empty, which left an extra untyped empty block before the inserted content (a regression in 0.130).

  • #6181 ec75af0 Thanks @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.

2 days ago
slate

slate-react@0.131.0

Minor Changes

  • #6183 35830d7 Thanks @dylans! - initialValue on <Slate> is now optional. When it's left out, the editor's existing editor.children are used, for editors created and filled ahead of rendering. Leaving it out while editor.children is empty throws with a hint to pass initialValue={[]} if an empty editor is intended.

Patch Changes

  • #6174 ae5dc30 Thanks @dylans! - autoFocus now focuses through ReactEditor.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 835e185 Thanks @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 7a4e15c Thanks @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 46cd8f9 Thanks @dylans! - An empty initialValue is now loaded as one empty block, so the editor has somewhere to put the cursor instead of breaking.

  • #6179 25f6353 Thanks @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 13d7c12 Thanks @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.

2 days ago
slate

slate-dom@0.131.0

Patch Changes

  • #6186 843bfaa Thanks @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 8cd5101 Thanks @dylans! - Copying an empty line now gives one blank line in plain text instead of two.

2 days ago
slate

slate-react@0.130.2

Patch Changes

  • #6171 7843bd5 Thanks @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 through editor.deleteFragment, like cut does, so plugins that guard deletion apply to both.