@acorex/components 22.2.0-next.0 → 22.2.0-next.2

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.
Files changed (115) hide show
  1. package/comment/README.md +467 -2
  2. package/fesm2022/acorex-components-action-sheet.mjs +2 -2
  3. package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
  4. package/fesm2022/acorex-components-alert.mjs +2 -2
  5. package/fesm2022/acorex-components-alert.mjs.map +1 -1
  6. package/fesm2022/acorex-components-avatar.mjs +2 -2
  7. package/fesm2022/acorex-components-button.mjs +1 -1
  8. package/fesm2022/acorex-components-button.mjs.map +1 -1
  9. package/fesm2022/acorex-components-calendar.mjs +13 -15
  10. package/fesm2022/acorex-components-calendar.mjs.map +1 -1
  11. package/fesm2022/acorex-components-check-box.mjs +2 -2
  12. package/fesm2022/acorex-components-check-box.mjs.map +1 -1
  13. package/fesm2022/acorex-components-color-box.mjs +2 -2
  14. package/fesm2022/acorex-components-color-box.mjs.map +1 -1
  15. package/fesm2022/acorex-components-combo-box.mjs +44 -2
  16. package/fesm2022/acorex-components-combo-box.mjs.map +1 -1
  17. package/fesm2022/acorex-components-command.mjs +2 -2
  18. package/fesm2022/acorex-components-command.mjs.map +1 -1
  19. package/fesm2022/acorex-components-comment.mjs +905 -69
  20. package/fesm2022/acorex-components-comment.mjs.map +1 -1
  21. package/fesm2022/{acorex-components-conversation-acorex-components-conversation-C1Lf9tAe.mjs → acorex-components-conversation-acorex-components-conversation-pR9sXIuW.mjs} +6 -6
  22. package/fesm2022/{acorex-components-conversation-acorex-components-conversation-C1Lf9tAe.mjs.map → acorex-components-conversation-acorex-components-conversation-pR9sXIuW.mjs.map} +1 -1
  23. package/fesm2022/{acorex-components-conversation-picker-rename-file-dialog.component-DyOC1WEb.mjs → acorex-components-conversation-picker-rename-file-dialog.component-DWIRLLMb.mjs} +2 -2
  24. package/fesm2022/{acorex-components-conversation-picker-rename-file-dialog.component-DyOC1WEb.mjs.map → acorex-components-conversation-picker-rename-file-dialog.component-DWIRLLMb.mjs.map} +1 -1
  25. package/fesm2022/acorex-components-conversation.mjs +1 -1
  26. package/fesm2022/acorex-components-data-list.mjs +1 -1
  27. package/fesm2022/acorex-components-data-list.mjs.map +1 -1
  28. package/fesm2022/acorex-components-data-table.mjs +524 -145
  29. package/fesm2022/acorex-components-data-table.mjs.map +1 -1
  30. package/fesm2022/acorex-components-datetime-box.mjs +2 -2
  31. package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
  32. package/fesm2022/acorex-components-datetime-picker.mjs +2 -2
  33. package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
  34. package/fesm2022/acorex-components-decorators.mjs +2 -2
  35. package/fesm2022/acorex-components-decorators.mjs.map +1 -1
  36. package/fesm2022/acorex-components-drawer.mjs +17 -6
  37. package/fesm2022/acorex-components-drawer.mjs.map +1 -1
  38. package/fesm2022/acorex-components-dropdown-button.mjs +16 -11
  39. package/fesm2022/acorex-components-dropdown-button.mjs.map +1 -1
  40. package/fesm2022/acorex-components-dropdown.mjs +2 -2
  41. package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
  42. package/fesm2022/acorex-components-fab.mjs +1 -1
  43. package/fesm2022/acorex-components-fab.mjs.map +1 -1
  44. package/fesm2022/acorex-components-file-viewer.mjs +6 -2
  45. package/fesm2022/acorex-components-file-viewer.mjs.map +1 -1
  46. package/fesm2022/acorex-components-image-editor.mjs +8 -8
  47. package/fesm2022/acorex-components-image-editor.mjs.map +1 -1
  48. package/fesm2022/acorex-components-kanban.mjs +108 -5
  49. package/fesm2022/acorex-components-kanban.mjs.map +1 -1
  50. package/fesm2022/acorex-components-list.mjs +7 -8
  51. package/fesm2022/acorex-components-list.mjs.map +1 -1
  52. package/fesm2022/acorex-components-loading.mjs +2 -2
  53. package/fesm2022/acorex-components-loading.mjs.map +1 -1
  54. package/fesm2022/acorex-components-lookup.mjs +160 -23
  55. package/fesm2022/acorex-components-lookup.mjs.map +1 -1
  56. package/fesm2022/acorex-components-map.mjs +27 -9
  57. package/fesm2022/acorex-components-map.mjs.map +1 -1
  58. package/fesm2022/acorex-components-media-viewer.mjs +1 -1
  59. package/fesm2022/acorex-components-media-viewer.mjs.map +1 -1
  60. package/fesm2022/acorex-components-menu.mjs +30 -8
  61. package/fesm2022/acorex-components-menu.mjs.map +1 -1
  62. package/fesm2022/acorex-components-paint.mjs +1 -1
  63. package/fesm2022/acorex-components-paint.mjs.map +1 -1
  64. package/fesm2022/acorex-components-password-box.mjs +1 -1
  65. package/fesm2022/acorex-components-password-box.mjs.map +1 -1
  66. package/fesm2022/acorex-components-popover.mjs +14 -1
  67. package/fesm2022/acorex-components-popover.mjs.map +1 -1
  68. package/fesm2022/acorex-components-reaction.mjs +1 -1
  69. package/fesm2022/acorex-components-reaction.mjs.map +1 -1
  70. package/fesm2022/acorex-components-scheduler.mjs +10 -10
  71. package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
  72. package/fesm2022/acorex-components-side-menu.mjs +1 -1
  73. package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
  74. package/fesm2022/acorex-components-sidebar.mjs +2 -2
  75. package/fesm2022/acorex-components-sidebar.mjs.map +1 -1
  76. package/fesm2022/acorex-components-tabs.mjs +4 -2
  77. package/fesm2022/acorex-components-tabs.mjs.map +1 -1
  78. package/fesm2022/acorex-components-tag-box.mjs +2 -2
  79. package/fesm2022/acorex-components-tag-box.mjs.map +1 -1
  80. package/fesm2022/acorex-components-text-editor.mjs +1950 -0
  81. package/fesm2022/acorex-components-text-editor.mjs.map +1 -0
  82. package/fesm2022/acorex-components-time-duration.mjs +59 -19
  83. package/fesm2022/acorex-components-time-duration.mjs.map +1 -1
  84. package/fesm2022/acorex-components-toast.mjs +2 -2
  85. package/fesm2022/acorex-components-toast.mjs.map +1 -1
  86. package/fesm2022/acorex-components-tooltip.mjs +49 -4
  87. package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
  88. package/fesm2022/acorex-components-tree-view.mjs +1 -1
  89. package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
  90. package/fesm2022/acorex-components-wysiwyg.mjs +10 -3
  91. package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
  92. package/package.json +9 -20
  93. package/text-editor/README.md +7 -0
  94. package/types/acorex-components-combo-box.d.ts +5 -0
  95. package/types/acorex-components-comment.d.ts +352 -33
  96. package/types/acorex-components-data-table.d.ts +121 -14
  97. package/types/acorex-components-drawer.d.ts +2 -2
  98. package/types/acorex-components-dropdown-button.d.ts +7 -2
  99. package/types/acorex-components-file-viewer.d.ts +3 -0
  100. package/types/acorex-components-lookup.d.ts +35 -6
  101. package/types/acorex-components-map.d.ts +7 -0
  102. package/types/acorex-components-menu.d.ts +5 -0
  103. package/types/acorex-components-popover.d.ts +5 -1
  104. package/types/acorex-components-text-editor.d.ts +1256 -0
  105. package/types/acorex-components-time-duration.d.ts +17 -3
  106. package/types/acorex-components-tooltip.d.ts +11 -1
  107. package/types/acorex-components-wysiwyg.d.ts +5 -0
  108. package/cron-job/README.md +0 -3
  109. package/editor/README.md +0 -3
  110. package/fesm2022/acorex-components-cron-job.mjs +0 -1309
  111. package/fesm2022/acorex-components-cron-job.mjs.map +0 -1
  112. package/fesm2022/acorex-components-editor.mjs +0 -199
  113. package/fesm2022/acorex-components-editor.mjs.map +0 -1
  114. package/types/acorex-components-cron-job.d.ts +0 -330
  115. package/types/acorex-components-editor.d.ts +0 -79
@@ -0,0 +1,1950 @@
1
+ import { AXComponent, MXInputBaseValueComponent, MXLookComponent, AXFocusableComponent, AXValuableComponent } from '@acorex/cdk/common';
2
+ import { AXButtonComponent, AXButtonItemListComponent, AXButtonItemComponent } from '@acorex/components/button';
3
+ import { AXDecoratorIconComponent, AXDecoratorGenericComponent } from '@acorex/components/decorators';
4
+ import { AXTranslatorPipe, AXTranslationService } from '@acorex/core/translation';
5
+ import { AsyncPipe, isPlatformBrowser } from '@angular/common';
6
+ import * as i0 from '@angular/core';
7
+ import { inject, signal, computed, Injectable, input, ViewEncapsulation, ChangeDetectionStrategy, Component, ElementRef, PLATFORM_ID, afterNextRender, effect, DestroyRef, contentChild, numberAttribute, forwardRef, model, viewChild, NgModule } from '@angular/core';
8
+ import { AXTextEditor, AX_TEXT_EDITOR_ZOOM_MAX, AX_TEXT_EDITOR_ZOOM_MIN, AX_TEXT_EDITOR_DEFAULT_TEXT_COLORS, AX_TEXT_EDITOR_DEFAULT_BACKGROUND_COLORS, AX_TEXT_EDITOR_ZOOM_PRESETS, AX_TEXT_EDITOR_FONT_SIZES } from '@acorex/cdk/text-editor';
9
+ import { isEqual } from 'lodash-es';
10
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
11
+ import * as i1 from '@angular/forms';
12
+ import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
13
+ import { classes } from 'polytype';
14
+ import { AXHorizontalScrollDirective } from '@acorex/cdk/horizontal-scroll';
15
+ import { AXDropdownButtonComponent } from '@acorex/components/dropdown-button';
16
+ import { AXBadgeComponent } from '@acorex/components/badge';
17
+ import { AXColorPaletteComponent, AXColorPalettePickerComponent, AXColorPaletteSwatchesComponent, AXColorPaletteInputComponent } from '@acorex/components/color-palette';
18
+ import { AXToastService } from '@acorex/components/toast';
19
+ import { AXFileService, AXFileTypeRegistryService, AX_IMAGE_FILE_TYPE, AX_VIDEO_FILE_TYPE } from '@acorex/core/file';
20
+
21
+ /**
22
+ * Per-editor facade for `ax-text-editor`. Wraps headless {@link AXTextEditor} from `@acorex/cdk/text-editor`.
23
+ * Projected toolbar tools inject this service for commands, selection preservation, and zoom.
24
+ */
25
+ class AXTextEditorService {
26
+ constructor() {
27
+ this.core = inject(AXTextEditor);
28
+ this.host = null;
29
+ this.preservedRange = null;
30
+ this.editor = this.core.editor;
31
+ this.state = this.core.state;
32
+ this.version = this.core.version;
33
+ this.disabled = signal(false, /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
35
+ this.readonly = signal(false, /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
37
+ this.editable = computed(() => !this.disabled() && !this.readonly(), /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []));
39
+ this.textColor = computed(() => this.core.state().textColor, /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "textColor" }] : /* istanbul ignore next */ []));
41
+ this.highlightColor = computed(() => this.core.state().highlightColor, /* @ts-ignore */
42
+ ...(ngDevMode ? [{ debugName: "highlightColor" }] : /* istanbul ignore next */ []));
43
+ this.fontSize = computed(() => this.core.state().fontSize, /* @ts-ignore */
44
+ ...(ngDevMode ? [{ debugName: "fontSize" }] : /* istanbul ignore next */ []));
45
+ this.zoom = signal(100, /* @ts-ignore */
46
+ ...(ngDevMode ? [{ debugName: "zoom" }] : /* istanbul ignore next */ []));
47
+ this.zoomFactor = computed(() => this.zoom() / 100, /* @ts-ignore */
48
+ ...(ngDevMode ? [{ debugName: "zoomFactor" }] : /* istanbul ignore next */ []));
49
+ }
50
+ bindHost(host) {
51
+ this.host = host;
52
+ this.syncHostState();
53
+ }
54
+ syncHostState() {
55
+ this.disabled.set(Boolean(this.host?.disabled()));
56
+ this.readonly.set(Boolean(this.host?.readonly()));
57
+ this.setEditable(this.editable());
58
+ }
59
+ getHost() {
60
+ return this.host;
61
+ }
62
+ refresh() {
63
+ this.core.refresh();
64
+ }
65
+ chain() {
66
+ return this.core.chain();
67
+ }
68
+ get commands() {
69
+ return this.core.commands;
70
+ }
71
+ get canCommands() {
72
+ return this.core.editor()?.can();
73
+ }
74
+ isActive(command, attrs) {
75
+ return this.core.isActive(command, attrs);
76
+ }
77
+ can(command, attrs) {
78
+ if (!this.editable())
79
+ return false;
80
+ return this.core.can(command, attrs);
81
+ }
82
+ preserveSelection() {
83
+ const editor = this.core.editor();
84
+ if (!editor)
85
+ return;
86
+ const { from, to } = editor.state.selection;
87
+ this.preservedRange = { from, to };
88
+ }
89
+ clearPreservedSelection() {
90
+ this.preservedRange = null;
91
+ }
92
+ run(command, attrs) {
93
+ if (!this.editable())
94
+ return false;
95
+ const editor = this.core.editor();
96
+ if (!editor)
97
+ return false;
98
+ this.restorePreservedSelection(editor);
99
+ return this.core.run(command, attrs);
100
+ }
101
+ restorePreservedSelection(editor) {
102
+ const range = this.preservedRange;
103
+ if (!range)
104
+ return;
105
+ const max = editor.state.doc.content.size;
106
+ const from = Math.max(0, Math.min(range.from, max));
107
+ const to = Math.max(0, Math.min(range.to, max));
108
+ if (editor.state.selection.from === from && editor.state.selection.to === to)
109
+ return;
110
+ editor.commands.setTextSelection({ from, to });
111
+ }
112
+ getJSON() {
113
+ return this.core.getJSON();
114
+ }
115
+ getHTML() {
116
+ return this.core.getHTML();
117
+ }
118
+ getText(options) {
119
+ return this.core.getText(options);
120
+ }
121
+ setContent(content, emitUpdate = false) {
122
+ this.core.setContent(content, emitUpdate);
123
+ return true;
124
+ }
125
+ insertContent(value) {
126
+ return this.core.insertContent(value);
127
+ }
128
+ clearContent() {
129
+ return this.core.clearContent();
130
+ }
131
+ focus() {
132
+ this.core.focus();
133
+ return true;
134
+ }
135
+ blur() {
136
+ this.core.blur();
137
+ return true;
138
+ }
139
+ isEmpty() {
140
+ return this.core.isEmpty();
141
+ }
142
+ isFocused() {
143
+ return this.core.isFocused();
144
+ }
145
+ isEditable() {
146
+ return this.core.isEditable();
147
+ }
148
+ setEditable(editable) {
149
+ this.core.setEditable(editable);
150
+ }
151
+ destroyEditor() {
152
+ this.core.destroy();
153
+ }
154
+ setZoom(value) {
155
+ if (!Number.isFinite(value))
156
+ return;
157
+ this.zoom.set(Math.min(AX_TEXT_EDITOR_ZOOM_MAX, Math.max(AX_TEXT_EDITOR_ZOOM_MIN, Math.round(value))));
158
+ }
159
+ zoomIn(step = 10) {
160
+ this.setZoom(this.zoom() + step);
161
+ }
162
+ zoomOut(step = 10) {
163
+ this.setZoom(this.zoom() - step);
164
+ }
165
+ fitToPage() {
166
+ const editor = this.core.editor();
167
+ if (!editor) {
168
+ this.setZoom(100);
169
+ return;
170
+ }
171
+ const prose = editor.view.dom;
172
+ const viewport = prose.closest('ax-text-editor-content') ?? prose.parentElement;
173
+ if (!viewport) {
174
+ this.setZoom(100);
175
+ return;
176
+ }
177
+ const factor = Math.max(this.zoom() / 100, 0.01);
178
+ const unscaledWidth = prose.scrollWidth / factor;
179
+ const available = viewport.clientWidth;
180
+ if (unscaledWidth <= 0 || available <= 0 || unscaledWidth <= available) {
181
+ this.setZoom(100);
182
+ return;
183
+ }
184
+ this.setZoom(Math.floor((available / unscaledWidth) * 100));
185
+ }
186
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
187
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorService }); }
188
+ }
189
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorService, decorators: [{
190
+ type: Injectable
191
+ }] });
192
+
193
+ /**
194
+ * Marker base for projected editor tools and slots.
195
+ */
196
+ class AXTextEditorSlot {
197
+ }
198
+
199
+ const TOGGLE_COMMANDS = new Set([
200
+ 'bold',
201
+ 'italic',
202
+ 'underline',
203
+ 'strike',
204
+ 'bulletList',
205
+ 'orderedList',
206
+ 'superscript',
207
+ 'subscript',
208
+ 'blockquote',
209
+ 'code',
210
+ 'codeBlock',
211
+ 'direction',
212
+ ]);
213
+ class AXTextEditorCommandComponent extends AXTextEditorSlot {
214
+ constructor() {
215
+ super(...arguments);
216
+ this.editorService = inject(AXTextEditorService);
217
+ this.command = input.required(/* @ts-ignore */
218
+ ...(ngDevMode ? [{ debugName: "command" }] : /* istanbul ignore next */ []));
219
+ this.attrs = input({}, /* @ts-ignore */
220
+ ...(ngDevMode ? [{ debugName: "attrs" }] : /* istanbul ignore next */ []));
221
+ this.icon = input('', /* @ts-ignore */
222
+ ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
223
+ this.label = input('', /* @ts-ignore */
224
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
225
+ this.toggleable = computed(() => TOGGLE_COMMANDS.has(this.command()), /* @ts-ignore */
226
+ ...(ngDevMode ? [{ debugName: "toggleable" }] : /* istanbul ignore next */ []));
227
+ this.active = computed(() => this.editorService.isActive(this.command(), this.attrs()), /* @ts-ignore */
228
+ ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
229
+ this.enabled = computed(() => this.editorService.can(this.command(), this.attrs()), /* @ts-ignore */
230
+ ...(ngDevMode ? [{ debugName: "enabled" }] : /* istanbul ignore next */ []));
231
+ }
232
+ execute() {
233
+ this.editorService.run(this.command(), this.attrs());
234
+ }
235
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorCommandComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
236
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: AXTextEditorCommandComponent, isStandalone: true, selector: "ax-text-editor-command", inputs: { command: { classPropertyName: "command", publicName: "command", isSignal: true, isRequired: true, transformFunction: null }, attrs: { classPropertyName: "attrs", publicName: "attrs", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
237
+ { provide: AXComponent, useExisting: AXTextEditorCommandComponent },
238
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorCommandComponent },
239
+ ], usesInheritance: true, ngImport: i0, template: `
240
+ <ax-button
241
+ class="ax-sm"
242
+ look="blank"
243
+ [iconOnly]="true"
244
+ [text]="label()"
245
+ [toggleable]="toggleable()"
246
+ [selected]="active()"
247
+ [disabled]="!enabled()"
248
+ [attr.title]="label() | translate | async"
249
+ (onClick)="execute()"
250
+ >
251
+ @if (icon()) {
252
+ <ax-icon class="ax-icon {{ icon() }}"></ax-icon>
253
+ }
254
+ </ax-button>
255
+ `, isInline: true, dependencies: [{ kind: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
256
+ }
257
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorCommandComponent, decorators: [{
258
+ type: Component,
259
+ args: [{
260
+ selector: 'ax-text-editor-command',
261
+ template: `
262
+ <ax-button
263
+ class="ax-sm"
264
+ look="blank"
265
+ [iconOnly]="true"
266
+ [text]="label()"
267
+ [toggleable]="toggleable()"
268
+ [selected]="active()"
269
+ [disabled]="!enabled()"
270
+ [attr.title]="label() | translate | async"
271
+ (onClick)="execute()"
272
+ >
273
+ @if (icon()) {
274
+ <ax-icon class="ax-icon {{ icon() }}"></ax-icon>
275
+ }
276
+ </ax-button>
277
+ `,
278
+ changeDetection: ChangeDetectionStrategy.OnPush,
279
+ encapsulation: ViewEncapsulation.None,
280
+ imports: [AXButtonComponent, AXDecoratorIconComponent, AXTranslatorPipe, AsyncPipe],
281
+ providers: [
282
+ { provide: AXComponent, useExisting: AXTextEditorCommandComponent },
283
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorCommandComponent },
284
+ ],
285
+ }]
286
+ }], propDecorators: { command: [{ type: i0.Input, args: [{ isSignal: true, alias: "command", required: true }] }], attrs: [{ type: i0.Input, args: [{ isSignal: true, alias: "attrs", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }] } });
287
+
288
+ class AXTextEditorContentComponent extends AXTextEditorSlot {
289
+ constructor() {
290
+ super();
291
+ this.textEditor = inject(AXTextEditor);
292
+ this.editorService = inject(AXTextEditorService);
293
+ this.elementRef = inject((ElementRef));
294
+ this.platformId = inject(PLATFORM_ID);
295
+ afterNextRender(() => void this.createEditor());
296
+ effect(() => {
297
+ if (!this.editorService.editor())
298
+ return;
299
+ this.editorService.setEditable(this.editorService.editable());
300
+ });
301
+ }
302
+ host() {
303
+ return this.editorService.getHost();
304
+ }
305
+ ngOnDestroy() {
306
+ this.editorService.destroyEditor();
307
+ }
308
+ async createEditor() {
309
+ if (!isPlatformBrowser(this.platformId) || this.textEditor.ready())
310
+ return;
311
+ const host = this.host();
312
+ const element = this.elementRef.nativeElement.querySelector('.ax-text-editor-surface');
313
+ if (!host || !element)
314
+ return;
315
+ await this.textEditor.init(element, {
316
+ content: this.toContent(host.value()),
317
+ editable: this.editorService.editable(),
318
+ placeholder: () => this.host()?.placeHolder() ?? '',
319
+ onUpdate: () => this.emitValue(),
320
+ onSelectionUpdate: () => this.editorService.refresh(),
321
+ onTransaction: () => this.editorService.refresh(),
322
+ onFocus: (_, event) => this.host()?.notifyFocus(event),
323
+ onBlur: (_, event) => this.host()?.notifyBlur(event),
324
+ editorProps: {
325
+ handleDOMEvents: {
326
+ mousedown: () => {
327
+ this.editorService.clearPreservedSelection();
328
+ return false;
329
+ },
330
+ },
331
+ },
332
+ });
333
+ }
334
+ emitValue() {
335
+ const host = this.host();
336
+ const next = this.serialize();
337
+ if (!host || isEqual(next, host.value())) {
338
+ this.editorService.refresh();
339
+ return;
340
+ }
341
+ host.notifyValue(next);
342
+ this.editorService.refresh();
343
+ }
344
+ serialize() {
345
+ const editor = this.textEditor.editor();
346
+ if (!editor || editor.isEmpty)
347
+ return null;
348
+ return this.host()?.outputFormat() === 'html' ? editor.getHTML() : editor.getJSON();
349
+ }
350
+ toContent(value) {
351
+ if (value == null || value === '')
352
+ return '';
353
+ return value;
354
+ }
355
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
356
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorContentComponent, isStandalone: true, selector: "ax-text-editor-content", providers: [
357
+ { provide: AXComponent, useExisting: AXTextEditorContentComponent },
358
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorContentComponent },
359
+ ], usesInheritance: true, ngImport: i0, template: `<div class="ax-text-editor-surface" #surface></div>`, isInline: true, styles: ["@layer properties;@layer components{ax-text-editor-content{position:relative;display:block;width:100%;max-width:100%;min-width:calc(var(--spacing, .25rem) * 0)}.ax-text-editor-surface{width:100%;min-width:calc(var(--spacing, .25rem) * 0)}.ax-text-editor-prose{width:100%;min-width:calc(var(--spacing, .25rem) * 0);padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 2);--tw-outline-style: none;outline-style:none;min-height:var( --ax-comp-text-editor-min-height, calc(var(--ax-comp-text-editor-initial-line, 6) * 1.5em + 1.5rem) );color:var(--ax-comp-text-editor-text-color, var(--ax-sys-color-on-surface, inherit));zoom:var(--ax-comp-text-editor-zoom, 1)}.ax-text-editor-prose a{color:rgba(var(--ax-sys-color-primary-600));text-decoration-line:underline;text-underline-offset:2px;text-decoration-thickness:1px}.ax-text-editor-prose a:hover{color:rgba(var(--ax-sys-color-primary-700));text-decoration-thickness:2px}.ax-text-editor-prose blockquote{margin-block:calc(var(--spacing, .25rem) * 2);padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 1);border-inline-start:3px solid var(--ax-sys-color-primary, #3b82f6);color:var(--ax-comp-text-editor-text-color, currentColor)}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-prose blockquote{color:color-mix(in oklab,var(--ax-comp-text-editor-text-color, currentColor) 72%,transparent)}}.ax-text-editor-prose blockquote p{margin:0}.ax-text-editor-prose pre,.ax-text-editor-prose pre.ax-text-editor-code-block{margin-block:calc(var(--spacing, .25rem) * 2);display:block;width:100%;overflow-x:auto;border-radius:var(--radius-xl, .75rem);padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 3);background-color:var(--ax-comp-text-editor-code-bg-color, rgba(var(--ax-sys-color-surface)));border:0;color:inherit;font-family:inherit;white-space:pre-wrap}.ax-text-editor-prose pre code{display:block;border-radius:0;border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding:calc(var(--spacing, .25rem) * 0);color:inherit;font-family:inherit;font-size:inherit}.ax-text-editor-prose p.is-empty:first-child:before,.ax-text-editor-prose p.is-editor-empty:first-child:before{pointer-events:none;float:left;height:calc(var(--spacing, .25rem) * 0);content:attr(data-placeholder);color:var(--ax-comp-text-editor-placeholder-color, currentColor)}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-prose p.is-empty:first-child:before,.ax-text-editor-prose p.is-editor-empty:first-child:before{color:var(--ax-comp-text-editor-placeholder-color, color-mix(in oklab, currentColor 45%, transparent))}}.ax-text-editor-prose sup{font-size:.75em;line-height:0;position:relative;top:-.4em;vertical-align:baseline}.ax-text-editor-prose sub{font-size:.75em;line-height:0;position:relative;bottom:-.2em;vertical-align:baseline}.ax-text-editor-prose table{width:100%;border-collapse:collapse;border:1px solid var(--ax-comp-text-editor-table-border-color, var(--ax-sys-color-border-lightest, #e5e7eb))}.ax-text-editor-prose th,.ax-text-editor-prose td{position:relative;min-width:calc(var(--spacing, .25rem) * 16);padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:calc(var(--spacing, .25rem) * 1);vertical-align:top;border:1px solid var(--ax-comp-text-editor-table-border-color, var(--ax-sys-color-border-lightest, #e5e7eb))}.ax-text-editor-prose .selectedCell{background:var(--ax-sys-color-primary, #3b82f6)}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-prose .selectedCell{background:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 16%,transparent)}}.ax-text-editor-prose .column-resize-handle{pointer-events:none;position:absolute;inset-inline-end:calc(var(--spacing, .25rem) * -.5);top:calc(var(--spacing, .25rem) * 0);bottom:calc(var(--spacing, .25rem) * 0);width:calc(var(--spacing, .25rem) * 1);background:var(--ax-sys-color-primary, #3b82f6)}.ax-text-editor-prose .tableWrapper{margin-block:calc(var(--spacing, .25rem) * 2);overflow-x:auto}.ax-text-editor-prose img.ax-text-editor-image,.ax-text-editor-prose img{margin-block:calc(var(--spacing, .25rem) * 2);height:auto;max-width:100%;border-radius:var(--ax-sys-border-radius)}.ax-text-editor-prose video.ax-text-editor-video,.ax-text-editor-prose video,.ax-text-editor-prose [data-text-editor-video] iframe,.ax-text-editor-prose [data-wysiwyg-video] iframe{margin-block:calc(var(--spacing, .25rem) * 2);max-width:100%;border-radius:var(--ax-sys-border-radius);width:100%;aspect-ratio:16 / 9}.resize-cursor{cursor:col-resize}}ax-text-editor .ax-text-editor-prose :not(pre)>code,ax-text-editor .ax-text-editor-prose code.ax-text-editor-code{display:inline;border-radius:.5rem;padding:.25rem .625rem;background-color:var(--ax-comp-text-editor-code-bg-color, rgba(var(--ax-sys-color-surface)));border:1px solid var(--ax-comp-text-editor-code-border-color, rgba(var(--ax-sys-color-border-surface)));color:inherit;font-family:inherit;font-size:.875em}ax-text-editor .ax-text-editor-prose pre code{display:block;border:0;border-radius:0;padding:0;background-color:transparent;color:inherit;font-family:inherit;font-size:inherit}ax-text-editor .ax-text-editor-prose ul,ax-text-editor .ax-text-editor-prose ul.ax-text-editor-bullet-list{list-style-type:disc!important;list-style-position:outside;margin-block:.5em;padding-inline-start:1.75rem}ax-text-editor .ax-text-editor-prose ol,ax-text-editor .ax-text-editor-prose ol.ax-text-editor-ordered-list{list-style-type:decimal!important;list-style-position:outside;margin-block:.5em;padding-inline-start:1.75rem}ax-text-editor .ax-text-editor-prose ul ul{list-style-type:circle!important}ax-text-editor .ax-text-editor-prose ol ol{list-style-type:lower-alpha!important}ax-text-editor .ax-text-editor-prose li{display:list-item!important}ax-text-editor .ax-text-editor-prose li p{margin:0}ax-text-editor .ax-text-editor-prose .ax-text-editor-kept-selection{background-color:var(--ax-sys-color-primary, #3b82f6)}@supports (color: color-mix(in lab,red,red)){ax-text-editor .ax-text-editor-prose .ax-text-editor-kept-selection{background-color:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 28%,transparent)}}ax-text-editor .ax-text-editor-prose p{margin-block:.35em;font-size:1em;font-weight:400}ax-text-editor .ax-text-editor-prose h1,ax-text-editor .ax-text-editor-prose h2,ax-text-editor .ax-text-editor-prose h3{margin-block:.6em .35em;letter-spacing:-.02em;color:inherit}ax-text-editor .ax-text-editor-prose h1{font-size:2.5rem!important;font-weight:600!important;line-height:1.2}ax-text-editor .ax-text-editor-prose h2{font-size:2rem!important;font-weight:600!important;line-height:1.25}ax-text-editor .ax-text-editor-prose h3{font-size:1.5rem!important;font-weight:600!important;line-height:1.3}ax-text-editor .ax-text-editor-prose>:first-child{margin-top:0}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
360
+ }
361
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorContentComponent, decorators: [{
362
+ type: Component,
363
+ args: [{ selector: 'ax-text-editor-content', template: `<div class="ax-text-editor-surface" #surface></div>`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
364
+ { provide: AXComponent, useExisting: AXTextEditorContentComponent },
365
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorContentComponent },
366
+ ], styles: ["@layer properties;@layer components{ax-text-editor-content{position:relative;display:block;width:100%;max-width:100%;min-width:calc(var(--spacing, .25rem) * 0)}.ax-text-editor-surface{width:100%;min-width:calc(var(--spacing, .25rem) * 0)}.ax-text-editor-prose{width:100%;min-width:calc(var(--spacing, .25rem) * 0);padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 2);--tw-outline-style: none;outline-style:none;min-height:var( --ax-comp-text-editor-min-height, calc(var(--ax-comp-text-editor-initial-line, 6) * 1.5em + 1.5rem) );color:var(--ax-comp-text-editor-text-color, var(--ax-sys-color-on-surface, inherit));zoom:var(--ax-comp-text-editor-zoom, 1)}.ax-text-editor-prose a{color:rgba(var(--ax-sys-color-primary-600));text-decoration-line:underline;text-underline-offset:2px;text-decoration-thickness:1px}.ax-text-editor-prose a:hover{color:rgba(var(--ax-sys-color-primary-700));text-decoration-thickness:2px}.ax-text-editor-prose blockquote{margin-block:calc(var(--spacing, .25rem) * 2);padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 1);border-inline-start:3px solid var(--ax-sys-color-primary, #3b82f6);color:var(--ax-comp-text-editor-text-color, currentColor)}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-prose blockquote{color:color-mix(in oklab,var(--ax-comp-text-editor-text-color, currentColor) 72%,transparent)}}.ax-text-editor-prose blockquote p{margin:0}.ax-text-editor-prose pre,.ax-text-editor-prose pre.ax-text-editor-code-block{margin-block:calc(var(--spacing, .25rem) * 2);display:block;width:100%;overflow-x:auto;border-radius:var(--radius-xl, .75rem);padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 3);background-color:var(--ax-comp-text-editor-code-bg-color, rgba(var(--ax-sys-color-surface)));border:0;color:inherit;font-family:inherit;white-space:pre-wrap}.ax-text-editor-prose pre code{display:block;border-radius:0;border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding:calc(var(--spacing, .25rem) * 0);color:inherit;font-family:inherit;font-size:inherit}.ax-text-editor-prose p.is-empty:first-child:before,.ax-text-editor-prose p.is-editor-empty:first-child:before{pointer-events:none;float:left;height:calc(var(--spacing, .25rem) * 0);content:attr(data-placeholder);color:var(--ax-comp-text-editor-placeholder-color, currentColor)}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-prose p.is-empty:first-child:before,.ax-text-editor-prose p.is-editor-empty:first-child:before{color:var(--ax-comp-text-editor-placeholder-color, color-mix(in oklab, currentColor 45%, transparent))}}.ax-text-editor-prose sup{font-size:.75em;line-height:0;position:relative;top:-.4em;vertical-align:baseline}.ax-text-editor-prose sub{font-size:.75em;line-height:0;position:relative;bottom:-.2em;vertical-align:baseline}.ax-text-editor-prose table{width:100%;border-collapse:collapse;border:1px solid var(--ax-comp-text-editor-table-border-color, var(--ax-sys-color-border-lightest, #e5e7eb))}.ax-text-editor-prose th,.ax-text-editor-prose td{position:relative;min-width:calc(var(--spacing, .25rem) * 16);padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:calc(var(--spacing, .25rem) * 1);vertical-align:top;border:1px solid var(--ax-comp-text-editor-table-border-color, var(--ax-sys-color-border-lightest, #e5e7eb))}.ax-text-editor-prose .selectedCell{background:var(--ax-sys-color-primary, #3b82f6)}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-prose .selectedCell{background:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 16%,transparent)}}.ax-text-editor-prose .column-resize-handle{pointer-events:none;position:absolute;inset-inline-end:calc(var(--spacing, .25rem) * -.5);top:calc(var(--spacing, .25rem) * 0);bottom:calc(var(--spacing, .25rem) * 0);width:calc(var(--spacing, .25rem) * 1);background:var(--ax-sys-color-primary, #3b82f6)}.ax-text-editor-prose .tableWrapper{margin-block:calc(var(--spacing, .25rem) * 2);overflow-x:auto}.ax-text-editor-prose img.ax-text-editor-image,.ax-text-editor-prose img{margin-block:calc(var(--spacing, .25rem) * 2);height:auto;max-width:100%;border-radius:var(--ax-sys-border-radius)}.ax-text-editor-prose video.ax-text-editor-video,.ax-text-editor-prose video,.ax-text-editor-prose [data-text-editor-video] iframe,.ax-text-editor-prose [data-wysiwyg-video] iframe{margin-block:calc(var(--spacing, .25rem) * 2);max-width:100%;border-radius:var(--ax-sys-border-radius);width:100%;aspect-ratio:16 / 9}.resize-cursor{cursor:col-resize}}ax-text-editor .ax-text-editor-prose :not(pre)>code,ax-text-editor .ax-text-editor-prose code.ax-text-editor-code{display:inline;border-radius:.5rem;padding:.25rem .625rem;background-color:var(--ax-comp-text-editor-code-bg-color, rgba(var(--ax-sys-color-surface)));border:1px solid var(--ax-comp-text-editor-code-border-color, rgba(var(--ax-sys-color-border-surface)));color:inherit;font-family:inherit;font-size:.875em}ax-text-editor .ax-text-editor-prose pre code{display:block;border:0;border-radius:0;padding:0;background-color:transparent;color:inherit;font-family:inherit;font-size:inherit}ax-text-editor .ax-text-editor-prose ul,ax-text-editor .ax-text-editor-prose ul.ax-text-editor-bullet-list{list-style-type:disc!important;list-style-position:outside;margin-block:.5em;padding-inline-start:1.75rem}ax-text-editor .ax-text-editor-prose ol,ax-text-editor .ax-text-editor-prose ol.ax-text-editor-ordered-list{list-style-type:decimal!important;list-style-position:outside;margin-block:.5em;padding-inline-start:1.75rem}ax-text-editor .ax-text-editor-prose ul ul{list-style-type:circle!important}ax-text-editor .ax-text-editor-prose ol ol{list-style-type:lower-alpha!important}ax-text-editor .ax-text-editor-prose li{display:list-item!important}ax-text-editor .ax-text-editor-prose li p{margin:0}ax-text-editor .ax-text-editor-prose .ax-text-editor-kept-selection{background-color:var(--ax-sys-color-primary, #3b82f6)}@supports (color: color-mix(in lab,red,red)){ax-text-editor .ax-text-editor-prose .ax-text-editor-kept-selection{background-color:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 28%,transparent)}}ax-text-editor .ax-text-editor-prose p{margin-block:.35em;font-size:1em;font-weight:400}ax-text-editor .ax-text-editor-prose h1,ax-text-editor .ax-text-editor-prose h2,ax-text-editor .ax-text-editor-prose h3{margin-block:.6em .35em;letter-spacing:-.02em;color:inherit}ax-text-editor .ax-text-editor-prose h1{font-size:2.5rem!important;font-weight:600!important;line-height:1.2}ax-text-editor .ax-text-editor-prose h2{font-size:2rem!important;font-weight:600!important;line-height:1.25}ax-text-editor .ax-text-editor-prose h3{font-size:1.5rem!important;font-weight:600!important;line-height:1.3}ax-text-editor .ax-text-editor-prose>:first-child{margin-top:0}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
367
+ }], ctorParameters: () => [] });
368
+
369
+ const SCOPE = '@acorex:text-editor';
370
+ const AX_TEXT_EDITOR_I18N = {
371
+ placeholder: `${SCOPE}.placeholder`,
372
+ tools: {
373
+ undo: `${SCOPE}.tools.undo`,
374
+ redo: `${SCOPE}.tools.redo`,
375
+ bold: `${SCOPE}.tools.bold`,
376
+ italic: `${SCOPE}.tools.italic`,
377
+ underline: `${SCOPE}.tools.underline`,
378
+ strike: `${SCOPE}.tools.strike`,
379
+ code: `${SCOPE}.tools.code`,
380
+ codeBlock: `${SCOPE}.tools.code-block`,
381
+ link: `${SCOPE}.tools.link`,
382
+ image: `${SCOPE}.tools.image`,
383
+ video: `${SCOPE}.tools.video`,
384
+ bulletList: `${SCOPE}.tools.bullet-list`,
385
+ orderedList: `${SCOPE}.tools.ordered-list`,
386
+ ltr: `${SCOPE}.tools.ltr`,
387
+ rtl: `${SCOPE}.tools.rtl`,
388
+ textColor: `${SCOPE}.tools.text-color`,
389
+ highlight: `${SCOPE}.tools.highlight`,
390
+ colors: `${SCOPE}.tools.colors`,
391
+ paragraph: `${SCOPE}.tools.paragraph`,
392
+ alignLeft: `${SCOPE}.tools.align-left`,
393
+ alignCenter: `${SCOPE}.tools.align-center`,
394
+ alignRight: `${SCOPE}.tools.align-right`,
395
+ alignJustify: `${SCOPE}.tools.align-justify`,
396
+ superscript: `${SCOPE}.tools.superscript`,
397
+ subscript: `${SCOPE}.tools.subscript`,
398
+ blockquote: `${SCOPE}.tools.blockquote`,
399
+ horizontalRule: `${SCOPE}.tools.horizontal-rule`,
400
+ zoomIn: `${SCOPE}.tools.zoom-in`,
401
+ zoomOut: `${SCOPE}.tools.zoom-out`,
402
+ },
403
+ blocks: {
404
+ paragraph: `${SCOPE}.blocks.paragraph`,
405
+ heading1: `${SCOPE}.blocks.heading1`,
406
+ heading2: `${SCOPE}.blocks.heading2`,
407
+ heading3: `${SCOPE}.blocks.heading3`,
408
+ blockquote: `${SCOPE}.blocks.blockquote`,
409
+ codeBlock: `${SCOPE}.blocks.code-block`,
410
+ },
411
+ fontSize: {
412
+ label: `${SCOPE}.font-size.label`,
413
+ default: `${SCOPE}.font-size.default`,
414
+ },
415
+ insert: {
416
+ apply: `${SCOPE}.insert.apply`,
417
+ remove: `${SCOPE}.insert.remove`,
418
+ failed: `${SCOPE}.insert.failed`,
419
+ },
420
+ swatches: {
421
+ recent: `${SCOPE}.swatches.recent`,
422
+ text: `${SCOPE}.swatches.text`,
423
+ highlight: `${SCOPE}.swatches.highlight`,
424
+ },
425
+ zoom: {
426
+ fit: `${SCOPE}.zoom.fit`,
427
+ },
428
+ table: {
429
+ insert: `${SCOPE}.table.insert`,
430
+ },
431
+ };
432
+
433
+ class AXTextEditorComponent extends classes((MXInputBaseValueComponent), MXLookComponent) {
434
+ static parseLineCount(value) {
435
+ if (value === undefined || value === null || value === '')
436
+ return undefined;
437
+ const n = typeof value === 'number' ? value : Number(value);
438
+ return Number.isFinite(n) && n > 0 ? Math.floor(n) : undefined;
439
+ }
440
+ constructor() {
441
+ super();
442
+ this.editorService = inject(AXTextEditorService);
443
+ this.destroyRef = inject(DestroyRef);
444
+ this.translation = inject(AXTranslationService);
445
+ this.projected = contentChild(AXTextEditorContentComponent, /* @ts-ignore */
446
+ ...(ngDevMode ? [{ debugName: "projected" }] : /* istanbul ignore next */ []));
447
+ this.syncingFromEditor = false;
448
+ this.placeHolder = input('', /* @ts-ignore */
449
+ ...(ngDevMode ? [{ debugName: "placeHolder" }] : /* istanbul ignore next */ []));
450
+ this.outputFormat = input('json', /* @ts-ignore */
451
+ ...(ngDevMode ? [{ debugName: "outputFormat" }] : /* istanbul ignore next */ []));
452
+ /**
453
+ * Minimum visible height of the editable surface, in text lines.
454
+ * Takes precedence over {@link initialLine} when set.
455
+ */
456
+ this.line = input(undefined, { ...(ngDevMode ? { debugName: "line" } : /* istanbul ignore next */ {}), transform: (value) => AXTextEditorComponent.parseLineCount(value) });
457
+ /**
458
+ * Minimum height of the editable surface, measured in text lines.
459
+ *
460
+ * @defaultValue 6
461
+ */
462
+ this.initialLine = input(6, { ...(ngDevMode ? { debugName: "initialLine" } : /* istanbul ignore next */ {}), transform: numberAttribute });
463
+ /**
464
+ * Maximum visible height of the editable area, in text lines.
465
+ * When set, content scrolls inside the editor after this height.
466
+ */
467
+ this.maxLine = input(undefined, { ...(ngDevMode ? { debugName: "maxLine" } : /* istanbul ignore next */ {}), transform: (value) => AXTextEditorComponent.parseLineCount(value) });
468
+ this.resolvedLine = computed(() => Math.max(1, this.line() ?? this.initialLine() ?? 6), /* @ts-ignore */
469
+ ...(ngDevMode ? [{ debugName: "resolvedLine" }] : /* istanbul ignore next */ []));
470
+ this.resolvedLineCss = computed(() => String(this.resolvedLine()), /* @ts-ignore */
471
+ ...(ngDevMode ? [{ debugName: "resolvedLineCss" }] : /* istanbul ignore next */ []));
472
+ this.maxLineHeightStyle = computed(() => {
473
+ const max = this.maxLine();
474
+ if (max == null)
475
+ return null;
476
+ const lines = Math.max(max, this.resolvedLine());
477
+ return `calc(${lines} * 1.5em + 1.5rem)`;
478
+ }, /* @ts-ignore */
479
+ ...(ngDevMode ? [{ debugName: "maxLineHeightStyle" }] : /* istanbul ignore next */ []));
480
+ this.zoomFactor = computed(() => this.editorService.zoomFactor(), /* @ts-ignore */
481
+ ...(ngDevMode ? [{ debugName: "zoomFactor" }] : /* istanbul ignore next */ []));
482
+ this.projectedContent = computed(() => this.projected() != null, /* @ts-ignore */
483
+ ...(ngDevMode ? [{ debugName: "projectedContent" }] : /* istanbul ignore next */ []));
484
+ this.editorService.bindHost({
485
+ placeHolder: () => this.placeHolder() ||
486
+ this.translation.translateSync(AX_TEXT_EDITOR_I18N.placeholder, { waitForLoad: true }),
487
+ outputFormat: () => this.outputFormat(),
488
+ value: () => this.value,
489
+ disabled: () => this.disabled,
490
+ readonly: () => this.readonly,
491
+ notifyFocus: (event) => this.notifyEditorFocus(event),
492
+ notifyBlur: (event) => this.notifyEditorBlur(event),
493
+ notifyValue: (value) => this.notifyEditorValue(value),
494
+ });
495
+ this.disabledChange.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.editorService.syncHostState());
496
+ this.readonlyChange.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.editorService.syncHostState());
497
+ }
498
+ getEditor() {
499
+ return this.editorService.editor();
500
+ }
501
+ getEditorService() {
502
+ return this.editorService;
503
+ }
504
+ focus() {
505
+ this.editorService.focus();
506
+ }
507
+ blur() {
508
+ this.editorService.blur();
509
+ }
510
+ /**
511
+ * Replaces the editor content. Optionally focuses the editor afterward.
512
+ *
513
+ * @param value - HTML, JSON, or null to clear.
514
+ * @param focus - When true, moves the caret into the editor after the content is applied.
515
+ * @returns void
516
+ */
517
+ setContent(value, focus = false) {
518
+ this.value = value ?? '';
519
+ if (!focus)
520
+ return;
521
+ setTimeout(() => this.focus());
522
+ }
523
+ /** @ignore */
524
+ notifyEditorFocus(event) {
525
+ this.emitOnFocusEvent(event);
526
+ }
527
+ /** @ignore */
528
+ notifyEditorBlur(event) {
529
+ this.emitOnBlurEvent(event);
530
+ }
531
+ /** @ignore */
532
+ notifyEditorValue(value) {
533
+ this.syncingFromEditor = true;
534
+ this.commitValue(value, true);
535
+ this.syncingFromEditor = false;
536
+ }
537
+ internalValueChanged(value) {
538
+ if (this.syncingFromEditor)
539
+ return;
540
+ const editor = this.editorService.editor();
541
+ if (!editor)
542
+ return;
543
+ if (editor.isEmpty && (value == null || value === ''))
544
+ return;
545
+ this.editorService.setContent(value == null ? '' : value, false);
546
+ }
547
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
548
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: AXTextEditorComponent, isStandalone: true, selector: "ax-text-editor", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: false, isRequired: false, transformFunction: null }, placeHolder: { classPropertyName: "placeHolder", publicName: "placeHolder", isSignal: true, isRequired: false, transformFunction: null }, outputFormat: { classPropertyName: "outputFormat", publicName: "outputFormat", isSignal: true, isRequired: false, transformFunction: null }, line: { classPropertyName: "line", publicName: "line", isSignal: true, isRequired: false, transformFunction: null }, initialLine: { classPropertyName: "initialLine", publicName: "initialLine", isSignal: true, isRequired: false, transformFunction: null }, maxLine: { classPropertyName: "maxLine", publicName: "maxLine", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onBlur: "onBlur", onFocus: "onFocus", valueChange: "valueChange", stateChange: "stateChange", onValueChanged: "onValueChanged", readonlyChange: "readonlyChange", disabledChange: "disabledChange" }, host: { attributes: { "ngSkipHydration": "true" }, properties: { "style.--ax-comp-text-editor-initial-line": "resolvedLineCss()", "style.--ax-comp-text-editor-max-height": "maxLineHeightStyle()", "style.--ax-comp-text-editor-zoom": "zoomFactor()", "class.ax-state-disabled": "disabled", "class.ax-state-readonly": "readonly && !disabled" }, classAttribute: "ax-text-editor" }, providers: [
549
+ AXTextEditor,
550
+ AXTextEditorService,
551
+ { provide: AXComponent, useExisting: AXTextEditorComponent },
552
+ { provide: AXFocusableComponent, useExisting: AXTextEditorComponent },
553
+ { provide: AXValuableComponent, useExisting: AXTextEditorComponent },
554
+ {
555
+ provide: NG_VALUE_ACCESSOR,
556
+ useExisting: forwardRef(() => AXTextEditorComponent),
557
+ multi: true,
558
+ },
559
+ ], queries: [{ propertyName: "projected", first: true, predicate: AXTextEditorContentComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-editor-container ax-default {{ look }}\">\n <ng-content select=\"ax-text-editor-toolbar\"></ng-content>\n <div class=\"ax-text-editor-content-stack\">\n <ng-content select=\"ax-header\"></ng-content>\n @if (!projectedContent()) {\n <ax-text-editor-content></ax-text-editor-content>\n }\n <ng-content select=\"ax-text-editor-content\"></ng-content>\n <ng-content select=\"ax-footer\"></ng-content>\n </div>\n <ng-content select=\"ax-validation-rule\"></ng-content>\n</div>\n<div class=\"ax-error-container\"></div>\n", styles: ["@layer properties;@layer components{ax-text-editor{position:relative;display:block;width:100%;max-width:100%;min-width:calc(var(--spacing, .25rem) * 0);overflow:visible;border-radius:var(--ax-sys-border-radius)}ax-text-editor:focus-within{box-shadow:0 0 0 2px var(--ax-sys-color-primary-light, rgb(147 197 253))}ax-text-editor>.ax-editor-container{position:relative;display:flex;max-width:100%;min-width:calc(var(--spacing, .25rem) * 0);flex-direction:column;display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;height:auto!important;min-height:var(--ax-sys-size-default, 2.5rem);padding:0!important;overflow:visible!important}ax-text-editor ax-text-editor-toolbar{width:100%;flex-shrink:0}ax-text-editor .ax-text-editor-content-stack{display:flex;min-height:calc(var(--spacing, .25rem) * 0);width:100%;min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-direction:column;align-items:stretch}ax-text-editor .ax-text-editor-content-stack>ax-header,ax-text-editor .ax-text-editor-content-stack>ax-footer{display:flex;flex-shrink:0;align-items:center;gap:calc(var(--spacing, .25rem) * 2);align-self:stretch}ax-text-editor .ax-text-editor-content-stack>ax-header:not(:has(>ax-button)),ax-text-editor .ax-text-editor-content-stack>ax-footer:not(:has(>ax-button)){align-items:center;align-self:stretch}:is(ax-text-editor .ax-text-editor-content-stack>ax-header:not(:has(>ax-button)),ax-text-editor .ax-text-editor-content-stack>ax-footer:not(:has(>ax-button)))>ax-icon,:is(ax-text-editor .ax-text-editor-content-stack>ax-header:not(:has(>ax-button)),ax-text-editor .ax-text-editor-content-stack>ax-footer:not(:has(>ax-button)))>ax-text{display:inline-flex;align-items:center;--tw-leading: 1;line-height:1;color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){:is(ax-text-editor .ax-text-editor-content-stack>ax-header:not(:has(>ax-button)),ax-text-editor .ax-text-editor-content-stack>ax-footer:not(:has(>ax-button)))>ax-icon,:is(ax-text-editor .ax-text-editor-content-stack>ax-header:not(:has(>ax-button)),ax-text-editor .ax-text-editor-content-stack>ax-footer:not(:has(>ax-button)))>ax-text{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}:is(ax-text-editor .ax-text-editor-content-stack>ax-header:not(:has(>ax-button)),ax-text-editor .ax-text-editor-content-stack>ax-footer:not(:has(>ax-button)))>ax-icon{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-text-editor .ax-text-editor-content-stack>ax-header{padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 1.5)}ax-text-editor .ax-text-editor-content-stack>ax-footer{justify-content:flex-end;padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 1.5)}ax-text-editor .ax-text-editor-content-stack>ax-text-editor-content{min-height:calc(var(--spacing, .25rem) * 0);min-width:calc(var(--spacing, .25rem) * 0);flex:1;overflow:auto;max-height:var(--ax-comp-text-editor-max-height, none)}ax-text-editor ax-text-editor-content{min-width:calc(var(--spacing, .25rem) * 0);flex:1;overflow:auto;max-height:var(--ax-comp-text-editor-max-height, none)}ax-text-editor:has(ax-text-editor-toolbar.ax-orientation-vertical)>.ax-editor-container{flex-direction:row!important;align-items:stretch!important}ax-text-editor:has(ax-text-editor-toolbar.ax-orientation-vertical) ax-text-editor-toolbar.ax-orientation-vertical{width:auto;max-width:none;flex-shrink:0;align-self:flex-start;overflow:hidden;max-height:var( --ax-comp-text-editor-max-height, var( --ax-comp-text-editor-min-height, calc(var(--ax-comp-text-editor-initial-line, 6) * 1.5em + 1.5rem) ) )}:dir(rtl) ax-text-editor:has(ax-text-editor-toolbar.ax-orientation-vertical)>.ax-editor-container{flex-direction:row-reverse!important}:is(ax-text-editor.ax-state-disabled,ax-text-editor.ax-state-readonly) ax-text-editor-toolbar{pointer-events:none;opacity:60%}ax-text-editor.ax-state-readonly:not(.ax-state-disabled) ax-text-editor-content{cursor:default}ax-text-editor.ax-state-disabled{cursor:not-allowed}ax-text-editor.ax-state-disabled ax-text-editor-content{pointer-events:none;cursor:not-allowed;opacity:60%}}@property --tw-leading{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-leading: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXTextEditorContentComponent, selector: "ax-text-editor-content" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
560
+ }
561
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorComponent, decorators: [{
562
+ type: Component,
563
+ args: [{ selector: 'ax-text-editor', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, inputs: ['disabled', 'tabIndex', 'readonly', 'value', 'state', 'name', 'look'], outputs: [
564
+ 'onBlur',
565
+ 'onFocus',
566
+ 'valueChange',
567
+ 'stateChange',
568
+ 'onValueChanged',
569
+ 'readonlyChange',
570
+ 'disabledChange',
571
+ ], host: {
572
+ '[style.--ax-comp-text-editor-initial-line]': 'resolvedLineCss()',
573
+ '[style.--ax-comp-text-editor-max-height]': 'maxLineHeightStyle()',
574
+ '[style.--ax-comp-text-editor-zoom]': 'zoomFactor()',
575
+ '[class.ax-state-disabled]': 'disabled',
576
+ '[class.ax-state-readonly]': 'readonly && !disabled',
577
+ class: 'ax-text-editor',
578
+ ngSkipHydration: 'true',
579
+ }, providers: [
580
+ AXTextEditor,
581
+ AXTextEditorService,
582
+ { provide: AXComponent, useExisting: AXTextEditorComponent },
583
+ { provide: AXFocusableComponent, useExisting: AXTextEditorComponent },
584
+ { provide: AXValuableComponent, useExisting: AXTextEditorComponent },
585
+ {
586
+ provide: NG_VALUE_ACCESSOR,
587
+ useExisting: forwardRef(() => AXTextEditorComponent),
588
+ multi: true,
589
+ },
590
+ ], imports: [AXTextEditorContentComponent], template: "<div class=\"ax-editor-container ax-default {{ look }}\">\n <ng-content select=\"ax-text-editor-toolbar\"></ng-content>\n <div class=\"ax-text-editor-content-stack\">\n <ng-content select=\"ax-header\"></ng-content>\n @if (!projectedContent()) {\n <ax-text-editor-content></ax-text-editor-content>\n }\n <ng-content select=\"ax-text-editor-content\"></ng-content>\n <ng-content select=\"ax-footer\"></ng-content>\n </div>\n <ng-content select=\"ax-validation-rule\"></ng-content>\n</div>\n<div class=\"ax-error-container\"></div>\n", styles: ["@layer properties;@layer components{ax-text-editor{position:relative;display:block;width:100%;max-width:100%;min-width:calc(var(--spacing, .25rem) * 0);overflow:visible;border-radius:var(--ax-sys-border-radius)}ax-text-editor:focus-within{box-shadow:0 0 0 2px var(--ax-sys-color-primary-light, rgb(147 197 253))}ax-text-editor>.ax-editor-container{position:relative;display:flex;max-width:100%;min-width:calc(var(--spacing, .25rem) * 0);flex-direction:column;display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;height:auto!important;min-height:var(--ax-sys-size-default, 2.5rem);padding:0!important;overflow:visible!important}ax-text-editor ax-text-editor-toolbar{width:100%;flex-shrink:0}ax-text-editor .ax-text-editor-content-stack{display:flex;min-height:calc(var(--spacing, .25rem) * 0);width:100%;min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-direction:column;align-items:stretch}ax-text-editor .ax-text-editor-content-stack>ax-header,ax-text-editor .ax-text-editor-content-stack>ax-footer{display:flex;flex-shrink:0;align-items:center;gap:calc(var(--spacing, .25rem) * 2);align-self:stretch}ax-text-editor .ax-text-editor-content-stack>ax-header:not(:has(>ax-button)),ax-text-editor .ax-text-editor-content-stack>ax-footer:not(:has(>ax-button)){align-items:center;align-self:stretch}:is(ax-text-editor .ax-text-editor-content-stack>ax-header:not(:has(>ax-button)),ax-text-editor .ax-text-editor-content-stack>ax-footer:not(:has(>ax-button)))>ax-icon,:is(ax-text-editor .ax-text-editor-content-stack>ax-header:not(:has(>ax-button)),ax-text-editor .ax-text-editor-content-stack>ax-footer:not(:has(>ax-button)))>ax-text{display:inline-flex;align-items:center;--tw-leading: 1;line-height:1;color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){:is(ax-text-editor .ax-text-editor-content-stack>ax-header:not(:has(>ax-button)),ax-text-editor .ax-text-editor-content-stack>ax-footer:not(:has(>ax-button)))>ax-icon,:is(ax-text-editor .ax-text-editor-content-stack>ax-header:not(:has(>ax-button)),ax-text-editor .ax-text-editor-content-stack>ax-footer:not(:has(>ax-button)))>ax-text{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}:is(ax-text-editor .ax-text-editor-content-stack>ax-header:not(:has(>ax-button)),ax-text-editor .ax-text-editor-content-stack>ax-footer:not(:has(>ax-button)))>ax-icon{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-text-editor .ax-text-editor-content-stack>ax-header{padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 1.5)}ax-text-editor .ax-text-editor-content-stack>ax-footer{justify-content:flex-end;padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 1.5)}ax-text-editor .ax-text-editor-content-stack>ax-text-editor-content{min-height:calc(var(--spacing, .25rem) * 0);min-width:calc(var(--spacing, .25rem) * 0);flex:1;overflow:auto;max-height:var(--ax-comp-text-editor-max-height, none)}ax-text-editor ax-text-editor-content{min-width:calc(var(--spacing, .25rem) * 0);flex:1;overflow:auto;max-height:var(--ax-comp-text-editor-max-height, none)}ax-text-editor:has(ax-text-editor-toolbar.ax-orientation-vertical)>.ax-editor-container{flex-direction:row!important;align-items:stretch!important}ax-text-editor:has(ax-text-editor-toolbar.ax-orientation-vertical) ax-text-editor-toolbar.ax-orientation-vertical{width:auto;max-width:none;flex-shrink:0;align-self:flex-start;overflow:hidden;max-height:var( --ax-comp-text-editor-max-height, var( --ax-comp-text-editor-min-height, calc(var(--ax-comp-text-editor-initial-line, 6) * 1.5em + 1.5rem) ) )}:dir(rtl) ax-text-editor:has(ax-text-editor-toolbar.ax-orientation-vertical)>.ax-editor-container{flex-direction:row-reverse!important}:is(ax-text-editor.ax-state-disabled,ax-text-editor.ax-state-readonly) ax-text-editor-toolbar{pointer-events:none;opacity:60%}ax-text-editor.ax-state-readonly:not(.ax-state-disabled) ax-text-editor-content{cursor:default}ax-text-editor.ax-state-disabled{cursor:not-allowed}ax-text-editor.ax-state-disabled ax-text-editor-content{pointer-events:none;cursor:not-allowed;opacity:60%}}@property --tw-leading{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-leading: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
591
+ }], ctorParameters: () => [], propDecorators: { projected: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AXTextEditorContentComponent), { isSignal: true }] }], placeHolder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeHolder", required: false }] }], outputFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "outputFormat", required: false }] }], line: [{ type: i0.Input, args: [{ isSignal: true, alias: "line", required: false }] }], initialLine: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialLine", required: false }] }], maxLine: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLine", required: false }] }] } });
592
+
593
+ class AXTextEditorToolbarComponent extends AXTextEditorSlot {
594
+ constructor() {
595
+ super(...arguments);
596
+ this.editorService = inject(AXTextEditorService);
597
+ this.orientation = input('horizontal', /* @ts-ignore */
598
+ ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
599
+ }
600
+ onMouseDown(event) {
601
+ const target = event.target;
602
+ if (target?.closest('input, textarea, select, [contenteditable="true"]'))
603
+ return;
604
+ this.editorService.preserveSelection();
605
+ event.preventDefault();
606
+ }
607
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorToolbarComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
608
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: AXTextEditorToolbarComponent, isStandalone: true, selector: "ax-text-editor-toolbar", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "onMouseDown($event)" }, properties: { "class.ax-orientation-vertical": "orientation() === \"vertical\"", "class.ax-orientation-horizontal": "orientation() === \"horizontal\"" }, classAttribute: "ax-text-editor-toolbar" }, providers: [
609
+ { provide: AXComponent, useExisting: AXTextEditorToolbarComponent },
610
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorToolbarComponent },
611
+ ], usesInheritance: true, ngImport: i0, template: `
612
+ <div class="ax-text-editor-toolbar-content">
613
+ <div class="ax-text-editor-toolbar-prefix">
614
+ <ng-content select="ax-prefix"></ng-content>
615
+ </div>
616
+ <div class="ax-text-editor-toolbar-tools" axHorizontalScroll [orientation]="orientation()">
617
+ <ng-content></ng-content>
618
+ </div>
619
+ <div class="ax-text-editor-toolbar-suffix">
620
+ <ng-content select="ax-suffix"></ng-content>
621
+ </div>
622
+ </div>
623
+ `, isInline: true, styles: ["@layer components{ax-text-editor-toolbar{position:relative;display:block;width:100%;max-width:100%;min-width:calc(var(--spacing, .25rem) * 0);overflow-x:hidden;overflow-y:visible}ax-text-editor-toolbar>.ax-text-editor-toolbar-content{display:flex;width:100%;max-width:100%;min-width:calc(var(--spacing, .25rem) * 0);flex-wrap:nowrap;align-items:center;gap:calc(var(--spacing, .25rem) * 1);padding-inline:calc(var(--spacing, .25rem) * 1);padding-block:calc(var(--spacing, .25rem) * .5)}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-prefix:not(:has(ax-prefix)),ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-suffix:not(:has(ax-suffix)){display:none}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-prefix:has(ax-prefix){display:flex;flex-shrink:0;align-items:center;gap:calc(var(--spacing, .25rem) * 1);align-self:stretch;padding-inline:calc(var(--spacing, .25rem) * 1);border-inline-end:1px solid var(--ax-sys-color-border-lightest, var(--color-border-lightest, #e5e7eb))}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-suffix:has(ax-suffix){margin-inline-start:auto;display:flex;flex-shrink:0;align-items:center;gap:calc(var(--spacing, .25rem) * 1);align-self:stretch;padding-inline:calc(var(--spacing, .25rem) * 1);border-inline-start:1px solid var(--ax-sys-color-border-lightest, var(--color-border-lightest, #e5e7eb))}ax-text-editor-toolbar>.ax-text-editor-toolbar-content ax-prefix,ax-text-editor-toolbar>.ax-text-editor-toolbar-content ax-suffix{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 1)}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools{display:flex;min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-wrap:nowrap;align-items:center;gap:calc(var(--spacing, .25rem) * 1);overflow-x:auto;overflow-y:hidden;padding:calc(var(--spacing, .25rem) * 1);overscroll-behavior-x:contain;scrollbar-width:none;-ms-overflow-style:none}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools::-webkit-scrollbar{display:none}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools>*{display:flex;flex-shrink:0;align-items:center;gap:calc(var(--spacing, .25rem) * 1)}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools ax-dropdown-button{width:auto}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools>ax-divider{margin-inline:calc(var(--spacing, .25rem) * 1);display:block;min-height:calc(var(--spacing, .25rem) * 6);width:1px;align-self:stretch;background-color:rgba(var(--ax-sys-color-border-lightest-surface))}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools ax-button button.ax-state-selected{background-color:var(--ax-comp-bg-lighter, var(--color-surface));color:var(--ax-comp-text-lighter, var(--color-on-surface))}ax-text-editor-toolbar.ax-orientation-vertical{display:flex;width:auto;max-width:none;flex-direction:column;overflow:hidden}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content{min-height:calc(var(--spacing, .25rem) * 0);flex:1;flex-direction:column;align-items:stretch;gap:calc(var(--spacing, .25rem) * 1);padding-inline:calc(var(--spacing, .25rem) * .5);padding-block:calc(var(--spacing, .25rem) * 1)}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-prefix:has(ax-prefix){flex-direction:column;align-items:center;padding-inline:calc(var(--spacing, .25rem) * 0);padding-block:calc(var(--spacing, .25rem) * 1);border-inline-end:0;border-block-end:1px solid var(--ax-sys-color-border-lightest, var(--color-border-lightest, #e5e7eb))}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-suffix:has(ax-suffix){margin-inline-start:calc(var(--spacing, .25rem) * 0);margin-top:auto;flex-direction:column;align-items:center;padding-inline:calc(var(--spacing, .25rem) * 0);padding-block:calc(var(--spacing, .25rem) * 1);border-inline-start:0;border-block-start:1px solid var(--ax-sys-color-border-lightest, var(--color-border-lightest, #e5e7eb))}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content ax-prefix,ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content ax-suffix{flex-direction:column;align-items:center;gap:calc(var(--spacing, .25rem) * 1)}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools{min-height:calc(var(--spacing, .25rem) * 0);flex:1;flex-direction:column;align-items:center;gap:calc(var(--spacing, .25rem) * 1);overflow-x:hidden;overflow-y:auto;padding:calc(var(--spacing, .25rem) * 1);overscroll-behavior-y:contain}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools>*{flex-direction:column;align-items:center;justify-content:center;gap:calc(var(--spacing, .25rem) * 1)}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools>ax-divider{margin-inline:calc(var(--spacing, .25rem) * 0);margin-block:calc(var(--spacing, .25rem) * 1);height:1px;min-height:1px;width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);align-self:center}ax-text-editor-toolbar.ax-orientation-vertical .ax-text-editor-zoom-value{min-width:calc(var(--spacing, .25rem) * 0)}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: AXHorizontalScrollDirective, selector: "[axHorizontalScroll]", inputs: ["disabled", "orientation", "speed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
624
+ }
625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorToolbarComponent, decorators: [{
626
+ type: Component,
627
+ args: [{ selector: 'ax-text-editor-toolbar', template: `
628
+ <div class="ax-text-editor-toolbar-content">
629
+ <div class="ax-text-editor-toolbar-prefix">
630
+ <ng-content select="ax-prefix"></ng-content>
631
+ </div>
632
+ <div class="ax-text-editor-toolbar-tools" axHorizontalScroll [orientation]="orientation()">
633
+ <ng-content></ng-content>
634
+ </div>
635
+ <div class="ax-text-editor-toolbar-suffix">
636
+ <ng-content select="ax-suffix"></ng-content>
637
+ </div>
638
+ </div>
639
+ `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
640
+ class: 'ax-text-editor-toolbar',
641
+ '[class.ax-orientation-vertical]': 'orientation() === "vertical"',
642
+ '[class.ax-orientation-horizontal]': 'orientation() === "horizontal"',
643
+ '(mousedown)': 'onMouseDown($event)',
644
+ }, imports: [AXHorizontalScrollDirective], providers: [
645
+ { provide: AXComponent, useExisting: AXTextEditorToolbarComponent },
646
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorToolbarComponent },
647
+ ], styles: ["@layer components{ax-text-editor-toolbar{position:relative;display:block;width:100%;max-width:100%;min-width:calc(var(--spacing, .25rem) * 0);overflow-x:hidden;overflow-y:visible}ax-text-editor-toolbar>.ax-text-editor-toolbar-content{display:flex;width:100%;max-width:100%;min-width:calc(var(--spacing, .25rem) * 0);flex-wrap:nowrap;align-items:center;gap:calc(var(--spacing, .25rem) * 1);padding-inline:calc(var(--spacing, .25rem) * 1);padding-block:calc(var(--spacing, .25rem) * .5)}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-prefix:not(:has(ax-prefix)),ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-suffix:not(:has(ax-suffix)){display:none}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-prefix:has(ax-prefix){display:flex;flex-shrink:0;align-items:center;gap:calc(var(--spacing, .25rem) * 1);align-self:stretch;padding-inline:calc(var(--spacing, .25rem) * 1);border-inline-end:1px solid var(--ax-sys-color-border-lightest, var(--color-border-lightest, #e5e7eb))}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-suffix:has(ax-suffix){margin-inline-start:auto;display:flex;flex-shrink:0;align-items:center;gap:calc(var(--spacing, .25rem) * 1);align-self:stretch;padding-inline:calc(var(--spacing, .25rem) * 1);border-inline-start:1px solid var(--ax-sys-color-border-lightest, var(--color-border-lightest, #e5e7eb))}ax-text-editor-toolbar>.ax-text-editor-toolbar-content ax-prefix,ax-text-editor-toolbar>.ax-text-editor-toolbar-content ax-suffix{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 1)}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools{display:flex;min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-wrap:nowrap;align-items:center;gap:calc(var(--spacing, .25rem) * 1);overflow-x:auto;overflow-y:hidden;padding:calc(var(--spacing, .25rem) * 1);overscroll-behavior-x:contain;scrollbar-width:none;-ms-overflow-style:none}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools::-webkit-scrollbar{display:none}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools>*{display:flex;flex-shrink:0;align-items:center;gap:calc(var(--spacing, .25rem) * 1)}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools ax-dropdown-button{width:auto}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools>ax-divider{margin-inline:calc(var(--spacing, .25rem) * 1);display:block;min-height:calc(var(--spacing, .25rem) * 6);width:1px;align-self:stretch;background-color:rgba(var(--ax-sys-color-border-lightest-surface))}ax-text-editor-toolbar>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools ax-button button.ax-state-selected{background-color:var(--ax-comp-bg-lighter, var(--color-surface));color:var(--ax-comp-text-lighter, var(--color-on-surface))}ax-text-editor-toolbar.ax-orientation-vertical{display:flex;width:auto;max-width:none;flex-direction:column;overflow:hidden}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content{min-height:calc(var(--spacing, .25rem) * 0);flex:1;flex-direction:column;align-items:stretch;gap:calc(var(--spacing, .25rem) * 1);padding-inline:calc(var(--spacing, .25rem) * .5);padding-block:calc(var(--spacing, .25rem) * 1)}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-prefix:has(ax-prefix){flex-direction:column;align-items:center;padding-inline:calc(var(--spacing, .25rem) * 0);padding-block:calc(var(--spacing, .25rem) * 1);border-inline-end:0;border-block-end:1px solid var(--ax-sys-color-border-lightest, var(--color-border-lightest, #e5e7eb))}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-suffix:has(ax-suffix){margin-inline-start:calc(var(--spacing, .25rem) * 0);margin-top:auto;flex-direction:column;align-items:center;padding-inline:calc(var(--spacing, .25rem) * 0);padding-block:calc(var(--spacing, .25rem) * 1);border-inline-start:0;border-block-start:1px solid var(--ax-sys-color-border-lightest, var(--color-border-lightest, #e5e7eb))}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content ax-prefix,ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content ax-suffix{flex-direction:column;align-items:center;gap:calc(var(--spacing, .25rem) * 1)}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools{min-height:calc(var(--spacing, .25rem) * 0);flex:1;flex-direction:column;align-items:center;gap:calc(var(--spacing, .25rem) * 1);overflow-x:hidden;overflow-y:auto;padding:calc(var(--spacing, .25rem) * 1);overscroll-behavior-y:contain}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools>*{flex-direction:column;align-items:center;justify-content:center;gap:calc(var(--spacing, .25rem) * 1)}ax-text-editor-toolbar.ax-orientation-vertical>.ax-text-editor-toolbar-content .ax-text-editor-toolbar-tools>ax-divider{margin-inline:calc(var(--spacing, .25rem) * 0);margin-block:calc(var(--spacing, .25rem) * 1);height:1px;min-height:1px;width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);align-self:center}ax-text-editor-toolbar.ax-orientation-vertical .ax-text-editor-zoom-value{min-width:calc(var(--spacing, .25rem) * 0)}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
648
+ }], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }] } });
649
+
650
+ class AXTextEditorAlignmentComponent extends AXTextEditorSlot {
651
+ constructor() {
652
+ super(...arguments);
653
+ this.i18n = AX_TEXT_EDITOR_I18N;
654
+ }
655
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorAlignmentComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
656
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorAlignmentComponent, isStandalone: true, selector: "ax-text-editor-alignment", providers: [
657
+ { provide: AXComponent, useExisting: AXTextEditorAlignmentComponent },
658
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorAlignmentComponent },
659
+ ], usesInheritance: true, ngImport: i0, template: `
660
+ <ax-text-editor-command
661
+ command="align"
662
+ [attrs]="{ align: 'left' }"
663
+ icon="ax-icon-align-left"
664
+ [label]="i18n.tools.alignLeft"
665
+ />
666
+ <ax-text-editor-command
667
+ command="align"
668
+ [attrs]="{ align: 'center' }"
669
+ icon="ax-icon-align-center"
670
+ [label]="i18n.tools.alignCenter"
671
+ />
672
+ <ax-text-editor-command
673
+ command="align"
674
+ [attrs]="{ align: 'right' }"
675
+ icon="ax-icon-align-right"
676
+ [label]="i18n.tools.alignRight"
677
+ />
678
+ <ax-text-editor-command
679
+ command="align"
680
+ [attrs]="{ align: 'justify' }"
681
+ icon="ax-icon-align-justify"
682
+ [label]="i18n.tools.alignJustify"
683
+ />
684
+ `, isInline: true, dependencies: [{ kind: "component", type: AXTextEditorCommandComponent, selector: "ax-text-editor-command", inputs: ["command", "attrs", "icon", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
685
+ }
686
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorAlignmentComponent, decorators: [{
687
+ type: Component,
688
+ args: [{
689
+ selector: 'ax-text-editor-alignment',
690
+ template: `
691
+ <ax-text-editor-command
692
+ command="align"
693
+ [attrs]="{ align: 'left' }"
694
+ icon="ax-icon-align-left"
695
+ [label]="i18n.tools.alignLeft"
696
+ />
697
+ <ax-text-editor-command
698
+ command="align"
699
+ [attrs]="{ align: 'center' }"
700
+ icon="ax-icon-align-center"
701
+ [label]="i18n.tools.alignCenter"
702
+ />
703
+ <ax-text-editor-command
704
+ command="align"
705
+ [attrs]="{ align: 'right' }"
706
+ icon="ax-icon-align-right"
707
+ [label]="i18n.tools.alignRight"
708
+ />
709
+ <ax-text-editor-command
710
+ command="align"
711
+ [attrs]="{ align: 'justify' }"
712
+ icon="ax-icon-align-justify"
713
+ [label]="i18n.tools.alignJustify"
714
+ />
715
+ `,
716
+ changeDetection: ChangeDetectionStrategy.OnPush,
717
+ encapsulation: ViewEncapsulation.None,
718
+ imports: [AXTextEditorCommandComponent],
719
+ providers: [
720
+ { provide: AXComponent, useExisting: AXTextEditorAlignmentComponent },
721
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorAlignmentComponent },
722
+ ],
723
+ }]
724
+ }] });
725
+
726
+ class AXTextEditorBlocksComponent extends AXTextEditorSlot {
727
+ constructor() {
728
+ super(...arguments);
729
+ this.i18n = AX_TEXT_EDITOR_I18N;
730
+ }
731
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorBlocksComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
732
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorBlocksComponent, isStandalone: true, selector: "ax-text-editor-blocks", providers: [
733
+ { provide: AXComponent, useExisting: AXTextEditorBlocksComponent },
734
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorBlocksComponent },
735
+ ], usesInheritance: true, ngImport: i0, template: `
736
+ <ax-text-editor-command command="codeBlock" icon="ax-icon-code-block" [label]="i18n.tools.codeBlock" />
737
+ <ax-text-editor-command command="horizontalRule" icon="ax-icon-horizontal-rule" [label]="i18n.tools.horizontalRule" />
738
+ `, isInline: true, dependencies: [{ kind: "component", type: AXTextEditorCommandComponent, selector: "ax-text-editor-command", inputs: ["command", "attrs", "icon", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
739
+ }
740
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorBlocksComponent, decorators: [{
741
+ type: Component,
742
+ args: [{
743
+ selector: 'ax-text-editor-blocks',
744
+ template: `
745
+ <ax-text-editor-command command="codeBlock" icon="ax-icon-code-block" [label]="i18n.tools.codeBlock" />
746
+ <ax-text-editor-command command="horizontalRule" icon="ax-icon-horizontal-rule" [label]="i18n.tools.horizontalRule" />
747
+ `,
748
+ changeDetection: ChangeDetectionStrategy.OnPush,
749
+ encapsulation: ViewEncapsulation.None,
750
+ imports: [AXTextEditorCommandComponent],
751
+ providers: [
752
+ { provide: AXComponent, useExisting: AXTextEditorBlocksComponent },
753
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorBlocksComponent },
754
+ ],
755
+ }]
756
+ }] });
757
+
758
+ class AXTextEditorColorSwatchesComponent extends AXTextEditorSlot {
759
+ constructor() {
760
+ super(...arguments);
761
+ this.editorService = inject(AXTextEditorService);
762
+ this.i18n = AX_TEXT_EDITOR_I18N;
763
+ this.textColors = input([], /* @ts-ignore */
764
+ ...(ngDevMode ? [{ debugName: "textColors" }] : /* istanbul ignore next */ []));
765
+ this.backgroundColors = input([], /* @ts-ignore */
766
+ ...(ngDevMode ? [{ debugName: "backgroundColors" }] : /* istanbul ignore next */ []));
767
+ this.recentColors = model([], /* @ts-ignore */
768
+ ...(ngDevMode ? [{ debugName: "recentColors" }] : /* istanbul ignore next */ []));
769
+ this.resolvedTextColors = computed(() => this.textColors().length ? this.textColors() : AX_TEXT_EDITOR_DEFAULT_TEXT_COLORS, /* @ts-ignore */
770
+ ...(ngDevMode ? [{ debugName: "resolvedTextColors" }] : /* istanbul ignore next */ []));
771
+ this.resolvedBackgroundColors = computed(() => this.backgroundColors().length ? this.backgroundColors() : AX_TEXT_EDITOR_DEFAULT_BACKGROUND_COLORS, /* @ts-ignore */
772
+ ...(ngDevMode ? [{ debugName: "resolvedBackgroundColors" }] : /* istanbul ignore next */ []));
773
+ }
774
+ isTextSelected(color) {
775
+ return sameColor(this.editorService.textColor(), color);
776
+ }
777
+ isBackgroundSelected(color) {
778
+ return sameColor(this.editorService.highlightColor(), color);
779
+ }
780
+ applyText(color) {
781
+ this.editorService.run('color', { color });
782
+ this.remember({ color, kind: 'text' });
783
+ }
784
+ applyBackground(color) {
785
+ this.editorService.run('highlight', { color });
786
+ this.remember({ color, kind: 'background' });
787
+ }
788
+ applyRecent(item) {
789
+ if (item.kind === 'text')
790
+ this.applyText(item.color);
791
+ else
792
+ this.applyBackground(item.color);
793
+ }
794
+ remember(item) {
795
+ const next = [item, ...this.recentColors().filter((entry) => entry.kind !== item.kind || !sameColor(entry.color, item.color))];
796
+ this.recentColors.set(next.slice(0, 8));
797
+ }
798
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorColorSwatchesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
799
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: AXTextEditorColorSwatchesComponent, isStandalone: true, selector: "ax-text-editor-color-swatches", inputs: { textColors: { classPropertyName: "textColors", publicName: "textColors", isSignal: true, isRequired: false, transformFunction: null }, backgroundColors: { classPropertyName: "backgroundColors", publicName: "backgroundColors", isSignal: true, isRequired: false, transformFunction: null }, recentColors: { classPropertyName: "recentColors", publicName: "recentColors", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { recentColors: "recentColorsChange" }, providers: [
800
+ { provide: AXComponent, useExisting: AXTextEditorColorSwatchesComponent },
801
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorColorSwatchesComponent },
802
+ ], usesInheritance: true, ngImport: i0, template: `
803
+ <ax-dropdown-button class="ax-sm" look="blank" mode="dropdown" [iconOnly]="true" [text]="i18n.tools.colors">
804
+ <ax-prefix>
805
+ <span
806
+ class="ax-text-editor-swatches-trigger"
807
+ [style.color]="editorService.textColor() || 'currentColor'"
808
+ [style.background-color]="editorService.highlightColor() || 'transparent'"
809
+ >
810
+ A
811
+ </span>
812
+ </ax-prefix>
813
+ <div class="ax-text-editor-swatches-panel" (click)="$event.stopPropagation()" (mousedown)="$event.stopPropagation()">
814
+ @if (recentColors().length) {
815
+ <div class="ax-text-editor-swatches-section">
816
+ <div class="ax-text-editor-swatches-title">{{ i18n.swatches.recent | translate | async }}</div>
817
+ <div class="ax-text-editor-swatches-row">
818
+ @for (item of recentColors(); track item.kind + item.color) {
819
+ <button
820
+ type="button"
821
+ class="ax-text-editor-swatch"
822
+ [class.ax-text-editor-swatch-letter]="item.kind === 'text'"
823
+ [class.ax-text-editor-swatch-dot]="item.kind === 'background'"
824
+ [style.background-color]="item.kind === 'background' ? item.color : null"
825
+ [attr.title]="item.color"
826
+ (click)="applyRecent(item)"
827
+ >
828
+ @if (item.kind === 'text') {
829
+ <span [style.color]="item.color">A</span>
830
+ }
831
+ </button>
832
+ }
833
+ </div>
834
+ </div>
835
+ }
836
+ <div class="ax-text-editor-swatches-section">
837
+ <div class="ax-text-editor-swatches-title">{{ i18n.swatches.text | translate | async }}</div>
838
+ <div class="ax-text-editor-swatches-row">
839
+ @for (color of resolvedTextColors(); track color) {
840
+ <button
841
+ type="button"
842
+ class="ax-text-editor-swatch ax-text-editor-swatch-letter"
843
+ [class.ax-state-selected]="isTextSelected(color)"
844
+ [attr.title]="color"
845
+ (click)="applyText(color)"
846
+ >
847
+ <span [style.color]="color">A</span>
848
+ </button>
849
+ }
850
+ </div>
851
+ </div>
852
+ <div class="ax-text-editor-swatches-section">
853
+ <div class="ax-text-editor-swatches-title">{{ i18n.swatches.highlight | translate | async }}</div>
854
+ <div class="ax-text-editor-swatches-row">
855
+ @for (color of resolvedBackgroundColors(); track color) {
856
+ <button
857
+ type="button"
858
+ class="ax-text-editor-swatch ax-text-editor-swatch-dot"
859
+ [class.ax-state-selected]="isBackgroundSelected(color)"
860
+ [style.background-color]="color"
861
+ [attr.title]="color"
862
+ (click)="applyBackground(color)"
863
+ ></button>
864
+ }
865
+ </div>
866
+ </div>
867
+ </div>
868
+ </ax-dropdown-button>
869
+ `, isInline: true, styles: ["@layer properties;@layer components{ax-text-editor-color-swatches{position:relative;z-index:20;display:inline-flex;align-items:center}.ax-text-editor-swatches-trigger{display:inline-flex;height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);align-items:center;justify-content:center;border-radius:var(--radius-sm, .25rem);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}ax-text-editor-color-swatches ax-dropdown-button ax-suffix{display:none}.ax-overlay-pane:has(.ax-text-editor-swatches-panel){width:max-content;min-width:0}.ax-text-editor-swatches-panel{display:flex;width:max-content;flex-direction:column;gap:12px;padding:12px}.ax-text-editor-swatches-section{display:flex;flex-direction:column;gap:8px}.ax-text-editor-swatches-title{font-size:13px;font-weight:500;line-height:1.25;color:#374151}.ax-text-editor-swatches-row{display:grid;grid-template-columns:repeat(4,28px);gap:8px 10px}.ax-text-editor-swatch{display:inline-flex;width:28px;height:28px;flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;padding:0;border:1px solid transparent;border-radius:9999px;background:transparent}.ax-text-editor-swatch-letter{border-color:#d1d5db;background:#fff;font-size:13px;font-weight:600;line-height:1}.ax-text-editor-swatch-dot{border-color:#e5e7eb}.ax-text-editor-swatch.ax-state-selected{box-shadow:0 0 0 2px var(--ax-sys-color-primary, #8b5cf6)}}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXDropdownButtonComponent, selector: "ax-dropdown-button", inputs: ["disabled", "size", "text", "selected", "color", "look", "type", "mode", "iconOnly"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
870
+ }
871
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorColorSwatchesComponent, decorators: [{
872
+ type: Component,
873
+ args: [{ selector: 'ax-text-editor-color-swatches', template: `
874
+ <ax-dropdown-button class="ax-sm" look="blank" mode="dropdown" [iconOnly]="true" [text]="i18n.tools.colors">
875
+ <ax-prefix>
876
+ <span
877
+ class="ax-text-editor-swatches-trigger"
878
+ [style.color]="editorService.textColor() || 'currentColor'"
879
+ [style.background-color]="editorService.highlightColor() || 'transparent'"
880
+ >
881
+ A
882
+ </span>
883
+ </ax-prefix>
884
+ <div class="ax-text-editor-swatches-panel" (click)="$event.stopPropagation()" (mousedown)="$event.stopPropagation()">
885
+ @if (recentColors().length) {
886
+ <div class="ax-text-editor-swatches-section">
887
+ <div class="ax-text-editor-swatches-title">{{ i18n.swatches.recent | translate | async }}</div>
888
+ <div class="ax-text-editor-swatches-row">
889
+ @for (item of recentColors(); track item.kind + item.color) {
890
+ <button
891
+ type="button"
892
+ class="ax-text-editor-swatch"
893
+ [class.ax-text-editor-swatch-letter]="item.kind === 'text'"
894
+ [class.ax-text-editor-swatch-dot]="item.kind === 'background'"
895
+ [style.background-color]="item.kind === 'background' ? item.color : null"
896
+ [attr.title]="item.color"
897
+ (click)="applyRecent(item)"
898
+ >
899
+ @if (item.kind === 'text') {
900
+ <span [style.color]="item.color">A</span>
901
+ }
902
+ </button>
903
+ }
904
+ </div>
905
+ </div>
906
+ }
907
+ <div class="ax-text-editor-swatches-section">
908
+ <div class="ax-text-editor-swatches-title">{{ i18n.swatches.text | translate | async }}</div>
909
+ <div class="ax-text-editor-swatches-row">
910
+ @for (color of resolvedTextColors(); track color) {
911
+ <button
912
+ type="button"
913
+ class="ax-text-editor-swatch ax-text-editor-swatch-letter"
914
+ [class.ax-state-selected]="isTextSelected(color)"
915
+ [attr.title]="color"
916
+ (click)="applyText(color)"
917
+ >
918
+ <span [style.color]="color">A</span>
919
+ </button>
920
+ }
921
+ </div>
922
+ </div>
923
+ <div class="ax-text-editor-swatches-section">
924
+ <div class="ax-text-editor-swatches-title">{{ i18n.swatches.highlight | translate | async }}</div>
925
+ <div class="ax-text-editor-swatches-row">
926
+ @for (color of resolvedBackgroundColors(); track color) {
927
+ <button
928
+ type="button"
929
+ class="ax-text-editor-swatch ax-text-editor-swatch-dot"
930
+ [class.ax-state-selected]="isBackgroundSelected(color)"
931
+ [style.background-color]="color"
932
+ [attr.title]="color"
933
+ (click)="applyBackground(color)"
934
+ ></button>
935
+ }
936
+ </div>
937
+ </div>
938
+ </div>
939
+ </ax-dropdown-button>
940
+ `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [AXDropdownButtonComponent, AXDecoratorGenericComponent, AXTranslatorPipe, AsyncPipe], providers: [
941
+ { provide: AXComponent, useExisting: AXTextEditorColorSwatchesComponent },
942
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorColorSwatchesComponent },
943
+ ], styles: ["@layer properties;@layer components{ax-text-editor-color-swatches{position:relative;z-index:20;display:inline-flex;align-items:center}.ax-text-editor-swatches-trigger{display:inline-flex;height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);align-items:center;justify-content:center;border-radius:var(--radius-sm, .25rem);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}ax-text-editor-color-swatches ax-dropdown-button ax-suffix{display:none}.ax-overlay-pane:has(.ax-text-editor-swatches-panel){width:max-content;min-width:0}.ax-text-editor-swatches-panel{display:flex;width:max-content;flex-direction:column;gap:12px;padding:12px}.ax-text-editor-swatches-section{display:flex;flex-direction:column;gap:8px}.ax-text-editor-swatches-title{font-size:13px;font-weight:500;line-height:1.25;color:#374151}.ax-text-editor-swatches-row{display:grid;grid-template-columns:repeat(4,28px);gap:8px 10px}.ax-text-editor-swatch{display:inline-flex;width:28px;height:28px;flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;padding:0;border:1px solid transparent;border-radius:9999px;background:transparent}.ax-text-editor-swatch-letter{border-color:#d1d5db;background:#fff;font-size:13px;font-weight:600;line-height:1}.ax-text-editor-swatch-dot{border-color:#e5e7eb}.ax-text-editor-swatch.ax-state-selected{box-shadow:0 0 0 2px var(--ax-sys-color-primary, #8b5cf6)}}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
944
+ }], propDecorators: { textColors: [{ type: i0.Input, args: [{ isSignal: true, alias: "textColors", required: false }] }], backgroundColors: [{ type: i0.Input, args: [{ isSignal: true, alias: "backgroundColors", required: false }] }], recentColors: [{ type: i0.Input, args: [{ isSignal: true, alias: "recentColors", required: false }] }, { type: i0.Output, args: ["recentColorsChange"] }] } });
945
+ function sameColor(left, right) {
946
+ return (left ?? '').replaceAll(' ', '').toLowerCase() === right.replaceAll(' ', '').toLowerCase();
947
+ }
948
+
949
+ class AXTextEditorColorsComponent extends AXTextEditorSlot {
950
+ constructor() {
951
+ super(...arguments);
952
+ this.editorService = inject(AXTextEditorService);
953
+ this.i18n = AX_TEXT_EDITOR_I18N;
954
+ }
955
+ setColor(color) {
956
+ if (color)
957
+ this.editorService.run('color', { color });
958
+ else
959
+ this.editorService.run('color');
960
+ }
961
+ setHighlight(color) {
962
+ if (color)
963
+ this.editorService.run('highlight', { color });
964
+ else
965
+ this.editorService.run('highlight');
966
+ }
967
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorColorsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
968
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorColorsComponent, isStandalone: true, selector: "ax-text-editor-colors", providers: [
969
+ { provide: AXComponent, useExisting: AXTextEditorColorsComponent },
970
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorColorsComponent },
971
+ ], usesInheritance: true, ngImport: i0, template: `
972
+ <ax-dropdown-button class="ax-sm" look="blank" mode="dropdown" [iconOnly]="true" [text]="i18n.tools.textColor">
973
+ <ax-prefix class="ax-text-editor-color-trigger">
974
+ <ax-icon class="ax-icon ax-icon-color-palette"></ax-icon>
975
+ <ax-badge
976
+ text=""
977
+ class="ax-text-editor-color-badge"
978
+ [look]="editorService.textColor() ? 'solid' : 'outline'"
979
+ [style.background-color]="editorService.textColor()"
980
+ ></ax-badge>
981
+ </ax-prefix>
982
+ <ax-color-palette
983
+ class="ax-text-editor-color-palette"
984
+ [ngModel]="editorService.textColor()"
985
+ (ngModelChange)="setColor($event)"
986
+ >
987
+ <ax-color-palette-picker></ax-color-palette-picker>
988
+ <ax-color-palette-swatches></ax-color-palette-swatches>
989
+ <ax-color-palette-input></ax-color-palette-input>
990
+ </ax-color-palette>
991
+ </ax-dropdown-button>
992
+
993
+ <ax-dropdown-button class="ax-sm" look="blank" mode="dropdown" [iconOnly]="true" [text]="i18n.tools.highlight">
994
+ <ax-prefix class="ax-text-editor-color-trigger">
995
+ <ax-icon class="ax-icon ax-icon-highlight"></ax-icon>
996
+ <ax-badge
997
+ text=""
998
+ class="ax-text-editor-color-badge"
999
+ [look]="editorService.highlightColor() ? 'solid' : 'outline'"
1000
+ [style.background-color]="editorService.highlightColor()"
1001
+ ></ax-badge>
1002
+ </ax-prefix>
1003
+ <ax-color-palette
1004
+ class="ax-text-editor-color-palette"
1005
+ [ngModel]="editorService.highlightColor()"
1006
+ (ngModelChange)="setHighlight($event)"
1007
+ >
1008
+ <ax-color-palette-picker></ax-color-palette-picker>
1009
+ <ax-color-palette-swatches></ax-color-palette-swatches>
1010
+ <ax-color-palette-input></ax-color-palette-input>
1011
+ </ax-color-palette>
1012
+ </ax-dropdown-button>
1013
+ `, isInline: true, styles: ["@layer components{ax-text-editor-colors{position:relative;z-index:20;display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 1)}.ax-text-editor-color-trigger{display:inline-flex;align-items:center;gap:calc(var(--spacing, .25rem) * 1)}.ax-text-editor-color-badge{pointer-events:none;box-shadow:inset 0 0 0 1px currentColor}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-color-badge{box-shadow:inset 0 0 0 1px color-mix(in oklab,currentColor 25%,transparent)}}.ax-text-editor-color-palette{width:calc(var(--spacing, .25rem) * 72);max-width:min(18rem,calc(100vw - 2rem));padding:calc(var(--spacing, .25rem) * 2)}@media(min-width:48rem){.ax-text-editor-color-palette{width:calc(var(--spacing, .25rem) * 80)}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXDropdownButtonComponent, selector: "ax-dropdown-button", inputs: ["disabled", "size", "text", "selected", "color", "look", "type", "mode", "iconOnly"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "component", type: AXColorPaletteComponent, selector: "ax-color-palette", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange"] }, { kind: "component", type: AXColorPalettePickerComponent, selector: "ax-color-palette-picker" }, { kind: "component", type: AXColorPaletteSwatchesComponent, selector: "ax-color-palette-swatches, ax-color-palette-favorite", inputs: ["colors"] }, { kind: "component", type: AXColorPaletteInputComponent, selector: "ax-color-palette-input" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1014
+ }
1015
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorColorsComponent, decorators: [{
1016
+ type: Component,
1017
+ args: [{ selector: 'ax-text-editor-colors', template: `
1018
+ <ax-dropdown-button class="ax-sm" look="blank" mode="dropdown" [iconOnly]="true" [text]="i18n.tools.textColor">
1019
+ <ax-prefix class="ax-text-editor-color-trigger">
1020
+ <ax-icon class="ax-icon ax-icon-color-palette"></ax-icon>
1021
+ <ax-badge
1022
+ text=""
1023
+ class="ax-text-editor-color-badge"
1024
+ [look]="editorService.textColor() ? 'solid' : 'outline'"
1025
+ [style.background-color]="editorService.textColor()"
1026
+ ></ax-badge>
1027
+ </ax-prefix>
1028
+ <ax-color-palette
1029
+ class="ax-text-editor-color-palette"
1030
+ [ngModel]="editorService.textColor()"
1031
+ (ngModelChange)="setColor($event)"
1032
+ >
1033
+ <ax-color-palette-picker></ax-color-palette-picker>
1034
+ <ax-color-palette-swatches></ax-color-palette-swatches>
1035
+ <ax-color-palette-input></ax-color-palette-input>
1036
+ </ax-color-palette>
1037
+ </ax-dropdown-button>
1038
+
1039
+ <ax-dropdown-button class="ax-sm" look="blank" mode="dropdown" [iconOnly]="true" [text]="i18n.tools.highlight">
1040
+ <ax-prefix class="ax-text-editor-color-trigger">
1041
+ <ax-icon class="ax-icon ax-icon-highlight"></ax-icon>
1042
+ <ax-badge
1043
+ text=""
1044
+ class="ax-text-editor-color-badge"
1045
+ [look]="editorService.highlightColor() ? 'solid' : 'outline'"
1046
+ [style.background-color]="editorService.highlightColor()"
1047
+ ></ax-badge>
1048
+ </ax-prefix>
1049
+ <ax-color-palette
1050
+ class="ax-text-editor-color-palette"
1051
+ [ngModel]="editorService.highlightColor()"
1052
+ (ngModelChange)="setHighlight($event)"
1053
+ >
1054
+ <ax-color-palette-picker></ax-color-palette-picker>
1055
+ <ax-color-palette-swatches></ax-color-palette-swatches>
1056
+ <ax-color-palette-input></ax-color-palette-input>
1057
+ </ax-color-palette>
1058
+ </ax-dropdown-button>
1059
+ `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
1060
+ AXDropdownButtonComponent,
1061
+ AXDecoratorGenericComponent,
1062
+ AXDecoratorIconComponent,
1063
+ AXBadgeComponent,
1064
+ AXColorPaletteComponent,
1065
+ AXColorPalettePickerComponent,
1066
+ AXColorPaletteSwatchesComponent,
1067
+ AXColorPaletteInputComponent,
1068
+ FormsModule,
1069
+ ], providers: [
1070
+ { provide: AXComponent, useExisting: AXTextEditorColorsComponent },
1071
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorColorsComponent },
1072
+ ], styles: ["@layer components{ax-text-editor-colors{position:relative;z-index:20;display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 1)}.ax-text-editor-color-trigger{display:inline-flex;align-items:center;gap:calc(var(--spacing, .25rem) * 1)}.ax-text-editor-color-badge{pointer-events:none;box-shadow:inset 0 0 0 1px currentColor}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-color-badge{box-shadow:inset 0 0 0 1px color-mix(in oklab,currentColor 25%,transparent)}}.ax-text-editor-color-palette{width:calc(var(--spacing, .25rem) * 72);max-width:min(18rem,calc(100vw - 2rem));padding:calc(var(--spacing, .25rem) * 2)}@media(min-width:48rem){.ax-text-editor-color-palette{width:calc(var(--spacing, .25rem) * 80)}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
1073
+ }] });
1074
+
1075
+ class AXTextEditorFontStyleComponent extends AXTextEditorSlot {
1076
+ constructor() {
1077
+ super(...arguments);
1078
+ this.i18n = AX_TEXT_EDITOR_I18N;
1079
+ }
1080
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorFontStyleComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1081
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorFontStyleComponent, isStandalone: true, selector: "ax-text-editor-font-style", providers: [
1082
+ { provide: AXComponent, useExisting: AXTextEditorFontStyleComponent },
1083
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorFontStyleComponent },
1084
+ ], usesInheritance: true, ngImport: i0, template: `
1085
+ <ax-text-editor-command command="bold" icon="ax-icon-bold" [label]="i18n.tools.bold" />
1086
+ <ax-text-editor-command command="italic" icon="ax-icon-italic" [label]="i18n.tools.italic" />
1087
+ <ax-text-editor-command command="underline" icon="ax-icon-under-line" [label]="i18n.tools.underline" />
1088
+ <ax-text-editor-command command="strike" icon="ax-icon-strike" [label]="i18n.tools.strike" />
1089
+ <ax-text-editor-command command="code" icon="ax-icon-code" [label]="i18n.tools.code" />
1090
+ `, isInline: true, dependencies: [{ kind: "component", type: AXTextEditorCommandComponent, selector: "ax-text-editor-command", inputs: ["command", "attrs", "icon", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1091
+ }
1092
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorFontStyleComponent, decorators: [{
1093
+ type: Component,
1094
+ args: [{
1095
+ selector: 'ax-text-editor-font-style',
1096
+ template: `
1097
+ <ax-text-editor-command command="bold" icon="ax-icon-bold" [label]="i18n.tools.bold" />
1098
+ <ax-text-editor-command command="italic" icon="ax-icon-italic" [label]="i18n.tools.italic" />
1099
+ <ax-text-editor-command command="underline" icon="ax-icon-under-line" [label]="i18n.tools.underline" />
1100
+ <ax-text-editor-command command="strike" icon="ax-icon-strike" [label]="i18n.tools.strike" />
1101
+ <ax-text-editor-command command="code" icon="ax-icon-code" [label]="i18n.tools.code" />
1102
+ `,
1103
+ changeDetection: ChangeDetectionStrategy.OnPush,
1104
+ encapsulation: ViewEncapsulation.None,
1105
+ imports: [AXTextEditorCommandComponent],
1106
+ providers: [
1107
+ { provide: AXComponent, useExisting: AXTextEditorFontStyleComponent },
1108
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorFontStyleComponent },
1109
+ ],
1110
+ }]
1111
+ }] });
1112
+
1113
+ class AXTextEditorHeadingComponent extends AXTextEditorSlot {
1114
+ constructor() {
1115
+ super(...arguments);
1116
+ this.editorService = inject(AXTextEditorService);
1117
+ this.i18n = AX_TEXT_EDITOR_I18N;
1118
+ this.editorReady = computed(() => this.editorService.editor() != null, /* @ts-ignore */
1119
+ ...(ngDevMode ? [{ debugName: "editorReady" }] : /* istanbul ignore next */ []));
1120
+ this.isParagraphSelected = computed(() => this.editorService.isActive('paragraph'), /* @ts-ignore */
1121
+ ...(ngDevMode ? [{ debugName: "isParagraphSelected" }] : /* istanbul ignore next */ []));
1122
+ this.isH1 = computed(() => this.editorService.isActive('heading', { level: 1 }), /* @ts-ignore */
1123
+ ...(ngDevMode ? [{ debugName: "isH1" }] : /* istanbul ignore next */ []));
1124
+ this.isH2 = computed(() => this.editorService.isActive('heading', { level: 2 }), /* @ts-ignore */
1125
+ ...(ngDevMode ? [{ debugName: "isH2" }] : /* istanbul ignore next */ []));
1126
+ this.isH3 = computed(() => this.editorService.isActive('heading', { level: 3 }), /* @ts-ignore */
1127
+ ...(ngDevMode ? [{ debugName: "isH3" }] : /* istanbul ignore next */ []));
1128
+ this.currentLabel = computed(() => {
1129
+ if (this.isH1())
1130
+ return this.i18n.blocks.heading1;
1131
+ if (this.isH2())
1132
+ return this.i18n.blocks.heading2;
1133
+ if (this.isH3())
1134
+ return this.i18n.blocks.heading3;
1135
+ return this.i18n.blocks.paragraph;
1136
+ }, /* @ts-ignore */
1137
+ ...(ngDevMode ? [{ debugName: "currentLabel" }] : /* istanbul ignore next */ []));
1138
+ }
1139
+ onSelect(event) {
1140
+ const data = (event.data ?? {});
1141
+ const level = Number(data.level);
1142
+ if (level === 1 || level === 2 || level === 3) {
1143
+ this.editorService.run('heading', { level });
1144
+ }
1145
+ else {
1146
+ this.editorService.run('paragraph');
1147
+ }
1148
+ setTimeout(() => this.editorService.focus());
1149
+ }
1150
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorHeadingComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1151
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorHeadingComponent, isStandalone: true, selector: "ax-text-editor-heading", providers: [
1152
+ { provide: AXComponent, useExisting: AXTextEditorHeadingComponent },
1153
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorHeadingComponent },
1154
+ ], usesInheritance: true, ngImport: i0, template: `
1155
+ <ax-dropdown-button
1156
+ class="ax-sm"
1157
+ look="blank"
1158
+ mode="dropdown"
1159
+ [iconOnly]="true"
1160
+ [text]="i18n.blocks.paragraph"
1161
+ [disabled]="!editorReady()"
1162
+ [attr.title]="currentLabel() | translate | async"
1163
+ >
1164
+ <ax-prefix>
1165
+ <ax-icon class="ax-icon ax-icon-paragraph"></ax-icon>
1166
+ </ax-prefix>
1167
+ <ax-button-item-list (mousedown)="$event.preventDefault()" (onItemClick)="onSelect($event)">
1168
+ <ax-button-item [text]="i18n.blocks.paragraph" [data]="{ level: null }" [selected]="isParagraphSelected()"></ax-button-item>
1169
+ <ax-button-item [text]="i18n.blocks.heading1" [data]="{ level: 1 }" [selected]="isH1()"></ax-button-item>
1170
+ <ax-button-item [text]="i18n.blocks.heading2" [data]="{ level: 2 }" [selected]="isH2()"></ax-button-item>
1171
+ <ax-button-item [text]="i18n.blocks.heading3" [data]="{ level: 3 }" [selected]="isH3()"></ax-button-item>
1172
+ </ax-button-item-list>
1173
+ </ax-dropdown-button>
1174
+ <ax-text-editor-command command="direction" [attrs]="{ direction: 'ltr' }" icon="ax-icon-ltr" [label]="i18n.tools.ltr" />
1175
+ <ax-text-editor-command command="direction" [attrs]="{ direction: 'rtl' }" icon="ax-icon-rtl" [label]="i18n.tools.rtl" />
1176
+ `, isInline: true, styles: ["ax-text-editor-heading .ax-icon-rtl{transform:scaleX(-1)}\n"], dependencies: [{ kind: "component", type: AXDropdownButtonComponent, selector: "ax-dropdown-button", inputs: ["disabled", "size", "text", "selected", "color", "look", "type", "mode", "iconOnly"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "component", type: AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items", "closeParentOnClick", "lockOnLoading"], outputs: ["onItemClick"] }, { kind: "component", type: AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: AXTextEditorCommandComponent, selector: "ax-text-editor-command", inputs: ["command", "attrs", "icon", "label"] }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1177
+ }
1178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorHeadingComponent, decorators: [{
1179
+ type: Component,
1180
+ args: [{ selector: 'ax-text-editor-heading', template: `
1181
+ <ax-dropdown-button
1182
+ class="ax-sm"
1183
+ look="blank"
1184
+ mode="dropdown"
1185
+ [iconOnly]="true"
1186
+ [text]="i18n.blocks.paragraph"
1187
+ [disabled]="!editorReady()"
1188
+ [attr.title]="currentLabel() | translate | async"
1189
+ >
1190
+ <ax-prefix>
1191
+ <ax-icon class="ax-icon ax-icon-paragraph"></ax-icon>
1192
+ </ax-prefix>
1193
+ <ax-button-item-list (mousedown)="$event.preventDefault()" (onItemClick)="onSelect($event)">
1194
+ <ax-button-item [text]="i18n.blocks.paragraph" [data]="{ level: null }" [selected]="isParagraphSelected()"></ax-button-item>
1195
+ <ax-button-item [text]="i18n.blocks.heading1" [data]="{ level: 1 }" [selected]="isH1()"></ax-button-item>
1196
+ <ax-button-item [text]="i18n.blocks.heading2" [data]="{ level: 2 }" [selected]="isH2()"></ax-button-item>
1197
+ <ax-button-item [text]="i18n.blocks.heading3" [data]="{ level: 3 }" [selected]="isH3()"></ax-button-item>
1198
+ </ax-button-item-list>
1199
+ </ax-dropdown-button>
1200
+ <ax-text-editor-command command="direction" [attrs]="{ direction: 'ltr' }" icon="ax-icon-ltr" [label]="i18n.tools.ltr" />
1201
+ <ax-text-editor-command command="direction" [attrs]="{ direction: 'rtl' }" icon="ax-icon-rtl" [label]="i18n.tools.rtl" />
1202
+ `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
1203
+ AXDropdownButtonComponent,
1204
+ AXButtonItemListComponent,
1205
+ AXButtonItemComponent,
1206
+ AXDecoratorIconComponent,
1207
+ AXDecoratorGenericComponent,
1208
+ AXTextEditorCommandComponent,
1209
+ AXTranslatorPipe,
1210
+ AsyncPipe,
1211
+ ], providers: [
1212
+ { provide: AXComponent, useExisting: AXTextEditorHeadingComponent },
1213
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorHeadingComponent },
1214
+ ], styles: ["ax-text-editor-heading .ax-icon-rtl{transform:scaleX(-1)}\n"] }]
1215
+ }] });
1216
+
1217
+ class AXTextEditorHistoryComponent extends AXTextEditorSlot {
1218
+ constructor() {
1219
+ super(...arguments);
1220
+ this.i18n = AX_TEXT_EDITOR_I18N;
1221
+ }
1222
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorHistoryComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1223
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorHistoryComponent, isStandalone: true, selector: "ax-text-editor-history", providers: [
1224
+ { provide: AXComponent, useExisting: AXTextEditorHistoryComponent },
1225
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorHistoryComponent },
1226
+ ], usesInheritance: true, ngImport: i0, template: `
1227
+ <ax-text-editor-command command="undo" icon="ax-icon-undo" [label]="i18n.tools.undo" />
1228
+ <ax-text-editor-command command="redo" icon="ax-icon-redo" [label]="i18n.tools.redo" />
1229
+ `, isInline: true, dependencies: [{ kind: "component", type: AXTextEditorCommandComponent, selector: "ax-text-editor-command", inputs: ["command", "attrs", "icon", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1230
+ }
1231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorHistoryComponent, decorators: [{
1232
+ type: Component,
1233
+ args: [{
1234
+ selector: 'ax-text-editor-history',
1235
+ template: `
1236
+ <ax-text-editor-command command="undo" icon="ax-icon-undo" [label]="i18n.tools.undo" />
1237
+ <ax-text-editor-command command="redo" icon="ax-icon-redo" [label]="i18n.tools.redo" />
1238
+ `,
1239
+ changeDetection: ChangeDetectionStrategy.OnPush,
1240
+ encapsulation: ViewEncapsulation.None,
1241
+ imports: [AXTextEditorCommandComponent],
1242
+ providers: [
1243
+ { provide: AXComponent, useExisting: AXTextEditorHistoryComponent },
1244
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorHistoryComponent },
1245
+ ],
1246
+ }]
1247
+ }] });
1248
+
1249
+ class AXTextEditorLinkComponent extends AXTextEditorSlot {
1250
+ constructor() {
1251
+ super(...arguments);
1252
+ this.editorService = inject(AXTextEditorService);
1253
+ this.i18n = AX_TEXT_EDITOR_I18N;
1254
+ this.dropdown = viewChild('dropdown', /* @ts-ignore */
1255
+ ...(ngDevMode ? [{ debugName: "dropdown" }] : /* istanbul ignore next */ []));
1256
+ this.href = signal('', /* @ts-ignore */
1257
+ ...(ngDevMode ? [{ debugName: "href" }] : /* istanbul ignore next */ []));
1258
+ this.active = computed(() => this.editorService.isActive('link'), /* @ts-ignore */
1259
+ ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
1260
+ this.savedFrom = 0;
1261
+ this.savedTo = 0;
1262
+ }
1263
+ syncHref() {
1264
+ const editor = this.editorService.editor();
1265
+ this.savedFrom = editor?.state.selection.from ?? 0;
1266
+ this.savedTo = editor?.state.selection.to ?? 0;
1267
+ this.href.set(editor?.getAttributes('link')?.['href'] ?? '');
1268
+ }
1269
+ apply() {
1270
+ const editor = this.editorService.editor();
1271
+ const value = this.href().trim();
1272
+ if (!value) {
1273
+ this.remove();
1274
+ return;
1275
+ }
1276
+ editor?.chain().setTextSelection({ from: this.savedFrom, to: this.savedTo }).run();
1277
+ this.editorService.run('link', { href: value });
1278
+ this.dropdown()?.close();
1279
+ }
1280
+ remove() {
1281
+ const editor = this.editorService.editor();
1282
+ editor?.chain().setTextSelection({ from: this.savedFrom, to: this.savedTo }).run();
1283
+ this.editorService.run('unlink');
1284
+ this.href.set('');
1285
+ this.dropdown()?.close();
1286
+ }
1287
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorLinkComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1288
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", type: AXTextEditorLinkComponent, isStandalone: true, selector: "ax-text-editor-link", providers: [
1289
+ { provide: AXComponent, useExisting: AXTextEditorLinkComponent },
1290
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorLinkComponent },
1291
+ ], viewQueries: [{ propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
1292
+ <ax-dropdown-button
1293
+ #dropdown
1294
+ class="ax-sm"
1295
+ look="blank"
1296
+ mode="dropdown"
1297
+ [iconOnly]="true"
1298
+ [text]="i18n.tools.link"
1299
+ [selected]="active()"
1300
+ [attr.title]="i18n.tools.link"
1301
+ (onClick)="syncHref()"
1302
+ >
1303
+ <ax-prefix>
1304
+ <ax-icon class="ax-icon ax-icon-link"></ax-icon>
1305
+ </ax-prefix>
1306
+ <div class="ax-text-editor-link-panel" (click)="$event.stopPropagation()" (mousedown)="$event.stopPropagation()">
1307
+ <input
1308
+ class="ax-text-editor-link-input"
1309
+ type="url"
1310
+ placeholder="https://"
1311
+ [ngModel]="href()"
1312
+ (ngModelChange)="href.set($event)"
1313
+ (keydown.enter)="apply(); $event.preventDefault()"
1314
+ />
1315
+ <ax-button class="ax-xs" look="solid" color="primary" [text]="i18n.insert.apply" (onClick)="apply()"></ax-button>
1316
+ <ax-button class="ax-xs" look="blank" [text]="i18n.insert.remove" (onClick)="remove()"></ax-button>
1317
+ </div>
1318
+ </ax-dropdown-button>
1319
+ `, isInline: true, styles: ["@layer properties;@layer components{.ax-text-editor-link-panel{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 1);border-radius:var(--ax-sys-border-radius);background-color:rgba(var(--ax-sys-color-lightest-surface));padding:calc(var(--spacing, .25rem) * 2);--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ax-text-editor-link-input{min-width:calc(var(--spacing, .25rem) * 40);border-radius:var(--ax-sys-border-radius);border-style:var(--tw-border-style);border-width:1px;border-color:rgba(var(--ax-sys-color-border-lightest-surface));background-color:transparent;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:calc(var(--spacing, .25rem) * 1);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-outline-style: none;outline-style:none}}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-border-style: solid}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXDropdownButtonComponent, selector: "ax-dropdown-button", inputs: ["disabled", "size", "text", "selected", "color", "look", "type", "mode", "iconOnly"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1320
+ }
1321
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorLinkComponent, decorators: [{
1322
+ type: Component,
1323
+ args: [{ selector: 'ax-text-editor-link', template: `
1324
+ <ax-dropdown-button
1325
+ #dropdown
1326
+ class="ax-sm"
1327
+ look="blank"
1328
+ mode="dropdown"
1329
+ [iconOnly]="true"
1330
+ [text]="i18n.tools.link"
1331
+ [selected]="active()"
1332
+ [attr.title]="i18n.tools.link"
1333
+ (onClick)="syncHref()"
1334
+ >
1335
+ <ax-prefix>
1336
+ <ax-icon class="ax-icon ax-icon-link"></ax-icon>
1337
+ </ax-prefix>
1338
+ <div class="ax-text-editor-link-panel" (click)="$event.stopPropagation()" (mousedown)="$event.stopPropagation()">
1339
+ <input
1340
+ class="ax-text-editor-link-input"
1341
+ type="url"
1342
+ placeholder="https://"
1343
+ [ngModel]="href()"
1344
+ (ngModelChange)="href.set($event)"
1345
+ (keydown.enter)="apply(); $event.preventDefault()"
1346
+ />
1347
+ <ax-button class="ax-xs" look="solid" color="primary" [text]="i18n.insert.apply" (onClick)="apply()"></ax-button>
1348
+ <ax-button class="ax-xs" look="blank" [text]="i18n.insert.remove" (onClick)="remove()"></ax-button>
1349
+ </div>
1350
+ </ax-dropdown-button>
1351
+ `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
1352
+ AXDropdownButtonComponent,
1353
+ AXButtonComponent,
1354
+ AXDecoratorIconComponent,
1355
+ AXDecoratorGenericComponent,
1356
+ FormsModule,
1357
+ ], providers: [
1358
+ { provide: AXComponent, useExisting: AXTextEditorLinkComponent },
1359
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorLinkComponent },
1360
+ ], styles: ["@layer properties;@layer components{.ax-text-editor-link-panel{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 1);border-radius:var(--ax-sys-border-radius);background-color:rgba(var(--ax-sys-color-lightest-surface));padding:calc(var(--spacing, .25rem) * 2);--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ax-text-editor-link-input{min-width:calc(var(--spacing, .25rem) * 40);border-radius:var(--ax-sys-border-radius);border-style:var(--tw-border-style);border-width:1px;border-color:rgba(var(--ax-sys-color-border-lightest-surface));background-color:transparent;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:calc(var(--spacing, .25rem) * 1);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-outline-style: none;outline-style:none}}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-border-style: solid}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
1361
+ }], propDecorators: { dropdown: [{ type: i0.ViewChild, args: ['dropdown', { isSignal: true }] }] } });
1362
+
1363
+ class AXTextEditorListComponent extends AXTextEditorSlot {
1364
+ constructor() {
1365
+ super(...arguments);
1366
+ this.i18n = AX_TEXT_EDITOR_I18N;
1367
+ }
1368
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1369
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorListComponent, isStandalone: true, selector: "ax-text-editor-list", providers: [
1370
+ { provide: AXComponent, useExisting: AXTextEditorListComponent },
1371
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorListComponent },
1372
+ ], usesInheritance: true, ngImport: i0, template: `
1373
+ <ax-text-editor-command command="bulletList" icon="ax-icon-un-order-list" [label]="i18n.tools.bulletList" />
1374
+ <ax-text-editor-command command="orderedList" icon="ax-icon-order-list" [label]="i18n.tools.orderedList" />
1375
+ `, isInline: true, dependencies: [{ kind: "component", type: AXTextEditorCommandComponent, selector: "ax-text-editor-command", inputs: ["command", "attrs", "icon", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1376
+ }
1377
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorListComponent, decorators: [{
1378
+ type: Component,
1379
+ args: [{
1380
+ selector: 'ax-text-editor-list',
1381
+ template: `
1382
+ <ax-text-editor-command command="bulletList" icon="ax-icon-un-order-list" [label]="i18n.tools.bulletList" />
1383
+ <ax-text-editor-command command="orderedList" icon="ax-icon-order-list" [label]="i18n.tools.orderedList" />
1384
+ `,
1385
+ changeDetection: ChangeDetectionStrategy.OnPush,
1386
+ encapsulation: ViewEncapsulation.None,
1387
+ imports: [AXTextEditorCommandComponent],
1388
+ providers: [
1389
+ { provide: AXComponent, useExisting: AXTextEditorListComponent },
1390
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorListComponent },
1391
+ ],
1392
+ }]
1393
+ }] });
1394
+
1395
+ class AXTextEditorTableComponent extends AXTextEditorSlot {
1396
+ constructor() {
1397
+ super(...arguments);
1398
+ this.editorService = inject(AXTextEditorService);
1399
+ this.dropdown = viewChild('dropdown', /* @ts-ignore */
1400
+ ...(ngDevMode ? [{ debugName: "dropdown" }] : /* istanbul ignore next */ []));
1401
+ this.i18n = AX_TEXT_EDITOR_I18N;
1402
+ this.cells = [1, 2, 3, 4, 5, 6, 7, 8];
1403
+ this.hover = signal({ rows: 0, cols: 0 }, /* @ts-ignore */
1404
+ ...(ngDevMode ? [{ debugName: "hover" }] : /* istanbul ignore next */ []));
1405
+ this.sizeLabel = computed(() => {
1406
+ const { rows, cols } = this.hover();
1407
+ return rows && cols ? `${rows} × ${cols}` : this.i18n.table.insert;
1408
+ }, /* @ts-ignore */
1409
+ ...(ngDevMode ? [{ debugName: "sizeLabel" }] : /* istanbul ignore next */ []));
1410
+ }
1411
+ isHighlighted(row, col) {
1412
+ const hover = this.hover();
1413
+ return hover.rows > 0 && hover.cols > 0 && row <= hover.rows && col <= hover.cols;
1414
+ }
1415
+ insert(rows, cols) {
1416
+ this.editorService.run('insertTable', { rows, cols, withHeaderRow: false });
1417
+ this.dropdown()?.close();
1418
+ }
1419
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1420
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: AXTextEditorTableComponent, isStandalone: true, selector: "ax-text-editor-table", providers: [
1421
+ { provide: AXComponent, useExisting: AXTextEditorTableComponent },
1422
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorTableComponent },
1423
+ ], viewQueries: [{ propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
1424
+ <ax-dropdown-button #dropdown class="ax-sm" look="blank" mode="dropdown" [iconOnly]="true" [text]="i18n.table.insert">
1425
+ <ax-prefix>
1426
+ <ax-icon class="ax-icon ax-icon-table"></ax-icon>
1427
+ </ax-prefix>
1428
+ <div class="ax-text-editor-table-picker" (mousedown)="$event.preventDefault()" (mouseleave)="hover.set({ rows: 0, cols: 0 })">
1429
+ <div class="ax-text-editor-table-grid">
1430
+ @for (row of cells; track row) {
1431
+ @for (col of cells; track col) {
1432
+ <button
1433
+ type="button"
1434
+ class="ax-text-editor-table-cell"
1435
+ [class.ax-state-active]="isHighlighted(row, col)"
1436
+ (mouseenter)="hover.set({ rows: row, cols: col })"
1437
+ (click)="insert(row, col)"
1438
+ ></button>
1439
+ }
1440
+ }
1441
+ </div>
1442
+ <div class="ax-text-editor-table-size">{{ sizeLabel() | translate | async }}</div>
1443
+ </div>
1444
+ </ax-dropdown-button>
1445
+ `, isInline: true, styles: ["@layer properties;@layer components{.ax-text-editor-table-picker{min-width:calc(var(--spacing, .25rem) * 44);padding:calc(var(--spacing, .25rem) * 2)}.ax-text-editor-table-grid{display:grid;grid-template-columns:repeat(8,1.125rem);gap:.25rem}.ax-text-editor-table-cell{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4);border-radius:var(--radius-sm, .25rem);border-style:var(--tw-border-style);border-width:1px;border-color:rgba(var(--ax-sys-color-border-lightest-surface));background-color:rgba(var(--ax-sys-color-lightest-surface));padding:calc(var(--spacing, .25rem) * 0)}.ax-text-editor-table-cell.ax-state-active{border-color:var(--ax-sys-color-primary, #3b82f6);background:var(--ax-sys-color-primary, #3b82f6)}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-table-cell.ax-state-active{background:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 18%,white)}}.ax-text-editor-table-size{margin-top:calc(var(--spacing, .25rem) * 2);text-align:center;font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:currentColor}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-table-size{color:color-mix(in oklab,currentColor 70%,transparent)}}}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXDropdownButtonComponent, selector: "ax-dropdown-button", inputs: ["disabled", "size", "text", "selected", "color", "look", "type", "mode", "iconOnly"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1446
+ }
1447
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorTableComponent, decorators: [{
1448
+ type: Component,
1449
+ args: [{ selector: 'ax-text-editor-table', template: `
1450
+ <ax-dropdown-button #dropdown class="ax-sm" look="blank" mode="dropdown" [iconOnly]="true" [text]="i18n.table.insert">
1451
+ <ax-prefix>
1452
+ <ax-icon class="ax-icon ax-icon-table"></ax-icon>
1453
+ </ax-prefix>
1454
+ <div class="ax-text-editor-table-picker" (mousedown)="$event.preventDefault()" (mouseleave)="hover.set({ rows: 0, cols: 0 })">
1455
+ <div class="ax-text-editor-table-grid">
1456
+ @for (row of cells; track row) {
1457
+ @for (col of cells; track col) {
1458
+ <button
1459
+ type="button"
1460
+ class="ax-text-editor-table-cell"
1461
+ [class.ax-state-active]="isHighlighted(row, col)"
1462
+ (mouseenter)="hover.set({ rows: row, cols: col })"
1463
+ (click)="insert(row, col)"
1464
+ ></button>
1465
+ }
1466
+ }
1467
+ </div>
1468
+ <div class="ax-text-editor-table-size">{{ sizeLabel() | translate | async }}</div>
1469
+ </div>
1470
+ </ax-dropdown-button>
1471
+ `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [AXDropdownButtonComponent, AXDecoratorIconComponent, AXDecoratorGenericComponent, AXTranslatorPipe, AsyncPipe], providers: [
1472
+ { provide: AXComponent, useExisting: AXTextEditorTableComponent },
1473
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorTableComponent },
1474
+ ], styles: ["@layer properties;@layer components{.ax-text-editor-table-picker{min-width:calc(var(--spacing, .25rem) * 44);padding:calc(var(--spacing, .25rem) * 2)}.ax-text-editor-table-grid{display:grid;grid-template-columns:repeat(8,1.125rem);gap:.25rem}.ax-text-editor-table-cell{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4);border-radius:var(--radius-sm, .25rem);border-style:var(--tw-border-style);border-width:1px;border-color:rgba(var(--ax-sys-color-border-lightest-surface));background-color:rgba(var(--ax-sys-color-lightest-surface));padding:calc(var(--spacing, .25rem) * 0)}.ax-text-editor-table-cell.ax-state-active{border-color:var(--ax-sys-color-primary, #3b82f6);background:var(--ax-sys-color-primary, #3b82f6)}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-table-cell.ax-state-active{background:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 18%,white)}}.ax-text-editor-table-size{margin-top:calc(var(--spacing, .25rem) * 2);text-align:center;font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:currentColor}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-table-size{color:color-mix(in oklab,currentColor 70%,transparent)}}}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
1475
+ }], propDecorators: { dropdown: [{ type: i0.ViewChild, args: ['dropdown', { isSignal: true }] }] } });
1476
+
1477
+ class AXTextEditorScriptComponent extends AXTextEditorSlot {
1478
+ constructor() {
1479
+ super(...arguments);
1480
+ this.i18n = AX_TEXT_EDITOR_I18N;
1481
+ }
1482
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorScriptComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1483
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorScriptComponent, isStandalone: true, selector: "ax-text-editor-script", providers: [
1484
+ { provide: AXComponent, useExisting: AXTextEditorScriptComponent },
1485
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorScriptComponent },
1486
+ ], usesInheritance: true, ngImport: i0, template: `
1487
+ <ax-text-editor-command command="superscript" icon="ax-icon-superscript" [label]="i18n.tools.superscript" />
1488
+ <ax-text-editor-command command="subscript" icon="ax-icon-subscript" [label]="i18n.tools.subscript" />
1489
+ `, isInline: true, dependencies: [{ kind: "component", type: AXTextEditorCommandComponent, selector: "ax-text-editor-command", inputs: ["command", "attrs", "icon", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1490
+ }
1491
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorScriptComponent, decorators: [{
1492
+ type: Component,
1493
+ args: [{
1494
+ selector: 'ax-text-editor-script',
1495
+ template: `
1496
+ <ax-text-editor-command command="superscript" icon="ax-icon-superscript" [label]="i18n.tools.superscript" />
1497
+ <ax-text-editor-command command="subscript" icon="ax-icon-subscript" [label]="i18n.tools.subscript" />
1498
+ `,
1499
+ changeDetection: ChangeDetectionStrategy.OnPush,
1500
+ encapsulation: ViewEncapsulation.None,
1501
+ imports: [AXTextEditorCommandComponent],
1502
+ providers: [
1503
+ { provide: AXComponent, useExisting: AXTextEditorScriptComponent },
1504
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorScriptComponent },
1505
+ ],
1506
+ }]
1507
+ }] });
1508
+
1509
+ class AXTextEditorZoomComponent extends AXTextEditorSlot {
1510
+ constructor() {
1511
+ super(...arguments);
1512
+ this.editorService = inject(AXTextEditorService);
1513
+ this.i18n = AX_TEXT_EDITOR_I18N;
1514
+ this.dropdown = viewChild('dropdown', /* @ts-ignore */
1515
+ ...(ngDevMode ? [{ debugName: "dropdown" }] : /* istanbul ignore next */ []));
1516
+ this.presets = AX_TEXT_EDITOR_ZOOM_PRESETS;
1517
+ this.draft = signal('100', /* @ts-ignore */
1518
+ ...(ngDevMode ? [{ debugName: "draft" }] : /* istanbul ignore next */ []));
1519
+ this.zoomLabel = computed(() => `${this.editorService.zoom()}%`, /* @ts-ignore */
1520
+ ...(ngDevMode ? [{ debugName: "zoomLabel" }] : /* istanbul ignore next */ []));
1521
+ this.canZoomOut = computed(() => this.editorService.zoom() > AX_TEXT_EDITOR_ZOOM_MIN, /* @ts-ignore */
1522
+ ...(ngDevMode ? [{ debugName: "canZoomOut" }] : /* istanbul ignore next */ []));
1523
+ this.canZoomIn = computed(() => this.editorService.zoom() < AX_TEXT_EDITOR_ZOOM_MAX, /* @ts-ignore */
1524
+ ...(ngDevMode ? [{ debugName: "canZoomIn" }] : /* istanbul ignore next */ []));
1525
+ }
1526
+ syncDraft() {
1527
+ this.draft.set(String(this.editorService.zoom()));
1528
+ }
1529
+ onDraftInput(event) {
1530
+ this.draft.set(event.target.value);
1531
+ }
1532
+ commitDraft() {
1533
+ const next = Number.parseInt(this.draft(), 10);
1534
+ if (Number.isFinite(next))
1535
+ this.editorService.setZoom(next);
1536
+ this.dropdown()?.close();
1537
+ }
1538
+ applyPreset(value) {
1539
+ this.editorService.setZoom(value);
1540
+ this.dropdown()?.close();
1541
+ }
1542
+ fitToPage() {
1543
+ this.editorService.fitToPage();
1544
+ this.dropdown()?.close();
1545
+ }
1546
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorZoomComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1547
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: AXTextEditorZoomComponent, isStandalone: true, selector: "ax-text-editor-zoom", host: { classAttribute: "ax-text-editor-zoom" }, providers: [
1548
+ { provide: AXComponent, useExisting: AXTextEditorZoomComponent },
1549
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorZoomComponent },
1550
+ ], viewQueries: [{ propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
1551
+ <ax-button
1552
+ class="ax-sm"
1553
+ look="blank"
1554
+ [iconOnly]="true"
1555
+ [text]="i18n.tools.zoomOut"
1556
+ [disabled]="!canZoomOut()"
1557
+ (onClick)="editorService.zoomOut()"
1558
+ >
1559
+ <ax-icon class="fa-regular fa-minus"></ax-icon>
1560
+ </ax-button>
1561
+ <ax-dropdown-button
1562
+ #dropdown
1563
+ class="ax-sm ax-text-editor-zoom-value"
1564
+ look="blank"
1565
+ mode="dropdown"
1566
+ [text]="zoomLabel()"
1567
+ (onClick)="syncDraft()"
1568
+ >
1569
+ <div class="ax-text-editor-zoom-panel" (click)="$event.stopPropagation()" (mousedown)="$event.stopPropagation()">
1570
+ <input
1571
+ class="ax-text-editor-zoom-input"
1572
+ type="text"
1573
+ inputmode="numeric"
1574
+ [value]="draft()"
1575
+ (input)="onDraftInput($event)"
1576
+ (keydown.enter)="commitDraft(); $event.preventDefault()"
1577
+ />
1578
+ <ax-button-item-list>
1579
+ <ax-button-item [text]="i18n.zoom.fit" (onClick)="fitToPage()">
1580
+ <ax-prefix>
1581
+ <ax-icon class="fa-regular fa-expand"></ax-icon>
1582
+ </ax-prefix>
1583
+ </ax-button-item>
1584
+ @for (preset of presets; track preset) {
1585
+ <ax-button-item
1586
+ [text]="preset + '%'"
1587
+ [selected]="editorService.zoom() === preset"
1588
+ (onClick)="applyPreset(preset)"
1589
+ ></ax-button-item>
1590
+ }
1591
+ </ax-button-item-list>
1592
+ </div>
1593
+ </ax-dropdown-button>
1594
+ <ax-button
1595
+ class="ax-sm"
1596
+ look="blank"
1597
+ [iconOnly]="true"
1598
+ [text]="i18n.tools.zoomIn"
1599
+ [disabled]="!canZoomIn()"
1600
+ (onClick)="editorService.zoomIn()"
1601
+ >
1602
+ <ax-icon class="fa-regular fa-plus"></ax-icon>
1603
+ </ax-button>
1604
+ `, isInline: true, styles: ["@layer properties;@layer components{ax-text-editor-zoom{display:inline-flex;align-items:center}.ax-text-editor-zoom-value{min-width:calc(var(--spacing, .25rem) * 16)}.ax-text-editor-zoom-value ax-suffix,ax-text-editor-zoom ax-dropdown-button ax-suffix{display:none!important}.ax-text-editor-zoom-panel{display:flex;min-width:calc(var(--spacing, .25rem) * 44);flex-direction:column;gap:calc(var(--spacing, .25rem) * 1);border-radius:var(--ax-sys-border-radius);background-color:rgba(var(--ax-sys-color-lightest-surface));padding:calc(var(--spacing, .25rem) * 2);--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ax-text-editor-zoom-input{width:100%;border-radius:var(--ax-sys-border-radius);border-style:var(--tw-border-style);border-width:1px;border-color:rgba(var(--ax-sys-color-border-lightest-surface));background-color:transparent;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:calc(var(--spacing, .25rem) * 1);text-align:center;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-outline-style: none;outline-style:none}.ax-text-editor-zoom-input:focus{border-color:var(--ax-sys-color-primary, #8b5cf6);box-shadow:0 0 0 2px var(--ax-sys-color-primary, #8b5cf6)}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-zoom-input:focus{box-shadow:0 0 0 2px color-mix(in oklab,var(--ax-sys-color-primary, #8b5cf6) 35%,transparent)}}}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-border-style: solid}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: AXDropdownButtonComponent, selector: "ax-dropdown-button", inputs: ["disabled", "size", "text", "selected", "color", "look", "type", "mode", "iconOnly"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "component", type: AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items", "closeParentOnClick", "lockOnLoading"], outputs: ["onItemClick"] }, { kind: "component", type: AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1605
+ }
1606
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorZoomComponent, decorators: [{
1607
+ type: Component,
1608
+ args: [{ selector: 'ax-text-editor-zoom', template: `
1609
+ <ax-button
1610
+ class="ax-sm"
1611
+ look="blank"
1612
+ [iconOnly]="true"
1613
+ [text]="i18n.tools.zoomOut"
1614
+ [disabled]="!canZoomOut()"
1615
+ (onClick)="editorService.zoomOut()"
1616
+ >
1617
+ <ax-icon class="fa-regular fa-minus"></ax-icon>
1618
+ </ax-button>
1619
+ <ax-dropdown-button
1620
+ #dropdown
1621
+ class="ax-sm ax-text-editor-zoom-value"
1622
+ look="blank"
1623
+ mode="dropdown"
1624
+ [text]="zoomLabel()"
1625
+ (onClick)="syncDraft()"
1626
+ >
1627
+ <div class="ax-text-editor-zoom-panel" (click)="$event.stopPropagation()" (mousedown)="$event.stopPropagation()">
1628
+ <input
1629
+ class="ax-text-editor-zoom-input"
1630
+ type="text"
1631
+ inputmode="numeric"
1632
+ [value]="draft()"
1633
+ (input)="onDraftInput($event)"
1634
+ (keydown.enter)="commitDraft(); $event.preventDefault()"
1635
+ />
1636
+ <ax-button-item-list>
1637
+ <ax-button-item [text]="i18n.zoom.fit" (onClick)="fitToPage()">
1638
+ <ax-prefix>
1639
+ <ax-icon class="fa-regular fa-expand"></ax-icon>
1640
+ </ax-prefix>
1641
+ </ax-button-item>
1642
+ @for (preset of presets; track preset) {
1643
+ <ax-button-item
1644
+ [text]="preset + '%'"
1645
+ [selected]="editorService.zoom() === preset"
1646
+ (onClick)="applyPreset(preset)"
1647
+ ></ax-button-item>
1648
+ }
1649
+ </ax-button-item-list>
1650
+ </div>
1651
+ </ax-dropdown-button>
1652
+ <ax-button
1653
+ class="ax-sm"
1654
+ look="blank"
1655
+ [iconOnly]="true"
1656
+ [text]="i18n.tools.zoomIn"
1657
+ [disabled]="!canZoomIn()"
1658
+ (onClick)="editorService.zoomIn()"
1659
+ >
1660
+ <ax-icon class="fa-regular fa-plus"></ax-icon>
1661
+ </ax-button>
1662
+ `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
1663
+ class: 'ax-text-editor-zoom',
1664
+ }, imports: [
1665
+ AXButtonComponent,
1666
+ AXDropdownButtonComponent,
1667
+ AXButtonItemListComponent,
1668
+ AXButtonItemComponent,
1669
+ AXDecoratorIconComponent,
1670
+ AXDecoratorGenericComponent,
1671
+ ], providers: [
1672
+ { provide: AXComponent, useExisting: AXTextEditorZoomComponent },
1673
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorZoomComponent },
1674
+ ], styles: ["@layer properties;@layer components{ax-text-editor-zoom{display:inline-flex;align-items:center}.ax-text-editor-zoom-value{min-width:calc(var(--spacing, .25rem) * 16)}.ax-text-editor-zoom-value ax-suffix,ax-text-editor-zoom ax-dropdown-button ax-suffix{display:none!important}.ax-text-editor-zoom-panel{display:flex;min-width:calc(var(--spacing, .25rem) * 44);flex-direction:column;gap:calc(var(--spacing, .25rem) * 1);border-radius:var(--ax-sys-border-radius);background-color:rgba(var(--ax-sys-color-lightest-surface));padding:calc(var(--spacing, .25rem) * 2);--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ax-text-editor-zoom-input{width:100%;border-radius:var(--ax-sys-border-radius);border-style:var(--tw-border-style);border-width:1px;border-color:rgba(var(--ax-sys-color-border-lightest-surface));background-color:transparent;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:calc(var(--spacing, .25rem) * 1);text-align:center;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-outline-style: none;outline-style:none}.ax-text-editor-zoom-input:focus{border-color:var(--ax-sys-color-primary, #8b5cf6);box-shadow:0 0 0 2px var(--ax-sys-color-primary, #8b5cf6)}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-zoom-input:focus{box-shadow:0 0 0 2px color-mix(in oklab,var(--ax-sys-color-primary, #8b5cf6) 35%,transparent)}}}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-border-style: solid}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
1675
+ }], propDecorators: { dropdown: [{ type: i0.ViewChild, args: ['dropdown', { isSignal: true }] }] } });
1676
+
1677
+ class AXTextEditorFontSizeComponent extends AXTextEditorSlot {
1678
+ constructor() {
1679
+ super(...arguments);
1680
+ this.editorService = inject(AXTextEditorService);
1681
+ this.translation = inject(AXTranslationService);
1682
+ this.i18n = AX_TEXT_EDITOR_I18N;
1683
+ this.sizes = AX_TEXT_EDITOR_FONT_SIZES;
1684
+ this.dropdown = viewChild('dropdown', /* @ts-ignore */
1685
+ ...(ngDevMode ? [{ debugName: "dropdown" }] : /* istanbul ignore next */ []));
1686
+ this.currentSize = computed(() => {
1687
+ const raw = this.editorService.fontSize();
1688
+ if (!raw)
1689
+ return null;
1690
+ const parsed = Number.parseInt(raw, 10);
1691
+ return Number.isFinite(parsed) ? parsed : null;
1692
+ }, /* @ts-ignore */
1693
+ ...(ngDevMode ? [{ debugName: "currentSize" }] : /* istanbul ignore next */ []));
1694
+ this.sizeLabel = computed(() => {
1695
+ const size = this.currentSize();
1696
+ return size == null ? this.translation.translateSync(this.i18n.fontSize.default) : String(size);
1697
+ }, /* @ts-ignore */
1698
+ ...(ngDevMode ? [{ debugName: "sizeLabel" }] : /* istanbul ignore next */ []));
1699
+ }
1700
+ apply(size) {
1701
+ this.editorService.run('fontSize', size == null ? undefined : { size: `${size}px` });
1702
+ this.dropdown()?.close();
1703
+ }
1704
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorFontSizeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1705
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: AXTextEditorFontSizeComponent, isStandalone: true, selector: "ax-text-editor-font-size", providers: [
1706
+ { provide: AXComponent, useExisting: AXTextEditorFontSizeComponent },
1707
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorFontSizeComponent },
1708
+ ], viewQueries: [{ propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
1709
+ <ax-dropdown-button
1710
+ #dropdown
1711
+ class="ax-sm ax-text-editor-font-size"
1712
+ look="blank"
1713
+ mode="dropdown"
1714
+ [text]="sizeLabel()"
1715
+ [attr.title]="i18n.fontSize.label | translate | async"
1716
+ [disabled]="!editorService.can('fontSize')"
1717
+ >
1718
+ <ax-button-item-list (mousedown)="$event.preventDefault()">
1719
+ <ax-button-item
1720
+ [text]="i18n.fontSize.default"
1721
+ [selected]="currentSize() == null"
1722
+ (onClick)="apply(null)"
1723
+ ></ax-button-item>
1724
+ @for (size of sizes; track size) {
1725
+ <ax-button-item [text]="'' + size" [selected]="currentSize() === size" (onClick)="apply(size)"></ax-button-item>
1726
+ }
1727
+ </ax-button-item-list>
1728
+ </ax-dropdown-button>
1729
+ `, isInline: true, styles: ["@layer components{ax-text-editor-font-size{display:inline-flex;align-items:center}ax-text-editor-font-size ax-dropdown-button{min-width:calc(var(--spacing, .25rem) * 16)}ax-text-editor-font-size ax-dropdown-button ax-suffix{display:none!important}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXDropdownButtonComponent, selector: "ax-dropdown-button", inputs: ["disabled", "size", "text", "selected", "color", "look", "type", "mode", "iconOnly"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "component", type: AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items", "closeParentOnClick", "lockOnLoading"], outputs: ["onItemClick"] }, { kind: "component", type: AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1730
+ }
1731
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorFontSizeComponent, decorators: [{
1732
+ type: Component,
1733
+ args: [{ selector: 'ax-text-editor-font-size', template: `
1734
+ <ax-dropdown-button
1735
+ #dropdown
1736
+ class="ax-sm ax-text-editor-font-size"
1737
+ look="blank"
1738
+ mode="dropdown"
1739
+ [text]="sizeLabel()"
1740
+ [attr.title]="i18n.fontSize.label | translate | async"
1741
+ [disabled]="!editorService.can('fontSize')"
1742
+ >
1743
+ <ax-button-item-list (mousedown)="$event.preventDefault()">
1744
+ <ax-button-item
1745
+ [text]="i18n.fontSize.default"
1746
+ [selected]="currentSize() == null"
1747
+ (onClick)="apply(null)"
1748
+ ></ax-button-item>
1749
+ @for (size of sizes; track size) {
1750
+ <ax-button-item [text]="'' + size" [selected]="currentSize() === size" (onClick)="apply(size)"></ax-button-item>
1751
+ }
1752
+ </ax-button-item-list>
1753
+ </ax-dropdown-button>
1754
+ `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
1755
+ AXDropdownButtonComponent,
1756
+ AXButtonItemListComponent,
1757
+ AXButtonItemComponent,
1758
+ AXTranslatorPipe,
1759
+ AsyncPipe,
1760
+ ], providers: [
1761
+ { provide: AXComponent, useExisting: AXTextEditorFontSizeComponent },
1762
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorFontSizeComponent },
1763
+ ], styles: ["@layer components{ax-text-editor-font-size{display:inline-flex;align-items:center}ax-text-editor-font-size ax-dropdown-button{min-width:calc(var(--spacing, .25rem) * 16)}ax-text-editor-font-size ax-dropdown-button ax-suffix{display:none!important}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
1764
+ }], propDecorators: { dropdown: [{ type: i0.ViewChild, args: ['dropdown', { isSignal: true }] }] } });
1765
+
1766
+ class AXTextEditorMediaComponent extends AXTextEditorSlot {
1767
+ constructor() {
1768
+ super();
1769
+ this.editorService = inject(AXTextEditorService);
1770
+ this.i18n = AX_TEXT_EDITOR_I18N;
1771
+ this.fileService = inject(AXFileService);
1772
+ this.fileTypes = inject(AXFileTypeRegistryService);
1773
+ this.toast = inject(AXToastService);
1774
+ this.translation = inject(AXTranslationService);
1775
+ this.fileTypes.registerTypes([AX_IMAGE_FILE_TYPE, AX_VIDEO_FILE_TYPE]);
1776
+ }
1777
+ async pick(kind) {
1778
+ if (!this.editorService.can(kind))
1779
+ return;
1780
+ const { accepted, rejected } = await this.fileService.chooseValidated({
1781
+ fileType: kind,
1782
+ multiple: false,
1783
+ });
1784
+ if (rejected[0]?.errors[0]?.message) {
1785
+ this.toast.danger(rejected[0].errors[0].message);
1786
+ }
1787
+ else if (rejected.length) {
1788
+ this.toast.danger(this.translation.translateSync(this.i18n.insert.failed));
1789
+ }
1790
+ const file = accepted[0];
1791
+ if (!file)
1792
+ return;
1793
+ try {
1794
+ const src = await this.fileService.blobToBase64(file);
1795
+ this.editorService.run(kind, { src, alt: file.name });
1796
+ }
1797
+ catch {
1798
+ this.toast.danger(this.translation.translateSync(this.i18n.insert.failed));
1799
+ }
1800
+ }
1801
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorMediaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1802
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorMediaComponent, isStandalone: true, selector: "ax-text-editor-media", providers: [
1803
+ { provide: AXComponent, useExisting: AXTextEditorMediaComponent },
1804
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorMediaComponent },
1805
+ ], usesInheritance: true, ngImport: i0, template: `
1806
+ <ax-button
1807
+ class="ax-sm"
1808
+ look="blank"
1809
+ [iconOnly]="true"
1810
+ [text]="i18n.tools.image"
1811
+ [disabled]="!editorService.can('image')"
1812
+ (onClick)="pick('image')"
1813
+ >
1814
+ <ax-icon class="ax-icon ax-icon-image"></ax-icon>
1815
+ </ax-button>
1816
+ <ax-button
1817
+ class="ax-sm"
1818
+ look="blank"
1819
+ [iconOnly]="true"
1820
+ [text]="i18n.tools.video"
1821
+ [disabled]="!editorService.can('video')"
1822
+ (onClick)="pick('video')"
1823
+ >
1824
+ <ax-icon class="ax-icon ax-icon-play"></ax-icon>
1825
+ </ax-button>
1826
+ `, isInline: true, dependencies: [{ kind: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1827
+ }
1828
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorMediaComponent, decorators: [{
1829
+ type: Component,
1830
+ args: [{
1831
+ selector: 'ax-text-editor-media',
1832
+ template: `
1833
+ <ax-button
1834
+ class="ax-sm"
1835
+ look="blank"
1836
+ [iconOnly]="true"
1837
+ [text]="i18n.tools.image"
1838
+ [disabled]="!editorService.can('image')"
1839
+ (onClick)="pick('image')"
1840
+ >
1841
+ <ax-icon class="ax-icon ax-icon-image"></ax-icon>
1842
+ </ax-button>
1843
+ <ax-button
1844
+ class="ax-sm"
1845
+ look="blank"
1846
+ [iconOnly]="true"
1847
+ [text]="i18n.tools.video"
1848
+ [disabled]="!editorService.can('video')"
1849
+ (onClick)="pick('video')"
1850
+ >
1851
+ <ax-icon class="ax-icon ax-icon-play"></ax-icon>
1852
+ </ax-button>
1853
+ `,
1854
+ changeDetection: ChangeDetectionStrategy.OnPush,
1855
+ encapsulation: ViewEncapsulation.None,
1856
+ imports: [AXButtonComponent, AXDecoratorIconComponent],
1857
+ providers: [
1858
+ { provide: AXComponent, useExisting: AXTextEditorMediaComponent },
1859
+ { provide: AXTextEditorSlot, useExisting: AXTextEditorMediaComponent },
1860
+ ],
1861
+ }]
1862
+ }], ctorParameters: () => [] });
1863
+
1864
+ const COMPONENTS = [
1865
+ AXTextEditorComponent,
1866
+ AXTextEditorToolbarComponent,
1867
+ AXTextEditorContentComponent,
1868
+ AXTextEditorCommandComponent,
1869
+ AXTextEditorHistoryComponent,
1870
+ AXTextEditorHeadingComponent,
1871
+ AXTextEditorFontStyleComponent,
1872
+ AXTextEditorFontSizeComponent,
1873
+ AXTextEditorAlignmentComponent,
1874
+ AXTextEditorColorsComponent,
1875
+ AXTextEditorColorSwatchesComponent,
1876
+ AXTextEditorListComponent,
1877
+ AXTextEditorLinkComponent,
1878
+ AXTextEditorMediaComponent,
1879
+ AXTextEditorBlocksComponent,
1880
+ AXTextEditorTableComponent,
1881
+ AXTextEditorScriptComponent,
1882
+ AXTextEditorZoomComponent,
1883
+ ];
1884
+ class AXTextEditorModule {
1885
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1886
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorModule, imports: [AXTextEditorComponent,
1887
+ AXTextEditorToolbarComponent,
1888
+ AXTextEditorContentComponent,
1889
+ AXTextEditorCommandComponent,
1890
+ AXTextEditorHistoryComponent,
1891
+ AXTextEditorHeadingComponent,
1892
+ AXTextEditorFontStyleComponent,
1893
+ AXTextEditorFontSizeComponent,
1894
+ AXTextEditorAlignmentComponent,
1895
+ AXTextEditorColorsComponent,
1896
+ AXTextEditorColorSwatchesComponent,
1897
+ AXTextEditorListComponent,
1898
+ AXTextEditorLinkComponent,
1899
+ AXTextEditorMediaComponent,
1900
+ AXTextEditorBlocksComponent,
1901
+ AXTextEditorTableComponent,
1902
+ AXTextEditorScriptComponent,
1903
+ AXTextEditorZoomComponent], exports: [AXTextEditorComponent,
1904
+ AXTextEditorToolbarComponent,
1905
+ AXTextEditorContentComponent,
1906
+ AXTextEditorCommandComponent,
1907
+ AXTextEditorHistoryComponent,
1908
+ AXTextEditorHeadingComponent,
1909
+ AXTextEditorFontStyleComponent,
1910
+ AXTextEditorFontSizeComponent,
1911
+ AXTextEditorAlignmentComponent,
1912
+ AXTextEditorColorsComponent,
1913
+ AXTextEditorColorSwatchesComponent,
1914
+ AXTextEditorListComponent,
1915
+ AXTextEditorLinkComponent,
1916
+ AXTextEditorMediaComponent,
1917
+ AXTextEditorBlocksComponent,
1918
+ AXTextEditorTableComponent,
1919
+ AXTextEditorScriptComponent,
1920
+ AXTextEditorZoomComponent] }); }
1921
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorModule, imports: [AXTextEditorCommandComponent,
1922
+ AXTextEditorHistoryComponent,
1923
+ AXTextEditorHeadingComponent,
1924
+ AXTextEditorFontStyleComponent,
1925
+ AXTextEditorFontSizeComponent,
1926
+ AXTextEditorAlignmentComponent,
1927
+ AXTextEditorColorsComponent,
1928
+ AXTextEditorColorSwatchesComponent,
1929
+ AXTextEditorListComponent,
1930
+ AXTextEditorLinkComponent,
1931
+ AXTextEditorMediaComponent,
1932
+ AXTextEditorBlocksComponent,
1933
+ AXTextEditorTableComponent,
1934
+ AXTextEditorScriptComponent,
1935
+ AXTextEditorZoomComponent] }); }
1936
+ }
1937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorModule, decorators: [{
1938
+ type: NgModule,
1939
+ args: [{
1940
+ imports: [...COMPONENTS],
1941
+ exports: [...COMPONENTS],
1942
+ }]
1943
+ }] });
1944
+
1945
+ /**
1946
+ * Generated bundle index. Do not edit.
1947
+ */
1948
+
1949
+ export { AXTextEditorAlignmentComponent, AXTextEditorBlocksComponent, AXTextEditorColorSwatchesComponent, AXTextEditorColorsComponent, AXTextEditorCommandComponent, AXTextEditorComponent, AXTextEditorContentComponent, AXTextEditorFontSizeComponent, AXTextEditorFontStyleComponent, AXTextEditorHeadingComponent, AXTextEditorHistoryComponent, AXTextEditorLinkComponent, AXTextEditorListComponent, AXTextEditorMediaComponent, AXTextEditorModule, AXTextEditorScriptComponent, AXTextEditorService, AXTextEditorSlot, AXTextEditorTableComponent, AXTextEditorToolbarComponent, AXTextEditorZoomComponent, AX_TEXT_EDITOR_I18N };
1950
+ //# sourceMappingURL=acorex-components-text-editor.mjs.map