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

feature: add support for blocknote transactions #1147

Open
wants to merge 2 commits into
base: refactor/clean-blockcontainer
Choose a base branch
from

Conversation

YousefED
Copy link
Collaborator

This is a POC for blocknote-level transactions. It should make it possible to clean our existing commands (those in blockManipulation further down by migrating away from tiptap-style commands). It also unlocks the possibility for userland-transactions.

For example, the following bug is fixed:

  • select a number of paragraphs
  • change type to "heading"
  • "undo" will undo them one by one (after the fix, "undo" will reset all headings back to paragraphs in one step as expected)

closes https://github.com/TypeCellOS/BlockNote/issues?q=is:issue is:open undo

TODO:

  • add tests
  • See if there are bugs with this approach. For example, what if you call other functions in a transact block that depend on editor.state? It's likely they should read the state from the activeTransaction instead (diagnose, create tests, and fix)
  • if there are other BlockNote APIs called in a loop (similar to blocktype select), migrate them to use transact

Copy link

vercel bot commented Oct 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Oct 13, 2024 7:14pm
blocknote-website ✅ Ready (Inspect) Visit Preview Oct 13, 2024 7:14pm

@YousefED YousefED changed the title add support for blocknote transactions fix: add support for blocknote transactions Oct 13, 2024
@YousefED YousefED changed the title fix: add support for blocknote transactions feature: add support for blocknote transactions Oct 13, 2024
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.

1 participant