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 = `
Générez un thème pour voir la prévisualisation