slate v0.27.0 Release Notes
Release Date: 2017-10-14 // over 6 years ago-
BREAKING
The
Range
model is now calledLeaf
. This is to disambiguate with the concept of "ranges" that is used throughout the codebase to be synonymous to selections. For example in methods likegetBlocksAtRange(selection)
.The
text.ranges
property in the JSON representation is nowtext.leaves
. When passing in JSON withtext.ranges
you'll now receive a deprecation warning in the console in development.🗄 ###### DEPRECATED
The
Selection
model is now calledRange
. This is to make it more clear what a "selection" really is, to make many of the other methods that act on "ranges" make sense, and to more closely parallel the native DOM API for selections and ranges. A mockSelection
object is still exported with deprecatedstatic
methods, to make the transition to the new API easier.The
Text.getRanges()
method is nowText.getLeaves()
. It will still work, and it will return a list of leaves, but you will see a deprecation warning in the console in development.