stream-chat-angular 2.9.0 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/en.d.ts +2 -0
- package/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +718 -343
- 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 +175 -40
- package/esm2015/lib/chat-client.service.js +6 -1
- 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 +20 -9
- package/esm2015/lib/message-input/message-input.component.js +61 -13
- package/esm2015/lib/message-list/message-list.component.js +124 -55
- package/esm2015/lib/message-preview.js +4 -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 +583 -252
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/channel/channel.component.d.ts +2 -1
- package/lib/channel.service.d.ts +22 -7
- package/lib/chat-client.service.d.ts +1 -0
- package/lib/icon/icon.component.d.ts +1 -1
- package/lib/message/message.component.d.ts +26 -8
- package/lib/message-actions-box/message-actions-box.component.d.ts +4 -1
- package/lib/message-input/message-input.component.d.ts +7 -1
- package/lib/message-list/message-list.component.d.ts +21 -7
- 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.1';
|
|
357
357
|
|
|
358
358
|
var NotificationService = /** @class */ (function () {
|
|
359
359
|
function NotificationService() {
|
|
@@ -465,6 +465,18 @@
|
|
|
465
465
|
});
|
|
466
466
|
});
|
|
467
467
|
};
|
|
468
|
+
ChatClientService.prototype.disconnectUser = function () {
|
|
469
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
470
|
+
return __generator(this, function (_a) {
|
|
471
|
+
switch (_a.label) {
|
|
472
|
+
case 0: return [4 /*yield*/, this.chatClient.disconnectUser()];
|
|
473
|
+
case 1:
|
|
474
|
+
_a.sent();
|
|
475
|
+
return [2 /*return*/];
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
});
|
|
479
|
+
};
|
|
468
480
|
ChatClientService.prototype.getAppSettings = function () {
|
|
469
481
|
return __awaiter(this, void 0, void 0, function () {
|
|
470
482
|
var settings;
|
|
@@ -529,7 +541,11 @@
|
|
|
529
541
|
}]
|
|
530
542
|
}], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: NotificationService }]; } });
|
|
531
543
|
|
|
532
|
-
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; }
|
|
533
549
|
var clientSideId = user.id + "-" + uuid.v4();
|
|
534
550
|
return {
|
|
535
551
|
__html: text,
|
|
@@ -543,6 +559,8 @@
|
|
|
543
559
|
user: user,
|
|
544
560
|
attachments: attachments,
|
|
545
561
|
mentioned_users: mentionedUsers,
|
|
562
|
+
parent_id: parentId,
|
|
563
|
+
quoted_message_id: quotedMessageId,
|
|
546
564
|
};
|
|
547
565
|
};
|
|
548
566
|
|
|
@@ -569,31 +587,53 @@
|
|
|
569
587
|
this.activeChannelMessagesSubject = new rxjs.BehaviorSubject([]);
|
|
570
588
|
this.hasMoreChannelsSubject = new rxjs.ReplaySubject(1);
|
|
571
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);
|
|
572
594
|
this.channelListSetter = function (channels) {
|
|
573
595
|
_this.channelsSubject.next(channels);
|
|
574
596
|
};
|
|
575
597
|
this.messageListSetter = function (messages) {
|
|
576
598
|
_this.activeChannelMessagesSubject.next(messages);
|
|
577
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
|
+
};
|
|
578
606
|
this.channels$ = this.channelsSubject.asObservable();
|
|
579
607
|
this.activeChannel$ = this.activeChannelSubject.asObservable();
|
|
580
608
|
this.activeChannelMessages$ = this.activeChannelMessagesSubject.pipe(operators.map(function (messages) {
|
|
581
609
|
var channel = _this.activeChannelSubject.getValue();
|
|
582
|
-
return messages.map(function (message) {
|
|
583
|
-
if (_this.isStreamMessage(message) &&
|
|
584
|
-
_this.isFormatMessageResponse(message)) {
|
|
585
|
-
return message;
|
|
586
|
-
}
|
|
587
|
-
else if (_this.isFormatMessageResponse(message)) {
|
|
588
|
-
return Object.assign(Object.assign({}, message), { readBy: getReadBy(message, channel) });
|
|
589
|
-
}
|
|
590
|
-
else {
|
|
591
|
-
var formatMessage = _this.formatMessage(message);
|
|
592
|
-
return Object.assign(Object.assign({}, formatMessage), { readBy: getReadBy(formatMessage, channel) });
|
|
593
|
-
}
|
|
594
|
-
});
|
|
610
|
+
return messages.map(function (message) { return _this.transformToStreamMessage(message, channel); });
|
|
595
611
|
}));
|
|
596
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
|
+
});
|
|
597
637
|
}
|
|
598
638
|
ChannelService.prototype.setAsActiveChannel = function (channel) {
|
|
599
639
|
var prevActiveChannel = this.activeChannelSubject.getValue();
|
|
@@ -607,25 +647,59 @@
|
|
|
607
647
|
void channel.markRead();
|
|
608
648
|
}
|
|
609
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
|
+
});
|
|
610
683
|
};
|
|
684
|
+
// load more thread replies
|
|
611
685
|
ChannelService.prototype.loadMoreMessages = function () {
|
|
612
|
-
var _a, _b, _c, _d;
|
|
686
|
+
var _a, _b, _c, _d, _e;
|
|
613
687
|
return __awaiter(this, void 0, void 0, function () {
|
|
614
688
|
var activeChnannel, lastMessageId;
|
|
615
|
-
return __generator(this, function (
|
|
616
|
-
switch (
|
|
689
|
+
return __generator(this, function (_f) {
|
|
690
|
+
switch (_f.label) {
|
|
617
691
|
case 0:
|
|
618
692
|
activeChnannel = this.activeChannelSubject.getValue();
|
|
619
693
|
lastMessageId = (_a = this.activeChannelMessagesSubject.getValue()[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
620
694
|
return [4 /*yield*/, (activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.query({
|
|
621
|
-
messages: { limit:
|
|
695
|
+
messages: { limit: (_b = this.options) === null || _b === void 0 ? void 0 : _b.message_limit, id_lt: lastMessageId },
|
|
622
696
|
members: { limit: 0 },
|
|
623
697
|
watchers: { limit: 0 },
|
|
624
698
|
}))];
|
|
625
699
|
case 1:
|
|
626
|
-
|
|
627
|
-
if (((
|
|
628
|
-
((
|
|
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)) {
|
|
629
703
|
this.activeChannelMessagesSubject.next(__spreadArray([], __read(activeChnannel.state.messages)));
|
|
630
704
|
}
|
|
631
705
|
return [2 /*return*/];
|
|
@@ -633,11 +707,36 @@
|
|
|
633
707
|
});
|
|
634
708
|
});
|
|
635
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
|
+
};
|
|
636
735
|
ChannelService.prototype.init = function (filters, sort, options) {
|
|
637
736
|
return __awaiter(this, void 0, void 0, function () {
|
|
638
737
|
var _this = this;
|
|
639
|
-
return __generator(this, function (
|
|
640
|
-
switch (
|
|
738
|
+
return __generator(this, function (_f) {
|
|
739
|
+
switch (_f.label) {
|
|
641
740
|
case 0:
|
|
642
741
|
this.filters = filters;
|
|
643
742
|
this.options = options || {
|
|
@@ -646,27 +745,35 @@
|
|
|
646
745
|
state: true,
|
|
647
746
|
presence: true,
|
|
648
747
|
watch: true,
|
|
649
|
-
message_limit:
|
|
748
|
+
message_limit: this.messagePageSize,
|
|
650
749
|
};
|
|
651
750
|
this.sort = sort || { last_message_at: -1, updated_at: -1 };
|
|
652
751
|
return [4 /*yield*/, this.queryChannels()];
|
|
653
752
|
case 1:
|
|
654
|
-
|
|
753
|
+
_f.sent();
|
|
655
754
|
this.chatClientService.notification$.subscribe(function (notification) { return void _this.handleNotification(notification); });
|
|
656
755
|
return [2 /*return*/];
|
|
657
756
|
}
|
|
658
757
|
});
|
|
659
758
|
});
|
|
660
759
|
};
|
|
760
|
+
ChannelService.prototype.reset = function () {
|
|
761
|
+
this.activeChannelMessagesSubject.next([]);
|
|
762
|
+
this.activeChannelSubject.next(undefined);
|
|
763
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
764
|
+
this.activeThreadMessagesSubject.next([]);
|
|
765
|
+
this.channelsSubject.next(undefined);
|
|
766
|
+
this.selectMessageToQuote(undefined);
|
|
767
|
+
};
|
|
661
768
|
ChannelService.prototype.loadMoreChannels = function () {
|
|
662
769
|
return __awaiter(this, void 0, void 0, function () {
|
|
663
|
-
return __generator(this, function (
|
|
664
|
-
switch (
|
|
770
|
+
return __generator(this, function (_f) {
|
|
771
|
+
switch (_f.label) {
|
|
665
772
|
case 0:
|
|
666
773
|
this.options.offset = this.channels.length;
|
|
667
774
|
return [4 /*yield*/, this.queryChannels()];
|
|
668
775
|
case 1:
|
|
669
|
-
|
|
776
|
+
_f.sent();
|
|
670
777
|
return [2 /*return*/];
|
|
671
778
|
}
|
|
672
779
|
});
|
|
@@ -675,13 +782,13 @@
|
|
|
675
782
|
ChannelService.prototype.addReaction = function (messageId, reactionType) {
|
|
676
783
|
var _a;
|
|
677
784
|
return __awaiter(this, void 0, void 0, function () {
|
|
678
|
-
return __generator(this, function (
|
|
679
|
-
switch (
|
|
785
|
+
return __generator(this, function (_f) {
|
|
786
|
+
switch (_f.label) {
|
|
680
787
|
case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject.getValue()) === null || _a === void 0 ? void 0 : _a.sendReaction(messageId, {
|
|
681
788
|
type: reactionType,
|
|
682
789
|
}))];
|
|
683
790
|
case 1:
|
|
684
|
-
|
|
791
|
+
_f.sent();
|
|
685
792
|
return [2 /*return*/];
|
|
686
793
|
}
|
|
687
794
|
});
|
|
@@ -690,32 +797,34 @@
|
|
|
690
797
|
ChannelService.prototype.removeReaction = function (messageId, reactionType) {
|
|
691
798
|
var _a;
|
|
692
799
|
return __awaiter(this, void 0, void 0, function () {
|
|
693
|
-
return __generator(this, function (
|
|
694
|
-
switch (
|
|
800
|
+
return __generator(this, function (_f) {
|
|
801
|
+
switch (_f.label) {
|
|
695
802
|
case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject
|
|
696
803
|
.getValue()) === null || _a === void 0 ? void 0 : _a.deleteReaction(messageId, reactionType))];
|
|
697
804
|
case 1:
|
|
698
|
-
|
|
805
|
+
_f.sent();
|
|
699
806
|
return [2 /*return*/];
|
|
700
807
|
}
|
|
701
808
|
});
|
|
702
809
|
});
|
|
703
810
|
};
|
|
704
|
-
ChannelService.prototype.sendMessage = function (text, attachments, mentionedUsers) {
|
|
811
|
+
ChannelService.prototype.sendMessage = function (text, attachments, mentionedUsers, parentId, quotedMessageId) {
|
|
705
812
|
if (attachments === void 0) { attachments = []; }
|
|
706
813
|
if (mentionedUsers === void 0) { mentionedUsers = []; }
|
|
814
|
+
if (parentId === void 0) { parentId = undefined; }
|
|
815
|
+
if (quotedMessageId === void 0) { quotedMessageId = undefined; }
|
|
707
816
|
return __awaiter(this, void 0, void 0, function () {
|
|
708
817
|
var preview, channel;
|
|
709
|
-
return __generator(this, function (
|
|
710
|
-
switch (
|
|
818
|
+
return __generator(this, function (_f) {
|
|
819
|
+
switch (_f.label) {
|
|
711
820
|
case 0:
|
|
712
|
-
preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers);
|
|
821
|
+
preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers, parentId, quotedMessageId);
|
|
713
822
|
channel = this.activeChannelSubject.getValue();
|
|
714
823
|
preview.readBy = [];
|
|
715
824
|
channel.state.addMessageSorted(preview, true);
|
|
716
825
|
return [4 /*yield*/, this.sendMessageRequest(preview)];
|
|
717
826
|
case 1:
|
|
718
|
-
|
|
827
|
+
_f.sent();
|
|
719
828
|
return [2 /*return*/];
|
|
720
829
|
}
|
|
721
830
|
});
|
|
@@ -724,14 +833,14 @@
|
|
|
724
833
|
ChannelService.prototype.resendMessage = function (message) {
|
|
725
834
|
return __awaiter(this, void 0, void 0, function () {
|
|
726
835
|
var channel;
|
|
727
|
-
return __generator(this, function (
|
|
728
|
-
switch (
|
|
836
|
+
return __generator(this, function (_f) {
|
|
837
|
+
switch (_f.label) {
|
|
729
838
|
case 0:
|
|
730
839
|
channel = this.activeChannelSubject.getValue();
|
|
731
840
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, message), { errorStatusCode: undefined, status: 'sending' }), true);
|
|
732
841
|
return [4 /*yield*/, this.sendMessageRequest(message)];
|
|
733
842
|
case 1:
|
|
734
|
-
|
|
843
|
+
_f.sent();
|
|
735
844
|
return [2 /*return*/];
|
|
736
845
|
}
|
|
737
846
|
});
|
|
@@ -739,11 +848,11 @@
|
|
|
739
848
|
};
|
|
740
849
|
ChannelService.prototype.updateMessage = function (message) {
|
|
741
850
|
return __awaiter(this, void 0, void 0, function () {
|
|
742
|
-
return __generator(this, function (
|
|
743
|
-
switch (
|
|
851
|
+
return __generator(this, function (_f) {
|
|
852
|
+
switch (_f.label) {
|
|
744
853
|
case 0: return [4 /*yield*/, this.chatClientService.chatClient.updateMessage(message)];
|
|
745
854
|
case 1:
|
|
746
|
-
|
|
855
|
+
_f.sent();
|
|
747
856
|
return [2 /*return*/];
|
|
748
857
|
}
|
|
749
858
|
});
|
|
@@ -751,11 +860,11 @@
|
|
|
751
860
|
};
|
|
752
861
|
ChannelService.prototype.deleteMessage = function (message) {
|
|
753
862
|
return __awaiter(this, void 0, void 0, function () {
|
|
754
|
-
return __generator(this, function (
|
|
755
|
-
switch (
|
|
863
|
+
return __generator(this, function (_f) {
|
|
864
|
+
switch (_f.label) {
|
|
756
865
|
case 0: return [4 /*yield*/, this.chatClientService.chatClient.deleteMessage(message.id)];
|
|
757
866
|
case 1:
|
|
758
|
-
|
|
867
|
+
_f.sent();
|
|
759
868
|
return [2 /*return*/];
|
|
760
869
|
}
|
|
761
870
|
});
|
|
@@ -764,8 +873,8 @@
|
|
|
764
873
|
ChannelService.prototype.uploadAttachments = function (uploads) {
|
|
765
874
|
return __awaiter(this, void 0, void 0, function () {
|
|
766
875
|
var result, channel, uploadResults;
|
|
767
|
-
return __generator(this, function (
|
|
768
|
-
switch (
|
|
876
|
+
return __generator(this, function (_f) {
|
|
877
|
+
switch (_f.label) {
|
|
769
878
|
case 0:
|
|
770
879
|
result = [];
|
|
771
880
|
channel = this.activeChannelSubject.getValue();
|
|
@@ -773,7 +882,7 @@
|
|
|
773
882
|
? channel.sendImage(upload.file)
|
|
774
883
|
: channel.sendFile(upload.file); }))];
|
|
775
884
|
case 1:
|
|
776
|
-
uploadResults =
|
|
885
|
+
uploadResults = _f.sent();
|
|
777
886
|
uploadResults.forEach(function (uploadResult, i) {
|
|
778
887
|
var file = uploads[i].file;
|
|
779
888
|
var type = uploads[i].type;
|
|
@@ -797,15 +906,15 @@
|
|
|
797
906
|
ChannelService.prototype.deleteAttachment = function (attachmentUpload) {
|
|
798
907
|
return __awaiter(this, void 0, void 0, function () {
|
|
799
908
|
var channel;
|
|
800
|
-
return __generator(this, function (
|
|
801
|
-
switch (
|
|
909
|
+
return __generator(this, function (_f) {
|
|
910
|
+
switch (_f.label) {
|
|
802
911
|
case 0:
|
|
803
912
|
channel = this.activeChannelSubject.getValue();
|
|
804
913
|
return [4 /*yield*/, (attachmentUpload.type === 'image'
|
|
805
914
|
? channel.deleteImage(attachmentUpload.url)
|
|
806
915
|
: channel.deleteFile(attachmentUpload.url))];
|
|
807
916
|
case 1:
|
|
808
|
-
|
|
917
|
+
_f.sent();
|
|
809
918
|
return [2 /*return*/];
|
|
810
919
|
}
|
|
811
920
|
});
|
|
@@ -815,8 +924,8 @@
|
|
|
815
924
|
return __awaiter(this, void 0, void 0, function () {
|
|
816
925
|
var activeChannel, result;
|
|
817
926
|
var _this = this;
|
|
818
|
-
return __generator(this, function (
|
|
819
|
-
switch (
|
|
927
|
+
return __generator(this, function (_f) {
|
|
928
|
+
switch (_f.label) {
|
|
820
929
|
case 0:
|
|
821
930
|
activeChannel = this.activeChannelSubject.getValue();
|
|
822
931
|
if (!activeChannel) {
|
|
@@ -833,7 +942,7 @@
|
|
|
833
942
|
id: { $ne: this.chatClientService.chatClient.userID },
|
|
834
943
|
})];
|
|
835
944
|
case 2:
|
|
836
|
-
result =
|
|
945
|
+
result = _f.sent();
|
|
837
946
|
return [2 /*return*/, Object.values(result.members)];
|
|
838
947
|
}
|
|
839
948
|
});
|
|
@@ -841,60 +950,84 @@
|
|
|
841
950
|
};
|
|
842
951
|
ChannelService.prototype.sendAction = function (messageId, formData) {
|
|
843
952
|
return __awaiter(this, void 0, void 0, function () {
|
|
844
|
-
var channel, response;
|
|
845
|
-
return __generator(this, function (
|
|
846
|
-
switch (
|
|
953
|
+
var channel, response, isThreadReply;
|
|
954
|
+
return __generator(this, function (_f) {
|
|
955
|
+
switch (_f.label) {
|
|
847
956
|
case 0:
|
|
848
957
|
channel = this.activeChannelSubject.getValue();
|
|
849
958
|
return [4 /*yield*/, channel.sendAction(messageId, formData)];
|
|
850
959
|
case 1:
|
|
851
|
-
response =
|
|
960
|
+
response = _f.sent();
|
|
852
961
|
if (response === null || response === void 0 ? void 0 : response.message) {
|
|
853
962
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, response.message), { status: 'received' }));
|
|
854
|
-
|
|
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)));
|
|
855
967
|
}
|
|
856
968
|
else {
|
|
857
969
|
channel.state.removeMessage({ id: messageId });
|
|
858
|
-
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
|
+
}
|
|
859
980
|
}
|
|
860
981
|
return [2 /*return*/];
|
|
861
982
|
}
|
|
862
983
|
});
|
|
863
984
|
});
|
|
864
985
|
};
|
|
986
|
+
ChannelService.prototype.selectMessageToQuote = function (message) {
|
|
987
|
+
this.messageToQuoteSubject.next(message);
|
|
988
|
+
};
|
|
865
989
|
ChannelService.prototype.sendMessageRequest = function (preview) {
|
|
866
990
|
var _a;
|
|
867
991
|
return __awaiter(this, void 0, void 0, function () {
|
|
868
|
-
var channel, response, error_1, stringError, parsedError;
|
|
869
|
-
return __generator(this, function (
|
|
870
|
-
switch (
|
|
992
|
+
var channel, isThreadReply, response, error_1, stringError, parsedError;
|
|
993
|
+
return __generator(this, function (_f) {
|
|
994
|
+
switch (_f.label) {
|
|
871
995
|
case 0:
|
|
872
996
|
channel = this.activeChannelSubject.getValue();
|
|
873
|
-
|
|
874
|
-
|
|
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;
|
|
875
1002
|
case 1:
|
|
876
|
-
|
|
1003
|
+
_f.trys.push([1, 3, , 4]);
|
|
877
1004
|
return [4 /*yield*/, channel.sendMessage({
|
|
878
1005
|
text: preview.text,
|
|
879
1006
|
attachments: preview.attachments,
|
|
880
1007
|
mentioned_users: (_a = preview.mentioned_users) === null || _a === void 0 ? void 0 : _a.map(function (u) { return u.id; }),
|
|
881
1008
|
id: preview.id,
|
|
1009
|
+
parent_id: preview.parent_id,
|
|
1010
|
+
quoted_message_id: preview.quoted_message_id,
|
|
882
1011
|
})];
|
|
883
1012
|
case 2:
|
|
884
|
-
response =
|
|
1013
|
+
response = _f.sent();
|
|
885
1014
|
if (response === null || response === void 0 ? void 0 : response.message) {
|
|
886
1015
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, response.message), { status: 'received' }), true);
|
|
887
|
-
|
|
1016
|
+
isThreadReply
|
|
1017
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
1018
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
888
1019
|
}
|
|
889
1020
|
return [3 /*break*/, 4];
|
|
890
1021
|
case 3:
|
|
891
|
-
error_1 =
|
|
1022
|
+
error_1 = _f.sent();
|
|
892
1023
|
stringError = JSON.stringify(error_1);
|
|
893
1024
|
parsedError = stringError
|
|
894
1025
|
? JSON.parse(stringError)
|
|
895
1026
|
: {};
|
|
896
1027
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, preview), { errorStatusCode: parsedError.status || undefined, status: 'failed' }), true);
|
|
897
|
-
|
|
1028
|
+
isThreadReply
|
|
1029
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
1030
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
898
1031
|
return [3 /*break*/, 4];
|
|
899
1032
|
case 4: return [2 /*return*/];
|
|
900
1033
|
}
|
|
@@ -903,53 +1036,53 @@
|
|
|
903
1036
|
};
|
|
904
1037
|
ChannelService.prototype.handleNotification = function (notification) {
|
|
905
1038
|
return __awaiter(this, void 0, void 0, function () {
|
|
906
|
-
var
|
|
1039
|
+
var _f;
|
|
907
1040
|
var _this = this;
|
|
908
|
-
return __generator(this, function (
|
|
909
|
-
switch (
|
|
1041
|
+
return __generator(this, function (_g) {
|
|
1042
|
+
switch (_g.label) {
|
|
910
1043
|
case 0:
|
|
911
|
-
|
|
912
|
-
switch (
|
|
1044
|
+
_f = notification.eventType;
|
|
1045
|
+
switch (_f) {
|
|
913
1046
|
case 'notification.message_new': return [3 /*break*/, 1];
|
|
914
1047
|
case 'notification.added_to_channel': return [3 /*break*/, 3];
|
|
915
1048
|
case 'notification.removed_from_channel': return [3 /*break*/, 5];
|
|
916
1049
|
}
|
|
917
1050
|
return [3 /*break*/, 6];
|
|
918
1051
|
case 1: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
919
|
-
return __generator(this, function (
|
|
920
|
-
switch (
|
|
1052
|
+
return __generator(this, function (_f) {
|
|
1053
|
+
switch (_f.label) {
|
|
921
1054
|
case 0:
|
|
922
1055
|
if (!this.customNewMessageNotificationHandler) return [3 /*break*/, 1];
|
|
923
1056
|
this.customNewMessageNotificationHandler(notification, this.channelListSetter);
|
|
924
1057
|
return [3 /*break*/, 3];
|
|
925
1058
|
case 1: return [4 /*yield*/, this.handleNewMessageNotification(notification)];
|
|
926
1059
|
case 2:
|
|
927
|
-
|
|
928
|
-
|
|
1060
|
+
_f.sent();
|
|
1061
|
+
_f.label = 3;
|
|
929
1062
|
case 3: return [2 /*return*/];
|
|
930
1063
|
}
|
|
931
1064
|
});
|
|
932
1065
|
}); })];
|
|
933
1066
|
case 2:
|
|
934
|
-
|
|
1067
|
+
_g.sent();
|
|
935
1068
|
return [3 /*break*/, 6];
|
|
936
1069
|
case 3: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
937
|
-
return __generator(this, function (
|
|
938
|
-
switch (
|
|
1070
|
+
return __generator(this, function (_f) {
|
|
1071
|
+
switch (_f.label) {
|
|
939
1072
|
case 0:
|
|
940
1073
|
if (!this.customAddedToChannelNotificationHandler) return [3 /*break*/, 1];
|
|
941
1074
|
this.customAddedToChannelNotificationHandler(notification, this.channelListSetter);
|
|
942
1075
|
return [3 /*break*/, 3];
|
|
943
1076
|
case 1: return [4 /*yield*/, this.handleAddedToChannelNotification(notification)];
|
|
944
1077
|
case 2:
|
|
945
|
-
|
|
946
|
-
|
|
1078
|
+
_f.sent();
|
|
1079
|
+
_f.label = 3;
|
|
947
1080
|
case 3: return [2 /*return*/];
|
|
948
1081
|
}
|
|
949
1082
|
});
|
|
950
1083
|
}); })];
|
|
951
1084
|
case 4:
|
|
952
|
-
|
|
1085
|
+
_g.sent();
|
|
953
1086
|
return [3 /*break*/, 6];
|
|
954
1087
|
case 5:
|
|
955
1088
|
{
|
|
@@ -962,7 +1095,7 @@
|
|
|
962
1095
|
}
|
|
963
1096
|
});
|
|
964
1097
|
}
|
|
965
|
-
|
|
1098
|
+
_g.label = 6;
|
|
966
1099
|
case 6: return [2 /*return*/];
|
|
967
1100
|
}
|
|
968
1101
|
});
|
|
@@ -974,11 +1107,11 @@
|
|
|
974
1107
|
};
|
|
975
1108
|
ChannelService.prototype.handleNewMessageNotification = function (notification) {
|
|
976
1109
|
return __awaiter(this, void 0, void 0, function () {
|
|
977
|
-
return __generator(this, function (
|
|
978
|
-
switch (
|
|
1110
|
+
return __generator(this, function (_f) {
|
|
1111
|
+
switch (_f.label) {
|
|
979
1112
|
case 0: return [4 /*yield*/, this.addChannelFromNotification(notification)];
|
|
980
1113
|
case 1:
|
|
981
|
-
|
|
1114
|
+
_f.sent();
|
|
982
1115
|
return [2 /*return*/];
|
|
983
1116
|
}
|
|
984
1117
|
});
|
|
@@ -986,11 +1119,11 @@
|
|
|
986
1119
|
};
|
|
987
1120
|
ChannelService.prototype.handleAddedToChannelNotification = function (notification) {
|
|
988
1121
|
return __awaiter(this, void 0, void 0, function () {
|
|
989
|
-
return __generator(this, function (
|
|
990
|
-
switch (
|
|
1122
|
+
return __generator(this, function (_f) {
|
|
1123
|
+
switch (_f.label) {
|
|
991
1124
|
case 0: return [4 /*yield*/, this.addChannelFromNotification(notification)];
|
|
992
1125
|
case 1:
|
|
993
|
-
|
|
1126
|
+
_f.sent();
|
|
994
1127
|
return [2 /*return*/];
|
|
995
1128
|
}
|
|
996
1129
|
});
|
|
@@ -1000,13 +1133,13 @@
|
|
|
1000
1133
|
var _a, _b;
|
|
1001
1134
|
return __awaiter(this, void 0, void 0, function () {
|
|
1002
1135
|
var channel;
|
|
1003
|
-
return __generator(this, function (
|
|
1004
|
-
switch (
|
|
1136
|
+
return __generator(this, function (_f) {
|
|
1137
|
+
switch (_f.label) {
|
|
1005
1138
|
case 0:
|
|
1006
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);
|
|
1007
1140
|
return [4 /*yield*/, channel.watch()];
|
|
1008
1141
|
case 1:
|
|
1009
|
-
|
|
1142
|
+
_f.sent();
|
|
1010
1143
|
this.watchForChannelEvents(channel);
|
|
1011
1144
|
this.channelsSubject.next(__spreadArray([
|
|
1012
1145
|
channel
|
|
@@ -1027,9 +1160,11 @@
|
|
|
1027
1160
|
};
|
|
1028
1161
|
ChannelService.prototype.watchForActiveChannelEvents = function (channel) {
|
|
1029
1162
|
var _this = this;
|
|
1030
|
-
this.activeChannelSubscriptions.push(channel.on('message.new', function () {
|
|
1163
|
+
this.activeChannelSubscriptions.push(channel.on('message.new', function (event) {
|
|
1031
1164
|
_this.ngZone.run(function () {
|
|
1032
|
-
|
|
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)));
|
|
1033
1168
|
_this.activeChannel$.pipe(operators.first()).subscribe(function (c) {
|
|
1034
1169
|
if (_this.canSendReadEvents) {
|
|
1035
1170
|
void (c === null || c === void 0 ? void 0 : c.markRead());
|
|
@@ -1059,11 +1194,16 @@
|
|
|
1059
1194
|
ChannelService.prototype.messageUpdated = function (event) {
|
|
1060
1195
|
var _this = this;
|
|
1061
1196
|
this.ngZone.run(function () {
|
|
1062
|
-
var
|
|
1197
|
+
var isThreadReply = event.message && event.message.parent_id;
|
|
1198
|
+
var messages = isThreadReply
|
|
1199
|
+
? _this.activeThreadMessagesSubject.getValue()
|
|
1200
|
+
: _this.activeChannelMessagesSubject.getValue();
|
|
1063
1201
|
var messageIndex = messages.findIndex(function (m) { var _a; return m.id === ((_a = event.message) === null || _a === void 0 ? void 0 : _a.id); });
|
|
1064
1202
|
if (messageIndex !== -1 && event.message) {
|
|
1065
1203
|
messages[messageIndex] = event.message;
|
|
1066
|
-
|
|
1204
|
+
isThreadReply
|
|
1205
|
+
? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(messages)))
|
|
1206
|
+
: _this.activeChannelMessagesSubject.next(__spreadArray([], __read(messages)));
|
|
1067
1207
|
}
|
|
1068
1208
|
});
|
|
1069
1209
|
};
|
|
@@ -1071,8 +1211,11 @@
|
|
|
1071
1211
|
var _this = this;
|
|
1072
1212
|
this.ngZone.run(function () {
|
|
1073
1213
|
var _a, _b, _c, _d;
|
|
1214
|
+
var isThreadMessage = e.message && e.message.parent_id;
|
|
1074
1215
|
var messages;
|
|
1075
|
-
|
|
1216
|
+
(isThreadMessage
|
|
1217
|
+
? _this.activeThreadMessages$
|
|
1218
|
+
: _this.activeChannelMessages$)
|
|
1076
1219
|
.pipe(operators.first())
|
|
1077
1220
|
.subscribe(function (m) { return (messages = m); });
|
|
1078
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); });
|
|
@@ -1083,7 +1226,9 @@
|
|
|
1083
1226
|
message.reaction_scores = Object.assign({}, (_b = e.message) === null || _b === void 0 ? void 0 : _b.reaction_scores);
|
|
1084
1227
|
message.latest_reactions = __spreadArray([], __read((((_c = e.message) === null || _c === void 0 ? void 0 : _c.latest_reactions) || [])));
|
|
1085
1228
|
message.own_reactions = __spreadArray([], __read((((_d = e.message) === null || _d === void 0 ? void 0 : _d.own_reactions) || [])));
|
|
1086
|
-
|
|
1229
|
+
isThreadMessage
|
|
1230
|
+
? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(messages)))
|
|
1231
|
+
: _this.activeChannelMessagesSubject.next(__spreadArray([], __read(messages)));
|
|
1087
1232
|
});
|
|
1088
1233
|
};
|
|
1089
1234
|
ChannelService.prototype.formatMessage = function (message) {
|
|
@@ -1113,13 +1258,13 @@
|
|
|
1113
1258
|
return __awaiter(this, void 0, void 0, function () {
|
|
1114
1259
|
var channels, prevChannels, error_2;
|
|
1115
1260
|
var _this = this;
|
|
1116
|
-
return __generator(this, function (
|
|
1117
|
-
switch (
|
|
1261
|
+
return __generator(this, function (_f) {
|
|
1262
|
+
switch (_f.label) {
|
|
1118
1263
|
case 0:
|
|
1119
|
-
|
|
1264
|
+
_f.trys.push([0, 2, , 3]);
|
|
1120
1265
|
return [4 /*yield*/, this.chatClientService.chatClient.queryChannels(this.filters, this.sort, this.options)];
|
|
1121
1266
|
case 1:
|
|
1122
|
-
channels =
|
|
1267
|
+
channels = _f.sent();
|
|
1123
1268
|
channels.forEach(function (c) { return _this.watchForChannelEvents(c); });
|
|
1124
1269
|
prevChannels = this.channelsSubject.getValue() || [];
|
|
1125
1270
|
this.channelsSubject.next(__spreadArray(__spreadArray([], __read(prevChannels)), __read(channels)));
|
|
@@ -1129,7 +1274,7 @@
|
|
|
1129
1274
|
this.hasMoreChannelsSubject.next(channels.length >= this.options.limit);
|
|
1130
1275
|
return [3 /*break*/, 3];
|
|
1131
1276
|
case 2:
|
|
1132
|
-
error_2 =
|
|
1277
|
+
error_2 = _f.sent();
|
|
1133
1278
|
this.channelsSubject.error(error_2);
|
|
1134
1279
|
return [3 /*break*/, 3];
|
|
1135
1280
|
case 3: return [2 /*return*/];
|
|
@@ -1144,7 +1289,7 @@
|
|
|
1144
1289
|
case 'message.new': {
|
|
1145
1290
|
_this.ngZone.run(function () {
|
|
1146
1291
|
if (_this.customNewMessageHandler) {
|
|
1147
|
-
_this.customNewMessageHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1292
|
+
_this.customNewMessageHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1148
1293
|
}
|
|
1149
1294
|
else {
|
|
1150
1295
|
_this.handleNewMessage(event, channel);
|
|
@@ -1155,7 +1300,7 @@
|
|
|
1155
1300
|
case 'channel.hidden': {
|
|
1156
1301
|
_this.ngZone.run(function () {
|
|
1157
1302
|
if (_this.customChannelHiddenHandler) {
|
|
1158
|
-
_this.customChannelHiddenHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1303
|
+
_this.customChannelHiddenHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1159
1304
|
}
|
|
1160
1305
|
else {
|
|
1161
1306
|
_this.handleChannelHidden(event);
|
|
@@ -1166,7 +1311,7 @@
|
|
|
1166
1311
|
case 'channel.deleted': {
|
|
1167
1312
|
_this.ngZone.run(function () {
|
|
1168
1313
|
if (_this.customChannelDeletedHandler) {
|
|
1169
|
-
_this.customChannelDeletedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1314
|
+
_this.customChannelDeletedHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1170
1315
|
}
|
|
1171
1316
|
else {
|
|
1172
1317
|
_this.handleChannelDeleted(event);
|
|
@@ -1177,7 +1322,7 @@
|
|
|
1177
1322
|
case 'channel.visible': {
|
|
1178
1323
|
_this.ngZone.run(function () {
|
|
1179
1324
|
if (_this.customChannelVisibleHandler) {
|
|
1180
|
-
_this.customChannelVisibleHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1325
|
+
_this.customChannelVisibleHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1181
1326
|
}
|
|
1182
1327
|
else {
|
|
1183
1328
|
_this.handleChannelVisible(event, channel);
|
|
@@ -1188,7 +1333,7 @@
|
|
|
1188
1333
|
case 'channel.updated': {
|
|
1189
1334
|
_this.ngZone.run(function () {
|
|
1190
1335
|
if (_this.customChannelUpdatedHandler) {
|
|
1191
|
-
_this.customChannelUpdatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1336
|
+
_this.customChannelUpdatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1192
1337
|
}
|
|
1193
1338
|
else {
|
|
1194
1339
|
_this.handleChannelUpdate(event);
|
|
@@ -1199,7 +1344,7 @@
|
|
|
1199
1344
|
case 'channel.truncated': {
|
|
1200
1345
|
_this.ngZone.run(function () {
|
|
1201
1346
|
if (_this.customChannelTruncatedHandler) {
|
|
1202
|
-
_this.customChannelTruncatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1347
|
+
_this.customChannelTruncatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1203
1348
|
}
|
|
1204
1349
|
else {
|
|
1205
1350
|
_this.handleChannelTruncate(event);
|
|
@@ -1240,6 +1385,7 @@
|
|
|
1240
1385
|
}
|
|
1241
1386
|
}
|
|
1242
1387
|
};
|
|
1388
|
+
// truncate active thread as well
|
|
1243
1389
|
ChannelService.prototype.handleChannelTruncate = function (event) {
|
|
1244
1390
|
var _a, _b;
|
|
1245
1391
|
var channelIndex = this.channels.findIndex(function (c) { return c.cid === event.channel.cid; });
|
|
@@ -1251,6 +1397,8 @@
|
|
|
1251
1397
|
channel.state.messages = [];
|
|
1252
1398
|
this.activeChannelSubject.next(channel);
|
|
1253
1399
|
this.activeChannelMessagesSubject.next([]);
|
|
1400
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
1401
|
+
this.activeThreadMessagesSubject.next([]);
|
|
1254
1402
|
}
|
|
1255
1403
|
}
|
|
1256
1404
|
};
|
|
@@ -1274,6 +1422,20 @@
|
|
|
1274
1422
|
enumerable: false,
|
|
1275
1423
|
configurable: true
|
|
1276
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
|
+
};
|
|
1277
1439
|
return ChannelService;
|
|
1278
1440
|
}());
|
|
1279
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 });
|
|
@@ -1632,6 +1794,7 @@
|
|
|
1632
1794
|
Flag: 'Flag',
|
|
1633
1795
|
'Message Failed': 'Message Failed',
|
|
1634
1796
|
'Message Failed · Unauthorized': 'Message Failed · Unauthorized',
|
|
1797
|
+
'Message Failed · Click to try again': 'Message Failed · Click to try again',
|
|
1635
1798
|
'Message deleted': 'Message deleted',
|
|
1636
1799
|
'Message has been successfully flagged': 'Message has been successfully flagged',
|
|
1637
1800
|
'Message pinned': 'Message pinned',
|
|
@@ -1682,6 +1845,7 @@
|
|
|
1682
1845
|
test: 'success',
|
|
1683
1846
|
'Sending links is not allowed in this conversation': 'Sending links is not allowed in this conversation',
|
|
1684
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",
|
|
1685
1849
|
'Unsupported file type: {{type}}': 'Unsupported file type: {{type}}',
|
|
1686
1850
|
},
|
|
1687
1851
|
};
|
|
@@ -1699,14 +1863,14 @@
|
|
|
1699
1863
|
};
|
|
1700
1864
|
return StreamI18nService;
|
|
1701
1865
|
}());
|
|
1702
|
-
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 });
|
|
1703
1867
|
StreamI18nService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, providedIn: 'root' });
|
|
1704
1868
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, decorators: [{
|
|
1705
1869
|
type: i0.Injectable,
|
|
1706
1870
|
args: [{
|
|
1707
1871
|
providedIn: 'root',
|
|
1708
1872
|
}]
|
|
1709
|
-
}], ctorParameters: function () { return [{ type:
|
|
1873
|
+
}], ctorParameters: function () { return [{ type: i1__namespace.TranslateService }]; } });
|
|
1710
1874
|
|
|
1711
1875
|
var AvatarComponent = /** @class */ (function () {
|
|
1712
1876
|
function AvatarComponent() {
|
|
@@ -1747,7 +1911,7 @@
|
|
|
1747
1911
|
return IconComponent;
|
|
1748
1912
|
}());
|
|
1749
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 });
|
|
1750
|
-
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"] }] });
|
|
1751
1915
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: IconComponent, decorators: [{
|
|
1752
1916
|
type: i0.Component,
|
|
1753
1917
|
args: [{
|
|
@@ -1889,6 +2053,90 @@
|
|
|
1889
2053
|
}]
|
|
1890
2054
|
}], ctorParameters: function () { return []; } });
|
|
1891
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
|
+
|
|
1892
2140
|
var AttachmentPreviewListComponent = /** @class */ (function () {
|
|
1893
2141
|
function AttachmentPreviewListComponent(attachmentService) {
|
|
1894
2142
|
this.attachmentService = attachmentService;
|
|
@@ -1924,7 +2172,7 @@
|
|
|
1924
2172
|
return AttachmentPreviewListComponent;
|
|
1925
2173
|
}());
|
|
1926
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 });
|
|
1927
|
-
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 } });
|
|
1928
2176
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentPreviewListComponent, decorators: [{
|
|
1929
2177
|
type: i0.Component,
|
|
1930
2178
|
args: [{
|
|
@@ -1945,6 +2193,7 @@
|
|
|
1945
2193
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
1946
2194
|
this.cdRef = cdRef;
|
|
1947
2195
|
this.chatClient = chatClient;
|
|
2196
|
+
this.mode = 'main';
|
|
1948
2197
|
this.messageUpdate = new i0.EventEmitter();
|
|
1949
2198
|
this.textareaValue = '';
|
|
1950
2199
|
this.mentionedUsers = [];
|
|
@@ -1965,14 +2214,19 @@
|
|
|
1965
2214
|
_this.isFileUploadAuthorized =
|
|
1966
2215
|
capabilities.indexOf('upload-file') !== -1;
|
|
1967
2216
|
_this.canSendLinks = capabilities.indexOf('send-links') !== -1;
|
|
1968
|
-
_this.
|
|
1969
|
-
|
|
1970
|
-
_this.cdRef.detectChanges();
|
|
1971
|
-
_this.initTextarea();
|
|
1972
|
-
}
|
|
2217
|
+
_this.channel = channel;
|
|
2218
|
+
_this.setCanSendMessages();
|
|
1973
2219
|
}
|
|
1974
2220
|
}));
|
|
1975
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
|
+
}));
|
|
1976
2230
|
this.attachmentUploads$ = this.attachmentService.attachmentUploads$;
|
|
1977
2231
|
this.isFileUploadEnabled = this.configService.isFileUploadEnabled;
|
|
1978
2232
|
this.acceptedFileTypes = this.configService.acceptedFileTypes;
|
|
@@ -2021,13 +2275,17 @@
|
|
|
2021
2275
|
if (changes.mentionScope) {
|
|
2022
2276
|
this.configService.mentionScope = this.mentionScope;
|
|
2023
2277
|
}
|
|
2278
|
+
if (changes.mode) {
|
|
2279
|
+
this.setCanSendMessages();
|
|
2280
|
+
}
|
|
2024
2281
|
};
|
|
2025
2282
|
MessageInputComponent.prototype.ngOnDestroy = function () {
|
|
2026
2283
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
2027
2284
|
};
|
|
2028
2285
|
MessageInputComponent.prototype.messageSent = function () {
|
|
2286
|
+
var _a;
|
|
2029
2287
|
return __awaiter(this, void 0, void 0, function () {
|
|
2030
|
-
var attachmentUploadInProgressCounter, attachments, text, error_1;
|
|
2288
|
+
var attachmentUploadInProgressCounter, attachments, text, parentMessageId, error_1;
|
|
2031
2289
|
return __generator(this, function (_12) {
|
|
2032
2290
|
switch (_12.label) {
|
|
2033
2291
|
case 0:
|
|
@@ -2053,12 +2311,18 @@
|
|
|
2053
2311
|
if (!this.isUpdate) {
|
|
2054
2312
|
this.textareaValue = '';
|
|
2055
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
|
+
}
|
|
2056
2320
|
_12.label = 1;
|
|
2057
2321
|
case 1:
|
|
2058
2322
|
_12.trys.push([1, 3, , 4]);
|
|
2059
2323
|
return [4 /*yield*/, (this.isUpdate
|
|
2060
2324
|
? this.channelService.updateMessage(Object.assign(Object.assign({}, this.message), { text: text, attachments: attachments }))
|
|
2061
|
-
: 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))];
|
|
2062
2326
|
case 2:
|
|
2063
2327
|
_12.sent();
|
|
2064
2328
|
this.messageUpdate.emit();
|
|
@@ -2072,7 +2336,11 @@
|
|
|
2072
2336
|
this.notificationService.addTemporaryNotification('streamChat.Edit message request failed');
|
|
2073
2337
|
}
|
|
2074
2338
|
return [3 /*break*/, 4];
|
|
2075
|
-
case 4:
|
|
2339
|
+
case 4:
|
|
2340
|
+
if (this.quotedMessage) {
|
|
2341
|
+
this.deselectMessageToQuote();
|
|
2342
|
+
}
|
|
2343
|
+
return [2 /*return*/];
|
|
2076
2344
|
}
|
|
2077
2345
|
});
|
|
2078
2346
|
});
|
|
@@ -2092,6 +2360,17 @@
|
|
|
2092
2360
|
enumerable: false,
|
|
2093
2361
|
configurable: true
|
|
2094
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
|
+
});
|
|
2095
2374
|
MessageInputComponent.prototype.filesSelected = function (fileList) {
|
|
2096
2375
|
return __awaiter(this, void 0, void 0, function () {
|
|
2097
2376
|
return __generator(this, function (_12) {
|
|
@@ -2110,6 +2389,9 @@
|
|
|
2110
2389
|
});
|
|
2111
2390
|
});
|
|
2112
2391
|
};
|
|
2392
|
+
MessageInputComponent.prototype.deselectMessageToQuote = function () {
|
|
2393
|
+
this.channelService.selectMessageToQuote(undefined);
|
|
2394
|
+
};
|
|
2113
2395
|
MessageInputComponent.prototype.clearFileInput = function () {
|
|
2114
2396
|
this.fileInput.nativeElement.value = '';
|
|
2115
2397
|
};
|
|
@@ -2189,10 +2471,25 @@
|
|
|
2189
2471
|
});
|
|
2190
2472
|
});
|
|
2191
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
|
+
};
|
|
2192
2489
|
return MessageInputComponent;
|
|
2193
2490
|
}());
|
|
2194
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 });
|
|
2195
|
-
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 } });
|
|
2196
2493
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputComponent, decorators: [{
|
|
2197
2494
|
type: i0.Component,
|
|
2198
2495
|
args: [{
|
|
@@ -2216,6 +2513,8 @@
|
|
|
2216
2513
|
type: i0.Input
|
|
2217
2514
|
}], commandAutocompleteItemTemplate: [{
|
|
2218
2515
|
type: i0.Input
|
|
2516
|
+
}], mode: [{
|
|
2517
|
+
type: i0.Input
|
|
2219
2518
|
}], acceptedFileTypes: [{
|
|
2220
2519
|
type: i0.Input
|
|
2221
2520
|
}], isMultipleFileUploadEnabled: [{
|
|
@@ -2277,7 +2576,7 @@
|
|
|
2277
2576
|
return ModalComponent;
|
|
2278
2577
|
}());
|
|
2279
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 });
|
|
2280
|
-
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"] }] });
|
|
2281
2580
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ModalComponent, decorators: [{
|
|
2282
2581
|
type: i0.Component,
|
|
2283
2582
|
args: [{
|
|
@@ -2323,7 +2622,7 @@
|
|
|
2323
2622
|
return NotificationListComponent;
|
|
2324
2623
|
}());
|
|
2325
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 });
|
|
2326
|
-
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 } });
|
|
2327
2626
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationListComponent, decorators: [{
|
|
2328
2627
|
type: i0.Component,
|
|
2329
2628
|
args: [{
|
|
@@ -2376,23 +2675,32 @@
|
|
|
2376
2675
|
};
|
|
2377
2676
|
Object.defineProperty(MessageActionsBoxComponent.prototype, "isQuoteVisible", {
|
|
2378
2677
|
get: function () {
|
|
2379
|
-
|
|
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));
|
|
2380
2682
|
},
|
|
2381
2683
|
enumerable: false,
|
|
2382
2684
|
configurable: true
|
|
2383
2685
|
});
|
|
2384
2686
|
Object.defineProperty(MessageActionsBoxComponent.prototype, "isEditVisible", {
|
|
2385
2687
|
get: function () {
|
|
2386
|
-
return ((this.enabledActions.indexOf('edit') !== -1
|
|
2387
|
-
this.enabledActions.indexOf('
|
|
2688
|
+
return (((this.enabledActions.indexOf('edit') !== -1 ||
|
|
2689
|
+
this.enabledActions.indexOf('update-own-message') !== -1) &&
|
|
2690
|
+
this.isMine) ||
|
|
2691
|
+
this.enabledActions.indexOf('edit-any') !== -1 ||
|
|
2692
|
+
this.enabledActions.indexOf('update-any-message') !== -1);
|
|
2388
2693
|
},
|
|
2389
2694
|
enumerable: false,
|
|
2390
2695
|
configurable: true
|
|
2391
2696
|
});
|
|
2392
2697
|
Object.defineProperty(MessageActionsBoxComponent.prototype, "isDeleteVisible", {
|
|
2393
2698
|
get: function () {
|
|
2394
|
-
return ((this.enabledActions.indexOf('delete') !== -1
|
|
2395
|
-
this.enabledActions.indexOf('delete-
|
|
2699
|
+
return (((this.enabledActions.indexOf('delete') !== -1 ||
|
|
2700
|
+
this.enabledActions.indexOf('delete-own-message') !== -1) &&
|
|
2701
|
+
this.isMine) ||
|
|
2702
|
+
this.enabledActions.indexOf('delete-any') !== -1 ||
|
|
2703
|
+
this.enabledActions.indexOf('delete-any-message') !== -1);
|
|
2396
2704
|
},
|
|
2397
2705
|
enumerable: false,
|
|
2398
2706
|
configurable: true
|
|
@@ -2406,7 +2714,9 @@
|
|
|
2406
2714
|
});
|
|
2407
2715
|
Object.defineProperty(MessageActionsBoxComponent.prototype, "isFlagVisible", {
|
|
2408
2716
|
get: function () {
|
|
2409
|
-
return this.enabledActions.indexOf('flag') !== -1
|
|
2717
|
+
return ((this.enabledActions.indexOf('flag') !== -1 ||
|
|
2718
|
+
this.enabledActions.indexOf('flag-message') !== -1) &&
|
|
2719
|
+
!this.isMine);
|
|
2410
2720
|
},
|
|
2411
2721
|
enumerable: false,
|
|
2412
2722
|
configurable: true
|
|
@@ -2446,7 +2756,7 @@
|
|
|
2446
2756
|
alert('Feature not yet implemented');
|
|
2447
2757
|
};
|
|
2448
2758
|
MessageActionsBoxComponent.prototype.quoteClicked = function () {
|
|
2449
|
-
|
|
2759
|
+
this.channelService.selectMessageToQuote(this.message);
|
|
2450
2760
|
};
|
|
2451
2761
|
MessageActionsBoxComponent.prototype.editClicked = function () {
|
|
2452
2762
|
this.isEditing.emit(true);
|
|
@@ -2479,7 +2789,7 @@
|
|
|
2479
2789
|
return MessageActionsBoxComponent;
|
|
2480
2790
|
}());
|
|
2481
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 });
|
|
2482
|
-
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 } });
|
|
2483
2793
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageActionsBoxComponent, decorators: [{
|
|
2484
2794
|
type: i0.Component,
|
|
2485
2795
|
args: [{
|
|
@@ -2512,11 +2822,12 @@
|
|
|
2512
2822
|
this.subscriptions = [];
|
|
2513
2823
|
this.isError$ = this.channelService.channels$.pipe(operators.map(function () { return false; }), operators.catchError(function () { return rxjs.of(true); }), operators.startWith(false));
|
|
2514
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; }));
|
|
2515
2826
|
}
|
|
2516
2827
|
return ChannelComponent;
|
|
2517
2828
|
}());
|
|
2518
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 });
|
|
2519
|
-
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 } });
|
|
2520
2831
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelComponent, decorators: [{
|
|
2521
2832
|
type: i0.Component,
|
|
2522
2833
|
args: [{
|
|
@@ -2629,7 +2940,7 @@
|
|
|
2629
2940
|
return ChannelHeaderComponent;
|
|
2630
2941
|
}());
|
|
2631
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 });
|
|
2632
|
-
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 } });
|
|
2633
2944
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelHeaderComponent, decorators: [{
|
|
2634
2945
|
type: i0.Component,
|
|
2635
2946
|
args: [{
|
|
@@ -2729,7 +3040,7 @@
|
|
|
2729
3040
|
return ChannelPreviewComponent;
|
|
2730
3041
|
}());
|
|
2731
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 });
|
|
2732
|
-
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 } });
|
|
2733
3044
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelPreviewComponent, decorators: [{
|
|
2734
3045
|
type: i0.Component,
|
|
2735
3046
|
args: [{
|
|
@@ -2779,7 +3090,7 @@
|
|
|
2779
3090
|
return ChannelListComponent;
|
|
2780
3091
|
}());
|
|
2781
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 });
|
|
2782
|
-
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 } });
|
|
2783
3094
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelListComponent, decorators: [{
|
|
2784
3095
|
type: i0.Component,
|
|
2785
3096
|
args: [{
|
|
@@ -2974,95 +3285,12 @@
|
|
|
2974
3285
|
args: ['selectorTooltip']
|
|
2975
3286
|
}] } });
|
|
2976
3287
|
|
|
2977
|
-
var ImageLoadService = /** @class */ (function () {
|
|
2978
|
-
function ImageLoadService() {
|
|
2979
|
-
this.imageLoad$ = new rxjs.Subject();
|
|
2980
|
-
}
|
|
2981
|
-
return ImageLoadService;
|
|
2982
|
-
}());
|
|
2983
|
-
ImageLoadService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2984
|
-
ImageLoadService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, providedIn: 'root' });
|
|
2985
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, decorators: [{
|
|
2986
|
-
type: i0.Injectable,
|
|
2987
|
-
args: [{
|
|
2988
|
-
providedIn: 'root',
|
|
2989
|
-
}]
|
|
2990
|
-
}], ctorParameters: function () { return []; } });
|
|
2991
|
-
|
|
2992
|
-
var AttachmentListComponent = /** @class */ (function () {
|
|
2993
|
-
function AttachmentListComponent(imageLoadService, channelService) {
|
|
2994
|
-
this.imageLoadService = imageLoadService;
|
|
2995
|
-
this.channelService = channelService;
|
|
2996
|
-
this.attachments = [];
|
|
2997
|
-
this.orderedAttachments = [];
|
|
2998
|
-
}
|
|
2999
|
-
AttachmentListComponent.prototype.ngOnChanges = function () {
|
|
3000
|
-
var _this = this;
|
|
3001
|
-
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); })));
|
|
3002
|
-
};
|
|
3003
|
-
AttachmentListComponent.prototype.trackById = function (index) {
|
|
3004
|
-
return index;
|
|
3005
|
-
};
|
|
3006
|
-
AttachmentListComponent.prototype.isImage = function (attachment) {
|
|
3007
|
-
return isImageAttachment(attachment);
|
|
3008
|
-
};
|
|
3009
|
-
AttachmentListComponent.prototype.isFile = function (attachment) {
|
|
3010
|
-
return attachment.type === 'file';
|
|
3011
|
-
};
|
|
3012
|
-
AttachmentListComponent.prototype.isCard = function (attachment) {
|
|
3013
|
-
return (!attachment.type ||
|
|
3014
|
-
(attachment.type === 'image' && !this.isImage(attachment)) ||
|
|
3015
|
-
attachment.type === 'giphy');
|
|
3016
|
-
};
|
|
3017
|
-
AttachmentListComponent.prototype.imageLoaded = function () {
|
|
3018
|
-
this.imageLoadService.imageLoad$.next();
|
|
3019
|
-
};
|
|
3020
|
-
AttachmentListComponent.prototype.hasFileSize = function (attachment) {
|
|
3021
|
-
return (attachment.file_size && Number.isFinite(Number(attachment.file_size)));
|
|
3022
|
-
};
|
|
3023
|
-
AttachmentListComponent.prototype.getFileSize = function (attachment) {
|
|
3024
|
-
return prettybytes__default['default'](attachment.file_size);
|
|
3025
|
-
};
|
|
3026
|
-
AttachmentListComponent.prototype.trimUrl = function (url) {
|
|
3027
|
-
if (url !== undefined && url !== null) {
|
|
3028
|
-
var _a = __read(url
|
|
3029
|
-
.replace(/^(?:https?:\/\/)?(?:www\.)?/i, '')
|
|
3030
|
-
.split('/'), 1), trimmedUrl = _a[0];
|
|
3031
|
-
return trimmedUrl;
|
|
3032
|
-
}
|
|
3033
|
-
return null;
|
|
3034
|
-
};
|
|
3035
|
-
AttachmentListComponent.prototype.sendAction = function (action) {
|
|
3036
|
-
var _a;
|
|
3037
|
-
void this.channelService.sendAction(this.messageId, (_a = {},
|
|
3038
|
-
_a[action.name] = action.value,
|
|
3039
|
-
_a));
|
|
3040
|
-
};
|
|
3041
|
-
AttachmentListComponent.prototype.trackByActionValue = function (_, item) {
|
|
3042
|
-
return item.value;
|
|
3043
|
-
};
|
|
3044
|
-
return AttachmentListComponent;
|
|
3045
|
-
}());
|
|
3046
|
-
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 });
|
|
3047
|
-
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"] }] });
|
|
3048
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentListComponent, decorators: [{
|
|
3049
|
-
type: i0.Component,
|
|
3050
|
-
args: [{
|
|
3051
|
-
selector: 'stream-attachment-list',
|
|
3052
|
-
templateUrl: './attachment-list.component.html',
|
|
3053
|
-
styles: [],
|
|
3054
|
-
}]
|
|
3055
|
-
}], ctorParameters: function () { return [{ type: ImageLoadService }, { type: ChannelService }]; }, propDecorators: { messageId: [{
|
|
3056
|
-
type: i0.Input
|
|
3057
|
-
}], attachments: [{
|
|
3058
|
-
type: i0.Input
|
|
3059
|
-
}] } });
|
|
3060
|
-
|
|
3061
3288
|
var MessageComponent = /** @class */ (function () {
|
|
3062
3289
|
function MessageComponent(chatClientService, channelService) {
|
|
3063
3290
|
this.chatClientService = chatClientService;
|
|
3064
3291
|
this.channelService = channelService;
|
|
3065
3292
|
this.enabledMessageActions = [];
|
|
3293
|
+
this.mode = 'main';
|
|
3066
3294
|
this.isActionBoxOpen = false;
|
|
3067
3295
|
this.isReactionSelectorOpen = false;
|
|
3068
3296
|
this.isPressedOnMobile = false;
|
|
@@ -3071,47 +3299,8 @@
|
|
|
3071
3299
|
this.user = this.chatClientService.chatClient.user;
|
|
3072
3300
|
}
|
|
3073
3301
|
MessageComponent.prototype.ngOnChanges = function (changes) {
|
|
3074
|
-
var _this = this;
|
|
3075
|
-
var _a, _b;
|
|
3076
3302
|
if (changes.message) {
|
|
3077
|
-
|
|
3078
|
-
if (!content) {
|
|
3079
|
-
this.messageTextParts = [];
|
|
3080
|
-
}
|
|
3081
|
-
else {
|
|
3082
|
-
// Backend will wrap HTML content with <p></p>\n
|
|
3083
|
-
if (content.startsWith('<p>')) {
|
|
3084
|
-
content = content.replace('<p>', '');
|
|
3085
|
-
}
|
|
3086
|
-
if (content.endsWith('</p>\n')) {
|
|
3087
|
-
content = content.replace('</p>\n', '');
|
|
3088
|
-
}
|
|
3089
|
-
if (!this.message.mentioned_users ||
|
|
3090
|
-
this.message.mentioned_users.length === 0) {
|
|
3091
|
-
this.messageTextParts = [{ content: content, type: 'text' }];
|
|
3092
|
-
}
|
|
3093
|
-
else {
|
|
3094
|
-
this.messageTextParts = [];
|
|
3095
|
-
var text_1 = content;
|
|
3096
|
-
this.message.mentioned_users.forEach(function (user) {
|
|
3097
|
-
var mention = "@" + (user.name || user.id);
|
|
3098
|
-
var precedingText = text_1.substring(0, text_1.indexOf(mention));
|
|
3099
|
-
_this.messageTextParts.push({
|
|
3100
|
-
content: precedingText,
|
|
3101
|
-
type: 'text',
|
|
3102
|
-
});
|
|
3103
|
-
_this.messageTextParts.push({
|
|
3104
|
-
content: mention,
|
|
3105
|
-
type: 'mention',
|
|
3106
|
-
user: user,
|
|
3107
|
-
});
|
|
3108
|
-
text_1 = text_1.replace(precedingText + mention, '');
|
|
3109
|
-
});
|
|
3110
|
-
if (text_1) {
|
|
3111
|
-
this.messageTextParts.push({ content: text_1, type: 'text' });
|
|
3112
|
-
}
|
|
3113
|
-
}
|
|
3114
|
-
}
|
|
3303
|
+
this.createMessageParts();
|
|
3115
3304
|
}
|
|
3116
3305
|
};
|
|
3117
3306
|
Object.defineProperty(MessageComponent.prototype, "isSentByCurrentUser", {
|
|
@@ -3183,7 +3372,8 @@
|
|
|
3183
3372
|
this.message.type === 'system' ||
|
|
3184
3373
|
this.message.type === 'ephemeral' ||
|
|
3185
3374
|
this.message.status === 'failed' ||
|
|
3186
|
-
this.message.status === 'sending'
|
|
3375
|
+
this.message.status === 'sending' ||
|
|
3376
|
+
(this.mode === 'thread' && !this.message.parent_id));
|
|
3187
3377
|
},
|
|
3188
3378
|
enumerable: false,
|
|
3189
3379
|
configurable: true
|
|
@@ -3205,6 +3395,33 @@
|
|
|
3205
3395
|
enumerable: false,
|
|
3206
3396
|
configurable: true
|
|
3207
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
|
+
});
|
|
3208
3425
|
MessageComponent.prototype.resendMessage = function () {
|
|
3209
3426
|
void this.channelService.resendMessage(this.message);
|
|
3210
3427
|
};
|
|
@@ -3227,10 +3444,55 @@
|
|
|
3227
3444
|
};
|
|
3228
3445
|
window.addEventListener('click', eventHandler);
|
|
3229
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
|
+
};
|
|
3230
3492
|
return MessageComponent;
|
|
3231
3493
|
}());
|
|
3232
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 });
|
|
3233
|
-
MessageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageComponent, selector: "stream-message", inputs: { messageInputTemplate: "messageInputTemplate", mentionTemplate: "mentionTemplate", message: "message", enabledMessageActions: "enabledMessageActions", areReactionsEnabled: "areReactionsEnabled", canReactToMessage: "canReactToMessage", isLastSentMessage: "isLastSentMessage", canReceiveReadEvents: "canReceiveReadEvents" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n #container\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.mobile-press]=\"isPressedOnMobile\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"\n areReactionsEnabled && hasReactions\n \"\n data-testid=\"message-container\"\n>\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n isMessageDeliveredAndRead && canReceiveReadEvents;\n else deliveredStatus\n \"\n >\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <stream-avatar\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n ></stream-avatar>\n <div class=\"str-chat__message-inner\">\n <div\n class=\"str-chat__message-simple__actions\"\n data-testid=\"message-options\"\n *ngIf=\"areOptionsVisible\"\n >\n <div\n data-testid=\"message-actions-container\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--options\n \"\n [class.str-chat-angular__message-simple__actions__action--options--editing]=\"\n isEditing\n \"\n >\n <stream-message-actions-box\n [isOpen]=\"isActionBoxOpen\"\n [isMine]=\"isSentByCurrentUser\"\n [enabledActions]=\"enabledMessageActions\"\n [message]=\"message\"\n (displayedActionsCount)=\"visibleMessageActionsCount = $event\"\n (isEditing)=\"isEditing = $event; isActionBoxOpen = !isEditing\"\n [messageInputTemplate]=\"messageInputTemplate\"\n ></stream-message-actions-box>\n <stream-icon\n *ngIf=\"visibleMessageActionsCount > 0\"\n data-testid=\"action-icon\"\n icon=\"action-icon\"\n (keyup.enter)=\"isActionBoxOpen = !isActionBoxOpen\"\n (click)=\"isActionBoxOpen = !isActionBoxOpen\"\n ></stream-icon>\n </div>\n <div\n *ngIf=\"areReactionsEnabled && canReactToMessage\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--reactions\n \"\n data-testid=\"reaction-icon\"\n (click)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n (keyup.enter)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n >\n <stream-icon icon=\"reaction-icon\"></stream-icon>\n </div>\n </div>\n <stream-message-reactions\n *ngIf=\"areReactionsEnabled\"\n [messageReactionCounts]=\"message?.reaction_counts || {}\"\n [latestReactions]=\"message?.latest_reactions || []\"\n [(isSelectorOpen)]=\"isReactionSelectorOpen\"\n [messageId]=\"message?.id\"\n [ownReactions]=\"message?.own_reactions || []\"\n ></stream-message-reactions>\n <stream-attachment-list\n *ngIf=\"hasAttachment\"\n [attachments]=\"message!.attachments!\"\n [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 } });
|
|
3234
3496
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageComponent, decorators: [{
|
|
3235
3497
|
type: i0.Component,
|
|
3236
3498
|
args: [{
|
|
@@ -3254,6 +3516,8 @@
|
|
|
3254
3516
|
type: i0.Input
|
|
3255
3517
|
}], canReceiveReadEvents: [{
|
|
3256
3518
|
type: i0.Input
|
|
3519
|
+
}], mode: [{
|
|
3520
|
+
type: i0.Input
|
|
3257
3521
|
}], container: [{
|
|
3258
3522
|
type: i0.ViewChild,
|
|
3259
3523
|
args: ['container']
|
|
@@ -3278,7 +3542,7 @@
|
|
|
3278
3542
|
return TextareaComponent;
|
|
3279
3543
|
}());
|
|
3280
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 });
|
|
3281
|
-
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 } });
|
|
3282
3546
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: TextareaComponent, decorators: [{
|
|
3283
3547
|
type: i0.Component,
|
|
3284
3548
|
args: [{
|
|
@@ -3483,7 +3747,7 @@
|
|
|
3483
3747
|
return AutocompleteTextareaComponent;
|
|
3484
3748
|
}());
|
|
3485
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 });
|
|
3486
|
-
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 } });
|
|
3487
3751
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AutocompleteTextareaComponent, decorators: [{
|
|
3488
3752
|
type: i0.Component,
|
|
3489
3753
|
args: [{
|
|
@@ -3561,30 +3825,37 @@
|
|
|
3561
3825
|
this.channelService = channelService;
|
|
3562
3826
|
this.chatClientService = chatClientService;
|
|
3563
3827
|
this.imageLoadService = imageLoadService;
|
|
3564
|
-
|
|
3828
|
+
/**
|
|
3829
|
+
* @deprecated https://getstream.io/chat/docs/sdk/angular/components/message_list/#caution-arereactionsenabled-deprecated
|
|
3830
|
+
*/
|
|
3831
|
+
this.areReactionsEnabled = undefined;
|
|
3832
|
+
/**
|
|
3833
|
+
* @deprecated https://getstream.io/chat/docs/sdk/angular/components/message_list/#caution-enabledmessageactions-deprecated
|
|
3834
|
+
*/
|
|
3565
3835
|
/* eslint-disable-next-line @angular-eslint/no-input-rename */
|
|
3566
|
-
this.enabledMessageActionsInput =
|
|
3836
|
+
this.enabledMessageActionsInput = undefined;
|
|
3837
|
+
this.mode = 'main';
|
|
3567
3838
|
this.enabledMessageActions = [];
|
|
3568
3839
|
this.class = 'str-chat-angular__main-panel-inner str-chat-angular__message-list-host';
|
|
3569
3840
|
this.unreadMessageCount = 0;
|
|
3570
3841
|
this.groupStyles = [];
|
|
3571
3842
|
this.authorizedMessageActions = ['flag'];
|
|
3572
3843
|
this.isUserScrolledUpThreshold = 300;
|
|
3573
|
-
this.
|
|
3844
|
+
this.subscriptions = [];
|
|
3845
|
+
this.subscriptions.push(this.channelService.activeChannel$.subscribe(function (channel) {
|
|
3574
3846
|
var _a;
|
|
3575
|
-
_this.
|
|
3576
|
-
_this.hasNewMessages = true;
|
|
3577
|
-
_this.isUserScrolledUp = false;
|
|
3578
|
-
_this.containerHeight = undefined;
|
|
3579
|
-
_this.olderMassagesLoaded = false;
|
|
3580
|
-
_this.oldestMessageDate = undefined;
|
|
3581
|
-
_this.unreadMessageCount = 0;
|
|
3582
|
-
_this.isNewMessageSentByUser = undefined;
|
|
3847
|
+
_this.resetScrollState();
|
|
3583
3848
|
var capabilites = (_a = channel === null || channel === void 0 ? void 0 : channel.data) === null || _a === void 0 ? void 0 : _a.own_capabilities;
|
|
3584
3849
|
if (capabilites) {
|
|
3585
3850
|
_this.canReactToMessage = capabilites.indexOf('send-reaction') !== -1;
|
|
3586
3851
|
_this.canReceiveReadEvents = capabilites.indexOf('read-events') !== -1;
|
|
3587
3852
|
_this.authorizedMessageActions = [];
|
|
3853
|
+
if (_this.canReactToMessage) {
|
|
3854
|
+
_this.authorizedMessageActions.push('send-reaction');
|
|
3855
|
+
}
|
|
3856
|
+
if (_this.canReceiveReadEvents) {
|
|
3857
|
+
_this.authorizedMessageActions.push('read-events');
|
|
3858
|
+
}
|
|
3588
3859
|
if (capabilites.indexOf('flag-message') !== -1) {
|
|
3589
3860
|
_this.authorizedMessageActions.push('flag');
|
|
3590
3861
|
}
|
|
@@ -3602,46 +3873,16 @@
|
|
|
3602
3873
|
_this.authorizedMessageActions.push('delete');
|
|
3603
3874
|
_this.authorizedMessageActions.push('delete-any');
|
|
3604
3875
|
}
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
});
|
|
3608
|
-
this.messages$ = this.channelService.activeChannelMessages$.pipe(operators.tap(function (messages) {
|
|
3609
|
-
var _a, _b, _c, _d, _e;
|
|
3610
|
-
if (messages.length === 0) {
|
|
3611
|
-
return;
|
|
3612
|
-
}
|
|
3613
|
-
var currentLatestMessageDate = messages[messages.length - 1].created_at;
|
|
3614
|
-
if (!_this.latestMessageDate ||
|
|
3615
|
-
((_a = _this.latestMessageDate) === null || _a === void 0 ? void 0 : _a.getTime()) < currentLatestMessageDate.getTime()) {
|
|
3616
|
-
_this.latestMessageDate = currentLatestMessageDate;
|
|
3617
|
-
_this.hasNewMessages = true;
|
|
3618
|
-
_this.isNewMessageSentByUser =
|
|
3619
|
-
((_b = messages[messages.length - 1].user) === null || _b === void 0 ? void 0 : _b.id) ===
|
|
3620
|
-
((_d = (_c = _this.chatClientService.chatClient) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.id);
|
|
3621
|
-
if (_this.isUserScrolledUp) {
|
|
3622
|
-
_this.unreadMessageCount++;
|
|
3876
|
+
if (capabilites.indexOf('send-reply') !== -1) {
|
|
3877
|
+
_this.authorizedMessageActions.push('send-reply');
|
|
3623
3878
|
}
|
|
3879
|
+
if (capabilites.indexOf('quote-message') !== -1) {
|
|
3880
|
+
_this.authorizedMessageActions.push('quote-message');
|
|
3881
|
+
}
|
|
3882
|
+
_this.setEnabledActions();
|
|
3624
3883
|
}
|
|
3625
|
-
var currentOldestMessageDate = messages[0].created_at;
|
|
3626
|
-
if (!_this.oldestMessageDate) {
|
|
3627
|
-
_this.oldestMessageDate = currentOldestMessageDate;
|
|
3628
|
-
}
|
|
3629
|
-
else if (((_e = _this.oldestMessageDate) === null || _e === void 0 ? void 0 : _e.getTime()) > currentOldestMessageDate.getTime()) {
|
|
3630
|
-
_this.oldestMessageDate = currentOldestMessageDate;
|
|
3631
|
-
_this.olderMassagesLoaded = true;
|
|
3632
|
-
}
|
|
3633
|
-
}), operators.tap(function (messages) {
|
|
3634
|
-
_this.groupStyles = messages.map(function (m, i) { return getGroupStyles(m, messages[i - 1], messages[i + 1]); });
|
|
3635
|
-
}), operators.tap(function (messages) {
|
|
3636
|
-
var _a;
|
|
3637
|
-
return (_this.lastSentMessageId = (_a = __spreadArray([], __read(messages)).reverse()
|
|
3638
|
-
.find(function (m) {
|
|
3639
|
-
var _a, _b, _c;
|
|
3640
|
-
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) &&
|
|
3641
|
-
m.status !== 'sending';
|
|
3642
|
-
})) === null || _a === void 0 ? void 0 : _a.id);
|
|
3643
3884
|
}));
|
|
3644
|
-
this.imageLoadService.imageLoad$.subscribe(function () {
|
|
3885
|
+
this.subscriptions.push(this.imageLoadService.imageLoad$.subscribe(function () {
|
|
3645
3886
|
if (!_this.isUserScrolledUp) {
|
|
3646
3887
|
_this.scrollToBottom();
|
|
3647
3888
|
// Hacky and unreliable workaround to scroll down after loaded images move the scrollbar
|
|
@@ -3649,12 +3890,27 @@
|
|
|
3649
3890
|
_this.scrollToBottom();
|
|
3650
3891
|
}, 300);
|
|
3651
3892
|
}
|
|
3652
|
-
});
|
|
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
|
+
}));
|
|
3653
3903
|
}
|
|
3904
|
+
MessageListComponent.prototype.ngOnInit = function () {
|
|
3905
|
+
this.setMessages$();
|
|
3906
|
+
};
|
|
3654
3907
|
MessageListComponent.prototype.ngOnChanges = function (changes) {
|
|
3655
3908
|
if (changes.enabledMessageActionsInput) {
|
|
3656
3909
|
this.setEnabledActions();
|
|
3657
3910
|
}
|
|
3911
|
+
if (changes.mode) {
|
|
3912
|
+
this.setMessages$();
|
|
3913
|
+
}
|
|
3658
3914
|
};
|
|
3659
3915
|
MessageListComponent.prototype.ngAfterViewChecked = function () {
|
|
3660
3916
|
var _this = this;
|
|
@@ -3681,6 +3937,9 @@
|
|
|
3681
3937
|
this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;
|
|
3682
3938
|
}
|
|
3683
3939
|
};
|
|
3940
|
+
MessageListComponent.prototype.ngOnDestroy = function () {
|
|
3941
|
+
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
3942
|
+
};
|
|
3684
3943
|
MessageListComponent.prototype.trackByMessageId = function (index, item) {
|
|
3685
3944
|
return item.id;
|
|
3686
3945
|
};
|
|
@@ -3689,6 +3948,7 @@
|
|
|
3689
3948
|
this.scrollContainer.nativeElement.scrollHeight;
|
|
3690
3949
|
};
|
|
3691
3950
|
MessageListComponent.prototype.scrolled = function () {
|
|
3951
|
+
var _a, _b;
|
|
3692
3952
|
this.isUserScrolledUp =
|
|
3693
3953
|
this.scrollContainer.nativeElement.scrollHeight -
|
|
3694
3954
|
(this.scrollContainer.nativeElement.scrollTop +
|
|
@@ -3697,21 +3957,36 @@
|
|
|
3697
3957
|
if (!this.isUserScrolledUp) {
|
|
3698
3958
|
this.unreadMessageCount = 0;
|
|
3699
3959
|
}
|
|
3700
|
-
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))) {
|
|
3701
3965
|
this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;
|
|
3702
|
-
|
|
3966
|
+
this.mode === 'main'
|
|
3967
|
+
? void this.channelService.loadMoreMessages()
|
|
3968
|
+
: void this.channelService.loadMoreThreadReplies();
|
|
3703
3969
|
}
|
|
3970
|
+
this.prevScrollTop = this.scrollContainer.nativeElement.scrollTop;
|
|
3704
3971
|
};
|
|
3705
3972
|
MessageListComponent.prototype.preserveScrollbarPosition = function () {
|
|
3706
3973
|
this.scrollContainer.nativeElement.scrollTop =
|
|
3707
|
-
this.
|
|
3974
|
+
(this.prevScrollTop || 0) +
|
|
3975
|
+
(this.scrollContainer.nativeElement.scrollHeight - this.containerHeight);
|
|
3708
3976
|
};
|
|
3709
3977
|
MessageListComponent.prototype.setEnabledActions = function () {
|
|
3710
3978
|
var _this = this;
|
|
3711
3979
|
this.enabledMessageActions = [];
|
|
3712
3980
|
if (!this.enabledMessageActionsInput) {
|
|
3981
|
+
this.enabledMessageActions = this.authorizedMessageActions;
|
|
3713
3982
|
return;
|
|
3714
3983
|
}
|
|
3984
|
+
this.enabledMessageActionsInput = __spreadArray(__spreadArray([], __read(this.enabledMessageActionsInput)), [
|
|
3985
|
+
'send-reaction',
|
|
3986
|
+
'read-events',
|
|
3987
|
+
'send-reply',
|
|
3988
|
+
'quote-message',
|
|
3989
|
+
]);
|
|
3715
3990
|
this.enabledMessageActionsInput.forEach(function (action) {
|
|
3716
3991
|
var isAuthorized = _this.authorizedMessageActions.indexOf(action) !== -1;
|
|
3717
3992
|
if (isAuthorized) {
|
|
@@ -3719,10 +3994,62 @@
|
|
|
3719
3994
|
}
|
|
3720
3995
|
});
|
|
3721
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
|
+
};
|
|
3722
4049
|
return MessageListComponent;
|
|
3723
4050
|
}());
|
|
3724
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 });
|
|
3725
|
-
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 } });
|
|
3726
4053
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageListComponent, decorators: [{
|
|
3727
4054
|
type: i0.Component,
|
|
3728
4055
|
args: [{
|
|
@@ -3741,12 +4068,55 @@
|
|
|
3741
4068
|
}], enabledMessageActionsInput: [{
|
|
3742
4069
|
type: i0.Input,
|
|
3743
4070
|
args: ['enabledMessageActions']
|
|
4071
|
+
}], mode: [{
|
|
4072
|
+
type: i0.Input
|
|
3744
4073
|
}], class: [{
|
|
3745
4074
|
type: i0.HostBinding,
|
|
3746
4075
|
args: ['class']
|
|
3747
4076
|
}], scrollContainer: [{
|
|
3748
4077
|
type: i0.ViewChild,
|
|
3749
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']
|
|
3750
4120
|
}] } });
|
|
3751
4121
|
|
|
3752
4122
|
var StreamAvatarModule = /** @class */ (function () {
|
|
@@ -3755,13 +4125,13 @@
|
|
|
3755
4125
|
return StreamAvatarModule;
|
|
3756
4126
|
}());
|
|
3757
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 });
|
|
3758
|
-
StreamAvatarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, declarations: [AvatarComponent], imports: [i6.CommonModule,
|
|
3759
|
-
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]] });
|
|
3760
4130
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, decorators: [{
|
|
3761
4131
|
type: i0.NgModule,
|
|
3762
4132
|
args: [{
|
|
3763
4133
|
declarations: [AvatarComponent],
|
|
3764
|
-
imports: [i6.CommonModule,
|
|
4134
|
+
imports: [i6.CommonModule, i1.TranslateModule],
|
|
3765
4135
|
exports: [AvatarComponent],
|
|
3766
4136
|
}]
|
|
3767
4137
|
}] });
|
|
@@ -3788,7 +4158,8 @@
|
|
|
3788
4158
|
NotificationListComponent,
|
|
3789
4159
|
AttachmentPreviewListComponent,
|
|
3790
4160
|
ModalComponent,
|
|
3791
|
-
TextareaDirective
|
|
4161
|
+
TextareaDirective,
|
|
4162
|
+
ThreadComponent], imports: [i6.CommonModule, i1.TranslateModule, StreamAvatarModule], exports: [ChannelComponent,
|
|
3792
4163
|
ChannelHeaderComponent,
|
|
3793
4164
|
ChannelListComponent,
|
|
3794
4165
|
ChannelPreviewComponent,
|
|
@@ -3804,8 +4175,9 @@
|
|
|
3804
4175
|
NotificationListComponent,
|
|
3805
4176
|
AttachmentPreviewListComponent,
|
|
3806
4177
|
ModalComponent,
|
|
3807
|
-
StreamAvatarModule
|
|
3808
|
-
|
|
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] });
|
|
3809
4181
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, decorators: [{
|
|
3810
4182
|
type: i0.NgModule,
|
|
3811
4183
|
args: [{
|
|
@@ -3827,8 +4199,9 @@
|
|
|
3827
4199
|
AttachmentPreviewListComponent,
|
|
3828
4200
|
ModalComponent,
|
|
3829
4201
|
TextareaDirective,
|
|
4202
|
+
ThreadComponent,
|
|
3830
4203
|
],
|
|
3831
|
-
imports: [i6.CommonModule,
|
|
4204
|
+
imports: [i6.CommonModule, i1.TranslateModule, StreamAvatarModule],
|
|
3832
4205
|
exports: [
|
|
3833
4206
|
ChannelComponent,
|
|
3834
4207
|
ChannelHeaderComponent,
|
|
@@ -3847,6 +4220,7 @@
|
|
|
3847
4220
|
AttachmentPreviewListComponent,
|
|
3848
4221
|
ModalComponent,
|
|
3849
4222
|
StreamAvatarModule,
|
|
4223
|
+
ThreadComponent,
|
|
3850
4224
|
],
|
|
3851
4225
|
}]
|
|
3852
4226
|
}] });
|
|
@@ -3857,18 +4231,18 @@
|
|
|
3857
4231
|
return StreamAutocompleteTextareaModule;
|
|
3858
4232
|
}());
|
|
3859
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 });
|
|
3860
|
-
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] });
|
|
3861
4235
|
StreamAutocompleteTextareaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, providers: [
|
|
3862
4236
|
{
|
|
3863
4237
|
provide: textareaInjectionToken,
|
|
3864
4238
|
useValue: AutocompleteTextareaComponent,
|
|
3865
4239
|
},
|
|
3866
|
-
], imports: [[i6.CommonModule,
|
|
4240
|
+
], imports: [[i6.CommonModule, i1.TranslateModule, i5.MentionModule, StreamAvatarModule]] });
|
|
3867
4241
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, decorators: [{
|
|
3868
4242
|
type: i0.NgModule,
|
|
3869
4243
|
args: [{
|
|
3870
4244
|
declarations: [AutocompleteTextareaComponent],
|
|
3871
|
-
imports: [i6.CommonModule,
|
|
4245
|
+
imports: [i6.CommonModule, i1.TranslateModule, i5.MentionModule, StreamAvatarModule],
|
|
3872
4246
|
exports: [AutocompleteTextareaComponent],
|
|
3873
4247
|
providers: [
|
|
3874
4248
|
{
|
|
@@ -3885,18 +4259,18 @@
|
|
|
3885
4259
|
return StreamTextareaModule;
|
|
3886
4260
|
}());
|
|
3887
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 });
|
|
3888
|
-
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] });
|
|
3889
4263
|
StreamTextareaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, providers: [
|
|
3890
4264
|
{
|
|
3891
4265
|
provide: textareaInjectionToken,
|
|
3892
4266
|
useValue: TextareaComponent,
|
|
3893
4267
|
},
|
|
3894
|
-
], imports: [[i6.CommonModule,
|
|
4268
|
+
], imports: [[i6.CommonModule, i1.TranslateModule]] });
|
|
3895
4269
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, decorators: [{
|
|
3896
4270
|
type: i0.NgModule,
|
|
3897
4271
|
args: [{
|
|
3898
4272
|
declarations: [TextareaComponent],
|
|
3899
|
-
imports: [i6.CommonModule,
|
|
4273
|
+
imports: [i6.CommonModule, i1.TranslateModule],
|
|
3900
4274
|
exports: [TextareaComponent],
|
|
3901
4275
|
providers: [
|
|
3902
4276
|
{
|
|
@@ -3948,6 +4322,7 @@
|
|
|
3948
4322
|
exports.TextareaComponent = TextareaComponent;
|
|
3949
4323
|
exports.TextareaDirective = TextareaDirective;
|
|
3950
4324
|
exports.ThemeService = ThemeService;
|
|
4325
|
+
exports.ThreadComponent = ThreadComponent;
|
|
3951
4326
|
exports.TransliterationService = TransliterationService;
|
|
3952
4327
|
exports.createMessagePreview = createMessagePreview;
|
|
3953
4328
|
exports.getDeviceWidth = getDeviceWidth;
|