Good point to make a commit

This commit is contained in:
2025-07-06 19:03:59 +02:00
parent 365143c7db
commit 2895b917fc
16 changed files with 18636 additions and 39 deletions

34
tp-rtb-bold.js Normal file
View File

@ -0,0 +1,34 @@
import { TpRtbBaseExtension } from './tp-rtb-base-extension.js';
import Bold from '@tiptap/extension-bold';
class TpRtbBold extends TpRtbBaseExtension {
constructor() {
super();
this.label = 'Bold';
}
getExtension() {
return Bold;
}
_handleClick() {
if (this.parentEditor && this.parentEditor.editor) {
this.parentEditor.editor.chain().focus().toggleBold().run();
}
}
_setupEditorListeners() {
const { editor } = this.parentEditor;
// Update button state when selection changes
editor.on('selectionUpdate', () => {
this.active = editor.isActive('bold');
});
editor.on('focus', () => {
this.active = editor.isActive('bold');
});
}
}
customElements.define('tp-rtb-bold', TpRtbBold);