@gilav21/shadcn-angular-rte 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { isDevMode, inject, Injectable, input, computed, ChangeDetectionStrategy, Component, signal, ElementRef, DestroyRef, output, Injector, InjectionToken, effect, untracked, forwardRef, ViewChild, Directive, model, afterNextRender, Renderer2, viewChild, afterRenderEffect, ApplicationRef, EnvironmentInjector, createComponent, HostListener, ViewContainerRef, TemplateRef, PLATFORM_ID, NgZone, ViewChildren, contentChild, Pipe } from '@angular/core';
2
+ import { isDevMode, inject, Injectable, input, computed, ChangeDetectionStrategy, Component, signal, ElementRef, DestroyRef, output, Injector, InjectionToken, effect, untracked, forwardRef, ViewChild, Directive, model, afterNextRender, afterRenderEffect, Renderer2, viewChild, contentChild, ApplicationRef, EnvironmentInjector, createComponent, HostListener, ViewContainerRef, TemplateRef, PLATFORM_ID, NgZone, ViewChildren, Pipe } from '@angular/core';
3
3
  import * as i1 from '@angular/forms';
4
4
  import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
5
5
  import { DOCUMENT, NgComponentOutlet, NgTemplateOutlet, isPlatformBrowser, DatePipe } from '@angular/common';
@@ -682,8 +682,11 @@ function graphemeLength(text) {
682
682
  const segmenter = graphemeSegmenter();
683
683
  if (!segmenter)
684
684
  return text.length;
685
+ // Walk the iterator rather than Array.from: this runs on every keystroke of a length-limited field, and
686
+ // materialising a Segment object per grapheme costs memory and about a third more time on a long string.
687
+ const segments = segmenter.segment(text)[Symbol.iterator]();
685
688
  let count = 0;
686
- for (const _ of segmenter.segment(text))
689
+ while (!segments.next().done)
687
690
  count++;
688
691
  return count;
689
692
  }
@@ -1963,7 +1966,7 @@ function stripCssComments(value) {
1963
1966
  function decodeCssEscapes(value) {
1964
1967
  if (!value.includes('\\'))
1965
1968
  return value;
1966
- return value.replaceAll(/\\([0-9a-fA-F]{1,6})[ \t\n]?|\\(.)/g, (_match, hex, literal) => {
1969
+ return value.replaceAll(/\\([0-9a-fA-F]{1,6})[ \t\n]?|\\(.)/g, (...[, hex, literal]) => {
1967
1970
  if (hex !== undefined) {
1968
1971
  const code = Number.parseInt(hex, 16);
1969
1972
  return code > 0 && code <= 0x10FFFF ? String.fromCodePoint(code) : '';
@@ -3545,7 +3548,7 @@ class RichTextSanitizerService {
3545
3548
  * don't require HTML entity encoding inside double-quoted attributes.
3546
3549
  */
3547
3550
  normalizeStyleQuotes(html) {
3548
- return html.replaceAll(/style="([^"]*)"/g, (_match, styleContent) => `style="${styleContent.replaceAll('&quot;', "'")}"`);
3551
+ return html.replaceAll(/style="([^"]*)"/g, (...[, styleContent]) => `style="${styleContent.replaceAll('&quot;', "'")}"`);
3549
3552
  }
3550
3553
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: RichTextSanitizerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3551
3554
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: RichTextSanitizerService, providedIn: 'root' }); }
@@ -5500,7 +5503,7 @@ class RichTextMarkdownService {
5500
5503
  // fence before blockquote and list parsing baked those markers INTO the
5501
5504
  // code, and each round-trip added another level -- the same compounding
5502
5505
  // corruption the lift was introduced to stop, reintroduced for nesting.
5503
- return markdown.replaceAll(CODE_FENCE_OPEN, '').replaceAll(CODE_FENCE_CLOSE, '').replaceAll(FENCE_PATTERN, (_match, prefix, _fence, lang, code) => {
5506
+ return markdown.replaceAll(CODE_FENCE_OPEN, '').replaceAll(CODE_FENCE_CLOSE, '').replaceAll(FENCE_PATTERN, (...[, prefix, , lang, code]) => {
5504
5507
  const langAttr = lang ? ` data-language="${lang}" class="language-${lang}"` : '';
5505
5508
  const token = `${prefix}${CODE_FENCE_OPEN}${store.length}${CODE_FENCE_CLOSE}`;
5506
5509
  const body = stripBlockPrefix(code, prefix);
@@ -7412,7 +7415,7 @@ function trackRowspans(cells, carried) {
7412
7415
  * "&lt;code&gt;x&lt;/code&gt;".
7413
7416
  */
7414
7417
  function resolveInlineCodeText(value, store) {
7415
- return value.replaceAll(/(\d{1,9})/g, (_match, index) => {
7418
+ return value.replaceAll(/(\d{1,9})/g, (...[, index]) => {
7416
7419
  const parked = store[Number(index)] ?? '';
7417
7420
  return parked.replace(/^<code>/, '').replace(/<\/code>$/, '');
7418
7421
  });
@@ -7427,7 +7430,7 @@ function restoreParked(html, open, close, store, map = (s) => s) {
7427
7430
  if (store.length === 0)
7428
7431
  return html;
7429
7432
  const pattern = new RegExp(String.raw `${open}(\d{1,9})${close}`, 'g');
7430
- return html.replaceAll(pattern, (_match, index) => map(store[Number(index)] ?? ''));
7433
+ return html.replaceAll(pattern, (...[, index]) => map(store[Number(index)] ?? ''));
7431
7434
  }
7432
7435
 
7433
7436
  /** Word's namespaced wrapper elements, unwrapped so the text they hold stays. */
@@ -7889,7 +7892,7 @@ class RichTextPasteNormalizerService {
7889
7892
  const mapped = new Map();
7890
7893
  for (const [prop, value] of styles) {
7891
7894
  if (prop.startsWith('mso-')) {
7892
- this.mapMsoProperty(prop, value, mapped, el);
7895
+ this.mapMsoProperty(prop, value, mapped);
7893
7896
  }
7894
7897
  else if (!prop.startsWith('-')) {
7895
7898
  this.mapStandardProperty(prop, value, mapped);
@@ -7966,7 +7969,7 @@ class RichTextPasteNormalizerService {
7966
7969
  break;
7967
7970
  }
7968
7971
  }
7969
- mapMsoProperty(prop, value, mapped, _el) {
7972
+ mapMsoProperty(prop, value, mapped) {
7970
7973
  if (!value)
7971
7974
  return;
7972
7975
  this.mapMsoFontProperty(prop, value, mapped);
@@ -11181,7 +11184,7 @@ function markdownToText(value) {
11181
11184
  const fences = [];
11182
11185
  let text = value
11183
11186
  .replaceAll(/[\ue000\ue001]/g, '')
11184
- .replace(FENCE, (_match, body) => {
11187
+ .replace(FENCE, (...[, body]) => {
11185
11188
  fences.push(body);
11186
11189
  return `\ue000${fences.length - 1}\ue001`;
11187
11190
  });
@@ -11191,7 +11194,7 @@ function markdownToText(value) {
11191
11194
  for (const [pattern, replacement] of ENTITIES) {
11192
11195
  text = text.replace(pattern, replacement);
11193
11196
  }
11194
- return text.replace(FENCE_TOKEN, (_match, index) => fences[Number(index)] ?? '');
11197
+ return text.replace(FENCE_TOKEN, (...[, index]) => fences[Number(index)] ?? '');
11195
11198
  }
11196
11199
  /**
11197
11200
  * Collapse whitespace artefacts both paths can leave behind.
@@ -11589,7 +11592,7 @@ function formatRelativeTime(value, unit, locale, options) {
11589
11592
  */
11590
11593
  function localeDigits(locale) {
11591
11594
  const formatter = new Intl.NumberFormat(locale, { useGrouping: false });
11592
- return Array.from({ length: 10 }, (_, digit) => formatter.format(digit));
11595
+ return Array.from({ length: 10 }, (...[, digit]) => formatter.format(digit));
11593
11596
  }
11594
11597
  /**
11595
11598
  * Rewrite a locale's digits as ASCII so the result can be parsed as a number.
@@ -19311,15 +19314,6 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
19311
19314
  .replaceAll(/<\/(p|div|li|h[1-6]|blockquote|pre|tr)>/gi, '\n');
19312
19315
  return this.sanitizer.stripTags(blockAware);
19313
19316
  }
19314
- isSelectionInsideEditor() {
19315
- const selection = this.document.getSelection();
19316
- const editor = this.getEditorElement();
19317
- if (!selection || selection.rangeCount === 0 || !editor) {
19318
- return false;
19319
- }
19320
- const range = selection.getRangeAt(0);
19321
- return editor.contains(range.startContainer) && editor.contains(range.endContainer);
19322
- }
19323
19317
  computeDelta(prev, current) {
19324
19318
  const prevLines = prev.split('\n');
19325
19319
  const curLines = current.split('\n');
@@ -20744,6 +20738,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
20744
20738
  }], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
20745
20739
 
20746
20740
  class DialogContentComponent {
20741
+ static { this.idSeq = 0; }
20747
20742
  constructor() {
20748
20743
  this.dialog = inject(DIALOG, { optional: true });
20749
20744
  this.el = inject(ElementRef);
@@ -20768,6 +20763,14 @@ class DialogContentComponent {
20768
20763
  this.t = this.i18n.t;
20769
20764
  this.dir = this.i18n.dir;
20770
20765
  this.classes = computed(() => cn('fixed z-50 grid w-full max-w-[calc(100vw-2rem)] sm:max-w-lg border bg-background shadow-lg duration-200 sm:rounded-lg', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
20766
+ /**
20767
+ * `id` of this panel's own title, for `aria-labelledby`; null while it has none. The title is rendered
20768
+ * either from the `title` input or projected as a `<ui-dialog-title>`, so it is found in the DOM after
20769
+ * render and given an id, which covers both modes.
20770
+ */
20771
+ this.titleId = signal(null, ...(ngDevMode ? [{ debugName: "titleId" }] : /* istanbul ignore next */ []));
20772
+ /** `id` of this panel's own description, for `aria-describedby`; null while it has none. */
20773
+ this.descriptionId = signal(null, ...(ngDevMode ? [{ debugName: "descriptionId" }] : /* istanbul ignore next */ []));
20771
20774
  effect(() => {
20772
20775
  if (this.dialog?.open()) {
20773
20776
  this.previousActiveElement = this.document.activeElement;
@@ -20777,6 +20780,30 @@ class DialogContentComponent {
20777
20780
  this.previousActiveElement.focus();
20778
20781
  }
20779
20782
  });
20783
+ afterRenderEffect(() => {
20784
+ // The inputs are read so a title or description set after the dialog opened is picked up too.
20785
+ this.title();
20786
+ this.description();
20787
+ if (!this.dialog?.open())
20788
+ return;
20789
+ const panel = this.el.nativeElement.querySelector('[data-slot="dialog-content"]');
20790
+ this.titleId.set(panel ? this.ownId(panel, 'dialog-title') : null);
20791
+ this.descriptionId.set(panel ? this.ownId(panel, 'dialog-description') : null);
20792
+ });
20793
+ }
20794
+ /**
20795
+ * The id of the `slot` element that belongs to `panel` itself, giving it one if it has none. A dialog
20796
+ * nested inside this one has a title of its own that this panel must never take as its name, so only
20797
+ * elements whose nearest panel is this one count.
20798
+ */
20799
+ ownId(panel, slot) {
20800
+ // Array.from, not a spread: a consumer's `lib` may omit dom.iterable (Storybook's does), and a
20801
+ // NodeList is only iterable with it.
20802
+ const own = Array.from(panel.querySelectorAll(`[data-slot="${slot}"]`)).find(el => el.closest('[data-slot="dialog-content"]') === panel);
20803
+ if (!own)
20804
+ return null;
20805
+ own.id ||= `${slot}-${++DialogContentComponent.idSeq}`;
20806
+ return own.id;
20780
20807
  }
20781
20808
  ngAfterViewInit() {
20782
20809
  if (this.dialog?.open()) {
@@ -20816,7 +20843,7 @@ class DialogContentComponent {
20816
20843
  trapTabKey(event, this.contentEl);
20817
20844
  }
20818
20845
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DialogContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
20819
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DialogContentComponent, isStandalone: true, selector: "ui-dialog-content", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "@if (dialog?.open()) {\n <div class=\"fixed inset-0 z-50 flex items-center justify-center\" [attr.dir]=\"dir()\">\n <!-- Overlay -->\n <button\n type=\"button\"\n class=\"fixed inset-0 bg-black/80 animate-in fade-in-0\"\n [attr.data-slot]=\"'dialog-overlay'\"\n [attr.aria-label]=\"t().close\"\n (click)=\"onOverlayClick()\"\n ></button>\n <!-- Content -->\n <div\n #contentEl\n [class]=\"classes()\"\n [attr.data-slot]=\"'dialog-content'\"\n (keydown)=\"onKeydown($event)\"\n tabindex=\"-1\"\n >\n @if (title()) {\n <ui-dialog-header>\n <ui-dialog-title>{{ title() }}</ui-dialog-title>\n @if (description()) {\n <ui-dialog-description>{{ description() }}</ui-dialog-description>\n }\n </ui-dialog-header>\n }\n <ng-content />\n <!-- Close button -->\n <button\n type=\"button\"\n class=\"absolute end-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none pointer-coarse:end-0.5 pointer-coarse:top-0.5 pointer-coarse:size-11\"\n [attr.aria-label]=\"t().close\"\n (click)=\"close()\"\n >\n <svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n <span class=\"sr-only\">{{ t().close }}</span>\n </button>\n </div>\n </div>\n}\n", styles: [":host{--_d: var(--density-dialog, var(--density, 1))}@layer components{[data-slot=dialog-content]{gap:calc(.75rem * var(--_d));padding:calc(1rem * var(--_d))}@media(min-width:640px){[data-slot=dialog-content]{gap:calc(1rem * var(--_d));padding:calc(1.5rem * var(--_d))}}}\n"], dependencies: [{ kind: "component", type: DialogHeaderComponent, selector: "ui-dialog-header", inputs: ["class"] }, { kind: "component", type: DialogTitleComponent, selector: "ui-dialog-title", inputs: ["class"] }, { kind: "component", type: DialogDescriptionComponent, selector: "ui-dialog-description", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
20846
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DialogContentComponent, isStandalone: true, selector: "ui-dialog-content", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "@if (dialog?.open()) {\n <div class=\"fixed inset-0 z-50 flex items-center justify-center\" [attr.dir]=\"dir()\">\n <!-- Overlay -->\n <button\n type=\"button\"\n class=\"fixed inset-0 bg-black/80 animate-in fade-in-0\"\n [attr.data-slot]=\"'dialog-overlay'\"\n [attr.aria-label]=\"t().close\"\n (click)=\"onOverlayClick()\"\n ></button>\n <!-- Content -->\n <div\n #contentEl\n [class]=\"classes()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"titleId()\"\n [attr.aria-describedby]=\"descriptionId()\"\n [attr.data-slot]=\"'dialog-content'\"\n (keydown)=\"onKeydown($event)\"\n tabindex=\"-1\"\n >\n @if (title()) {\n <ui-dialog-header>\n <ui-dialog-title>{{ title() }}</ui-dialog-title>\n @if (description()) {\n <ui-dialog-description>{{ description() }}</ui-dialog-description>\n }\n </ui-dialog-header>\n }\n <ng-content />\n <!-- Close button -->\n <button\n type=\"button\"\n class=\"absolute end-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none pointer-coarse:end-0.5 pointer-coarse:top-0.5 pointer-coarse:size-11\"\n [attr.aria-label]=\"t().close\"\n (click)=\"close()\"\n >\n <svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n <span class=\"sr-only\">{{ t().close }}</span>\n </button>\n </div>\n </div>\n}\n", styles: [":host{--_d: var(--density-dialog, var(--density, 1))}@layer components{[data-slot=dialog-content]{gap:calc(.75rem * var(--_d));padding:calc(1rem * var(--_d))}@media(min-width:640px){[data-slot=dialog-content]{gap:calc(1rem * var(--_d));padding:calc(1.5rem * var(--_d))}}}\n"], dependencies: [{ kind: "component", type: DialogHeaderComponent, selector: "ui-dialog-header", inputs: ["class"] }, { kind: "component", type: DialogTitleComponent, selector: "ui-dialog-title", inputs: ["class"] }, { kind: "component", type: DialogDescriptionComponent, selector: "ui-dialog-description", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
20820
20847
  }
20821
20848
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DialogContentComponent, decorators: [{
20822
20849
  type: Component,
@@ -20824,7 +20851,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
20824
20851
  DialogHeaderComponent,
20825
20852
  DialogTitleComponent,
20826
20853
  DialogDescriptionComponent,
20827
- ], host: { class: 'contents' }, template: "@if (dialog?.open()) {\n <div class=\"fixed inset-0 z-50 flex items-center justify-center\" [attr.dir]=\"dir()\">\n <!-- Overlay -->\n <button\n type=\"button\"\n class=\"fixed inset-0 bg-black/80 animate-in fade-in-0\"\n [attr.data-slot]=\"'dialog-overlay'\"\n [attr.aria-label]=\"t().close\"\n (click)=\"onOverlayClick()\"\n ></button>\n <!-- Content -->\n <div\n #contentEl\n [class]=\"classes()\"\n [attr.data-slot]=\"'dialog-content'\"\n (keydown)=\"onKeydown($event)\"\n tabindex=\"-1\"\n >\n @if (title()) {\n <ui-dialog-header>\n <ui-dialog-title>{{ title() }}</ui-dialog-title>\n @if (description()) {\n <ui-dialog-description>{{ description() }}</ui-dialog-description>\n }\n </ui-dialog-header>\n }\n <ng-content />\n <!-- Close button -->\n <button\n type=\"button\"\n class=\"absolute end-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none pointer-coarse:end-0.5 pointer-coarse:top-0.5 pointer-coarse:size-11\"\n [attr.aria-label]=\"t().close\"\n (click)=\"close()\"\n >\n <svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n <span class=\"sr-only\">{{ t().close }}</span>\n </button>\n </div>\n </div>\n}\n", styles: [":host{--_d: var(--density-dialog, var(--density, 1))}@layer components{[data-slot=dialog-content]{gap:calc(.75rem * var(--_d));padding:calc(1rem * var(--_d))}@media(min-width:640px){[data-slot=dialog-content]{gap:calc(1rem * var(--_d));padding:calc(1.5rem * var(--_d))}}}\n"] }]
20854
+ ], host: { class: 'contents' }, template: "@if (dialog?.open()) {\n <div class=\"fixed inset-0 z-50 flex items-center justify-center\" [attr.dir]=\"dir()\">\n <!-- Overlay -->\n <button\n type=\"button\"\n class=\"fixed inset-0 bg-black/80 animate-in fade-in-0\"\n [attr.data-slot]=\"'dialog-overlay'\"\n [attr.aria-label]=\"t().close\"\n (click)=\"onOverlayClick()\"\n ></button>\n <!-- Content -->\n <div\n #contentEl\n [class]=\"classes()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"titleId()\"\n [attr.aria-describedby]=\"descriptionId()\"\n [attr.data-slot]=\"'dialog-content'\"\n (keydown)=\"onKeydown($event)\"\n tabindex=\"-1\"\n >\n @if (title()) {\n <ui-dialog-header>\n <ui-dialog-title>{{ title() }}</ui-dialog-title>\n @if (description()) {\n <ui-dialog-description>{{ description() }}</ui-dialog-description>\n }\n </ui-dialog-header>\n }\n <ng-content />\n <!-- Close button -->\n <button\n type=\"button\"\n class=\"absolute end-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none pointer-coarse:end-0.5 pointer-coarse:top-0.5 pointer-coarse:size-11\"\n [attr.aria-label]=\"t().close\"\n (click)=\"close()\"\n >\n <svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n <span class=\"sr-only\">{{ t().close }}</span>\n </button>\n </div>\n </div>\n}\n", styles: [":host{--_d: var(--density-dialog, var(--density, 1))}@layer components{[data-slot=dialog-content]{gap:calc(.75rem * var(--_d));padding:calc(1rem * var(--_d))}@media(min-width:640px){[data-slot=dialog-content]{gap:calc(1rem * var(--_d));padding:calc(1.5rem * var(--_d))}}}\n"] }]
20828
20855
  }], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }] } });
20829
20856
 
20830
20857
  class DialogFooterComponent {
@@ -21578,6 +21605,13 @@ class AlertDialogContentComponent {
21578
21605
  /** The cancel button was pressed. Same simple-mode-only rules as {@link actionClick}. */
21579
21606
  this.cancelClick = output();
21580
21607
  this.classes = computed(() => cn('fixed z-50 grid w-full max-w-[calc(100vw-2rem)] sm:max-w-lg gap-3 sm:gap-4 border bg-background p-4 sm:p-6 shadow-lg duration-200 sm:rounded-lg', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
21608
+ /**
21609
+ * The two places a title can come from: the one this component renders for the `title` input, and one the
21610
+ * author projects. Read by the naming effect so it runs again when either appears, which a title rendered
21611
+ * after the dialog opened (behind an `@if`, say) otherwise never triggers.
21612
+ */
21613
+ this.ownTitle = viewChild(AlertDialogTitleComponent, ...(ngDevMode ? [{ debugName: "ownTitle" }] : /* istanbul ignore next */ []));
21614
+ this.projectedTitle = contentChild(AlertDialogTitleComponent, ...(ngDevMode ? [{ debugName: "projectedTitle" }] : /* istanbul ignore next */ []));
21581
21615
  effect(() => {
21582
21616
  if (this.alertDialog?.open()) {
21583
21617
  this.previousActiveElement = this.document.activeElement;
@@ -21590,6 +21624,8 @@ class AlertDialogContentComponent {
21590
21624
  afterRenderEffect(() => {
21591
21625
  if (!this.alertDialog?.open())
21592
21626
  return;
21627
+ this.ownTitle();
21628
+ this.projectedTitle();
21593
21629
  const host = this.el.nativeElement;
21594
21630
  const titleEl = host.querySelector('[data-slot="alert-dialog-title"]');
21595
21631
  if (!titleEl)
@@ -21622,7 +21658,7 @@ class AlertDialogContentComponent {
21622
21658
  trapTabKey(event, this.contentEl);
21623
21659
  }
21624
21660
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: AlertDialogContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
21625
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: AlertDialogContentComponent, isStandalone: true, selector: "ui-alert-dialog-content", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, actionText: { classPropertyName: "actionText", publicName: "actionText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionClick: "actionClick", cancelClick: "cancelClick" }, host: { classAttribute: "contents" }, ngImport: i0, template: `
21661
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: AlertDialogContentComponent, isStandalone: true, selector: "ui-alert-dialog-content", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, actionText: { classPropertyName: "actionText", publicName: "actionText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionClick: "actionClick", cancelClick: "cancelClick" }, host: { classAttribute: "contents" }, queries: [{ propertyName: "projectedTitle", first: true, predicate: AlertDialogTitleComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "ownTitle", first: true, predicate: AlertDialogTitleComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
21626
21662
  @if (alertDialog?.open()) {
21627
21663
  <div
21628
21664
  class="fixed inset-0 z-50 flex items-center justify-center"
@@ -21714,7 +21750,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
21714
21750
  `,
21715
21751
  host: { class: 'contents' },
21716
21752
  }]
21717
- }], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], actionText: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionText", required: false }] }], cancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelText", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], actionClick: [{ type: i0.Output, args: ["actionClick"] }], cancelClick: [{ type: i0.Output, args: ["cancelClick"] }] } });
21753
+ }], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], actionText: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionText", required: false }] }], cancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelText", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], actionClick: [{ type: i0.Output, args: ["actionClick"] }], cancelClick: [{ type: i0.Output, args: ["cancelClick"] }], ownTitle: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AlertDialogTitleComponent), { isSignal: true }] }], projectedTitle: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AlertDialogTitleComponent), { isSignal: true }] }] } });
21718
21754
 
21719
21755
  class ConfirmDialogComponent {
21720
21756
  /**
@@ -27997,7 +28033,7 @@ class TabsListComponent {
27997
28033
  this.skeleton = input(false, ...(ngDevMode ? [{ debugName: "skeleton" }] : /* istanbul ignore next */ []));
27998
28034
  /** How many placeholder bars {@link skeleton} renders — set it to the tab count you expect so the bar doesn't resize on load. Ignored unless `skeleton` is `true`. */
27999
28035
  this.skeletonCount = input(3, ...(ngDevMode ? [{ debugName: "skeletonCount" }] : /* istanbul ignore next */ []));
28000
- this.skeletonItems = computed(() => Array.from({ length: this.skeletonCount() }, (_, i) => i), ...(ngDevMode ? [{ debugName: "skeletonItems" }] : /* istanbul ignore next */ []));
28036
+ this.skeletonItems = computed(() => Array.from({ length: this.skeletonCount() }, (...[, i]) => i), ...(ngDevMode ? [{ debugName: "skeletonItems" }] : /* istanbul ignore next */ []));
28001
28037
  this.skeletonClasses = computed(() => cn(this.classes(), 'gap-1'), ...(ngDevMode ? [{ debugName: "skeletonClasses" }] : /* istanbul ignore next */ []));
28002
28038
  this.classes = computed(() => cn('inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
28003
28039
  }
@@ -29217,6 +29253,14 @@ class ColorPickerComponent {
29217
29253
  this.commitHsv();
29218
29254
  this.onTouched();
29219
29255
  }
29256
+ ngOnDestroy() {
29257
+ // A drag still going when the picker is destroyed would keep listening on the window (and
29258
+ // calling into a destroyed picker) until the next pointer-up; the copy badge timer likewise.
29259
+ this.dragCleanup?.();
29260
+ this.dragCleanup = null;
29261
+ if (this.copyTimer)
29262
+ clearTimeout(this.copyTimer);
29263
+ }
29220
29264
  startAreaDrag(clientX, clientY) {
29221
29265
  this.isDragging = true;
29222
29266
  this.updateFromAreaPosition(clientX, clientY);
@@ -33369,7 +33413,7 @@ class RichTextFileImportDirective {
33369
33413
  async importDocx(file) {
33370
33414
  this.assertImportableSize(file);
33371
33415
  const bytes = new Uint8Array(await file.arrayBuffer());
33372
- const { parseDocx } = await import('./gilav21-shadcn-angular-rte-docx-parser-CAPT-WC9.mjs');
33416
+ const { parseDocx } = await import('./gilav21-shadcn-angular-rte-docx-parser-D_wFX3FP.mjs');
33373
33417
  const { renderDocxForEditor } = await import('./gilav21-shadcn-angular-rte-docx-to-editor-html-BreagmS_.mjs');
33374
33418
  const html = renderDocxForEditor(parseDocx(bytes));
33375
33419
  this.insertImported(html);
@@ -33377,7 +33421,7 @@ class RichTextFileImportDirective {
33377
33421
  async importPdf(file) {
33378
33422
  this.assertImportableSize(file);
33379
33423
  const buffer = await file.arrayBuffer();
33380
- const { parsePdfReadable } = await import('./gilav21-shadcn-angular-rte-pdf-readable-JvCpuNQH.mjs');
33424
+ const { parsePdfReadable } = await import('./gilav21-shadcn-angular-rte-pdf-readable-BKYRkHec.mjs');
33381
33425
  const result = await parsePdfReadable(buffer);
33382
33426
  if (result.html.trim() && result.fontFaceCss)
33383
33427
  this.injectFontCss(result.fontFaceCss);
@@ -36224,7 +36268,7 @@ function resolveEntityTemplate(template, context) {
36224
36268
  query: context.query, type: context.type, userId: context.userId, tagId: context.tagId,
36225
36269
  };
36226
36270
  return template
36227
- .replaceAll(/@@([a-zA-Z0-9_-]+)@@/g, (_m, token) => values[token] ?? '')
36271
+ .replaceAll(/@@([a-zA-Z0-9_-]+)@@/g, (...[, token]) => values[token] ?? '')
36228
36272
  .replaceAll(/:([a-zA-Z][a-zA-Z0-9_-]*)/g, (match, token) => values[token] ?? match);
36229
36273
  }
36230
36274
  function resolveEntityText(context, options) {
@@ -36366,7 +36410,6 @@ class RichTextMentionsDirective {
36366
36410
  this.sanitizer = inject(RichTextSanitizerService);
36367
36411
  this.injector = inject(Injector);
36368
36412
  this.vcr = inject(ViewContainerRef);
36369
- this.document = inject(DOCUMENT);
36370
36413
  /** Locale for the popover UI: a registry key (`'en'`/`'he'`/…) or a full dictionary. */
36371
36414
  this.uiRteMentionsLocale = input(...(ngDevMode ? [undefined, { debugName: "uiRteMentionsLocale" }] : /* istanbul ignore next */ []));
36372
36415
  /** Enable the `@mention` trigger (the bare `uiRteMentions` attribute). */
@@ -40239,7 +40282,7 @@ const DEFAULT_FONT_FAMILIES = [
40239
40282
  'Impact',
40240
40283
  ];
40241
40284
  /** Font sizes (px) offered by the font-size dropdown: 8px…72px in 2px steps. */
40242
- const FONT_SIZE_STEPS = Array.from({ length: 33 }, (_, i) => 8 + i * 2);
40285
+ const FONT_SIZE_STEPS = Array.from({ length: 33 }, (...[, i]) => 8 + i * 2);
40243
40286
  /**
40244
40287
  * Opt-in typography addon for `<ui-rich-text-editor>`. Attaches via DI to the
40245
40288
  * `RichTextEditorAddonHost` the base provides and contributes two toolbar
@@ -40409,4 +40452,4 @@ const RTE_FULL = [
40409
40452
  */
40410
40453
 
40411
40454
  export { RichTextAllowHost as $, ACTION_ATTRS as A, RICH_TEXT_LOCALES as B, RICH_TEXT_MENTIONS_LOCALES as C, DEFAULT_COLOR_PALETTE as D, EMPTINESS_FIXTURES as E, FIND_MAX_PAINTED_RECTS as F, RICH_TEXT_OUTLINE_CONTEXT as G, HEADER_BYTES as H, IMAGE_IMPORT_ACCEPT as I, RICH_TEXT_OUTLINE_LOCALES as J, RICH_TEXT_PROSE_CLASSES as K, RICH_TEXT_SHORTCUT_DEFINITIONS as L, MAX_NESTING_DEPTH as M, RICH_TEXT_SLASH_COMMANDS_LOCALES as N, RICH_TEXT_TABLES_BUTTON_CONTEXT as O, PDF_MIME as P, RICH_TEXT_TABLES_LOCALES as Q, RICH_TEXT_ACTIONS_SANITIZER_RULES as R, RICH_TEXT_TYPOGRAPHY_BUTTON_CONTEXT as S, RICH_TEXT_TYPOGRAPHY_LOCALES as T, RTE_FULL as U, RichTextActionsBindDirective as V, RichTextActionsDirective as W, RichTextAiChipComponent as X, RichTextAiDirective as Y, RichTextAiPanelComponent as Z, RichTextAllowDirective as _, ACTION_PARAMS as a, flattenIntoRowText as a$, RichTextColorsButtonComponent as a0, RichTextColorsDirective as a1, RichTextCommandRegistry as a2, RichTextEditorAddonHost as a3, RichTextEditorComponent as a4, RichTextEmojiButtonComponent as a5, RichTextEmojiDirective as a6, RichTextFileImportButtonComponent as a7, RichTextFileImportDirective as a8, RichTextFileImportOverlayComponent as a9, TRANSPARENT_PIXEL as aA, addonSetting as aB, anchorOverlay as aC, applyImageAlignment as aD, applyStarterStyle as aE, assertFlatParams as aF, bindRichTextActions as aG, blockquoteDepthOf as aH, buildDefaultSlashCommands as aI, buildEntityInsertNode as aJ, buildEntityRenderContext as aK, buildFindIndex as aL, buildLineIndex as aM, caretPosition as aN, childList as aO, classifyImport as aP, compileFindRegex as aQ, computeSeedStyleString as aR, containsCssUrl as aS, createImageElement as aT, cssFunctionCalls as aU, dataUrlToFile as aV, decodeCssEscapes as aW, detectTrigger as aX, directionOf as aY, dragHasSupportedDocument as aZ, extractCssUrls as a_, RichTextHistoryDirective as aa, RichTextHistoryPanelComponent as ab, RichTextImageResizerComponent as ac, RichTextImagesButtonComponent as ad, RichTextImagesDirective as ae, RichTextImagesOverlayComponent as af, RichTextLinksButtonComponent as ag, RichTextLinksDirective as ah, RichTextLinksFormComponent as ai, RichTextMarkdownService as aj, RichTextMentionPopoverComponent as ak, RichTextMentionsDirective as al, RichTextOutlineDirective as am, RichTextOutlinePanelComponent as an, RichTextPasteNormalizerService as ao, RichTextSanitizerService as ap, RichTextSlashCommandsDirective as aq, RichTextSlashCommandsMenuComponent as ar, RichTextTablesButtonComponent as as, RichTextTablesDirective as at, RichTextToolbarComponent as au, RichTextToolbarViewContext as av, RichTextTypographyButtonComponent as aw, RichTextTypographyDirective as ax, TEXT_STYLE_OPTIONS as ay, TOOLBAR_BUTTONS as az, AddonSlotRegistry as b, validateActionParams as b$, hasUnsafeCssFunction as b0, holdsNothing as b1, hostOf as b2, hoverCardAction as b3, hoverCardHandlers as b4, inlineElementsHoldingBlocks as b5, isCombinedOnElement as b6, isHostAllowed as b7, isHostBearingUrl as b8, isLineOwner as b9, offsetToPosition as bA, openDialogAction as bB, openDialogHandlers as bC, parseImageSize as bD, placeCaretIn as bE, placeImageAtSelection as bF, positionAfterLine as bG, rangeShowsNothing as bH, readActions as bI, readFileAsDataUrl as bJ, remoteHostOf as bK, removeAction as bL, reportResourceDecisions as bM, resolveFromPage as bN, richTextHasMedia as bO, richTextMaxLength as bP, richTextMinWords as bQ, richTextRequired as bR, richTextVisibleText as bS, rowRunsOf as bT, selectTriggerRange as bU, separateListKinds as bV, simpleHash as bW, stripCssComments as bX, stripStyleIfMatches as bY, structureAround as bZ, validateActionId as b_, isNestedList as ba, isPdfHeader as bb, isPhrasing as bc, isRichTextEmpty as bd, isSupportedDocumentFile as be, isZipHeader as bf, labelBlockedImages as bg, lastOwnInlineNode as bh, lineAbove as bi, lineBelow as bj, lineIsEmpty as bk, lineIsTextOnly as bl, lineKeepsItsElement as bm, lineOf as bn, lineOwnNodes as bo, lineTagIsFixed as bp, lineText as bq, linesBetween as br, linesMayJoin as bs, linkedPreviewDialogAction as bt, linkedPreviewDialogHandlers as bu, matchBlockInputRule as bv, matchInlineInputRule as bw, mountTopLayer as bx, nodeShowsNothing as by, normalizeHostEntry as bz, DEFAULT_FONT_FAMILIES as c, writeAction as c0, writeCombined as c1, DEFAULT_HIGHLIGHT_PALETTE as d, DEFAULT_LINK_SCHEMES as e, DEFAULT_TOOLBAR_ITEMS as f, DOCUMENT_IMPORT_ACCEPT as g, DOCX_MIME as h, isValidImageMagicBytes as i, FIND_MAX_QUERY_LENGTH as j, INLINE_RULE_LOOKBEHIND as k, PresetDialogComponent as l, PresetHoverCardComponent as m, RICH_TEXT_AI_CONTEXT as n, RICH_TEXT_AI_LOCALES as o, RICH_TEXT_COLORS_LOCALES as p, RICH_TEXT_COLOR_BUTTON_CONTEXT as q, RICH_TEXT_EMOJI_CONTEXT as r, RICH_TEXT_EMOJI_LOCALES as s, RICH_TEXT_FILE_IMPORT_BUTTON_CONTEXT as t, RICH_TEXT_FILE_IMPORT_LOCALES as u, RICH_TEXT_HISTORY_LOCALES as v, RICH_TEXT_IMAGES_BUTTON_CONTEXT as w, RICH_TEXT_IMAGES_LOCALES as x, RICH_TEXT_LINKS_BUTTON_CONTEXT as y, RICH_TEXT_LINKS_LOCALES as z };
40412
- //# sourceMappingURL=gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-CjHrbpSa.mjs.map
40455
+ //# sourceMappingURL=gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-CHDlfOxW.mjs.map