Skip to content

feat: Return values for block manipulation methods #458

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

Merged
merged 4 commits into from
Jan 3, 2024

Conversation

matthewlipski
Copy link
Collaborator

This PR adds return values for the following BlockNoteEditor methods:

// Returns the blocks after being inserted
insertBlocks(...): Block[]

// Returns the updated block
updateBlock(...): Block

// Returns the blocks that were removed
removeBlocks(...): Block[]

// Returns both the blocks that were removed and the blocks after being inserted
replaceBlocks(...): {
  insertedBlocks: Block[];
  removedBlocks: Block[];
}

Closes #410

Copy link

vercel bot commented Dec 6, 2023

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

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Jan 3, 2024 3:48pm
blocknote-website ✅ Ready (Inspect) Visit Preview Jan 3, 2024 3:48pm

@sahilpohare
Copy link

Could we have this merged?

# Conflicts:
#	packages/core/src/api/blockManipulation/blockManipulation.ts
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.

Return the data (or id atleast) of the new block created upon using insertBlocks
3 participants