class CustomEditorToolbar extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
`;
// Make buttons interactive
this.shadowRoot.querySelectorAll('.tool-button').forEach(button => {
button.addEventListener('click', () => {
this.shadowRoot.querySelectorAll('.tool-button').forEach(btn => {
btn.classList.remove('active');
});
button.classList.add('active');
});
});
}
}
customElements.define('custom-editor-toolbar', CustomEditorToolbar);