stream-chat-angular 2.6.0 → 2.8.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.
@@ -353,7 +353,7 @@
353
353
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
354
354
  }
355
355
 
356
- var version = '2.6.0';
356
+ var version = '2.8.0';
357
357
 
358
358
  var NotificationService = /** @class */ (function () {
359
359
  function NotificationService() {
@@ -403,9 +403,8 @@
403
403
  }], ctorParameters: function () { return []; } });
404
404
 
405
405
  var ChatClientService = /** @class */ (function () {
406
- function ChatClientService(ngZone, appRef, notificationService) {
406
+ function ChatClientService(ngZone, notificationService) {
407
407
  this.ngZone = ngZone;
408
- this.appRef = appRef;
409
408
  this.notificationService = notificationService;
410
409
  this.notificationSubject = new rxjs.ReplaySubject(1);
411
410
  this.connectionStateSubject = new rxjs.ReplaySubject(1);
@@ -414,7 +413,7 @@
414
413
  this.connectionState$ = this.connectionStateSubject.asObservable();
415
414
  this.appSettings$ = this.appSettingsSubject.asObservable();
416
415
  }
417
- ChatClientService.prototype.init = function (apiKey, userId, userToken) {
416
+ ChatClientService.prototype.init = function (apiKey, userOrId, userTokenOrProvider) {
418
417
  return __awaiter(this, void 0, void 0, function () {
419
418
  var removeNotification;
420
419
  var _this = this;
@@ -423,12 +422,16 @@
423
422
  case 0:
424
423
  this.chatClient = streamChat.StreamChat.getInstance(apiKey);
425
424
  return [4 /*yield*/, this.ngZone.runOutsideAngular(function () { return __awaiter(_this, void 0, void 0, function () {
425
+ var user;
426
426
  return __generator(this, function (_a) {
427
427
  switch (_a.label) {
428
- case 0: return [4 /*yield*/, this.chatClient.connectUser({ id: userId }, userToken)];
428
+ case 0:
429
+ user = typeof userOrId === 'string' ? { id: userOrId } : userOrId;
430
+ return [4 /*yield*/, this.chatClient.connectUser(user, userTokenOrProvider)];
429
431
  case 1:
430
432
  _a.sent();
431
433
  this.chatClient.setUserAgent("stream-chat-angular-" + version + "-" + this.chatClient.getUserAgent());
434
+ this.chatClient.getAppSettings;
432
435
  return [2 /*return*/];
433
436
  }
434
437
  });
@@ -436,39 +439,26 @@
436
439
  case 1:
437
440
  _a.sent();
438
441
  this.appSettingsSubject.next(undefined);
439
- this.chatClient.on('notification.added_to_channel', function (e) {
442
+ this.chatClient.on(function (e) {
440
443
  _this.notificationSubject.next({
441
- eventType: 'notification.added_to_channel',
444
+ eventType: e.type,
442
445
  event: e,
443
446
  });
444
- _this.appRef.tick();
445
- });
446
- this.chatClient.on('notification.message_new', function (e) {
447
- _this.notificationSubject.next({
448
- eventType: 'notification.message_new',
449
- event: e,
450
- });
451
- _this.appRef.tick();
452
- });
453
- this.chatClient.on('notification.removed_from_channel', function (e) {
454
- _this.notificationSubject.next({
455
- eventType: 'notification.removed_from_channel',
456
- event: e,
457
- });
458
- _this.appRef.tick();
459
447
  });
460
448
  this.chatClient.on('connection.changed', function (e) {
461
- var isOnline = e.online;
462
- if (isOnline) {
463
- if (removeNotification) {
464
- removeNotification();
449
+ _this.ngZone.run(function () {
450
+ var isOnline = e.online;
451
+ if (isOnline) {
452
+ if (removeNotification) {
453
+ removeNotification();
454
+ }
465
455
  }
466
- }
467
- else {
468
- removeNotification = _this.notificationService.addPermanentNotification('streamChat.Connection failure, reconnecting now...');
469
- }
470
- _this.connectionStateSubject.next(isOnline ? 'online' : 'offline');
471
- _this.appRef.tick();
456
+ else {
457
+ removeNotification =
458
+ _this.notificationService.addPermanentNotification('streamChat.Connection failure, reconnecting now...');
459
+ }
460
+ _this.connectionStateSubject.next(isOnline ? 'online' : 'offline');
461
+ });
472
462
  });
473
463
  return [2 /*return*/];
474
464
  }
@@ -530,14 +520,14 @@
530
520
  };
531
521
  return ChatClientService;
532
522
  }());
533
- ChatClientService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChatClientService, deps: [{ token: i0__namespace.NgZone }, { token: i0__namespace.ApplicationRef }, { token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
523
+ ChatClientService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChatClientService, deps: [{ token: i0__namespace.NgZone }, { token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
534
524
  ChatClientService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChatClientService, providedIn: 'root' });
535
525
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChatClientService, decorators: [{
536
526
  type: i0.Injectable,
537
527
  args: [{
538
528
  providedIn: 'root',
539
529
  }]
540
- }], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: i0__namespace.ApplicationRef }, { type: NotificationService }]; } });
530
+ }], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: NotificationService }]; } });
541
531
 
542
532
  var createMessagePreview = function (user, text, attachments, mentionedUsers) {
543
533
  var clientSideId = user.id + "-" + uuid.v4();
@@ -570,10 +560,9 @@
570
560
  };
571
561
 
572
562
  var ChannelService = /** @class */ (function () {
573
- function ChannelService(chatClientService, appRef, ngZone) {
563
+ function ChannelService(chatClientService, ngZone) {
574
564
  var _this = this;
575
565
  this.chatClientService = chatClientService;
576
- this.appRef = appRef;
577
566
  this.ngZone = ngZone;
578
567
  this.channelsSubject = new rxjs.BehaviorSubject(undefined);
579
568
  this.activeChannelSubject = new rxjs.BehaviorSubject(undefined);
@@ -840,10 +829,7 @@
840
829
  return [2 /*return*/, []];
841
830
  }
842
831
  return [4 /*yield*/, activeChannel.queryMembers({
843
- $or: [
844
- { id: { $autocomplete: searchTerm } },
845
- { name: { $autocomplete: searchTerm } },
846
- ],
832
+ name: { $autocomplete: searchTerm },
847
833
  id: { $ne: this.chatClientService.chatClient.userID },
848
834
  })];
849
835
  case 2:
@@ -891,55 +877,73 @@
891
877
  ChannelService.prototype.handleNotification = function (notification) {
892
878
  return __awaiter(this, void 0, void 0, function () {
893
879
  var _e;
880
+ var _this = this;
894
881
  return __generator(this, function (_f) {
895
882
  switch (_f.label) {
896
883
  case 0:
897
884
  _e = notification.eventType;
898
885
  switch (_e) {
899
886
  case 'notification.message_new': return [3 /*break*/, 1];
900
- case 'notification.added_to_channel': return [3 /*break*/, 5];
901
- case 'notification.removed_from_channel': return [3 /*break*/, 9];
887
+ case 'notification.added_to_channel': return [3 /*break*/, 3];
888
+ case 'notification.removed_from_channel': return [3 /*break*/, 5];
902
889
  }
903
- return [3 /*break*/, 10];
904
- case 1:
905
- if (!this.customNewMessageNotificationHandler) return [3 /*break*/, 2];
906
- this.customNewMessageNotificationHandler(notification, this.channelListSetter);
907
- return [3 /*break*/, 4];
908
- case 2: return [4 /*yield*/, this.handleNewMessageNotification(notification)];
909
- case 3:
890
+ return [3 /*break*/, 6];
891
+ case 1: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
892
+ return __generator(this, function (_e) {
893
+ switch (_e.label) {
894
+ case 0:
895
+ if (!this.customNewMessageNotificationHandler) return [3 /*break*/, 1];
896
+ this.customNewMessageNotificationHandler(notification, this.channelListSetter);
897
+ return [3 /*break*/, 3];
898
+ case 1: return [4 /*yield*/, this.handleNewMessageNotification(notification)];
899
+ case 2:
900
+ _e.sent();
901
+ _e.label = 3;
902
+ case 3: return [2 /*return*/];
903
+ }
904
+ });
905
+ }); })];
906
+ case 2:
910
907
  _f.sent();
911
- _f.label = 4;
912
- case 4: return [3 /*break*/, 10];
913
- case 5:
914
- if (!this.customAddedToChannelNotificationHandler) return [3 /*break*/, 6];
915
- this.customAddedToChannelNotificationHandler(notification, this.channelListSetter);
916
- return [3 /*break*/, 8];
917
- case 6: return [4 /*yield*/, this.handleAddedToChannelNotification(notification)];
918
- case 7:
908
+ return [3 /*break*/, 6];
909
+ case 3: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
910
+ return __generator(this, function (_e) {
911
+ switch (_e.label) {
912
+ case 0:
913
+ if (!this.customAddedToChannelNotificationHandler) return [3 /*break*/, 1];
914
+ this.customAddedToChannelNotificationHandler(notification, this.channelListSetter);
915
+ return [3 /*break*/, 3];
916
+ case 1: return [4 /*yield*/, this.handleAddedToChannelNotification(notification)];
917
+ case 2:
918
+ _e.sent();
919
+ _e.label = 3;
920
+ case 3: return [2 /*return*/];
921
+ }
922
+ });
923
+ }); })];
924
+ case 4:
919
925
  _f.sent();
920
- _f.label = 8;
921
- case 8: return [3 /*break*/, 10];
922
- case 9:
926
+ return [3 /*break*/, 6];
927
+ case 5:
923
928
  {
924
- if (this.customRemovedFromChannelNotificationHandler) {
925
- this.customRemovedFromChannelNotificationHandler(notification, this.channelListSetter);
926
- }
927
- else {
928
- this.handleRemovedFromChannelNotification(notification);
929
- }
929
+ this.ngZone.run(function () {
930
+ if (_this.customRemovedFromChannelNotificationHandler) {
931
+ _this.customRemovedFromChannelNotificationHandler(notification, _this.channelListSetter);
932
+ }
933
+ else {
934
+ _this.handleRemovedFromChannelNotification(notification);
935
+ }
936
+ });
930
937
  }
931
- _f.label = 10;
932
- case 10: return [2 /*return*/];
938
+ _f.label = 6;
939
+ case 6: return [2 /*return*/];
933
940
  }
934
941
  });
935
942
  });
936
943
  };
937
944
  ChannelService.prototype.handleRemovedFromChannelNotification = function (notification) {
938
- var _this = this;
939
- this.ngZone.run(function () {
940
- var channelIdToBeRemoved = notification.event.channel.cid;
941
- _this.removeFromChannelList(channelIdToBeRemoved);
942
- });
945
+ var channelIdToBeRemoved = notification.event.channel.cid;
946
+ this.removeFromChannelList(channelIdToBeRemoved);
943
947
  };
944
948
  ChannelService.prototype.handleNewMessageNotification = function (notification) {
945
949
  return __awaiter(this, void 0, void 0, function () {
@@ -969,7 +973,6 @@
969
973
  var _a, _b;
970
974
  return __awaiter(this, void 0, void 0, function () {
971
975
  var channel;
972
- var _this = this;
973
976
  return __generator(this, function (_e) {
974
977
  switch (_e.label) {
975
978
  case 0:
@@ -978,11 +981,9 @@
978
981
  case 1:
979
982
  _e.sent();
980
983
  this.watchForChannelEvents(channel);
981
- this.ngZone.run(function () {
982
- _this.channelsSubject.next(__spreadArray([
983
- channel
984
- ], __read((_this.channelsSubject.getValue() || []))));
985
- });
984
+ this.channelsSubject.next(__spreadArray([
985
+ channel
986
+ ], __read((this.channelsSubject.getValue() || []))));
986
987
  return [2 /*return*/];
987
988
  }
988
989
  });
@@ -1015,15 +1016,17 @@
1015
1016
  this.activeChannelSubscriptions.push(channel.on('reaction.deleted', function (e) { return _this.messageReactionEventReceived(e); }));
1016
1017
  this.activeChannelSubscriptions.push(channel.on('reaction.updated', function (e) { return _this.messageReactionEventReceived(e); }));
1017
1018
  this.activeChannelSubscriptions.push(channel.on('message.read', function (e) {
1018
- var latestMessage;
1019
- _this.activeChannelMessages$.pipe(operators.first()).subscribe(function (messages) {
1020
- latestMessage = messages[messages.length - 1];
1019
+ _this.ngZone.run(function () {
1020
+ var latestMessage;
1021
+ _this.activeChannelMessages$.pipe(operators.first()).subscribe(function (messages) {
1022
+ latestMessage = messages[messages.length - 1];
1023
+ });
1024
+ if (!latestMessage || !e.user) {
1025
+ return;
1026
+ }
1027
+ latestMessage.readBy = getReadBy(latestMessage, channel);
1028
+ _this.activeChannelMessagesSubject.next(_this.activeChannelMessagesSubject.getValue());
1021
1029
  });
1022
- if (!latestMessage || !e.user) {
1023
- return;
1024
- }
1025
- latestMessage.readBy = getReadBy(latestMessage, channel);
1026
- _this.activeChannelMessagesSubject.next(_this.activeChannelMessagesSubject.getValue());
1027
1030
  }));
1028
1031
  };
1029
1032
  ChannelService.prototype.messageUpdated = function (event) {
@@ -1112,66 +1115,72 @@
1112
1115
  channel.on(function (event) {
1113
1116
  switch (event.type) {
1114
1117
  case 'message.new': {
1115
- if (_this.customNewMessageHandler) {
1116
- _this.customNewMessageHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
1117
- }
1118
- else {
1119
- _this.handleNewMessage(event, channel);
1120
- }
1118
+ _this.ngZone.run(function () {
1119
+ if (_this.customNewMessageHandler) {
1120
+ _this.customNewMessageHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
1121
+ }
1122
+ else {
1123
+ _this.handleNewMessage(event, channel);
1124
+ }
1125
+ });
1121
1126
  break;
1122
1127
  }
1123
1128
  case 'channel.hidden': {
1124
- if (_this.customChannelHiddenHandler) {
1125
- _this.customChannelHiddenHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
1126
- }
1127
- else {
1128
- _this.handleChannelHidden(event);
1129
- }
1130
- _this.appRef.tick();
1129
+ _this.ngZone.run(function () {
1130
+ if (_this.customChannelHiddenHandler) {
1131
+ _this.customChannelHiddenHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
1132
+ }
1133
+ else {
1134
+ _this.handleChannelHidden(event);
1135
+ }
1136
+ });
1131
1137
  break;
1132
1138
  }
1133
1139
  case 'channel.deleted': {
1134
- if (_this.customChannelDeletedHandler) {
1135
- _this.customChannelDeletedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
1136
- }
1137
- else {
1138
- _this.handleChannelDeleted(event);
1139
- }
1140
- _this.appRef.tick();
1140
+ _this.ngZone.run(function () {
1141
+ if (_this.customChannelDeletedHandler) {
1142
+ _this.customChannelDeletedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
1143
+ }
1144
+ else {
1145
+ _this.handleChannelDeleted(event);
1146
+ }
1147
+ });
1141
1148
  break;
1142
1149
  }
1143
1150
  case 'channel.visible': {
1144
- if (_this.customChannelVisibleHandler) {
1145
- _this.customChannelVisibleHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
1146
- }
1147
- else {
1148
- _this.handleChannelVisible(event, channel);
1149
- }
1150
- _this.appRef.tick();
1151
+ _this.ngZone.run(function () {
1152
+ if (_this.customChannelVisibleHandler) {
1153
+ _this.customChannelVisibleHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
1154
+ }
1155
+ else {
1156
+ _this.handleChannelVisible(event, channel);
1157
+ }
1158
+ });
1151
1159
  break;
1152
1160
  }
1153
1161
  case 'channel.updated': {
1154
- if (_this.customChannelUpdatedHandler) {
1155
- _this.customChannelUpdatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
1156
- }
1157
- else {
1158
- _this.handleChannelUpdate(event);
1159
- }
1160
- _this.appRef.tick();
1162
+ _this.ngZone.run(function () {
1163
+ if (_this.customChannelUpdatedHandler) {
1164
+ _this.customChannelUpdatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
1165
+ }
1166
+ else {
1167
+ _this.handleChannelUpdate(event);
1168
+ }
1169
+ });
1161
1170
  break;
1162
1171
  }
1163
1172
  case 'channel.truncated': {
1164
- if (_this.customChannelTruncatedHandler) {
1165
- _this.customChannelTruncatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
1166
- }
1167
- else {
1168
- _this.handleChannelTruncate(event);
1169
- }
1170
- _this.appRef.tick();
1173
+ _this.ngZone.run(function () {
1174
+ if (_this.customChannelTruncatedHandler) {
1175
+ _this.customChannelTruncatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
1176
+ }
1177
+ else {
1178
+ _this.handleChannelTruncate(event);
1179
+ }
1180
+ });
1171
1181
  break;
1172
1182
  }
1173
1183
  }
1174
- setTimeout(function () { return _this.appRef.tick(); }, 0);
1175
1184
  });
1176
1185
  };
1177
1186
  ChannelService.prototype.handleNewMessage = function (_, channel) {
@@ -1240,14 +1249,14 @@
1240
1249
  });
1241
1250
  return ChannelService;
1242
1251
  }());
1243
- ChannelService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelService, deps: [{ token: ChatClientService }, { token: i0__namespace.ApplicationRef }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1252
+ ChannelService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelService, deps: [{ token: ChatClientService }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1244
1253
  ChannelService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelService, providedIn: 'root' });
1245
1254
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelService, decorators: [{
1246
1255
  type: i0.Injectable,
1247
1256
  args: [{
1248
1257
  providedIn: 'root',
1249
1258
  }]
1250
- }], ctorParameters: function () { return [{ type: ChatClientService }, { type: i0__namespace.ApplicationRef }, { type: i0__namespace.NgZone }]; } });
1259
+ }], ctorParameters: function () { return [{ type: ChatClientService }, { type: i0__namespace.NgZone }]; } });
1251
1260
 
1252
1261
  var ThemeService = /** @class */ (function () {
1253
1262
  function ThemeService() {
@@ -1880,7 +1889,7 @@
1880
1889
  return AttachmentPreviewListComponent;
1881
1890
  }());
1882
1891
  AttachmentPreviewListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentPreviewListComponent, deps: [{ token: AttachmentService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1883
- AttachmentPreviewListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list", ngImport: i0__namespace, template: "<div class=\"rfu-image-previewer\">\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"rfu-image-previewer__image\"\n [class.rfu-image-previewer__image--loaded]=\"\n attachmentUpload.state === 'success'\n \"\n data-testclass=\"attachment-image-preview\"\n >\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n class=\"rfu-image-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n data-testclass=\"upload-error\"\n >\n <stream-icon icon=\"retry\"></stream-icon>\n </div>\n <div class=\"rfu-thumbnail__wrapper\" style=\"width: 100; height: 100\">\n <div class=\"rfu-thumbnail__overlay\">\n <div\n class=\"rfu-icon-button\"\n data-testclass=\"delete-attachment\"\n role=\"button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n </div>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"attachmentUpload.file.name\"\n class=\"rfu-thumbnail__image\"\n data-testclass=\"attachment-image\"\n />\n </div>\n <stream-loading-indicator\n data-testclass=\"loading-indicator\"\n color=\"rgba(255,255,255,0.7)\"\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n ></stream-loading-indicator>\n </div>\n <div\n class=\"rfu-file-previewer\"\n *ngIf=\"attachmentUpload.type === 'file'\"\n data-testclass=\"attachment-file-preview\"\n >\n <ol>\n <li\n class=\"rfu-file-previewer__file\"\n [class.rfu-file-previewer__file--uploading]=\"\n attachmentUpload.state === 'uploading'\n \"\n [class.rfu-file-previewer__file--failed]=\"\n attachmentUpload.state === 'error'\n \"\n >\n <stream-icon icon=\"file\"></stream-icon>\n\n <a\n data-testclass=\"file-download-link\"\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n download\n >\n {{ attachmentUpload.file.name }}\n <ng-container *ngIf=\"attachmentUpload.state === 'error'\">\n <div\n data-testclass=\"file-upload-retry\"\n class=\"rfu-file-previewer__failed\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n translate\n >\n streamChat.failed\n </div>\n <div\n class=\"rfu-file-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n translate\n >\n streamChat.retry\n </div>\n </ng-container>\n </a>\n\n <span\n data-testclass=\"file-delete\"\n class=\"rfu-file-previewer__close-button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n \u2718\n </span>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"rfu-file-previewer__loading-indicator\"\n >\n <stream-loading-indicator></stream-loading-indicator>\n </div>\n </li>\n </ol>\n </div>\n </ng-container>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "async": i3__namespace.AsyncPipe } });
1892
+ AttachmentPreviewListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list", ngImport: i0__namespace, template: "<div class=\"rfu-image-previewer\" *ngIf=\"(attachmentUploads$ | async)?.length\">\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"rfu-image-previewer__image\"\n [class.rfu-image-previewer__image--loaded]=\"\n attachmentUpload.state === 'success'\n \"\n data-testclass=\"attachment-image-preview\"\n >\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n class=\"rfu-image-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n data-testclass=\"upload-error\"\n >\n <stream-icon icon=\"retry\"></stream-icon>\n </div>\n <div class=\"rfu-thumbnail__wrapper\" style=\"width: 100; height: 100\">\n <div class=\"rfu-thumbnail__overlay\">\n <div\n class=\"rfu-icon-button\"\n data-testclass=\"delete-attachment\"\n role=\"button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n </div>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"attachmentUpload.file.name\"\n class=\"rfu-thumbnail__image\"\n data-testclass=\"attachment-image\"\n />\n </div>\n <stream-loading-indicator\n data-testclass=\"loading-indicator\"\n color=\"rgba(255,255,255,0.7)\"\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n ></stream-loading-indicator>\n </div>\n <div\n class=\"rfu-file-previewer\"\n *ngIf=\"attachmentUpload.type === 'file'\"\n data-testclass=\"attachment-file-preview\"\n >\n <ol>\n <li\n class=\"rfu-file-previewer__file\"\n [class.rfu-file-previewer__file--uploading]=\"\n attachmentUpload.state === 'uploading'\n \"\n [class.rfu-file-previewer__file--failed]=\"\n attachmentUpload.state === 'error'\n \"\n >\n <stream-icon icon=\"file\"></stream-icon>\n\n <a\n data-testclass=\"file-download-link\"\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n download\n >\n {{ attachmentUpload.file.name }}\n <ng-container *ngIf=\"attachmentUpload.state === 'error'\">\n <div\n data-testclass=\"file-upload-retry\"\n class=\"rfu-file-previewer__failed\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n translate\n >\n streamChat.failed\n </div>\n <div\n class=\"rfu-file-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n translate\n >\n streamChat.retry\n </div>\n </ng-container>\n </a>\n\n <span\n data-testclass=\"file-delete\"\n class=\"rfu-file-previewer__close-button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n \u2718\n </span>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"rfu-file-previewer__loading-indicator\"\n >\n <stream-loading-indicator></stream-loading-indicator>\n </div>\n </li>\n </ol>\n </div>\n </ng-container>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "async": i3__namespace.AsyncPipe } });
1884
1893
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentPreviewListComponent, decorators: [{
1885
1894
  type: i0.Component,
1886
1895
  args: [{
@@ -2427,7 +2436,7 @@
2427
2436
  return MessageActionsBoxComponent;
2428
2437
  }());
2429
2438
  MessageActionsBoxComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageActionsBoxComponent, deps: [{ token: ChatClientService }, { token: NotificationService }, { token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
2430
- MessageActionsBoxComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: { messageInputTemplate: "messageInputTemplate", isOpen: "isOpen", isMine: "isMine", message: "message", enabledActions: "enabledActions" }, outputs: { displayedActionsCount: "displayedActionsCount", isEditing: "isEditing" }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: MessageInputComponent, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n data-testid=\"action-box\"\n class=\"str-chat__message-actions-box\"\n [class.str-chat__message-actions-box--open]=\"isOpen\"\n [class.str-chat__message-actions-box--mine]=\"isMine\"\n>\n <ul class=\"str-chat__message-actions-list\">\n <button\n data-testid=\"quote-action\"\n *ngIf=\"isQuoteVisible\"\n (click)=\"quoteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Reply\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"pin-action\"\n *ngIf=\"isPinVisible\"\n (click)=\"pinClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{\n (message?.pinned ? \"streamChat.Unpin\" : \"streamChat.Pin\") | translate\n }}\n </li>\n </button>\n <button\n data-testid=\"flag-action\"\n *ngIf=\"isFlagVisible\"\n (click)=\"flagClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Flag\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"mute-action\"\n *ngIf=\"isMuteVisible\"\n (click)=\"muteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Mute\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"edit-action\"\n *ngIf=\"isEditVisible\"\n (click)=\"editClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Edit Message\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"delete-action\"\n *ngIf=\"isDeleteVisible\"\n (click)=\"deleteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Delete\" | translate }}\n </li>\n </button>\n </ul>\n</div>\n\n<stream-modal\n [isOpen]=\"isEditModalOpen\"\n (isOpenChange)=\"\n isEditModalOpen = $event; isEditModalOpen ? '' : modalClosed()\n \"\n>\n <div class=\"str-chat__edit-message-form\" *ngIf=\"isEditModalOpen\">\n <ng-container *ngIf=\"messageInputTemplate; else defaultInput\">\n <ng-container\n *ngTemplateOutlet=\"\n messageInputTemplate;\n context: {\n message: message,\n messageUpdateHandler: modalClosed\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultInput>\n <stream-message-input\n [message]=\"message\"\n (messageUpdate)=\"modalClosed()\"\n ></stream-message-input>\n </ng-template>\n <stream-notification-list></stream-notification-list>\n <div class=\"str-chat__message-team-form-footer\">\n <div></div>\n <div>\n <button translate data-testid=\"cancel-button\" (click)=\"modalClosed()\">\n streamChat.Cancel\n </button>\n <button\n type=\"submit\"\n translate\n data-testid=\"send-button\"\n (click)=\"sendClicked()\"\n (keyup.enter)=\"sendClicked()\"\n >\n streamChat.Send\n </button>\n </div>\n </div>\n </div>\n</stream-modal>\n", components: [{ type: ModalComponent, selector: "stream-modal", inputs: ["isOpen"], outputs: ["isOpenChange"] }, { type: MessageInputComponent, selector: "stream-message-input", inputs: ["isFileUploadEnabled", "areMentionsEnabled", "mentionScope", "mentionAutocompleteItemTemplate", "acceptedFileTypes", "isMultipleFileUploadEnabled", "message"], outputs: ["messageUpdate"] }, { type: NotificationListComponent, selector: "stream-notification-list" }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i10__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i10__namespace.TranslatePipe } });
2439
+ MessageActionsBoxComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: { messageInputTemplate: "messageInputTemplate", isOpen: "isOpen", isMine: "isMine", message: "message", enabledActions: "enabledActions" }, outputs: { displayedActionsCount: "displayedActionsCount", isEditing: "isEditing" }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: MessageInputComponent, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n data-testid=\"action-box\"\n class=\"str-chat__message-actions-box\"\n [class.str-chat__message-actions-box--open]=\"isOpen\"\n [class.str-chat__message-actions-box--mine]=\"isMine\"\n>\n <ul class=\"str-chat__message-actions-list\">\n <button\n data-testid=\"quote-action\"\n *ngIf=\"isQuoteVisible\"\n (click)=\"quoteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Reply\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"pin-action\"\n *ngIf=\"isPinVisible\"\n (click)=\"pinClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{\n (message?.pinned ? \"streamChat.Unpin\" : \"streamChat.Pin\") | translate\n }}\n </li>\n </button>\n <button\n data-testid=\"flag-action\"\n *ngIf=\"isFlagVisible\"\n (click)=\"flagClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Flag\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"mute-action\"\n *ngIf=\"isMuteVisible\"\n (click)=\"muteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Mute\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"edit-action\"\n *ngIf=\"isEditVisible\"\n (click)=\"editClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Edit Message\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"delete-action\"\n *ngIf=\"isDeleteVisible\"\n (click)=\"deleteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Delete\" | translate }}\n </li>\n </button>\n </ul>\n</div>\n\n<stream-modal\n [isOpen]=\"isEditModalOpen\"\n (isOpenChange)=\"\n isEditModalOpen = $event; isEditModalOpen ? '' : modalClosed()\n \"\n>\n <div class=\"str-chat__edit-message-form\" *ngIf=\"isEditModalOpen\">\n <ng-container *ngIf=\"messageInputTemplate; else defaultInput\">\n <ng-container\n *ngTemplateOutlet=\"\n messageInputTemplate;\n context: {\n message: message,\n messageUpdateHandler: modalClosed\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultInput>\n <stream-message-input\n [message]=\"message\"\n (messageUpdate)=\"modalClosed()\"\n ></stream-message-input>\n </ng-template>\n <stream-notification-list></stream-notification-list>\n <div\n class=\"\n str-chat__message-team-form-footer\n str-chat__message-team-form-footer-angular\n \"\n >\n <div class=\"str-chat__edit-message-form-options\">\n <button translate data-testid=\"cancel-button\" (click)=\"modalClosed()\">\n streamChat.Cancel\n </button>\n <button\n type=\"submit\"\n translate\n data-testid=\"send-button\"\n (click)=\"sendClicked()\"\n (keyup.enter)=\"sendClicked()\"\n >\n streamChat.Send\n </button>\n </div>\n </div>\n </div>\n</stream-modal>\n", components: [{ type: ModalComponent, selector: "stream-modal", inputs: ["isOpen"], outputs: ["isOpenChange"] }, { type: MessageInputComponent, selector: "stream-message-input", inputs: ["isFileUploadEnabled", "areMentionsEnabled", "mentionScope", "mentionAutocompleteItemTemplate", "acceptedFileTypes", "isMultipleFileUploadEnabled", "message"], outputs: ["messageUpdate"] }, { type: NotificationListComponent, selector: "stream-notification-list" }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i10__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i10__namespace.TranslatePipe } });
2431
2440
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageActionsBoxComponent, decorators: [{
2432
2441
  type: i0.Component,
2433
2442
  args: [{
@@ -2588,8 +2597,9 @@
2588
2597
  }], ctorParameters: function () { return [{ type: ChannelService }, { type: ChannelListToggleService }]; } });
2589
2598
 
2590
2599
  var ChannelPreviewComponent = /** @class */ (function () {
2591
- function ChannelPreviewComponent(channelService) {
2600
+ function ChannelPreviewComponent(channelService, ngZone) {
2592
2601
  this.channelService = channelService;
2602
+ this.ngZone = ngZone;
2593
2603
  this.isActive = false;
2594
2604
  this.isUnread = false;
2595
2605
  this.latestMessage = 'Nothing yet...';
@@ -2611,8 +2621,10 @@
2611
2621
  this.subscriptions.push(this.channel.on('message.updated', this.handleMessageEvent.bind(this)));
2612
2622
  this.subscriptions.push(this.channel.on('message.deleted', this.handleMessageEvent.bind(this)));
2613
2623
  this.subscriptions.push(this.channel.on('channel.truncated', this.handleMessageEvent.bind(this)));
2614
- this.subscriptions.push(this.channel.on('message.read', function () { return (_this.isUnread =
2615
- !!_this.channel.countUnread() && _this.canSendReadEvents); }));
2624
+ this.subscriptions.push(this.channel.on('message.read', function () { return _this.ngZone.run(function () {
2625
+ _this.isUnread =
2626
+ !!_this.channel.countUnread() && _this.canSendReadEvents;
2627
+ }); }));
2616
2628
  };
2617
2629
  ChannelPreviewComponent.prototype.ngOnDestroy = function () {
2618
2630
  this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
@@ -2645,17 +2657,20 @@
2645
2657
  void this.channelService.setAsActiveChannel(this.channel);
2646
2658
  };
2647
2659
  ChannelPreviewComponent.prototype.handleMessageEvent = function (event) {
2648
- var _a, _b, _c;
2649
- if (((_a = this.channel) === null || _a === void 0 ? void 0 : _a.state.messages.length) === 0) {
2650
- this.latestMessage = 'Nothing yet...';
2651
- return;
2652
- }
2653
- if (!event.message ||
2654
- ((_b = this.channel) === null || _b === void 0 ? void 0 : _b.state.messages[((_c = this.channel) === null || _c === void 0 ? void 0 : _c.state.messages.length) - 1].id) !== event.message.id) {
2655
- return;
2656
- }
2657
- this.setLatestMessage(event.message);
2658
- this.isUnread = !!this.channel.countUnread() && this.canSendReadEvents;
2660
+ var _this = this;
2661
+ this.ngZone.run(function () {
2662
+ var _a, _b, _c;
2663
+ if (((_a = _this.channel) === null || _a === void 0 ? void 0 : _a.state.messages.length) === 0) {
2664
+ _this.latestMessage = 'Nothing yet...';
2665
+ return;
2666
+ }
2667
+ if (!event.message ||
2668
+ ((_b = _this.channel) === null || _b === void 0 ? void 0 : _b.state.messages[((_c = _this.channel) === null || _c === void 0 ? void 0 : _c.state.messages.length) - 1].id) !== event.message.id) {
2669
+ return;
2670
+ }
2671
+ _this.setLatestMessage(event.message);
2672
+ _this.isUnread = !!_this.channel.countUnread() && _this.canSendReadEvents;
2673
+ });
2659
2674
  };
2660
2675
  ChannelPreviewComponent.prototype.setLatestMessage = function (message) {
2661
2676
  if (message === null || message === void 0 ? void 0 : message.deleted_at) {
@@ -2670,7 +2685,7 @@
2670
2685
  };
2671
2686
  return ChannelPreviewComponent;
2672
2687
  }());
2673
- ChannelPreviewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelPreviewComponent, deps: [{ token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
2688
+ ChannelPreviewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelPreviewComponent, deps: [{ token: ChannelService }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
2674
2689
  ChannelPreviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: { channel: "channel" }, ngImport: i0__namespace, template: "<button\n class=\"str-chat__channel-preview-messenger\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n data-testid=\"channel-preview-container\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar\n imageUrl=\"{{ avatarImage }}\"\n name=\"{{ avatarName }}\"\n [size]=\"40\"\n ></stream-avatar>\n </div>\n <div class=\"str-chat__channel-preview-messenger--right\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{ title }}</span>\n </div>\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n {{ latestMessage | translate }}\n </div>\n </div>\n</button>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate": i10__namespace.TranslatePipe } });
2675
2690
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelPreviewComponent, decorators: [{
2676
2691
  type: i0.Component,
@@ -2679,7 +2694,7 @@
2679
2694
  templateUrl: './channel-preview.component.html',
2680
2695
  styles: [],
2681
2696
  }]
2682
- }], ctorParameters: function () { return [{ type: ChannelService }]; }, propDecorators: { channel: [{
2697
+ }], ctorParameters: function () { return [{ type: ChannelService }, { type: i0__namespace.NgZone }]; }, propDecorators: { channel: [{
2683
2698
  type: i0.Input
2684
2699
  }] } });
2685
2700
 
@@ -3159,7 +3174,7 @@
3159
3174
  return MessageComponent;
3160
3175
  }());
3161
3176
  MessageComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageComponent, deps: [{ token: ChatClientService }, { token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
3162
- MessageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageComponent, selector: "stream-message", inputs: { messageInputTemplate: "messageInputTemplate", mentionTemplate: "mentionTemplate", message: "message", enabledMessageActions: "enabledMessageActions", areReactionsEnabled: "areReactionsEnabled", canReactToMessage: "canReactToMessage", isLastSentMessage: "isLastSentMessage", canReceiveReadEvents: "canReceiveReadEvents" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n #container\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.mobile-press]=\"isPressedOnMobile\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"\n areReactionsEnabled && hasReactions\n \"\n data-testid=\"message-container\"\n>\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n isMessageDeliveredAndRead && canReceiveReadEvents;\n else deliveredStatus\n \"\n >\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <stream-avatar\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n ></stream-avatar>\n <div class=\"str-chat__message-inner\">\n <div\n class=\"str-chat__message-simple__actions\"\n data-testid=\"message-options\"\n *ngIf=\"areOptionsVisible\"\n >\n <div\n data-testid=\"message-actions-container\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--options\n \"\n [class.str-chat-angular__message-simple__actions__action--options--editing]=\"\n isEditing\n \"\n >\n <stream-message-actions-box\n [isOpen]=\"isActionBoxOpen\"\n [isMine]=\"isSentByCurrentUser\"\n [enabledActions]=\"enabledMessageActions\"\n [message]=\"message\"\n (displayedActionsCount)=\"visibleMessageActionsCount = $event\"\n (isEditing)=\"isEditing = $event; isActionBoxOpen = !isEditing\"\n [messageInputTemplate]=\"messageInputTemplate\"\n ></stream-message-actions-box>\n <stream-icon\n *ngIf=\"visibleMessageActionsCount > 0\"\n data-testid=\"action-icon\"\n icon=\"action-icon\"\n (keyup.enter)=\"isActionBoxOpen = !isActionBoxOpen\"\n (click)=\"isActionBoxOpen = !isActionBoxOpen\"\n ></stream-icon>\n </div>\n <div\n *ngIf=\"areReactionsEnabled && canReactToMessage\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--reactions\n \"\n data-testid=\"reaction-icon\"\n (click)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n (keyup.enter)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n >\n <stream-icon icon=\"reaction-icon\"></stream-icon>\n </div>\n </div>\n <stream-message-reactions\n *ngIf=\"areReactionsEnabled\"\n [messageReactionCounts]=\"message?.reaction_counts || {}\"\n [latestReactions]=\"message?.latest_reactions || []\"\n [(isSelectorOpen)]=\"isReactionSelectorOpen\"\n [messageId]=\"message?.id\"\n [ownReactions]=\"message?.own_reactions || []\"\n ></stream-message-reactions>\n <stream-attachment-list\n *ngIf=\"hasAttachment\"\n [attachments]=\"message!.attachments!\"\n ></stream-attachment-list>\n <div class=\"str-chat__message-text\" *ngIf=\"message?.text\">\n <div\n data-testid=\"inner-message\"\n class=\"\n str-chat__message-text-inner str-chat__message-simple-text-inner\n \"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n (click)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n (keyup.enter)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n >\n <div\n data-testid=\"client-error-message\"\n *ngIf=\"message?.type === 'error'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{ \"streamChat.Error \u00B7 Unsent\" | translate }}\n </div>\n <div\n data-testid=\"error-message\"\n *ngIf=\"message?.status === 'failed'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed \u00B7 Unauthorized\"\n : \"streamChat.Message Failed \u00B7 Click to try again\"\n ) | translate\n }}\n </div>\n <div\n (click)=\"textClicked()\"\n (keyup.enter)=\"textClicked()\"\n data-testid=\"text\"\n >\n <p>\n <!-- eslint-disable-next-line @angular-eslint/template/use-track-by-function -->\n <ng-container *ngFor=\"let part of messageTextParts\">\n <span\n *ngIf=\"part.type === 'text'; else mention\"\n [innerHTML]=\"part.content\"\n ></span>\n <ng-template #mention>\n <ng-container *ngIf=\"mentionTemplate; else defaultMention\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionTemplate;\n context: { user: part.user! }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultMention>\n <b>{{ part.content }}</b>\n </ng-template>\n </ng-template>\n </ng-container>\n </p>\n </div>\n </div>\n </div>\n <div class=\"str-chat__message-data str-chat__message-simple-data\">\n <span\n data-testid=\"sender\"\n *ngIf=\"!isSentByCurrentUser\"\n class=\"str-chat__message-simple-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span data-testid=\"date\" class=\"str-chat__message-simple-timestamp\">\n {{ parsedDate }}\n </span>\n </div>\n </div>\n </ng-container>\n </ng-container>\n</div>\n\n<ng-template #sendingStatus>\n <span class=\"str-chat__message-simple-status\" data-testid=\"sending-indicator\">\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n <stream-loading-indicator\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator>\n </span>\n</ng-template>\n<ng-template #readStatus>\n <span class=\"str-chat__message-simple-status\" data-testid=\"read-indicator\">\n <div class=\"str-chat__tooltip\" data-testid=\"read-by-tooltip\">\n {{ readByText }}\n </div>\n <stream-avatar\n class=\"str-chat-angular__avatar-host\"\n data-test-id=\"last-read-user-avatar\"\n [size]=\"15\"\n [imageUrl]=\"lastReadUser?.image\"\n [name]=\"lastReadUser?.name || lastReadUser?.id\"\n ></stream-avatar>\n <span\n data-test-id=\"read-by-length\"\n *ngIf=\"isReadByMultipleUsers\"\n class=\"str-chat__message-simple-status-number\"\n >\n {{ (message?.readBy)!.length }}\n </span>\n </span>\n</ng-template>\n<ng-template #deliveredStatus>\n <span\n class=\"str-chat__message-simple-status\"\n data-testid=\"delivered-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n <stream-icon\n data-testid=\"delivered-icon\"\n icon=\"delivered-icon\"\n ></stream-icon>\n </span>\n</ng-template>\n\n<ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n</ng-template>\n\n<ng-template #systemMessage>\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ message?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n</ng-template>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }, { type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: ["messageInputTemplate", "isOpen", "isMine", "message", "enabledActions"], outputs: ["displayedActionsCount", "isEditing"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: ["messageId", "messageReactionCounts", "isSelectorOpen", "latestReactions", "ownReactions"], outputs: ["isSelectorOpenChange"] }, { type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["attachments"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i10__namespace.TranslatePipe } });
3177
+ MessageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageComponent, selector: "stream-message", inputs: { messageInputTemplate: "messageInputTemplate", mentionTemplate: "mentionTemplate", message: "message", enabledMessageActions: "enabledMessageActions", areReactionsEnabled: "areReactionsEnabled", canReactToMessage: "canReactToMessage", isLastSentMessage: "isLastSentMessage", canReceiveReadEvents: "canReceiveReadEvents" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n #container\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.mobile-press]=\"isPressedOnMobile\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"\n areReactionsEnabled && hasReactions\n \"\n data-testid=\"message-container\"\n>\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n isMessageDeliveredAndRead && canReceiveReadEvents;\n else deliveredStatus\n \"\n >\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <stream-avatar\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n ></stream-avatar>\n <div class=\"str-chat__message-inner\">\n <div\n class=\"str-chat__message-simple__actions\"\n data-testid=\"message-options\"\n *ngIf=\"areOptionsVisible\"\n >\n <div\n data-testid=\"message-actions-container\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--options\n \"\n [class.str-chat-angular__message-simple__actions__action--options--editing]=\"\n isEditing\n \"\n >\n <stream-message-actions-box\n [isOpen]=\"isActionBoxOpen\"\n [isMine]=\"isSentByCurrentUser\"\n [enabledActions]=\"enabledMessageActions\"\n [message]=\"message\"\n (displayedActionsCount)=\"visibleMessageActionsCount = $event\"\n (isEditing)=\"isEditing = $event; isActionBoxOpen = !isEditing\"\n [messageInputTemplate]=\"messageInputTemplate\"\n ></stream-message-actions-box>\n <stream-icon\n *ngIf=\"visibleMessageActionsCount > 0\"\n data-testid=\"action-icon\"\n icon=\"action-icon\"\n (keyup.enter)=\"isActionBoxOpen = !isActionBoxOpen\"\n (click)=\"isActionBoxOpen = !isActionBoxOpen\"\n ></stream-icon>\n </div>\n <div\n *ngIf=\"areReactionsEnabled && canReactToMessage\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--reactions\n \"\n data-testid=\"reaction-icon\"\n (click)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n (keyup.enter)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n >\n <stream-icon icon=\"reaction-icon\"></stream-icon>\n </div>\n </div>\n <stream-message-reactions\n *ngIf=\"areReactionsEnabled\"\n [messageReactionCounts]=\"message?.reaction_counts || {}\"\n [latestReactions]=\"message?.latest_reactions || []\"\n [(isSelectorOpen)]=\"isReactionSelectorOpen\"\n [messageId]=\"message?.id\"\n [ownReactions]=\"message?.own_reactions || []\"\n ></stream-message-reactions>\n <stream-attachment-list\n *ngIf=\"hasAttachment\"\n [attachments]=\"message!.attachments!\"\n ></stream-attachment-list>\n <div class=\"str-chat__message-text\" *ngIf=\"message?.text\">\n <div\n data-testid=\"inner-message\"\n class=\"\n str-chat__message-text-inner str-chat__message-simple-text-inner\n \"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n (click)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n (keyup.enter)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n >\n <div\n data-testid=\"client-error-message\"\n *ngIf=\"message?.type === 'error'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{ \"streamChat.Error \u00B7 Unsent\" | translate }}\n </div>\n <div\n data-testid=\"error-message\"\n *ngIf=\"message?.status === 'failed'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed \u00B7 Unauthorized\"\n : \"streamChat.Message Failed \u00B7 Click to try again\"\n ) | translate\n }}\n </div>\n <div\n (click)=\"textClicked()\"\n (keyup.enter)=\"textClicked()\"\n data-testid=\"text\"\n >\n <p>\n <!-- eslint-disable-next-line @angular-eslint/template/use-track-by-function -->\n <ng-container *ngFor=\"let part of messageTextParts\">\n <span\n *ngIf=\"part.type === 'text'; else mention\"\n [innerHTML]=\"part.content\"\n ></span>\n <ng-template #mention>\n <ng-container *ngIf=\"mentionTemplate; else defaultMention\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionTemplate;\n context: { user: part.user! }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultMention>\n <b>{{ part.content }}</b>\n </ng-template>\n </ng-template>\n </ng-container>\n </p>\n </div>\n </div>\n </div>\n <div class=\"str-chat__message-data str-chat__message-simple-data\">\n <span\n data-testid=\"sender\"\n *ngIf=\"!isSentByCurrentUser\"\n class=\"str-chat__message-simple-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span data-testid=\"date\" class=\"str-chat__message-simple-timestamp\">\n {{ parsedDate }}\n </span>\n </div>\n </div>\n </ng-container>\n </ng-container>\n</div>\n\n<ng-template #sendingStatus>\n <span\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"sending-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n <stream-loading-indicator\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator>\n </span>\n</ng-template>\n<ng-template #readStatus>\n <span\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"read-indicator\"\n >\n <div class=\"str-chat__tooltip\" data-testid=\"read-by-tooltip\">\n {{ readByText }}\n </div>\n <stream-avatar\n class=\"str-chat-angular__avatar-host\"\n data-test-id=\"last-read-user-avatar\"\n [size]=\"15\"\n [imageUrl]=\"lastReadUser?.image\"\n [name]=\"lastReadUser?.name || lastReadUser?.id\"\n ></stream-avatar>\n <span\n data-test-id=\"read-by-length\"\n *ngIf=\"isReadByMultipleUsers\"\n class=\"str-chat__message-simple-status-number\"\n >\n {{ (message?.readBy)!.length }}\n </span>\n </span>\n</ng-template>\n<ng-template #deliveredStatus>\n <span\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"delivered-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n <stream-icon\n data-testid=\"delivered-icon\"\n icon=\"delivered-icon\"\n ></stream-icon>\n </span>\n</ng-template>\n\n<ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n</ng-template>\n\n<ng-template #systemMessage>\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ message?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n</ng-template>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }, { type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: ["messageInputTemplate", "isOpen", "isMine", "message", "enabledActions"], outputs: ["displayedActionsCount", "isEditing"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: ["messageId", "messageReactionCounts", "isSelectorOpen", "latestReactions", "ownReactions"], outputs: ["isSelectorOpenChange"] }, { type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["attachments"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i10__namespace.TranslatePipe } });
3163
3178
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageComponent, decorators: [{
3164
3179
  type: i0.Component,
3165
3180
  args: [{
@@ -3257,24 +3272,28 @@
3257
3272
  this.send = new i0.EventEmitter();
3258
3273
  this.userMentions = new i0.EventEmitter();
3259
3274
  this.labelKey = 'autocompleteLabel';
3260
- this.triggerChar = '@';
3275
+ this.mentionTriggerChar = '@';
3261
3276
  this.autocompleteConfig = {
3262
3277
  mentions: [],
3263
3278
  };
3264
3279
  this.subscriptions = [];
3265
3280
  this.mentionedUsers = [];
3266
3281
  this.userMentionConfig = {
3267
- triggerChar: this.triggerChar,
3282
+ triggerChar: this.mentionTriggerChar,
3268
3283
  dropUp: true,
3269
3284
  labelKey: this.labelKey,
3270
3285
  returnTrigger: true,
3271
3286
  mentionFilter: function (searchString, items) { return _this.filter(searchString, items); },
3272
- mentionSelect: function (item, triggerChar) { return _this.mentioned(item, triggerChar); },
3287
+ mentionSelect: function (item, triggerChar) { return _this.itemSelectedFromAutocompleteList(item, triggerChar); },
3273
3288
  };
3274
3289
  this.searchTerm$ = new rxjs.BehaviorSubject('');
3275
3290
  this.searchTerm$
3276
3291
  .pipe(operators.debounceTime(300), operators.distinctUntilChanged())
3277
- .subscribe(function (searchTerm) { return void _this.updateMentionOptions(searchTerm); });
3292
+ .subscribe(function (searchTerm) {
3293
+ if (searchTerm.startsWith(_this.mentionTriggerChar)) {
3294
+ void _this.updateMentionOptions(searchTerm);
3295
+ }
3296
+ });
3278
3297
  this.subscriptions.push(this.channelService.activeChannel$.subscribe(function () {
3279
3298
  _this.mentionedUsers = [];
3280
3299
  _this.userMentions.next(__spreadArray([], __read(_this.mentionedUsers)));
@@ -3300,18 +3319,20 @@
3300
3319
  var _this = this;
3301
3320
  return items.filter(function (item) { return _this.transliterate(item.autocompleteLabel.toLowerCase()).includes(_this.transliterate(searchString.toLowerCase())); });
3302
3321
  };
3303
- AutocompleteTextareaComponent.prototype.mentioned = function (item, triggerChar) {
3322
+ AutocompleteTextareaComponent.prototype.itemSelectedFromAutocompleteList = function (item, triggerChar) {
3304
3323
  if (triggerChar === void 0) { triggerChar = ''; }
3305
- this.mentionedUsers.push((item.user ? item.user : item));
3306
- this.userMentions.next(__spreadArray([], __read(this.mentionedUsers)));
3324
+ if (triggerChar === this.mentionTriggerChar) {
3325
+ this.mentionedUsers.push((item.user ? item.user : item));
3326
+ this.userMentions.next(__spreadArray([], __read(this.mentionedUsers)));
3327
+ }
3307
3328
  return triggerChar + item.autocompleteLabel;
3308
3329
  };
3309
3330
  AutocompleteTextareaComponent.prototype.autcompleteSearchTermChanged = function (searchTerm) {
3310
- if (searchTerm === this.triggerChar) {
3331
+ if (searchTerm === this.mentionTriggerChar) {
3311
3332
  void this.updateMentionOptions();
3312
3333
  }
3313
3334
  else {
3314
- this.searchTerm$.next(searchTerm.replace(this.triggerChar, ''));
3335
+ this.searchTerm$.next(searchTerm);
3315
3336
  }
3316
3337
  };
3317
3338
  AutocompleteTextareaComponent.prototype.inputChanged = function () {
@@ -3343,6 +3364,7 @@
3343
3364
  if (!this.areMentionsEnabled) {
3344
3365
  return [2 /*return*/];
3345
3366
  }
3367
+ searchTerm = searchTerm === null || searchTerm === void 0 ? void 0 : searchTerm.replace(this.mentionTriggerChar, '');
3346
3368
  request = this.mentionScope === 'application'
3347
3369
  ? function (s) { return _this.chatClientService.autocompleteUsers(s); }
3348
3370
  : function (s) { return _this.channelService.autocompleteMembers(s); };
@@ -3366,7 +3388,7 @@
3366
3388
  var updatedMentionedUsers = [];
3367
3389
  this.mentionedUsers.forEach(function (u) {
3368
3390
  var key = u.name || u.id;
3369
- if (_this.value.includes("" + _this.triggerChar + key)) {
3391
+ if (_this.value.includes("" + _this.mentionTriggerChar + key)) {
3370
3392
  updatedMentionedUsers.push(u);
3371
3393
  }
3372
3394
  });