{"version":3,"file":"ngx-t-forms-editor-input-element.component-BGdZ4evj.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/editor-input-element/core/quill-input/quill.config.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/editor-input-element/core/quill-input/quill-input.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/editor-input-element/core/quill-input/quill-input.component.html","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/editor-input-element/editor-input-element.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/editor-input-element/editor-input-element.component.html"],"sourcesContent":["import type Quill from 'quill';\r\nimport type { Op, QuillOptions } from 'quill';\r\n\r\n/**\r\n * Serialized Quill document — the Delta op-list persisted as the control value.\r\n *\r\n * Stored as a plain object (NOT a live `Delta` instance) so it round-trips through\r\n * reactive-form state and the library's structural `_isEqual` check cleanly. `_isEqual`\r\n * rejects values whose constructors differ, so a `Delta` instance would never compare\r\n * equal to the plain object rehydrated from saved form data.\r\n */\r\nexport interface QuillContent {\r\n  ops: Op[];\r\n}\r\n\r\n/** Inputs the host component feeds into the Quill setup. */\r\nexport interface QuillEditorPayload {\r\n  /** Render the editor in non-editable mode. */\r\n  readOnly: boolean;\r\n  /** Placeholder shown while the document is empty. */\r\n  placeholder?: string;\r\n}\r\n\r\n/**\r\n * Narrow surface of Quill's built-in table module (`getModule('table')`), typed so the\r\n * host component can drive table operations without leaking `any`.\r\n */\r\nexport interface QuillTableModule {\r\n  insertTable(rows: number, columns: number): void;\r\n  insertRowBelow(): void;\r\n  insertColumnRight(): void;\r\n  deleteRow(): void;\r\n  deleteColumn(): void;\r\n  deleteTable(): void;\r\n}\r\n\r\n/** A custom toolbar control wired to a native Quill table operation. */\r\nexport interface QuillTableControl {\r\n  /** Toolbar format key — Quill renders it as a `button.ql-<format>`. */\r\n  format: string;\r\n  /** Tooltip surfaced via the button's `title` attribute. */\r\n  title: string;\r\n  /** Inline SVG markup. Paths use `ql-stroke` so they inherit the themed icon colour. */\r\n  icon: string;\r\n  /** Operation run against the native table module when the button is pressed. */\r\n  run: (table: QuillTableModule) => void;\r\n}\r\n\r\nconst svg = (body: string): string => `<svg viewBox=\"0 0 18 18\">${body}</svg>`;\r\n\r\n/**\r\n * Word-like table toolkit backed by Quill's native table module. Each control degrades to a\r\n * no-op when the caret is outside a table, so the buttons are always safe to press.\r\n */\r\nexport const QUILL_TABLE_CONTROLS: readonly QuillTableControl[] = [\r\n  {\r\n    format: 'table-insert',\r\n    title: 'Insert table (3×3)',\r\n    icon: svg('<rect class=\"ql-stroke\" fill=\"none\" x=\"3\" y=\"4\" width=\"12\" height=\"10\" rx=\"1\"></rect><line class=\"ql-stroke\" x1=\"3\" y1=\"7.3\" x2=\"15\" y2=\"7.3\"></line><line class=\"ql-stroke\" x1=\"3\" y1=\"10.6\" x2=\"15\" y2=\"10.6\"></line><line class=\"ql-stroke\" x1=\"7\" y1=\"4\" x2=\"7\" y2=\"14\"></line><line class=\"ql-stroke\" x1=\"11\" y1=\"4\" x2=\"11\" y2=\"14\"></line>'),\r\n    run: table => table.insertTable(3, 3),\r\n  },\r\n  {\r\n    format: 'table-row',\r\n    title: 'Insert row below',\r\n    icon: svg('<rect class=\"ql-stroke\" fill=\"none\" x=\"3\" y=\"3\" width=\"12\" height=\"6\" rx=\"1\"></rect><line class=\"ql-stroke\" x1=\"9\" y1=\"11\" x2=\"9\" y2=\"15\"></line><line class=\"ql-stroke\" x1=\"7\" y1=\"13\" x2=\"11\" y2=\"13\"></line>'),\r\n    run: table => table.insertRowBelow(),\r\n  },\r\n  {\r\n    format: 'table-column',\r\n    title: 'Insert column right',\r\n    icon: svg('<rect class=\"ql-stroke\" fill=\"none\" x=\"3\" y=\"3\" width=\"6\" height=\"12\" rx=\"1\"></rect><line class=\"ql-stroke\" x1=\"13\" y1=\"6\" x2=\"13\" y2=\"12\"></line><line class=\"ql-stroke\" x1=\"11\" y1=\"9\" x2=\"15\" y2=\"9\"></line>'),\r\n    run: table => table.insertColumnRight(),\r\n  },\r\n  {\r\n    format: 'table-delete-row',\r\n    title: 'Delete row',\r\n    icon: svg('<rect class=\"ql-stroke\" fill=\"none\" x=\"3\" y=\"3\" width=\"12\" height=\"6\" rx=\"1\"></rect><line class=\"ql-stroke\" x1=\"7\" y1=\"13\" x2=\"11\" y2=\"13\"></line>'),\r\n    run: table => table.deleteRow(),\r\n  },\r\n  {\r\n    format: 'table-delete-column',\r\n    title: 'Delete column',\r\n    icon: svg('<rect class=\"ql-stroke\" fill=\"none\" x=\"3\" y=\"3\" width=\"6\" height=\"12\" rx=\"1\"></rect><line class=\"ql-stroke\" x1=\"11\" y1=\"9\" x2=\"15\" y2=\"9\"></line>'),\r\n    run: table => table.deleteColumn(),\r\n  },\r\n  {\r\n    format: 'table-delete',\r\n    title: 'Delete table',\r\n    icon: svg('<rect class=\"ql-stroke\" fill=\"none\" x=\"3\" y=\"3\" width=\"12\" height=\"12\" rx=\"1\"></rect><line class=\"ql-stroke\" x1=\"5.5\" y1=\"5.5\" x2=\"12.5\" y2=\"12.5\"></line><line class=\"ql-stroke\" x1=\"12.5\" y1=\"5.5\" x2=\"5.5\" y2=\"12.5\"></line>'),\r\n    run: table => table.deleteTable(),\r\n  },\r\n];\r\n\r\n/**\r\n * Human-readable tooltips for the built-in controls, keyed by the button's CSS selector.\r\n * Quill ships no titles of its own, so these make the toolbar self-explanatory.\r\n */\r\nexport const QUILL_BUILTIN_TITLES: Readonly<Record<string, string>> = {\r\n  '.ql-bold': 'Bold',\r\n  '.ql-italic': 'Italic',\r\n  '.ql-underline': 'Underline',\r\n  '.ql-strike': 'Strikethrough',\r\n  '.ql-blockquote': 'Quote',\r\n  '.ql-code-block': 'Code block',\r\n  '.ql-link': 'Insert link',\r\n  '.ql-image': 'Insert image',\r\n  '.ql-video': 'Embed video',\r\n  '.ql-clean': 'Clear formatting',\r\n  '.ql-list[value=\"ordered\"]': 'Numbered list',\r\n  '.ql-list[value=\"bullet\"]': 'Bulleted list',\r\n  '.ql-list[value=\"check\"]': 'Checklist',\r\n  '.ql-script[value=\"sub\"]': 'Subscript',\r\n  '.ql-script[value=\"super\"]': 'Superscript',\r\n  '.ql-indent[value=\"-1\"]': 'Decrease indent',\r\n  '.ql-indent[value=\"+1\"]': 'Increase indent',\r\n  '.ql-direction[value=\"rtl\"]': 'Right-to-left',\r\n  '.ql-color': 'Text colour',\r\n  '.ql-background': 'Highlight colour',\r\n  '.ql-align': 'Alignment',\r\n  '.ql-header': 'Heading',\r\n  '.ql-font': 'Font',\r\n  '.ql-size': 'Font size',\r\n};\r\n\r\n/**\r\n * Comprehensive, logically grouped \"snow\" toolbar — headings/fonts, inline styling, colour,\r\n * scripts, lists, indentation/alignment, blocks, media and a native table toolkit.\r\n */\r\nconst TOOLBAR_CONTAINER: readonly unknown[] = [\r\n  [{ header: [1, 2, 3, 4, 5, 6, false] }, { font: [] }, { size: ['small', false, 'large', 'huge'] }],\r\n  ['bold', 'italic', 'underline', 'strike'],\r\n  [{ color: [] }, { background: [] }],\r\n  [{ script: 'sub' }, { script: 'super' }],\r\n  [{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],\r\n  [{ indent: '-1' }, { indent: '+1' }, { align: [] }, { direction: 'rtl' }],\r\n  ['blockquote', 'code-block'],\r\n  ['link', 'image', 'video'],\r\n  QUILL_TABLE_CONTROLS.map(control => control.format),\r\n  ['clean']\r\n];\r\n\r\n/** The `this` context Quill binds when it invokes a toolbar handler. */\r\ninterface ToolbarHandlerContext {\r\n  quill: Quill;\r\n}\r\n\r\n/**\r\n * Builds the toolbar handler map for the custom table buttons.\r\n *\r\n * These MUST be supplied in the toolbar config (not added later via `addHandler`): Quill's\r\n * toolbar skips attaching a click listener to any button whose format is neither a registered\r\n * blot nor already present in `handlers` at construction time. A late `addHandler` sets the\r\n * handler but never re-attaches the listener, so the button stays inert.\r\n */\r\nconst buildTableHandlers = (): Record<string, (this: ToolbarHandlerContext) => void> => {\r\n  const handlers: Record<string, (this: ToolbarHandlerContext) => void> = {};\r\n  for (const control of QUILL_TABLE_CONTROLS) {\r\n    handlers[control.format] = function tableHandler(this: ToolbarHandlerContext): void {\r\n      const table = this.quill.getModule('table') as QuillTableModule;\r\n      // Native table ops bail when there is no selection; force focus + a range first.\r\n      this.quill.getSelection(true);\r\n      control.run(table);\r\n    };\r\n  }\r\n  return handlers;\r\n};\r\n\r\n/**\r\n * Builds a ready-to-use `QuillOptions` for a \"snow\" editor with the native table module\r\n * enabled and the custom table-button handlers wired into the toolbar config.\r\n *\r\n * Browser-only by construction: callers MUST instantiate Quill behind an\r\n * `isPlatformBrowser(...)` guard because Quill touches `document` at construction time.\r\n */\r\nexport const buildQuillOptions = (payload: QuillEditorPayload): QuillOptions => ({\r\n  theme: 'snow',\r\n  readOnly: payload.readOnly,\r\n  placeholder: payload.placeholder ?? \"Let's write something amazing...\",\r\n  modules: {\r\n    toolbar: {\r\n      container: TOOLBAR_CONTAINER,\r\n      handlers: buildTableHandlers()\r\n    },\r\n    table: true,\r\n    history: { delay: 1000, maxStack: 100, userOnly: true },\r\n    clipboard: { matchVisual: false }\r\n  }\r\n});\r\n\r\n/**\r\n * Quill's empty document is a single trailing newline op. Treat that — and a literally\r\n * empty op-list — as \"no value\" so `required` validation behaves intuitively.\r\n */\r\nexport const isEmptyQuillDocument = (ops: Op[]): boolean =>\r\n  ops.length === 0 || (ops.length === 1 && ops[0]?.insert === '\\n');\r\n","/// <reference path=\"../../../../../../../types/quill.d.ts\" />\r\nimport {\r\n  AfterViewInit,\r\n  ChangeDetectionStrategy,\r\n  Component,\r\n  ElementRef,\r\n  Input,\r\n  OnDestroy,\r\n  PLATFORM_ID,\r\n  computed,\r\n  inject,\r\n  input,\r\n  output,\r\n  signal,\r\n  viewChild\r\n} from '@angular/core';\r\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\r\nimport { NgControl } from '@angular/forms';\r\n\r\nimport { ITowerStepColumn } from 'ngx-t-forms-types';\r\n// Mirrors the EditorJS sibling (Trap 16): `quill` is a browser-only bundle that touches\r\n// `document` at construction time and crashes under bare-Node SSR. The top-level import is\r\n// type-only (zero runtime emission); the real load happens inside the SSR-gated\r\n// `ngAfterViewInit` via dynamic `import()`.\r\nimport type QuillType from 'quill';\r\nimport type { Range as QuillRange } from 'quill';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\n\r\nimport { BaseCustomInput, BaseCustomInputConfig } from '../../../../../../services/core/t-input-controller/functions/baseCustomInput';\r\nimport {\r\n  buildQuillOptions,\r\n  isEmptyQuillDocument,\r\n  QUILL_BUILTIN_TITLES,\r\n  QUILL_TABLE_CONTROLS,\r\n  QuillContent\r\n} from './quill.config';\r\nimport { EditorFullScreenHost } from '../editor-full-screen';\r\nimport { EditorFullScreenToggleComponent } from '../editor-full-screen-toggle/editor-full-screen-toggle.component';\r\nimport { _isEqual } from '../../../../../../shared/functions/isEqual';\r\n\r\nconst customInputConfig: BaseCustomInputConfig = {\r\n  controlType: 'lib-quill-input',\r\n  nextId: 0\r\n};\r\n\r\n/**\r\n * Quill (\"snow\" theme) rich-text editor wired into Angular Material's form-field as a\r\n * custom `MatFormFieldControl`. The full Quill setup — toolbar, formats, history — lives in\r\n * `quill.config.ts`; this component owns lifecycle, SSR gating and value round-tripping.\r\n */\r\n@Component({\r\n  selector: 'lib-quill-input',\r\n  templateUrl: './quill-input.component.html',\r\n  styleUrl: './quill-input.component.css',\r\n  imports: [EditorFullScreenToggleComponent],\r\n  host: {\r\n    '[class.floating]': 'shouldLabelFloat',\r\n    '[id]': 'id',\r\n    '(keydown.escape)': 'onEscape($event)'\r\n  },\r\n  providers: [{ provide: MatFormFieldControl, useExisting: QuillInputComponent }],\r\n  changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class QuillInputComponent\r\n  extends BaseCustomInput<QuillContent | undefined>\r\n  implements AfterViewInit, OnDestroy {\r\n\r\n  readonly inputConfig = input.required<ITowerStepColumn>();\r\n\r\n  readonly valueChanged = output<QuillContent | undefined>();\r\n\r\n  protected editor: QuillType | undefined;\r\n\r\n  /** Whether the editor is currently popped out to fill the screen. */\r\n  protected readonly fullScreen = signal(false);\r\n\r\n  /** Mirrors the CVA's disabled state into the signal graph so the template can react to it. */\r\n  readonly #controlDisabled = signal(false);\r\n\r\n  /**\r\n   * Read-only when either the column config or the reactive-form control says so. Drives both\r\n   * Quill's own editable state and hiding the formatting toolbar, which is dead weight when\r\n   * nothing can be edited.\r\n   */\r\n  protected readonly readOnly = computed(() => {\r\n    const config = this.inputConfig();\r\n    return this.#controlDisabled() || config.readonly || config.disabled || false;\r\n  });\r\n\r\n  /**\r\n   * Height the in-flow wrapper holds onto while the editor is popped out. Set from the editor's\r\n   * measured height on the way in, cleared on the way out.\r\n   */\r\n  protected readonly reservedHeight = signal<number | null>(null);\r\n\r\n  private readonly editorHost = viewChild.required<ElementRef<HTMLElement>>('editorHost');\r\n\r\n  /**\r\n   * The bordered surface Quill fills — toolbar included. This is what gets promoted to the\r\n   * browser's top layer. (`viewChild` cannot sit on an ES-private field — NG1053.)\r\n   */\r\n  private readonly quillHost = viewChild.required<ElementRef<HTMLElement>>('quillHost');\r\n\r\n  readonly #platformId = inject(PLATFORM_ID);\r\n\r\n  readonly #document = inject(DOCUMENT);\r\n\r\n  #changeHandler: (() => void) | undefined;\r\n\r\n  #fullScreenHost: EditorFullScreenHost | undefined;\r\n\r\n  /** Guards against overlapping pop-out transitions (see `#toggleFullScreen`). */\r\n  #toggling = false;\r\n\r\n  constructor() {\r\n    super(\r\n      inject(NgControl, { optional: true, self: true }) as NgControl,\r\n      inject<ElementRef<HTMLElement>>(ElementRef),\r\n      customInputConfig\r\n    );\r\n  }\r\n\r\n  override get empty(): boolean {\r\n    const n = this.value;\r\n    return n === null || n === undefined;\r\n  }\r\n\r\n  override get shouldLabelFloat(): boolean {\r\n    return true;\r\n  }\r\n\r\n  override _value: QuillContent | undefined = undefined;\r\n\r\n  @Input() override set value(value: QuillContent | undefined) {\r\n    if (!_isEqual(this._value, value)) {\r\n      this._value = value;\r\n      this.onChange(value);\r\n      this.stateChanges.next();\r\n    }\r\n  }\r\n\r\n  override get value(): QuillContent | undefined {\r\n    return this._value;\r\n  }\r\n\r\n  async ngAfterViewInit(): Promise<void> {\r\n    if (!isPlatformBrowser(this.#platformId)) return;\r\n\r\n    // Browser-only dynamic load — see the Trap 16 comment at the top of this file. The\r\n    // CSS import injects Quill's global theme styles (Quill's runtime DOM is not view-scoped).\r\n    const [{ default: Quill, Delta }] = await Promise.all([\r\n      import('quill'),\r\n      import('quill/dist/quill.snow.css')\r\n    ]);\r\n\r\n    this.#fullScreenHost = new EditorFullScreenHost(this.#document, () => this.#setFullScreen(false));\r\n\r\n    const config = this.inputConfig();\r\n    this.editor = new Quill(this.editorHost().nativeElement, buildQuillOptions({\r\n      readOnly: this.readOnly(),\r\n      placeholder: config.placeholder\r\n    }));\r\n\r\n    const initial = this.value;\r\n    if (initial?.ops?.length) {\r\n      this.editor.setContents(new Delta(initial.ops), 'silent');\r\n    }\r\n\r\n    // A `setDisabledState` that arrived before the editor existed is applied here.\r\n    this.#applyReadOnly();\r\n    this.#decorateToolbar();\r\n\r\n    this.#changeHandler = () => this.contentChangedSaveValue();\r\n    this.editor.on('text-change', this.#changeHandler);\r\n  }\r\n\r\n  /**\r\n   * Quill ships no icons for custom buttons and no tooltips for any button. Inject themeable\r\n   * SVG icons (their `ql-stroke` paths inherit the toolbar colour) and `title` tooltips so the\r\n   * toolbar reads clearly in both light and dark mode.\r\n   */\r\n  #decorateToolbar(): void {\r\n    const root = this._elementRef.nativeElement;\r\n    for (const control of QUILL_TABLE_CONTROLS) {\r\n      const button = root.querySelector<HTMLElement>(`.ql-${control.format}`);\r\n      if (!button) continue;\r\n      button.innerHTML = control.icon;\r\n      button.setAttribute('title', control.title);\r\n    }\r\n    for (const [selector, title] of Object.entries(QUILL_BUILTIN_TITLES)) {\r\n      root.querySelectorAll<HTMLElement>(selector).forEach(el => el.setAttribute('title', title));\r\n    }\r\n  }\r\n\r\n  /**\r\n   * Keeps Quill's own read-only state in step with the control's. The pop-out re-enables pointer\r\n   * events on the popped-out surface (Material kills them field-wide when the control is\r\n   * disabled), so this is what actually keeps a disabled field uneditable — the CSS no longer\r\n   * does it.\r\n   */\r\n  override setDisabledState(isDisabled: boolean): void {\r\n    super.setDisabledState(isDisabled);\r\n    this.#controlDisabled.set(isDisabled);\r\n    this.#applyReadOnly();\r\n  }\r\n\r\n  /** Pushes {@link readOnly} onto the Quill instance, which is not reactive. */\r\n  #applyReadOnly(): void {\r\n    this.editor?.enable(!this.readOnly());\r\n  }\r\n\r\n  /** Toggles the pop-out from the floating button. */\r\n  protected toggleFullScreen(): void {\r\n    void this.#toggleFullScreen();\r\n  }\r\n\r\n  /**\r\n   * Pops the editor out to fill the screen, or restores it. Wired to the toolbar button, so it\r\n   * always runs inside the click gesture the Fullscreen API requires — everything up to the\r\n   * promotion is synchronous for that reason.\r\n   */\r\n  async #toggleFullScreen(): Promise<void> {\r\n    const fullScreenHost = this.#fullScreenHost;\r\n    // Both transitions settle asynchronously; ignore clicks that land mid-flight rather than\r\n    // letting a second `requestFullscreen()` race the first.\r\n    if (!fullScreenHost || this.#toggling) return;\r\n    this.#toggling = true;\r\n\r\n    // Promotion re-lays the editor out, which drops the caret; put it back afterwards.\r\n    // `getSelection()` without an argument reads the range without stealing focus.\r\n    const selection = this.editor?.getSelection() ?? null;\r\n\r\n    try {\r\n      if (this.fullScreen()) {\r\n        await fullScreenHost.exit();\r\n      } else {\r\n        const element = this.quillHost().nativeElement;\r\n        this.reservedHeight.set(element.offsetHeight);\r\n        await fullScreenHost.enter(element);\r\n      }\r\n    } finally {\r\n      // `enter()` degrades rather than throwing, but `exit()` can reject if the browser refuses\r\n      // to leave full screen. Either way the controller has already settled its own state, so\r\n      // read it back instead of assuming the toggle succeeded.\r\n      this.#setFullScreen(fullScreenHost.active);\r\n      this.#restoreSelection(selection);\r\n      this.#toggling = false;\r\n    }\r\n  }\r\n\r\n  /**\r\n   * Escape leaves the pop-out. Native full screen is torn down by the browser itself (picked up\r\n   * through `fullscreenchange`); this covers the popover and fixed fallbacks. The event is\r\n   * stopped so Escape closes the editor rather than an enclosing dialog.\r\n   */\r\n  protected onEscape(event: Event): void {\r\n    if (!this.fullScreen()) return;\r\n    event.preventDefault();\r\n    event.stopPropagation();\r\n    void this.#toggleFullScreen();\r\n  }\r\n\r\n  /**\r\n   * Single funnel for pop-out state, so the signal and the reserved space always agree —\r\n   * including when the browser closed full screen on its own.\r\n   */\r\n  #setFullScreen(active: boolean): void {\r\n    this.fullScreen.set(active);\r\n    if (!active) this.reservedHeight.set(null);\r\n  }\r\n\r\n  /** Returns the caret to where it was before the pop-out re-laid the editor out. */\r\n  #restoreSelection(selection: QuillRange | null): void {\r\n    const editor = this.editor;\r\n    if (!editor) return;\r\n    if (selection) editor.setSelection(selection, 'silent');\r\n    else editor.focus();\r\n  }\r\n\r\n  contentChangedSaveValue(): void {\r\n    if (!this.editor) return;\r\n    const ops = this.editor.getContents().ops;\r\n    const value: QuillContent | undefined = isEmptyQuillDocument(ops) ? undefined : { ops };\r\n    this.value = value;\r\n    this.onChange(value);\r\n    this.valueChanged.emit(value);\r\n  }\r\n\r\n  override ngOnDestroy(): void {\r\n    this.#fullScreenHost?.destroy();\r\n    this.#fullScreenHost = undefined;\r\n    if (this.editor && this.#changeHandler) {\r\n      this.editor.off('text-change', this.#changeHandler);\r\n    }\r\n    this.editor = undefined;\r\n    // Tear the editor down first, then let the base complete `stateChanges` / `destroy$` and\r\n    // clear the temporary-error timer — none of which happened while this override skipped it.\r\n    super.ngOnDestroy();\r\n  }\r\n}\r\n","\r\n<!-- `.quill-shell` stays in the document flow and holds the editor's footprint while\r\n     `.quill-host` is promoted to the browser's top layer for full screen. Without it the\r\n     surrounding form-field collapses by the editor's height, and the page scroll position\r\n     jumps when full screen is left. -->\r\n<div class=\"quill-shell\" [style.height.px]=\"reservedHeight()\">\r\n  <div class=\"quill-host\" #quillHost [class.is-readonly]=\"readOnly()\">\r\n    <div #editorHost></div>\r\n\r\n    <!-- Floats over the editing surface rather than living in the toolbar, so it survives the\r\n         toolbar being hidden in read-only mode. -->\r\n    <lib-editor-full-screen-toggle\r\n      [active]=\"fullScreen()\"\r\n      (toggled)=\"toggleFullScreen()\"\r\n    ></lib-editor-full-screen-toggle>\r\n  </div>\r\n</div>\r\n","import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\r\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport type { ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { RichTextEditorType } from 'ngx-t-forms-types';\r\nimport { TFormInputStatusComponent } from '../../../t-form-input-status/t-form-input-status.component';\r\nimport { EditorJsInputComponent } from './core/editor-js-input/editor-js-input.component';\r\nimport { QuillInputComponent } from './core/quill-input/quill-input.component';\r\nimport { getInputErrorMessage } from '../../../../services/core/t-input-controller/functions/inputErrorMessage';\r\n\r\n/**\r\n * Wraps a configurable rich-text editor inside a `mat-form-field`, selecting the concrete\r\n * editor (EditorJS or Quill) from the column's `richTextEditorLibrary`, with shared\r\n * label / hint / error / suffix / prefix metadata from the column.\r\n */\r\n@Component({\r\n  selector: 'lib-editor-input-element',\r\n  templateUrl: './editor-input-element.component.html',\r\n  styleUrl: './editor-input-element.component.css',\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n  imports: [\r\n    ReactiveFormsModule,\r\n    MatFormFieldModule,\r\n    MatIconModule,\r\n    MatButtonModule,\r\n    MatTooltipModule,\r\n    TFormInputStatusComponent,\r\n    EditorJsInputComponent,\r\n    QuillInputComponent,\r\n  ],\r\n})\r\nexport class EditorInputElementComponent {\r\n  readonly inputConfig = input.required<ITowerStepColumn>();\r\n  readonly formGroup = input.required<FormGroup>();\r\n  readonly reload = output<void>();\r\n\r\n  /** Editor-library enum exposed for `@switch` in the template. */\r\n  protected readonly editorType = RichTextEditorType;\r\n\r\n  protected readonly errorMessage = computed(() =>\r\n    getInputErrorMessage(this.inputConfig(), this.formGroup()),\r\n  );\r\n}\r\n","<form [formGroup]=\"formGroup()\">\r\n  @if (inputConfig(); as inputConfig) {\r\n    <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n      <mat-label>\r\n        {{ inputConfig.label }}\r\n        <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n      </mat-label>\r\n\r\n      @switch (inputConfig.richTextEditorLibrary) {\r\n        @case (editorType.Quill) {\r\n          <lib-quill-input\r\n            [inputConfig]=\"inputConfig\"\r\n            [formControlName]=\"inputConfig.id\"\r\n            [required]=\"inputConfig.required\"\r\n          ></lib-quill-input>\r\n        }\r\n        @case (editorType.EditorJS) {\r\n          <lib-editor-js-input\r\n            [inputConfig]=\"inputConfig\"\r\n            [formControlName]=\"inputConfig.id\"\r\n            [required]=\"inputConfig.required\"\r\n          ></lib-editor-js-input>\r\n        }\r\n      }\r\n\r\n      @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n        <mat-hint class=\"inputHint\">\r\n          {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n        </mat-hint>\r\n      }\r\n\r\n      @if (!!errorMessage()) {\r\n        <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n      }\r\n\r\n      @if (inputConfig.prefixIcon) {\r\n        <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n      }\r\n\r\n      @if (inputConfig.canReload?.canReload) {\r\n        <button\r\n          mat-icon-button\r\n          style=\"margin-right: 4px;\"\r\n          matTooltip=\"Click to refresh this field.\"\r\n          class=\"input-sync-button\"\r\n          (click)=\"inputConfig.canReload.emit()\"\r\n          matSuffix\r\n        >\r\n          <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n        </button>\r\n      }\r\n\r\n      @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n        <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n      }\r\n\r\n      @if (inputConfig.prefixText) {\r\n        <span matPrefix style=\"top: 0\">{{ inputConfig.prefixText }}</span>\r\n      }\r\n      @if (inputConfig.suffixText) {\r\n        <span matSuffix style=\"padding-left: 5px\">{{ inputConfig.suffixText }}</span>\r\n      }\r\n\r\n      @if (inputConfig.maxLength && formGroup()) {\r\n        <mat-hint align=\"end\">\r\n          {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\r\n        </mat-hint>\r\n      }\r\n    </mat-form-field>\r\n  }\r\n</form>\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAgDA,MAAM,GAAG,GAAG,CAAC,IAAY,KAAa,CAAA,yBAAA,EAA4B,IAAI,CAAA,MAAA,CAAQ;AAE9E;;;AAGG;AACI,MAAM,oBAAoB,GAAiC;AAChE,IAAA;AACE,QAAA,MAAM,EAAE,cAAc;AACtB,QAAA,KAAK,EAAE,oBAAoB;AAC3B,QAAA,IAAI,EAAE,GAAG,CAAC,mVAAmV,CAAC;AAC9V,QAAA,GAAG,EAAE,KAAK,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;AACtC,KAAA;AACD,IAAA;AACE,QAAA,MAAM,EAAE,WAAW;AACnB,QAAA,KAAK,EAAE,kBAAkB;AACzB,QAAA,IAAI,EAAE,GAAG,CAAC,iNAAiN,CAAC;QAC5N,GAAG,EAAE,KAAK,IAAI,KAAK,CAAC,cAAc,EAAE;AACrC,KAAA;AACD,IAAA;AACE,QAAA,MAAM,EAAE,cAAc;AACtB,QAAA,KAAK,EAAE,qBAAqB;AAC5B,QAAA,IAAI,EAAE,GAAG,CAAC,iNAAiN,CAAC;QAC5N,GAAG,EAAE,KAAK,IAAI,KAAK,CAA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