Changelog History
Page 2
-
v0.55.3
December 16, 2019 -
v0.55.2
December 16, 2019 -
v0.55.1
December 16, 2019 -
v0.55.0 Changes
December 15, 2019BREAKING
The
match
option must now be a function. Previously there were a few shorthands, like passing in a plain object. This behavior was removed because it made it harder to reason about exactly what was being matched, it made debugging harder, and it made it hard to type well. Now thematch
option must be a function that receives theNode
object to match. If you're using TypeScript, and the function you pass in is a type guard, that will be taken into account in the return value!Previously you might write:
Editor.nodes(editor, { at: range, match: 'text', }) Editor.nodes(editor, { at: range, match: { type: 'paragraph' }, })
Now you'd write:
Editor.nodes(editor, { at: range, match: Text.isText, }) Editor.nodes(editor, { at: range, match: node => node.type === 'paragraph', })
0️⃣ The
mode
option now defaults to'lowest'
. Previously the default varied depending on where in the codebase it was used. Now it defaults to'lowest'
everywhere, and you can always pass in'highest'
to change the behavior. The one exception is theEditor.nodes
helper which defaults to'all'
since that's the expected behavior most of the time.The
Editor.match
helper was renamed toEditor.above
. This was just to make it clear how it searched in the tree—it looks through all of the nodes directly above a location in the document.The
Editor.above/previous/next
helpers now take all options in a dictionary. Previously their APIs did not exactly match theEditor.nodes
helper which they are shorthand for, but now this is no longer the case. Theat
,match
andmode
options are all passed in theoptions
argument.Previously you would use:
Editor.previous(editor, path, n => Text.isText(n), { mode: 'lowest', })
Now you'd use:
Editor.previous(editor, { at: path, match: n => Text.isText(n), mode: 'lowest', ... })
🚚 The
Editor.elements
andEditor.texts
helpers were removed. These were simple convenience helpers that were rarely used. You can now achieve the same thing by using theEditor.nodes
helper directly along with thematch
option. For example:Editor.nodes(editor, { at: range, match: Element.isElement, })
-
v0.54.6 Changes
December 14, 20192019-12-14
-
v0.54.5 Changes
December 13, 20192019-12-13
-
v0.54.4 Changes
December 13, 20192019-12-13
-
v0.54.3 Changes
December 13, 20192019-12-13
-
v0.54.2 Changes
December 13, 20192019-12-13
-
v0.54.1
December 12, 2019