All files / service-web-theme/src client.ts

100% Statements 8/8
100% Branches 7/7
100% Functions 2/2
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45        13x 13x                     7x           5x 5x 2x                                        
import { LitElement, css, html, type PropertyDeclarations, type TemplateResult } from 'lit';
 
/** A client message with server-rendered fallback text, isolated from htmx's light-DOM morphs. */
export class BeMusicStatusElement extends LitElement {
  static override properties: PropertyDeclarations = { message: { attribute: false } };
  static override styles = css`
    :host {
      display: block;
    }
    :host([hidden]) {
      display: none;
    }
  `;
  declare message: string | undefined;
 
  protected override render(): TemplateResult {
    return this.message === undefined ? html`<slot></slot>` : html`<span part="message">${this.message}</span>`;
  }
}
 
/** Register on the client explicitly; importing the module has no registration side effect. */
export function defineServiceUI(registry: CustomElementRegistry = customElements): void {
  const existing = registry.get('be-music-status');
  if (existing === undefined) registry.define('be-music-status', BeMusicStatusElement);
  else if (existing !== BeMusicStatusElement) throw new Error('Conflicting be-music-status element');
}
 
export { serviceHeaderTemplate, serviceSkipLinkTemplate } from './header-template.ts';
export type { ServiceHeaderInput } from './header-model.ts';
 
export { buildInfoTemplate, publicBetaNoticeTemplate, serviceFooterTemplate } from './footer-template.ts';
 
export { authButtonTemplate, authPanelTemplate, type AuthButtonInput } from './auth-template.ts';
export { avatarTemplate, accountIdentityTemplate } from './account-identity-template.ts';
export type { ServiceAccountIdentity } from './account-model.ts';
export { skeletonGroupTemplate, skeletonTemplate } from './skeleton-template.ts';
export type { SkeletonInput, SkeletonLength, SkeletonShape } from './skeleton-model.ts';
export {
  popoverTemplate,
  languageMenuTemplate,
  languageLinksTemplate,
  type PopoverInput,
  type LanguageChoice,
} from './popover-template.ts';