Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency @blocknote/react to v0.20.0 #6346

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 3, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@blocknote/react 0.19.2 -> 0.20.0 age adoption passing confidence

Release Notes

TypeCellOS/BlockNote (@​blocknote/react)

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 methods

The previously undocumented moveBlockUp & moveBlockDown methods have been renamed to moveBlocksUp & 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 the moveBlockUp & moveBlockDown methods, which are now moveBlocksUp & moveBlocksDown. This means that all the changes mentioned above also apply to those shortcuts.

Improved Tab/Shift+Tab handling

Indentation & 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 use Tab/Shift+Tab to indent/unindent the selected blocks, the user would have to first hit Escape 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 cause Tab/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:

- id-0
  - id-1
    - >|id-2
    - id-3
  - id-4
    - id-5
  - id-6
- id-7
- id-8
- id-9|<
  - id-10

Here, each block is represented by its ID, and the selection is represented by the >| and |< markers. So the selection starts in block id-2 and ends in block id-9.

In this case, the blocks id-6, id-7, and id-8 set the shared depth, as they are the least nested blocks spanned by the selection. Therefore, these blocks are all added to the blocks array.

Technically, the selection also spans block id-0, which is also at the shared depth, as the selection starts in block id-2 which is its descendant. Because id-0 is the first block in the selection, it's omitted and instead id-2, where the selection starts, is added. Additionally, its later siblings (in this case, id-3) are added to the blocks array, and we move up one level of depth. The ancestor of block id-2 at this depth is block id-1. Its later siblings are also added to the blocks 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants