stream-chat-angular 2.13.1 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +472 -134
- 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 +89 -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/emoji-input.service.js +3 -3
- package/esm2015/lib/message-input/message-input-config.service.js +2 -2
- package/esm2015/lib/message-input/message-input.component.js +74 -10
- package/esm2015/lib/message-input/textarea/textarea.component.js +13 -1
- package/esm2015/lib/message-list/message-list.component.js +26 -7
- 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 +339 -37
- 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 +34 -1
- 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/emoji-input.service.d.ts +2 -2
- package/lib/message-input/message-input-config.service.d.ts +1 -1
- package/lib/message-input/message-input.component.d.ts +44 -2
- package/lib/message-input/textarea/textarea.component.d.ts +12 -0
- package/lib/message-list/message-list.component.d.ts +30 -4
- 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 +1 -1
- package/src/assets/version.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('stream-chat'), require('rxjs/operators'), require('uuid'), require('@ngx-translate/core'), require('@angular/common'), require('pretty-bytes'), require('dayjs'), require('dayjs/plugin/calendar'), require('emoji-regex'), require('@stream-io/transliterate'), require('angular-mentions')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('stream-chat-angular', ['exports', '@angular/core', 'rxjs', 'stream-chat', 'rxjs/operators', 'uuid', '@ngx-translate/core', '@angular/common', 'pretty-bytes', 'dayjs', 'dayjs/plugin/calendar', 'emoji-regex', '@stream-io/transliterate', 'angular-mentions'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['stream-chat-angular'] = {}, global.ng.core, global.rxjs, global.streamChat, global.rxjs.operators, global.uuid, global.i2, global.ng.common, global.prettybytes, global.Dayjs, global.calendar, global.emojiRegex, global.transliterate, global.i6));
|
|
5
|
-
}(this, (function (exports, i0, rxjs, streamChat, operators, uuid, i2,
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['stream-chat-angular'] = {}, global.ng.core, global.rxjs, global.streamChat, global.rxjs.operators, global.uuid, global.i2, global.ng.common, global.prettybytes, global.Dayjs, global.calendar, global.emojiRegex, global.transliterate, global.i6$1));
|
|
5
|
+
}(this, (function (exports, i0, rxjs, streamChat, operators, uuid, i2, i6, prettybytes, Dayjs, calendar, emojiRegex, transliterate, i6$1) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
|
|
29
29
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
30
30
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
31
|
-
var
|
|
31
|
+
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
32
32
|
var prettybytes__default = /*#__PURE__*/_interopDefaultLegacy(prettybytes);
|
|
33
33
|
var Dayjs__default = /*#__PURE__*/_interopDefaultLegacy(Dayjs);
|
|
34
34
|
var calendar__default = /*#__PURE__*/_interopDefaultLegacy(calendar);
|
|
35
35
|
var emojiRegex__default = /*#__PURE__*/_interopDefaultLegacy(emojiRegex);
|
|
36
36
|
var transliterate__default = /*#__PURE__*/_interopDefaultLegacy(transliterate);
|
|
37
|
-
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
37
|
+
var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
|
|
38
38
|
|
|
39
39
|
/*! *****************************************************************************
|
|
40
40
|
Copyright (c) Microsoft Corporation.
|
|
@@ -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.0';
|
|
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,8 +635,11 @@
|
|
|
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);
|
|
641
|
+
this.usersTypingInChannelSubject = new rxjs.BehaviorSubject([]);
|
|
642
|
+
this.usersTypingInThreadSubject = new rxjs.BehaviorSubject([]);
|
|
640
643
|
this.channelListSetter = function (channels) {
|
|
641
644
|
_this.channelsSubject.next(channels);
|
|
642
645
|
};
|
|
@@ -665,8 +668,8 @@
|
|
|
665
668
|
this.activeParentMessage$ = rxjs.combineLatest([
|
|
666
669
|
this.activeChannelMessages$,
|
|
667
670
|
this.activeParentMessageId$,
|
|
668
|
-
]).pipe(operators.map(function (
|
|
669
|
-
var
|
|
671
|
+
]).pipe(operators.map(function (_h) {
|
|
672
|
+
var _j = __read(_h, 2), messages = _j[0], parentMessageId = _j[1];
|
|
670
673
|
if (!parentMessageId) {
|
|
671
674
|
return undefined;
|
|
672
675
|
}
|
|
@@ -680,6 +683,11 @@
|
|
|
680
683
|
.subscribe(function () {
|
|
681
684
|
void _this.setAsActiveParentMessage(undefined);
|
|
682
685
|
});
|
|
686
|
+
this.usersTypingInChannel$ =
|
|
687
|
+
this.usersTypingInChannelSubject.asObservable();
|
|
688
|
+
this.usersTypingInThread$ = this.usersTypingInThreadSubject.asObservable();
|
|
689
|
+
this.latestMessageDateByUserByChannels$ =
|
|
690
|
+
this.latestMessageDateByUserByChannelsSubject.asObservable();
|
|
683
691
|
}
|
|
684
692
|
/**
|
|
685
693
|
* Sets the given `channel` as active.
|
|
@@ -709,8 +717,8 @@
|
|
|
709
717
|
var _a;
|
|
710
718
|
return __awaiter(this, void 0, void 0, function () {
|
|
711
719
|
var messageToQuote, activeChannel, result;
|
|
712
|
-
return __generator(this, function (
|
|
713
|
-
switch (
|
|
720
|
+
return __generator(this, function (_h) {
|
|
721
|
+
switch (_h.label) {
|
|
714
722
|
case 0:
|
|
715
723
|
messageToQuote = this.messageToQuoteSubject.getValue();
|
|
716
724
|
if (messageToQuote && !!messageToQuote.parent_id) {
|
|
@@ -727,9 +735,9 @@
|
|
|
727
735
|
limit: (_a = this.options) === null || _a === void 0 ? void 0 : _a.message_limit,
|
|
728
736
|
}))];
|
|
729
737
|
case 2:
|
|
730
|
-
result =
|
|
738
|
+
result = _h.sent();
|
|
731
739
|
this.activeThreadMessagesSubject.next((result === null || result === void 0 ? void 0 : result.messages) || []);
|
|
732
|
-
|
|
740
|
+
_h.label = 3;
|
|
733
741
|
case 3: return [2 /*return*/];
|
|
734
742
|
}
|
|
735
743
|
});
|
|
@@ -742,8 +750,8 @@
|
|
|
742
750
|
var _a, _b, _c, _d, _e;
|
|
743
751
|
return __awaiter(this, void 0, void 0, function () {
|
|
744
752
|
var activeChnannel, lastMessageId;
|
|
745
|
-
return __generator(this, function (
|
|
746
|
-
switch (
|
|
753
|
+
return __generator(this, function (_h) {
|
|
754
|
+
switch (_h.label) {
|
|
747
755
|
case 0:
|
|
748
756
|
activeChnannel = this.activeChannelSubject.getValue();
|
|
749
757
|
lastMessageId = (_a = this.activeChannelMessagesSubject.getValue()[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
@@ -753,7 +761,7 @@
|
|
|
753
761
|
watchers: { limit: 0 },
|
|
754
762
|
}))];
|
|
755
763
|
case 1:
|
|
756
|
-
|
|
764
|
+
_h.sent();
|
|
757
765
|
if (((_c = activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.data) === null || _c === void 0 ? void 0 : _c.id) ===
|
|
758
766
|
((_e = (_d = this.activeChannelSubject.getValue()) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.id)) {
|
|
759
767
|
this.activeChannelMessagesSubject.next(__spreadArray([], __read(activeChnannel.state.messages)));
|
|
@@ -770,8 +778,8 @@
|
|
|
770
778
|
var _a, _b;
|
|
771
779
|
return __awaiter(this, void 0, void 0, function () {
|
|
772
780
|
var activeChnannel, parentMessageId, lastMessageId;
|
|
773
|
-
return __generator(this, function (
|
|
774
|
-
switch (
|
|
781
|
+
return __generator(this, function (_h) {
|
|
782
|
+
switch (_h.label) {
|
|
775
783
|
case 0:
|
|
776
784
|
activeChnannel = this.activeChannelSubject.getValue();
|
|
777
785
|
parentMessageId = this.activeParentMessageIdSubject.getValue();
|
|
@@ -784,7 +792,7 @@
|
|
|
784
792
|
id_lt: lastMessageId,
|
|
785
793
|
}))];
|
|
786
794
|
case 1:
|
|
787
|
-
|
|
795
|
+
_h.sent();
|
|
788
796
|
this.activeThreadMessagesSubject.next((activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.state.threads[parentMessageId]) || []);
|
|
789
797
|
return [2 /*return*/];
|
|
790
798
|
}
|
|
@@ -800,8 +808,8 @@
|
|
|
800
808
|
ChannelService.prototype.init = function (filters, sort, options) {
|
|
801
809
|
return __awaiter(this, void 0, void 0, function () {
|
|
802
810
|
var _this = this;
|
|
803
|
-
return __generator(this, function (
|
|
804
|
-
switch (
|
|
811
|
+
return __generator(this, function (_h) {
|
|
812
|
+
switch (_h.label) {
|
|
805
813
|
case 0:
|
|
806
814
|
this.filters = filters;
|
|
807
815
|
this.options = options || {
|
|
@@ -815,7 +823,7 @@
|
|
|
815
823
|
this.sort = sort || { last_message_at: -1, updated_at: -1 };
|
|
816
824
|
return [4 /*yield*/, this.queryChannels()];
|
|
817
825
|
case 1:
|
|
818
|
-
|
|
826
|
+
_h.sent();
|
|
819
827
|
this.chatClientService.notification$.subscribe(function (notification) { return void _this.handleNotification(notification); });
|
|
820
828
|
return [2 /*return*/];
|
|
821
829
|
}
|
|
@@ -823,7 +831,7 @@
|
|
|
823
831
|
});
|
|
824
832
|
};
|
|
825
833
|
/**
|
|
826
|
-
* 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).
|
|
827
835
|
*/
|
|
828
836
|
ChannelService.prototype.reset = function () {
|
|
829
837
|
this.activeChannelMessagesSubject.next([]);
|
|
@@ -831,6 +839,7 @@
|
|
|
831
839
|
this.activeParentMessageIdSubject.next(undefined);
|
|
832
840
|
this.activeThreadMessagesSubject.next([]);
|
|
833
841
|
this.channelsSubject.next(undefined);
|
|
842
|
+
this.latestMessageDateByUserByChannelsSubject.next({});
|
|
834
843
|
this.selectMessageToQuote(undefined);
|
|
835
844
|
};
|
|
836
845
|
/**
|
|
@@ -838,13 +847,13 @@
|
|
|
838
847
|
*/
|
|
839
848
|
ChannelService.prototype.loadMoreChannels = function () {
|
|
840
849
|
return __awaiter(this, void 0, void 0, function () {
|
|
841
|
-
return __generator(this, function (
|
|
842
|
-
switch (
|
|
850
|
+
return __generator(this, function (_h) {
|
|
851
|
+
switch (_h.label) {
|
|
843
852
|
case 0:
|
|
844
853
|
this.options.offset = this.channels.length;
|
|
845
854
|
return [4 /*yield*/, this.queryChannels()];
|
|
846
855
|
case 1:
|
|
847
|
-
|
|
856
|
+
_h.sent();
|
|
848
857
|
return [2 /*return*/];
|
|
849
858
|
}
|
|
850
859
|
});
|
|
@@ -858,13 +867,13 @@
|
|
|
858
867
|
ChannelService.prototype.addReaction = function (messageId, reactionType) {
|
|
859
868
|
var _a;
|
|
860
869
|
return __awaiter(this, void 0, void 0, function () {
|
|
861
|
-
return __generator(this, function (
|
|
862
|
-
switch (
|
|
870
|
+
return __generator(this, function (_h) {
|
|
871
|
+
switch (_h.label) {
|
|
863
872
|
case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject.getValue()) === null || _a === void 0 ? void 0 : _a.sendReaction(messageId, {
|
|
864
873
|
type: reactionType,
|
|
865
874
|
}))];
|
|
866
875
|
case 1:
|
|
867
|
-
|
|
876
|
+
_h.sent();
|
|
868
877
|
return [2 /*return*/];
|
|
869
878
|
}
|
|
870
879
|
});
|
|
@@ -878,12 +887,12 @@
|
|
|
878
887
|
ChannelService.prototype.removeReaction = function (messageId, reactionType) {
|
|
879
888
|
var _a;
|
|
880
889
|
return __awaiter(this, void 0, void 0, function () {
|
|
881
|
-
return __generator(this, function (
|
|
882
|
-
switch (
|
|
890
|
+
return __generator(this, function (_h) {
|
|
891
|
+
switch (_h.label) {
|
|
883
892
|
case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject
|
|
884
893
|
.getValue()) === null || _a === void 0 ? void 0 : _a.deleteReaction(messageId, reactionType))];
|
|
885
894
|
case 1:
|
|
886
|
-
|
|
895
|
+
_h.sent();
|
|
887
896
|
return [2 /*return*/];
|
|
888
897
|
}
|
|
889
898
|
});
|
|
@@ -904,8 +913,8 @@
|
|
|
904
913
|
if (quotedMessageId === void 0) { quotedMessageId = undefined; }
|
|
905
914
|
return __awaiter(this, void 0, void 0, function () {
|
|
906
915
|
var preview, channel;
|
|
907
|
-
return __generator(this, function (
|
|
908
|
-
switch (
|
|
916
|
+
return __generator(this, function (_h) {
|
|
917
|
+
switch (_h.label) {
|
|
909
918
|
case 0:
|
|
910
919
|
preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers, parentId, quotedMessageId);
|
|
911
920
|
channel = this.activeChannelSubject.getValue();
|
|
@@ -913,7 +922,7 @@
|
|
|
913
922
|
channel.state.addMessageSorted(preview, true);
|
|
914
923
|
return [4 /*yield*/, this.sendMessageRequest(preview)];
|
|
915
924
|
case 1:
|
|
916
|
-
|
|
925
|
+
_h.sent();
|
|
917
926
|
return [2 /*return*/];
|
|
918
927
|
}
|
|
919
928
|
});
|
|
@@ -926,14 +935,14 @@
|
|
|
926
935
|
ChannelService.prototype.resendMessage = function (message) {
|
|
927
936
|
return __awaiter(this, void 0, void 0, function () {
|
|
928
937
|
var channel;
|
|
929
|
-
return __generator(this, function (
|
|
930
|
-
switch (
|
|
938
|
+
return __generator(this, function (_h) {
|
|
939
|
+
switch (_h.label) {
|
|
931
940
|
case 0:
|
|
932
941
|
channel = this.activeChannelSubject.getValue();
|
|
933
942
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, message), { errorStatusCode: undefined, status: 'sending' }), true);
|
|
934
943
|
return [4 /*yield*/, this.sendMessageRequest(message)];
|
|
935
944
|
case 1:
|
|
936
|
-
|
|
945
|
+
_h.sent();
|
|
937
946
|
return [2 /*return*/];
|
|
938
947
|
}
|
|
939
948
|
});
|
|
@@ -945,11 +954,11 @@
|
|
|
945
954
|
*/
|
|
946
955
|
ChannelService.prototype.updateMessage = function (message) {
|
|
947
956
|
return __awaiter(this, void 0, void 0, function () {
|
|
948
|
-
return __generator(this, function (
|
|
949
|
-
switch (
|
|
957
|
+
return __generator(this, function (_h) {
|
|
958
|
+
switch (_h.label) {
|
|
950
959
|
case 0: return [4 /*yield*/, this.chatClientService.chatClient.updateMessage(message)];
|
|
951
960
|
case 1:
|
|
952
|
-
|
|
961
|
+
_h.sent();
|
|
953
962
|
return [2 /*return*/];
|
|
954
963
|
}
|
|
955
964
|
});
|
|
@@ -961,11 +970,11 @@
|
|
|
961
970
|
*/
|
|
962
971
|
ChannelService.prototype.deleteMessage = function (message) {
|
|
963
972
|
return __awaiter(this, void 0, void 0, function () {
|
|
964
|
-
return __generator(this, function (
|
|
965
|
-
switch (
|
|
973
|
+
return __generator(this, function (_h) {
|
|
974
|
+
switch (_h.label) {
|
|
966
975
|
case 0: return [4 /*yield*/, this.chatClientService.chatClient.deleteMessage(message.id)];
|
|
967
976
|
case 1:
|
|
968
|
-
|
|
977
|
+
_h.sent();
|
|
969
978
|
return [2 /*return*/];
|
|
970
979
|
}
|
|
971
980
|
});
|
|
@@ -979,8 +988,8 @@
|
|
|
979
988
|
ChannelService.prototype.uploadAttachments = function (uploads) {
|
|
980
989
|
return __awaiter(this, void 0, void 0, function () {
|
|
981
990
|
var result, channel, uploadResults;
|
|
982
|
-
return __generator(this, function (
|
|
983
|
-
switch (
|
|
991
|
+
return __generator(this, function (_h) {
|
|
992
|
+
switch (_h.label) {
|
|
984
993
|
case 0:
|
|
985
994
|
result = [];
|
|
986
995
|
channel = this.activeChannelSubject.getValue();
|
|
@@ -988,7 +997,7 @@
|
|
|
988
997
|
? channel.sendImage(upload.file)
|
|
989
998
|
: channel.sendFile(upload.file); }))];
|
|
990
999
|
case 1:
|
|
991
|
-
uploadResults =
|
|
1000
|
+
uploadResults = _h.sent();
|
|
992
1001
|
uploadResults.forEach(function (uploadResult, i) {
|
|
993
1002
|
var file = uploads[i].file;
|
|
994
1003
|
var type = uploads[i].type;
|
|
@@ -1016,15 +1025,15 @@
|
|
|
1016
1025
|
ChannelService.prototype.deleteAttachment = function (attachmentUpload) {
|
|
1017
1026
|
return __awaiter(this, void 0, void 0, function () {
|
|
1018
1027
|
var channel;
|
|
1019
|
-
return __generator(this, function (
|
|
1020
|
-
switch (
|
|
1028
|
+
return __generator(this, function (_h) {
|
|
1029
|
+
switch (_h.label) {
|
|
1021
1030
|
case 0:
|
|
1022
1031
|
channel = this.activeChannelSubject.getValue();
|
|
1023
1032
|
return [4 /*yield*/, (attachmentUpload.type === 'image'
|
|
1024
1033
|
? channel.deleteImage(attachmentUpload.url)
|
|
1025
1034
|
: channel.deleteFile(attachmentUpload.url))];
|
|
1026
1035
|
case 1:
|
|
1027
|
-
|
|
1036
|
+
_h.sent();
|
|
1028
1037
|
return [2 /*return*/];
|
|
1029
1038
|
}
|
|
1030
1039
|
});
|
|
@@ -1039,8 +1048,8 @@
|
|
|
1039
1048
|
return __awaiter(this, void 0, void 0, function () {
|
|
1040
1049
|
var activeChannel, result;
|
|
1041
1050
|
var _this = this;
|
|
1042
|
-
return __generator(this, function (
|
|
1043
|
-
switch (
|
|
1051
|
+
return __generator(this, function (_h) {
|
|
1052
|
+
switch (_h.label) {
|
|
1044
1053
|
case 0:
|
|
1045
1054
|
activeChannel = this.activeChannelSubject.getValue();
|
|
1046
1055
|
if (!activeChannel) {
|
|
@@ -1057,7 +1066,7 @@
|
|
|
1057
1066
|
id: { $ne: this.chatClientService.chatClient.userID },
|
|
1058
1067
|
})];
|
|
1059
1068
|
case 2:
|
|
1060
|
-
result =
|
|
1069
|
+
result = _h.sent();
|
|
1061
1070
|
return [2 /*return*/, Object.values(result.members)];
|
|
1062
1071
|
}
|
|
1063
1072
|
});
|
|
@@ -1071,13 +1080,13 @@
|
|
|
1071
1080
|
ChannelService.prototype.sendAction = function (messageId, formData) {
|
|
1072
1081
|
return __awaiter(this, void 0, void 0, function () {
|
|
1073
1082
|
var channel, response, isThreadReply;
|
|
1074
|
-
return __generator(this, function (
|
|
1075
|
-
switch (
|
|
1083
|
+
return __generator(this, function (_h) {
|
|
1084
|
+
switch (_h.label) {
|
|
1076
1085
|
case 0:
|
|
1077
1086
|
channel = this.activeChannelSubject.getValue();
|
|
1078
1087
|
return [4 /*yield*/, channel.sendAction(messageId, formData)];
|
|
1079
1088
|
case 1:
|
|
1080
|
-
response =
|
|
1089
|
+
response = _h.sent();
|
|
1081
1090
|
if (response === null || response === void 0 ? void 0 : response.message) {
|
|
1082
1091
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, response.message), { status: 'received' }));
|
|
1083
1092
|
isThreadReply = !!response.message.parent_id;
|
|
@@ -1114,17 +1123,17 @@
|
|
|
1114
1123
|
var _a;
|
|
1115
1124
|
return __awaiter(this, void 0, void 0, function () {
|
|
1116
1125
|
var channel, isThreadReply, response, error_1, stringError, parsedError;
|
|
1117
|
-
return __generator(this, function (
|
|
1118
|
-
switch (
|
|
1126
|
+
return __generator(this, function (_h) {
|
|
1127
|
+
switch (_h.label) {
|
|
1119
1128
|
case 0:
|
|
1120
1129
|
channel = this.activeChannelSubject.getValue();
|
|
1121
1130
|
isThreadReply = !!preview.parent_id;
|
|
1122
1131
|
isThreadReply
|
|
1123
1132
|
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
1124
1133
|
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
1125
|
-
|
|
1134
|
+
_h.label = 1;
|
|
1126
1135
|
case 1:
|
|
1127
|
-
|
|
1136
|
+
_h.trys.push([1, 3, , 4]);
|
|
1128
1137
|
return [4 /*yield*/, channel.sendMessage({
|
|
1129
1138
|
text: preview.text,
|
|
1130
1139
|
attachments: preview.attachments,
|
|
@@ -1134,7 +1143,7 @@
|
|
|
1134
1143
|
quoted_message_id: preview.quoted_message_id,
|
|
1135
1144
|
})];
|
|
1136
1145
|
case 2:
|
|
1137
|
-
response =
|
|
1146
|
+
response = _h.sent();
|
|
1138
1147
|
if (response === null || response === void 0 ? void 0 : response.message) {
|
|
1139
1148
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, response.message), { status: 'received' }), true);
|
|
1140
1149
|
isThreadReply
|
|
@@ -1143,7 +1152,7 @@
|
|
|
1143
1152
|
}
|
|
1144
1153
|
return [3 /*break*/, 4];
|
|
1145
1154
|
case 3:
|
|
1146
|
-
error_1 =
|
|
1155
|
+
error_1 = _h.sent();
|
|
1147
1156
|
stringError = JSON.stringify(error_1);
|
|
1148
1157
|
parsedError = stringError
|
|
1149
1158
|
? JSON.parse(stringError)
|
|
@@ -1160,53 +1169,53 @@
|
|
|
1160
1169
|
};
|
|
1161
1170
|
ChannelService.prototype.handleNotification = function (notification) {
|
|
1162
1171
|
return __awaiter(this, void 0, void 0, function () {
|
|
1163
|
-
var
|
|
1172
|
+
var _h;
|
|
1164
1173
|
var _this = this;
|
|
1165
|
-
return __generator(this, function (
|
|
1166
|
-
switch (
|
|
1174
|
+
return __generator(this, function (_j) {
|
|
1175
|
+
switch (_j.label) {
|
|
1167
1176
|
case 0:
|
|
1168
|
-
|
|
1169
|
-
switch (
|
|
1177
|
+
_h = notification.eventType;
|
|
1178
|
+
switch (_h) {
|
|
1170
1179
|
case 'notification.message_new': return [3 /*break*/, 1];
|
|
1171
1180
|
case 'notification.added_to_channel': return [3 /*break*/, 3];
|
|
1172
1181
|
case 'notification.removed_from_channel': return [3 /*break*/, 5];
|
|
1173
1182
|
}
|
|
1174
1183
|
return [3 /*break*/, 6];
|
|
1175
1184
|
case 1: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1176
|
-
return __generator(this, function (
|
|
1177
|
-
switch (
|
|
1185
|
+
return __generator(this, function (_h) {
|
|
1186
|
+
switch (_h.label) {
|
|
1178
1187
|
case 0:
|
|
1179
1188
|
if (!this.customNewMessageNotificationHandler) return [3 /*break*/, 1];
|
|
1180
1189
|
this.customNewMessageNotificationHandler(notification, this.channelListSetter);
|
|
1181
1190
|
return [3 /*break*/, 3];
|
|
1182
1191
|
case 1: return [4 /*yield*/, this.handleNewMessageNotification(notification)];
|
|
1183
1192
|
case 2:
|
|
1184
|
-
|
|
1185
|
-
|
|
1193
|
+
_h.sent();
|
|
1194
|
+
_h.label = 3;
|
|
1186
1195
|
case 3: return [2 /*return*/];
|
|
1187
1196
|
}
|
|
1188
1197
|
});
|
|
1189
1198
|
}); })];
|
|
1190
1199
|
case 2:
|
|
1191
|
-
|
|
1200
|
+
_j.sent();
|
|
1192
1201
|
return [3 /*break*/, 6];
|
|
1193
1202
|
case 3: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1194
|
-
return __generator(this, function (
|
|
1195
|
-
switch (
|
|
1203
|
+
return __generator(this, function (_h) {
|
|
1204
|
+
switch (_h.label) {
|
|
1196
1205
|
case 0:
|
|
1197
1206
|
if (!this.customAddedToChannelNotificationHandler) return [3 /*break*/, 1];
|
|
1198
1207
|
this.customAddedToChannelNotificationHandler(notification, this.channelListSetter);
|
|
1199
1208
|
return [3 /*break*/, 3];
|
|
1200
1209
|
case 1: return [4 /*yield*/, this.handleAddedToChannelNotification(notification)];
|
|
1201
1210
|
case 2:
|
|
1202
|
-
|
|
1203
|
-
|
|
1211
|
+
_h.sent();
|
|
1212
|
+
_h.label = 3;
|
|
1204
1213
|
case 3: return [2 /*return*/];
|
|
1205
1214
|
}
|
|
1206
1215
|
});
|
|
1207
1216
|
}); })];
|
|
1208
1217
|
case 4:
|
|
1209
|
-
|
|
1218
|
+
_j.sent();
|
|
1210
1219
|
return [3 /*break*/, 6];
|
|
1211
1220
|
case 5:
|
|
1212
1221
|
{
|
|
@@ -1219,7 +1228,7 @@
|
|
|
1219
1228
|
}
|
|
1220
1229
|
});
|
|
1221
1230
|
}
|
|
1222
|
-
|
|
1231
|
+
_j.label = 6;
|
|
1223
1232
|
case 6: return [2 /*return*/];
|
|
1224
1233
|
}
|
|
1225
1234
|
});
|
|
@@ -1231,11 +1240,11 @@
|
|
|
1231
1240
|
};
|
|
1232
1241
|
ChannelService.prototype.handleNewMessageNotification = function (notification) {
|
|
1233
1242
|
return __awaiter(this, void 0, void 0, function () {
|
|
1234
|
-
return __generator(this, function (
|
|
1235
|
-
switch (
|
|
1243
|
+
return __generator(this, function (_h) {
|
|
1244
|
+
switch (_h.label) {
|
|
1236
1245
|
case 0: return [4 /*yield*/, this.addChannelFromNotification(notification)];
|
|
1237
1246
|
case 1:
|
|
1238
|
-
|
|
1247
|
+
_h.sent();
|
|
1239
1248
|
return [2 /*return*/];
|
|
1240
1249
|
}
|
|
1241
1250
|
});
|
|
@@ -1243,11 +1252,11 @@
|
|
|
1243
1252
|
};
|
|
1244
1253
|
ChannelService.prototype.handleAddedToChannelNotification = function (notification) {
|
|
1245
1254
|
return __awaiter(this, void 0, void 0, function () {
|
|
1246
|
-
return __generator(this, function (
|
|
1247
|
-
switch (
|
|
1255
|
+
return __generator(this, function (_h) {
|
|
1256
|
+
switch (_h.label) {
|
|
1248
1257
|
case 0: return [4 /*yield*/, this.addChannelFromNotification(notification)];
|
|
1249
1258
|
case 1:
|
|
1250
|
-
|
|
1259
|
+
_h.sent();
|
|
1251
1260
|
return [2 /*return*/];
|
|
1252
1261
|
}
|
|
1253
1262
|
});
|
|
@@ -1257,13 +1266,13 @@
|
|
|
1257
1266
|
var _a, _b;
|
|
1258
1267
|
return __awaiter(this, void 0, void 0, function () {
|
|
1259
1268
|
var channel;
|
|
1260
|
-
return __generator(this, function (
|
|
1261
|
-
switch (
|
|
1269
|
+
return __generator(this, function (_h) {
|
|
1270
|
+
switch (_h.label) {
|
|
1262
1271
|
case 0:
|
|
1263
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);
|
|
1264
1273
|
return [4 /*yield*/, channel.watch()];
|
|
1265
1274
|
case 1:
|
|
1266
|
-
|
|
1275
|
+
_h.sent();
|
|
1267
1276
|
this.watchForChannelEvents(channel);
|
|
1268
1277
|
this.channelsSubject.next(__spreadArray([
|
|
1269
1278
|
channel
|
|
@@ -1294,6 +1303,7 @@
|
|
|
1294
1303
|
void (c === null || c === void 0 ? void 0 : c.markRead());
|
|
1295
1304
|
}
|
|
1296
1305
|
});
|
|
1306
|
+
_this.updateLatestMessages(event);
|
|
1297
1307
|
});
|
|
1298
1308
|
}));
|
|
1299
1309
|
this.activeChannelSubscriptions.push(channel.on('message.updated', function (event) { return _this.messageUpdated(event); }));
|
|
@@ -1314,6 +1324,46 @@
|
|
|
1314
1324
|
_this.activeChannelMessagesSubject.next(_this.activeChannelMessagesSubject.getValue());
|
|
1315
1325
|
});
|
|
1316
1326
|
}));
|
|
1327
|
+
this.activeChannelSubscriptions.push(channel.on('typing.start', function (e) { return _this.ngZone.run(function () { return _this.handleTypingStartEvent(e); }); }));
|
|
1328
|
+
this.activeChannelSubscriptions.push(channel.on('typing.stop', function (e) { return _this.ngZone.run(function () { return _this.handleTypingStopEvent(e); }); }));
|
|
1329
|
+
};
|
|
1330
|
+
/**
|
|
1331
|
+
* Call this method if user started typing in the active channel
|
|
1332
|
+
* @param parentId The id of the parent message, if user is typing in a thread
|
|
1333
|
+
*/
|
|
1334
|
+
ChannelService.prototype.typingStarted = function (parentId) {
|
|
1335
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1336
|
+
var activeChannel;
|
|
1337
|
+
return __generator(this, function (_h) {
|
|
1338
|
+
switch (_h.label) {
|
|
1339
|
+
case 0:
|
|
1340
|
+
activeChannel = this.activeChannelSubject.getValue();
|
|
1341
|
+
return [4 /*yield*/, (activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.keystroke(parentId))];
|
|
1342
|
+
case 1:
|
|
1343
|
+
_h.sent();
|
|
1344
|
+
return [2 /*return*/];
|
|
1345
|
+
}
|
|
1346
|
+
});
|
|
1347
|
+
});
|
|
1348
|
+
};
|
|
1349
|
+
/**
|
|
1350
|
+
* Call this method if user stopped typing in the active channel
|
|
1351
|
+
* @param parentId The id of the parent message, if user were typing in a thread
|
|
1352
|
+
*/
|
|
1353
|
+
ChannelService.prototype.typingStopped = function (parentId) {
|
|
1354
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1355
|
+
var activeChannel;
|
|
1356
|
+
return __generator(this, function (_h) {
|
|
1357
|
+
switch (_h.label) {
|
|
1358
|
+
case 0:
|
|
1359
|
+
activeChannel = this.activeChannelSubject.getValue();
|
|
1360
|
+
return [4 /*yield*/, (activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.stopTyping(parentId))];
|
|
1361
|
+
case 1:
|
|
1362
|
+
_h.sent();
|
|
1363
|
+
return [2 /*return*/];
|
|
1364
|
+
}
|
|
1365
|
+
});
|
|
1366
|
+
});
|
|
1317
1367
|
};
|
|
1318
1368
|
ChannelService.prototype.messageUpdated = function (event) {
|
|
1319
1369
|
var _this = this;
|
|
@@ -1382,13 +1432,13 @@
|
|
|
1382
1432
|
return __awaiter(this, void 0, void 0, function () {
|
|
1383
1433
|
var channels, prevChannels, error_2;
|
|
1384
1434
|
var _this = this;
|
|
1385
|
-
return __generator(this, function (
|
|
1386
|
-
switch (
|
|
1435
|
+
return __generator(this, function (_h) {
|
|
1436
|
+
switch (_h.label) {
|
|
1387
1437
|
case 0:
|
|
1388
|
-
|
|
1438
|
+
_h.trys.push([0, 2, , 3]);
|
|
1389
1439
|
return [4 /*yield*/, this.chatClientService.chatClient.queryChannels(this.filters, this.sort, this.options)];
|
|
1390
1440
|
case 1:
|
|
1391
|
-
channels =
|
|
1441
|
+
channels = _h.sent();
|
|
1392
1442
|
channels.forEach(function (c) { return _this.watchForChannelEvents(c); });
|
|
1393
1443
|
prevChannels = this.channelsSubject.getValue() || [];
|
|
1394
1444
|
this.channelsSubject.next(__spreadArray(__spreadArray([], __read(prevChannels)), __read(channels)));
|
|
@@ -1398,7 +1448,7 @@
|
|
|
1398
1448
|
this.hasMoreChannelsSubject.next(channels.length >= this.options.limit);
|
|
1399
1449
|
return [3 /*break*/, 3];
|
|
1400
1450
|
case 2:
|
|
1401
|
-
error_2 =
|
|
1451
|
+
error_2 = _h.sent();
|
|
1402
1452
|
this.channelsSubject.error(error_2);
|
|
1403
1453
|
return [3 /*break*/, 3];
|
|
1404
1454
|
case 3: return [2 /*return*/];
|
|
@@ -1509,7 +1559,6 @@
|
|
|
1509
1559
|
}
|
|
1510
1560
|
}
|
|
1511
1561
|
};
|
|
1512
|
-
// truncate active thread as well
|
|
1513
1562
|
ChannelService.prototype.handleChannelTruncate = function (event) {
|
|
1514
1563
|
var _a, _b;
|
|
1515
1564
|
var channelIndex = this.channels.findIndex(function (c) { return c.cid === event.channel.cid; });
|
|
@@ -1560,6 +1609,61 @@
|
|
|
1560
1609
|
return Object.assign(Object.assign({}, formatMessage), { readBy: isThreadMessage ? [] : getReadBy(formatMessage, channel) });
|
|
1561
1610
|
}
|
|
1562
1611
|
};
|
|
1612
|
+
ChannelService.prototype.handleTypingStartEvent = function (event) {
|
|
1613
|
+
var _a, _b;
|
|
1614
|
+
if (((_a = event.user) === null || _a === void 0 ? void 0 : _a.id) === ((_b = this.chatClientService.chatClient.user) === null || _b === void 0 ? void 0 : _b.id)) {
|
|
1615
|
+
return;
|
|
1616
|
+
}
|
|
1617
|
+
var isTypingInThread = !!event.parent_id;
|
|
1618
|
+
if (isTypingInThread &&
|
|
1619
|
+
event.parent_id !== this.activeParentMessageIdSubject.getValue()) {
|
|
1620
|
+
return;
|
|
1621
|
+
}
|
|
1622
|
+
var subject = isTypingInThread
|
|
1623
|
+
? this.usersTypingInThreadSubject
|
|
1624
|
+
: this.usersTypingInChannelSubject;
|
|
1625
|
+
var users = subject.getValue();
|
|
1626
|
+
var user = event.user;
|
|
1627
|
+
if (user && !users.find(function (u) { return u.id === user.id; })) {
|
|
1628
|
+
users.push(user);
|
|
1629
|
+
subject.next(__spreadArray([], __read(users)));
|
|
1630
|
+
}
|
|
1631
|
+
};
|
|
1632
|
+
ChannelService.prototype.handleTypingStopEvent = function (event) {
|
|
1633
|
+
var usersTypingInChannel = this.usersTypingInChannelSubject.getValue();
|
|
1634
|
+
var usersTypingInThread = this.usersTypingInThreadSubject.getValue();
|
|
1635
|
+
var user = event.user;
|
|
1636
|
+
if (user && usersTypingInChannel.find(function (u) { return u.id === user.id; })) {
|
|
1637
|
+
usersTypingInChannel.splice(usersTypingInChannel.findIndex(function (u) { return u.id === user.id; }), 1);
|
|
1638
|
+
this.usersTypingInChannelSubject.next(__spreadArray([], __read(usersTypingInChannel)));
|
|
1639
|
+
return;
|
|
1640
|
+
}
|
|
1641
|
+
if (user && usersTypingInThread.find(function (u) { return u.id === user.id; })) {
|
|
1642
|
+
usersTypingInThread.splice(usersTypingInThread.findIndex(function (u) { return u.id === user.id; }), 1);
|
|
1643
|
+
this.usersTypingInThreadSubject.next(__spreadArray([], __read(usersTypingInThread)));
|
|
1644
|
+
return;
|
|
1645
|
+
}
|
|
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
|
+
};
|
|
1563
1667
|
return ChannelService;
|
|
1564
1668
|
}());
|
|
1565
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 });
|
|
@@ -2066,8 +2170,14 @@
|
|
|
2066
2170
|
}]
|
|
2067
2171
|
}], ctorParameters: function () { return [{ type: i2__namespace.TranslateService }]; } });
|
|
2068
2172
|
|
|
2173
|
+
/**
|
|
2174
|
+
* The `Avatar` component displays the provided image, with fallback to the first letter of the optional name input.
|
|
2175
|
+
*/
|
|
2069
2176
|
var AvatarComponent = /** @class */ (function () {
|
|
2070
2177
|
function AvatarComponent() {
|
|
2178
|
+
/**
|
|
2179
|
+
* The size in pixels of the avatar image.
|
|
2180
|
+
*/
|
|
2071
2181
|
this.size = 32;
|
|
2072
2182
|
this.isLoaded = false;
|
|
2073
2183
|
this.isError = false;
|
|
@@ -2083,7 +2193,7 @@
|
|
|
2083
2193
|
return AvatarComponent;
|
|
2084
2194
|
}());
|
|
2085
2195
|
AvatarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AvatarComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2086
|
-
AvatarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AvatarComponent, selector: "stream-avatar", inputs: { name: "name", imageUrl: "imageUrl", size: "size" }, ngImport: i0__namespace, template: "<div\n class=\"str-chat__avatar str-chat__avatar--circle\"\n title=\"{{ name }}\"\n [style]=\"{\n flexBasis: size + 'px',\n fontSize: size / 2 + 'px',\n height: size + 'px',\n lineHeight: size + 'px',\n width: size + 'px'\n }\"\n>\n <img\n *ngIf=\"imageUrl && !isError; else fallback\"\n class=\"str-chat__avatar-image str-chat__avatar-image{{\n isLoaded ? ' str-chat__avatar-image--loaded' : ''\n }}\"\n src=\"{{ imageUrl }}\"\n alt=\"{{ initials }}\"\n data-testid=\"avatar-img\"\n (load)=\"isLoaded = true\"\n (error)=\"isError = true\"\n [style]=\"{\n flexBasis: size + 'px',\n height: size + 'px',\n objectFit: 'cover',\n width: size + 'px'\n }\"\n />\n <ng-template #fallback>\n <div data-testid=\"fallback-img\" class=\"str-chat__avatar-fallback\">\n {{ initials }}\n </div>\n </ng-template>\n</div>\n", styles: [""], directives: [{ type:
|
|
2196
|
+
AvatarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AvatarComponent, selector: "stream-avatar", inputs: { name: "name", imageUrl: "imageUrl", size: "size" }, ngImport: i0__namespace, template: "<div\n class=\"str-chat__avatar str-chat__avatar--circle\"\n title=\"{{ name }}\"\n [style]=\"{\n flexBasis: size + 'px',\n fontSize: size / 2 + 'px',\n height: size + 'px',\n lineHeight: size + 'px',\n width: size + 'px'\n }\"\n>\n <img\n *ngIf=\"imageUrl && !isError; else fallback\"\n class=\"str-chat__avatar-image str-chat__avatar-image{{\n isLoaded ? ' str-chat__avatar-image--loaded' : ''\n }}\"\n src=\"{{ imageUrl }}\"\n alt=\"{{ initials }}\"\n data-testid=\"avatar-img\"\n (load)=\"isLoaded = true\"\n (error)=\"isError = true\"\n [style]=\"{\n flexBasis: size + 'px',\n height: size + 'px',\n objectFit: 'cover',\n width: size + 'px'\n }\"\n />\n <ng-template #fallback>\n <div data-testid=\"fallback-img\" class=\"str-chat__avatar-fallback\">\n {{ initials }}\n </div>\n </ng-template>\n</div>\n", styles: [""], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2087
2197
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AvatarComponent, decorators: [{
|
|
2088
2198
|
type: i0.Component,
|
|
2089
2199
|
args: [{
|
|
@@ -2099,13 +2209,16 @@
|
|
|
2099
2209
|
type: i0.Input
|
|
2100
2210
|
}] } });
|
|
2101
2211
|
|
|
2212
|
+
/**
|
|
2213
|
+
* The `Icon` component can be used to display different icons (i. e. message delivered icon).
|
|
2214
|
+
*/
|
|
2102
2215
|
var IconComponent = /** @class */ (function () {
|
|
2103
2216
|
function IconComponent() {
|
|
2104
2217
|
}
|
|
2105
2218
|
return IconComponent;
|
|
2106
2219
|
}());
|
|
2107
2220
|
IconComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: IconComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2108
|
-
IconComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: IconComponent, selector: "stream-icon", inputs: { icon: "icon", size: "size" }, ngImport: i0__namespace, template: "<svg\n data-testid=\"action-icon\"\n *ngIf=\"icon === 'action-icon'\"\n height=\"4\"\n viewBox=\"0 0 11 4\"\n width=\"11\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M1.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'delivered-icon'\"\n height=\"16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"delivered-icon\"\n>\n <path\n d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm3.72 6.633a.955.955 0 1 0-1.352-1.352L6.986 8.663 5.633 7.31A.956.956 0 1 0 4.28 8.663l2.029 2.028a.956.956 0 0 0 1.353 0l4.058-4.058z\"\n fill=\"#006CFF\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'reaction-icon'\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n width=\"12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reaction-icon\"\n>\n <g clipRule=\"evenodd\" fillRule=\"evenodd\">\n <path\n d=\"M6 1.2C3.3 1.2 1.2 3.3 1.2 6c0 2.7 2.1 4.8 4.8 4.8 2.7 0 4.8-2.1 4.8-4.8 0-2.7-2.1-4.8-4.8-4.8zM0 6c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6-6-2.7-6-6z\"\n ></path>\n <path\n d=\"M5.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM8.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM3.3 6.7c.3-.2.6-.1.8.1.3.4.8.9 1.5 1 .6.2 1.4.1 2.4-1 .2-.2.6-.3.8 0 .2.2.3.6 0 .8-1.1 1.3-2.4 1.7-3.5 1.5-1-.2-1.8-.9-2.2-1.5-.2-.3-.1-.7.2-.9z\"\n ></path>\n </g>\n</svg>\n<svg\n data-testid=\"connection-error\"\n *ngIf=\"icon === 'connection-error'\"\n width=\"78px\"\n height=\"78px\"\n viewBox=\"0 0 78 78\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <!-- Generator: Sketch 52.6 (67491) - http://www.bohemiancoding.com/sketch -->\n <title>Combined Shape</title>\n <desc>Created with Sketch.</desc>\n <g\n id=\"Interactions\"\n stroke=\"none\"\n stroke-width=\"1\"\n fill=\"none\"\n fill-rule=\"evenodd\"\n >\n <g\n id=\"Connection-Error-_-Connectivity\"\n transform=\"translate(-270.000000, -30.000000)\"\n fill=\"#CF1F25\"\n >\n <g\n id=\"109-network-connection\"\n transform=\"translate(270.000000, 30.000000)\"\n >\n <path\n d=\"M66.4609744,11.414231 C81.6225232,26.5757798 81.6225232,51.157545 66.4609744,66.3188467 C51.2994256,81.4803954 26.7176604,81.4803954 11.5563587,66.3188467 C-3.60519004,51.1572979 -3.60519004,26.5755327 11.5563587,11.414231 C26.7179075,-3.74731776 51.2996727,-3.74731776 66.4609744,11.414231 Z M54.7853215,45.8823776 L54.7853215,40.5882574 C54.7853215,39.613638 53.9952341,38.8235506 53.0206147,38.8235506 L44.9576695,38.8235506 L41.428256,42.3529641 L51.255555,42.3529641 L51.255555,45.8823776 L54.7853215,45.8823776 Z M40.6659027,43.1153174 L37.8988425,45.8823776 L40.6659027,45.8823776 L40.6659027,43.1153174 Z M51.1764962,56.4702653 L58.2353232,56.4702653 C59.2099355,56.4702653 60.00003,55.6801708 60.00003,54.7055585 L60.00003,51.176145 C60.00003,50.2015327 59.2099355,49.4114382 58.2353232,49.4114382 L51.1764962,49.4114382 C50.2018839,49.4114382 49.4117894,50.2015327 49.4117894,51.176145 L49.4117894,54.7055585 C49.4117894,55.6801708 50.2018839,56.4702653 51.1764962,56.4702653 Z M35.2941353,56.4702653 L42.3529624,56.4702653 C43.3275746,56.4702653 44.1176691,55.6801708 44.1176691,54.7055585 L44.1176691,51.176145 C44.1176691,50.2015327 43.3275746,49.4114382 42.3529624,49.4114382 L35.2941353,49.4114382 C34.319523,49.4114382 33.5294285,50.2015327 33.5294285,51.176145 L33.5294285,54.7055585 C33.5294285,55.6801708 34.319523,56.4702653 35.2941353,56.4702653 Z M56.6964989,19.0874231 C56.007381,18.3985134 54.8903216,18.3985134 54.2012036,19.087423 L45.882376,27.4062507 L45.882376,19.4117761 C45.882376,18.4371568 45.0922885,17.6470693 44.1176692,17.6470693 L33.5294286,17.6470693 C32.5548092,17.6470694 31.7647218,18.4371568 31.7647218,19.4117761 L31.7647218,30.0000167 C31.7647219,30.9746363 32.5548092,31.7647237 33.5294285,31.7647237 L41.5239031,31.7647237 L34.4650761,38.8235508 L24.7058947,38.8235508 C23.7312753,38.8235508 22.9411879,39.6136382 22.9411879,40.5882575 L22.9411879,45.8823778 L26.4706014,45.8823778 L26.4706014,42.3529643 L30.9356624,42.3529643 L23.8768354,49.4117914 L19.4117743,49.4117914 C18.4371549,49.4117914 17.6470675,50.2018788 17.6470675,51.1764981 L17.6470675,54.7059117 C17.6504049,54.9674302 17.7129076,55.2248042 17.8298886,55.4587302 L16.4456526,56.8429662 C15.7446193,57.5200453 15.7252005,58.6372282 16.4022825,59.3382615 C17.0793616,60.0392948 18.1965445,60.0587136 18.8975778,59.3816316 C18.9122847,59.3674273 18.9267436,59.3529684 18.940948,59.3382615 L56.6964963,21.5830662 C57.3856425,20.8939094 57.3856425,19.7765747 56.6964963,19.0874179 Z\"\n id=\"Combined-Shape\"\n ></path>\n </g>\n </g>\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'send'\"\n data-testid=\"send\"\n height=\"17\"\n viewBox=\"0 0 18 17\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Send</title>\n <path\n d=\"M0 17.015l17.333-8.508L0 0v6.617l12.417 1.89L0 10.397z\"\n fill=\"#006cff\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'file-upload'\"\n data-testid=\"file-upload\"\n height=\"14\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Attach files</title>\n <path\n d=\"M1.667.333h10.666c.737 0 1.334.597 1.334 1.334v10.666c0 .737-.597 1.334-1.334 1.334H1.667a1.333 1.333 0 0 1-1.334-1.334V1.667C.333.93.93.333 1.667.333zm2 1.334a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333zm-2 9.333v1.333h10.666v-4l-2-2-4 4-2-2L1.667 11z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n data-testid=\"retry\"\n *ngIf=\"icon === 'retry'\"\n width=\"22\"\n height=\"20\"\n viewBox=\"0 0 22 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M20 5.535V2a1 1 0 0 1 2 0v6a1 1 0 0 1-1 1h-6a1 1 0 0 1 0-2h3.638l-2.975-2.653a8 8 0 1 0 1.884 8.32 1 1 0 1 1 1.886.666A10 10 0 1 1 5.175 1.245c3.901-2.15 8.754-1.462 11.88 1.667L20 5.535z\"\n fill=\"#FFF\"\n fill-rule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'close'\"\n data-testid=\"close\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <defs>\n <path\n d=\"M465 5c5.53 0 10 4.47 10 10s-4.47 10-10 10-10-4.47-10-10 4.47-10 10-10zm3.59 5L465 13.59 461.41 10 460 11.41l3.59 3.59-3.59 3.59 1.41 1.41 3.59-3.59 3.59 3.59 1.41-1.41-3.59-3.59 3.59-3.59-1.41-1.41z\"\n id=\"b\"\n />\n <filter\n x=\"-30%\"\n y=\"-30%\"\n width=\"160%\"\n height=\"160%\"\n filterUnits=\"objectBoundingBox\"\n id=\"a\"\n >\n <feOffset in=\"SourceAlpha\" result=\"shadowOffsetOuter1\" />\n <feGaussianBlur\n stdDeviation=\"2\"\n in=\"shadowOffsetOuter1\"\n result=\"shadowBlurOuter1\"\n />\n <feColorMatrix\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0\"\n in=\"shadowBlurOuter1\"\n />\n </filter>\n </defs>\n <g transform=\"translate(-451 -1)\" fill-rule=\"nonzero\" fill=\"none\">\n <use fill=\"#000\" filter=\"url(#a)\" xlink:href=\"#b\" />\n <use fill=\"#FFF\" fill-rule=\"evenodd\" xlink:href=\"#b\" />\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'file'\"\n data-testid=\"file\"\n className=\"rfu-file-icon--small fa-file-fallback\"\n [attr.height]=\"size || 20\"\n [attr.width]=\"size || 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 384 512\"\n>\n <path\n d=\"M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z\"\n fill=\"#414D54\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'reply'\"\n data-testid=\"reply\"\n height=\"15\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M.56 10.946H.06l-.002-.498L.025.92a.5.5 0 1 1 1-.004l.032 9.029H9.06v-4l9 4.5-9 4.5v-4H.56z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n height=\"10\"\n width=\"10\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"close-no-outline\"\n *ngIf=\"icon === 'close-no-outline'\"\n>\n <path\n d=\"M9.916 1.027L8.973.084 5 4.058 1.027.084l-.943.943L4.058 5 .084 8.973l.943.943L5 5.942l3.973 3.974.943-.943L5.942 5z\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n height=\"10\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reply-in-thread\"\n *ngIf=\"icon === 'reply-in-thread'\"\n>\n <path\n d=\"M8.516 3c4.78 0 4.972 6.5 4.972 6.5-1.6-2.906-2.847-3.184-4.972-3.184v2.872L3.772 4.994 8.516.5V3zM.484 5l4.5-4.237v1.78L2.416 5l2.568 2.125v1.828L.484 5z\"\n fillRule=\"evenodd\"\n />\n</svg>\n", directives: [{ type:
|
|
2221
|
+
IconComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: IconComponent, selector: "stream-icon", inputs: { icon: "icon", size: "size" }, ngImport: i0__namespace, template: "<svg\n data-testid=\"action-icon\"\n *ngIf=\"icon === 'action-icon'\"\n height=\"4\"\n viewBox=\"0 0 11 4\"\n width=\"11\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M1.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'delivered-icon'\"\n height=\"16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"delivered-icon\"\n>\n <path\n d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm3.72 6.633a.955.955 0 1 0-1.352-1.352L6.986 8.663 5.633 7.31A.956.956 0 1 0 4.28 8.663l2.029 2.028a.956.956 0 0 0 1.353 0l4.058-4.058z\"\n fill=\"#006CFF\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'reaction-icon'\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n width=\"12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reaction-icon\"\n>\n <g clipRule=\"evenodd\" fillRule=\"evenodd\">\n <path\n d=\"M6 1.2C3.3 1.2 1.2 3.3 1.2 6c0 2.7 2.1 4.8 4.8 4.8 2.7 0 4.8-2.1 4.8-4.8 0-2.7-2.1-4.8-4.8-4.8zM0 6c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6-6-2.7-6-6z\"\n ></path>\n <path\n d=\"M5.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM8.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM3.3 6.7c.3-.2.6-.1.8.1.3.4.8.9 1.5 1 .6.2 1.4.1 2.4-1 .2-.2.6-.3.8 0 .2.2.3.6 0 .8-1.1 1.3-2.4 1.7-3.5 1.5-1-.2-1.8-.9-2.2-1.5-.2-.3-.1-.7.2-.9z\"\n ></path>\n </g>\n</svg>\n<svg\n data-testid=\"connection-error\"\n *ngIf=\"icon === 'connection-error'\"\n width=\"78px\"\n height=\"78px\"\n viewBox=\"0 0 78 78\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <!-- Generator: Sketch 52.6 (67491) - http://www.bohemiancoding.com/sketch -->\n <title>Combined Shape</title>\n <desc>Created with Sketch.</desc>\n <g\n id=\"Interactions\"\n stroke=\"none\"\n stroke-width=\"1\"\n fill=\"none\"\n fill-rule=\"evenodd\"\n >\n <g\n id=\"Connection-Error-_-Connectivity\"\n transform=\"translate(-270.000000, -30.000000)\"\n fill=\"#CF1F25\"\n >\n <g\n id=\"109-network-connection\"\n transform=\"translate(270.000000, 30.000000)\"\n >\n <path\n d=\"M66.4609744,11.414231 C81.6225232,26.5757798 81.6225232,51.157545 66.4609744,66.3188467 C51.2994256,81.4803954 26.7176604,81.4803954 11.5563587,66.3188467 C-3.60519004,51.1572979 -3.60519004,26.5755327 11.5563587,11.414231 C26.7179075,-3.74731776 51.2996727,-3.74731776 66.4609744,11.414231 Z M54.7853215,45.8823776 L54.7853215,40.5882574 C54.7853215,39.613638 53.9952341,38.8235506 53.0206147,38.8235506 L44.9576695,38.8235506 L41.428256,42.3529641 L51.255555,42.3529641 L51.255555,45.8823776 L54.7853215,45.8823776 Z M40.6659027,43.1153174 L37.8988425,45.8823776 L40.6659027,45.8823776 L40.6659027,43.1153174 Z M51.1764962,56.4702653 L58.2353232,56.4702653 C59.2099355,56.4702653 60.00003,55.6801708 60.00003,54.7055585 L60.00003,51.176145 C60.00003,50.2015327 59.2099355,49.4114382 58.2353232,49.4114382 L51.1764962,49.4114382 C50.2018839,49.4114382 49.4117894,50.2015327 49.4117894,51.176145 L49.4117894,54.7055585 C49.4117894,55.6801708 50.2018839,56.4702653 51.1764962,56.4702653 Z M35.2941353,56.4702653 L42.3529624,56.4702653 C43.3275746,56.4702653 44.1176691,55.6801708 44.1176691,54.7055585 L44.1176691,51.176145 C44.1176691,50.2015327 43.3275746,49.4114382 42.3529624,49.4114382 L35.2941353,49.4114382 C34.319523,49.4114382 33.5294285,50.2015327 33.5294285,51.176145 L33.5294285,54.7055585 C33.5294285,55.6801708 34.319523,56.4702653 35.2941353,56.4702653 Z M56.6964989,19.0874231 C56.007381,18.3985134 54.8903216,18.3985134 54.2012036,19.087423 L45.882376,27.4062507 L45.882376,19.4117761 C45.882376,18.4371568 45.0922885,17.6470693 44.1176692,17.6470693 L33.5294286,17.6470693 C32.5548092,17.6470694 31.7647218,18.4371568 31.7647218,19.4117761 L31.7647218,30.0000167 C31.7647219,30.9746363 32.5548092,31.7647237 33.5294285,31.7647237 L41.5239031,31.7647237 L34.4650761,38.8235508 L24.7058947,38.8235508 C23.7312753,38.8235508 22.9411879,39.6136382 22.9411879,40.5882575 L22.9411879,45.8823778 L26.4706014,45.8823778 L26.4706014,42.3529643 L30.9356624,42.3529643 L23.8768354,49.4117914 L19.4117743,49.4117914 C18.4371549,49.4117914 17.6470675,50.2018788 17.6470675,51.1764981 L17.6470675,54.7059117 C17.6504049,54.9674302 17.7129076,55.2248042 17.8298886,55.4587302 L16.4456526,56.8429662 C15.7446193,57.5200453 15.7252005,58.6372282 16.4022825,59.3382615 C17.0793616,60.0392948 18.1965445,60.0587136 18.8975778,59.3816316 C18.9122847,59.3674273 18.9267436,59.3529684 18.940948,59.3382615 L56.6964963,21.5830662 C57.3856425,20.8939094 57.3856425,19.7765747 56.6964963,19.0874179 Z\"\n id=\"Combined-Shape\"\n ></path>\n </g>\n </g>\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'send'\"\n data-testid=\"send\"\n height=\"17\"\n viewBox=\"0 0 18 17\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Send</title>\n <path\n d=\"M0 17.015l17.333-8.508L0 0v6.617l12.417 1.89L0 10.397z\"\n fill=\"#006cff\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'file-upload'\"\n data-testid=\"file-upload\"\n height=\"14\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Attach files</title>\n <path\n d=\"M1.667.333h10.666c.737 0 1.334.597 1.334 1.334v10.666c0 .737-.597 1.334-1.334 1.334H1.667a1.333 1.333 0 0 1-1.334-1.334V1.667C.333.93.93.333 1.667.333zm2 1.334a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333zm-2 9.333v1.333h10.666v-4l-2-2-4 4-2-2L1.667 11z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n data-testid=\"retry\"\n *ngIf=\"icon === 'retry'\"\n width=\"22\"\n height=\"20\"\n viewBox=\"0 0 22 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M20 5.535V2a1 1 0 0 1 2 0v6a1 1 0 0 1-1 1h-6a1 1 0 0 1 0-2h3.638l-2.975-2.653a8 8 0 1 0 1.884 8.32 1 1 0 1 1 1.886.666A10 10 0 1 1 5.175 1.245c3.901-2.15 8.754-1.462 11.88 1.667L20 5.535z\"\n fill=\"#FFF\"\n fill-rule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'close'\"\n data-testid=\"close\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <defs>\n <path\n d=\"M465 5c5.53 0 10 4.47 10 10s-4.47 10-10 10-10-4.47-10-10 4.47-10 10-10zm3.59 5L465 13.59 461.41 10 460 11.41l3.59 3.59-3.59 3.59 1.41 1.41 3.59-3.59 3.59 3.59 1.41-1.41-3.59-3.59 3.59-3.59-1.41-1.41z\"\n id=\"b\"\n />\n <filter\n x=\"-30%\"\n y=\"-30%\"\n width=\"160%\"\n height=\"160%\"\n filterUnits=\"objectBoundingBox\"\n id=\"a\"\n >\n <feOffset in=\"SourceAlpha\" result=\"shadowOffsetOuter1\" />\n <feGaussianBlur\n stdDeviation=\"2\"\n in=\"shadowOffsetOuter1\"\n result=\"shadowBlurOuter1\"\n />\n <feColorMatrix\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0\"\n in=\"shadowBlurOuter1\"\n />\n </filter>\n </defs>\n <g transform=\"translate(-451 -1)\" fill-rule=\"nonzero\" fill=\"none\">\n <use fill=\"#000\" filter=\"url(#a)\" xlink:href=\"#b\" />\n <use fill=\"#FFF\" fill-rule=\"evenodd\" xlink:href=\"#b\" />\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'file'\"\n data-testid=\"file\"\n className=\"rfu-file-icon--small fa-file-fallback\"\n [attr.height]=\"size || 20\"\n [attr.width]=\"size || 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 384 512\"\n>\n <path\n d=\"M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z\"\n fill=\"#414D54\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'reply'\"\n data-testid=\"reply\"\n height=\"15\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M.56 10.946H.06l-.002-.498L.025.92a.5.5 0 1 1 1-.004l.032 9.029H9.06v-4l9 4.5-9 4.5v-4H.56z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n height=\"10\"\n width=\"10\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"close-no-outline\"\n *ngIf=\"icon === 'close-no-outline'\"\n>\n <path\n d=\"M9.916 1.027L8.973.084 5 4.058 1.027.084l-.943.943L4.058 5 .084 8.973l.943.943L5 5.942l3.973 3.974.943-.943L5.942 5z\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n height=\"10\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reply-in-thread\"\n *ngIf=\"icon === 'reply-in-thread'\"\n>\n <path\n d=\"M8.516 3c4.78 0 4.972 6.5 4.972 6.5-1.6-2.906-2.847-3.184-4.972-3.184v2.872L3.772 4.994 8.516.5V3zM.484 5l4.5-4.237v1.78L2.416 5l2.568 2.125v1.828L.484 5z\"\n fillRule=\"evenodd\"\n />\n</svg>\n", directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }] });
|
|
2109
2222
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: IconComponent, decorators: [{
|
|
2110
2223
|
type: i0.Component,
|
|
2111
2224
|
args: [{
|
|
@@ -2119,15 +2232,24 @@
|
|
|
2119
2232
|
type: i0.Input
|
|
2120
2233
|
}] } });
|
|
2121
2234
|
|
|
2235
|
+
/**
|
|
2236
|
+
* The `LoadingIndicator` component displays a spinner to indicate that an action is in progress.
|
|
2237
|
+
*/
|
|
2122
2238
|
var LoadingIndicatorComponent = /** @class */ (function () {
|
|
2123
2239
|
function LoadingIndicatorComponent() {
|
|
2240
|
+
/**
|
|
2241
|
+
* The size of the indicator (in pixels)
|
|
2242
|
+
*/
|
|
2124
2243
|
this.size = 15;
|
|
2244
|
+
/**
|
|
2245
|
+
* The color of the indicator
|
|
2246
|
+
*/
|
|
2125
2247
|
this.color = '#006CFF';
|
|
2126
2248
|
}
|
|
2127
2249
|
return LoadingIndicatorComponent;
|
|
2128
2250
|
}());
|
|
2129
2251
|
LoadingIndicatorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: LoadingIndicatorComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2130
|
-
LoadingIndicatorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: { size: "size", color: "color" }, ngImport: i0__namespace, template: "<div class=\"str-chat__loading-indicator\">\n <svg\n [attr.height]=\"size\"\n viewBox=\"0 0 30 30\"\n [attr.width]=\"size\"\n data-testid=\"loading-indicator\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient id=\"a\" x1=\"50%\" x2=\"50%\" y1=\"0%\" y2=\"100%\">\n <stop offset=\"0%\" stop-color=\"#FFF\" stop-opacity=\"0\" />\n <stop\n data-testid=\"stop-color\"\n offset=\"100%\"\n [attr.stop-color]=\"color\"\n stop-opacity=\"1\"\n [ngStyle]=\"{ stopColor: color }\"\n />\n </linearGradient>\n </defs>\n <path\n d=\"M2.518 23.321l1.664-1.11A12.988 12.988 0 0 0 15 28c7.18 0 13-5.82 13-13S22.18 2 15 2V0c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-5.206 0-9.792-2.652-12.482-6.679z\"\n fill=\"url(#a)\"\n fillRule=\"evenodd\"\n />\n </svg>\n</div>\n", directives: [{ type:
|
|
2252
|
+
LoadingIndicatorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: { size: "size", color: "color" }, ngImport: i0__namespace, template: "<div class=\"str-chat__loading-indicator\">\n <svg\n [attr.height]=\"size\"\n viewBox=\"0 0 30 30\"\n [attr.width]=\"size\"\n data-testid=\"loading-indicator\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient id=\"a\" x1=\"50%\" x2=\"50%\" y1=\"0%\" y2=\"100%\">\n <stop offset=\"0%\" stop-color=\"#FFF\" stop-opacity=\"0\" />\n <stop\n data-testid=\"stop-color\"\n offset=\"100%\"\n [attr.stop-color]=\"color\"\n stop-opacity=\"1\"\n [ngStyle]=\"{ stopColor: color }\"\n />\n </linearGradient>\n </defs>\n <path\n d=\"M2.518 23.321l1.664-1.11A12.988 12.988 0 0 0 15 28c7.18 0 13-5.82 13-13S22.18 2 15 2V0c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-5.206 0-9.792-2.652-12.482-6.679z\"\n fill=\"url(#a)\"\n fillRule=\"evenodd\"\n />\n </svg>\n</div>\n", directives: [{ type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
2131
2253
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: LoadingIndicatorComponent, decorators: [{
|
|
2132
2254
|
type: i0.Component,
|
|
2133
2255
|
args: [{
|
|
@@ -2230,12 +2352,12 @@
|
|
|
2230
2352
|
}] } });
|
|
2231
2353
|
|
|
2232
2354
|
/**
|
|
2233
|
-
*
|
|
2355
|
+
* If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this service, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)
|
|
2234
2356
|
*/
|
|
2235
2357
|
var EmojiInputService = /** @class */ (function () {
|
|
2236
2358
|
function EmojiInputService() {
|
|
2237
2359
|
/**
|
|
2238
|
-
*
|
|
2360
|
+
* If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this Subject, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)
|
|
2239
2361
|
*/
|
|
2240
2362
|
this.emojiInput$ = new rxjs.Subject();
|
|
2241
2363
|
}
|
|
@@ -2251,7 +2373,7 @@
|
|
|
2251
2373
|
}], ctorParameters: function () { return []; } });
|
|
2252
2374
|
|
|
2253
2375
|
/**
|
|
2254
|
-
* 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.
|
|
2255
2377
|
*/
|
|
2256
2378
|
var MessageInputConfigService = /** @class */ (function () {
|
|
2257
2379
|
function MessageInputConfigService() {
|
|
@@ -2304,10 +2426,16 @@
|
|
|
2304
2426
|
}]
|
|
2305
2427
|
}], ctorParameters: function () { return []; } });
|
|
2306
2428
|
|
|
2429
|
+
/**
|
|
2430
|
+
* The `AttachmentList` compontent displays the attachments of a message
|
|
2431
|
+
*/
|
|
2307
2432
|
var AttachmentListComponent = /** @class */ (function () {
|
|
2308
2433
|
function AttachmentListComponent(imageLoadService, channelService) {
|
|
2309
2434
|
this.imageLoadService = imageLoadService;
|
|
2310
2435
|
this.channelService = channelService;
|
|
2436
|
+
/**
|
|
2437
|
+
* The attachments to display
|
|
2438
|
+
*/
|
|
2311
2439
|
this.attachments = [];
|
|
2312
2440
|
this.orderedAttachments = [];
|
|
2313
2441
|
}
|
|
@@ -2359,7 +2487,7 @@
|
|
|
2359
2487
|
return AttachmentListComponent;
|
|
2360
2488
|
}());
|
|
2361
2489
|
AttachmentListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentListComponent, deps: [{ token: ImageLoadService }, { token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2362
|
-
AttachmentListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AttachmentListComponent, selector: "stream-attachment-list", inputs: { messageId: "messageId", attachments: "attachments" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngFor=\"let attachment of orderedAttachments; trackBy: trackById\">\n <div\n data-testclass=\"attachment-container\"\n class=\"str-chat__message-attachment str-chat__message-attachment--{{\n attachment.type\n }}\"\n [class.str-chat__message-attachment--card]=\"isCard(attachment)\"\n [class.str-chat-angular__message-attachment-file-single]=\"\n isFile(attachment)\n \"\n >\n <img\n *ngIf=\"isImage(attachment)\"\n class=\"str-chat__message-attachment--img\"\n data-testclass=\"image\"\n [src]=\"attachment.img_url || attachment.thumb_url || attachment.image_url\"\n [alt]=\"attachment?.fallback\"\n (load)=\"imageLoaded()\"\n />\n <div\n *ngIf=\"isFile(attachment)\"\n class=\"\n str-chat__message-attachment-file--item\n str-chat-angular__message-attachment-file-single\n \"\n >\n <stream-icon icon=\"file\" [size]=\"30\"></stream-icon>\n <div class=\"str-chat__message-attachment-file--item-text\">\n <a\n data-testclass=\"file-link\"\n download\n href=\"{{ attachment.asset_url }}\"\n target=\"_blank\"\n >\n {{ attachment.title }}\n </a>\n <span data-testclass=\"size\" *ngIf=\"hasFileSize(attachment)\">{{\n getFileSize(attachment)\n }}</span>\n </div>\n </div>\n <div\n *ngIf=\"isCard(attachment)\"\n class=\"str-chat__message-attachment-card str-chat__message-attachment-card--{{\n attachment.type\n }}\"\n >\n <div\n *ngIf=\"attachment.image_url || attachment.thumb_url\"\n class=\"str-chat__message-attachment-card--header\"\n >\n <img\n data-testclass=\"card-img\"\n alt=\"{{ attachment.image_url || attachment.thumb_url }}\"\n src=\"{{ attachment.image_url || attachment.thumb_url }}\"\n />\n </div>\n <div class=\"str-chat__message-attachment-card--content\">\n <div class=\"str-chat__message-attachment-card--flex\">\n <div\n *ngIf=\"attachment.title\"\n data-testclass=\"card-title\"\n class=\"str-chat__message-attachment-card--title\"\n >\n {{ attachment.title }}\n </div>\n <div\n *ngIf=\"attachment.text\"\n class=\"str-chat__message-attachment-card--text\"\n data-testclass=\"card-text\"\n >\n {{ attachment.text }}\n </div>\n <a\n class=\"str-chat__message-attachment-card--url\"\n *ngIf=\"attachment.title_link || attachment.og_scrape_url\"\n data-testclass=\"url-link\"\n noopener\n noreferrer\n href=\"{{ attachment.title_link || attachment.og_scrape_url }}\"\n target=\"_blank\"\n >\n {{ trimUrl(attachment.title_link || attachment.og_scrape_url) }}\n </a>\n </div>\n </div>\n </div>\n <div\n class=\"str-chat__message-attachment-actions\"\n *ngIf=\"attachment.actions && attachment.actions.length > 0\"\n >\n <div class=\"str-chat__message-attachment-actions-form\">\n <button\n *ngFor=\"let action of attachment.actions; trackBy: trackByActionValue\"\n class=\"str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--{{\n action.style\n }}\"\n data-testclass=\"attachment-action\"\n (click)=\"sendAction(action)\"\n (keyup.enter)=\"sendAction(action)\"\n >\n {{ action.text }}\n </button>\n </div>\n </div>\n </div>\n</ng-container>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type:
|
|
2490
|
+
AttachmentListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AttachmentListComponent, selector: "stream-attachment-list", inputs: { messageId: "messageId", attachments: "attachments" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngFor=\"let attachment of orderedAttachments; trackBy: trackById\">\n <div\n data-testclass=\"attachment-container\"\n class=\"str-chat__message-attachment str-chat__message-attachment--{{\n attachment.type\n }}\"\n [class.str-chat__message-attachment--card]=\"isCard(attachment)\"\n [class.str-chat-angular__message-attachment-file-single]=\"\n isFile(attachment)\n \"\n >\n <img\n *ngIf=\"isImage(attachment)\"\n class=\"str-chat__message-attachment--img\"\n data-testclass=\"image\"\n [src]=\"attachment.img_url || attachment.thumb_url || attachment.image_url\"\n [alt]=\"attachment?.fallback\"\n (load)=\"imageLoaded()\"\n />\n <div\n *ngIf=\"isFile(attachment)\"\n class=\"\n str-chat__message-attachment-file--item\n str-chat-angular__message-attachment-file-single\n \"\n >\n <stream-icon icon=\"file\" [size]=\"30\"></stream-icon>\n <div class=\"str-chat__message-attachment-file--item-text\">\n <a\n data-testclass=\"file-link\"\n download\n href=\"{{ attachment.asset_url }}\"\n target=\"_blank\"\n >\n {{ attachment.title }}\n </a>\n <span data-testclass=\"size\" *ngIf=\"hasFileSize(attachment)\">{{\n getFileSize(attachment)\n }}</span>\n </div>\n </div>\n <div\n *ngIf=\"isCard(attachment)\"\n class=\"str-chat__message-attachment-card str-chat__message-attachment-card--{{\n attachment.type\n }}\"\n >\n <div\n *ngIf=\"attachment.image_url || attachment.thumb_url\"\n class=\"str-chat__message-attachment-card--header\"\n >\n <img\n data-testclass=\"card-img\"\n alt=\"{{ attachment.image_url || attachment.thumb_url }}\"\n src=\"{{ attachment.image_url || attachment.thumb_url }}\"\n />\n </div>\n <div class=\"str-chat__message-attachment-card--content\">\n <div class=\"str-chat__message-attachment-card--flex\">\n <div\n *ngIf=\"attachment.title\"\n data-testclass=\"card-title\"\n class=\"str-chat__message-attachment-card--title\"\n >\n {{ attachment.title }}\n </div>\n <div\n *ngIf=\"attachment.text\"\n class=\"str-chat__message-attachment-card--text\"\n data-testclass=\"card-text\"\n >\n {{ attachment.text }}\n </div>\n <a\n class=\"str-chat__message-attachment-card--url\"\n *ngIf=\"attachment.title_link || attachment.og_scrape_url\"\n data-testclass=\"url-link\"\n noopener\n noreferrer\n href=\"{{ attachment.title_link || attachment.og_scrape_url }}\"\n target=\"_blank\"\n >\n {{ trimUrl(attachment.title_link || attachment.og_scrape_url) }}\n </a>\n </div>\n </div>\n </div>\n <div\n class=\"str-chat__message-attachment-actions\"\n *ngIf=\"attachment.actions && attachment.actions.length > 0\"\n >\n <div class=\"str-chat__message-attachment-actions-form\">\n <button\n *ngFor=\"let action of attachment.actions; trackBy: trackByActionValue\"\n class=\"str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--{{\n action.style\n }}\"\n data-testclass=\"attachment-action\"\n (click)=\"sendAction(action)\"\n (keyup.enter)=\"sendAction(action)\"\n >\n {{ action.text }}\n </button>\n </div>\n </div>\n </div>\n</ng-container>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2363
2491
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentListComponent, decorators: [{
|
|
2364
2492
|
type: i0.Component,
|
|
2365
2493
|
args: [{
|
|
@@ -2373,6 +2501,9 @@
|
|
|
2373
2501
|
type: i0.Input
|
|
2374
2502
|
}] } });
|
|
2375
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
|
+
*/
|
|
2376
2507
|
var AttachmentPreviewListComponent = /** @class */ (function () {
|
|
2377
2508
|
function AttachmentPreviewListComponent(attachmentService) {
|
|
2378
2509
|
this.attachmentService = attachmentService;
|
|
@@ -2408,7 +2539,7 @@
|
|
|
2408
2539
|
return AttachmentPreviewListComponent;
|
|
2409
2540
|
}());
|
|
2410
2541
|
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 });
|
|
2411
|
-
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:
|
|
2542
|
+
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: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "async": i6__namespace.AsyncPipe } });
|
|
2412
2543
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentPreviewListComponent, decorators: [{
|
|
2413
2544
|
type: i0.Component,
|
|
2414
2545
|
args: [{
|
|
@@ -2418,6 +2549,9 @@
|
|
|
2418
2549
|
}]
|
|
2419
2550
|
}], ctorParameters: function () { return [{ type: AttachmentService }]; } });
|
|
2420
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
|
+
*/
|
|
2421
2555
|
var MessageInputComponent = /** @class */ (function () {
|
|
2422
2556
|
function MessageInputComponent(channelService, notificationService, attachmentService, configService, textareaType, componentFactoryResolver, cdRef, chatClient, emojiInputService) {
|
|
2423
2557
|
var _this = this;
|
|
@@ -2430,10 +2564,18 @@
|
|
|
2430
2564
|
this.cdRef = cdRef;
|
|
2431
2565
|
this.chatClient = chatClient;
|
|
2432
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
|
+
*/
|
|
2433
2570
|
this.mode = 'main';
|
|
2571
|
+
/**
|
|
2572
|
+
* Emits when a message was successfuly sent or updated
|
|
2573
|
+
*/
|
|
2434
2574
|
this.messageUpdate = new i0.EventEmitter();
|
|
2435
2575
|
this.textareaValue = '';
|
|
2436
2576
|
this.mentionedUsers = [];
|
|
2577
|
+
this.typingStart$ = new rxjs.Subject();
|
|
2578
|
+
this.isCooldownInProgress = false;
|
|
2437
2579
|
this.subscriptions = [];
|
|
2438
2580
|
this.isViewInited = false;
|
|
2439
2581
|
this.subscriptions.push(this.attachmentService.attachmentUploadInProgressCounter$.subscribe(function (counter) {
|
|
@@ -2476,6 +2618,31 @@
|
|
|
2476
2618
|
this.commandAutocompleteItemTemplate =
|
|
2477
2619
|
this.configService.commandAutocompleteItemTemplate;
|
|
2478
2620
|
this.emojiPickerTemplate = this.configService.emojiPickerTemplate;
|
|
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
|
+
}));
|
|
2479
2646
|
}
|
|
2480
2647
|
MessageInputComponent.prototype.ngAfterViewInit = function () {
|
|
2481
2648
|
this.isViewInited = true;
|
|
@@ -2526,7 +2693,7 @@
|
|
|
2526
2693
|
MessageInputComponent.prototype.messageSent = function () {
|
|
2527
2694
|
var _a;
|
|
2528
2695
|
return __awaiter(this, void 0, void 0, function () {
|
|
2529
|
-
var attachmentUploadInProgressCounter, attachments, text,
|
|
2696
|
+
var attachmentUploadInProgressCounter, attachments, text, error_1;
|
|
2530
2697
|
return __generator(this, function (_12) {
|
|
2531
2698
|
switch (_12.label) {
|
|
2532
2699
|
case 0:
|
|
@@ -2552,18 +2719,12 @@
|
|
|
2552
2719
|
if (!this.isUpdate) {
|
|
2553
2720
|
this.textareaValue = '';
|
|
2554
2721
|
}
|
|
2555
|
-
parentMessageId = undefined;
|
|
2556
|
-
if (this.mode === 'thread') {
|
|
2557
|
-
this.channelService.activeParentMessageId$
|
|
2558
|
-
.pipe(operators.first())
|
|
2559
|
-
.subscribe(function (id) { return (parentMessageId = id); });
|
|
2560
|
-
}
|
|
2561
2722
|
_12.label = 1;
|
|
2562
2723
|
case 1:
|
|
2563
2724
|
_12.trys.push([1, 3, , 4]);
|
|
2564
2725
|
return [4 /*yield*/, (this.isUpdate
|
|
2565
2726
|
? this.channelService.updateMessage(Object.assign(Object.assign({}, this.message), { text: text, attachments: attachments }))
|
|
2566
|
-
: this.channelService.sendMessage(text, attachments, this.mentionedUsers, parentMessageId, (_a = this.quotedMessage) === null || _a === void 0 ? void 0 : _a.id))];
|
|
2727
|
+
: this.channelService.sendMessage(text, attachments, this.mentionedUsers, this.parentMessageId, (_a = this.quotedMessage) === null || _a === void 0 ? void 0 : _a.id))];
|
|
2567
2728
|
case 2:
|
|
2568
2729
|
_12.sent();
|
|
2569
2730
|
this.messageUpdate.emit();
|
|
@@ -2578,6 +2739,7 @@
|
|
|
2578
2739
|
}
|
|
2579
2740
|
return [3 /*break*/, 4];
|
|
2580
2741
|
case 4:
|
|
2742
|
+
void this.channelService.typingStopped(this.parentMessageId);
|
|
2581
2743
|
if (this.quotedMessage) {
|
|
2582
2744
|
this.deselectMessageToQuote();
|
|
2583
2745
|
}
|
|
@@ -2612,6 +2774,21 @@
|
|
|
2612
2774
|
enumerable: false,
|
|
2613
2775
|
configurable: true
|
|
2614
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
|
+
});
|
|
2615
2792
|
MessageInputComponent.prototype.filesSelected = function (fileList) {
|
|
2616
2793
|
return __awaiter(this, void 0, void 0, function () {
|
|
2617
2794
|
return __generator(this, function (_12) {
|
|
@@ -2727,10 +2904,41 @@
|
|
|
2727
2904
|
this.initTextarea();
|
|
2728
2905
|
}
|
|
2729
2906
|
};
|
|
2907
|
+
Object.defineProperty(MessageInputComponent.prototype, "parentMessageId", {
|
|
2908
|
+
get: function () {
|
|
2909
|
+
var parentMessageId = undefined;
|
|
2910
|
+
if (this.mode === 'thread') {
|
|
2911
|
+
this.channelService.activeParentMessageId$
|
|
2912
|
+
.pipe(operators.first())
|
|
2913
|
+
.subscribe(function (id) { return (parentMessageId = id); });
|
|
2914
|
+
}
|
|
2915
|
+
return parentMessageId;
|
|
2916
|
+
},
|
|
2917
|
+
enumerable: false,
|
|
2918
|
+
configurable: true
|
|
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
|
+
};
|
|
2730
2938
|
return MessageInputComponent;
|
|
2731
2939
|
}());
|
|
2732
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 });
|
|
2733
|
-
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 } });
|
|
2734
2942
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputComponent, decorators: [{
|
|
2735
2943
|
type: i0.Component,
|
|
2736
2944
|
args: [{
|
|
@@ -2774,10 +2982,19 @@
|
|
|
2774
2982
|
args: [TextareaDirective, { static: false }]
|
|
2775
2983
|
}] } });
|
|
2776
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
|
+
*/
|
|
2777
2988
|
var ModalComponent = /** @class */ (function () {
|
|
2778
2989
|
function ModalComponent() {
|
|
2779
2990
|
var _this = this;
|
|
2991
|
+
/**
|
|
2992
|
+
* If `true` the modal will be displayed, if `false` the modal will be hidden
|
|
2993
|
+
*/
|
|
2780
2994
|
this.isOpen = false;
|
|
2995
|
+
/**
|
|
2996
|
+
* Emits `true` if the modal becomes visible, and `false` if the modal is closed.
|
|
2997
|
+
*/
|
|
2781
2998
|
this.isOpenChange = new i0.EventEmitter();
|
|
2782
2999
|
this.watchForEscPress = function (event) {
|
|
2783
3000
|
if (event.key === 'Escape') {
|
|
@@ -2836,6 +3053,9 @@
|
|
|
2836
3053
|
args: ['content']
|
|
2837
3054
|
}] } });
|
|
2838
3055
|
|
|
3056
|
+
/**
|
|
3057
|
+
* The `Notification` component displays a notification within the [`NotificationList`](./NotificationListComponent.mdx)
|
|
3058
|
+
*/
|
|
2839
3059
|
var NotificationComponent = /** @class */ (function () {
|
|
2840
3060
|
function NotificationComponent() {
|
|
2841
3061
|
}
|
|
@@ -2854,6 +3074,9 @@
|
|
|
2854
3074
|
type: i0.Input
|
|
2855
3075
|
}] } });
|
|
2856
3076
|
|
|
3077
|
+
/**
|
|
3078
|
+
* The `NotificationList` component displays the list of active notifications.
|
|
3079
|
+
*/
|
|
2857
3080
|
var NotificationListComponent = /** @class */ (function () {
|
|
2858
3081
|
function NotificationListComponent(notificationService) {
|
|
2859
3082
|
this.notificationService = notificationService;
|
|
@@ -2865,7 +3088,7 @@
|
|
|
2865
3088
|
return NotificationListComponent;
|
|
2866
3089
|
}());
|
|
2867
3090
|
NotificationListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationListComponent, deps: [{ token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2868
|
-
NotificationListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: NotificationListComponent, selector: "stream-notification-list", ngImport: i0__namespace, template: "<div class=\"str-chat__list-notifications\">\n <stream-notification\n *ngFor=\"let notification of notifications$ | async; trackBy: trackByItem\"\n [type]=\"notification.type\"\n ><div data-testclass=\"notification-content\">\n {{ notification.text | translate: notification.translateParams }}\n </div></stream-notification\n >\n</div>\n", components: [{ type: NotificationComponent, selector: "stream-notification", inputs: ["type"] }], directives: [{ type:
|
|
3091
|
+
NotificationListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: NotificationListComponent, selector: "stream-notification-list", ngImport: i0__namespace, template: "<div class=\"str-chat__list-notifications\">\n <stream-notification\n *ngFor=\"let notification of notifications$ | async; trackBy: trackByItem\"\n [type]=\"notification.type\"\n ><div data-testclass=\"notification-content\">\n {{ notification.text | translate: notification.translateParams }}\n </div></stream-notification\n >\n</div>\n", components: [{ type: NotificationComponent, selector: "stream-notification", inputs: ["type"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6__namespace.AsyncPipe, "translate": i2__namespace.TranslatePipe } });
|
|
2869
3092
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationListComponent, decorators: [{
|
|
2870
3093
|
type: i0.Component,
|
|
2871
3094
|
args: [{
|
|
@@ -2875,16 +3098,34 @@
|
|
|
2875
3098
|
}]
|
|
2876
3099
|
}], ctorParameters: function () { return [{ type: NotificationService }]; } });
|
|
2877
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
|
+
*/
|
|
2878
3104
|
var MessageActionsBoxComponent = /** @class */ (function () {
|
|
2879
3105
|
function MessageActionsBoxComponent(chatClientService, notificationService, channelService) {
|
|
2880
3106
|
var _this = this;
|
|
2881
3107
|
this.chatClientService = chatClientService;
|
|
2882
3108
|
this.notificationService = notificationService;
|
|
2883
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
|
+
*/
|
|
2884
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
|
+
*/
|
|
2885
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
|
+
*/
|
|
2886
3121
|
this.enabledActions = [];
|
|
3122
|
+
/**
|
|
3123
|
+
* The number of authorized actions (it can be less or equal than the number of enabled actions)
|
|
3124
|
+
*/
|
|
2887
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
|
+
*/
|
|
2888
3129
|
this.isEditing = new i0.EventEmitter();
|
|
2889
3130
|
this.isEditModalOpen = false;
|
|
2890
3131
|
this.modalClosed = function () {
|
|
@@ -3032,7 +3273,7 @@
|
|
|
3032
3273
|
return MessageActionsBoxComponent;
|
|
3033
3274
|
}());
|
|
3034
3275
|
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 });
|
|
3035
|
-
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", "commandAutocompleteItemTemplate", "emojiPickerTemplate", "mode", "acceptedFileTypes", "isMultipleFileUploadEnabled", "message"], outputs: ["messageUpdate"] }, { type: NotificationListComponent, selector: "stream-notification-list" }], directives: [{ type:
|
|
3276
|
+
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", "commandAutocompleteItemTemplate", "emojiPickerTemplate", "mode", "acceptedFileTypes", "isMultipleFileUploadEnabled", "message"], outputs: ["messageUpdate"] }, { type: NotificationListComponent, selector: "stream-notification-list" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i2__namespace.TranslatePipe } });
|
|
3036
3277
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageActionsBoxComponent, decorators: [{
|
|
3037
3278
|
type: i0.Component,
|
|
3038
3279
|
args: [{
|
|
@@ -3059,6 +3300,9 @@
|
|
|
3059
3300
|
args: [MessageInputComponent]
|
|
3060
3301
|
}] } });
|
|
3061
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
|
+
*/
|
|
3062
3306
|
var ChannelComponent = /** @class */ (function () {
|
|
3063
3307
|
function ChannelComponent(channelService) {
|
|
3064
3308
|
this.channelService = channelService;
|
|
@@ -3070,7 +3314,7 @@
|
|
|
3070
3314
|
return ChannelComponent;
|
|
3071
3315
|
}());
|
|
3072
3316
|
ChannelComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelComponent, deps: [{ token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3073
|
-
ChannelComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelComponent, selector: "stream-channel", ngImport: i0__namespace, template: "<div\n *ngIf=\"(isError$ | async) === false && (isInitializing$ | async) === false\"\n class=\"str-chat str-chat-channel messaging\"\n>\n <div class=\"str-chat__container\">\n <div class=\"str-chat__main-panel\">\n <ng-content></ng-content>\n </div>\n <ng-content\n *ngIf=\"isActiveThread$ | async\"\n select='[name=\"thread\"]'\n ></ng-content>\n </div>\n</div>\n", directives: [{ type:
|
|
3317
|
+
ChannelComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelComponent, selector: "stream-channel", ngImport: i0__namespace, template: "<div\n *ngIf=\"(isError$ | async) === false && (isInitializing$ | async) === false\"\n class=\"str-chat str-chat-channel messaging\"\n>\n <div class=\"str-chat__container\">\n <div class=\"str-chat__main-panel\">\n <ng-content></ng-content>\n </div>\n <ng-content\n *ngIf=\"isActiveThread$ | async\"\n select='[name=\"thread\"]'\n ></ng-content>\n </div>\n</div>\n", directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i6__namespace.AsyncPipe } });
|
|
3074
3318
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelComponent, decorators: [{
|
|
3075
3319
|
type: i0.Component,
|
|
3076
3320
|
args: [{
|
|
@@ -3163,6 +3407,9 @@
|
|
|
3163
3407
|
args: [{ providedIn: 'root' }]
|
|
3164
3408
|
}], ctorParameters: function () { return []; } });
|
|
3165
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
|
+
*/
|
|
3166
3413
|
var ChannelHeaderComponent = /** @class */ (function () {
|
|
3167
3414
|
function ChannelHeaderComponent(channelService, channelListToggleService) {
|
|
3168
3415
|
var _this = this;
|
|
@@ -3212,6 +3459,9 @@
|
|
|
3212
3459
|
}]
|
|
3213
3460
|
}], ctorParameters: function () { return [{ type: ChannelService }, { type: ChannelListToggleService }]; } });
|
|
3214
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
|
+
*/
|
|
3215
3465
|
var ChannelPreviewComponent = /** @class */ (function () {
|
|
3216
3466
|
function ChannelPreviewComponent(channelService, ngZone) {
|
|
3217
3467
|
this.channelService = channelService;
|
|
@@ -3314,6 +3564,9 @@
|
|
|
3314
3564
|
type: i0.Input
|
|
3315
3565
|
}] } });
|
|
3316
3566
|
|
|
3567
|
+
/**
|
|
3568
|
+
* The `ChannelList` component renders the list of channels.
|
|
3569
|
+
*/
|
|
3317
3570
|
var ChannelListComponent = /** @class */ (function () {
|
|
3318
3571
|
function ChannelListComponent(channelService, channelListToggleService) {
|
|
3319
3572
|
this.channelService = channelService;
|
|
@@ -3352,7 +3605,7 @@
|
|
|
3352
3605
|
return ChannelListComponent;
|
|
3353
3606
|
}());
|
|
3354
3607
|
ChannelListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelListComponent, deps: [{ token: ChannelService }, { token: ChannelListToggleService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3355
|
-
ChannelListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelListComponent, selector: "stream-channel-list", inputs: { customChannelPreviewTemplate: "customChannelPreviewTemplate" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], ngImport: i0__namespace, template: "<div\n #container\n data-testid=\"channel-list-container\"\n class=\"str-chat str-chat-channel-list messaging\"\n [class.str-chat-channel-list--open]=\"(isOpen$ | async) === true\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false && (isInitializing$ | async) === false;\n else statusIndicator\n \"\n class=\"str-chat__channel-list-messenger\"\n >\n <div class=\"str-chat__channel-list-messenger__main\">\n <p\n data-testid=\"empty-channel-list-indicator\"\n *ngIf=\"!(channels$ | async)?.length\"\n >\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n <ng-container\n *ngFor=\"let channel of channels$ | async; trackBy: trackByChannelId\"\n >\n <ng-container\n *ngIf=\"customChannelPreviewTemplate; else defaultTemplate\"\n >\n <div (click)=\"channelSelected()\" (keyup.enter)=\"channelSelected()\">\n <ng-container\n *ngTemplateOutlet=\"\n customChannelPreviewTemplate;\n context: { channel: channel }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <ng-template #defaultTemplate>\n <stream-channel-preview\n data-testclass=\"channel-preview\"\n [channel]=\"channel\"\n (click)=\"channelSelected()\"\n (keyup.enter)=\"channelSelected()\"\n ></stream-channel-preview>\n </ng-template>\n </ng-container>\n <div\n *ngIf=\"hasMoreChannels$ | async\"\n class=\"str-chat__load-more-button\"\n (click)=\"loadMoreChannels()\"\n (keyup.enter)=\"loadMoreChannels()\"\n data-testid=\"load-more\"\n >\n <button\n class=\"str-chat__load-more-button__button\"\n data-testid=\"load-more-button\"\n [disabled]=\"isLoadingMoreChannels\"\n >\n <span *ngIf=\"!isLoadingMoreChannels; else loadingIndicator\">{{\n \"Load more\" | translate\n }}</span>\n <ng-template #loadingIndicator\n ><stream-loading-indicator></stream-loading-indicator\n ></ng-template>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #statusIndicator>\n <ng-container *ngIf=\"isError$ | async\">\n <ng-container *ngTemplateOutlet=\"chatDown\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isInitializing$ | async\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #chatDown>\n <div data-testid=\"chatdown-container\" class=\"str-chat__down\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n <div class=\"str-chat__down-main\">\n <stream-icon icon=\"connection-error\"></stream-icon>\n <h1>{{ \"streamChat.Connection error\" | translate }}</h1>\n <h3>\n {{\n \"streamChat.Error connecting to chat, refresh the page to try again.\"\n | translate\n }}\n </h3>\n </div>\n </div>\n</ng-template>\n\n<ng-template #loadingChannels>\n <div data-testid=\"loading-indicator\" class=\"str-chat__loading-channels\">\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannel>\n <div class=\"str-chat__loading-channels-item\">\n <div class=\"str-chat__loading-channels-avatar\"></div>\n <div class=\"str-chat__loading-channels-meta\">\n <div class=\"str-chat__loading-channels-username\"></div>\n <div class=\"str-chat__loading-channels-status\"></div>\n </div>\n </div>\n</ng-template>\n", components: [{ type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: ["channel"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type:
|
|
3608
|
+
ChannelListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelListComponent, selector: "stream-channel-list", inputs: { customChannelPreviewTemplate: "customChannelPreviewTemplate" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], ngImport: i0__namespace, template: "<div\n #container\n data-testid=\"channel-list-container\"\n class=\"str-chat str-chat-channel-list messaging\"\n [class.str-chat-channel-list--open]=\"(isOpen$ | async) === true\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false && (isInitializing$ | async) === false;\n else statusIndicator\n \"\n class=\"str-chat__channel-list-messenger\"\n >\n <div class=\"str-chat__channel-list-messenger__main\">\n <p\n data-testid=\"empty-channel-list-indicator\"\n *ngIf=\"!(channels$ | async)?.length\"\n >\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n <ng-container\n *ngFor=\"let channel of channels$ | async; trackBy: trackByChannelId\"\n >\n <ng-container\n *ngIf=\"customChannelPreviewTemplate; else defaultTemplate\"\n >\n <div (click)=\"channelSelected()\" (keyup.enter)=\"channelSelected()\">\n <ng-container\n *ngTemplateOutlet=\"\n customChannelPreviewTemplate;\n context: { channel: channel }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <ng-template #defaultTemplate>\n <stream-channel-preview\n data-testclass=\"channel-preview\"\n [channel]=\"channel\"\n (click)=\"channelSelected()\"\n (keyup.enter)=\"channelSelected()\"\n ></stream-channel-preview>\n </ng-template>\n </ng-container>\n <div\n *ngIf=\"hasMoreChannels$ | async\"\n class=\"str-chat__load-more-button\"\n (click)=\"loadMoreChannels()\"\n (keyup.enter)=\"loadMoreChannels()\"\n data-testid=\"load-more\"\n >\n <button\n class=\"str-chat__load-more-button__button\"\n data-testid=\"load-more-button\"\n [disabled]=\"isLoadingMoreChannels\"\n >\n <span *ngIf=\"!isLoadingMoreChannels; else loadingIndicator\">{{\n \"Load more\" | translate\n }}</span>\n <ng-template #loadingIndicator\n ><stream-loading-indicator></stream-loading-indicator\n ></ng-template>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #statusIndicator>\n <ng-container *ngIf=\"isError$ | async\">\n <ng-container *ngTemplateOutlet=\"chatDown\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isInitializing$ | async\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #chatDown>\n <div data-testid=\"chatdown-container\" class=\"str-chat__down\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n <div class=\"str-chat__down-main\">\n <stream-icon icon=\"connection-error\"></stream-icon>\n <h1>{{ \"streamChat.Connection error\" | translate }}</h1>\n <h3>\n {{\n \"streamChat.Error connecting to chat, refresh the page to try again.\"\n | translate\n }}\n </h3>\n </div>\n </div>\n</ng-template>\n\n<ng-template #loadingChannels>\n <div data-testid=\"loading-indicator\" class=\"str-chat__loading-channels\">\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannel>\n <div class=\"str-chat__loading-channels-item\">\n <div class=\"str-chat__loading-channels-avatar\"></div>\n <div class=\"str-chat__loading-channels-meta\">\n <div class=\"str-chat__loading-channels-username\"></div>\n <div class=\"str-chat__loading-channels-status\"></div>\n </div>\n </div>\n</ng-template>\n", components: [{ type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: ["channel"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i6__namespace.AsyncPipe, "translate": i2__namespace.TranslatePipe } });
|
|
3356
3609
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelListComponent, decorators: [{
|
|
3357
3610
|
type: i0.Component,
|
|
3358
3611
|
args: [{
|
|
@@ -3410,16 +3663,34 @@
|
|
|
3410
3663
|
wow: '😮',
|
|
3411
3664
|
sad: '😞',
|
|
3412
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
|
+
*/
|
|
3413
3669
|
var MessageReactionsComponent = /** @class */ (function () {
|
|
3414
3670
|
function MessageReactionsComponent(cdRef, channelService) {
|
|
3415
3671
|
var _this = this;
|
|
3416
3672
|
this.cdRef = cdRef;
|
|
3417
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
|
+
*/
|
|
3418
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
|
+
*/
|
|
3419
3681
|
this.isSelectorOpen = false;
|
|
3420
|
-
|
|
3682
|
+
/**
|
|
3683
|
+
* List of reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.
|
|
3684
|
+
*/
|
|
3421
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
|
+
*/
|
|
3422
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();
|
|
3423
3694
|
this.eventHandler = function (event) {
|
|
3424
3695
|
var _a;
|
|
3425
3696
|
if (!((_a = _this.selectorContainer) === null || _a === void 0 ? void 0 : _a.nativeElement.contains(event.target))) {
|
|
@@ -3519,7 +3790,7 @@
|
|
|
3519
3790
|
return MessageReactionsComponent;
|
|
3520
3791
|
}());
|
|
3521
3792
|
MessageReactionsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageReactionsComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3522
|
-
MessageReactionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: { messageId: "messageId", messageReactionCounts: "messageReactionCounts", isSelectorOpen: "isSelectorOpen", latestReactions: "latestReactions", ownReactions: "ownReactions" }, outputs: { isSelectorOpenChange: "isSelectorOpenChange" }, viewQueries: [{ propertyName: "selectorContainer", first: true, predicate: ["selectorContainer"], descendants: true }, { propertyName: "selectorTooltip", first: true, predicate: ["selectorTooltip"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n *ngIf=\"existingReactions.length > 0 && !isSelectorOpen\"\n class=\"str-chat__reaction-list\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n data-testid=\"reaction-list\"\n>\n <ul>\n <li\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji\"\n >\n <span class=\"emoji\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n \n </li>\n <li>\n <span\n data-testid=\"reactions-count\"\n class=\"str-chat__reaction-list--counter\"\n >{{ reactionsCount }}</span\n >\n </li>\n </ul>\n</div>\n\n<div\n #selectorContainer\n class=\"str-chat__reaction-selector\"\n *ngIf=\"isSelectorOpen\"\n data-testid=\"reaction-selector\"\n>\n <div\n *ngIf=\"tooltipText\"\n data-testid=\"tooltip\"\n #selectorTooltip\n class=\"str-chat__reaction-selector-tooltip\"\n [ngStyle]=\"{\n left: tooltipPositions?.tooltip + 'px',\n visibility: tooltipPositions ? 'visible' : 'hidden'\n }\"\n >\n <div\n class=\"arrow\"\n [ngStyle]=\"{ left: tooltipPositions?.arrow + 'px' }\"\n ></div>\n <span class=\"latest-user-username\">\n {{ tooltipText }}\n </span>\n </div>\n <ul class=\"str-chat__message-reactions-list\">\n <li\n class=\"str-chat__message-reactions-list-item str-chat__emoji\"\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji-option\"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <div\n *ngIf=\"getLatestUserByReaction(reactionType) as user\"\n class=\"latest-user\"\n (click)=\"hideTooltip()\"\n (keyup.enter)=\"hideTooltip()\"\n (mouseenter)=\"showTooltip($event, reactionType)\"\n (mouseleave)=\"hideTooltip()\"\n attr.data-testid=\"{{ reactionType }}-last-user\"\n >\n <stream-avatar\n attr.data-testid=\"{{ reactionType }}-avatar\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name || user.id\"\n [size]=\"20\"\n ></stream-avatar>\n </div>\n <span class=\"emoji\" style=\"width: 20px; height: 20px; top: 10px\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n <span\n *ngIf=\"\n messageReactionCounts[reactionType] &&\n messageReactionCounts[reactionType]! > 0\n \"\n class=\"str-chat__message-reactions-list-item__count\"\n attr.data-testid=\"{{ reactionType }}-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n </ul>\n</div>\n", styles: [".emoji {position: relative; display: inline-block; }"], components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], directives: [{ type:
|
|
3793
|
+
MessageReactionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: { messageId: "messageId", messageReactionCounts: "messageReactionCounts", isSelectorOpen: "isSelectorOpen", latestReactions: "latestReactions", ownReactions: "ownReactions" }, outputs: { isSelectorOpenChange: "isSelectorOpenChange" }, viewQueries: [{ propertyName: "selectorContainer", first: true, predicate: ["selectorContainer"], descendants: true }, { propertyName: "selectorTooltip", first: true, predicate: ["selectorTooltip"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n *ngIf=\"existingReactions.length > 0 && !isSelectorOpen\"\n class=\"str-chat__reaction-list\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n data-testid=\"reaction-list\"\n>\n <ul>\n <li\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji\"\n >\n <span class=\"emoji\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n \n </li>\n <li>\n <span\n data-testid=\"reactions-count\"\n class=\"str-chat__reaction-list--counter\"\n >{{ reactionsCount }}</span\n >\n </li>\n </ul>\n</div>\n\n<div\n #selectorContainer\n class=\"str-chat__reaction-selector\"\n *ngIf=\"isSelectorOpen\"\n data-testid=\"reaction-selector\"\n>\n <div\n *ngIf=\"tooltipText\"\n data-testid=\"tooltip\"\n #selectorTooltip\n class=\"str-chat__reaction-selector-tooltip\"\n [ngStyle]=\"{\n left: tooltipPositions?.tooltip + 'px',\n visibility: tooltipPositions ? 'visible' : 'hidden'\n }\"\n >\n <div\n class=\"arrow\"\n [ngStyle]=\"{ left: tooltipPositions?.arrow + 'px' }\"\n ></div>\n <span class=\"latest-user-username\">\n {{ tooltipText }}\n </span>\n </div>\n <ul class=\"str-chat__message-reactions-list\">\n <li\n class=\"str-chat__message-reactions-list-item str-chat__emoji\"\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji-option\"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <div\n *ngIf=\"getLatestUserByReaction(reactionType) as user\"\n class=\"latest-user\"\n (click)=\"hideTooltip()\"\n (keyup.enter)=\"hideTooltip()\"\n (mouseenter)=\"showTooltip($event, reactionType)\"\n (mouseleave)=\"hideTooltip()\"\n attr.data-testid=\"{{ reactionType }}-last-user\"\n >\n <stream-avatar\n attr.data-testid=\"{{ reactionType }}-avatar\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name || user.id\"\n [size]=\"20\"\n ></stream-avatar>\n </div>\n <span class=\"emoji\" style=\"width: 20px; height: 20px; top: 10px\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n <span\n *ngIf=\"\n messageReactionCounts[reactionType] &&\n messageReactionCounts[reactionType]! > 0\n \"\n class=\"str-chat__message-reactions-list-item__count\"\n attr.data-testid=\"{{ reactionType }}-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n </ul>\n</div>\n", styles: [".emoji {position: relative; display: inline-block; }"], components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
3523
3794
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageReactionsComponent, decorators: [{
|
|
3524
3795
|
type: i0.Component,
|
|
3525
3796
|
args: [{
|
|
@@ -3533,12 +3804,12 @@
|
|
|
3533
3804
|
type: i0.Input
|
|
3534
3805
|
}], isSelectorOpen: [{
|
|
3535
3806
|
type: i0.Input
|
|
3536
|
-
}], isSelectorOpenChange: [{
|
|
3537
|
-
type: i0.Output
|
|
3538
3807
|
}], latestReactions: [{
|
|
3539
3808
|
type: i0.Input
|
|
3540
3809
|
}], ownReactions: [{
|
|
3541
3810
|
type: i0.Input
|
|
3811
|
+
}], isSelectorOpenChange: [{
|
|
3812
|
+
type: i0.Output
|
|
3542
3813
|
}], selectorContainer: [{
|
|
3543
3814
|
type: i0.ViewChild,
|
|
3544
3815
|
args: ['selectorContainer']
|
|
@@ -3547,11 +3818,20 @@
|
|
|
3547
3818
|
args: ['selectorTooltip']
|
|
3548
3819
|
}] } });
|
|
3549
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
|
+
*/
|
|
3550
3824
|
var MessageComponent = /** @class */ (function () {
|
|
3551
3825
|
function MessageComponent(chatClientService, channelService) {
|
|
3552
3826
|
this.chatClientService = chatClientService;
|
|
3553
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
|
+
*/
|
|
3554
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
|
+
*/
|
|
3555
3835
|
this.mode = 'main';
|
|
3556
3836
|
this.isActionBoxOpen = false;
|
|
3557
3837
|
this.isReactionSelectorOpen = false;
|
|
@@ -3757,7 +4037,7 @@
|
|
|
3757
4037
|
return MessageComponent;
|
|
3758
4038
|
}());
|
|
3759
4039
|
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 });
|
|
3760
|
-
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", mode: "mode" }, 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 !== false && hasReactions\n \"\n data-testid=\"message-container\"\n (mouseleave)=\"isActionBoxOpen = false\"\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 mode === 'main' &&\n isMessageDeliveredAndRead &&\n canDisplayReadStatus;\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 <!-- eslint-disable @angular-eslint/template/conditional-complexity -->\n <div\n *ngIf=\"\n enabledMessageActions.indexOf('send-reply') !== -1 &&\n mode === 'main'\n \"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--thread\n \"\n data-testid=\"reply-in-thread\"\n (click)=\"setAsActiveParentMessage()\"\n (keyup.enter)=\"setAsActiveParentMessage()\"\n >\n <stream-icon icon=\"reply-in-thread\"></stream-icon>\n </div>\n <div\n *ngIf=\"\n areReactionsEnabled !== false &&\n canReactToMessage !== false &&\n enabledMessageActions.indexOf('send-reaction') !== -1\n \"\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 <!-- eslint-enable @angular-eslint/template/conditional-complexity -->\n <stream-message-reactions\n *ngIf=\"areReactionsEnabled !== false\"\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 && !message?.quoted_message\"\n [attachments]=\"message!.attachments!\"\n [messageId]=\"message!.id\"\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 <ng-container *ngTemplateOutlet=\"quotedMessage\"></ng-container>\n <stream-attachment-list\n *ngIf=\"hasAttachment && message?.quoted_message\"\n [attachments]=\"message!.attachments!\"\n [messageId]=\"message!.id\"\n ></stream-attachment-list>\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-simple-reply-button\">\n <button\n *ngIf=\"\n !!message?.reply_count &&\n mode !== 'thread' &&\n enabledMessageActions.indexOf('send-reply') !== -1\n \"\n class=\"str-chat__message-replies-count-button\"\n data-testid=\"reply-count-button\"\n (click)=\"setAsActiveParentMessage()\"\n >\n <stream-icon icon=\"reply\"></stream-icon>\n {{message?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </button>\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 *ngIf=\"mode === 'main'\"\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\n<ng-template #quotedMessage>\n <div\n *ngIf=\"message?.quoted_message\"\n class=\"quoted-message\"\n data-testid=\"quoted-message-container\"\n [class.mine]=\"isSentByCurrentUser\"\n >\n <stream-avatar\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.quoted_message?.user?.image\"\n [name]=\"\n message?.quoted_message?.user?.name || message?.quoted_message?.user?.id\n \"\n [size]=\"20\"\n ></stream-avatar>\n <div class=\"quoted-message-inner\">\n <stream-attachment-list\n *ngIf=\"\n message?.quoted_message?.attachments &&\n message?.quoted_message?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"message?.quoted_message?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"\n message?.quoted_message?.html || message?.quoted_message?.text\n \"\n ></div>\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: ["messageId", "attachments"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i2__namespace.TranslatePipe } });
|
|
4040
|
+
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", mode: "mode" }, 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 !== false && hasReactions\n \"\n data-testid=\"message-container\"\n (mouseleave)=\"isActionBoxOpen = false\"\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 mode === 'main' &&\n isMessageDeliveredAndRead &&\n canDisplayReadStatus;\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 <!-- eslint-disable @angular-eslint/template/conditional-complexity -->\n <div\n *ngIf=\"\n enabledMessageActions.indexOf('send-reply') !== -1 &&\n mode === 'main'\n \"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--thread\n \"\n data-testid=\"reply-in-thread\"\n (click)=\"setAsActiveParentMessage()\"\n (keyup.enter)=\"setAsActiveParentMessage()\"\n >\n <stream-icon icon=\"reply-in-thread\"></stream-icon>\n </div>\n <div\n *ngIf=\"\n areReactionsEnabled !== false &&\n canReactToMessage !== false &&\n enabledMessageActions.indexOf('send-reaction') !== -1\n \"\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 <!-- eslint-enable @angular-eslint/template/conditional-complexity -->\n <stream-message-reactions\n *ngIf=\"areReactionsEnabled !== false\"\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 && !message?.quoted_message\"\n [attachments]=\"message!.attachments!\"\n [messageId]=\"message!.id\"\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 <ng-container *ngTemplateOutlet=\"quotedMessage\"></ng-container>\n <stream-attachment-list\n *ngIf=\"hasAttachment && message?.quoted_message\"\n [attachments]=\"message!.attachments!\"\n [messageId]=\"message!.id\"\n ></stream-attachment-list>\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-simple-reply-button\">\n <button\n *ngIf=\"\n !!message?.reply_count &&\n mode !== 'thread' &&\n enabledMessageActions.indexOf('send-reply') !== -1\n \"\n class=\"str-chat__message-replies-count-button\"\n data-testid=\"reply-count-button\"\n (click)=\"setAsActiveParentMessage()\"\n >\n <stream-icon icon=\"reply\"></stream-icon>\n {{message?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </button>\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 *ngIf=\"mode === 'main'\"\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\n<ng-template #quotedMessage>\n <div\n *ngIf=\"message?.quoted_message\"\n class=\"quoted-message\"\n data-testid=\"quoted-message-container\"\n [class.mine]=\"isSentByCurrentUser\"\n >\n <stream-avatar\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.quoted_message?.user?.image\"\n [name]=\"\n message?.quoted_message?.user?.name || message?.quoted_message?.user?.id\n \"\n [size]=\"20\"\n ></stream-avatar>\n <div class=\"quoted-message-inner\">\n <stream-attachment-list\n *ngIf=\"\n message?.quoted_message?.attachments &&\n message?.quoted_message?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"message?.quoted_message?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"\n message?.quoted_message?.html || message?.quoted_message?.text\n \"\n ></div>\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: ["messageId", "attachments"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i2__namespace.TranslatePipe } });
|
|
3761
4041
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageComponent, decorators: [{
|
|
3762
4042
|
type: i0.Component,
|
|
3763
4043
|
args: [{
|
|
@@ -3788,13 +4068,25 @@
|
|
|
3788
4068
|
args: ['container']
|
|
3789
4069
|
}] } });
|
|
3790
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
|
+
*/
|
|
3791
4074
|
var TextareaComponent = /** @class */ (function () {
|
|
3792
4075
|
function TextareaComponent(emojiInputService) {
|
|
3793
4076
|
var _this = this;
|
|
3794
4077
|
this.emojiInputService = emojiInputService;
|
|
3795
4078
|
this.class = 'str-chat__textarea';
|
|
4079
|
+
/**
|
|
4080
|
+
* The value of the input HTML element.
|
|
4081
|
+
*/
|
|
3796
4082
|
this.value = '';
|
|
4083
|
+
/**
|
|
4084
|
+
* Emits the current value of the input element when a user types.
|
|
4085
|
+
*/
|
|
3797
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
|
+
*/
|
|
3798
4090
|
this.send = new i0.EventEmitter();
|
|
3799
4091
|
this.subscriptions = [];
|
|
3800
4092
|
this.subscriptions.push(this.emojiInputService.emojiInput$.subscribe(function (emoji) {
|
|
@@ -3867,6 +4159,9 @@
|
|
|
3867
4159
|
args: [{ providedIn: 'root' }]
|
|
3868
4160
|
}], ctorParameters: function () { return []; } });
|
|
3869
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
|
+
*/
|
|
3870
4165
|
var AutocompleteTextareaComponent = /** @class */ (function () {
|
|
3871
4166
|
function AutocompleteTextareaComponent(channelService, chatClientService, transliterationService, emojiInputService) {
|
|
3872
4167
|
var _this = this;
|
|
@@ -3875,11 +4170,29 @@
|
|
|
3875
4170
|
this.transliterationService = transliterationService;
|
|
3876
4171
|
this.emojiInputService = emojiInputService;
|
|
3877
4172
|
this.class = 'str-chat__textarea';
|
|
4173
|
+
/**
|
|
4174
|
+
* The value of the input HTML element.
|
|
4175
|
+
*/
|
|
3878
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
|
+
*/
|
|
3879
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
|
+
*/
|
|
3880
4184
|
this.mentionScope = 'channel';
|
|
4185
|
+
/**
|
|
4186
|
+
* Emits the current value of the input element when a user types.
|
|
4187
|
+
*/
|
|
3881
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
|
+
*/
|
|
3882
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
|
+
*/
|
|
3883
4196
|
this.userMentions = new i0.EventEmitter();
|
|
3884
4197
|
this.autocompleteKey = 'autocompleteLabel';
|
|
3885
4198
|
this.mentionTriggerChar = '@';
|
|
@@ -4047,7 +4360,7 @@
|
|
|
4047
4360
|
return AutocompleteTextareaComponent;
|
|
4048
4361
|
}());
|
|
4049
4362
|
AutocompleteTextareaComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AutocompleteTextareaComponent, deps: [{ token: ChannelService }, { token: ChatClientService }, { token: TransliterationService }, { token: EmojiInputService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
4050
|
-
AutocompleteTextareaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AutocompleteTextareaComponent, selector: "stream-autocomplete-textarea", inputs: { value: "value", areMentionsEnabled: "areMentionsEnabled", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", commandAutocompleteItemTemplate: "commandAutocompleteItemTemplate", mentionScope: "mentionScope" }, outputs: { valueChange: "valueChange", send: "send", userMentions: "userMentions" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ 'streamChat.Type your message' | translate }}\"\n class=\"rta__textarea str-chat__textarea__textarea str-chat__angular-textarea\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n [mentionConfig]=\"autocompleteConfig\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n [mentionListTemplate]=\"autocompleteItem\"\n (blur)=\"inputLeft()\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <div class=\"rta rta__item str-chat__emojisearch__item\" [ngSwitch]=\"item.type\">\n <div class=\"rta__entity\" *ngSwitchCase=\"'mention'\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n <div class=\"rta__entity\" *ngSwitchCase=\"'command'\">\n <ng-container\n *ngTemplateOutlet=\"\n commandAutocompleteItemTemplate || defaultCommandTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #defaultCommandTemplate let-item=\"item\">\n <div class=\"str-chat__slash-command\">\n <span class=\"str-chat__slash-command-header\">\n <strong data-testclass=\"command-name\">{{ item.name }}</strong>\n {{ item.args }}\n </span>\n <br />\n <span class=\"str-chat__slash-command-description\">{{\n item.description\n }}</span>\n </div>\n</ng-template>\n\n<ng-template #defaultMentionTemplate let-item=\"item\">\n <div class=\"str-chat__user-item\">\n <stream-avatar\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n style=\"height: 20px\"\n [size]=\"20\"\n [imageUrl]=\"item.image || item.user?.image\"\n [name]=\"item.autocompleteLabel\"\n ></stream-avatar>\n <span data-testclass=\"username\" class=\"str-chat__user-item--name\">{{\n item.autocompleteLabel\n }}</span>\n </div>\n</ng-template>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], directives: [{ type: i6__namespace.MentionDirective, selector: "[mention], [mentionConfig]", inputs: ["mentionConfig", "mention", "mentionListTemplate"], outputs: ["searchTerm", "itemSelected", "opened", "closed"] }, { type:
|
|
4363
|
+
AutocompleteTextareaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AutocompleteTextareaComponent, selector: "stream-autocomplete-textarea", inputs: { value: "value", areMentionsEnabled: "areMentionsEnabled", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", commandAutocompleteItemTemplate: "commandAutocompleteItemTemplate", mentionScope: "mentionScope" }, outputs: { valueChange: "valueChange", send: "send", userMentions: "userMentions" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ 'streamChat.Type your message' | translate }}\"\n class=\"rta__textarea str-chat__textarea__textarea str-chat__angular-textarea\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n [mentionConfig]=\"autocompleteConfig\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n [mentionListTemplate]=\"autocompleteItem\"\n (blur)=\"inputLeft()\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <div class=\"rta rta__item str-chat__emojisearch__item\" [ngSwitch]=\"item.type\">\n <div class=\"rta__entity\" *ngSwitchCase=\"'mention'\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n <div class=\"rta__entity\" *ngSwitchCase=\"'command'\">\n <ng-container\n *ngTemplateOutlet=\"\n commandAutocompleteItemTemplate || defaultCommandTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #defaultCommandTemplate let-item=\"item\">\n <div class=\"str-chat__slash-command\">\n <span class=\"str-chat__slash-command-header\">\n <strong data-testclass=\"command-name\">{{ item.name }}</strong>\n {{ item.args }}\n </span>\n <br />\n <span class=\"str-chat__slash-command-description\">{{\n item.description\n }}</span>\n </div>\n</ng-template>\n\n<ng-template #defaultMentionTemplate let-item=\"item\">\n <div class=\"str-chat__user-item\">\n <stream-avatar\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n style=\"height: 20px\"\n [size]=\"20\"\n [imageUrl]=\"item.image || item.user?.image\"\n [name]=\"item.autocompleteLabel\"\n ></stream-avatar>\n <span data-testclass=\"username\" class=\"str-chat__user-item--name\">{{\n item.autocompleteLabel\n }}</span>\n </div>\n</ng-template>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], directives: [{ type: i6__namespace$1.MentionDirective, selector: "[mention], [mentionConfig]", inputs: ["mentionConfig", "mention", "mentionListTemplate"], outputs: ["searchTerm", "itemSelected", "opened", "closed"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "translate": i2__namespace.TranslatePipe } });
|
|
4051
4364
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AutocompleteTextareaComponent, decorators: [{
|
|
4052
4365
|
type: i0.Component,
|
|
4053
4366
|
args: [{
|
|
@@ -4119,6 +4432,9 @@
|
|
|
4119
4432
|
date1.getDate() === date2.getDate());
|
|
4120
4433
|
};
|
|
4121
4434
|
|
|
4435
|
+
/**
|
|
4436
|
+
* The `MessageList` component renders a scrollable list of messages.
|
|
4437
|
+
*/
|
|
4122
4438
|
var MessageListComponent = /** @class */ (function () {
|
|
4123
4439
|
function MessageListComponent(channelService, chatClientService, imageLoadService) {
|
|
4124
4440
|
var _this = this;
|
|
@@ -4126,14 +4442,17 @@
|
|
|
4126
4442
|
this.chatClientService = chatClientService;
|
|
4127
4443
|
this.imageLoadService = imageLoadService;
|
|
4128
4444
|
/**
|
|
4129
|
-
* @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).
|
|
4130
4446
|
*/
|
|
4131
4447
|
this.areReactionsEnabled = undefined;
|
|
4132
4448
|
/**
|
|
4133
|
-
* @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.
|
|
4134
4450
|
*/
|
|
4135
4451
|
/* eslint-disable-next-line @angular-eslint/no-input-rename */
|
|
4136
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
|
+
*/
|
|
4137
4456
|
this.mode = 'main';
|
|
4138
4457
|
this.enabledMessageActions = [];
|
|
4139
4458
|
this.class = 'str-chat-angular__main-panel-inner str-chat-angular__message-list-host';
|
|
@@ -4200,6 +4519,8 @@
|
|
|
4200
4519
|
}
|
|
4201
4520
|
_this.parentMessage = message;
|
|
4202
4521
|
}));
|
|
4522
|
+
this.usersTypingInChannel$ = this.channelService.usersTypingInChannel$;
|
|
4523
|
+
this.usersTypingInThread$ = this.channelService.usersTypingInThread$;
|
|
4203
4524
|
}
|
|
4204
4525
|
MessageListComponent.prototype.ngOnInit = function () {
|
|
4205
4526
|
this.setMessages$();
|
|
@@ -4240,9 +4561,21 @@
|
|
|
4240
4561
|
MessageListComponent.prototype.ngOnDestroy = function () {
|
|
4241
4562
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
4242
4563
|
};
|
|
4564
|
+
Object.defineProperty(MessageListComponent.prototype, "usersTyping$", {
|
|
4565
|
+
get: function () {
|
|
4566
|
+
return this.mode === 'thread'
|
|
4567
|
+
? this.usersTypingInThread$
|
|
4568
|
+
: this.usersTypingInChannel$;
|
|
4569
|
+
},
|
|
4570
|
+
enumerable: false,
|
|
4571
|
+
configurable: true
|
|
4572
|
+
});
|
|
4243
4573
|
MessageListComponent.prototype.trackByMessageId = function (index, item) {
|
|
4244
4574
|
return item.id;
|
|
4245
4575
|
};
|
|
4576
|
+
MessageListComponent.prototype.trackByUserId = function (index, user) {
|
|
4577
|
+
return user.id;
|
|
4578
|
+
};
|
|
4246
4579
|
MessageListComponent.prototype.scrollToBottom = function () {
|
|
4247
4580
|
this.scrollContainer.nativeElement.scrollTop =
|
|
4248
4581
|
this.scrollContainer.nativeElement.scrollHeight;
|
|
@@ -4349,7 +4682,7 @@
|
|
|
4349
4682
|
return MessageListComponent;
|
|
4350
4683
|
}());
|
|
4351
4684
|
MessageListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageListComponent, deps: [{ token: ChannelService }, { token: ChatClientService }, { token: ImageLoadService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
4352
|
-
MessageListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageListComponent, selector: "stream-message-list", inputs: { messageTemplate: "messageTemplate", messageInputTemplate: "messageInputTemplate", mentionTemplate: "mentionTemplate", areReactionsEnabled: "areReactionsEnabled", enabledMessageActionsInput: ["enabledMessageActions", "enabledMessageActionsInput"], mode: "mode" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true }, { propertyName: "parentMessageElement", first: true, predicate: ["parentMessageElement"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n #scrollContainer\n data-testid=\"scroll-container\"\n class=\"str-chat__list\"\n (scroll)=\"scrolled()\"\n>\n <div class=\"str-chat__reverse-infinite-scroll\">\n <ul class=\"str-chat__ul\">\n <li\n #parentMessageElement\n *ngIf=\"mode === 'thread'\"\n data-testid=\"parent-message\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: parentMessage }\n \"\n ></ng-container>\n <div class=\"str-chat__thread-start\" translate>\n streamChat.Start of a new thread\n </div>\n </li>\n <li\n data-testclass=\"message\"\n *ngFor=\"\n let message of messages$ | async;\n let i = index;\n trackBy: trackByMessageId\n \"\n class=\"str-chat__li str-chat__li--{{ groupStyles[i] }}\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: message }\n \"\n ></ng-container>\n </li>\n </ul>\n </div>\n</div>\n<div class=\"str-chat__list-notifications\">\n <button\n data-testid=\"scroll-to-bottom\"\n *ngIf=\"isUserScrolledUp\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-right\n str-chat__message-notification-scroll-down\n \"\n (keyup.enter)=\"scrollToBottom()\"\n (click)=\"scrollToBottom()\"\n >\n <div\n *ngIf=\"unreadMessageCount > 0\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-scroll-down-unread-count\n \"\n >\n {{ unreadMessageCount }}\n </div>\n </button>\n</div>\n\n<ng-template #messageTemplateContainer let-message=\"message\">\n <ng-container *ngIf=\"messageTemplate; else defaultMessageTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplate;\n context: {\n message: message,\n areReactionsEnabled: areReactionsEnabled,\n canReactToMessage: canReactToMessage,\n lastSentMessageId: !!(\n lastSentMessageId && message?.id === lastSentMessageId\n ),\n canReceiveReadEvents: canReceiveReadEvents,\n messageInputTemplate: messageInputTemplate,\n mentionTemplate: mentionTemplate,\n mode: mode\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultMessageTemplate>\n <stream-message\n [message]=\"message\"\n [areReactionsEnabled]=\"areReactionsEnabled\"\n [canReactToMessage]=\"canReactToMessage\"\n [isLastSentMessage]=\"\n !!(lastSentMessageId && message?.id === lastSentMessageId)\n \"\n [enabledMessageActions]=\"enabledMessageActions\"\n [canReceiveReadEvents]=\"canReceiveReadEvents\"\n [messageInputTemplate]=\"messageInputTemplate\"\n [mentionTemplate]=\"mentionTemplate\"\n [mode]=\"mode\"\n ></stream-message>\n </ng-template>\n</ng-template>\n", components: [{ type: MessageComponent, selector: "stream-message", inputs: ["messageInputTemplate", "mentionTemplate", "message", "enabledMessageActions", "areReactionsEnabled", "canReactToMessage", "isLastSentMessage", "canReceiveReadEvents", "mode"] }], directives: [{ type:
|
|
4685
|
+
MessageListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageListComponent, selector: "stream-message-list", inputs: { messageTemplate: "messageTemplate", messageInputTemplate: "messageInputTemplate", mentionTemplate: "mentionTemplate", typingIndicatorTemplate: "typingIndicatorTemplate", areReactionsEnabled: "areReactionsEnabled", enabledMessageActionsInput: ["enabledMessageActions", "enabledMessageActionsInput"], mode: "mode" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true }, { propertyName: "parentMessageElement", first: true, predicate: ["parentMessageElement"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n #scrollContainer\n data-testid=\"scroll-container\"\n class=\"str-chat__list\"\n (scroll)=\"scrolled()\"\n>\n <div class=\"str-chat__reverse-infinite-scroll\">\n <ul class=\"str-chat__ul\">\n <li\n #parentMessageElement\n *ngIf=\"mode === 'thread'\"\n data-testid=\"parent-message\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: parentMessage }\n \"\n ></ng-container>\n <div class=\"str-chat__thread-start\" translate>\n streamChat.Start of a new thread\n </div>\n </li>\n <li\n data-testclass=\"message\"\n *ngFor=\"\n let message of messages$ | async;\n let i = index;\n trackBy: trackByMessageId\n \"\n class=\"str-chat__li str-chat__li--{{ groupStyles[i] }}\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: message }\n \"\n ></ng-container>\n </li>\n </ul>\n <ng-container *ngIf=\"typingIndicatorTemplate; else defaultTypingIndicator\">\n <ng-container\n *ngTemplateOutlet=\"\n typingIndicatorTemplate;\n context: { usersTyping$: usersTyping$ }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultTypingIndicator>\n <div\n *ngIf=\"(usersTyping$ | async)?.length\"\n data-testid=\"typing-indicator\"\n class=\"str-chat__typing-indicator str-chat__typing-indicator--typing\"\n >\n <stream-avatar\n *ngFor=\"let user of usersTyping$ | async; trackBy: trackByUserId\"\n [name]=\"user.name || user.id\"\n [imageUrl]=\"user.image\"\n ></stream-avatar>\n <div class=\"str-chat__typing-indicator__dots\">\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n </div>\n </div>\n </ng-template>\n </div>\n</div>\n<div class=\"str-chat__list-notifications\">\n <button\n data-testid=\"scroll-to-bottom\"\n *ngIf=\"isUserScrolledUp\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-right\n str-chat__message-notification-scroll-down\n \"\n (keyup.enter)=\"scrollToBottom()\"\n (click)=\"scrollToBottom()\"\n >\n <div\n *ngIf=\"unreadMessageCount > 0\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-scroll-down-unread-count\n \"\n >\n {{ unreadMessageCount }}\n </div>\n </button>\n</div>\n\n<ng-template #messageTemplateContainer let-message=\"message\">\n <ng-container *ngIf=\"messageTemplate; else defaultMessageTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplate;\n context: {\n message: message,\n areReactionsEnabled: areReactionsEnabled,\n canReactToMessage: canReactToMessage,\n lastSentMessageId: !!(\n lastSentMessageId && message?.id === lastSentMessageId\n ),\n canReceiveReadEvents: canReceiveReadEvents,\n messageInputTemplate: messageInputTemplate,\n mentionTemplate: mentionTemplate,\n mode: mode\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultMessageTemplate>\n <stream-message\n [message]=\"message\"\n [areReactionsEnabled]=\"areReactionsEnabled\"\n [canReactToMessage]=\"canReactToMessage\"\n [isLastSentMessage]=\"\n !!(lastSentMessageId && message?.id === lastSentMessageId)\n \"\n [enabledMessageActions]=\"enabledMessageActions\"\n [canReceiveReadEvents]=\"canReceiveReadEvents\"\n [messageInputTemplate]=\"messageInputTemplate\"\n [mentionTemplate]=\"mentionTemplate\"\n [mode]=\"mode\"\n ></stream-message>\n </ng-template>\n</ng-template>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }, { type: MessageComponent, selector: "stream-message", inputs: ["messageInputTemplate", "mentionTemplate", "message", "enabledMessageActions", "areReactionsEnabled", "canReactToMessage", "isLastSentMessage", "canReceiveReadEvents", "mode"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6__namespace.AsyncPipe } });
|
|
4353
4686
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageListComponent, decorators: [{
|
|
4354
4687
|
type: i0.Component,
|
|
4355
4688
|
args: [{
|
|
@@ -4363,6 +4696,8 @@
|
|
|
4363
4696
|
type: i0.Input
|
|
4364
4697
|
}], mentionTemplate: [{
|
|
4365
4698
|
type: i0.Input
|
|
4699
|
+
}], typingIndicatorTemplate: [{
|
|
4700
|
+
type: i0.Input
|
|
4366
4701
|
}], areReactionsEnabled: [{
|
|
4367
4702
|
type: i0.Input
|
|
4368
4703
|
}], enabledMessageActionsInput: [{
|
|
@@ -4381,6 +4716,9 @@
|
|
|
4381
4716
|
args: ['parentMessageElement']
|
|
4382
4717
|
}] } });
|
|
4383
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
|
+
*/
|
|
4384
4722
|
var ThreadComponent = /** @class */ (function () {
|
|
4385
4723
|
function ThreadComponent(channelService) {
|
|
4386
4724
|
var _this = this;
|
|
@@ -4425,13 +4763,13 @@
|
|
|
4425
4763
|
return StreamAvatarModule;
|
|
4426
4764
|
}());
|
|
4427
4765
|
StreamAvatarModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
4428
|
-
StreamAvatarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, declarations: [AvatarComponent], imports: [
|
|
4429
|
-
StreamAvatarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, imports: [[
|
|
4766
|
+
StreamAvatarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, declarations: [AvatarComponent], imports: [i6.CommonModule, i2.TranslateModule], exports: [AvatarComponent] });
|
|
4767
|
+
StreamAvatarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, imports: [[i6.CommonModule, i2.TranslateModule]] });
|
|
4430
4768
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, decorators: [{
|
|
4431
4769
|
type: i0.NgModule,
|
|
4432
4770
|
args: [{
|
|
4433
4771
|
declarations: [AvatarComponent],
|
|
4434
|
-
imports: [
|
|
4772
|
+
imports: [i6.CommonModule, i2.TranslateModule],
|
|
4435
4773
|
exports: [AvatarComponent],
|
|
4436
4774
|
}]
|
|
4437
4775
|
}] });
|
|
@@ -4459,7 +4797,7 @@
|
|
|
4459
4797
|
AttachmentPreviewListComponent,
|
|
4460
4798
|
ModalComponent,
|
|
4461
4799
|
TextareaDirective,
|
|
4462
|
-
ThreadComponent], imports: [
|
|
4800
|
+
ThreadComponent], imports: [i6.CommonModule, i2.TranslateModule, StreamAvatarModule], exports: [ChannelComponent,
|
|
4463
4801
|
ChannelHeaderComponent,
|
|
4464
4802
|
ChannelListComponent,
|
|
4465
4803
|
ChannelPreviewComponent,
|
|
@@ -4477,7 +4815,7 @@
|
|
|
4477
4815
|
ModalComponent,
|
|
4478
4816
|
StreamAvatarModule,
|
|
4479
4817
|
ThreadComponent] });
|
|
4480
|
-
StreamChatModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, imports: [[
|
|
4818
|
+
StreamChatModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, imports: [[i6.CommonModule, i2.TranslateModule, StreamAvatarModule], StreamAvatarModule] });
|
|
4481
4819
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, decorators: [{
|
|
4482
4820
|
type: i0.NgModule,
|
|
4483
4821
|
args: [{
|
|
@@ -4501,7 +4839,7 @@
|
|
|
4501
4839
|
TextareaDirective,
|
|
4502
4840
|
ThreadComponent,
|
|
4503
4841
|
],
|
|
4504
|
-
imports: [
|
|
4842
|
+
imports: [i6.CommonModule, i2.TranslateModule, StreamAvatarModule],
|
|
4505
4843
|
exports: [
|
|
4506
4844
|
ChannelComponent,
|
|
4507
4845
|
ChannelHeaderComponent,
|
|
@@ -4531,18 +4869,18 @@
|
|
|
4531
4869
|
return StreamAutocompleteTextareaModule;
|
|
4532
4870
|
}());
|
|
4533
4871
|
StreamAutocompleteTextareaModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
4534
|
-
StreamAutocompleteTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, declarations: [AutocompleteTextareaComponent], imports: [
|
|
4872
|
+
StreamAutocompleteTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, declarations: [AutocompleteTextareaComponent], imports: [i6.CommonModule, i2.TranslateModule, i6$1.MentionModule, StreamAvatarModule], exports: [AutocompleteTextareaComponent] });
|
|
4535
4873
|
StreamAutocompleteTextareaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, providers: [
|
|
4536
4874
|
{
|
|
4537
4875
|
provide: textareaInjectionToken,
|
|
4538
4876
|
useValue: AutocompleteTextareaComponent,
|
|
4539
4877
|
},
|
|
4540
|
-
], imports: [[
|
|
4878
|
+
], imports: [[i6.CommonModule, i2.TranslateModule, i6$1.MentionModule, StreamAvatarModule]] });
|
|
4541
4879
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, decorators: [{
|
|
4542
4880
|
type: i0.NgModule,
|
|
4543
4881
|
args: [{
|
|
4544
4882
|
declarations: [AutocompleteTextareaComponent],
|
|
4545
|
-
imports: [
|
|
4883
|
+
imports: [i6.CommonModule, i2.TranslateModule, i6$1.MentionModule, StreamAvatarModule],
|
|
4546
4884
|
exports: [AutocompleteTextareaComponent],
|
|
4547
4885
|
providers: [
|
|
4548
4886
|
{
|
|
@@ -4559,18 +4897,18 @@
|
|
|
4559
4897
|
return StreamTextareaModule;
|
|
4560
4898
|
}());
|
|
4561
4899
|
StreamTextareaModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
4562
|
-
StreamTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, declarations: [TextareaComponent], imports: [
|
|
4900
|
+
StreamTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, declarations: [TextareaComponent], imports: [i6.CommonModule, i2.TranslateModule], exports: [TextareaComponent] });
|
|
4563
4901
|
StreamTextareaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, providers: [
|
|
4564
4902
|
{
|
|
4565
4903
|
provide: textareaInjectionToken,
|
|
4566
4904
|
useValue: TextareaComponent,
|
|
4567
4905
|
},
|
|
4568
|
-
], imports: [[
|
|
4906
|
+
], imports: [[i6.CommonModule, i2.TranslateModule]] });
|
|
4569
4907
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, decorators: [{
|
|
4570
4908
|
type: i0.NgModule,
|
|
4571
4909
|
args: [{
|
|
4572
4910
|
declarations: [TextareaComponent],
|
|
4573
|
-
imports: [
|
|
4911
|
+
imports: [i6.CommonModule, i2.TranslateModule],
|
|
4574
4912
|
exports: [TextareaComponent],
|
|
4575
4913
|
providers: [
|
|
4576
4914
|
{
|