feat: modularize block system (#718)
This commit is contained in:
parent
5e8cddc886
commit
38527ff92e
18 changed files with 684 additions and 604 deletions
|
|
@ -24,11 +24,11 @@ export function headingRule(level: number) {
|
|||
export const handleTransaction = ({
|
||||
transaction,
|
||||
editorRef,
|
||||
saveContent,
|
||||
onSaveContent,
|
||||
}: {
|
||||
transaction: Transaction;
|
||||
editorRef: MutableRefObject<EditorView | null>;
|
||||
saveContent: (updatedContent: string, debounce: boolean) => void;
|
||||
onSaveContent: (updatedContent: string, debounce: boolean) => void;
|
||||
}) => {
|
||||
if (!editorRef || !editorRef.current) return;
|
||||
|
||||
|
|
@ -39,9 +39,9 @@ export const handleTransaction = ({
|
|||
const updatedContent = buildContentFromDocument(newState.doc);
|
||||
|
||||
if (transaction.getMeta('no-debounce')) {
|
||||
saveContent(updatedContent, false);
|
||||
onSaveContent(updatedContent, false);
|
||||
} else {
|
||||
saveContent(updatedContent, true);
|
||||
onSaveContent(updatedContent, true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue