TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.
https://www.blocknotejs.org/
Mozilla Public License 2.0
5.9k stars 384 forks source link

simple latex block #818

Closed jkcs closed 2 weeks ago

jkcs commented 3 weeks ago

close #741 /claim #741

vercel[bot] commented 3 weeks ago

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

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Jun 8, 2024 3:32am
blocknote-website ✅ Ready (Inspect) Visit Preview Jun 8, 2024 3:32am
vercel[bot] commented 3 weeks ago

@jkcs is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

jkcs commented 3 weeks ago

This already looks pretty good, awesome!

I've left some comments inline, and have some additional questions:

  • Why did you need to use createInternalInlineContentSpec instead of the regular content spec?
  • It would be very nice to have this keyboard accessible (compare with the behavior in Notion when using the keyboards to navigate).
  • Should we create a separate package (e.g.: packages/react-extension-equations) for this so users can easily add it to their editor without having to copy all the code? I think it should be an extension because not all users might want to pull in the katex dependency

It's great to see your contributions; it seems you're getting up to speed nicely 💪 did you find it ok to get started and / or have any feedback about the codebase?

  1. The reason for using createInternalInlineContentSpec is that it allows customization of addNodeView. (Not sure if createInlineContentSpec would work)
  2. I will look into keyboard accessibility.
  3. You’re right, we should create a separate package.

Getting started with the code was okay for me, having prior experience with Tiptap would have made it faster. It would be great if we could enhance the CONTRIBUTING.md file.

Given this, I will create a new PR

YousefED commented 3 weeks ago

Ok!

Getting started with the code was okay for me, having prior experience with Tiptap would have made it faster. It would be great if we could enhance the CONTRIBUTING.md file.

Awesome. Yes, feel free to make a PR for the file with improvements you'd like to see!

The reason for using createInternalInlineContentSpec is that it allows customization of addNodeView. (Not sure if createInlineContentSpec would work)

Why do you need your manual NodeView? If there is anything missing in our higher level createReactInlineContentSpec, it'd be great to know so we can consider implementing it there. This way we would improve our API surface + not have the Latex block dive into "internals"

jkcs commented 2 weeks ago

The implementation of keyboard accessibility is more challenging than I anticipated. I'll close this for now and will provide a new PR once I have it implemented