feat: add experimental better editor

This commit is contained in:
sethburkart123
2024-06-24 19:44:44 +10:00
parent 254d2111c8
commit 87e60130cc
14 changed files with 1447 additions and 6 deletions
+11
View File
@@ -0,0 +1,11 @@
body {
background: transparent !important;
}
.bn-container[data-color-scheme=dark] {
--bn-colors-editor-background: #18181B00 !important;
}
.bn-container > [contenteditable="true"] {
height: 100vh !important;
}
+25
View File
@@ -0,0 +1,25 @@
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()
}, '*')
})
return (
<div className="h-screen">
<BlockNoteView editor={editor} />
</div>
)
}