@xsmusices/ui 1.44.35 → 1.44.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/xsmusices-ui.mjs +15 -8
- package/fesm2022/xsmusices-ui.mjs.map +1 -1
- package/index.d.ts +13 -9
- package/package.json +1 -1
|
@@ -15465,6 +15465,7 @@ class XSChatTextareaComponent {
|
|
|
15465
15465
|
sendMessage = output();
|
|
15466
15466
|
sendWithAttachments = output();
|
|
15467
15467
|
sendError = output();
|
|
15468
|
+
typing = output();
|
|
15468
15469
|
textareaEl = viewChild('textareaEl', ...(ngDevMode ? [{ debugName: "textareaEl" }] : []));
|
|
15469
15470
|
fileInputEl = viewChild('fileInputEl', ...(ngDevMode ? [{ debugName: "fileInputEl" }] : []));
|
|
15470
15471
|
messageText = signal('', ...(ngDevMode ? [{ debugName: "messageText" }] : []));
|
|
@@ -15501,6 +15502,7 @@ class XSChatTextareaComponent {
|
|
|
15501
15502
|
}
|
|
15502
15503
|
onTextChange() {
|
|
15503
15504
|
this.autoResize();
|
|
15505
|
+
this.typing.emit();
|
|
15504
15506
|
}
|
|
15505
15507
|
autoResize() {
|
|
15506
15508
|
const textarea = this.textareaEl()?.nativeElement;
|
|
@@ -15679,12 +15681,12 @@ class XSChatTextareaComponent {
|
|
|
15679
15681
|
return BLOCKED_WORDS.some((word) => text.toLowerCase().includes(word));
|
|
15680
15682
|
}
|
|
15681
15683
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: XSChatTextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
15682
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.33", type: XSChatTextareaComponent, isStandalone: true, selector: "xs-chat-textarea", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, attachEnabled: { classPropertyName: "attachEnabled", publicName: "attachEnabled", isSignal: true, isRequired: false, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null }, uploadProgress: { classPropertyName: "uploadProgress", publicName: "uploadProgress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sendMessage: "sendMessage", sendWithAttachments: "sendWithAttachments", sendError: "sendError" }, host: { attributes: { "xs-chat-textarea-host": "" } }, viewQueries: [{ propertyName: "textareaEl", first: true, predicate: ["textareaEl"], descendants: true, isSignal: true }, { propertyName: "fileInputEl", first: true, predicate: ["fileInputEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex flex-col\">\n @if (showEmojiPicker()) {\n <div\n class=\"flex flex-wrap gap-1 p-2 border-t border-zinc-800 max-h-32 overflow-y-auto\"\n >\n @for (emoji of emojis; track emoji) {\n <button\n (click)=\"insertEmoji(emoji)\"\n class=\"w-8 h-8 flex items-center justify-center hover:bg-zinc-800 rounded-lg text-lg transition-colors\"\n >\n {{ emoji }}\n </button>\n }\n </div>\n }\n @if (attachEnabled() && drafts().length > 0) {\n <div class=\"flex flex-wrap gap-2 px-4 pt-2\">\n @for (draft of drafts(); track draft.name; let i = $index) {\n <div\n class=\"relative flex items-center gap-2 max-w-40 rounded-xl bg-zinc-900/70 border border-zinc-800 p-1.5\"\n >\n @if (isImageDraft(draft) && draft.previewUrl) {\n <img\n [src]=\"draft.previewUrl\"\n [alt]=\"draft.name\"\n class=\"w-10 h-10 rounded-lg object-cover shrink-0\"\n />\n }\n <div class=\"flex flex-col min-w-0\">\n <span class=\"text-xs font-medium text-white truncate\">\n {{ draft.name }}\n </span>\n <span class=\"text-[10px] text-zinc-500\">\n {{ (draft.size / 1024).toFixed(0) }} KB\n </span>\n </div>\n <button\n (click)=\"removeDraft(i)\"\n class=\"absolute -top-2 -right-2 w-5 h-5 flex items-center justify-center rounded-full bg-zinc-700 text-white text-[10px] leading-none hover:bg-zinc-600\"\n >\n \u2715\n </button>\n </div>\n }\n </div>\n }\n @if (uploading()) {\n <div class=\"px-4 pt-2\">\n <div class=\"h-1 rounded-full bg-zinc-800 overflow-hidden\">\n <div\n class=\"h-full rounded-full bg-white transition-all\"\n [style.width.%]=\"uploadProgress()\"\n ></div>\n </div>\n </div>\n }\n <div\n class=\"flex items-end gap-2 px-4 py-2 border-t border-zinc-800\"\n >\n @if (attachEnabled()) {\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"paperclip\"\n [disabled]=\"disabled() || uploading()\"\n (click)=\"openFilePicker()\"\n ></xs-button>\n <input\n #fileInputEl\n type=\"file\"\n class=\"hidden\"\n [accept]=\"attachmentAccept\"\n multiple\n (change)=\"onFilesSelected($event)\"\n />\n }\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"face-smile\"\n (click)=\"toggleEmojiPicker()\"\n ></xs-button>\n <div class=\"flex-1 relative\">\n <textarea\n #textareaEl\n [(ngModel)]=\"messageText\"\n (ngModelChange)=\"onTextChange()\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"autoResize()\"\n [placeholder]=\"placeholderText\"\n [maxLength]=\"maxLength\"\n class=\"block w-full px-4 py-2.5 text-sm font-medium text-white bg-zinc-900/50 border-0 focus:ring-0 focus:outline-none placeholder:text-zinc-500 resize-none overflow-hidden rounded-xl\"\n rows=\"1\"\n [disabled]=\"disabled()\"\n ></textarea>\n <span\n class=\"absolute bottom-2 right-3 text-[10px] text-zinc-500 pointer-events-none select-none leading-none\"\n >\n {{ messageText().length }}/{{ maxLength }}\n </span>\n </div>\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"paper-plane\"\n [disabled]=\"!canSend() || disabled()\"\n (click)=\"send()\"\n ></xs-button>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: XSButtonComponent, selector: "xs-button", inputs: ["id", "label", "type", "icon", "action", "customClass", "variant", "layout", "badgeCount", "isFull", "disabled", "loading", "title", "ariaLabel", "borderRadius", "isGrouped", "groupPosition"], outputs: ["isGroupedChange", "groupPositionChange", "click", "onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
15684
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.33", type: XSChatTextareaComponent, isStandalone: true, selector: "xs-chat-textarea", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, attachEnabled: { classPropertyName: "attachEnabled", publicName: "attachEnabled", isSignal: true, isRequired: false, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null }, uploadProgress: { classPropertyName: "uploadProgress", publicName: "uploadProgress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sendMessage: "sendMessage", sendWithAttachments: "sendWithAttachments", sendError: "sendError", typing: "typing" }, host: { attributes: { "xs-chat-textarea-host": "" } }, viewQueries: [{ propertyName: "textareaEl", first: true, predicate: ["textareaEl"], descendants: true, isSignal: true }, { propertyName: "fileInputEl", first: true, predicate: ["fileInputEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex flex-col\">\n @if (showEmojiPicker()) {\n <div\n class=\"flex flex-wrap gap-1 p-2 border-t border-zinc-800 max-h-32 overflow-y-auto\"\n >\n @for (emoji of emojis; track emoji) {\n <button\n (click)=\"insertEmoji(emoji)\"\n class=\"w-8 h-8 flex items-center justify-center hover:bg-zinc-800 rounded-lg text-lg transition-colors\"\n >\n {{ emoji }}\n </button>\n }\n </div>\n }\n @if (attachEnabled() && drafts().length > 0) {\n <div class=\"flex flex-wrap gap-2 px-4 pt-2\">\n @for (draft of drafts(); track draft.name; let i = $index) {\n <div\n class=\"relative flex items-center gap-2 max-w-40 rounded-xl bg-zinc-900/70 border border-zinc-800 p-1.5\"\n >\n @if (isImageDraft(draft) && draft.previewUrl) {\n <img\n [src]=\"draft.previewUrl\"\n [alt]=\"draft.name\"\n class=\"w-10 h-10 rounded-lg object-cover shrink-0\"\n />\n }\n <div class=\"flex flex-col min-w-0\">\n <span class=\"text-xs font-medium text-white truncate\">\n {{ draft.name }}\n </span>\n <span class=\"text-[10px] text-zinc-500\">\n {{ (draft.size / 1024).toFixed(0) }} KB\n </span>\n </div>\n <button\n (click)=\"removeDraft(i)\"\n class=\"absolute -top-2 -right-2 w-5 h-5 flex items-center justify-center rounded-full bg-zinc-700 text-white text-[10px] leading-none hover:bg-zinc-600\"\n >\n \u2715\n </button>\n </div>\n }\n </div>\n }\n @if (uploading()) {\n <div class=\"px-4 pt-2\">\n <div class=\"h-1 rounded-full bg-zinc-800 overflow-hidden\">\n <div\n class=\"h-full rounded-full bg-white transition-all\"\n [style.width.%]=\"uploadProgress()\"\n ></div>\n </div>\n </div>\n }\n <div\n class=\"flex items-end gap-2 px-4 py-2 border-t border-zinc-800\"\n >\n @if (attachEnabled()) {\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"paperclip\"\n [disabled]=\"disabled() || uploading()\"\n (click)=\"openFilePicker()\"\n ></xs-button>\n <input\n #fileInputEl\n type=\"file\"\n class=\"hidden\"\n [accept]=\"attachmentAccept\"\n multiple\n (change)=\"onFilesSelected($event)\"\n />\n }\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"face-smile\"\n (click)=\"toggleEmojiPicker()\"\n ></xs-button>\n <div class=\"flex-1 relative\">\n <textarea\n #textareaEl\n [(ngModel)]=\"messageText\"\n (ngModelChange)=\"onTextChange()\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"autoResize()\"\n [placeholder]=\"placeholderText\"\n [maxLength]=\"maxLength\"\n class=\"block w-full px-4 py-2.5 text-sm font-medium text-white bg-zinc-900/50 border-0 focus:ring-0 focus:outline-none placeholder:text-zinc-500 resize-none overflow-hidden rounded-xl\"\n rows=\"1\"\n [disabled]=\"disabled()\"\n ></textarea>\n <span\n class=\"absolute bottom-2 right-3 text-[10px] text-zinc-500 pointer-events-none select-none leading-none\"\n >\n {{ messageText().length }}/{{ maxLength }}\n </span>\n </div>\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"paper-plane\"\n [disabled]=\"!canSend() || disabled()\"\n (click)=\"send()\"\n ></xs-button>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: XSButtonComponent, selector: "xs-button", inputs: ["id", "label", "type", "icon", "action", "customClass", "variant", "layout", "badgeCount", "isFull", "disabled", "loading", "title", "ariaLabel", "borderRadius", "isGrouped", "groupPosition"], outputs: ["isGroupedChange", "groupPositionChange", "click", "onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
15683
15685
|
}
|
|
15684
15686
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: XSChatTextareaComponent, decorators: [{
|
|
15685
15687
|
type: Component,
|
|
15686
15688
|
args: [{ selector: 'xs-chat-textarea', standalone: true, imports: [CommonModule, FormsModule, XSButtonComponent], host: { 'xs-chat-textarea-host': '' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col\">\n @if (showEmojiPicker()) {\n <div\n class=\"flex flex-wrap gap-1 p-2 border-t border-zinc-800 max-h-32 overflow-y-auto\"\n >\n @for (emoji of emojis; track emoji) {\n <button\n (click)=\"insertEmoji(emoji)\"\n class=\"w-8 h-8 flex items-center justify-center hover:bg-zinc-800 rounded-lg text-lg transition-colors\"\n >\n {{ emoji }}\n </button>\n }\n </div>\n }\n @if (attachEnabled() && drafts().length > 0) {\n <div class=\"flex flex-wrap gap-2 px-4 pt-2\">\n @for (draft of drafts(); track draft.name; let i = $index) {\n <div\n class=\"relative flex items-center gap-2 max-w-40 rounded-xl bg-zinc-900/70 border border-zinc-800 p-1.5\"\n >\n @if (isImageDraft(draft) && draft.previewUrl) {\n <img\n [src]=\"draft.previewUrl\"\n [alt]=\"draft.name\"\n class=\"w-10 h-10 rounded-lg object-cover shrink-0\"\n />\n }\n <div class=\"flex flex-col min-w-0\">\n <span class=\"text-xs font-medium text-white truncate\">\n {{ draft.name }}\n </span>\n <span class=\"text-[10px] text-zinc-500\">\n {{ (draft.size / 1024).toFixed(0) }} KB\n </span>\n </div>\n <button\n (click)=\"removeDraft(i)\"\n class=\"absolute -top-2 -right-2 w-5 h-5 flex items-center justify-center rounded-full bg-zinc-700 text-white text-[10px] leading-none hover:bg-zinc-600\"\n >\n \u2715\n </button>\n </div>\n }\n </div>\n }\n @if (uploading()) {\n <div class=\"px-4 pt-2\">\n <div class=\"h-1 rounded-full bg-zinc-800 overflow-hidden\">\n <div\n class=\"h-full rounded-full bg-white transition-all\"\n [style.width.%]=\"uploadProgress()\"\n ></div>\n </div>\n </div>\n }\n <div\n class=\"flex items-end gap-2 px-4 py-2 border-t border-zinc-800\"\n >\n @if (attachEnabled()) {\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"paperclip\"\n [disabled]=\"disabled() || uploading()\"\n (click)=\"openFilePicker()\"\n ></xs-button>\n <input\n #fileInputEl\n type=\"file\"\n class=\"hidden\"\n [accept]=\"attachmentAccept\"\n multiple\n (change)=\"onFilesSelected($event)\"\n />\n }\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"face-smile\"\n (click)=\"toggleEmojiPicker()\"\n ></xs-button>\n <div class=\"flex-1 relative\">\n <textarea\n #textareaEl\n [(ngModel)]=\"messageText\"\n (ngModelChange)=\"onTextChange()\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"autoResize()\"\n [placeholder]=\"placeholderText\"\n [maxLength]=\"maxLength\"\n class=\"block w-full px-4 py-2.5 text-sm font-medium text-white bg-zinc-900/50 border-0 focus:ring-0 focus:outline-none placeholder:text-zinc-500 resize-none overflow-hidden rounded-xl\"\n rows=\"1\"\n [disabled]=\"disabled()\"\n ></textarea>\n <span\n class=\"absolute bottom-2 right-3 text-[10px] text-zinc-500 pointer-events-none select-none leading-none\"\n >\n {{ messageText().length }}/{{ maxLength }}\n </span>\n </div>\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"paper-plane\"\n [disabled]=\"!canSend() || disabled()\"\n (click)=\"send()\"\n ></xs-button>\n </div>\n</div>\n" }]
|
|
15687
|
-
}], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], attachEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachEnabled", required: false }] }], uploading: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploading", required: false }] }], uploadProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadProgress", required: false }] }], sendMessage: [{ type: i0.Output, args: ["sendMessage"] }], sendWithAttachments: [{ type: i0.Output, args: ["sendWithAttachments"] }], sendError: [{ type: i0.Output, args: ["sendError"] }], textareaEl: [{ type: i0.ViewChild, args: ['textareaEl', { isSignal: true }] }], fileInputEl: [{ type: i0.ViewChild, args: ['fileInputEl', { isSignal: true }] }] } });
|
|
15689
|
+
}], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], attachEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachEnabled", required: false }] }], uploading: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploading", required: false }] }], uploadProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadProgress", required: false }] }], sendMessage: [{ type: i0.Output, args: ["sendMessage"] }], sendWithAttachments: [{ type: i0.Output, args: ["sendWithAttachments"] }], sendError: [{ type: i0.Output, args: ["sendError"] }], typing: [{ type: i0.Output, args: ["typing"] }], textareaEl: [{ type: i0.ViewChild, args: ['textareaEl', { isSignal: true }] }], fileInputEl: [{ type: i0.ViewChild, args: ['fileInputEl', { isSignal: true }] }] } });
|
|
15688
15690
|
|
|
15689
15691
|
class XSChatConversationInfoComponent {
|
|
15690
15692
|
xsTranslate = inject(XSTranslateService);
|
|
@@ -15842,6 +15844,7 @@ class XSChatConversationComponent {
|
|
|
15842
15844
|
alertType = input(null, ...(ngDevMode ? [{ debugName: "alertType" }] : []));
|
|
15843
15845
|
alertMessage = input('', ...(ngDevMode ? [{ debugName: "alertMessage" }] : []));
|
|
15844
15846
|
sendError = output();
|
|
15847
|
+
typing = output();
|
|
15845
15848
|
sendMessage = output();
|
|
15846
15849
|
goToList = output();
|
|
15847
15850
|
loadMoreMessages = output();
|
|
@@ -16007,7 +16010,7 @@ class XSChatConversationComponent {
|
|
|
16007
16010
|
}
|
|
16008
16011
|
}
|
|
16009
16012
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: XSChatConversationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
16010
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.33", type: XSChatConversationComponent, isStandalone: true, selector: "xs-chat-conversation", inputs: { messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, currentChatInfo: { classPropertyName: "currentChatInfo", publicName: "currentChatInfo", isSignal: true, isRequired: false, transformFunction: null }, userId: { classPropertyName: "userId", publicName: "userId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, typingUserId: { classPropertyName: "typingUserId", publicName: "typingUserId", isSignal: true, isRequired: false, transformFunction: null }, typingLabel: { classPropertyName: "typingLabel", publicName: "typingLabel", isSignal: true, isRequired: false, transformFunction: null }, onlineLabel: { classPropertyName: "onlineLabel", publicName: "onlineLabel", isSignal: true, isRequired: false, transformFunction: null }, offlineLabel: { classPropertyName: "offlineLabel", publicName: "offlineLabel", isSignal: true, isRequired: false, transformFunction: null }, roleLabel: { classPropertyName: "roleLabel", publicName: "roleLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyMessagesLabel: { classPropertyName: "emptyMessagesLabel", publicName: "emptyMessagesLabel", isSignal: true, isRequired: false, transformFunction: null }, textareaPlaceholder: { classPropertyName: "textareaPlaceholder", publicName: "textareaPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, yesterdayLabel: { classPropertyName: "yesterdayLabel", publicName: "yesterdayLabel", isSignal: true, isRequired: false, transformFunction: null }, attachEnabled: { classPropertyName: "attachEnabled", publicName: "attachEnabled", isSignal: true, isRequired: false, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null }, uploadProgress: { classPropertyName: "uploadProgress", publicName: "uploadProgress", isSignal: true, isRequired: false, transformFunction: null }, infoButtons: { classPropertyName: "infoButtons", publicName: "infoButtons", isSignal: true, isRequired: false, transformFunction: null }, alertType: { classPropertyName: "alertType", publicName: "alertType", isSignal: true, isRequired: false, transformFunction: null }, alertMessage: { classPropertyName: "alertMessage", publicName: "alertMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sendError: "sendError", sendMessage: "sendMessage", goToList: "goToList", loadMoreMessages: "loadMoreMessages", clickInfoButton: "clickInfoButton", retryMessage: "retryMessage", replyToMessage: "replyToMessage" }, host: { attributes: { "xs-chat-conversation-host": "" }, classAttribute: "flex flex-col min-h-0 flex-1" }, viewQueries: [{ propertyName: "messagesContainer", first: true, predicate: ["messagesContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #messagesContainer\n class=\"flex flex-col flex-1 min-h-[300px] overflow-y-auto\"\n (scroll)=\"onScroll()\"\n >\n <xs-chat-conversation-info\n class=\"sticky top-0 z-10 bg-zinc-900\"\n [currentChatInfo]=\"currentChatInfo()\"\n [userId]=\"userId()\"\n [typingUserId]=\"typingUserId()\"\n [typingLabel]=\"typingLabel()\"\n [onlineLabel]=\"onlineLabel()\"\n [offlineLabel]=\"offlineLabel()\"\n [roleLabel]=\"roleLabel()\"\n [buttons]=\"infoButtons()\"\n (goToList)=\"goToList.emit()\"\n (clickButton)=\"clickInfoButton.emit($event)\"\n />\n\n @if (alertType(); as type) {\n <xs-chat-alert\n [type]=\"type\"\n [message]=\"alertMessage()\"\n />\n }\n\n <div class=\"flex-1 flex flex-col px-4 py-3\">\n @for (msg of messages(); track msg._id; let i = $index) {\n @if (showDateSeparator(i)) {\n <div class=\"flex justify-center py-2\">\n <span\n class=\"text-[10px] text-zinc-600 bg-zinc-900 px-3 py-1 rounded-full\"\n >\n {{ formatDateSeparator(msg.created) }}\n </span>\n </div>\n }\n <div\n class=\"flex group px-4 items-end gap-2\"\n [class.justify-end]=\"isMine(msg)\"\n [class.justify-start]=\"!isMine(msg)\"\n [class.mt-2]=\"i > 0 && isSameSender(i)\"\n [class.mt-3]=\"i > 0 && !isSameSender(i)\"\n >\n @if (!isMine(msg) && !isSameSender(i)) {\n <xs-image\n [item]=\"otherUser(msg)!\"\n typeItem=\"user\"\n imageType=\"small\"\n [alt]=\"otherUser(msg)?.name ?? ''\"\n class=\"w-7 h-7 rounded-full overflow-hidden shrink-0 mt-1\"\n [objectFit]=\"'cover'\"\n />\n } @else {\n <div class=\"w-7 shrink-0\"></div>\n }\n <div\n class=\"max-w-[80%] text-sm relative\"\n [class.rounded-2xl]=\"!isSameSender(i)\"\n [class.rounded-md]=\"i > 0 && isSameSender(i)\"\n [class.bg-zinc-500]=\"!isMine(msg)\"\n [class.bg-zinc-900]=\"isMine(msg)\"\n [class.px-3]=\"true\"\n [class.py-2]=\"!isSameSender(i)\"\n [class.py-1]=\"i > 0 && isSameSender(i)\"\n [class.rounded-br-md]=\"\n isMine(msg) && !isSameSender(i)\n \"\n [class.rounded-bl-md]=\"\n !isMine(msg) && !isSameSender(i)\n \"\n [class.rounded-tr-md]=\"\n isMine(msg) && isSameSender(i)\n \"\n [class.rounded-tl-md]=\"\n !isMine(msg) && isSameSender(i)\n \"\n >\n @if (msg.replyTo) {\n <div\n class=\"mb-1.5 pl-2 border-l-2 border-zinc-500 text-[11px] text-zinc-400 leading-tight\"\n >\n <span class=\"font-semibold text-zinc-300\">{{\n msg.replyTo.sender === userId()\n ? t('YOU')\n : msg.replyTo.sender\n }}</span>\n <p class=\"truncate\">{{ msg.replyTo.text }}</p>\n </div>\n }\n @if (hasLink(msg.text); as link) {\n <a\n [href]=\"link\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"block mb-1.5 p-2 rounded-lg bg-black/20 border border-zinc-700/50 hover:border-zinc-500 transition-colors\"\n >\n <span\n class=\"text-[11px] text-zinc-400 truncate block\"\n >{{ link }}</span\n >\n <span class=\"text-[10px] text-zinc-500\"\n >{{ t('OPEN_LINK') }}</span\n >\n </a>\n }\n <p\n class=\"text-white break-words whitespace-pre-wrap\"\n >\n {{ msg.text }}\n </p>\n @if (\n msg.attachments && msg.attachments.length > 0\n ) {\n <div class=\"flex flex-wrap gap-1.5 mt-1.5\">\n @for (att of msg.attachments; track att.url) {\n @if (att.type.startsWith('image/')) {\n <xs-image\n [item]=\"{ _id: att.url, image: true }\"\n [typeItem]=\"'media'\"\n imageType=\"normal\"\n [objectFit]=\"'cover'\"\n customClass=\"rounded-lg w-full max-h-48 object-cover\"\n />\n }\n }\n </div>\n }\n <div\n class=\"flex items-center justify-end gap-1 mt-1\"\n >\n <span class=\"text-[10px]\" [class.text-zinc-400]=\"!isMine(msg)\" [class.text-zinc-500]=\"isMine(msg)\">{{\n formatTime(msg.created)\n }}</span>\n @if (isMine(msg)) {\n @if (msg.isFailed) {\n <button\n (click)=\"onRetry(msg)\"\n class=\"text-red-400 hover:text-red-300 text-[10px] flex items-center gap-0.5\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-3 h-3\"\n >\n <path\n d=\"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\"\n />\n </svg>\n {{ t('RETRY') }}\n </button>\n } @else if (msg.isTemp) {\n <span\n class=\"text-[10px] text-zinc-500 animate-pulse\"\n >{{ t('SENDING') }}</span\n >\n } @else {\n <span\n class=\"text-[10px]\"\n [class.text-zinc-400]=\"msg.isRead\"\n [class.text-zinc-500]=\"!msg.isRead\"\n >\n {{ msg.isRead ? '\u2713\u2713' : '\u2713' }}\n </span>\n }\n }\n <button\n (click)=\"onReply(msg)\"\n class=\"opacity-0 group-hover:opacity-100 text-[10px] transition-opacity\"\n [class.text-zinc-600]=\"isMine(msg)\"\n [class.text-zinc-400]=\"!isMine(msg)\"\n [class.hover:text-zinc-300]=\"!isMine(msg)\"\n [class.hover:text-zinc-400]=\"isMine(msg)\"\n [title]=\"t('REPLY')\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-3 h-3\"\n >\n <path\n d=\"M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z\"\n />\n </svg>\n </button>\n <button\n (click)=\"copyMessage(msg.text)\"\n class=\"opacity-0 group-hover:opacity-100 text-[10px] transition-opacity\"\n [class.text-zinc-600]=\"isMine(msg)\"\n [class.text-zinc-400]=\"!isMine(msg)\"\n [class.hover:text-zinc-300]=\"!isMine(msg)\"\n [class.hover:text-zinc-400]=\"isMine(msg)\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-3 h-3\"\n >\n <path\n d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\"\n />\n </svg>\n </button>\n </div>\n </div>\n </div>\n } @empty {\n <div\n class=\"flex-1 flex items-center justify-center text-zinc-500 text-sm\"\n >\n {{ _emptyMessagesLabel() }}\n </div>\n }\n\n @if (typingUserId() && typingUserId() !== userId()) {\n <div class=\"flex justify-start px-4 pt-2\">\n <div\n class=\"flex items-center gap-2 px-4 py-3 rounded-2xl rounded-bl-md bg-zinc-800\"\n >\n <span\n class=\"w-2 h-2 bg-zinc-500 rounded-full animate-bounce delay-[0s]\"\n ></span>\n <span\n class=\"w-2 h-2 bg-zinc-500 rounded-full animate-bounce delay-[0.15s]\"\n ></span>\n <span\n class=\"w-2 h-2 bg-zinc-500 rounded-full animate-bounce delay-[0.3s]\"\n ></span>\n </div>\n </div>\n }\n </div>\n </div>\n\n <div class=\"shrink-0\">\n @if (replyToMsg(); as replyMsg) {\n <div\n class=\"bg-zinc-900 border-t border-zinc-800\"\n >\n <div class=\"flex items-center gap-2 px-4 py-2\">\n <div class=\"flex-1 min-w-0\">\n <span\n class=\"text-[11px] font-semibold text-zinc-400\"\n >{{ t('REPLYING_TO') }}\n {{\n replyMsg.sender === userId() ? t('YOURSELF') : ''\n }}</span\n >\n <p class=\"text-xs text-zinc-400 truncate\">\n {{ replyMsg.text }}\n </p>\n </div>\n <button\n (click)=\"cancelReply()\"\n class=\"text-zinc-500 hover:text-white shrink-0\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-4 h-4\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n />\n </svg>\n </button>\n </div>\n </div>\n }\n\n <xs-chat-textarea\n [placeholder]=\"\n replyToMsg()\n ? t('REPLY_PLACEHOLDER')\n : _textareaPlaceholder()\n \"\n [disabled]=\"disabled()\"\n [attachEnabled]=\"attachEnabled()\"\n [uploading]=\"uploading()\"\n [uploadProgress]=\"uploadProgress()\"\n (sendMessage)=\"onSendMessage($event)\"\n (sendWithAttachments)=\"onSendWithAttachments($event)\"\n (sendError)=\"sendError.emit($event)\"\n />\n </div>\n ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: XSChatTextareaComponent, selector: "xs-chat-textarea", inputs: ["placeholder", "disabled", "attachEnabled", "uploading", "uploadProgress"], outputs: ["sendMessage", "sendWithAttachments", "sendError"] }, { kind: "component", type: XSChatConversationInfoComponent, selector: "xs-chat-conversation-info", inputs: ["currentChatInfo", "userId", "typingUserId", "typingLabel", "onlineLabel", "offlineLabel", "roleLabel", "buttons"], outputs: ["goToList", "clickButton"] }, { kind: "component", type: XSChatAlertComponent, selector: "xs-chat-alert", inputs: ["type", "message"] }, { kind: "component", type: XSImageComponent, selector: "xs-image", inputs: ["config", "viewTransitionName", "src", "alt", "width", "height", "size", "rounded", "objectFit", "clickable", "item", "typeItem", "imageType", "fallbackSrc", "loading", "priority", "customClass", "generateAvatar"], outputs: ["onClick", "onLoad", "onError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
16013
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.33", type: XSChatConversationComponent, isStandalone: true, selector: "xs-chat-conversation", inputs: { messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, currentChatInfo: { classPropertyName: "currentChatInfo", publicName: "currentChatInfo", isSignal: true, isRequired: false, transformFunction: null }, userId: { classPropertyName: "userId", publicName: "userId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, typingUserId: { classPropertyName: "typingUserId", publicName: "typingUserId", isSignal: true, isRequired: false, transformFunction: null }, typingLabel: { classPropertyName: "typingLabel", publicName: "typingLabel", isSignal: true, isRequired: false, transformFunction: null }, onlineLabel: { classPropertyName: "onlineLabel", publicName: "onlineLabel", isSignal: true, isRequired: false, transformFunction: null }, offlineLabel: { classPropertyName: "offlineLabel", publicName: "offlineLabel", isSignal: true, isRequired: false, transformFunction: null }, roleLabel: { classPropertyName: "roleLabel", publicName: "roleLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyMessagesLabel: { classPropertyName: "emptyMessagesLabel", publicName: "emptyMessagesLabel", isSignal: true, isRequired: false, transformFunction: null }, textareaPlaceholder: { classPropertyName: "textareaPlaceholder", publicName: "textareaPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, yesterdayLabel: { classPropertyName: "yesterdayLabel", publicName: "yesterdayLabel", isSignal: true, isRequired: false, transformFunction: null }, attachEnabled: { classPropertyName: "attachEnabled", publicName: "attachEnabled", isSignal: true, isRequired: false, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null }, uploadProgress: { classPropertyName: "uploadProgress", publicName: "uploadProgress", isSignal: true, isRequired: false, transformFunction: null }, infoButtons: { classPropertyName: "infoButtons", publicName: "infoButtons", isSignal: true, isRequired: false, transformFunction: null }, alertType: { classPropertyName: "alertType", publicName: "alertType", isSignal: true, isRequired: false, transformFunction: null }, alertMessage: { classPropertyName: "alertMessage", publicName: "alertMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sendError: "sendError", typing: "typing", sendMessage: "sendMessage", goToList: "goToList", loadMoreMessages: "loadMoreMessages", clickInfoButton: "clickInfoButton", retryMessage: "retryMessage", replyToMessage: "replyToMessage" }, host: { attributes: { "xs-chat-conversation-host": "" }, classAttribute: "flex flex-col min-h-0 flex-1" }, viewQueries: [{ propertyName: "messagesContainer", first: true, predicate: ["messagesContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #messagesContainer\n class=\"flex flex-col flex-1 min-h-[300px] overflow-y-auto\"\n (scroll)=\"onScroll()\"\n >\n <xs-chat-conversation-info\n class=\"sticky top-0 z-10 bg-zinc-900\"\n [currentChatInfo]=\"currentChatInfo()\"\n [userId]=\"userId()\"\n [typingUserId]=\"typingUserId()\"\n [typingLabel]=\"typingLabel()\"\n [onlineLabel]=\"onlineLabel()\"\n [offlineLabel]=\"offlineLabel()\"\n [roleLabel]=\"roleLabel()\"\n [buttons]=\"infoButtons()\"\n (goToList)=\"goToList.emit()\"\n (clickButton)=\"clickInfoButton.emit($event)\"\n />\n\n @if (alertType(); as type) {\n <xs-chat-alert\n [type]=\"type\"\n [message]=\"alertMessage()\"\n />\n }\n\n <div class=\"flex-1 flex flex-col px-4 py-3\">\n @for (msg of messages(); track msg._id; let i = $index) {\n @if (showDateSeparator(i)) {\n <div class=\"flex justify-center py-2\">\n <span\n class=\"text-[10px] text-zinc-600 bg-zinc-900 px-3 py-1 rounded-full\"\n >\n {{ formatDateSeparator(msg.created) }}\n </span>\n </div>\n }\n <div\n class=\"flex group px-4 items-end gap-2\"\n [class.justify-end]=\"isMine(msg)\"\n [class.justify-start]=\"!isMine(msg)\"\n [class.mt-2]=\"i > 0 && isSameSender(i)\"\n [class.mt-3]=\"i > 0 && !isSameSender(i)\"\n >\n @if (!isMine(msg) && !isSameSender(i)) {\n <xs-image\n [item]=\"otherUser(msg)!\"\n typeItem=\"user\"\n imageType=\"small\"\n [alt]=\"otherUser(msg)?.name ?? ''\"\n class=\"w-7 h-7 rounded-full overflow-hidden shrink-0 mt-1\"\n [objectFit]=\"'cover'\"\n />\n } @else {\n <div class=\"w-7 shrink-0\"></div>\n }\n <div\n class=\"max-w-[80%] text-sm relative\"\n [class.rounded-2xl]=\"!isSameSender(i)\"\n [class.rounded-md]=\"i > 0 && isSameSender(i)\"\n [class.bg-zinc-500]=\"!isMine(msg)\"\n [class.bg-zinc-900]=\"isMine(msg)\"\n [class.px-3]=\"true\"\n [class.py-2]=\"!isSameSender(i)\"\n [class.py-1]=\"i > 0 && isSameSender(i)\"\n [class.rounded-br-md]=\"\n isMine(msg) && !isSameSender(i)\n \"\n [class.rounded-bl-md]=\"\n !isMine(msg) && !isSameSender(i)\n \"\n [class.rounded-tr-md]=\"\n isMine(msg) && isSameSender(i)\n \"\n [class.rounded-tl-md]=\"\n !isMine(msg) && isSameSender(i)\n \"\n >\n @if (msg.replyTo) {\n <div\n class=\"mb-1.5 pl-2 border-l-2 border-zinc-500 text-[11px] text-zinc-400 leading-tight\"\n >\n <span class=\"font-semibold text-zinc-300\">{{\n msg.replyTo.sender === userId()\n ? t('YOU')\n : msg.replyTo.sender\n }}</span>\n <p class=\"truncate\">{{ msg.replyTo.text }}</p>\n </div>\n }\n @if (hasLink(msg.text); as link) {\n <a\n [href]=\"link\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"block mb-1.5 p-2 rounded-lg bg-black/20 border border-zinc-700/50 hover:border-zinc-500 transition-colors\"\n >\n <span\n class=\"text-[11px] text-zinc-400 truncate block\"\n >{{ link }}</span\n >\n <span class=\"text-[10px] text-zinc-500\"\n >{{ t('OPEN_LINK') }}</span\n >\n </a>\n }\n <p\n class=\"text-white break-words whitespace-pre-wrap\"\n >\n {{ msg.text }}\n </p>\n @if (\n msg.attachments && msg.attachments.length > 0\n ) {\n <div class=\"flex flex-wrap gap-1.5 mt-1.5\">\n @for (att of msg.attachments; track att.url) {\n @if (att.type.startsWith('image/')) {\n <xs-image\n [item]=\"{ _id: att.url, image: true }\"\n [typeItem]=\"'media'\"\n imageType=\"normal\"\n [objectFit]=\"'cover'\"\n customClass=\"rounded-lg w-full max-h-48 object-cover\"\n />\n }\n }\n </div>\n }\n <div\n class=\"flex items-center justify-end gap-1 mt-1\"\n >\n <span class=\"text-[10px]\" [class.text-zinc-400]=\"!isMine(msg)\" [class.text-zinc-500]=\"isMine(msg)\">{{\n formatTime(msg.created)\n }}</span>\n @if (isMine(msg)) {\n @if (msg.isFailed) {\n <button\n (click)=\"onRetry(msg)\"\n class=\"text-red-400 hover:text-red-300 text-[10px] flex items-center gap-0.5\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-3 h-3\"\n >\n <path\n d=\"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\"\n />\n </svg>\n {{ t('RETRY') }}\n </button>\n } @else if (msg.isTemp) {\n <span\n class=\"text-[10px] text-zinc-500 animate-pulse\"\n >{{ t('SENDING') }}</span\n >\n } @else {\n <span\n class=\"text-[10px]\"\n [class.text-zinc-400]=\"msg.isRead\"\n [class.text-zinc-500]=\"!msg.isRead\"\n >\n {{ msg.isRead ? '\u2713\u2713' : '\u2713' }}\n </span>\n }\n }\n <button\n (click)=\"onReply(msg)\"\n class=\"opacity-0 group-hover:opacity-100 text-[10px] transition-opacity\"\n [class.text-zinc-600]=\"isMine(msg)\"\n [class.text-zinc-400]=\"!isMine(msg)\"\n [class.hover:text-zinc-300]=\"!isMine(msg)\"\n [class.hover:text-zinc-400]=\"isMine(msg)\"\n [title]=\"t('REPLY')\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-3 h-3\"\n >\n <path\n d=\"M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z\"\n />\n </svg>\n </button>\n <button\n (click)=\"copyMessage(msg.text)\"\n class=\"opacity-0 group-hover:opacity-100 text-[10px] transition-opacity\"\n [class.text-zinc-600]=\"isMine(msg)\"\n [class.text-zinc-400]=\"!isMine(msg)\"\n [class.hover:text-zinc-300]=\"!isMine(msg)\"\n [class.hover:text-zinc-400]=\"isMine(msg)\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-3 h-3\"\n >\n <path\n d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\"\n />\n </svg>\n </button>\n </div>\n </div>\n </div>\n } @empty {\n <div\n class=\"flex-1 flex items-center justify-center text-zinc-500 text-sm\"\n >\n {{ _emptyMessagesLabel() }}\n </div>\n }\n\n @if (typingUserId() && typingUserId() !== userId()) {\n <div class=\"flex justify-start px-4 pt-2\">\n <div\n class=\"flex items-center gap-2 px-4 py-3 rounded-2xl rounded-bl-md bg-zinc-800\"\n >\n <span\n class=\"w-2 h-2 bg-zinc-500 rounded-full animate-bounce delay-[0s]\"\n ></span>\n <span\n class=\"w-2 h-2 bg-zinc-500 rounded-full animate-bounce delay-[0.15s]\"\n ></span>\n <span\n class=\"w-2 h-2 bg-zinc-500 rounded-full animate-bounce delay-[0.3s]\"\n ></span>\n </div>\n </div>\n }\n </div>\n </div>\n\n <div class=\"shrink-0\">\n @if (replyToMsg(); as replyMsg) {\n <div\n class=\"bg-zinc-900 border-t border-zinc-800\"\n >\n <div class=\"flex items-center gap-2 px-4 py-2\">\n <div class=\"flex-1 min-w-0\">\n <span\n class=\"text-[11px] font-semibold text-zinc-400\"\n >{{ t('REPLYING_TO') }}\n {{\n replyMsg.sender === userId() ? t('YOURSELF') : ''\n }}</span\n >\n <p class=\"text-xs text-zinc-400 truncate\">\n {{ replyMsg.text }}\n </p>\n </div>\n <button\n (click)=\"cancelReply()\"\n class=\"text-zinc-500 hover:text-white shrink-0\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-4 h-4\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n />\n </svg>\n </button>\n </div>\n </div>\n }\n\n <xs-chat-textarea\n [placeholder]=\"\n replyToMsg()\n ? t('REPLY_PLACEHOLDER')\n : _textareaPlaceholder()\n \"\n [disabled]=\"disabled()\"\n [attachEnabled]=\"attachEnabled()\"\n [uploading]=\"uploading()\"\n [uploadProgress]=\"uploadProgress()\"\n (sendMessage)=\"onSendMessage($event)\"\n (sendWithAttachments)=\"onSendWithAttachments($event)\"\n (typing)=\"typing.emit()\"\n (sendError)=\"sendError.emit($event)\"\n />\n </div>\n ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: XSChatTextareaComponent, selector: "xs-chat-textarea", inputs: ["placeholder", "disabled", "attachEnabled", "uploading", "uploadProgress"], outputs: ["sendMessage", "sendWithAttachments", "sendError", "typing"] }, { kind: "component", type: XSChatConversationInfoComponent, selector: "xs-chat-conversation-info", inputs: ["currentChatInfo", "userId", "typingUserId", "typingLabel", "onlineLabel", "offlineLabel", "roleLabel", "buttons"], outputs: ["goToList", "clickButton"] }, { kind: "component", type: XSChatAlertComponent, selector: "xs-chat-alert", inputs: ["type", "message"] }, { kind: "component", type: XSImageComponent, selector: "xs-image", inputs: ["config", "viewTransitionName", "src", "alt", "width", "height", "size", "rounded", "objectFit", "clickable", "item", "typeItem", "imageType", "fallbackSrc", "loading", "priority", "customClass", "generateAvatar"], outputs: ["onClick", "onLoad", "onError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
16011
16014
|
}
|
|
16012
16015
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: XSChatConversationComponent, decorators: [{
|
|
16013
16016
|
type: Component,
|
|
@@ -16020,8 +16023,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImpo
|
|
|
16020
16023
|
], host: {
|
|
16021
16024
|
'xs-chat-conversation-host': '',
|
|
16022
16025
|
class: 'flex flex-col min-h-0 flex-1',
|
|
16023
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n #messagesContainer\n class=\"flex flex-col flex-1 min-h-[300px] overflow-y-auto\"\n (scroll)=\"onScroll()\"\n >\n <xs-chat-conversation-info\n class=\"sticky top-0 z-10 bg-zinc-900\"\n [currentChatInfo]=\"currentChatInfo()\"\n [userId]=\"userId()\"\n [typingUserId]=\"typingUserId()\"\n [typingLabel]=\"typingLabel()\"\n [onlineLabel]=\"onlineLabel()\"\n [offlineLabel]=\"offlineLabel()\"\n [roleLabel]=\"roleLabel()\"\n [buttons]=\"infoButtons()\"\n (goToList)=\"goToList.emit()\"\n (clickButton)=\"clickInfoButton.emit($event)\"\n />\n\n @if (alertType(); as type) {\n <xs-chat-alert\n [type]=\"type\"\n [message]=\"alertMessage()\"\n />\n }\n\n <div class=\"flex-1 flex flex-col px-4 py-3\">\n @for (msg of messages(); track msg._id; let i = $index) {\n @if (showDateSeparator(i)) {\n <div class=\"flex justify-center py-2\">\n <span\n class=\"text-[10px] text-zinc-600 bg-zinc-900 px-3 py-1 rounded-full\"\n >\n {{ formatDateSeparator(msg.created) }}\n </span>\n </div>\n }\n <div\n class=\"flex group px-4 items-end gap-2\"\n [class.justify-end]=\"isMine(msg)\"\n [class.justify-start]=\"!isMine(msg)\"\n [class.mt-2]=\"i > 0 && isSameSender(i)\"\n [class.mt-3]=\"i > 0 && !isSameSender(i)\"\n >\n @if (!isMine(msg) && !isSameSender(i)) {\n <xs-image\n [item]=\"otherUser(msg)!\"\n typeItem=\"user\"\n imageType=\"small\"\n [alt]=\"otherUser(msg)?.name ?? ''\"\n class=\"w-7 h-7 rounded-full overflow-hidden shrink-0 mt-1\"\n [objectFit]=\"'cover'\"\n />\n } @else {\n <div class=\"w-7 shrink-0\"></div>\n }\n <div\n class=\"max-w-[80%] text-sm relative\"\n [class.rounded-2xl]=\"!isSameSender(i)\"\n [class.rounded-md]=\"i > 0 && isSameSender(i)\"\n [class.bg-zinc-500]=\"!isMine(msg)\"\n [class.bg-zinc-900]=\"isMine(msg)\"\n [class.px-3]=\"true\"\n [class.py-2]=\"!isSameSender(i)\"\n [class.py-1]=\"i > 0 && isSameSender(i)\"\n [class.rounded-br-md]=\"\n isMine(msg) && !isSameSender(i)\n \"\n [class.rounded-bl-md]=\"\n !isMine(msg) && !isSameSender(i)\n \"\n [class.rounded-tr-md]=\"\n isMine(msg) && isSameSender(i)\n \"\n [class.rounded-tl-md]=\"\n !isMine(msg) && isSameSender(i)\n \"\n >\n @if (msg.replyTo) {\n <div\n class=\"mb-1.5 pl-2 border-l-2 border-zinc-500 text-[11px] text-zinc-400 leading-tight\"\n >\n <span class=\"font-semibold text-zinc-300\">{{\n msg.replyTo.sender === userId()\n ? t('YOU')\n : msg.replyTo.sender\n }}</span>\n <p class=\"truncate\">{{ msg.replyTo.text }}</p>\n </div>\n }\n @if (hasLink(msg.text); as link) {\n <a\n [href]=\"link\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"block mb-1.5 p-2 rounded-lg bg-black/20 border border-zinc-700/50 hover:border-zinc-500 transition-colors\"\n >\n <span\n class=\"text-[11px] text-zinc-400 truncate block\"\n >{{ link }}</span\n >\n <span class=\"text-[10px] text-zinc-500\"\n >{{ t('OPEN_LINK') }}</span\n >\n </a>\n }\n <p\n class=\"text-white break-words whitespace-pre-wrap\"\n >\n {{ msg.text }}\n </p>\n @if (\n msg.attachments && msg.attachments.length > 0\n ) {\n <div class=\"flex flex-wrap gap-1.5 mt-1.5\">\n @for (att of msg.attachments; track att.url) {\n @if (att.type.startsWith('image/')) {\n <xs-image\n [item]=\"{ _id: att.url, image: true }\"\n [typeItem]=\"'media'\"\n imageType=\"normal\"\n [objectFit]=\"'cover'\"\n customClass=\"rounded-lg w-full max-h-48 object-cover\"\n />\n }\n }\n </div>\n }\n <div\n class=\"flex items-center justify-end gap-1 mt-1\"\n >\n <span class=\"text-[10px]\" [class.text-zinc-400]=\"!isMine(msg)\" [class.text-zinc-500]=\"isMine(msg)\">{{\n formatTime(msg.created)\n }}</span>\n @if (isMine(msg)) {\n @if (msg.isFailed) {\n <button\n (click)=\"onRetry(msg)\"\n class=\"text-red-400 hover:text-red-300 text-[10px] flex items-center gap-0.5\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-3 h-3\"\n >\n <path\n d=\"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\"\n />\n </svg>\n {{ t('RETRY') }}\n </button>\n } @else if (msg.isTemp) {\n <span\n class=\"text-[10px] text-zinc-500 animate-pulse\"\n >{{ t('SENDING') }}</span\n >\n } @else {\n <span\n class=\"text-[10px]\"\n [class.text-zinc-400]=\"msg.isRead\"\n [class.text-zinc-500]=\"!msg.isRead\"\n >\n {{ msg.isRead ? '\u2713\u2713' : '\u2713' }}\n </span>\n }\n }\n <button\n (click)=\"onReply(msg)\"\n class=\"opacity-0 group-hover:opacity-100 text-[10px] transition-opacity\"\n [class.text-zinc-600]=\"isMine(msg)\"\n [class.text-zinc-400]=\"!isMine(msg)\"\n [class.hover:text-zinc-300]=\"!isMine(msg)\"\n [class.hover:text-zinc-400]=\"isMine(msg)\"\n [title]=\"t('REPLY')\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-3 h-3\"\n >\n <path\n d=\"M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z\"\n />\n </svg>\n </button>\n <button\n (click)=\"copyMessage(msg.text)\"\n class=\"opacity-0 group-hover:opacity-100 text-[10px] transition-opacity\"\n [class.text-zinc-600]=\"isMine(msg)\"\n [class.text-zinc-400]=\"!isMine(msg)\"\n [class.hover:text-zinc-300]=\"!isMine(msg)\"\n [class.hover:text-zinc-400]=\"isMine(msg)\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-3 h-3\"\n >\n <path\n d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\"\n />\n </svg>\n </button>\n </div>\n </div>\n </div>\n } @empty {\n <div\n class=\"flex-1 flex items-center justify-center text-zinc-500 text-sm\"\n >\n {{ _emptyMessagesLabel() }}\n </div>\n }\n\n @if (typingUserId() && typingUserId() !== userId()) {\n <div class=\"flex justify-start px-4 pt-2\">\n <div\n class=\"flex items-center gap-2 px-4 py-3 rounded-2xl rounded-bl-md bg-zinc-800\"\n >\n <span\n class=\"w-2 h-2 bg-zinc-500 rounded-full animate-bounce delay-[0s]\"\n ></span>\n <span\n class=\"w-2 h-2 bg-zinc-500 rounded-full animate-bounce delay-[0.15s]\"\n ></span>\n <span\n class=\"w-2 h-2 bg-zinc-500 rounded-full animate-bounce delay-[0.3s]\"\n ></span>\n </div>\n </div>\n }\n </div>\n </div>\n\n <div class=\"shrink-0\">\n @if (replyToMsg(); as replyMsg) {\n <div\n class=\"bg-zinc-900 border-t border-zinc-800\"\n >\n <div class=\"flex items-center gap-2 px-4 py-2\">\n <div class=\"flex-1 min-w-0\">\n <span\n class=\"text-[11px] font-semibold text-zinc-400\"\n >{{ t('REPLYING_TO') }}\n {{\n replyMsg.sender === userId() ? t('YOURSELF') : ''\n }}</span\n >\n <p class=\"text-xs text-zinc-400 truncate\">\n {{ replyMsg.text }}\n </p>\n </div>\n <button\n (click)=\"cancelReply()\"\n class=\"text-zinc-500 hover:text-white shrink-0\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-4 h-4\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n />\n </svg>\n </button>\n </div>\n </div>\n }\n\n <xs-chat-textarea\n [placeholder]=\"\n replyToMsg()\n ? t('REPLY_PLACEHOLDER')\n : _textareaPlaceholder()\n \"\n [disabled]=\"disabled()\"\n [attachEnabled]=\"attachEnabled()\"\n [uploading]=\"uploading()\"\n [uploadProgress]=\"uploadProgress()\"\n (sendMessage)=\"onSendMessage($event)\"\n (sendWithAttachments)=\"onSendWithAttachments($event)\"\n (sendError)=\"sendError.emit($event)\"\n />\n </div>\n " }]
|
|
16024
|
-
}], ctorParameters: () => [], propDecorators: { messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: false }] }], currentChatInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentChatInfo", required: false }] }], userId: [{ type: i0.Input, args: [{ isSignal: true, alias: "userId", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], typingUserId: [{ type: i0.Input, args: [{ isSignal: true, alias: "typingUserId", required: false }] }], typingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "typingLabel", required: false }] }], onlineLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "onlineLabel", required: false }] }], offlineLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "offlineLabel", required: false }] }], roleLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "roleLabel", required: false }] }], emptyMessagesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessagesLabel", required: false }] }], textareaPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "textareaPlaceholder", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], yesterdayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yesterdayLabel", required: false }] }], attachEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachEnabled", required: false }] }], uploading: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploading", required: false }] }], uploadProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadProgress", required: false }] }], infoButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "infoButtons", required: false }] }], alertType: [{ type: i0.Input, args: [{ isSignal: true, alias: "alertType", required: false }] }], alertMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "alertMessage", required: false }] }], sendError: [{ type: i0.Output, args: ["sendError"] }], sendMessage: [{ type: i0.Output, args: ["sendMessage"] }], goToList: [{ type: i0.Output, args: ["goToList"] }], loadMoreMessages: [{ type: i0.Output, args: ["loadMoreMessages"] }], clickInfoButton: [{ type: i0.Output, args: ["clickInfoButton"] }], retryMessage: [{ type: i0.Output, args: ["retryMessage"] }], replyToMessage: [{ type: i0.Output, args: ["replyToMessage"] }], messagesContainer: [{ type: i0.ViewChild, args: ['messagesContainer', { isSignal: true }] }] } });
|
|
16026
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n #messagesContainer\n class=\"flex flex-col flex-1 min-h-[300px] overflow-y-auto\"\n (scroll)=\"onScroll()\"\n >\n <xs-chat-conversation-info\n class=\"sticky top-0 z-10 bg-zinc-900\"\n [currentChatInfo]=\"currentChatInfo()\"\n [userId]=\"userId()\"\n [typingUserId]=\"typingUserId()\"\n [typingLabel]=\"typingLabel()\"\n [onlineLabel]=\"onlineLabel()\"\n [offlineLabel]=\"offlineLabel()\"\n [roleLabel]=\"roleLabel()\"\n [buttons]=\"infoButtons()\"\n (goToList)=\"goToList.emit()\"\n (clickButton)=\"clickInfoButton.emit($event)\"\n />\n\n @if (alertType(); as type) {\n <xs-chat-alert\n [type]=\"type\"\n [message]=\"alertMessage()\"\n />\n }\n\n <div class=\"flex-1 flex flex-col px-4 py-3\">\n @for (msg of messages(); track msg._id; let i = $index) {\n @if (showDateSeparator(i)) {\n <div class=\"flex justify-center py-2\">\n <span\n class=\"text-[10px] text-zinc-600 bg-zinc-900 px-3 py-1 rounded-full\"\n >\n {{ formatDateSeparator(msg.created) }}\n </span>\n </div>\n }\n <div\n class=\"flex group px-4 items-end gap-2\"\n [class.justify-end]=\"isMine(msg)\"\n [class.justify-start]=\"!isMine(msg)\"\n [class.mt-2]=\"i > 0 && isSameSender(i)\"\n [class.mt-3]=\"i > 0 && !isSameSender(i)\"\n >\n @if (!isMine(msg) && !isSameSender(i)) {\n <xs-image\n [item]=\"otherUser(msg)!\"\n typeItem=\"user\"\n imageType=\"small\"\n [alt]=\"otherUser(msg)?.name ?? ''\"\n class=\"w-7 h-7 rounded-full overflow-hidden shrink-0 mt-1\"\n [objectFit]=\"'cover'\"\n />\n } @else {\n <div class=\"w-7 shrink-0\"></div>\n }\n <div\n class=\"max-w-[80%] text-sm relative\"\n [class.rounded-2xl]=\"!isSameSender(i)\"\n [class.rounded-md]=\"i > 0 && isSameSender(i)\"\n [class.bg-zinc-500]=\"!isMine(msg)\"\n [class.bg-zinc-900]=\"isMine(msg)\"\n [class.px-3]=\"true\"\n [class.py-2]=\"!isSameSender(i)\"\n [class.py-1]=\"i > 0 && isSameSender(i)\"\n [class.rounded-br-md]=\"\n isMine(msg) && !isSameSender(i)\n \"\n [class.rounded-bl-md]=\"\n !isMine(msg) && !isSameSender(i)\n \"\n [class.rounded-tr-md]=\"\n isMine(msg) && isSameSender(i)\n \"\n [class.rounded-tl-md]=\"\n !isMine(msg) && isSameSender(i)\n \"\n >\n @if (msg.replyTo) {\n <div\n class=\"mb-1.5 pl-2 border-l-2 border-zinc-500 text-[11px] text-zinc-400 leading-tight\"\n >\n <span class=\"font-semibold text-zinc-300\">{{\n msg.replyTo.sender === userId()\n ? t('YOU')\n : msg.replyTo.sender\n }}</span>\n <p class=\"truncate\">{{ msg.replyTo.text }}</p>\n </div>\n }\n @if (hasLink(msg.text); as link) {\n <a\n [href]=\"link\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"block mb-1.5 p-2 rounded-lg bg-black/20 border border-zinc-700/50 hover:border-zinc-500 transition-colors\"\n >\n <span\n class=\"text-[11px] text-zinc-400 truncate block\"\n >{{ link }}</span\n >\n <span class=\"text-[10px] text-zinc-500\"\n >{{ t('OPEN_LINK') }}</span\n >\n </a>\n }\n <p\n class=\"text-white break-words whitespace-pre-wrap\"\n >\n {{ msg.text }}\n </p>\n @if (\n msg.attachments && msg.attachments.length > 0\n ) {\n <div class=\"flex flex-wrap gap-1.5 mt-1.5\">\n @for (att of msg.attachments; track att.url) {\n @if (att.type.startsWith('image/')) {\n <xs-image\n [item]=\"{ _id: att.url, image: true }\"\n [typeItem]=\"'media'\"\n imageType=\"normal\"\n [objectFit]=\"'cover'\"\n customClass=\"rounded-lg w-full max-h-48 object-cover\"\n />\n }\n }\n </div>\n }\n <div\n class=\"flex items-center justify-end gap-1 mt-1\"\n >\n <span class=\"text-[10px]\" [class.text-zinc-400]=\"!isMine(msg)\" [class.text-zinc-500]=\"isMine(msg)\">{{\n formatTime(msg.created)\n }}</span>\n @if (isMine(msg)) {\n @if (msg.isFailed) {\n <button\n (click)=\"onRetry(msg)\"\n class=\"text-red-400 hover:text-red-300 text-[10px] flex items-center gap-0.5\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-3 h-3\"\n >\n <path\n d=\"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\"\n />\n </svg>\n {{ t('RETRY') }}\n </button>\n } @else if (msg.isTemp) {\n <span\n class=\"text-[10px] text-zinc-500 animate-pulse\"\n >{{ t('SENDING') }}</span\n >\n } @else {\n <span\n class=\"text-[10px]\"\n [class.text-zinc-400]=\"msg.isRead\"\n [class.text-zinc-500]=\"!msg.isRead\"\n >\n {{ msg.isRead ? '\u2713\u2713' : '\u2713' }}\n </span>\n }\n }\n <button\n (click)=\"onReply(msg)\"\n class=\"opacity-0 group-hover:opacity-100 text-[10px] transition-opacity\"\n [class.text-zinc-600]=\"isMine(msg)\"\n [class.text-zinc-400]=\"!isMine(msg)\"\n [class.hover:text-zinc-300]=\"!isMine(msg)\"\n [class.hover:text-zinc-400]=\"isMine(msg)\"\n [title]=\"t('REPLY')\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-3 h-3\"\n >\n <path\n d=\"M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z\"\n />\n </svg>\n </button>\n <button\n (click)=\"copyMessage(msg.text)\"\n class=\"opacity-0 group-hover:opacity-100 text-[10px] transition-opacity\"\n [class.text-zinc-600]=\"isMine(msg)\"\n [class.text-zinc-400]=\"!isMine(msg)\"\n [class.hover:text-zinc-300]=\"!isMine(msg)\"\n [class.hover:text-zinc-400]=\"isMine(msg)\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-3 h-3\"\n >\n <path\n d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\"\n />\n </svg>\n </button>\n </div>\n </div>\n </div>\n } @empty {\n <div\n class=\"flex-1 flex items-center justify-center text-zinc-500 text-sm\"\n >\n {{ _emptyMessagesLabel() }}\n </div>\n }\n\n @if (typingUserId() && typingUserId() !== userId()) {\n <div class=\"flex justify-start px-4 pt-2\">\n <div\n class=\"flex items-center gap-2 px-4 py-3 rounded-2xl rounded-bl-md bg-zinc-800\"\n >\n <span\n class=\"w-2 h-2 bg-zinc-500 rounded-full animate-bounce delay-[0s]\"\n ></span>\n <span\n class=\"w-2 h-2 bg-zinc-500 rounded-full animate-bounce delay-[0.15s]\"\n ></span>\n <span\n class=\"w-2 h-2 bg-zinc-500 rounded-full animate-bounce delay-[0.3s]\"\n ></span>\n </div>\n </div>\n }\n </div>\n </div>\n\n <div class=\"shrink-0\">\n @if (replyToMsg(); as replyMsg) {\n <div\n class=\"bg-zinc-900 border-t border-zinc-800\"\n >\n <div class=\"flex items-center gap-2 px-4 py-2\">\n <div class=\"flex-1 min-w-0\">\n <span\n class=\"text-[11px] font-semibold text-zinc-400\"\n >{{ t('REPLYING_TO') }}\n {{\n replyMsg.sender === userId() ? t('YOURSELF') : ''\n }}</span\n >\n <p class=\"text-xs text-zinc-400 truncate\">\n {{ replyMsg.text }}\n </p>\n </div>\n <button\n (click)=\"cancelReply()\"\n class=\"text-zinc-500 hover:text-white shrink-0\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-4 h-4\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n />\n </svg>\n </button>\n </div>\n </div>\n }\n\n <xs-chat-textarea\n [placeholder]=\"\n replyToMsg()\n ? t('REPLY_PLACEHOLDER')\n : _textareaPlaceholder()\n \"\n [disabled]=\"disabled()\"\n [attachEnabled]=\"attachEnabled()\"\n [uploading]=\"uploading()\"\n [uploadProgress]=\"uploadProgress()\"\n (sendMessage)=\"onSendMessage($event)\"\n (sendWithAttachments)=\"onSendWithAttachments($event)\"\n (typing)=\"typing.emit()\"\n (sendError)=\"sendError.emit($event)\"\n />\n </div>\n " }]
|
|
16027
|
+
}], ctorParameters: () => [], propDecorators: { messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: false }] }], currentChatInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentChatInfo", required: false }] }], userId: [{ type: i0.Input, args: [{ isSignal: true, alias: "userId", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], typingUserId: [{ type: i0.Input, args: [{ isSignal: true, alias: "typingUserId", required: false }] }], typingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "typingLabel", required: false }] }], onlineLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "onlineLabel", required: false }] }], offlineLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "offlineLabel", required: false }] }], roleLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "roleLabel", required: false }] }], emptyMessagesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessagesLabel", required: false }] }], textareaPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "textareaPlaceholder", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], yesterdayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yesterdayLabel", required: false }] }], attachEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachEnabled", required: false }] }], uploading: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploading", required: false }] }], uploadProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadProgress", required: false }] }], infoButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "infoButtons", required: false }] }], alertType: [{ type: i0.Input, args: [{ isSignal: true, alias: "alertType", required: false }] }], alertMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "alertMessage", required: false }] }], sendError: [{ type: i0.Output, args: ["sendError"] }], typing: [{ type: i0.Output, args: ["typing"] }], sendMessage: [{ type: i0.Output, args: ["sendMessage"] }], goToList: [{ type: i0.Output, args: ["goToList"] }], loadMoreMessages: [{ type: i0.Output, args: ["loadMoreMessages"] }], clickInfoButton: [{ type: i0.Output, args: ["clickInfoButton"] }], retryMessage: [{ type: i0.Output, args: ["retryMessage"] }], replyToMessage: [{ type: i0.Output, args: ["replyToMessage"] }], messagesContainer: [{ type: i0.ViewChild, args: ['messagesContainer', { isSignal: true }] }] } });
|
|
16025
16028
|
|
|
16026
16029
|
class XSChatFloatingPanelComponent {
|
|
16027
16030
|
isOpen = input(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
@@ -16143,6 +16146,7 @@ class XSChatFloatingPanelComponent {
|
|
|
16143
16146
|
selectChat = output();
|
|
16144
16147
|
sendMessage = output();
|
|
16145
16148
|
sendError = output();
|
|
16149
|
+
typing = output();
|
|
16146
16150
|
retryMessage = output();
|
|
16147
16151
|
replyToMessage = output();
|
|
16148
16152
|
closePanel = output();
|
|
@@ -16158,6 +16162,9 @@ class XSChatFloatingPanelComponent {
|
|
|
16158
16162
|
onRetryMessage(messageId) {
|
|
16159
16163
|
this.retryMessage.emit(messageId);
|
|
16160
16164
|
}
|
|
16165
|
+
onTyping() {
|
|
16166
|
+
this.typing.emit();
|
|
16167
|
+
}
|
|
16161
16168
|
onReplyToMessage(message) {
|
|
16162
16169
|
this.replyToMessage.emit(message);
|
|
16163
16170
|
}
|
|
@@ -16171,7 +16178,7 @@ class XSChatFloatingPanelComponent {
|
|
|
16171
16178
|
this.clickDropdownItem.emit(event);
|
|
16172
16179
|
}
|
|
16173
16180
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: XSChatFloatingPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
16174
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.33", type: XSChatFloatingPanelComponent, isStandalone: true, selector: "xs-chat-floating-panel", inputs: { isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, chats: { classPropertyName: "chats", publicName: "chats", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, currentChatInfo: { classPropertyName: "currentChatInfo", publicName: "currentChatInfo", isSignal: true, isRequired: false, transformFunction: null }, userId: { classPropertyName: "userId", publicName: "userId", isSignal: true, isRequired: false, transformFunction: null }, selectedChatId: { classPropertyName: "selectedChatId", publicName: "selectedChatId", isSignal: true, isRequired: false, transformFunction: null }, typingUserId: { classPropertyName: "typingUserId", publicName: "typingUserId", isSignal: true, isRequired: false, transformFunction: null }, dropdownItems: { classPropertyName: "dropdownItems", publicName: "dropdownItems", isSignal: true, isRequired: false, transformFunction: null }, typingLabel: { classPropertyName: "typingLabel", publicName: "typingLabel", isSignal: true, isRequired: false, transformFunction: null }, onlineLabel: { classPropertyName: "onlineLabel", publicName: "onlineLabel", isSignal: true, isRequired: false, transformFunction: null }, offlineLabel: { classPropertyName: "offlineLabel", publicName: "offlineLabel", isSignal: true, isRequired: false, transformFunction: null }, roleLabel: { classPropertyName: "roleLabel", publicName: "roleLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyMessagesLabel: { classPropertyName: "emptyMessagesLabel", publicName: "emptyMessagesLabel", isSignal: true, isRequired: false, transformFunction: null }, textareaPlaceholder: { classPropertyName: "textareaPlaceholder", publicName: "textareaPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, yesterdayLabel: { classPropertyName: "yesterdayLabel", publicName: "yesterdayLabel", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, noResultsLabel: { classPropertyName: "noResultsLabel", publicName: "noResultsLabel", isSignal: true, isRequired: false, transformFunction: null }, noChatsLabel: { classPropertyName: "noChatsLabel", publicName: "noChatsLabel", isSignal: true, isRequired: false, transformFunction: null }, swipeBlockLabel: { classPropertyName: "swipeBlockLabel", publicName: "swipeBlockLabel", isSignal: true, isRequired: false, transformFunction: null }, swipePinLabel: { classPropertyName: "swipePinLabel", publicName: "swipePinLabel", isSignal: true, isRequired: false, transformFunction: null }, swipeDeleteLabel: { classPropertyName: "swipeDeleteLabel", publicName: "swipeDeleteLabel", isSignal: true, isRequired: false, transformFunction: null }, swipeCancelLabel: { classPropertyName: "swipeCancelLabel", publicName: "swipeCancelLabel", isSignal: true, isRequired: false, transformFunction: null }, infoButtons: { classPropertyName: "infoButtons", publicName: "infoButtons", isSignal: true, isRequired: false, transformFunction: null }, alertType: { classPropertyName: "alertType", publicName: "alertType", isSignal: true, isRequired: false, transformFunction: null }, alertMessage: { classPropertyName: "alertMessage", publicName: "alertMessage", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, attachEnabled: { classPropertyName: "attachEnabled", publicName: "attachEnabled", isSignal: true, isRequired: false, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null }, uploadProgress: { classPropertyName: "uploadProgress", publicName: "uploadProgress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectChat: "selectChat", sendMessage: "sendMessage", sendError: "sendError", retryMessage: "retryMessage", replyToMessage: "replyToMessage", closePanel: "closePanel", goToList: "goToList", clickDropdownItem: "clickDropdownItem", clickInfoButton: "clickInfoButton" }, host: { attributes: { "xs-chat-floating-panel-host": "" } }, ngImport: i0, template: "\n @if (isOpen()) {\n <div\n class=\"fixed inset-0 z-[300] hidden lg:block\"\n (click)=\"closePanel.emit()\"\n ></div>\n\n <div\n class=\"fixed bottom-20 right-4 z-[301] hidden lg:flex flex-col bg-zinc-900/95 backdrop-blur-2xl border border-white/10 rounded-2xl shadow-2xl w-[380px] h-[560px]\"\n (click)=\"$event.stopPropagation()\"\n >\n <div\n class=\"flex items-center justify-between px-4 py-3 border-b border-white/10 shrink-0\"\n >\n <div class=\"flex items-center gap-2 min-w-0\">\n @if (selectedChatId()) {\n <button\n (click)=\"goToList.emit()\"\n class=\"text-zinc-400 hover:text-white shrink-0 transition-colors\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-4 h-4\"\n >\n <path\n d=\"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\"\n />\n </svg>\n </button>\n }\n <span\n class=\"text-sm font-semibold text-white truncate\"\n >{{ title() }}</span\n >\n </div>\n <button\n (click)=\"closePanel.emit()\"\n class=\"flex items-center justify-center w-7 h-7 text-zinc-400 hover:text-white hover:bg-zinc-800 rounded-full transition-colors shrink-0\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-4 h-4\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n />\n </svg>\n </button>\n </div>\n\n <div class=\"flex-1 min-h-0 flex flex-col\">\n @if (!selectedChatId()) {\n <xs-chat-list\n [chats]=\"chats()\"\n [loading]=\"loading()\"\n [dropdownItems]=\"dropdownItems()\"\n [userId]=\"userId()\"\n [searchPlaceholder]=\"searchPlaceholderText\"\n [noResultsLabel]=\"noResultsText\"\n [noChatsLabel]=\"noChatsText\"\n [swipeBlockLabel]=\"swipeBlockText\"\n [swipePinLabel]=\"swipePinText\"\n [swipeDeleteLabel]=\"swipeDeleteText\"\n [swipeCancelLabel]=\"swipeCancelText\"\n (selectChat)=\"onSelectChat($event)\"\n (clickDropdownItem)=\"onDropdownItemClick($event)\"\n />\n } @else {\n <div class=\"flex-1 min-h-0 flex flex-col\">\n <xs-chat-conversation\n [messages]=\"messages()\"\n [currentChatInfo]=\"currentChatInfo()\"\n [userId]=\"userId()\"\n [typingUserId]=\"typingUserId()\"\n [typingLabel]=\"typingText\"\n [onlineLabel]=\"onlineText\"\n [offlineLabel]=\"offlineText\"\n [roleLabel]=\"roleLabel()\"\n [emptyMessagesLabel]=\"emptyMessagesText\"\n [textareaPlaceholder]=\"textareaPlaceholderText\"\n [todayLabel]=\"todayText\"\n [yesterdayLabel]=\"yesterdayText\"\n [infoButtons]=\"infoButtons()\"\n [alertType]=\"alertType()\"\n [alertMessage]=\"alertMessage()\"\n [attachEnabled]=\"attachEnabled()\"\n [uploading]=\"uploading()\"\n [uploadProgress]=\"uploadProgress()\"\n (sendMessage)=\"onSendMessage($event)\"\n (sendError)=\"sendError.emit($event)\"\n (retryMessage)=\"onRetryMessage($event)\"\n (replyToMessage)=\"onReplyToMessage($event)\"\n (goToList)=\"onGoToList()\"\n (clickInfoButton)=\"onClickInfoButton($event)\"\n />\n </div>\n }\n </div>\n\n @if (selectedChatId() && showFooter()) {\n <div\n class=\"flex items-center justify-between px-3 py-1 border-t border-white/10 shrink-0\"\n >\n <ng-content select=\"[footerLeft]\" />\n <ng-content select=\"[footerRight]\" />\n </div>\n }\n </div>\n }\n ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: XSChatListComponent, selector: "xs-chat-list", inputs: ["chats", "loading", "showSearch", "dropdownItems", "userId", "searchPlaceholder", "noResultsLabel", "noChatsLabel", "swipeBlockLabel", "swipePinLabel", "swipeDeleteLabel", "swipeCancelLabel"], outputs: ["searchQueryChange", "selectChat", "clickDropdownItem"] }, { kind: "component", type: XSChatConversationComponent, selector: "xs-chat-conversation", inputs: ["messages", "currentChatInfo", "userId", "disabled", "typingUserId", "typingLabel", "onlineLabel", "offlineLabel", "roleLabel", "emptyMessagesLabel", "textareaPlaceholder", "todayLabel", "yesterdayLabel", "attachEnabled", "uploading", "uploadProgress", "infoButtons", "alertType", "alertMessage"], outputs: ["sendError", "sendMessage", "goToList", "loadMoreMessages", "clickInfoButton", "retryMessage", "replyToMessage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
16181
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.33", type: XSChatFloatingPanelComponent, isStandalone: true, selector: "xs-chat-floating-panel", inputs: { isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, chats: { classPropertyName: "chats", publicName: "chats", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, currentChatInfo: { classPropertyName: "currentChatInfo", publicName: "currentChatInfo", isSignal: true, isRequired: false, transformFunction: null }, userId: { classPropertyName: "userId", publicName: "userId", isSignal: true, isRequired: false, transformFunction: null }, selectedChatId: { classPropertyName: "selectedChatId", publicName: "selectedChatId", isSignal: true, isRequired: false, transformFunction: null }, typingUserId: { classPropertyName: "typingUserId", publicName: "typingUserId", isSignal: true, isRequired: false, transformFunction: null }, dropdownItems: { classPropertyName: "dropdownItems", publicName: "dropdownItems", isSignal: true, isRequired: false, transformFunction: null }, typingLabel: { classPropertyName: "typingLabel", publicName: "typingLabel", isSignal: true, isRequired: false, transformFunction: null }, onlineLabel: { classPropertyName: "onlineLabel", publicName: "onlineLabel", isSignal: true, isRequired: false, transformFunction: null }, offlineLabel: { classPropertyName: "offlineLabel", publicName: "offlineLabel", isSignal: true, isRequired: false, transformFunction: null }, roleLabel: { classPropertyName: "roleLabel", publicName: "roleLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyMessagesLabel: { classPropertyName: "emptyMessagesLabel", publicName: "emptyMessagesLabel", isSignal: true, isRequired: false, transformFunction: null }, textareaPlaceholder: { classPropertyName: "textareaPlaceholder", publicName: "textareaPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, yesterdayLabel: { classPropertyName: "yesterdayLabel", publicName: "yesterdayLabel", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, noResultsLabel: { classPropertyName: "noResultsLabel", publicName: "noResultsLabel", isSignal: true, isRequired: false, transformFunction: null }, noChatsLabel: { classPropertyName: "noChatsLabel", publicName: "noChatsLabel", isSignal: true, isRequired: false, transformFunction: null }, swipeBlockLabel: { classPropertyName: "swipeBlockLabel", publicName: "swipeBlockLabel", isSignal: true, isRequired: false, transformFunction: null }, swipePinLabel: { classPropertyName: "swipePinLabel", publicName: "swipePinLabel", isSignal: true, isRequired: false, transformFunction: null }, swipeDeleteLabel: { classPropertyName: "swipeDeleteLabel", publicName: "swipeDeleteLabel", isSignal: true, isRequired: false, transformFunction: null }, swipeCancelLabel: { classPropertyName: "swipeCancelLabel", publicName: "swipeCancelLabel", isSignal: true, isRequired: false, transformFunction: null }, infoButtons: { classPropertyName: "infoButtons", publicName: "infoButtons", isSignal: true, isRequired: false, transformFunction: null }, alertType: { classPropertyName: "alertType", publicName: "alertType", isSignal: true, isRequired: false, transformFunction: null }, alertMessage: { classPropertyName: "alertMessage", publicName: "alertMessage", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, attachEnabled: { classPropertyName: "attachEnabled", publicName: "attachEnabled", isSignal: true, isRequired: false, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null }, uploadProgress: { classPropertyName: "uploadProgress", publicName: "uploadProgress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectChat: "selectChat", sendMessage: "sendMessage", sendError: "sendError", typing: "typing", retryMessage: "retryMessage", replyToMessage: "replyToMessage", closePanel: "closePanel", goToList: "goToList", clickDropdownItem: "clickDropdownItem", clickInfoButton: "clickInfoButton" }, host: { attributes: { "xs-chat-floating-panel-host": "" } }, ngImport: i0, template: "\n @if (isOpen()) {\n <div\n class=\"fixed inset-0 z-[300] hidden lg:block\"\n (click)=\"closePanel.emit()\"\n ></div>\n\n <div\n class=\"fixed bottom-20 right-4 z-[301] hidden lg:flex flex-col bg-zinc-900/95 backdrop-blur-2xl border border-white/10 rounded-2xl shadow-2xl w-[380px] h-[560px]\"\n (click)=\"$event.stopPropagation()\"\n >\n <div\n class=\"flex items-center justify-between px-4 py-3 border-b border-white/10 shrink-0\"\n >\n <div class=\"flex items-center gap-2 min-w-0\">\n @if (selectedChatId()) {\n <button\n (click)=\"goToList.emit()\"\n class=\"text-zinc-400 hover:text-white shrink-0 transition-colors\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-4 h-4\"\n >\n <path\n d=\"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\"\n />\n </svg>\n </button>\n }\n <span\n class=\"text-sm font-semibold text-white truncate\"\n >{{ title() }}</span\n >\n </div>\n <button\n (click)=\"closePanel.emit()\"\n class=\"flex items-center justify-center w-7 h-7 text-zinc-400 hover:text-white hover:bg-zinc-800 rounded-full transition-colors shrink-0\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-4 h-4\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n />\n </svg>\n </button>\n </div>\n\n <div class=\"flex-1 min-h-0 flex flex-col\">\n @if (!selectedChatId()) {\n <xs-chat-list\n [chats]=\"chats()\"\n [loading]=\"loading()\"\n [dropdownItems]=\"dropdownItems()\"\n [userId]=\"userId()\"\n [searchPlaceholder]=\"searchPlaceholderText\"\n [noResultsLabel]=\"noResultsText\"\n [noChatsLabel]=\"noChatsText\"\n [swipeBlockLabel]=\"swipeBlockText\"\n [swipePinLabel]=\"swipePinText\"\n [swipeDeleteLabel]=\"swipeDeleteText\"\n [swipeCancelLabel]=\"swipeCancelText\"\n (selectChat)=\"onSelectChat($event)\"\n (clickDropdownItem)=\"onDropdownItemClick($event)\"\n />\n } @else {\n <div class=\"flex-1 min-h-0 flex flex-col\">\n <xs-chat-conversation\n [messages]=\"messages()\"\n [currentChatInfo]=\"currentChatInfo()\"\n [userId]=\"userId()\"\n [typingUserId]=\"typingUserId()\"\n [typingLabel]=\"typingText\"\n [onlineLabel]=\"onlineText\"\n [offlineLabel]=\"offlineText\"\n [roleLabel]=\"roleLabel()\"\n [emptyMessagesLabel]=\"emptyMessagesText\"\n [textareaPlaceholder]=\"textareaPlaceholderText\"\n [todayLabel]=\"todayText\"\n [yesterdayLabel]=\"yesterdayText\"\n [infoButtons]=\"infoButtons()\"\n [alertType]=\"alertType()\"\n [alertMessage]=\"alertMessage()\"\n [attachEnabled]=\"attachEnabled()\"\n [uploading]=\"uploading()\"\n [uploadProgress]=\"uploadProgress()\"\n (sendMessage)=\"onSendMessage($event)\"\n (sendError)=\"sendError.emit($event)\"\n (typing)=\"onTyping()\"\n (retryMessage)=\"onRetryMessage($event)\"\n (replyToMessage)=\"onReplyToMessage($event)\"\n (goToList)=\"onGoToList()\"\n (clickInfoButton)=\"onClickInfoButton($event)\"\n />\n </div>\n }\n </div>\n\n @if (selectedChatId() && showFooter()) {\n <div\n class=\"flex items-center justify-between px-3 py-1 border-t border-white/10 shrink-0\"\n >\n <ng-content select=\"[footerLeft]\" />\n <ng-content select=\"[footerRight]\" />\n </div>\n }\n </div>\n }\n ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: XSChatListComponent, selector: "xs-chat-list", inputs: ["chats", "loading", "showSearch", "dropdownItems", "userId", "searchPlaceholder", "noResultsLabel", "noChatsLabel", "swipeBlockLabel", "swipePinLabel", "swipeDeleteLabel", "swipeCancelLabel"], outputs: ["searchQueryChange", "selectChat", "clickDropdownItem"] }, { kind: "component", type: XSChatConversationComponent, selector: "xs-chat-conversation", inputs: ["messages", "currentChatInfo", "userId", "disabled", "typingUserId", "typingLabel", "onlineLabel", "offlineLabel", "roleLabel", "emptyMessagesLabel", "textareaPlaceholder", "todayLabel", "yesterdayLabel", "attachEnabled", "uploading", "uploadProgress", "infoButtons", "alertType", "alertMessage"], outputs: ["sendError", "typing", "sendMessage", "goToList", "loadMoreMessages", "clickInfoButton", "retryMessage", "replyToMessage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
16175
16182
|
}
|
|
16176
16183
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: XSChatFloatingPanelComponent, decorators: [{
|
|
16177
16184
|
type: Component,
|
|
@@ -16179,8 +16186,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImpo
|
|
|
16179
16186
|
CommonModule,
|
|
16180
16187
|
XSChatListComponent,
|
|
16181
16188
|
XSChatConversationComponent,
|
|
16182
|
-
], host: { 'xs-chat-floating-panel-host': '' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "\n @if (isOpen()) {\n <div\n class=\"fixed inset-0 z-[300] hidden lg:block\"\n (click)=\"closePanel.emit()\"\n ></div>\n\n <div\n class=\"fixed bottom-20 right-4 z-[301] hidden lg:flex flex-col bg-zinc-900/95 backdrop-blur-2xl border border-white/10 rounded-2xl shadow-2xl w-[380px] h-[560px]\"\n (click)=\"$event.stopPropagation()\"\n >\n <div\n class=\"flex items-center justify-between px-4 py-3 border-b border-white/10 shrink-0\"\n >\n <div class=\"flex items-center gap-2 min-w-0\">\n @if (selectedChatId()) {\n <button\n (click)=\"goToList.emit()\"\n class=\"text-zinc-400 hover:text-white shrink-0 transition-colors\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-4 h-4\"\n >\n <path\n d=\"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\"\n />\n </svg>\n </button>\n }\n <span\n class=\"text-sm font-semibold text-white truncate\"\n >{{ title() }}</span\n >\n </div>\n <button\n (click)=\"closePanel.emit()\"\n class=\"flex items-center justify-center w-7 h-7 text-zinc-400 hover:text-white hover:bg-zinc-800 rounded-full transition-colors shrink-0\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-4 h-4\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n />\n </svg>\n </button>\n </div>\n\n <div class=\"flex-1 min-h-0 flex flex-col\">\n @if (!selectedChatId()) {\n <xs-chat-list\n [chats]=\"chats()\"\n [loading]=\"loading()\"\n [dropdownItems]=\"dropdownItems()\"\n [userId]=\"userId()\"\n [searchPlaceholder]=\"searchPlaceholderText\"\n [noResultsLabel]=\"noResultsText\"\n [noChatsLabel]=\"noChatsText\"\n [swipeBlockLabel]=\"swipeBlockText\"\n [swipePinLabel]=\"swipePinText\"\n [swipeDeleteLabel]=\"swipeDeleteText\"\n [swipeCancelLabel]=\"swipeCancelText\"\n (selectChat)=\"onSelectChat($event)\"\n (clickDropdownItem)=\"onDropdownItemClick($event)\"\n />\n } @else {\n <div class=\"flex-1 min-h-0 flex flex-col\">\n <xs-chat-conversation\n [messages]=\"messages()\"\n [currentChatInfo]=\"currentChatInfo()\"\n [userId]=\"userId()\"\n [typingUserId]=\"typingUserId()\"\n [typingLabel]=\"typingText\"\n [onlineLabel]=\"onlineText\"\n [offlineLabel]=\"offlineText\"\n [roleLabel]=\"roleLabel()\"\n [emptyMessagesLabel]=\"emptyMessagesText\"\n [textareaPlaceholder]=\"textareaPlaceholderText\"\n [todayLabel]=\"todayText\"\n [yesterdayLabel]=\"yesterdayText\"\n [infoButtons]=\"infoButtons()\"\n [alertType]=\"alertType()\"\n [alertMessage]=\"alertMessage()\"\n [attachEnabled]=\"attachEnabled()\"\n [uploading]=\"uploading()\"\n [uploadProgress]=\"uploadProgress()\"\n (sendMessage)=\"onSendMessage($event)\"\n (sendError)=\"sendError.emit($event)\"\n (retryMessage)=\"onRetryMessage($event)\"\n (replyToMessage)=\"onReplyToMessage($event)\"\n (goToList)=\"onGoToList()\"\n (clickInfoButton)=\"onClickInfoButton($event)\"\n />\n </div>\n }\n </div>\n\n @if (selectedChatId() && showFooter()) {\n <div\n class=\"flex items-center justify-between px-3 py-1 border-t border-white/10 shrink-0\"\n >\n <ng-content select=\"[footerLeft]\" />\n <ng-content select=\"[footerRight]\" />\n </div>\n }\n </div>\n }\n " }]
|
|
16183
|
-
}], ctorParameters: () => [], propDecorators: { isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], chats: [{ type: i0.Input, args: [{ isSignal: true, alias: "chats", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: false }] }], currentChatInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentChatInfo", required: false }] }], userId: [{ type: i0.Input, args: [{ isSignal: true, alias: "userId", required: false }] }], selectedChatId: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedChatId", required: false }] }], typingUserId: [{ type: i0.Input, args: [{ isSignal: true, alias: "typingUserId", required: false }] }], dropdownItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownItems", required: false }] }], typingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "typingLabel", required: false }] }], onlineLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "onlineLabel", required: false }] }], offlineLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "offlineLabel", required: false }] }], roleLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "roleLabel", required: false }] }], emptyMessagesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessagesLabel", required: false }] }], textareaPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "textareaPlaceholder", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], yesterdayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yesterdayLabel", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], noResultsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "noResultsLabel", required: false }] }], noChatsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "noChatsLabel", required: false }] }], swipeBlockLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "swipeBlockLabel", required: false }] }], swipePinLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "swipePinLabel", required: false }] }], swipeDeleteLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "swipeDeleteLabel", required: false }] }], swipeCancelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "swipeCancelLabel", required: false }] }], infoButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "infoButtons", required: false }] }], alertType: [{ type: i0.Input, args: [{ isSignal: true, alias: "alertType", required: false }] }], alertMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "alertMessage", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], attachEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachEnabled", required: false }] }], uploading: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploading", required: false }] }], uploadProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadProgress", required: false }] }], selectChat: [{ type: i0.Output, args: ["selectChat"] }], sendMessage: [{ type: i0.Output, args: ["sendMessage"] }], sendError: [{ type: i0.Output, args: ["sendError"] }], retryMessage: [{ type: i0.Output, args: ["retryMessage"] }], replyToMessage: [{ type: i0.Output, args: ["replyToMessage"] }], closePanel: [{ type: i0.Output, args: ["closePanel"] }], goToList: [{ type: i0.Output, args: ["goToList"] }], clickDropdownItem: [{ type: i0.Output, args: ["clickDropdownItem"] }], clickInfoButton: [{ type: i0.Output, args: ["clickInfoButton"] }] } });
|
|
16189
|
+
], host: { 'xs-chat-floating-panel-host': '' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "\n @if (isOpen()) {\n <div\n class=\"fixed inset-0 z-[300] hidden lg:block\"\n (click)=\"closePanel.emit()\"\n ></div>\n\n <div\n class=\"fixed bottom-20 right-4 z-[301] hidden lg:flex flex-col bg-zinc-900/95 backdrop-blur-2xl border border-white/10 rounded-2xl shadow-2xl w-[380px] h-[560px]\"\n (click)=\"$event.stopPropagation()\"\n >\n <div\n class=\"flex items-center justify-between px-4 py-3 border-b border-white/10 shrink-0\"\n >\n <div class=\"flex items-center gap-2 min-w-0\">\n @if (selectedChatId()) {\n <button\n (click)=\"goToList.emit()\"\n class=\"text-zinc-400 hover:text-white shrink-0 transition-colors\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-4 h-4\"\n >\n <path\n d=\"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\"\n />\n </svg>\n </button>\n }\n <span\n class=\"text-sm font-semibold text-white truncate\"\n >{{ title() }}</span\n >\n </div>\n <button\n (click)=\"closePanel.emit()\"\n class=\"flex items-center justify-center w-7 h-7 text-zinc-400 hover:text-white hover:bg-zinc-800 rounded-full transition-colors shrink-0\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"w-4 h-4\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n />\n </svg>\n </button>\n </div>\n\n <div class=\"flex-1 min-h-0 flex flex-col\">\n @if (!selectedChatId()) {\n <xs-chat-list\n [chats]=\"chats()\"\n [loading]=\"loading()\"\n [dropdownItems]=\"dropdownItems()\"\n [userId]=\"userId()\"\n [searchPlaceholder]=\"searchPlaceholderText\"\n [noResultsLabel]=\"noResultsText\"\n [noChatsLabel]=\"noChatsText\"\n [swipeBlockLabel]=\"swipeBlockText\"\n [swipePinLabel]=\"swipePinText\"\n [swipeDeleteLabel]=\"swipeDeleteText\"\n [swipeCancelLabel]=\"swipeCancelText\"\n (selectChat)=\"onSelectChat($event)\"\n (clickDropdownItem)=\"onDropdownItemClick($event)\"\n />\n } @else {\n <div class=\"flex-1 min-h-0 flex flex-col\">\n <xs-chat-conversation\n [messages]=\"messages()\"\n [currentChatInfo]=\"currentChatInfo()\"\n [userId]=\"userId()\"\n [typingUserId]=\"typingUserId()\"\n [typingLabel]=\"typingText\"\n [onlineLabel]=\"onlineText\"\n [offlineLabel]=\"offlineText\"\n [roleLabel]=\"roleLabel()\"\n [emptyMessagesLabel]=\"emptyMessagesText\"\n [textareaPlaceholder]=\"textareaPlaceholderText\"\n [todayLabel]=\"todayText\"\n [yesterdayLabel]=\"yesterdayText\"\n [infoButtons]=\"infoButtons()\"\n [alertType]=\"alertType()\"\n [alertMessage]=\"alertMessage()\"\n [attachEnabled]=\"attachEnabled()\"\n [uploading]=\"uploading()\"\n [uploadProgress]=\"uploadProgress()\"\n (sendMessage)=\"onSendMessage($event)\"\n (sendError)=\"sendError.emit($event)\"\n (typing)=\"onTyping()\"\n (retryMessage)=\"onRetryMessage($event)\"\n (replyToMessage)=\"onReplyToMessage($event)\"\n (goToList)=\"onGoToList()\"\n (clickInfoButton)=\"onClickInfoButton($event)\"\n />\n </div>\n }\n </div>\n\n @if (selectedChatId() && showFooter()) {\n <div\n class=\"flex items-center justify-between px-3 py-1 border-t border-white/10 shrink-0\"\n >\n <ng-content select=\"[footerLeft]\" />\n <ng-content select=\"[footerRight]\" />\n </div>\n }\n </div>\n }\n " }]
|
|
16190
|
+
}], ctorParameters: () => [], propDecorators: { isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], chats: [{ type: i0.Input, args: [{ isSignal: true, alias: "chats", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: false }] }], currentChatInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentChatInfo", required: false }] }], userId: [{ type: i0.Input, args: [{ isSignal: true, alias: "userId", required: false }] }], selectedChatId: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedChatId", required: false }] }], typingUserId: [{ type: i0.Input, args: [{ isSignal: true, alias: "typingUserId", required: false }] }], dropdownItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownItems", required: false }] }], typingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "typingLabel", required: false }] }], onlineLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "onlineLabel", required: false }] }], offlineLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "offlineLabel", required: false }] }], roleLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "roleLabel", required: false }] }], emptyMessagesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessagesLabel", required: false }] }], textareaPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "textareaPlaceholder", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], yesterdayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yesterdayLabel", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], noResultsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "noResultsLabel", required: false }] }], noChatsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "noChatsLabel", required: false }] }], swipeBlockLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "swipeBlockLabel", required: false }] }], swipePinLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "swipePinLabel", required: false }] }], swipeDeleteLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "swipeDeleteLabel", required: false }] }], swipeCancelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "swipeCancelLabel", required: false }] }], infoButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "infoButtons", required: false }] }], alertType: [{ type: i0.Input, args: [{ isSignal: true, alias: "alertType", required: false }] }], alertMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "alertMessage", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], attachEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachEnabled", required: false }] }], uploading: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploading", required: false }] }], uploadProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadProgress", required: false }] }], selectChat: [{ type: i0.Output, args: ["selectChat"] }], sendMessage: [{ type: i0.Output, args: ["sendMessage"] }], sendError: [{ type: i0.Output, args: ["sendError"] }], typing: [{ type: i0.Output, args: ["typing"] }], retryMessage: [{ type: i0.Output, args: ["retryMessage"] }], replyToMessage: [{ type: i0.Output, args: ["replyToMessage"] }], closePanel: [{ type: i0.Output, args: ["closePanel"] }], goToList: [{ type: i0.Output, args: ["goToList"] }], clickDropdownItem: [{ type: i0.Output, args: ["clickDropdownItem"] }], clickInfoButton: [{ type: i0.Output, args: ["clickInfoButton"] }] } });
|
|
16184
16191
|
|
|
16185
16192
|
class XSOtaProgressBarComponent {
|
|
16186
16193
|
visible = input(false, ...(ngDevMode ? [{ debugName: "visible" }] : []));
|