/** * — local replacement for the upstream wokwi-elements * version. Kept inside velxio because we cannot push the original Lit * sources to wokwi/wokwi-elements. * * Plain HTMLElement (no Lit) — the SVG is static and `value` is read by * the SPICE layer from the simulator store, not from this DOM node, so * we don't need reactive rendering. */ interface ElementPin { name: string; x: number; y: number; signals: unknown[]; } const SVG = ` `; export class CapacitorElement extends HTMLElement { static observedAttributes = ['value']; readonly pinInfo: ElementPin[] = [ { name: '1', x: 0, y: 5.65, signals: [] }, { name: '2', x: 58.8, y: 5.65, signals: [] }, ]; constructor() { super(); const root = this.attachShadow({ mode: 'open' }); root.innerHTML = `${SVG}`; } get value(): string { return this.getAttribute('value') ?? '1u'; } set value(v: string) { this.setAttribute('value', String(v)); } } if (!customElements.get('wokwi-capacitor')) { customElements.define('wokwi-capacitor', CapacitorElement); }