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

feat: Custom Blocks #191

Merged
merged 73 commits into from
May 31, 2023
Merged

feat: Custom Blocks #191

merged 73 commits into from
May 31, 2023

Conversation

matthewlipski
Copy link
Collaborator

@matthewlipski matthewlipski commented May 10, 2023

This PR enables users to add Custom Blocks! 🥳

See https://www.blocknotejs.org/docs/block-types#custom-block-types

Besides the API surface, the biggest change was rearchitecting BlockNote for custom schemas without compromising on Type-safety. A BlockNote editor will now have a specific type (using generics) based on the Schema (the blocks registered to it).


Two remaining issues will be picked up separately:

(see also #164)

@vercel
Copy link

vercel bot commented May 10, 2023

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

Name Status Preview Comments Updated (UTC)
blocknote-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2023 2:21pm

Copy link

@tonyabracadabra tonyabracadabra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

* Fixed custom block placeholders, formatting toolbar, and sizing

* Small styling changes

* Made text align button not show up when selected block/s doesn't/don't support the prop

* Updated docs

* Finished 1st draft custom block docs and demo

* Added type arguments in custom block docs & minor changes

* Implemented PR feedback
// let complexHTML: string;
// let complexMarkdown: string;

function removeInlineContentClass(html: string) {
return html.replace(/ class="_inlineContent_1c48ad"/g, "");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1c48ad is not stable I think? that will change based on the build

@@ -38,7 +38,6 @@ Tippy popups that are appended to document.body directly
.defaultStyles h3,
.defaultStyles li {
all: unset !important;
flex-grow: 1 !important;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is intended to be removed right? I thought we just added it

* update packages incl prosemirror-view

* fix build

* fix ReactAlert + add logs
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.

None yet

3 participants