feat: improve editor + add exporting

This commit is contained in:
sethburkart123
2024-06-25 17:02:52 +10:00
parent 87e60130cc
commit 53cab9701d
10 changed files with 68 additions and 1333 deletions
+4
View File
@@ -8,4 +8,8 @@ body {
.bn-container > [contenteditable="true"] {
height: 100vh !important;
}
.ProseMirror {
background: transparent !important;
}
+1 -3
View File
@@ -2,18 +2,16 @@ import "@blocknote/core/fonts/inter.css";
import { useCreateBlockNote } from "@blocknote/react";
import { BlockNoteView } from "@blocknote/mantine";
import "@blocknote/mantine/style.css";
//import { generateHTML } from '@tiptap/html'
import './Editor.css'
export default function Editor() {
const editor = useCreateBlockNote({});
/* debounce on change to export to html */
editor._tiptapEditor.on('update', () => {
window.parent.postMessage({
type: 'message-html',
data: editor._tiptapEditor.getHTML()
data: editor._tiptapEditor.getHTML(),
}, '*')
})