feat: Custom inline equation using the BlockNote API#1022
feat: Custom inline equation using the BlockNote API#1022jkcs wants to merge 3 commits intoTypeCellOS:mainfrom
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! |
YousefED
left a comment
There was a problem hiding this comment.
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.
What were the exact issues you were having with copying without the renderHTML?
|
👍👍👍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:
renderHTMLimplementation for inline content (in this case, to address copying issues)"Link