stream-chat-angular 3.0.0-beta.6 → 3.0.0-beta.7

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.
Files changed (38) hide show
  1. package/assets/version.d.ts +1 -1
  2. package/bundles/stream-chat-angular.umd.js +15 -34
  3. package/bundles/stream-chat-angular.umd.js.map +1 -1
  4. package/esm2015/assets/version.js +2 -2
  5. package/esm2015/lib/attachment-list/attachment-list.component.js +1 -1
  6. package/esm2015/lib/channel-header/channel-header.component.js +1 -1
  7. package/esm2015/lib/channel-list/channel-list.component.js +1 -1
  8. package/esm2015/lib/channel-preview/channel-preview.component.js +1 -1
  9. package/esm2015/lib/channel.service.js +11 -18
  10. package/esm2015/lib/chat-client.service.js +4 -3
  11. package/esm2015/lib/message/message.component.js +1 -1
  12. package/esm2015/lib/message-input/message-input.component.js +1 -1
  13. package/esm2015/lib/message-list/message-list.component.js +1 -1
  14. package/esm2015/lib/message-preview.js +4 -17
  15. package/esm2015/lib/message-reactions/message-reactions.component.js +1 -1
  16. package/esm2015/lib/read-by.js +1 -1
  17. package/esm2015/lib/types.js +1 -1
  18. package/fesm2015/stream-chat-angular.js +17 -36
  19. package/fesm2015/stream-chat-angular.js.map +1 -1
  20. package/lib/attachment-list/attachment-list.component.d.ts +6 -6
  21. package/lib/attachment.service.d.ts +1 -1
  22. package/lib/channel-header/channel-header.component.d.ts +3 -3
  23. package/lib/channel-list/channel-list.component.d.ts +4 -4
  24. package/lib/channel-preview/channel-preview.component.d.ts +3 -2
  25. package/lib/channel.service.d.ts +31 -29
  26. package/lib/chat-client.service.d.ts +11 -10
  27. package/lib/custom-templates.service.d.ts +2 -2
  28. package/lib/message/message.component.d.ts +22 -3
  29. package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +1 -1
  30. package/lib/message-input/message-input.component.d.ts +21 -2
  31. package/lib/message-input/textarea.directive.d.ts +1 -1
  32. package/lib/message-list/group-styles.d.ts +1 -1
  33. package/lib/message-preview.d.ts +2 -1
  34. package/lib/message-reactions/message-reactions.component.d.ts +4 -4
  35. package/lib/read-by.d.ts +2 -1
  36. package/lib/types.d.ts +24 -17
  37. package/package.json +2 -2
  38. package/src/assets/version.ts +1 -1
@@ -1 +1 @@
1
- export declare const version = "3.0.0-beta.6";
1
+ export declare const version = "3.0.0-beta.7";
@@ -354,7 +354,7 @@
354
354
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
355
355
  }
356
356
 
357
- var version = '3.0.0-beta.6';
357
+ var version = '3.0.0-beta.7';
358
358
 
359
359
  /**
360
360
  * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
@@ -486,7 +486,8 @@
486
486
  }); })];
487
487
  case 1:
488
488
  _d.sent();
489
- return [4 /*yield*/, this.chatClient.queryChannels({ invite: 'pending' }, {}, { user_id: (_a = this.chatClient.user) === null || _a === void 0 ? void 0 : _a.id })];
489
+ return [4 /*yield*/, this.chatClient.queryChannels({ invite: 'pending' }, // TODO: find out why we need this typecast
490
+ {}, { user_id: (_a = this.chatClient.user) === null || _a === void 0 ? void 0 : _a.id })];
490
491
  case 2:
491
492
  channels = _d.sent();
492
493
  this.pendingInvitesSubject.next(channels);
@@ -628,27 +629,13 @@
628
629
  }]
629
630
  }], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: NotificationService }]; } });
630
631
 
631
- var createMessagePreview = function (user, text, attachments, mentionedUsers, parentId, quotedMessageId) {
632
+ var createMessagePreview = function (user, text, attachments, mentionedUsers, parentId, quotedMessageId, customData) {
632
633
  if (attachments === void 0) { attachments = []; }
633
634
  if (mentionedUsers === void 0) { mentionedUsers = []; }
634
635
  if (parentId === void 0) { parentId = undefined; }
635
636
  if (quotedMessageId === void 0) { quotedMessageId = undefined; }
636
637
  var clientSideId = user.id + "-" + uuid.v4();
637
- return {
638
- __html: text,
639
- created_at: new Date(),
640
- html: text,
641
- id: clientSideId,
642
- reactions: [],
643
- status: 'sending',
644
- text: text,
645
- type: 'regular',
646
- user: user,
647
- attachments: attachments,
648
- mentioned_users: mentionedUsers,
649
- parent_id: parentId,
650
- quoted_message_id: quotedMessageId,
651
- };
638
+ return Object.assign({ __html: text, created_at: new Date(), html: text, id: clientSideId, reactions: [], status: 'sending', text: text, type: 'regular', user: user, attachments: attachments, mentioned_users: mentionedUsers, parent_id: parentId, quoted_message_id: quotedMessageId }, customData);
652
639
  };
653
640
 
654
641
  var getReadBy = function (message, channel) {
@@ -914,15 +901,14 @@
914
901
  * Adds a reaction to a message.
915
902
  * @param messageId The id of the message to add the reaction to
916
903
  * @param reactionType The type of the reaction
904
+ * @param customData
917
905
  */
918
- ChannelService.prototype.addReaction = function (messageId, reactionType) {
906
+ ChannelService.prototype.addReaction = function (messageId, reactionType, customData) {
919
907
  var _a;
920
908
  return __awaiter(this, void 0, void 0, function () {
921
909
  return __generator(this, function (_h) {
922
910
  switch (_h.label) {
923
- case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject.getValue()) === null || _a === void 0 ? void 0 : _a.sendReaction(messageId, {
924
- type: reactionType,
925
- }))];
911
+ case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject.getValue()) === null || _a === void 0 ? void 0 : _a.sendReaction(messageId, Object.assign({ type: reactionType }, customData)))];
926
912
  case 1:
927
913
  _h.sent();
928
914
  return [2 /*return*/];
@@ -956,22 +942,24 @@
956
942
  * @param mentionedUsers Mentioned users
957
943
  * @param parentId Id of the parent message (if sending a thread reply)
958
944
  * @param quotedMessageId Id of the message to quote (if sending a quote reply)
945
+ * @param customData
959
946
  */
960
- ChannelService.prototype.sendMessage = function (text, attachments, mentionedUsers, parentId, quotedMessageId) {
947
+ ChannelService.prototype.sendMessage = function (text, attachments, mentionedUsers, parentId, quotedMessageId, customData) {
961
948
  if (attachments === void 0) { attachments = []; }
962
949
  if (mentionedUsers === void 0) { mentionedUsers = []; }
963
950
  if (parentId === void 0) { parentId = undefined; }
964
951
  if (quotedMessageId === void 0) { quotedMessageId = undefined; }
952
+ if (customData === void 0) { customData = undefined; }
965
953
  return __awaiter(this, void 0, void 0, function () {
966
954
  var preview, channel;
967
955
  return __generator(this, function (_h) {
968
956
  switch (_h.label) {
969
957
  case 0:
970
- preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers, parentId, quotedMessageId);
958
+ preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers, parentId, quotedMessageId, customData);
971
959
  channel = this.activeChannelSubject.getValue();
972
960
  preview.readBy = [];
973
961
  channel.state.addMessageSorted(preview, true);
974
- return [4 /*yield*/, this.sendMessageRequest(preview)];
962
+ return [4 /*yield*/, this.sendMessageRequest(preview, customData)];
975
963
  case 1:
976
964
  _h.sent();
977
965
  return [2 /*return*/];
@@ -1170,7 +1158,7 @@
1170
1158
  ChannelService.prototype.selectMessageToQuote = function (message) {
1171
1159
  this.messageToQuoteSubject.next(message);
1172
1160
  };
1173
- ChannelService.prototype.sendMessageRequest = function (preview) {
1161
+ ChannelService.prototype.sendMessageRequest = function (preview, customData) {
1174
1162
  var _a;
1175
1163
  return __awaiter(this, void 0, void 0, function () {
1176
1164
  var channel, isThreadReply, response, error_1, stringError, parsedError;
@@ -1185,14 +1173,7 @@
1185
1173
  _h.label = 1;
1186
1174
  case 1:
1187
1175
  _h.trys.push([1, 3, , 4]);
1188
- return [4 /*yield*/, channel.sendMessage({
1189
- text: preview.text,
1190
- attachments: preview.attachments,
1191
- mentioned_users: (_a = preview.mentioned_users) === null || _a === void 0 ? void 0 : _a.map(function (u) { return u.id; }),
1192
- id: preview.id,
1193
- parent_id: preview.parent_id,
1194
- quoted_message_id: preview.quoted_message_id,
1195
- })];
1176
+ return [4 /*yield*/, channel.sendMessage(Object.assign({ id: preview.id, text: preview.text, attachments: preview.attachments, mentioned_users: (_a = preview.mentioned_users) === null || _a === void 0 ? void 0 : _a.map(function (u) { return u.id; }), parent_id: preview.parent_id, quoted_message_id: preview.quoted_message_id }, customData))];
1196
1177
  case 2:
1197
1178
  response = _h.sent();
1198
1179
  if (response === null || response === void 0 ? void 0 : response.message) {