stream-chat-angular 2.8.2 → 2.12.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 +804 -338
- 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 +191 -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 +67 -42
- package/esm2015/lib/message-actions-box/message-actions-box.component.js +20 -9
- 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 +69 -13
- 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 +130 -55
- package/esm2015/lib/message-preview.js +4 -2
- package/esm2015/lib/stream-chat.module.js +8 -3
- package/esm2015/lib/thread/thread.component.js +37 -0
- package/esm2015/lib/types.js +1 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/stream-chat-angular.js +659 -250
- 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 +23 -7
- package/lib/chat-client.service.d.ts +1 -0
- package/lib/icon/icon.component.d.ts +1 -1
- package/lib/message/message.component.d.ts +26 -8
- package/lib/message-actions-box/message-actions-box.component.d.ts +4 -1
- package/lib/message-input/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 +9 -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 -11
- package/public-api.d.ts +1 -0
- package/src/assets/i18n/en.ts +4 -0
- package/src/assets/version.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('stream-chat'), require('rxjs/operators'), require('uuid'), require('@ngx-translate/core'), require('@angular/common'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('stream-chat-angular', ['exports', '@angular/core', 'rxjs', 'stream-chat', 'rxjs/operators', 'uuid', '@ngx-translate/core', '@angular/common', 'dayjs', 'dayjs/plugin/calendar', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['stream-chat-angular'] = {}, global.ng.core, global.rxjs, global.streamChat, global.rxjs.operators, global.uuid, global.
|
|
5
|
-
}(this, (function (exports, i0, rxjs, streamChat, operators, uuid,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('stream-chat'), require('rxjs/operators'), require('uuid'), require('@ngx-translate/core'), require('@angular/common'), require('pretty-bytes'), require('dayjs'), require('dayjs/plugin/calendar'), require('@stream-io/transliterate'), require('angular-mentions')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('stream-chat-angular', ['exports', '@angular/core', 'rxjs', 'stream-chat', 'rxjs/operators', 'uuid', '@ngx-translate/core', '@angular/common', 'pretty-bytes', 'dayjs', 'dayjs/plugin/calendar', '@stream-io/transliterate', 'angular-mentions'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['stream-chat-angular'] = {}, global.ng.core, global.rxjs, global.streamChat, global.rxjs.operators, global.uuid, global.i1, global.ng.common, global.prettybytes, global.Dayjs, global.calendar, global.transliterate, global.i5));
|
|
5
|
+
}(this, (function (exports, i0, rxjs, streamChat, operators, uuid, i1, i6, prettybytes, Dayjs, calendar, transliterate, i5) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
30
|
-
var
|
|
31
|
-
var
|
|
30
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
31
|
+
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
32
|
+
var prettybytes__default = /*#__PURE__*/_interopDefaultLegacy(prettybytes);
|
|
32
33
|
var Dayjs__default = /*#__PURE__*/_interopDefaultLegacy(Dayjs);
|
|
33
34
|
var calendar__default = /*#__PURE__*/_interopDefaultLegacy(calendar);
|
|
34
|
-
var prettybytes__default = /*#__PURE__*/_interopDefaultLegacy(prettybytes);
|
|
35
35
|
var transliterate__default = /*#__PURE__*/_interopDefaultLegacy(transliterate);
|
|
36
36
|
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
37
37
|
|
|
@@ -353,7 +353,7 @@
|
|
|
353
353
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
-
var version = '2.
|
|
356
|
+
var version = '2.12.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,11 @@
|
|
|
529
541
|
}]
|
|
530
542
|
}], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: NotificationService }]; } });
|
|
531
543
|
|
|
532
|
-
var createMessagePreview = function (user, text, attachments, mentionedUsers) {
|
|
544
|
+
var createMessagePreview = function (user, text, attachments, mentionedUsers, parentId, quotedMessageId) {
|
|
545
|
+
if (attachments === void 0) { attachments = []; }
|
|
546
|
+
if (mentionedUsers === void 0) { mentionedUsers = []; }
|
|
547
|
+
if (parentId === void 0) { parentId = undefined; }
|
|
548
|
+
if (quotedMessageId === void 0) { quotedMessageId = undefined; }
|
|
533
549
|
var clientSideId = user.id + "-" + uuid.v4();
|
|
534
550
|
return {
|
|
535
551
|
__html: text,
|
|
@@ -543,6 +559,8 @@
|
|
|
543
559
|
user: user,
|
|
544
560
|
attachments: attachments,
|
|
545
561
|
mentioned_users: mentionedUsers,
|
|
562
|
+
parent_id: parentId,
|
|
563
|
+
quoted_message_id: quotedMessageId,
|
|
546
564
|
};
|
|
547
565
|
};
|
|
548
566
|
|
|
@@ -569,31 +587,53 @@
|
|
|
569
587
|
this.activeChannelMessagesSubject = new rxjs.BehaviorSubject([]);
|
|
570
588
|
this.hasMoreChannelsSubject = new rxjs.ReplaySubject(1);
|
|
571
589
|
this.activeChannelSubscriptions = [];
|
|
590
|
+
this.activeParentMessageIdSubject = new rxjs.BehaviorSubject(undefined);
|
|
591
|
+
this.activeThreadMessagesSubject = new rxjs.BehaviorSubject([]);
|
|
592
|
+
this.messagePageSize = 25;
|
|
593
|
+
this.messageToQuoteSubject = new rxjs.BehaviorSubject(undefined);
|
|
572
594
|
this.channelListSetter = function (channels) {
|
|
573
595
|
_this.channelsSubject.next(channels);
|
|
574
596
|
};
|
|
575
597
|
this.messageListSetter = function (messages) {
|
|
576
598
|
_this.activeChannelMessagesSubject.next(messages);
|
|
577
599
|
};
|
|
600
|
+
this.threadListSetter = function (messages) {
|
|
601
|
+
_this.activeThreadMessagesSubject.next(messages);
|
|
602
|
+
};
|
|
603
|
+
this.parentMessageSetter = function (message) {
|
|
604
|
+
_this.activeParentMessageIdSubject.next(message === null || message === void 0 ? void 0 : message.id);
|
|
605
|
+
};
|
|
578
606
|
this.channels$ = this.channelsSubject.asObservable();
|
|
579
607
|
this.activeChannel$ = this.activeChannelSubject.asObservable();
|
|
580
608
|
this.activeChannelMessages$ = this.activeChannelMessagesSubject.pipe(operators.map(function (messages) {
|
|
581
609
|
var channel = _this.activeChannelSubject.getValue();
|
|
582
|
-
return messages.map(function (message) {
|
|
583
|
-
if (_this.isStreamMessage(message) &&
|
|
584
|
-
_this.isFormatMessageResponse(message)) {
|
|
585
|
-
return message;
|
|
586
|
-
}
|
|
587
|
-
else if (_this.isFormatMessageResponse(message)) {
|
|
588
|
-
return Object.assign(Object.assign({}, message), { readBy: getReadBy(message, channel) });
|
|
589
|
-
}
|
|
590
|
-
else {
|
|
591
|
-
var formatMessage = _this.formatMessage(message);
|
|
592
|
-
return Object.assign(Object.assign({}, formatMessage), { readBy: getReadBy(formatMessage, channel) });
|
|
593
|
-
}
|
|
594
|
-
});
|
|
610
|
+
return messages.map(function (message) { return _this.transformToStreamMessage(message, channel); });
|
|
595
611
|
}));
|
|
596
612
|
this.hasMoreChannels$ = this.hasMoreChannelsSubject.asObservable();
|
|
613
|
+
this.activeParentMessageId$ =
|
|
614
|
+
this.activeParentMessageIdSubject.asObservable();
|
|
615
|
+
this.activeThreadMessages$ = this.activeThreadMessagesSubject.pipe(operators.map(function (messages) {
|
|
616
|
+
var channel = _this.activeChannelSubject.getValue();
|
|
617
|
+
return messages.map(function (message) { return _this.transformToStreamMessage(message, channel); });
|
|
618
|
+
}));
|
|
619
|
+
this.activeParentMessage$ = rxjs.combineLatest([
|
|
620
|
+
this.activeChannelMessages$,
|
|
621
|
+
this.activeParentMessageId$,
|
|
622
|
+
]).pipe(operators.map(function (_f) {
|
|
623
|
+
var _g = __read(_f, 2), messages = _g[0], parentMessageId = _g[1];
|
|
624
|
+
if (!parentMessageId) {
|
|
625
|
+
return undefined;
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
return messages.find(function (m) { return m.id === parentMessageId; });
|
|
629
|
+
}
|
|
630
|
+
}), operators.shareReplay());
|
|
631
|
+
this.messageToQuote$ = this.messageToQuoteSubject.asObservable();
|
|
632
|
+
this.chatClientService.connectionState$
|
|
633
|
+
.pipe(operators.filter(function (s) { return s === 'online'; }))
|
|
634
|
+
.subscribe(function () {
|
|
635
|
+
void _this.setAsActiveParentMessage(undefined);
|
|
636
|
+
});
|
|
597
637
|
}
|
|
598
638
|
ChannelService.prototype.setAsActiveChannel = function (channel) {
|
|
599
639
|
var prevActiveChannel = this.activeChannelSubject.getValue();
|
|
@@ -607,25 +647,59 @@
|
|
|
607
647
|
void channel.markRead();
|
|
608
648
|
}
|
|
609
649
|
this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
650
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
651
|
+
this.activeThreadMessagesSubject.next([]);
|
|
652
|
+
this.messageToQuoteSubject.next(undefined);
|
|
653
|
+
};
|
|
654
|
+
ChannelService.prototype.setAsActiveParentMessage = function (message) {
|
|
655
|
+
var _a;
|
|
656
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
657
|
+
var messageToQuote, activeChannel, result;
|
|
658
|
+
return __generator(this, function (_f) {
|
|
659
|
+
switch (_f.label) {
|
|
660
|
+
case 0:
|
|
661
|
+
messageToQuote = this.messageToQuoteSubject.getValue();
|
|
662
|
+
if (messageToQuote && !!messageToQuote.parent_id) {
|
|
663
|
+
this.messageToQuoteSubject.next(undefined);
|
|
664
|
+
}
|
|
665
|
+
if (!!message) return [3 /*break*/, 1];
|
|
666
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
667
|
+
this.activeThreadMessagesSubject.next([]);
|
|
668
|
+
return [3 /*break*/, 3];
|
|
669
|
+
case 1:
|
|
670
|
+
this.activeParentMessageIdSubject.next(message.id);
|
|
671
|
+
activeChannel = this.activeChannelSubject.getValue();
|
|
672
|
+
return [4 /*yield*/, (activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.getReplies(message.id, {
|
|
673
|
+
limit: (_a = this.options) === null || _a === void 0 ? void 0 : _a.message_limit,
|
|
674
|
+
}))];
|
|
675
|
+
case 2:
|
|
676
|
+
result = _f.sent();
|
|
677
|
+
this.activeThreadMessagesSubject.next((result === null || result === void 0 ? void 0 : result.messages) || []);
|
|
678
|
+
_f.label = 3;
|
|
679
|
+
case 3: return [2 /*return*/];
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
});
|
|
610
683
|
};
|
|
684
|
+
// load more thread replies
|
|
611
685
|
ChannelService.prototype.loadMoreMessages = function () {
|
|
612
|
-
var _a, _b, _c, _d;
|
|
686
|
+
var _a, _b, _c, _d, _e;
|
|
613
687
|
return __awaiter(this, void 0, void 0, function () {
|
|
614
688
|
var activeChnannel, lastMessageId;
|
|
615
|
-
return __generator(this, function (
|
|
616
|
-
switch (
|
|
689
|
+
return __generator(this, function (_f) {
|
|
690
|
+
switch (_f.label) {
|
|
617
691
|
case 0:
|
|
618
692
|
activeChnannel = this.activeChannelSubject.getValue();
|
|
619
693
|
lastMessageId = (_a = this.activeChannelMessagesSubject.getValue()[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
620
694
|
return [4 /*yield*/, (activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.query({
|
|
621
|
-
messages: { limit:
|
|
695
|
+
messages: { limit: (_b = this.options) === null || _b === void 0 ? void 0 : _b.message_limit, id_lt: lastMessageId },
|
|
622
696
|
members: { limit: 0 },
|
|
623
697
|
watchers: { limit: 0 },
|
|
624
698
|
}))];
|
|
625
699
|
case 1:
|
|
626
|
-
|
|
627
|
-
if (((
|
|
628
|
-
((
|
|
700
|
+
_f.sent();
|
|
701
|
+
if (((_c = activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.data) === null || _c === void 0 ? void 0 : _c.id) ===
|
|
702
|
+
((_e = (_d = this.activeChannelSubject.getValue()) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.id)) {
|
|
629
703
|
this.activeChannelMessagesSubject.next(__spreadArray([], __read(activeChnannel.state.messages)));
|
|
630
704
|
}
|
|
631
705
|
return [2 /*return*/];
|
|
@@ -633,11 +707,36 @@
|
|
|
633
707
|
});
|
|
634
708
|
});
|
|
635
709
|
};
|
|
710
|
+
ChannelService.prototype.loadMoreThreadReplies = function () {
|
|
711
|
+
var _a, _b;
|
|
712
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
713
|
+
var activeChnannel, parentMessageId, lastMessageId;
|
|
714
|
+
return __generator(this, function (_f) {
|
|
715
|
+
switch (_f.label) {
|
|
716
|
+
case 0:
|
|
717
|
+
activeChnannel = this.activeChannelSubject.getValue();
|
|
718
|
+
parentMessageId = this.activeParentMessageIdSubject.getValue();
|
|
719
|
+
if (!parentMessageId) {
|
|
720
|
+
return [2 /*return*/];
|
|
721
|
+
}
|
|
722
|
+
lastMessageId = (_a = this.activeThreadMessagesSubject.getValue()[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
723
|
+
return [4 /*yield*/, (activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.getReplies(parentMessageId, {
|
|
724
|
+
limit: (_b = this.options) === null || _b === void 0 ? void 0 : _b.message_limit,
|
|
725
|
+
id_lt: lastMessageId,
|
|
726
|
+
}))];
|
|
727
|
+
case 1:
|
|
728
|
+
_f.sent();
|
|
729
|
+
this.activeThreadMessagesSubject.next((activeChnannel === null || activeChnannel === void 0 ? void 0 : activeChnannel.state.threads[parentMessageId]) || []);
|
|
730
|
+
return [2 /*return*/];
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
});
|
|
734
|
+
};
|
|
636
735
|
ChannelService.prototype.init = function (filters, sort, options) {
|
|
637
736
|
return __awaiter(this, void 0, void 0, function () {
|
|
638
737
|
var _this = this;
|
|
639
|
-
return __generator(this, function (
|
|
640
|
-
switch (
|
|
738
|
+
return __generator(this, function (_f) {
|
|
739
|
+
switch (_f.label) {
|
|
641
740
|
case 0:
|
|
642
741
|
this.filters = filters;
|
|
643
742
|
this.options = options || {
|
|
@@ -646,27 +745,35 @@
|
|
|
646
745
|
state: true,
|
|
647
746
|
presence: true,
|
|
648
747
|
watch: true,
|
|
649
|
-
message_limit:
|
|
748
|
+
message_limit: this.messagePageSize,
|
|
650
749
|
};
|
|
651
750
|
this.sort = sort || { last_message_at: -1, updated_at: -1 };
|
|
652
751
|
return [4 /*yield*/, this.queryChannels()];
|
|
653
752
|
case 1:
|
|
654
|
-
|
|
753
|
+
_f.sent();
|
|
655
754
|
this.chatClientService.notification$.subscribe(function (notification) { return void _this.handleNotification(notification); });
|
|
656
755
|
return [2 /*return*/];
|
|
657
756
|
}
|
|
658
757
|
});
|
|
659
758
|
});
|
|
660
759
|
};
|
|
760
|
+
ChannelService.prototype.reset = function () {
|
|
761
|
+
this.activeChannelMessagesSubject.next([]);
|
|
762
|
+
this.activeChannelSubject.next(undefined);
|
|
763
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
764
|
+
this.activeThreadMessagesSubject.next([]);
|
|
765
|
+
this.channelsSubject.next(undefined);
|
|
766
|
+
this.selectMessageToQuote(undefined);
|
|
767
|
+
};
|
|
661
768
|
ChannelService.prototype.loadMoreChannels = function () {
|
|
662
769
|
return __awaiter(this, void 0, void 0, function () {
|
|
663
|
-
return __generator(this, function (
|
|
664
|
-
switch (
|
|
770
|
+
return __generator(this, function (_f) {
|
|
771
|
+
switch (_f.label) {
|
|
665
772
|
case 0:
|
|
666
773
|
this.options.offset = this.channels.length;
|
|
667
774
|
return [4 /*yield*/, this.queryChannels()];
|
|
668
775
|
case 1:
|
|
669
|
-
|
|
776
|
+
_f.sent();
|
|
670
777
|
return [2 /*return*/];
|
|
671
778
|
}
|
|
672
779
|
});
|
|
@@ -675,13 +782,13 @@
|
|
|
675
782
|
ChannelService.prototype.addReaction = function (messageId, reactionType) {
|
|
676
783
|
var _a;
|
|
677
784
|
return __awaiter(this, void 0, void 0, function () {
|
|
678
|
-
return __generator(this, function (
|
|
679
|
-
switch (
|
|
785
|
+
return __generator(this, function (_f) {
|
|
786
|
+
switch (_f.label) {
|
|
680
787
|
case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject.getValue()) === null || _a === void 0 ? void 0 : _a.sendReaction(messageId, {
|
|
681
788
|
type: reactionType,
|
|
682
789
|
}))];
|
|
683
790
|
case 1:
|
|
684
|
-
|
|
791
|
+
_f.sent();
|
|
685
792
|
return [2 /*return*/];
|
|
686
793
|
}
|
|
687
794
|
});
|
|
@@ -690,32 +797,34 @@
|
|
|
690
797
|
ChannelService.prototype.removeReaction = function (messageId, reactionType) {
|
|
691
798
|
var _a;
|
|
692
799
|
return __awaiter(this, void 0, void 0, function () {
|
|
693
|
-
return __generator(this, function (
|
|
694
|
-
switch (
|
|
800
|
+
return __generator(this, function (_f) {
|
|
801
|
+
switch (_f.label) {
|
|
695
802
|
case 0: return [4 /*yield*/, ((_a = this.activeChannelSubject
|
|
696
803
|
.getValue()) === null || _a === void 0 ? void 0 : _a.deleteReaction(messageId, reactionType))];
|
|
697
804
|
case 1:
|
|
698
|
-
|
|
805
|
+
_f.sent();
|
|
699
806
|
return [2 /*return*/];
|
|
700
807
|
}
|
|
701
808
|
});
|
|
702
809
|
});
|
|
703
810
|
};
|
|
704
|
-
ChannelService.prototype.sendMessage = function (text, attachments, mentionedUsers) {
|
|
811
|
+
ChannelService.prototype.sendMessage = function (text, attachments, mentionedUsers, parentId, quotedMessageId) {
|
|
705
812
|
if (attachments === void 0) { attachments = []; }
|
|
706
813
|
if (mentionedUsers === void 0) { mentionedUsers = []; }
|
|
814
|
+
if (parentId === void 0) { parentId = undefined; }
|
|
815
|
+
if (quotedMessageId === void 0) { quotedMessageId = undefined; }
|
|
707
816
|
return __awaiter(this, void 0, void 0, function () {
|
|
708
817
|
var preview, channel;
|
|
709
|
-
return __generator(this, function (
|
|
710
|
-
switch (
|
|
818
|
+
return __generator(this, function (_f) {
|
|
819
|
+
switch (_f.label) {
|
|
711
820
|
case 0:
|
|
712
|
-
preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers);
|
|
821
|
+
preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers, parentId, quotedMessageId);
|
|
713
822
|
channel = this.activeChannelSubject.getValue();
|
|
714
823
|
preview.readBy = [];
|
|
715
824
|
channel.state.addMessageSorted(preview, true);
|
|
716
825
|
return [4 /*yield*/, this.sendMessageRequest(preview)];
|
|
717
826
|
case 1:
|
|
718
|
-
|
|
827
|
+
_f.sent();
|
|
719
828
|
return [2 /*return*/];
|
|
720
829
|
}
|
|
721
830
|
});
|
|
@@ -724,14 +833,14 @@
|
|
|
724
833
|
ChannelService.prototype.resendMessage = function (message) {
|
|
725
834
|
return __awaiter(this, void 0, void 0, function () {
|
|
726
835
|
var channel;
|
|
727
|
-
return __generator(this, function (
|
|
728
|
-
switch (
|
|
836
|
+
return __generator(this, function (_f) {
|
|
837
|
+
switch (_f.label) {
|
|
729
838
|
case 0:
|
|
730
839
|
channel = this.activeChannelSubject.getValue();
|
|
731
840
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, message), { errorStatusCode: undefined, status: 'sending' }), true);
|
|
732
841
|
return [4 /*yield*/, this.sendMessageRequest(message)];
|
|
733
842
|
case 1:
|
|
734
|
-
|
|
843
|
+
_f.sent();
|
|
735
844
|
return [2 /*return*/];
|
|
736
845
|
}
|
|
737
846
|
});
|
|
@@ -739,11 +848,11 @@
|
|
|
739
848
|
};
|
|
740
849
|
ChannelService.prototype.updateMessage = function (message) {
|
|
741
850
|
return __awaiter(this, void 0, void 0, function () {
|
|
742
|
-
return __generator(this, function (
|
|
743
|
-
switch (
|
|
851
|
+
return __generator(this, function (_f) {
|
|
852
|
+
switch (_f.label) {
|
|
744
853
|
case 0: return [4 /*yield*/, this.chatClientService.chatClient.updateMessage(message)];
|
|
745
854
|
case 1:
|
|
746
|
-
|
|
855
|
+
_f.sent();
|
|
747
856
|
return [2 /*return*/];
|
|
748
857
|
}
|
|
749
858
|
});
|
|
@@ -751,11 +860,11 @@
|
|
|
751
860
|
};
|
|
752
861
|
ChannelService.prototype.deleteMessage = function (message) {
|
|
753
862
|
return __awaiter(this, void 0, void 0, function () {
|
|
754
|
-
return __generator(this, function (
|
|
755
|
-
switch (
|
|
863
|
+
return __generator(this, function (_f) {
|
|
864
|
+
switch (_f.label) {
|
|
756
865
|
case 0: return [4 /*yield*/, this.chatClientService.chatClient.deleteMessage(message.id)];
|
|
757
866
|
case 1:
|
|
758
|
-
|
|
867
|
+
_f.sent();
|
|
759
868
|
return [2 /*return*/];
|
|
760
869
|
}
|
|
761
870
|
});
|
|
@@ -764,8 +873,8 @@
|
|
|
764
873
|
ChannelService.prototype.uploadAttachments = function (uploads) {
|
|
765
874
|
return __awaiter(this, void 0, void 0, function () {
|
|
766
875
|
var result, channel, uploadResults;
|
|
767
|
-
return __generator(this, function (
|
|
768
|
-
switch (
|
|
876
|
+
return __generator(this, function (_f) {
|
|
877
|
+
switch (_f.label) {
|
|
769
878
|
case 0:
|
|
770
879
|
result = [];
|
|
771
880
|
channel = this.activeChannelSubject.getValue();
|
|
@@ -773,7 +882,7 @@
|
|
|
773
882
|
? channel.sendImage(upload.file)
|
|
774
883
|
: channel.sendFile(upload.file); }))];
|
|
775
884
|
case 1:
|
|
776
|
-
uploadResults =
|
|
885
|
+
uploadResults = _f.sent();
|
|
777
886
|
uploadResults.forEach(function (uploadResult, i) {
|
|
778
887
|
var file = uploads[i].file;
|
|
779
888
|
var type = uploads[i].type;
|
|
@@ -797,15 +906,15 @@
|
|
|
797
906
|
ChannelService.prototype.deleteAttachment = function (attachmentUpload) {
|
|
798
907
|
return __awaiter(this, void 0, void 0, function () {
|
|
799
908
|
var channel;
|
|
800
|
-
return __generator(this, function (
|
|
801
|
-
switch (
|
|
909
|
+
return __generator(this, function (_f) {
|
|
910
|
+
switch (_f.label) {
|
|
802
911
|
case 0:
|
|
803
912
|
channel = this.activeChannelSubject.getValue();
|
|
804
913
|
return [4 /*yield*/, (attachmentUpload.type === 'image'
|
|
805
914
|
? channel.deleteImage(attachmentUpload.url)
|
|
806
915
|
: channel.deleteFile(attachmentUpload.url))];
|
|
807
916
|
case 1:
|
|
808
|
-
|
|
917
|
+
_f.sent();
|
|
809
918
|
return [2 /*return*/];
|
|
810
919
|
}
|
|
811
920
|
});
|
|
@@ -815,8 +924,8 @@
|
|
|
815
924
|
return __awaiter(this, void 0, void 0, function () {
|
|
816
925
|
var activeChannel, result;
|
|
817
926
|
var _this = this;
|
|
818
|
-
return __generator(this, function (
|
|
819
|
-
switch (
|
|
927
|
+
return __generator(this, function (_f) {
|
|
928
|
+
switch (_f.label) {
|
|
820
929
|
case 0:
|
|
821
930
|
activeChannel = this.activeChannelSubject.getValue();
|
|
822
931
|
if (!activeChannel) {
|
|
@@ -833,41 +942,92 @@
|
|
|
833
942
|
id: { $ne: this.chatClientService.chatClient.userID },
|
|
834
943
|
})];
|
|
835
944
|
case 2:
|
|
836
|
-
result =
|
|
945
|
+
result = _f.sent();
|
|
837
946
|
return [2 /*return*/, Object.values(result.members)];
|
|
838
947
|
}
|
|
839
948
|
});
|
|
840
949
|
});
|
|
841
950
|
};
|
|
951
|
+
ChannelService.prototype.sendAction = function (messageId, formData) {
|
|
952
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
953
|
+
var channel, response, isThreadReply;
|
|
954
|
+
return __generator(this, function (_f) {
|
|
955
|
+
switch (_f.label) {
|
|
956
|
+
case 0:
|
|
957
|
+
channel = this.activeChannelSubject.getValue();
|
|
958
|
+
return [4 /*yield*/, channel.sendAction(messageId, formData)];
|
|
959
|
+
case 1:
|
|
960
|
+
response = _f.sent();
|
|
961
|
+
if (response === null || response === void 0 ? void 0 : response.message) {
|
|
962
|
+
channel.state.addMessageSorted(Object.assign(Object.assign({}, response.message), { status: 'received' }));
|
|
963
|
+
isThreadReply = !!response.message.parent_id;
|
|
964
|
+
isThreadReply
|
|
965
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[response.message.parent_id])))
|
|
966
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
967
|
+
}
|
|
968
|
+
else {
|
|
969
|
+
channel.state.removeMessage({ id: messageId });
|
|
970
|
+
if (this.activeChannelMessagesSubject
|
|
971
|
+
.getValue()
|
|
972
|
+
.find(function (m) { return m.id === messageId; })) {
|
|
973
|
+
this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
974
|
+
}
|
|
975
|
+
else if (this.activeThreadMessagesSubject
|
|
976
|
+
.getValue()
|
|
977
|
+
.find(function (m) { return m.id === messageId; })) {
|
|
978
|
+
this.activeThreadMessagesSubject.next(channel.state.threads[this.activeParentMessageIdSubject.getValue()]);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
return [2 /*return*/];
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
});
|
|
985
|
+
};
|
|
986
|
+
ChannelService.prototype.selectMessageToQuote = function (message) {
|
|
987
|
+
this.messageToQuoteSubject.next(message);
|
|
988
|
+
};
|
|
842
989
|
ChannelService.prototype.sendMessageRequest = function (preview) {
|
|
843
990
|
var _a;
|
|
844
991
|
return __awaiter(this, void 0, void 0, function () {
|
|
845
|
-
var channel, error_1, stringError, parsedError;
|
|
846
|
-
return __generator(this, function (
|
|
847
|
-
switch (
|
|
992
|
+
var channel, isThreadReply, response, error_1, stringError, parsedError;
|
|
993
|
+
return __generator(this, function (_f) {
|
|
994
|
+
switch (_f.label) {
|
|
848
995
|
case 0:
|
|
849
996
|
channel = this.activeChannelSubject.getValue();
|
|
850
|
-
|
|
851
|
-
|
|
997
|
+
isThreadReply = !!preview.parent_id;
|
|
998
|
+
isThreadReply
|
|
999
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
1000
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
1001
|
+
_f.label = 1;
|
|
852
1002
|
case 1:
|
|
853
|
-
|
|
1003
|
+
_f.trys.push([1, 3, , 4]);
|
|
854
1004
|
return [4 /*yield*/, channel.sendMessage({
|
|
855
1005
|
text: preview.text,
|
|
856
1006
|
attachments: preview.attachments,
|
|
857
1007
|
mentioned_users: (_a = preview.mentioned_users) === null || _a === void 0 ? void 0 : _a.map(function (u) { return u.id; }),
|
|
858
1008
|
id: preview.id,
|
|
1009
|
+
parent_id: preview.parent_id,
|
|
1010
|
+
quoted_message_id: preview.quoted_message_id,
|
|
859
1011
|
})];
|
|
860
1012
|
case 2:
|
|
861
|
-
|
|
1013
|
+
response = _f.sent();
|
|
1014
|
+
if (response === null || response === void 0 ? void 0 : response.message) {
|
|
1015
|
+
channel.state.addMessageSorted(Object.assign(Object.assign({}, response.message), { status: 'received' }), true);
|
|
1016
|
+
isThreadReply
|
|
1017
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
1018
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
1019
|
+
}
|
|
862
1020
|
return [3 /*break*/, 4];
|
|
863
1021
|
case 3:
|
|
864
|
-
error_1 =
|
|
1022
|
+
error_1 = _f.sent();
|
|
865
1023
|
stringError = JSON.stringify(error_1);
|
|
866
1024
|
parsedError = stringError
|
|
867
1025
|
? JSON.parse(stringError)
|
|
868
1026
|
: {};
|
|
869
1027
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, preview), { errorStatusCode: parsedError.status || undefined, status: 'failed' }), true);
|
|
870
|
-
|
|
1028
|
+
isThreadReply
|
|
1029
|
+
? this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[preview.parent_id])))
|
|
1030
|
+
: this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
871
1031
|
return [3 /*break*/, 4];
|
|
872
1032
|
case 4: return [2 /*return*/];
|
|
873
1033
|
}
|
|
@@ -876,53 +1036,53 @@
|
|
|
876
1036
|
};
|
|
877
1037
|
ChannelService.prototype.handleNotification = function (notification) {
|
|
878
1038
|
return __awaiter(this, void 0, void 0, function () {
|
|
879
|
-
var
|
|
1039
|
+
var _f;
|
|
880
1040
|
var _this = this;
|
|
881
|
-
return __generator(this, function (
|
|
882
|
-
switch (
|
|
1041
|
+
return __generator(this, function (_g) {
|
|
1042
|
+
switch (_g.label) {
|
|
883
1043
|
case 0:
|
|
884
|
-
|
|
885
|
-
switch (
|
|
1044
|
+
_f = notification.eventType;
|
|
1045
|
+
switch (_f) {
|
|
886
1046
|
case 'notification.message_new': return [3 /*break*/, 1];
|
|
887
1047
|
case 'notification.added_to_channel': return [3 /*break*/, 3];
|
|
888
1048
|
case 'notification.removed_from_channel': return [3 /*break*/, 5];
|
|
889
1049
|
}
|
|
890
1050
|
return [3 /*break*/, 6];
|
|
891
1051
|
case 1: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
892
|
-
return __generator(this, function (
|
|
893
|
-
switch (
|
|
1052
|
+
return __generator(this, function (_f) {
|
|
1053
|
+
switch (_f.label) {
|
|
894
1054
|
case 0:
|
|
895
1055
|
if (!this.customNewMessageNotificationHandler) return [3 /*break*/, 1];
|
|
896
1056
|
this.customNewMessageNotificationHandler(notification, this.channelListSetter);
|
|
897
1057
|
return [3 /*break*/, 3];
|
|
898
1058
|
case 1: return [4 /*yield*/, this.handleNewMessageNotification(notification)];
|
|
899
1059
|
case 2:
|
|
900
|
-
|
|
901
|
-
|
|
1060
|
+
_f.sent();
|
|
1061
|
+
_f.label = 3;
|
|
902
1062
|
case 3: return [2 /*return*/];
|
|
903
1063
|
}
|
|
904
1064
|
});
|
|
905
1065
|
}); })];
|
|
906
1066
|
case 2:
|
|
907
|
-
|
|
1067
|
+
_g.sent();
|
|
908
1068
|
return [3 /*break*/, 6];
|
|
909
1069
|
case 3: return [4 /*yield*/, this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
910
|
-
return __generator(this, function (
|
|
911
|
-
switch (
|
|
1070
|
+
return __generator(this, function (_f) {
|
|
1071
|
+
switch (_f.label) {
|
|
912
1072
|
case 0:
|
|
913
1073
|
if (!this.customAddedToChannelNotificationHandler) return [3 /*break*/, 1];
|
|
914
1074
|
this.customAddedToChannelNotificationHandler(notification, this.channelListSetter);
|
|
915
1075
|
return [3 /*break*/, 3];
|
|
916
1076
|
case 1: return [4 /*yield*/, this.handleAddedToChannelNotification(notification)];
|
|
917
1077
|
case 2:
|
|
918
|
-
|
|
919
|
-
|
|
1078
|
+
_f.sent();
|
|
1079
|
+
_f.label = 3;
|
|
920
1080
|
case 3: return [2 /*return*/];
|
|
921
1081
|
}
|
|
922
1082
|
});
|
|
923
1083
|
}); })];
|
|
924
1084
|
case 4:
|
|
925
|
-
|
|
1085
|
+
_g.sent();
|
|
926
1086
|
return [3 /*break*/, 6];
|
|
927
1087
|
case 5:
|
|
928
1088
|
{
|
|
@@ -935,7 +1095,7 @@
|
|
|
935
1095
|
}
|
|
936
1096
|
});
|
|
937
1097
|
}
|
|
938
|
-
|
|
1098
|
+
_g.label = 6;
|
|
939
1099
|
case 6: return [2 /*return*/];
|
|
940
1100
|
}
|
|
941
1101
|
});
|
|
@@ -947,11 +1107,11 @@
|
|
|
947
1107
|
};
|
|
948
1108
|
ChannelService.prototype.handleNewMessageNotification = function (notification) {
|
|
949
1109
|
return __awaiter(this, void 0, void 0, function () {
|
|
950
|
-
return __generator(this, function (
|
|
951
|
-
switch (
|
|
1110
|
+
return __generator(this, function (_f) {
|
|
1111
|
+
switch (_f.label) {
|
|
952
1112
|
case 0: return [4 /*yield*/, this.addChannelFromNotification(notification)];
|
|
953
1113
|
case 1:
|
|
954
|
-
|
|
1114
|
+
_f.sent();
|
|
955
1115
|
return [2 /*return*/];
|
|
956
1116
|
}
|
|
957
1117
|
});
|
|
@@ -959,11 +1119,11 @@
|
|
|
959
1119
|
};
|
|
960
1120
|
ChannelService.prototype.handleAddedToChannelNotification = function (notification) {
|
|
961
1121
|
return __awaiter(this, void 0, void 0, function () {
|
|
962
|
-
return __generator(this, function (
|
|
963
|
-
switch (
|
|
1122
|
+
return __generator(this, function (_f) {
|
|
1123
|
+
switch (_f.label) {
|
|
964
1124
|
case 0: return [4 /*yield*/, this.addChannelFromNotification(notification)];
|
|
965
1125
|
case 1:
|
|
966
|
-
|
|
1126
|
+
_f.sent();
|
|
967
1127
|
return [2 /*return*/];
|
|
968
1128
|
}
|
|
969
1129
|
});
|
|
@@ -973,13 +1133,13 @@
|
|
|
973
1133
|
var _a, _b;
|
|
974
1134
|
return __awaiter(this, void 0, void 0, function () {
|
|
975
1135
|
var channel;
|
|
976
|
-
return __generator(this, function (
|
|
977
|
-
switch (
|
|
1136
|
+
return __generator(this, function (_f) {
|
|
1137
|
+
switch (_f.label) {
|
|
978
1138
|
case 0:
|
|
979
1139
|
channel = this.chatClientService.chatClient.channel((_a = notification.event.channel) === null || _a === void 0 ? void 0 : _a.type, (_b = notification.event.channel) === null || _b === void 0 ? void 0 : _b.id);
|
|
980
1140
|
return [4 /*yield*/, channel.watch()];
|
|
981
1141
|
case 1:
|
|
982
|
-
|
|
1142
|
+
_f.sent();
|
|
983
1143
|
this.watchForChannelEvents(channel);
|
|
984
1144
|
this.channelsSubject.next(__spreadArray([
|
|
985
1145
|
channel
|
|
@@ -1000,9 +1160,11 @@
|
|
|
1000
1160
|
};
|
|
1001
1161
|
ChannelService.prototype.watchForActiveChannelEvents = function (channel) {
|
|
1002
1162
|
var _this = this;
|
|
1003
|
-
this.activeChannelSubscriptions.push(channel.on('message.new', function () {
|
|
1163
|
+
this.activeChannelSubscriptions.push(channel.on('message.new', function (event) {
|
|
1004
1164
|
_this.ngZone.run(function () {
|
|
1005
|
-
|
|
1165
|
+
event.message && event.message.parent_id
|
|
1166
|
+
? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[event.message.parent_id])))
|
|
1167
|
+
: _this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
1006
1168
|
_this.activeChannel$.pipe(operators.first()).subscribe(function (c) {
|
|
1007
1169
|
if (_this.canSendReadEvents) {
|
|
1008
1170
|
void (c === null || c === void 0 ? void 0 : c.markRead());
|
|
@@ -1032,11 +1194,16 @@
|
|
|
1032
1194
|
ChannelService.prototype.messageUpdated = function (event) {
|
|
1033
1195
|
var _this = this;
|
|
1034
1196
|
this.ngZone.run(function () {
|
|
1035
|
-
var
|
|
1197
|
+
var isThreadReply = event.message && event.message.parent_id;
|
|
1198
|
+
var messages = isThreadReply
|
|
1199
|
+
? _this.activeThreadMessagesSubject.getValue()
|
|
1200
|
+
: _this.activeChannelMessagesSubject.getValue();
|
|
1036
1201
|
var messageIndex = messages.findIndex(function (m) { var _a; return m.id === ((_a = event.message) === null || _a === void 0 ? void 0 : _a.id); });
|
|
1037
1202
|
if (messageIndex !== -1 && event.message) {
|
|
1038
1203
|
messages[messageIndex] = event.message;
|
|
1039
|
-
|
|
1204
|
+
isThreadReply
|
|
1205
|
+
? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(messages)))
|
|
1206
|
+
: _this.activeChannelMessagesSubject.next(__spreadArray([], __read(messages)));
|
|
1040
1207
|
}
|
|
1041
1208
|
});
|
|
1042
1209
|
};
|
|
@@ -1044,8 +1211,11 @@
|
|
|
1044
1211
|
var _this = this;
|
|
1045
1212
|
this.ngZone.run(function () {
|
|
1046
1213
|
var _a, _b, _c, _d;
|
|
1214
|
+
var isThreadMessage = e.message && e.message.parent_id;
|
|
1047
1215
|
var messages;
|
|
1048
|
-
|
|
1216
|
+
(isThreadMessage
|
|
1217
|
+
? _this.activeThreadMessages$
|
|
1218
|
+
: _this.activeChannelMessages$)
|
|
1049
1219
|
.pipe(operators.first())
|
|
1050
1220
|
.subscribe(function (m) { return (messages = m); });
|
|
1051
1221
|
var message = messages.find(function (m) { var _a; return m.id === ((_a = e === null || e === void 0 ? void 0 : e.message) === null || _a === void 0 ? void 0 : _a.id); });
|
|
@@ -1056,7 +1226,9 @@
|
|
|
1056
1226
|
message.reaction_scores = Object.assign({}, (_b = e.message) === null || _b === void 0 ? void 0 : _b.reaction_scores);
|
|
1057
1227
|
message.latest_reactions = __spreadArray([], __read((((_c = e.message) === null || _c === void 0 ? void 0 : _c.latest_reactions) || [])));
|
|
1058
1228
|
message.own_reactions = __spreadArray([], __read((((_d = e.message) === null || _d === void 0 ? void 0 : _d.own_reactions) || [])));
|
|
1059
|
-
|
|
1229
|
+
isThreadMessage
|
|
1230
|
+
? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(messages)))
|
|
1231
|
+
: _this.activeChannelMessagesSubject.next(__spreadArray([], __read(messages)));
|
|
1060
1232
|
});
|
|
1061
1233
|
};
|
|
1062
1234
|
ChannelService.prototype.formatMessage = function (message) {
|
|
@@ -1086,13 +1258,13 @@
|
|
|
1086
1258
|
return __awaiter(this, void 0, void 0, function () {
|
|
1087
1259
|
var channels, prevChannels, error_2;
|
|
1088
1260
|
var _this = this;
|
|
1089
|
-
return __generator(this, function (
|
|
1090
|
-
switch (
|
|
1261
|
+
return __generator(this, function (_f) {
|
|
1262
|
+
switch (_f.label) {
|
|
1091
1263
|
case 0:
|
|
1092
|
-
|
|
1264
|
+
_f.trys.push([0, 2, , 3]);
|
|
1093
1265
|
return [4 /*yield*/, this.chatClientService.chatClient.queryChannels(this.filters, this.sort, this.options)];
|
|
1094
1266
|
case 1:
|
|
1095
|
-
channels =
|
|
1267
|
+
channels = _f.sent();
|
|
1096
1268
|
channels.forEach(function (c) { return _this.watchForChannelEvents(c); });
|
|
1097
1269
|
prevChannels = this.channelsSubject.getValue() || [];
|
|
1098
1270
|
this.channelsSubject.next(__spreadArray(__spreadArray([], __read(prevChannels)), __read(channels)));
|
|
@@ -1102,7 +1274,7 @@
|
|
|
1102
1274
|
this.hasMoreChannelsSubject.next(channels.length >= this.options.limit);
|
|
1103
1275
|
return [3 /*break*/, 3];
|
|
1104
1276
|
case 2:
|
|
1105
|
-
error_2 =
|
|
1277
|
+
error_2 = _f.sent();
|
|
1106
1278
|
this.channelsSubject.error(error_2);
|
|
1107
1279
|
return [3 /*break*/, 3];
|
|
1108
1280
|
case 3: return [2 /*return*/];
|
|
@@ -1117,7 +1289,7 @@
|
|
|
1117
1289
|
case 'message.new': {
|
|
1118
1290
|
_this.ngZone.run(function () {
|
|
1119
1291
|
if (_this.customNewMessageHandler) {
|
|
1120
|
-
_this.customNewMessageHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1292
|
+
_this.customNewMessageHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1121
1293
|
}
|
|
1122
1294
|
else {
|
|
1123
1295
|
_this.handleNewMessage(event, channel);
|
|
@@ -1128,7 +1300,7 @@
|
|
|
1128
1300
|
case 'channel.hidden': {
|
|
1129
1301
|
_this.ngZone.run(function () {
|
|
1130
1302
|
if (_this.customChannelHiddenHandler) {
|
|
1131
|
-
_this.customChannelHiddenHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1303
|
+
_this.customChannelHiddenHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1132
1304
|
}
|
|
1133
1305
|
else {
|
|
1134
1306
|
_this.handleChannelHidden(event);
|
|
@@ -1139,7 +1311,7 @@
|
|
|
1139
1311
|
case 'channel.deleted': {
|
|
1140
1312
|
_this.ngZone.run(function () {
|
|
1141
1313
|
if (_this.customChannelDeletedHandler) {
|
|
1142
|
-
_this.customChannelDeletedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1314
|
+
_this.customChannelDeletedHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1143
1315
|
}
|
|
1144
1316
|
else {
|
|
1145
1317
|
_this.handleChannelDeleted(event);
|
|
@@ -1150,7 +1322,7 @@
|
|
|
1150
1322
|
case 'channel.visible': {
|
|
1151
1323
|
_this.ngZone.run(function () {
|
|
1152
1324
|
if (_this.customChannelVisibleHandler) {
|
|
1153
|
-
_this.customChannelVisibleHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1325
|
+
_this.customChannelVisibleHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1154
1326
|
}
|
|
1155
1327
|
else {
|
|
1156
1328
|
_this.handleChannelVisible(event, channel);
|
|
@@ -1161,7 +1333,7 @@
|
|
|
1161
1333
|
case 'channel.updated': {
|
|
1162
1334
|
_this.ngZone.run(function () {
|
|
1163
1335
|
if (_this.customChannelUpdatedHandler) {
|
|
1164
|
-
_this.customChannelUpdatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1336
|
+
_this.customChannelUpdatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1165
1337
|
}
|
|
1166
1338
|
else {
|
|
1167
1339
|
_this.handleChannelUpdate(event);
|
|
@@ -1172,7 +1344,7 @@
|
|
|
1172
1344
|
case 'channel.truncated': {
|
|
1173
1345
|
_this.ngZone.run(function () {
|
|
1174
1346
|
if (_this.customChannelTruncatedHandler) {
|
|
1175
|
-
_this.customChannelTruncatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter);
|
|
1347
|
+
_this.customChannelTruncatedHandler(event, channel, _this.channelListSetter, _this.messageListSetter, _this.threadListSetter, _this.parentMessageSetter);
|
|
1176
1348
|
}
|
|
1177
1349
|
else {
|
|
1178
1350
|
_this.handleChannelTruncate(event);
|
|
@@ -1213,6 +1385,7 @@
|
|
|
1213
1385
|
}
|
|
1214
1386
|
}
|
|
1215
1387
|
};
|
|
1388
|
+
// truncate active thread as well
|
|
1216
1389
|
ChannelService.prototype.handleChannelTruncate = function (event) {
|
|
1217
1390
|
var _a, _b;
|
|
1218
1391
|
var channelIndex = this.channels.findIndex(function (c) { return c.cid === event.channel.cid; });
|
|
@@ -1224,6 +1397,8 @@
|
|
|
1224
1397
|
channel.state.messages = [];
|
|
1225
1398
|
this.activeChannelSubject.next(channel);
|
|
1226
1399
|
this.activeChannelMessagesSubject.next([]);
|
|
1400
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
1401
|
+
this.activeThreadMessagesSubject.next([]);
|
|
1227
1402
|
}
|
|
1228
1403
|
}
|
|
1229
1404
|
};
|
|
@@ -1247,6 +1422,20 @@
|
|
|
1247
1422
|
enumerable: false,
|
|
1248
1423
|
configurable: true
|
|
1249
1424
|
});
|
|
1425
|
+
ChannelService.prototype.transformToStreamMessage = function (message, channel) {
|
|
1426
|
+
var isThreadMessage = !!message.parent_id;
|
|
1427
|
+
if (this.isStreamMessage(message) &&
|
|
1428
|
+
this.isFormatMessageResponse(message)) {
|
|
1429
|
+
return message;
|
|
1430
|
+
}
|
|
1431
|
+
else if (this.isFormatMessageResponse(message)) {
|
|
1432
|
+
return Object.assign(Object.assign({}, message), { readBy: isThreadMessage ? [] : getReadBy(message, channel) });
|
|
1433
|
+
}
|
|
1434
|
+
else {
|
|
1435
|
+
var formatMessage = this.formatMessage(message);
|
|
1436
|
+
return Object.assign(Object.assign({}, formatMessage), { readBy: isThreadMessage ? [] : getReadBy(formatMessage, channel) });
|
|
1437
|
+
}
|
|
1438
|
+
};
|
|
1250
1439
|
return ChannelService;
|
|
1251
1440
|
}());
|
|
1252
1441
|
ChannelService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelService, deps: [{ token: ChatClientService }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
@@ -1605,6 +1794,7 @@
|
|
|
1605
1794
|
Flag: 'Flag',
|
|
1606
1795
|
'Message Failed': 'Message Failed',
|
|
1607
1796
|
'Message Failed · Unauthorized': 'Message Failed · Unauthorized',
|
|
1797
|
+
'Message Failed · Click to try again': 'Message Failed · Click to try again',
|
|
1608
1798
|
'Message deleted': 'Message deleted',
|
|
1609
1799
|
'Message has been successfully flagged': 'Message has been successfully flagged',
|
|
1610
1800
|
'Message pinned': 'Message pinned',
|
|
@@ -1655,6 +1845,7 @@
|
|
|
1655
1845
|
test: 'success',
|
|
1656
1846
|
'Sending links is not allowed in this conversation': 'Sending links is not allowed in this conversation',
|
|
1657
1847
|
"You can't send messages in this channel": "You can't send messages in this channel",
|
|
1848
|
+
"You can't send thread replies in this channel": "You can't send thread replies in this channel",
|
|
1658
1849
|
'Unsupported file type: {{type}}': 'Unsupported file type: {{type}}',
|
|
1659
1850
|
},
|
|
1660
1851
|
};
|
|
@@ -1672,14 +1863,14 @@
|
|
|
1672
1863
|
};
|
|
1673
1864
|
return StreamI18nService;
|
|
1674
1865
|
}());
|
|
1675
|
-
StreamI18nService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, deps: [{ token:
|
|
1866
|
+
StreamI18nService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, deps: [{ token: i1__namespace.TranslateService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1676
1867
|
StreamI18nService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, providedIn: 'root' });
|
|
1677
1868
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, decorators: [{
|
|
1678
1869
|
type: i0.Injectable,
|
|
1679
1870
|
args: [{
|
|
1680
1871
|
providedIn: 'root',
|
|
1681
1872
|
}]
|
|
1682
|
-
}], ctorParameters: function () { return [{ type:
|
|
1873
|
+
}], ctorParameters: function () { return [{ type: i1__namespace.TranslateService }]; } });
|
|
1683
1874
|
|
|
1684
1875
|
var AvatarComponent = /** @class */ (function () {
|
|
1685
1876
|
function AvatarComponent() {
|
|
@@ -1698,7 +1889,7 @@
|
|
|
1698
1889
|
return AvatarComponent;
|
|
1699
1890
|
}());
|
|
1700
1891
|
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:
|
|
1892
|
+
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
1893
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AvatarComponent, decorators: [{
|
|
1703
1894
|
type: i0.Component,
|
|
1704
1895
|
args: [{
|
|
@@ -1720,7 +1911,7 @@
|
|
|
1720
1911
|
return IconComponent;
|
|
1721
1912
|
}());
|
|
1722
1913
|
IconComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: IconComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
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:
|
|
1914
|
+
IconComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: IconComponent, selector: "stream-icon", inputs: { icon: "icon", size: "size" }, ngImport: i0__namespace, template: "<svg\n data-testid=\"action-icon\"\n *ngIf=\"icon === 'action-icon'\"\n height=\"4\"\n viewBox=\"0 0 11 4\"\n width=\"11\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M1.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'delivered-icon'\"\n height=\"16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"delivered-icon\"\n>\n <path\n d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm3.72 6.633a.955.955 0 1 0-1.352-1.352L6.986 8.663 5.633 7.31A.956.956 0 1 0 4.28 8.663l2.029 2.028a.956.956 0 0 0 1.353 0l4.058-4.058z\"\n fill=\"#006CFF\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'reaction-icon'\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n width=\"12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reaction-icon\"\n>\n <g clipRule=\"evenodd\" fillRule=\"evenodd\">\n <path\n d=\"M6 1.2C3.3 1.2 1.2 3.3 1.2 6c0 2.7 2.1 4.8 4.8 4.8 2.7 0 4.8-2.1 4.8-4.8 0-2.7-2.1-4.8-4.8-4.8zM0 6c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6-6-2.7-6-6z\"\n ></path>\n <path\n d=\"M5.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM8.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM3.3 6.7c.3-.2.6-.1.8.1.3.4.8.9 1.5 1 .6.2 1.4.1 2.4-1 .2-.2.6-.3.8 0 .2.2.3.6 0 .8-1.1 1.3-2.4 1.7-3.5 1.5-1-.2-1.8-.9-2.2-1.5-.2-.3-.1-.7.2-.9z\"\n ></path>\n </g>\n</svg>\n<svg\n data-testid=\"connection-error\"\n *ngIf=\"icon === 'connection-error'\"\n width=\"78px\"\n height=\"78px\"\n viewBox=\"0 0 78 78\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <!-- Generator: Sketch 52.6 (67491) - http://www.bohemiancoding.com/sketch -->\n <title>Combined Shape</title>\n <desc>Created with Sketch.</desc>\n <g\n id=\"Interactions\"\n stroke=\"none\"\n stroke-width=\"1\"\n fill=\"none\"\n fill-rule=\"evenodd\"\n >\n <g\n id=\"Connection-Error-_-Connectivity\"\n transform=\"translate(-270.000000, -30.000000)\"\n fill=\"#CF1F25\"\n >\n <g\n id=\"109-network-connection\"\n transform=\"translate(270.000000, 30.000000)\"\n >\n <path\n d=\"M66.4609744,11.414231 C81.6225232,26.5757798 81.6225232,51.157545 66.4609744,66.3188467 C51.2994256,81.4803954 26.7176604,81.4803954 11.5563587,66.3188467 C-3.60519004,51.1572979 -3.60519004,26.5755327 11.5563587,11.414231 C26.7179075,-3.74731776 51.2996727,-3.74731776 66.4609744,11.414231 Z M54.7853215,45.8823776 L54.7853215,40.5882574 C54.7853215,39.613638 53.9952341,38.8235506 53.0206147,38.8235506 L44.9576695,38.8235506 L41.428256,42.3529641 L51.255555,42.3529641 L51.255555,45.8823776 L54.7853215,45.8823776 Z M40.6659027,43.1153174 L37.8988425,45.8823776 L40.6659027,45.8823776 L40.6659027,43.1153174 Z M51.1764962,56.4702653 L58.2353232,56.4702653 C59.2099355,56.4702653 60.00003,55.6801708 60.00003,54.7055585 L60.00003,51.176145 C60.00003,50.2015327 59.2099355,49.4114382 58.2353232,49.4114382 L51.1764962,49.4114382 C50.2018839,49.4114382 49.4117894,50.2015327 49.4117894,51.176145 L49.4117894,54.7055585 C49.4117894,55.6801708 50.2018839,56.4702653 51.1764962,56.4702653 Z M35.2941353,56.4702653 L42.3529624,56.4702653 C43.3275746,56.4702653 44.1176691,55.6801708 44.1176691,54.7055585 L44.1176691,51.176145 C44.1176691,50.2015327 43.3275746,49.4114382 42.3529624,49.4114382 L35.2941353,49.4114382 C34.319523,49.4114382 33.5294285,50.2015327 33.5294285,51.176145 L33.5294285,54.7055585 C33.5294285,55.6801708 34.319523,56.4702653 35.2941353,56.4702653 Z M56.6964989,19.0874231 C56.007381,18.3985134 54.8903216,18.3985134 54.2012036,19.087423 L45.882376,27.4062507 L45.882376,19.4117761 C45.882376,18.4371568 45.0922885,17.6470693 44.1176692,17.6470693 L33.5294286,17.6470693 C32.5548092,17.6470694 31.7647218,18.4371568 31.7647218,19.4117761 L31.7647218,30.0000167 C31.7647219,30.9746363 32.5548092,31.7647237 33.5294285,31.7647237 L41.5239031,31.7647237 L34.4650761,38.8235508 L24.7058947,38.8235508 C23.7312753,38.8235508 22.9411879,39.6136382 22.9411879,40.5882575 L22.9411879,45.8823778 L26.4706014,45.8823778 L26.4706014,42.3529643 L30.9356624,42.3529643 L23.8768354,49.4117914 L19.4117743,49.4117914 C18.4371549,49.4117914 17.6470675,50.2018788 17.6470675,51.1764981 L17.6470675,54.7059117 C17.6504049,54.9674302 17.7129076,55.2248042 17.8298886,55.4587302 L16.4456526,56.8429662 C15.7446193,57.5200453 15.7252005,58.6372282 16.4022825,59.3382615 C17.0793616,60.0392948 18.1965445,60.0587136 18.8975778,59.3816316 C18.9122847,59.3674273 18.9267436,59.3529684 18.940948,59.3382615 L56.6964963,21.5830662 C57.3856425,20.8939094 57.3856425,19.7765747 56.6964963,19.0874179 Z\"\n id=\"Combined-Shape\"\n ></path>\n </g>\n </g>\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'send'\"\n data-testid=\"send\"\n height=\"17\"\n viewBox=\"0 0 18 17\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Send</title>\n <path\n d=\"M0 17.015l17.333-8.508L0 0v6.617l12.417 1.89L0 10.397z\"\n fill=\"#006cff\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'file-upload'\"\n data-testid=\"file-upload\"\n height=\"14\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Attach files</title>\n <path\n d=\"M1.667.333h10.666c.737 0 1.334.597 1.334 1.334v10.666c0 .737-.597 1.334-1.334 1.334H1.667a1.333 1.333 0 0 1-1.334-1.334V1.667C.333.93.93.333 1.667.333zm2 1.334a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333zm-2 9.333v1.333h10.666v-4l-2-2-4 4-2-2L1.667 11z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n data-testid=\"retry\"\n *ngIf=\"icon === 'retry'\"\n width=\"22\"\n height=\"20\"\n viewBox=\"0 0 22 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M20 5.535V2a1 1 0 0 1 2 0v6a1 1 0 0 1-1 1h-6a1 1 0 0 1 0-2h3.638l-2.975-2.653a8 8 0 1 0 1.884 8.32 1 1 0 1 1 1.886.666A10 10 0 1 1 5.175 1.245c3.901-2.15 8.754-1.462 11.88 1.667L20 5.535z\"\n fill=\"#FFF\"\n fill-rule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'close'\"\n data-testid=\"close\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <defs>\n <path\n d=\"M465 5c5.53 0 10 4.47 10 10s-4.47 10-10 10-10-4.47-10-10 4.47-10 10-10zm3.59 5L465 13.59 461.41 10 460 11.41l3.59 3.59-3.59 3.59 1.41 1.41 3.59-3.59 3.59 3.59 1.41-1.41-3.59-3.59 3.59-3.59-1.41-1.41z\"\n id=\"b\"\n />\n <filter\n x=\"-30%\"\n y=\"-30%\"\n width=\"160%\"\n height=\"160%\"\n filterUnits=\"objectBoundingBox\"\n id=\"a\"\n >\n <feOffset in=\"SourceAlpha\" result=\"shadowOffsetOuter1\" />\n <feGaussianBlur\n stdDeviation=\"2\"\n in=\"shadowOffsetOuter1\"\n result=\"shadowBlurOuter1\"\n />\n <feColorMatrix\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0\"\n in=\"shadowBlurOuter1\"\n />\n </filter>\n </defs>\n <g transform=\"translate(-451 -1)\" fill-rule=\"nonzero\" fill=\"none\">\n <use fill=\"#000\" filter=\"url(#a)\" xlink:href=\"#b\" />\n <use fill=\"#FFF\" fill-rule=\"evenodd\" xlink:href=\"#b\" />\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'file'\"\n data-testid=\"file\"\n className=\"rfu-file-icon--small fa-file-fallback\"\n [attr.height]=\"size || 20\"\n [attr.width]=\"size || 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 384 512\"\n>\n <path\n d=\"M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z\"\n fill=\"#414D54\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'reply'\"\n data-testid=\"reply\"\n height=\"15\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M.56 10.946H.06l-.002-.498L.025.92a.5.5 0 1 1 1-.004l.032 9.029H9.06v-4l9 4.5-9 4.5v-4H.56z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n height=\"10\"\n width=\"10\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"close-no-outline\"\n *ngIf=\"icon === 'close-no-outline'\"\n>\n <path\n d=\"M9.916 1.027L8.973.084 5 4.058 1.027.084l-.943.943L4.058 5 .084 8.973l.943.943L5 5.942l3.973 3.974.943-.943L5.942 5z\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n height=\"10\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reply-in-thread\"\n *ngIf=\"icon === 'reply-in-thread'\"\n>\n <path\n d=\"M8.516 3c4.78 0 4.972 6.5 4.972 6.5-1.6-2.906-2.847-3.184-4.972-3.184v2.872L3.772 4.994 8.516.5V3zM.484 5l4.5-4.237v1.78L2.416 5l2.568 2.125v1.828L.484 5z\"\n fillRule=\"evenodd\"\n />\n</svg>\n", directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }] });
|
|
1724
1915
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: IconComponent, decorators: [{
|
|
1725
1916
|
type: i0.Component,
|
|
1726
1917
|
args: [{
|
|
@@ -1742,7 +1933,7 @@
|
|
|
1742
1933
|
return LoadingIndicatorComponent;
|
|
1743
1934
|
}());
|
|
1744
1935
|
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:
|
|
1936
|
+
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
1937
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: LoadingIndicatorComponent, decorators: [{
|
|
1747
1938
|
type: i0.Component,
|
|
1748
1939
|
args: [{
|
|
@@ -1785,6 +1976,8 @@
|
|
|
1785
1976
|
this.componentRef.instance.areMentionsEnabled = this.areMentionsEnabled;
|
|
1786
1977
|
this.componentRef.instance.mentionAutocompleteItemTemplate =
|
|
1787
1978
|
this.mentionAutocompleteItemTemplate;
|
|
1979
|
+
this.componentRef.instance.commandAutocompleteItemTemplate =
|
|
1980
|
+
this.commandAutocompleteItemTemplate;
|
|
1788
1981
|
this.componentRef.instance.mentionScope = this.mentionScope;
|
|
1789
1982
|
this.componentRef.instance.value = this.value;
|
|
1790
1983
|
}
|
|
@@ -1796,6 +1989,10 @@
|
|
|
1796
1989
|
this.componentRef.instance.mentionAutocompleteItemTemplate =
|
|
1797
1990
|
this.mentionAutocompleteItemTemplate;
|
|
1798
1991
|
}
|
|
1992
|
+
if (changes.commandAutocompleteItemTemplate) {
|
|
1993
|
+
this.componentRef.instance.commandAutocompleteItemTemplate =
|
|
1994
|
+
this.commandAutocompleteItemTemplate;
|
|
1995
|
+
}
|
|
1799
1996
|
if (changes.mentionScope) {
|
|
1800
1997
|
this.componentRef.instance.mentionScope = this.mentionScope;
|
|
1801
1998
|
}
|
|
@@ -1812,7 +2009,7 @@
|
|
|
1812
2009
|
return TextareaDirective;
|
|
1813
2010
|
}());
|
|
1814
2011
|
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 });
|
|
2012
|
+
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
2013
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: TextareaDirective, decorators: [{
|
|
1817
2014
|
type: i0.Directive,
|
|
1818
2015
|
args: [{
|
|
@@ -1826,6 +2023,8 @@
|
|
|
1826
2023
|
type: i0.Input
|
|
1827
2024
|
}], mentionScope: [{
|
|
1828
2025
|
type: i0.Input
|
|
2026
|
+
}], commandAutocompleteItemTemplate: [{
|
|
2027
|
+
type: i0.Input
|
|
1829
2028
|
}], value: [{
|
|
1830
2029
|
type: i0.Input
|
|
1831
2030
|
}], valueChange: [{
|
|
@@ -1854,6 +2053,90 @@
|
|
|
1854
2053
|
}]
|
|
1855
2054
|
}], ctorParameters: function () { return []; } });
|
|
1856
2055
|
|
|
2056
|
+
var ImageLoadService = /** @class */ (function () {
|
|
2057
|
+
function ImageLoadService() {
|
|
2058
|
+
this.imageLoad$ = new rxjs.Subject();
|
|
2059
|
+
}
|
|
2060
|
+
return ImageLoadService;
|
|
2061
|
+
}());
|
|
2062
|
+
ImageLoadService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2063
|
+
ImageLoadService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, providedIn: 'root' });
|
|
2064
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, decorators: [{
|
|
2065
|
+
type: i0.Injectable,
|
|
2066
|
+
args: [{
|
|
2067
|
+
providedIn: 'root',
|
|
2068
|
+
}]
|
|
2069
|
+
}], ctorParameters: function () { return []; } });
|
|
2070
|
+
|
|
2071
|
+
var AttachmentListComponent = /** @class */ (function () {
|
|
2072
|
+
function AttachmentListComponent(imageLoadService, channelService) {
|
|
2073
|
+
this.imageLoadService = imageLoadService;
|
|
2074
|
+
this.channelService = channelService;
|
|
2075
|
+
this.attachments = [];
|
|
2076
|
+
this.orderedAttachments = [];
|
|
2077
|
+
}
|
|
2078
|
+
AttachmentListComponent.prototype.ngOnChanges = function () {
|
|
2079
|
+
var _this = this;
|
|
2080
|
+
this.orderedAttachments = __spreadArray(__spreadArray(__spreadArray([], __read(this.attachments.filter(function (a) { return _this.isImage(a); }))), __read(this.attachments.filter(function (a) { return _this.isFile(a); }))), __read(this.attachments.filter(function (a) { return _this.isCard(a); })));
|
|
2081
|
+
};
|
|
2082
|
+
AttachmentListComponent.prototype.trackById = function (index) {
|
|
2083
|
+
return index;
|
|
2084
|
+
};
|
|
2085
|
+
AttachmentListComponent.prototype.isImage = function (attachment) {
|
|
2086
|
+
return isImageAttachment(attachment);
|
|
2087
|
+
};
|
|
2088
|
+
AttachmentListComponent.prototype.isFile = function (attachment) {
|
|
2089
|
+
return attachment.type === 'file';
|
|
2090
|
+
};
|
|
2091
|
+
AttachmentListComponent.prototype.isCard = function (attachment) {
|
|
2092
|
+
return (!attachment.type ||
|
|
2093
|
+
(attachment.type === 'image' && !this.isImage(attachment)) ||
|
|
2094
|
+
attachment.type === 'giphy');
|
|
2095
|
+
};
|
|
2096
|
+
AttachmentListComponent.prototype.imageLoaded = function () {
|
|
2097
|
+
this.imageLoadService.imageLoad$.next();
|
|
2098
|
+
};
|
|
2099
|
+
AttachmentListComponent.prototype.hasFileSize = function (attachment) {
|
|
2100
|
+
return (attachment.file_size && Number.isFinite(Number(attachment.file_size)));
|
|
2101
|
+
};
|
|
2102
|
+
AttachmentListComponent.prototype.getFileSize = function (attachment) {
|
|
2103
|
+
return prettybytes__default['default'](attachment.file_size);
|
|
2104
|
+
};
|
|
2105
|
+
AttachmentListComponent.prototype.trimUrl = function (url) {
|
|
2106
|
+
if (url !== undefined && url !== null) {
|
|
2107
|
+
var _a = __read(url
|
|
2108
|
+
.replace(/^(?:https?:\/\/)?(?:www\.)?/i, '')
|
|
2109
|
+
.split('/'), 1), trimmedUrl = _a[0];
|
|
2110
|
+
return trimmedUrl;
|
|
2111
|
+
}
|
|
2112
|
+
return null;
|
|
2113
|
+
};
|
|
2114
|
+
AttachmentListComponent.prototype.sendAction = function (action) {
|
|
2115
|
+
var _a;
|
|
2116
|
+
void this.channelService.sendAction(this.messageId, (_a = {},
|
|
2117
|
+
_a[action.name] = action.value,
|
|
2118
|
+
_a));
|
|
2119
|
+
};
|
|
2120
|
+
AttachmentListComponent.prototype.trackByActionValue = function (_, item) {
|
|
2121
|
+
return item.value;
|
|
2122
|
+
};
|
|
2123
|
+
return AttachmentListComponent;
|
|
2124
|
+
}());
|
|
2125
|
+
AttachmentListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentListComponent, deps: [{ token: ImageLoadService }, { token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2126
|
+
AttachmentListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AttachmentListComponent, selector: "stream-attachment-list", inputs: { messageId: "messageId", attachments: "attachments" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngFor=\"let attachment of orderedAttachments; trackBy: trackById\">\n <div\n data-testclass=\"attachment-container\"\n class=\"str-chat__message-attachment str-chat__message-attachment--{{\n attachment.type\n }}\"\n [class.str-chat__message-attachment--card]=\"isCard(attachment)\"\n [class.str-chat-angular__message-attachment-file-single]=\"\n isFile(attachment)\n \"\n >\n <img\n *ngIf=\"isImage(attachment)\"\n class=\"str-chat__message-attachment--img\"\n data-testclass=\"image\"\n [src]=\"attachment.img_url || attachment.thumb_url || attachment.image_url\"\n [alt]=\"attachment?.fallback\"\n (load)=\"imageLoaded()\"\n />\n <div\n *ngIf=\"isFile(attachment)\"\n class=\"\n str-chat__message-attachment-file--item\n str-chat-angular__message-attachment-file-single\n \"\n >\n <stream-icon icon=\"file\" [size]=\"30\"></stream-icon>\n <div class=\"str-chat__message-attachment-file--item-text\">\n <a\n data-testclass=\"file-link\"\n download\n href=\"{{ attachment.asset_url }}\"\n target=\"_blank\"\n >\n {{ attachment.title }}\n </a>\n <span data-testclass=\"size\" *ngIf=\"hasFileSize(attachment)\">{{\n getFileSize(attachment)\n }}</span>\n </div>\n </div>\n <div\n *ngIf=\"isCard(attachment)\"\n class=\"str-chat__message-attachment-card str-chat__message-attachment-card--{{\n attachment.type\n }}\"\n >\n <div\n *ngIf=\"attachment.image_url || attachment.thumb_url\"\n class=\"str-chat__message-attachment-card--header\"\n >\n <img\n data-testclass=\"card-img\"\n alt=\"{{ attachment.image_url || attachment.thumb_url }}\"\n src=\"{{ attachment.image_url || attachment.thumb_url }}\"\n />\n </div>\n <div class=\"str-chat__message-attachment-card--content\">\n <div class=\"str-chat__message-attachment-card--flex\">\n <div\n *ngIf=\"attachment.title\"\n data-testclass=\"card-title\"\n class=\"str-chat__message-attachment-card--title\"\n >\n {{ attachment.title }}\n </div>\n <div\n *ngIf=\"attachment.text\"\n class=\"str-chat__message-attachment-card--text\"\n data-testclass=\"card-text\"\n >\n {{ attachment.text }}\n </div>\n <a\n class=\"str-chat__message-attachment-card--url\"\n *ngIf=\"attachment.title_link || attachment.og_scrape_url\"\n data-testclass=\"url-link\"\n noopener\n noreferrer\n href=\"{{ attachment.title_link || attachment.og_scrape_url }}\"\n target=\"_blank\"\n >\n {{ trimUrl(attachment.title_link || attachment.og_scrape_url) }}\n </a>\n </div>\n </div>\n </div>\n <div\n class=\"str-chat__message-attachment-actions\"\n *ngIf=\"attachment.actions && attachment.actions.length > 0\"\n >\n <div class=\"str-chat__message-attachment-actions-form\">\n <button\n *ngFor=\"let action of attachment.actions; trackBy: trackByActionValue\"\n class=\"str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--{{\n action.style\n }}\"\n data-testclass=\"attachment-action\"\n (click)=\"sendAction(action)\"\n (keyup.enter)=\"sendAction(action)\"\n >\n {{ action.text }}\n </button>\n </div>\n </div>\n </div>\n</ng-container>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2127
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentListComponent, decorators: [{
|
|
2128
|
+
type: i0.Component,
|
|
2129
|
+
args: [{
|
|
2130
|
+
selector: 'stream-attachment-list',
|
|
2131
|
+
templateUrl: './attachment-list.component.html',
|
|
2132
|
+
styles: [],
|
|
2133
|
+
}]
|
|
2134
|
+
}], ctorParameters: function () { return [{ type: ImageLoadService }, { type: ChannelService }]; }, propDecorators: { messageId: [{
|
|
2135
|
+
type: i0.Input
|
|
2136
|
+
}], attachments: [{
|
|
2137
|
+
type: i0.Input
|
|
2138
|
+
}] } });
|
|
2139
|
+
|
|
1857
2140
|
var AttachmentPreviewListComponent = /** @class */ (function () {
|
|
1858
2141
|
function AttachmentPreviewListComponent(attachmentService) {
|
|
1859
2142
|
this.attachmentService = attachmentService;
|
|
@@ -1889,7 +2172,7 @@
|
|
|
1889
2172
|
return AttachmentPreviewListComponent;
|
|
1890
2173
|
}());
|
|
1891
2174
|
AttachmentPreviewListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentPreviewListComponent, deps: [{ token: AttachmentService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
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:
|
|
2175
|
+
AttachmentPreviewListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list", ngImport: i0__namespace, template: "<div class=\"rfu-image-previewer\" *ngIf=\"(attachmentUploads$ | async)?.length\">\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"rfu-image-previewer__image\"\n [class.rfu-image-previewer__image--loaded]=\"\n attachmentUpload.state === 'success'\n \"\n data-testclass=\"attachment-image-preview\"\n >\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n class=\"rfu-image-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n data-testclass=\"upload-error\"\n >\n <stream-icon icon=\"retry\"></stream-icon>\n </div>\n <div class=\"rfu-thumbnail__wrapper\" style=\"width: 100; height: 100\">\n <div class=\"rfu-thumbnail__overlay\">\n <div\n class=\"rfu-icon-button\"\n data-testclass=\"delete-attachment\"\n role=\"button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n </div>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"attachmentUpload.file.name\"\n class=\"rfu-thumbnail__image\"\n data-testclass=\"attachment-image\"\n />\n </div>\n <stream-loading-indicator\n data-testclass=\"loading-indicator\"\n color=\"rgba(255,255,255,0.7)\"\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n ></stream-loading-indicator>\n </div>\n <div\n class=\"rfu-file-previewer\"\n *ngIf=\"attachmentUpload.type === 'file'\"\n data-testclass=\"attachment-file-preview\"\n >\n <ol>\n <li\n class=\"rfu-file-previewer__file\"\n [class.rfu-file-previewer__file--uploading]=\"\n attachmentUpload.state === 'uploading'\n \"\n [class.rfu-file-previewer__file--failed]=\"\n attachmentUpload.state === 'error'\n \"\n >\n <stream-icon icon=\"file\"></stream-icon>\n\n <a\n data-testclass=\"file-download-link\"\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n download\n >\n {{ attachmentUpload.file.name }}\n <ng-container *ngIf=\"attachmentUpload.state === 'error'\">\n <div\n data-testclass=\"file-upload-retry\"\n class=\"rfu-file-previewer__failed\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n translate\n >\n streamChat.failed\n </div>\n <div\n class=\"rfu-file-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n translate\n >\n streamChat.retry\n </div>\n </ng-container>\n </a>\n\n <span\n data-testclass=\"file-delete\"\n class=\"rfu-file-previewer__close-button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n \u2718\n </span>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"rfu-file-previewer__loading-indicator\"\n >\n <stream-loading-indicator></stream-loading-indicator>\n </div>\n </li>\n </ol>\n </div>\n </ng-container>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "async": i6__namespace.AsyncPipe } });
|
|
1893
2176
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentPreviewListComponent, decorators: [{
|
|
1894
2177
|
type: i0.Component,
|
|
1895
2178
|
args: [{
|
|
@@ -1910,6 +2193,7 @@
|
|
|
1910
2193
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
1911
2194
|
this.cdRef = cdRef;
|
|
1912
2195
|
this.chatClient = chatClient;
|
|
2196
|
+
this.mode = 'main';
|
|
1913
2197
|
this.messageUpdate = new i0.EventEmitter();
|
|
1914
2198
|
this.textareaValue = '';
|
|
1915
2199
|
this.mentionedUsers = [];
|
|
@@ -1930,14 +2214,19 @@
|
|
|
1930
2214
|
_this.isFileUploadAuthorized =
|
|
1931
2215
|
capabilities.indexOf('upload-file') !== -1;
|
|
1932
2216
|
_this.canSendLinks = capabilities.indexOf('send-links') !== -1;
|
|
1933
|
-
_this.
|
|
1934
|
-
|
|
1935
|
-
_this.cdRef.detectChanges();
|
|
1936
|
-
_this.initTextarea();
|
|
1937
|
-
}
|
|
2217
|
+
_this.channel = channel;
|
|
2218
|
+
_this.setCanSendMessages();
|
|
1938
2219
|
}
|
|
1939
2220
|
}));
|
|
1940
2221
|
this.subscriptions.push(this.chatClient.appSettings$.subscribe(function (appSettings) { return (_this.appSettings = appSettings); }));
|
|
2222
|
+
this.subscriptions.push(this.channelService.messageToQuote$.subscribe(function (m) {
|
|
2223
|
+
var isThreadReply = m && m.parent_id;
|
|
2224
|
+
if ((_this.mode === 'thread' && isThreadReply) ||
|
|
2225
|
+
(_this.mode === 'thread' && _this.quotedMessage && !m) ||
|
|
2226
|
+
(_this.mode === 'main' && !isThreadReply)) {
|
|
2227
|
+
_this.quotedMessage = m;
|
|
2228
|
+
}
|
|
2229
|
+
}));
|
|
1941
2230
|
this.attachmentUploads$ = this.attachmentService.attachmentUploads$;
|
|
1942
2231
|
this.isFileUploadEnabled = this.configService.isFileUploadEnabled;
|
|
1943
2232
|
this.acceptedFileTypes = this.configService.acceptedFileTypes;
|
|
@@ -1947,6 +2236,8 @@
|
|
|
1947
2236
|
this.mentionAutocompleteItemTemplate =
|
|
1948
2237
|
this.configService.mentionAutocompleteItemTemplate;
|
|
1949
2238
|
this.mentionScope = this.configService.mentionScope;
|
|
2239
|
+
this.commandAutocompleteItemTemplate =
|
|
2240
|
+
this.configService.commandAutocompleteItemTemplate;
|
|
1950
2241
|
}
|
|
1951
2242
|
MessageInputComponent.prototype.ngAfterViewInit = function () {
|
|
1952
2243
|
this.isViewInited = true;
|
|
@@ -1977,16 +2268,24 @@
|
|
|
1977
2268
|
this.configService.mentionAutocompleteItemTemplate =
|
|
1978
2269
|
this.mentionAutocompleteItemTemplate;
|
|
1979
2270
|
}
|
|
2271
|
+
if (changes.commandAutocompleteItemTemplate) {
|
|
2272
|
+
this.configService.commandAutocompleteItemTemplate =
|
|
2273
|
+
this.commandAutocompleteItemTemplate;
|
|
2274
|
+
}
|
|
1980
2275
|
if (changes.mentionScope) {
|
|
1981
2276
|
this.configService.mentionScope = this.mentionScope;
|
|
1982
2277
|
}
|
|
2278
|
+
if (changes.mode) {
|
|
2279
|
+
this.setCanSendMessages();
|
|
2280
|
+
}
|
|
1983
2281
|
};
|
|
1984
2282
|
MessageInputComponent.prototype.ngOnDestroy = function () {
|
|
1985
2283
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
1986
2284
|
};
|
|
1987
2285
|
MessageInputComponent.prototype.messageSent = function () {
|
|
2286
|
+
var _a;
|
|
1988
2287
|
return __awaiter(this, void 0, void 0, function () {
|
|
1989
|
-
var attachmentUploadInProgressCounter, attachments, text, error_1;
|
|
2288
|
+
var attachmentUploadInProgressCounter, attachments, text, parentMessageId, error_1;
|
|
1990
2289
|
return __generator(this, function (_12) {
|
|
1991
2290
|
switch (_12.label) {
|
|
1992
2291
|
case 0:
|
|
@@ -2012,12 +2311,18 @@
|
|
|
2012
2311
|
if (!this.isUpdate) {
|
|
2013
2312
|
this.textareaValue = '';
|
|
2014
2313
|
}
|
|
2314
|
+
parentMessageId = undefined;
|
|
2315
|
+
if (this.mode === 'thread') {
|
|
2316
|
+
this.channelService.activeParentMessageId$
|
|
2317
|
+
.pipe(operators.first())
|
|
2318
|
+
.subscribe(function (id) { return (parentMessageId = id); });
|
|
2319
|
+
}
|
|
2015
2320
|
_12.label = 1;
|
|
2016
2321
|
case 1:
|
|
2017
2322
|
_12.trys.push([1, 3, , 4]);
|
|
2018
2323
|
return [4 /*yield*/, (this.isUpdate
|
|
2019
2324
|
? this.channelService.updateMessage(Object.assign(Object.assign({}, this.message), { text: text, attachments: attachments }))
|
|
2020
|
-
: this.channelService.sendMessage(text, attachments, this.mentionedUsers))];
|
|
2325
|
+
: this.channelService.sendMessage(text, attachments, this.mentionedUsers, parentMessageId, (_a = this.quotedMessage) === null || _a === void 0 ? void 0 : _a.id))];
|
|
2021
2326
|
case 2:
|
|
2022
2327
|
_12.sent();
|
|
2023
2328
|
this.messageUpdate.emit();
|
|
@@ -2031,7 +2336,11 @@
|
|
|
2031
2336
|
this.notificationService.addTemporaryNotification('streamChat.Edit message request failed');
|
|
2032
2337
|
}
|
|
2033
2338
|
return [3 /*break*/, 4];
|
|
2034
|
-
case 4:
|
|
2339
|
+
case 4:
|
|
2340
|
+
if (this.quotedMessage) {
|
|
2341
|
+
this.deselectMessageToQuote();
|
|
2342
|
+
}
|
|
2343
|
+
return [2 /*return*/];
|
|
2035
2344
|
}
|
|
2036
2345
|
});
|
|
2037
2346
|
});
|
|
@@ -2051,6 +2360,17 @@
|
|
|
2051
2360
|
enumerable: false,
|
|
2052
2361
|
configurable: true
|
|
2053
2362
|
});
|
|
2363
|
+
Object.defineProperty(MessageInputComponent.prototype, "quotedMessageAttachments", {
|
|
2364
|
+
get: function () {
|
|
2365
|
+
var _a;
|
|
2366
|
+
var originalAttachments = (_a = this.quotedMessage) === null || _a === void 0 ? void 0 : _a.attachments;
|
|
2367
|
+
return originalAttachments && originalAttachments.length
|
|
2368
|
+
? [originalAttachments[0]]
|
|
2369
|
+
: [];
|
|
2370
|
+
},
|
|
2371
|
+
enumerable: false,
|
|
2372
|
+
configurable: true
|
|
2373
|
+
});
|
|
2054
2374
|
MessageInputComponent.prototype.filesSelected = function (fileList) {
|
|
2055
2375
|
return __awaiter(this, void 0, void 0, function () {
|
|
2056
2376
|
return __generator(this, function (_12) {
|
|
@@ -2069,6 +2389,9 @@
|
|
|
2069
2389
|
});
|
|
2070
2390
|
});
|
|
2071
2391
|
};
|
|
2392
|
+
MessageInputComponent.prototype.deselectMessageToQuote = function () {
|
|
2393
|
+
this.channelService.selectMessageToQuote(undefined);
|
|
2394
|
+
};
|
|
2072
2395
|
MessageInputComponent.prototype.clearFileInput = function () {
|
|
2073
2396
|
this.fileInput.nativeElement.value = '';
|
|
2074
2397
|
};
|
|
@@ -2148,10 +2471,25 @@
|
|
|
2148
2471
|
});
|
|
2149
2472
|
});
|
|
2150
2473
|
};
|
|
2474
|
+
MessageInputComponent.prototype.setCanSendMessages = function () {
|
|
2475
|
+
var _a, _b;
|
|
2476
|
+
var capabilities = (_b = (_a = this.channel) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.own_capabilities;
|
|
2477
|
+
if (!capabilities) {
|
|
2478
|
+
this.canSendMessages = false;
|
|
2479
|
+
}
|
|
2480
|
+
else {
|
|
2481
|
+
this.canSendMessages =
|
|
2482
|
+
capabilities.indexOf(this.mode === 'main' ? 'send-message' : 'send-reply') !== -1;
|
|
2483
|
+
}
|
|
2484
|
+
if (this.isViewInited) {
|
|
2485
|
+
this.cdRef.detectChanges();
|
|
2486
|
+
this.initTextarea();
|
|
2487
|
+
}
|
|
2488
|
+
};
|
|
2151
2489
|
return MessageInputComponent;
|
|
2152
2490
|
}());
|
|
2153
2491
|
MessageInputComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputComponent, deps: [{ token: ChannelService }, { token: NotificationService }, { token: AttachmentService }, { token: MessageInputConfigService }, { token: textareaInjectionToken }, { token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ChangeDetectorRef }, { token: ChatClientService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
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
|
|
2492
|
+
MessageInputComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageInputComponent, selector: "stream-message-input", inputs: { isFileUploadEnabled: "isFileUploadEnabled", areMentionsEnabled: "areMentionsEnabled", mentionScope: "mentionScope", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", commandAutocompleteItemTemplate: "commandAutocompleteItemTemplate", mode: "mode", acceptedFileTypes: "acceptedFileTypes", isMultipleFileUploadEnabled: "isMultipleFileUploadEnabled", message: "message" }, outputs: { messageUpdate: "messageUpdate" }, providers: [AttachmentService], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "textareaAnchor", first: true, predicate: TextareaDirective, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n class=\"{{\n mode === 'main' ? 'str-chat__input-flat' : 'str-chat__small-message-input'\n }}\"\n [class.str-chat__input-flat-has-attachments]=\"\n (attachmentUploads$ | async)!.length > 0\n \"\n [class.str-chat__input-flat-quoted]=\"!!quotedMessage\"\n>\n <div\n data-testid=\"quoted-message-container\"\n class=\"quoted-message-preview\"\n *ngIf=\"quotedMessage\"\n >\n <div class=\"quoted-message-preview-header\">\n <div>{{ \"streamChat.Reply to Message\" | translate }}</div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon\n icon=\"close-no-outline\"\n style=\"font-size: 10px; line-height: 10px\"\n ></stream-icon>\n </button>\n </div>\n <div class=\"quoted-message-preview-content\">\n <stream-avatar\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"quotedMessage?.user?.image\"\n [name]=\"quotedMessage?.user?.name || quotedMessage?.user?.id\"\n [size]=\"20\"\n ></stream-avatar>\n <div class=\"quoted-message-preview-content-inner\">\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"quotedMessage?.html || quotedMessage?.text\"\n ></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__input-flat-wrapper\" style=\"width: 100%\">\n <div\n class=\"{{\n mode === 'main'\n ? 'str-chat__input-flat--textarea-wrapper'\n : 'str-chat__small-message-input--textarea-wrapper'\n }}\"\n >\n <stream-attachment-preview-list\n class=\"rfu-image-previewer-angular-host\"\n ></stream-attachment-preview-list>\n <div class=\"rta str-chat__textarea\">\n <ng-template\n *ngIf=\"canSendMessages; else notAllowed\"\n streamTextarea\n [(value)]=\"textareaValue\"\n (send)=\"messageSent()\"\n [componentRef]=\"textareaRef\"\n (userMentions)=\"mentionedUsers = $event\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionAutocompleteItemTemplate]=\"mentionAutocompleteItemTemplate\"\n [commandAutocompleteItemTemplate]=\"commandAutocompleteItemTemplate\"\n [mentionScope]=\"mentionScope\"\n ></ng-template>\n <ng-template #notAllowed>\n <textarea\n disabled\n rows=\"1\"\n [value]=\"\n (mode === 'thread'\n ? 'You can\\'t send thread replies in this channel'\n : 'streamChat.You can\\'t send messages in this channel'\n ) | translate\n \"\n class=\"rta__textarea str-chat__textarea__textarea\"\n ></textarea>\n </ng-template>\n </div>\n <div\n *ngIf=\"isFileUploadEnabled && isFileUploadAuthorized && canSendMessages\"\n class=\"str-chat__fileupload-wrapper\"\n data-testid=\"file-upload-button\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Attach files\" | translate }}\n </div>\n <div class=\"rfu-file-upload-button\">\n <label>\n <input\n #fileInput\n type=\"file\"\n class=\"rfu-file-input\"\n data-testid=\"file-input\"\n [accept]=\"accept\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <span class=\"str-chat__input-flat-fileupload\">\n <stream-icon icon=\"file-upload\"></stream-icon>\n </span>\n </label>\n </div>\n </div>\n </div>\n <button\n *ngIf=\"canSendMessages\"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon icon=\"send\"></stream-icon>\n </button>\n </div>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }, { type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["messageId", "attachments"] }, { type: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: TextareaDirective, selector: "[streamTextarea]", inputs: ["componentRef", "areMentionsEnabled", "mentionAutocompleteItemTemplate", "mentionScope", "commandAutocompleteItemTemplate", "value"], outputs: ["valueChange", "send", "userMentions"] }], pipes: { "async": i6__namespace.AsyncPipe, "translate": i1__namespace.TranslatePipe } });
|
|
2155
2493
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputComponent, decorators: [{
|
|
2156
2494
|
type: i0.Component,
|
|
2157
2495
|
args: [{
|
|
@@ -2173,6 +2511,10 @@
|
|
|
2173
2511
|
type: i0.Input
|
|
2174
2512
|
}], mentionAutocompleteItemTemplate: [{
|
|
2175
2513
|
type: i0.Input
|
|
2514
|
+
}], commandAutocompleteItemTemplate: [{
|
|
2515
|
+
type: i0.Input
|
|
2516
|
+
}], mode: [{
|
|
2517
|
+
type: i0.Input
|
|
2176
2518
|
}], acceptedFileTypes: [{
|
|
2177
2519
|
type: i0.Input
|
|
2178
2520
|
}], isMultipleFileUploadEnabled: [{
|
|
@@ -2234,7 +2576,7 @@
|
|
|
2234
2576
|
return ModalComponent;
|
|
2235
2577
|
}());
|
|
2236
2578
|
ModalComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ModalComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2237
|
-
ModalComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ModalComponent, selector: "stream-modal", inputs: { isOpen: "isOpen" }, outputs: { isOpenChange: "isOpenChange" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n translate\n >\n streamChat.Close\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n <div class=\"str-chat__modal__inner\" #content>\n <ng-content></ng-content>\n </div>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type:
|
|
2579
|
+
ModalComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ModalComponent, selector: "stream-modal", inputs: { isOpen: "isOpen" }, outputs: { isOpenChange: "isOpenChange" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n translate\n >\n streamChat.Close\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n <div class=\"str-chat__modal__inner\" #content>\n <ng-content></ng-content>\n </div>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }] });
|
|
2238
2580
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ModalComponent, decorators: [{
|
|
2239
2581
|
type: i0.Component,
|
|
2240
2582
|
args: [{
|
|
@@ -2280,7 +2622,7 @@
|
|
|
2280
2622
|
return NotificationListComponent;
|
|
2281
2623
|
}());
|
|
2282
2624
|
NotificationListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationListComponent, deps: [{ token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
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:
|
|
2625
|
+
NotificationListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: NotificationListComponent, selector: "stream-notification-list", ngImport: i0__namespace, template: "<div class=\"str-chat__list-notifications\">\n <stream-notification\n *ngFor=\"let notification of notifications$ | async; trackBy: trackByItem\"\n [type]=\"notification.type\"\n ><div data-testclass=\"notification-content\">\n {{ notification.text | translate: notification.translateParams }}\n </div></stream-notification\n >\n</div>\n", components: [{ type: NotificationComponent, selector: "stream-notification", inputs: ["type"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6__namespace.AsyncPipe, "translate": i1__namespace.TranslatePipe } });
|
|
2284
2626
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationListComponent, decorators: [{
|
|
2285
2627
|
type: i0.Component,
|
|
2286
2628
|
args: [{
|
|
@@ -2333,23 +2675,32 @@
|
|
|
2333
2675
|
};
|
|
2334
2676
|
Object.defineProperty(MessageActionsBoxComponent.prototype, "isQuoteVisible", {
|
|
2335
2677
|
get: function () {
|
|
2336
|
-
|
|
2678
|
+
var _a;
|
|
2679
|
+
return ((this.enabledActions.indexOf('quote') !== -1 ||
|
|
2680
|
+
this.enabledActions.indexOf('quote-message') !== -1) &&
|
|
2681
|
+
!((_a = this.message) === null || _a === void 0 ? void 0 : _a.quoted_message));
|
|
2337
2682
|
},
|
|
2338
2683
|
enumerable: false,
|
|
2339
2684
|
configurable: true
|
|
2340
2685
|
});
|
|
2341
2686
|
Object.defineProperty(MessageActionsBoxComponent.prototype, "isEditVisible", {
|
|
2342
2687
|
get: function () {
|
|
2343
|
-
return ((this.enabledActions.indexOf('edit') !== -1
|
|
2344
|
-
this.enabledActions.indexOf('
|
|
2688
|
+
return (((this.enabledActions.indexOf('edit') !== -1 ||
|
|
2689
|
+
this.enabledActions.indexOf('update-own-message') !== -1) &&
|
|
2690
|
+
this.isMine) ||
|
|
2691
|
+
this.enabledActions.indexOf('edit-any') !== -1 ||
|
|
2692
|
+
this.enabledActions.indexOf('update-any-message') !== -1);
|
|
2345
2693
|
},
|
|
2346
2694
|
enumerable: false,
|
|
2347
2695
|
configurable: true
|
|
2348
2696
|
});
|
|
2349
2697
|
Object.defineProperty(MessageActionsBoxComponent.prototype, "isDeleteVisible", {
|
|
2350
2698
|
get: function () {
|
|
2351
|
-
return ((this.enabledActions.indexOf('delete') !== -1
|
|
2352
|
-
this.enabledActions.indexOf('delete-
|
|
2699
|
+
return (((this.enabledActions.indexOf('delete') !== -1 ||
|
|
2700
|
+
this.enabledActions.indexOf('delete-own-message') !== -1) &&
|
|
2701
|
+
this.isMine) ||
|
|
2702
|
+
this.enabledActions.indexOf('delete-any') !== -1 ||
|
|
2703
|
+
this.enabledActions.indexOf('delete-any-message') !== -1);
|
|
2353
2704
|
},
|
|
2354
2705
|
enumerable: false,
|
|
2355
2706
|
configurable: true
|
|
@@ -2363,7 +2714,9 @@
|
|
|
2363
2714
|
});
|
|
2364
2715
|
Object.defineProperty(MessageActionsBoxComponent.prototype, "isFlagVisible", {
|
|
2365
2716
|
get: function () {
|
|
2366
|
-
return this.enabledActions.indexOf('flag') !== -1
|
|
2717
|
+
return ((this.enabledActions.indexOf('flag') !== -1 ||
|
|
2718
|
+
this.enabledActions.indexOf('flag-message') !== -1) &&
|
|
2719
|
+
!this.isMine);
|
|
2367
2720
|
},
|
|
2368
2721
|
enumerable: false,
|
|
2369
2722
|
configurable: true
|
|
@@ -2403,7 +2756,7 @@
|
|
|
2403
2756
|
alert('Feature not yet implemented');
|
|
2404
2757
|
};
|
|
2405
2758
|
MessageActionsBoxComponent.prototype.quoteClicked = function () {
|
|
2406
|
-
|
|
2759
|
+
this.channelService.selectMessageToQuote(this.message);
|
|
2407
2760
|
};
|
|
2408
2761
|
MessageActionsBoxComponent.prototype.editClicked = function () {
|
|
2409
2762
|
this.isEditing.emit(true);
|
|
@@ -2436,7 +2789,7 @@
|
|
|
2436
2789
|
return MessageActionsBoxComponent;
|
|
2437
2790
|
}());
|
|
2438
2791
|
MessageActionsBoxComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageActionsBoxComponent, deps: [{ token: ChatClientService }, { token: NotificationService }, { token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
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:
|
|
2792
|
+
MessageActionsBoxComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: { messageInputTemplate: "messageInputTemplate", isOpen: "isOpen", isMine: "isMine", message: "message", enabledActions: "enabledActions" }, outputs: { displayedActionsCount: "displayedActionsCount", isEditing: "isEditing" }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: MessageInputComponent, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n data-testid=\"action-box\"\n class=\"str-chat__message-actions-box\"\n [class.str-chat__message-actions-box--open]=\"isOpen\"\n [class.str-chat__message-actions-box--mine]=\"isMine\"\n>\n <ul class=\"str-chat__message-actions-list\">\n <button\n data-testid=\"quote-action\"\n *ngIf=\"isQuoteVisible\"\n (click)=\"quoteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Reply\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"pin-action\"\n *ngIf=\"isPinVisible\"\n (click)=\"pinClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{\n (message?.pinned ? \"streamChat.Unpin\" : \"streamChat.Pin\") | translate\n }}\n </li>\n </button>\n <button\n data-testid=\"flag-action\"\n *ngIf=\"isFlagVisible\"\n (click)=\"flagClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Flag\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"mute-action\"\n *ngIf=\"isMuteVisible\"\n (click)=\"muteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Mute\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"edit-action\"\n *ngIf=\"isEditVisible\"\n (click)=\"editClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Edit Message\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"delete-action\"\n *ngIf=\"isDeleteVisible\"\n (click)=\"deleteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Delete\" | translate }}\n </li>\n </button>\n </ul>\n</div>\n\n<stream-modal\n [isOpen]=\"isEditModalOpen\"\n (isOpenChange)=\"\n isEditModalOpen = $event; isEditModalOpen ? '' : modalClosed()\n \"\n>\n <div class=\"str-chat__edit-message-form\" *ngIf=\"isEditModalOpen\">\n <ng-container *ngIf=\"messageInputTemplate; else defaultInput\">\n <ng-container\n *ngTemplateOutlet=\"\n messageInputTemplate;\n context: {\n message: message,\n messageUpdateHandler: modalClosed\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultInput>\n <stream-message-input\n [message]=\"message\"\n (messageUpdate)=\"modalClosed()\"\n ></stream-message-input>\n </ng-template>\n <stream-notification-list></stream-notification-list>\n <div\n class=\"\n str-chat__message-team-form-footer\n str-chat__message-team-form-footer-angular\n \"\n >\n <div class=\"str-chat__edit-message-form-options\">\n <button translate data-testid=\"cancel-button\" (click)=\"modalClosed()\">\n streamChat.Cancel\n </button>\n <button\n type=\"submit\"\n translate\n data-testid=\"send-button\"\n (click)=\"sendClicked()\"\n (keyup.enter)=\"sendClicked()\"\n >\n streamChat.Send\n </button>\n </div>\n </div>\n </div>\n</stream-modal>\n", components: [{ type: ModalComponent, selector: "stream-modal", inputs: ["isOpen"], outputs: ["isOpenChange"] }, { type: MessageInputComponent, selector: "stream-message-input", inputs: ["isFileUploadEnabled", "areMentionsEnabled", "mentionScope", "mentionAutocompleteItemTemplate", "commandAutocompleteItemTemplate", "mode", "acceptedFileTypes", "isMultipleFileUploadEnabled", "message"], outputs: ["messageUpdate"] }, { type: NotificationListComponent, selector: "stream-notification-list" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
2440
2793
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageActionsBoxComponent, decorators: [{
|
|
2441
2794
|
type: i0.Component,
|
|
2442
2795
|
args: [{
|
|
@@ -2469,11 +2822,12 @@
|
|
|
2469
2822
|
this.subscriptions = [];
|
|
2470
2823
|
this.isError$ = this.channelService.channels$.pipe(operators.map(function () { return false; }), operators.catchError(function () { return rxjs.of(true); }), operators.startWith(false));
|
|
2471
2824
|
this.isInitializing$ = this.channelService.channels$.pipe(operators.map(function (channels) { return !channels; }), operators.catchError(function () { return rxjs.of(false); }));
|
|
2825
|
+
this.isActiveThread$ = this.channelService.activeParentMessageId$.pipe(operators.map(function (id) { return !!id; }));
|
|
2472
2826
|
}
|
|
2473
2827
|
return ChannelComponent;
|
|
2474
2828
|
}());
|
|
2475
2829
|
ChannelComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelComponent, deps: [{ token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
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:
|
|
2830
|
+
ChannelComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelComponent, selector: "stream-channel", ngImport: i0__namespace, template: "<div\n *ngIf=\"(isError$ | async) === false && (isInitializing$ | async) === false\"\n class=\"str-chat str-chat-channel messaging\"\n>\n <div class=\"str-chat__container\">\n <div class=\"str-chat__main-panel\">\n <ng-content></ng-content>\n </div>\n <ng-content\n *ngIf=\"isActiveThread$ | async\"\n select='[name=\"thread\"]'\n ></ng-content>\n </div>\n</div>\n", directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i6__namespace.AsyncPipe } });
|
|
2477
2831
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelComponent, decorators: [{
|
|
2478
2832
|
type: i0.Component,
|
|
2479
2833
|
args: [{
|
|
@@ -2586,7 +2940,7 @@
|
|
|
2586
2940
|
return ChannelHeaderComponent;
|
|
2587
2941
|
}());
|
|
2588
2942
|
ChannelHeaderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelHeaderComponent, deps: [{ token: ChannelService }, { token: ChannelListToggleService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2589
|
-
ChannelHeaderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelHeaderComponent, selector: "stream-channel-header", ngImport: i0__namespace, template: "<div class=\"str-chat__header-livestream\">\n <div\n class=\"str-chat__header-hamburger\"\n (click)=\"toggleMenu($event)\"\n (keyup.enter)=\"toggleMenu($event)\"\n >\n <span class=\"str-chat__header-hamburger--line\"></span>\n <span class=\"str-chat__header-hamburger--line\"></span>\n <span class=\"str-chat__header-hamburger--line\"></span>\n </div>\n <stream-avatar\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ activeChannel?.data?.name }}\"\n ></stream-avatar>\n <div class=\"str-chat__header-livestream-left\">\n <p data-testid=\"name\" class=\"str-chat__header-livestream-left--title\">\n {{ activeChannel?.data?.name }}\n </p>\n <p data-testid=\"info\" class=\"str-chat__header-livestream-left--members\">\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{canReceiveConnectEvents ? ('streamChat.{{ watcherCount }} online' |\n translate:watcherCountParam) : ''}}\n </p>\n </div>\n</div>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate":
|
|
2943
|
+
ChannelHeaderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelHeaderComponent, selector: "stream-channel-header", ngImport: i0__namespace, template: "<div class=\"str-chat__header-livestream\">\n <div\n class=\"str-chat__header-hamburger\"\n (click)=\"toggleMenu($event)\"\n (keyup.enter)=\"toggleMenu($event)\"\n >\n <span class=\"str-chat__header-hamburger--line\"></span>\n <span class=\"str-chat__header-hamburger--line\"></span>\n <span class=\"str-chat__header-hamburger--line\"></span>\n </div>\n <stream-avatar\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ activeChannel?.data?.name }}\"\n ></stream-avatar>\n <div class=\"str-chat__header-livestream-left\">\n <p data-testid=\"name\" class=\"str-chat__header-livestream-left--title\">\n {{ activeChannel?.data?.name }}\n </p>\n <p data-testid=\"info\" class=\"str-chat__header-livestream-left--members\">\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{canReceiveConnectEvents ? ('streamChat.{{ watcherCount }} online' |\n translate:watcherCountParam) : ''}}\n </p>\n </div>\n</div>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
2590
2944
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelHeaderComponent, decorators: [{
|
|
2591
2945
|
type: i0.Component,
|
|
2592
2946
|
args: [{
|
|
@@ -2686,7 +3040,7 @@
|
|
|
2686
3040
|
return ChannelPreviewComponent;
|
|
2687
3041
|
}());
|
|
2688
3042
|
ChannelPreviewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelPreviewComponent, deps: [{ token: ChannelService }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2689
|
-
ChannelPreviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: { channel: "channel" }, ngImport: i0__namespace, template: "<button\n class=\"str-chat__channel-preview-messenger\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n data-testid=\"channel-preview-container\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar\n imageUrl=\"{{ avatarImage }}\"\n name=\"{{ avatarName }}\"\n [size]=\"40\"\n ></stream-avatar>\n </div>\n <div class=\"str-chat__channel-preview-messenger--right\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{ title }}</span>\n </div>\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n {{ latestMessage | translate }}\n </div>\n </div>\n</button>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate":
|
|
3043
|
+
ChannelPreviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: { channel: "channel" }, ngImport: i0__namespace, template: "<button\n class=\"str-chat__channel-preview-messenger\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n data-testid=\"channel-preview-container\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar\n imageUrl=\"{{ avatarImage }}\"\n name=\"{{ avatarName }}\"\n [size]=\"40\"\n ></stream-avatar>\n </div>\n <div class=\"str-chat__channel-preview-messenger--right\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{ title }}</span>\n </div>\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n {{ latestMessage | translate }}\n </div>\n </div>\n</button>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
2690
3044
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelPreviewComponent, decorators: [{
|
|
2691
3045
|
type: i0.Component,
|
|
2692
3046
|
args: [{
|
|
@@ -2736,7 +3090,7 @@
|
|
|
2736
3090
|
return ChannelListComponent;
|
|
2737
3091
|
}());
|
|
2738
3092
|
ChannelListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelListComponent, deps: [{ token: ChannelService }, { token: ChannelListToggleService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
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:
|
|
3093
|
+
ChannelListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelListComponent, selector: "stream-channel-list", inputs: { customChannelPreviewTemplate: "customChannelPreviewTemplate" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], ngImport: i0__namespace, template: "<div\n #container\n data-testid=\"channel-list-container\"\n class=\"str-chat str-chat-channel-list messaging\"\n [class.str-chat-channel-list--open]=\"(isOpen$ | async) === true\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false && (isInitializing$ | async) === false;\n else statusIndicator\n \"\n class=\"str-chat__channel-list-messenger\"\n >\n <div class=\"str-chat__channel-list-messenger__main\">\n <p\n data-testid=\"empty-channel-list-indicator\"\n *ngIf=\"!(channels$ | async)?.length\"\n >\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n <ng-container\n *ngFor=\"let channel of channels$ | async; trackBy: trackByChannelId\"\n >\n <ng-container\n *ngIf=\"customChannelPreviewTemplate; else defaultTemplate\"\n >\n <div (click)=\"channelSelected()\" (keyup.enter)=\"channelSelected()\">\n <ng-container\n *ngTemplateOutlet=\"\n customChannelPreviewTemplate;\n context: { channel: channel }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <ng-template #defaultTemplate>\n <stream-channel-preview\n data-testclass=\"channel-preview\"\n [channel]=\"channel\"\n (click)=\"channelSelected()\"\n (keyup.enter)=\"channelSelected()\"\n ></stream-channel-preview>\n </ng-template>\n </ng-container>\n <div\n *ngIf=\"hasMoreChannels$ | async\"\n class=\"str-chat__load-more-button\"\n (click)=\"loadMoreChannels()\"\n (keyup.enter)=\"loadMoreChannels()\"\n data-testid=\"load-more\"\n >\n <button\n class=\"str-chat__load-more-button__button\"\n data-testid=\"load-more-button\"\n [disabled]=\"isLoadingMoreChannels\"\n >\n <span *ngIf=\"!isLoadingMoreChannels; else loadingIndicator\">{{\n \"Load more\" | translate\n }}</span>\n <ng-template #loadingIndicator\n ><stream-loading-indicator></stream-loading-indicator\n ></ng-template>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #statusIndicator>\n <ng-container *ngIf=\"isError$ | async\">\n <ng-container *ngTemplateOutlet=\"chatDown\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isInitializing$ | async\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #chatDown>\n <div data-testid=\"chatdown-container\" class=\"str-chat__down\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n <div class=\"str-chat__down-main\">\n <stream-icon icon=\"connection-error\"></stream-icon>\n <h1>{{ \"streamChat.Connection error\" | translate }}</h1>\n <h3>\n {{\n \"streamChat.Error connecting to chat, refresh the page to try again.\"\n | translate\n }}\n </h3>\n </div>\n </div>\n</ng-template>\n\n<ng-template #loadingChannels>\n <div data-testid=\"loading-indicator\" class=\"str-chat__loading-channels\">\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannel>\n <div class=\"str-chat__loading-channels-item\">\n <div class=\"str-chat__loading-channels-avatar\"></div>\n <div class=\"str-chat__loading-channels-meta\">\n <div class=\"str-chat__loading-channels-username\"></div>\n <div class=\"str-chat__loading-channels-status\"></div>\n </div>\n </div>\n</ng-template>\n", components: [{ type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: ["channel"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i6__namespace.AsyncPipe, "translate": i1__namespace.TranslatePipe } });
|
|
2740
3094
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelListComponent, decorators: [{
|
|
2741
3095
|
type: i0.Component,
|
|
2742
3096
|
args: [{
|
|
@@ -2903,7 +3257,7 @@
|
|
|
2903
3257
|
return MessageReactionsComponent;
|
|
2904
3258
|
}());
|
|
2905
3259
|
MessageReactionsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageReactionsComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
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:
|
|
3260
|
+
MessageReactionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: { messageId: "messageId", messageReactionCounts: "messageReactionCounts", isSelectorOpen: "isSelectorOpen", latestReactions: "latestReactions", ownReactions: "ownReactions" }, outputs: { isSelectorOpenChange: "isSelectorOpenChange" }, viewQueries: [{ propertyName: "selectorContainer", first: true, predicate: ["selectorContainer"], descendants: true }, { propertyName: "selectorTooltip", first: true, predicate: ["selectorTooltip"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n *ngIf=\"existingReactions.length > 0 && !isSelectorOpen\"\n class=\"str-chat__reaction-list\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n data-testid=\"reaction-list\"\n>\n <ul>\n <li\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji\"\n >\n <span class=\"emoji\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n \n </li>\n <li>\n <span\n data-testid=\"reactions-count\"\n class=\"str-chat__reaction-list--counter\"\n >{{ reactionsCount }}</span\n >\n </li>\n </ul>\n</div>\n\n<div\n #selectorContainer\n class=\"str-chat__reaction-selector\"\n *ngIf=\"isSelectorOpen\"\n data-testid=\"reaction-selector\"\n>\n <div\n *ngIf=\"tooltipText\"\n data-testid=\"tooltip\"\n #selectorTooltip\n class=\"str-chat__reaction-selector-tooltip\"\n [ngStyle]=\"{\n left: tooltipPositions?.tooltip + 'px',\n visibility: tooltipPositions ? 'visible' : 'hidden'\n }\"\n >\n <div\n class=\"arrow\"\n [ngStyle]=\"{ left: tooltipPositions?.arrow + 'px' }\"\n ></div>\n <span class=\"latest-user-username\">\n {{ tooltipText }}\n </span>\n </div>\n <ul class=\"str-chat__message-reactions-list\">\n <li\n class=\"str-chat__message-reactions-list-item\"\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
3261
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageReactionsComponent, decorators: [{
|
|
2908
3262
|
type: i0.Component,
|
|
2909
3263
|
args: [{
|
|
@@ -2931,82 +3285,12 @@
|
|
|
2931
3285
|
args: ['selectorTooltip']
|
|
2932
3286
|
}] } });
|
|
2933
3287
|
|
|
2934
|
-
var ImageLoadService = /** @class */ (function () {
|
|
2935
|
-
function ImageLoadService() {
|
|
2936
|
-
this.imageLoad$ = new rxjs.Subject();
|
|
2937
|
-
}
|
|
2938
|
-
return ImageLoadService;
|
|
2939
|
-
}());
|
|
2940
|
-
ImageLoadService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2941
|
-
ImageLoadService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, providedIn: 'root' });
|
|
2942
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ImageLoadService, decorators: [{
|
|
2943
|
-
type: i0.Injectable,
|
|
2944
|
-
args: [{
|
|
2945
|
-
providedIn: 'root',
|
|
2946
|
-
}]
|
|
2947
|
-
}], ctorParameters: function () { return []; } });
|
|
2948
|
-
|
|
2949
|
-
var AttachmentListComponent = /** @class */ (function () {
|
|
2950
|
-
function AttachmentListComponent(imageLoadService) {
|
|
2951
|
-
this.imageLoadService = imageLoadService;
|
|
2952
|
-
this.attachments = [];
|
|
2953
|
-
this.orderedAttachments = [];
|
|
2954
|
-
}
|
|
2955
|
-
AttachmentListComponent.prototype.ngOnChanges = function () {
|
|
2956
|
-
var _this = this;
|
|
2957
|
-
this.orderedAttachments = __spreadArray(__spreadArray(__spreadArray([], __read(this.attachments.filter(function (a) { return _this.isImage(a); }))), __read(this.attachments.filter(function (a) { return _this.isFile(a); }))), __read(this.attachments.filter(function (a) { return _this.isCard(a); })));
|
|
2958
|
-
};
|
|
2959
|
-
AttachmentListComponent.prototype.trackById = function (index) {
|
|
2960
|
-
return index;
|
|
2961
|
-
};
|
|
2962
|
-
AttachmentListComponent.prototype.isImage = function (attachment) {
|
|
2963
|
-
return isImageAttachment(attachment);
|
|
2964
|
-
};
|
|
2965
|
-
AttachmentListComponent.prototype.isFile = function (attachment) {
|
|
2966
|
-
return attachment.type === 'file';
|
|
2967
|
-
};
|
|
2968
|
-
AttachmentListComponent.prototype.isCard = function (attachment) {
|
|
2969
|
-
return (!attachment.type ||
|
|
2970
|
-
(attachment.type === 'image' && !this.isImage(attachment)));
|
|
2971
|
-
};
|
|
2972
|
-
AttachmentListComponent.prototype.imageLoaded = function () {
|
|
2973
|
-
this.imageLoadService.imageLoad$.next();
|
|
2974
|
-
};
|
|
2975
|
-
AttachmentListComponent.prototype.hasFileSize = function (attachment) {
|
|
2976
|
-
return (attachment.file_size && Number.isFinite(Number(attachment.file_size)));
|
|
2977
|
-
};
|
|
2978
|
-
AttachmentListComponent.prototype.getFileSize = function (attachment) {
|
|
2979
|
-
return prettybytes__default['default'](attachment.file_size);
|
|
2980
|
-
};
|
|
2981
|
-
AttachmentListComponent.prototype.trimUrl = function (url) {
|
|
2982
|
-
if (url !== undefined && url !== null) {
|
|
2983
|
-
var _a = __read(url
|
|
2984
|
-
.replace(/^(?:https?:\/\/)?(?:www\.)?/i, '')
|
|
2985
|
-
.split('/'), 1), trimmedUrl = _a[0];
|
|
2986
|
-
return trimmedUrl;
|
|
2987
|
-
}
|
|
2988
|
-
return null;
|
|
2989
|
-
};
|
|
2990
|
-
return AttachmentListComponent;
|
|
2991
|
-
}());
|
|
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: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2994
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentListComponent, decorators: [{
|
|
2995
|
-
type: i0.Component,
|
|
2996
|
-
args: [{
|
|
2997
|
-
selector: 'stream-attachment-list',
|
|
2998
|
-
templateUrl: './attachment-list.component.html',
|
|
2999
|
-
styles: [],
|
|
3000
|
-
}]
|
|
3001
|
-
}], ctorParameters: function () { return [{ type: ImageLoadService }]; }, propDecorators: { attachments: [{
|
|
3002
|
-
type: i0.Input
|
|
3003
|
-
}] } });
|
|
3004
|
-
|
|
3005
3288
|
var MessageComponent = /** @class */ (function () {
|
|
3006
3289
|
function MessageComponent(chatClientService, channelService) {
|
|
3007
3290
|
this.chatClientService = chatClientService;
|
|
3008
3291
|
this.channelService = channelService;
|
|
3009
3292
|
this.enabledMessageActions = [];
|
|
3293
|
+
this.mode = 'main';
|
|
3010
3294
|
this.isActionBoxOpen = false;
|
|
3011
3295
|
this.isReactionSelectorOpen = false;
|
|
3012
3296
|
this.isPressedOnMobile = false;
|
|
@@ -3015,47 +3299,8 @@
|
|
|
3015
3299
|
this.user = this.chatClientService.chatClient.user;
|
|
3016
3300
|
}
|
|
3017
3301
|
MessageComponent.prototype.ngOnChanges = function (changes) {
|
|
3018
|
-
var _this = this;
|
|
3019
|
-
var _a, _b;
|
|
3020
3302
|
if (changes.message) {
|
|
3021
|
-
|
|
3022
|
-
if (!content) {
|
|
3023
|
-
this.messageTextParts = [];
|
|
3024
|
-
}
|
|
3025
|
-
else {
|
|
3026
|
-
// Backend will wrap HTML content with <p></p>\n
|
|
3027
|
-
if (content.startsWith('<p>')) {
|
|
3028
|
-
content = content.replace('<p>', '');
|
|
3029
|
-
}
|
|
3030
|
-
if (content.endsWith('</p>\n')) {
|
|
3031
|
-
content = content.replace('</p>\n', '');
|
|
3032
|
-
}
|
|
3033
|
-
if (!this.message.mentioned_users ||
|
|
3034
|
-
this.message.mentioned_users.length === 0) {
|
|
3035
|
-
this.messageTextParts = [{ content: content, type: 'text' }];
|
|
3036
|
-
}
|
|
3037
|
-
else {
|
|
3038
|
-
this.messageTextParts = [];
|
|
3039
|
-
var text_1 = content;
|
|
3040
|
-
this.message.mentioned_users.forEach(function (user) {
|
|
3041
|
-
var mention = "@" + (user.name || user.id);
|
|
3042
|
-
var precedingText = text_1.substring(0, text_1.indexOf(mention));
|
|
3043
|
-
_this.messageTextParts.push({
|
|
3044
|
-
content: precedingText,
|
|
3045
|
-
type: 'text',
|
|
3046
|
-
});
|
|
3047
|
-
_this.messageTextParts.push({
|
|
3048
|
-
content: mention,
|
|
3049
|
-
type: 'mention',
|
|
3050
|
-
user: user,
|
|
3051
|
-
});
|
|
3052
|
-
text_1 = text_1.replace(precedingText + mention, '');
|
|
3053
|
-
});
|
|
3054
|
-
if (text_1) {
|
|
3055
|
-
this.messageTextParts.push({ content: text_1, type: 'text' });
|
|
3056
|
-
}
|
|
3057
|
-
}
|
|
3058
|
-
}
|
|
3303
|
+
this.createMessageParts();
|
|
3059
3304
|
}
|
|
3060
3305
|
};
|
|
3061
3306
|
Object.defineProperty(MessageComponent.prototype, "isSentByCurrentUser", {
|
|
@@ -3127,7 +3372,8 @@
|
|
|
3127
3372
|
this.message.type === 'system' ||
|
|
3128
3373
|
this.message.type === 'ephemeral' ||
|
|
3129
3374
|
this.message.status === 'failed' ||
|
|
3130
|
-
this.message.status === 'sending'
|
|
3375
|
+
this.message.status === 'sending' ||
|
|
3376
|
+
(this.mode === 'thread' && !this.message.parent_id));
|
|
3131
3377
|
},
|
|
3132
3378
|
enumerable: false,
|
|
3133
3379
|
configurable: true
|
|
@@ -3149,6 +3395,33 @@
|
|
|
3149
3395
|
enumerable: false,
|
|
3150
3396
|
configurable: true
|
|
3151
3397
|
});
|
|
3398
|
+
Object.defineProperty(MessageComponent.prototype, "replyCountParam", {
|
|
3399
|
+
get: function () {
|
|
3400
|
+
var _a;
|
|
3401
|
+
return { replyCount: (_a = this.message) === null || _a === void 0 ? void 0 : _a.reply_count };
|
|
3402
|
+
},
|
|
3403
|
+
enumerable: false,
|
|
3404
|
+
configurable: true
|
|
3405
|
+
});
|
|
3406
|
+
Object.defineProperty(MessageComponent.prototype, "canDisplayReadStatus", {
|
|
3407
|
+
get: function () {
|
|
3408
|
+
return (this.canReceiveReadEvents !== false &&
|
|
3409
|
+
this.enabledMessageActions.indexOf('read-events') !== -1);
|
|
3410
|
+
},
|
|
3411
|
+
enumerable: false,
|
|
3412
|
+
configurable: true
|
|
3413
|
+
});
|
|
3414
|
+
Object.defineProperty(MessageComponent.prototype, "quotedMessageAttachments", {
|
|
3415
|
+
get: function () {
|
|
3416
|
+
var _a, _b;
|
|
3417
|
+
var originalAttachments = (_b = (_a = this.message) === null || _a === void 0 ? void 0 : _a.quoted_message) === null || _b === void 0 ? void 0 : _b.attachments;
|
|
3418
|
+
return originalAttachments && originalAttachments.length
|
|
3419
|
+
? [originalAttachments[0]]
|
|
3420
|
+
: [];
|
|
3421
|
+
},
|
|
3422
|
+
enumerable: false,
|
|
3423
|
+
configurable: true
|
|
3424
|
+
});
|
|
3152
3425
|
MessageComponent.prototype.resendMessage = function () {
|
|
3153
3426
|
void this.channelService.resendMessage(this.message);
|
|
3154
3427
|
};
|
|
@@ -3171,10 +3444,55 @@
|
|
|
3171
3444
|
};
|
|
3172
3445
|
window.addEventListener('click', eventHandler);
|
|
3173
3446
|
};
|
|
3447
|
+
MessageComponent.prototype.setAsActiveParentMessage = function () {
|
|
3448
|
+
void this.channelService.setAsActiveParentMessage(this.message);
|
|
3449
|
+
};
|
|
3450
|
+
MessageComponent.prototype.createMessageParts = function () {
|
|
3451
|
+
var _this = this;
|
|
3452
|
+
var _a, _b;
|
|
3453
|
+
var content = ((_a = this.message) === null || _a === void 0 ? void 0 : _a.html) || ((_b = this.message) === null || _b === void 0 ? void 0 : _b.text);
|
|
3454
|
+
if (!content) {
|
|
3455
|
+
this.messageTextParts = [];
|
|
3456
|
+
}
|
|
3457
|
+
else {
|
|
3458
|
+
// Backend will wrap HTML content with <p></p>\n
|
|
3459
|
+
if (content.startsWith('<p>')) {
|
|
3460
|
+
content = content.replace('<p>', '');
|
|
3461
|
+
}
|
|
3462
|
+
if (content.endsWith('</p>\n')) {
|
|
3463
|
+
content = content.replace('</p>\n', '');
|
|
3464
|
+
}
|
|
3465
|
+
if (!this.message.mentioned_users ||
|
|
3466
|
+
this.message.mentioned_users.length === 0) {
|
|
3467
|
+
this.messageTextParts = [{ content: content, type: 'text' }];
|
|
3468
|
+
}
|
|
3469
|
+
else {
|
|
3470
|
+
this.messageTextParts = [];
|
|
3471
|
+
var text_1 = content;
|
|
3472
|
+
this.message.mentioned_users.forEach(function (user) {
|
|
3473
|
+
var mention = "@" + (user.name || user.id);
|
|
3474
|
+
var precedingText = text_1.substring(0, text_1.indexOf(mention));
|
|
3475
|
+
_this.messageTextParts.push({
|
|
3476
|
+
content: precedingText,
|
|
3477
|
+
type: 'text',
|
|
3478
|
+
});
|
|
3479
|
+
_this.messageTextParts.push({
|
|
3480
|
+
content: mention,
|
|
3481
|
+
type: 'mention',
|
|
3482
|
+
user: user,
|
|
3483
|
+
});
|
|
3484
|
+
text_1 = text_1.replace(precedingText + mention, '');
|
|
3485
|
+
});
|
|
3486
|
+
if (text_1) {
|
|
3487
|
+
this.messageTextParts.push({ content: text_1, type: 'text' });
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
};
|
|
3174
3492
|
return MessageComponent;
|
|
3175
3493
|
}());
|
|
3176
3494
|
MessageComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageComponent, deps: [{ token: ChatClientService }, { token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
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 } });
|
|
3495
|
+
MessageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageComponent, selector: "stream-message", inputs: { messageInputTemplate: "messageInputTemplate", mentionTemplate: "mentionTemplate", message: "message", enabledMessageActions: "enabledMessageActions", areReactionsEnabled: "areReactionsEnabled", canReactToMessage: "canReactToMessage", isLastSentMessage: "isLastSentMessage", canReceiveReadEvents: "canReceiveReadEvents", mode: "mode" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n #container\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.mobile-press]=\"isPressedOnMobile\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"\n areReactionsEnabled !== false && hasReactions\n \"\n data-testid=\"message-container\"\n>\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n mode === 'main' &&\n isMessageDeliveredAndRead &&\n canDisplayReadStatus;\n else deliveredStatus\n \"\n >\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <stream-avatar\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n ></stream-avatar>\n <div class=\"str-chat__message-inner\">\n <div\n class=\"str-chat__message-simple__actions\"\n data-testid=\"message-options\"\n *ngIf=\"areOptionsVisible\"\n >\n <div\n data-testid=\"message-actions-container\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--options\n \"\n [class.str-chat-angular__message-simple__actions__action--options--editing]=\"\n isEditing\n \"\n >\n <stream-message-actions-box\n [isOpen]=\"isActionBoxOpen\"\n [isMine]=\"isSentByCurrentUser\"\n [enabledActions]=\"enabledMessageActions\"\n [message]=\"message\"\n (displayedActionsCount)=\"visibleMessageActionsCount = $event\"\n (isEditing)=\"isEditing = $event; isActionBoxOpen = !isEditing\"\n [messageInputTemplate]=\"messageInputTemplate\"\n ></stream-message-actions-box>\n <stream-icon\n *ngIf=\"visibleMessageActionsCount > 0\"\n data-testid=\"action-icon\"\n icon=\"action-icon\"\n (keyup.enter)=\"isActionBoxOpen = !isActionBoxOpen\"\n (click)=\"isActionBoxOpen = !isActionBoxOpen\"\n ></stream-icon>\n </div>\n <!-- eslint-disable @angular-eslint/template/conditional-complexity -->\n <div\n *ngIf=\"\n enabledMessageActions.indexOf('send-reply') !== -1 &&\n mode === 'main'\n \"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--thread\n \"\n data-testid=\"reply-in-thread\"\n (click)=\"setAsActiveParentMessage()\"\n (keyup.enter)=\"setAsActiveParentMessage()\"\n >\n <stream-icon icon=\"reply-in-thread\"></stream-icon>\n </div>\n <div\n *ngIf=\"\n areReactionsEnabled !== false &&\n canReactToMessage !== false &&\n enabledMessageActions.indexOf('send-reaction') !== -1\n \"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--reactions\n \"\n data-testid=\"reaction-icon\"\n (click)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n (keyup.enter)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n >\n <stream-icon icon=\"reaction-icon\"></stream-icon>\n </div>\n </div>\n <!-- eslint-enable @angular-eslint/template/conditional-complexity -->\n <stream-message-reactions\n *ngIf=\"areReactionsEnabled !== false\"\n [messageReactionCounts]=\"message?.reaction_counts || {}\"\n [latestReactions]=\"message?.latest_reactions || []\"\n [(isSelectorOpen)]=\"isReactionSelectorOpen\"\n [messageId]=\"message?.id\"\n [ownReactions]=\"message?.own_reactions || []\"\n ></stream-message-reactions>\n <stream-attachment-list\n *ngIf=\"hasAttachment && !message?.quoted_message\"\n [attachments]=\"message!.attachments!\"\n [messageId]=\"message!.id\"\n ></stream-attachment-list>\n <div class=\"str-chat__message-text\" *ngIf=\"message?.text\">\n <div\n data-testid=\"inner-message\"\n class=\"\n str-chat__message-text-inner str-chat__message-simple-text-inner\n \"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n (click)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n (keyup.enter)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n >\n <ng-container *ngTemplateOutlet=\"quotedMessage\"></ng-container>\n <stream-attachment-list\n *ngIf=\"hasAttachment && message?.quoted_message\"\n [attachments]=\"message!.attachments!\"\n [messageId]=\"message!.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"client-error-message\"\n *ngIf=\"message?.type === 'error'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{ \"streamChat.Error \u00B7 Unsent\" | translate }}\n </div>\n <div\n data-testid=\"error-message\"\n *ngIf=\"message?.status === 'failed'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed \u00B7 Unauthorized\"\n : \"streamChat.Message Failed \u00B7 Click to try again\"\n ) | translate\n }}\n </div>\n <div\n (click)=\"textClicked()\"\n (keyup.enter)=\"textClicked()\"\n data-testid=\"text\"\n >\n <p>\n <!-- eslint-disable-next-line @angular-eslint/template/use-track-by-function -->\n <ng-container *ngFor=\"let part of messageTextParts\">\n <span\n *ngIf=\"part.type === 'text'; else mention\"\n [innerHTML]=\"part.content\"\n ></span>\n <ng-template #mention>\n <ng-container *ngIf=\"mentionTemplate; else defaultMention\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionTemplate;\n context: { user: part.user! }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultMention>\n <b>{{ part.content }}</b>\n </ng-template>\n </ng-template>\n </ng-container>\n </p>\n </div>\n </div>\n </div>\n <div class=\"str-chat__message-simple-reply-button\">\n <button\n *ngIf=\"\n !!message?.reply_count &&\n mode !== 'thread' &&\n enabledMessageActions.indexOf('send-reply') !== -1\n \"\n class=\"str-chat__message-replies-count-button\"\n data-testid=\"reply-count-button\"\n (click)=\"setAsActiveParentMessage()\"\n >\n <stream-icon icon=\"reply\"></stream-icon>\n {{message?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </button>\n </div>\n <div class=\"str-chat__message-data str-chat__message-simple-data\">\n <span\n data-testid=\"sender\"\n *ngIf=\"!isSentByCurrentUser\"\n class=\"str-chat__message-simple-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span data-testid=\"date\" class=\"str-chat__message-simple-timestamp\">\n {{ parsedDate }}\n </span>\n </div>\n </div>\n </ng-container>\n </ng-container>\n</div>\n\n<ng-template #sendingStatus>\n <span\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"sending-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n <stream-loading-indicator\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator>\n </span>\n</ng-template>\n<ng-template #readStatus>\n <span\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"read-indicator\"\n >\n <div class=\"str-chat__tooltip\" data-testid=\"read-by-tooltip\">\n {{ readByText }}\n </div>\n <stream-avatar\n class=\"str-chat-angular__avatar-host\"\n data-test-id=\"last-read-user-avatar\"\n [size]=\"15\"\n [imageUrl]=\"lastReadUser?.image\"\n [name]=\"lastReadUser?.name || lastReadUser?.id\"\n ></stream-avatar>\n <span\n data-test-id=\"read-by-length\"\n *ngIf=\"isReadByMultipleUsers\"\n class=\"str-chat__message-simple-status-number\"\n >\n {{ (message?.readBy)!.length }}\n </span>\n </span>\n</ng-template>\n<ng-template #deliveredStatus>\n <span\n *ngIf=\"mode === 'main'\"\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"delivered-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n <stream-icon\n data-testid=\"delivered-icon\"\n icon=\"delivered-icon\"\n ></stream-icon>\n </span>\n</ng-template>\n\n<ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n</ng-template>\n\n<ng-template #systemMessage>\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ message?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n</ng-template>\n\n<ng-template #quotedMessage>\n <div\n *ngIf=\"message?.quoted_message\"\n class=\"quoted-message\"\n data-testid=\"quoted-message-container\"\n [class.mine]=\"isSentByCurrentUser\"\n >\n <stream-avatar\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.quoted_message?.user?.image\"\n [name]=\"\n message?.quoted_message?.user?.name || message?.quoted_message?.user?.id\n \"\n [size]=\"20\"\n ></stream-avatar>\n <div class=\"quoted-message-inner\">\n <stream-attachment-list\n *ngIf=\"\n message?.quoted_message?.attachments &&\n message?.quoted_message?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"message?.quoted_message?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"\n message?.quoted_message?.html || message?.quoted_message?.text\n \"\n ></div>\n </div>\n </div>\n</ng-template>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }, { type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: ["messageInputTemplate", "isOpen", "isMine", "message", "enabledActions"], outputs: ["displayedActionsCount", "isEditing"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: ["messageId", "messageReactionCounts", "isSelectorOpen", "latestReactions", "ownReactions"], outputs: ["isSelectorOpenChange"] }, { type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["messageId", "attachments"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
3178
3496
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageComponent, decorators: [{
|
|
3179
3497
|
type: i0.Component,
|
|
3180
3498
|
args: [{
|
|
@@ -3198,6 +3516,8 @@
|
|
|
3198
3516
|
type: i0.Input
|
|
3199
3517
|
}], canReceiveReadEvents: [{
|
|
3200
3518
|
type: i0.Input
|
|
3519
|
+
}], mode: [{
|
|
3520
|
+
type: i0.Input
|
|
3201
3521
|
}], container: [{
|
|
3202
3522
|
type: i0.ViewChild,
|
|
3203
3523
|
args: ['container']
|
|
@@ -3222,7 +3542,7 @@
|
|
|
3222
3542
|
return TextareaComponent;
|
|
3223
3543
|
}());
|
|
3224
3544
|
TextareaComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: TextareaComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3225
|
-
TextareaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: TextareaComponent, selector: "stream-textarea", inputs: { value: "value" }, outputs: { valueChange: "valueChange", send: "send" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ 'streamChat.Type your message' | translate }}\"\n class=\"rta__textarea str-chat__textarea__textarea\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n></textarea>\n", pipes: { "translate":
|
|
3545
|
+
TextareaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: TextareaComponent, selector: "stream-textarea", inputs: { value: "value" }, outputs: { valueChange: "valueChange", send: "send" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ 'streamChat.Type your message' | translate }}\"\n class=\"rta__textarea str-chat__textarea__textarea\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n></textarea>\n", pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
3226
3546
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: TextareaComponent, decorators: [{
|
|
3227
3547
|
type: i0.Component,
|
|
3228
3548
|
args: [{
|
|
@@ -3271,8 +3591,9 @@
|
|
|
3271
3591
|
this.valueChange = new i0.EventEmitter();
|
|
3272
3592
|
this.send = new i0.EventEmitter();
|
|
3273
3593
|
this.userMentions = new i0.EventEmitter();
|
|
3274
|
-
this.
|
|
3594
|
+
this.autocompleteKey = 'autocompleteLabel';
|
|
3275
3595
|
this.mentionTriggerChar = '@';
|
|
3596
|
+
this.commandTriggerChar = '/';
|
|
3276
3597
|
this.autocompleteConfig = {
|
|
3277
3598
|
mentions: [],
|
|
3278
3599
|
};
|
|
@@ -3281,7 +3602,15 @@
|
|
|
3281
3602
|
this.userMentionConfig = {
|
|
3282
3603
|
triggerChar: this.mentionTriggerChar,
|
|
3283
3604
|
dropUp: true,
|
|
3284
|
-
labelKey: this.
|
|
3605
|
+
labelKey: this.autocompleteKey,
|
|
3606
|
+
returnTrigger: true,
|
|
3607
|
+
mentionFilter: function (searchString, items) { return _this.filter(searchString, items); },
|
|
3608
|
+
mentionSelect: function (item, triggerChar) { return _this.itemSelectedFromAutocompleteList(item, triggerChar); },
|
|
3609
|
+
};
|
|
3610
|
+
this.slashCommandConfig = {
|
|
3611
|
+
triggerChar: this.commandTriggerChar,
|
|
3612
|
+
dropUp: true,
|
|
3613
|
+
labelKey: 'name',
|
|
3285
3614
|
returnTrigger: true,
|
|
3286
3615
|
mentionFilter: function (searchString, items) { return _this.filter(searchString, items); },
|
|
3287
3616
|
mentionSelect: function (item, triggerChar) { return _this.itemSelectedFromAutocompleteList(item, triggerChar); },
|
|
@@ -3294,20 +3623,33 @@
|
|
|
3294
3623
|
void _this.updateMentionOptions(searchTerm);
|
|
3295
3624
|
}
|
|
3296
3625
|
});
|
|
3297
|
-
this.subscriptions.push(this.channelService.activeChannel$.subscribe(function () {
|
|
3626
|
+
this.subscriptions.push(this.channelService.activeChannel$.subscribe(function (channel) {
|
|
3627
|
+
var _a;
|
|
3628
|
+
var commands = ((_a = channel === null || channel === void 0 ? void 0 : channel.getConfig()) === null || _a === void 0 ? void 0 : _a.commands) || [];
|
|
3629
|
+
_this.slashCommandConfig.items = commands.map(function (c) {
|
|
3630
|
+
var _b;
|
|
3631
|
+
return (Object.assign(Object.assign({}, c), (_b = {}, _b[_this.autocompleteKey] = c.name, _b.type = 'command', _b)));
|
|
3632
|
+
});
|
|
3298
3633
|
_this.mentionedUsers = [];
|
|
3299
3634
|
_this.userMentions.next(__spreadArray([], __read(_this.mentionedUsers)));
|
|
3300
3635
|
void _this.updateMentionOptions(_this.searchTerm$.getValue());
|
|
3301
3636
|
}));
|
|
3637
|
+
this.autocompleteConfig.mentions = [
|
|
3638
|
+
this.userMentionConfig,
|
|
3639
|
+
this.slashCommandConfig,
|
|
3640
|
+
];
|
|
3302
3641
|
}
|
|
3303
3642
|
AutocompleteTextareaComponent.prototype.ngOnChanges = function (changes) {
|
|
3304
3643
|
if (changes.areMentionsEnabled) {
|
|
3305
3644
|
if (this.areMentionsEnabled) {
|
|
3306
|
-
this.autocompleteConfig.mentions = [
|
|
3645
|
+
this.autocompleteConfig.mentions = [
|
|
3646
|
+
this.userMentionConfig,
|
|
3647
|
+
this.slashCommandConfig,
|
|
3648
|
+
];
|
|
3307
3649
|
this.autocompleteConfig = Object.assign({}, this.autocompleteConfig);
|
|
3308
3650
|
}
|
|
3309
3651
|
else {
|
|
3310
|
-
this.autocompleteConfig.mentions = [];
|
|
3652
|
+
this.autocompleteConfig.mentions = [this.slashCommandConfig];
|
|
3311
3653
|
this.autocompleteConfig = Object.assign({}, this.autocompleteConfig);
|
|
3312
3654
|
}
|
|
3313
3655
|
}
|
|
@@ -3325,7 +3667,9 @@
|
|
|
3325
3667
|
this.mentionedUsers.push((item.user ? item.user : item));
|
|
3326
3668
|
this.userMentions.next(__spreadArray([], __read(this.mentionedUsers)));
|
|
3327
3669
|
}
|
|
3328
|
-
return triggerChar +
|
|
3670
|
+
return (triggerChar +
|
|
3671
|
+
item.autocompleteLabel +
|
|
3672
|
+
(triggerChar === this.commandTriggerChar ? ' ' : ''));
|
|
3329
3673
|
};
|
|
3330
3674
|
AutocompleteTextareaComponent.prototype.autcompleteSearchTermChanged = function (searchTerm) {
|
|
3331
3675
|
if (searchTerm === this.mentionTriggerChar) {
|
|
@@ -3358,8 +3702,8 @@
|
|
|
3358
3702
|
return __awaiter(this, void 0, void 0, function () {
|
|
3359
3703
|
var request, result, items;
|
|
3360
3704
|
var _this = this;
|
|
3361
|
-
return __generator(this, function (
|
|
3362
|
-
switch (
|
|
3705
|
+
return __generator(this, function (_b) {
|
|
3706
|
+
switch (_b.label) {
|
|
3363
3707
|
case 0:
|
|
3364
3708
|
if (!this.areMentionsEnabled) {
|
|
3365
3709
|
return [2 /*return*/];
|
|
@@ -3370,13 +3714,16 @@
|
|
|
3370
3714
|
: function (s) { return _this.channelService.autocompleteMembers(s); };
|
|
3371
3715
|
return [4 /*yield*/, request(searchTerm || '')];
|
|
3372
3716
|
case 1:
|
|
3373
|
-
result =
|
|
3717
|
+
result = _b.sent();
|
|
3374
3718
|
items = this.filter(searchTerm || '', result.map(function (i) {
|
|
3375
3719
|
var user = (i.user ? i.user : i);
|
|
3376
3720
|
return Object.assign(Object.assign({}, i), { autocompleteLabel: user.name || user.id, type: 'mention' });
|
|
3377
3721
|
}));
|
|
3378
3722
|
this.userMentionConfig.items = items;
|
|
3379
|
-
this.autocompleteConfig.mentions = [
|
|
3723
|
+
this.autocompleteConfig.mentions = [
|
|
3724
|
+
this.userMentionConfig,
|
|
3725
|
+
this.slashCommandConfig,
|
|
3726
|
+
];
|
|
3380
3727
|
this.autocompleteConfig = Object.assign({}, this.autocompleteConfig);
|
|
3381
3728
|
return [2 /*return*/];
|
|
3382
3729
|
}
|
|
@@ -3400,7 +3747,7 @@
|
|
|
3400
3747
|
return AutocompleteTextareaComponent;
|
|
3401
3748
|
}());
|
|
3402
3749
|
AutocompleteTextareaComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AutocompleteTextareaComponent, deps: [{ token: ChannelService }, { token: ChatClientService }, { token: TransliterationService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
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:
|
|
3750
|
+
AutocompleteTextareaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AutocompleteTextareaComponent, selector: "stream-autocomplete-textarea", inputs: { value: "value", areMentionsEnabled: "areMentionsEnabled", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", commandAutocompleteItemTemplate: "commandAutocompleteItemTemplate", mentionScope: "mentionScope" }, outputs: { valueChange: "valueChange", send: "send", userMentions: "userMentions" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ 'streamChat.Type your message' | translate }}\"\n class=\"rta__textarea str-chat__textarea__textarea\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n [mentionConfig]=\"autocompleteConfig\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n [mentionListTemplate]=\"autocompleteItem\"\n (blur)=\"inputLeft()\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <div class=\"rta rta__item str-chat__emojisearch__item\" [ngSwitch]=\"item.type\">\n <div class=\"rta__entity\" *ngSwitchCase=\"'mention'\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n <div class=\"rta__entity\" *ngSwitchCase=\"'command'\">\n <ng-container\n *ngTemplateOutlet=\"\n commandAutocompleteItemTemplate || defaultCommandTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #defaultCommandTemplate let-item=\"item\">\n <div class=\"str-chat__slash-command\">\n <span class=\"str-chat__slash-command-header\">\n <strong data-testclass=\"command-name\">{{ item.name }}</strong>\n {{ item.args }}\n </span>\n <br />\n <span class=\"str-chat__slash-command-description\">{{\n item.description\n }}</span>\n </div>\n</ng-template>\n\n<ng-template #defaultMentionTemplate let-item=\"item\">\n <div class=\"str-chat__user-item\">\n <stream-avatar\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n style=\"height: 20px\"\n [size]=\"20\"\n [imageUrl]=\"item.image || item.user?.image\"\n [name]=\"item.autocompleteLabel\"\n ></stream-avatar>\n <span data-testclass=\"username\" class=\"str-chat__user-item--name\">{{\n item.autocompleteLabel\n }}</span>\n </div>\n</ng-template>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], directives: [{ type: i5__namespace.MentionDirective, selector: "[mention], [mentionConfig]", inputs: ["mentionConfig", "mention", "mentionListTemplate"], outputs: ["searchTerm", "itemSelected", "opened", "closed"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
3404
3751
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AutocompleteTextareaComponent, decorators: [{
|
|
3405
3752
|
type: i0.Component,
|
|
3406
3753
|
args: [{
|
|
@@ -3416,6 +3763,8 @@
|
|
|
3416
3763
|
type: i0.Input
|
|
3417
3764
|
}], mentionAutocompleteItemTemplate: [{
|
|
3418
3765
|
type: i0.Input
|
|
3766
|
+
}], commandAutocompleteItemTemplate: [{
|
|
3767
|
+
type: i0.Input
|
|
3419
3768
|
}], mentionScope: [{
|
|
3420
3769
|
type: i0.Input
|
|
3421
3770
|
}], valueChange: [{
|
|
@@ -3476,30 +3825,37 @@
|
|
|
3476
3825
|
this.channelService = channelService;
|
|
3477
3826
|
this.chatClientService = chatClientService;
|
|
3478
3827
|
this.imageLoadService = imageLoadService;
|
|
3479
|
-
|
|
3828
|
+
/**
|
|
3829
|
+
* @deprecated https://getstream.io/chat/docs/sdk/angular/components/message_list/#caution-arereactionsenabled-deprecated
|
|
3830
|
+
*/
|
|
3831
|
+
this.areReactionsEnabled = undefined;
|
|
3832
|
+
/**
|
|
3833
|
+
* @deprecated https://getstream.io/chat/docs/sdk/angular/components/message_list/#caution-enabledmessageactions-deprecated
|
|
3834
|
+
*/
|
|
3480
3835
|
/* eslint-disable-next-line @angular-eslint/no-input-rename */
|
|
3481
|
-
this.enabledMessageActionsInput =
|
|
3836
|
+
this.enabledMessageActionsInput = undefined;
|
|
3837
|
+
this.mode = 'main';
|
|
3482
3838
|
this.enabledMessageActions = [];
|
|
3483
3839
|
this.class = 'str-chat-angular__main-panel-inner str-chat-angular__message-list-host';
|
|
3484
3840
|
this.unreadMessageCount = 0;
|
|
3485
3841
|
this.groupStyles = [];
|
|
3486
3842
|
this.authorizedMessageActions = ['flag'];
|
|
3487
3843
|
this.isUserScrolledUpThreshold = 300;
|
|
3488
|
-
this.
|
|
3844
|
+
this.subscriptions = [];
|
|
3845
|
+
this.subscriptions.push(this.channelService.activeChannel$.subscribe(function (channel) {
|
|
3489
3846
|
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;
|
|
3847
|
+
_this.resetScrollState();
|
|
3498
3848
|
var capabilites = (_a = channel === null || channel === void 0 ? void 0 : channel.data) === null || _a === void 0 ? void 0 : _a.own_capabilities;
|
|
3499
3849
|
if (capabilites) {
|
|
3500
3850
|
_this.canReactToMessage = capabilites.indexOf('send-reaction') !== -1;
|
|
3501
3851
|
_this.canReceiveReadEvents = capabilites.indexOf('read-events') !== -1;
|
|
3502
3852
|
_this.authorizedMessageActions = [];
|
|
3853
|
+
if (_this.canReactToMessage) {
|
|
3854
|
+
_this.authorizedMessageActions.push('send-reaction');
|
|
3855
|
+
}
|
|
3856
|
+
if (_this.canReceiveReadEvents) {
|
|
3857
|
+
_this.authorizedMessageActions.push('read-events');
|
|
3858
|
+
}
|
|
3503
3859
|
if (capabilites.indexOf('flag-message') !== -1) {
|
|
3504
3860
|
_this.authorizedMessageActions.push('flag');
|
|
3505
3861
|
}
|
|
@@ -3517,46 +3873,16 @@
|
|
|
3517
3873
|
_this.authorizedMessageActions.push('delete');
|
|
3518
3874
|
_this.authorizedMessageActions.push('delete-any');
|
|
3519
3875
|
}
|
|
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++;
|
|
3876
|
+
if (capabilites.indexOf('send-reply') !== -1) {
|
|
3877
|
+
_this.authorizedMessageActions.push('send-reply');
|
|
3538
3878
|
}
|
|
3879
|
+
if (capabilites.indexOf('quote-message') !== -1) {
|
|
3880
|
+
_this.authorizedMessageActions.push('quote-message');
|
|
3881
|
+
}
|
|
3882
|
+
_this.setEnabledActions();
|
|
3539
3883
|
}
|
|
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
3884
|
}));
|
|
3559
|
-
this.imageLoadService.imageLoad$.subscribe(function () {
|
|
3885
|
+
this.subscriptions.push(this.imageLoadService.imageLoad$.subscribe(function () {
|
|
3560
3886
|
if (!_this.isUserScrolledUp) {
|
|
3561
3887
|
_this.scrollToBottom();
|
|
3562
3888
|
// Hacky and unreliable workaround to scroll down after loaded images move the scrollbar
|
|
@@ -3564,12 +3890,27 @@
|
|
|
3564
3890
|
_this.scrollToBottom();
|
|
3565
3891
|
}, 300);
|
|
3566
3892
|
}
|
|
3567
|
-
});
|
|
3893
|
+
}));
|
|
3894
|
+
this.subscriptions.push(this.channelService.activeParentMessage$.subscribe(function (message) {
|
|
3895
|
+
if (message &&
|
|
3896
|
+
_this.parentMessage &&
|
|
3897
|
+
message.id !== _this.parentMessage.id &&
|
|
3898
|
+
_this.mode === 'thread') {
|
|
3899
|
+
_this.resetScrollState();
|
|
3900
|
+
}
|
|
3901
|
+
_this.parentMessage = message;
|
|
3902
|
+
}));
|
|
3568
3903
|
}
|
|
3904
|
+
MessageListComponent.prototype.ngOnInit = function () {
|
|
3905
|
+
this.setMessages$();
|
|
3906
|
+
};
|
|
3569
3907
|
MessageListComponent.prototype.ngOnChanges = function (changes) {
|
|
3570
3908
|
if (changes.enabledMessageActionsInput) {
|
|
3571
3909
|
this.setEnabledActions();
|
|
3572
3910
|
}
|
|
3911
|
+
if (changes.mode) {
|
|
3912
|
+
this.setMessages$();
|
|
3913
|
+
}
|
|
3573
3914
|
};
|
|
3574
3915
|
MessageListComponent.prototype.ngAfterViewChecked = function () {
|
|
3575
3916
|
var _this = this;
|
|
@@ -3589,6 +3930,15 @@
|
|
|
3589
3930
|
this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;
|
|
3590
3931
|
this.olderMassagesLoaded = false;
|
|
3591
3932
|
}
|
|
3933
|
+
else if (this.containerHeight !== undefined &&
|
|
3934
|
+
this.containerHeight < this.scrollContainer.nativeElement.scrollHeight &&
|
|
3935
|
+
!this.isUserScrolledUp) {
|
|
3936
|
+
this.scrollToBottom();
|
|
3937
|
+
this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;
|
|
3938
|
+
}
|
|
3939
|
+
};
|
|
3940
|
+
MessageListComponent.prototype.ngOnDestroy = function () {
|
|
3941
|
+
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
3592
3942
|
};
|
|
3593
3943
|
MessageListComponent.prototype.trackByMessageId = function (index, item) {
|
|
3594
3944
|
return item.id;
|
|
@@ -3598,6 +3948,7 @@
|
|
|
3598
3948
|
this.scrollContainer.nativeElement.scrollHeight;
|
|
3599
3949
|
};
|
|
3600
3950
|
MessageListComponent.prototype.scrolled = function () {
|
|
3951
|
+
var _a, _b;
|
|
3601
3952
|
this.isUserScrolledUp =
|
|
3602
3953
|
this.scrollContainer.nativeElement.scrollHeight -
|
|
3603
3954
|
(this.scrollContainer.nativeElement.scrollTop +
|
|
@@ -3606,21 +3957,36 @@
|
|
|
3606
3957
|
if (!this.isUserScrolledUp) {
|
|
3607
3958
|
this.unreadMessageCount = 0;
|
|
3608
3959
|
}
|
|
3609
|
-
if (this.scrollContainer.nativeElement.scrollTop
|
|
3960
|
+
if (this.scrollContainer.nativeElement.scrollTop <=
|
|
3961
|
+
(((_a = this.parentMessageElement) === null || _a === void 0 ? void 0 : _a.nativeElement.clientHeight) || 0) &&
|
|
3962
|
+
(this.prevScrollTop === undefined ||
|
|
3963
|
+
this.prevScrollTop >
|
|
3964
|
+
(((_b = this.parentMessageElement) === null || _b === void 0 ? void 0 : _b.nativeElement.clientHeight) || 0))) {
|
|
3610
3965
|
this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;
|
|
3611
|
-
|
|
3966
|
+
this.mode === 'main'
|
|
3967
|
+
? void this.channelService.loadMoreMessages()
|
|
3968
|
+
: void this.channelService.loadMoreThreadReplies();
|
|
3612
3969
|
}
|
|
3970
|
+
this.prevScrollTop = this.scrollContainer.nativeElement.scrollTop;
|
|
3613
3971
|
};
|
|
3614
3972
|
MessageListComponent.prototype.preserveScrollbarPosition = function () {
|
|
3615
3973
|
this.scrollContainer.nativeElement.scrollTop =
|
|
3616
|
-
this.
|
|
3974
|
+
(this.prevScrollTop || 0) +
|
|
3975
|
+
(this.scrollContainer.nativeElement.scrollHeight - this.containerHeight);
|
|
3617
3976
|
};
|
|
3618
3977
|
MessageListComponent.prototype.setEnabledActions = function () {
|
|
3619
3978
|
var _this = this;
|
|
3620
3979
|
this.enabledMessageActions = [];
|
|
3621
3980
|
if (!this.enabledMessageActionsInput) {
|
|
3981
|
+
this.enabledMessageActions = this.authorizedMessageActions;
|
|
3622
3982
|
return;
|
|
3623
3983
|
}
|
|
3984
|
+
this.enabledMessageActionsInput = __spreadArray(__spreadArray([], __read(this.enabledMessageActionsInput)), [
|
|
3985
|
+
'send-reaction',
|
|
3986
|
+
'read-events',
|
|
3987
|
+
'send-reply',
|
|
3988
|
+
'quote-message',
|
|
3989
|
+
]);
|
|
3624
3990
|
this.enabledMessageActionsInput.forEach(function (action) {
|
|
3625
3991
|
var isAuthorized = _this.authorizedMessageActions.indexOf(action) !== -1;
|
|
3626
3992
|
if (isAuthorized) {
|
|
@@ -3628,10 +3994,62 @@
|
|
|
3628
3994
|
}
|
|
3629
3995
|
});
|
|
3630
3996
|
};
|
|
3997
|
+
MessageListComponent.prototype.setMessages$ = function () {
|
|
3998
|
+
var _this = this;
|
|
3999
|
+
this.messages$ = (this.mode === 'main'
|
|
4000
|
+
? this.channelService.activeChannelMessages$
|
|
4001
|
+
: this.channelService.activeThreadMessages$).pipe(operators.tap(function (messages) {
|
|
4002
|
+
var _a, _b, _c, _d, _e;
|
|
4003
|
+
if (messages.length === 0) {
|
|
4004
|
+
return;
|
|
4005
|
+
}
|
|
4006
|
+
var currentLatestMessageDate = messages[messages.length - 1].created_at;
|
|
4007
|
+
if (!_this.latestMessageDate ||
|
|
4008
|
+
((_a = _this.latestMessageDate) === null || _a === void 0 ? void 0 : _a.getTime()) < currentLatestMessageDate.getTime()) {
|
|
4009
|
+
_this.latestMessageDate = currentLatestMessageDate;
|
|
4010
|
+
_this.hasNewMessages = true;
|
|
4011
|
+
_this.isNewMessageSentByUser =
|
|
4012
|
+
((_b = messages[messages.length - 1].user) === null || _b === void 0 ? void 0 : _b.id) ===
|
|
4013
|
+
((_d = (_c = _this.chatClientService.chatClient) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.id);
|
|
4014
|
+
if (_this.isUserScrolledUp) {
|
|
4015
|
+
_this.unreadMessageCount++;
|
|
4016
|
+
}
|
|
4017
|
+
}
|
|
4018
|
+
var currentOldestMessageDate = messages[0].created_at;
|
|
4019
|
+
if (!_this.oldestMessageDate) {
|
|
4020
|
+
_this.oldestMessageDate = currentOldestMessageDate;
|
|
4021
|
+
}
|
|
4022
|
+
else if (((_e = _this.oldestMessageDate) === null || _e === void 0 ? void 0 : _e.getTime()) > currentOldestMessageDate.getTime()) {
|
|
4023
|
+
_this.oldestMessageDate = currentOldestMessageDate;
|
|
4024
|
+
_this.olderMassagesLoaded = true;
|
|
4025
|
+
}
|
|
4026
|
+
}), operators.tap(function (messages) {
|
|
4027
|
+
_this.groupStyles = messages.map(function (m, i) { return getGroupStyles(m, messages[i - 1], messages[i + 1]); });
|
|
4028
|
+
}), operators.tap(function (messages) {
|
|
4029
|
+
var _a;
|
|
4030
|
+
return (_this.lastSentMessageId = (_a = __spreadArray([], __read(messages)).reverse()
|
|
4031
|
+
.find(function (m) {
|
|
4032
|
+
var _a, _b, _c;
|
|
4033
|
+
return ((_a = m.user) === null || _a === void 0 ? void 0 : _a.id) === ((_c = (_b = _this.chatClientService.chatClient) === null || _b === void 0 ? void 0 : _b.user) === null || _c === void 0 ? void 0 : _c.id) &&
|
|
4034
|
+
m.status !== 'sending';
|
|
4035
|
+
})) === null || _a === void 0 ? void 0 : _a.id);
|
|
4036
|
+
}));
|
|
4037
|
+
};
|
|
4038
|
+
MessageListComponent.prototype.resetScrollState = function () {
|
|
4039
|
+
this.latestMessageDate = undefined;
|
|
4040
|
+
this.hasNewMessages = true;
|
|
4041
|
+
this.isUserScrolledUp = false;
|
|
4042
|
+
this.containerHeight = undefined;
|
|
4043
|
+
this.olderMassagesLoaded = false;
|
|
4044
|
+
this.oldestMessageDate = undefined;
|
|
4045
|
+
this.unreadMessageCount = 0;
|
|
4046
|
+
this.prevScrollTop = undefined;
|
|
4047
|
+
this.isNewMessageSentByUser = undefined;
|
|
4048
|
+
};
|
|
3631
4049
|
return MessageListComponent;
|
|
3632
4050
|
}());
|
|
3633
4051
|
MessageListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageListComponent, deps: [{ token: ChannelService }, { token: ChatClientService }, { token: ImageLoadService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
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
|
|
4052
|
+
MessageListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageListComponent, selector: "stream-message-list", inputs: { messageTemplate: "messageTemplate", messageInputTemplate: "messageInputTemplate", mentionTemplate: "mentionTemplate", areReactionsEnabled: "areReactionsEnabled", enabledMessageActionsInput: ["enabledMessageActions", "enabledMessageActionsInput"], mode: "mode" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true }, { propertyName: "parentMessageElement", first: true, predicate: ["parentMessageElement"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n #scrollContainer\n data-testid=\"scroll-container\"\n class=\"str-chat__list\"\n (scroll)=\"scrolled()\"\n>\n <div class=\"str-chat__reverse-infinite-scroll\">\n <ul class=\"str-chat__ul\">\n <li\n #parentMessageElement\n *ngIf=\"mode === 'thread'\"\n data-testid=\"parent-message\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: parentMessage }\n \"\n ></ng-container>\n <div class=\"str-chat__thread-start\" translate>\n streamChat.Start of a new thread\n </div>\n </li>\n <li\n data-testclass=\"message\"\n *ngFor=\"\n let message of messages$ | async;\n let i = index;\n trackBy: trackByMessageId\n \"\n class=\"str-chat__li str-chat__li--{{ groupStyles[i] }}\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: message }\n \"\n ></ng-container>\n </li>\n </ul>\n </div>\n</div>\n<div class=\"str-chat__list-notifications\">\n <button\n data-testid=\"scroll-to-bottom\"\n *ngIf=\"isUserScrolledUp\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-right\n str-chat__message-notification-scroll-down\n \"\n (keyup.enter)=\"scrollToBottom()\"\n (click)=\"scrollToBottom()\"\n >\n <div\n *ngIf=\"unreadMessageCount > 0\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-scroll-down-unread-count\n \"\n >\n {{ unreadMessageCount }}\n </div>\n </button>\n</div>\n\n<ng-template #messageTemplateContainer let-message=\"message\">\n <ng-container *ngIf=\"messageTemplate; else defaultMessageTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplate;\n context: {\n message: message,\n areReactionsEnabled: areReactionsEnabled,\n canReactToMessage: canReactToMessage,\n lastSentMessageId: !!(\n lastSentMessageId && message?.id === lastSentMessageId\n ),\n canReceiveReadEvents: canReceiveReadEvents,\n messageInputTemplate: messageInputTemplate,\n mentionTemplate: mentionTemplate,\n mode: mode\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultMessageTemplate>\n <stream-message\n [message]=\"message\"\n [areReactionsEnabled]=\"areReactionsEnabled\"\n [canReactToMessage]=\"canReactToMessage\"\n [isLastSentMessage]=\"\n !!(lastSentMessageId && message?.id === lastSentMessageId)\n \"\n [enabledMessageActions]=\"enabledMessageActions\"\n [canReceiveReadEvents]=\"canReceiveReadEvents\"\n [messageInputTemplate]=\"messageInputTemplate\"\n [mentionTemplate]=\"mentionTemplate\"\n [mode]=\"mode\"\n ></stream-message>\n </ng-template>\n</ng-template>\n", components: [{ type: MessageComponent, selector: "stream-message", inputs: ["messageInputTemplate", "mentionTemplate", "message", "enabledMessageActions", "areReactionsEnabled", "canReactToMessage", "isLastSentMessage", "canReceiveReadEvents", "mode"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6__namespace.AsyncPipe } });
|
|
3635
4053
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageListComponent, decorators: [{
|
|
3636
4054
|
type: i0.Component,
|
|
3637
4055
|
args: [{
|
|
@@ -3650,12 +4068,55 @@
|
|
|
3650
4068
|
}], enabledMessageActionsInput: [{
|
|
3651
4069
|
type: i0.Input,
|
|
3652
4070
|
args: ['enabledMessageActions']
|
|
4071
|
+
}], mode: [{
|
|
4072
|
+
type: i0.Input
|
|
3653
4073
|
}], class: [{
|
|
3654
4074
|
type: i0.HostBinding,
|
|
3655
4075
|
args: ['class']
|
|
3656
4076
|
}], scrollContainer: [{
|
|
3657
4077
|
type: i0.ViewChild,
|
|
3658
4078
|
args: ['scrollContainer']
|
|
4079
|
+
}], parentMessageElement: [{
|
|
4080
|
+
type: i0.ViewChild,
|
|
4081
|
+
args: ['parentMessageElement']
|
|
4082
|
+
}] } });
|
|
4083
|
+
|
|
4084
|
+
var ThreadComponent = /** @class */ (function () {
|
|
4085
|
+
function ThreadComponent(channelService) {
|
|
4086
|
+
var _this = this;
|
|
4087
|
+
this.channelService = channelService;
|
|
4088
|
+
this.class = 'str-chat__thread';
|
|
4089
|
+
this.subscriptions = [];
|
|
4090
|
+
this.subscriptions.push(this.channelService.activeParentMessage$.subscribe(function (parentMessage) { return (_this.parentMessage = parentMessage); }));
|
|
4091
|
+
}
|
|
4092
|
+
ThreadComponent.prototype.ngOnDestroy = function () {
|
|
4093
|
+
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
4094
|
+
};
|
|
4095
|
+
Object.defineProperty(ThreadComponent.prototype, "replyCountParam", {
|
|
4096
|
+
get: function () {
|
|
4097
|
+
var _a;
|
|
4098
|
+
return { replyCount: (_a = this.parentMessage) === null || _a === void 0 ? void 0 : _a.reply_count };
|
|
4099
|
+
},
|
|
4100
|
+
enumerable: false,
|
|
4101
|
+
configurable: true
|
|
4102
|
+
});
|
|
4103
|
+
ThreadComponent.prototype.closeThread = function () {
|
|
4104
|
+
void this.channelService.setAsActiveParentMessage(undefined);
|
|
4105
|
+
};
|
|
4106
|
+
return ThreadComponent;
|
|
4107
|
+
}());
|
|
4108
|
+
ThreadComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ThreadComponent, deps: [{ token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
4109
|
+
ThreadComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ThreadComponent, selector: "stream-thread", host: { properties: { "class": "this.class" } }, ngImport: i0__namespace, template: "<div class=\"str-chat__thread-header\">\n <div class=\"str-chat__thread-header-details\">\n <strong translate>streamChat.Thread</strong>\n <small data-testid=\"reply-count\">\n {{parentMessage?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </small>\n </div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"close-button\"\n (click)=\"closeThread()\"\n >\n <stream-icon icon=\"close-no-outline\"></stream-icon>\n </button>\n</div>\n<ng-content select='[name=\"thread-message-list\"]'></ng-content>\n<div class=\"str-chat__small-message-input__wrapper\">\n <ng-content select='[name=\"thread-message-input\"]'></ng-content>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
|
|
4110
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ThreadComponent, decorators: [{
|
|
4111
|
+
type: i0.Component,
|
|
4112
|
+
args: [{
|
|
4113
|
+
selector: 'stream-thread',
|
|
4114
|
+
templateUrl: './thread.component.html',
|
|
4115
|
+
styles: [],
|
|
4116
|
+
}]
|
|
4117
|
+
}], ctorParameters: function () { return [{ type: ChannelService }]; }, propDecorators: { class: [{
|
|
4118
|
+
type: i0.HostBinding,
|
|
4119
|
+
args: ['class']
|
|
3659
4120
|
}] } });
|
|
3660
4121
|
|
|
3661
4122
|
var StreamAvatarModule = /** @class */ (function () {
|
|
@@ -3664,13 +4125,13 @@
|
|
|
3664
4125
|
return StreamAvatarModule;
|
|
3665
4126
|
}());
|
|
3666
4127
|
StreamAvatarModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
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: [[
|
|
4128
|
+
StreamAvatarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, declarations: [AvatarComponent], imports: [i6.CommonModule, i1.TranslateModule], exports: [AvatarComponent] });
|
|
4129
|
+
StreamAvatarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, imports: [[i6.CommonModule, i1.TranslateModule]] });
|
|
3669
4130
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, decorators: [{
|
|
3670
4131
|
type: i0.NgModule,
|
|
3671
4132
|
args: [{
|
|
3672
4133
|
declarations: [AvatarComponent],
|
|
3673
|
-
imports: [
|
|
4134
|
+
imports: [i6.CommonModule, i1.TranslateModule],
|
|
3674
4135
|
exports: [AvatarComponent],
|
|
3675
4136
|
}]
|
|
3676
4137
|
}] });
|
|
@@ -3697,7 +4158,8 @@
|
|
|
3697
4158
|
NotificationListComponent,
|
|
3698
4159
|
AttachmentPreviewListComponent,
|
|
3699
4160
|
ModalComponent,
|
|
3700
|
-
TextareaDirective
|
|
4161
|
+
TextareaDirective,
|
|
4162
|
+
ThreadComponent], imports: [i6.CommonModule, i1.TranslateModule, StreamAvatarModule], exports: [ChannelComponent,
|
|
3701
4163
|
ChannelHeaderComponent,
|
|
3702
4164
|
ChannelListComponent,
|
|
3703
4165
|
ChannelPreviewComponent,
|
|
@@ -3713,8 +4175,9 @@
|
|
|
3713
4175
|
NotificationListComponent,
|
|
3714
4176
|
AttachmentPreviewListComponent,
|
|
3715
4177
|
ModalComponent,
|
|
3716
|
-
StreamAvatarModule
|
|
3717
|
-
|
|
4178
|
+
StreamAvatarModule,
|
|
4179
|
+
ThreadComponent] });
|
|
4180
|
+
StreamChatModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, imports: [[i6.CommonModule, i1.TranslateModule, StreamAvatarModule], StreamAvatarModule] });
|
|
3718
4181
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, decorators: [{
|
|
3719
4182
|
type: i0.NgModule,
|
|
3720
4183
|
args: [{
|
|
@@ -3736,8 +4199,9 @@
|
|
|
3736
4199
|
AttachmentPreviewListComponent,
|
|
3737
4200
|
ModalComponent,
|
|
3738
4201
|
TextareaDirective,
|
|
4202
|
+
ThreadComponent,
|
|
3739
4203
|
],
|
|
3740
|
-
imports: [
|
|
4204
|
+
imports: [i6.CommonModule, i1.TranslateModule, StreamAvatarModule],
|
|
3741
4205
|
exports: [
|
|
3742
4206
|
ChannelComponent,
|
|
3743
4207
|
ChannelHeaderComponent,
|
|
@@ -3756,6 +4220,7 @@
|
|
|
3756
4220
|
AttachmentPreviewListComponent,
|
|
3757
4221
|
ModalComponent,
|
|
3758
4222
|
StreamAvatarModule,
|
|
4223
|
+
ThreadComponent,
|
|
3759
4224
|
],
|
|
3760
4225
|
}]
|
|
3761
4226
|
}] });
|
|
@@ -3766,18 +4231,18 @@
|
|
|
3766
4231
|
return StreamAutocompleteTextareaModule;
|
|
3767
4232
|
}());
|
|
3768
4233
|
StreamAutocompleteTextareaModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3769
|
-
StreamAutocompleteTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, declarations: [AutocompleteTextareaComponent], imports: [
|
|
4234
|
+
StreamAutocompleteTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, declarations: [AutocompleteTextareaComponent], imports: [i6.CommonModule, i1.TranslateModule, i5.MentionModule, StreamAvatarModule], exports: [AutocompleteTextareaComponent] });
|
|
3770
4235
|
StreamAutocompleteTextareaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, providers: [
|
|
3771
4236
|
{
|
|
3772
4237
|
provide: textareaInjectionToken,
|
|
3773
4238
|
useValue: AutocompleteTextareaComponent,
|
|
3774
4239
|
},
|
|
3775
|
-
], imports: [[
|
|
4240
|
+
], imports: [[i6.CommonModule, i1.TranslateModule, i5.MentionModule, StreamAvatarModule]] });
|
|
3776
4241
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, decorators: [{
|
|
3777
4242
|
type: i0.NgModule,
|
|
3778
4243
|
args: [{
|
|
3779
4244
|
declarations: [AutocompleteTextareaComponent],
|
|
3780
|
-
imports: [
|
|
4245
|
+
imports: [i6.CommonModule, i1.TranslateModule, i5.MentionModule, StreamAvatarModule],
|
|
3781
4246
|
exports: [AutocompleteTextareaComponent],
|
|
3782
4247
|
providers: [
|
|
3783
4248
|
{
|
|
@@ -3794,18 +4259,18 @@
|
|
|
3794
4259
|
return StreamTextareaModule;
|
|
3795
4260
|
}());
|
|
3796
4261
|
StreamTextareaModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3797
|
-
StreamTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, declarations: [TextareaComponent], imports: [
|
|
4262
|
+
StreamTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, declarations: [TextareaComponent], imports: [i6.CommonModule, i1.TranslateModule], exports: [TextareaComponent] });
|
|
3798
4263
|
StreamTextareaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, providers: [
|
|
3799
4264
|
{
|
|
3800
4265
|
provide: textareaInjectionToken,
|
|
3801
4266
|
useValue: TextareaComponent,
|
|
3802
4267
|
},
|
|
3803
|
-
], imports: [[
|
|
4268
|
+
], imports: [[i6.CommonModule, i1.TranslateModule]] });
|
|
3804
4269
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, decorators: [{
|
|
3805
4270
|
type: i0.NgModule,
|
|
3806
4271
|
args: [{
|
|
3807
4272
|
declarations: [TextareaComponent],
|
|
3808
|
-
imports: [
|
|
4273
|
+
imports: [i6.CommonModule, i1.TranslateModule],
|
|
3809
4274
|
exports: [TextareaComponent],
|
|
3810
4275
|
providers: [
|
|
3811
4276
|
{
|
|
@@ -3857,6 +4322,7 @@
|
|
|
3857
4322
|
exports.TextareaComponent = TextareaComponent;
|
|
3858
4323
|
exports.TextareaDirective = TextareaDirective;
|
|
3859
4324
|
exports.ThemeService = ThemeService;
|
|
4325
|
+
exports.ThreadComponent = ThreadComponent;
|
|
3860
4326
|
exports.TransliterationService = TransliterationService;
|
|
3861
4327
|
exports.createMessagePreview = createMessagePreview;
|
|
3862
4328
|
exports.getDeviceWidth = getDeviceWidth;
|