-
-
Notifications
You must be signed in to change notification settings - Fork 463
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 inline equation using the BlockNote API #1022
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@jkcs is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
Thanks! The UX of this looks great. I hope to dive into the code coming week. I'd like to research what API surface we'd need to add so this can be built using purely the BlockNote API (and not TipTap internals). Will keep you posted, but lmk in case you have suggestions 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.
Great stuff. This example shows where the BN API is lacking and is a great starting point to improve it.
I've implemented an isSelected
prop (see 519f34a) and made inline content selectable to make the logic a lot easier. We now don't need to listen for "cursor edge keyboard navigations" anymore, but can let prosemirror handle this.
Let me know what you think @jkcs! Do you see any new bugs popping up with the new approach?
There are a couple of todos left with this new approach:
- Make sure the formatting toolbar doesn't show
- Research if there are any other downsides / side effects (for example for other examples) of setting
selectable: true
. Should we make this configurable or not? - Implement remaining APIs (marked as TODO in code)
- Review RenderHTML (@jkcs see my PR comment about copying)
}, | ||
content: "none", | ||
// copy content | ||
renderHTML: (props) => { |
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.
What were the exact issues you were having with copying without the renderHTML?
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.
👍👍👍Extending isSelected is much better than before. New bug: losing focus on input, need to keep isSelected as true. Implement BlockNote API to add, remove, and edit inline content. For the tiptapApi, it requires 'pos'. Is there a way to operate based on the |
API Extension Changes:
renderHTML
implementation for inline content (in this case, to address copying issues)"Link