@acorex/components 20.3.48 → 20.3.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,11 @@
1
1
  import { AXComponent } from '@acorex/cdk/common';
2
- import { isPlatformBrowser, AsyncPipe, CommonModule } from '@angular/common';
2
+ import { isPlatformBrowser, AsyncPipe } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, DOCUMENT, PLATFORM_ID, ViewEncapsulation, Component, contentChild, viewChild, input, afterNextRender, model, NgModule } from '@angular/core';
5
- import * as i1 from '@acorex/components/accordion';
6
- import { AXAccordionModule } from '@acorex/components/accordion';
4
+ import { inject, DOCUMENT, PLATFORM_ID, ChangeDetectionStrategy, ViewEncapsulation, Component, contentChild, input, model, afterNextRender, NgModule } from '@angular/core';
7
5
  import { AXAvatarComponent } from '@acorex/components/avatar';
8
6
  import { AXTranslatorPipe, AXTranslationModule } from '@acorex/core/translation';
9
7
  import { AXDecoratorIconComponent, AXDecoratorGenericComponent, AXDecoratorModule } from '@acorex/components/decorators';
10
8
  import { AXButtonModule } from '@acorex/components/button';
11
- import { AXCollapseModule } from '@acorex/components/collapse';
12
9
  import { AXTextAreaModule } from '@acorex/components/text-area';
13
10
  import { AXWysiwygModule } from '@acorex/components/wysiwyg';
14
11
 
@@ -26,30 +23,23 @@ class AXCommentContainerComponent {
26
23
  * Scrolls to a specific comment reply by its ID and highlights it temporarily.
27
24
  *
28
25
  * @param id - The ID of the comment reply to scroll to
29
- * @returns void
30
26
  */
31
27
  scrollToReply(id) {
32
- if (isPlatformBrowser(this.platformID)) {
33
- const el = this.document.querySelector(`ax-comment-item[id=${id}]`);
34
- if (!el)
35
- return;
36
- el.scrollIntoView({ behavior: 'smooth', block: 'center' });
37
- const content = el?.firstElementChild?.children[1];
38
- const prevBg = content.style.background;
39
- content.style.borderRadius = '0.25rem';
40
- content.style.transition = 'background 1s ease-in-out';
41
- content.style.background = '#e2fffc';
42
- setTimeout(() => {
43
- content.style.background = prevBg || 'rgba(0, 0, 0, 0)';
44
- }, 1000);
45
- }
28
+ if (!isPlatformBrowser(this.platformID))
29
+ return;
30
+ const el = this.document.querySelector(`ax-comment-item[id="${id}"]`);
31
+ if (!el)
32
+ return;
33
+ el.scrollIntoView({ behavior: 'smooth', block: 'center' });
34
+ el.classList.add('ax-state-highlight');
35
+ setTimeout(() => el.classList.remove('ax-state-highlight'), 1500);
46
36
  }
47
37
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
48
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: AXCommentContainerComponent, isStandalone: true, selector: "ax-comment-container", providers: [{ provide: AXComponent, useExisting: AXCommentContainerComponent }], ngImport: i0, template: "<ng-content> </ng-content>\n", styles: ["ax-comment-container{width:100%}\n"], encapsulation: i0.ViewEncapsulation.None }); }
38
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: AXCommentContainerComponent, isStandalone: true, selector: "ax-comment-container", providers: [{ provide: AXComponent, useExisting: AXCommentContainerComponent }], ngImport: i0, template: '<ng-content />', isInline: true, styles: ["ax-comment-container{display:block;width:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
49
39
  }
50
40
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentContainerComponent, decorators: [{
51
41
  type: Component,
52
- args: [{ selector: 'ax-comment-container', encapsulation: ViewEncapsulation.None, providers: [{ provide: AXComponent, useExisting: AXCommentContainerComponent }], template: "<ng-content> </ng-content>\n", styles: ["ax-comment-container{width:100%}\n"] }]
42
+ args: [{ selector: 'ax-comment-container', template: '<ng-content />', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: AXComponent, useExisting: AXCommentContainerComponent }], styles: ["ax-comment-container{display:block;width:100%}\n"] }]
53
43
  }] });
54
44
 
55
45
  /**
@@ -58,43 +48,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
58
48
  * @category Components
59
49
  */
60
50
  class AXCommentItemComponent {
61
- /**
62
- * @ignore
63
- */
64
51
  constructor() {
65
- /**
66
- * @ignore
67
- */
68
52
  this.avatar = contentChild(AXAvatarComponent, ...(ngDevMode ? [{ debugName: "avatar" }] : []));
69
- this.collapse = viewChild('c', ...(ngDevMode ? [{ debugName: "collapse" }] : []));
70
53
  this.replyCount = input(...(ngDevMode ? [undefined, { debugName: "replyCount" }] : []));
54
+ /** Two-way bindable state controlling whether nested replies are visible. */
55
+ this.repliesExpanded = model(false, ...(ngDevMode ? [{ debugName: "repliesExpanded" }] : []));
71
56
  afterNextRender(() => {
72
57
  this.avatar()?.size?.set(40);
73
58
  });
74
59
  }
75
- toggleCollapse() {
76
- this.collapse().toggle();
60
+ toggleReplies() {
61
+ this.repliesExpanded.update((v) => !v);
62
+ }
63
+ showReplies() {
64
+ this.repliesExpanded.set(true);
65
+ }
66
+ hideReplies() {
67
+ this.repliesExpanded.set(false);
77
68
  }
78
69
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
79
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.3", type: AXCommentItemComponent, isStandalone: true, selector: "ax-comment-item", inputs: { replyCount: { classPropertyName: "replyCount", publicName: "replyCount", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: AXComponent, useExisting: AXCommentItemComponent }], queries: [{ propertyName: "avatar", first: true, predicate: AXAvatarComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "collapse", first: true, predicate: ["c"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ax-comment-items\">\n <div class=\"ax-header-container\">\n <div class=\"ax-title-avatar-container\">\n <ng-content select=\"ax-avatar\"></ng-content>\n <ng-content select=\"ax-title\"></ng-content>\n <ng-content select=\"ax-comment-date\"></ng-content>\n </div>\n\n <div>\n <ng-content select=\"ax-comment-menu-options\"></ng-content>\n </div>\n </div>\n <div class=\"ax-content-container\">\n <ng-content select=\"ax-content\"></ng-content>\n <div class=\"ax-reaction-container\">\n <ng-content select=\"ax-comment-like\"></ng-content>\n <ng-content select=\"ax-comment-reply-text\"></ng-content>\n </div>\n </div>\n @if (replyCount()) {\n <div class=\"ax-comment-replies\">\n <ax-accordion-group look=\"none\" [accordion]=\"true\" [activeIndex]=\"1\">\n <ax-accordion-item\n #c\n [caption]=\"\n ('@acorex:comment.view' | translate | async) +\n ' ' +\n replyCount() +\n ' ' +\n ((replyCount() > 1 ? '@acorex:comment.replies' : '@acorex:comment.reply') | translate | async)\n \"\n [isCollapsed]=\"true\"\n >\n <ng-content select=\"ax-comment-item\"></ng-content>\n <ng-content select=\"ax-comment-reply-more\"></ng-content>\n </ax-accordion-item>\n </ax-accordion-group>\n </div>\n }\n</div>\n", styles: [".ax-comment-items{margin-bottom:.25rem}.ax-comment-items .ax-header-container{display:flex;align-items:center;justify-content:space-between}.ax-comment-items .ax-header-container .ax-title-avatar-container{display:flex;align-items:center}.ax-comment-items .ax-header-container ax-title{font-weight:500;padding:.5rem}.ax-comment-items .ax-content-container{margin-inline-start:3rem;display:flex;flex-direction:column;font-size:.875rem;opacity:80%}.ax-comment-items .ax-content-container .ax-reaction-container{margin-top:.75rem;display:flex}.ax-comment-items .ax-content-container .ax-reaction-container ax-comment-like{margin-inline-end:1.5rem}.ax-comment-items .ax-content-container .ax-reaction-container ax-comment-like,.ax-comment-items .ax-content-container .ax-reaction-container ax-comment-reply,.ax-comment-items .ax-content-container .ax-reaction-container ax-text{cursor:pointer}.ax-comment-items .ax-comment-replies{margin-inline-start:2rem}.ax-comment-items .ax-comment-replies .ax-collapse-header-container{font-weight:500;justify-content:unset;color:rgba(var(--ax-sys-color-primary-surface))}.ax-comment-items .ax-comment-replies ax-comment-reply-more{cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: AXAccordionModule }, { kind: "component", type: i1.AXAccordionItemComponent, selector: "ax-accordion-item", inputs: ["isCollapsed", "icon", "caption", "isLoading", "headerTemplate", "look", "disabled"], outputs: ["isCollapsedChange", "isLoadingChange", "onClick"] }, { kind: "component", type: i1.AXAccordionGroupComponent, selector: "ax-accordion-group", inputs: ["accordion", "activeIndex", "look", "collapsedOnItemClick"], outputs: ["activeIndexChange"] }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None }); }
70
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.3", type: AXCommentItemComponent, isStandalone: true, selector: "ax-comment-item", inputs: { replyCount: { classPropertyName: "replyCount", publicName: "replyCount", isSignal: true, isRequired: false, transformFunction: null }, repliesExpanded: { classPropertyName: "repliesExpanded", publicName: "repliesExpanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { repliesExpanded: "repliesExpandedChange" }, providers: [{ provide: AXComponent, useExisting: AXCommentItemComponent }], queries: [{ propertyName: "avatar", first: true, predicate: AXAvatarComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ax-comment-header\">\n <div class=\"ax-comment-header-start\">\n <ng-content select=\"ax-avatar\" />\n <div class=\"ax-comment-header-content\">\n <ng-content select=\"ax-title\" />\n <ng-content select=\"ax-comment-date\" />\n </div>\n </div>\n <ng-content select=\"ax-comment-menu-options\" />\n</div>\n\n<div class=\"ax-comment-body\">\n <ng-content select=\"ax-content\" />\n <div class=\"ax-comment-actions\">\n <ng-content select=\"ax-comment-like\" />\n <ng-content select=\"ax-comment-reply-text\" />\n </div>\n</div>\n\n@if (replyCount()) {\n <div class=\"ax-comment-replies\">\n <span class=\"ax-comment-replies-toggle\" (click)=\"toggleReplies()\">\n {{ (repliesExpanded() ? '@acorex:comment.hide' : '@acorex:comment.view') | translate | async }}\n {{ replyCount() }}\n {{ (replyCount() > 1 ? '@acorex:comment.replies' : '@acorex:comment.reply') | translate | async }}\n </span>\n @if (repliesExpanded()) {\n <div class=\"ax-comment-replies-content\">\n <ng-content select=\"ax-comment-item\" />\n <ng-content select=\"ax-comment-reply-more\" />\n </div>\n }\n </div>\n}\n", styles: ["ax-comment-item{--ax-comp-comment-spacing: 1rem;--ax-comp-comment-header-gap: .5rem;--ax-comp-comment-body-indent: 3rem;--ax-comp-comment-body-font-size: .875rem;--ax-comp-comment-reply-indent: 2.5rem;--ax-comp-comment-highlight-bg: rgba(var(--ax-sys-color-primary-surface), .1);display:block;padding:.25rem;border-radius:.25rem;transition:background 1s ease-in-out}ax-comment-item:not(:last-child){margin-bottom:var(--ax-comp-comment-spacing)}ax-comment-item.ax-state-highlight{background:var(--ax-comp-comment-highlight-bg)}ax-comment-item .ax-comment-header{display:flex;align-items:center;justify-content:space-between}ax-comment-item .ax-comment-header .ax-comment-header-start{display:flex;align-items:center;gap:var(--ax-comp-comment-header-gap)}ax-comment-item .ax-comment-header .ax-comment-header-start .ax-comment-header-content{display:flex;align-items:baseline;gap:.5rem}ax-comment-item .ax-comment-header ax-title{font-weight:500}ax-comment-item .ax-comment-body{margin-inline-start:var(--ax-comp-comment-body-indent);font-size:var(--ax-comp-comment-body-font-size);color:rgba(var(--ax-sys-color-on-surface));padding-top:.25rem}ax-comment-item .ax-comment-actions{display:flex;align-items:center;gap:1rem;margin-top:.5rem;font-size:var(--ax-comp-comment-body-font-size)}ax-comment-item .ax-comment-actions ax-comment-like,ax-comment-item .ax-comment-actions ax-comment-reply-text{cursor:pointer;-webkit-user-select:none;user-select:none}ax-comment-item .ax-comment-replies{margin-inline-start:var(--ax-comp-comment-reply-indent);margin-top:.5rem}ax-comment-item .ax-comment-replies .ax-comment-replies-toggle{display:inline-flex;align-items:center;gap:.25rem;cursor:pointer;-webkit-user-select:none;user-select:none;font-size:var(--ax-comp-comment-body-font-size);font-weight:500;color:rgba(var(--ax-sys-color-primary-surface))}ax-comment-item .ax-comment-replies .ax-comment-replies-toggle:hover{text-decoration:underline}ax-comment-item .ax-comment-replies .ax-comment-replies-content{margin-top:.5rem}ax-comment-item .ax-comment-replies ax-comment-reply-more{cursor:pointer;color:rgba(var(--ax-sys-color-primary-surface));font-weight:500;font-size:var(--ax-comp-comment-body-font-size)}ax-comment-item .ax-comment-replies ax-comment-reply-more:hover{text-decoration:underline}\n"], dependencies: [{ kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
80
71
  }
81
72
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentItemComponent, decorators: [{
82
73
  type: Component,
83
- args: [{ selector: 'ax-comment-item', encapsulation: ViewEncapsulation.None, imports: [AXAccordionModule, AXTranslatorPipe, AsyncPipe], providers: [{ provide: AXComponent, useExisting: AXCommentItemComponent }], template: "<div class=\"ax-comment-items\">\n <div class=\"ax-header-container\">\n <div class=\"ax-title-avatar-container\">\n <ng-content select=\"ax-avatar\"></ng-content>\n <ng-content select=\"ax-title\"></ng-content>\n <ng-content select=\"ax-comment-date\"></ng-content>\n </div>\n\n <div>\n <ng-content select=\"ax-comment-menu-options\"></ng-content>\n </div>\n </div>\n <div class=\"ax-content-container\">\n <ng-content select=\"ax-content\"></ng-content>\n <div class=\"ax-reaction-container\">\n <ng-content select=\"ax-comment-like\"></ng-content>\n <ng-content select=\"ax-comment-reply-text\"></ng-content>\n </div>\n </div>\n @if (replyCount()) {\n <div class=\"ax-comment-replies\">\n <ax-accordion-group look=\"none\" [accordion]=\"true\" [activeIndex]=\"1\">\n <ax-accordion-item\n #c\n [caption]=\"\n ('@acorex:comment.view' | translate | async) +\n ' ' +\n replyCount() +\n ' ' +\n ((replyCount() > 1 ? '@acorex:comment.replies' : '@acorex:comment.reply') | translate | async)\n \"\n [isCollapsed]=\"true\"\n >\n <ng-content select=\"ax-comment-item\"></ng-content>\n <ng-content select=\"ax-comment-reply-more\"></ng-content>\n </ax-accordion-item>\n </ax-accordion-group>\n </div>\n }\n</div>\n", styles: [".ax-comment-items{margin-bottom:.25rem}.ax-comment-items .ax-header-container{display:flex;align-items:center;justify-content:space-between}.ax-comment-items .ax-header-container .ax-title-avatar-container{display:flex;align-items:center}.ax-comment-items .ax-header-container ax-title{font-weight:500;padding:.5rem}.ax-comment-items .ax-content-container{margin-inline-start:3rem;display:flex;flex-direction:column;font-size:.875rem;opacity:80%}.ax-comment-items .ax-content-container .ax-reaction-container{margin-top:.75rem;display:flex}.ax-comment-items .ax-content-container .ax-reaction-container ax-comment-like{margin-inline-end:1.5rem}.ax-comment-items .ax-content-container .ax-reaction-container ax-comment-like,.ax-comment-items .ax-content-container .ax-reaction-container ax-comment-reply,.ax-comment-items .ax-content-container .ax-reaction-container ax-text{cursor:pointer}.ax-comment-items .ax-comment-replies{margin-inline-start:2rem}.ax-comment-items .ax-comment-replies .ax-collapse-header-container{font-weight:500;justify-content:unset;color:rgba(var(--ax-sys-color-primary-surface))}.ax-comment-items .ax-comment-replies ax-comment-reply-more{cursor:pointer}\n"] }]
74
+ args: [{ selector: 'ax-comment-item', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXTranslatorPipe, AsyncPipe], providers: [{ provide: AXComponent, useExisting: AXCommentItemComponent }], template: "<div class=\"ax-comment-header\">\n <div class=\"ax-comment-header-start\">\n <ng-content select=\"ax-avatar\" />\n <div class=\"ax-comment-header-content\">\n <ng-content select=\"ax-title\" />\n <ng-content select=\"ax-comment-date\" />\n </div>\n </div>\n <ng-content select=\"ax-comment-menu-options\" />\n</div>\n\n<div class=\"ax-comment-body\">\n <ng-content select=\"ax-content\" />\n <div class=\"ax-comment-actions\">\n <ng-content select=\"ax-comment-like\" />\n <ng-content select=\"ax-comment-reply-text\" />\n </div>\n</div>\n\n@if (replyCount()) {\n <div class=\"ax-comment-replies\">\n <span class=\"ax-comment-replies-toggle\" (click)=\"toggleReplies()\">\n {{ (repliesExpanded() ? '@acorex:comment.hide' : '@acorex:comment.view') | translate | async }}\n {{ replyCount() }}\n {{ (replyCount() > 1 ? '@acorex:comment.replies' : '@acorex:comment.reply') | translate | async }}\n </span>\n @if (repliesExpanded()) {\n <div class=\"ax-comment-replies-content\">\n <ng-content select=\"ax-comment-item\" />\n <ng-content select=\"ax-comment-reply-more\" />\n </div>\n }\n </div>\n}\n", styles: ["ax-comment-item{--ax-comp-comment-spacing: 1rem;--ax-comp-comment-header-gap: .5rem;--ax-comp-comment-body-indent: 3rem;--ax-comp-comment-body-font-size: .875rem;--ax-comp-comment-reply-indent: 2.5rem;--ax-comp-comment-highlight-bg: rgba(var(--ax-sys-color-primary-surface), .1);display:block;padding:.25rem;border-radius:.25rem;transition:background 1s ease-in-out}ax-comment-item:not(:last-child){margin-bottom:var(--ax-comp-comment-spacing)}ax-comment-item.ax-state-highlight{background:var(--ax-comp-comment-highlight-bg)}ax-comment-item .ax-comment-header{display:flex;align-items:center;justify-content:space-between}ax-comment-item .ax-comment-header .ax-comment-header-start{display:flex;align-items:center;gap:var(--ax-comp-comment-header-gap)}ax-comment-item .ax-comment-header .ax-comment-header-start .ax-comment-header-content{display:flex;align-items:baseline;gap:.5rem}ax-comment-item .ax-comment-header ax-title{font-weight:500}ax-comment-item .ax-comment-body{margin-inline-start:var(--ax-comp-comment-body-indent);font-size:var(--ax-comp-comment-body-font-size);color:rgba(var(--ax-sys-color-on-surface));padding-top:.25rem}ax-comment-item .ax-comment-actions{display:flex;align-items:center;gap:1rem;margin-top:.5rem;font-size:var(--ax-comp-comment-body-font-size)}ax-comment-item .ax-comment-actions ax-comment-like,ax-comment-item .ax-comment-actions ax-comment-reply-text{cursor:pointer;-webkit-user-select:none;user-select:none}ax-comment-item .ax-comment-replies{margin-inline-start:var(--ax-comp-comment-reply-indent);margin-top:.5rem}ax-comment-item .ax-comment-replies .ax-comment-replies-toggle{display:inline-flex;align-items:center;gap:.25rem;cursor:pointer;-webkit-user-select:none;user-select:none;font-size:var(--ax-comp-comment-body-font-size);font-weight:500;color:rgba(var(--ax-sys-color-primary-surface))}ax-comment-item .ax-comment-replies .ax-comment-replies-toggle:hover{text-decoration:underline}ax-comment-item .ax-comment-replies .ax-comment-replies-content{margin-top:.5rem}ax-comment-item .ax-comment-replies ax-comment-reply-more{cursor:pointer;color:rgba(var(--ax-sys-color-primary-surface));font-weight:500;font-size:var(--ax-comp-comment-body-font-size)}ax-comment-item .ax-comment-replies ax-comment-reply-more:hover{text-decoration:underline}\n"] }]
84
75
  }], ctorParameters: () => [] });
85
76
 
86
77
  /**
87
- * A component for displaying and managing date on a comment.
78
+ * A component for displaying date on a comment.
88
79
  *
89
80
  * @category Components
90
81
  */
91
82
  class AXCommentDateComponent {
92
83
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
93
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: AXCommentDateComponent, isStandalone: true, selector: "ax-comment-date", providers: [{ provide: AXComponent, useExisting: AXCommentDateComponent }], ngImport: i0, template: "<ng-content></ng-content>\n", styles: ["ax-comment-date{color:rgb(var(--ax-sys-color-ghost-400));font-size:.8rem}\n"], encapsulation: i0.ViewEncapsulation.None }); }
84
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: AXCommentDateComponent, isStandalone: true, selector: "ax-comment-date", providers: [{ provide: AXComponent, useExisting: AXCommentDateComponent }], ngImport: i0, template: '<ng-content />', isInline: true, styles: ["ax-comment-date{color:rgb(var(--ax-sys-color-ghost-400));font-size:.8rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
94
85
  }
95
86
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentDateComponent, decorators: [{
96
87
  type: Component,
97
- args: [{ selector: 'ax-comment-date', encapsulation: ViewEncapsulation.None, providers: [{ provide: AXComponent, useExisting: AXCommentDateComponent }], template: "<ng-content></ng-content>\n", styles: ["ax-comment-date{color:rgb(var(--ax-sys-color-ghost-400));font-size:.8rem}\n"] }]
88
+ args: [{ selector: 'ax-comment-date', template: '<ng-content />', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: AXComponent, useExisting: AXCommentDateComponent }], styles: ["ax-comment-date{color:rgb(var(--ax-sys-color-ghost-400));font-size:.8rem}\n"] }]
98
89
  }] });
99
90
 
100
91
  /**
@@ -104,20 +95,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
104
95
  */
105
96
  class AXCommentLikeComponent {
106
97
  constructor() {
107
- /**
108
- * Indicates whether the comment is liked.
109
- */
110
98
  this.like = model.required(...(ngDevMode ? [{ debugName: "like" }] : []));
111
99
  }
112
- changeState() {
100
+ toggleLike() {
113
101
  this.like.update((prev) => !prev);
114
102
  }
115
103
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentLikeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
116
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.3", type: AXCommentLikeComponent, isStandalone: true, selector: "ax-comment-like", inputs: { like: { classPropertyName: "like", publicName: "like", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { like: "likeChange" }, providers: [{ provide: AXComponent, useExisting: AXCommentLikeComponent }], ngImport: i0, template: "<div class=\"ax-comment-like-container\" [class.ax-state-liked]=\"like()\" (click)=\"changeState()\">\n <ax-icon class=\"ax-icon ax-icon-heart\"></ax-icon>\n <ax-text><ng-content></ng-content></ax-text>\n</div>\n", styles: [".ax-comment-like-container{display:flex;align-items:center;gap:.25rem}.ax-comment-like-container ax-icon{font-size:.938rem}.ax-comment-like-container.ax-state-liked{color:rgba(var(--ax-sys-color-danger-500))}.ax-comment-like-container.ax-state-liked ax-icon{font-weight:700}.ax-comment-like-container.ax-state-liked ax-text{color:rgba(var(--ax-sys-color-danger-500))}\n"], dependencies: [{ kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }] }); }
104
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.3", type: AXCommentLikeComponent, isStandalone: true, selector: "ax-comment-like", inputs: { like: { classPropertyName: "like", publicName: "like", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { like: "likeChange" }, providers: [{ provide: AXComponent, useExisting: AXCommentLikeComponent }], ngImport: i0, template: "<div class=\"ax-comment-like-container\" [class.ax-state-liked]=\"like()\" (click)=\"toggleLike()\">\n <ax-icon class=\"ax-icon ax-icon-heart\"></ax-icon>\n <ax-text><ng-content /></ax-text>\n</div>\n", styles: ["ax-comment-like .ax-comment-like-container{display:flex;align-items:center;gap:.25rem;transition:color .2s ease}ax-comment-like .ax-comment-like-container ax-icon{font-size:.938rem;transition:transform .2s ease}ax-comment-like .ax-comment-like-container:hover:not(.ax-state-liked){color:rgba(var(--ax-sys-color-danger-400))}ax-comment-like .ax-comment-like-container.ax-state-liked{color:rgba(var(--ax-sys-color-danger-500))}ax-comment-like .ax-comment-like-container.ax-state-liked ax-icon{font-weight:700}\n"], dependencies: [{ kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
117
105
  }
118
106
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentLikeComponent, decorators: [{
119
107
  type: Component,
120
- args: [{ selector: 'ax-comment-like', imports: [AXDecoratorIconComponent, AXDecoratorGenericComponent], providers: [{ provide: AXComponent, useExisting: AXCommentLikeComponent }], template: "<div class=\"ax-comment-like-container\" [class.ax-state-liked]=\"like()\" (click)=\"changeState()\">\n <ax-icon class=\"ax-icon ax-icon-heart\"></ax-icon>\n <ax-text><ng-content></ng-content></ax-text>\n</div>\n", styles: [".ax-comment-like-container{display:flex;align-items:center;gap:.25rem}.ax-comment-like-container ax-icon{font-size:.938rem}.ax-comment-like-container.ax-state-liked{color:rgba(var(--ax-sys-color-danger-500))}.ax-comment-like-container.ax-state-liked ax-icon{font-weight:700}.ax-comment-like-container.ax-state-liked ax-text{color:rgba(var(--ax-sys-color-danger-500))}\n"] }]
108
+ args: [{ selector: 'ax-comment-like', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXDecoratorIconComponent, AXDecoratorGenericComponent], providers: [{ provide: AXComponent, useExisting: AXCommentLikeComponent }], template: "<div class=\"ax-comment-like-container\" [class.ax-state-liked]=\"like()\" (click)=\"toggleLike()\">\n <ax-icon class=\"ax-icon ax-icon-heart\"></ax-icon>\n <ax-text><ng-content /></ax-text>\n</div>\n", styles: ["ax-comment-like .ax-comment-like-container{display:flex;align-items:center;gap:.25rem;transition:color .2s ease}ax-comment-like .ax-comment-like-container ax-icon{font-size:.938rem;transition:transform .2s ease}ax-comment-like .ax-comment-like-container:hover:not(.ax-state-liked){color:rgba(var(--ax-sys-color-danger-400))}ax-comment-like .ax-comment-like-container.ax-state-liked{color:rgba(var(--ax-sys-color-danger-500))}ax-comment-like .ax-comment-like-container.ax-state-liked ax-icon{font-weight:700}\n"] }]
121
109
  }] });
122
110
 
123
111
  /**
@@ -127,45 +115,76 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
127
115
  */
128
116
  class AXMenuOptionsComponent {
129
117
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXMenuOptionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
130
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: AXMenuOptionsComponent, isStandalone: true, selector: "ax-comment-menu-options", providers: [{ provide: AXComponent, useExisting: AXMenuOptionsComponent }], ngImport: i0, template: "<ng-content></ng-content>\n" }); }
118
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: AXMenuOptionsComponent, isStandalone: true, selector: "ax-comment-menu-options", providers: [{ provide: AXComponent, useExisting: AXMenuOptionsComponent }], ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
131
119
  }
132
120
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXMenuOptionsComponent, decorators: [{
133
121
  type: Component,
134
- args: [{ selector: 'ax-comment-menu-options', providers: [{ provide: AXComponent, useExisting: AXMenuOptionsComponent }], template: "<ng-content></ng-content>\n" }]
122
+ args: [{
123
+ selector: 'ax-comment-menu-options',
124
+ template: '<ng-content />',
125
+ encapsulation: ViewEncapsulation.None,
126
+ changeDetection: ChangeDetectionStrategy.OnPush,
127
+ providers: [{ provide: AXComponent, useExisting: AXMenuOptionsComponent }],
128
+ }]
135
129
  }] });
136
130
 
131
+ /**
132
+ * A component for displaying "show more replies" action on a comment.
133
+ *
134
+ * @category Components
135
+ */
137
136
  class AXCommentReplyMoreComponent {
138
137
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentReplyMoreComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
139
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: AXCommentReplyMoreComponent, isStandalone: true, selector: "ax-comment-reply-more", providers: [{ provide: AXComponent, useExisting: AXCommentReplyMoreComponent }], ngImport: i0, template: "<ax-text><ng-content></ng-content></ax-text>\n", dependencies: [{ kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }] }); }
138
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: AXCommentReplyMoreComponent, isStandalone: true, selector: "ax-comment-reply-more", providers: [{ provide: AXComponent, useExisting: AXCommentReplyMoreComponent }], ngImport: i0, template: '<ax-text><ng-content /></ax-text>', isInline: true, dependencies: [{ kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
140
139
  }
141
140
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentReplyMoreComponent, decorators: [{
142
141
  type: Component,
143
- args: [{ selector: 'ax-comment-reply-more', imports: [AXDecoratorGenericComponent], providers: [{ provide: AXComponent, useExisting: AXCommentReplyMoreComponent }], template: "<ax-text><ng-content></ng-content></ax-text>\n" }]
142
+ args: [{
143
+ selector: 'ax-comment-reply-more',
144
+ template: '<ax-text><ng-content /></ax-text>',
145
+ encapsulation: ViewEncapsulation.None,
146
+ changeDetection: ChangeDetectionStrategy.OnPush,
147
+ imports: [AXDecoratorGenericComponent],
148
+ providers: [{ provide: AXComponent, useExisting: AXCommentReplyMoreComponent }],
149
+ }]
144
150
  }] });
145
151
 
152
+ /**
153
+ * A component for displaying the reply action text on a comment.
154
+ *
155
+ * @category Components
156
+ */
146
157
  class AXCommentReplyTextComponent {
147
158
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentReplyTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
148
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: AXCommentReplyTextComponent, isStandalone: true, selector: "ax-comment-reply-text", providers: [{ provide: AXComponent, useExisting: AXCommentReplyTextComponent }], ngImport: i0, template: "<ax-text>Reply</ax-text>\n", dependencies: [{ kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }] }); }
159
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: AXCommentReplyTextComponent, isStandalone: true, selector: "ax-comment-reply-text", providers: [{ provide: AXComponent, useExisting: AXCommentReplyTextComponent }], ngImport: i0, template: `<ax-text>{{ '@acorex:comment.reply' | translate | async }}</ax-text>`, isInline: true, dependencies: [{ kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
149
160
  }
150
161
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentReplyTextComponent, decorators: [{
151
162
  type: Component,
152
- args: [{ selector: 'ax-comment-reply-text', imports: [AXDecoratorGenericComponent], providers: [{ provide: AXComponent, useExisting: AXCommentReplyTextComponent }], template: "<ax-text>Reply</ax-text>\n" }]
163
+ args: [{
164
+ selector: 'ax-comment-reply-text',
165
+ template: `<ax-text>{{ '@acorex:comment.reply' | translate | async }}</ax-text>`,
166
+ encapsulation: ViewEncapsulation.None,
167
+ changeDetection: ChangeDetectionStrategy.OnPush,
168
+ imports: [AXDecoratorGenericComponent, AXTranslatorPipe, AsyncPipe],
169
+ providers: [{ provide: AXComponent, useExisting: AXCommentReplyTextComponent }],
170
+ }]
153
171
  }] });
154
172
 
155
173
  /**
156
174
  * A component for viewing comments with their details.
175
+ *
157
176
  * @category Components
158
177
  */
159
178
  class AXCommentViewComponent {
160
179
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
161
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: AXCommentViewComponent, isStandalone: true, selector: "ax-comment-view", providers: [{ provide: AXComponent, useExisting: AXCommentViewComponent }], ngImport: i0, template: "<ng-content select=\"ax-comment-item\"></ng-content>\n", styles: ["ax-comment-view{border:1px solid rgb(var(--ax-sys-color-border-lightest-surface));border-radius:var(--ax-sys-border-radius);display:block;padding:1.5rem;margin-bottom:1rem}\n"], encapsulation: i0.ViewEncapsulation.None }); }
180
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: AXCommentViewComponent, isStandalone: true, selector: "ax-comment-view", providers: [{ provide: AXComponent, useExisting: AXCommentViewComponent }], ngImport: i0, template: '<ng-content select="ax-comment-item" />', isInline: true, styles: ["ax-comment-view{display:block;margin-block-end:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
162
181
  }
163
182
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentViewComponent, decorators: [{
164
183
  type: Component,
165
- args: [{ selector: 'ax-comment-view', encapsulation: ViewEncapsulation.None, providers: [{ provide: AXComponent, useExisting: AXCommentViewComponent }], template: "<ng-content select=\"ax-comment-item\"></ng-content>\n", styles: ["ax-comment-view{border:1px solid rgb(var(--ax-sys-color-border-lightest-surface));border-radius:var(--ax-sys-border-radius);display:block;padding:1.5rem;margin-bottom:1rem}\n"] }]
184
+ args: [{ selector: 'ax-comment-view', template: '<ng-content select="ax-comment-item" />', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: AXComponent, useExisting: AXCommentViewComponent }], styles: ["ax-comment-view{display:block;margin-block-end:1rem}\n"] }]
166
185
  }] });
167
186
 
168
- const COMPONENT = [
187
+ const COMPONENTS = [
169
188
  AXCommentViewComponent,
170
189
  AXCommentContainerComponent,
171
190
  AXCommentItemComponent,
@@ -175,24 +194,10 @@ const COMPONENT = [
175
194
  AXCommentDateComponent,
176
195
  AXCommentReplyMoreComponent,
177
196
  ];
178
- const MODULES = [
179
- AXDecoratorModule,
180
- AXWysiwygModule,
181
- AXCollapseModule,
182
- AXButtonModule,
183
- AXTextAreaModule,
184
- AXTranslationModule,
185
- CommonModule,
186
- ];
197
+ const MODULES = [AXDecoratorModule, AXWysiwygModule, AXButtonModule, AXTextAreaModule, AXTranslationModule];
187
198
  class AXCommentModule {
188
199
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
189
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.3", ngImport: i0, type: AXCommentModule, imports: [AXDecoratorModule,
190
- AXWysiwygModule,
191
- AXCollapseModule,
192
- AXButtonModule,
193
- AXTextAreaModule,
194
- AXTranslationModule,
195
- CommonModule, AXCommentViewComponent,
200
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.3", ngImport: i0, type: AXCommentModule, imports: [AXDecoratorModule, AXWysiwygModule, AXButtonModule, AXTextAreaModule, AXTranslationModule, AXCommentViewComponent,
196
201
  AXCommentContainerComponent,
197
202
  AXCommentItemComponent,
198
203
  AXCommentLikeComponent,
@@ -207,17 +212,15 @@ class AXCommentModule {
207
212
  AXCommentReplyTextComponent,
208
213
  AXCommentDateComponent,
209
214
  AXCommentReplyMoreComponent] }); }
210
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentModule, imports: [MODULES, AXCommentItemComponent,
211
- AXCommentLikeComponent,
215
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentModule, imports: [MODULES, AXCommentLikeComponent,
212
216
  AXCommentReplyTextComponent,
213
217
  AXCommentReplyMoreComponent] }); }
214
218
  }
215
219
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommentModule, decorators: [{
216
220
  type: NgModule,
217
221
  args: [{
218
- imports: [...MODULES, ...COMPONENT],
219
- exports: [...COMPONENT],
220
- providers: [],
222
+ imports: [...MODULES, ...COMPONENTS],
223
+ exports: [...COMPONENTS],
221
224
  }]
222
225
  }] });
223
226