-
-
Notifications
You must be signed in to change notification settings - Fork 550
feat: add support for tiptap / liveblocks comments #1442
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -130,6 +131,11 @@ export function contentNodeToInlineContent< | |||
} else { | |||
const config = styleSchema[mark.type.name]; | |||
if (!config) { | |||
if (mark.type.spec.group?.includes("blocknoteIgnore")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we store something else in the spec rather than using the group for this?
Or maybe by the mark's name?
This feels kind of wrong to use the group for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair. Prefer just to add anything else on the spec? (i.e.: (mark.type.spec as any).blocknoteIgnore = true
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, looks like the type should be already be open to allowing that sort of modifcation:
/**
Mark specs can include additional properties that can be
inspected through [`MarkType.spec`](https://prosemirror.net/docs/ref/#model.MarkType.spec) when
working with the mark.
*/
[key: string]: any;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, and it can be added in tiptap with:
extendMarkSchema(extension) {
if (extension.name === "comment") { // if "comment" is the name of the comment mark
return {
blocknoteIgnore: true,
};
}
return {};
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, much cleaner!
This PR:
blocknoteIgnore
it's possible to use these marks while not affecting the rest of BlockNote. In Tiptap, this can be done like this: