class CustomImageGenerator extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open' }); } connectedCallback() { this.render(); } static get observedAttributes() { return ['image-data']; } attributeChangedCallback(name, oldValue, newValue) { if (oldValue !== newValue) { this.render(); } } render() { const imageData = this.getAttribute('image-data') || ''; const hasImage = imageData !== ''; this.shadowRoot.innerHTML = `

Visualisation du Thème

${hasImage ? `Generated theme preview` : `

Générez un thème pour voir la prévisualisation

` }
${hasImage ? `
` : ''} `; feather.replace(); } } customElements.define('custom-image-generator', CustomImageGenerator);