stream-chat-angular 4.45.2 → 4.47.0
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/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +73 -9
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/chat-client.service.js +19 -1
- package/esm2015/lib/custom-templates.service.js +9 -1
- package/esm2015/lib/message-list/message-list.component.js +39 -9
- package/fesm2015/stream-chat-angular.js +65 -9
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/custom-templates.service.d.ts +8 -0
- package/lib/message-list/message-list.component.d.ts +8 -3
- package/package.json +1 -1
- package/src/assets/version.ts +1 -1
package/assets/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.
|
|
1
|
+
export declare const version = "4.47.0";
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
var version = '4.
|
|
359
|
+
var version = '4.47.0';
|
|
360
360
|
|
|
361
361
|
/**
|
|
362
362
|
* The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
|
|
@@ -660,6 +660,24 @@
|
|
|
660
660
|
this.userSubject.next(Object.assign(Object.assign({}, user_1), { total_unread_count: e.total_unread_count }));
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
+
if (typeof e.unread_channels !== 'undefined') {
|
|
664
|
+
var user_2;
|
|
665
|
+
this.userSubject.pipe(rxjs.take(1)).subscribe(function (u) {
|
|
666
|
+
user_2 = u;
|
|
667
|
+
});
|
|
668
|
+
if (user_2 && user_2.unread_channels !== e.unread_channels) {
|
|
669
|
+
this.userSubject.next(Object.assign(Object.assign({}, user_2), { unread_channels: e.unread_channels }));
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
if (typeof e.unread_count !== 'undefined') {
|
|
673
|
+
var user_3;
|
|
674
|
+
this.userSubject.pipe(rxjs.take(1)).subscribe(function (u) {
|
|
675
|
+
user_3 = u;
|
|
676
|
+
});
|
|
677
|
+
if (user_3 && user_3.unread_count !== e.unread_count) {
|
|
678
|
+
this.userSubject.next(Object.assign(Object.assign({}, user_3), { unread_count: e.unread_count }));
|
|
679
|
+
}
|
|
680
|
+
}
|
|
663
681
|
if (e.type === 'user.updated' &&
|
|
664
682
|
this.chatClient.user &&
|
|
665
683
|
((_a = e.user) === null || _a === void 0 ? void 0 : _a.id) === this.chatClient.user.id) {
|
|
@@ -3242,6 +3260,14 @@
|
|
|
3242
3260
|
* The template used to display the new messages indicator inside the [message list](../components/MessageListComponent.mdx)
|
|
3243
3261
|
*/
|
|
3244
3262
|
this.newMessagesIndicatorTemplate$ = new rxjs.BehaviorSubject(undefined);
|
|
3263
|
+
/**
|
|
3264
|
+
* The template to show if the main message list is empty
|
|
3265
|
+
*/
|
|
3266
|
+
this.emptyMainMessageListPlaceholder$ = new rxjs.BehaviorSubject(undefined);
|
|
3267
|
+
/**
|
|
3268
|
+
* The template to show if the thread message list is empty
|
|
3269
|
+
*/
|
|
3270
|
+
this.emptyThreadMessageListPlaceholder$ = new rxjs.BehaviorSubject(undefined);
|
|
3245
3271
|
}
|
|
3246
3272
|
return CustomTemplatesService;
|
|
3247
3273
|
}());
|
|
@@ -6159,13 +6185,14 @@
|
|
|
6159
6185
|
* The `MessageList` component renders a scrollable list of messages.
|
|
6160
6186
|
*/
|
|
6161
6187
|
var MessageListComponent = /** @class */ (function () {
|
|
6162
|
-
function MessageListComponent(channelService, chatClientService, customTemplatesService, dateParser, ngZone) {
|
|
6188
|
+
function MessageListComponent(channelService, chatClientService, customTemplatesService, dateParser, ngZone, cdRef) {
|
|
6163
6189
|
var _this = this;
|
|
6164
6190
|
this.channelService = channelService;
|
|
6165
6191
|
this.chatClientService = chatClientService;
|
|
6166
6192
|
this.customTemplatesService = customTemplatesService;
|
|
6167
6193
|
this.dateParser = dateParser;
|
|
6168
6194
|
this.ngZone = ngZone;
|
|
6195
|
+
this.cdRef = cdRef;
|
|
6169
6196
|
/**
|
|
6170
6197
|
* Determines if the message list should display channel messages or [thread messages](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
|
|
6171
6198
|
*/
|
|
@@ -6205,8 +6232,10 @@
|
|
|
6205
6232
|
* You can turn on and off the loading indicator that signals to users that more messages are being loaded to the message list
|
|
6206
6233
|
*/
|
|
6207
6234
|
this.displayLoadingIndicator = true;
|
|
6235
|
+
this.emptyMainMessageListTemplate = null;
|
|
6236
|
+
this.emptyThreadMessageListTemplate = null;
|
|
6208
6237
|
this.enabledMessageActions = [];
|
|
6209
|
-
this.
|
|
6238
|
+
this.isEmpty = true;
|
|
6210
6239
|
this.unreadMessageCount = 0;
|
|
6211
6240
|
this.groupStyles = [];
|
|
6212
6241
|
this.isNextMessageOnSeparateDate = [];
|
|
@@ -6273,6 +6302,13 @@
|
|
|
6273
6302
|
this.usersTypingInChannel$ = this.channelService.usersTypingInChannel$;
|
|
6274
6303
|
this.usersTypingInThread$ = this.channelService.usersTypingInThread$;
|
|
6275
6304
|
}
|
|
6305
|
+
Object.defineProperty(MessageListComponent.prototype, "class", {
|
|
6306
|
+
get: function () {
|
|
6307
|
+
return "str-chat-angular__main-panel-inner str-chat-angular__message-list-host str-chat__main-panel-inner " + (this.isEmpty ? 'str-chat-angular__message-list-host--empty' : '');
|
|
6308
|
+
},
|
|
6309
|
+
enumerable: false,
|
|
6310
|
+
configurable: true
|
|
6311
|
+
});
|
|
6276
6312
|
MessageListComponent.prototype.ngOnInit = function () {
|
|
6277
6313
|
this.setMessages$();
|
|
6278
6314
|
};
|
|
@@ -6314,6 +6350,20 @@
|
|
|
6314
6350
|
}
|
|
6315
6351
|
}
|
|
6316
6352
|
}));
|
|
6353
|
+
this.subscriptions.push(this.customTemplatesService.emptyMainMessageListPlaceholder$.subscribe(function (template) {
|
|
6354
|
+
var isChanged = _this.emptyMainMessageListTemplate !== template;
|
|
6355
|
+
_this.emptyMainMessageListTemplate = template || null;
|
|
6356
|
+
if (isChanged) {
|
|
6357
|
+
_this.cdRef.detectChanges();
|
|
6358
|
+
}
|
|
6359
|
+
}));
|
|
6360
|
+
this.subscriptions.push(this.customTemplatesService.emptyThreadMessageListPlaceholder$.subscribe(function (template) {
|
|
6361
|
+
var isChanged = _this.emptyThreadMessageListTemplate !== template;
|
|
6362
|
+
_this.emptyThreadMessageListTemplate = template || null;
|
|
6363
|
+
if (isChanged) {
|
|
6364
|
+
_this.cdRef.detectChanges();
|
|
6365
|
+
}
|
|
6366
|
+
}));
|
|
6317
6367
|
};
|
|
6318
6368
|
MessageListComponent.prototype.ngAfterViewChecked = function () {
|
|
6319
6369
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -6460,6 +6510,15 @@
|
|
|
6460
6510
|
enumerable: false,
|
|
6461
6511
|
configurable: true
|
|
6462
6512
|
});
|
|
6513
|
+
Object.defineProperty(MessageListComponent.prototype, "emptyListTemplate", {
|
|
6514
|
+
get: function () {
|
|
6515
|
+
return this.mode === 'main'
|
|
6516
|
+
? this.emptyMainMessageListTemplate
|
|
6517
|
+
: this.emptyThreadMessageListTemplate;
|
|
6518
|
+
},
|
|
6519
|
+
enumerable: false,
|
|
6520
|
+
configurable: true
|
|
6521
|
+
});
|
|
6463
6522
|
MessageListComponent.prototype.preserveScrollbarPosition = function () {
|
|
6464
6523
|
this.scrollContainer.nativeElement.scrollTop =
|
|
6465
6524
|
(this.prevScrollTop || 0) +
|
|
@@ -6505,6 +6564,10 @@
|
|
|
6505
6564
|
_this.resetScrollState();
|
|
6506
6565
|
return;
|
|
6507
6566
|
}
|
|
6567
|
+
if (_this.isEmpty) {
|
|
6568
|
+
// cdRef.detectChanges() isn't enough here, test will fail
|
|
6569
|
+
setTimeout(function () { return (_this.isEmpty = false); }, 0);
|
|
6570
|
+
}
|
|
6508
6571
|
(_d = (_c = _this.chatClientService.chatClient) === null || _c === void 0 ? void 0 : _c.logger) === null || _d === void 0 ? void 0 : _d.call(_c, 'info', "Received one or more messages", {
|
|
6509
6572
|
tags: "message list " + _this.mode,
|
|
6510
6573
|
});
|
|
@@ -6549,6 +6612,7 @@
|
|
|
6549
6612
|
}));
|
|
6550
6613
|
};
|
|
6551
6614
|
MessageListComponent.prototype.resetScrollState = function () {
|
|
6615
|
+
this.isEmpty = true;
|
|
6552
6616
|
this.latestMessage = undefined;
|
|
6553
6617
|
this.hasNewMessages = true;
|
|
6554
6618
|
this.isUserScrolled = false;
|
|
@@ -6630,8 +6694,8 @@
|
|
|
6630
6694
|
};
|
|
6631
6695
|
return MessageListComponent;
|
|
6632
6696
|
}());
|
|
6633
|
-
MessageListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageListComponent, deps: [{ token: ChannelService }, { token: ChatClientService }, { token: CustomTemplatesService }, { token: DateParserService }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6634
|
-
MessageListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageListComponent, selector: "stream-message-list", inputs: { mode: "mode", direction: "direction", messageOptionsTrigger: "messageOptionsTrigger", hideJumpToLatestButtonDuringScroll: "hideJumpToLatestButtonDuringScroll", customMessageActions: "customMessageActions", displayDateSeparator: "displayDateSeparator", dateSeparatorTextPos: "dateSeparatorTextPos", openMessageListAt: "openMessageListAt", displayLoadingIndicator: "displayLoadingIndicator" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true }, { propertyName: "parentMessageElement", first: true, predicate: ["parentMessageElement"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n #scrollContainer\n data-testid=\"scroll-container\"\n class=\"str-chat__list\"\n style=\"overscroll-behavior: none\"\n>\n <div class=\"str-chat__reverse-infinite-scroll str-chat__message-list-scroll\">\n <ul\n class=\"str-chat__ul\"\n [class.str-chat__message-options-in-bubble]=\"\n messageOptionsTrigger === 'message-bubble'\n \"\n >\n <li\n #parentMessageElement\n *ngIf=\"mode === 'thread' && parentMessage\"\n data-testid=\"parent-message\"\n class=\"str-chat__parent-message-li\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: parentMessage, index: 'parent' }\n \"\n ></ng-container>\n <div data-testid=\"reply-count\" class=\"str-chat__thread-start\">\n {{parentMessage?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </div>\n </li>\n <stream-loading-indicator\n data-testid=\"top-loading-indicator\"\n *ngIf=\"\n isLoading && direction === 'bottom-to-top' && displayLoadingIndicator\n \"\n ></stream-loading-indicator>\n <ng-container *ngIf=\"messages$ | async as messages\">\n <ng-container\n *ngFor=\"\n let message of messages;\n let i = index;\n let isFirst = first;\n let isLast = last;\n trackBy: trackByMessageId\n \"\n >\n <ng-container *ngIf=\"isFirst\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: message.created_at,\n parsedDate: parseDate(message.created_at),\n isNewMessage: false\n }\n \"\n ></ng-container>\n </ng-container>\n <li\n tabindex=\"0\"\n data-testclass=\"message\"\n class=\"str-chat__li str-chat__li--{{ groupStyles[i] }}\"\n id=\"{{ message.id }}\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: message, index: i }\n \"\n ></ng-container>\n </li>\n <ng-container\n *ngIf=\"\n (lastReadMessageId === message.id &&\n !isLast &&\n direction === 'bottom-to-top' &&\n !isSentByCurrentUser(messages[i + 1]) &&\n (!displayDateSeparator || !isNextMessageOnSeparateDate[i])) ||\n (direction === 'top-to-bottom' &&\n !isLast &&\n !isSentByCurrentUser(message) &&\n lastReadMessageId === messages[i + 1].id)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customnewMessagesIndicatorTemplate ||\n defaultNewMessagesIndicator\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isNextMessageOnSeparateDate[i]\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: messages[i + 1].created_at,\n parsedDate: parseDate(messages[i + 1].created_at),\n isNewMessage:\n (direction === 'bottom-to-top' &&\n message.id === lastReadMessageId &&\n !isSentByCurrentUser(messages[i + 1])) ||\n (direction === 'top-to-bottom' && false)\n }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n <stream-loading-indicator\n data-testid=\"bottom-loading-indicator\"\n *ngIf=\"\n isLoading && direction === 'top-to-bottom' && displayLoadingIndicator\n \"\n ></stream-loading-indicator>\n </ul>\n <ng-template #defaultTypingIndicator let-usersTyping$=\"usersTyping$\">\n <!-- eslint-disable-next-line @angular-eslint/template/no-any -->\n <ng-container *ngIf=\"$any(usersTyping$ | async) as users\">\n <div\n *ngIf=\"users.length > 0\"\n data-testid=\"typing-indicator\"\n class=\"str-chat__typing-indicator str-chat__typing-indicator--typing\"\n >\n <div class=\"str-chat__typing-indicator__dots\">\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n </div>\n <div\n data-testid=\"typing-users\"\n class=\"str-chat__typing-indicator__users\"\n >\n {{\n users.length === 1\n ? (\"streamChat.user is typing\"\n | translate: { user: getTypingIndicatorText(users) })\n : (\"streamChat.users are typing\"\n | translate: { users: getTypingIndicatorText(users) })\n }}\n </div>\n </div>\n </ng-container>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n typingIndicatorTemplate || defaultTypingIndicator;\n context: getTypingIndicatorContext()\n \"\n ></ng-container>\n </div>\n</div>\n<div class=\"str-chat__jump-to-latest-message\">\n <button\n data-testid=\"scroll-to-latest\"\n *ngIf=\"isUserScrolled\"\n class=\"\n str-chat__message-notification-scroll-to-latest\n str-chat__message-notification-scroll-to-latest-right\n str-chat__circle-fab\n \"\n (keyup.enter)=\"jumpToLatestMessage()\"\n (click)=\"jumpToLatestMessage()\"\n >\n <stream-icon\n class=\"str-chat__jump-to-latest-icon str-chat__circle-fab-icon\"\n [icon]=\"direction === 'bottom-to-top' ? 'arrow-down' : 'arrow-up'\"\n ></stream-icon>\n <div\n *ngIf=\"unreadMessageCount > 0\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-scroll-to-latest-unread-count\n str-chat__jump-to-latest-unread-count\n \"\n >\n {{ unreadMessageCount }}\n </div>\n </button>\n</div>\n\n<ng-template #messageTemplateContainer let-message=\"message\" let-index=\"index\">\n <ng-template\n #defaultMessageTemplate\n let-messageInput=\"message\"\n let-isLastSentMessage=\"isLastSentMessage\"\n let-enabledMessageActions=\"enabledMessageActions\"\n let-mode=\"mode\"\n let-isHighlighted=\"isHighlighted\"\n let-customActions=\"customActions\"\n >\n <stream-message\n [message]=\"messageInput\"\n [isLastSentMessage]=\"isLastSentMessage\"\n [enabledMessageActions]=\"enabledMessageActions\"\n [mode]=\"mode\"\n [isHighlighted]=\"isHighlighted\"\n [customActions]=\"customActions\"\n ></stream-message>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplate || defaultMessageTemplate;\n context: {\n message: message,\n isLastSentMessage: !!(\n lastSentMessageId && message?.id === lastSentMessageId\n ),\n enabledMessageActions: enabledMessageActions,\n mode: mode,\n isHighlighted:\n message?.id === highlightedMessageId &&\n !isJumpingToLatestUnreadMessage,\n customActions: customMessageActions\n }\n \"\n ></ng-container>\n</ng-template>\n\n<ng-template\n #dateSeparator\n let-date=\"date\"\n let-parsedDate=\"parsedDate\"\n let-isNewMessage=\"isNewMessage\"\n>\n <ng-container *ngIf=\"displayDateSeparator\">\n <ng-container\n *ngTemplateOutlet=\"\n customDateSeparatorTemplate || defaultDateSeparator;\n context: {\n date: date,\n parsedDate: parsedDate,\n isNewMessage: isNewMessage\n }\n \"\n ></ng-container>\n </ng-container>\n\n <ng-template\n #defaultDateSeparator\n let-date=\"date\"\n let-parsedDate=\"parsedDate\"\n let-isNewMessage=\"isNewMessage\"\n >\n <div data-testid=\"date-separator\" class=\"str-chat__date-separator\">\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'right' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n <div class=\"str-chat__date-separator-date\">\n {{ parsedDate }}\n <span\n *ngIf=\"isNewMessage\"\n data-testid=\"new-messages-indicator-date-separator\"\n >\u2022 {{ \"streamChat.New\" | translate }}</span\n >\n </div>\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'left' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #defaultNewMessagesIndicator>\n <div data-testid=\"new-messages-indicator\" class=\"str-chat__date-separator\">\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'right' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n <div class=\"str-chat__date-separator-date\" translate>streamChat.New</div>\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'left' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n </div>\n</ng-template>\n", components: [{ type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: MessageComponent, selector: "stream-message", inputs: ["message", "enabledMessageActions", "isLastSentMessage", "mode", "isHighlighted", "customActions"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i9__namespace.TranslatePipe, "async": i5__namespace.AsyncPipe } });
|
|
6697
|
+
MessageListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageListComponent, deps: [{ token: ChannelService }, { token: ChatClientService }, { token: CustomTemplatesService }, { token: DateParserService }, { token: i0__namespace.NgZone }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6698
|
+
MessageListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageListComponent, selector: "stream-message-list", inputs: { mode: "mode", direction: "direction", messageOptionsTrigger: "messageOptionsTrigger", hideJumpToLatestButtonDuringScroll: "hideJumpToLatestButtonDuringScroll", customMessageActions: "customMessageActions", displayDateSeparator: "displayDateSeparator", dateSeparatorTextPos: "dateSeparatorTextPos", openMessageListAt: "openMessageListAt", displayLoadingIndicator: "displayLoadingIndicator" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true }, { propertyName: "parentMessageElement", first: true, predicate: ["parentMessageElement"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n #scrollContainer\n data-testid=\"scroll-container\"\n class=\"str-chat__list\"\n style=\"overscroll-behavior: none\"\n>\n <ng-container *ngIf=\"mode === 'main' && isEmpty && emptyListTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyListTemplate\"></ng-container>\n </ng-container>\n <div class=\"str-chat__reverse-infinite-scroll str-chat__message-list-scroll\">\n <ul\n class=\"str-chat__ul\"\n [class.str-chat__message-options-in-bubble]=\"\n messageOptionsTrigger === 'message-bubble'\n \"\n >\n <li\n #parentMessageElement\n *ngIf=\"mode === 'thread' && parentMessage\"\n data-testid=\"parent-message\"\n class=\"str-chat__parent-message-li\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: parentMessage, index: 'parent' }\n \"\n ></ng-container>\n <div data-testid=\"reply-count\" class=\"str-chat__thread-start\">\n {{parentMessage?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </div>\n </li>\n <ng-container *ngIf=\"mode === 'thread' && isEmpty && emptyListTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyListTemplate\"></ng-container>\n </ng-container>\n <stream-loading-indicator\n data-testid=\"top-loading-indicator\"\n *ngIf=\"\n isLoading && direction === 'bottom-to-top' && displayLoadingIndicator\n \"\n ></stream-loading-indicator>\n <ng-container *ngIf=\"messages$ | async as messages\">\n <ng-container\n *ngFor=\"\n let message of messages;\n let i = index;\n let isFirst = first;\n let isLast = last;\n trackBy: trackByMessageId\n \"\n >\n <ng-container *ngIf=\"isFirst\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: message.created_at,\n parsedDate: parseDate(message.created_at),\n isNewMessage: false\n }\n \"\n ></ng-container>\n </ng-container>\n <li\n tabindex=\"0\"\n data-testclass=\"message\"\n class=\"str-chat__li str-chat__li--{{ groupStyles[i] }}\"\n id=\"{{ message.id }}\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: message, index: i }\n \"\n ></ng-container>\n </li>\n <ng-container\n *ngIf=\"\n (lastReadMessageId === message.id &&\n !isLast &&\n direction === 'bottom-to-top' &&\n !isSentByCurrentUser(messages[i + 1]) &&\n (!displayDateSeparator || !isNextMessageOnSeparateDate[i])) ||\n (direction === 'top-to-bottom' &&\n !isLast &&\n !isSentByCurrentUser(message) &&\n lastReadMessageId === messages[i + 1].id)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customnewMessagesIndicatorTemplate ||\n defaultNewMessagesIndicator\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isNextMessageOnSeparateDate[i]\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: messages[i + 1].created_at,\n parsedDate: parseDate(messages[i + 1].created_at),\n isNewMessage:\n (direction === 'bottom-to-top' &&\n message.id === lastReadMessageId &&\n !isSentByCurrentUser(messages[i + 1])) ||\n (direction === 'top-to-bottom' && false)\n }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n <stream-loading-indicator\n data-testid=\"bottom-loading-indicator\"\n *ngIf=\"\n isLoading && direction === 'top-to-bottom' && displayLoadingIndicator\n \"\n ></stream-loading-indicator>\n </ul>\n <ng-template #defaultTypingIndicator let-usersTyping$=\"usersTyping$\">\n <!-- eslint-disable-next-line @angular-eslint/template/no-any -->\n <ng-container *ngIf=\"$any(usersTyping$ | async) as users\">\n <div\n *ngIf=\"users.length > 0\"\n data-testid=\"typing-indicator\"\n class=\"str-chat__typing-indicator str-chat__typing-indicator--typing\"\n >\n <div class=\"str-chat__typing-indicator__dots\">\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n </div>\n <div\n data-testid=\"typing-users\"\n class=\"str-chat__typing-indicator__users\"\n >\n {{\n users.length === 1\n ? (\"streamChat.user is typing\"\n | translate: { user: getTypingIndicatorText(users) })\n : (\"streamChat.users are typing\"\n | translate: { users: getTypingIndicatorText(users) })\n }}\n </div>\n </div>\n </ng-container>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n typingIndicatorTemplate || defaultTypingIndicator;\n context: getTypingIndicatorContext()\n \"\n ></ng-container>\n </div>\n</div>\n<div class=\"str-chat__jump-to-latest-message\">\n <button\n data-testid=\"scroll-to-latest\"\n *ngIf=\"isUserScrolled\"\n class=\"\n str-chat__message-notification-scroll-to-latest\n str-chat__message-notification-scroll-to-latest-right\n str-chat__circle-fab\n \"\n (keyup.enter)=\"jumpToLatestMessage()\"\n (click)=\"jumpToLatestMessage()\"\n >\n <stream-icon\n class=\"str-chat__jump-to-latest-icon str-chat__circle-fab-icon\"\n [icon]=\"direction === 'bottom-to-top' ? 'arrow-down' : 'arrow-up'\"\n ></stream-icon>\n <div\n *ngIf=\"unreadMessageCount > 0\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-scroll-to-latest-unread-count\n str-chat__jump-to-latest-unread-count\n \"\n >\n {{ unreadMessageCount }}\n </div>\n </button>\n</div>\n\n<ng-template #messageTemplateContainer let-message=\"message\" let-index=\"index\">\n <ng-template\n #defaultMessageTemplate\n let-messageInput=\"message\"\n let-isLastSentMessage=\"isLastSentMessage\"\n let-enabledMessageActions=\"enabledMessageActions\"\n let-mode=\"mode\"\n let-isHighlighted=\"isHighlighted\"\n let-customActions=\"customActions\"\n >\n <stream-message\n [message]=\"messageInput\"\n [isLastSentMessage]=\"isLastSentMessage\"\n [enabledMessageActions]=\"enabledMessageActions\"\n [mode]=\"mode\"\n [isHighlighted]=\"isHighlighted\"\n [customActions]=\"customActions\"\n ></stream-message>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplate || defaultMessageTemplate;\n context: {\n message: message,\n isLastSentMessage: !!(\n lastSentMessageId && message?.id === lastSentMessageId\n ),\n enabledMessageActions: enabledMessageActions,\n mode: mode,\n isHighlighted:\n message?.id === highlightedMessageId &&\n !isJumpingToLatestUnreadMessage,\n customActions: customMessageActions\n }\n \"\n ></ng-container>\n</ng-template>\n\n<ng-template\n #dateSeparator\n let-date=\"date\"\n let-parsedDate=\"parsedDate\"\n let-isNewMessage=\"isNewMessage\"\n>\n <ng-container *ngIf=\"displayDateSeparator\">\n <ng-container\n *ngTemplateOutlet=\"\n customDateSeparatorTemplate || defaultDateSeparator;\n context: {\n date: date,\n parsedDate: parsedDate,\n isNewMessage: isNewMessage\n }\n \"\n ></ng-container>\n </ng-container>\n\n <ng-template\n #defaultDateSeparator\n let-date=\"date\"\n let-parsedDate=\"parsedDate\"\n let-isNewMessage=\"isNewMessage\"\n >\n <div data-testid=\"date-separator\" class=\"str-chat__date-separator\">\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'right' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n <div class=\"str-chat__date-separator-date\">\n {{ parsedDate }}\n <span\n *ngIf=\"isNewMessage\"\n data-testid=\"new-messages-indicator-date-separator\"\n >\u2022 {{ \"streamChat.New\" | translate }}</span\n >\n </div>\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'left' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #defaultNewMessagesIndicator>\n <div data-testid=\"new-messages-indicator\" class=\"str-chat__date-separator\">\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'right' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n <div class=\"str-chat__date-separator-date\" translate>streamChat.New</div>\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'left' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n </div>\n</ng-template>\n", components: [{ type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: MessageComponent, selector: "stream-message", inputs: ["message", "enabledMessageActions", "isLastSentMessage", "mode", "isHighlighted", "customActions"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i9__namespace.TranslatePipe, "async": i5__namespace.AsyncPipe } });
|
|
6635
6699
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageListComponent, decorators: [{
|
|
6636
6700
|
type: i0.Component,
|
|
6637
6701
|
args: [{
|
|
@@ -6639,7 +6703,7 @@
|
|
|
6639
6703
|
templateUrl: './message-list.component.html',
|
|
6640
6704
|
styles: [],
|
|
6641
6705
|
}]
|
|
6642
|
-
}], ctorParameters: function () { return [{ type: ChannelService }, { type: ChatClientService }, { type: CustomTemplatesService }, { type: DateParserService }, { type: i0__namespace.NgZone }]; }, propDecorators: { mode: [{
|
|
6706
|
+
}], ctorParameters: function () { return [{ type: ChannelService }, { type: ChatClientService }, { type: CustomTemplatesService }, { type: DateParserService }, { type: i0__namespace.NgZone }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { mode: [{
|
|
6643
6707
|
type: i0.Input
|
|
6644
6708
|
}], direction: [{
|
|
6645
6709
|
type: i0.Input
|
|
@@ -6657,15 +6721,15 @@
|
|
|
6657
6721
|
type: i0.Input
|
|
6658
6722
|
}], displayLoadingIndicator: [{
|
|
6659
6723
|
type: i0.Input
|
|
6660
|
-
}], class: [{
|
|
6661
|
-
type: i0.HostBinding,
|
|
6662
|
-
args: ['class']
|
|
6663
6724
|
}], scrollContainer: [{
|
|
6664
6725
|
type: i0.ViewChild,
|
|
6665
6726
|
args: ['scrollContainer']
|
|
6666
6727
|
}], parentMessageElement: [{
|
|
6667
6728
|
type: i0.ViewChild,
|
|
6668
6729
|
args: ['parentMessageElement']
|
|
6730
|
+
}], class: [{
|
|
6731
|
+
type: i0.HostBinding,
|
|
6732
|
+
args: ['class']
|
|
6669
6733
|
}] } });
|
|
6670
6734
|
|
|
6671
6735
|
/**
|