@acorex/components 22.4.47 → 22.4.49
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-BfIrtZNG.mjs → acorex-components-conversation-acorex-components-conversation-CccEQ_Wr.mjs} +310 -281
- package/fesm2022/acorex-components-conversation-acorex-components-conversation-CccEQ_Wr.mjs.map +1 -0
- package/fesm2022/{acorex-components-conversation-picker-rename-file-dialog.component-DlwW-J-B.mjs → acorex-components-conversation-picker-rename-file-dialog.component-6Is-walP.mjs} +2 -2
- package/fesm2022/{acorex-components-conversation-picker-rename-file-dialog.component-DlwW-J-B.mjs.map → acorex-components-conversation-picker-rename-file-dialog.component-6Is-walP.mjs.map} +1 -1
- package/fesm2022/acorex-components-conversation.mjs +1 -1
- package/fesm2022/acorex-components-inline-reaction.mjs +29 -5
- package/fesm2022/acorex-components-inline-reaction.mjs.map +1 -1
- package/fesm2022/acorex-components-lookup.mjs +29 -2
- package/fesm2022/acorex-components-lookup.mjs.map +1 -1
- package/fesm2022/acorex-components-reaction.mjs +6 -3
- package/fesm2022/acorex-components-reaction.mjs.map +1 -1
- package/fesm2022/acorex-components-text-editor.mjs +40 -17
- package/fesm2022/acorex-components-text-editor.mjs.map +1 -1
- package/package.json +3 -3
- package/types/acorex-components-conversation.d.ts +11 -22
- package/types/acorex-components-inline-reaction.d.ts +9 -0
- package/types/acorex-components-lookup.d.ts +7 -0
- package/types/acorex-components-reaction.d.ts +3 -1
- package/fesm2022/acorex-components-conversation-acorex-components-conversation-BfIrtZNG.mjs.map +0 -1
|
@@ -35,6 +35,9 @@ class AXReactionComponent {
|
|
|
35
35
|
*/
|
|
36
36
|
this.editable = input(false, /* @ts-ignore */
|
|
37
37
|
...(ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []));
|
|
38
|
+
/** Whether to show the add button and picker when editable. */
|
|
39
|
+
this.showAddButton = input(true, /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "showAddButton" }] : /* istanbul ignore next */ []));
|
|
38
41
|
/**
|
|
39
42
|
* When true, the emoji picker popover is opened.
|
|
40
43
|
*
|
|
@@ -113,15 +116,15 @@ class AXReactionComponent {
|
|
|
113
116
|
return `${item.emoji.name}, ${item.count}${selected}`;
|
|
114
117
|
}
|
|
115
118
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXReactionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
116
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: AXReactionComponent, isStandalone: true, selector: "ax-reaction", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, showPicker: { classPropertyName: "showPicker", publicName: "showPicker", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { add: "add", remove: "remove" }, host: { properties: { "class.ax-reaction-editable": "editable()" }, classAttribute: "ax-reaction-host" }, providers: [{ provide: AXComponent, useExisting: AXReactionComponent }], viewQueries: [{ propertyName: "pickerPopover", first: true, predicate: ["pickerPopover"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ax-reaction\">\n @for (item of items(); track item.emoji.
|
|
119
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: AXReactionComponent, isStandalone: true, selector: "ax-reaction", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, showAddButton: { classPropertyName: "showAddButton", publicName: "showAddButton", isSignal: true, isRequired: false, transformFunction: null }, showPicker: { classPropertyName: "showPicker", publicName: "showPicker", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { add: "add", remove: "remove" }, host: { properties: { "class.ax-reaction-editable": "editable()" }, classAttribute: "ax-reaction-host" }, providers: [{ provide: AXComponent, useExisting: AXReactionComponent }], viewQueries: [{ propertyName: "pickerPopover", first: true, predicate: ["pickerPopover"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ax-reaction\">\n @for (item of items(); track item.emoji.unicode) {\n <button\n type=\"button\"\n class=\"ax-reaction-item\"\n [class.ax-reaction-item-selected]=\"item.selected\"\n [class.ax-reaction-item-interactive]=\"editable()\"\n [attr.aria-label]=\"itemAriaLabel(item)\"\n [attr.aria-pressed]=\"editable() || item.selected ? !!item.selected : null\"\n [title]=\"item.emoji.name\"\n (click)=\"onItemClick(item)\"\n >\n <ax-emoji [emoji]=\"item.emoji\" [size]=\"size()\" />\n\n <span class=\"ax-reaction-count\">\n {{ item.count }}\n </span>\n </button>\n }\n\n @if (editable() && showAddButton()) {\n <button\n #addButton\n type=\"button\"\n class=\"ax-reaction-item ax-reaction-add\"\n [class.ax-reaction-item-selected]=\"isPickerVisible()\"\n [attr.aria-label]=\"'Add reaction'\"\n [attr.aria-expanded]=\"isPickerVisible()\"\n [attr.aria-haspopup]=\"true\"\n title=\"Add reaction\"\n (click)=\"togglePicker($event)\"\n (mousedown)=\"$event.stopPropagation()\"\n >\n <span class=\"ax-reaction-add-icon\" aria-hidden=\"true\"></span>\n </button>\n\n <ax-popover\n #pickerPopover\n [target]=\"addButton\"\n [openOn]=\"'manual'\"\n [closeOn]=\"'clickOut'\"\n [placement]=\"'bottom-start'\"\n panelClass=\"ax-reaction-picker-panel\"\n (onOpened)=\"onPickerOpened()\"\n (onClosed)=\"onPickerClosed()\"\n >\n <ax-emoji-picker (selected)=\"onPickerSelected($event)\" />\n </ax-popover>\n }\n</div>\n", styles: ["@layer properties;@layer components{ax-reaction{--ax-comp-reaction-gap: .25rem;--ax-comp-reaction-item-gap: .25rem;--ax-comp-reaction-item-padding-x: .4rem;--ax-comp-reaction-item-padding-y: .125rem;--ax-comp-reaction-item-min-height: 1.5rem;--ax-comp-reaction-item-radius: 9999px;--ax-comp-reaction-item-font-size: .6875rem;--ax-comp-reaction-item-bg: var(--color-surface);--ax-comp-reaction-item-border: var(--color-border-lightest);--ax-comp-reaction-item-color: var(--color-on-surface);--ax-comp-reaction-item-hover-bg: var(--color-lightest);--ax-comp-reaction-item-selected-bg: color-mix(in srgb, rgba(var(--ax-sys-color-primary-surface)) 18%, rgba(var(--ax-sys-color-surface)));--ax-comp-reaction-item-selected-border: var(--color-border-primary);position:relative;display:inline-flex;align-items:center}@supports (color: color-mix(in lab,red,red)){ax-reaction{--ax-comp-reaction-item-selected-bg: color-mix(in oklab, var(--color-primary) 18%, var(--color-surface))}}ax-reaction .ax-reaction{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var(--ax-comp-reaction-gap)}ax-reaction .ax-reaction-item{display:inline-flex;align-items:center;justify-content:center;border-radius:calc(infinity * 1px);border-style:var(--tw-border-style);border-width:1px;gap:var(--ax-comp-reaction-item-gap);min-height:var(--ax-comp-reaction-item-min-height);padding:var(--ax-comp-reaction-item-padding-y) var(--ax-comp-reaction-item-padding-x);border-radius:var(--ax-comp-reaction-item-radius);border-color:var(--ax-comp-reaction-item-border);background-color:var(--ax-comp-reaction-item-bg);color:var(--ax-comp-reaction-item-color);font-size:var(--ax-comp-reaction-item-font-size);line-height:1;cursor:default}ax-reaction .ax-reaction-item ax-emoji{pointer-events:none}ax-reaction .ax-reaction-item-interactive,ax-reaction .ax-reaction-add{cursor:pointer}:is(ax-reaction .ax-reaction-item-interactive,ax-reaction .ax-reaction-add):hover{background-color:var(--ax-comp-reaction-item-hover-bg);border-color:var(--color-border-light)}:is(ax-reaction .ax-reaction-item-interactive,ax-reaction .ax-reaction-add):focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}ax-reaction .ax-reaction-item-selected{background-color:var(--ax-comp-reaction-item-selected-bg);border-color:var(--ax-comp-reaction-item-selected-border)}ax-reaction .ax-reaction-count{--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);color:var(--ax-comp-reaction-item-color);opacity:.7}ax-reaction .ax-reaction-item-selected .ax-reaction-count{color:var(--color-primary);opacity:.95}ax-reaction .ax-reaction-add{aspect-ratio:1 / 1;min-width:1.5rem;padding-inline:calc(var(--spacing, .25rem) * 0)}ax-reaction .ax-reaction-add-icon{position:relative;display:block;width:calc(var(--spacing, .25rem) * 2.5);height:calc(var(--spacing, .25rem) * 2.5)}ax-reaction .ax-reaction-add-icon:before,ax-reaction .ax-reaction-add-icon:after{position:absolute;inset:calc(var(--spacing, .25rem) * 0);margin:auto;border-radius:calc(infinity * 1px);content:\"\";background-color:currentColor}ax-reaction .ax-reaction-add-icon:before{width:100%;height:1.5px}ax-reaction .ax-reaction-add-icon:after{width:1.5px;height:100%}ax-reaction ax-popover{display:contents}.ax-reaction-picker-panel ax-emoji-picker{width:min(22rem,92vw);border:none;box-shadow:none;border-radius:0}}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-ordinal{syntax: \"*\"; inherits: false;}@property --tw-slashed-zero{syntax: \"*\"; inherits: false;}@property --tw-numeric-figure{syntax: \"*\"; inherits: false;}@property --tw-numeric-spacing{syntax: \"*\"; inherits: false;}@property --tw-numeric-fraction{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-border-style: solid;--tw-font-weight: initial;--tw-ordinal: initial;--tw-slashed-zero: initial;--tw-numeric-figure: initial;--tw-numeric-spacing: initial;--tw-numeric-fraction: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXEmojiComponent, selector: "ax-emoji", inputs: ["emoji", "appearance", "size"] }, { kind: "component", type: AXEmojiPickerComponent, selector: "ax-emoji-picker", inputs: ["items", "size", "appearance", "showSearch", "showRecent", "columns", "searchPlaceholder", "excludeCategories", "excludeCodes", "excludeUnicode", "recentItems"], outputs: ["selected", "recentChanged"] }, { kind: "component", type: AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disablePanelClass", "visualContextScope", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "restoreFocusOnClose", "openAfter", "closeAfter", "closeOnScroll", "closeOnNavigation", "backdropClass", "panelClass", "adaptivityEnabled", "draggable"], outputs: ["onOpened", "onClosed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
117
120
|
}
|
|
118
121
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXReactionComponent, decorators: [{
|
|
119
122
|
type: Component,
|
|
120
123
|
args: [{ selector: 'ax-reaction', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
121
124
|
class: 'ax-reaction-host',
|
|
122
125
|
'[class.ax-reaction-editable]': 'editable()',
|
|
123
|
-
}, imports: [AXEmojiComponent, AXEmojiPickerComponent, AXPopoverComponent], providers: [{ provide: AXComponent, useExisting: AXReactionComponent }], template: "<div class=\"ax-reaction\">\n @for (item of items(); track item.emoji.
|
|
124
|
-
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], showPicker: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPicker", required: false }] }], add: [{ type: i0.Output, args: ["add"] }], remove: [{ type: i0.Output, args: ["remove"] }], pickerPopover: [{ type: i0.ViewChild, args: ['pickerPopover', { isSignal: true }] }] } });
|
|
126
|
+
}, imports: [AXEmojiComponent, AXEmojiPickerComponent, AXPopoverComponent], providers: [{ provide: AXComponent, useExisting: AXReactionComponent }], template: "<div class=\"ax-reaction\">\n @for (item of items(); track item.emoji.unicode) {\n <button\n type=\"button\"\n class=\"ax-reaction-item\"\n [class.ax-reaction-item-selected]=\"item.selected\"\n [class.ax-reaction-item-interactive]=\"editable()\"\n [attr.aria-label]=\"itemAriaLabel(item)\"\n [attr.aria-pressed]=\"editable() || item.selected ? !!item.selected : null\"\n [title]=\"item.emoji.name\"\n (click)=\"onItemClick(item)\"\n >\n <ax-emoji [emoji]=\"item.emoji\" [size]=\"size()\" />\n\n <span class=\"ax-reaction-count\">\n {{ item.count }}\n </span>\n </button>\n }\n\n @if (editable() && showAddButton()) {\n <button\n #addButton\n type=\"button\"\n class=\"ax-reaction-item ax-reaction-add\"\n [class.ax-reaction-item-selected]=\"isPickerVisible()\"\n [attr.aria-label]=\"'Add reaction'\"\n [attr.aria-expanded]=\"isPickerVisible()\"\n [attr.aria-haspopup]=\"true\"\n title=\"Add reaction\"\n (click)=\"togglePicker($event)\"\n (mousedown)=\"$event.stopPropagation()\"\n >\n <span class=\"ax-reaction-add-icon\" aria-hidden=\"true\"></span>\n </button>\n\n <ax-popover\n #pickerPopover\n [target]=\"addButton\"\n [openOn]=\"'manual'\"\n [closeOn]=\"'clickOut'\"\n [placement]=\"'bottom-start'\"\n panelClass=\"ax-reaction-picker-panel\"\n (onOpened)=\"onPickerOpened()\"\n (onClosed)=\"onPickerClosed()\"\n >\n <ax-emoji-picker (selected)=\"onPickerSelected($event)\" />\n </ax-popover>\n }\n</div>\n", styles: ["@layer properties;@layer components{ax-reaction{--ax-comp-reaction-gap: .25rem;--ax-comp-reaction-item-gap: .25rem;--ax-comp-reaction-item-padding-x: .4rem;--ax-comp-reaction-item-padding-y: .125rem;--ax-comp-reaction-item-min-height: 1.5rem;--ax-comp-reaction-item-radius: 9999px;--ax-comp-reaction-item-font-size: .6875rem;--ax-comp-reaction-item-bg: var(--color-surface);--ax-comp-reaction-item-border: var(--color-border-lightest);--ax-comp-reaction-item-color: var(--color-on-surface);--ax-comp-reaction-item-hover-bg: var(--color-lightest);--ax-comp-reaction-item-selected-bg: color-mix(in srgb, rgba(var(--ax-sys-color-primary-surface)) 18%, rgba(var(--ax-sys-color-surface)));--ax-comp-reaction-item-selected-border: var(--color-border-primary);position:relative;display:inline-flex;align-items:center}@supports (color: color-mix(in lab,red,red)){ax-reaction{--ax-comp-reaction-item-selected-bg: color-mix(in oklab, var(--color-primary) 18%, var(--color-surface))}}ax-reaction .ax-reaction{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var(--ax-comp-reaction-gap)}ax-reaction .ax-reaction-item{display:inline-flex;align-items:center;justify-content:center;border-radius:calc(infinity * 1px);border-style:var(--tw-border-style);border-width:1px;gap:var(--ax-comp-reaction-item-gap);min-height:var(--ax-comp-reaction-item-min-height);padding:var(--ax-comp-reaction-item-padding-y) var(--ax-comp-reaction-item-padding-x);border-radius:var(--ax-comp-reaction-item-radius);border-color:var(--ax-comp-reaction-item-border);background-color:var(--ax-comp-reaction-item-bg);color:var(--ax-comp-reaction-item-color);font-size:var(--ax-comp-reaction-item-font-size);line-height:1;cursor:default}ax-reaction .ax-reaction-item ax-emoji{pointer-events:none}ax-reaction .ax-reaction-item-interactive,ax-reaction .ax-reaction-add{cursor:pointer}:is(ax-reaction .ax-reaction-item-interactive,ax-reaction .ax-reaction-add):hover{background-color:var(--ax-comp-reaction-item-hover-bg);border-color:var(--color-border-light)}:is(ax-reaction .ax-reaction-item-interactive,ax-reaction .ax-reaction-add):focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}ax-reaction .ax-reaction-item-selected{background-color:var(--ax-comp-reaction-item-selected-bg);border-color:var(--ax-comp-reaction-item-selected-border)}ax-reaction .ax-reaction-count{--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);color:var(--ax-comp-reaction-item-color);opacity:.7}ax-reaction .ax-reaction-item-selected .ax-reaction-count{color:var(--color-primary);opacity:.95}ax-reaction .ax-reaction-add{aspect-ratio:1 / 1;min-width:1.5rem;padding-inline:calc(var(--spacing, .25rem) * 0)}ax-reaction .ax-reaction-add-icon{position:relative;display:block;width:calc(var(--spacing, .25rem) * 2.5);height:calc(var(--spacing, .25rem) * 2.5)}ax-reaction .ax-reaction-add-icon:before,ax-reaction .ax-reaction-add-icon:after{position:absolute;inset:calc(var(--spacing, .25rem) * 0);margin:auto;border-radius:calc(infinity * 1px);content:\"\";background-color:currentColor}ax-reaction .ax-reaction-add-icon:before{width:100%;height:1.5px}ax-reaction .ax-reaction-add-icon:after{width:1.5px;height:100%}ax-reaction ax-popover{display:contents}.ax-reaction-picker-panel ax-emoji-picker{width:min(22rem,92vw);border:none;box-shadow:none;border-radius:0}}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-ordinal{syntax: \"*\"; inherits: false;}@property --tw-slashed-zero{syntax: \"*\"; inherits: false;}@property --tw-numeric-figure{syntax: \"*\"; inherits: false;}@property --tw-numeric-spacing{syntax: \"*\"; inherits: false;}@property --tw-numeric-fraction{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-border-style: solid;--tw-font-weight: initial;--tw-ordinal: initial;--tw-slashed-zero: initial;--tw-numeric-figure: initial;--tw-numeric-spacing: initial;--tw-numeric-fraction: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
|
|
127
|
+
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], showAddButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAddButton", required: false }] }], showPicker: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPicker", required: false }] }], add: [{ type: i0.Output, args: ["add"] }], remove: [{ type: i0.Output, args: ["remove"] }], pickerPopover: [{ type: i0.ViewChild, args: ['pickerPopover', { isSignal: true }] }] } });
|
|
125
128
|
|
|
126
129
|
class AXReactionModule {
|
|
127
130
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXReactionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-reaction.mjs","sources":["../../../../packages/components/reaction/src/lib/reaction.component.ts","../../../../packages/components/reaction/src/lib/reaction.component.html","../../../../packages/components/reaction/src/lib/reaction.module.ts","../../../../packages/components/reaction/src/acorex-components-reaction.ts"],"sourcesContent":["import { AXComponent } from '@acorex/cdk/common';\nimport { AXEmoji } from '@acorex/core/constants';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n input,\n output,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXEmojiComponent } from '@acorex/components/emoji';\nimport { AXEmojiPickerComponent } from '@acorex/components/emojipicker';\nimport { AXPopoverComponent } from '@acorex/components/popover';\nimport { AXReactionItem } from './reaction.type';\n\n/**\n * Telegram-style reaction chips for chat messages.\n * Renders emojis with {@link AXEmojiComponent} and opens {@link AXEmojiPickerComponent}\n * inside {@link AXPopoverComponent} when editable.\n *\n * @category Components\n */\n@Component({\n selector: 'ax-reaction',\n templateUrl: './reaction.component.html',\n styleUrls: ['./reaction.component.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'ax-reaction-host',\n '[class.ax-reaction-editable]': 'editable()',\n },\n imports: [AXEmojiComponent, AXEmojiPickerComponent, AXPopoverComponent],\n providers: [{ provide: AXComponent, useExisting: AXReactionComponent }],\n})\nexport class AXReactionComponent {\n /**\n * Aggregated reactions to display.\n *\n * @defaultValue []\n */\n readonly items = input<readonly AXReactionItem[]>([]);\n\n /**\n * Rendered emoji size in pixels.\n *\n * @defaultValue 18\n */\n readonly size = input(18);\n\n /**\n * When true, reactions are interactive and an add button opens the emoji picker popover.\n *\n * @defaultValue false\n */\n readonly editable = input(false);\n\n /**\n * When true, the emoji picker popover is opened.\n *\n * @defaultValue false\n */\n readonly showPicker = input(false);\n\n /**\n * Emits when the user selects a new reaction or an unselected existing one.\n */\n readonly add = output<AXEmoji>();\n\n /**\n * Emits when the user removes their own reaction.\n */\n readonly remove = output<AXEmoji>();\n\n private readonly pickerPopover = viewChild<AXPopoverComponent>('pickerPopover');\n\n /** Whether the emoji picker popover is currently open. */\n protected readonly pickerOpen = signal(false);\n\n /** Whether the add button should appear pressed while the picker is open. */\n protected readonly isPickerVisible = computed(() => this.showPicker() || this.pickerOpen());\n\n constructor() {\n effect(() => {\n const show = this.showPicker();\n const popover = this.pickerPopover();\n if (!popover) {\n return;\n }\n\n if (show && !popover.isOpen) {\n void popover.open();\n }\n });\n }\n\n /** Toggles a reaction without mutating counts; parent owns state. */\n protected onItemClick(item: AXReactionItem): void {\n if (!this.editable()) {\n return;\n }\n\n if (item.selected) {\n this.remove.emit(item.emoji);\n return;\n }\n\n this.add.emit(item.emoji);\n }\n\n /** Opens or closes the emoji picker popover. */\n protected togglePicker(event?: Event): void {\n event?.preventDefault();\n event?.stopPropagation();\n\n const popover = this.pickerPopover();\n if (!popover) {\n return;\n }\n\n if (popover.isOpen) {\n popover.close();\n return;\n }\n\n void popover.open();\n }\n\n /** Forwards a picker selection as `add` and closes the popover. */\n protected onPickerSelected(emoji: AXEmoji): void {\n this.add.emit(emoji);\n this.pickerPopover()?.close();\n }\n\n /** Syncs the add-button pressed state when the popover opens. */\n protected onPickerOpened(): void {\n this.pickerOpen.set(true);\n }\n\n /** Syncs the add-button pressed state when the popover closes. */\n protected onPickerClosed(): void {\n this.pickerOpen.set(false);\n }\n\n /** Accessible name for an existing reaction chip. */\n protected itemAriaLabel(item: AXReactionItem): string {\n const selected = item.selected ? ', selected' : '';\n return `${item.emoji.name}, ${item.count}${selected}`;\n }\n}\n","<div class=\"ax-reaction\">\n @for (item of items(); track item.emoji.code) {\n <button\n type=\"button\"\n class=\"ax-reaction-item\"\n [class.ax-reaction-item-selected]=\"item.selected\"\n [class.ax-reaction-item-interactive]=\"editable()\"\n [attr.aria-label]=\"itemAriaLabel(item)\"\n [attr.aria-pressed]=\"item.selected ? true : null\"\n [title]=\"item.emoji.name\"\n (click)=\"onItemClick(item)\"\n >\n <ax-emoji [emoji]=\"item.emoji\" [size]=\"size()\" />\n\n <span class=\"ax-reaction-count\">\n {{ item.count }}\n </span>\n </button>\n }\n\n @if (editable()) {\n <button\n #addButton\n type=\"button\"\n class=\"ax-reaction-item ax-reaction-add\"\n [class.ax-reaction-item-selected]=\"isPickerVisible()\"\n [attr.aria-label]=\"'Add reaction'\"\n [attr.aria-expanded]=\"isPickerVisible()\"\n [attr.aria-haspopup]=\"true\"\n title=\"Add reaction\"\n (click)=\"togglePicker($event)\"\n (mousedown)=\"$event.stopPropagation()\"\n >\n <span class=\"ax-reaction-add-icon\" aria-hidden=\"true\"></span>\n </button>\n\n <ax-popover\n #pickerPopover\n [target]=\"addButton\"\n [openOn]=\"'manual'\"\n [closeOn]=\"'clickOut'\"\n [placement]=\"'bottom-start'\"\n panelClass=\"ax-reaction-picker-panel\"\n (onOpened)=\"onPickerOpened()\"\n (onClosed)=\"onPickerClosed()\"\n >\n <ax-emoji-picker (selected)=\"onPickerSelected($event)\" />\n </ax-popover>\n }\n</div>\n","import { NgModule } from '@angular/core';\nimport { AXReactionComponent } from './reaction.component';\n\n@NgModule({\n imports: [AXReactionComponent],\n exports: [AXReactionComponent],\n})\nexport class AXReactionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAkBA;;;;;;AAMG;MAcU,mBAAmB,CAAA;AA+C9B,IAAA,WAAA,GAAA;AA9CA;;;;AAIG;QACM,IAAA,CAAA,KAAK,GAAG,KAAK,CAA4B,EAAE;kFAAC;AAErD;;;;AAIG;QACM,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,EAAE;iFAAC;AAEzB;;;;AAIG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK;qFAAC;AAEhC;;;;AAIG;QACM,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,KAAK;uFAAC;AAElC;;AAEG;QACM,IAAA,CAAA,GAAG,GAAG,MAAM,EAAW;AAEhC;;AAEG;QACM,IAAA,CAAA,MAAM,GAAG,MAAM,EAAW;QAElB,IAAA,CAAA,aAAa,GAAG,SAAS,CAAqB,eAAe;0FAAC;;QAG5D,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,KAAK;uFAAC;;AAG1B,QAAA,IAAA,CAAA,eAAe,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE;4FAAC;QAGzF,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE;AAC9B,YAAA,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE;YACpC,IAAI,CAAC,OAAO,EAAE;gBACZ;YACF;AAEA,YAAA,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;AAC3B,gBAAA,KAAK,OAAO,CAAC,IAAI,EAAE;YACrB;AACF,QAAA,CAAC,CA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zC;AACJ,wBAAA,KAAK,EAAE,kBAAkB;AACzB,wBAAA,8BAA8B,EAAE,YAAY;AAC7C,qBAAA,EAAA,OAAA,EACQ,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,kBAAkB,CAAC,EAAA,SAAA,EAC5D,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAA,mBAAqB,EAAE,CAAC,EAAA,QAAA,EAAA,uhDAAA,EAAA,MAAA,EAAA,CAAA,q1IAAA,CAAA,EAAA;ujBAyCR,eAAe,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;MEtEnE,gBAAgB,CAAA;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,OAAA,EAAA,CAHjB,mBAAmB,CAAA,EAAA,OAAA,EAAA,CACnB,mBAAmB,CAAA,EAAA,CAAA,CAAA;AAElB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHjB,mBAAmB,CAAA,EAAA,CAAA,CAAA;;2FAGlB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,mBAAmB,CAAC;oBAC9B,OAAO,EAAE,CAAC,mBAAmB,CAAC;AAC/B,iBAAA;;;ACND;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"acorex-components-reaction.mjs","sources":["../../../../packages/components/reaction/src/lib/reaction.component.ts","../../../../packages/components/reaction/src/lib/reaction.component.html","../../../../packages/components/reaction/src/lib/reaction.module.ts","../../../../packages/components/reaction/src/acorex-components-reaction.ts"],"sourcesContent":["import { AXComponent } from '@acorex/cdk/common';\nimport { AXEmoji } from '@acorex/core/constants';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n input,\n output,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXEmojiComponent } from '@acorex/components/emoji';\nimport { AXEmojiPickerComponent } from '@acorex/components/emojipicker';\nimport { AXPopoverComponent } from '@acorex/components/popover';\nimport { AXReactionItem } from './reaction.type';\n\n/**\n * Telegram-style reaction chips for chat messages.\n * Renders emojis with {@link AXEmojiComponent} and opens {@link AXEmojiPickerComponent}\n * inside {@link AXPopoverComponent} when editable.\n *\n * @category Components\n */\n@Component({\n selector: 'ax-reaction',\n templateUrl: './reaction.component.html',\n styleUrls: ['./reaction.component.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'ax-reaction-host',\n '[class.ax-reaction-editable]': 'editable()',\n },\n imports: [AXEmojiComponent, AXEmojiPickerComponent, AXPopoverComponent],\n providers: [{ provide: AXComponent, useExisting: AXReactionComponent }],\n})\nexport class AXReactionComponent {\n /**\n * Aggregated reactions to display.\n *\n * @defaultValue []\n */\n readonly items = input<readonly AXReactionItem[]>([]);\n\n /**\n * Rendered emoji size in pixels.\n *\n * @defaultValue 18\n */\n readonly size = input(18);\n\n /**\n * When true, reactions are interactive and an add button opens the emoji picker popover.\n *\n * @defaultValue false\n */\n readonly editable = input(false);\n\n /** Whether to show the add button and picker when editable. */\n readonly showAddButton = input(true);\n\n /**\n * When true, the emoji picker popover is opened.\n *\n * @defaultValue false\n */\n readonly showPicker = input(false);\n\n /**\n * Emits when the user selects a new reaction or an unselected existing one.\n */\n readonly add = output<AXEmoji>();\n\n /**\n * Emits when the user removes their own reaction.\n */\n readonly remove = output<AXEmoji>();\n\n private readonly pickerPopover = viewChild<AXPopoverComponent>('pickerPopover');\n\n /** Whether the emoji picker popover is currently open. */\n protected readonly pickerOpen = signal(false);\n\n /** Whether the add button should appear pressed while the picker is open. */\n protected readonly isPickerVisible = computed(() => this.showPicker() || this.pickerOpen());\n\n constructor() {\n effect(() => {\n const show = this.showPicker();\n const popover = this.pickerPopover();\n if (!popover) {\n return;\n }\n\n if (show && !popover.isOpen) {\n void popover.open();\n }\n });\n }\n\n /** Toggles a reaction without mutating counts; parent owns state. */\n protected onItemClick(item: AXReactionItem): void {\n if (!this.editable()) {\n return;\n }\n\n if (item.selected) {\n this.remove.emit(item.emoji);\n return;\n }\n\n this.add.emit(item.emoji);\n }\n\n /** Opens or closes the emoji picker popover. */\n protected togglePicker(event?: Event): void {\n event?.preventDefault();\n event?.stopPropagation();\n\n const popover = this.pickerPopover();\n if (!popover) {\n return;\n }\n\n if (popover.isOpen) {\n popover.close();\n return;\n }\n\n void popover.open();\n }\n\n /** Forwards a picker selection as `add` and closes the popover. */\n protected onPickerSelected(emoji: AXEmoji): void {\n this.add.emit(emoji);\n this.pickerPopover()?.close();\n }\n\n /** Syncs the add-button pressed state when the popover opens. */\n protected onPickerOpened(): void {\n this.pickerOpen.set(true);\n }\n\n /** Syncs the add-button pressed state when the popover closes. */\n protected onPickerClosed(): void {\n this.pickerOpen.set(false);\n }\n\n /** Accessible name for an existing reaction chip. */\n protected itemAriaLabel(item: AXReactionItem): string {\n const selected = item.selected ? ', selected' : '';\n return `${item.emoji.name}, ${item.count}${selected}`;\n }\n}\n","<div class=\"ax-reaction\">\n @for (item of items(); track item.emoji.unicode) {\n <button\n type=\"button\"\n class=\"ax-reaction-item\"\n [class.ax-reaction-item-selected]=\"item.selected\"\n [class.ax-reaction-item-interactive]=\"editable()\"\n [attr.aria-label]=\"itemAriaLabel(item)\"\n [attr.aria-pressed]=\"editable() || item.selected ? !!item.selected : null\"\n [title]=\"item.emoji.name\"\n (click)=\"onItemClick(item)\"\n >\n <ax-emoji [emoji]=\"item.emoji\" [size]=\"size()\" />\n\n <span class=\"ax-reaction-count\">\n {{ item.count }}\n </span>\n </button>\n }\n\n @if (editable() && showAddButton()) {\n <button\n #addButton\n type=\"button\"\n class=\"ax-reaction-item ax-reaction-add\"\n [class.ax-reaction-item-selected]=\"isPickerVisible()\"\n [attr.aria-label]=\"'Add reaction'\"\n [attr.aria-expanded]=\"isPickerVisible()\"\n [attr.aria-haspopup]=\"true\"\n title=\"Add reaction\"\n (click)=\"togglePicker($event)\"\n (mousedown)=\"$event.stopPropagation()\"\n >\n <span class=\"ax-reaction-add-icon\" aria-hidden=\"true\"></span>\n </button>\n\n <ax-popover\n #pickerPopover\n [target]=\"addButton\"\n [openOn]=\"'manual'\"\n [closeOn]=\"'clickOut'\"\n [placement]=\"'bottom-start'\"\n panelClass=\"ax-reaction-picker-panel\"\n (onOpened)=\"onPickerOpened()\"\n (onClosed)=\"onPickerClosed()\"\n >\n <ax-emoji-picker (selected)=\"onPickerSelected($event)\" />\n </ax-popover>\n }\n</div>\n","import { NgModule } from '@angular/core';\nimport { AXReactionComponent } from './reaction.component';\n\n@NgModule({\n imports: [AXReactionComponent],\n exports: [AXReactionComponent],\n})\nexport class AXReactionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAkBA;;;;;;AAMG;MAcU,mBAAmB,CAAA;AAkD9B,IAAA,WAAA,GAAA;AAjDA;;;;AAIG;QACM,IAAA,CAAA,KAAK,GAAG,KAAK,CAA4B,EAAE;kFAAC;AAErD;;;;AAIG;QACM,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,EAAE;iFAAC;AAEzB;;;;AAIG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK;qFAAC;;QAGvB,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,IAAI;0FAAC;AAEpC;;;;AAIG;QACM,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,KAAK;uFAAC;AAElC;;AAEG;QACM,IAAA,CAAA,GAAG,GAAG,MAAM,EAAW;AAEhC;;AAEG;QACM,IAAA,CAAA,MAAM,GAAG,MA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AAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHjB,mBAAmB,CAAA,EAAA,CAAA,CAAA;;2FAGlB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,mBAAmB,CAAC;oBAC9B,OAAO,EAAE,CAAC,mBAAmB,CAAC;AAC/B,iBAAA;;;ACND;;AAEG;;"}
|
|
@@ -2,9 +2,9 @@ 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, NgTemplateOutlet } from '@angular/common';
|
|
5
|
+
import { DOCUMENT, 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, NgZone, afterNextRender, effect, TemplateRef, Directive, untracked, DestroyRef, ViewContainerRef, contentChild, output, numberAttribute, forwardRef, model, viewChild, NgModule } from '@angular/core';
|
|
7
|
+
import { inject, signal, computed, Injectable, Pipe, 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
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';
|
|
@@ -211,6 +211,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
211
211
|
class AXTextEditorSlot {
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
const COMMAND_SHORTCUTS = {
|
|
215
|
+
bold: 'B',
|
|
216
|
+
italic: 'I',
|
|
217
|
+
underline: 'U',
|
|
218
|
+
strike: 'Shift + S',
|
|
219
|
+
code: 'E',
|
|
220
|
+
spoiler: 'Shift + P',
|
|
221
|
+
};
|
|
222
|
+
class AXTextEditorCommandTitlePipe {
|
|
223
|
+
constructor() {
|
|
224
|
+
// Match ProseMirror's platform detection for the Mod key.
|
|
225
|
+
this.modifier = /Mac|iP(hone|[oa]d)/.test(inject(DOCUMENT).defaultView?.navigator.platform ?? '') ? 'Cmd' : 'Ctrl';
|
|
226
|
+
}
|
|
227
|
+
transform(label, command) {
|
|
228
|
+
const shortcut = COMMAND_SHORTCUTS[command];
|
|
229
|
+
// Isolate the shortcut so its key order is preserved in RTL tooltips.
|
|
230
|
+
return label && shortcut ? `${label} (\u2066${this.modifier} + ${shortcut}\u2069)` : label;
|
|
231
|
+
}
|
|
232
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorCommandTitlePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
233
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorCommandTitlePipe, isStandalone: true, name: "axTextEditorCommandTitle" }); }
|
|
234
|
+
}
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorCommandTitlePipe, decorators: [{
|
|
236
|
+
type: Pipe,
|
|
237
|
+
args: [{ name: 'axTextEditorCommandTitle' }]
|
|
238
|
+
}] });
|
|
239
|
+
|
|
214
240
|
const TOGGLE_COMMANDS = new Set([
|
|
215
241
|
'bold',
|
|
216
242
|
'italic',
|
|
@@ -261,7 +287,7 @@ class AXTextEditorCommandComponent extends AXTextEditorSlot {
|
|
|
261
287
|
[toggleable]="toggleable()"
|
|
262
288
|
[selected]="active()"
|
|
263
289
|
[disabled]="!enabled()"
|
|
264
|
-
[attr.title]="label() | translate | async"
|
|
290
|
+
[attr.title]="label() | translate | async | axTextEditorCommandTitle: command()"
|
|
265
291
|
(onClick)="execute()"
|
|
266
292
|
>
|
|
267
293
|
@if (icon()) {
|
|
@@ -270,7 +296,7 @@ class AXTextEditorCommandComponent extends AXTextEditorSlot {
|
|
|
270
296
|
<ng-content></ng-content>
|
|
271
297
|
}
|
|
272
298
|
</ax-button>
|
|
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 }); }
|
|
299
|
+
`, 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" }, { kind: "pipe", type: AXTextEditorCommandTitlePipe, name: "axTextEditorCommandTitle" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
274
300
|
}
|
|
275
301
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorCommandComponent, decorators: [{
|
|
276
302
|
type: Component,
|
|
@@ -285,7 +311,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
285
311
|
[toggleable]="toggleable()"
|
|
286
312
|
[selected]="active()"
|
|
287
313
|
[disabled]="!enabled()"
|
|
288
|
-
[attr.title]="label() | translate | async"
|
|
314
|
+
[attr.title]="label() | translate | async | axTextEditorCommandTitle: command()"
|
|
289
315
|
(onClick)="execute()"
|
|
290
316
|
>
|
|
291
317
|
@if (icon()) {
|
|
@@ -297,7 +323,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
297
323
|
`,
|
|
298
324
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
299
325
|
encapsulation: ViewEncapsulation.None,
|
|
300
|
-
imports: [AXButtonComponent, AXDecoratorIconComponent, AXTranslatorPipe, AsyncPipe],
|
|
326
|
+
imports: [AXButtonComponent, AXDecoratorIconComponent, AXTranslatorPipe, AsyncPipe, AXTextEditorCommandTitlePipe],
|
|
301
327
|
providers: [
|
|
302
328
|
{ provide: AXComponent, useExisting: AXTextEditorCommandComponent },
|
|
303
329
|
{ provide: AXTextEditorSlot, useExisting: AXTextEditorCommandComponent },
|
|
@@ -398,14 +424,14 @@ class AXTextEditorContentComponent extends AXTextEditorSlot {
|
|
|
398
424
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: AXTextEditorContentComponent, isStandalone: true, selector: "ax-text-editor-content", providers: [
|
|
399
425
|
{ provide: AXComponent, useExisting: AXTextEditorContentComponent },
|
|
400
426
|
{ provide: AXTextEditorSlot, useExisting: AXTextEditorContentComponent },
|
|
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 }); }
|
|
427
|
+
], 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{-webkit-user-select:all;user-select:all}.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-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{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", ":is(.ax-text-editor-mention,.ax-conversation-mention){display:inline-flex;align-items:center;gap:.2rem;box-sizing:border-box;max-inline-size:calc(100% - .1rem);margin-inline:.05rem;padding-inline:.12rem .35rem;border-radius:999px;color:var(--ax-comp-mention-color, var(--ax-sys-color-primary, #1d4ed8));background:color-mix(in oklab,currentColor 14%,transparent);font-weight:600;line-height:1;vertical-align:middle}.ax-text-editor-prose p .ax-text-editor-mention{line-height:inherit;block-size:1lh;vertical-align:top}:is(.ax-text-editor-mention-text,.ax-conversation-mention-text){min-inline-size:0;overflow:hidden;line-height:1;text-overflow:ellipsis;white-space:nowrap}:is(.ax-text-editor-mention-avatar-host,.ax-conversation-mention-avatar){display:inline-flex;flex:none;align-items:center;justify-content:center;overflow:hidden;border-radius:999px;line-height:0}\n", "ax-text-editor .ax-text-editor-prose .ax-text-editor-spoiler,ax-conversation-emoji-text .ax-conversation-fmt-spoiler:not(.ax-conversation-fmt-spoiler-open){--ax-spoiler-particle: radial-gradient(circle, currentColor .45px, transparent .85px);--ax-spoiler-faint-particle: radial-gradient( circle, color-mix(in oklab, currentColor 55%, transparent) .3px, transparent .75px );background-image:var(--ax-spoiler-particle),var(--ax-spoiler-particle),var(--ax-spoiler-particle),var(--ax-spoiler-faint-particle),var(--ax-spoiler-faint-particle),var(--ax-spoiler-faint-particle),var(--ax-spoiler-faint-particle);background-size:19px 17px,23px 19px,29px 23px,17px 23px,31px 17px,23px 29px,29px 19px;background-position:1px -3px,-4px 2px,3px 5px,-7px 3px,5px -4px,-4px -7px,9px -8px;box-decoration-break:clone;-webkit-box-decoration-break:clone}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
402
428
|
}
|
|
403
429
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorContentComponent, decorators: [{
|
|
404
430
|
type: Component,
|
|
405
431
|
args: [{ selector: 'ax-text-editor-content', template: `<div class="ax-text-editor-surface" #surface></div>`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
|
406
432
|
{ provide: AXComponent, useExisting: AXTextEditorContentComponent },
|
|
407
433
|
{ provide: AXTextEditorSlot, useExisting: AXTextEditorContentComponent },
|
|
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{
|
|
434
|
+
], 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{-webkit-user-select:all;user-select:all}.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-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{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", ":is(.ax-text-editor-mention,.ax-conversation-mention){display:inline-flex;align-items:center;gap:.2rem;box-sizing:border-box;max-inline-size:calc(100% - .1rem);margin-inline:.05rem;padding-inline:.12rem .35rem;border-radius:999px;color:var(--ax-comp-mention-color, var(--ax-sys-color-primary, #1d4ed8));background:color-mix(in oklab,currentColor 14%,transparent);font-weight:600;line-height:1;vertical-align:middle}.ax-text-editor-prose p .ax-text-editor-mention{line-height:inherit;block-size:1lh;vertical-align:top}:is(.ax-text-editor-mention-text,.ax-conversation-mention-text){min-inline-size:0;overflow:hidden;line-height:1;text-overflow:ellipsis;white-space:nowrap}:is(.ax-text-editor-mention-avatar-host,.ax-conversation-mention-avatar){display:inline-flex;flex:none;align-items:center;justify-content:center;overflow:hidden;border-radius:999px;line-height:0}\n", "ax-text-editor .ax-text-editor-prose .ax-text-editor-spoiler,ax-conversation-emoji-text .ax-conversation-fmt-spoiler:not(.ax-conversation-fmt-spoiler-open){--ax-spoiler-particle: radial-gradient(circle, currentColor .45px, transparent .85px);--ax-spoiler-faint-particle: radial-gradient( circle, color-mix(in oklab, currentColor 55%, transparent) .3px, transparent .75px );background-image:var(--ax-spoiler-particle),var(--ax-spoiler-particle),var(--ax-spoiler-particle),var(--ax-spoiler-faint-particle),var(--ax-spoiler-faint-particle),var(--ax-spoiler-faint-particle),var(--ax-spoiler-faint-particle);background-size:19px 17px,23px 19px,29px 23px,17px 23px,31px 17px,23px 29px,29px 19px;background-position:1px -3px,-4px 2px,3px 5px,-7px 3px,5px -4px,-4px -7px,9px -8px;box-decoration-break:clone;-webkit-box-decoration-break:clone}\n"] }]
|
|
409
435
|
}], ctorParameters: () => [] });
|
|
410
436
|
|
|
411
437
|
/** Portrait for a mention. The template context is the mention item. */
|
|
@@ -741,7 +767,7 @@ class AXTextEditorInlineToolbarComponent extends AXTextEditorSlot {
|
|
|
741
767
|
<div class="ax-text-editor-inline-toolbar-tools">
|
|
742
768
|
<ng-content></ng-content>
|
|
743
769
|
</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 }); }
|
|
770
|
+
`, 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-text-editor-font-style>ax-text-editor-command[command=code]{display:flex;align-items:center}ax-text-editor-inline-toolbar .ax-text-editor-inline-toolbar-tools>ax-text-editor-font-style>ax-text-editor-command[command=code]:before{content:\"\";width:1px;height:1.25rem;margin-inline:.125rem;background-color:rgba(var(--ax-sys-color-border-light-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
771
|
}
|
|
746
772
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorInlineToolbarComponent, decorators: [{
|
|
747
773
|
type: Component,
|
|
@@ -760,7 +786,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
760
786
|
}, providers: [
|
|
761
787
|
{ provide: AXComponent, useExisting: AXTextEditorInlineToolbarComponent },
|
|
762
788
|
{ 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"] }]
|
|
789
|
+
], 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-text-editor-font-style>ax-text-editor-command[command=code]{display:flex;align-items:center}ax-text-editor-inline-toolbar .ax-text-editor-inline-toolbar-tools>ax-text-editor-font-style>ax-text-editor-command[command=code]:before{content:\"\";width:1px;height:1.25rem;margin-inline:.125rem;background-color:rgba(var(--ax-sys-color-border-light-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
790
|
}], ctorParameters: () => [] });
|
|
765
791
|
|
|
766
792
|
class AXTextEditorComponent extends classes((MXInputBaseValueComponent), MXLookComponent) {
|
|
@@ -851,11 +877,8 @@ class AXTextEditorComponent extends classes((MXInputBaseValueComponent), MXLookC
|
|
|
851
877
|
});
|
|
852
878
|
effect(() => {
|
|
853
879
|
const template = this.mentionAvatar()?.template ?? null;
|
|
854
|
-
const editor = this.editorService.editor();
|
|
855
880
|
untracked(() => {
|
|
856
881
|
this.editorService.mentionAvatarTemplate.set(template);
|
|
857
|
-
if (!editor)
|
|
858
|
-
return;
|
|
859
882
|
this.textEditor.setMentionAvatarRenderer(template ? (host, item) => this.mountMentionAvatar(template, host, item) : null);
|
|
860
883
|
});
|
|
861
884
|
});
|
|
@@ -1512,7 +1535,7 @@ class AXTextEditorSpoilerComponent extends AXTextEditorSlot {
|
|
|
1512
1535
|
[toggleable]="true"
|
|
1513
1536
|
[selected]="active()"
|
|
1514
1537
|
[disabled]="!enabled()"
|
|
1515
|
-
[attr.title]="i18n.tools.spoiler | translate | async"
|
|
1538
|
+
[attr.title]="i18n.tools.spoiler | translate | async | axTextEditorCommandTitle: 'spoiler'"
|
|
1516
1539
|
(onClick)="execute()"
|
|
1517
1540
|
>
|
|
1518
1541
|
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
@@ -1526,7 +1549,7 @@ class AXTextEditorSpoilerComponent extends AXTextEditorSlot {
|
|
|
1526
1549
|
/>
|
|
1527
1550
|
</svg>
|
|
1528
1551
|
</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 }); }
|
|
1552
|
+
`, 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" }, { kind: "pipe", type: AXTextEditorCommandTitlePipe, name: "axTextEditorCommandTitle" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1530
1553
|
}
|
|
1531
1554
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditorSpoilerComponent, decorators: [{
|
|
1532
1555
|
type: Component,
|
|
@@ -1539,7 +1562,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
1539
1562
|
[toggleable]="true"
|
|
1540
1563
|
[selected]="active()"
|
|
1541
1564
|
[disabled]="!enabled()"
|
|
1542
|
-
[attr.title]="i18n.tools.spoiler | translate | async"
|
|
1565
|
+
[attr.title]="i18n.tools.spoiler | translate | async | axTextEditorCommandTitle: 'spoiler'"
|
|
1543
1566
|
(onClick)="execute()"
|
|
1544
1567
|
>
|
|
1545
1568
|
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
@@ -1553,7 +1576,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
1553
1576
|
/>
|
|
1554
1577
|
</svg>
|
|
1555
1578
|
</ax-button>
|
|
1556
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [AXButtonComponent, AXTranslatorPipe, AsyncPipe], providers: [
|
|
1579
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [AXButtonComponent, AXTranslatorPipe, AsyncPipe, AXTextEditorCommandTitlePipe], providers: [
|
|
1557
1580
|
{ provide: AXComponent, useExisting: AXTextEditorSpoilerComponent },
|
|
1558
1581
|
{ provide: AXTextEditorSlot, useExisting: AXTextEditorSpoilerComponent },
|
|
1559
1582
|
], styles: ["ax-text-editor-spoiler svg{display:block;width:1rem;height:1rem}\n"] }]
|