Skip to content

Releases: ianstormtaylor/slate

0.7.0

22 Nov 02:45
Compare
Choose a tag to compare
BREAKING CHANGES
  • The Raw serializer is no longer terse by default! Previously, the Raw serializer would return a "terse" representation of the document, omitting information that wasn't strictly necessary to deserialize later, like the key of nodes. By default this no longer happens. You have to opt-in to the behavior by passing { terse: true } as the second options argument of the deserialize and serialize methods.

0.6.0

22 Nov 02:45
Compare
Choose a tag to compare
BREAKING CHANGES
  • Void components are no longer rendered implicity! Previously, Slate would automatically wrap any node with isVoid: true in a <Void> component. But doing this prevented you from customizing the wrapper, like adding a className or style property. So you must now render the wrapper yourself, and it has been exported as Slate.Void. This, combined with a small change to the <Void> component's structure allows the "selected" state of void nodes to be rendered purely with CSS based on the :focus property of a <Void> element, which previously had to be handled in Javascript. This allows us to streamline selection-handling logic, improving performance and reducing complexity.
  • data-offset-key is now <key>-<index> instead of <key>:<start>-<end>. This shouldn't actually affect anyone, unless you were specifically relying on that attribute in the DOM. This change greatly reduces the number of re-renders needed, since previously any additional characters would cause a cascading change in the <start> and <end> offsets of latter text ranges.

0.5.0

22 Nov 02:41
Compare
Choose a tag to compare
BREAKING CHANGES
  • node.getTextNodes() is now node.getTexts(). This is just for consistency with the other existing Node methods like getBlocks(), getInlines(), etc. And it's nicely shorter. 😉
  • Node methods now throw earlier during unexpected states. This shouldn't break anything for most folks, unless a strange edge-case was going undetected previously.

0.4.0

22 Nov 02:41
Compare
Choose a tag to compare
BREAKING CHANGES
  • renderMark(mark, state, editor) is now renderMark(mark, marks, state, editor). This change allows you to render marks based on multiple marks presence at once on a given range of text, for example using a custom BoldItalic.otf font when text has both bold and italic marks.

0.3.0

22 Nov 02:42
Compare
Choose a tag to compare
BREAKING CHANGES
  • transform.unwrapBlock() now unwraps selectively. Previously, calling unwrapBlock with a range representing a middle sibling would unwrap all of the siblings, removing the wrapping block entirely. Now, calling it with those same arguments will only move the middle sibling up a layer in the hierarchy, preserving the nesting on any of its siblings. This changes makes it much simpler to implement functionality like unwrapping a single list item, which previously would unwrap the entire list.

0.2.0

22 Nov 02:42
Compare
Choose a tag to compare
BREAKING CHANGES
  • transform.mark() is now transform.addMark() and transform.unmark() is now transform.removeMark(). The new names make it clearer that the transforms are actions being performed, and it paves the way for adding a toggleMark convenience as well.