@acorex/components 22.4.45 → 22.4.47
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.
- package/fesm2022/{acorex-components-conversation-acorex-components-conversation-C7ilacTf.mjs → acorex-components-conversation-acorex-components-conversation-BfIrtZNG.mjs} +790 -398
- package/fesm2022/acorex-components-conversation-acorex-components-conversation-BfIrtZNG.mjs.map +1 -0
- package/fesm2022/{acorex-components-conversation-picker-rename-file-dialog.component-B_OSm0vS.mjs → acorex-components-conversation-picker-rename-file-dialog.component-DlwW-J-B.mjs} +4 -4
- package/fesm2022/{acorex-components-conversation-picker-rename-file-dialog.component-B_OSm0vS.mjs.map → acorex-components-conversation-picker-rename-file-dialog.component-DlwW-J-B.mjs.map} +1 -1
- package/fesm2022/acorex-components-conversation.mjs +1 -1
- package/fesm2022/acorex-components-grid-layout-builder.mjs +30 -4
- package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-text-editor.mjs +471 -12
- package/fesm2022/acorex-components-text-editor.mjs.map +1 -1
- package/package.json +3 -3
- package/text-editor/README.md +2 -0
- package/types/acorex-components-conversation.d.ts +75 -50
- package/types/acorex-components-grid-layout-builder.d.ts +11 -1
- package/types/acorex-components-text-editor.d.ts +236 -6
- package/fesm2022/acorex-components-conversation-acorex-components-conversation-C7ilacTf.mjs.map +0 -1
|
@@ -2,10 +2,10 @@ import { AXComponent, MXInputBaseValueComponent, MXLookComponent, AXFocusableCom
|
|
|
2
2
|
import { AXButtonComponent, AXButtonItemListComponent, AXButtonItemComponent } from '@acorex/components/button';
|
|
3
3
|
import { AXDecoratorIconComponent, AXDecoratorGenericComponent } from '@acorex/components/decorators';
|
|
4
4
|
import { AXTranslatorPipe, AXTranslationService } from '@acorex/core/translation';
|
|
5
|
-
import { AsyncPipe, isPlatformBrowser } from '@angular/common';
|
|
5
|
+
import { AsyncPipe, isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
|
|
6
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';
|
|
7
|
+
import { inject, signal, computed, Injectable, input, ViewEncapsulation, ChangeDetectionStrategy, Component, ElementRef, PLATFORM_ID, NgZone, afterNextRender, effect, TemplateRef, Directive, untracked, DestroyRef, ViewContainerRef, contentChild, output, numberAttribute, forwardRef, model, viewChild, NgModule } from '@angular/core';
|
|
8
|
+
import { AXTextEditor, AX_TEXT_EDITOR_ZOOM_MAX, AX_TEXT_EDITOR_ZOOM_MIN, resolveTextEditorMentions, textEditorMentionAvatar, 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
9
|
import { isEqual } from 'lodash-es';
|
|
10
10
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
11
11
|
import * as i1 from '@angular/forms';
|
|
@@ -30,6 +30,9 @@ class AXTextEditorService {
|
|
|
30
30
|
this.editor = this.core.editor;
|
|
31
31
|
this.state = this.core.state;
|
|
32
32
|
this.version = this.core.version;
|
|
33
|
+
this.mentionSuggestion = this.core.mentionSuggestion;
|
|
34
|
+
this.mentionAvatarTemplate = signal(null, /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "mentionAvatarTemplate" }] : /* istanbul ignore next */ []));
|
|
33
36
|
this.disabled = signal(false, /* @ts-ignore */
|
|
34
37
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
35
38
|
this.readonly = signal(false, /* @ts-ignore */
|
|
@@ -162,6 +165,18 @@ class AXTextEditorService {
|
|
|
162
165
|
zoomOut(step = 10) {
|
|
163
166
|
this.setZoom(this.zoom() - step);
|
|
164
167
|
}
|
|
168
|
+
selectMention(item) {
|
|
169
|
+
this.core.selectMention(item);
|
|
170
|
+
}
|
|
171
|
+
dismissMention() {
|
|
172
|
+
this.core.dismissMention();
|
|
173
|
+
}
|
|
174
|
+
setMentionAvatarRenderer(renderer) {
|
|
175
|
+
this.core.setMentionAvatarRenderer(renderer);
|
|
176
|
+
}
|
|
177
|
+
setMentionIndex(index) {
|
|
178
|
+
this.core.setMentionIndex(index);
|
|
179
|
+
}
|
|
165
180
|
fitToPage() {
|
|
166
181
|
const editor = this.core.editor();
|
|
167
182
|
if (!editor) {
|
|
@@ -201,6 +216,7 @@ const TOGGLE_COMMANDS = new Set([
|
|
|
201
216
|
'italic',
|
|
202
217
|
'underline',
|
|
203
218
|
'strike',
|
|
219
|
+
'spoiler',
|
|
204
220
|
'bulletList',
|
|
205
221
|
'orderedList',
|
|
206
222
|
'superscript',
|
|
@@ -250,6 +266,8 @@ class AXTextEditorCommandComponent extends AXTextEditorSlot {
|
|
|
250
266
|
>
|
|
251
267
|
@if (icon()) {
|
|
252
268
|
<ax-icon class="ax-icon {{ icon() }}"></ax-icon>
|
|
269
|
+
} @else {
|
|
270
|
+
<ng-content></ng-content>
|
|
253
271
|
}
|
|
254
272
|
</ax-button>
|
|
255
273
|
`, 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 }); }
|
|
@@ -272,6 +290,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
272
290
|
>
|
|
273
291
|
@if (icon()) {
|
|
274
292
|
<ax-icon class="ax-icon {{ icon() }}"></ax-icon>
|
|
293
|
+
} @else {
|
|
294
|
+
<ng-content></ng-content>
|
|
275
295
|
}
|
|
276
296
|
</ax-button>
|
|
277
297
|
`,
|
|
@@ -292,12 +312,16 @@ class AXTextEditorContentComponent extends AXTextEditorSlot {
|
|
|
292
312
|
this.editorService = inject(AXTextEditorService);
|
|
293
313
|
this.elementRef = inject((ElementRef));
|
|
294
314
|
this.platformId = inject(PLATFORM_ID);
|
|
315
|
+
this.zone = inject(NgZone);
|
|
295
316
|
afterNextRender(() => void this.createEditor());
|
|
296
317
|
effect(() => {
|
|
297
318
|
if (!this.editorService.editor())
|
|
298
319
|
return;
|
|
299
320
|
this.editorService.setEditable(this.editorService.editable());
|
|
300
321
|
});
|
|
322
|
+
effect(() => {
|
|
323
|
+
this.textEditor.setMentionSource(resolveTextEditorMentions(this.host()?.mentions() ?? null));
|
|
324
|
+
});
|
|
301
325
|
}
|
|
302
326
|
host() {
|
|
303
327
|
return this.editorService.getHost();
|
|
@@ -315,6 +339,7 @@ class AXTextEditorContentComponent extends AXTextEditorSlot {
|
|
|
315
339
|
await this.textEditor.init(element, {
|
|
316
340
|
content: this.toContent(host.value()),
|
|
317
341
|
editable: this.editorService.editable(),
|
|
342
|
+
exitMarksOnEnter: host.exitMarksOnEnter(),
|
|
318
343
|
placeholder: () => this.host()?.placeHolder() ?? '',
|
|
319
344
|
onUpdate: () => this.emitValue(),
|
|
320
345
|
onSelectionUpdate: () => this.editorService.refresh(),
|
|
@@ -327,10 +352,27 @@ class AXTextEditorContentComponent extends AXTextEditorSlot {
|
|
|
327
352
|
this.editorService.clearPreservedSelection();
|
|
328
353
|
return false;
|
|
329
354
|
},
|
|
355
|
+
keydown: (_view, event) => this.handleEnterKey(event),
|
|
330
356
|
},
|
|
331
357
|
},
|
|
332
358
|
});
|
|
333
359
|
}
|
|
360
|
+
/** Enter submits. Shift+Enter is a line break. An open mention list still accepts the person. */
|
|
361
|
+
handleEnterKey(event) {
|
|
362
|
+
const host = this.host();
|
|
363
|
+
if (!host?.enterSubmits() || event.key !== 'Enter' || event.isComposing)
|
|
364
|
+
return false;
|
|
365
|
+
if (event.shiftKey) {
|
|
366
|
+
event.preventDefault();
|
|
367
|
+
queueMicrotask(() => this.textEditor.insertHardBreak());
|
|
368
|
+
return true;
|
|
369
|
+
}
|
|
370
|
+
if (this.editorService.mentionSuggestion())
|
|
371
|
+
return false;
|
|
372
|
+
event.preventDefault();
|
|
373
|
+
this.zone.run(() => host.notifySubmit());
|
|
374
|
+
return true;
|
|
375
|
+
}
|
|
334
376
|
emitValue() {
|
|
335
377
|
const host = this.host();
|
|
336
378
|
const next = this.serialize();
|
|
@@ -356,16 +398,31 @@ class AXTextEditorContentComponent extends AXTextEditorSlot {
|
|
|
356
398
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorContentComponent, isStandalone: true, selector: "ax-text-editor-content", providers: [
|
|
357
399
|
{ provide: AXComponent, useExisting: AXTextEditorContentComponent },
|
|
358
400
|
{ 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 }); }
|
|
401
|
+
], 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-mention{display:inline-flex;align-items:center;gap:.2rem;margin-inline:.05rem;padding:0 .35rem 0 .12rem;border-radius:999px;background:var(--ax-sys-color-primary, #3b82f6);color:var(--ax-sys-color-primary, #1d4ed8);font-weight:600;line-height:1.45;vertical-align:middle;-webkit-user-select:all;user-select:all}@supports (color: color-mix(in lab,red,red)){ax-text-editor .ax-text-editor-prose .ax-text-editor-mention{background:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 14%,transparent)}}.ax-text-editor-mention-avatar-host{display:inline-flex;flex:none;align-items:center;justify-content:center;line-height:0}ax-text-editor .ax-text-editor-prose .ax-text-editor-mention-avatar-host{width:1.15rem;height:1.15rem;min-width:1.15rem;max-width:1.15rem;max-height:1.15rem;overflow:hidden;border-radius:999px}ax-text-editor .ax-text-editor-prose .ax-text-editor-mention-avatar-host ax-conversation-avatar,ax-text-editor .ax-text-editor-prose .ax-text-editor-mention-avatar-host ax-avatar,ax-text-editor .ax-text-editor-prose .ax-text-editor-mention-avatar-host .ax-avatar{width:1.15rem!important;height:1.15rem!important;min-width:0!important;min-height:0!important}.ax-text-editor-mention-avatar{display:inline-flex;flex:none;align-items:center;justify-content:center;width:1.15rem;height:1.15rem;border-radius:999px;object-fit:cover;background:var(--ax-sys-color-primary, #3b82f6);color:var(--ax-sys-color-primary, #1d4ed8);font-size:.68rem;font-weight:700;line-height:1}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-mention-avatar{background:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 18%,transparent)}}ax-text-editor .ax-text-editor-prose .ax-text-editor-mention-query{border-radius:.25rem;background:var(--ax-sys-color-primary, #3b82f6)}@supports (color: color-mix(in lab,red,red)){ax-text-editor .ax-text-editor-prose .ax-text-editor-mention-query{background:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 16%,transparent)}}ax-text-editor .ax-text-editor-prose .ax-text-editor-spoiler{border-radius:.2rem;background-color:rgba(var(--ax-sys-color-on-surface),.16);box-decoration-break:clone;-webkit-box-decoration-break:clone}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
402
|
}
|
|
361
403
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorContentComponent, decorators: [{
|
|
362
404
|
type: Component,
|
|
363
405
|
args: [{ selector: 'ax-text-editor-content', template: `<div class="ax-text-editor-surface" #surface></div>`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
|
364
406
|
{ provide: AXComponent, useExisting: AXTextEditorContentComponent },
|
|
365
407
|
{ 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"] }]
|
|
408
|
+
], 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-mention{display:inline-flex;align-items:center;gap:.2rem;margin-inline:.05rem;padding:0 .35rem 0 .12rem;border-radius:999px;background:var(--ax-sys-color-primary, #3b82f6);color:var(--ax-sys-color-primary, #1d4ed8);font-weight:600;line-height:1.45;vertical-align:middle;-webkit-user-select:all;user-select:all}@supports (color: color-mix(in lab,red,red)){ax-text-editor .ax-text-editor-prose .ax-text-editor-mention{background:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 14%,transparent)}}.ax-text-editor-mention-avatar-host{display:inline-flex;flex:none;align-items:center;justify-content:center;line-height:0}ax-text-editor .ax-text-editor-prose .ax-text-editor-mention-avatar-host{width:1.15rem;height:1.15rem;min-width:1.15rem;max-width:1.15rem;max-height:1.15rem;overflow:hidden;border-radius:999px}ax-text-editor .ax-text-editor-prose .ax-text-editor-mention-avatar-host ax-conversation-avatar,ax-text-editor .ax-text-editor-prose .ax-text-editor-mention-avatar-host ax-avatar,ax-text-editor .ax-text-editor-prose .ax-text-editor-mention-avatar-host .ax-avatar{width:1.15rem!important;height:1.15rem!important;min-width:0!important;min-height:0!important}.ax-text-editor-mention-avatar{display:inline-flex;flex:none;align-items:center;justify-content:center;width:1.15rem;height:1.15rem;border-radius:999px;object-fit:cover;background:var(--ax-sys-color-primary, #3b82f6);color:var(--ax-sys-color-primary, #1d4ed8);font-size:.68rem;font-weight:700;line-height:1}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-mention-avatar{background:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 18%,transparent)}}ax-text-editor .ax-text-editor-prose .ax-text-editor-mention-query{border-radius:.25rem;background:var(--ax-sys-color-primary, #3b82f6)}@supports (color: color-mix(in lab,red,red)){ax-text-editor .ax-text-editor-prose .ax-text-editor-mention-query{background:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 16%,transparent)}}ax-text-editor .ax-text-editor-prose .ax-text-editor-spoiler{border-radius:.2rem;background-color:rgba(var(--ax-sys-color-on-surface),.16);box-decoration-break:clone;-webkit-box-decoration-break:clone}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
409
|
}], ctorParameters: () => [] });
|
|
368
410
|
|
|
411
|
+
/** Portrait for a mention. The template context is the mention item. */
|
|
412
|
+
class AXTextEditorMentionAvatarDirective {
|
|
413
|
+
constructor() {
|
|
414
|
+
this.template = inject((TemplateRef));
|
|
415
|
+
}
|
|
416
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorMentionAvatarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
417
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorMentionAvatarDirective, isStandalone: true, selector: "ng-template[axTextEditorMentionAvatar]", ngImport: i0 }); }
|
|
418
|
+
}
|
|
419
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorMentionAvatarDirective, decorators: [{
|
|
420
|
+
type: Directive,
|
|
421
|
+
args: [{
|
|
422
|
+
selector: 'ng-template[axTextEditorMentionAvatar]',
|
|
423
|
+
}]
|
|
424
|
+
}] });
|
|
425
|
+
|
|
369
426
|
const SCOPE = '@acorex:text-editor';
|
|
370
427
|
const AX_TEXT_EDITOR_I18N = {
|
|
371
428
|
placeholder: `${SCOPE}.placeholder`,
|
|
@@ -376,6 +433,7 @@ const AX_TEXT_EDITOR_I18N = {
|
|
|
376
433
|
italic: `${SCOPE}.tools.italic`,
|
|
377
434
|
underline: `${SCOPE}.tools.underline`,
|
|
378
435
|
strike: `${SCOPE}.tools.strike`,
|
|
436
|
+
spoiler: `${SCOPE}.tools.spoiler`,
|
|
379
437
|
code: `${SCOPE}.tools.code`,
|
|
380
438
|
codeBlock: `${SCOPE}.tools.code-block`,
|
|
381
439
|
link: `${SCOPE}.tools.link`,
|
|
@@ -428,8 +486,283 @@ const AX_TEXT_EDITOR_I18N = {
|
|
|
428
486
|
table: {
|
|
429
487
|
insert: `${SCOPE}.table.insert`,
|
|
430
488
|
},
|
|
489
|
+
mentions: {
|
|
490
|
+
label: `${SCOPE}.mentions.label`,
|
|
491
|
+
loading: `${SCOPE}.mentions.loading`,
|
|
492
|
+
empty: `${SCOPE}.mentions.empty`,
|
|
493
|
+
},
|
|
431
494
|
};
|
|
432
495
|
|
|
496
|
+
class AXTextEditorMentionMenuComponent {
|
|
497
|
+
constructor() {
|
|
498
|
+
this.editorService = inject(AXTextEditorService);
|
|
499
|
+
this.elementRef = inject((ElementRef));
|
|
500
|
+
this.translation = inject(AXTranslationService);
|
|
501
|
+
this.i18n = AX_TEXT_EDITOR_I18N;
|
|
502
|
+
this.suggestion = this.editorService.mentionSuggestion;
|
|
503
|
+
this.avatarTemplate = this.editorService.mentionAvatarTemplate;
|
|
504
|
+
this.open = computed(() => this.placement() != null, /* @ts-ignore */
|
|
505
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
506
|
+
this.label = computed(() => {
|
|
507
|
+
this.suggestion();
|
|
508
|
+
return this.translation.translateSync(this.i18n.mentions.label);
|
|
509
|
+
}, /* @ts-ignore */
|
|
510
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
511
|
+
this.placement = computed(() => {
|
|
512
|
+
const rect = this.suggestion()?.rect;
|
|
513
|
+
if (!rect)
|
|
514
|
+
return null;
|
|
515
|
+
const estimated = 240;
|
|
516
|
+
const above = rect.bottom + 8 + estimated > window.innerHeight && rect.top > 120;
|
|
517
|
+
return {
|
|
518
|
+
top: above ? rect.top - 8 : rect.bottom + 8,
|
|
519
|
+
left: Math.min(Math.max(8, rect.left), Math.max(8, window.innerWidth - 280)),
|
|
520
|
+
above,
|
|
521
|
+
};
|
|
522
|
+
}, /* @ts-ignore */
|
|
523
|
+
...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
|
|
524
|
+
effect(() => {
|
|
525
|
+
const current = this.suggestion();
|
|
526
|
+
if (!current)
|
|
527
|
+
return;
|
|
528
|
+
untracked(() => {
|
|
529
|
+
queueMicrotask(() => {
|
|
530
|
+
const option = this.elementRef.nativeElement.querySelector('[aria-selected="true"]');
|
|
531
|
+
option?.scrollIntoView({ block: 'nearest' });
|
|
532
|
+
});
|
|
533
|
+
});
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
optionId(index) {
|
|
537
|
+
return `ax-text-editor-mention-${index}`;
|
|
538
|
+
}
|
|
539
|
+
avatar(item) {
|
|
540
|
+
return textEditorMentionAvatar(item.avatar);
|
|
541
|
+
}
|
|
542
|
+
initial(label) {
|
|
543
|
+
const char = Array.from(label.trim())[0];
|
|
544
|
+
return char ? char.toLocaleUpperCase() : '@';
|
|
545
|
+
}
|
|
546
|
+
hover(index) {
|
|
547
|
+
this.editorService.setMentionIndex(index);
|
|
548
|
+
}
|
|
549
|
+
select(item) {
|
|
550
|
+
this.editorService.selectMention(item);
|
|
551
|
+
}
|
|
552
|
+
onMouseDown(event) {
|
|
553
|
+
event.preventDefault();
|
|
554
|
+
}
|
|
555
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorMentionMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
556
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: AXTextEditorMentionMenuComponent, isStandalone: true, selector: "ax-text-editor-mention-menu", host: { attributes: { "role": "listbox" }, listeners: { "mousedown": "onMouseDown($event)" }, properties: { "attr.aria-label": "label()", "class.ax-open": "open()", "class.ax-above": "placement()?.above ?? false", "style.top.px": "placement()?.top ?? null", "style.left.px": "placement()?.left ?? null" } }, ngImport: i0, template: `
|
|
557
|
+
@if (suggestion(); as current) {
|
|
558
|
+
@for (item of current.items; track item.id; let index = $index) {
|
|
559
|
+
<button
|
|
560
|
+
type="button"
|
|
561
|
+
role="option"
|
|
562
|
+
class="ax-text-editor-mention-option"
|
|
563
|
+
[attr.aria-selected]="index === current.index"
|
|
564
|
+
[id]="optionId(index)"
|
|
565
|
+
(mouseenter)="hover(index)"
|
|
566
|
+
(click)="select(item)"
|
|
567
|
+
>
|
|
568
|
+
@if (avatarTemplate(); as template) {
|
|
569
|
+
<span class="ax-text-editor-mention-avatar-host">
|
|
570
|
+
<ng-container *ngTemplateOutlet="template; context: { $implicit: item }" />
|
|
571
|
+
</span>
|
|
572
|
+
} @else if (avatar(item); as src) {
|
|
573
|
+
<img class="ax-text-editor-mention-avatar" [src]="src" alt="" />
|
|
574
|
+
} @else {
|
|
575
|
+
<span class="ax-text-editor-mention-avatar" aria-hidden="true">{{ initial(item.label) }}</span>
|
|
576
|
+
}
|
|
577
|
+
<span class="ax-text-editor-mention-label">{{ item.label }}</span>
|
|
578
|
+
</button>
|
|
579
|
+
} @empty {
|
|
580
|
+
<div class="ax-text-editor-mention-status" role="status">
|
|
581
|
+
{{ (current.loading ? i18n.mentions.loading : i18n.mentions.empty) | translate | async }}
|
|
582
|
+
</div>
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
`, isInline: true, styles: ["@layer components{ax-text-editor-mention-menu{position:fixed;z-index:80;display:none;min-width:14rem;max-width:min(20rem,calc(100vw - 1rem));max-height:16rem;overflow:auto;padding:.25rem;border-radius:.75rem;border:1px solid rgba(var(--ax-sys-color-border-lightest-surface));background-color:rgba(var(--ax-sys-color-lightest-surface));color:rgba(var(--ax-sys-color-on-surface));box-shadow:0 12px 32px #00000029}ax-text-editor-mention-menu.ax-open{display:block}ax-text-editor-mention-menu.ax-above{transform:translateY(calc(-100% - .25rem))}.ax-text-editor-mention-option{display:flex;width:100%;align-items:center;gap:.5rem;border:0;border-radius:.5rem;background:transparent;color:inherit;cursor:pointer;padding:.4rem .5rem;text-align:start}.ax-text-editor-mention-option[aria-selected=true]{background:var(--ax-sys-color-primary, #3b82f6)}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-mention-option[aria-selected=true]{background:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 14%,transparent)}}.ax-text-editor-mention-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-text-editor-mention-status{padding:.55rem .65rem;color:currentColor;font-size:.875rem}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-mention-status{color:color-mix(in oklab,currentColor 65%,transparent)}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
586
|
+
}
|
|
587
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorMentionMenuComponent, decorators: [{
|
|
588
|
+
type: Component,
|
|
589
|
+
args: [{ selector: 'ax-text-editor-mention-menu', template: `
|
|
590
|
+
@if (suggestion(); as current) {
|
|
591
|
+
@for (item of current.items; track item.id; let index = $index) {
|
|
592
|
+
<button
|
|
593
|
+
type="button"
|
|
594
|
+
role="option"
|
|
595
|
+
class="ax-text-editor-mention-option"
|
|
596
|
+
[attr.aria-selected]="index === current.index"
|
|
597
|
+
[id]="optionId(index)"
|
|
598
|
+
(mouseenter)="hover(index)"
|
|
599
|
+
(click)="select(item)"
|
|
600
|
+
>
|
|
601
|
+
@if (avatarTemplate(); as template) {
|
|
602
|
+
<span class="ax-text-editor-mention-avatar-host">
|
|
603
|
+
<ng-container *ngTemplateOutlet="template; context: { $implicit: item }" />
|
|
604
|
+
</span>
|
|
605
|
+
} @else if (avatar(item); as src) {
|
|
606
|
+
<img class="ax-text-editor-mention-avatar" [src]="src" alt="" />
|
|
607
|
+
} @else {
|
|
608
|
+
<span class="ax-text-editor-mention-avatar" aria-hidden="true">{{ initial(item.label) }}</span>
|
|
609
|
+
}
|
|
610
|
+
<span class="ax-text-editor-mention-label">{{ item.label }}</span>
|
|
611
|
+
</button>
|
|
612
|
+
} @empty {
|
|
613
|
+
<div class="ax-text-editor-mention-status" role="status">
|
|
614
|
+
{{ (current.loading ? i18n.mentions.loading : i18n.mentions.empty) | translate | async }}
|
|
615
|
+
</div>
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [AXTranslatorPipe, AsyncPipe, NgTemplateOutlet], host: {
|
|
619
|
+
role: 'listbox',
|
|
620
|
+
'[attr.aria-label]': 'label()',
|
|
621
|
+
'[class.ax-open]': 'open()',
|
|
622
|
+
'[class.ax-above]': 'placement()?.above ?? false',
|
|
623
|
+
'[style.top.px]': 'placement()?.top ?? null',
|
|
624
|
+
'[style.left.px]': 'placement()?.left ?? null',
|
|
625
|
+
'(mousedown)': 'onMouseDown($event)',
|
|
626
|
+
}, styles: ["@layer components{ax-text-editor-mention-menu{position:fixed;z-index:80;display:none;min-width:14rem;max-width:min(20rem,calc(100vw - 1rem));max-height:16rem;overflow:auto;padding:.25rem;border-radius:.75rem;border:1px solid rgba(var(--ax-sys-color-border-lightest-surface));background-color:rgba(var(--ax-sys-color-lightest-surface));color:rgba(var(--ax-sys-color-on-surface));box-shadow:0 12px 32px #00000029}ax-text-editor-mention-menu.ax-open{display:block}ax-text-editor-mention-menu.ax-above{transform:translateY(calc(-100% - .25rem))}.ax-text-editor-mention-option{display:flex;width:100%;align-items:center;gap:.5rem;border:0;border-radius:.5rem;background:transparent;color:inherit;cursor:pointer;padding:.4rem .5rem;text-align:start}.ax-text-editor-mention-option[aria-selected=true]{background:var(--ax-sys-color-primary, #3b82f6)}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-mention-option[aria-selected=true]{background:color-mix(in oklab,var(--ax-sys-color-primary, #3b82f6) 14%,transparent)}}.ax-text-editor-mention-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-text-editor-mention-status{padding:.55rem .65rem;color:currentColor;font-size:.875rem}@supports (color: color-mix(in lab,red,red)){.ax-text-editor-mention-status{color:color-mix(in oklab,currentColor 65%,transparent)}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
|
|
627
|
+
}], ctorParameters: () => [] });
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Selection toolbar. Project the same tools used by `ax-text-editor-toolbar`.
|
|
631
|
+
* It appears above a non-empty text selection and does not replace the persistent toolbar.
|
|
632
|
+
*/
|
|
633
|
+
class AXTextEditorInlineToolbarComponent extends AXTextEditorSlot {
|
|
634
|
+
constructor() {
|
|
635
|
+
super();
|
|
636
|
+
this.editorService = inject(AXTextEditorService);
|
|
637
|
+
this.elementRef = inject((ElementRef));
|
|
638
|
+
this.destroyRef = inject(DestroyRef);
|
|
639
|
+
this.open = signal(false, /* @ts-ignore */
|
|
640
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
641
|
+
this.below = signal(false, /* @ts-ignore */
|
|
642
|
+
...(ngDevMode ? [{ debugName: "below" }] : /* istanbul ignore next */ []));
|
|
643
|
+
this.top = signal(0, /* @ts-ignore */
|
|
644
|
+
...(ngDevMode ? [{ debugName: "top" }] : /* istanbul ignore next */ []));
|
|
645
|
+
this.left = signal(0, /* @ts-ignore */
|
|
646
|
+
...(ngDevMode ? [{ debugName: "left" }] : /* istanbul ignore next */ []));
|
|
647
|
+
effect(() => {
|
|
648
|
+
this.editorService.version();
|
|
649
|
+
this.editorService.mentionSuggestion();
|
|
650
|
+
untracked(() => this.place());
|
|
651
|
+
});
|
|
652
|
+
afterNextRender(() => {
|
|
653
|
+
const place = () => this.place();
|
|
654
|
+
document.addEventListener('scroll', place, true);
|
|
655
|
+
window.addEventListener('resize', place);
|
|
656
|
+
this.destroyRef.onDestroy(() => {
|
|
657
|
+
document.removeEventListener('scroll', place, true);
|
|
658
|
+
window.removeEventListener('resize', place);
|
|
659
|
+
});
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
onMouseDown(event) {
|
|
663
|
+
const target = event.target;
|
|
664
|
+
if (target?.closest('input, textarea, select, [contenteditable="true"]'))
|
|
665
|
+
return;
|
|
666
|
+
this.editorService.preserveSelection();
|
|
667
|
+
event.preventDefault();
|
|
668
|
+
}
|
|
669
|
+
place() {
|
|
670
|
+
const editor = this.editorService.editor();
|
|
671
|
+
const suggestion = this.editorService.mentionSuggestion();
|
|
672
|
+
const selection = editor?.state.selection;
|
|
673
|
+
if (!editor || suggestion || !editor.isFocused || !editor.isEditable || !selection || selection.empty) {
|
|
674
|
+
this.open.set(false);
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
const text = editor.state.doc.textBetween(selection.from, selection.to, '\n');
|
|
678
|
+
if (!text.trim()) {
|
|
679
|
+
this.open.set(false);
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
const rect = this.selectionLineRect(editor);
|
|
683
|
+
if (!rect) {
|
|
684
|
+
this.open.set(false);
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
const toolbarHeight = this.elementRef.nativeElement.offsetHeight || 40;
|
|
688
|
+
const below = rect.top - toolbarHeight < 8;
|
|
689
|
+
this.below.set(below);
|
|
690
|
+
this.top.set(Math.round(below ? rect.bottom : rect.top));
|
|
691
|
+
this.left.set(this.clampLeft(rect));
|
|
692
|
+
this.open.set(true);
|
|
693
|
+
queueMicrotask(() => {
|
|
694
|
+
if (!this.open())
|
|
695
|
+
return;
|
|
696
|
+
this.left.set(this.clampLeft(rect));
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
/** The line of text under the caret, ignoring the stretched box select-all creates. */
|
|
700
|
+
selectionLineRect(editor) {
|
|
701
|
+
const domSelection = window.getSelection();
|
|
702
|
+
const anchor = domSelection?.anchorNode;
|
|
703
|
+
if (!domSelection || domSelection.rangeCount === 0 || !anchor || !editor.view.dom.contains(anchor))
|
|
704
|
+
return null;
|
|
705
|
+
const editorRect = editor.view.dom.getBoundingClientRect();
|
|
706
|
+
const rects = Array.from(domSelection.getRangeAt(0).getClientRects()).filter((rect) => {
|
|
707
|
+
if (rect.width < 1 || rect.height < 1 || rect.height > editorRect.height + 4)
|
|
708
|
+
return false;
|
|
709
|
+
return (rect.bottom > editorRect.top &&
|
|
710
|
+
rect.top < editorRect.bottom &&
|
|
711
|
+
rect.right > editorRect.left &&
|
|
712
|
+
rect.left < editorRect.right);
|
|
713
|
+
});
|
|
714
|
+
const selection = editor.state.selection;
|
|
715
|
+
let focus;
|
|
716
|
+
try {
|
|
717
|
+
focus = editor.view.coordsAtPos(Math.max(selection.from, selection.to - 1));
|
|
718
|
+
}
|
|
719
|
+
catch {
|
|
720
|
+
return rects[0] ?? null;
|
|
721
|
+
}
|
|
722
|
+
if (!rects.length) {
|
|
723
|
+
return new DOMRect(focus.left, focus.top, Math.max(1, focus.right - focus.left), Math.max(1, focus.bottom - focus.top));
|
|
724
|
+
}
|
|
725
|
+
return rects.reduce((best, rect) => Math.abs((rect.top + rect.bottom) / 2 - (focus.top + focus.bottom) / 2) <
|
|
726
|
+
Math.abs((best.top + best.bottom) / 2 - (focus.top + focus.bottom) / 2)
|
|
727
|
+
? rect
|
|
728
|
+
: best);
|
|
729
|
+
}
|
|
730
|
+
clampLeft(rect) {
|
|
731
|
+
const width = this.elementRef.nativeElement.offsetWidth || 240;
|
|
732
|
+
const half = width / 2;
|
|
733
|
+
const center = rect.left + rect.width / 2;
|
|
734
|
+
return Math.round(Math.min(window.innerWidth - 8 - half, Math.max(8 + half, center)));
|
|
735
|
+
}
|
|
736
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorInlineToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
737
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorInlineToolbarComponent, isStandalone: true, selector: "ax-text-editor-inline-toolbar", host: { listeners: { "mousedown": "onMouseDown($event)" }, properties: { "class.ax-open": "open()", "class.ax-below": "below()", "style.top.px": "top()", "style.left.px": "left()", "attr.aria-hidden": "open() ? null : true" }, classAttribute: "ax-text-editor-inline-toolbar" }, providers: [
|
|
738
|
+
{ provide: AXComponent, useExisting: AXTextEditorInlineToolbarComponent },
|
|
739
|
+
{ provide: AXTextEditorSlot, useExisting: AXTextEditorInlineToolbarComponent },
|
|
740
|
+
], usesInheritance: true, ngImport: i0, template: `
|
|
741
|
+
<div class="ax-text-editor-inline-toolbar-tools">
|
|
742
|
+
<ng-content></ng-content>
|
|
743
|
+
</div>
|
|
744
|
+
`, isInline: true, styles: ["@layer components{ax-text-editor-inline-toolbar{position:fixed;z-index:70;display:none;max-width:calc(100vw - 1rem);padding:.25rem;border-radius:.75rem;border:1px solid rgba(var(--ax-sys-color-border-lightest-surface));background-color:rgba(var(--ax-sys-color-lightest-surface));color:rgba(var(--ax-sys-color-on-surface));box-shadow:0 10px 28px #00000029;transform:translate(-50%,calc(-100% - .4rem));-webkit-user-select:none;user-select:none}ax-text-editor-inline-toolbar.ax-open{display:flex}ax-text-editor-inline-toolbar.ax-below{transform:translate(-50%,.4rem)}ax-text-editor-inline-toolbar .ax-text-editor-inline-toolbar-tools{display:flex;min-width:0;align-items:center;gap:.25rem}ax-text-editor-inline-toolbar .ax-text-editor-inline-toolbar-tools>*{display:flex;flex-shrink:0;align-items:center;gap:.125rem}ax-text-editor-inline-toolbar .ax-text-editor-inline-toolbar-tools>ax-divider{display:block;align-self:stretch;width:1px;min-height:1.25rem;margin-inline:.125rem;background-color:rgba(var(--ax-sys-color-border-lightest-surface))}ax-text-editor-inline-toolbar .ax-text-editor-inline-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-inline-toolbar .ax-text-editor-inline-toolbar-tools ax-text-editor-command svg{width:1rem;height:1rem;display:block}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
745
|
+
}
|
|
746
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorInlineToolbarComponent, decorators: [{
|
|
747
|
+
type: Component,
|
|
748
|
+
args: [{ selector: 'ax-text-editor-inline-toolbar', template: `
|
|
749
|
+
<div class="ax-text-editor-inline-toolbar-tools">
|
|
750
|
+
<ng-content></ng-content>
|
|
751
|
+
</div>
|
|
752
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
753
|
+
class: 'ax-text-editor-inline-toolbar',
|
|
754
|
+
'[class.ax-open]': 'open()',
|
|
755
|
+
'[class.ax-below]': 'below()',
|
|
756
|
+
'[style.top.px]': 'top()',
|
|
757
|
+
'[style.left.px]': 'left()',
|
|
758
|
+
'[attr.aria-hidden]': 'open() ? null : true',
|
|
759
|
+
'(mousedown)': 'onMouseDown($event)',
|
|
760
|
+
}, providers: [
|
|
761
|
+
{ provide: AXComponent, useExisting: AXTextEditorInlineToolbarComponent },
|
|
762
|
+
{ provide: AXTextEditorSlot, useExisting: AXTextEditorInlineToolbarComponent },
|
|
763
|
+
], styles: ["@layer components{ax-text-editor-inline-toolbar{position:fixed;z-index:70;display:none;max-width:calc(100vw - 1rem);padding:.25rem;border-radius:.75rem;border:1px solid rgba(var(--ax-sys-color-border-lightest-surface));background-color:rgba(var(--ax-sys-color-lightest-surface));color:rgba(var(--ax-sys-color-on-surface));box-shadow:0 10px 28px #00000029;transform:translate(-50%,calc(-100% - .4rem));-webkit-user-select:none;user-select:none}ax-text-editor-inline-toolbar.ax-open{display:flex}ax-text-editor-inline-toolbar.ax-below{transform:translate(-50%,.4rem)}ax-text-editor-inline-toolbar .ax-text-editor-inline-toolbar-tools{display:flex;min-width:0;align-items:center;gap:.25rem}ax-text-editor-inline-toolbar .ax-text-editor-inline-toolbar-tools>*{display:flex;flex-shrink:0;align-items:center;gap:.125rem}ax-text-editor-inline-toolbar .ax-text-editor-inline-toolbar-tools>ax-divider{display:block;align-self:stretch;width:1px;min-height:1.25rem;margin-inline:.125rem;background-color:rgba(var(--ax-sys-color-border-lightest-surface))}ax-text-editor-inline-toolbar .ax-text-editor-inline-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-inline-toolbar .ax-text-editor-inline-toolbar-tools ax-text-editor-command svg{width:1rem;height:1rem;display:block}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
|
|
764
|
+
}], ctorParameters: () => [] });
|
|
765
|
+
|
|
433
766
|
class AXTextEditorComponent extends classes((MXInputBaseValueComponent), MXLookComponent) {
|
|
434
767
|
static parseLineCount(value) {
|
|
435
768
|
if (value === undefined || value === null || value === '')
|
|
@@ -440,15 +773,35 @@ class AXTextEditorComponent extends classes((MXInputBaseValueComponent), MXLookC
|
|
|
440
773
|
constructor() {
|
|
441
774
|
super();
|
|
442
775
|
this.editorService = inject(AXTextEditorService);
|
|
776
|
+
this.textEditor = inject(AXTextEditor);
|
|
777
|
+
this.viewContainer = inject(ViewContainerRef);
|
|
443
778
|
this.destroyRef = inject(DestroyRef);
|
|
444
779
|
this.translation = inject(AXTranslationService);
|
|
445
780
|
this.projected = contentChild(AXTextEditorContentComponent, /* @ts-ignore */
|
|
446
781
|
...(ngDevMode ? [{ debugName: "projected" }] : /* istanbul ignore next */ []));
|
|
782
|
+
this.inlineToolbar = contentChild(AXTextEditorInlineToolbarComponent, /* @ts-ignore */
|
|
783
|
+
...(ngDevMode ? [{ debugName: "inlineToolbar" }] : /* istanbul ignore next */ []));
|
|
784
|
+
this.mentionAvatar = contentChild(AXTextEditorMentionAvatarDirective, /* @ts-ignore */
|
|
785
|
+
...(ngDevMode ? [{ debugName: "mentionAvatar" }] : /* istanbul ignore next */ []));
|
|
447
786
|
this.syncingFromEditor = false;
|
|
448
787
|
this.placeHolder = input('', /* @ts-ignore */
|
|
449
788
|
...(ngDevMode ? [{ debugName: "placeHolder" }] : /* istanbul ignore next */ []));
|
|
450
789
|
this.outputFormat = input('json', /* @ts-ignore */
|
|
451
790
|
...(ngDevMode ? [{ debugName: "outputFormat" }] : /* istanbul ignore next */ []));
|
|
791
|
+
/**
|
|
792
|
+
* People offered when the user types `@`.
|
|
793
|
+
* An array is filtered locally. A function can search remotely. `null` leaves `@` as plain text.
|
|
794
|
+
*/
|
|
795
|
+
this.mentions = input(null, /* @ts-ignore */
|
|
796
|
+
...(ngDevMode ? [{ debugName: "mentions" }] : /* istanbul ignore next */ []));
|
|
797
|
+
/**
|
|
798
|
+
* Enter emits {@link submitted} instead of splitting the block.
|
|
799
|
+
* Shift+Enter still inserts a line break. An open mention list keeps Enter.
|
|
800
|
+
*/
|
|
801
|
+
this.enterSubmits = input(false, /* @ts-ignore */
|
|
802
|
+
...(ngDevMode ? [{ debugName: "enterSubmits" }] : /* istanbul ignore next */ []));
|
|
803
|
+
/** Emitted when Enter submits and no mention suggestion is open. */
|
|
804
|
+
this.submitted = output();
|
|
452
805
|
/**
|
|
453
806
|
* Minimum visible height of the editable surface, in text lines.
|
|
454
807
|
* Takes precedence over {@link initialLine} when set.
|
|
@@ -486,15 +839,38 @@ class AXTextEditorComponent extends classes((MXInputBaseValueComponent), MXLookC
|
|
|
486
839
|
this.translation.translateSync(AX_TEXT_EDITOR_I18N.placeholder, { waitForLoad: true }),
|
|
487
840
|
outputFormat: () => this.outputFormat(),
|
|
488
841
|
value: () => this.value,
|
|
842
|
+
mentions: () => this.mentions(),
|
|
843
|
+
exitMarksOnEnter: () => this.inlineToolbar() != null,
|
|
844
|
+
enterSubmits: () => this.enterSubmits(),
|
|
489
845
|
disabled: () => this.disabled,
|
|
490
846
|
readonly: () => this.readonly,
|
|
491
847
|
notifyFocus: (event) => this.notifyEditorFocus(event),
|
|
492
848
|
notifyBlur: (event) => this.notifyEditorBlur(event),
|
|
493
849
|
notifyValue: (value) => this.notifyEditorValue(value),
|
|
850
|
+
notifySubmit: () => this.submitted.emit(),
|
|
851
|
+
});
|
|
852
|
+
effect(() => {
|
|
853
|
+
const template = this.mentionAvatar()?.template ?? null;
|
|
854
|
+
const editor = this.editorService.editor();
|
|
855
|
+
untracked(() => {
|
|
856
|
+
this.editorService.mentionAvatarTemplate.set(template);
|
|
857
|
+
if (!editor)
|
|
858
|
+
return;
|
|
859
|
+
this.textEditor.setMentionAvatarRenderer(template ? (host, item) => this.mountMentionAvatar(template, host, item) : null);
|
|
860
|
+
});
|
|
494
861
|
});
|
|
495
862
|
this.disabledChange.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.editorService.syncHostState());
|
|
496
863
|
this.readonlyChange.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.editorService.syncHostState());
|
|
497
864
|
}
|
|
865
|
+
mountMentionAvatar(template, host, item) {
|
|
866
|
+
const view = this.viewContainer.createEmbeddedView(template, { $implicit: item });
|
|
867
|
+
view.rootNodes.forEach((node) => {
|
|
868
|
+
if (node instanceof Node)
|
|
869
|
+
host.appendChild(node);
|
|
870
|
+
});
|
|
871
|
+
view.detectChanges();
|
|
872
|
+
return () => view.destroy();
|
|
873
|
+
}
|
|
498
874
|
getEditor() {
|
|
499
875
|
return this.editorService.editor();
|
|
500
876
|
}
|
|
@@ -545,7 +921,7 @@ class AXTextEditorComponent extends classes((MXInputBaseValueComponent), MXLookC
|
|
|
545
921
|
this.editorService.setContent(value == null ? '' : value, false);
|
|
546
922
|
}
|
|
547
923
|
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: [
|
|
924
|
+
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 }, mentions: { classPropertyName: "mentions", publicName: "mentions", isSignal: true, isRequired: false, transformFunction: null }, enterSubmits: { classPropertyName: "enterSubmits", publicName: "enterSubmits", 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", submitted: "submitted" }, 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
925
|
AXTextEditor,
|
|
550
926
|
AXTextEditorService,
|
|
551
927
|
{ provide: AXComponent, useExisting: AXTextEditorComponent },
|
|
@@ -556,7 +932,7 @@ class AXTextEditorComponent extends classes((MXInputBaseValueComponent), MXLookC
|
|
|
556
932
|
useExisting: forwardRef(() => AXTextEditorComponent),
|
|
557
933
|
multi: true,
|
|
558
934
|
},
|
|
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 }); }
|
|
935
|
+
], queries: [{ propertyName: "projected", first: true, predicate: AXTextEditorContentComponent, descendants: true, isSignal: true }, { propertyName: "inlineToolbar", first: true, predicate: AXTextEditorInlineToolbarComponent, descendants: true, isSignal: true }, { propertyName: "mentionAvatar", first: true, predicate: AXTextEditorMentionAvatarDirective, 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<ng-content select=\"ax-text-editor-inline-toolbar\"></ng-content>\n<ax-text-editor-mention-menu></ax-text-editor-mention-menu>\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" }, { kind: "component", type: AXTextEditorMentionMenuComponent, selector: "ax-text-editor-mention-menu" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
560
936
|
}
|
|
561
937
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorComponent, decorators: [{
|
|
562
938
|
type: Component,
|
|
@@ -587,8 +963,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
587
963
|
useExisting: forwardRef(() => AXTextEditorComponent),
|
|
588
964
|
multi: true,
|
|
589
965
|
},
|
|
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 }] }] } });
|
|
966
|
+
], imports: [AXTextEditorContentComponent, AXTextEditorMentionMenuComponent], 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<ng-content select=\"ax-text-editor-inline-toolbar\"></ng-content>\n<ax-text-editor-mention-menu></ax-text-editor-mention-menu>\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"] }]
|
|
967
|
+
}], ctorParameters: () => [], propDecorators: { projected: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AXTextEditorContentComponent), { isSignal: true }] }], inlineToolbar: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AXTextEditorInlineToolbarComponent), { isSignal: true }] }], mentionAvatar: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AXTextEditorMentionAvatarDirective), { isSignal: true }] }], placeHolder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeHolder", required: false }] }], outputFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "outputFormat", required: false }] }], mentions: [{ type: i0.Input, args: [{ isSignal: true, alias: "mentions", required: false }] }], enterSubmits: [{ type: i0.Input, args: [{ isSignal: true, alias: "enterSubmits", required: false }] }], submitted: [{ type: i0.Output, args: ["submitted"] }], 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
968
|
|
|
593
969
|
class AXTextEditorToolbarComponent extends AXTextEditorSlot {
|
|
594
970
|
constructor() {
|
|
@@ -1110,6 +1486,79 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
1110
1486
|
}]
|
|
1111
1487
|
}] });
|
|
1112
1488
|
|
|
1489
|
+
class AXTextEditorSpoilerComponent extends AXTextEditorSlot {
|
|
1490
|
+
constructor() {
|
|
1491
|
+
super(...arguments);
|
|
1492
|
+
this.editorService = inject(AXTextEditorService);
|
|
1493
|
+
this.i18n = AX_TEXT_EDITOR_I18N;
|
|
1494
|
+
this.active = computed(() => this.editorService.isActive('spoiler'), /* @ts-ignore */
|
|
1495
|
+
...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
1496
|
+
this.enabled = computed(() => this.editorService.can('spoiler'), /* @ts-ignore */
|
|
1497
|
+
...(ngDevMode ? [{ debugName: "enabled" }] : /* istanbul ignore next */ []));
|
|
1498
|
+
}
|
|
1499
|
+
execute() {
|
|
1500
|
+
this.editorService.run('spoiler');
|
|
1501
|
+
}
|
|
1502
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorSpoilerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1503
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorSpoilerComponent, isStandalone: true, selector: "ax-text-editor-spoiler", providers: [
|
|
1504
|
+
{ provide: AXComponent, useExisting: AXTextEditorSpoilerComponent },
|
|
1505
|
+
{ provide: AXTextEditorSlot, useExisting: AXTextEditorSpoilerComponent },
|
|
1506
|
+
], usesInheritance: true, ngImport: i0, template: `
|
|
1507
|
+
<ax-button
|
|
1508
|
+
class="ax-sm"
|
|
1509
|
+
look="blank"
|
|
1510
|
+
[iconOnly]="true"
|
|
1511
|
+
[text]="i18n.tools.spoiler"
|
|
1512
|
+
[toggleable]="true"
|
|
1513
|
+
[selected]="active()"
|
|
1514
|
+
[disabled]="!enabled()"
|
|
1515
|
+
[attr.title]="i18n.tools.spoiler | translate | async"
|
|
1516
|
+
(onClick)="execute()"
|
|
1517
|
+
>
|
|
1518
|
+
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
1519
|
+
<path
|
|
1520
|
+
fill="none"
|
|
1521
|
+
stroke="currentColor"
|
|
1522
|
+
stroke-width="2"
|
|
1523
|
+
stroke-linecap="round"
|
|
1524
|
+
stroke-linejoin="round"
|
|
1525
|
+
d="M3 3l18 18M10.6 10.6A3 3 0 0 0 14.8 15M9.9 5.2A11 11 0 0 1 12 5c5.2 0 9.3 3.2 11 7.5a12 12 0 0 1-4.2 5.2M6.1 6.1C3.6 7.7 1.8 10.2 1 12.5 2.7 16.8 6.8 20 12 20c1.4 0 2.7-.2 3.9-.7"
|
|
1526
|
+
/>
|
|
1527
|
+
</svg>
|
|
1528
|
+
</ax-button>
|
|
1529
|
+
`, isInline: true, styles: ["ax-text-editor-spoiler svg{display:block;width:1rem;height:1rem}\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: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1530
|
+
}
|
|
1531
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorSpoilerComponent, decorators: [{
|
|
1532
|
+
type: Component,
|
|
1533
|
+
args: [{ selector: 'ax-text-editor-spoiler', template: `
|
|
1534
|
+
<ax-button
|
|
1535
|
+
class="ax-sm"
|
|
1536
|
+
look="blank"
|
|
1537
|
+
[iconOnly]="true"
|
|
1538
|
+
[text]="i18n.tools.spoiler"
|
|
1539
|
+
[toggleable]="true"
|
|
1540
|
+
[selected]="active()"
|
|
1541
|
+
[disabled]="!enabled()"
|
|
1542
|
+
[attr.title]="i18n.tools.spoiler | translate | async"
|
|
1543
|
+
(onClick)="execute()"
|
|
1544
|
+
>
|
|
1545
|
+
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
1546
|
+
<path
|
|
1547
|
+
fill="none"
|
|
1548
|
+
stroke="currentColor"
|
|
1549
|
+
stroke-width="2"
|
|
1550
|
+
stroke-linecap="round"
|
|
1551
|
+
stroke-linejoin="round"
|
|
1552
|
+
d="M3 3l18 18M10.6 10.6A3 3 0 0 0 14.8 15M9.9 5.2A11 11 0 0 1 12 5c5.2 0 9.3 3.2 11 7.5a12 12 0 0 1-4.2 5.2M6.1 6.1C3.6 7.7 1.8 10.2 1 12.5 2.7 16.8 6.8 20 12 20c1.4 0 2.7-.2 3.9-.7"
|
|
1553
|
+
/>
|
|
1554
|
+
</svg>
|
|
1555
|
+
</ax-button>
|
|
1556
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [AXButtonComponent, AXTranslatorPipe, AsyncPipe], providers: [
|
|
1557
|
+
{ provide: AXComponent, useExisting: AXTextEditorSpoilerComponent },
|
|
1558
|
+
{ provide: AXTextEditorSlot, useExisting: AXTextEditorSpoilerComponent },
|
|
1559
|
+
], styles: ["ax-text-editor-spoiler svg{display:block;width:1rem;height:1rem}\n"] }]
|
|
1560
|
+
}] });
|
|
1561
|
+
|
|
1113
1562
|
class AXTextEditorHeadingComponent extends AXTextEditorSlot {
|
|
1114
1563
|
constructor() {
|
|
1115
1564
|
super(...arguments);
|
|
@@ -1862,13 +2311,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
1862
2311
|
}], ctorParameters: () => [] });
|
|
1863
2312
|
|
|
1864
2313
|
const COMPONENTS = [
|
|
2314
|
+
AXTextEditorMentionAvatarDirective,
|
|
1865
2315
|
AXTextEditorComponent,
|
|
1866
2316
|
AXTextEditorToolbarComponent,
|
|
2317
|
+
AXTextEditorInlineToolbarComponent,
|
|
1867
2318
|
AXTextEditorContentComponent,
|
|
1868
2319
|
AXTextEditorCommandComponent,
|
|
1869
2320
|
AXTextEditorHistoryComponent,
|
|
1870
2321
|
AXTextEditorHeadingComponent,
|
|
1871
2322
|
AXTextEditorFontStyleComponent,
|
|
2323
|
+
AXTextEditorSpoilerComponent,
|
|
1872
2324
|
AXTextEditorFontSizeComponent,
|
|
1873
2325
|
AXTextEditorAlignmentComponent,
|
|
1874
2326
|
AXTextEditorColorsComponent,
|
|
@@ -1883,13 +2335,16 @@ const COMPONENTS = [
|
|
|
1883
2335
|
];
|
|
1884
2336
|
class AXTextEditorModule {
|
|
1885
2337
|
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: [
|
|
2338
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorModule, imports: [AXTextEditorMentionAvatarDirective,
|
|
2339
|
+
AXTextEditorComponent,
|
|
1887
2340
|
AXTextEditorToolbarComponent,
|
|
2341
|
+
AXTextEditorInlineToolbarComponent,
|
|
1888
2342
|
AXTextEditorContentComponent,
|
|
1889
2343
|
AXTextEditorCommandComponent,
|
|
1890
2344
|
AXTextEditorHistoryComponent,
|
|
1891
2345
|
AXTextEditorHeadingComponent,
|
|
1892
2346
|
AXTextEditorFontStyleComponent,
|
|
2347
|
+
AXTextEditorSpoilerComponent,
|
|
1893
2348
|
AXTextEditorFontSizeComponent,
|
|
1894
2349
|
AXTextEditorAlignmentComponent,
|
|
1895
2350
|
AXTextEditorColorsComponent,
|
|
@@ -1900,13 +2355,16 @@ class AXTextEditorModule {
|
|
|
1900
2355
|
AXTextEditorBlocksComponent,
|
|
1901
2356
|
AXTextEditorTableComponent,
|
|
1902
2357
|
AXTextEditorScriptComponent,
|
|
1903
|
-
AXTextEditorZoomComponent], exports: [
|
|
2358
|
+
AXTextEditorZoomComponent], exports: [AXTextEditorMentionAvatarDirective,
|
|
2359
|
+
AXTextEditorComponent,
|
|
1904
2360
|
AXTextEditorToolbarComponent,
|
|
2361
|
+
AXTextEditorInlineToolbarComponent,
|
|
1905
2362
|
AXTextEditorContentComponent,
|
|
1906
2363
|
AXTextEditorCommandComponent,
|
|
1907
2364
|
AXTextEditorHistoryComponent,
|
|
1908
2365
|
AXTextEditorHeadingComponent,
|
|
1909
2366
|
AXTextEditorFontStyleComponent,
|
|
2367
|
+
AXTextEditorSpoilerComponent,
|
|
1910
2368
|
AXTextEditorFontSizeComponent,
|
|
1911
2369
|
AXTextEditorAlignmentComponent,
|
|
1912
2370
|
AXTextEditorColorsComponent,
|
|
@@ -1922,6 +2380,7 @@ class AXTextEditorModule {
|
|
|
1922
2380
|
AXTextEditorHistoryComponent,
|
|
1923
2381
|
AXTextEditorHeadingComponent,
|
|
1924
2382
|
AXTextEditorFontStyleComponent,
|
|
2383
|
+
AXTextEditorSpoilerComponent,
|
|
1925
2384
|
AXTextEditorFontSizeComponent,
|
|
1926
2385
|
AXTextEditorAlignmentComponent,
|
|
1927
2386
|
AXTextEditorColorsComponent,
|
|
@@ -1946,5 +2405,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
1946
2405
|
* Generated bundle index. Do not edit.
|
|
1947
2406
|
*/
|
|
1948
2407
|
|
|
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 };
|
|
2408
|
+
export { AXTextEditorAlignmentComponent, AXTextEditorBlocksComponent, AXTextEditorColorSwatchesComponent, AXTextEditorColorsComponent, AXTextEditorCommandComponent, AXTextEditorComponent, AXTextEditorContentComponent, AXTextEditorFontSizeComponent, AXTextEditorFontStyleComponent, AXTextEditorHeadingComponent, AXTextEditorHistoryComponent, AXTextEditorInlineToolbarComponent, AXTextEditorLinkComponent, AXTextEditorListComponent, AXTextEditorMediaComponent, AXTextEditorMentionAvatarDirective, AXTextEditorModule, AXTextEditorScriptComponent, AXTextEditorService, AXTextEditorSlot, AXTextEditorSpoilerComponent, AXTextEditorTableComponent, AXTextEditorToolbarComponent, AXTextEditorZoomComponent, AX_TEXT_EDITOR_I18N };
|
|
1950
2409
|
//# sourceMappingURL=acorex-components-text-editor.mjs.map
|