fix(deps): update dependency @blocknote/core to v0.20.0 #6344
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.19.2
->0.20.0
Release Notes
TypeCellOS/BlockNote (@blocknote/core)
v0.20.0
Compare Source
💖 Moving blocks as well as indentation & toolbar navigation changes have been sponsored by DINUM 🇫🇷 and ZenDiS 🇩🇪
💖 Table cell navigation changes have been sponsored by DeepOrigin💖
Moving blocks
[Breaking]
moveBlocksUp
/moveBlocksDown
methodsThe previously undocumented
moveBlockUp
&moveBlockDown
methods have been renamed tomoveBlocksUp
&moveBlocksDown
as they now support selections that span multiple blocks.Additionally, their behaviour is now more inline with Notion and they now work better with
"column"
and"columnList"
blocks from the@blocknote/xl-multi-column
package.Docs have also been added for both methods.
Keyboard shortcuts
The
Cmd+Shift+Up
/Cmd+Shift+Down
keyboard shortcuts (Ctrl+Shift+Up
/Ctrl+Shift+Down
for Windows) previously used themoveBlockUp
&moveBlockDown
methods, which are nowmoveBlocksUp
&moveBlocksDown
. This means that all the changes mentioned above also apply to those shortcuts.Improved
Tab
/Shift+Tab
handlingIndentation & toolbar navigation
Previously, while the formatting or link toolbars were open,
Tab
&Shift+Tab
was used to navigate them for keyboard accessibility. In order to useTab
/Shift+Tab
to indent/unindent the selected blocks, the user would have to first hitEscape
to close the toolbar(s). However, they would then immediately reopen, which would be frustrating when trying to move blocks up/down multiple nesting levels.Now, the formatting and link toolbars remain closed after indenting/unindenting with
Tab
/Shift+Tab
.Additionally, setting the new
tab-behaviour
editor option to"prefer-indent"
will causeTab
/Shift+Tab
to always indent/unindent the selected blocks, regardless of any open toolbars. Note that this will make the toolbars no longer keyboard accessible.Table cell navigation
Tab
/Shift+Tab
now navigate through cells when the selection is inside a table block, instead of indenting/unindenting the block.Updated editor methods
getBlock
Previously could only get regular blocks, now also works with
"column"
and"columnList"
blocks from the@blocknote/xl-multi-column
package.getSelection
[Breaking]Previously,
getSelection().blocks
would return blocks spanned by the selection at all nesting levels. This release changes that behaviour.In most cases,
getSelection().blocks
now returns only the blocks spanned by the selection at the shared depth, i.e. the minimum depth at which the blocks share a common ancestor.However, when the block in which the selection starts is at a higher depth than the shared depth, we omit the first block at the shared depth. Instead, we include the first block at its depth, and any blocks at a higher index up to the shared depth. The following example illustrates this:
Here, each block is represented by its ID, and the selection is represented by the
>|
and|<
markers. So the selection starts in blockid-2
and ends in blockid-9
.In this case, the blocks
id-6
,id-7
, andid-8
set the shared depth, as they are the least nested blocks spanned by the selection. Therefore, these blocks are all added to theblocks
array.Technically, the selection also spans block
id-0
, which is also at the shared depth, as the selection starts in blockid-2
which is its descendant. Becauseid-0
is the first block in the selection, it's omitted and insteadid-2
, where the selection starts, is added. Additionally, its later siblings (in this case,id-3
) are added to theblocks
array, and we move up one level of depth. The ancestor of blockid-2
at this depth is blockid-1
. Its later siblings are also added to theblocks
array, and we again move up one level of depth.Since we're now at the shared depth, we are done, so the final
blocks
array for this example would be:[id-2, id-3, id-4, id-6, id-7, id-8, id-9]
New editor methods
getPrevBlock
Docs reference
getNextBlock
Docs reference
getParentBlock
Docs reference
setSelection
Docs reference
What's Changed
New Contributors
Full Changelog: TypeCellOS/BlockNote@v0.19.2...v0.20.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.