stream-chat-angular 2.14.0 → 2.16.1
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 +333 -101
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/attachment-list/attachment-list.component.js +7 -1
- package/esm2015/lib/attachment-preview-list/attachment-preview-list.component.js +4 -1
- package/esm2015/lib/attachment.service.js +1 -1
- package/esm2015/lib/avatar/avatar.component.js +7 -1
- package/esm2015/lib/channel/channel.component.js +4 -1
- package/esm2015/lib/channel-header/channel-header.component.js +4 -1
- package/esm2015/lib/channel-list/channel-list.component.js +4 -1
- package/esm2015/lib/channel-preview/channel-preview.component.js +4 -1
- package/esm2015/lib/channel.service.js +27 -3
- package/esm2015/lib/icon/icon.component.js +4 -1
- package/esm2015/lib/loading-indicator/loading-indicator.component.js +10 -1
- package/esm2015/lib/message/message.component.js +10 -1
- package/esm2015/lib/message-actions-box/message-actions-box.component.js +19 -1
- package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +22 -1
- package/esm2015/lib/message-input/message-input-config.service.js +2 -2
- package/esm2015/lib/message-input/message-input.component.js +61 -4
- package/esm2015/lib/message-input/textarea/textarea.component.js +13 -1
- package/esm2015/lib/message-list/message-list.component.js +9 -3
- package/esm2015/lib/message-reactions/message-reactions.component.js +22 -4
- package/esm2015/lib/modal/modal.component.js +10 -1
- package/esm2015/lib/notification/notification.component.js +4 -1
- package/esm2015/lib/notification-list/notification-list.component.js +4 -1
- package/esm2015/lib/notification.service.js +2 -2
- package/esm2015/lib/thread/thread.component.js +4 -1
- package/fesm2015/stream-chat-angular.js +235 -13
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/attachment-list/attachment-list.component.d.ts +9 -0
- package/lib/attachment-preview-list/attachment-preview-list.component.d.ts +3 -0
- package/lib/attachment.service.d.ts +1 -1
- package/lib/avatar/avatar.component.d.ts +12 -0
- package/lib/channel/channel.component.d.ts +3 -0
- package/lib/channel-header/channel-header.component.d.ts +3 -0
- package/lib/channel-list/channel-list.component.d.ts +6 -0
- package/lib/channel-preview/channel-preview.component.d.ts +6 -0
- package/lib/channel.service.d.ts +19 -2
- package/lib/icon/icon.component.d.ts +9 -0
- package/lib/loading-indicator/loading-indicator.component.d.ts +9 -0
- package/lib/message/message.component.d.ts +27 -3
- package/lib/message-actions-box/message-actions-box.component.d.ts +24 -0
- package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +27 -0
- package/lib/message-input/message-input-config.service.d.ts +1 -1
- package/lib/message-input/message-input.component.d.ts +41 -1
- package/lib/message-input/textarea/textarea.component.d.ts +12 -0
- package/lib/message-list/message-list.component.d.ts +20 -2
- package/lib/message-reactions/message-reactions.component.d.ts +22 -1
- package/lib/modal/modal.component.d.ts +9 -0
- package/lib/notification/notification.component.d.ts +6 -0
- package/lib/notification-list/notification-list.component.d.ts +3 -0
- package/lib/notification.service.d.ts +1 -1
- package/lib/thread/thread.component.d.ts +3 -0
- package/package.json +2 -2
- package/src/assets/version.ts +1 -1
|
@@ -354,10 +354,10 @@
|
|
|
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 = '2.
|
|
357
|
+
var version = '2.16.1';
|
|
358
358
|
|
|
359
359
|
/**
|
|
360
|
-
* The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/
|
|
360
|
+
* The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
|
|
361
361
|
*/
|
|
362
362
|
var NotificationService = /** @class */ (function () {
|
|
363
363
|
function NotificationService() {
|
|
@@ -635,6 +635,7 @@
|
|
|
635
635
|
this.activeChannelSubscriptions = [];
|
|
636
636
|
this.activeParentMessageIdSubject = new rxjs.BehaviorSubject(undefined);
|
|
637
637
|
this.activeThreadMessagesSubject = new rxjs.BehaviorSubject([]);
|
|
638
|
+
this.latestMessageDateByUserByChannelsSubject = new rxjs.BehaviorSubject({});
|
|
638
639
|
this.messagePageSize = 25;
|
|
639
640
|
this.messageToQuoteSubject = new rxjs.BehaviorSubject(undefined);
|
|
640
641
|
this.usersTypingInChannelSubject = new rxjs.BehaviorSubject([]);
|
|
@@ -667,8 +668,8 @@
|
|
|
667
668
|
this.activeParentMessage$ = rxjs.combineLatest([
|
|
668
669
|
this.activeChannelMessages$,
|
|
669
670
|
this.activeParentMessageId$,
|
|
670
|
-
]).pipe(operators.map(function (
|
|
671
|
-
var
|
|
671
|
+
]).pipe(operators.map(function (_h) {
|
|
672
|
+
var _j = __read(_h, 2), messages = _j[0], parentMessageId = _j[1];
|
|
672
673
|
if (!parentMessageId) {
|
|
673
674
|
return undefined;
|
|
674
675
|
}
|
|
@@ -685,6 +686,8 @@
|
|
|
685
686
|
this.usersTypingInChannel$ =
|
|
686
687
|
this.usersTypingInChannelSubject.asObservable();
|
|
687
688
|
this.usersTypingInThread$ = this.usersTypingInThreadSubject.asObservable();
|
|
689
|
+
this.latestMessageDateByUserByChannels$ =
|
|
690
|
+
this.latestMessageDateByUserByChannelsSubject.asObservable();
|
|
688
691
|
}
|
|
689
692
|
/**
|
|
690
693
|
* Sets the given `channel` as active.
|
|
@@ -714,8 +717,8 @@
|
|
|
714
717
|
var _a;
|
|
715
718
|
return __awaiter(this, void 0, void 0, function () {
|
|
716
719
|
var messageToQuote, activeChannel, result;
|
|
717
|
-
return __generator(this, function (
|
|
718
|
-
switch (
|
|
720
|
+
return __generator(this, function (_h) {
|
|
721
|
+
switch (_h.label) {
|
|
719
722
|
case 0:
|
|
720
723
|
messageToQuote = this.messageToQuoteSubject.getValue();
|
|
721
724
|
if (messageToQuote && !!messageToQuote.parent_id) {
|
|
@@ -732,9 +735,9 @@
|
|
|
732
735
|
limit: (_a = this.options) === null || _a === void 0 ? void 0 : _a.message_limit,
|
|
733
736
|
}))];
|
|
734
737
|
case 2:
|
|
735
|
-
result =
|
|
738
|
+
result = _h.sent();
|
|
736
739
|
this.activeThreadMessagesSubject.next((result === null || result === void 0 ? void 0 : result.messages) || []);
|
|
737
|
-
|
|
740
|
+
_h.label = 3;
|
|
738
741
|
case 3: return [2 /*return*/];
|
|
739
742
|
}
|
|
740
743
|
});
|
|
@@ -747,8 +750,8 @@
|
|
|
747
750
|
var _a, _b, _c, _d, _e;
|
|
748
751
|
return __awaiter(this, void 0, void 0, function () {
|
|
749
752
|
var activeChnannel, lastMessageId;
|
|
750
|
-
return __generator(this, function (
|
|
751
|
-
switch (
|
|
753
|
+
return __generator(this, function (_h) {
|
|
754
|
+
switch (_h.label) {
|
|
752
755
|
case 0:
|
|
753
756
|
activeChnannel = this.activeChannelSubject.getValue();
|
|
754
757
|
lastMessageId = (_a = this.activeChannelMessagesSubject.getValue()[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
@@ -758,7 +761,7 @@
|
|
|
758
761
|
watchers: { limit: 0 },
|
|
759
762
|
}))];
|
|
760
763
|
case 1:
|
|
761
|
-
|
|
764
|
+
_h.sent();
|
|
762
765
|
if (((_c = activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.data) === null || _c === void 0 ? void 0 : _c.id) ===
|
|
763
766
|
((_e = (_d = this.activeChannelSubject.getValue()) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.id)) {
|
|
764
767
|
this.activeChannelMessagesSubject.next(__spreadArray([], __read(activeChnannel.state.messages)));
|
|
@@ -775,8 +778,8 @@
|
|
|
775
778
|
var _a, _b;
|
|
776
779
|
return __awaiter(this, void 0, void 0, function () {
|
|
777
780
|
var activeChnannel, parentMessageId, lastMessageId;
|
|
778
|
-
return __generator(this, function (
|
|
779
|
-
switch (
|
|
781
|
+
return __generator(this, function (_h) {
|
|
782
|
+
switch (_h.label) {
|
|
780
783
|
case 0:
|
|
781
784
|
activeChnannel = this.activeChannelSubject.getValue();
|
|
782
785
|
parentMessageId = this.activeParentMessageIdSubject.getValue();
|
|
@@ -789,7 +792,7 @@
|
|
|
789
792
|
id_lt: lastMessageId,
|
|
790
793
|
}))];
|
|
791
794
|
case 1:
|
|
792
|
-
|
|
795
|
+
_h.sent();
|
|
793
796
|
this.activeThreadMessagesSubject.next((activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.state.threads[parentMessageId]) || []);
|
|
794
797
|
return [2 /*return*/];
|
|
795
798
|
}
|
|
@@ -805,8 +808,8 @@
|
|
|
805
808
|
ChannelService.prototype.init = function (filters, sort, options) {
|
|
806
809
|
return __awaiter(this, void 0, void 0, function () {
|
|
807
810
|
var _this = this;
|
|
808
|
-
return __generator(this, function (
|
|
809
|
-
switch (
|
|
811
|
+
return __generator(this, function (_h) {
|
|
812
|
+
switch (_h.label) {
|
|
810
813
|
case 0:
|
|
811
814
|
this.filters = filters;
|
|
812
815
|
this.options = options || {
|
|
@@ -820,7 +823,7 @@
|
|
|
820
823
|
this.sort = sort || { last_message_at: -1, updated_at: -1 };
|
|
821
824
|
return [4 /*yield*/, this.queryChannels()];
|
|
822
825
|
case 1:
|
|
823
|
-
|
|
826
|
+
_h.sent();
|
|
824
827
|
this.chatClientService.notification$.subscribe(function (notification) { return void _this.handleNotification(notification); });
|
|
825
828
|
return [2 /*return*/];
|
|
826
829
|
}
|
|
@@ -828,7 +831,7 @@
|
|
|
828
831
|
});
|
|
829
832
|
};
|
|
830
833
|
/**
|
|
831
|
-
* Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./
|
|
834
|
+
* Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./ChatClientService.mdx/#disconnectuser).
|
|
832
835
|
*/
|
|
833
836
|
ChannelService.prototype.reset = function () {
|
|
834
837
|
this.activeChannelMessagesSubject.next([]);
|
|
@@ -836,6 +839,7 @@
|
|
|
836
839
|
this.activeParentMessageIdSubject.next(undefined);
|
|
837
840
|
this.activeThreadMessagesSubject.next([]);
|
|
838
841
|
this.channelsSubject.next(undefined);
|
|
842
|
+
this.latestMessageDateByUserByChannelsSubject.next({});
|
|
839
843
|
this.selectMessageToQuote(undefined);
|
|
840
844
|
};
|
|
841
845
|
/**
|
|
@@ -843,13 +847,13 @@
|
|
|
843
847
|
*/
|
|
844
848
|
ChannelService.prototype.loadMoreChannels = function () {
|
|
845
849
|
return __awaiter(this, void 0, void 0, function () {
|
|
846
|
-
return __generator(this, function (
|
|
847
|
-
switch (
|
|
850
|
+
return __generator(this, function (_h) {
|
|
851
|
+
switch (_h.label) {
|
|
848
852
|
case 0:
|
|
849
853
|
this.options.offset = this.channels.length;
|
|
850
854
|
return [4 /*yield*/, this.queryChannels()];
|
|
851
855
|
case 1:
|
|
852
|
-
|
|
856
|
+
_h.sent();
|
|
853
857
|
return [2 /*return*/];
|
|
854
858
|
}
|
|
855
859
|
});
|
|
@@ -863,13 +867,13 @@
|
|
|
863
867
|
ChannelService.prototype.addReaction = function (messageId, reactionType) {
|
|
864
868
|
var _a;
|
|
865
869
|
return __awaiter(this, void 0, void 0, function () {
|
|
866
|
-
return __generator(this, function (
|
|
867
|
-
switch (
|
|
870
|
+
return __generator(this, function (_h) {
|
|
871
|
+
switch (_h.label) {
|
|
868
872
|
case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject.getValue()) === null || _a === void 0 ? void 0 : _a.sendReaction(messageId, {
|
|
869
873
|
type: reactionType,
|
|
870
874
|
}))];
|
|
871
875
|
case 1:
|
|
872
|
-
|
|
876
|
+
_h.sent();
|
|
873
877
|
return [2 /*return*/];
|
|
874
878
|
}
|
|
875
879
|
});
|
|
@@ -883,12 +887,12 @@
|
|
|
883
887
|
ChannelService.prototype.removeReaction = function (messageId, reactionType) {
|
|
884
888
|
var _a;
|
|
885
889
|
return __awaiter(this, void 0, void 0, function () {
|
|
886
|
-
return __generator(this, function (
|
|
887
|
-
switch (
|
|
890
|
+
return __generator(this, function (_h) {
|
|
891
|
+
switch (_h.label) {
|
|
888
892
|
case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject
|
|
889
893
|
.getValue()) === null || _a === void 0 ? void 0 : _a.deleteReaction(messageId, reactionType))];
|
|
890
894
|
case 1:
|
|
891
|
-
|
|
895
|
+
_h.sent();
|
|
892
896
|
return [2 /*return*/];
|
|
893
897
|
}
|
|
894
898
|
});
|
|
@@ -909,8 +913,8 @@
|
|
|
909
913
|
if (quotedMessageId === void 0) { quotedMessageId = undefined; }
|
|
910
914
|
return __awaiter(this, void 0, void 0, function () {
|
|
911
915
|
var preview, channel;
|
|
912
|
-
return __generator(this, function (
|
|
913
|
-
switch (
|
|
916
|
+
return __generator(this, function (_h) {
|
|
917
|
+
switch (_h.label) {
|
|
914
918
|
case 0:
|
|
915
919
|
preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers, parentId, quotedMessageId);
|
|
916
920
|
channel = this.activeChannelSubject.getValue();
|
|
@@ -918,7 +922,7 @@
|
|
|
918
922
|
channel.state.addMessageSorted(preview, true);
|
|
919
923
|
return [4 /*yield*/, this.sendMessageRequest(preview)];
|
|
920
924
|
case 1:
|
|
921
|
-
|
|
925
|
+
_h.sent();
|
|
922
926
|
return [2 /*return*/];
|
|
923
927
|
}
|
|
924
928
|
});
|
|
@@ -931,14 +935,14 @@
|
|
|
931
935
|
ChannelService.prototype.resendMessage = function (message) {
|
|
932
936
|
return __awaiter(this, void 0, void 0, function () {
|
|
933
937
|
var channel;
|
|
934
|
-
return __generator(this, function (
|
|
935
|
-
switch (
|
|
938
|
+
return __generator(this, function (_h) {
|
|
939
|
+
switch (_h.label) {
|
|
936
940
|
case 0:
|
|
937
941
|
channel = this.activeChannelSubject.getValue();
|
|
938
942
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, message), { errorStatusCode: undefined, status: 'sending' }), true);
|
|
939
943
|
return [4 /*yield*/, this.sendMessageRequest(message)];
|
|
940
944
|
case 1:
|
|
941
|
-
|
|
945
|
+
_h.sent();
|
|
942
946
|
return [2 /*return*/];
|
|
943
947
|
}
|
|
944
948
|
});
|
|
@@ -950,11 +954,11 @@
|
|
|
950
954
|
*/
|
|
951
955
|
ChannelService.prototype.updateMessage = function (message) {
|
|
952
956
|
return __awaiter(this, void 0, void 0, function () {
|
|
953
|
-
return __generator(this, function (
|
|
954
|
-
switch (
|
|
957
|
+
return __generator(this, function (_h) {
|
|
958
|
+
switch (_h.label) {
|
|
955
959
|
case 0: return [4 /*yield*/, this.chatClientService.chatClient.updateMessage(message)];
|
|
956
960
|
case 1:
|
|
957
|
-
|
|
961
|
+
_h.sent();
|
|
958
962
|
return [2 /*return*/];
|
|
959
963
|
}
|
|
960
964
|
});
|
|
@@ -966,11 +970,11 @@
|
|
|
966
970
|
*/
|
|
967
971
|
ChannelService.prototype.deleteMessage = function (message) {
|
|
968
972
|
return __awaiter(this, void 0, void 0, function () {
|
|
969
|
-
return __generator(this, function (
|
|
970
|
-
switch (
|
|
973
|
+
return __generator(this, function (_h) {
|
|
974
|
+
switch (_h.label) {
|
|
971
975
|
case 0: return [4 /*yield*/, this.chatClientService.chatClient.deleteMessage(message.id)];
|
|
972
976
|
case 1:
|
|
973
|
-
|
|
977
|
+
_h.sent();
|
|
974
978
|
return [2 /*return*/];
|
|
975
979
|
}
|
|
976
980
|
});
|
|
@@ -984,8 +988,8 @@
|
|
|
984
988
|
ChannelService.prototype.uploadAttachments = function (uploads) {
|
|
985
989
|
return __awaiter(this, void 0, void 0, function () {
|
|
986
990
|
var result, channel, uploadResults;
|
|
987
|
-
return __generator(this, function (
|
|
988
|
-
switch (
|
|
991
|
+
return __generator(this, function (_h) {
|
|
992
|
+
switch (_h.label) {
|
|
989
993
|
case 0:
|
|
990
994
|
result = [];
|
|
991
995
|
channel = this.activeChannelSubject.getValue();
|
|
@@ -993,7 +997,7 @@
|
|
|
993
997
|
? channel.sendImage(upload.file)
|
|
994
998
|
: channel.sendFile(upload.file); }))];
|
|
995
999
|
case 1:
|
|
996
|
-
uploadResults =
|
|
1000
|
+
uploadResults = _h.sent();
|
|
997
1001
|
uploadResults.forEach(function (uploadResult, i) {
|
|
998
1002
|
var file = uploads[i].file;
|
|
999
1003
|
var type = uploads[i].type;
|
|
@@ -1021,15 +1025,15 @@
|
|
|
1021
1025
|
ChannelService.prototype.deleteAttachment = function (attachmentUpload) {
|
|
1022
1026
|
return __awaiter(this, void 0, void 0, function () {
|
|
1023
1027
|
var channel;
|
|
1024
|
-
return __generator(this, function (
|
|
1025
|
-
switch (
|
|
1028
|
+
return __generator(this, function (_h) {
|
|
1029
|
+
switch (_h.label) {
|
|
1026
1030
|
case 0:
|
|
1027
1031
|
channel = this.activeChannelSubject.getValue();
|
|
1028
1032
|
return [4 /*yield*/, (attachmentUpload.type === 'image'
|
|
1029
1033
|
? channel.deleteImage(attachmentUpload.url)
|
|
1030
1034
|
: channel.deleteFile(attachmentUpload.url))];
|
|
1031
1035
|
case 1:
|
|
1032
|
-
|
|
1036
|
+
_h.sent();
|
|
1033
1037
|
return [2 /*return*/];
|
|
1034
1038
|
}
|
|
1035
1039
|
});
|
|
@@ -1044,8 +1048,8 @@
|
|
|
1044
1048
|
return __awaiter(this, void 0, void 0, function () {
|
|
1045
1049
|
var activeChannel, result;
|
|
1046
1050
|
var _this = this;
|
|
1047
|
-
return __generator(this, function (
|
|
1048
|
-
switch (
|
|
1051
|
+
return __generator(this, function (_h) {
|
|
1052
|
+
switch (_h.label) {
|
|
1049
1053
|
case 0:
|
|
1050
1054
|
activeChannel = this.activeChannelSubject.getValue();
|
|
1051
1055
|
if (!activeChannel) {
|
|
@@ -1062,7 +1066,7 @@
|
|
|
1062
1066
|
id: { $ne: this.chatClientService.chatClient.userID },
|
|
1063
1067
|
})];
|
|
1064
1068
|
case 2:
|
|
1065
|
-
result =
|
|
1069
|
+
result = _h.sent();
|
|
1066
1070
|
return [2 /*return*/, Object.values(result.members)];
|
|
1067
1071
|
}
|
|
1068
1072
|
});
|
|
@@ -1076,13 +1080,13 @@
|
|
|
1076
1080
|
ChannelService.prototype.sendAction = function (messageId, formData) {
|
|
1077
1081
|
return __awaiter(this, void 0, void 0, function () {
|
|
1078
1082
|
var channel, response, isThreadReply;
|
|
1079
|
-
return __generator(this, function (
|
|
1080
|
-
switch (
|
|
1083
|
+
return __generator(this, function (_h) {
|
|
1084
|
+
switch (_h.label) {
|
|
1081
1085
|
case 0:
|
|
1082
1086
|
channel = this.activeChannelSubject.getValue();
|
|
1083
1087
|
return [4 /*yield*/, channel.sendAction(messageId, formData)];
|
|
1084
1088
|
case 1:
|
|
1085
|
-
response =
|
|
1089
|
+
response = _h.sent();
|
|
1086
1090
|
if (response === null || response === void 0 ? void 0 : response.message) {
|
|
1087
1091
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, response.message), { status: 'received' }));
|
|
1088
1092
|
isThreadReply = !!response.message.parent_id;
|
|
@@ -1119,17 +1123,17 @@
|
|
|
1119
1123
|
var _a;
|
|
1120
1124
|
return __awaiter(this, void 0, void 0, function () {
|
|
1121
1125
|
var channel, isThreadReply, response, error_1, stringError, parsedError;
|
|
1122
|
-
return __generator(this, function (
|
|
1123
|
-
switch (
|
|
1126
|
+
return __generator(this, function (_h) {
|
|
1127
|
+
switch (_h.label) {
|
|
1124
1128
|
case 0:
|
|
1125
1129
|
channel = this.activeChannelSubject.getValue();
|
|
1126
1130
|
isThreadReply = !!preview.parent_id;
|
|
1127
1131
|
isThreadReply
|
|
1128
1132
|
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
1129
1133
|
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
1130
|
-
|
|
1134
|
+
_h.label = 1;
|
|
1131
1135
|
case 1:
|
|
1132
|
-
|
|
1136
|
+
_h.trys.push([1, 3, , 4]);
|
|
1133
1137
|
return [4 /*yield*/, channel.sendMessage({
|
|
1134
1138
|
text: preview.text,
|
|
1135
1139
|
attachments: preview.attachments,
|
|
@@ -1139,7 +1143,7 @@
|
|
|
1139
1143
|
quoted_message_id: preview.quoted_message_id,
|
|
1140
1144
|
})];
|
|
1141
1145
|
case 2:
|
|
1142
|
-
response =
|
|
1146
|
+
response = _h.sent();
|
|
1143
1147
|
if (response === null || response === void 0 ? void 0 : response.message) {
|
|
1144
1148
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, response.message), { status: 'received' }), true);
|
|
1145
1149
|
isThreadReply
|
|
@@ -1148,7 +1152,7 @@
|
|
|
1148
1152
|
}
|
|
1149
1153
|
return [3 /*break*/, 4];
|
|
1150
1154
|
case 3:
|
|
1151
|
-
error_1 =
|
|
1155
|
+
error_1 = _h.sent();
|
|
1152
1156
|
stringError = JSON.stringify(error_1);
|
|
1153
1157
|
parsedError = stringError
|
|
1154
1158
|
? JSON.parse(stringError)
|
|
@@ -1165,53 +1169,53 @@
|
|
|
1165
1169
|
};
|
|
1166
1170
|
ChannelService.prototype.handleNotification = function (notification) {
|
|
1167
1171
|
return __awaiter(this, void 0, void 0, function () {
|
|
1168
|
-
var
|
|
1172
|
+
var _h;
|
|
1169
1173
|
var _this = this;
|
|
1170
|
-
return __generator(this, function (
|
|
1171
|
-
switch (
|
|
1174
|
+
return __generator(this, function (_j) {
|
|
1175
|
+
switch (_j.label) {
|
|
1172
1176
|
case 0:
|
|
1173
|
-
|
|
1174
|
-
switch (
|
|
1177
|
+
_h = notification.eventType;
|
|
1178
|
+
switch (_h) {
|
|
1175
1179
|
case 'notification.message_new': return [3 /*break*/, 1];
|
|
1176
1180
|
case 'notification.added_to_channel': return [3 /*break*/, 3];
|
|
1177
1181
|
case 'notification.removed_from_channel': return [3 /*break*/, 5];
|
|
1178
1182
|
}
|
|
1179
1183
|
return [3 /*break*/, 6];
|
|
1180
1184
|
case 1: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1181
|
-
return __generator(this, function (
|
|
1182
|
-
switch (
|
|
1185
|
+
return __generator(this, function (_h) {
|
|
1186
|
+
switch (_h.label) {
|
|
1183
1187
|
case 0:
|
|
1184
1188
|
if (!this.customNewMessageNotificationHandler) return [3 /*break*/, 1];
|
|
1185
1189
|
this.customNewMessageNotificationHandler(notification, this.channelListSetter);
|
|
1186
1190
|
return [3 /*break*/, 3];
|
|
1187
1191
|
case 1: return [4 /*yield*/, this.handleNewMessageNotification(notification)];
|
|
1188
1192
|
case 2:
|
|
1189
|
-
|
|
1190
|
-
|
|
1193
|
+
_h.sent();
|
|
1194
|
+
_h.label = 3;
|
|
1191
1195
|
case 3: return [2 /*return*/];
|
|
1192
1196
|
}
|
|
1193
1197
|
});
|
|
1194
1198
|
}); })];
|
|
1195
1199
|
case 2:
|
|
1196
|
-
|
|
1200
|
+
_j.sent();
|
|
1197
1201
|
return [3 /*break*/, 6];
|
|
1198
1202
|
case 3: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1199
|
-
return __generator(this, function (
|
|
1200
|
-
switch (
|
|
1203
|
+
return __generator(this, function (_h) {
|
|
1204
|
+
switch (_h.label) {
|
|
1201
1205
|
case 0:
|
|
1202
1206
|
if (!this.customAddedToChannelNotificationHandler) return [3 /*break*/, 1];
|
|
1203
1207
|
this.customAddedToChannelNotificationHandler(notification, this.channelListSetter);
|
|
1204
1208
|
return [3 /*break*/, 3];
|
|
1205
1209
|
case 1: return [4 /*yield*/, this.handleAddedToChannelNotification(notification)];
|
|
1206
1210
|
case 2:
|
|
1207
|
-
|
|
1208
|
-
|
|
1211
|
+
_h.sent();
|
|
1212
|
+
_h.label = 3;
|
|
1209
1213
|
case 3: return [2 /*return*/];
|
|
1210
1214
|
}
|
|
1211
1215
|
});
|
|
1212
1216
|
}); })];
|
|
1213
1217
|
case 4:
|
|
1214
|
-
|
|
1218
|
+
_j.sent();
|
|
1215
1219
|
return [3 /*break*/, 6];
|
|
1216
1220
|
case 5:
|
|
1217
1221
|
{
|
|
@@ -1224,7 +1228,7 @@
|
|
|
1224
1228
|
}
|
|
1225
1229
|
});
|
|
1226
1230
|
}
|
|
1227
|
-
|
|
1231
|
+
_j.label = 6;
|
|
1228
1232
|
case 6: return [2 /*return*/];
|
|
1229
1233
|
}
|
|
1230
1234
|
});
|
|
@@ -1236,11 +1240,11 @@
|
|
|
1236
1240
|
};
|
|
1237
1241
|
ChannelService.prototype.handleNewMessageNotification = function (notification) {
|
|
1238
1242
|
return __awaiter(this, void 0, void 0, function () {
|
|
1239
|
-
return __generator(this, function (
|
|
1240
|
-
switch (
|
|
1243
|
+
return __generator(this, function (_h) {
|
|
1244
|
+
switch (_h.label) {
|
|
1241
1245
|
case 0: return [4 /*yield*/, this.addChannelFromNotification(notification)];
|
|
1242
1246
|
case 1:
|
|
1243
|
-
|
|
1247
|
+
_h.sent();
|
|
1244
1248
|
return [2 /*return*/];
|
|
1245
1249
|
}
|
|
1246
1250
|
});
|
|
@@ -1248,11 +1252,11 @@
|
|
|
1248
1252
|
};
|
|
1249
1253
|
ChannelService.prototype.handleAddedToChannelNotification = function (notification) {
|
|
1250
1254
|
return __awaiter(this, void 0, void 0, function () {
|
|
1251
|
-
return __generator(this, function (
|
|
1252
|
-
switch (
|
|
1255
|
+
return __generator(this, function (_h) {
|
|
1256
|
+
switch (_h.label) {
|
|
1253
1257
|
case 0: return [4 /*yield*/, this.addChannelFromNotification(notification)];
|
|
1254
1258
|
case 1:
|
|
1255
|
-
|
|
1259
|
+
_h.sent();
|
|
1256
1260
|
return [2 /*return*/];
|
|
1257
1261
|
}
|
|
1258
1262
|
});
|
|
@@ -1262,13 +1266,13 @@
|
|
|
1262
1266
|
var _a, _b;
|
|
1263
1267
|
return __awaiter(this, void 0, void 0, function () {
|
|
1264
1268
|
var channel;
|
|
1265
|
-
return __generator(this, function (
|
|
1266
|
-
switch (
|
|
1269
|
+
return __generator(this, function (_h) {
|
|
1270
|
+
switch (_h.label) {
|
|
1267
1271
|
case 0:
|
|
1268
1272
|
channel = this.chatClientService.chatClient.channel((_a = notification.event.channel) === null || _a === void 0 ? void 0 : _a.type, (_b = notification.event.channel) === null || _b === void 0 ? void 0 : _b.id);
|
|
1269
1273
|
return [4 /*yield*/, channel.watch()];
|
|
1270
1274
|
case 1:
|
|
1271
|
-
|
|
1275
|
+
_h.sent();
|
|
1272
1276
|
this.watchForChannelEvents(channel);
|
|
1273
1277
|
this.channelsSubject.next(__spreadArray([
|
|
1274
1278
|
channel
|
|
@@ -1299,6 +1303,7 @@
|
|
|
1299
1303
|
void (c === null || c === void 0 ? void 0 : c.markRead());
|
|
1300
1304
|
}
|
|
1301
1305
|
});
|
|
1306
|
+
_this.updateLatestMessages(event);
|
|
1302
1307
|
});
|
|
1303
1308
|
}));
|
|
1304
1309
|
this.activeChannelSubscriptions.push(channel.on('message.updated', function (event) { return _this.messageUpdated(event); }));
|
|
@@ -1329,13 +1334,13 @@
|
|
|
1329
1334
|
ChannelService.prototype.typingStarted = function (parentId) {
|
|
1330
1335
|
return __awaiter(this, void 0, void 0, function () {
|
|
1331
1336
|
var activeChannel;
|
|
1332
|
-
return __generator(this, function (
|
|
1333
|
-
switch (
|
|
1337
|
+
return __generator(this, function (_h) {
|
|
1338
|
+
switch (_h.label) {
|
|
1334
1339
|
case 0:
|
|
1335
1340
|
activeChannel = this.activeChannelSubject.getValue();
|
|
1336
1341
|
return [4 /*yield*/, (activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.keystroke(parentId))];
|
|
1337
1342
|
case 1:
|
|
1338
|
-
|
|
1343
|
+
_h.sent();
|
|
1339
1344
|
return [2 /*return*/];
|
|
1340
1345
|
}
|
|
1341
1346
|
});
|
|
@@ -1348,13 +1353,13 @@
|
|
|
1348
1353
|
ChannelService.prototype.typingStopped = function (parentId) {
|
|
1349
1354
|
return __awaiter(this, void 0, void 0, function () {
|
|
1350
1355
|
var activeChannel;
|
|
1351
|
-
return __generator(this, function (
|
|
1352
|
-
switch (
|
|
1356
|
+
return __generator(this, function (_h) {
|
|
1357
|
+
switch (_h.label) {
|
|
1353
1358
|
case 0:
|
|
1354
1359
|
activeChannel = this.activeChannelSubject.getValue();
|
|
1355
1360
|
return [4 /*yield*/, (activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.stopTyping(parentId))];
|
|
1356
1361
|
case 1:
|
|
1357
|
-
|
|
1362
|
+
_h.sent();
|
|
1358
1363
|
return [2 /*return*/];
|
|
1359
1364
|
}
|
|
1360
1365
|
});
|
|
@@ -1427,13 +1432,13 @@
|
|
|
1427
1432
|
return __awaiter(this, void 0, void 0, function () {
|
|
1428
1433
|
var channels, prevChannels, error_2;
|
|
1429
1434
|
var _this = this;
|
|
1430
|
-
return __generator(this, function (
|
|
1431
|
-
switch (
|
|
1435
|
+
return __generator(this, function (_h) {
|
|
1436
|
+
switch (_h.label) {
|
|
1432
1437
|
case 0:
|
|
1433
|
-
|
|
1438
|
+
_h.trys.push([0, 2, , 3]);
|
|
1434
1439
|
return [4 /*yield*/, this.chatClientService.chatClient.queryChannels(this.filters, this.sort, this.options)];
|
|
1435
1440
|
case 1:
|
|
1436
|
-
channels =
|
|
1441
|
+
channels = _h.sent();
|
|
1437
1442
|
channels.forEach(function (c) { return _this.watchForChannelEvents(c); });
|
|
1438
1443
|
prevChannels = this.channelsSubject.getValue() || [];
|
|
1439
1444
|
this.channelsSubject.next(__spreadArray(__spreadArray([], __read(prevChannels)), __read(channels)));
|
|
@@ -1443,7 +1448,7 @@
|
|
|
1443
1448
|
this.hasMoreChannelsSubject.next(channels.length >= this.options.limit);
|
|
1444
1449
|
return [3 /*break*/, 3];
|
|
1445
1450
|
case 2:
|
|
1446
|
-
error_2 =
|
|
1451
|
+
error_2 = _h.sent();
|
|
1447
1452
|
this.channelsSubject.error(error_2);
|
|
1448
1453
|
return [3 /*break*/, 3];
|
|
1449
1454
|
case 3: return [2 /*return*/];
|
|
@@ -1554,7 +1559,6 @@
|
|
|
1554
1559
|
}
|
|
1555
1560
|
}
|
|
1556
1561
|
};
|
|
1557
|
-
// truncate active thread as well
|
|
1558
1562
|
ChannelService.prototype.handleChannelTruncate = function (event) {
|
|
1559
1563
|
var _a, _b;
|
|
1560
1564
|
var channelIndex = this.channels.findIndex(function (c) { return c.cid === event.channel.cid; });
|
|
@@ -1640,6 +1644,26 @@
|
|
|
1640
1644
|
return;
|
|
1641
1645
|
}
|
|
1642
1646
|
};
|
|
1647
|
+
ChannelService.prototype.updateLatestMessages = function (event) {
|
|
1648
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1649
|
+
if (((_b = (_a = event.message) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.id) !== ((_d = (_c = this.chatClientService) === null || _c === void 0 ? void 0 : _c.chatClient.user) === null || _d === void 0 ? void 0 : _d.id)) {
|
|
1650
|
+
return;
|
|
1651
|
+
}
|
|
1652
|
+
var latestMessages = this.latestMessageDateByUserByChannelsSubject.getValue();
|
|
1653
|
+
if (!((_e = event.message) === null || _e === void 0 ? void 0 : _e.created_at)) {
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1656
|
+
var channelId = (_f = event === null || event === void 0 ? void 0 : event.message) === null || _f === void 0 ? void 0 : _f.cid;
|
|
1657
|
+
if (!channelId) {
|
|
1658
|
+
return;
|
|
1659
|
+
}
|
|
1660
|
+
var messageDate = new Date(event.message.created_at);
|
|
1661
|
+
if (!latestMessages[channelId] ||
|
|
1662
|
+
((_g = latestMessages[channelId]) === null || _g === void 0 ? void 0 : _g.getTime()) < messageDate.getTime()) {
|
|
1663
|
+
latestMessages[channelId] = messageDate;
|
|
1664
|
+
this.latestMessageDateByUserByChannelsSubject.next(Object.assign({}, latestMessages));
|
|
1665
|
+
}
|
|
1666
|
+
};
|
|
1643
1667
|
return ChannelService;
|
|
1644
1668
|
}());
|
|
1645
1669
|
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 });
|
|
@@ -2146,8 +2170,14 @@
|
|
|
2146
2170
|
}]
|
|
2147
2171
|
}], ctorParameters: function () { return [{ type: i2__namespace.TranslateService }]; } });
|
|
2148
2172
|
|
|
2173
|
+
/**
|
|
2174
|
+
* The `Avatar` component displays the provided image, with fallback to the first letter of the optional name input.
|
|
2175
|
+
*/
|
|
2149
2176
|
var AvatarComponent = /** @class */ (function () {
|
|
2150
2177
|
function AvatarComponent() {
|
|
2178
|
+
/**
|
|
2179
|
+
* The size in pixels of the avatar image.
|
|
2180
|
+
*/
|
|
2151
2181
|
this.size = 32;
|
|
2152
2182
|
this.isLoaded = false;
|
|
2153
2183
|
this.isError = false;
|
|
@@ -2179,6 +2209,9 @@
|
|
|
2179
2209
|
type: i0.Input
|
|
2180
2210
|
}] } });
|
|
2181
2211
|
|
|
2212
|
+
/**
|
|
2213
|
+
* The `Icon` component can be used to display different icons (i. e. message delivered icon).
|
|
2214
|
+
*/
|
|
2182
2215
|
var IconComponent = /** @class */ (function () {
|
|
2183
2216
|
function IconComponent() {
|
|
2184
2217
|
}
|
|
@@ -2199,9 +2232,18 @@
|
|
|
2199
2232
|
type: i0.Input
|
|
2200
2233
|
}] } });
|
|
2201
2234
|
|
|
2235
|
+
/**
|
|
2236
|
+
* The `LoadingIndicator` component displays a spinner to indicate that an action is in progress.
|
|
2237
|
+
*/
|
|
2202
2238
|
var LoadingIndicatorComponent = /** @class */ (function () {
|
|
2203
2239
|
function LoadingIndicatorComponent() {
|
|
2240
|
+
/**
|
|
2241
|
+
* The size of the indicator (in pixels)
|
|
2242
|
+
*/
|
|
2204
2243
|
this.size = 15;
|
|
2244
|
+
/**
|
|
2245
|
+
* The color of the indicator
|
|
2246
|
+
*/
|
|
2205
2247
|
this.color = '#006CFF';
|
|
2206
2248
|
}
|
|
2207
2249
|
return LoadingIndicatorComponent;
|
|
@@ -2331,7 +2373,7 @@
|
|
|
2331
2373
|
}], ctorParameters: function () { return []; } });
|
|
2332
2374
|
|
|
2333
2375
|
/**
|
|
2334
|
-
* The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](../components/
|
|
2376
|
+
* The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](../components/MessageInputComponent.mdx) components if your UI has more than one input component.
|
|
2335
2377
|
*/
|
|
2336
2378
|
var MessageInputConfigService = /** @class */ (function () {
|
|
2337
2379
|
function MessageInputConfigService() {
|
|
@@ -2384,10 +2426,16 @@
|
|
|
2384
2426
|
}]
|
|
2385
2427
|
}], ctorParameters: function () { return []; } });
|
|
2386
2428
|
|
|
2429
|
+
/**
|
|
2430
|
+
* The `AttachmentList` compontent displays the attachments of a message
|
|
2431
|
+
*/
|
|
2387
2432
|
var AttachmentListComponent = /** @class */ (function () {
|
|
2388
2433
|
function AttachmentListComponent(imageLoadService, channelService) {
|
|
2389
2434
|
this.imageLoadService = imageLoadService;
|
|
2390
2435
|
this.channelService = channelService;
|
|
2436
|
+
/**
|
|
2437
|
+
* The attachments to display
|
|
2438
|
+
*/
|
|
2391
2439
|
this.attachments = [];
|
|
2392
2440
|
this.orderedAttachments = [];
|
|
2393
2441
|
}
|
|
@@ -2453,6 +2501,9 @@
|
|
|
2453
2501
|
type: i0.Input
|
|
2454
2502
|
}] } });
|
|
2455
2503
|
|
|
2504
|
+
/**
|
|
2505
|
+
* The `AttachmentPreviewList` compontent displays a preview of the attachments uploaded to a message. Users can delete attachments using the preview component, or retry upload if it failed previously.
|
|
2506
|
+
*/
|
|
2456
2507
|
var AttachmentPreviewListComponent = /** @class */ (function () {
|
|
2457
2508
|
function AttachmentPreviewListComponent(attachmentService) {
|
|
2458
2509
|
this.attachmentService = attachmentService;
|
|
@@ -2498,6 +2549,9 @@
|
|
|
2498
2549
|
}]
|
|
2499
2550
|
}], ctorParameters: function () { return [{ type: AttachmentService }]; } });
|
|
2500
2551
|
|
|
2552
|
+
/**
|
|
2553
|
+
* The `MessageInput` component displays an input where users can type their messages and upload files, and sends the message to the active channel. The component can be used to compose new messages or update existing ones. To send messages, the chat user needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
|
|
2554
|
+
*/
|
|
2501
2555
|
var MessageInputComponent = /** @class */ (function () {
|
|
2502
2556
|
function MessageInputComponent(channelService, notificationService, attachmentService, configService, textareaType, componentFactoryResolver, cdRef, chatClient, emojiInputService) {
|
|
2503
2557
|
var _this = this;
|
|
@@ -2510,11 +2564,18 @@
|
|
|
2510
2564
|
this.cdRef = cdRef;
|
|
2511
2565
|
this.chatClient = chatClient;
|
|
2512
2566
|
this.emojiInputService = emojiInputService;
|
|
2567
|
+
/**
|
|
2568
|
+
* Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
|
|
2569
|
+
*/
|
|
2513
2570
|
this.mode = 'main';
|
|
2571
|
+
/**
|
|
2572
|
+
* Emits when a message was successfuly sent or updated
|
|
2573
|
+
*/
|
|
2514
2574
|
this.messageUpdate = new i0.EventEmitter();
|
|
2515
2575
|
this.textareaValue = '';
|
|
2516
2576
|
this.mentionedUsers = [];
|
|
2517
2577
|
this.typingStart$ = new rxjs.Subject();
|
|
2578
|
+
this.isCooldownInProgress = false;
|
|
2518
2579
|
this.subscriptions = [];
|
|
2519
2580
|
this.isViewInited = false;
|
|
2520
2581
|
this.subscriptions.push(this.attachmentService.attachmentUploadInProgressCounter$.subscribe(function (counter) {
|
|
@@ -2558,6 +2619,30 @@
|
|
|
2558
2619
|
this.configService.commandAutocompleteItemTemplate;
|
|
2559
2620
|
this.emojiPickerTemplate = this.configService.emojiPickerTemplate;
|
|
2560
2621
|
this.subscriptions.push(this.typingStart$.subscribe(function () { return void _this.channelService.typingStarted(_this.parentMessageId); }));
|
|
2622
|
+
this.subscriptions.push(rxjs.combineLatest([
|
|
2623
|
+
this.channelService.latestMessageDateByUserByChannels$,
|
|
2624
|
+
this.channelService.activeChannel$,
|
|
2625
|
+
])
|
|
2626
|
+
.pipe(operators.map(function (_12) {
|
|
2627
|
+
var _13 = __read(_12, 2), latestMessages = _13[0], channel = _13[1];
|
|
2628
|
+
return [latestMessages[(channel === null || channel === void 0 ? void 0 : channel.cid) || ''], channel];
|
|
2629
|
+
}))
|
|
2630
|
+
.subscribe(function (_12) {
|
|
2631
|
+
var _13 = __read(_12, 2), latestMessageDate = _13[0], channel = _13[1];
|
|
2632
|
+
var _a, _b, _c;
|
|
2633
|
+
var cooldown = ((_a = channel === null || channel === void 0 ? void 0 : channel.data) === null || _a === void 0 ? void 0 : _a.cooldown) &&
|
|
2634
|
+
latestMessageDate &&
|
|
2635
|
+
Math.round(((_b = channel === null || channel === void 0 ? void 0 : channel.data) === null || _b === void 0 ? void 0 : _b.cooldown) -
|
|
2636
|
+
(new Date().getTime() - latestMessageDate.getTime()) / 1000);
|
|
2637
|
+
if (cooldown &&
|
|
2638
|
+
cooldown > 0 &&
|
|
2639
|
+
((_c = channel === null || channel === void 0 ? void 0 : channel.data) === null || _c === void 0 ? void 0 : _c.own_capabilities).includes('slow-mode')) {
|
|
2640
|
+
_this.startCooldown(cooldown);
|
|
2641
|
+
}
|
|
2642
|
+
else if (_this.isCooldownInProgress) {
|
|
2643
|
+
_this.stopCooldown();
|
|
2644
|
+
}
|
|
2645
|
+
}));
|
|
2561
2646
|
}
|
|
2562
2647
|
MessageInputComponent.prototype.ngAfterViewInit = function () {
|
|
2563
2648
|
this.isViewInited = true;
|
|
@@ -2689,6 +2774,21 @@
|
|
|
2689
2774
|
enumerable: false,
|
|
2690
2775
|
configurable: true
|
|
2691
2776
|
});
|
|
2777
|
+
Object.defineProperty(MessageInputComponent.prototype, "disabledTextareaText", {
|
|
2778
|
+
get: function () {
|
|
2779
|
+
if (!this.canSendMessages) {
|
|
2780
|
+
return this.mode === 'thread'
|
|
2781
|
+
? "streamChat.You can't send thread replies in this channel"
|
|
2782
|
+
: "streamChat.You can't send messages in this channel";
|
|
2783
|
+
}
|
|
2784
|
+
else if (this.cooldown$) {
|
|
2785
|
+
return 'streamChat.Slow Mode ON';
|
|
2786
|
+
}
|
|
2787
|
+
return '';
|
|
2788
|
+
},
|
|
2789
|
+
enumerable: false,
|
|
2790
|
+
configurable: true
|
|
2791
|
+
});
|
|
2692
2792
|
MessageInputComponent.prototype.filesSelected = function (fileList) {
|
|
2693
2793
|
return __awaiter(this, void 0, void 0, function () {
|
|
2694
2794
|
return __generator(this, function (_12) {
|
|
@@ -2817,10 +2917,28 @@
|
|
|
2817
2917
|
enumerable: false,
|
|
2818
2918
|
configurable: true
|
|
2819
2919
|
});
|
|
2920
|
+
MessageInputComponent.prototype.startCooldown = function (cooldown) {
|
|
2921
|
+
var _this = this;
|
|
2922
|
+
this.isCooldownInProgress = true;
|
|
2923
|
+
this.cooldown$ = rxjs.timer(0, 1000).pipe(operators.take(cooldown + 1), operators.map(function (v) { return cooldown - v; }), operators.tap(function (v) {
|
|
2924
|
+
if (v === 0) {
|
|
2925
|
+
_this.stopCooldown();
|
|
2926
|
+
}
|
|
2927
|
+
}));
|
|
2928
|
+
};
|
|
2929
|
+
MessageInputComponent.prototype.stopCooldown = function () {
|
|
2930
|
+
var _this = this;
|
|
2931
|
+
this.cooldown$ = undefined;
|
|
2932
|
+
this.isCooldownInProgress = false;
|
|
2933
|
+
// the anchor directive will be recreated because of *ngIf, so we will have to reinit the textarea as well
|
|
2934
|
+
this.textareaRef = undefined;
|
|
2935
|
+
// we can only create the textarea after the anchor was recreated, so we will have to wait a change detection cycle with setTimeout
|
|
2936
|
+
setTimeout(function () { return _this.initTextarea(); });
|
|
2937
|
+
};
|
|
2820
2938
|
return MessageInputComponent;
|
|
2821
2939
|
}());
|
|
2822
2940
|
MessageInputComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputComponent, deps: [{ token: ChannelService }, { token: NotificationService }, { token: AttachmentService }, { token: MessageInputConfigService }, { token: textareaInjectionToken }, { token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ChangeDetectorRef }, { token: ChatClientService }, { token: EmojiInputService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2823
|
-
MessageInputComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageInputComponent, selector: "stream-message-input", inputs: { isFileUploadEnabled: "isFileUploadEnabled", areMentionsEnabled: "areMentionsEnabled", mentionScope: "mentionScope", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", commandAutocompleteItemTemplate: "commandAutocompleteItemTemplate", emojiPickerTemplate: "emojiPickerTemplate", mode: "mode", acceptedFileTypes: "acceptedFileTypes", isMultipleFileUploadEnabled: "isMultipleFileUploadEnabled", message: "message" }, outputs: { messageUpdate: "messageUpdate" }, providers: [AttachmentService, EmojiInputService], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "textareaAnchor", first: true, predicate: TextareaDirective, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n class=\"{{\n mode === 'main' ? 'str-chat__input-flat' : 'str-chat__small-message-input'\n }}\"\n [class.str-chat__input-flat-has-attachments]=\"\n (attachmentUploads$ | async)!.length > 0\n \"\n [class.str-chat__input-flat-quoted]=\"!!quotedMessage\"\n>\n <div\n data-testid=\"quoted-message-container\"\n class=\"quoted-message-preview\"\n *ngIf=\"quotedMessage\"\n >\n <div class=\"quoted-message-preview-header\">\n <div>{{ \"streamChat.Reply to Message\" | translate }}</div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon\n icon=\"close-no-outline\"\n style=\"font-size: 10px; line-height: 10px\"\n ></stream-icon>\n </button>\n </div>\n <div class=\"quoted-message-preview-content\">\n <stream-avatar\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"quotedMessage?.user?.image\"\n [name]=\"quotedMessage?.user?.name || quotedMessage?.user?.id\"\n [size]=\"20\"\n ></stream-avatar>\n <div class=\"quoted-message-preview-content-inner\">\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"quotedMessage?.html || quotedMessage?.text\"\n ></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__input-flat-wrapper\" style=\"width: 100%\">\n <div\n class=\"{{\n mode === 'main'\n ? 'str-chat__input-flat--textarea-wrapper'\n : 'str-chat__small-message-input--textarea-wrapper'\n }}\"\n >\n <stream-attachment-preview-list\n class=\"rfu-image-previewer-angular-host\"\n ></stream-attachment-preview-list>\n <div class=\"rta str-chat__textarea str-chat-angular__textarea\">\n <ng-container
|
|
2941
|
+
MessageInputComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageInputComponent, selector: "stream-message-input", inputs: { isFileUploadEnabled: "isFileUploadEnabled", areMentionsEnabled: "areMentionsEnabled", mentionScope: "mentionScope", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", commandAutocompleteItemTemplate: "commandAutocompleteItemTemplate", emojiPickerTemplate: "emojiPickerTemplate", mode: "mode", acceptedFileTypes: "acceptedFileTypes", isMultipleFileUploadEnabled: "isMultipleFileUploadEnabled", message: "message" }, outputs: { messageUpdate: "messageUpdate" }, providers: [AttachmentService, EmojiInputService], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "textareaAnchor", first: true, predicate: TextareaDirective, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n class=\"{{\n mode === 'main' ? 'str-chat__input-flat' : 'str-chat__small-message-input'\n }}\"\n [class.str-chat__input-flat-has-attachments]=\"\n (attachmentUploads$ | async)!.length > 0\n \"\n [class.str-chat__input-flat-quoted]=\"!!quotedMessage\"\n>\n <div\n data-testid=\"quoted-message-container\"\n class=\"quoted-message-preview\"\n *ngIf=\"quotedMessage\"\n >\n <div class=\"quoted-message-preview-header\">\n <div>{{ \"streamChat.Reply to Message\" | translate }}</div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon\n icon=\"close-no-outline\"\n style=\"font-size: 10px; line-height: 10px\"\n ></stream-icon>\n </button>\n </div>\n <div class=\"quoted-message-preview-content\">\n <stream-avatar\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"quotedMessage?.user?.image\"\n [name]=\"quotedMessage?.user?.name || quotedMessage?.user?.id\"\n [size]=\"20\"\n ></stream-avatar>\n <div class=\"quoted-message-preview-content-inner\">\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"quotedMessage?.html || quotedMessage?.text\"\n ></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__input-flat-wrapper\" style=\"width: 100%\">\n <div\n class=\"{{\n mode === 'main'\n ? 'str-chat__input-flat--textarea-wrapper'\n : 'str-chat__small-message-input--textarea-wrapper'\n }}\"\n >\n <stream-attachment-preview-list\n class=\"rfu-image-previewer-angular-host\"\n ></stream-attachment-preview-list>\n <div class=\"rta str-chat__textarea str-chat-angular__textarea\">\n <ng-container\n *ngIf=\"emojiPickerTemplate && !isCooldownInProgress\"\n data-testid=\"emoji-picker\"\n >\n <div\n class=\"\n str-chat__input-flat-emojiselect\n str-chat-angular__emojiselect\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n emojiPickerTemplate;\n context: { emojiInput$: emojiInputService.emojiInput$ }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <div\n class=\"str-chat__input-flat-cooldown str-chat-angular__cooldown\"\n *ngIf=\"isCooldownInProgress\"\n data-testid=\"cooldown-timer\"\n >\n {{ cooldown$ | async }}\n </div>\n <ng-template\n *ngIf=\"canSendMessages && !isCooldownInProgress; else notAllowed\"\n streamTextarea\n [(value)]=\"textareaValue\"\n (valueChange)=\"typingStart$.next()\"\n (send)=\"messageSent()\"\n [componentRef]=\"textareaRef\"\n (userMentions)=\"mentionedUsers = $event\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionAutocompleteItemTemplate]=\"mentionAutocompleteItemTemplate\"\n [commandAutocompleteItemTemplate]=\"commandAutocompleteItemTemplate\"\n [mentionScope]=\"mentionScope\"\n ></ng-template>\n <ng-template #notAllowed>\n <textarea\n disabled\n rows=\"1\"\n [value]=\"disabledTextareaText | translate\"\n class=\"rta__textarea str-chat__textarea__textarea\"\n data-testid=\"disabled-textarea\"\n ></textarea>\n </ng-template>\n </div>\n <div\n *ngIf=\"\n isFileUploadEnabled &&\n isFileUploadAuthorized &&\n canSendMessages &&\n !isCooldownInProgress\n \"\n class=\"str-chat__fileupload-wrapper\"\n data-testid=\"file-upload-button\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Attach files\" | translate }}\n </div>\n <div class=\"rfu-file-upload-button\">\n <label>\n <input\n #fileInput\n type=\"file\"\n class=\"rfu-file-input\"\n data-testid=\"file-input\"\n [accept]=\"accept\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <span class=\"str-chat__input-flat-fileupload\">\n <stream-icon icon=\"file-upload\"></stream-icon>\n </span>\n </label>\n </div>\n </div>\n </div>\n <button\n *ngIf=\"canSendMessages\"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon icon=\"send\"></stream-icon>\n </button>\n </div>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }, { type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["messageId", "attachments"] }, { type: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: TextareaDirective, selector: "[streamTextarea]", inputs: ["componentRef", "areMentionsEnabled", "mentionAutocompleteItemTemplate", "mentionScope", "commandAutocompleteItemTemplate", "value"], outputs: ["valueChange", "send", "userMentions"] }], pipes: { "async": i6__namespace.AsyncPipe, "translate": i2__namespace.TranslatePipe } });
|
|
2824
2942
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputComponent, decorators: [{
|
|
2825
2943
|
type: i0.Component,
|
|
2826
2944
|
args: [{
|
|
@@ -2864,10 +2982,19 @@
|
|
|
2864
2982
|
args: [TextareaDirective, { static: false }]
|
|
2865
2983
|
}] } });
|
|
2866
2984
|
|
|
2985
|
+
/**
|
|
2986
|
+
* The `Modal` component displays its content in an overlay. The modal can be closed with a close button, if the user clicks outside of the modal content, or if the escape button is pressed. The modal can also be closed from outside.
|
|
2987
|
+
*/
|
|
2867
2988
|
var ModalComponent = /** @class */ (function () {
|
|
2868
2989
|
function ModalComponent() {
|
|
2869
2990
|
var _this = this;
|
|
2991
|
+
/**
|
|
2992
|
+
* If `true` the modal will be displayed, if `false` the modal will be hidden
|
|
2993
|
+
*/
|
|
2870
2994
|
this.isOpen = false;
|
|
2995
|
+
/**
|
|
2996
|
+
* Emits `true` if the modal becomes visible, and `false` if the modal is closed.
|
|
2997
|
+
*/
|
|
2871
2998
|
this.isOpenChange = new i0.EventEmitter();
|
|
2872
2999
|
this.watchForEscPress = function (event) {
|
|
2873
3000
|
if (event.key === 'Escape') {
|
|
@@ -2926,6 +3053,9 @@
|
|
|
2926
3053
|
args: ['content']
|
|
2927
3054
|
}] } });
|
|
2928
3055
|
|
|
3056
|
+
/**
|
|
3057
|
+
* The `Notification` component displays a notification within the [`NotificationList`](./NotificationListComponent.mdx)
|
|
3058
|
+
*/
|
|
2929
3059
|
var NotificationComponent = /** @class */ (function () {
|
|
2930
3060
|
function NotificationComponent() {
|
|
2931
3061
|
}
|
|
@@ -2944,6 +3074,9 @@
|
|
|
2944
3074
|
type: i0.Input
|
|
2945
3075
|
}] } });
|
|
2946
3076
|
|
|
3077
|
+
/**
|
|
3078
|
+
* The `NotificationList` component displays the list of active notifications.
|
|
3079
|
+
*/
|
|
2947
3080
|
var NotificationListComponent = /** @class */ (function () {
|
|
2948
3081
|
function NotificationListComponent(notificationService) {
|
|
2949
3082
|
this.notificationService = notificationService;
|
|
@@ -2965,16 +3098,34 @@
|
|
|
2965
3098
|
}]
|
|
2966
3099
|
}], ctorParameters: function () { return [{ type: NotificationService }]; } });
|
|
2967
3100
|
|
|
3101
|
+
/**
|
|
3102
|
+
* The `MessageActionsBox` component displays a list of message actions (i.e edit), that can be opened or closed. You can find the [list of the supported actions](../concepts/message-interactions.mdx) in the message interaction guide.
|
|
3103
|
+
*/
|
|
2968
3104
|
var MessageActionsBoxComponent = /** @class */ (function () {
|
|
2969
3105
|
function MessageActionsBoxComponent(chatClientService, notificationService, channelService) {
|
|
2970
3106
|
var _this = this;
|
|
2971
3107
|
this.chatClientService = chatClientService;
|
|
2972
3108
|
this.notificationService = notificationService;
|
|
2973
3109
|
this.channelService = channelService;
|
|
3110
|
+
/**
|
|
3111
|
+
* Indicates if the list should be opened or closed. Adding a UI element to open and close the list is the parent's component responsibility.
|
|
3112
|
+
*/
|
|
2974
3113
|
this.isOpen = false;
|
|
3114
|
+
/**
|
|
3115
|
+
* Indicates if the message actions are belonging to a message that was sent by the current user or not.
|
|
3116
|
+
*/
|
|
2975
3117
|
this.isMine = false;
|
|
3118
|
+
/**
|
|
3119
|
+
* The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI.
|
|
3120
|
+
*/
|
|
2976
3121
|
this.enabledActions = [];
|
|
3122
|
+
/**
|
|
3123
|
+
* The number of authorized actions (it can be less or equal than the number of enabled actions)
|
|
3124
|
+
*/
|
|
2977
3125
|
this.displayedActionsCount = new i0.EventEmitter();
|
|
3126
|
+
/**
|
|
3127
|
+
* An event which emits `true` if the edit message modal is open, and `false` when it is closed.
|
|
3128
|
+
*/
|
|
2978
3129
|
this.isEditing = new i0.EventEmitter();
|
|
2979
3130
|
this.isEditModalOpen = false;
|
|
2980
3131
|
this.modalClosed = function () {
|
|
@@ -3149,6 +3300,9 @@
|
|
|
3149
3300
|
args: [MessageInputComponent]
|
|
3150
3301
|
}] } });
|
|
3151
3302
|
|
|
3303
|
+
/**
|
|
3304
|
+
* The `Channel` component is a container component that displays the [`ChannelHeader`](./ChannelHeaderComponent.mdx), [`MessageList`](./MessageListComponent.mdx), [`NotificationList`](./NotificationListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components. You can also provide the [`Thread`](./ThreadComponent.mdx) component to use message [threads](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
|
|
3305
|
+
*/
|
|
3152
3306
|
var ChannelComponent = /** @class */ (function () {
|
|
3153
3307
|
function ChannelComponent(channelService) {
|
|
3154
3308
|
this.channelService = channelService;
|
|
@@ -3253,6 +3407,9 @@
|
|
|
3253
3407
|
args: [{ providedIn: 'root' }]
|
|
3254
3408
|
}], ctorParameters: function () { return []; } });
|
|
3255
3409
|
|
|
3410
|
+
/**
|
|
3411
|
+
* The `ChannelHeader` component displays the avatar and name of the currently active channel along with member and watcher information. You can read about [the difference between members and watchers](https://getstream.io/chat/docs/javascript/watch_channel/?language=javascript#watchers-vs-members) in the platform documentation. Please note that number of watchers is only displayed if the user has [`connect-events` capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript)
|
|
3412
|
+
*/
|
|
3256
3413
|
var ChannelHeaderComponent = /** @class */ (function () {
|
|
3257
3414
|
function ChannelHeaderComponent(channelService, channelListToggleService) {
|
|
3258
3415
|
var _this = this;
|
|
@@ -3302,6 +3459,9 @@
|
|
|
3302
3459
|
}]
|
|
3303
3460
|
}], ctorParameters: function () { return [{ type: ChannelService }, { type: ChannelListToggleService }]; } });
|
|
3304
3461
|
|
|
3462
|
+
/**
|
|
3463
|
+
* The `ChannelPreview` component displays a channel preview in the channel list, it consists of the image, name and latest message of the channel.
|
|
3464
|
+
*/
|
|
3305
3465
|
var ChannelPreviewComponent = /** @class */ (function () {
|
|
3306
3466
|
function ChannelPreviewComponent(channelService, ngZone) {
|
|
3307
3467
|
this.channelService = channelService;
|
|
@@ -3404,6 +3564,9 @@
|
|
|
3404
3564
|
type: i0.Input
|
|
3405
3565
|
}] } });
|
|
3406
3566
|
|
|
3567
|
+
/**
|
|
3568
|
+
* The `ChannelList` component renders the list of channels.
|
|
3569
|
+
*/
|
|
3407
3570
|
var ChannelListComponent = /** @class */ (function () {
|
|
3408
3571
|
function ChannelListComponent(channelService, channelListToggleService) {
|
|
3409
3572
|
this.channelService = channelService;
|
|
@@ -3500,16 +3663,34 @@
|
|
|
3500
3663
|
wow: '😮',
|
|
3501
3664
|
sad: '😞',
|
|
3502
3665
|
};
|
|
3666
|
+
/**
|
|
3667
|
+
* The `MessageReactions` component displays the reactions of a message, the current user can add and remove reactions. You can read more about [message reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript) in the platform documentation.
|
|
3668
|
+
*/
|
|
3503
3669
|
var MessageReactionsComponent = /** @class */ (function () {
|
|
3504
3670
|
function MessageReactionsComponent(cdRef, channelService) {
|
|
3505
3671
|
var _this = this;
|
|
3506
3672
|
this.cdRef = cdRef;
|
|
3507
3673
|
this.channelService = channelService;
|
|
3674
|
+
/**
|
|
3675
|
+
* The number of reactions grouped by [reaction types](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts)
|
|
3676
|
+
*/
|
|
3508
3677
|
this.messageReactionCounts = {};
|
|
3678
|
+
/**
|
|
3679
|
+
* Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.
|
|
3680
|
+
*/
|
|
3509
3681
|
this.isSelectorOpen = false;
|
|
3510
|
-
|
|
3682
|
+
/**
|
|
3683
|
+
* List of reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.
|
|
3684
|
+
*/
|
|
3511
3685
|
this.latestReactions = [];
|
|
3686
|
+
/**
|
|
3687
|
+
* List of the user's own reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.
|
|
3688
|
+
*/
|
|
3512
3689
|
this.ownReactions = [];
|
|
3690
|
+
/**
|
|
3691
|
+
* Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.
|
|
3692
|
+
*/
|
|
3693
|
+
this.isSelectorOpenChange = new i0.EventEmitter();
|
|
3513
3694
|
this.eventHandler = function (event) {
|
|
3514
3695
|
var _a;
|
|
3515
3696
|
if (!((_a = _this.selectorContainer) === null || _a === void 0 ? void 0 : _a.nativeElement.contains(event.target))) {
|
|
@@ -3623,12 +3804,12 @@
|
|
|
3623
3804
|
type: i0.Input
|
|
3624
3805
|
}], isSelectorOpen: [{
|
|
3625
3806
|
type: i0.Input
|
|
3626
|
-
}], isSelectorOpenChange: [{
|
|
3627
|
-
type: i0.Output
|
|
3628
3807
|
}], latestReactions: [{
|
|
3629
3808
|
type: i0.Input
|
|
3630
3809
|
}], ownReactions: [{
|
|
3631
3810
|
type: i0.Input
|
|
3811
|
+
}], isSelectorOpenChange: [{
|
|
3812
|
+
type: i0.Output
|
|
3632
3813
|
}], selectorContainer: [{
|
|
3633
3814
|
type: i0.ViewChild,
|
|
3634
3815
|
args: ['selectorContainer']
|
|
@@ -3637,11 +3818,20 @@
|
|
|
3637
3818
|
args: ['selectorTooltip']
|
|
3638
3819
|
}] } });
|
|
3639
3820
|
|
|
3821
|
+
/**
|
|
3822
|
+
* The `Message` component displays a message with additional information such as sender and date, and enables [interaction with the message (i.e. edit or react)](../concepts/message-interactions.mdx).
|
|
3823
|
+
*/
|
|
3640
3824
|
var MessageComponent = /** @class */ (function () {
|
|
3641
3825
|
function MessageComponent(chatClientService, channelService) {
|
|
3642
3826
|
this.chatClientService = chatClientService;
|
|
3643
3827
|
this.channelService = channelService;
|
|
3828
|
+
/**
|
|
3829
|
+
* The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
|
|
3830
|
+
*/
|
|
3644
3831
|
this.enabledMessageActions = [];
|
|
3832
|
+
/**
|
|
3833
|
+
* Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
|
|
3834
|
+
*/
|
|
3645
3835
|
this.mode = 'main';
|
|
3646
3836
|
this.isActionBoxOpen = false;
|
|
3647
3837
|
this.isReactionSelectorOpen = false;
|
|
@@ -3878,13 +4068,25 @@
|
|
|
3878
4068
|
args: ['container']
|
|
3879
4069
|
}] } });
|
|
3880
4070
|
|
|
4071
|
+
/**
|
|
4072
|
+
* The `Textarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.
|
|
4073
|
+
*/
|
|
3881
4074
|
var TextareaComponent = /** @class */ (function () {
|
|
3882
4075
|
function TextareaComponent(emojiInputService) {
|
|
3883
4076
|
var _this = this;
|
|
3884
4077
|
this.emojiInputService = emojiInputService;
|
|
3885
4078
|
this.class = 'str-chat__textarea';
|
|
4079
|
+
/**
|
|
4080
|
+
* The value of the input HTML element.
|
|
4081
|
+
*/
|
|
3886
4082
|
this.value = '';
|
|
4083
|
+
/**
|
|
4084
|
+
* Emits the current value of the input element when a user types.
|
|
4085
|
+
*/
|
|
3887
4086
|
this.valueChange = new i0.EventEmitter();
|
|
4087
|
+
/**
|
|
4088
|
+
* Emits when a user triggers a message send event (this happens when they hit the `Enter` key).
|
|
4089
|
+
*/
|
|
3888
4090
|
this.send = new i0.EventEmitter();
|
|
3889
4091
|
this.subscriptions = [];
|
|
3890
4092
|
this.subscriptions.push(this.emojiInputService.emojiInput$.subscribe(function (emoji) {
|
|
@@ -3957,6 +4159,9 @@
|
|
|
3957
4159
|
args: [{ providedIn: 'root' }]
|
|
3958
4160
|
}], ctorParameters: function () { return []; } });
|
|
3959
4161
|
|
|
4162
|
+
/**
|
|
4163
|
+
* The `AutocompleteTextarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.
|
|
4164
|
+
*/
|
|
3960
4165
|
var AutocompleteTextareaComponent = /** @class */ (function () {
|
|
3961
4166
|
function AutocompleteTextareaComponent(channelService, chatClientService, transliterationService, emojiInputService) {
|
|
3962
4167
|
var _this = this;
|
|
@@ -3965,11 +4170,29 @@
|
|
|
3965
4170
|
this.transliterationService = transliterationService;
|
|
3966
4171
|
this.emojiInputService = emojiInputService;
|
|
3967
4172
|
this.class = 'str-chat__textarea';
|
|
4173
|
+
/**
|
|
4174
|
+
* The value of the input HTML element.
|
|
4175
|
+
*/
|
|
3968
4176
|
this.value = '';
|
|
4177
|
+
/**
|
|
4178
|
+
* If true, users can mention other users in messages. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.
|
|
4179
|
+
*/
|
|
3969
4180
|
this.areMentionsEnabled = true;
|
|
4181
|
+
/**
|
|
4182
|
+
* The scope for user mentions, either members of the current channel of members of the application. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.
|
|
4183
|
+
*/
|
|
3970
4184
|
this.mentionScope = 'channel';
|
|
4185
|
+
/**
|
|
4186
|
+
* Emits the current value of the input element when a user types.
|
|
4187
|
+
*/
|
|
3971
4188
|
this.valueChange = new i0.EventEmitter();
|
|
4189
|
+
/**
|
|
4190
|
+
* Emits when a user triggers a message send event (this happens when they hit the `Enter` key).
|
|
4191
|
+
*/
|
|
3972
4192
|
this.send = new i0.EventEmitter();
|
|
4193
|
+
/**
|
|
4194
|
+
* Emits the array of users that are mentioned in the message, it is updated when a user mentions a new user or deletes a mention.
|
|
4195
|
+
*/
|
|
3973
4196
|
this.userMentions = new i0.EventEmitter();
|
|
3974
4197
|
this.autocompleteKey = 'autocompleteLabel';
|
|
3975
4198
|
this.mentionTriggerChar = '@';
|
|
@@ -4209,6 +4432,9 @@
|
|
|
4209
4432
|
date1.getDate() === date2.getDate());
|
|
4210
4433
|
};
|
|
4211
4434
|
|
|
4435
|
+
/**
|
|
4436
|
+
* The `MessageList` component renders a scrollable list of messages.
|
|
4437
|
+
*/
|
|
4212
4438
|
var MessageListComponent = /** @class */ (function () {
|
|
4213
4439
|
function MessageListComponent(channelService, chatClientService, imageLoadService) {
|
|
4214
4440
|
var _this = this;
|
|
@@ -4216,14 +4442,17 @@
|
|
|
4216
4442
|
this.chatClientService = chatClientService;
|
|
4217
4443
|
this.imageLoadService = imageLoadService;
|
|
4218
4444
|
/**
|
|
4219
|
-
* @deprecated https://getstream.io/chat/docs/
|
|
4445
|
+
* @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead. If true, the message reactions are displayed. Users can also react to messages if they have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
|
|
4220
4446
|
*/
|
|
4221
4447
|
this.areReactionsEnabled = undefined;
|
|
4222
4448
|
/**
|
|
4223
|
-
* @deprecated https://getstream.io/chat/docs/
|
|
4449
|
+
* @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead. The list of [actions that are enabled](./MessageActionsBoxComponent.mdx), please note that the user also has to have the necessary [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) for actions to work. Unathorized actions won't be displayed on the UI. The `MessgaeList` component makes the necessary checks before passing the actions to the `Message` component.
|
|
4224
4450
|
*/
|
|
4225
4451
|
/* eslint-disable-next-line @angular-eslint/no-input-rename */
|
|
4226
4452
|
this.enabledMessageActionsInput = undefined;
|
|
4453
|
+
/**
|
|
4454
|
+
* Determines if the message list should display channel messages or [thread messages](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
|
|
4455
|
+
*/
|
|
4227
4456
|
this.mode = 'main';
|
|
4228
4457
|
this.enabledMessageActions = [];
|
|
4229
4458
|
this.class = 'str-chat-angular__main-panel-inner str-chat-angular__message-list-host';
|
|
@@ -4487,6 +4716,9 @@
|
|
|
4487
4716
|
args: ['parentMessageElement']
|
|
4488
4717
|
}] } });
|
|
4489
4718
|
|
|
4719
|
+
/**
|
|
4720
|
+
* The `Thread` component represents a [message thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript), it is a container component that displays a thread with a header, [`MessageList`](./MessageListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components.
|
|
4721
|
+
*/
|
|
4490
4722
|
var ThreadComponent = /** @class */ (function () {
|
|
4491
4723
|
function ThreadComponent(channelService) {
|
|
4492
4724
|
var _this = this;
|