Getting the new new new rich text editor working. I think it is working... Yay Shad Editor that uses TipTap and Shadcn.

This commit is contained in:
Scott Idem
2024-12-02 18:56:45 -05:00
parent 940a7e9a21
commit 44907bc01f
42 changed files with 2095 additions and 572 deletions

View File

@@ -42,9 +42,17 @@
class?: string;
content?: Content;
showToolbar?: boolean;
// html_text?: string;
new_html?: string;
}
let { class: className = '', content = $bindable(''), showToolbar = true }: Props = $props();
let { class:
className = '',
content = $bindable(''),
showToolbar = true,
// html_text = '',
new_html = $bindable(''),
}: Props = $props();
let editor = $state<Editor>();
let element = $state<HTMLElement>();
@@ -133,6 +141,12 @@
editor = transaction.editor;
console.log(editor.isActive('bold'));
content = editor.getHTML();
console.log(content);
if (content == '<p></p>') {
new_html = '';
} else {
new_html = content ?? '';
}
}
});
});