import './components/main-window.js'; import './components/custom-button.js'; import './components/item-list.js'; import './components/custom-item.js'; import './components/custom-modal.js'; import './components/custom-text.js'; import './components/back-icon.js'; import Store from './modules/store.js'; import text from './modules/text.js'; class AppBase extends HTMLElement { constructor() { super(); this.text = text; this.properties = { color: '#324BFF', }; this.store = new Store(); } connectedCallback() { this.store.subscribe(this.render.bind(this)); this.render(); } render(action = 'INIT') { if (![Store.actions.OPEN_MODAL, Store.actions.CLOSE_MODAL, Store.actions.ADD_LINE, Store.actions.REMOVE_LINE, Store.actions.UNDO, 'INIT'].includes(action)) { return; // Only render if content changed } this.innerHTML = `

${this.text.title}

${this.text.description}

${text.modal.description}

`; } } customElements.define('app-base', AppBase);