mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 11:44:40 +00:00
25 lines
646 B
TypeScript
25 lines
646 B
TypeScript
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>
|
|
)
|
|
} |