/** * ViewerHTMLTemplates - HTML template generation for ImageViewer * REFACTOR: Extract HTML template generation from ImageViewer (Issue C3.1) * * Centralizes all HTML template generation with static methods * Improves testability and maintainability of template strings * * @example * ```typescript * const html = ViewerHTMLTemplates.createViewerHTML(true); * const zoomIn = ViewerHTMLTemplates.createZoomInButton(); * ``` */ export class ViewerHTMLTemplates { /** * Creates the zoom-in button HTML * Only generated if hasZoomButtons option is true * * @param hasZoomButtons - Whether to create the button * @returns HTML string for zoom-in button or empty string * * @example * ```typescript * const btn = ViewerHTMLTemplates.createZoomInButton(true); * // '
' * ``` */ static createZoomInButton(hasZoomButtons: boolean): string { return hasZoomButtons ? `` : ''; } /** * Creates the zoom-out button HTML * Only generated if hasZoomButtons option is true * * @param hasZoomButtons - Whether to create the button * @returns HTML string for zoom-out button or empty string * * @example * ```typescript * const btn = ViewerHTMLTemplates.createZoomOutButton(true); * // '' * ``` */ static createZoomOutButton(hasZoomButtons: boolean): string { return hasZoomButtons ? `` : ''; } /** * Creates the complete image viewer HTML structure * Includes loader, snap view, zoom controls, and image container * * @param hasZoomButtons - Whether to include zoom in/out buttons * @returns Complete HTML string for the viewer * * @example * ```typescript * const html = ViewerHTMLTemplates.createViewerHTML(true); * container.innerHTML = html; * ``` */ static createViewerHTML(hasZoomButtons: boolean): string { const zoomInBtn = this.createZoomInButton(hasZoomButtons); const zoomOutBtn = this.createZoomOutButton(hasZoomButtons); const zoomActionsClass = hasZoomButtons ? 'iv-zoom-actions--has-buttons' : ''; return `