import { Injectable, signal } from '@angular/core';

/**
 * Cross-component hover/focus bridge between an editor field and the schematic
 * live preview. A field marks itself with `appHighlightSource="logo"` and the
 * preview marks the matching element with `appHighlightTarget="logo"`; this
 * service is the shared signal both sides read/write so they don't need a
 * direct reference to each other.
 */
@Injectable({ providedIn: 'root' })
export class PreviewHighlightService {
  readonly activeId = signal<string | null>(null);

  set(id: string | null): void {
    this.activeId.set(id);
  }
}
