// A plain custom element: one light-DOM button that asks the admin SPA to // run the field's action. It makes no request and reads no cookie or // storage; the SPA owns HTTP. class AcmeDemoLookup extends HTMLElement { connectedCallback() { if (this.firstChild) return const button = document.createElement('button') button.type = 'button' button.textContent = this.getAttribute('label') || '' button.addEventListener('click', () => { this.dispatchEvent(new CustomEvent('summer-action', { bubbles: true, composed: true })) }) this.append(button) } } if (!customElements.get('acme-demo-lookup')) { customElements.define('acme-demo-lookup', AcmeDemoLookup) }