stream-chat-angular 2.8.1 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/en.d.ts +2 -0
- package/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +618 -218
- 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/attachment-list/attachment-list.component.js +21 -8
- package/esm2015/lib/channel/channel.component.js +3 -2
- package/esm2015/lib/channel.service.js +179 -38
- 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 +18 -3
- package/esm2015/lib/message-actions-box/message-actions-box.component.js +15 -7
- package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +35 -9
- package/esm2015/lib/message-input/message-input-config.service.js +1 -1
- package/esm2015/lib/message-input/message-input.component.js +40 -8
- package/esm2015/lib/message-input/textarea.directive.js +10 -2
- package/esm2015/lib/message-input/textarea.interface.js +1 -1
- package/esm2015/lib/message-list/message-list.component.js +126 -55
- package/esm2015/lib/message-preview.js +3 -2
- package/esm2015/lib/stream-chat.module.js +8 -3
- package/esm2015/lib/thread/thread.component.js +37 -0
- package/esm2015/lib/types.js +1 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/stream-chat-angular.js +491 -134
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/attachment-list/attachment-list.component.d.ts +8 -3
- package/lib/channel/channel.component.d.ts +2 -1
- package/lib/channel.service.d.ts +20 -7
- package/lib/chat-client.service.d.ts +4 -3
- package/lib/icon/icon.component.d.ts +1 -1
- package/lib/message/message.component.d.ts +17 -3
- package/lib/message-actions-box/message-actions-box.component.d.ts +4 -1
- package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +6 -3
- package/lib/message-input/message-input-config.service.d.ts +2 -1
- package/lib/message-input/message-input.component.d.ts +6 -2
- package/lib/message-input/textarea.directive.d.ts +3 -2
- package/lib/message-input/textarea.interface.d.ts +2 -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/lib/types.d.ts +7 -1
- package/package.json +2 -2
- package/public-api.d.ts +1 -0
- package/src/assets/i18n/en.ts +4 -0
- package/src/assets/version.ts +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('stream-chat'), require('rxjs/operators'), require('uuid'), require('@ngx-translate/core'), require('@angular/common'), require('dayjs'), require('dayjs/plugin/calendar'), require('pretty-bytes'), require('@stream-io/transliterate'), require('angular-mentions')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('stream-chat-angular', ['exports', '@angular/core', 'rxjs', 'stream-chat', 'rxjs/operators', 'uuid', '@ngx-translate/core', '@angular/common', 'dayjs', 'dayjs/plugin/calendar', 'pretty-bytes', '@stream-io/transliterate', 'angular-mentions'], factory) :
|
|
4
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.i10, global.ng.common, global.Dayjs, global.calendar, global.prettybytes, global.transliterate, global.i5));
|
|
5
|
-
}(this, (function (exports, i0, rxjs, streamChat, operators, uuid, i10,
|
|
5
|
+
}(this, (function (exports, i0, rxjs, streamChat, operators, uuid, i10, i6, Dayjs, calendar, prettybytes, transliterate, i5) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
30
30
|
var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
|
|
31
|
-
var
|
|
31
|
+
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
32
32
|
var Dayjs__default = /*#__PURE__*/_interopDefaultLegacy(Dayjs);
|
|
33
33
|
var calendar__default = /*#__PURE__*/_interopDefaultLegacy(calendar);
|
|
34
34
|
var prettybytes__default = /*#__PURE__*/_interopDefaultLegacy(prettybytes);
|
|
@@ -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.11.0';
|
|
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,7 @@
|
|
|
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) {
|
|
533
545
|
var clientSideId = user.id + "-" + uuid.v4();
|
|
534
546
|
return {
|
|
535
547
|
__html: text,
|
|
@@ -543,6 +555,7 @@
|
|
|
543
555
|
user: user,
|
|
544
556
|
attachments: attachments,
|
|
545
557
|
mentioned_users: mentionedUsers,
|
|
558
|
+
parent_id: parentId,
|
|
546
559
|
};
|
|
547
560
|
};
|
|
548
561
|
|
|
@@ -569,31 +582,51 @@
|
|
|
569
582
|
this.activeChannelMessagesSubject = new rxjs.BehaviorSubject([]);
|
|
570
583
|
this.hasMoreChannelsSubject = new rxjs.ReplaySubject(1);
|
|
571
584
|
this.activeChannelSubscriptions = [];
|
|
585
|
+
this.activeParentMessageIdSubject = new rxjs.BehaviorSubject(undefined);
|
|
586
|
+
this.activeThreadMessagesSubject = new rxjs.BehaviorSubject([]);
|
|
587
|
+
this.messagePageSize = 25;
|
|
572
588
|
this.channelListSetter = function (channels) {
|
|
573
589
|
_this.channelsSubject.next(channels);
|
|
574
590
|
};
|
|
575
591
|
this.messageListSetter = function (messages) {
|
|
576
592
|
_this.activeChannelMessagesSubject.next(messages);
|
|
577
593
|
};
|
|
594
|
+
this.threadListSetter = function (messages) {
|
|
595
|
+
_this.activeThreadMessagesSubject.next(messages);
|
|
596
|
+
};
|
|
597
|
+
this.parentMessageSetter = function (message) {
|
|
598
|
+
_this.activeParentMessageIdSubject.next(message === null || message === void 0 ? void 0 : message.id);
|
|
599
|
+
};
|
|
578
600
|
this.channels$ = this.channelsSubject.asObservable();
|
|
579
601
|
this.activeChannel$ = this.activeChannelSubject.asObservable();
|
|
580
602
|
this.activeChannelMessages$ = this.activeChannelMessagesSubject.pipe(operators.map(function (messages) {
|
|
581
603
|
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
|
-
});
|
|
604
|
+
return messages.map(function (message) { return _this.transformToStreamMessage(message, channel); });
|
|
595
605
|
}));
|
|
596
606
|
this.hasMoreChannels$ = this.hasMoreChannelsSubject.asObservable();
|
|
607
|
+
this.activeParentMessageId$ =
|
|
608
|
+
this.activeParentMessageIdSubject.asObservable();
|
|
609
|
+
this.activeThreadMessages$ = this.activeThreadMessagesSubject.pipe(operators.map(function (messages) {
|
|
610
|
+
var channel = _this.activeChannelSubject.getValue();
|
|
611
|
+
return messages.map(function (message) { return _this.transformToStreamMessage(message, channel); });
|
|
612
|
+
}));
|
|
613
|
+
this.activeParentMessage$ = rxjs.combineLatest([
|
|
614
|
+
this.activeChannelMessages$,
|
|
615
|
+
this.activeParentMessageId$,
|
|
616
|
+
]).pipe(operators.map(function (_f) {
|
|
617
|
+
var _g = __read(_f, 2), messages = _g[0], parentMessageId = _g[1];
|
|
618
|
+
if (!parentMessageId) {
|
|
619
|
+
return undefined;
|
|
620
|
+
}
|
|
621
|
+
else {
|
|
622
|
+
return messages.find(function (m) { return m.id === parentMessageId; });
|
|
623
|
+
}
|
|
624
|
+
}), operators.shareReplay());
|
|
625
|
+
this.chatClientService.connectionState$
|
|
626
|
+
.pipe(operators.filter(function (s) { return s === 'online'; }))
|
|
627
|
+
.subscribe(function () {
|
|
628
|
+
void _this.setAsActiveParentMessage(undefined);
|
|
629
|
+
});
|
|
597
630
|
}
|
|
598
631
|
ChannelService.prototype.setAsActiveChannel = function (channel) {
|
|
599
632
|
var prevActiveChannel = this.activeChannelSubject.getValue();
|
|
@@ -607,25 +640,54 @@
|
|
|
607
640
|
void channel.markRead();
|
|
608
641
|
}
|
|
609
642
|
this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
643
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
644
|
+
this.activeThreadMessagesSubject.next([]);
|
|
610
645
|
};
|
|
646
|
+
ChannelService.prototype.setAsActiveParentMessage = function (message) {
|
|
647
|
+
var _a;
|
|
648
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
649
|
+
var activeChannel, result;
|
|
650
|
+
return __generator(this, function (_f) {
|
|
651
|
+
switch (_f.label) {
|
|
652
|
+
case 0:
|
|
653
|
+
if (!!message) return [3 /*break*/, 1];
|
|
654
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
655
|
+
this.activeThreadMessagesSubject.next([]);
|
|
656
|
+
return [3 /*break*/, 3];
|
|
657
|
+
case 1:
|
|
658
|
+
this.activeParentMessageIdSubject.next(message.id);
|
|
659
|
+
activeChannel = this.activeChannelSubject.getValue();
|
|
660
|
+
return [4 /*yield*/, (activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.getReplies(message.id, {
|
|
661
|
+
limit: (_a = this.options) === null || _a === void 0 ? void 0 : _a.message_limit,
|
|
662
|
+
}))];
|
|
663
|
+
case 2:
|
|
664
|
+
result = _f.sent();
|
|
665
|
+
this.activeThreadMessagesSubject.next((result === null || result === void 0 ? void 0 : result.messages) || []);
|
|
666
|
+
_f.label = 3;
|
|
667
|
+
case 3: return [2 /*return*/];
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
});
|
|
671
|
+
};
|
|
672
|
+
// load more thread replies
|
|
611
673
|
ChannelService.prototype.loadMoreMessages = function () {
|
|
612
|
-
var _a, _b, _c, _d;
|
|
674
|
+
var _a, _b, _c, _d, _e;
|
|
613
675
|
return __awaiter(this, void 0, void 0, function () {
|
|
614
676
|
var activeChnannel, lastMessageId;
|
|
615
|
-
return __generator(this, function (
|
|
616
|
-
switch (
|
|
677
|
+
return __generator(this, function (_f) {
|
|
678
|
+
switch (_f.label) {
|
|
617
679
|
case 0:
|
|
618
680
|
activeChnannel = this.activeChannelSubject.getValue();
|
|
619
681
|
lastMessageId = (_a = this.activeChannelMessagesSubject.getValue()[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
620
682
|
return [4 /*yield*/, (activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.query({
|
|
621
|
-
messages: { limit:
|
|
683
|
+
messages: { limit: (_b = this.options) === null || _b === void 0 ? void 0 : _b.message_limit, id_lt: lastMessageId },
|
|
622
684
|
members: { limit: 0 },
|
|
623
685
|
watchers: { limit: 0 },
|
|
624
686
|
}))];
|
|
625
687
|
case 1:
|
|
626
|
-
|
|
627
|
-
if (((
|
|
628
|
-
((
|
|
688
|
+
_f.sent();
|
|
689
|
+
if (((_c = activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.data) === null || _c === void 0 ? void 0 : _c.id) ===
|
|
690
|
+
((_e = (_d = this.activeChannelSubject.getValue()) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.id)) {
|
|
629
691
|
this.activeChannelMessagesSubject.next(__spreadArray([], __read(activeChnannel.state.messages)));
|
|
630
692
|
}
|
|
631
693
|
return [2 /*return*/];
|
|
@@ -633,11 +695,36 @@
|
|
|
633
695
|
});
|
|
634
696
|
});
|
|
635
697
|
};
|
|
698
|
+
ChannelService.prototype.loadMoreThreadReplies = function () {
|
|
699
|
+
var _a, _b;
|
|
700
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
701
|
+
var activeChnannel, parentMessageId, lastMessageId;
|
|
702
|
+
return __generator(this, function (_f) {
|
|
703
|
+
switch (_f.label) {
|
|
704
|
+
case 0:
|
|
705
|
+
activeChnannel = this.activeChannelSubject.getValue();
|
|
706
|
+
parentMessageId = this.activeParentMessageIdSubject.getValue();
|
|
707
|
+
if (!parentMessageId) {
|
|
708
|
+
return [2 /*return*/];
|
|
709
|
+
}
|
|
710
|
+
lastMessageId = (_a = this.activeThreadMessagesSubject.getValue()[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
711
|
+
return [4 /*yield*/, (activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.getReplies(parentMessageId, {
|
|
712
|
+
limit: (_b = this.options) === null || _b === void 0 ? void 0 : _b.message_limit,
|
|
713
|
+
id_lt: lastMessageId,
|
|
714
|
+
}))];
|
|
715
|
+
case 1:
|
|
716
|
+
_f.sent();
|
|
717
|
+
this.activeThreadMessagesSubject.next((activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.state.threads[parentMessageId]) || []);
|
|
718
|
+
return [2 /*return*/];
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
});
|
|
722
|
+
};
|
|
636
723
|
ChannelService.prototype.init = function (filters, sort, options) {
|
|
637
724
|
return __awaiter(this, void 0, void 0, function () {
|
|
638
725
|
var _this = this;
|
|
639
|
-
return __generator(this, function (
|
|
640
|
-
switch (
|
|
726
|
+
return __generator(this, function (_f) {
|
|
727
|
+
switch (_f.label) {
|
|
641
728
|
case 0:
|
|
642
729
|
this.filters = filters;
|
|
643
730
|
this.options = options || {
|
|
@@ -646,27 +733,34 @@
|
|
|
646
733
|
state: true,
|
|
647
734
|
presence: true,
|
|
648
735
|
watch: true,
|
|
649
|
-
message_limit:
|
|
736
|
+
message_limit: this.messagePageSize,
|
|
650
737
|
};
|
|
651
738
|
this.sort = sort || { last_message_at: -1, updated_at: -1 };
|
|
652
739
|
return [4 /*yield*/, this.queryChannels()];
|
|
653
740
|
case 1:
|
|
654
|
-
|
|
741
|
+
_f.sent();
|
|
655
742
|
this.chatClientService.notification$.subscribe(function (notification) { return void _this.handleNotification(notification); });
|
|
656
743
|
return [2 /*return*/];
|
|
657
744
|
}
|
|
658
745
|
});
|
|
659
746
|
});
|
|
660
747
|
};
|
|
748
|
+
ChannelService.prototype.reset = function () {
|
|
749
|
+
this.activeChannelMessagesSubject.next([]);
|
|
750
|
+
this.activeChannelSubject.next(undefined);
|
|
751
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
752
|
+
this.activeThreadMessagesSubject.next([]);
|
|
753
|
+
this.channelsSubject.next(undefined);
|
|
754
|
+
};
|
|
661
755
|
ChannelService.prototype.loadMoreChannels = function () {
|
|
662
756
|
return __awaiter(this, void 0, void 0, function () {
|
|
663
|
-
return __generator(this, function (
|
|
664
|
-
switch (
|
|
757
|
+
return __generator(this, function (_f) {
|
|
758
|
+
switch (_f.label) {
|
|
665
759
|
case 0:
|
|
666
760
|
this.options.offset = this.channels.length;
|
|
667
761
|
return [4 /*yield*/, this.queryChannels()];
|
|
668
762
|
case 1:
|
|
669
|
-
|
|
763
|
+
_f.sent();
|
|
670
764
|
return [2 /*return*/];
|
|
671
765
|
}
|
|
672
766
|
});
|
|
@@ -675,13 +769,13 @@
|
|
|
675
769
|
ChannelService.prototype.addReaction = function (messageId, reactionType) {
|
|
676
770
|
var _a;
|
|
677
771
|
return __awaiter(this, void 0, void 0, function () {
|
|
678
|
-
return __generator(this, function (
|
|
679
|
-
switch (
|
|
772
|
+
return __generator(this, function (_f) {
|
|
773
|
+
switch (_f.label) {
|
|
680
774
|
case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject.getValue()) === null || _a === void 0 ? void 0 : _a.sendReaction(messageId, {
|
|
681
775
|
type: reactionType,
|
|
682
776
|
}))];
|
|
683
777
|
case 1:
|
|
684
|
-
|
|
778
|
+
_f.sent();
|
|
685
779
|
return [2 /*return*/];
|
|
686
780
|
}
|
|
687
781
|
});
|
|
@@ -690,32 +784,33 @@
|
|
|
690
784
|
ChannelService.prototype.removeReaction = function (messageId, reactionType) {
|
|
691
785
|
var _a;
|
|
692
786
|
return __awaiter(this, void 0, void 0, function () {
|
|
693
|
-
return __generator(this, function (
|
|
694
|
-
switch (
|
|
787
|
+
return __generator(this, function (_f) {
|
|
788
|
+
switch (_f.label) {
|
|
695
789
|
case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject
|
|
696
790
|
.getValue()) === null || _a === void 0 ? void 0 : _a.deleteReaction(messageId, reactionType))];
|
|
697
791
|
case 1:
|
|
698
|
-
|
|
792
|
+
_f.sent();
|
|
699
793
|
return [2 /*return*/];
|
|
700
794
|
}
|
|
701
795
|
});
|
|
702
796
|
});
|
|
703
797
|
};
|
|
704
|
-
ChannelService.prototype.sendMessage = function (text, attachments, mentionedUsers) {
|
|
798
|
+
ChannelService.prototype.sendMessage = function (text, attachments, mentionedUsers, parentId) {
|
|
705
799
|
if (attachments === void 0) { attachments = []; }
|
|
706
800
|
if (mentionedUsers === void 0) { mentionedUsers = []; }
|
|
801
|
+
if (parentId === void 0) { parentId = undefined; }
|
|
707
802
|
return __awaiter(this, void 0, void 0, function () {
|
|
708
803
|
var preview, channel;
|
|
709
|
-
return __generator(this, function (
|
|
710
|
-
switch (
|
|
804
|
+
return __generator(this, function (_f) {
|
|
805
|
+
switch (_f.label) {
|
|
711
806
|
case 0:
|
|
712
|
-
preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers);
|
|
807
|
+
preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers, parentId);
|
|
713
808
|
channel = this.activeChannelSubject.getValue();
|
|
714
809
|
preview.readBy = [];
|
|
715
810
|
channel.state.addMessageSorted(preview, true);
|
|
716
811
|
return [4 /*yield*/, this.sendMessageRequest(preview)];
|
|
717
812
|
case 1:
|
|
718
|
-
|
|
813
|
+
_f.sent();
|
|
719
814
|
return [2 /*return*/];
|
|
720
815
|
}
|
|
721
816
|
});
|
|
@@ -724,14 +819,14 @@
|
|
|
724
819
|
ChannelService.prototype.resendMessage = function (message) {
|
|
725
820
|
return __awaiter(this, void 0, void 0, function () {
|
|
726
821
|
var channel;
|
|
727
|
-
return __generator(this, function (
|
|
728
|
-
switch (
|
|
822
|
+
return __generator(this, function (_f) {
|
|
823
|
+
switch (_f.label) {
|
|
729
824
|
case 0:
|
|
730
825
|
channel = this.activeChannelSubject.getValue();
|
|
731
826
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, message), { errorStatusCode: undefined, status: 'sending' }), true);
|
|
732
827
|
return [4 /*yield*/, this.sendMessageRequest(message)];
|
|
733
828
|
case 1:
|
|
734
|
-
|
|
829
|
+
_f.sent();
|
|
735
830
|
return [2 /*return*/];
|
|
736
831
|
}
|
|
737
832
|
});
|
|
@@ -739,11 +834,11 @@
|
|
|
739
834
|
};
|
|
740
835
|
ChannelService.prototype.updateMessage = function (message) {
|
|
741
836
|
return __awaiter(this, void 0, void 0, function () {
|
|
742
|
-
return __generator(this, function (
|
|
743
|
-
switch (
|
|
837
|
+
return __generator(this, function (_f) {
|
|
838
|
+
switch (_f.label) {
|
|
744
839
|
case 0: return [4 /*yield*/, this.chatClientService.chatClient.updateMessage(message)];
|
|
745
840
|
case 1:
|
|
746
|
-
|
|
841
|
+
_f.sent();
|
|
747
842
|
return [2 /*return*/];
|
|
748
843
|
}
|
|
749
844
|
});
|
|
@@ -751,11 +846,11 @@
|
|
|
751
846
|
};
|
|
752
847
|
ChannelService.prototype.deleteMessage = function (message) {
|
|
753
848
|
return __awaiter(this, void 0, void 0, function () {
|
|
754
|
-
return __generator(this, function (
|
|
755
|
-
switch (
|
|
849
|
+
return __generator(this, function (_f) {
|
|
850
|
+
switch (_f.label) {
|
|
756
851
|
case 0: return [4 /*yield*/, this.chatClientService.chatClient.deleteMessage(message.id)];
|
|
757
852
|
case 1:
|
|
758
|
-
|
|
853
|
+
_f.sent();
|
|
759
854
|
return [2 /*return*/];
|
|
760
855
|
}
|
|
761
856
|
});
|
|
@@ -764,8 +859,8 @@
|
|
|
764
859
|
ChannelService.prototype.uploadAttachments = function (uploads) {
|
|
765
860
|
return __awaiter(this, void 0, void 0, function () {
|
|
766
861
|
var result, channel, uploadResults;
|
|
767
|
-
return __generator(this, function (
|
|
768
|
-
switch (
|
|
862
|
+
return __generator(this, function (_f) {
|
|
863
|
+
switch (_f.label) {
|
|
769
864
|
case 0:
|
|
770
865
|
result = [];
|
|
771
866
|
channel = this.activeChannelSubject.getValue();
|
|
@@ -773,7 +868,7 @@
|
|
|
773
868
|
? channel.sendImage(upload.file)
|
|
774
869
|
: channel.sendFile(upload.file); }))];
|
|
775
870
|
case 1:
|
|
776
|
-
uploadResults =
|
|
871
|
+
uploadResults = _f.sent();
|
|
777
872
|
uploadResults.forEach(function (uploadResult, i) {
|
|
778
873
|
var file = uploads[i].file;
|
|
779
874
|
var type = uploads[i].type;
|
|
@@ -797,15 +892,15 @@
|
|
|
797
892
|
ChannelService.prototype.deleteAttachment = function (attachmentUpload) {
|
|
798
893
|
return __awaiter(this, void 0, void 0, function () {
|
|
799
894
|
var channel;
|
|
800
|
-
return __generator(this, function (
|
|
801
|
-
switch (
|
|
895
|
+
return __generator(this, function (_f) {
|
|
896
|
+
switch (_f.label) {
|
|
802
897
|
case 0:
|
|
803
898
|
channel = this.activeChannelSubject.getValue();
|
|
804
899
|
return [4 /*yield*/, (attachmentUpload.type === 'image'
|
|
805
900
|
? channel.deleteImage(attachmentUpload.url)
|
|
806
901
|
: channel.deleteFile(attachmentUpload.url))];
|
|
807
902
|
case 1:
|
|
808
|
-
|
|
903
|
+
_f.sent();
|
|
809
904
|
return [2 /*return*/];
|
|
810
905
|
}
|
|
811
906
|
});
|
|
@@ -815,8 +910,8 @@
|
|
|
815
910
|
return __awaiter(this, void 0, void 0, function () {
|
|
816
911
|
var activeChannel, result;
|
|
817
912
|
var _this = this;
|
|
818
|
-
return __generator(this, function (
|
|
819
|
-
switch (
|
|
913
|
+
return __generator(this, function (_f) {
|
|
914
|
+
switch (_f.label) {
|
|
820
915
|
case 0:
|
|
821
916
|
activeChannel = this.activeChannelSubject.getValue();
|
|
822
917
|
if (!activeChannel) {
|
|
@@ -833,41 +928,88 @@
|
|
|
833
928
|
id: { $ne: this.chatClientService.chatClient.userID },
|
|
834
929
|
})];
|
|
835
930
|
case 2:
|
|
836
|
-
result =
|
|
931
|
+
result = _f.sent();
|
|
837
932
|
return [2 /*return*/, Object.values(result.members)];
|
|
838
933
|
}
|
|
839
934
|
});
|
|
840
935
|
});
|
|
841
936
|
};
|
|
937
|
+
ChannelService.prototype.sendAction = function (messageId, formData) {
|
|
938
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
939
|
+
var channel, response, isThreadReply;
|
|
940
|
+
return __generator(this, function (_f) {
|
|
941
|
+
switch (_f.label) {
|
|
942
|
+
case 0:
|
|
943
|
+
channel = this.activeChannelSubject.getValue();
|
|
944
|
+
return [4 /*yield*/, channel.sendAction(messageId, formData)];
|
|
945
|
+
case 1:
|
|
946
|
+
response = _f.sent();
|
|
947
|
+
if (response === null || response === void 0 ? void 0 : response.message) {
|
|
948
|
+
channel.state.addMessageSorted(Object.assign(Object.assign({}, response.message), { status: 'received' }));
|
|
949
|
+
isThreadReply = !!response.message.parent_id;
|
|
950
|
+
isThreadReply
|
|
951
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[response.message.parent_id])))
|
|
952
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
953
|
+
}
|
|
954
|
+
else {
|
|
955
|
+
channel.state.removeMessage({ id: messageId });
|
|
956
|
+
if (this.activeChannelMessagesSubject
|
|
957
|
+
.getValue()
|
|
958
|
+
.find(function (m) { return m.id === messageId; })) {
|
|
959
|
+
this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
960
|
+
}
|
|
961
|
+
else if (this.activeThreadMessagesSubject
|
|
962
|
+
.getValue()
|
|
963
|
+
.find(function (m) { return m.id === messageId; })) {
|
|
964
|
+
this.activeThreadMessagesSubject.next(channel.state.threads[this.activeParentMessageIdSubject.getValue()]);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
return [2 /*return*/];
|
|
968
|
+
}
|
|
969
|
+
});
|
|
970
|
+
});
|
|
971
|
+
};
|
|
842
972
|
ChannelService.prototype.sendMessageRequest = function (preview) {
|
|
843
973
|
var _a;
|
|
844
974
|
return __awaiter(this, void 0, void 0, function () {
|
|
845
|
-
var channel, error_1, stringError, parsedError;
|
|
846
|
-
return __generator(this, function (
|
|
847
|
-
switch (
|
|
975
|
+
var channel, isThreadReply, response, error_1, stringError, parsedError;
|
|
976
|
+
return __generator(this, function (_f) {
|
|
977
|
+
switch (_f.label) {
|
|
848
978
|
case 0:
|
|
849
979
|
channel = this.activeChannelSubject.getValue();
|
|
850
|
-
|
|
851
|
-
|
|
980
|
+
isThreadReply = !!preview.parent_id;
|
|
981
|
+
isThreadReply
|
|
982
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
983
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
984
|
+
_f.label = 1;
|
|
852
985
|
case 1:
|
|
853
|
-
|
|
986
|
+
_f.trys.push([1, 3, , 4]);
|
|
854
987
|
return [4 /*yield*/, channel.sendMessage({
|
|
855
988
|
text: preview.text,
|
|
856
989
|
attachments: preview.attachments,
|
|
857
990
|
mentioned_users: (_a = preview.mentioned_users) === null || _a === void 0 ? void 0 : _a.map(function (u) { return u.id; }),
|
|
858
991
|
id: preview.id,
|
|
992
|
+
parent_id: preview.parent_id,
|
|
859
993
|
})];
|
|
860
994
|
case 2:
|
|
861
|
-
|
|
995
|
+
response = _f.sent();
|
|
996
|
+
if (response === null || response === void 0 ? void 0 : response.message) {
|
|
997
|
+
channel.state.addMessageSorted(Object.assign(Object.assign({}, response.message), { status: 'received' }), true);
|
|
998
|
+
isThreadReply
|
|
999
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
1000
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
1001
|
+
}
|
|
862
1002
|
return [3 /*break*/, 4];
|
|
863
1003
|
case 3:
|
|
864
|
-
error_1 =
|
|
1004
|
+
error_1 = _f.sent();
|
|
865
1005
|
stringError = JSON.stringify(error_1);
|
|
866
1006
|
parsedError = stringError
|
|
867
1007
|
? JSON.parse(stringError)
|
|
868
1008
|
: {};
|
|
869
1009
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, preview), { errorStatusCode: parsedError.status || undefined, status: 'failed' }), true);
|
|
870
|
-
|
|
1010
|
+
isThreadReply
|
|
1011
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
1012
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
871
1013
|
return [3 /*break*/, 4];
|
|
872
1014
|
case 4: return [2 /*return*/];
|
|
873
1015
|
}
|
|
@@ -876,53 +1018,53 @@
|
|
|
876
1018
|
};
|
|
877
1019
|
ChannelService.prototype.handleNotification = function (notification) {
|
|
878
1020
|
return __awaiter(this, void 0, void 0, function () {
|
|
879
|
-
var
|
|
1021
|
+
var _f;
|
|
880
1022
|
var _this = this;
|
|
881
|
-
return __generator(this, function (
|
|
882
|
-
switch (
|
|
1023
|
+
return __generator(this, function (_g) {
|
|
1024
|
+
switch (_g.label) {
|
|
883
1025
|
case 0:
|
|
884
|
-
|
|
885
|
-
switch (
|
|
1026
|
+
_f = notification.eventType;
|
|
1027
|
+
switch (_f) {
|
|
886
1028
|
case 'notification.message_new': return [3 /*break*/, 1];
|
|
887
1029
|
case 'notification.added_to_channel': return [3 /*break*/, 3];
|
|
888
1030
|
case 'notification.removed_from_channel': return [3 /*break*/, 5];
|
|
889
1031
|
}
|
|
890
1032
|
return [3 /*break*/, 6];
|
|
891
1033
|
case 1: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
892
|
-
return __generator(this, function (
|
|
893
|
-
switch (
|
|
1034
|
+
return __generator(this, function (_f) {
|
|
1035
|
+
switch (_f.label) {
|
|
894
1036
|
case 0:
|
|
895
1037
|
if (!this.customNewMessageNotificationHandler) return [3 /*break*/, 1];
|
|
896
1038
|
this.customNewMessageNotificationHandler(notification, this.channelListSetter);
|
|
897
1039
|
return [3 /*break*/, 3];
|
|
898
1040
|
case 1: return [4 /*yield*/, this.handleNewMessageNotification(notification)];
|
|
899
1041
|
case 2:
|
|
900
|
-
|
|
901
|
-
|
|
1042
|
+
_f.sent();
|
|
1043
|
+
_f.label = 3;
|
|
902
1044
|
case 3: return [2 /*return*/];
|
|
903
1045
|
}
|
|
904
1046
|
});
|
|
905
1047
|
}); })];
|
|
906
1048
|
case 2:
|
|
907
|
-
|
|
1049
|
+
_g.sent();
|
|
908
1050
|
return [3 /*break*/, 6];
|
|
909
1051
|
case 3: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
910
|
-
return __generator(this, function (
|
|
911
|
-
switch (
|
|
1052
|
+
return __generator(this, function (_f) {
|
|
1053
|
+
switch (_f.label) {
|
|
912
1054
|
case 0:
|
|
913
1055
|
if (!this.customAddedToChannelNotificationHandler) return [3 /*break*/, 1];
|
|
914
1056
|
this.customAddedToChannelNotificationHandler(notification, this.channelListSetter);
|
|
915
1057
|
return [3 /*break*/, 3];
|
|
916
1058
|
case 1: return [4 /*yield*/, this.handleAddedToChannelNotification(notification)];
|
|
917
1059
|
case 2:
|
|
918
|
-
|
|
919
|
-
|
|
1060
|
+
_f.sent();
|
|
1061
|
+
_f.label = 3;
|
|
920
1062
|
case 3: return [2 /*return*/];
|
|
921
1063
|
}
|
|
922
1064
|
});
|
|
923
1065
|
}); })];
|
|
924
1066
|
case 4:
|
|
925
|
-
|
|
1067
|
+
_g.sent();
|
|
926
1068
|
return [3 /*break*/, 6];
|
|
927
1069
|
case 5:
|
|
928
1070
|
{
|
|
@@ -935,7 +1077,7 @@
|
|
|
935
1077
|
}
|
|
936
1078
|
});
|
|
937
1079
|
}
|
|
938
|
-
|
|
1080
|
+
_g.label = 6;
|
|
939
1081
|
case 6: return [2 /*return*/];
|
|
940
1082
|
}
|
|
941
1083
|
});
|
|
@@ -947,11 +1089,11 @@
|
|
|
947
1089
|
};
|
|
948
1090
|
ChannelService.prototype.handleNewMessageNotification = function (notification) {
|
|
949
1091
|
return __awaiter(this, void 0, void 0, function () {
|
|
950
|
-
return __generator(this, function (
|
|
951
|
-
switch (
|
|
1092
|
+
return __generator(this, function (_f) {
|
|
1093
|
+
switch (_f.label) {
|
|
952
1094
|
case 0: return [4 /*yield*/, this.addChannelFromNotification(notification)];
|
|
953
1095
|
case 1:
|
|
954
|
-
|
|
1096
|
+
_f.sent();
|
|
955
1097
|
return [2 /*return*/];
|
|
956
1098
|
}
|
|
957
1099
|
});
|
|
@@ -959,11 +1101,11 @@
|
|
|
959
1101
|
};
|
|
960
1102
|
ChannelService.prototype.handleAddedToChannelNotification = function (notification) {
|
|
961
1103
|
return __awaiter(this, void 0, void 0, function () {
|
|
962
|
-
return __generator(this, function (
|
|
963
|
-
switch (
|
|
1104
|
+
return __generator(this, function (_f) {
|
|
1105
|
+
switch (_f.label) {
|
|
964
1106
|
case 0: return [4 /*yield*/, this.addChannelFromNotification(notification)];
|
|
965
1107
|
case 1:
|
|
966
|
-
|
|
1108
|
+
_f.sent();
|
|
967
1109
|
return [2 /*return*/];
|
|
968
1110
|
}
|
|
969
1111
|
});
|
|
@@ -973,13 +1115,13 @@
|
|
|
973
1115
|
var _a, _b;
|
|
974
1116
|
return __awaiter(this, void 0, void 0, function () {
|
|
975
1117
|
var channel;
|
|
976
|
-
return __generator(this, function (
|
|
977
|
-
switch (
|
|
1118
|
+
return __generator(this, function (_f) {
|
|
1119
|
+
switch (_f.label) {
|
|
978
1120
|
case 0:
|
|
979
1121
|
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);
|
|
980
1122
|
return [4 /*yield*/, channel.watch()];
|
|
981
1123
|
case 1:
|
|
982
|
-
|
|
1124
|
+
_f.sent();
|
|
983
1125
|
this.watchForChannelEvents(channel);
|
|
984
1126
|
this.channelsSubject.next(__spreadArray([
|
|
985
1127
|
channel
|
|
@@ -1000,9 +1142,11 @@
|
|
|
1000
1142
|
};
|
|
1001
1143
|
ChannelService.prototype.watchForActiveChannelEvents = function (channel) {
|
|
1002
1144
|
var _this = this;
|
|
1003
|
-
this.activeChannelSubscriptions.push(channel.on('message.new', function () {
|
|
1145
|
+
this.activeChannelSubscriptions.push(channel.on('message.new', function (event) {
|
|
1004
1146
|
_this.ngZone.run(function () {
|
|
1005
|
-
|
|
1147
|
+
event.message && event.message.parent_id
|
|
1148
|
+
? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[event.message.parent_id])))
|
|
1149
|
+
: _this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
1006
1150
|
_this.activeChannel$.pipe(operators.first()).subscribe(function (c) {
|
|
1007
1151
|
if (_this.canSendReadEvents) {
|
|
1008
1152
|
void (c === null || c === void 0 ? void 0 : c.markRead());
|
|
@@ -1032,11 +1176,16 @@
|
|
|
1032
1176
|
ChannelService.prototype.messageUpdated = function (event) {
|
|
1033
1177
|
var _this = this;
|
|
1034
1178
|
this.ngZone.run(function () {
|
|
1035
|
-
var
|
|
1179
|
+
var isThreadReply = event.message && event.message.parent_id;
|
|
1180
|
+
var messages = isThreadReply
|
|
1181
|
+
? _this.activeThreadMessagesSubject.getValue()
|
|
1182
|
+
: _this.activeChannelMessagesSubject.getValue();
|
|
1036
1183
|
var messageIndex = messages.findIndex(function (m) { var _a; return m.id === ((_a = event.message) === null || _a === void 0 ? void 0 : _a.id); });
|
|
1037
1184
|
if (messageIndex !== -1 && event.message) {
|
|
1038
1185
|
messages[messageIndex] = event.message;
|
|
1039
|
-
|
|
1186
|
+
isThreadReply
|
|
1187
|
+
? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(messages)))
|
|
1188
|
+
: _this.activeChannelMessagesSubject.next(__spreadArray([], __read(messages)));
|
|
1040
1189
|
}
|
|
1041
1190
|
});
|
|
1042
1191
|
};
|
|
@@ -1044,8 +1193,11 @@
|
|
|
1044
1193
|
var _this = this;
|
|
1045
1194
|
this.ngZone.run(function () {
|
|
1046
1195
|
var _a, _b, _c, _d;
|
|
1196
|
+
var isThreadMessage = e.message && e.message.parent_id;
|
|
1047
1197
|
var messages;
|
|
1048
|
-
|
|
1198
|
+
(isThreadMessage
|
|
1199
|
+
? _this.activeThreadMessages$
|
|
1200
|
+
: _this.activeChannelMessages$)
|
|
1049
1201
|
.pipe(operators.first())
|
|
1050
1202
|
.subscribe(function (m) { return (messages = m); });
|
|
1051
1203
|
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); });
|
|
@@ -1056,7 +1208,9 @@
|
|
|
1056
1208
|
message.reaction_scores = Object.assign({}, (_b = e.message) === null || _b === void 0 ? void 0 : _b.reaction_scores);
|
|
1057
1209
|
message.latest_reactions = __spreadArray([], __read((((_c = e.message) === null || _c === void 0 ? void 0 : _c.latest_reactions) || [])));
|
|
1058
1210
|
message.own_reactions = __spreadArray([], __read((((_d = e.message) === null || _d === void 0 ? void 0 : _d.own_reactions) || [])));
|
|
1059
|
-
|
|
1211
|
+
isThreadMessage
|
|
1212
|
+
? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(messages)))
|
|
1213
|
+
: _this.activeChannelMessagesSubject.next(__spreadArray([], __read(messages)));
|
|
1060
1214
|
});
|
|
1061
1215
|
};
|
|
1062
1216
|
ChannelService.prototype.formatMessage = function (message) {
|
|
@@ -1086,13 +1240,13 @@
|
|
|
1086
1240
|
return __awaiter(this, void 0, void 0, function () {
|
|
1087
1241
|
var channels, prevChannels, error_2;
|
|
1088
1242
|
var _this = this;
|
|
1089
|
-
return __generator(this, function (
|
|
1090
|
-
switch (
|
|
1243
|
+
return __generator(this, function (_f) {
|
|
1244
|
+
switch (_f.label) {
|
|
1091
1245
|
case 0:
|
|
1092
|
-
|
|
1246
|
+
_f.trys.push([0, 2, , 3]);
|
|
1093
1247
|
return [4 /*yield*/, this.chatClientService.chatClient.queryChannels(this.filters, this.sort, this.options)];
|
|
1094
1248
|
case 1:
|
|
1095
|
-
channels =
|
|
1249
|
+
channels = _f.sent();
|
|
1096
1250
|
channels.forEach(function (c) { return _this.watchForChannelEvents(c); });
|
|
1097
1251
|
prevChannels = this.channelsSubject.getValue() || [];
|
|
1098
1252
|
this.channelsSubject.next(__spreadArray(__spreadArray([], __read(prevChannels)), __read(channels)));
|
|
@@ -1102,7 +1256,7 @@
|
|
|
1102
1256
|
this.hasMoreChannelsSubject.next(channels.length >= this.options.limit);
|
|
1103
1257
|
return [3 /*break*/, 3];
|
|
1104
1258
|
case 2:
|
|
1105
|
-
error_2 =
|
|
1259
|
+
error_2 = _f.sent();
|
|
1106
1260
|
this.channelsSubject.error(error_2);
|
|
1107
1261
|
return [3 /*break*/, 3];
|
|
1108
1262
|
case 3: return [2 /*return*/];
|
|
@@ -1117,7 +1271,7 @@
|
|
|
1117
1271
|
case 'message.new': {
|
|
1118
1272
|
_this.ngZone.run(function () {
|
|
1119
1273
|
if (_this.customNewMessageHandler) {
|
|
1120
|
-
_this.customNewMessageHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1274
|
+
_this.customNewMessageHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1121
1275
|
}
|
|
1122
1276
|
else {
|
|
1123
1277
|
_this.handleNewMessage(event, channel);
|
|
@@ -1128,7 +1282,7 @@
|
|
|
1128
1282
|
case 'channel.hidden': {
|
|
1129
1283
|
_this.ngZone.run(function () {
|
|
1130
1284
|
if (_this.customChannelHiddenHandler) {
|
|
1131
|
-
_this.customChannelHiddenHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1285
|
+
_this.customChannelHiddenHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1132
1286
|
}
|
|
1133
1287
|
else {
|
|
1134
1288
|
_this.handleChannelHidden(event);
|
|
@@ -1139,7 +1293,7 @@
|
|
|
1139
1293
|
case 'channel.deleted': {
|
|
1140
1294
|
_this.ngZone.run(function () {
|
|
1141
1295
|
if (_this.customChannelDeletedHandler) {
|
|
1142
|
-
_this.customChannelDeletedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1296
|
+
_this.customChannelDeletedHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1143
1297
|
}
|
|
1144
1298
|
else {
|
|
1145
1299
|
_this.handleChannelDeleted(event);
|
|
@@ -1150,7 +1304,7 @@
|
|
|
1150
1304
|
case 'channel.visible': {
|
|
1151
1305
|
_this.ngZone.run(function () {
|
|
1152
1306
|
if (_this.customChannelVisibleHandler) {
|
|
1153
|
-
_this.customChannelVisibleHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1307
|
+
_this.customChannelVisibleHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1154
1308
|
}
|
|
1155
1309
|
else {
|
|
1156
1310
|
_this.handleChannelVisible(event, channel);
|
|
@@ -1161,7 +1315,7 @@
|
|
|
1161
1315
|
case 'channel.updated': {
|
|
1162
1316
|
_this.ngZone.run(function () {
|
|
1163
1317
|
if (_this.customChannelUpdatedHandler) {
|
|
1164
|
-
_this.customChannelUpdatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1318
|
+
_this.customChannelUpdatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1165
1319
|
}
|
|
1166
1320
|
else {
|
|
1167
1321
|
_this.handleChannelUpdate(event);
|
|
@@ -1172,7 +1326,7 @@
|
|
|
1172
1326
|
case 'channel.truncated': {
|
|
1173
1327
|
_this.ngZone.run(function () {
|
|
1174
1328
|
if (_this.customChannelTruncatedHandler) {
|
|
1175
|
-
_this.customChannelTruncatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1329
|
+
_this.customChannelTruncatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1176
1330
|
}
|
|
1177
1331
|
else {
|
|
1178
1332
|
_this.handleChannelTruncate(event);
|
|
@@ -1213,6 +1367,7 @@
|
|
|
1213
1367
|
}
|
|
1214
1368
|
}
|
|
1215
1369
|
};
|
|
1370
|
+
// truncate active thread as well
|
|
1216
1371
|
ChannelService.prototype.handleChannelTruncate = function (event) {
|
|
1217
1372
|
var _a, _b;
|
|
1218
1373
|
var channelIndex = this.channels.findIndex(function (c) { return c.cid === event.channel.cid; });
|
|
@@ -1224,6 +1379,8 @@
|
|
|
1224
1379
|
channel.state.messages = [];
|
|
1225
1380
|
this.activeChannelSubject.next(channel);
|
|
1226
1381
|
this.activeChannelMessagesSubject.next([]);
|
|
1382
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
1383
|
+
this.activeThreadMessagesSubject.next([]);
|
|
1227
1384
|
}
|
|
1228
1385
|
}
|
|
1229
1386
|
};
|
|
@@ -1247,6 +1404,20 @@
|
|
|
1247
1404
|
enumerable: false,
|
|
1248
1405
|
configurable: true
|
|
1249
1406
|
});
|
|
1407
|
+
ChannelService.prototype.transformToStreamMessage = function (message, channel) {
|
|
1408
|
+
var isThreadMessage = !!message.parent_id;
|
|
1409
|
+
if (this.isStreamMessage(message) &&
|
|
1410
|
+
this.isFormatMessageResponse(message)) {
|
|
1411
|
+
return message;
|
|
1412
|
+
}
|
|
1413
|
+
else if (this.isFormatMessageResponse(message)) {
|
|
1414
|
+
return Object.assign(Object.assign({}, message), { readBy: isThreadMessage ? [] : getReadBy(message, channel) });
|
|
1415
|
+
}
|
|
1416
|
+
else {
|
|
1417
|
+
var formatMessage = this.formatMessage(message);
|
|
1418
|
+
return Object.assign(Object.assign({}, formatMessage), { readBy: isThreadMessage ? [] : getReadBy(formatMessage, channel) });
|
|
1419
|
+
}
|
|
1420
|
+
};
|
|
1250
1421
|
return ChannelService;
|
|
1251
1422
|
}());
|
|
1252
1423
|
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 });
|
|
@@ -1605,6 +1776,7 @@
|
|
|
1605
1776
|
Flag: 'Flag',
|
|
1606
1777
|
'Message Failed': 'Message Failed',
|
|
1607
1778
|
'Message Failed · Unauthorized': 'Message Failed · Unauthorized',
|
|
1779
|
+
'Message Failed · Click to try again': 'Message Failed · Click to try again',
|
|
1608
1780
|
'Message deleted': 'Message deleted',
|
|
1609
1781
|
'Message has been successfully flagged': 'Message has been successfully flagged',
|
|
1610
1782
|
'Message pinned': 'Message pinned',
|
|
@@ -1655,6 +1827,7 @@
|
|
|
1655
1827
|
test: 'success',
|
|
1656
1828
|
'Sending links is not allowed in this conversation': 'Sending links is not allowed in this conversation',
|
|
1657
1829
|
"You can't send messages in this channel": "You can't send messages in this channel",
|
|
1830
|
+
"You can't send thread replies in this channel": "You can't send thread replies in this channel",
|
|
1658
1831
|
'Unsupported file type: {{type}}': 'Unsupported file type: {{type}}',
|
|
1659
1832
|
},
|
|
1660
1833
|
};
|
|
@@ -1698,7 +1871,7 @@
|
|
|
1698
1871
|
return AvatarComponent;
|
|
1699
1872
|
}());
|
|
1700
1873
|
AvatarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AvatarComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1701
|
-
AvatarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AvatarComponent, selector: "stream-avatar", inputs: { name: "name", imageUrl: "imageUrl", size: "size" }, ngImport: i0__namespace, template: "<div\n class=\"str-chat__avatar str-chat__avatar--circle\"\n title=\"{{ name }}\"\n [style]=\"{\n flexBasis: size + 'px',\n fontSize: size / 2 + 'px',\n height: size + 'px',\n lineHeight: size + 'px',\n width: size + 'px'\n }\"\n>\n <img\n *ngIf=\"imageUrl && !isError; else fallback\"\n class=\"str-chat__avatar-image str-chat__avatar-image{{\n isLoaded ? ' str-chat__avatar-image--loaded' : ''\n }}\"\n src=\"{{ imageUrl }}\"\n alt=\"{{ initials }}\"\n data-testid=\"avatar-img\"\n (load)=\"isLoaded = true\"\n (error)=\"isError = true\"\n [style]=\"{\n flexBasis: size + 'px',\n height: size + 'px',\n objectFit: 'cover',\n width: size + 'px'\n }\"\n />\n <ng-template #fallback>\n <div data-testid=\"fallback-img\" class=\"str-chat__avatar-fallback\">\n {{ initials }}\n </div>\n </ng-template>\n</div>\n", styles: [""], directives: [{ type:
|
|
1874
|
+
AvatarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AvatarComponent, selector: "stream-avatar", inputs: { name: "name", imageUrl: "imageUrl", size: "size" }, ngImport: i0__namespace, template: "<div\n class=\"str-chat__avatar str-chat__avatar--circle\"\n title=\"{{ name }}\"\n [style]=\"{\n flexBasis: size + 'px',\n fontSize: size / 2 + 'px',\n height: size + 'px',\n lineHeight: size + 'px',\n width: size + 'px'\n }\"\n>\n <img\n *ngIf=\"imageUrl && !isError; else fallback\"\n class=\"str-chat__avatar-image str-chat__avatar-image{{\n isLoaded ? ' str-chat__avatar-image--loaded' : ''\n }}\"\n src=\"{{ imageUrl }}\"\n alt=\"{{ initials }}\"\n data-testid=\"avatar-img\"\n (load)=\"isLoaded = true\"\n (error)=\"isError = true\"\n [style]=\"{\n flexBasis: size + 'px',\n height: size + 'px',\n objectFit: 'cover',\n width: size + 'px'\n }\"\n />\n <ng-template #fallback>\n <div data-testid=\"fallback-img\" class=\"str-chat__avatar-fallback\">\n {{ initials }}\n </div>\n </ng-template>\n</div>\n", styles: [""], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1702
1875
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AvatarComponent, decorators: [{
|
|
1703
1876
|
type: i0.Component,
|
|
1704
1877
|
args: [{
|
|
@@ -1720,7 +1893,7 @@
|
|
|
1720
1893
|
return IconComponent;
|
|
1721
1894
|
}());
|
|
1722
1895
|
IconComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: IconComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1723
|
-
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:
|
|
1896
|
+
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 data-testid=\"close-no-outline\"\n *ngIf=\"icon === 'close-no-outline'\"\n height=\"10\"\n width=\"10\"\n xmlns=\"http://www.w3.org/2000/svg\"\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: i10__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }] });
|
|
1724
1897
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: IconComponent, decorators: [{
|
|
1725
1898
|
type: i0.Component,
|
|
1726
1899
|
args: [{
|
|
@@ -1742,7 +1915,7 @@
|
|
|
1742
1915
|
return LoadingIndicatorComponent;
|
|
1743
1916
|
}());
|
|
1744
1917
|
LoadingIndicatorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: LoadingIndicatorComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1745
|
-
LoadingIndicatorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: { size: "size", color: "color" }, ngImport: i0__namespace, template: "<div class=\"str-chat__loading-indicator\">\n <svg\n [attr.height]=\"size\"\n viewBox=\"0 0 30 30\"\n [attr.width]=\"size\"\n data-testid=\"loading-indicator\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient id=\"a\" x1=\"50%\" x2=\"50%\" y1=\"0%\" y2=\"100%\">\n <stop offset=\"0%\" stop-color=\"#FFF\" stop-opacity=\"0\" />\n <stop\n data-testid=\"stop-color\"\n offset=\"100%\"\n [attr.stop-color]=\"color\"\n stop-opacity=\"1\"\n [ngStyle]=\"{ stopColor: color }\"\n />\n </linearGradient>\n </defs>\n <path\n d=\"M2.518 23.321l1.664-1.11A12.988 12.988 0 0 0 15 28c7.18 0 13-5.82 13-13S22.18 2 15 2V0c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-5.206 0-9.792-2.652-12.482-6.679z\"\n fill=\"url(#a)\"\n fillRule=\"evenodd\"\n />\n </svg>\n</div>\n", directives: [{ type:
|
|
1918
|
+
LoadingIndicatorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: { size: "size", color: "color" }, ngImport: i0__namespace, template: "<div class=\"str-chat__loading-indicator\">\n <svg\n [attr.height]=\"size\"\n viewBox=\"0 0 30 30\"\n [attr.width]=\"size\"\n data-testid=\"loading-indicator\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient id=\"a\" x1=\"50%\" x2=\"50%\" y1=\"0%\" y2=\"100%\">\n <stop offset=\"0%\" stop-color=\"#FFF\" stop-opacity=\"0\" />\n <stop\n data-testid=\"stop-color\"\n offset=\"100%\"\n [attr.stop-color]=\"color\"\n stop-opacity=\"1\"\n [ngStyle]=\"{ stopColor: color }\"\n />\n </linearGradient>\n </defs>\n <path\n d=\"M2.518 23.321l1.664-1.11A12.988 12.988 0 0 0 15 28c7.18 0 13-5.82 13-13S22.18 2 15 2V0c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-5.206 0-9.792-2.652-12.482-6.679z\"\n fill=\"url(#a)\"\n fillRule=\"evenodd\"\n />\n </svg>\n</div>\n", directives: [{ type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
1746
1919
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: LoadingIndicatorComponent, decorators: [{
|
|
1747
1920
|
type: i0.Component,
|
|
1748
1921
|
args: [{
|
|
@@ -1785,6 +1958,8 @@
|
|
|
1785
1958
|
this.componentRef.instance.areMentionsEnabled = this.areMentionsEnabled;
|
|
1786
1959
|
this.componentRef.instance.mentionAutocompleteItemTemplate =
|
|
1787
1960
|
this.mentionAutocompleteItemTemplate;
|
|
1961
|
+
this.componentRef.instance.commandAutocompleteItemTemplate =
|
|
1962
|
+
this.commandAutocompleteItemTemplate;
|
|
1788
1963
|
this.componentRef.instance.mentionScope = this.mentionScope;
|
|
1789
1964
|
this.componentRef.instance.value = this.value;
|
|
1790
1965
|
}
|
|
@@ -1796,6 +1971,10 @@
|
|
|
1796
1971
|
this.componentRef.instance.mentionAutocompleteItemTemplate =
|
|
1797
1972
|
this.mentionAutocompleteItemTemplate;
|
|
1798
1973
|
}
|
|
1974
|
+
if (changes.commandAutocompleteItemTemplate) {
|
|
1975
|
+
this.componentRef.instance.commandAutocompleteItemTemplate =
|
|
1976
|
+
this.commandAutocompleteItemTemplate;
|
|
1977
|
+
}
|
|
1799
1978
|
if (changes.mentionScope) {
|
|
1800
1979
|
this.componentRef.instance.mentionScope = this.mentionScope;
|
|
1801
1980
|
}
|
|
@@ -1812,7 +1991,7 @@
|
|
|
1812
1991
|
return TextareaDirective;
|
|
1813
1992
|
}());
|
|
1814
1993
|
TextareaDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: TextareaDirective, deps: [{ token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
1815
|
-
TextareaDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: TextareaDirective, selector: "[streamTextarea]", inputs: { componentRef: "componentRef", areMentionsEnabled: "areMentionsEnabled", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", mentionScope: "mentionScope", value: "value" }, outputs: { valueChange: "valueChange", send: "send", userMentions: "userMentions" }, usesOnChanges: true, ngImport: i0__namespace });
|
|
1994
|
+
TextareaDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: TextareaDirective, selector: "[streamTextarea]", inputs: { componentRef: "componentRef", areMentionsEnabled: "areMentionsEnabled", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", mentionScope: "mentionScope", commandAutocompleteItemTemplate: "commandAutocompleteItemTemplate", value: "value" }, outputs: { valueChange: "valueChange", send: "send", userMentions: "userMentions" }, usesOnChanges: true, ngImport: i0__namespace });
|
|
1816
1995
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: TextareaDirective, decorators: [{
|
|
1817
1996
|
type: i0.Directive,
|
|
1818
1997
|
args: [{
|
|
@@ -1826,6 +2005,8 @@
|
|
|
1826
2005
|
type: i0.Input
|
|
1827
2006
|
}], mentionScope: [{
|
|
1828
2007
|
type: i0.Input
|
|
2008
|
+
}], commandAutocompleteItemTemplate: [{
|
|
2009
|
+
type: i0.Input
|
|
1829
2010
|
}], value: [{
|
|
1830
2011
|
type: i0.Input
|
|
1831
2012
|
}], valueChange: [{
|
|
@@ -1889,7 +2070,7 @@
|
|
|
1889
2070
|
return AttachmentPreviewListComponent;
|
|
1890
2071
|
}());
|
|
1891
2072
|
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 });
|
|
1892
|
-
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:
|
|
2073
|
+
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: i10__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "async": i6__namespace.AsyncPipe } });
|
|
1893
2074
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentPreviewListComponent, decorators: [{
|
|
1894
2075
|
type: i0.Component,
|
|
1895
2076
|
args: [{
|
|
@@ -1910,6 +2091,7 @@
|
|
|
1910
2091
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
1911
2092
|
this.cdRef = cdRef;
|
|
1912
2093
|
this.chatClient = chatClient;
|
|
2094
|
+
this.mode = 'main';
|
|
1913
2095
|
this.messageUpdate = new i0.EventEmitter();
|
|
1914
2096
|
this.textareaValue = '';
|
|
1915
2097
|
this.mentionedUsers = [];
|
|
@@ -1930,11 +2112,8 @@
|
|
|
1930
2112
|
_this.isFileUploadAuthorized =
|
|
1931
2113
|
capabilities.indexOf('upload-file') !== -1;
|
|
1932
2114
|
_this.canSendLinks = capabilities.indexOf('send-links') !== -1;
|
|
1933
|
-
_this.
|
|
1934
|
-
|
|
1935
|
-
_this.cdRef.detectChanges();
|
|
1936
|
-
_this.initTextarea();
|
|
1937
|
-
}
|
|
2115
|
+
_this.channel = channel;
|
|
2116
|
+
_this.setCanSendMessages();
|
|
1938
2117
|
}
|
|
1939
2118
|
}));
|
|
1940
2119
|
this.subscriptions.push(this.chatClient.appSettings$.subscribe(function (appSettings) { return (_this.appSettings = appSettings); }));
|
|
@@ -1947,6 +2126,8 @@
|
|
|
1947
2126
|
this.mentionAutocompleteItemTemplate =
|
|
1948
2127
|
this.configService.mentionAutocompleteItemTemplate;
|
|
1949
2128
|
this.mentionScope = this.configService.mentionScope;
|
|
2129
|
+
this.commandAutocompleteItemTemplate =
|
|
2130
|
+
this.configService.commandAutocompleteItemTemplate;
|
|
1950
2131
|
}
|
|
1951
2132
|
MessageInputComponent.prototype.ngAfterViewInit = function () {
|
|
1952
2133
|
this.isViewInited = true;
|
|
@@ -1977,16 +2158,23 @@
|
|
|
1977
2158
|
this.configService.mentionAutocompleteItemTemplate =
|
|
1978
2159
|
this.mentionAutocompleteItemTemplate;
|
|
1979
2160
|
}
|
|
2161
|
+
if (changes.commandAutocompleteItemTemplate) {
|
|
2162
|
+
this.configService.commandAutocompleteItemTemplate =
|
|
2163
|
+
this.commandAutocompleteItemTemplate;
|
|
2164
|
+
}
|
|
1980
2165
|
if (changes.mentionScope) {
|
|
1981
2166
|
this.configService.mentionScope = this.mentionScope;
|
|
1982
2167
|
}
|
|
2168
|
+
if (changes.mode) {
|
|
2169
|
+
this.setCanSendMessages();
|
|
2170
|
+
}
|
|
1983
2171
|
};
|
|
1984
2172
|
MessageInputComponent.prototype.ngOnDestroy = function () {
|
|
1985
2173
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
1986
2174
|
};
|
|
1987
2175
|
MessageInputComponent.prototype.messageSent = function () {
|
|
1988
2176
|
return __awaiter(this, void 0, void 0, function () {
|
|
1989
|
-
var attachmentUploadInProgressCounter, attachments, text, error_1;
|
|
2177
|
+
var attachmentUploadInProgressCounter, attachments, text, parentMessageId, error_1;
|
|
1990
2178
|
return __generator(this, function (_12) {
|
|
1991
2179
|
switch (_12.label) {
|
|
1992
2180
|
case 0:
|
|
@@ -2012,12 +2200,18 @@
|
|
|
2012
2200
|
if (!this.isUpdate) {
|
|
2013
2201
|
this.textareaValue = '';
|
|
2014
2202
|
}
|
|
2203
|
+
parentMessageId = undefined;
|
|
2204
|
+
if (this.mode === 'thread') {
|
|
2205
|
+
this.channelService.activeParentMessageId$
|
|
2206
|
+
.pipe(operators.first())
|
|
2207
|
+
.subscribe(function (id) { return (parentMessageId = id); });
|
|
2208
|
+
}
|
|
2015
2209
|
_12.label = 1;
|
|
2016
2210
|
case 1:
|
|
2017
2211
|
_12.trys.push([1, 3, , 4]);
|
|
2018
2212
|
return [4 /*yield*/, (this.isUpdate
|
|
2019
2213
|
? this.channelService.updateMessage(Object.assign(Object.assign({}, this.message), { text: text, attachments: attachments }))
|
|
2020
|
-
: this.channelService.sendMessage(text, attachments, this.mentionedUsers))];
|
|
2214
|
+
: this.channelService.sendMessage(text, attachments, this.mentionedUsers, parentMessageId))];
|
|
2021
2215
|
case 2:
|
|
2022
2216
|
_12.sent();
|
|
2023
2217
|
this.messageUpdate.emit();
|
|
@@ -2148,10 +2342,25 @@
|
|
|
2148
2342
|
});
|
|
2149
2343
|
});
|
|
2150
2344
|
};
|
|
2345
|
+
MessageInputComponent.prototype.setCanSendMessages = function () {
|
|
2346
|
+
var _a, _b;
|
|
2347
|
+
var capabilities = (_b = (_a = this.channel) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.own_capabilities;
|
|
2348
|
+
if (!capabilities) {
|
|
2349
|
+
this.canSendMessages = false;
|
|
2350
|
+
}
|
|
2351
|
+
else {
|
|
2352
|
+
this.canSendMessages =
|
|
2353
|
+
capabilities.indexOf(this.mode === 'main' ? 'send-message' : 'send-reply') !== -1;
|
|
2354
|
+
}
|
|
2355
|
+
if (this.isViewInited) {
|
|
2356
|
+
this.cdRef.detectChanges();
|
|
2357
|
+
this.initTextarea();
|
|
2358
|
+
}
|
|
2359
|
+
};
|
|
2151
2360
|
return MessageInputComponent;
|
|
2152
2361
|
}());
|
|
2153
2362
|
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 });
|
|
2154
|
-
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", 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
|
|
2363
|
+
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>\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: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list" }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], 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": i10__namespace.TranslatePipe } });
|
|
2155
2364
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputComponent, decorators: [{
|
|
2156
2365
|
type: i0.Component,
|
|
2157
2366
|
args: [{
|
|
@@ -2173,6 +2382,10 @@
|
|
|
2173
2382
|
type: i0.Input
|
|
2174
2383
|
}], mentionAutocompleteItemTemplate: [{
|
|
2175
2384
|
type: i0.Input
|
|
2385
|
+
}], commandAutocompleteItemTemplate: [{
|
|
2386
|
+
type: i0.Input
|
|
2387
|
+
}], mode: [{
|
|
2388
|
+
type: i0.Input
|
|
2176
2389
|
}], acceptedFileTypes: [{
|
|
2177
2390
|
type: i0.Input
|
|
2178
2391
|
}], isMultipleFileUploadEnabled: [{
|
|
@@ -2280,7 +2493,7 @@
|
|
|
2280
2493
|
return NotificationListComponent;
|
|
2281
2494
|
}());
|
|
2282
2495
|
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 });
|
|
2283
|
-
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:
|
|
2496
|
+
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": i10__namespace.TranslatePipe } });
|
|
2284
2497
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationListComponent, decorators: [{
|
|
2285
2498
|
type: i0.Component,
|
|
2286
2499
|
args: [{
|
|
@@ -2340,16 +2553,22 @@
|
|
|
2340
2553
|
});
|
|
2341
2554
|
Object.defineProperty(MessageActionsBoxComponent.prototype, "isEditVisible", {
|
|
2342
2555
|
get: function () {
|
|
2343
|
-
return ((this.enabledActions.indexOf('edit') !== -1
|
|
2344
|
-
this.enabledActions.indexOf('
|
|
2556
|
+
return (((this.enabledActions.indexOf('edit') !== -1 ||
|
|
2557
|
+
this.enabledActions.indexOf('update-own-message') !== -1) &&
|
|
2558
|
+
this.isMine) ||
|
|
2559
|
+
this.enabledActions.indexOf('edit-any') !== -1 ||
|
|
2560
|
+
this.enabledActions.indexOf('update-any-message') !== -1);
|
|
2345
2561
|
},
|
|
2346
2562
|
enumerable: false,
|
|
2347
2563
|
configurable: true
|
|
2348
2564
|
});
|
|
2349
2565
|
Object.defineProperty(MessageActionsBoxComponent.prototype, "isDeleteVisible", {
|
|
2350
2566
|
get: function () {
|
|
2351
|
-
return ((this.enabledActions.indexOf('delete') !== -1
|
|
2352
|
-
this.enabledActions.indexOf('delete-
|
|
2567
|
+
return (((this.enabledActions.indexOf('delete') !== -1 ||
|
|
2568
|
+
this.enabledActions.indexOf('delete-own-message') !== -1) &&
|
|
2569
|
+
this.isMine) ||
|
|
2570
|
+
this.enabledActions.indexOf('delete-any') !== -1 ||
|
|
2571
|
+
this.enabledActions.indexOf('delete-any-message') !== -1);
|
|
2353
2572
|
},
|
|
2354
2573
|
enumerable: false,
|
|
2355
2574
|
configurable: true
|
|
@@ -2363,7 +2582,9 @@
|
|
|
2363
2582
|
});
|
|
2364
2583
|
Object.defineProperty(MessageActionsBoxComponent.prototype, "isFlagVisible", {
|
|
2365
2584
|
get: function () {
|
|
2366
|
-
return this.enabledActions.indexOf('flag') !== -1
|
|
2585
|
+
return ((this.enabledActions.indexOf('flag') !== -1 ||
|
|
2586
|
+
this.enabledActions.indexOf('flag-message') !== -1) &&
|
|
2587
|
+
!this.isMine);
|
|
2367
2588
|
},
|
|
2368
2589
|
enumerable: false,
|
|
2369
2590
|
configurable: true
|
|
@@ -2436,7 +2657,7 @@
|
|
|
2436
2657
|
return MessageActionsBoxComponent;
|
|
2437
2658
|
}());
|
|
2438
2659
|
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 });
|
|
2439
|
-
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", "acceptedFileTypes", "isMultipleFileUploadEnabled", "message"], outputs: ["messageUpdate"] }, { type: NotificationListComponent, selector: "stream-notification-list" }], directives: [{ type:
|
|
2660
|
+
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: i10__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i10__namespace.TranslatePipe } });
|
|
2440
2661
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageActionsBoxComponent, decorators: [{
|
|
2441
2662
|
type: i0.Component,
|
|
2442
2663
|
args: [{
|
|
@@ -2469,11 +2690,12 @@
|
|
|
2469
2690
|
this.subscriptions = [];
|
|
2470
2691
|
this.isError$ = this.channelService.channels$.pipe(operators.map(function () { return false; }), operators.catchError(function () { return rxjs.of(true); }), operators.startWith(false));
|
|
2471
2692
|
this.isInitializing$ = this.channelService.channels$.pipe(operators.map(function (channels) { return !channels; }), operators.catchError(function () { return rxjs.of(false); }));
|
|
2693
|
+
this.isActiveThread$ = this.channelService.activeParentMessageId$.pipe(operators.map(function (id) { return !!id; }));
|
|
2472
2694
|
}
|
|
2473
2695
|
return ChannelComponent;
|
|
2474
2696
|
}());
|
|
2475
2697
|
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 });
|
|
2476
|
-
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:
|
|
2698
|
+
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 } });
|
|
2477
2699
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelComponent, decorators: [{
|
|
2478
2700
|
type: i0.Component,
|
|
2479
2701
|
args: [{
|
|
@@ -2736,7 +2958,7 @@
|
|
|
2736
2958
|
return ChannelListComponent;
|
|
2737
2959
|
}());
|
|
2738
2960
|
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 });
|
|
2739
|
-
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:
|
|
2961
|
+
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": i10__namespace.TranslatePipe } });
|
|
2740
2962
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelListComponent, decorators: [{
|
|
2741
2963
|
type: i0.Component,
|
|
2742
2964
|
args: [{
|
|
@@ -2903,7 +3125,7 @@
|
|
|
2903
3125
|
return MessageReactionsComponent;
|
|
2904
3126
|
}());
|
|
2905
3127
|
MessageReactionsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageReactionsComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2906
|
-
MessageReactionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: { messageId: "messageId", messageReactionCounts: "messageReactionCounts", isSelectorOpen: "isSelectorOpen", latestReactions: "latestReactions", ownReactions: "ownReactions" }, outputs: { isSelectorOpenChange: "isSelectorOpenChange" }, viewQueries: [{ propertyName: "selectorContainer", first: true, predicate: ["selectorContainer"], descendants: true }, { propertyName: "selectorTooltip", first: true, predicate: ["selectorTooltip"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n *ngIf=\"existingReactions.length > 0 && !isSelectorOpen\"\n class=\"str-chat__reaction-list\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n data-testid=\"reaction-list\"\n>\n <ul>\n <li\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji\"\n >\n <span class=\"emoji\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n \n </li>\n <li>\n <span\n data-testid=\"reactions-count\"\n class=\"str-chat__reaction-list--counter\"\n >{{ reactionsCount }}</span\n >\n </li>\n </ul>\n</div>\n\n<div\n #selectorContainer\n class=\"str-chat__reaction-selector\"\n *ngIf=\"isSelectorOpen\"\n data-testid=\"reaction-selector\"\n>\n <div\n *ngIf=\"tooltipText\"\n data-testid=\"tooltip\"\n #selectorTooltip\n class=\"str-chat__reaction-selector-tooltip\"\n [ngStyle]=\"{\n left: tooltipPositions?.tooltip + 'px',\n visibility: tooltipPositions ? 'visible' : 'hidden'\n }\"\n >\n <div\n class=\"arrow\"\n [ngStyle]=\"{ left: tooltipPositions?.arrow + 'px' }\"\n ></div>\n <span class=\"latest-user-username\">\n {{ tooltipText }}\n </span>\n </div>\n <ul class=\"str-chat__message-reactions-list\">\n <li\n class=\"str-chat__message-reactions-list-item\"\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji-option\"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <div\n *ngIf=\"getLatestUserByReaction(reactionType) as user\"\n class=\"latest-user\"\n (click)=\"hideTooltip()\"\n (keyup.enter)=\"hideTooltip()\"\n (mouseenter)=\"showTooltip($event, reactionType)\"\n (mouseleave)=\"hideTooltip()\"\n attr.data-testid=\"{{ reactionType }}-last-user\"\n >\n <stream-avatar\n attr.data-testid=\"{{ reactionType }}-avatar\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name || user.id\"\n [size]=\"20\"\n ></stream-avatar>\n </div>\n <span class=\"emoji\" style=\"width: 20px; height: 20px; top: 10px\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n <span\n *ngIf=\"\n messageReactionCounts[reactionType] &&\n messageReactionCounts[reactionType]! > 0\n \"\n class=\"str-chat__message-reactions-list-item__count\"\n attr.data-testid=\"{{ reactionType }}-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n </ul>\n</div>\n", styles: [".emoji {position: relative; display: inline-block; }"], components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], directives: [{ type:
|
|
3128
|
+
MessageReactionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: { messageId: "messageId", messageReactionCounts: "messageReactionCounts", isSelectorOpen: "isSelectorOpen", latestReactions: "latestReactions", ownReactions: "ownReactions" }, outputs: { isSelectorOpenChange: "isSelectorOpenChange" }, viewQueries: [{ propertyName: "selectorContainer", first: true, predicate: ["selectorContainer"], descendants: true }, { propertyName: "selectorTooltip", first: true, predicate: ["selectorTooltip"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n *ngIf=\"existingReactions.length > 0 && !isSelectorOpen\"\n class=\"str-chat__reaction-list\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n data-testid=\"reaction-list\"\n>\n <ul>\n <li\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji\"\n >\n <span class=\"emoji\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n \n </li>\n <li>\n <span\n data-testid=\"reactions-count\"\n class=\"str-chat__reaction-list--counter\"\n >{{ reactionsCount }}</span\n >\n </li>\n </ul>\n</div>\n\n<div\n #selectorContainer\n class=\"str-chat__reaction-selector\"\n *ngIf=\"isSelectorOpen\"\n data-testid=\"reaction-selector\"\n>\n <div\n *ngIf=\"tooltipText\"\n data-testid=\"tooltip\"\n #selectorTooltip\n class=\"str-chat__reaction-selector-tooltip\"\n [ngStyle]=\"{\n left: tooltipPositions?.tooltip + 'px',\n visibility: tooltipPositions ? 'visible' : 'hidden'\n }\"\n >\n <div\n class=\"arrow\"\n [ngStyle]=\"{ left: tooltipPositions?.arrow + 'px' }\"\n ></div>\n <span class=\"latest-user-username\">\n {{ tooltipText }}\n </span>\n </div>\n <ul class=\"str-chat__message-reactions-list\">\n <li\n class=\"str-chat__message-reactions-list-item\"\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji-option\"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <div\n *ngIf=\"getLatestUserByReaction(reactionType) as user\"\n class=\"latest-user\"\n (click)=\"hideTooltip()\"\n (keyup.enter)=\"hideTooltip()\"\n (mouseenter)=\"showTooltip($event, reactionType)\"\n (mouseleave)=\"hideTooltip()\"\n attr.data-testid=\"{{ reactionType }}-last-user\"\n >\n <stream-avatar\n attr.data-testid=\"{{ reactionType }}-avatar\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name || user.id\"\n [size]=\"20\"\n ></stream-avatar>\n </div>\n <span class=\"emoji\" style=\"width: 20px; height: 20px; top: 10px\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n <span\n *ngIf=\"\n messageReactionCounts[reactionType] &&\n messageReactionCounts[reactionType]! > 0\n \"\n class=\"str-chat__message-reactions-list-item__count\"\n attr.data-testid=\"{{ reactionType }}-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n </ul>\n</div>\n", styles: [".emoji {position: relative; display: inline-block; }"], components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
2907
3129
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageReactionsComponent, decorators: [{
|
|
2908
3130
|
type: i0.Component,
|
|
2909
3131
|
args: [{
|
|
@@ -2947,8 +3169,9 @@
|
|
|
2947
3169
|
}], ctorParameters: function () { return []; } });
|
|
2948
3170
|
|
|
2949
3171
|
var AttachmentListComponent = /** @class */ (function () {
|
|
2950
|
-
function AttachmentListComponent(imageLoadService) {
|
|
3172
|
+
function AttachmentListComponent(imageLoadService, channelService) {
|
|
2951
3173
|
this.imageLoadService = imageLoadService;
|
|
3174
|
+
this.channelService = channelService;
|
|
2952
3175
|
this.attachments = [];
|
|
2953
3176
|
this.orderedAttachments = [];
|
|
2954
3177
|
}
|
|
@@ -2967,7 +3190,8 @@
|
|
|
2967
3190
|
};
|
|
2968
3191
|
AttachmentListComponent.prototype.isCard = function (attachment) {
|
|
2969
3192
|
return (!attachment.type ||
|
|
2970
|
-
(attachment.type === 'image' && !this.isImage(attachment))
|
|
3193
|
+
(attachment.type === 'image' && !this.isImage(attachment)) ||
|
|
3194
|
+
attachment.type === 'giphy');
|
|
2971
3195
|
};
|
|
2972
3196
|
AttachmentListComponent.prototype.imageLoaded = function () {
|
|
2973
3197
|
this.imageLoadService.imageLoad$.next();
|
|
@@ -2987,10 +3211,19 @@
|
|
|
2987
3211
|
}
|
|
2988
3212
|
return null;
|
|
2989
3213
|
};
|
|
3214
|
+
AttachmentListComponent.prototype.sendAction = function (action) {
|
|
3215
|
+
var _a;
|
|
3216
|
+
void this.channelService.sendAction(this.messageId, (_a = {},
|
|
3217
|
+
_a[action.name] = action.value,
|
|
3218
|
+
_a));
|
|
3219
|
+
};
|
|
3220
|
+
AttachmentListComponent.prototype.trackByActionValue = function (_, item) {
|
|
3221
|
+
return item.value;
|
|
3222
|
+
};
|
|
2990
3223
|
return AttachmentListComponent;
|
|
2991
3224
|
}());
|
|
2992
|
-
AttachmentListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentListComponent, deps: [{ token: ImageLoadService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2993
|
-
AttachmentListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AttachmentListComponent, selector: "stream-attachment-list", inputs: { 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</ng-container>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type:
|
|
3225
|
+
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 });
|
|
3226
|
+
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"] }] });
|
|
2994
3227
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentListComponent, decorators: [{
|
|
2995
3228
|
type: i0.Component,
|
|
2996
3229
|
args: [{
|
|
@@ -2998,7 +3231,9 @@
|
|
|
2998
3231
|
templateUrl: './attachment-list.component.html',
|
|
2999
3232
|
styles: [],
|
|
3000
3233
|
}]
|
|
3001
|
-
}], ctorParameters: function () { return [{ type: ImageLoadService }]; }, propDecorators: {
|
|
3234
|
+
}], ctorParameters: function () { return [{ type: ImageLoadService }, { type: ChannelService }]; }, propDecorators: { messageId: [{
|
|
3235
|
+
type: i0.Input
|
|
3236
|
+
}], attachments: [{
|
|
3002
3237
|
type: i0.Input
|
|
3003
3238
|
}] } });
|
|
3004
3239
|
|
|
@@ -3007,6 +3242,7 @@
|
|
|
3007
3242
|
this.chatClientService = chatClientService;
|
|
3008
3243
|
this.channelService = channelService;
|
|
3009
3244
|
this.enabledMessageActions = [];
|
|
3245
|
+
this.mode = 'main';
|
|
3010
3246
|
this.isActionBoxOpen = false;
|
|
3011
3247
|
this.isReactionSelectorOpen = false;
|
|
3012
3248
|
this.isPressedOnMobile = false;
|
|
@@ -3127,7 +3363,8 @@
|
|
|
3127
3363
|
this.message.type === 'system' ||
|
|
3128
3364
|
this.message.type === 'ephemeral' ||
|
|
3129
3365
|
this.message.status === 'failed' ||
|
|
3130
|
-
this.message.status === 'sending'
|
|
3366
|
+
this.message.status === 'sending' ||
|
|
3367
|
+
(this.mode === 'thread' && !this.message.parent_id));
|
|
3131
3368
|
},
|
|
3132
3369
|
enumerable: false,
|
|
3133
3370
|
configurable: true
|
|
@@ -3149,6 +3386,22 @@
|
|
|
3149
3386
|
enumerable: false,
|
|
3150
3387
|
configurable: true
|
|
3151
3388
|
});
|
|
3389
|
+
Object.defineProperty(MessageComponent.prototype, "replyCountParam", {
|
|
3390
|
+
get: function () {
|
|
3391
|
+
var _a;
|
|
3392
|
+
return { replyCount: (_a = this.message) === null || _a === void 0 ? void 0 : _a.reply_count };
|
|
3393
|
+
},
|
|
3394
|
+
enumerable: false,
|
|
3395
|
+
configurable: true
|
|
3396
|
+
});
|
|
3397
|
+
Object.defineProperty(MessageComponent.prototype, "canDisplayReadStatus", {
|
|
3398
|
+
get: function () {
|
|
3399
|
+
return (this.canReceiveReadEvents !== false &&
|
|
3400
|
+
this.enabledMessageActions.indexOf('read-events') !== -1);
|
|
3401
|
+
},
|
|
3402
|
+
enumerable: false,
|
|
3403
|
+
configurable: true
|
|
3404
|
+
});
|
|
3152
3405
|
MessageComponent.prototype.resendMessage = function () {
|
|
3153
3406
|
void this.channelService.resendMessage(this.message);
|
|
3154
3407
|
};
|
|
@@ -3171,10 +3424,13 @@
|
|
|
3171
3424
|
};
|
|
3172
3425
|
window.addEventListener('click', eventHandler);
|
|
3173
3426
|
};
|
|
3427
|
+
MessageComponent.prototype.setAsActiveParentMessage = function () {
|
|
3428
|
+
void this.channelService.setAsActiveParentMessage(this.message);
|
|
3429
|
+
};
|
|
3174
3430
|
return MessageComponent;
|
|
3175
3431
|
}());
|
|
3176
3432
|
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 });
|
|
3177
|
-
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 ></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: ["attachments"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3__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 } });
|
|
3433
|
+
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>\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\"\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-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", 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 } });
|
|
3178
3434
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageComponent, decorators: [{
|
|
3179
3435
|
type: i0.Component,
|
|
3180
3436
|
args: [{
|
|
@@ -3198,6 +3454,8 @@
|
|
|
3198
3454
|
type: i0.Input
|
|
3199
3455
|
}], canReceiveReadEvents: [{
|
|
3200
3456
|
type: i0.Input
|
|
3457
|
+
}], mode: [{
|
|
3458
|
+
type: i0.Input
|
|
3201
3459
|
}], container: [{
|
|
3202
3460
|
type: i0.ViewChild,
|
|
3203
3461
|
args: ['container']
|
|
@@ -3271,8 +3529,9 @@
|
|
|
3271
3529
|
this.valueChange = new i0.EventEmitter();
|
|
3272
3530
|
this.send = new i0.EventEmitter();
|
|
3273
3531
|
this.userMentions = new i0.EventEmitter();
|
|
3274
|
-
this.
|
|
3532
|
+
this.autocompleteKey = 'autocompleteLabel';
|
|
3275
3533
|
this.mentionTriggerChar = '@';
|
|
3534
|
+
this.commandTriggerChar = '/';
|
|
3276
3535
|
this.autocompleteConfig = {
|
|
3277
3536
|
mentions: [],
|
|
3278
3537
|
};
|
|
@@ -3281,7 +3540,15 @@
|
|
|
3281
3540
|
this.userMentionConfig = {
|
|
3282
3541
|
triggerChar: this.mentionTriggerChar,
|
|
3283
3542
|
dropUp: true,
|
|
3284
|
-
labelKey: this.
|
|
3543
|
+
labelKey: this.autocompleteKey,
|
|
3544
|
+
returnTrigger: true,
|
|
3545
|
+
mentionFilter: function (searchString, items) { return _this.filter(searchString, items); },
|
|
3546
|
+
mentionSelect: function (item, triggerChar) { return _this.itemSelectedFromAutocompleteList(item, triggerChar); },
|
|
3547
|
+
};
|
|
3548
|
+
this.slashCommandConfig = {
|
|
3549
|
+
triggerChar: this.commandTriggerChar,
|
|
3550
|
+
dropUp: true,
|
|
3551
|
+
labelKey: 'name',
|
|
3285
3552
|
returnTrigger: true,
|
|
3286
3553
|
mentionFilter: function (searchString, items) { return _this.filter(searchString, items); },
|
|
3287
3554
|
mentionSelect: function (item, triggerChar) { return _this.itemSelectedFromAutocompleteList(item, triggerChar); },
|
|
@@ -3294,20 +3561,33 @@
|
|
|
3294
3561
|
void _this.updateMentionOptions(searchTerm);
|
|
3295
3562
|
}
|
|
3296
3563
|
});
|
|
3297
|
-
this.subscriptions.push(this.channelService.activeChannel$.subscribe(function () {
|
|
3564
|
+
this.subscriptions.push(this.channelService.activeChannel$.subscribe(function (channel) {
|
|
3565
|
+
var _a;
|
|
3566
|
+
var commands = ((_a = channel === null || channel === void 0 ? void 0 : channel.getConfig()) === null || _a === void 0 ? void 0 : _a.commands) || [];
|
|
3567
|
+
_this.slashCommandConfig.items = commands.map(function (c) {
|
|
3568
|
+
var _b;
|
|
3569
|
+
return (Object.assign(Object.assign({}, c), (_b = {}, _b[_this.autocompleteKey] = c.name, _b.type = 'command', _b)));
|
|
3570
|
+
});
|
|
3298
3571
|
_this.mentionedUsers = [];
|
|
3299
3572
|
_this.userMentions.next(__spreadArray([], __read(_this.mentionedUsers)));
|
|
3300
3573
|
void _this.updateMentionOptions(_this.searchTerm$.getValue());
|
|
3301
3574
|
}));
|
|
3575
|
+
this.autocompleteConfig.mentions = [
|
|
3576
|
+
this.userMentionConfig,
|
|
3577
|
+
this.slashCommandConfig,
|
|
3578
|
+
];
|
|
3302
3579
|
}
|
|
3303
3580
|
AutocompleteTextareaComponent.prototype.ngOnChanges = function (changes) {
|
|
3304
3581
|
if (changes.areMentionsEnabled) {
|
|
3305
3582
|
if (this.areMentionsEnabled) {
|
|
3306
|
-
this.autocompleteConfig.mentions = [
|
|
3583
|
+
this.autocompleteConfig.mentions = [
|
|
3584
|
+
this.userMentionConfig,
|
|
3585
|
+
this.slashCommandConfig,
|
|
3586
|
+
];
|
|
3307
3587
|
this.autocompleteConfig = Object.assign({}, this.autocompleteConfig);
|
|
3308
3588
|
}
|
|
3309
3589
|
else {
|
|
3310
|
-
this.autocompleteConfig.mentions = [];
|
|
3590
|
+
this.autocompleteConfig.mentions = [this.slashCommandConfig];
|
|
3311
3591
|
this.autocompleteConfig = Object.assign({}, this.autocompleteConfig);
|
|
3312
3592
|
}
|
|
3313
3593
|
}
|
|
@@ -3325,7 +3605,9 @@
|
|
|
3325
3605
|
this.mentionedUsers.push((item.user ? item.user : item));
|
|
3326
3606
|
this.userMentions.next(__spreadArray([], __read(this.mentionedUsers)));
|
|
3327
3607
|
}
|
|
3328
|
-
return triggerChar +
|
|
3608
|
+
return (triggerChar +
|
|
3609
|
+
item.autocompleteLabel +
|
|
3610
|
+
(triggerChar === this.commandTriggerChar ? ' ' : ''));
|
|
3329
3611
|
};
|
|
3330
3612
|
AutocompleteTextareaComponent.prototype.autcompleteSearchTermChanged = function (searchTerm) {
|
|
3331
3613
|
if (searchTerm === this.mentionTriggerChar) {
|
|
@@ -3358,8 +3640,8 @@
|
|
|
3358
3640
|
return __awaiter(this, void 0, void 0, function () {
|
|
3359
3641
|
var request, result, items;
|
|
3360
3642
|
var _this = this;
|
|
3361
|
-
return __generator(this, function (
|
|
3362
|
-
switch (
|
|
3643
|
+
return __generator(this, function (_b) {
|
|
3644
|
+
switch (_b.label) {
|
|
3363
3645
|
case 0:
|
|
3364
3646
|
if (!this.areMentionsEnabled) {
|
|
3365
3647
|
return [2 /*return*/];
|
|
@@ -3370,13 +3652,16 @@
|
|
|
3370
3652
|
: function (s) { return _this.channelService.autocompleteMembers(s); };
|
|
3371
3653
|
return [4 /*yield*/, request(searchTerm || '')];
|
|
3372
3654
|
case 1:
|
|
3373
|
-
result =
|
|
3655
|
+
result = _b.sent();
|
|
3374
3656
|
items = this.filter(searchTerm || '', result.map(function (i) {
|
|
3375
3657
|
var user = (i.user ? i.user : i);
|
|
3376
3658
|
return Object.assign(Object.assign({}, i), { autocompleteLabel: user.name || user.id, type: 'mention' });
|
|
3377
3659
|
}));
|
|
3378
3660
|
this.userMentionConfig.items = items;
|
|
3379
|
-
this.autocompleteConfig.mentions = [
|
|
3661
|
+
this.autocompleteConfig.mentions = [
|
|
3662
|
+
this.userMentionConfig,
|
|
3663
|
+
this.slashCommandConfig,
|
|
3664
|
+
];
|
|
3380
3665
|
this.autocompleteConfig = Object.assign({}, this.autocompleteConfig);
|
|
3381
3666
|
return [2 /*return*/];
|
|
3382
3667
|
}
|
|
@@ -3400,7 +3685,7 @@
|
|
|
3400
3685
|
return AutocompleteTextareaComponent;
|
|
3401
3686
|
}());
|
|
3402
3687
|
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 });
|
|
3403
|
-
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", 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>\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:
|
|
3688
|
+
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": i10__namespace.TranslatePipe } });
|
|
3404
3689
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AutocompleteTextareaComponent, decorators: [{
|
|
3405
3690
|
type: i0.Component,
|
|
3406
3691
|
args: [{
|
|
@@ -3416,6 +3701,8 @@
|
|
|
3416
3701
|
type: i0.Input
|
|
3417
3702
|
}], mentionAutocompleteItemTemplate: [{
|
|
3418
3703
|
type: i0.Input
|
|
3704
|
+
}], commandAutocompleteItemTemplate: [{
|
|
3705
|
+
type: i0.Input
|
|
3419
3706
|
}], mentionScope: [{
|
|
3420
3707
|
type: i0.Input
|
|
3421
3708
|
}], valueChange: [{
|
|
@@ -3476,30 +3763,37 @@
|
|
|
3476
3763
|
this.channelService = channelService;
|
|
3477
3764
|
this.chatClientService = chatClientService;
|
|
3478
3765
|
this.imageLoadService = imageLoadService;
|
|
3479
|
-
|
|
3766
|
+
/**
|
|
3767
|
+
* @deprecated https://getstream.io/chat/docs/sdk/angular/components/message_list/#caution-arereactionsenabled-deprecated
|
|
3768
|
+
*/
|
|
3769
|
+
this.areReactionsEnabled = undefined;
|
|
3770
|
+
/**
|
|
3771
|
+
* @deprecated https://getstream.io/chat/docs/sdk/angular/components/message_list/#caution-enabledmessageactions-deprecated
|
|
3772
|
+
*/
|
|
3480
3773
|
/* eslint-disable-next-line @angular-eslint/no-input-rename */
|
|
3481
|
-
this.enabledMessageActionsInput =
|
|
3774
|
+
this.enabledMessageActionsInput = undefined;
|
|
3775
|
+
this.mode = 'main';
|
|
3482
3776
|
this.enabledMessageActions = [];
|
|
3483
3777
|
this.class = 'str-chat-angular__main-panel-inner str-chat-angular__message-list-host';
|
|
3484
3778
|
this.unreadMessageCount = 0;
|
|
3485
3779
|
this.groupStyles = [];
|
|
3486
3780
|
this.authorizedMessageActions = ['flag'];
|
|
3487
3781
|
this.isUserScrolledUpThreshold = 300;
|
|
3488
|
-
this.
|
|
3782
|
+
this.subscriptions = [];
|
|
3783
|
+
this.subscriptions.push(this.channelService.activeChannel$.subscribe(function (channel) {
|
|
3489
3784
|
var _a;
|
|
3490
|
-
_this.
|
|
3491
|
-
_this.hasNewMessages = true;
|
|
3492
|
-
_this.isUserScrolledUp = false;
|
|
3493
|
-
_this.containerHeight = undefined;
|
|
3494
|
-
_this.olderMassagesLoaded = false;
|
|
3495
|
-
_this.oldestMessageDate = undefined;
|
|
3496
|
-
_this.unreadMessageCount = 0;
|
|
3497
|
-
_this.isNewMessageSentByUser = undefined;
|
|
3785
|
+
_this.resetScrollState();
|
|
3498
3786
|
var capabilites = (_a = channel === null || channel === void 0 ? void 0 : channel.data) === null || _a === void 0 ? void 0 : _a.own_capabilities;
|
|
3499
3787
|
if (capabilites) {
|
|
3500
3788
|
_this.canReactToMessage = capabilites.indexOf('send-reaction') !== -1;
|
|
3501
3789
|
_this.canReceiveReadEvents = capabilites.indexOf('read-events') !== -1;
|
|
3502
3790
|
_this.authorizedMessageActions = [];
|
|
3791
|
+
if (_this.canReactToMessage) {
|
|
3792
|
+
_this.authorizedMessageActions.push('send-reaction');
|
|
3793
|
+
}
|
|
3794
|
+
if (_this.canReceiveReadEvents) {
|
|
3795
|
+
_this.authorizedMessageActions.push('read-events');
|
|
3796
|
+
}
|
|
3503
3797
|
if (capabilites.indexOf('flag-message') !== -1) {
|
|
3504
3798
|
_this.authorizedMessageActions.push('flag');
|
|
3505
3799
|
}
|
|
@@ -3517,46 +3811,13 @@
|
|
|
3517
3811
|
_this.authorizedMessageActions.push('delete');
|
|
3518
3812
|
_this.authorizedMessageActions.push('delete-any');
|
|
3519
3813
|
}
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
});
|
|
3523
|
-
this.messages$ = this.channelService.activeChannelMessages$.pipe(operators.tap(function (messages) {
|
|
3524
|
-
var _a, _b, _c, _d, _e;
|
|
3525
|
-
if (messages.length === 0) {
|
|
3526
|
-
return;
|
|
3527
|
-
}
|
|
3528
|
-
var currentLatestMessageDate = messages[messages.length - 1].created_at;
|
|
3529
|
-
if (!_this.latestMessageDate ||
|
|
3530
|
-
((_a = _this.latestMessageDate) === null || _a === void 0 ? void 0 : _a.getTime()) < currentLatestMessageDate.getTime()) {
|
|
3531
|
-
_this.latestMessageDate = currentLatestMessageDate;
|
|
3532
|
-
_this.hasNewMessages = true;
|
|
3533
|
-
_this.isNewMessageSentByUser =
|
|
3534
|
-
((_b = messages[messages.length - 1].user) === null || _b === void 0 ? void 0 : _b.id) ===
|
|
3535
|
-
((_d = (_c = _this.chatClientService.chatClient) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.id);
|
|
3536
|
-
if (_this.isUserScrolledUp) {
|
|
3537
|
-
_this.unreadMessageCount++;
|
|
3814
|
+
if (capabilites.indexOf('send-reply') !== -1) {
|
|
3815
|
+
_this.authorizedMessageActions.push('send-reply');
|
|
3538
3816
|
}
|
|
3817
|
+
_this.setEnabledActions();
|
|
3539
3818
|
}
|
|
3540
|
-
var currentOldestMessageDate = messages[0].created_at;
|
|
3541
|
-
if (!_this.oldestMessageDate) {
|
|
3542
|
-
_this.oldestMessageDate = currentOldestMessageDate;
|
|
3543
|
-
}
|
|
3544
|
-
else if (((_e = _this.oldestMessageDate) === null || _e === void 0 ? void 0 : _e.getTime()) > currentOldestMessageDate.getTime()) {
|
|
3545
|
-
_this.oldestMessageDate = currentOldestMessageDate;
|
|
3546
|
-
_this.olderMassagesLoaded = true;
|
|
3547
|
-
}
|
|
3548
|
-
}), operators.tap(function (messages) {
|
|
3549
|
-
_this.groupStyles = messages.map(function (m, i) { return getGroupStyles(m, messages[i - 1], messages[i + 1]); });
|
|
3550
|
-
}), operators.tap(function (messages) {
|
|
3551
|
-
var _a;
|
|
3552
|
-
return (_this.lastSentMessageId = (_a = __spreadArray([], __read(messages)).reverse()
|
|
3553
|
-
.find(function (m) {
|
|
3554
|
-
var _a, _b, _c;
|
|
3555
|
-
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) &&
|
|
3556
|
-
m.status !== 'sending';
|
|
3557
|
-
})) === null || _a === void 0 ? void 0 : _a.id);
|
|
3558
3819
|
}));
|
|
3559
|
-
this.imageLoadService.imageLoad$.subscribe(function () {
|
|
3820
|
+
this.subscriptions.push(this.imageLoadService.imageLoad$.subscribe(function () {
|
|
3560
3821
|
if (!_this.isUserScrolledUp) {
|
|
3561
3822
|
_this.scrollToBottom();
|
|
3562
3823
|
// Hacky and unreliable workaround to scroll down after loaded images move the scrollbar
|
|
@@ -3564,12 +3825,27 @@
|
|
|
3564
3825
|
_this.scrollToBottom();
|
|
3565
3826
|
}, 300);
|
|
3566
3827
|
}
|
|
3567
|
-
});
|
|
3828
|
+
}));
|
|
3829
|
+
this.subscriptions.push(this.channelService.activeParentMessage$.subscribe(function (message) {
|
|
3830
|
+
if (message &&
|
|
3831
|
+
_this.parentMessage &&
|
|
3832
|
+
message.id !== _this.parentMessage.id &&
|
|
3833
|
+
_this.mode === 'thread') {
|
|
3834
|
+
_this.resetScrollState();
|
|
3835
|
+
}
|
|
3836
|
+
_this.parentMessage = message;
|
|
3837
|
+
}));
|
|
3568
3838
|
}
|
|
3839
|
+
MessageListComponent.prototype.ngOnInit = function () {
|
|
3840
|
+
this.setMessages$();
|
|
3841
|
+
};
|
|
3569
3842
|
MessageListComponent.prototype.ngOnChanges = function (changes) {
|
|
3570
3843
|
if (changes.enabledMessageActionsInput) {
|
|
3571
3844
|
this.setEnabledActions();
|
|
3572
3845
|
}
|
|
3846
|
+
if (changes.mode) {
|
|
3847
|
+
this.setMessages$();
|
|
3848
|
+
}
|
|
3573
3849
|
};
|
|
3574
3850
|
MessageListComponent.prototype.ngAfterViewChecked = function () {
|
|
3575
3851
|
var _this = this;
|
|
@@ -3589,6 +3865,15 @@
|
|
|
3589
3865
|
this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;
|
|
3590
3866
|
this.olderMassagesLoaded = false;
|
|
3591
3867
|
}
|
|
3868
|
+
else if (this.containerHeight !== undefined &&
|
|
3869
|
+
this.containerHeight < this.scrollContainer.nativeElement.scrollHeight &&
|
|
3870
|
+
!this.isUserScrolledUp) {
|
|
3871
|
+
this.scrollToBottom();
|
|
3872
|
+
this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;
|
|
3873
|
+
}
|
|
3874
|
+
};
|
|
3875
|
+
MessageListComponent.prototype.ngOnDestroy = function () {
|
|
3876
|
+
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
3592
3877
|
};
|
|
3593
3878
|
MessageListComponent.prototype.trackByMessageId = function (index, item) {
|
|
3594
3879
|
return item.id;
|
|
@@ -3598,6 +3883,7 @@
|
|
|
3598
3883
|
this.scrollContainer.nativeElement.scrollHeight;
|
|
3599
3884
|
};
|
|
3600
3885
|
MessageListComponent.prototype.scrolled = function () {
|
|
3886
|
+
var _a, _b;
|
|
3601
3887
|
this.isUserScrolledUp =
|
|
3602
3888
|
this.scrollContainer.nativeElement.scrollHeight -
|
|
3603
3889
|
(this.scrollContainer.nativeElement.scrollTop +
|
|
@@ -3606,21 +3892,35 @@
|
|
|
3606
3892
|
if (!this.isUserScrolledUp) {
|
|
3607
3893
|
this.unreadMessageCount = 0;
|
|
3608
3894
|
}
|
|
3609
|
-
if (this.scrollContainer.nativeElement.scrollTop
|
|
3895
|
+
if (this.scrollContainer.nativeElement.scrollTop <=
|
|
3896
|
+
(((_a = this.parentMessageElement) === null || _a === void 0 ? void 0 : _a.nativeElement.clientHeight) || 0) &&
|
|
3897
|
+
(this.prevScrollTop === undefined ||
|
|
3898
|
+
this.prevScrollTop >
|
|
3899
|
+
(((_b = this.parentMessageElement) === null || _b === void 0 ? void 0 : _b.nativeElement.clientHeight) || 0))) {
|
|
3610
3900
|
this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;
|
|
3611
|
-
|
|
3901
|
+
this.mode === 'main'
|
|
3902
|
+
? void this.channelService.loadMoreMessages()
|
|
3903
|
+
: void this.channelService.loadMoreThreadReplies();
|
|
3612
3904
|
}
|
|
3905
|
+
this.prevScrollTop = this.scrollContainer.nativeElement.scrollTop;
|
|
3613
3906
|
};
|
|
3614
3907
|
MessageListComponent.prototype.preserveScrollbarPosition = function () {
|
|
3615
3908
|
this.scrollContainer.nativeElement.scrollTop =
|
|
3616
|
-
this.
|
|
3909
|
+
(this.prevScrollTop || 0) +
|
|
3910
|
+
(this.scrollContainer.nativeElement.scrollHeight - this.containerHeight);
|
|
3617
3911
|
};
|
|
3618
3912
|
MessageListComponent.prototype.setEnabledActions = function () {
|
|
3619
3913
|
var _this = this;
|
|
3620
3914
|
this.enabledMessageActions = [];
|
|
3621
3915
|
if (!this.enabledMessageActionsInput) {
|
|
3916
|
+
this.enabledMessageActions = this.authorizedMessageActions;
|
|
3622
3917
|
return;
|
|
3623
3918
|
}
|
|
3919
|
+
this.enabledMessageActionsInput = __spreadArray(__spreadArray([], __read(this.enabledMessageActionsInput)), [
|
|
3920
|
+
'send-reaction',
|
|
3921
|
+
'read-events',
|
|
3922
|
+
'send-reply',
|
|
3923
|
+
]);
|
|
3624
3924
|
this.enabledMessageActionsInput.forEach(function (action) {
|
|
3625
3925
|
var isAuthorized = _this.authorizedMessageActions.indexOf(action) !== -1;
|
|
3626
3926
|
if (isAuthorized) {
|
|
@@ -3628,10 +3928,62 @@
|
|
|
3628
3928
|
}
|
|
3629
3929
|
});
|
|
3630
3930
|
};
|
|
3931
|
+
MessageListComponent.prototype.setMessages$ = function () {
|
|
3932
|
+
var _this = this;
|
|
3933
|
+
this.messages$ = (this.mode === 'main'
|
|
3934
|
+
? this.channelService.activeChannelMessages$
|
|
3935
|
+
: this.channelService.activeThreadMessages$).pipe(operators.tap(function (messages) {
|
|
3936
|
+
var _a, _b, _c, _d, _e;
|
|
3937
|
+
if (messages.length === 0) {
|
|
3938
|
+
return;
|
|
3939
|
+
}
|
|
3940
|
+
var currentLatestMessageDate = messages[messages.length - 1].created_at;
|
|
3941
|
+
if (!_this.latestMessageDate ||
|
|
3942
|
+
((_a = _this.latestMessageDate) === null || _a === void 0 ? void 0 : _a.getTime()) < currentLatestMessageDate.getTime()) {
|
|
3943
|
+
_this.latestMessageDate = currentLatestMessageDate;
|
|
3944
|
+
_this.hasNewMessages = true;
|
|
3945
|
+
_this.isNewMessageSentByUser =
|
|
3946
|
+
((_b = messages[messages.length - 1].user) === null || _b === void 0 ? void 0 : _b.id) ===
|
|
3947
|
+
((_d = (_c = _this.chatClientService.chatClient) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.id);
|
|
3948
|
+
if (_this.isUserScrolledUp) {
|
|
3949
|
+
_this.unreadMessageCount++;
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
var currentOldestMessageDate = messages[0].created_at;
|
|
3953
|
+
if (!_this.oldestMessageDate) {
|
|
3954
|
+
_this.oldestMessageDate = currentOldestMessageDate;
|
|
3955
|
+
}
|
|
3956
|
+
else if (((_e = _this.oldestMessageDate) === null || _e === void 0 ? void 0 : _e.getTime()) > currentOldestMessageDate.getTime()) {
|
|
3957
|
+
_this.oldestMessageDate = currentOldestMessageDate;
|
|
3958
|
+
_this.olderMassagesLoaded = true;
|
|
3959
|
+
}
|
|
3960
|
+
}), operators.tap(function (messages) {
|
|
3961
|
+
_this.groupStyles = messages.map(function (m, i) { return getGroupStyles(m, messages[i - 1], messages[i + 1]); });
|
|
3962
|
+
}), operators.tap(function (messages) {
|
|
3963
|
+
var _a;
|
|
3964
|
+
return (_this.lastSentMessageId = (_a = __spreadArray([], __read(messages)).reverse()
|
|
3965
|
+
.find(function (m) {
|
|
3966
|
+
var _a, _b, _c;
|
|
3967
|
+
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) &&
|
|
3968
|
+
m.status !== 'sending';
|
|
3969
|
+
})) === null || _a === void 0 ? void 0 : _a.id);
|
|
3970
|
+
}));
|
|
3971
|
+
};
|
|
3972
|
+
MessageListComponent.prototype.resetScrollState = function () {
|
|
3973
|
+
this.latestMessageDate = undefined;
|
|
3974
|
+
this.hasNewMessages = true;
|
|
3975
|
+
this.isUserScrolledUp = false;
|
|
3976
|
+
this.containerHeight = undefined;
|
|
3977
|
+
this.olderMassagesLoaded = false;
|
|
3978
|
+
this.oldestMessageDate = undefined;
|
|
3979
|
+
this.unreadMessageCount = 0;
|
|
3980
|
+
this.prevScrollTop = undefined;
|
|
3981
|
+
this.isNewMessageSentByUser = undefined;
|
|
3982
|
+
};
|
|
3631
3983
|
return MessageListComponent;
|
|
3632
3984
|
}());
|
|
3633
3985
|
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 });
|
|
3634
|
-
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
|
|
3986
|
+
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: i10__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 } });
|
|
3635
3987
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageListComponent, decorators: [{
|
|
3636
3988
|
type: i0.Component,
|
|
3637
3989
|
args: [{
|
|
@@ -3650,12 +4002,55 @@
|
|
|
3650
4002
|
}], enabledMessageActionsInput: [{
|
|
3651
4003
|
type: i0.Input,
|
|
3652
4004
|
args: ['enabledMessageActions']
|
|
4005
|
+
}], mode: [{
|
|
4006
|
+
type: i0.Input
|
|
3653
4007
|
}], class: [{
|
|
3654
4008
|
type: i0.HostBinding,
|
|
3655
4009
|
args: ['class']
|
|
3656
4010
|
}], scrollContainer: [{
|
|
3657
4011
|
type: i0.ViewChild,
|
|
3658
4012
|
args: ['scrollContainer']
|
|
4013
|
+
}], parentMessageElement: [{
|
|
4014
|
+
type: i0.ViewChild,
|
|
4015
|
+
args: ['parentMessageElement']
|
|
4016
|
+
}] } });
|
|
4017
|
+
|
|
4018
|
+
var ThreadComponent = /** @class */ (function () {
|
|
4019
|
+
function ThreadComponent(channelService) {
|
|
4020
|
+
var _this = this;
|
|
4021
|
+
this.channelService = channelService;
|
|
4022
|
+
this.class = 'str-chat__thread';
|
|
4023
|
+
this.subscriptions = [];
|
|
4024
|
+
this.subscriptions.push(this.channelService.activeParentMessage$.subscribe(function (parentMessage) { return (_this.parentMessage = parentMessage); }));
|
|
4025
|
+
}
|
|
4026
|
+
ThreadComponent.prototype.ngOnDestroy = function () {
|
|
4027
|
+
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
4028
|
+
};
|
|
4029
|
+
Object.defineProperty(ThreadComponent.prototype, "replyCountParam", {
|
|
4030
|
+
get: function () {
|
|
4031
|
+
var _a;
|
|
4032
|
+
return { replyCount: (_a = this.parentMessage) === null || _a === void 0 ? void 0 : _a.reply_count };
|
|
4033
|
+
},
|
|
4034
|
+
enumerable: false,
|
|
4035
|
+
configurable: true
|
|
4036
|
+
});
|
|
4037
|
+
ThreadComponent.prototype.closeThread = function () {
|
|
4038
|
+
void this.channelService.setAsActiveParentMessage(undefined);
|
|
4039
|
+
};
|
|
4040
|
+
return ThreadComponent;
|
|
4041
|
+
}());
|
|
4042
|
+
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 });
|
|
4043
|
+
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: i10__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i10__namespace.TranslatePipe } });
|
|
4044
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ThreadComponent, decorators: [{
|
|
4045
|
+
type: i0.Component,
|
|
4046
|
+
args: [{
|
|
4047
|
+
selector: 'stream-thread',
|
|
4048
|
+
templateUrl: './thread.component.html',
|
|
4049
|
+
styles: [],
|
|
4050
|
+
}]
|
|
4051
|
+
}], ctorParameters: function () { return [{ type: ChannelService }]; }, propDecorators: { class: [{
|
|
4052
|
+
type: i0.HostBinding,
|
|
4053
|
+
args: ['class']
|
|
3659
4054
|
}] } });
|
|
3660
4055
|
|
|
3661
4056
|
var StreamAvatarModule = /** @class */ (function () {
|
|
@@ -3664,13 +4059,13 @@
|
|
|
3664
4059
|
return StreamAvatarModule;
|
|
3665
4060
|
}());
|
|
3666
4061
|
StreamAvatarModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3667
|
-
StreamAvatarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, declarations: [AvatarComponent], imports: [
|
|
3668
|
-
StreamAvatarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, imports: [[
|
|
4062
|
+
StreamAvatarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, declarations: [AvatarComponent], imports: [i6.CommonModule, i10.TranslateModule], exports: [AvatarComponent] });
|
|
4063
|
+
StreamAvatarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, imports: [[i6.CommonModule, i10.TranslateModule]] });
|
|
3669
4064
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, decorators: [{
|
|
3670
4065
|
type: i0.NgModule,
|
|
3671
4066
|
args: [{
|
|
3672
4067
|
declarations: [AvatarComponent],
|
|
3673
|
-
imports: [
|
|
4068
|
+
imports: [i6.CommonModule, i10.TranslateModule],
|
|
3674
4069
|
exports: [AvatarComponent],
|
|
3675
4070
|
}]
|
|
3676
4071
|
}] });
|
|
@@ -3697,7 +4092,8 @@
|
|
|
3697
4092
|
NotificationListComponent,
|
|
3698
4093
|
AttachmentPreviewListComponent,
|
|
3699
4094
|
ModalComponent,
|
|
3700
|
-
TextareaDirective
|
|
4095
|
+
TextareaDirective,
|
|
4096
|
+
ThreadComponent], imports: [i6.CommonModule, i10.TranslateModule, StreamAvatarModule], exports: [ChannelComponent,
|
|
3701
4097
|
ChannelHeaderComponent,
|
|
3702
4098
|
ChannelListComponent,
|
|
3703
4099
|
ChannelPreviewComponent,
|
|
@@ -3713,8 +4109,9 @@
|
|
|
3713
4109
|
NotificationListComponent,
|
|
3714
4110
|
AttachmentPreviewListComponent,
|
|
3715
4111
|
ModalComponent,
|
|
3716
|
-
StreamAvatarModule
|
|
3717
|
-
|
|
4112
|
+
StreamAvatarModule,
|
|
4113
|
+
ThreadComponent] });
|
|
4114
|
+
StreamChatModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, imports: [[i6.CommonModule, i10.TranslateModule, StreamAvatarModule], StreamAvatarModule] });
|
|
3718
4115
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, decorators: [{
|
|
3719
4116
|
type: i0.NgModule,
|
|
3720
4117
|
args: [{
|
|
@@ -3736,8 +4133,9 @@
|
|
|
3736
4133
|
AttachmentPreviewListComponent,
|
|
3737
4134
|
ModalComponent,
|
|
3738
4135
|
TextareaDirective,
|
|
4136
|
+
ThreadComponent,
|
|
3739
4137
|
],
|
|
3740
|
-
imports: [
|
|
4138
|
+
imports: [i6.CommonModule, i10.TranslateModule, StreamAvatarModule],
|
|
3741
4139
|
exports: [
|
|
3742
4140
|
ChannelComponent,
|
|
3743
4141
|
ChannelHeaderComponent,
|
|
@@ -3756,6 +4154,7 @@
|
|
|
3756
4154
|
AttachmentPreviewListComponent,
|
|
3757
4155
|
ModalComponent,
|
|
3758
4156
|
StreamAvatarModule,
|
|
4157
|
+
ThreadComponent,
|
|
3759
4158
|
],
|
|
3760
4159
|
}]
|
|
3761
4160
|
}] });
|
|
@@ -3766,18 +4165,18 @@
|
|
|
3766
4165
|
return StreamAutocompleteTextareaModule;
|
|
3767
4166
|
}());
|
|
3768
4167
|
StreamAutocompleteTextareaModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3769
|
-
StreamAutocompleteTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, declarations: [AutocompleteTextareaComponent], imports: [
|
|
4168
|
+
StreamAutocompleteTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, declarations: [AutocompleteTextareaComponent], imports: [i6.CommonModule, i10.TranslateModule, i5.MentionModule, StreamAvatarModule], exports: [AutocompleteTextareaComponent] });
|
|
3770
4169
|
StreamAutocompleteTextareaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, providers: [
|
|
3771
4170
|
{
|
|
3772
4171
|
provide: textareaInjectionToken,
|
|
3773
4172
|
useValue: AutocompleteTextareaComponent,
|
|
3774
4173
|
},
|
|
3775
|
-
], imports: [[
|
|
4174
|
+
], imports: [[i6.CommonModule, i10.TranslateModule, i5.MentionModule, StreamAvatarModule]] });
|
|
3776
4175
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, decorators: [{
|
|
3777
4176
|
type: i0.NgModule,
|
|
3778
4177
|
args: [{
|
|
3779
4178
|
declarations: [AutocompleteTextareaComponent],
|
|
3780
|
-
imports: [
|
|
4179
|
+
imports: [i6.CommonModule, i10.TranslateModule, i5.MentionModule, StreamAvatarModule],
|
|
3781
4180
|
exports: [AutocompleteTextareaComponent],
|
|
3782
4181
|
providers: [
|
|
3783
4182
|
{
|
|
@@ -3794,18 +4193,18 @@
|
|
|
3794
4193
|
return StreamTextareaModule;
|
|
3795
4194
|
}());
|
|
3796
4195
|
StreamTextareaModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3797
|
-
StreamTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, declarations: [TextareaComponent], imports: [
|
|
4196
|
+
StreamTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, declarations: [TextareaComponent], imports: [i6.CommonModule, i10.TranslateModule], exports: [TextareaComponent] });
|
|
3798
4197
|
StreamTextareaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, providers: [
|
|
3799
4198
|
{
|
|
3800
4199
|
provide: textareaInjectionToken,
|
|
3801
4200
|
useValue: TextareaComponent,
|
|
3802
4201
|
},
|
|
3803
|
-
], imports: [[
|
|
4202
|
+
], imports: [[i6.CommonModule, i10.TranslateModule]] });
|
|
3804
4203
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, decorators: [{
|
|
3805
4204
|
type: i0.NgModule,
|
|
3806
4205
|
args: [{
|
|
3807
4206
|
declarations: [TextareaComponent],
|
|
3808
|
-
imports: [
|
|
4207
|
+
imports: [i6.CommonModule, i10.TranslateModule],
|
|
3809
4208
|
exports: [TextareaComponent],
|
|
3810
4209
|
providers: [
|
|
3811
4210
|
{
|
|
@@ -3857,6 +4256,7 @@
|
|
|
3857
4256
|
exports.TextareaComponent = TextareaComponent;
|
|
3858
4257
|
exports.TextareaDirective = TextareaDirective;
|
|
3859
4258
|
exports.ThemeService = ThemeService;
|
|
4259
|
+
exports.ThreadComponent = ThreadComponent;
|
|
3860
4260
|
exports.TransliterationService = TransliterationService;
|
|
3861
4261
|
exports.createMessagePreview = createMessagePreview;
|
|
3862
4262
|
exports.getDeviceWidth = getDeviceWidth;
|