Repository navigation
refactor: serialize clipboard to json instead of html - #1790
nperez0111 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
|
@nperez0111 following up from our discussion yesterday. What I missed is that the existing serializer is also used for I think the workarounds you pointed to are mostly in place for that, not for the clipboard handling. Also, in the preview environment I can also not move the PDF block (#1205). The idea (json on clipboard) makes sense of course, but as far as I can see now it doesn't resolve the open issues. This makes me think it becomes more of an architectural decision which we should explore when we get to streamlining the exporters / rendering - wdyt? |
|
Yep, that's fine. I renamed the PR to reflect that. |
Instead of trying to serialize everything into
blocknote/html, we can instead serialize intoblocknote/jsonwhatever slice of data we want to be on the clipboard or drag & drop.This should resolve a number of issues related to drag & drop, and simplifies things significantly.
HTML cannot encode the same sort of information that json can, for example, that a slice has different depths is not representable by html & has to be inferred, whereas just representing it as a slice, just works.
Does not resolve:
BlockNote/packages/core/src/extensions/SideMenu/SideMenuPlugin.ts
Lines 301 to 335 in 0eb3bce
What is left?