@acorex/components 17.0.14 → 17.0.16
Sign up to get free protection for your applications and to get access to all the features.
- package/audio-wave/lib/audio-wave.component.d.ts +7 -2
- package/audio-wave/lib/audio-wave.module.d.ts +2 -1
- package/audio-wave/lib/interfaces/audio-wave.interface.d.ts +2 -1
- package/common/lib/components/base-component.class.d.ts +0 -4
- package/conversation/index.d.ts +12 -0
- package/{chat/lib/chat-input/chat-input.component.d.ts → conversation/lib/conversation-input/conversation-input.component.d.ts} +4 -4
- package/conversation/lib/conversation-message/conversation-message.component.d.ts +16 -0
- package/conversation/lib/conversation-messages/conversation-message-text.component.d.ts +9 -0
- package/conversation/lib/conversation-messages/conversation-messages-voice/conversation-message-voice.component.d.ts +27 -0
- package/conversation/lib/conversation-view/conversation-view.component.d.ts +10 -0
- package/conversation/lib/conversation.module.d.ts +36 -0
- package/conversation/lib/conversation.types.d.ts +21 -0
- package/conversation/lib/services/conversation-message-type-registry.service.d.ts +9 -0
- package/conversation/lib/services/conversation.service.d.ts +5 -0
- package/esm2022/audio-wave/lib/audio-wave.component.mjs +56 -30
- package/esm2022/audio-wave/lib/audio-wave.module.mjs +5 -4
- package/esm2022/audio-wave/lib/interfaces/audio-wave.interface.mjs +1 -1
- package/esm2022/button/lib/button.component.mjs +3 -3
- package/esm2022/color-palette/lib/color-palette-picker.component.mjs +8 -12
- package/esm2022/common/lib/components/base-component.class.mjs +11 -14
- package/esm2022/conversation/acorex-components-conversation.mjs +5 -0
- package/esm2022/conversation/index.mjs +14 -0
- package/esm2022/conversation/lib/classes/events.interface.mjs +2 -0
- package/esm2022/{chat/lib/chat-input/chat-input.component.mjs → conversation/lib/conversation-input/conversation-input.component.mjs} +14 -14
- package/esm2022/conversation/lib/conversation-input/conversation-input.interface.mjs +2 -0
- package/esm2022/conversation/lib/conversation-message/conversation-message.component.mjs +55 -0
- package/esm2022/conversation/lib/conversation-messages/conversation-message-text.component.mjs +23 -0
- package/esm2022/conversation/lib/conversation-messages/conversation-messages-voice/conversation-message-voice.component.mjs +112 -0
- package/esm2022/conversation/lib/conversation-view/conversation-view.component.mjs +22 -0
- package/esm2022/conversation/lib/conversation.module.mjs +150 -0
- package/esm2022/conversation/lib/conversation.types.mjs +10 -0
- package/esm2022/conversation/lib/services/conversation-message-type-registry.service.mjs +20 -0
- package/esm2022/conversation/lib/services/conversation.service.mjs +10 -0
- package/esm2022/conversation/lib/services/recording.service.mjs +78 -0
- package/esm2022/dialog/lib/dialog.service.mjs +2 -2
- package/esm2022/list/lib/list.component.mjs +3 -3
- package/esm2022/select-box/lib/select-box.component.mjs +3 -3
- package/esm2022/side-menu/lib/side-menu.component.mjs +2 -2
- package/fesm2022/acorex-components-audio-wave.mjs +60 -33
- package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +2 -2
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +4 -8
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-common.mjs +10 -13
- package/fesm2022/acorex-components-common.mjs.map +1 -1
- package/fesm2022/{acorex-components-chat.mjs → acorex-components-conversation.mjs} +153 -86
- package/fesm2022/acorex-components-conversation.mjs.map +1 -0
- package/fesm2022/acorex-components-dialog.mjs +1 -1
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +2 -2
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +2 -2
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/package.json +13 -13
- package/chat/index.d.ts +0 -12
- package/chat/lib/chat-message/chat-message.component.d.ts +0 -16
- package/chat/lib/chat-messages/chat-message-text.component.d.ts +0 -8
- package/chat/lib/chat-messages/chat-messages-voice/chat-message-voice.component.d.ts +0 -19
- package/chat/lib/chat-view/chat-view.component.d.ts +0 -10
- package/chat/lib/chat.module.d.ts +0 -34
- package/chat/lib/chat.types.d.ts +0 -21
- package/chat/lib/services/chat-message-type-registry.service.d.ts +0 -9
- package/chat/lib/services/chat.service.d.ts +0 -5
- package/esm2022/chat/acorex-components-chat.mjs +0 -5
- package/esm2022/chat/index.mjs +0 -14
- package/esm2022/chat/lib/chat-input/chat-input.interface.mjs +0 -2
- package/esm2022/chat/lib/chat-message/chat-message.component.mjs +0 -48
- package/esm2022/chat/lib/chat-messages/chat-message-text.component.mjs +0 -23
- package/esm2022/chat/lib/chat-messages/chat-messages-voice/chat-message-voice.component.mjs +0 -60
- package/esm2022/chat/lib/chat-view/chat-view.component.mjs +0 -22
- package/esm2022/chat/lib/chat.module.mjs +0 -142
- package/esm2022/chat/lib/chat.types.mjs +0 -10
- package/esm2022/chat/lib/classes/events.interface.mjs +0 -2
- package/esm2022/chat/lib/services/chat-message-type-registry.service.mjs +0 -20
- package/esm2022/chat/lib/services/chat.service.mjs +0 -10
- package/esm2022/chat/lib/services/recording.service.mjs +0 -78
- package/fesm2022/acorex-components-chat.mjs.map +0 -1
- /package/{chat → conversation}/README.md +0 -0
- /package/{chat → conversation}/lib/classes/events.interface.d.ts +0 -0
- /package/{chat/lib/chat-input/chat-input.interface.d.ts → conversation/lib/conversation-input/conversation-input.interface.d.ts} +0 -0
- /package/{chat → conversation}/lib/services/recording.service.d.ts +0 -0
@@ -17,11 +17,15 @@ import { AXTranslationModule } from '@acorex/core/translation';
|
|
17
17
|
import { isBrowser } from '@acorex/core/platform';
|
18
18
|
import * as i1$1 from '@angular/cdk/portal';
|
19
19
|
import { ComponentPortal, CdkPortalOutlet } from '@angular/cdk/portal';
|
20
|
-
import * as
|
20
|
+
import * as i2$1 from '@acorex/components/avatar';
|
21
|
+
import { AXAvatarModule } from '@acorex/components/avatar';
|
22
|
+
import * as i4$1 from '@acorex/core/format';
|
21
23
|
import { AXFormatModule } from '@acorex/core/format';
|
22
|
-
import * as i2$
|
24
|
+
import * as i2$2 from '@acorex/components/audio-wave';
|
23
25
|
import { AXAudioWaveModule } from '@acorex/components/audio-wave';
|
24
26
|
import { AXCircularProgressModule } from '@acorex/components/circular-progress';
|
27
|
+
import * as i3$1 from '@acorex/components/loading';
|
28
|
+
import { AXLoadingModule } from '@acorex/components/loading';
|
25
29
|
import { AXDateTimeModule } from '@acorex/core/date-time';
|
26
30
|
|
27
31
|
class AXRecordingService {
|
@@ -100,7 +104,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImpor
|
|
100
104
|
type: Injectable
|
101
105
|
}] });
|
102
106
|
|
103
|
-
class
|
107
|
+
class AXConversationInputComponent extends classes((MXInputBaseValueComponent), MXLookComponent) {
|
104
108
|
constructor() {
|
105
109
|
super(...arguments);
|
106
110
|
this.hasAttachment = true;
|
@@ -168,27 +172,27 @@ class AXChatInputComponent extends classes((MXInputBaseValueComponent), MXLookCo
|
|
168
172
|
isUserInteraction: true,
|
169
173
|
});
|
170
174
|
}
|
171
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
172
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.2", type:
|
173
|
-
{ provide: AXComponent, useExisting:
|
174
|
-
{ provide: AXFocusableComponent, useExisting:
|
175
|
-
{ provide: AXValuableComponent, useExisting:
|
175
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
176
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.2", type: AXConversationInputComponent, selector: "ax-conversation-input", inputs: { maxLength: "maxLength", hasAttachment: "hasAttachment", haVoice: "haVoice", acceptFileType: "acceptFileType" }, outputs: { onSendClick: "onSendClick", onStartRecording: "onStartRecording", onStopRecording: "onStopRecording", onFileChange: "onFileChange" }, providers: [
|
177
|
+
{ provide: AXComponent, useExisting: AXConversationInputComponent },
|
178
|
+
{ provide: AXFocusableComponent, useExisting: AXConversationInputComponent },
|
179
|
+
{ provide: AXValuableComponent, useExisting: AXConversationInputComponent },
|
176
180
|
{
|
177
181
|
provide: NG_VALUE_ACCESSOR,
|
178
|
-
useExisting: forwardRef(() =>
|
182
|
+
useExisting: forwardRef(() => AXConversationInputComponent),
|
179
183
|
multi: true,
|
180
184
|
},
|
181
185
|
], viewQueries: [{ propertyName: "inputFile", first: true, predicate: ["inputFile"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-chat-input\" [class.ax-state-recording]=\"recording()\">\n @if (recording()) {\n <div class=\"ax-chat-input-start-side\">\n <span class=\"ax-record-dot\"></span>\n <span>{{ recordingService.timer() }}</span>\n </div>\n <div class=\"ax-chat-input-main-side\">\n <ax-button class=\"ax-sm\" look=\"blank\" color=\"primary\" [text]=\"'cancel' | translate | async\"\n (onClick)=\"handleStopClick()\"></ax-button>\n </div>\n <div class=\"ax-chat-input-end-side\">\n <ax-button look=\"solid\" color=\"danger\" class=\"ax-blob ax-sm\" (onClick)=\"handleSendVoiceClick()\">\n <ax-icon>\n <i class=\"ax-icon ax-icon-send\"></i>\n </ax-icon>\n </ax-button>\n </div>\n } @else {\n <div class=\"ax-chat-input-start-side\">\n <ax-button look=\"blank\" class=\"ax-sm\">\n <ax-icon>\n <i class=\"ax-icon ax-icon-emoji\"></i>\n </ax-icon>\n <ax-dropdown-panel>\n <ng-container>\n <div class=\"ax-emoji-container\">\n <div>\u26A0\uFE0F</div>\n <div>\u27A1\uFE0F</div>\n <div>\uD83D\uDD03</div>\n <div>\uD83D\uDD37</div>\n <div>\uD83E\uDD1A</div>\n <div>\uD83D\uDE02</div>\n <div>\uD83D\uDE0A</div>\n </div>\n </ng-container>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n <textarea class=\"ax-chat-input-main-side\"\n oninput='this.style.height = \"\";this.style.height = this.scrollHeight + \"px\"' type=\"text\" rows=\"1\" [id]=\"id\"\n [name]=\"name\" [attr.placeholder]=\"placeholder\" [attr.maxlength]=\"maxLength\" [disabled]=\"disabled\"\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [ngModel]=\"value\" (ngModelChange)=\"_handleModelChange($event)\"\n [ngModelOptions]=\"{ updateOn: _updateOn }\" (keydown)=\"emitOnKeydownEvent($event)\" (keyup)=\"emitOnKeyupEvent($event)\"\n (keypress)=\"emitOnKeypressEvent($event)\" (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"></textarea>\n <div class=\"ax-chat-input-end-side\">\n @if (!value) {\n <ax-button look=\"blank\" class=\"ax-sm\" (onClick)=\"handleAttachClick()\">\n <ax-icon>\n <i class=\"ax-icon ax-icon-attach\"></i>\n </ax-icon>\n </ax-button>\n <ax-button look=\"blank\" class=\"ax-sm\" (onClick)=\"handleRecordClick()\">\n <ax-icon>\n <i class=\"ax-icon ax-icon-mic\"></i>\n </ax-icon>\n </ax-button>\n <input #inputFile [accept]=\"acceptFileType\" type=\"file\" class=\"ax-attach-input\" (change)=\"handleChangeFile($event)\">\n }\n\n @if (value) {\n <ax-button look=\"solid\" color=\"primary\" class=\"ax-sm\" (onClick)=\"handleSendClick()\">\n <ax-icon>\n <i class=\"ax-icon ax-icon-send\"></i>\n </ax-icon>\n </ax-button>\n }\n </div>\n }\n</div>", styles: [".ax-dark .ax-chat-input:focus-within{box-shadow:0 0 0 1px rgba(var(--ax-color-primary-200));border-color:rgba(var(--ax-color-primary-200))}.ax-chat-input{border:1px solid;border-color:rgba(var(--ax-color-border-default));display:flex;align-items:flex-end;border-radius:var(--ax-rounded-border-default);position:relative;resize:vertical;height:auto;padding:.5rem;font-size:.875rem}.ax-chat-input.ax-state-recording{align-items:center;display:grid;grid-template-columns:repeat(3,1fr)}.ax-chat-input.ax-state-recording .ax-chat-input-start-side{justify-content:flex-start}.ax-chat-input.ax-state-recording .ax-chat-input-end-side{justify-content:flex-end}.ax-chat-input:focus-within{box-shadow:0 0 0 1px rgba(var(--ax-color-primary-500));border-color:rgba(var(--ax-color-primary-500))}.ax-chat-input>textarea{font-size:.875rem;background-color:transparent;max-height:10rem;min-height:1.5rem;line-height:2rem;flex:1 1 auto;height:auto;resize:none}.ax-chat-input>textarea:focus,.ax-chat-input>textarea:focus-visible{outline:unset}.ax-chat-input .ax-chat-input-start-side,.ax-chat-input .ax-chat-input-end-side{display:flex;align-items:center;justify-content:center}.ax-chat-input .ax-chat-input-start-side{padding-inline-end:.75rem}.ax-chat-input .ax-chat-input-main-side{flex:1 1 auto;display:flex;align-items:center;justify-content:center}.ax-chat-input .ax-chat-input-end-side{padding-inline-start:.75rem;gap:.5rem}.ax-chat-input .ax-record-dot{display:inline-flex;width:.5rem;height:.5rem;background-color:rgba(var(--ax-color-danger-500));border-radius:999rem;margin-inline-end:.5rem}.ax-chat-input .ax-blob{animation:pulse .75s infinite}@keyframes pulse{0%{transform:scale(1);box-shadow:0 0 rgba(var(--ax-color-danger-500),.7)}70%{transform:scale(1);box-shadow:0 0 0 10px rgba(var(--ax-color-danger-500),0)}to{transform:scale(1);box-shadow:0 0 rgba(var(--ax-color-danger-500),0)}}.ax-chat-input .ax-attach-input{opacity:0;width:0;height:0;position:absolute}.ax-emoji-container{padding:.75rem;gap:.5rem;display:grid;grid-template-columns:repeat(7,1fr)}.ax-emoji-container>div{padding:.25rem;cursor:pointer;border-radius:var(--ax-rounded-border-default)}.ax-emoji-container>div:hover{background-color:rgba(var(--ax-color-on-surface))}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
182
186
|
}
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationInputComponent, decorators: [{
|
184
188
|
type: Component,
|
185
|
-
args: [{ selector: 'ax-
|
186
|
-
{ provide: AXComponent, useExisting:
|
187
|
-
{ provide: AXFocusableComponent, useExisting:
|
188
|
-
{ provide: AXValuableComponent, useExisting:
|
189
|
+
args: [{ selector: 'ax-conversation-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
190
|
+
{ provide: AXComponent, useExisting: AXConversationInputComponent },
|
191
|
+
{ provide: AXFocusableComponent, useExisting: AXConversationInputComponent },
|
192
|
+
{ provide: AXValuableComponent, useExisting: AXConversationInputComponent },
|
189
193
|
{
|
190
194
|
provide: NG_VALUE_ACCESSOR,
|
191
|
-
useExisting: forwardRef(() =>
|
195
|
+
useExisting: forwardRef(() => AXConversationInputComponent),
|
192
196
|
multi: true,
|
193
197
|
},
|
194
198
|
], template: "<div class=\"ax-chat-input\" [class.ax-state-recording]=\"recording()\">\n @if (recording()) {\n <div class=\"ax-chat-input-start-side\">\n <span class=\"ax-record-dot\"></span>\n <span>{{ recordingService.timer() }}</span>\n </div>\n <div class=\"ax-chat-input-main-side\">\n <ax-button class=\"ax-sm\" look=\"blank\" color=\"primary\" [text]=\"'cancel' | translate | async\"\n (onClick)=\"handleStopClick()\"></ax-button>\n </div>\n <div class=\"ax-chat-input-end-side\">\n <ax-button look=\"solid\" color=\"danger\" class=\"ax-blob ax-sm\" (onClick)=\"handleSendVoiceClick()\">\n <ax-icon>\n <i class=\"ax-icon ax-icon-send\"></i>\n </ax-icon>\n </ax-button>\n </div>\n } @else {\n <div class=\"ax-chat-input-start-side\">\n <ax-button look=\"blank\" class=\"ax-sm\">\n <ax-icon>\n <i class=\"ax-icon ax-icon-emoji\"></i>\n </ax-icon>\n <ax-dropdown-panel>\n <ng-container>\n <div class=\"ax-emoji-container\">\n <div>\u26A0\uFE0F</div>\n <div>\u27A1\uFE0F</div>\n <div>\uD83D\uDD03</div>\n <div>\uD83D\uDD37</div>\n <div>\uD83E\uDD1A</div>\n <div>\uD83D\uDE02</div>\n <div>\uD83D\uDE0A</div>\n </div>\n </ng-container>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n <textarea class=\"ax-chat-input-main-side\"\n oninput='this.style.height = \"\";this.style.height = this.scrollHeight + \"px\"' type=\"text\" rows=\"1\" [id]=\"id\"\n [name]=\"name\" [attr.placeholder]=\"placeholder\" [attr.maxlength]=\"maxLength\" [disabled]=\"disabled\"\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [ngModel]=\"value\" (ngModelChange)=\"_handleModelChange($event)\"\n [ngModelOptions]=\"{ updateOn: _updateOn }\" (keydown)=\"emitOnKeydownEvent($event)\" (keyup)=\"emitOnKeyupEvent($event)\"\n (keypress)=\"emitOnKeypressEvent($event)\" (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"></textarea>\n <div class=\"ax-chat-input-end-side\">\n @if (!value) {\n <ax-button look=\"blank\" class=\"ax-sm\" (onClick)=\"handleAttachClick()\">\n <ax-icon>\n <i class=\"ax-icon ax-icon-attach\"></i>\n </ax-icon>\n </ax-button>\n <ax-button look=\"blank\" class=\"ax-sm\" (onClick)=\"handleRecordClick()\">\n <ax-icon>\n <i class=\"ax-icon ax-icon-mic\"></i>\n </ax-icon>\n </ax-button>\n <input #inputFile [accept]=\"acceptFileType\" type=\"file\" class=\"ax-attach-input\" (change)=\"handleChangeFile($event)\">\n }\n\n @if (value) {\n <ax-button look=\"solid\" color=\"primary\" class=\"ax-sm\" (onClick)=\"handleSendClick()\">\n <ax-icon>\n <i class=\"ax-icon ax-icon-send\"></i>\n </ax-icon>\n </ax-button>\n }\n </div>\n }\n</div>", styles: [".ax-dark .ax-chat-input:focus-within{box-shadow:0 0 0 1px rgba(var(--ax-color-primary-200));border-color:rgba(var(--ax-color-primary-200))}.ax-chat-input{border:1px solid;border-color:rgba(var(--ax-color-border-default));display:flex;align-items:flex-end;border-radius:var(--ax-rounded-border-default);position:relative;resize:vertical;height:auto;padding:.5rem;font-size:.875rem}.ax-chat-input.ax-state-recording{align-items:center;display:grid;grid-template-columns:repeat(3,1fr)}.ax-chat-input.ax-state-recording .ax-chat-input-start-side{justify-content:flex-start}.ax-chat-input.ax-state-recording .ax-chat-input-end-side{justify-content:flex-end}.ax-chat-input:focus-within{box-shadow:0 0 0 1px rgba(var(--ax-color-primary-500));border-color:rgba(var(--ax-color-primary-500))}.ax-chat-input>textarea{font-size:.875rem;background-color:transparent;max-height:10rem;min-height:1.5rem;line-height:2rem;flex:1 1 auto;height:auto;resize:none}.ax-chat-input>textarea:focus,.ax-chat-input>textarea:focus-visible{outline:unset}.ax-chat-input .ax-chat-input-start-side,.ax-chat-input .ax-chat-input-end-side{display:flex;align-items:center;justify-content:center}.ax-chat-input .ax-chat-input-start-side{padding-inline-end:.75rem}.ax-chat-input .ax-chat-input-main-side{flex:1 1 auto;display:flex;align-items:center;justify-content:center}.ax-chat-input .ax-chat-input-end-side{padding-inline-start:.75rem;gap:.5rem}.ax-chat-input .ax-record-dot{display:inline-flex;width:.5rem;height:.5rem;background-color:rgba(var(--ax-color-danger-500));border-radius:999rem;margin-inline-end:.5rem}.ax-chat-input .ax-blob{animation:pulse .75s infinite}@keyframes pulse{0%{transform:scale(1);box-shadow:0 0 rgba(var(--ax-color-danger-500),.7)}70%{transform:scale(1);box-shadow:0 0 0 10px rgba(var(--ax-color-danger-500),0)}to{transform:scale(1);box-shadow:0 0 rgba(var(--ax-color-danger-500),0)}}.ax-chat-input .ax-attach-input{opacity:0;width:0;height:0;position:absolute}.ax-emoji-container{padding:.75rem;gap:.5rem;display:grid;grid-template-columns:repeat(7,1fr)}.ax-emoji-container>div{padding:.25rem;cursor:pointer;border-radius:var(--ax-rounded-border-default)}.ax-emoji-container>div:hover{background-color:rgba(var(--ax-color-on-surface))}\n"] }]
|
@@ -213,7 +217,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImpor
|
|
213
217
|
type: Output
|
214
218
|
}] } });
|
215
219
|
|
216
|
-
class
|
220
|
+
class AXConversationMessageTypeRegistryService {
|
217
221
|
constructor() {
|
218
222
|
this.plugins = new Map();
|
219
223
|
}
|
@@ -223,19 +227,19 @@ class AXChatMessageTypeRegistryService {
|
|
223
227
|
resolve(name) {
|
224
228
|
return this.plugins.get(name);
|
225
229
|
}
|
226
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
227
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
230
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationMessageTypeRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
231
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationMessageTypeRegistryService, providedIn: 'root' }); }
|
228
232
|
}
|
229
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationMessageTypeRegistryService, decorators: [{
|
230
234
|
type: Injectable,
|
231
235
|
args: [{ providedIn: 'root' }]
|
232
236
|
}] });
|
233
237
|
|
234
|
-
class
|
238
|
+
class AXConversationMessageComponent extends MXBaseComponent {
|
235
239
|
constructor() {
|
236
240
|
super(...arguments);
|
237
241
|
this.chatMessage = input();
|
238
|
-
this.registryService = inject(
|
242
|
+
this.registryService = inject(AXConversationMessageTypeRegistryService);
|
239
243
|
}
|
240
244
|
get isOwn() {
|
241
245
|
return !this.chatMessage().fromId;
|
@@ -252,51 +256,57 @@ class AXChatMessageComponent extends MXBaseComponent {
|
|
252
256
|
Object.assign(ref.instance, { message: this.chatMessage() });
|
253
257
|
this.cdr.markForCheck();
|
254
258
|
const prefix = this.getHostElement().querySelector('ax-prefix');
|
255
|
-
const
|
256
|
-
|
259
|
+
const suffix = this.getHostElement().querySelector('ax-suffix');
|
260
|
+
const prefixContainer = this.getHostElement().querySelector('.ax-message-prefix');
|
261
|
+
const suffixContainer = this.getHostElement().querySelector('.ax-message-suffix');
|
262
|
+
if (prefix && prefixContainer) {
|
257
263
|
prefix.style.display = 'flex';
|
258
|
-
|
264
|
+
prefixContainer.append(prefix);
|
265
|
+
}
|
266
|
+
if (suffix && suffixContainer) {
|
267
|
+
suffix.style.display = 'flex';
|
268
|
+
suffixContainer.append(suffix);
|
259
269
|
}
|
260
270
|
}
|
261
271
|
}
|
262
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
263
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.2", type:
|
272
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationMessageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
273
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.2", type: AXConversationMessageComponent, selector: "ax-conversation-message", inputs: { chatMessage: { classPropertyName: "chatMessage", publicName: "chatMessage", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.__hostClass" } }, usesInheritance: true, ngImport: i0, template: "@if(chatMessage().fromId){\n<ax-avatar [size]=\"36\"></ax-avatar>\n}\n<div class=\"ax-message-content\" [class.ax-state-own]=\"!chatMessage().fromId\"\n [class.ax-state-other]=\"chatMessage().fromId\">\n <ng-template [cdkPortalOutlet]=\"_portal\" (attached)=\"_handleAttched($event)\"></ng-template>\n\n <div class=\"ax-chat-message-status\">\n <div class=\"ax-message-prefix\">\n </div>\n <div>\n <div class=\"ax-message-suffix\"></div>\n <span>{{ chatMessage().sendTime | format:'datetime':'HH:mm' | async }}</span>\n <span>\n @if(isOwn)\n {\n @if(chatMessage().deliverTime){\n <i class=\"ax-icon ax-icon-check ax-message-status\"></i>\n }\n @if(chatMessage().readTime){\n <i class=\"ax-icon ax-icon-dobble-check ax-message-status\"></i>\n }\n }\n </span>\n </div>\n </div>\n</div>\n\n@if(!chatMessage().fromId){\n<ax-avatar [size]=\"36\"></ax-avatar>\n}", styles: [":root{--ax-message-other-color: rgba(var(--ax-color-primary-500));--ax-message-other-color-fore: rgba(var(--ax-color-primary-fore));--ax-message-status-color: rgba(var(--ax-color-primary-700));--ax-message-other-bar-color: rgba(var(--ax-color-primary-400));--ax-message-other-progress-color: rgba(var(--ax-color-primary-fore));--ax-message-own-color: rgba(var(--ax-color-primary-100));--ax-message-own-color-fore: rgba(var(--ax-color-primary-700));--ax-message-own-bar-color: rgba(var(--ax-color-primary-200));--ax-message-own-progress-color: rgba(var(--ax-color-primary-700))}ax-conversation-message{display:flex;gap:.5rem;align-items:flex-end}ax-conversation-message.ax-state-own{justify-content:flex-end}ax-conversation-message .ax-message-content{display:block;padding:.5rem;font-size:.875rem;line-height:1.25rem;border-radius:1rem;width:fit-content}ax-conversation-message .ax-message-content.ax-state-own{border-end-end-radius:0!important;background-color:var(--ax-message-own-color);color:var(--ax-message-own-color-fore);justify-content:flex-end}ax-conversation-message .ax-message-content.ax-state-own .ax-chat-message-status{color:var(--ax-message-own-color-fore)}ax-conversation-message .ax-message-content.ax-state-other{border-end-start-radius:0!important;background-color:var(--ax-message-other-color);color:var(--ax-message-other-color-fore)}ax-conversation-message .ax-message-content.ax-state-other .ax-chat-message-status{color:var(--ax-message-other-color-fore)}ax-conversation-message .ax-message-content .ax-chat-message-status{display:flex;justify-content:space-between;align-items:center;font-size:.75rem}ax-conversation-message .ax-message-content .ax-chat-message-status>div{display:flex;gap:.125rem;align-items:center}ax-conversation-message .ax-message-content .ax-chat-message-status .ax-message-status{color:var(--ax-message-status-color);font-weight:700}ax-conversation-message .ax-message-content ax-prefix,ax-conversation-message .ax-message-content ax-suffix{display:none}.ax-dark ax-conversation-message{--ax-message-other-color: rgba(var(--ax-color-primary-900));--ax-message-other-color-fore: rgba(var(--ax-color-primary-fore));--ax-message-own-color: rgba(var(--ax-color-primary-700));--ax-message-own-color-fore: rgba(var(--ax-color-primary-fore));--ax-message-status-color: rgba(var(--ax-color-primary-100))}\n"], dependencies: [{ kind: "directive", type: i1$1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "component", type: i2$1.AXAvatarComponent, selector: "ax-avatar", inputs: ["color", "size", "look"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i4$1.AXFormatPipe, name: "format" }], encapsulation: i0.ViewEncapsulation.None }); }
|
264
274
|
}
|
265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
275
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationMessageComponent, decorators: [{
|
266
276
|
type: Component,
|
267
|
-
args: [{ selector: 'ax-
|
277
|
+
args: [{ selector: 'ax-conversation-message', encapsulation: ViewEncapsulation.None, template: "@if(chatMessage().fromId){\n<ax-avatar [size]=\"36\"></ax-avatar>\n}\n<div class=\"ax-message-content\" [class.ax-state-own]=\"!chatMessage().fromId\"\n [class.ax-state-other]=\"chatMessage().fromId\">\n <ng-template [cdkPortalOutlet]=\"_portal\" (attached)=\"_handleAttched($event)\"></ng-template>\n\n <div class=\"ax-chat-message-status\">\n <div class=\"ax-message-prefix\">\n </div>\n <div>\n <div class=\"ax-message-suffix\"></div>\n <span>{{ chatMessage().sendTime | format:'datetime':'HH:mm' | async }}</span>\n <span>\n @if(isOwn)\n {\n @if(chatMessage().deliverTime){\n <i class=\"ax-icon ax-icon-check ax-message-status\"></i>\n }\n @if(chatMessage().readTime){\n <i class=\"ax-icon ax-icon-dobble-check ax-message-status\"></i>\n }\n }\n </span>\n </div>\n </div>\n</div>\n\n@if(!chatMessage().fromId){\n<ax-avatar [size]=\"36\"></ax-avatar>\n}", styles: [":root{--ax-message-other-color: rgba(var(--ax-color-primary-500));--ax-message-other-color-fore: rgba(var(--ax-color-primary-fore));--ax-message-status-color: rgba(var(--ax-color-primary-700));--ax-message-other-bar-color: rgba(var(--ax-color-primary-400));--ax-message-other-progress-color: rgba(var(--ax-color-primary-fore));--ax-message-own-color: rgba(var(--ax-color-primary-100));--ax-message-own-color-fore: rgba(var(--ax-color-primary-700));--ax-message-own-bar-color: rgba(var(--ax-color-primary-200));--ax-message-own-progress-color: rgba(var(--ax-color-primary-700))}ax-conversation-message{display:flex;gap:.5rem;align-items:flex-end}ax-conversation-message.ax-state-own{justify-content:flex-end}ax-conversation-message .ax-message-content{display:block;padding:.5rem;font-size:.875rem;line-height:1.25rem;border-radius:1rem;width:fit-content}ax-conversation-message .ax-message-content.ax-state-own{border-end-end-radius:0!important;background-color:var(--ax-message-own-color);color:var(--ax-message-own-color-fore);justify-content:flex-end}ax-conversation-message .ax-message-content.ax-state-own .ax-chat-message-status{color:var(--ax-message-own-color-fore)}ax-conversation-message .ax-message-content.ax-state-other{border-end-start-radius:0!important;background-color:var(--ax-message-other-color);color:var(--ax-message-other-color-fore)}ax-conversation-message .ax-message-content.ax-state-other .ax-chat-message-status{color:var(--ax-message-other-color-fore)}ax-conversation-message .ax-message-content .ax-chat-message-status{display:flex;justify-content:space-between;align-items:center;font-size:.75rem}ax-conversation-message .ax-message-content .ax-chat-message-status>div{display:flex;gap:.125rem;align-items:center}ax-conversation-message .ax-message-content .ax-chat-message-status .ax-message-status{color:var(--ax-message-status-color);font-weight:700}ax-conversation-message .ax-message-content ax-prefix,ax-conversation-message .ax-message-content ax-suffix{display:none}.ax-dark ax-conversation-message{--ax-message-other-color: rgba(var(--ax-color-primary-900));--ax-message-other-color-fore: rgba(var(--ax-color-primary-fore));--ax-message-own-color: rgba(var(--ax-color-primary-700));--ax-message-own-color-fore: rgba(var(--ax-color-primary-fore));--ax-message-status-color: rgba(var(--ax-color-primary-100))}\n"] }]
|
268
278
|
}], propDecorators: { __hostClass: [{
|
269
279
|
type: HostBinding,
|
270
280
|
args: ['class']
|
271
281
|
}] } });
|
272
282
|
|
273
|
-
class
|
283
|
+
class AXConversationViewComponent extends MXBaseComponent {
|
274
284
|
constructor() {
|
275
285
|
super(...arguments);
|
276
|
-
this.
|
286
|
+
this._conversations = signal([]);
|
277
287
|
}
|
278
|
-
set
|
279
|
-
this.
|
288
|
+
set conversations(items) {
|
289
|
+
this._conversations.set(items);
|
280
290
|
}
|
281
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
282
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.2", type:
|
291
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
292
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.2", type: AXConversationViewComponent, selector: "ax-conversation-view", inputs: { conversations: "conversations" }, usesInheritance: true, ngImport: i0, template: "@for (item of _conversations(); track $index) {\n<ax-conversation-message [chatMessage]=\"item\"></ax-conversation-message>\n}", styles: ["ax-conversation-view{display:flex;flex-direction:column;gap:.5rem;height:100%;width:100%;overflow-y:auto;overflow-x:hidden}\n"], dependencies: [{ kind: "component", type: AXConversationMessageComponent, selector: "ax-conversation-message", inputs: ["chatMessage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
283
293
|
}
|
284
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
294
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationViewComponent, decorators: [{
|
285
295
|
type: Component,
|
286
|
-
args: [{ selector: 'ax-
|
287
|
-
}], propDecorators: {
|
296
|
+
args: [{ selector: 'ax-conversation-view', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@for (item of _conversations(); track $index) {\n<ax-conversation-message [chatMessage]=\"item\"></ax-conversation-message>\n}", styles: ["ax-conversation-view{display:flex;flex-direction:column;gap:.5rem;height:100%;width:100%;overflow-y:auto;overflow-x:hidden}\n"] }]
|
297
|
+
}], propDecorators: { conversations: [{
|
288
298
|
type: Input
|
289
299
|
}] } });
|
290
300
|
|
291
|
-
class
|
292
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
293
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
301
|
+
class AXConversationMessageBaseComponent {
|
302
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationMessageBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
303
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationMessageBaseComponent }); }
|
294
304
|
}
|
295
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
305
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationMessageBaseComponent, decorators: [{
|
296
306
|
type: Injectable
|
297
307
|
}] });
|
298
308
|
|
299
|
-
class
|
309
|
+
class AXConversationTextMessageComponent extends AXConversationMessageBaseComponent {
|
300
310
|
constructor() {
|
301
311
|
super(...arguments);
|
302
312
|
this._text = signal('');
|
@@ -304,10 +314,10 @@ class AXChatTextMessageComponent extends AXChatMessageBaseComponent {
|
|
304
314
|
ngOnInit() {
|
305
315
|
this._text.set(this.message?.content);
|
306
316
|
}
|
307
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
308
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", type:
|
317
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationTextMessageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
318
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", type: AXConversationTextMessageComponent, selector: "ng-component", inputs: { message: "message" }, usesInheritance: true, ngImport: i0, template: `<div [innerHtml]="_text()"></div>`, isInline: true, encapsulation: i0.ViewEncapsulation.None }); }
|
309
319
|
}
|
310
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationTextMessageComponent, decorators: [{
|
311
321
|
type: Component,
|
312
322
|
args: [{
|
313
323
|
template: `<div [innerHtml]="_text()"></div>`,
|
@@ -316,31 +326,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImpor
|
|
316
326
|
}]
|
317
327
|
}] });
|
318
328
|
|
319
|
-
class
|
329
|
+
class AXConversationAudioMessageComponent extends AXConversationMessageBaseComponent {
|
320
330
|
constructor() {
|
321
331
|
super();
|
322
332
|
this.config = { url: '' };
|
323
333
|
this.audioState = signal('paused');
|
334
|
+
this.selectedRate = signal(1);
|
335
|
+
this.selectedRateIndex = signal(1);
|
324
336
|
this.audioProgress = signal(0);
|
325
337
|
this.timeLeft = signal(0);
|
326
338
|
this.currentTime = signal(0);
|
327
339
|
this.duration = signal(0);
|
328
340
|
afterNextRender(() => {
|
329
341
|
this.config.url = this.message?.content;
|
330
|
-
this.
|
342
|
+
this.config.audioRate = 0.25;
|
343
|
+
this.setWaveColor();
|
344
|
+
this.handleLoadingProgress();
|
331
345
|
});
|
332
346
|
}
|
347
|
+
setWaveColor() {
|
348
|
+
let waveColor = '';
|
349
|
+
let progressColor = '';
|
350
|
+
if (this.message.fromId) {
|
351
|
+
waveColor = getComputedStyle(document.body).getPropertyValue('--ax-message-other-bar-color');
|
352
|
+
progressColor = getComputedStyle(document.body).getPropertyValue('--ax-message-other-progress-color');
|
353
|
+
}
|
354
|
+
else {
|
355
|
+
waveColor = getComputedStyle(document.body).getPropertyValue('--ax-message-own-bar-color');
|
356
|
+
progressColor = getComputedStyle(document.body).getPropertyValue('--ax-message-own-progress-color');
|
357
|
+
}
|
358
|
+
this.config.waveColor = waveColor;
|
359
|
+
this.config.progressColor = progressColor;
|
360
|
+
}
|
333
361
|
handlePauseClick() {
|
334
|
-
this.audio
|
362
|
+
this.audio?.pause();
|
335
363
|
this.audioState.set('paused');
|
336
364
|
}
|
337
365
|
handlePlayClick() {
|
338
|
-
this.audio
|
366
|
+
this.audio?.play()?.then(() => {
|
339
367
|
this.audioState.set('playing');
|
340
368
|
});
|
341
369
|
}
|
342
370
|
handleOnStatusChanged(e) {
|
343
|
-
|
371
|
+
if (e.status === 'load' || e.status === 'loading') {
|
372
|
+
this.audioState.set('loading');
|
373
|
+
}
|
344
374
|
if (e.status === 'loading') {
|
345
375
|
this.audioProgress.set(e.data.percent);
|
346
376
|
this.duration.set(Math.ceil(e.data.duration * 1000));
|
@@ -356,24 +386,55 @@ class AXChatAudioMessageComponent extends AXChatMessageBaseComponent {
|
|
356
386
|
this.timeLeft.set(this.duration() - e.data.currentTime * 1000);
|
357
387
|
this.currentTime.set(e.data.currentTime * 1000);
|
358
388
|
}
|
389
|
+
if (e.status === 'error') {
|
390
|
+
this.audioState.set('error');
|
391
|
+
}
|
392
|
+
}
|
393
|
+
handleLoadingProgress() {
|
394
|
+
// this.audioLoaderProgress?.nativeElement.style.cssText = `--ax-audio-progress: ${this.audioProgress()}`;
|
395
|
+
}
|
396
|
+
handleCancelLoading() {
|
397
|
+
//
|
359
398
|
}
|
360
|
-
|
361
|
-
|
399
|
+
handleReloadClick() {
|
400
|
+
//
|
401
|
+
this.audioState.set('loading');
|
402
|
+
this.audio.load();
|
403
|
+
}
|
404
|
+
handleRateClick() {
|
405
|
+
const rates = [0.5, 1, 2, 4];
|
406
|
+
if (this.selectedRateIndex() == rates.length - 1) {
|
407
|
+
this.selectedRateIndex.set(0);
|
408
|
+
}
|
409
|
+
else {
|
410
|
+
this.selectedRateIndex.set(this.selectedRateIndex() + 1);
|
411
|
+
}
|
412
|
+
this.selectedRate.set(rates[this.selectedRateIndex()]);
|
413
|
+
this.audio.setRate(this.selectedRate());
|
414
|
+
}
|
415
|
+
get __hostClass() {
|
416
|
+
return `${this.message.fromId ? 'ax-state-other' : 'ax-state-own'}`;
|
417
|
+
}
|
418
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationAudioMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
419
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.2", type: AXConversationAudioMessageComponent, selector: "ax-conversation-message-audio", inputs: { message: "message" }, host: { properties: { "class": "this.__hostClass" } }, viewQueries: [{ propertyName: "audio", first: true, predicate: ["a"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ax-prefix>\n @switch (audioState()) {\n @case ('paused')\n {\n {{currentTime() | format:'time-duration' | async}}\n }\n @case ('playing')\n {\n {{currentTime() | format:'time-duration' | async}}\n }\n @default {\n {{duration() | format:'time-duration' | async}}\n }\n }\n <button class=\"ax-audio-speed\" (click)=\"handleRateClick()\"></button>\n\n</ax-prefix>\n<div class=\"ax-audio-controller\">\n\n @switch (audioState()) {\n @case ('playing') {\n <button (click)=\"handlePauseClick()\">\n <i class=\"ax-icon ax-icon-pause\"></i>\n </button>\n }\n\n @case ('ready') {\n <button (click)=\"handlePlayClick()\">\n <i class=\"ax-icon ax-icon-play\" style=\"margin-inline-start: 0.25rem;\"></i>\n </button>\n }\n\n @case ('paused')\n {\n <button (click)=\"handlePlayClick()\">\n <i class=\"ax-icon ax-icon-play\" style=\"margin-inline-start: 0.25rem;\"></i>\n </button>\n }\n\n @case ('error')\n {\n <button class=\"ax-state-error\" (click)=\"handleReloadClick()\">\n <i class=\"ax-icon ax-icon-reload\"></i>\n </button>\n }\n\n @default {\n <button (click)=\"handleCancelLoading()\">\n <ax-loading-spinner [size]=\"24\" [stroke]=\"2\"\n [color]=\"message.fromId?'var(--ax-other-color)':'var(--ax-own-color)'\"></ax-loading-spinner>\n </button>\n }\n }\n\n</div>\n<ax-audio-wave #a [config]=\"config\" (onStatusChanged)=\"handleOnStatusChanged($event)\"></ax-audio-wave>\n<ax-suffix>\n <div class=\"ax-audio-rate-button\" [class.ax-state-own]=\"!message?.fromId\" (click)=\"handleRateClick()\">\n {{selectedRate()}}X</div>\n</ax-suffix>", styles: ["ax-conversation-message-audio{display:flex;align-items:center;justify-content:space-between;gap:.25rem;min-width:320px}ax-conversation-message-audio.ax-state-own .ax-audio-controller button{background-color:var(--ax-message-own-color-fore);color:var(--ax-message-own-color)}ax-conversation-message-audio.ax-state-other .ax-audio-controller button{background-color:var(--ax-message-other-color-fore);color:var(--ax-message-other-color)}ax-conversation-message-audio .ax-audio-controller button{width:2.5rem;height:2.5rem;border-radius:999rem;display:flex;align-items:center;justify-content:center}ax-conversation-message-audio .ax-audio-controller button ax-loading-spinner{display:flex}ax-conversation-message-audio .ax-audio-controller button.ax-state-error{background-color:rgba(var(--ax-color-danger-500));color:rgba(var(--ax-color-danger-fore))}ax-conversation-message-audio .ax-audio-controller button>i{width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;font-size:1.25rem;font-weight:700}ax-conversation-message-audio .ax-audio-wave{flex:1}.ax-audio-rate-button{background-color:var(--ax-message-other-color-fore);color:var(--ax-message-other-color);border-radius:.5rem;padding:0 .5rem;font-weight:700;margin-inline-end:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.ax-audio-rate-button.ax-state-own{background-color:var(--ax-message-own-color-fore);color:var(--ax-message-own-color)}\n"], dependencies: [{ kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title , ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i2$2.AXAudioWaveComponent, selector: "ax-audio-wave", inputs: ["config"], outputs: ["onStatusChanged"] }, { kind: "component", type: i3$1.AXLoadingSpinnerComponent, selector: "ax-loading-spinner", inputs: ["color", "size", "stroke"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i4$1.AXFormatPipe, name: "format" }], encapsulation: i0.ViewEncapsulation.None }); }
|
362
420
|
}
|
363
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
421
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationAudioMessageComponent, decorators: [{
|
364
422
|
type: Component,
|
365
|
-
args: [{ selector: 'ax-
|
423
|
+
args: [{ selector: 'ax-conversation-message-audio', encapsulation: ViewEncapsulation.None, inputs: ['message'], template: "<ax-prefix>\n @switch (audioState()) {\n @case ('paused')\n {\n {{currentTime() | format:'time-duration' | async}}\n }\n @case ('playing')\n {\n {{currentTime() | format:'time-duration' | async}}\n }\n @default {\n {{duration() | format:'time-duration' | async}}\n }\n }\n <button class=\"ax-audio-speed\" (click)=\"handleRateClick()\"></button>\n\n</ax-prefix>\n<div class=\"ax-audio-controller\">\n\n @switch (audioState()) {\n @case ('playing') {\n <button (click)=\"handlePauseClick()\">\n <i class=\"ax-icon ax-icon-pause\"></i>\n </button>\n }\n\n @case ('ready') {\n <button (click)=\"handlePlayClick()\">\n <i class=\"ax-icon ax-icon-play\" style=\"margin-inline-start: 0.25rem;\"></i>\n </button>\n }\n\n @case ('paused')\n {\n <button (click)=\"handlePlayClick()\">\n <i class=\"ax-icon ax-icon-play\" style=\"margin-inline-start: 0.25rem;\"></i>\n </button>\n }\n\n @case ('error')\n {\n <button class=\"ax-state-error\" (click)=\"handleReloadClick()\">\n <i class=\"ax-icon ax-icon-reload\"></i>\n </button>\n }\n\n @default {\n <button (click)=\"handleCancelLoading()\">\n <ax-loading-spinner [size]=\"24\" [stroke]=\"2\"\n [color]=\"message.fromId?'var(--ax-other-color)':'var(--ax-own-color)'\"></ax-loading-spinner>\n </button>\n }\n }\n\n</div>\n<ax-audio-wave #a [config]=\"config\" (onStatusChanged)=\"handleOnStatusChanged($event)\"></ax-audio-wave>\n<ax-suffix>\n <div class=\"ax-audio-rate-button\" [class.ax-state-own]=\"!message?.fromId\" (click)=\"handleRateClick()\">\n {{selectedRate()}}X</div>\n</ax-suffix>", styles: ["ax-conversation-message-audio{display:flex;align-items:center;justify-content:space-between;gap:.25rem;min-width:320px}ax-conversation-message-audio.ax-state-own .ax-audio-controller button{background-color:var(--ax-message-own-color-fore);color:var(--ax-message-own-color)}ax-conversation-message-audio.ax-state-other .ax-audio-controller button{background-color:var(--ax-message-other-color-fore);color:var(--ax-message-other-color)}ax-conversation-message-audio .ax-audio-controller button{width:2.5rem;height:2.5rem;border-radius:999rem;display:flex;align-items:center;justify-content:center}ax-conversation-message-audio .ax-audio-controller button ax-loading-spinner{display:flex}ax-conversation-message-audio .ax-audio-controller button.ax-state-error{background-color:rgba(var(--ax-color-danger-500));color:rgba(var(--ax-color-danger-fore))}ax-conversation-message-audio .ax-audio-controller button>i{width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;font-size:1.25rem;font-weight:700}ax-conversation-message-audio .ax-audio-wave{flex:1}.ax-audio-rate-button{background-color:var(--ax-message-other-color-fore);color:var(--ax-message-other-color);border-radius:.5rem;padding:0 .5rem;font-weight:700;margin-inline-end:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.ax-audio-rate-button.ax-state-own{background-color:var(--ax-message-own-color-fore);color:var(--ax-message-own-color)}\n"] }]
|
366
424
|
}], ctorParameters: () => [], propDecorators: { audio: [{
|
367
425
|
type: ViewChild,
|
368
426
|
args: ['a']
|
427
|
+
}], __hostClass: [{
|
428
|
+
type: HostBinding,
|
429
|
+
args: ['class']
|
369
430
|
}] } });
|
370
431
|
|
371
432
|
const COMPONENT = [
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
433
|
+
AXConversationViewComponent,
|
434
|
+
AXConversationInputComponent,
|
435
|
+
AXConversationMessageComponent,
|
436
|
+
AXConversationTextMessageComponent,
|
437
|
+
AXConversationAudioMessageComponent,
|
377
438
|
];
|
378
439
|
const MODULES = [
|
379
440
|
CommonModule,
|
@@ -389,11 +450,13 @@ const MODULES = [
|
|
389
450
|
AXCircularProgressModule,
|
390
451
|
AXDateTimeModule,
|
391
452
|
CdkPortalOutlet,
|
453
|
+
AXLoadingModule,
|
454
|
+
AXAvatarModule,
|
392
455
|
];
|
393
|
-
class
|
456
|
+
class AXConversationModule {
|
394
457
|
static forRoot(config) {
|
395
458
|
return {
|
396
|
-
ngModule:
|
459
|
+
ngModule: AXConversationModule,
|
397
460
|
providers: [
|
398
461
|
{
|
399
462
|
provide: 'AXChatModuleFactory',
|
@@ -403,14 +466,14 @@ class AXChatModule {
|
|
403
466
|
}
|
404
467
|
registry.register({
|
405
468
|
name: 'text',
|
406
|
-
component:
|
469
|
+
component: AXConversationTextMessageComponent,
|
407
470
|
});
|
408
471
|
registry.register({
|
409
472
|
name: 'audio',
|
410
|
-
component:
|
473
|
+
component: AXConversationAudioMessageComponent,
|
411
474
|
});
|
412
475
|
},
|
413
|
-
deps: [
|
476
|
+
deps: [AXConversationMessageTypeRegistryService],
|
414
477
|
multi: true,
|
415
478
|
},
|
416
479
|
],
|
@@ -418,7 +481,7 @@ class AXChatModule {
|
|
418
481
|
}
|
419
482
|
static forChild(config) {
|
420
483
|
return {
|
421
|
-
ngModule:
|
484
|
+
ngModule: AXConversationModule,
|
422
485
|
providers: [
|
423
486
|
{
|
424
487
|
provide: 'AXPWorkflowModuleFactory',
|
@@ -427,7 +490,7 @@ class AXChatModule {
|
|
427
490
|
registry.register(...config.types);
|
428
491
|
}
|
429
492
|
},
|
430
|
-
deps: [
|
493
|
+
deps: [AXConversationMessageTypeRegistryService],
|
431
494
|
multi: true,
|
432
495
|
},
|
433
496
|
],
|
@@ -441,12 +504,12 @@ class AXChatModule {
|
|
441
504
|
f();
|
442
505
|
});
|
443
506
|
}
|
444
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
445
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type:
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
507
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationModule, deps: [{ token: 'AXChatModuleFactory', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
508
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: AXConversationModule, declarations: [AXConversationViewComponent,
|
509
|
+
AXConversationInputComponent,
|
510
|
+
AXConversationMessageComponent,
|
511
|
+
AXConversationTextMessageComponent,
|
512
|
+
AXConversationAudioMessageComponent], imports: [CommonModule,
|
450
513
|
FormsModule,
|
451
514
|
AsyncPipe,
|
452
515
|
AXRippleDirective,
|
@@ -458,12 +521,14 @@ class AXChatModule {
|
|
458
521
|
AXAudioWaveModule,
|
459
522
|
AXCircularProgressModule,
|
460
523
|
AXDateTimeModule,
|
461
|
-
CdkPortalOutlet
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
524
|
+
CdkPortalOutlet,
|
525
|
+
AXLoadingModule,
|
526
|
+
AXAvatarModule], exports: [AXConversationViewComponent,
|
527
|
+
AXConversationInputComponent,
|
528
|
+
AXConversationMessageComponent,
|
529
|
+
AXConversationTextMessageComponent,
|
530
|
+
AXConversationAudioMessageComponent] }); }
|
531
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationModule, providers: [AXRecordingService], imports: [CommonModule,
|
467
532
|
FormsModule,
|
468
533
|
AXButtonModule,
|
469
534
|
AXDecoratorModule,
|
@@ -472,9 +537,11 @@ class AXChatModule {
|
|
472
537
|
AXFormatModule,
|
473
538
|
AXAudioWaveModule,
|
474
539
|
AXCircularProgressModule,
|
475
|
-
AXDateTimeModule
|
540
|
+
AXDateTimeModule,
|
541
|
+
AXLoadingModule,
|
542
|
+
AXAvatarModule] }); }
|
476
543
|
}
|
477
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
544
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationModule, decorators: [{
|
478
545
|
type: NgModule,
|
479
546
|
args: [{
|
480
547
|
declarations: [...COMPONENT],
|
@@ -489,11 +556,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImpor
|
|
489
556
|
args: ['AXChatModuleFactory']
|
490
557
|
}] }] });
|
491
558
|
|
492
|
-
class
|
493
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
494
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
559
|
+
class AXConversationService {
|
560
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
561
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationService }); }
|
495
562
|
}
|
496
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type:
|
563
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXConversationService, decorators: [{
|
497
564
|
type: Injectable
|
498
565
|
}] });
|
499
566
|
|
@@ -501,5 +568,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImpor
|
|
501
568
|
* Generated bundle index. Do not edit.
|
502
569
|
*/
|
503
570
|
|
504
|
-
export {
|
505
|
-
//# sourceMappingURL=acorex-components-
|
571
|
+
export { AXConversationAudioMessageComponent, AXConversationInputComponent, AXConversationMessageBaseComponent, AXConversationMessageComponent, AXConversationMessageTypeRegistryService, AXConversationModule, AXConversationService, AXConversationTextMessageComponent, AXConversationViewComponent, AXRecordingService };
|
572
|
+
//# sourceMappingURL=acorex-components-conversation.mjs.map
|