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

Using `BlockNoteViewRaw` throws `SideMenu` error #820

Closed TheMikeyRoss closed 3 weeks ago

TheMikeyRoss commented 3 weeks ago

Describe the bug I'm trying to use BlockNoteViewRaw and I keep getting the following error:

TypeError: Cannot read properties of undefined (reading 'SideMenu')

To Reproduce https://stackblitz.com/edit/github-h6gx3y?file=App.tsx

You'll have to open the browser console to see the error

image

Misc

YousefED commented 3 weeks ago

BlockNoteViewRaw expects a ComponentsContext to be available. Also see the other implementations: https://github.com/TypeCellOS/BlockNote/blob/c9a53bb9bd79c3b1990f74d2c87956c3cf5949b0/packages/ariakit/src/index.tsx#L99

TheMikeyRoss commented 3 weeks ago

Oh I see, I'm a little confused about the @blacknote/mantine package. What If I want to use a headless version with zero styles, do I still have to import the mantine package? wouldn't that add some extra size since it's bringing mantine with it?

YousefED commented 3 weeks ago

Oh I see, I'm a little confused about the @blacknote/mantine package. What If I want to use a headless version with zero styles, do I still have to import the mantine package? wouldn't that add some extra size since it's bringing mantine with it?

blocknote/mantine uses the Mantine UI to implement a UI, so by definition it's not headless. Depending on your definition of headless / what you're looking for exactly, you can:

TheMikeyRoss commented 3 weeks ago

Ah thanks @YousefED I think @blocknote/ariakit is what I'm kinda looking for