{"version":3,"file":"ngx-t-forms-quill-input.component-CN3aorpW.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/editor-full-screen.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/editor-input-element/core/editor-full-screen-toggle/editor-full-screen-toggle.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/editor-input-element/core/editor-full-screen-toggle/editor-full-screen-toggle.component.html","../../../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"],"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","/**\r\n * Element-level \"pop out to full screen\" shared by the rich-text editors in this folder.\r\n *\r\n * A plain `position: fixed` overlay is **not** sufficient here, and that is the whole point of\r\n * this file. The editors render inside a `mat-form-field`, which consumers routinely nest inside\r\n * a Material stepper, tab body, drawer or dialog. `position: fixed` is viewport-relative only\r\n * while **no** ancestor establishes a containing block — any ancestor with `transform`, `filter`,\r\n * `contain`, `will-change`, `backdrop-filter` or `perspective` captures it, and that ancestor's\r\n * `overflow: hidden` then clips it. Which of those a consumer uses is unknowable from in here, so\r\n * the pop-out has to stop depending on the host component altogether.\r\n *\r\n * The browser's **top layer** is what does that: elements promoted into it are painted outside\r\n * the ancestor chain and are immune to ancestor `transform`, `overflow`, `z-index` and stacking\r\n * contexts. Three strategies are tried, best first:\r\n *\r\n * 1. `requestFullscreen()` — top layer **and** drops the browser chrome. Needs a user gesture.\r\n * 2. `showPopover()` — top layer, no gesture required; covers browsers where element full screen\r\n *    is unavailable (Safari on iPhone) or blocked by a `fullscreen` permissions policy in an\r\n *    iframe.\r\n * 3. `position: fixed` — last resort for browsers with neither API.\r\n *\r\n * The element is promoted **in place** — never re-parented to `<body>`. Top-layer promotion\r\n * changes painting, not inheritance, so the editor keeps inheriting the app's `--mat-sys-*` theme\r\n * variables from its real ancestors; a portal to `<body>` would lose them.\r\n *\r\n * Only the standard, promise-returning `requestFullscreen` is used. The legacy\r\n * `webkitRequestFullscreen` returns `void` and reports failure through a separate event, so a\r\n * rejection could not be observed in time to fall through cleanly — those browsers take path 2/3.\r\n */\r\n\r\n/**\r\n * Class carried by the element while it is popped out. Each editor styles it in its own\r\n * stylesheet, and that rule **must** set a `display` value: it is what keeps the element visible\r\n * during the popover path (see {@link EditorFullScreenHost.enter}).\r\n */\r\nexport const EDITOR_FULL_SCREEN_CLASS = 'is-fullscreen';\r\n\r\n/** Mechanism currently holding the element open. */\r\nexport type EditorFullScreenMode = 'fullscreen' | 'popover' | 'fixed';\r\n\r\n/**\r\n * Owns the pop-out of a single element. One instance per editor; created behind the component's\r\n * `isPlatformBrowser` guard so nothing here runs during SSR.\r\n */\r\nexport class EditorFullScreenHost {\r\n  readonly #document: Document;\r\n  readonly #onExternalExit: () => void;\r\n\r\n  #element: HTMLElement | undefined;\r\n  #mode: EditorFullScreenMode | undefined;\r\n\r\n  /**\r\n   * @param document The owning document, injected via `DOCUMENT` — never the global.\r\n   * @param onExternalExit Called when the browser closed the pop-out without going through\r\n   *   {@link exit} (Escape, F11, another element claiming full screen).\r\n   */\r\n  constructor(document: Document, onExternalExit: () => void) {\r\n    this.#document = document;\r\n    this.#onExternalExit = onExternalExit;\r\n    this.#document.addEventListener('fullscreenchange', this.#handleFullScreenChange);\r\n  }\r\n\r\n  /** Whether an element is currently popped out. */\r\n  get active(): boolean {\r\n    return this.#mode !== undefined;\r\n  }\r\n\r\n  /**\r\n   * Pops `element` out using the best mechanism the browser allows, adding\r\n   * {@link EDITOR_FULL_SCREEN_CLASS} for the duration.\r\n   *\r\n   * Must be called synchronously from a user gesture, otherwise the Fullscreen API rejects and\r\n   * the pop-out silently degrades to the popover path.\r\n   *\r\n   * @param element The element to promote — must be the one carrying the editor chrome.\r\n   * @returns The mechanism that ended up being used.\r\n   */\r\n  async enter(element: HTMLElement): Promise<EditorFullScreenMode> {\r\n    if (this.#mode !== undefined) return this.#mode;\r\n\r\n    // Added first, and deliberately so: the class sets `display`, which — being author origin —\r\n    // beats the UA's `[popover]:not(:popover-open) { display: none }`. Without it the element\r\n    // would be display:none for the window between `setAttribute` and `showPopover()` below, and\r\n    // a style recalculation inside that window blurs whatever the user was typing in.\r\n    this.#element = element;\r\n    element.classList.add(EDITOR_FULL_SCREEN_CLASS);\r\n\r\n    // `fullscreenEnabled` is false when a permissions policy blocks it (an iframe without\r\n    // `allow=\"fullscreen\"`) and where element full screen is unsupported (Safari on iPhone).\r\n    if (this.#document.fullscreenEnabled && typeof element.requestFullscreen === 'function') {\r\n      try {\r\n        await element.requestFullscreen();\r\n        this.#mode = 'fullscreen';\r\n        return this.#mode;\r\n      } catch {\r\n        // Rejected — no transient activation, or the UA refused. Fall through to the top-layer\r\n        // popover, which needs neither.\r\n      }\r\n    }\r\n\r\n    if (typeof element.showPopover === 'function') {\r\n      element.setAttribute('popover', 'manual');\r\n      try {\r\n        element.showPopover();\r\n        this.#mode = 'popover';\r\n        return this.#mode;\r\n      } catch {\r\n        element.removeAttribute('popover');\r\n      }\r\n    }\r\n\r\n    this.#mode = 'fixed';\r\n    return this.#mode;\r\n  }\r\n\r\n  /** Closes the pop-out and returns the element to its place in the document flow. */\r\n  async exit(): Promise<void> {\r\n    const element = this.#element;\r\n    const mode = this.#mode;\r\n    this.#element = undefined;\r\n    this.#mode = undefined;\r\n    if (!element || mode === undefined) return;\r\n\r\n    try {\r\n      if (mode === 'fullscreen') {\r\n        // Leave full screen first: `exitFullscreen()` settles only once the browser's own\r\n        // transition has finished, and the class is what styles the surface until then.\r\n        if (this.#document.fullscreenElement === element) await this.#document.exitFullscreen();\r\n      } else if (mode === 'popover') {\r\n        element.hidePopover();\r\n        element.removeAttribute('popover');\r\n      }\r\n    } finally {\r\n      element.classList.remove(EDITOR_FULL_SCREEN_CLASS);\r\n    }\r\n  }\r\n\r\n  /** Detaches the document listener and closes any open pop-out. Call from `ngOnDestroy`. */\r\n  destroy(): void {\r\n    this.#document.removeEventListener('fullscreenchange', this.#handleFullScreenChange);\r\n    void this.exit();\r\n  }\r\n\r\n  /**\r\n   * The browser can close a native full screen behind our back — Escape, F11, or another element\r\n   * taking the top layer. Reconcile our own state and tell the owner so its toggle follows.\r\n   */\r\n  readonly #handleFullScreenChange = (): void => {\r\n    if (this.#mode !== 'fullscreen') return;\r\n    if (this.#document.fullscreenElement === this.#element) return;\r\n\r\n    this.#element?.classList.remove(EDITOR_FULL_SCREEN_CLASS);\r\n    this.#element = undefined;\r\n    this.#mode = undefined;\r\n    this.#onExternalExit();\r\n  };\r\n}\r\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, input, output } from '@angular/core';\r\n\r\n/**\r\n * Floating action button that pops a rich-text editor out to full screen and back.\r\n *\r\n * Shared by the Quill and Editor.js inputs so both carry the same affordance, icon and\r\n * accessible naming. It deliberately owns no state: the editor that hosts it drives {@link active}\r\n * and performs the promotion (see `editor-full-screen.ts`).\r\n *\r\n * Positioning belongs to the host — this component styles only the button. Place it by targeting\r\n * the element selector from the host's stylesheet.\r\n *\r\n * @example\r\n *   <lib-editor-full-screen-toggle [active]=\"fullScreen()\" (toggled)=\"toggleFullScreen()\" />\r\n */\r\n@Component({\r\n  selector: 'lib-editor-full-screen-toggle',\r\n  templateUrl: './editor-full-screen-toggle.component.html',\r\n  styleUrl: './editor-full-screen-toggle.component.css',\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n  encapsulation: ViewEncapsulation.Emulated,\r\n  host: {\r\n    'class': 'lib-editor-full-screen-toggle'\r\n  },\r\n  imports: []\r\n})\r\nexport class EditorFullScreenToggleComponent {\r\n  /** Whether the editor this controls is currently popped out. */\r\n  readonly active = input.required<boolean>();\r\n\r\n  /** Emitted when the user asks to enter or leave full screen. */\r\n  readonly toggled = output<void>();\r\n\r\n  /** Serves as both tooltip and accessible name, so the two can never drift apart. */\r\n  protected readonly label = computed(() => (this.active() ? 'Exit full screen' : 'Full screen'));\r\n}\r\n","<button\r\n  type=\"button\"\r\n  class=\"fab\"\r\n  [title]=\"label()\"\r\n  [attr.aria-label]=\"label()\"\r\n  [attr.aria-pressed]=\"active()\"\r\n  (click)=\"toggled.emit()\"\r\n>\r\n  @if (active()) {\r\n    <svg viewBox=\"0 0 18 18\" aria-hidden=\"true\">\r\n      <polyline points=\"3 7 7 7 7 3\"></polyline>\r\n      <polyline points=\"11 3 11 7 15 7\"></polyline>\r\n      <polyline points=\"15 11 11 11 11 15\"></polyline>\r\n      <polyline points=\"7 15 7 11 3 11\"></polyline>\r\n    </svg>\r\n  } @else {\r\n    <svg viewBox=\"0 0 18 18\" aria-hidden=\"true\">\r\n      <polyline points=\"7 3 3 3 3 7\"></polyline>\r\n      <polyline points=\"11 3 15 3 15 7\"></polyline>\r\n      <polyline points=\"15 11 15 15 11 15\"></polyline>\r\n      <polyline points=\"3 11 3 15 7 15\"></polyline>\r\n    </svg>\r\n  }\r\n</button>\r\n","/// <reference path=\"../../../../../../../types/quill.d.ts\" />\nimport {\n  AfterViewInit,\n  ChangeDetectionStrategy,\n  Component,\n  ElementRef,\n  Input,\n  OnDestroy,\n  PLATFORM_ID,\n  computed,\n  inject,\n  input,\n  output,\n  signal,\n  viewChild\n} from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { NgControl } from '@angular/forms';\n\nimport { ITowerStepColumn } from 'ngx-t-forms-types';\n// Mirrors the EditorJS sibling (Trap 16): `quill` is a browser-only bundle that touches\n// `document` at construction time and crashes under bare-Node SSR. The top-level import is\n// type-only (zero runtime emission); the real load happens inside the SSR-gated\n// `ngAfterViewInit` via dynamic `import()`.\nimport type QuillType from 'quill';\nimport type { Range as QuillRange } from 'quill';\nimport { MatFormFieldControl } from '@angular/material/form-field';\n\nimport { BaseCustomInput, BaseCustomInputConfig } from '../../../../../../services/core/t-input-controller/functions/baseCustomInput';\nimport {\n  buildQuillOptions,\n  isEmptyQuillDocument,\n  QUILL_BUILTIN_TITLES,\n  QUILL_TABLE_CONTROLS,\n  QuillContent\n} from './quill.config';\nimport { EditorFullScreenHost } from '../editor-full-screen';\nimport { EditorFullScreenToggleComponent } from '../editor-full-screen-toggle/editor-full-screen-toggle.component';\nimport { TokenBindingMenuComponent, type TokenMenuAnchor } from '../../../../../t-dynamic-data-edit/elements/token-binding-menu/token-binding-menu.component';\nimport type { EditorBinding } from '../../../../../t-dynamic-data-edit/elements/json-editor/json-editor.component';\nimport { _isEqual } from '../../../../../../shared/functions/isEqual';\n\nconst customInputConfig: BaseCustomInputConfig = {\n  controlType: 'lib-quill-input',\n  nextId: 0\n};\n\n/**\n * Quill (\"snow\" theme) rich-text editor wired into Angular Material's form-field as a\n * custom `MatFormFieldControl`. The full Quill setup — toolbar, formats, history — lives in\n * `quill.config.ts`; this component owns lifecycle, SSR gating and value round-tripping.\n */\n@Component({\n  selector: 'lib-quill-input',\n  templateUrl: './quill-input.component.html',\n  styleUrl: './quill-input.component.css',\n  imports: [EditorFullScreenToggleComponent, TokenBindingMenuComponent],\n  host: {\n    '[class.floating]': 'shouldLabelFloat',\n    '[id]': 'id',\n    '(keydown.escape)': 'onEscape($event)'\n  },\n  providers: [{ provide: MatFormFieldControl, useExisting: QuillInputComponent }],\n  changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class QuillInputComponent\n  extends BaseCustomInput<QuillContent | undefined>\n  implements AfterViewInit, OnDestroy {\n\n  readonly inputConfig = input.required<ITowerStepColumn>();\n\n  readonly valueChanged = output<QuillContent | undefined>();\n\n  /**\n   * Insertable bindings for the `$`-trigger picker. Empty (the default) leaves the\n   * gesture inert, so every existing consumer of this editor is unaffected.\n   *\n   * Same contract, same menu and same inserted spelling as\n   * `TokenTextInputComponent` and the JSON template editors — see\n   * `_shared/field-bindings.ts`.\n   */\n  @Input()\n  set bindings(value: readonly EditorBinding[] | undefined) {\n    this.#bindings.set(value ?? []);\n  }\n  get bindings(): readonly EditorBinding[] {\n    return this.#bindings();\n  }\n  readonly #bindings = signal<readonly EditorBinding[]>([]);\n\n  /** Whether the `$` menu is open. */\n  protected readonly menuOpen = signal(false);\n  /** Index of the highlighted option. */\n  protected readonly activeIndex = signal(0);\n  /** Viewport position of the menu, derived from Quill's own caret bounds. */\n  protected readonly anchor = signal<TokenMenuAnchor | null>(null);\n  /** Text typed after the `$` that opened the menu. */\n  readonly #filter = signal('');\n  /** Document index of the `$` that opened the menu. */\n  #triggerIndex = -1;\n\n  /** Matches `TokenTextInputComponent.FILTER_PATTERN` (dots + hyphens included, for `$ns.key` ids) so the gesture feels identical. */\n  static readonly FILTER_PATTERN = /^[a-zA-Z0-9_.\\s-]*$/;\n\n  /** Bindings matching the active filter, capped so the list stays usable. */\n  protected readonly filtered = computed(() => {\n    const term = this.#filter().trim().toLowerCase();\n    const all = this.#bindings();\n    if (!term) {\n      return all.slice(0, 50);\n    }\n    return all\n      .filter(b => (String(b.searchText ?? \"\") + \" \" + b.label).toLowerCase().includes(term))\n      .slice(0, 50);\n  });\n\n\n  protected editor: QuillType | undefined;\n\n  /** Whether the editor is currently popped out to fill the screen. */\n  protected readonly fullScreen = signal(false);\n\n  /** Mirrors the CVA's disabled state into the signal graph so the template can react to it. */\n  readonly #controlDisabled = signal(false);\n\n  /**\n   * Read-only when either the column config or the reactive-form control says so. Drives both\n   * Quill's own editable state and hiding the formatting toolbar, which is dead weight when\n   * nothing can be edited.\n   */\n  protected readonly readOnly = computed(() => {\n    const config = this.inputConfig();\n    return this.#controlDisabled() || config.readonly || config.disabled || false;\n  });\n\n  /**\n   * Height the in-flow wrapper holds onto while the editor is popped out. Set from the editor's\n   * measured height on the way in, cleared on the way out.\n   */\n  protected readonly reservedHeight = signal<number | null>(null);\n\n  private readonly editorHost = viewChild.required<ElementRef<HTMLElement>>('editorHost');\n\n  /**\n   * The bordered surface Quill fills — toolbar included. This is what gets promoted to the\n   * browser's top layer. (`viewChild` cannot sit on an ES-private field — NG1053.)\n   */\n  private readonly quillHost = viewChild.required<ElementRef<HTMLElement>>('quillHost');\n\n  readonly #platformId = inject(PLATFORM_ID);\n\n  readonly #document = inject(DOCUMENT);\n\n  #changeHandler: (() => void) | undefined;\n\n  /** Bound once so `on`/`off` refer to the same function. */\n  readonly #menuSyncHandler = (): void => this.#syncBindingMenu();\n\n  #fullScreenHost: EditorFullScreenHost | undefined;\n\n  /** Guards against overlapping pop-out transitions (see `#toggleFullScreen`). */\n  #toggling = false;\n\n  constructor() {\n    super(\n      inject(NgControl, { optional: true, self: true }) as NgControl,\n      inject<ElementRef<HTMLElement>>(ElementRef),\n      customInputConfig\n    );\n  }\n\n  override get empty(): boolean {\n    const n = this.value;\n    return n === null || n === undefined;\n  }\n\n  override get shouldLabelFloat(): boolean {\n    return true;\n  }\n\n  override _value: QuillContent | undefined = undefined;\n\n  @Input() override set value(value: QuillContent | undefined) {\n    if (!_isEqual(this._value, value)) {\n      this._value = value;\n      this.onChange(value);\n      this.stateChanges.next();\n    }\n  }\n\n  override get value(): QuillContent | undefined {\n    return this._value;\n  }\n\n  async ngAfterViewInit(): Promise<void> {\n    if (!isPlatformBrowser(this.#platformId)) return;\n\n    // Browser-only dynamic load — see the Trap 16 comment at the top of this file. The\n    // CSS import injects Quill's global theme styles (Quill's runtime DOM is not view-scoped).\n    const [{ default: Quill, Delta }] = await Promise.all([\n      import('quill'),\n      import('quill/dist/quill.snow.css')\n    ]);\n\n    this.#fullScreenHost = new EditorFullScreenHost(this.#document, () => this.#setFullScreen(false));\n\n    const config = this.inputConfig();\n    this.editor = new Quill(this.editorHost().nativeElement, buildQuillOptions({\n      readOnly: this.readOnly(),\n      placeholder: config.placeholder\n    }));\n\n    const initial = this.value;\n    if (initial?.ops?.length) {\n      this.editor.setContents(new Delta(initial.ops), 'silent');\n    }\n\n    // A `setDisabledState` that arrived before the editor existed is applied here.\n    this.#applyReadOnly();\n    this.#decorateToolbar();\n\n    this.#changeHandler = () => this.contentChangedSaveValue();\n    this.editor.on('text-change', this.#changeHandler);\n    // MENU SYNC RIDES editor-change, NOT text-change: editor-change fires for\n    // selection moves too and always AFTER the selection is updated, so\n    // getSelection() inside the handler is never stale — and the menu also\n    // closes when the caret merely moves away from the trigger.\n    this.editor.on('editor-change', this.#menuSyncHandler);\n    this.editorHost().nativeElement.addEventListener('keydown', this.#onBindingKeydown, true);\n  }\n\n  /**\n   * Quill ships no icons for custom buttons and no tooltips for any button. Inject themeable\n   * SVG icons (their `ql-stroke` paths inherit the toolbar colour) and `title` tooltips so the\n   * toolbar reads clearly in both light and dark mode.\n   */\n  #decorateToolbar(): void {\n    const root = this._elementRef.nativeElement;\n    for (const control of QUILL_TABLE_CONTROLS) {\n      const button = root.querySelector<HTMLElement>(`.ql-${control.format}`);\n      if (!button) continue;\n      button.innerHTML = control.icon;\n      button.setAttribute('title', control.title);\n    }\n    for (const [selector, title] of Object.entries(QUILL_BUILTIN_TITLES)) {\n      root.querySelectorAll<HTMLElement>(selector).forEach(el => el.setAttribute('title', title));\n    }\n  }\n\n  /**\n   * Keeps Quill's own read-only state in step with the control's. The pop-out re-enables pointer\n   * events on the popped-out surface (Material kills them field-wide when the control is\n   * disabled), so this is what actually keeps a disabled field uneditable — the CSS no longer\n   * does it.\n   */\n  override setDisabledState(isDisabled: boolean): void {\n    super.setDisabledState(isDisabled);\n    this.#controlDisabled.set(isDisabled);\n    this.#applyReadOnly();\n  }\n\n  /** Pushes {@link readOnly} onto the Quill instance, which is not reactive. */\n  #applyReadOnly(): void {\n    this.editor?.enable(!this.readOnly());\n  }\n\n  /** Toggles the pop-out from the floating button. */\n  protected toggleFullScreen(): void {\n    void this.#toggleFullScreen();\n  }\n\n  /**\n   * Pops the editor out to fill the screen, or restores it. Wired to the toolbar button, so it\n   * always runs inside the click gesture the Fullscreen API requires — everything up to the\n   * promotion is synchronous for that reason.\n   */\n  async #toggleFullScreen(): Promise<void> {\n    const fullScreenHost = this.#fullScreenHost;\n    // Both transitions settle asynchronously; ignore clicks that land mid-flight rather than\n    // letting a second `requestFullscreen()` race the first.\n    if (!fullScreenHost || this.#toggling) return;\n    this.#toggling = true;\n\n    // Promotion re-lays the editor out, which drops the caret; put it back afterwards.\n    // `getSelection()` without an argument reads the range without stealing focus.\n    const selection = this.editor?.getSelection() ?? null;\n\n    try {\n      if (this.fullScreen()) {\n        await fullScreenHost.exit();\n      } else {\n        const element = this.quillHost().nativeElement;\n        this.reservedHeight.set(element.offsetHeight);\n        await fullScreenHost.enter(element);\n      }\n    } finally {\n      // `enter()` degrades rather than throwing, but `exit()` can reject if the browser refuses\n      // to leave full screen. Either way the controller has already settled its own state, so\n      // read it back instead of assuming the toggle succeeded.\n      this.#setFullScreen(fullScreenHost.active);\n      this.#restoreSelection(selection);\n      this.#toggling = false;\n    }\n  }\n\n  /**\n   * Escape leaves the pop-out. Native full screen is torn down by the browser itself (picked up\n   * through `fullscreenchange`); this covers the popover and fixed fallbacks. The event is\n   * stopped so Escape closes the editor rather than an enclosing dialog.\n   */\n  protected onEscape(event: Event): void {\n    if (!this.fullScreen()) return;\n    event.preventDefault();\n    event.stopPropagation();\n    void this.#toggleFullScreen();\n  }\n\n  /**\n   * Single funnel for pop-out state, so the signal and the reserved space always agree —\n   * including when the browser closed full screen on its own.\n   */\n  #setFullScreen(active: boolean): void {\n    this.fullScreen.set(active);\n    if (!active) this.reservedHeight.set(null);\n  }\n\n  /** Returns the caret to where it was before the pop-out re-laid the editor out. */\n  #restoreSelection(selection: QuillRange | null): void {\n    const editor = this.editor;\n    if (!editor) return;\n    if (selection) editor.setSelection(selection, 'silent');\n    else editor.focus();\n  }\n\n  contentChangedSaveValue(): void {\n    if (!this.editor) return;\n    const ops = this.editor.getContents().ops;\n    const value: QuillContent | undefined = isEmptyQuillDocument(ops) ? undefined : { ops };\n    this.value = value;\n    this.onChange(value);\n    this.valueChanged.emit(value);\n  }\n\n  override ngOnDestroy(): void {\n    this.editorHost()?.nativeElement?.removeEventListener('keydown', this.#onBindingKeydown, true);\n    this.#fullScreenHost?.destroy();\n    this.#fullScreenHost = undefined;\n    if (this.editor && this.#changeHandler) {\n      this.editor.off('text-change', this.#changeHandler);\n      this.editor.off('editor-change', this.#menuSyncHandler);\n    }\n    this.editor = undefined;\n    // Tear the editor down first, then let the base complete `stateChanges` / `destroy$` and\n    // clear the temporary-error timer — none of which happened while this override skipped it.\n    super.ngOnDestroy();\n  }\n\n  /**\n   * Re-evaluates the `$` menu against the caret. Runs on every editor-change.\n   *\n   * Quill addresses positions as an index into the document rather than a\n   * `selectionStart` on a string, so the caret maths is Quill-specific even\n   * though the menu it drives is the shared one.\n   */\n  #syncBindingMenu(): void {\n    const editor = this.editor;\n    if (!editor || this.readOnly() || this.#bindings().length === 0) {\n      this.menuOpen.set(false);\n      return;\n    }\n    const selection = editor.getSelection();\n    if (!selection) {\n      this.menuOpen.set(false);\n      return;\n    }\n    const caret = selection.index;\n    const before = editor.getText(0, caret);\n    const dollar = before.lastIndexOf('$');\n    if (dollar < 0) {\n      this.menuOpen.set(false);\n      return;\n    }\n    const term = before.slice(dollar + 1);\n    if (!QuillInputComponent.FILTER_PATTERN.test(term)) {\n      this.menuOpen.set(false);\n      return;\n    }\n    // `getBounds` is relative to the editor container; add its viewport offset.\n    const bounds = editor.getBounds(caret);\n    const host = this.editorHost().nativeElement.getBoundingClientRect();\n    this.anchor.set({\n      top: host.top + (bounds?.bottom ?? 0) + 6,\n      left: host.left + (bounds?.left ?? 0),\n      width: 260,\n    });\n    this.#triggerIndex = dollar;\n    this.#filter.set(term);\n    this.activeIndex.set(0);\n    this.menuOpen.set(true);\n  }\n\n  /**\n   * Replaces the `$filter` run with the binding token.\n   *\n   * Inserted as TEXT, which the email compiler promotes to a real token span\n   * (`quillToEmailHtml` 's `promoteTextTokens`). An atomic embed blot — which\n   * would stop an author splitting a token by formatting half of it — is the\n   * next step and does not change this call site.\n   */\n  protected insertBinding(binding: EditorBinding): void {\n    const editor = this.editor;\n    if (!editor || this.#triggerIndex < 0) {\n      this.menuOpen.set(false);\n      return;\n    }\n    const selection = editor.getSelection();\n    const caret = selection?.index ?? this.#triggerIndex;\n    const length = Math.max(0, caret - this.#triggerIndex);\n    editor.deleteText(this.#triggerIndex, length, 'user');\n    editor.insertText(this.#triggerIndex, binding.insert, 'user');\n    editor.setSelection(this.#triggerIndex + binding.insert.length, 0, 'user');\n    this.menuOpen.set(false);\n    this.#filter.set('');\n    this.#triggerIndex = -1;\n    this.contentChangedSaveValue();\n  }\n\n  /**\n   * Navigation and acceptance while the menu is open.\n   *\n   * Bound in the CAPTURE phase so it runs before Quill's own keyboard module,\n   * which otherwise swallows Enter as a newline and the arrows as caret moves.\n   */\n  #onBindingKeydown = (event: KeyboardEvent): void => {\n    if (!this.menuOpen()) {\n      return;\n    }\n    const options = this.filtered();\n    if (event.key === 'Escape') {\n      this.menuOpen.set(false);\n      event.stopPropagation();\n      event.preventDefault();\n      return;\n    }\n    if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n      if (options.length > 0) {\n        const step = event.key === 'ArrowDown' ? 1 : -1;\n        this.activeIndex.set((this.activeIndex() + step + options.length) % options.length);\n      }\n      event.stopPropagation();\n      event.preventDefault();\n      return;\n    }\n    if (event.key === 'Enter' || event.key === 'Tab') {\n      const chosen = options[this.activeIndex()];\n      if (chosen) {\n        this.insertBinding(chosen);\n        event.stopPropagation();\n        event.preventDefault();\n      }\n    }\n  };\n}\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>\n\n@if (menuOpen()) {\n  <lib-token-binding-menu\n    [options]=\"filtered()\"\n    [activeIndex]=\"activeIndex()\"\n    [anchor]=\"anchor()\"\n    (pick)=\"insertBinding($event)\" />\n}\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,cA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