stream-chat-angular 2.10.0 → 2.12.2
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/i18n/en.d.ts +2 -0
- package/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +670 -337
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/i18n/en.js +3 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/channel/channel.component.js +3 -2
- package/esm2015/lib/channel.service.js +170 -40
- package/esm2015/lib/icon/icon.component.js +2 -2
- package/esm2015/lib/message/message.component.js +67 -42
- package/esm2015/lib/message-actions-box/message-actions-box.component.js +7 -4
- package/esm2015/lib/message-input/message-input.component.js +61 -13
- package/esm2015/lib/message-list/message-list.component.js +104 -53
- package/esm2015/lib/message-preview.js +4 -2
- package/esm2015/lib/message-reactions/message-reactions.component.js +2 -2
- package/esm2015/lib/stream-chat.module.js +8 -3
- package/esm2015/lib/thread/thread.component.js +37 -0
- package/esm2015/public-api.js +2 -1
- package/fesm2015/stream-chat-angular.js +541 -246
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/channel/channel.component.d.ts +2 -1
- package/lib/channel.service.d.ts +21 -7
- package/lib/icon/icon.component.d.ts +1 -1
- package/lib/message/message.component.d.ts +16 -6
- package/lib/message-input/message-input.component.d.ts +7 -1
- package/lib/message-list/message-list.component.d.ts +12 -3
- package/lib/message-preview.d.ts +1 -1
- package/lib/stream-chat.module.d.ts +5 -4
- package/lib/thread/thread.component.d.ts +18 -0
- package/package.json +2 -11
- package/public-api.d.ts +1 -0
- package/src/assets/i18n/en.ts +4 -0
- package/src/assets/version.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
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('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('stream-chat-angular', ['exports', '@angular/core', 'rxjs', 'stream-chat', 'rxjs/operators', 'uuid', '@ngx-translate/core', '@angular/common', 'dayjs', 'dayjs/plugin/calendar', '
|
|
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.
|
|
5
|
-
}(this, (function (exports, i0, rxjs, streamChat, operators, uuid,
|
|
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('@stream-io/transliterate'), require('angular-mentions')) :
|
|
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', '@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.i1, global.ng.common, global.prettybytes, global.Dayjs, global.calendar, global.transliterate, global.i5));
|
|
5
|
+
}(this, (function (exports, i0, rxjs, streamChat, operators, uuid, i1, i6, prettybytes, Dayjs, calendar, transliterate, i5) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
30
|
-
var
|
|
30
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
31
31
|
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
32
|
+
var prettybytes__default = /*#__PURE__*/_interopDefaultLegacy(prettybytes);
|
|
32
33
|
var Dayjs__default = /*#__PURE__*/_interopDefaultLegacy(Dayjs);
|
|
33
34
|
var calendar__default = /*#__PURE__*/_interopDefaultLegacy(calendar);
|
|
34
|
-
var prettybytes__default = /*#__PURE__*/_interopDefaultLegacy(prettybytes);
|
|
35
35
|
var transliterate__default = /*#__PURE__*/_interopDefaultLegacy(transliterate);
|
|
36
36
|
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
37
37
|
|
|
@@ -353,7 +353,7 @@
|
|
|
353
353
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
-
var version = '2.
|
|
356
|
+
var version = '2.12.2';
|
|
357
357
|
|
|
358
358
|
var NotificationService = /** @class */ (function () {
|
|
359
359
|
function NotificationService() {
|
|
@@ -541,7 +541,11 @@
|
|
|
541
541
|
}]
|
|
542
542
|
}], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: NotificationService }]; } });
|
|
543
543
|
|
|
544
|
-
var createMessagePreview = function (user, text, attachments, mentionedUsers) {
|
|
544
|
+
var createMessagePreview = function (user, text, attachments, mentionedUsers, parentId, quotedMessageId) {
|
|
545
|
+
if (attachments === void 0) { attachments = []; }
|
|
546
|
+
if (mentionedUsers === void 0) { mentionedUsers = []; }
|
|
547
|
+
if (parentId === void 0) { parentId = undefined; }
|
|
548
|
+
if (quotedMessageId === void 0) { quotedMessageId = undefined; }
|
|
545
549
|
var clientSideId = user.id + "-" + uuid.v4();
|
|
546
550
|
return {
|
|
547
551
|
__html: text,
|
|
@@ -555,6 +559,8 @@
|
|
|
555
559
|
user: user,
|
|
556
560
|
attachments: attachments,
|
|
557
561
|
mentioned_users: mentionedUsers,
|
|
562
|
+
parent_id: parentId,
|
|
563
|
+
quoted_message_id: quotedMessageId,
|
|
558
564
|
};
|
|
559
565
|
};
|
|
560
566
|
|
|
@@ -581,31 +587,53 @@
|
|
|
581
587
|
this.activeChannelMessagesSubject = new rxjs.BehaviorSubject([]);
|
|
582
588
|
this.hasMoreChannelsSubject = new rxjs.ReplaySubject(1);
|
|
583
589
|
this.activeChannelSubscriptions = [];
|
|
590
|
+
this.activeParentMessageIdSubject = new rxjs.BehaviorSubject(undefined);
|
|
591
|
+
this.activeThreadMessagesSubject = new rxjs.BehaviorSubject([]);
|
|
592
|
+
this.messagePageSize = 25;
|
|
593
|
+
this.messageToQuoteSubject = new rxjs.BehaviorSubject(undefined);
|
|
584
594
|
this.channelListSetter = function (channels) {
|
|
585
595
|
_this.channelsSubject.next(channels);
|
|
586
596
|
};
|
|
587
597
|
this.messageListSetter = function (messages) {
|
|
588
598
|
_this.activeChannelMessagesSubject.next(messages);
|
|
589
599
|
};
|
|
600
|
+
this.threadListSetter = function (messages) {
|
|
601
|
+
_this.activeThreadMessagesSubject.next(messages);
|
|
602
|
+
};
|
|
603
|
+
this.parentMessageSetter = function (message) {
|
|
604
|
+
_this.activeParentMessageIdSubject.next(message === null || message === void 0 ? void 0 : message.id);
|
|
605
|
+
};
|
|
590
606
|
this.channels$ = this.channelsSubject.asObservable();
|
|
591
607
|
this.activeChannel$ = this.activeChannelSubject.asObservable();
|
|
592
608
|
this.activeChannelMessages$ = this.activeChannelMessagesSubject.pipe(operators.map(function (messages) {
|
|
593
609
|
var channel = _this.activeChannelSubject.getValue();
|
|
594
|
-
return messages.map(function (message) {
|
|
595
|
-
if (_this.isStreamMessage(message) &&
|
|
596
|
-
_this.isFormatMessageResponse(message)) {
|
|
597
|
-
return message;
|
|
598
|
-
}
|
|
599
|
-
else if (_this.isFormatMessageResponse(message)) {
|
|
600
|
-
return Object.assign(Object.assign({}, message), { readBy: getReadBy(message, channel) });
|
|
601
|
-
}
|
|
602
|
-
else {
|
|
603
|
-
var formatMessage = _this.formatMessage(message);
|
|
604
|
-
return Object.assign(Object.assign({}, formatMessage), { readBy: getReadBy(formatMessage, channel) });
|
|
605
|
-
}
|
|
606
|
-
});
|
|
610
|
+
return messages.map(function (message) { return _this.transformToStreamMessage(message, channel); });
|
|
607
611
|
}));
|
|
608
612
|
this.hasMoreChannels$ = this.hasMoreChannelsSubject.asObservable();
|
|
613
|
+
this.activeParentMessageId$ =
|
|
614
|
+
this.activeParentMessageIdSubject.asObservable();
|
|
615
|
+
this.activeThreadMessages$ = this.activeThreadMessagesSubject.pipe(operators.map(function (messages) {
|
|
616
|
+
var channel = _this.activeChannelSubject.getValue();
|
|
617
|
+
return messages.map(function (message) { return _this.transformToStreamMessage(message, channel); });
|
|
618
|
+
}));
|
|
619
|
+
this.activeParentMessage$ = rxjs.combineLatest([
|
|
620
|
+
this.activeChannelMessages$,
|
|
621
|
+
this.activeParentMessageId$,
|
|
622
|
+
]).pipe(operators.map(function (_f) {
|
|
623
|
+
var _g = __read(_f, 2), messages = _g[0], parentMessageId = _g[1];
|
|
624
|
+
if (!parentMessageId) {
|
|
625
|
+
return undefined;
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
return messages.find(function (m) { return m.id === parentMessageId; });
|
|
629
|
+
}
|
|
630
|
+
}), operators.shareReplay());
|
|
631
|
+
this.messageToQuote$ = this.messageToQuoteSubject.asObservable();
|
|
632
|
+
this.chatClientService.connectionState$
|
|
633
|
+
.pipe(operators.filter(function (s) { return s === 'online'; }))
|
|
634
|
+
.subscribe(function () {
|
|
635
|
+
void _this.setAsActiveParentMessage(undefined);
|
|
636
|
+
});
|
|
609
637
|
}
|
|
610
638
|
ChannelService.prototype.setAsActiveChannel = function (channel) {
|
|
611
639
|
var prevActiveChannel = this.activeChannelSubject.getValue();
|
|
@@ -619,25 +647,59 @@
|
|
|
619
647
|
void channel.markRead();
|
|
620
648
|
}
|
|
621
649
|
this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
650
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
651
|
+
this.activeThreadMessagesSubject.next([]);
|
|
652
|
+
this.messageToQuoteSubject.next(undefined);
|
|
653
|
+
};
|
|
654
|
+
ChannelService.prototype.setAsActiveParentMessage = function (message) {
|
|
655
|
+
var _a;
|
|
656
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
657
|
+
var messageToQuote, activeChannel, result;
|
|
658
|
+
return __generator(this, function (_f) {
|
|
659
|
+
switch (_f.label) {
|
|
660
|
+
case 0:
|
|
661
|
+
messageToQuote = this.messageToQuoteSubject.getValue();
|
|
662
|
+
if (messageToQuote && !!messageToQuote.parent_id) {
|
|
663
|
+
this.messageToQuoteSubject.next(undefined);
|
|
664
|
+
}
|
|
665
|
+
if (!!message) return [3 /*break*/, 1];
|
|
666
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
667
|
+
this.activeThreadMessagesSubject.next([]);
|
|
668
|
+
return [3 /*break*/, 3];
|
|
669
|
+
case 1:
|
|
670
|
+
this.activeParentMessageIdSubject.next(message.id);
|
|
671
|
+
activeChannel = this.activeChannelSubject.getValue();
|
|
672
|
+
return [4 /*yield*/, (activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.getReplies(message.id, {
|
|
673
|
+
limit: (_a = this.options) === null || _a === void 0 ? void 0 : _a.message_limit,
|
|
674
|
+
}))];
|
|
675
|
+
case 2:
|
|
676
|
+
result = _f.sent();
|
|
677
|
+
this.activeThreadMessagesSubject.next((result === null || result === void 0 ? void 0 : result.messages) || []);
|
|
678
|
+
_f.label = 3;
|
|
679
|
+
case 3: return [2 /*return*/];
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
});
|
|
622
683
|
};
|
|
684
|
+
// load more thread replies
|
|
623
685
|
ChannelService.prototype.loadMoreMessages = function () {
|
|
624
|
-
var _a, _b, _c, _d;
|
|
686
|
+
var _a, _b, _c, _d, _e;
|
|
625
687
|
return __awaiter(this, void 0, void 0, function () {
|
|
626
688
|
var activeChnannel, lastMessageId;
|
|
627
|
-
return __generator(this, function (
|
|
628
|
-
switch (
|
|
689
|
+
return __generator(this, function (_f) {
|
|
690
|
+
switch (_f.label) {
|
|
629
691
|
case 0:
|
|
630
692
|
activeChnannel = this.activeChannelSubject.getValue();
|
|
631
693
|
lastMessageId = (_a = this.activeChannelMessagesSubject.getValue()[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
632
694
|
return [4 /*yield*/, (activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.query({
|
|
633
|
-
messages: { limit:
|
|
695
|
+
messages: { limit: (_b = this.options) === null || _b === void 0 ? void 0 : _b.message_limit, id_lt: lastMessageId },
|
|
634
696
|
members: { limit: 0 },
|
|
635
697
|
watchers: { limit: 0 },
|
|
636
698
|
}))];
|
|
637
699
|
case 1:
|
|
638
|
-
|
|
639
|
-
if (((
|
|
640
|
-
((
|
|
700
|
+
_f.sent();
|
|
701
|
+
if (((_c = activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.data) === null || _c === void 0 ? void 0 : _c.id) ===
|
|
702
|
+
((_e = (_d = this.activeChannelSubject.getValue()) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.id)) {
|
|
641
703
|
this.activeChannelMessagesSubject.next(__spreadArray([], __read(activeChnannel.state.messages)));
|
|
642
704
|
}
|
|
643
705
|
return [2 /*return*/];
|
|
@@ -645,11 +707,36 @@
|
|
|
645
707
|
});
|
|
646
708
|
});
|
|
647
709
|
};
|
|
710
|
+
ChannelService.prototype.loadMoreThreadReplies = function () {
|
|
711
|
+
var _a, _b;
|
|
712
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
713
|
+
var activeChnannel, parentMessageId, lastMessageId;
|
|
714
|
+
return __generator(this, function (_f) {
|
|
715
|
+
switch (_f.label) {
|
|
716
|
+
case 0:
|
|
717
|
+
activeChnannel = this.activeChannelSubject.getValue();
|
|
718
|
+
parentMessageId = this.activeParentMessageIdSubject.getValue();
|
|
719
|
+
if (!parentMessageId) {
|
|
720
|
+
return [2 /*return*/];
|
|
721
|
+
}
|
|
722
|
+
lastMessageId = (_a = this.activeThreadMessagesSubject.getValue()[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
723
|
+
return [4 /*yield*/, (activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.getReplies(parentMessageId, {
|
|
724
|
+
limit: (_b = this.options) === null || _b === void 0 ? void 0 : _b.message_limit,
|
|
725
|
+
id_lt: lastMessageId,
|
|
726
|
+
}))];
|
|
727
|
+
case 1:
|
|
728
|
+
_f.sent();
|
|
729
|
+
this.activeThreadMessagesSubject.next((activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.state.threads[parentMessageId]) || []);
|
|
730
|
+
return [2 /*return*/];
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
});
|
|
734
|
+
};
|
|
648
735
|
ChannelService.prototype.init = function (filters, sort, options) {
|
|
649
736
|
return __awaiter(this, void 0, void 0, function () {
|
|
650
737
|
var _this = this;
|
|
651
|
-
return __generator(this, function (
|
|
652
|
-
switch (
|
|
738
|
+
return __generator(this, function (_f) {
|
|
739
|
+
switch (_f.label) {
|
|
653
740
|
case 0:
|
|
654
741
|
this.filters = filters;
|
|
655
742
|
this.options = options || {
|
|
@@ -658,12 +745,12 @@
|
|
|
658
745
|
state: true,
|
|
659
746
|
presence: true,
|
|
660
747
|
watch: true,
|
|
661
|
-
message_limit:
|
|
748
|
+
message_limit: this.messagePageSize,
|
|
662
749
|
};
|
|
663
750
|
this.sort = sort || { last_message_at: -1, updated_at: -1 };
|
|
664
751
|
return [4 /*yield*/, this.queryChannels()];
|
|
665
752
|
case 1:
|
|
666
|
-
|
|
753
|
+
_f.sent();
|
|
667
754
|
this.chatClientService.notification$.subscribe(function (notification) { return void _this.handleNotification(notification); });
|
|
668
755
|
return [2 /*return*/];
|
|
669
756
|
}
|
|
@@ -673,17 +760,20 @@
|
|
|
673
760
|
ChannelService.prototype.reset = function () {
|
|
674
761
|
this.activeChannelMessagesSubject.next([]);
|
|
675
762
|
this.activeChannelSubject.next(undefined);
|
|
763
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
764
|
+
this.activeThreadMessagesSubject.next([]);
|
|
676
765
|
this.channelsSubject.next(undefined);
|
|
766
|
+
this.selectMessageToQuote(undefined);
|
|
677
767
|
};
|
|
678
768
|
ChannelService.prototype.loadMoreChannels = function () {
|
|
679
769
|
return __awaiter(this, void 0, void 0, function () {
|
|
680
|
-
return __generator(this, function (
|
|
681
|
-
switch (
|
|
770
|
+
return __generator(this, function (_f) {
|
|
771
|
+
switch (_f.label) {
|
|
682
772
|
case 0:
|
|
683
773
|
this.options.offset = this.channels.length;
|
|
684
774
|
return [4 /*yield*/, this.queryChannels()];
|
|
685
775
|
case 1:
|
|
686
|
-
|
|
776
|
+
_f.sent();
|
|
687
777
|
return [2 /*return*/];
|
|
688
778
|
}
|
|
689
779
|
});
|
|
@@ -692,13 +782,13 @@
|
|
|
692
782
|
ChannelService.prototype.addReaction = function (messageId, reactionType) {
|
|
693
783
|
var _a;
|
|
694
784
|
return __awaiter(this, void 0, void 0, function () {
|
|
695
|
-
return __generator(this, function (
|
|
696
|
-
switch (
|
|
785
|
+
return __generator(this, function (_f) {
|
|
786
|
+
switch (_f.label) {
|
|
697
787
|
case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject.getValue()) === null || _a === void 0 ? void 0 : _a.sendReaction(messageId, {
|
|
698
788
|
type: reactionType,
|
|
699
789
|
}))];
|
|
700
790
|
case 1:
|
|
701
|
-
|
|
791
|
+
_f.sent();
|
|
702
792
|
return [2 /*return*/];
|
|
703
793
|
}
|
|
704
794
|
});
|
|
@@ -707,32 +797,34 @@
|
|
|
707
797
|
ChannelService.prototype.removeReaction = function (messageId, reactionType) {
|
|
708
798
|
var _a;
|
|
709
799
|
return __awaiter(this, void 0, void 0, function () {
|
|
710
|
-
return __generator(this, function (
|
|
711
|
-
switch (
|
|
800
|
+
return __generator(this, function (_f) {
|
|
801
|
+
switch (_f.label) {
|
|
712
802
|
case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject
|
|
713
803
|
.getValue()) === null || _a === void 0 ? void 0 : _a.deleteReaction(messageId, reactionType))];
|
|
714
804
|
case 1:
|
|
715
|
-
|
|
805
|
+
_f.sent();
|
|
716
806
|
return [2 /*return*/];
|
|
717
807
|
}
|
|
718
808
|
});
|
|
719
809
|
});
|
|
720
810
|
};
|
|
721
|
-
ChannelService.prototype.sendMessage = function (text, attachments, mentionedUsers) {
|
|
811
|
+
ChannelService.prototype.sendMessage = function (text, attachments, mentionedUsers, parentId, quotedMessageId) {
|
|
722
812
|
if (attachments === void 0) { attachments = []; }
|
|
723
813
|
if (mentionedUsers === void 0) { mentionedUsers = []; }
|
|
814
|
+
if (parentId === void 0) { parentId = undefined; }
|
|
815
|
+
if (quotedMessageId === void 0) { quotedMessageId = undefined; }
|
|
724
816
|
return __awaiter(this, void 0, void 0, function () {
|
|
725
817
|
var preview, channel;
|
|
726
|
-
return __generator(this, function (
|
|
727
|
-
switch (
|
|
818
|
+
return __generator(this, function (_f) {
|
|
819
|
+
switch (_f.label) {
|
|
728
820
|
case 0:
|
|
729
|
-
preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers);
|
|
821
|
+
preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers, parentId, quotedMessageId);
|
|
730
822
|
channel = this.activeChannelSubject.getValue();
|
|
731
823
|
preview.readBy = [];
|
|
732
824
|
channel.state.addMessageSorted(preview, true);
|
|
733
825
|
return [4 /*yield*/, this.sendMessageRequest(preview)];
|
|
734
826
|
case 1:
|
|
735
|
-
|
|
827
|
+
_f.sent();
|
|
736
828
|
return [2 /*return*/];
|
|
737
829
|
}
|
|
738
830
|
});
|
|
@@ -741,14 +833,14 @@
|
|
|
741
833
|
ChannelService.prototype.resendMessage = function (message) {
|
|
742
834
|
return __awaiter(this, void 0, void 0, function () {
|
|
743
835
|
var channel;
|
|
744
|
-
return __generator(this, function (
|
|
745
|
-
switch (
|
|
836
|
+
return __generator(this, function (_f) {
|
|
837
|
+
switch (_f.label) {
|
|
746
838
|
case 0:
|
|
747
839
|
channel = this.activeChannelSubject.getValue();
|
|
748
840
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, message), { errorStatusCode: undefined, status: 'sending' }), true);
|
|
749
841
|
return [4 /*yield*/, this.sendMessageRequest(message)];
|
|
750
842
|
case 1:
|
|
751
|
-
|
|
843
|
+
_f.sent();
|
|
752
844
|
return [2 /*return*/];
|
|
753
845
|
}
|
|
754
846
|
});
|
|
@@ -756,11 +848,11 @@
|
|
|
756
848
|
};
|
|
757
849
|
ChannelService.prototype.updateMessage = function (message) {
|
|
758
850
|
return __awaiter(this, void 0, void 0, function () {
|
|
759
|
-
return __generator(this, function (
|
|
760
|
-
switch (
|
|
851
|
+
return __generator(this, function (_f) {
|
|
852
|
+
switch (_f.label) {
|
|
761
853
|
case 0: return [4 /*yield*/, this.chatClientService.chatClient.updateMessage(message)];
|
|
762
854
|
case 1:
|
|
763
|
-
|
|
855
|
+
_f.sent();
|
|
764
856
|
return [2 /*return*/];
|
|
765
857
|
}
|
|
766
858
|
});
|
|
@@ -768,11 +860,11 @@
|
|
|
768
860
|
};
|
|
769
861
|
ChannelService.prototype.deleteMessage = function (message) {
|
|
770
862
|
return __awaiter(this, void 0, void 0, function () {
|
|
771
|
-
return __generator(this, function (
|
|
772
|
-
switch (
|
|
863
|
+
return __generator(this, function (_f) {
|
|
864
|
+
switch (_f.label) {
|
|
773
865
|
case 0: return [4 /*yield*/, this.chatClientService.chatClient.deleteMessage(message.id)];
|
|
774
866
|
case 1:
|
|
775
|
-
|
|
867
|
+
_f.sent();
|
|
776
868
|
return [2 /*return*/];
|
|
777
869
|
}
|
|
778
870
|
});
|
|
@@ -781,8 +873,8 @@
|
|
|
781
873
|
ChannelService.prototype.uploadAttachments = function (uploads) {
|
|
782
874
|
return __awaiter(this, void 0, void 0, function () {
|
|
783
875
|
var result, channel, uploadResults;
|
|
784
|
-
return __generator(this, function (
|
|
785
|
-
switch (
|
|
876
|
+
return __generator(this, function (_f) {
|
|
877
|
+
switch (_f.label) {
|
|
786
878
|
case 0:
|
|
787
879
|
result = [];
|
|
788
880
|
channel = this.activeChannelSubject.getValue();
|
|
@@ -790,7 +882,7 @@
|
|
|
790
882
|
? channel.sendImage(upload.file)
|
|
791
883
|
: channel.sendFile(upload.file); }))];
|
|
792
884
|
case 1:
|
|
793
|
-
uploadResults =
|
|
885
|
+
uploadResults = _f.sent();
|
|
794
886
|
uploadResults.forEach(function (uploadResult, i) {
|
|
795
887
|
var file = uploads[i].file;
|
|
796
888
|
var type = uploads[i].type;
|
|
@@ -814,15 +906,15 @@
|
|
|
814
906
|
ChannelService.prototype.deleteAttachment = function (attachmentUpload) {
|
|
815
907
|
return __awaiter(this, void 0, void 0, function () {
|
|
816
908
|
var channel;
|
|
817
|
-
return __generator(this, function (
|
|
818
|
-
switch (
|
|
909
|
+
return __generator(this, function (_f) {
|
|
910
|
+
switch (_f.label) {
|
|
819
911
|
case 0:
|
|
820
912
|
channel = this.activeChannelSubject.getValue();
|
|
821
913
|
return [4 /*yield*/, (attachmentUpload.type === 'image'
|
|
822
914
|
? channel.deleteImage(attachmentUpload.url)
|
|
823
915
|
: channel.deleteFile(attachmentUpload.url))];
|
|
824
916
|
case 1:
|
|
825
|
-
|
|
917
|
+
_f.sent();
|
|
826
918
|
return [2 /*return*/];
|
|
827
919
|
}
|
|
828
920
|
});
|
|
@@ -832,8 +924,8 @@
|
|
|
832
924
|
return __awaiter(this, void 0, void 0, function () {
|
|
833
925
|
var activeChannel, result;
|
|
834
926
|
var _this = this;
|
|
835
|
-
return __generator(this, function (
|
|
836
|
-
switch (
|
|
927
|
+
return __generator(this, function (_f) {
|
|
928
|
+
switch (_f.label) {
|
|
837
929
|
case 0:
|
|
838
930
|
activeChannel = this.activeChannelSubject.getValue();
|
|
839
931
|
if (!activeChannel) {
|
|
@@ -850,7 +942,7 @@
|
|
|
850
942
|
id: { $ne: this.chatClientService.chatClient.userID },
|
|
851
943
|
})];
|
|
852
944
|
case 2:
|
|
853
|
-
result =
|
|
945
|
+
result = _f.sent();
|
|
854
946
|
return [2 /*return*/, Object.values(result.members)];
|
|
855
947
|
}
|
|
856
948
|
});
|
|
@@ -858,60 +950,84 @@
|
|
|
858
950
|
};
|
|
859
951
|
ChannelService.prototype.sendAction = function (messageId, formData) {
|
|
860
952
|
return __awaiter(this, void 0, void 0, function () {
|
|
861
|
-
var channel, response;
|
|
862
|
-
return __generator(this, function (
|
|
863
|
-
switch (
|
|
953
|
+
var channel, response, isThreadReply;
|
|
954
|
+
return __generator(this, function (_f) {
|
|
955
|
+
switch (_f.label) {
|
|
864
956
|
case 0:
|
|
865
957
|
channel = this.activeChannelSubject.getValue();
|
|
866
958
|
return [4 /*yield*/, channel.sendAction(messageId, formData)];
|
|
867
959
|
case 1:
|
|
868
|
-
response =
|
|
960
|
+
response = _f.sent();
|
|
869
961
|
if (response === null || response === void 0 ? void 0 : response.message) {
|
|
870
962
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, response.message), { status: 'received' }));
|
|
871
|
-
|
|
963
|
+
isThreadReply = !!response.message.parent_id;
|
|
964
|
+
isThreadReply
|
|
965
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[response.message.parent_id])))
|
|
966
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
872
967
|
}
|
|
873
968
|
else {
|
|
874
969
|
channel.state.removeMessage({ id: messageId });
|
|
875
|
-
this.activeChannelMessagesSubject
|
|
970
|
+
if (this.activeChannelMessagesSubject
|
|
971
|
+
.getValue()
|
|
972
|
+
.find(function (m) { return m.id === messageId; })) {
|
|
973
|
+
this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
974
|
+
}
|
|
975
|
+
else if (this.activeThreadMessagesSubject
|
|
976
|
+
.getValue()
|
|
977
|
+
.find(function (m) { return m.id === messageId; })) {
|
|
978
|
+
this.activeThreadMessagesSubject.next(channel.state.threads[this.activeParentMessageIdSubject.getValue()]);
|
|
979
|
+
}
|
|
876
980
|
}
|
|
877
981
|
return [2 /*return*/];
|
|
878
982
|
}
|
|
879
983
|
});
|
|
880
984
|
});
|
|
881
985
|
};
|
|
986
|
+
ChannelService.prototype.selectMessageToQuote = function (message) {
|
|
987
|
+
this.messageToQuoteSubject.next(message);
|
|
988
|
+
};
|
|
882
989
|
ChannelService.prototype.sendMessageRequest = function (preview) {
|
|
883
990
|
var _a;
|
|
884
991
|
return __awaiter(this, void 0, void 0, function () {
|
|
885
|
-
var channel, response, error_1, stringError, parsedError;
|
|
886
|
-
return __generator(this, function (
|
|
887
|
-
switch (
|
|
992
|
+
var channel, isThreadReply, response, error_1, stringError, parsedError;
|
|
993
|
+
return __generator(this, function (_f) {
|
|
994
|
+
switch (_f.label) {
|
|
888
995
|
case 0:
|
|
889
996
|
channel = this.activeChannelSubject.getValue();
|
|
890
|
-
|
|
891
|
-
|
|
997
|
+
isThreadReply = !!preview.parent_id;
|
|
998
|
+
isThreadReply
|
|
999
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
1000
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
1001
|
+
_f.label = 1;
|
|
892
1002
|
case 1:
|
|
893
|
-
|
|
1003
|
+
_f.trys.push([1, 3, , 4]);
|
|
894
1004
|
return [4 /*yield*/, channel.sendMessage({
|
|
895
1005
|
text: preview.text,
|
|
896
1006
|
attachments: preview.attachments,
|
|
897
1007
|
mentioned_users: (_a = preview.mentioned_users) === null || _a === void 0 ? void 0 : _a.map(function (u) { return u.id; }),
|
|
898
1008
|
id: preview.id,
|
|
1009
|
+
parent_id: preview.parent_id,
|
|
1010
|
+
quoted_message_id: preview.quoted_message_id,
|
|
899
1011
|
})];
|
|
900
1012
|
case 2:
|
|
901
|
-
response =
|
|
1013
|
+
response = _f.sent();
|
|
902
1014
|
if (response === null || response === void 0 ? void 0 : response.message) {
|
|
903
1015
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, response.message), { status: 'received' }), true);
|
|
904
|
-
|
|
1016
|
+
isThreadReply
|
|
1017
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
1018
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
905
1019
|
}
|
|
906
1020
|
return [3 /*break*/, 4];
|
|
907
1021
|
case 3:
|
|
908
|
-
error_1 =
|
|
1022
|
+
error_1 = _f.sent();
|
|
909
1023
|
stringError = JSON.stringify(error_1);
|
|
910
1024
|
parsedError = stringError
|
|
911
1025
|
? JSON.parse(stringError)
|
|
912
1026
|
: {};
|
|
913
1027
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, preview), { errorStatusCode: parsedError.status || undefined, status: 'failed' }), true);
|
|
914
|
-
|
|
1028
|
+
isThreadReply
|
|
1029
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
1030
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
915
1031
|
return [3 /*break*/, 4];
|
|
916
1032
|
case 4: return [2 /*return*/];
|
|
917
1033
|
}
|
|
@@ -920,53 +1036,53 @@
|
|
|
920
1036
|
};
|
|
921
1037
|
ChannelService.prototype.handleNotification = function (notification) {
|
|
922
1038
|
return __awaiter(this, void 0, void 0, function () {
|
|
923
|
-
var
|
|
1039
|
+
var _f;
|
|
924
1040
|
var _this = this;
|
|
925
|
-
return __generator(this, function (
|
|
926
|
-
switch (
|
|
1041
|
+
return __generator(this, function (_g) {
|
|
1042
|
+
switch (_g.label) {
|
|
927
1043
|
case 0:
|
|
928
|
-
|
|
929
|
-
switch (
|
|
1044
|
+
_f = notification.eventType;
|
|
1045
|
+
switch (_f) {
|
|
930
1046
|
case 'notification.message_new': return [3 /*break*/, 1];
|
|
931
1047
|
case 'notification.added_to_channel': return [3 /*break*/, 3];
|
|
932
1048
|
case 'notification.removed_from_channel': return [3 /*break*/, 5];
|
|
933
1049
|
}
|
|
934
1050
|
return [3 /*break*/, 6];
|
|
935
1051
|
case 1: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
936
|
-
return __generator(this, function (
|
|
937
|
-
switch (
|
|
1052
|
+
return __generator(this, function (_f) {
|
|
1053
|
+
switch (_f.label) {
|
|
938
1054
|
case 0:
|
|
939
1055
|
if (!this.customNewMessageNotificationHandler) return [3 /*break*/, 1];
|
|
940
1056
|
this.customNewMessageNotificationHandler(notification, this.channelListSetter);
|
|
941
1057
|
return [3 /*break*/, 3];
|
|
942
1058
|
case 1: return [4 /*yield*/, this.handleNewMessageNotification(notification)];
|
|
943
1059
|
case 2:
|
|
944
|
-
|
|
945
|
-
|
|
1060
|
+
_f.sent();
|
|
1061
|
+
_f.label = 3;
|
|
946
1062
|
case 3: return [2 /*return*/];
|
|
947
1063
|
}
|
|
948
1064
|
});
|
|
949
1065
|
}); })];
|
|
950
1066
|
case 2:
|
|
951
|
-
|
|
1067
|
+
_g.sent();
|
|
952
1068
|
return [3 /*break*/, 6];
|
|
953
1069
|
case 3: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
954
|
-
return __generator(this, function (
|
|
955
|
-
switch (
|
|
1070
|
+
return __generator(this, function (_f) {
|
|
1071
|
+
switch (_f.label) {
|
|
956
1072
|
case 0:
|
|
957
1073
|
if (!this.customAddedToChannelNotificationHandler) return [3 /*break*/, 1];
|
|
958
1074
|
this.customAddedToChannelNotificationHandler(notification, this.channelListSetter);
|
|
959
1075
|
return [3 /*break*/, 3];
|
|
960
1076
|
case 1: return [4 /*yield*/, this.handleAddedToChannelNotification(notification)];
|
|
961
1077
|
case 2:
|
|
962
|
-
|
|
963
|
-
|
|
1078
|
+
_f.sent();
|
|
1079
|
+
_f.label = 3;
|
|
964
1080
|
case 3: return [2 /*return*/];
|
|
965
1081
|
}
|
|
966
1082
|
});
|
|
967
1083
|
}); })];
|
|
968
1084
|
case 4:
|
|
969
|
-
|
|
1085
|
+
_g.sent();
|
|
970
1086
|
return [3 /*break*/, 6];
|
|
971
1087
|
case 5:
|
|
972
1088
|
{
|
|
@@ -979,7 +1095,7 @@
|
|
|
979
1095
|
}
|
|
980
1096
|
});
|
|
981
1097
|
}
|
|
982
|
-
|
|
1098
|
+
_g.label = 6;
|
|
983
1099
|
case 6: return [2 /*return*/];
|
|
984
1100
|
}
|
|
985
1101
|
});
|
|
@@ -991,11 +1107,11 @@
|
|
|
991
1107
|
};
|
|
992
1108
|
ChannelService.prototype.handleNewMessageNotification = function (notification) {
|
|
993
1109
|
return __awaiter(this, void 0, void 0, function () {
|
|
994
|
-
return __generator(this, function (
|
|
995
|
-
switch (
|
|
1110
|
+
return __generator(this, function (_f) {
|
|
1111
|
+
switch (_f.label) {
|
|
996
1112
|
case 0: return [4 /*yield*/, this.addChannelFromNotification(notification)];
|
|
997
1113
|
case 1:
|
|
998
|
-
|
|
1114
|
+
_f.sent();
|
|
999
1115
|
return [2 /*return*/];
|
|
1000
1116
|
}
|
|
1001
1117
|
});
|
|
@@ -1003,11 +1119,11 @@
|
|
|
1003
1119
|
};
|
|
1004
1120
|
ChannelService.prototype.handleAddedToChannelNotification = function (notification) {
|
|
1005
1121
|
return __awaiter(this, void 0, void 0, function () {
|
|
1006
|
-
return __generator(this, function (
|
|
1007
|
-
switch (
|
|
1122
|
+
return __generator(this, function (_f) {
|
|
1123
|
+
switch (_f.label) {
|
|
1008
1124
|
case 0: return [4 /*yield*/, this.addChannelFromNotification(notification)];
|
|
1009
1125
|
case 1:
|
|
1010
|
-
|
|
1126
|
+
_f.sent();
|
|
1011
1127
|
return [2 /*return*/];
|
|
1012
1128
|
}
|
|
1013
1129
|
});
|
|
@@ -1017,13 +1133,13 @@
|
|
|
1017
1133
|
var _a, _b;
|
|
1018
1134
|
return __awaiter(this, void 0, void 0, function () {
|
|
1019
1135
|
var channel;
|
|
1020
|
-
return __generator(this, function (
|
|
1021
|
-
switch (
|
|
1136
|
+
return __generator(this, function (_f) {
|
|
1137
|
+
switch (_f.label) {
|
|
1022
1138
|
case 0:
|
|
1023
1139
|
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);
|
|
1024
1140
|
return [4 /*yield*/, channel.watch()];
|
|
1025
1141
|
case 1:
|
|
1026
|
-
|
|
1142
|
+
_f.sent();
|
|
1027
1143
|
this.watchForChannelEvents(channel);
|
|
1028
1144
|
this.channelsSubject.next(__spreadArray([
|
|
1029
1145
|
channel
|
|
@@ -1044,9 +1160,11 @@
|
|
|
1044
1160
|
};
|
|
1045
1161
|
ChannelService.prototype.watchForActiveChannelEvents = function (channel) {
|
|
1046
1162
|
var _this = this;
|
|
1047
|
-
this.activeChannelSubscriptions.push(channel.on('message.new', function () {
|
|
1163
|
+
this.activeChannelSubscriptions.push(channel.on('message.new', function (event) {
|
|
1048
1164
|
_this.ngZone.run(function () {
|
|
1049
|
-
|
|
1165
|
+
event.message && event.message.parent_id
|
|
1166
|
+
? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[event.message.parent_id])))
|
|
1167
|
+
: _this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
1050
1168
|
_this.activeChannel$.pipe(operators.first()).subscribe(function (c) {
|
|
1051
1169
|
if (_this.canSendReadEvents) {
|
|
1052
1170
|
void (c === null || c === void 0 ? void 0 : c.markRead());
|
|
@@ -1076,11 +1194,16 @@
|
|
|
1076
1194
|
ChannelService.prototype.messageUpdated = function (event) {
|
|
1077
1195
|
var _this = this;
|
|
1078
1196
|
this.ngZone.run(function () {
|
|
1079
|
-
var
|
|
1197
|
+
var isThreadReply = event.message && event.message.parent_id;
|
|
1198
|
+
var messages = isThreadReply
|
|
1199
|
+
? _this.activeThreadMessagesSubject.getValue()
|
|
1200
|
+
: _this.activeChannelMessagesSubject.getValue();
|
|
1080
1201
|
var messageIndex = messages.findIndex(function (m) { var _a; return m.id === ((_a = event.message) === null || _a === void 0 ? void 0 : _a.id); });
|
|
1081
1202
|
if (messageIndex !== -1 && event.message) {
|
|
1082
1203
|
messages[messageIndex] = event.message;
|
|
1083
|
-
|
|
1204
|
+
isThreadReply
|
|
1205
|
+
? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(messages)))
|
|
1206
|
+
: _this.activeChannelMessagesSubject.next(__spreadArray([], __read(messages)));
|
|
1084
1207
|
}
|
|
1085
1208
|
});
|
|
1086
1209
|
};
|
|
@@ -1088,8 +1211,11 @@
|
|
|
1088
1211
|
var _this = this;
|
|
1089
1212
|
this.ngZone.run(function () {
|
|
1090
1213
|
var _a, _b, _c, _d;
|
|
1214
|
+
var isThreadMessage = e.message && e.message.parent_id;
|
|
1091
1215
|
var messages;
|
|
1092
|
-
|
|
1216
|
+
(isThreadMessage
|
|
1217
|
+
? _this.activeThreadMessages$
|
|
1218
|
+
: _this.activeChannelMessages$)
|
|
1093
1219
|
.pipe(operators.first())
|
|
1094
1220
|
.subscribe(function (m) { return (messages = m); });
|
|
1095
1221
|
var message = messages.find(function (m) { var _a; return m.id === ((_a = e === null || e === void 0 ? void 0 : e.message) === null || _a === void 0 ? void 0 : _a.id); });
|
|
@@ -1100,7 +1226,9 @@
|
|
|
1100
1226
|
message.reaction_scores = Object.assign({}, (_b = e.message) === null || _b === void 0 ? void 0 : _b.reaction_scores);
|
|
1101
1227
|
message.latest_reactions = __spreadArray([], __read((((_c = e.message) === null || _c === void 0 ? void 0 : _c.latest_reactions) || [])));
|
|
1102
1228
|
message.own_reactions = __spreadArray([], __read((((_d = e.message) === null || _d === void 0 ? void 0 : _d.own_reactions) || [])));
|
|
1103
|
-
|
|
1229
|
+
isThreadMessage
|
|
1230
|
+
? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(messages)))
|
|
1231
|
+
: _this.activeChannelMessagesSubject.next(__spreadArray([], __read(messages)));
|
|
1104
1232
|
});
|
|
1105
1233
|
};
|
|
1106
1234
|
ChannelService.prototype.formatMessage = function (message) {
|
|
@@ -1130,13 +1258,13 @@
|
|
|
1130
1258
|
return __awaiter(this, void 0, void 0, function () {
|
|
1131
1259
|
var channels, prevChannels, error_2;
|
|
1132
1260
|
var _this = this;
|
|
1133
|
-
return __generator(this, function (
|
|
1134
|
-
switch (
|
|
1261
|
+
return __generator(this, function (_f) {
|
|
1262
|
+
switch (_f.label) {
|
|
1135
1263
|
case 0:
|
|
1136
|
-
|
|
1264
|
+
_f.trys.push([0, 2, , 3]);
|
|
1137
1265
|
return [4 /*yield*/, this.chatClientService.chatClient.queryChannels(this.filters, this.sort, this.options)];
|
|
1138
1266
|
case 1:
|
|
1139
|
-
channels =
|
|
1267
|
+
channels = _f.sent();
|
|
1140
1268
|
channels.forEach(function (c) { return _this.watchForChannelEvents(c); });
|
|
1141
1269
|
prevChannels = this.channelsSubject.getValue() || [];
|
|
1142
1270
|
this.channelsSubject.next(__spreadArray(__spreadArray([], __read(prevChannels)), __read(channels)));
|
|
@@ -1146,7 +1274,7 @@
|
|
|
1146
1274
|
this.hasMoreChannelsSubject.next(channels.length >= this.options.limit);
|
|
1147
1275
|
return [3 /*break*/, 3];
|
|
1148
1276
|
case 2:
|
|
1149
|
-
error_2 =
|
|
1277
|
+
error_2 = _f.sent();
|
|
1150
1278
|
this.channelsSubject.error(error_2);
|
|
1151
1279
|
return [3 /*break*/, 3];
|
|
1152
1280
|
case 3: return [2 /*return*/];
|
|
@@ -1161,7 +1289,7 @@
|
|
|
1161
1289
|
case 'message.new': {
|
|
1162
1290
|
_this.ngZone.run(function () {
|
|
1163
1291
|
if (_this.customNewMessageHandler) {
|
|
1164
|
-
_this.customNewMessageHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1292
|
+
_this.customNewMessageHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1165
1293
|
}
|
|
1166
1294
|
else {
|
|
1167
1295
|
_this.handleNewMessage(event, channel);
|
|
@@ -1172,7 +1300,7 @@
|
|
|
1172
1300
|
case 'channel.hidden': {
|
|
1173
1301
|
_this.ngZone.run(function () {
|
|
1174
1302
|
if (_this.customChannelHiddenHandler) {
|
|
1175
|
-
_this.customChannelHiddenHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1303
|
+
_this.customChannelHiddenHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1176
1304
|
}
|
|
1177
1305
|
else {
|
|
1178
1306
|
_this.handleChannelHidden(event);
|
|
@@ -1183,7 +1311,7 @@
|
|
|
1183
1311
|
case 'channel.deleted': {
|
|
1184
1312
|
_this.ngZone.run(function () {
|
|
1185
1313
|
if (_this.customChannelDeletedHandler) {
|
|
1186
|
-
_this.customChannelDeletedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1314
|
+
_this.customChannelDeletedHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1187
1315
|
}
|
|
1188
1316
|
else {
|
|
1189
1317
|
_this.handleChannelDeleted(event);
|
|
@@ -1194,7 +1322,7 @@
|
|
|
1194
1322
|
case 'channel.visible': {
|
|
1195
1323
|
_this.ngZone.run(function () {
|
|
1196
1324
|
if (_this.customChannelVisibleHandler) {
|
|
1197
|
-
_this.customChannelVisibleHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1325
|
+
_this.customChannelVisibleHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1198
1326
|
}
|
|
1199
1327
|
else {
|
|
1200
1328
|
_this.handleChannelVisible(event, channel);
|
|
@@ -1205,7 +1333,7 @@
|
|
|
1205
1333
|
case 'channel.updated': {
|
|
1206
1334
|
_this.ngZone.run(function () {
|
|
1207
1335
|
if (_this.customChannelUpdatedHandler) {
|
|
1208
|
-
_this.customChannelUpdatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1336
|
+
_this.customChannelUpdatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1209
1337
|
}
|
|
1210
1338
|
else {
|
|
1211
1339
|
_this.handleChannelUpdate(event);
|
|
@@ -1216,7 +1344,7 @@
|
|
|
1216
1344
|
case 'channel.truncated': {
|
|
1217
1345
|
_this.ngZone.run(function () {
|
|
1218
1346
|
if (_this.customChannelTruncatedHandler) {
|
|
1219
|
-
_this.customChannelTruncatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1347
|
+
_this.customChannelTruncatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1220
1348
|
}
|
|
1221
1349
|
else {
|
|
1222
1350
|
_this.handleChannelTruncate(event);
|
|
@@ -1257,6 +1385,7 @@
|
|
|
1257
1385
|
}
|
|
1258
1386
|
}
|
|
1259
1387
|
};
|
|
1388
|
+
// truncate active thread as well
|
|
1260
1389
|
ChannelService.prototype.handleChannelTruncate = function (event) {
|
|
1261
1390
|
var _a, _b;
|
|
1262
1391
|
var channelIndex = this.channels.findIndex(function (c) { return c.cid === event.channel.cid; });
|
|
@@ -1268,6 +1397,8 @@
|
|
|
1268
1397
|
channel.state.messages = [];
|
|
1269
1398
|
this.activeChannelSubject.next(channel);
|
|
1270
1399
|
this.activeChannelMessagesSubject.next([]);
|
|
1400
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
1401
|
+
this.activeThreadMessagesSubject.next([]);
|
|
1271
1402
|
}
|
|
1272
1403
|
}
|
|
1273
1404
|
};
|
|
@@ -1291,6 +1422,20 @@
|
|
|
1291
1422
|
enumerable: false,
|
|
1292
1423
|
configurable: true
|
|
1293
1424
|
});
|
|
1425
|
+
ChannelService.prototype.transformToStreamMessage = function (message, channel) {
|
|
1426
|
+
var isThreadMessage = !!message.parent_id;
|
|
1427
|
+
if (this.isStreamMessage(message) &&
|
|
1428
|
+
this.isFormatMessageResponse(message)) {
|
|
1429
|
+
return message;
|
|
1430
|
+
}
|
|
1431
|
+
else if (this.isFormatMessageResponse(message)) {
|
|
1432
|
+
return Object.assign(Object.assign({}, message), { readBy: isThreadMessage ? [] : getReadBy(message, channel) });
|
|
1433
|
+
}
|
|
1434
|
+
else {
|
|
1435
|
+
var formatMessage = this.formatMessage(message);
|
|
1436
|
+
return Object.assign(Object.assign({}, formatMessage), { readBy: isThreadMessage ? [] : getReadBy(formatMessage, channel) });
|
|
1437
|
+
}
|
|
1438
|
+
};
|
|
1294
1439
|
return ChannelService;
|
|
1295
1440
|
}());
|
|
1296
1441
|
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 });
|
|
@@ -1649,6 +1794,7 @@
|
|
|
1649
1794
|
Flag: 'Flag',
|
|
1650
1795
|
'Message Failed': 'Message Failed',
|
|
1651
1796
|
'Message Failed · Unauthorized': 'Message Failed · Unauthorized',
|
|
1797
|
+
'Message Failed · Click to try again': 'Message Failed · Click to try again',
|
|
1652
1798
|
'Message deleted': 'Message deleted',
|
|
1653
1799
|
'Message has been successfully flagged': 'Message has been successfully flagged',
|
|
1654
1800
|
'Message pinned': 'Message pinned',
|
|
@@ -1699,6 +1845,7 @@
|
|
|
1699
1845
|
test: 'success',
|
|
1700
1846
|
'Sending links is not allowed in this conversation': 'Sending links is not allowed in this conversation',
|
|
1701
1847
|
"You can't send messages in this channel": "You can't send messages in this channel",
|
|
1848
|
+
"You can't send thread replies in this channel": "You can't send thread replies in this channel",
|
|
1702
1849
|
'Unsupported file type: {{type}}': 'Unsupported file type: {{type}}',
|
|
1703
1850
|
},
|
|
1704
1851
|
};
|
|
@@ -1716,14 +1863,14 @@
|
|
|
1716
1863
|
};
|
|
1717
1864
|
return StreamI18nService;
|
|
1718
1865
|
}());
|
|
1719
|
-
StreamI18nService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, deps: [{ token:
|
|
1866
|
+
StreamI18nService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, deps: [{ token: i1__namespace.TranslateService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1720
1867
|
StreamI18nService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, providedIn: 'root' });
|
|
1721
1868
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, decorators: [{
|
|
1722
1869
|
type: i0.Injectable,
|
|
1723
1870
|
args: [{
|
|
1724
1871
|
providedIn: 'root',
|
|
1725
1872
|
}]
|
|
1726
|
-
}], ctorParameters: function () { return [{ type:
|
|
1873
|
+
}], ctorParameters: function () { return [{ type: i1__namespace.TranslateService }]; } });
|
|
1727
1874
|
|
|
1728
1875
|
var AvatarComponent = /** @class */ (function () {
|
|
1729
1876
|
function AvatarComponent() {
|
|
@@ -1764,7 +1911,7 @@
|
|
|
1764
1911
|
return IconComponent;
|
|
1765
1912
|
}());
|
|
1766
1913
|
IconComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: IconComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1767
|
-
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", directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type:
|
|
1914
|
+
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: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }] });
|
|
1768
1915
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: IconComponent, decorators: [{
|
|
1769
1916
|
type: i0.Component,
|
|
1770
1917
|
args: [{
|
|
@@ -1906,6 +2053,90 @@
|
|
|
1906
2053
|
}]
|
|
1907
2054
|
}], ctorParameters: function () { return []; } });
|
|
1908
2055
|
|
|
2056
|
+
var ImageLoadService = /** @class */ (function () {
|
|
2057
|
+
function ImageLoadService() {
|
|
2058
|
+
this.imageLoad$ = new rxjs.Subject();
|
|
2059
|
+
}
|
|
2060
|
+
return ImageLoadService;
|
|
2061
|
+
}());
|
|
2062
|
+
ImageLoadService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2063
|
+
ImageLoadService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, providedIn: 'root' });
|
|
2064
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, decorators: [{
|
|
2065
|
+
type: i0.Injectable,
|
|
2066
|
+
args: [{
|
|
2067
|
+
providedIn: 'root',
|
|
2068
|
+
}]
|
|
2069
|
+
}], ctorParameters: function () { return []; } });
|
|
2070
|
+
|
|
2071
|
+
var AttachmentListComponent = /** @class */ (function () {
|
|
2072
|
+
function AttachmentListComponent(imageLoadService, channelService) {
|
|
2073
|
+
this.imageLoadService = imageLoadService;
|
|
2074
|
+
this.channelService = channelService;
|
|
2075
|
+
this.attachments = [];
|
|
2076
|
+
this.orderedAttachments = [];
|
|
2077
|
+
}
|
|
2078
|
+
AttachmentListComponent.prototype.ngOnChanges = function () {
|
|
2079
|
+
var _this = this;
|
|
2080
|
+
this.orderedAttachments = __spreadArray(__spreadArray(__spreadArray([], __read(this.attachments.filter(function (a) { return _this.isImage(a); }))), __read(this.attachments.filter(function (a) { return _this.isFile(a); }))), __read(this.attachments.filter(function (a) { return _this.isCard(a); })));
|
|
2081
|
+
};
|
|
2082
|
+
AttachmentListComponent.prototype.trackById = function (index) {
|
|
2083
|
+
return index;
|
|
2084
|
+
};
|
|
2085
|
+
AttachmentListComponent.prototype.isImage = function (attachment) {
|
|
2086
|
+
return isImageAttachment(attachment);
|
|
2087
|
+
};
|
|
2088
|
+
AttachmentListComponent.prototype.isFile = function (attachment) {
|
|
2089
|
+
return attachment.type === 'file';
|
|
2090
|
+
};
|
|
2091
|
+
AttachmentListComponent.prototype.isCard = function (attachment) {
|
|
2092
|
+
return (!attachment.type ||
|
|
2093
|
+
(attachment.type === 'image' && !this.isImage(attachment)) ||
|
|
2094
|
+
attachment.type === 'giphy');
|
|
2095
|
+
};
|
|
2096
|
+
AttachmentListComponent.prototype.imageLoaded = function () {
|
|
2097
|
+
this.imageLoadService.imageLoad$.next();
|
|
2098
|
+
};
|
|
2099
|
+
AttachmentListComponent.prototype.hasFileSize = function (attachment) {
|
|
2100
|
+
return (attachment.file_size && Number.isFinite(Number(attachment.file_size)));
|
|
2101
|
+
};
|
|
2102
|
+
AttachmentListComponent.prototype.getFileSize = function (attachment) {
|
|
2103
|
+
return prettybytes__default['default'](attachment.file_size);
|
|
2104
|
+
};
|
|
2105
|
+
AttachmentListComponent.prototype.trimUrl = function (url) {
|
|
2106
|
+
if (url !== undefined && url !== null) {
|
|
2107
|
+
var _a = __read(url
|
|
2108
|
+
.replace(/^(?:https?:\/\/)?(?:www\.)?/i, '')
|
|
2109
|
+
.split('/'), 1), trimmedUrl = _a[0];
|
|
2110
|
+
return trimmedUrl;
|
|
2111
|
+
}
|
|
2112
|
+
return null;
|
|
2113
|
+
};
|
|
2114
|
+
AttachmentListComponent.prototype.sendAction = function (action) {
|
|
2115
|
+
var _a;
|
|
2116
|
+
void this.channelService.sendAction(this.messageId, (_a = {},
|
|
2117
|
+
_a[action.name] = action.value,
|
|
2118
|
+
_a));
|
|
2119
|
+
};
|
|
2120
|
+
AttachmentListComponent.prototype.trackByActionValue = function (_, item) {
|
|
2121
|
+
return item.value;
|
|
2122
|
+
};
|
|
2123
|
+
return AttachmentListComponent;
|
|
2124
|
+
}());
|
|
2125
|
+
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 });
|
|
2126
|
+
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"] }] });
|
|
2127
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentListComponent, decorators: [{
|
|
2128
|
+
type: i0.Component,
|
|
2129
|
+
args: [{
|
|
2130
|
+
selector: 'stream-attachment-list',
|
|
2131
|
+
templateUrl: './attachment-list.component.html',
|
|
2132
|
+
styles: [],
|
|
2133
|
+
}]
|
|
2134
|
+
}], ctorParameters: function () { return [{ type: ImageLoadService }, { type: ChannelService }]; }, propDecorators: { messageId: [{
|
|
2135
|
+
type: i0.Input
|
|
2136
|
+
}], attachments: [{
|
|
2137
|
+
type: i0.Input
|
|
2138
|
+
}] } });
|
|
2139
|
+
|
|
1909
2140
|
var AttachmentPreviewListComponent = /** @class */ (function () {
|
|
1910
2141
|
function AttachmentPreviewListComponent(attachmentService) {
|
|
1911
2142
|
this.attachmentService = attachmentService;
|
|
@@ -1941,7 +2172,7 @@
|
|
|
1941
2172
|
return AttachmentPreviewListComponent;
|
|
1942
2173
|
}());
|
|
1943
2174
|
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 });
|
|
1944
|
-
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:
|
|
2175
|
+
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: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "async": i6__namespace.AsyncPipe } });
|
|
1945
2176
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentPreviewListComponent, decorators: [{
|
|
1946
2177
|
type: i0.Component,
|
|
1947
2178
|
args: [{
|
|
@@ -1962,6 +2193,7 @@
|
|
|
1962
2193
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
1963
2194
|
this.cdRef = cdRef;
|
|
1964
2195
|
this.chatClient = chatClient;
|
|
2196
|
+
this.mode = 'main';
|
|
1965
2197
|
this.messageUpdate = new i0.EventEmitter();
|
|
1966
2198
|
this.textareaValue = '';
|
|
1967
2199
|
this.mentionedUsers = [];
|
|
@@ -1982,14 +2214,19 @@
|
|
|
1982
2214
|
_this.isFileUploadAuthorized =
|
|
1983
2215
|
capabilities.indexOf('upload-file') !== -1;
|
|
1984
2216
|
_this.canSendLinks = capabilities.indexOf('send-links') !== -1;
|
|
1985
|
-
_this.
|
|
1986
|
-
|
|
1987
|
-
_this.cdRef.detectChanges();
|
|
1988
|
-
_this.initTextarea();
|
|
1989
|
-
}
|
|
2217
|
+
_this.channel = channel;
|
|
2218
|
+
_this.setCanSendMessages();
|
|
1990
2219
|
}
|
|
1991
2220
|
}));
|
|
1992
2221
|
this.subscriptions.push(this.chatClient.appSettings$.subscribe(function (appSettings) { return (_this.appSettings = appSettings); }));
|
|
2222
|
+
this.subscriptions.push(this.channelService.messageToQuote$.subscribe(function (m) {
|
|
2223
|
+
var isThreadReply = m && m.parent_id;
|
|
2224
|
+
if ((_this.mode === 'thread' && isThreadReply) ||
|
|
2225
|
+
(_this.mode === 'thread' && _this.quotedMessage && !m) ||
|
|
2226
|
+
(_this.mode === 'main' && !isThreadReply)) {
|
|
2227
|
+
_this.quotedMessage = m;
|
|
2228
|
+
}
|
|
2229
|
+
}));
|
|
1993
2230
|
this.attachmentUploads$ = this.attachmentService.attachmentUploads$;
|
|
1994
2231
|
this.isFileUploadEnabled = this.configService.isFileUploadEnabled;
|
|
1995
2232
|
this.acceptedFileTypes = this.configService.acceptedFileTypes;
|
|
@@ -2038,13 +2275,17 @@
|
|
|
2038
2275
|
if (changes.mentionScope) {
|
|
2039
2276
|
this.configService.mentionScope = this.mentionScope;
|
|
2040
2277
|
}
|
|
2278
|
+
if (changes.mode) {
|
|
2279
|
+
this.setCanSendMessages();
|
|
2280
|
+
}
|
|
2041
2281
|
};
|
|
2042
2282
|
MessageInputComponent.prototype.ngOnDestroy = function () {
|
|
2043
2283
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
2044
2284
|
};
|
|
2045
2285
|
MessageInputComponent.prototype.messageSent = function () {
|
|
2286
|
+
var _a;
|
|
2046
2287
|
return __awaiter(this, void 0, void 0, function () {
|
|
2047
|
-
var attachmentUploadInProgressCounter, attachments, text, error_1;
|
|
2288
|
+
var attachmentUploadInProgressCounter, attachments, text, parentMessageId, error_1;
|
|
2048
2289
|
return __generator(this, function (_12) {
|
|
2049
2290
|
switch (_12.label) {
|
|
2050
2291
|
case 0:
|
|
@@ -2070,12 +2311,18 @@
|
|
|
2070
2311
|
if (!this.isUpdate) {
|
|
2071
2312
|
this.textareaValue = '';
|
|
2072
2313
|
}
|
|
2314
|
+
parentMessageId = undefined;
|
|
2315
|
+
if (this.mode === 'thread') {
|
|
2316
|
+
this.channelService.activeParentMessageId$
|
|
2317
|
+
.pipe(operators.first())
|
|
2318
|
+
.subscribe(function (id) { return (parentMessageId = id); });
|
|
2319
|
+
}
|
|
2073
2320
|
_12.label = 1;
|
|
2074
2321
|
case 1:
|
|
2075
2322
|
_12.trys.push([1, 3, , 4]);
|
|
2076
2323
|
return [4 /*yield*/, (this.isUpdate
|
|
2077
2324
|
? this.channelService.updateMessage(Object.assign(Object.assign({}, this.message), { text: text, attachments: attachments }))
|
|
2078
|
-
: this.channelService.sendMessage(text, attachments, this.mentionedUsers))];
|
|
2325
|
+
: this.channelService.sendMessage(text, attachments, this.mentionedUsers, parentMessageId, (_a = this.quotedMessage) === null || _a === void 0 ? void 0 : _a.id))];
|
|
2079
2326
|
case 2:
|
|
2080
2327
|
_12.sent();
|
|
2081
2328
|
this.messageUpdate.emit();
|
|
@@ -2089,7 +2336,11 @@
|
|
|
2089
2336
|
this.notificationService.addTemporaryNotification('streamChat.Edit message request failed');
|
|
2090
2337
|
}
|
|
2091
2338
|
return [3 /*break*/, 4];
|
|
2092
|
-
case 4:
|
|
2339
|
+
case 4:
|
|
2340
|
+
if (this.quotedMessage) {
|
|
2341
|
+
this.deselectMessageToQuote();
|
|
2342
|
+
}
|
|
2343
|
+
return [2 /*return*/];
|
|
2093
2344
|
}
|
|
2094
2345
|
});
|
|
2095
2346
|
});
|
|
@@ -2109,6 +2360,17 @@
|
|
|
2109
2360
|
enumerable: false,
|
|
2110
2361
|
configurable: true
|
|
2111
2362
|
});
|
|
2363
|
+
Object.defineProperty(MessageInputComponent.prototype, "quotedMessageAttachments", {
|
|
2364
|
+
get: function () {
|
|
2365
|
+
var _a;
|
|
2366
|
+
var originalAttachments = (_a = this.quotedMessage) === null || _a === void 0 ? void 0 : _a.attachments;
|
|
2367
|
+
return originalAttachments && originalAttachments.length
|
|
2368
|
+
? [originalAttachments[0]]
|
|
2369
|
+
: [];
|
|
2370
|
+
},
|
|
2371
|
+
enumerable: false,
|
|
2372
|
+
configurable: true
|
|
2373
|
+
});
|
|
2112
2374
|
MessageInputComponent.prototype.filesSelected = function (fileList) {
|
|
2113
2375
|
return __awaiter(this, void 0, void 0, function () {
|
|
2114
2376
|
return __generator(this, function (_12) {
|
|
@@ -2127,6 +2389,9 @@
|
|
|
2127
2389
|
});
|
|
2128
2390
|
});
|
|
2129
2391
|
};
|
|
2392
|
+
MessageInputComponent.prototype.deselectMessageToQuote = function () {
|
|
2393
|
+
this.channelService.selectMessageToQuote(undefined);
|
|
2394
|
+
};
|
|
2130
2395
|
MessageInputComponent.prototype.clearFileInput = function () {
|
|
2131
2396
|
this.fileInput.nativeElement.value = '';
|
|
2132
2397
|
};
|
|
@@ -2206,10 +2471,25 @@
|
|
|
2206
2471
|
});
|
|
2207
2472
|
});
|
|
2208
2473
|
};
|
|
2474
|
+
MessageInputComponent.prototype.setCanSendMessages = function () {
|
|
2475
|
+
var _a, _b;
|
|
2476
|
+
var capabilities = (_b = (_a = this.channel) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.own_capabilities;
|
|
2477
|
+
if (!capabilities) {
|
|
2478
|
+
this.canSendMessages = false;
|
|
2479
|
+
}
|
|
2480
|
+
else {
|
|
2481
|
+
this.canSendMessages =
|
|
2482
|
+
capabilities.indexOf(this.mode === 'main' ? 'send-message' : 'send-reply') !== -1;
|
|
2483
|
+
}
|
|
2484
|
+
if (this.isViewInited) {
|
|
2485
|
+
this.cdRef.detectChanges();
|
|
2486
|
+
this.initTextarea();
|
|
2487
|
+
}
|
|
2488
|
+
};
|
|
2209
2489
|
return MessageInputComponent;
|
|
2210
2490
|
}());
|
|
2211
2491
|
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 }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2212
|
-
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", acceptedFileTypes: "acceptedFileTypes", isMultipleFileUploadEnabled: "isMultipleFileUploadEnabled", message: "message" }, outputs: { messageUpdate: "messageUpdate" }, providers: [AttachmentService], 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=\"str-chat__input-flat\"\n [class.str-chat__input-flat-has-attachments]=\"\n (attachmentUploads$ | async)!.length > 0\n \"\n>\n <div class=\"str-chat__input-flat-wrapper\">\n <div
|
|
2492
|
+
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", mode: "mode", acceptedFileTypes: "acceptedFileTypes", isMultipleFileUploadEnabled: "isMultipleFileUploadEnabled", message: "message" }, outputs: { messageUpdate: "messageUpdate" }, providers: [AttachmentService], 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\">\n <ng-template\n *ngIf=\"canSendMessages; else notAllowed\"\n streamTextarea\n [(value)]=\"textareaValue\"\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]=\"\n (mode === 'thread'\n ? 'You can\\'t send thread replies in this channel'\n : 'streamChat.You can\\'t send messages in this channel'\n ) | translate\n \"\n class=\"rta__textarea str-chat__textarea__textarea\"\n ></textarea>\n </ng-template>\n </div>\n <div\n *ngIf=\"isFileUploadEnabled && isFileUploadAuthorized && canSendMessages\"\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: TextareaDirective, selector: "[streamTextarea]", inputs: ["componentRef", "areMentionsEnabled", "mentionAutocompleteItemTemplate", "mentionScope", "commandAutocompleteItemTemplate", "value"], outputs: ["valueChange", "send", "userMentions"] }], pipes: { "async": i6__namespace.AsyncPipe, "translate": i1__namespace.TranslatePipe } });
|
|
2213
2493
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputComponent, decorators: [{
|
|
2214
2494
|
type: i0.Component,
|
|
2215
2495
|
args: [{
|
|
@@ -2233,6 +2513,8 @@
|
|
|
2233
2513
|
type: i0.Input
|
|
2234
2514
|
}], commandAutocompleteItemTemplate: [{
|
|
2235
2515
|
type: i0.Input
|
|
2516
|
+
}], mode: [{
|
|
2517
|
+
type: i0.Input
|
|
2236
2518
|
}], acceptedFileTypes: [{
|
|
2237
2519
|
type: i0.Input
|
|
2238
2520
|
}], isMultipleFileUploadEnabled: [{
|
|
@@ -2294,7 +2576,7 @@
|
|
|
2294
2576
|
return ModalComponent;
|
|
2295
2577
|
}());
|
|
2296
2578
|
ModalComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ModalComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2297
|
-
ModalComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ModalComponent, selector: "stream-modal", inputs: { isOpen: "isOpen" }, outputs: { isOpenChange: "isOpenChange" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n translate\n >\n streamChat.Close\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n <div class=\"str-chat__modal__inner\" #content>\n <ng-content></ng-content>\n </div>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type:
|
|
2579
|
+
ModalComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ModalComponent, selector: "stream-modal", inputs: { isOpen: "isOpen" }, outputs: { isOpenChange: "isOpenChange" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n translate\n >\n streamChat.Close\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n <div class=\"str-chat__modal__inner\" #content>\n <ng-content></ng-content>\n </div>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }] });
|
|
2298
2580
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ModalComponent, decorators: [{
|
|
2299
2581
|
type: i0.Component,
|
|
2300
2582
|
args: [{
|
|
@@ -2340,7 +2622,7 @@
|
|
|
2340
2622
|
return NotificationListComponent;
|
|
2341
2623
|
}());
|
|
2342
2624
|
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 });
|
|
2343
|
-
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":
|
|
2625
|
+
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": i1__namespace.TranslatePipe } });
|
|
2344
2626
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationListComponent, decorators: [{
|
|
2345
2627
|
type: i0.Component,
|
|
2346
2628
|
args: [{
|
|
@@ -2393,7 +2675,10 @@
|
|
|
2393
2675
|
};
|
|
2394
2676
|
Object.defineProperty(MessageActionsBoxComponent.prototype, "isQuoteVisible", {
|
|
2395
2677
|
get: function () {
|
|
2396
|
-
|
|
2678
|
+
var _a;
|
|
2679
|
+
return ((this.enabledActions.indexOf('quote') !== -1 ||
|
|
2680
|
+
this.enabledActions.indexOf('quote-message') !== -1) &&
|
|
2681
|
+
!((_a = this.message) === null || _a === void 0 ? void 0 : _a.quoted_message));
|
|
2397
2682
|
},
|
|
2398
2683
|
enumerable: false,
|
|
2399
2684
|
configurable: true
|
|
@@ -2471,7 +2756,7 @@
|
|
|
2471
2756
|
alert('Feature not yet implemented');
|
|
2472
2757
|
};
|
|
2473
2758
|
MessageActionsBoxComponent.prototype.quoteClicked = function () {
|
|
2474
|
-
|
|
2759
|
+
this.channelService.selectMessageToQuote(this.message);
|
|
2475
2760
|
};
|
|
2476
2761
|
MessageActionsBoxComponent.prototype.editClicked = function () {
|
|
2477
2762
|
this.isEditing.emit(true);
|
|
@@ -2504,7 +2789,7 @@
|
|
|
2504
2789
|
return MessageActionsBoxComponent;
|
|
2505
2790
|
}());
|
|
2506
2791
|
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 });
|
|
2507
|
-
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", "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:
|
|
2792
|
+
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", "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: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
2508
2793
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageActionsBoxComponent, decorators: [{
|
|
2509
2794
|
type: i0.Component,
|
|
2510
2795
|
args: [{
|
|
@@ -2537,11 +2822,12 @@
|
|
|
2537
2822
|
this.subscriptions = [];
|
|
2538
2823
|
this.isError$ = this.channelService.channels$.pipe(operators.map(function () { return false; }), operators.catchError(function () { return rxjs.of(true); }), operators.startWith(false));
|
|
2539
2824
|
this.isInitializing$ = this.channelService.channels$.pipe(operators.map(function (channels) { return !channels; }), operators.catchError(function () { return rxjs.of(false); }));
|
|
2825
|
+
this.isActiveThread$ = this.channelService.activeParentMessageId$.pipe(operators.map(function (id) { return !!id; }));
|
|
2540
2826
|
}
|
|
2541
2827
|
return ChannelComponent;
|
|
2542
2828
|
}());
|
|
2543
2829
|
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 });
|
|
2544
|
-
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 </div>\n</div>\n", directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i6__namespace.AsyncPipe } });
|
|
2830
|
+
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 } });
|
|
2545
2831
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelComponent, decorators: [{
|
|
2546
2832
|
type: i0.Component,
|
|
2547
2833
|
args: [{
|
|
@@ -2654,7 +2940,7 @@
|
|
|
2654
2940
|
return ChannelHeaderComponent;
|
|
2655
2941
|
}());
|
|
2656
2942
|
ChannelHeaderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelHeaderComponent, deps: [{ token: ChannelService }, { token: ChannelListToggleService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2657
|
-
ChannelHeaderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelHeaderComponent, selector: "stream-channel-header", ngImport: i0__namespace, template: "<div class=\"str-chat__header-livestream\">\n <div\n class=\"str-chat__header-hamburger\"\n (click)=\"toggleMenu($event)\"\n (keyup.enter)=\"toggleMenu($event)\"\n >\n <span class=\"str-chat__header-hamburger--line\"></span>\n <span class=\"str-chat__header-hamburger--line\"></span>\n <span class=\"str-chat__header-hamburger--line\"></span>\n </div>\n <stream-avatar\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ activeChannel?.data?.name }}\"\n ></stream-avatar>\n <div class=\"str-chat__header-livestream-left\">\n <p data-testid=\"name\" class=\"str-chat__header-livestream-left--title\">\n {{ activeChannel?.data?.name }}\n </p>\n <p data-testid=\"info\" class=\"str-chat__header-livestream-left--members\">\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{canReceiveConnectEvents ? ('streamChat.{{ watcherCount }} online' |\n translate:watcherCountParam) : ''}}\n </p>\n </div>\n</div>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate":
|
|
2943
|
+
ChannelHeaderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelHeaderComponent, selector: "stream-channel-header", ngImport: i0__namespace, template: "<div class=\"str-chat__header-livestream\">\n <div\n class=\"str-chat__header-hamburger\"\n (click)=\"toggleMenu($event)\"\n (keyup.enter)=\"toggleMenu($event)\"\n >\n <span class=\"str-chat__header-hamburger--line\"></span>\n <span class=\"str-chat__header-hamburger--line\"></span>\n <span class=\"str-chat__header-hamburger--line\"></span>\n </div>\n <stream-avatar\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ activeChannel?.data?.name }}\"\n ></stream-avatar>\n <div class=\"str-chat__header-livestream-left\">\n <p data-testid=\"name\" class=\"str-chat__header-livestream-left--title\">\n {{ activeChannel?.data?.name }}\n </p>\n <p data-testid=\"info\" class=\"str-chat__header-livestream-left--members\">\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{canReceiveConnectEvents ? ('streamChat.{{ watcherCount }} online' |\n translate:watcherCountParam) : ''}}\n </p>\n </div>\n</div>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
2658
2944
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelHeaderComponent, decorators: [{
|
|
2659
2945
|
type: i0.Component,
|
|
2660
2946
|
args: [{
|
|
@@ -2754,7 +3040,7 @@
|
|
|
2754
3040
|
return ChannelPreviewComponent;
|
|
2755
3041
|
}());
|
|
2756
3042
|
ChannelPreviewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelPreviewComponent, deps: [{ token: ChannelService }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2757
|
-
ChannelPreviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: { channel: "channel" }, ngImport: i0__namespace, template: "<button\n class=\"str-chat__channel-preview-messenger\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n data-testid=\"channel-preview-container\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar\n imageUrl=\"{{ avatarImage }}\"\n name=\"{{ avatarName }}\"\n [size]=\"40\"\n ></stream-avatar>\n </div>\n <div class=\"str-chat__channel-preview-messenger--right\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{ title }}</span>\n </div>\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n {{ latestMessage | translate }}\n </div>\n </div>\n</button>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate":
|
|
3043
|
+
ChannelPreviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: { channel: "channel" }, ngImport: i0__namespace, template: "<button\n class=\"str-chat__channel-preview-messenger\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n data-testid=\"channel-preview-container\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar\n imageUrl=\"{{ avatarImage }}\"\n name=\"{{ avatarName }}\"\n [size]=\"40\"\n ></stream-avatar>\n </div>\n <div class=\"str-chat__channel-preview-messenger--right\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{ title }}</span>\n </div>\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n {{ latestMessage | translate }}\n </div>\n </div>\n</button>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
2758
3044
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelPreviewComponent, decorators: [{
|
|
2759
3045
|
type: i0.Component,
|
|
2760
3046
|
args: [{
|
|
@@ -2804,7 +3090,7 @@
|
|
|
2804
3090
|
return ChannelListComponent;
|
|
2805
3091
|
}());
|
|
2806
3092
|
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 });
|
|
2807
|
-
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":
|
|
3093
|
+
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": i1__namespace.TranslatePipe } });
|
|
2808
3094
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelListComponent, decorators: [{
|
|
2809
3095
|
type: i0.Component,
|
|
2810
3096
|
args: [{
|
|
@@ -2971,7 +3257,7 @@
|
|
|
2971
3257
|
return MessageReactionsComponent;
|
|
2972
3258
|
}());
|
|
2973
3259
|
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 });
|
|
2974
|
-
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\"\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"] }] });
|
|
3260
|
+
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 emoji-mart-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"] }] });
|
|
2975
3261
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageReactionsComponent, decorators: [{
|
|
2976
3262
|
type: i0.Component,
|
|
2977
3263
|
args: [{
|
|
@@ -2999,95 +3285,12 @@
|
|
|
2999
3285
|
args: ['selectorTooltip']
|
|
3000
3286
|
}] } });
|
|
3001
3287
|
|
|
3002
|
-
var ImageLoadService = /** @class */ (function () {
|
|
3003
|
-
function ImageLoadService() {
|
|
3004
|
-
this.imageLoad$ = new rxjs.Subject();
|
|
3005
|
-
}
|
|
3006
|
-
return ImageLoadService;
|
|
3007
|
-
}());
|
|
3008
|
-
ImageLoadService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
3009
|
-
ImageLoadService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, providedIn: 'root' });
|
|
3010
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, decorators: [{
|
|
3011
|
-
type: i0.Injectable,
|
|
3012
|
-
args: [{
|
|
3013
|
-
providedIn: 'root',
|
|
3014
|
-
}]
|
|
3015
|
-
}], ctorParameters: function () { return []; } });
|
|
3016
|
-
|
|
3017
|
-
var AttachmentListComponent = /** @class */ (function () {
|
|
3018
|
-
function AttachmentListComponent(imageLoadService, channelService) {
|
|
3019
|
-
this.imageLoadService = imageLoadService;
|
|
3020
|
-
this.channelService = channelService;
|
|
3021
|
-
this.attachments = [];
|
|
3022
|
-
this.orderedAttachments = [];
|
|
3023
|
-
}
|
|
3024
|
-
AttachmentListComponent.prototype.ngOnChanges = function () {
|
|
3025
|
-
var _this = this;
|
|
3026
|
-
this.orderedAttachments = __spreadArray(__spreadArray(__spreadArray([], __read(this.attachments.filter(function (a) { return _this.isImage(a); }))), __read(this.attachments.filter(function (a) { return _this.isFile(a); }))), __read(this.attachments.filter(function (a) { return _this.isCard(a); })));
|
|
3027
|
-
};
|
|
3028
|
-
AttachmentListComponent.prototype.trackById = function (index) {
|
|
3029
|
-
return index;
|
|
3030
|
-
};
|
|
3031
|
-
AttachmentListComponent.prototype.isImage = function (attachment) {
|
|
3032
|
-
return isImageAttachment(attachment);
|
|
3033
|
-
};
|
|
3034
|
-
AttachmentListComponent.prototype.isFile = function (attachment) {
|
|
3035
|
-
return attachment.type === 'file';
|
|
3036
|
-
};
|
|
3037
|
-
AttachmentListComponent.prototype.isCard = function (attachment) {
|
|
3038
|
-
return (!attachment.type ||
|
|
3039
|
-
(attachment.type === 'image' && !this.isImage(attachment)) ||
|
|
3040
|
-
attachment.type === 'giphy');
|
|
3041
|
-
};
|
|
3042
|
-
AttachmentListComponent.prototype.imageLoaded = function () {
|
|
3043
|
-
this.imageLoadService.imageLoad$.next();
|
|
3044
|
-
};
|
|
3045
|
-
AttachmentListComponent.prototype.hasFileSize = function (attachment) {
|
|
3046
|
-
return (attachment.file_size && Number.isFinite(Number(attachment.file_size)));
|
|
3047
|
-
};
|
|
3048
|
-
AttachmentListComponent.prototype.getFileSize = function (attachment) {
|
|
3049
|
-
return prettybytes__default['default'](attachment.file_size);
|
|
3050
|
-
};
|
|
3051
|
-
AttachmentListComponent.prototype.trimUrl = function (url) {
|
|
3052
|
-
if (url !== undefined && url !== null) {
|
|
3053
|
-
var _a = __read(url
|
|
3054
|
-
.replace(/^(?:https?:\/\/)?(?:www\.)?/i, '')
|
|
3055
|
-
.split('/'), 1), trimmedUrl = _a[0];
|
|
3056
|
-
return trimmedUrl;
|
|
3057
|
-
}
|
|
3058
|
-
return null;
|
|
3059
|
-
};
|
|
3060
|
-
AttachmentListComponent.prototype.sendAction = function (action) {
|
|
3061
|
-
var _a;
|
|
3062
|
-
void this.channelService.sendAction(this.messageId, (_a = {},
|
|
3063
|
-
_a[action.name] = action.value,
|
|
3064
|
-
_a));
|
|
3065
|
-
};
|
|
3066
|
-
AttachmentListComponent.prototype.trackByActionValue = function (_, item) {
|
|
3067
|
-
return item.value;
|
|
3068
|
-
};
|
|
3069
|
-
return AttachmentListComponent;
|
|
3070
|
-
}());
|
|
3071
|
-
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 });
|
|
3072
|
-
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"] }] });
|
|
3073
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentListComponent, decorators: [{
|
|
3074
|
-
type: i0.Component,
|
|
3075
|
-
args: [{
|
|
3076
|
-
selector: 'stream-attachment-list',
|
|
3077
|
-
templateUrl: './attachment-list.component.html',
|
|
3078
|
-
styles: [],
|
|
3079
|
-
}]
|
|
3080
|
-
}], ctorParameters: function () { return [{ type: ImageLoadService }, { type: ChannelService }]; }, propDecorators: { messageId: [{
|
|
3081
|
-
type: i0.Input
|
|
3082
|
-
}], attachments: [{
|
|
3083
|
-
type: i0.Input
|
|
3084
|
-
}] } });
|
|
3085
|
-
|
|
3086
3288
|
var MessageComponent = /** @class */ (function () {
|
|
3087
3289
|
function MessageComponent(chatClientService, channelService) {
|
|
3088
3290
|
this.chatClientService = chatClientService;
|
|
3089
3291
|
this.channelService = channelService;
|
|
3090
3292
|
this.enabledMessageActions = [];
|
|
3293
|
+
this.mode = 'main';
|
|
3091
3294
|
this.isActionBoxOpen = false;
|
|
3092
3295
|
this.isReactionSelectorOpen = false;
|
|
3093
3296
|
this.isPressedOnMobile = false;
|
|
@@ -3096,47 +3299,8 @@
|
|
|
3096
3299
|
this.user = this.chatClientService.chatClient.user;
|
|
3097
3300
|
}
|
|
3098
3301
|
MessageComponent.prototype.ngOnChanges = function (changes) {
|
|
3099
|
-
var _this = this;
|
|
3100
|
-
var _a, _b;
|
|
3101
3302
|
if (changes.message) {
|
|
3102
|
-
|
|
3103
|
-
if (!content) {
|
|
3104
|
-
this.messageTextParts = [];
|
|
3105
|
-
}
|
|
3106
|
-
else {
|
|
3107
|
-
// Backend will wrap HTML content with <p></p>\n
|
|
3108
|
-
if (content.startsWith('<p>')) {
|
|
3109
|
-
content = content.replace('<p>', '');
|
|
3110
|
-
}
|
|
3111
|
-
if (content.endsWith('</p>\n')) {
|
|
3112
|
-
content = content.replace('</p>\n', '');
|
|
3113
|
-
}
|
|
3114
|
-
if (!this.message.mentioned_users ||
|
|
3115
|
-
this.message.mentioned_users.length === 0) {
|
|
3116
|
-
this.messageTextParts = [{ content: content, type: 'text' }];
|
|
3117
|
-
}
|
|
3118
|
-
else {
|
|
3119
|
-
this.messageTextParts = [];
|
|
3120
|
-
var text_1 = content;
|
|
3121
|
-
this.message.mentioned_users.forEach(function (user) {
|
|
3122
|
-
var mention = "@" + (user.name || user.id);
|
|
3123
|
-
var precedingText = text_1.substring(0, text_1.indexOf(mention));
|
|
3124
|
-
_this.messageTextParts.push({
|
|
3125
|
-
content: precedingText,
|
|
3126
|
-
type: 'text',
|
|
3127
|
-
});
|
|
3128
|
-
_this.messageTextParts.push({
|
|
3129
|
-
content: mention,
|
|
3130
|
-
type: 'mention',
|
|
3131
|
-
user: user,
|
|
3132
|
-
});
|
|
3133
|
-
text_1 = text_1.replace(precedingText + mention, '');
|
|
3134
|
-
});
|
|
3135
|
-
if (text_1) {
|
|
3136
|
-
this.messageTextParts.push({ content: text_1, type: 'text' });
|
|
3137
|
-
}
|
|
3138
|
-
}
|
|
3139
|
-
}
|
|
3303
|
+
this.createMessageParts();
|
|
3140
3304
|
}
|
|
3141
3305
|
};
|
|
3142
3306
|
Object.defineProperty(MessageComponent.prototype, "isSentByCurrentUser", {
|
|
@@ -3208,7 +3372,8 @@
|
|
|
3208
3372
|
this.message.type === 'system' ||
|
|
3209
3373
|
this.message.type === 'ephemeral' ||
|
|
3210
3374
|
this.message.status === 'failed' ||
|
|
3211
|
-
this.message.status === 'sending'
|
|
3375
|
+
this.message.status === 'sending' ||
|
|
3376
|
+
(this.mode === 'thread' && !this.message.parent_id));
|
|
3212
3377
|
},
|
|
3213
3378
|
enumerable: false,
|
|
3214
3379
|
configurable: true
|
|
@@ -3230,6 +3395,33 @@
|
|
|
3230
3395
|
enumerable: false,
|
|
3231
3396
|
configurable: true
|
|
3232
3397
|
});
|
|
3398
|
+
Object.defineProperty(MessageComponent.prototype, "replyCountParam", {
|
|
3399
|
+
get: function () {
|
|
3400
|
+
var _a;
|
|
3401
|
+
return { replyCount: (_a = this.message) === null || _a === void 0 ? void 0 : _a.reply_count };
|
|
3402
|
+
},
|
|
3403
|
+
enumerable: false,
|
|
3404
|
+
configurable: true
|
|
3405
|
+
});
|
|
3406
|
+
Object.defineProperty(MessageComponent.prototype, "canDisplayReadStatus", {
|
|
3407
|
+
get: function () {
|
|
3408
|
+
return (this.canReceiveReadEvents !== false &&
|
|
3409
|
+
this.enabledMessageActions.indexOf('read-events') !== -1);
|
|
3410
|
+
},
|
|
3411
|
+
enumerable: false,
|
|
3412
|
+
configurable: true
|
|
3413
|
+
});
|
|
3414
|
+
Object.defineProperty(MessageComponent.prototype, "quotedMessageAttachments", {
|
|
3415
|
+
get: function () {
|
|
3416
|
+
var _a, _b;
|
|
3417
|
+
var originalAttachments = (_b = (_a = this.message) === null || _a === void 0 ? void 0 : _a.quoted_message) === null || _b === void 0 ? void 0 : _b.attachments;
|
|
3418
|
+
return originalAttachments && originalAttachments.length
|
|
3419
|
+
? [originalAttachments[0]]
|
|
3420
|
+
: [];
|
|
3421
|
+
},
|
|
3422
|
+
enumerable: false,
|
|
3423
|
+
configurable: true
|
|
3424
|
+
});
|
|
3233
3425
|
MessageComponent.prototype.resendMessage = function () {
|
|
3234
3426
|
void this.channelService.resendMessage(this.message);
|
|
3235
3427
|
};
|
|
@@ -3252,10 +3444,55 @@
|
|
|
3252
3444
|
};
|
|
3253
3445
|
window.addEventListener('click', eventHandler);
|
|
3254
3446
|
};
|
|
3447
|
+
MessageComponent.prototype.setAsActiveParentMessage = function () {
|
|
3448
|
+
void this.channelService.setAsActiveParentMessage(this.message);
|
|
3449
|
+
};
|
|
3450
|
+
MessageComponent.prototype.createMessageParts = function () {
|
|
3451
|
+
var _this = this;
|
|
3452
|
+
var _a, _b;
|
|
3453
|
+
var content = ((_a = this.message) === null || _a === void 0 ? void 0 : _a.html) || ((_b = this.message) === null || _b === void 0 ? void 0 : _b.text);
|
|
3454
|
+
if (!content) {
|
|
3455
|
+
this.messageTextParts = [];
|
|
3456
|
+
}
|
|
3457
|
+
else {
|
|
3458
|
+
// Backend will wrap HTML content with <p></p>\n
|
|
3459
|
+
if (content.startsWith('<p>')) {
|
|
3460
|
+
content = content.replace('<p>', '');
|
|
3461
|
+
}
|
|
3462
|
+
if (content.endsWith('</p>\n')) {
|
|
3463
|
+
content = content.replace('</p>\n', '');
|
|
3464
|
+
}
|
|
3465
|
+
if (!this.message.mentioned_users ||
|
|
3466
|
+
this.message.mentioned_users.length === 0) {
|
|
3467
|
+
this.messageTextParts = [{ content: content, type: 'text' }];
|
|
3468
|
+
}
|
|
3469
|
+
else {
|
|
3470
|
+
this.messageTextParts = [];
|
|
3471
|
+
var text_1 = content;
|
|
3472
|
+
this.message.mentioned_users.forEach(function (user) {
|
|
3473
|
+
var mention = "@" + (user.name || user.id);
|
|
3474
|
+
var precedingText = text_1.substring(0, text_1.indexOf(mention));
|
|
3475
|
+
_this.messageTextParts.push({
|
|
3476
|
+
content: precedingText,
|
|
3477
|
+
type: 'text',
|
|
3478
|
+
});
|
|
3479
|
+
_this.messageTextParts.push({
|
|
3480
|
+
content: mention,
|
|
3481
|
+
type: 'mention',
|
|
3482
|
+
user: user,
|
|
3483
|
+
});
|
|
3484
|
+
text_1 = text_1.replace(precedingText + mention, '');
|
|
3485
|
+
});
|
|
3486
|
+
if (text_1) {
|
|
3487
|
+
this.messageTextParts.push({ content: text_1, type: 'text' });
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
};
|
|
3255
3492
|
return MessageComponent;
|
|
3256
3493
|
}());
|
|
3257
3494
|
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 });
|
|
3258
|
-
MessageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageComponent, selector: "stream-message", inputs: { messageInputTemplate: "messageInputTemplate", mentionTemplate: "mentionTemplate", message: "message", enabledMessageActions: "enabledMessageActions", areReactionsEnabled: "areReactionsEnabled", canReactToMessage: "canReactToMessage", isLastSentMessage: "isLastSentMessage", canReceiveReadEvents: "canReceiveReadEvents" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n #container\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.mobile-press]=\"isPressedOnMobile\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"\n areReactionsEnabled !== false && hasReactions\n \"\n data-testid=\"message-container\"\n>\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n isMessageDeliveredAndRead &&\n canReceiveReadEvents !== false &&\n enabledMessageActions.indexOf('read-events') !== -1;\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 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\"\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 <div\n data-testid=\"client-error-message\"\n *ngIf=\"message?.type === 'error'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{ \"streamChat.Error \u00B7 Unsent\" | translate }}\n </div>\n <div\n data-testid=\"error-message\"\n *ngIf=\"message?.status === 'failed'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed \u00B7 Unauthorized\"\n : \"streamChat.Message Failed \u00B7 Click to try again\"\n ) | translate\n }}\n </div>\n <div\n (click)=\"textClicked()\"\n (keyup.enter)=\"textClicked()\"\n data-testid=\"text\"\n >\n <p>\n <!-- eslint-disable-next-line @angular-eslint/template/use-track-by-function -->\n <ng-container *ngFor=\"let part of messageTextParts\">\n <span\n *ngIf=\"part.type === 'text'; else mention\"\n [innerHTML]=\"part.content\"\n ></span>\n <ng-template #mention>\n <ng-container *ngIf=\"mentionTemplate; else defaultMention\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionTemplate;\n context: { user: part.user! }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultMention>\n <b>{{ part.content }}</b>\n </ng-template>\n </ng-template>\n </ng-container>\n </p>\n </div>\n </div>\n </div>\n <div class=\"str-chat__message-data str-chat__message-simple-data\">\n <span\n data-testid=\"sender\"\n *ngIf=\"!isSentByCurrentUser\"\n class=\"str-chat__message-simple-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span data-testid=\"date\" class=\"str-chat__message-simple-timestamp\">\n {{ parsedDate }}\n </span>\n </div>\n </div>\n </ng-container>\n </ng-container>\n</div>\n\n<ng-template #sendingStatus>\n <span\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"sending-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n <stream-loading-indicator\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator>\n </span>\n</ng-template>\n<ng-template #readStatus>\n <span\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"read-indicator\"\n >\n <div class=\"str-chat__tooltip\" data-testid=\"read-by-tooltip\">\n {{ readByText }}\n </div>\n <stream-avatar\n class=\"str-chat-angular__avatar-host\"\n data-test-id=\"last-read-user-avatar\"\n [size]=\"15\"\n [imageUrl]=\"lastReadUser?.image\"\n [name]=\"lastReadUser?.name || lastReadUser?.id\"\n ></stream-avatar>\n <span\n data-test-id=\"read-by-length\"\n *ngIf=\"isReadByMultipleUsers\"\n class=\"str-chat__message-simple-status-number\"\n >\n {{ (message?.readBy)!.length }}\n </span>\n </span>\n</ng-template>\n<ng-template #deliveredStatus>\n <span\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"delivered-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n <stream-icon\n data-testid=\"delivered-icon\"\n icon=\"delivered-icon\"\n ></stream-icon>\n </span>\n</ng-template>\n\n<ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n</ng-template>\n\n<ng-template #systemMessage>\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ message?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n</ng-template>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }, { type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: ["messageInputTemplate", "isOpen", "isMine", "message", "enabledActions"], outputs: ["displayedActionsCount", "isEditing"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: ["messageId", "messageReactionCounts", "isSelectorOpen", "latestReactions", "ownReactions"], outputs: ["isSelectorOpenChange"] }, { type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["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: i10__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i10__namespace.TranslatePipe } });
|
|
3495
|
+
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: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
3259
3496
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageComponent, decorators: [{
|
|
3260
3497
|
type: i0.Component,
|
|
3261
3498
|
args: [{
|
|
@@ -3279,6 +3516,8 @@
|
|
|
3279
3516
|
type: i0.Input
|
|
3280
3517
|
}], canReceiveReadEvents: [{
|
|
3281
3518
|
type: i0.Input
|
|
3519
|
+
}], mode: [{
|
|
3520
|
+
type: i0.Input
|
|
3282
3521
|
}], container: [{
|
|
3283
3522
|
type: i0.ViewChild,
|
|
3284
3523
|
args: ['container']
|
|
@@ -3303,7 +3542,7 @@
|
|
|
3303
3542
|
return TextareaComponent;
|
|
3304
3543
|
}());
|
|
3305
3544
|
TextareaComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: TextareaComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3306
|
-
TextareaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: TextareaComponent, selector: "stream-textarea", inputs: { value: "value" }, outputs: { valueChange: "valueChange", send: "send" }, 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\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n></textarea>\n", pipes: { "translate":
|
|
3545
|
+
TextareaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: TextareaComponent, selector: "stream-textarea", inputs: { value: "value" }, outputs: { valueChange: "valueChange", send: "send" }, 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\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n></textarea>\n", pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
3307
3546
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: TextareaComponent, decorators: [{
|
|
3308
3547
|
type: i0.Component,
|
|
3309
3548
|
args: [{
|
|
@@ -3508,7 +3747,7 @@
|
|
|
3508
3747
|
return AutocompleteTextareaComponent;
|
|
3509
3748
|
}());
|
|
3510
3749
|
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 }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3511
|
-
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\"\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: i5__namespace.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":
|
|
3750
|
+
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\"\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: i5__namespace.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": i1__namespace.TranslatePipe } });
|
|
3512
3751
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AutocompleteTextareaComponent, decorators: [{
|
|
3513
3752
|
type: i0.Component,
|
|
3514
3753
|
args: [{
|
|
@@ -3595,22 +3834,17 @@
|
|
|
3595
3834
|
*/
|
|
3596
3835
|
/* eslint-disable-next-line @angular-eslint/no-input-rename */
|
|
3597
3836
|
this.enabledMessageActionsInput = undefined;
|
|
3837
|
+
this.mode = 'main';
|
|
3598
3838
|
this.enabledMessageActions = [];
|
|
3599
3839
|
this.class = 'str-chat-angular__main-panel-inner str-chat-angular__message-list-host';
|
|
3600
3840
|
this.unreadMessageCount = 0;
|
|
3601
3841
|
this.groupStyles = [];
|
|
3602
3842
|
this.authorizedMessageActions = ['flag'];
|
|
3603
3843
|
this.isUserScrolledUpThreshold = 300;
|
|
3604
|
-
this.
|
|
3844
|
+
this.subscriptions = [];
|
|
3845
|
+
this.subscriptions.push(this.channelService.activeChannel$.subscribe(function (channel) {
|
|
3605
3846
|
var _a;
|
|
3606
|
-
_this.
|
|
3607
|
-
_this.hasNewMessages = true;
|
|
3608
|
-
_this.isUserScrolledUp = false;
|
|
3609
|
-
_this.containerHeight = undefined;
|
|
3610
|
-
_this.olderMassagesLoaded = false;
|
|
3611
|
-
_this.oldestMessageDate = undefined;
|
|
3612
|
-
_this.unreadMessageCount = 0;
|
|
3613
|
-
_this.isNewMessageSentByUser = undefined;
|
|
3847
|
+
_this.resetScrollState();
|
|
3614
3848
|
var capabilites = (_a = channel === null || channel === void 0 ? void 0 : channel.data) === null || _a === void 0 ? void 0 : _a.own_capabilities;
|
|
3615
3849
|
if (capabilites) {
|
|
3616
3850
|
_this.canReactToMessage = capabilites.indexOf('send-reaction') !== -1;
|
|
@@ -3639,46 +3873,16 @@
|
|
|
3639
3873
|
_this.authorizedMessageActions.push('delete');
|
|
3640
3874
|
_this.authorizedMessageActions.push('delete-any');
|
|
3641
3875
|
}
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
});
|
|
3645
|
-
this.messages$ = this.channelService.activeChannelMessages$.pipe(operators.tap(function (messages) {
|
|
3646
|
-
var _a, _b, _c, _d, _e;
|
|
3647
|
-
if (messages.length === 0) {
|
|
3648
|
-
return;
|
|
3649
|
-
}
|
|
3650
|
-
var currentLatestMessageDate = messages[messages.length - 1].created_at;
|
|
3651
|
-
if (!_this.latestMessageDate ||
|
|
3652
|
-
((_a = _this.latestMessageDate) === null || _a === void 0 ? void 0 : _a.getTime()) < currentLatestMessageDate.getTime()) {
|
|
3653
|
-
_this.latestMessageDate = currentLatestMessageDate;
|
|
3654
|
-
_this.hasNewMessages = true;
|
|
3655
|
-
_this.isNewMessageSentByUser =
|
|
3656
|
-
((_b = messages[messages.length - 1].user) === null || _b === void 0 ? void 0 : _b.id) ===
|
|
3657
|
-
((_d = (_c = _this.chatClientService.chatClient) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.id);
|
|
3658
|
-
if (_this.isUserScrolledUp) {
|
|
3659
|
-
_this.unreadMessageCount++;
|
|
3876
|
+
if (capabilites.indexOf('send-reply') !== -1) {
|
|
3877
|
+
_this.authorizedMessageActions.push('send-reply');
|
|
3660
3878
|
}
|
|
3879
|
+
if (capabilites.indexOf('quote-message') !== -1) {
|
|
3880
|
+
_this.authorizedMessageActions.push('quote-message');
|
|
3881
|
+
}
|
|
3882
|
+
_this.setEnabledActions();
|
|
3661
3883
|
}
|
|
3662
|
-
var currentOldestMessageDate = messages[0].created_at;
|
|
3663
|
-
if (!_this.oldestMessageDate) {
|
|
3664
|
-
_this.oldestMessageDate = currentOldestMessageDate;
|
|
3665
|
-
}
|
|
3666
|
-
else if (((_e = _this.oldestMessageDate) === null || _e === void 0 ? void 0 : _e.getTime()) > currentOldestMessageDate.getTime()) {
|
|
3667
|
-
_this.oldestMessageDate = currentOldestMessageDate;
|
|
3668
|
-
_this.olderMassagesLoaded = true;
|
|
3669
|
-
}
|
|
3670
|
-
}), operators.tap(function (messages) {
|
|
3671
|
-
_this.groupStyles = messages.map(function (m, i) { return getGroupStyles(m, messages[i - 1], messages[i + 1]); });
|
|
3672
|
-
}), operators.tap(function (messages) {
|
|
3673
|
-
var _a;
|
|
3674
|
-
return (_this.lastSentMessageId = (_a = __spreadArray([], __read(messages)).reverse()
|
|
3675
|
-
.find(function (m) {
|
|
3676
|
-
var _a, _b, _c;
|
|
3677
|
-
return ((_a = m.user) === null || _a === void 0 ? void 0 : _a.id) === ((_c = (_b = _this.chatClientService.chatClient) === null || _b === void 0 ? void 0 : _b.user) === null || _c === void 0 ? void 0 : _c.id) &&
|
|
3678
|
-
m.status !== 'sending';
|
|
3679
|
-
})) === null || _a === void 0 ? void 0 : _a.id);
|
|
3680
3884
|
}));
|
|
3681
|
-
this.imageLoadService.imageLoad$.subscribe(function () {
|
|
3885
|
+
this.subscriptions.push(this.imageLoadService.imageLoad$.subscribe(function () {
|
|
3682
3886
|
if (!_this.isUserScrolledUp) {
|
|
3683
3887
|
_this.scrollToBottom();
|
|
3684
3888
|
// Hacky and unreliable workaround to scroll down after loaded images move the scrollbar
|
|
@@ -3686,12 +3890,27 @@
|
|
|
3686
3890
|
_this.scrollToBottom();
|
|
3687
3891
|
}, 300);
|
|
3688
3892
|
}
|
|
3689
|
-
});
|
|
3893
|
+
}));
|
|
3894
|
+
this.subscriptions.push(this.channelService.activeParentMessage$.subscribe(function (message) {
|
|
3895
|
+
if (message &&
|
|
3896
|
+
_this.parentMessage &&
|
|
3897
|
+
message.id !== _this.parentMessage.id &&
|
|
3898
|
+
_this.mode === 'thread') {
|
|
3899
|
+
_this.resetScrollState();
|
|
3900
|
+
}
|
|
3901
|
+
_this.parentMessage = message;
|
|
3902
|
+
}));
|
|
3690
3903
|
}
|
|
3904
|
+
MessageListComponent.prototype.ngOnInit = function () {
|
|
3905
|
+
this.setMessages$();
|
|
3906
|
+
};
|
|
3691
3907
|
MessageListComponent.prototype.ngOnChanges = function (changes) {
|
|
3692
3908
|
if (changes.enabledMessageActionsInput) {
|
|
3693
3909
|
this.setEnabledActions();
|
|
3694
3910
|
}
|
|
3911
|
+
if (changes.mode) {
|
|
3912
|
+
this.setMessages$();
|
|
3913
|
+
}
|
|
3695
3914
|
};
|
|
3696
3915
|
MessageListComponent.prototype.ngAfterViewChecked = function () {
|
|
3697
3916
|
var _this = this;
|
|
@@ -3718,6 +3937,9 @@
|
|
|
3718
3937
|
this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;
|
|
3719
3938
|
}
|
|
3720
3939
|
};
|
|
3940
|
+
MessageListComponent.prototype.ngOnDestroy = function () {
|
|
3941
|
+
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
3942
|
+
};
|
|
3721
3943
|
MessageListComponent.prototype.trackByMessageId = function (index, item) {
|
|
3722
3944
|
return item.id;
|
|
3723
3945
|
};
|
|
@@ -3726,6 +3948,7 @@
|
|
|
3726
3948
|
this.scrollContainer.nativeElement.scrollHeight;
|
|
3727
3949
|
};
|
|
3728
3950
|
MessageListComponent.prototype.scrolled = function () {
|
|
3951
|
+
var _a, _b;
|
|
3729
3952
|
this.isUserScrolledUp =
|
|
3730
3953
|
this.scrollContainer.nativeElement.scrollHeight -
|
|
3731
3954
|
(this.scrollContainer.nativeElement.scrollTop +
|
|
@@ -3734,14 +3957,22 @@
|
|
|
3734
3957
|
if (!this.isUserScrolledUp) {
|
|
3735
3958
|
this.unreadMessageCount = 0;
|
|
3736
3959
|
}
|
|
3737
|
-
if (this.scrollContainer.nativeElement.scrollTop
|
|
3960
|
+
if (this.scrollContainer.nativeElement.scrollTop <=
|
|
3961
|
+
(((_a = this.parentMessageElement) === null || _a === void 0 ? void 0 : _a.nativeElement.clientHeight) || 0) &&
|
|
3962
|
+
(this.prevScrollTop === undefined ||
|
|
3963
|
+
this.prevScrollTop >
|
|
3964
|
+
(((_b = this.parentMessageElement) === null || _b === void 0 ? void 0 : _b.nativeElement.clientHeight) || 0))) {
|
|
3738
3965
|
this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;
|
|
3739
|
-
|
|
3966
|
+
this.mode === 'main'
|
|
3967
|
+
? void this.channelService.loadMoreMessages()
|
|
3968
|
+
: void this.channelService.loadMoreThreadReplies();
|
|
3740
3969
|
}
|
|
3970
|
+
this.prevScrollTop = this.scrollContainer.nativeElement.scrollTop;
|
|
3741
3971
|
};
|
|
3742
3972
|
MessageListComponent.prototype.preserveScrollbarPosition = function () {
|
|
3743
3973
|
this.scrollContainer.nativeElement.scrollTop =
|
|
3744
|
-
this.
|
|
3974
|
+
(this.prevScrollTop || 0) +
|
|
3975
|
+
(this.scrollContainer.nativeElement.scrollHeight - this.containerHeight);
|
|
3745
3976
|
};
|
|
3746
3977
|
MessageListComponent.prototype.setEnabledActions = function () {
|
|
3747
3978
|
var _this = this;
|
|
@@ -3753,6 +3984,8 @@
|
|
|
3753
3984
|
this.enabledMessageActionsInput = __spreadArray(__spreadArray([], __read(this.enabledMessageActionsInput)), [
|
|
3754
3985
|
'send-reaction',
|
|
3755
3986
|
'read-events',
|
|
3987
|
+
'send-reply',
|
|
3988
|
+
'quote-message',
|
|
3756
3989
|
]);
|
|
3757
3990
|
this.enabledMessageActionsInput.forEach(function (action) {
|
|
3758
3991
|
var isAuthorized = _this.authorizedMessageActions.indexOf(action) !== -1;
|
|
@@ -3761,10 +3994,62 @@
|
|
|
3761
3994
|
}
|
|
3762
3995
|
});
|
|
3763
3996
|
};
|
|
3997
|
+
MessageListComponent.prototype.setMessages$ = function () {
|
|
3998
|
+
var _this = this;
|
|
3999
|
+
this.messages$ = (this.mode === 'main'
|
|
4000
|
+
? this.channelService.activeChannelMessages$
|
|
4001
|
+
: this.channelService.activeThreadMessages$).pipe(operators.tap(function (messages) {
|
|
4002
|
+
var _a, _b, _c, _d, _e;
|
|
4003
|
+
if (messages.length === 0) {
|
|
4004
|
+
return;
|
|
4005
|
+
}
|
|
4006
|
+
var currentLatestMessageDate = messages[messages.length - 1].created_at;
|
|
4007
|
+
if (!_this.latestMessageDate ||
|
|
4008
|
+
((_a = _this.latestMessageDate) === null || _a === void 0 ? void 0 : _a.getTime()) < currentLatestMessageDate.getTime()) {
|
|
4009
|
+
_this.latestMessageDate = currentLatestMessageDate;
|
|
4010
|
+
_this.hasNewMessages = true;
|
|
4011
|
+
_this.isNewMessageSentByUser =
|
|
4012
|
+
((_b = messages[messages.length - 1].user) === null || _b === void 0 ? void 0 : _b.id) ===
|
|
4013
|
+
((_d = (_c = _this.chatClientService.chatClient) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.id);
|
|
4014
|
+
if (_this.isUserScrolledUp) {
|
|
4015
|
+
_this.unreadMessageCount++;
|
|
4016
|
+
}
|
|
4017
|
+
}
|
|
4018
|
+
var currentOldestMessageDate = messages[0].created_at;
|
|
4019
|
+
if (!_this.oldestMessageDate) {
|
|
4020
|
+
_this.oldestMessageDate = currentOldestMessageDate;
|
|
4021
|
+
}
|
|
4022
|
+
else if (((_e = _this.oldestMessageDate) === null || _e === void 0 ? void 0 : _e.getTime()) > currentOldestMessageDate.getTime()) {
|
|
4023
|
+
_this.oldestMessageDate = currentOldestMessageDate;
|
|
4024
|
+
_this.olderMassagesLoaded = true;
|
|
4025
|
+
}
|
|
4026
|
+
}), operators.tap(function (messages) {
|
|
4027
|
+
_this.groupStyles = messages.map(function (m, i) { return getGroupStyles(m, messages[i - 1], messages[i + 1]); });
|
|
4028
|
+
}), operators.tap(function (messages) {
|
|
4029
|
+
var _a;
|
|
4030
|
+
return (_this.lastSentMessageId = (_a = __spreadArray([], __read(messages)).reverse()
|
|
4031
|
+
.find(function (m) {
|
|
4032
|
+
var _a, _b, _c;
|
|
4033
|
+
return ((_a = m.user) === null || _a === void 0 ? void 0 : _a.id) === ((_c = (_b = _this.chatClientService.chatClient) === null || _b === void 0 ? void 0 : _b.user) === null || _c === void 0 ? void 0 : _c.id) &&
|
|
4034
|
+
m.status !== 'sending';
|
|
4035
|
+
})) === null || _a === void 0 ? void 0 : _a.id);
|
|
4036
|
+
}));
|
|
4037
|
+
};
|
|
4038
|
+
MessageListComponent.prototype.resetScrollState = function () {
|
|
4039
|
+
this.latestMessageDate = undefined;
|
|
4040
|
+
this.hasNewMessages = true;
|
|
4041
|
+
this.isUserScrolledUp = false;
|
|
4042
|
+
this.containerHeight = undefined;
|
|
4043
|
+
this.olderMassagesLoaded = false;
|
|
4044
|
+
this.oldestMessageDate = undefined;
|
|
4045
|
+
this.unreadMessageCount = 0;
|
|
4046
|
+
this.prevScrollTop = undefined;
|
|
4047
|
+
this.isNewMessageSentByUser = undefined;
|
|
4048
|
+
};
|
|
3764
4049
|
return MessageListComponent;
|
|
3765
4050
|
}());
|
|
3766
4051
|
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 });
|
|
3767
|
-
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"] }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], 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 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
|
|
4052
|
+
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: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1__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 } });
|
|
3768
4053
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageListComponent, decorators: [{
|
|
3769
4054
|
type: i0.Component,
|
|
3770
4055
|
args: [{
|
|
@@ -3783,12 +4068,55 @@
|
|
|
3783
4068
|
}], enabledMessageActionsInput: [{
|
|
3784
4069
|
type: i0.Input,
|
|
3785
4070
|
args: ['enabledMessageActions']
|
|
4071
|
+
}], mode: [{
|
|
4072
|
+
type: i0.Input
|
|
3786
4073
|
}], class: [{
|
|
3787
4074
|
type: i0.HostBinding,
|
|
3788
4075
|
args: ['class']
|
|
3789
4076
|
}], scrollContainer: [{
|
|
3790
4077
|
type: i0.ViewChild,
|
|
3791
4078
|
args: ['scrollContainer']
|
|
4079
|
+
}], parentMessageElement: [{
|
|
4080
|
+
type: i0.ViewChild,
|
|
4081
|
+
args: ['parentMessageElement']
|
|
4082
|
+
}] } });
|
|
4083
|
+
|
|
4084
|
+
var ThreadComponent = /** @class */ (function () {
|
|
4085
|
+
function ThreadComponent(channelService) {
|
|
4086
|
+
var _this = this;
|
|
4087
|
+
this.channelService = channelService;
|
|
4088
|
+
this.class = 'str-chat__thread';
|
|
4089
|
+
this.subscriptions = [];
|
|
4090
|
+
this.subscriptions.push(this.channelService.activeParentMessage$.subscribe(function (parentMessage) { return (_this.parentMessage = parentMessage); }));
|
|
4091
|
+
}
|
|
4092
|
+
ThreadComponent.prototype.ngOnDestroy = function () {
|
|
4093
|
+
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
4094
|
+
};
|
|
4095
|
+
Object.defineProperty(ThreadComponent.prototype, "replyCountParam", {
|
|
4096
|
+
get: function () {
|
|
4097
|
+
var _a;
|
|
4098
|
+
return { replyCount: (_a = this.parentMessage) === null || _a === void 0 ? void 0 : _a.reply_count };
|
|
4099
|
+
},
|
|
4100
|
+
enumerable: false,
|
|
4101
|
+
configurable: true
|
|
4102
|
+
});
|
|
4103
|
+
ThreadComponent.prototype.closeThread = function () {
|
|
4104
|
+
void this.channelService.setAsActiveParentMessage(undefined);
|
|
4105
|
+
};
|
|
4106
|
+
return ThreadComponent;
|
|
4107
|
+
}());
|
|
4108
|
+
ThreadComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ThreadComponent, deps: [{ token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
4109
|
+
ThreadComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ThreadComponent, selector: "stream-thread", host: { properties: { "class": "this.class" } }, ngImport: i0__namespace, template: "<div class=\"str-chat__thread-header\">\n <div class=\"str-chat__thread-header-details\">\n <strong translate>streamChat.Thread</strong>\n <small data-testid=\"reply-count\">\n {{parentMessage?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </small>\n </div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"close-button\"\n (click)=\"closeThread()\"\n >\n <stream-icon icon=\"close-no-outline\"></stream-icon>\n </button>\n</div>\n<ng-content select='[name=\"thread-message-list\"]'></ng-content>\n<div class=\"str-chat__small-message-input__wrapper\">\n <ng-content select='[name=\"thread-message-input\"]'></ng-content>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
4110
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ThreadComponent, decorators: [{
|
|
4111
|
+
type: i0.Component,
|
|
4112
|
+
args: [{
|
|
4113
|
+
selector: 'stream-thread',
|
|
4114
|
+
templateUrl: './thread.component.html',
|
|
4115
|
+
styles: [],
|
|
4116
|
+
}]
|
|
4117
|
+
}], ctorParameters: function () { return [{ type: ChannelService }]; }, propDecorators: { class: [{
|
|
4118
|
+
type: i0.HostBinding,
|
|
4119
|
+
args: ['class']
|
|
3792
4120
|
}] } });
|
|
3793
4121
|
|
|
3794
4122
|
var StreamAvatarModule = /** @class */ (function () {
|
|
@@ -3797,13 +4125,13 @@
|
|
|
3797
4125
|
return StreamAvatarModule;
|
|
3798
4126
|
}());
|
|
3799
4127
|
StreamAvatarModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3800
|
-
StreamAvatarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, declarations: [AvatarComponent], imports: [i6.CommonModule,
|
|
3801
|
-
StreamAvatarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, imports: [[i6.CommonModule,
|
|
4128
|
+
StreamAvatarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, declarations: [AvatarComponent], imports: [i6.CommonModule, i1.TranslateModule], exports: [AvatarComponent] });
|
|
4129
|
+
StreamAvatarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, imports: [[i6.CommonModule, i1.TranslateModule]] });
|
|
3802
4130
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, decorators: [{
|
|
3803
4131
|
type: i0.NgModule,
|
|
3804
4132
|
args: [{
|
|
3805
4133
|
declarations: [AvatarComponent],
|
|
3806
|
-
imports: [i6.CommonModule,
|
|
4134
|
+
imports: [i6.CommonModule, i1.TranslateModule],
|
|
3807
4135
|
exports: [AvatarComponent],
|
|
3808
4136
|
}]
|
|
3809
4137
|
}] });
|
|
@@ -3830,7 +4158,8 @@
|
|
|
3830
4158
|
NotificationListComponent,
|
|
3831
4159
|
AttachmentPreviewListComponent,
|
|
3832
4160
|
ModalComponent,
|
|
3833
|
-
TextareaDirective
|
|
4161
|
+
TextareaDirective,
|
|
4162
|
+
ThreadComponent], imports: [i6.CommonModule, i1.TranslateModule, StreamAvatarModule], exports: [ChannelComponent,
|
|
3834
4163
|
ChannelHeaderComponent,
|
|
3835
4164
|
ChannelListComponent,
|
|
3836
4165
|
ChannelPreviewComponent,
|
|
@@ -3846,8 +4175,9 @@
|
|
|
3846
4175
|
NotificationListComponent,
|
|
3847
4176
|
AttachmentPreviewListComponent,
|
|
3848
4177
|
ModalComponent,
|
|
3849
|
-
StreamAvatarModule
|
|
3850
|
-
|
|
4178
|
+
StreamAvatarModule,
|
|
4179
|
+
ThreadComponent] });
|
|
4180
|
+
StreamChatModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, imports: [[i6.CommonModule, i1.TranslateModule, StreamAvatarModule], StreamAvatarModule] });
|
|
3851
4181
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, decorators: [{
|
|
3852
4182
|
type: i0.NgModule,
|
|
3853
4183
|
args: [{
|
|
@@ -3869,8 +4199,9 @@
|
|
|
3869
4199
|
AttachmentPreviewListComponent,
|
|
3870
4200
|
ModalComponent,
|
|
3871
4201
|
TextareaDirective,
|
|
4202
|
+
ThreadComponent,
|
|
3872
4203
|
],
|
|
3873
|
-
imports: [i6.CommonModule,
|
|
4204
|
+
imports: [i6.CommonModule, i1.TranslateModule, StreamAvatarModule],
|
|
3874
4205
|
exports: [
|
|
3875
4206
|
ChannelComponent,
|
|
3876
4207
|
ChannelHeaderComponent,
|
|
@@ -3889,6 +4220,7 @@
|
|
|
3889
4220
|
AttachmentPreviewListComponent,
|
|
3890
4221
|
ModalComponent,
|
|
3891
4222
|
StreamAvatarModule,
|
|
4223
|
+
ThreadComponent,
|
|
3892
4224
|
],
|
|
3893
4225
|
}]
|
|
3894
4226
|
}] });
|
|
@@ -3899,18 +4231,18 @@
|
|
|
3899
4231
|
return StreamAutocompleteTextareaModule;
|
|
3900
4232
|
}());
|
|
3901
4233
|
StreamAutocompleteTextareaModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3902
|
-
StreamAutocompleteTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, declarations: [AutocompleteTextareaComponent], imports: [i6.CommonModule,
|
|
4234
|
+
StreamAutocompleteTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, declarations: [AutocompleteTextareaComponent], imports: [i6.CommonModule, i1.TranslateModule, i5.MentionModule, StreamAvatarModule], exports: [AutocompleteTextareaComponent] });
|
|
3903
4235
|
StreamAutocompleteTextareaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, providers: [
|
|
3904
4236
|
{
|
|
3905
4237
|
provide: textareaInjectionToken,
|
|
3906
4238
|
useValue: AutocompleteTextareaComponent,
|
|
3907
4239
|
},
|
|
3908
|
-
], imports: [[i6.CommonModule,
|
|
4240
|
+
], imports: [[i6.CommonModule, i1.TranslateModule, i5.MentionModule, StreamAvatarModule]] });
|
|
3909
4241
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, decorators: [{
|
|
3910
4242
|
type: i0.NgModule,
|
|
3911
4243
|
args: [{
|
|
3912
4244
|
declarations: [AutocompleteTextareaComponent],
|
|
3913
|
-
imports: [i6.CommonModule,
|
|
4245
|
+
imports: [i6.CommonModule, i1.TranslateModule, i5.MentionModule, StreamAvatarModule],
|
|
3914
4246
|
exports: [AutocompleteTextareaComponent],
|
|
3915
4247
|
providers: [
|
|
3916
4248
|
{
|
|
@@ -3927,18 +4259,18 @@
|
|
|
3927
4259
|
return StreamTextareaModule;
|
|
3928
4260
|
}());
|
|
3929
4261
|
StreamTextareaModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3930
|
-
StreamTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, declarations: [TextareaComponent], imports: [i6.CommonModule,
|
|
4262
|
+
StreamTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, declarations: [TextareaComponent], imports: [i6.CommonModule, i1.TranslateModule], exports: [TextareaComponent] });
|
|
3931
4263
|
StreamTextareaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, providers: [
|
|
3932
4264
|
{
|
|
3933
4265
|
provide: textareaInjectionToken,
|
|
3934
4266
|
useValue: TextareaComponent,
|
|
3935
4267
|
},
|
|
3936
|
-
], imports: [[i6.CommonModule,
|
|
4268
|
+
], imports: [[i6.CommonModule, i1.TranslateModule]] });
|
|
3937
4269
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, decorators: [{
|
|
3938
4270
|
type: i0.NgModule,
|
|
3939
4271
|
args: [{
|
|
3940
4272
|
declarations: [TextareaComponent],
|
|
3941
|
-
imports: [i6.CommonModule,
|
|
4273
|
+
imports: [i6.CommonModule, i1.TranslateModule],
|
|
3942
4274
|
exports: [TextareaComponent],
|
|
3943
4275
|
providers: [
|
|
3944
4276
|
{
|
|
@@ -3990,6 +4322,7 @@
|
|
|
3990
4322
|
exports.TextareaComponent = TextareaComponent;
|
|
3991
4323
|
exports.TextareaDirective = TextareaDirective;
|
|
3992
4324
|
exports.ThemeService = ThemeService;
|
|
4325
|
+
exports.ThreadComponent = ThreadComponent;
|
|
3993
4326
|
exports.TransliterationService = TransliterationService;
|
|
3994
4327
|
exports.createMessagePreview = createMessagePreview;
|
|
3995
4328
|
exports.getDeviceWidth = getDeviceWidth;
|