stream-chat-angular 2.14.0 → 2.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +333 -101
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/attachment-list/attachment-list.component.js +7 -1
- package/esm2015/lib/attachment-preview-list/attachment-preview-list.component.js +4 -1
- package/esm2015/lib/attachment.service.js +1 -1
- package/esm2015/lib/avatar/avatar.component.js +7 -1
- package/esm2015/lib/channel/channel.component.js +4 -1
- package/esm2015/lib/channel-header/channel-header.component.js +4 -1
- package/esm2015/lib/channel-list/channel-list.component.js +4 -1
- package/esm2015/lib/channel-preview/channel-preview.component.js +4 -1
- package/esm2015/lib/channel.service.js +27 -3
- package/esm2015/lib/icon/icon.component.js +4 -1
- package/esm2015/lib/loading-indicator/loading-indicator.component.js +10 -1
- package/esm2015/lib/message/message.component.js +10 -1
- package/esm2015/lib/message-actions-box/message-actions-box.component.js +19 -1
- package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +22 -1
- package/esm2015/lib/message-input/message-input-config.service.js +2 -2
- package/esm2015/lib/message-input/message-input.component.js +61 -4
- package/esm2015/lib/message-input/textarea/textarea.component.js +13 -1
- package/esm2015/lib/message-list/message-list.component.js +9 -3
- package/esm2015/lib/message-reactions/message-reactions.component.js +22 -4
- package/esm2015/lib/modal/modal.component.js +10 -1
- package/esm2015/lib/notification/notification.component.js +4 -1
- package/esm2015/lib/notification-list/notification-list.component.js +4 -1
- package/esm2015/lib/notification.service.js +2 -2
- package/esm2015/lib/thread/thread.component.js +4 -1
- package/fesm2015/stream-chat-angular.js +235 -13
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/attachment-list/attachment-list.component.d.ts +9 -0
- package/lib/attachment-preview-list/attachment-preview-list.component.d.ts +3 -0
- package/lib/attachment.service.d.ts +1 -1
- package/lib/avatar/avatar.component.d.ts +12 -0
- package/lib/channel/channel.component.d.ts +3 -0
- package/lib/channel-header/channel-header.component.d.ts +3 -0
- package/lib/channel-list/channel-list.component.d.ts +6 -0
- package/lib/channel-preview/channel-preview.component.d.ts +6 -0
- package/lib/channel.service.d.ts +19 -2
- package/lib/icon/icon.component.d.ts +9 -0
- package/lib/loading-indicator/loading-indicator.component.d.ts +9 -0
- package/lib/message/message.component.d.ts +27 -3
- package/lib/message-actions-box/message-actions-box.component.d.ts +24 -0
- package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +27 -0
- package/lib/message-input/message-input-config.service.d.ts +1 -1
- package/lib/message-input/message-input.component.d.ts +41 -1
- package/lib/message-input/textarea/textarea.component.d.ts +12 -0
- package/lib/message-list/message-list.component.d.ts +20 -2
- package/lib/message-reactions/message-reactions.component.d.ts +22 -1
- package/lib/modal/modal.component.d.ts +9 -0
- package/lib/notification/notification.component.d.ts +6 -0
- package/lib/notification-list/notification-list.component.d.ts +3 -0
- package/lib/notification.service.d.ts +1 -1
- package/lib/thread/thread.component.d.ts +3 -0
- package/package.json +2 -2
- package/src/assets/version.ts +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __awaiter } from 'tslib';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Injectable, Component, Input, InjectionToken, EventEmitter, Directive, Output, Inject, ViewChild, HostBinding, NgModule } from '@angular/core';
|
|
4
|
-
import { BehaviorSubject, ReplaySubject, combineLatest, Subject, of } from 'rxjs';
|
|
4
|
+
import { BehaviorSubject, ReplaySubject, combineLatest, Subject, timer, of } from 'rxjs';
|
|
5
5
|
import { StreamChat } from 'stream-chat';
|
|
6
|
-
import { map, shareReplay, filter, first, catchError, startWith, distinctUntilChanged, debounceTime
|
|
6
|
+
import { map, shareReplay, filter, first, take, tap, catchError, startWith, distinctUntilChanged, debounceTime } from 'rxjs/operators';
|
|
7
7
|
import { v4 } from 'uuid';
|
|
8
8
|
import * as i2 from '@ngx-translate/core';
|
|
9
9
|
import { TranslateModule } from '@ngx-translate/core';
|
|
@@ -17,10 +17,10 @@ import transliterate from '@stream-io/transliterate';
|
|
|
17
17
|
import * as i6$1 from 'angular-mentions';
|
|
18
18
|
import { MentionModule } from 'angular-mentions';
|
|
19
19
|
|
|
20
|
-
const version = '2.
|
|
20
|
+
const version = '2.16.1';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/
|
|
23
|
+
* The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
|
|
24
24
|
*/
|
|
25
25
|
class NotificationService {
|
|
26
26
|
constructor() {
|
|
@@ -238,6 +238,7 @@ class ChannelService {
|
|
|
238
238
|
this.activeChannelSubscriptions = [];
|
|
239
239
|
this.activeParentMessageIdSubject = new BehaviorSubject(undefined);
|
|
240
240
|
this.activeThreadMessagesSubject = new BehaviorSubject([]);
|
|
241
|
+
this.latestMessageDateByUserByChannelsSubject = new BehaviorSubject({});
|
|
241
242
|
this.messagePageSize = 25;
|
|
242
243
|
this.messageToQuoteSubject = new BehaviorSubject(undefined);
|
|
243
244
|
this.usersTypingInChannelSubject = new BehaviorSubject([]);
|
|
@@ -287,6 +288,8 @@ class ChannelService {
|
|
|
287
288
|
this.usersTypingInChannel$ =
|
|
288
289
|
this.usersTypingInChannelSubject.asObservable();
|
|
289
290
|
this.usersTypingInThread$ = this.usersTypingInThreadSubject.asObservable();
|
|
291
|
+
this.latestMessageDateByUserByChannels$ =
|
|
292
|
+
this.latestMessageDateByUserByChannelsSubject.asObservable();
|
|
290
293
|
}
|
|
291
294
|
/**
|
|
292
295
|
* Sets the given `channel` as active.
|
|
@@ -396,7 +399,7 @@ class ChannelService {
|
|
|
396
399
|
});
|
|
397
400
|
}
|
|
398
401
|
/**
|
|
399
|
-
* Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./
|
|
402
|
+
* Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./ChatClientService.mdx/#disconnectuser).
|
|
400
403
|
*/
|
|
401
404
|
reset() {
|
|
402
405
|
this.activeChannelMessagesSubject.next([]);
|
|
@@ -404,6 +407,7 @@ class ChannelService {
|
|
|
404
407
|
this.activeParentMessageIdSubject.next(undefined);
|
|
405
408
|
this.activeThreadMessagesSubject.next([]);
|
|
406
409
|
this.channelsSubject.next(undefined);
|
|
410
|
+
this.latestMessageDateByUserByChannelsSubject.next({});
|
|
407
411
|
this.selectMessageToQuote(undefined);
|
|
408
412
|
}
|
|
409
413
|
/**
|
|
@@ -724,6 +728,7 @@ class ChannelService {
|
|
|
724
728
|
void (c === null || c === void 0 ? void 0 : c.markRead());
|
|
725
729
|
}
|
|
726
730
|
});
|
|
731
|
+
this.updateLatestMessages(event);
|
|
727
732
|
});
|
|
728
733
|
}));
|
|
729
734
|
this.activeChannelSubscriptions.push(channel.on('message.updated', (event) => this.messageUpdated(event)));
|
|
@@ -945,7 +950,6 @@ class ChannelService {
|
|
|
945
950
|
}
|
|
946
951
|
}
|
|
947
952
|
}
|
|
948
|
-
// truncate active thread as well
|
|
949
953
|
handleChannelTruncate(event) {
|
|
950
954
|
var _a, _b;
|
|
951
955
|
const channelIndex = this.channels.findIndex((c) => c.cid === event.channel.cid);
|
|
@@ -1023,6 +1027,26 @@ class ChannelService {
|
|
|
1023
1027
|
return;
|
|
1024
1028
|
}
|
|
1025
1029
|
}
|
|
1030
|
+
updateLatestMessages(event) {
|
|
1031
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1032
|
+
if (((_b = (_a = event.message) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.id) !== ((_d = (_c = this.chatClientService) === null || _c === void 0 ? void 0 : _c.chatClient.user) === null || _d === void 0 ? void 0 : _d.id)) {
|
|
1033
|
+
return;
|
|
1034
|
+
}
|
|
1035
|
+
const latestMessages = this.latestMessageDateByUserByChannelsSubject.getValue();
|
|
1036
|
+
if (!((_e = event.message) === null || _e === void 0 ? void 0 : _e.created_at)) {
|
|
1037
|
+
return;
|
|
1038
|
+
}
|
|
1039
|
+
const channelId = (_f = event === null || event === void 0 ? void 0 : event.message) === null || _f === void 0 ? void 0 : _f.cid;
|
|
1040
|
+
if (!channelId) {
|
|
1041
|
+
return;
|
|
1042
|
+
}
|
|
1043
|
+
const messageDate = new Date(event.message.created_at);
|
|
1044
|
+
if (!latestMessages[channelId] ||
|
|
1045
|
+
((_g = latestMessages[channelId]) === null || _g === void 0 ? void 0 : _g.getTime()) < messageDate.getTime()) {
|
|
1046
|
+
latestMessages[channelId] = messageDate;
|
|
1047
|
+
this.latestMessageDateByUserByChannelsSubject.next(Object.assign({}, latestMessages));
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1026
1050
|
}
|
|
1027
1051
|
ChannelService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: ChannelService, deps: [{ token: ChatClientService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1028
1052
|
ChannelService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: ChannelService, providedIn: 'root' });
|
|
@@ -1481,8 +1505,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
1481
1505
|
}]
|
|
1482
1506
|
}], ctorParameters: function () { return [{ type: i2.TranslateService }]; } });
|
|
1483
1507
|
|
|
1508
|
+
/**
|
|
1509
|
+
* The `Avatar` component displays the provided image, with fallback to the first letter of the optional name input.
|
|
1510
|
+
*/
|
|
1484
1511
|
class AvatarComponent {
|
|
1485
1512
|
constructor() {
|
|
1513
|
+
/**
|
|
1514
|
+
* The size in pixels of the avatar image.
|
|
1515
|
+
*/
|
|
1486
1516
|
this.size = 32;
|
|
1487
1517
|
this.isLoaded = false;
|
|
1488
1518
|
this.isError = false;
|
|
@@ -1509,6 +1539,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
1509
1539
|
type: Input
|
|
1510
1540
|
}] } });
|
|
1511
1541
|
|
|
1542
|
+
/**
|
|
1543
|
+
* The `Icon` component can be used to display different icons (i. e. message delivered icon).
|
|
1544
|
+
*/
|
|
1512
1545
|
class IconComponent {
|
|
1513
1546
|
constructor() { }
|
|
1514
1547
|
}
|
|
@@ -1527,9 +1560,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
1527
1560
|
type: Input
|
|
1528
1561
|
}] } });
|
|
1529
1562
|
|
|
1563
|
+
/**
|
|
1564
|
+
* The `LoadingIndicator` component displays a spinner to indicate that an action is in progress.
|
|
1565
|
+
*/
|
|
1530
1566
|
class LoadingIndicatorComponent {
|
|
1531
1567
|
constructor() {
|
|
1568
|
+
/**
|
|
1569
|
+
* The size of the indicator (in pixels)
|
|
1570
|
+
*/
|
|
1532
1571
|
this.size = 15;
|
|
1572
|
+
/**
|
|
1573
|
+
* The color of the indicator
|
|
1574
|
+
*/
|
|
1533
1575
|
this.color = '#006CFF';
|
|
1534
1576
|
}
|
|
1535
1577
|
}
|
|
@@ -1655,7 +1697,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
1655
1697
|
}], ctorParameters: function () { return []; } });
|
|
1656
1698
|
|
|
1657
1699
|
/**
|
|
1658
|
-
* The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](../components/
|
|
1700
|
+
* The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](../components/MessageInputComponent.mdx) components if your UI has more than one input component.
|
|
1659
1701
|
*/
|
|
1660
1702
|
class MessageInputConfigService {
|
|
1661
1703
|
constructor() {
|
|
@@ -1706,10 +1748,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
1706
1748
|
}]
|
|
1707
1749
|
}], ctorParameters: function () { return []; } });
|
|
1708
1750
|
|
|
1751
|
+
/**
|
|
1752
|
+
* The `AttachmentList` compontent displays the attachments of a message
|
|
1753
|
+
*/
|
|
1709
1754
|
class AttachmentListComponent {
|
|
1710
1755
|
constructor(imageLoadService, channelService) {
|
|
1711
1756
|
this.imageLoadService = imageLoadService;
|
|
1712
1757
|
this.channelService = channelService;
|
|
1758
|
+
/**
|
|
1759
|
+
* The attachments to display
|
|
1760
|
+
*/
|
|
1713
1761
|
this.attachments = [];
|
|
1714
1762
|
this.orderedAttachments = [];
|
|
1715
1763
|
}
|
|
@@ -1776,6 +1824,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
1776
1824
|
type: Input
|
|
1777
1825
|
}] } });
|
|
1778
1826
|
|
|
1827
|
+
/**
|
|
1828
|
+
* The `AttachmentPreviewList` compontent displays a preview of the attachments uploaded to a message. Users can delete attachments using the preview component, or retry upload if it failed previously.
|
|
1829
|
+
*/
|
|
1779
1830
|
class AttachmentPreviewListComponent {
|
|
1780
1831
|
constructor(attachmentService) {
|
|
1781
1832
|
this.attachmentService = attachmentService;
|
|
@@ -1806,6 +1857,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
1806
1857
|
}]
|
|
1807
1858
|
}], ctorParameters: function () { return [{ type: AttachmentService }]; } });
|
|
1808
1859
|
|
|
1860
|
+
/**
|
|
1861
|
+
* The `MessageInput` component displays an input where users can type their messages and upload files, and sends the message to the active channel. The component can be used to compose new messages or update existing ones. To send messages, the chat user needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
|
|
1862
|
+
*/
|
|
1809
1863
|
class MessageInputComponent {
|
|
1810
1864
|
constructor(channelService, notificationService, attachmentService, configService, textareaType, componentFactoryResolver, cdRef, chatClient, emojiInputService) {
|
|
1811
1865
|
this.channelService = channelService;
|
|
@@ -1817,11 +1871,18 @@ class MessageInputComponent {
|
|
|
1817
1871
|
this.cdRef = cdRef;
|
|
1818
1872
|
this.chatClient = chatClient;
|
|
1819
1873
|
this.emojiInputService = emojiInputService;
|
|
1874
|
+
/**
|
|
1875
|
+
* Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
|
|
1876
|
+
*/
|
|
1820
1877
|
this.mode = 'main';
|
|
1878
|
+
/**
|
|
1879
|
+
* Emits when a message was successfuly sent or updated
|
|
1880
|
+
*/
|
|
1821
1881
|
this.messageUpdate = new EventEmitter();
|
|
1822
1882
|
this.textareaValue = '';
|
|
1823
1883
|
this.mentionedUsers = [];
|
|
1824
1884
|
this.typingStart$ = new Subject();
|
|
1885
|
+
this.isCooldownInProgress = false;
|
|
1825
1886
|
this.subscriptions = [];
|
|
1826
1887
|
this.isViewInited = false;
|
|
1827
1888
|
this.subscriptions.push(this.attachmentService.attachmentUploadInProgressCounter$.subscribe((counter) => {
|
|
@@ -1865,6 +1926,26 @@ class MessageInputComponent {
|
|
|
1865
1926
|
this.configService.commandAutocompleteItemTemplate;
|
|
1866
1927
|
this.emojiPickerTemplate = this.configService.emojiPickerTemplate;
|
|
1867
1928
|
this.subscriptions.push(this.typingStart$.subscribe(() => void this.channelService.typingStarted(this.parentMessageId)));
|
|
1929
|
+
this.subscriptions.push(combineLatest([
|
|
1930
|
+
this.channelService.latestMessageDateByUserByChannels$,
|
|
1931
|
+
this.channelService.activeChannel$,
|
|
1932
|
+
])
|
|
1933
|
+
.pipe(map(([latestMessages, channel]) => [latestMessages[(channel === null || channel === void 0 ? void 0 : channel.cid) || ''], channel]))
|
|
1934
|
+
.subscribe(([latestMessageDate, channel]) => {
|
|
1935
|
+
var _a, _b, _c;
|
|
1936
|
+
const cooldown = ((_a = channel === null || channel === void 0 ? void 0 : channel.data) === null || _a === void 0 ? void 0 : _a.cooldown) &&
|
|
1937
|
+
latestMessageDate &&
|
|
1938
|
+
Math.round(((_b = channel === null || channel === void 0 ? void 0 : channel.data) === null || _b === void 0 ? void 0 : _b.cooldown) -
|
|
1939
|
+
(new Date().getTime() - latestMessageDate.getTime()) / 1000);
|
|
1940
|
+
if (cooldown &&
|
|
1941
|
+
cooldown > 0 &&
|
|
1942
|
+
((_c = channel === null || channel === void 0 ? void 0 : channel.data) === null || _c === void 0 ? void 0 : _c.own_capabilities).includes('slow-mode')) {
|
|
1943
|
+
this.startCooldown(cooldown);
|
|
1944
|
+
}
|
|
1945
|
+
else if (this.isCooldownInProgress) {
|
|
1946
|
+
this.stopCooldown();
|
|
1947
|
+
}
|
|
1948
|
+
}));
|
|
1868
1949
|
}
|
|
1869
1950
|
ngAfterViewInit() {
|
|
1870
1951
|
this.isViewInited = true;
|
|
@@ -1972,6 +2053,17 @@ class MessageInputComponent {
|
|
|
1972
2053
|
? [originalAttachments[0]]
|
|
1973
2054
|
: [];
|
|
1974
2055
|
}
|
|
2056
|
+
get disabledTextareaText() {
|
|
2057
|
+
if (!this.canSendMessages) {
|
|
2058
|
+
return this.mode === 'thread'
|
|
2059
|
+
? "streamChat.You can't send thread replies in this channel"
|
|
2060
|
+
: "streamChat.You can't send messages in this channel";
|
|
2061
|
+
}
|
|
2062
|
+
else if (this.cooldown$) {
|
|
2063
|
+
return 'streamChat.Slow Mode ON';
|
|
2064
|
+
}
|
|
2065
|
+
return '';
|
|
2066
|
+
}
|
|
1975
2067
|
filesSelected(fileList) {
|
|
1976
2068
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1977
2069
|
if (!(yield this.areAttachemntsValid(fileList))) {
|
|
@@ -2073,9 +2165,25 @@ class MessageInputComponent {
|
|
|
2073
2165
|
}
|
|
2074
2166
|
return parentMessageId;
|
|
2075
2167
|
}
|
|
2168
|
+
startCooldown(cooldown) {
|
|
2169
|
+
this.isCooldownInProgress = true;
|
|
2170
|
+
this.cooldown$ = timer(0, 1000).pipe(take(cooldown + 1), map((v) => cooldown - v), tap((v) => {
|
|
2171
|
+
if (v === 0) {
|
|
2172
|
+
this.stopCooldown();
|
|
2173
|
+
}
|
|
2174
|
+
}));
|
|
2175
|
+
}
|
|
2176
|
+
stopCooldown() {
|
|
2177
|
+
this.cooldown$ = undefined;
|
|
2178
|
+
this.isCooldownInProgress = false;
|
|
2179
|
+
// the anchor directive will be recreated because of *ngIf, so we will have to reinit the textarea as well
|
|
2180
|
+
this.textareaRef = undefined;
|
|
2181
|
+
// we can only create the textarea after the anchor was recreated, so we will have to wait a change detection cycle with setTimeout
|
|
2182
|
+
setTimeout(() => this.initTextarea());
|
|
2183
|
+
}
|
|
2076
2184
|
}
|
|
2077
2185
|
MessageInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: MessageInputComponent, deps: [{ token: ChannelService }, { token: NotificationService }, { token: AttachmentService }, { token: MessageInputConfigService }, { token: textareaInjectionToken }, { token: i0.ComponentFactoryResolver }, { token: i0.ChangeDetectorRef }, { token: ChatClientService }, { token: EmojiInputService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2078
|
-
MessageInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageInputComponent, selector: "stream-message-input", inputs: { isFileUploadEnabled: "isFileUploadEnabled", areMentionsEnabled: "areMentionsEnabled", mentionScope: "mentionScope", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", commandAutocompleteItemTemplate: "commandAutocompleteItemTemplate", emojiPickerTemplate: "emojiPickerTemplate", mode: "mode", acceptedFileTypes: "acceptedFileTypes", isMultipleFileUploadEnabled: "isMultipleFileUploadEnabled", message: "message" }, outputs: { messageUpdate: "messageUpdate" }, providers: [AttachmentService, EmojiInputService], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "textareaAnchor", first: true, predicate: TextareaDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"{{\n mode === 'main' ? 'str-chat__input-flat' : 'str-chat__small-message-input'\n }}\"\n [class.str-chat__input-flat-has-attachments]=\"\n (attachmentUploads$ | async)!.length > 0\n \"\n [class.str-chat__input-flat-quoted]=\"!!quotedMessage\"\n>\n <div\n data-testid=\"quoted-message-container\"\n class=\"quoted-message-preview\"\n *ngIf=\"quotedMessage\"\n >\n <div class=\"quoted-message-preview-header\">\n <div>{{ \"streamChat.Reply to Message\" | translate }}</div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon\n icon=\"close-no-outline\"\n style=\"font-size: 10px; line-height: 10px\"\n ></stream-icon>\n </button>\n </div>\n <div class=\"quoted-message-preview-content\">\n <stream-avatar\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"quotedMessage?.user?.image\"\n [name]=\"quotedMessage?.user?.name || quotedMessage?.user?.id\"\n [size]=\"20\"\n ></stream-avatar>\n <div class=\"quoted-message-preview-content-inner\">\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"quotedMessage?.html || quotedMessage?.text\"\n ></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__input-flat-wrapper\" style=\"width: 100%\">\n <div\n class=\"{{\n mode === 'main'\n ? 'str-chat__input-flat--textarea-wrapper'\n : 'str-chat__small-message-input--textarea-wrapper'\n }}\"\n >\n <stream-attachment-preview-list\n class=\"rfu-image-previewer-angular-host\"\n ></stream-attachment-preview-list>\n <div class=\"rta str-chat__textarea str-chat-angular__textarea\">\n <ng-container
|
|
2186
|
+
MessageInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageInputComponent, selector: "stream-message-input", inputs: { isFileUploadEnabled: "isFileUploadEnabled", areMentionsEnabled: "areMentionsEnabled", mentionScope: "mentionScope", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", commandAutocompleteItemTemplate: "commandAutocompleteItemTemplate", emojiPickerTemplate: "emojiPickerTemplate", mode: "mode", acceptedFileTypes: "acceptedFileTypes", isMultipleFileUploadEnabled: "isMultipleFileUploadEnabled", message: "message" }, outputs: { messageUpdate: "messageUpdate" }, providers: [AttachmentService, EmojiInputService], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "textareaAnchor", first: true, predicate: TextareaDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"{{\n mode === 'main' ? 'str-chat__input-flat' : 'str-chat__small-message-input'\n }}\"\n [class.str-chat__input-flat-has-attachments]=\"\n (attachmentUploads$ | async)!.length > 0\n \"\n [class.str-chat__input-flat-quoted]=\"!!quotedMessage\"\n>\n <div\n data-testid=\"quoted-message-container\"\n class=\"quoted-message-preview\"\n *ngIf=\"quotedMessage\"\n >\n <div class=\"quoted-message-preview-header\">\n <div>{{ \"streamChat.Reply to Message\" | translate }}</div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon\n icon=\"close-no-outline\"\n style=\"font-size: 10px; line-height: 10px\"\n ></stream-icon>\n </button>\n </div>\n <div class=\"quoted-message-preview-content\">\n <stream-avatar\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"quotedMessage?.user?.image\"\n [name]=\"quotedMessage?.user?.name || quotedMessage?.user?.id\"\n [size]=\"20\"\n ></stream-avatar>\n <div class=\"quoted-message-preview-content-inner\">\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"quotedMessage?.html || quotedMessage?.text\"\n ></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__input-flat-wrapper\" style=\"width: 100%\">\n <div\n class=\"{{\n mode === 'main'\n ? 'str-chat__input-flat--textarea-wrapper'\n : 'str-chat__small-message-input--textarea-wrapper'\n }}\"\n >\n <stream-attachment-preview-list\n class=\"rfu-image-previewer-angular-host\"\n ></stream-attachment-preview-list>\n <div class=\"rta str-chat__textarea str-chat-angular__textarea\">\n <ng-container\n *ngIf=\"emojiPickerTemplate && !isCooldownInProgress\"\n data-testid=\"emoji-picker\"\n >\n <div\n class=\"\n str-chat__input-flat-emojiselect\n str-chat-angular__emojiselect\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n emojiPickerTemplate;\n context: { emojiInput$: emojiInputService.emojiInput$ }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <div\n class=\"str-chat__input-flat-cooldown str-chat-angular__cooldown\"\n *ngIf=\"isCooldownInProgress\"\n data-testid=\"cooldown-timer\"\n >\n {{ cooldown$ | async }}\n </div>\n <ng-template\n *ngIf=\"canSendMessages && !isCooldownInProgress; else notAllowed\"\n streamTextarea\n [(value)]=\"textareaValue\"\n (valueChange)=\"typingStart$.next()\"\n (send)=\"messageSent()\"\n [componentRef]=\"textareaRef\"\n (userMentions)=\"mentionedUsers = $event\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionAutocompleteItemTemplate]=\"mentionAutocompleteItemTemplate\"\n [commandAutocompleteItemTemplate]=\"commandAutocompleteItemTemplate\"\n [mentionScope]=\"mentionScope\"\n ></ng-template>\n <ng-template #notAllowed>\n <textarea\n disabled\n rows=\"1\"\n [value]=\"disabledTextareaText | translate\"\n class=\"rta__textarea str-chat__textarea__textarea\"\n data-testid=\"disabled-textarea\"\n ></textarea>\n </ng-template>\n </div>\n <div\n *ngIf=\"\n isFileUploadEnabled &&\n isFileUploadAuthorized &&\n canSendMessages &&\n !isCooldownInProgress\n \"\n class=\"str-chat__fileupload-wrapper\"\n data-testid=\"file-upload-button\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Attach files\" | translate }}\n </div>\n <div class=\"rfu-file-upload-button\">\n <label>\n <input\n #fileInput\n type=\"file\"\n class=\"rfu-file-input\"\n data-testid=\"file-input\"\n [accept]=\"accept\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <span class=\"str-chat__input-flat-fileupload\">\n <stream-icon icon=\"file-upload\"></stream-icon>\n </span>\n </label>\n </div>\n </div>\n </div>\n <button\n *ngIf=\"canSendMessages\"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon icon=\"send\"></stream-icon>\n </button>\n </div>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }, { type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["messageId", "attachments"] }, { type: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: TextareaDirective, selector: "[streamTextarea]", inputs: ["componentRef", "areMentionsEnabled", "mentionAutocompleteItemTemplate", "mentionScope", "commandAutocompleteItemTemplate", "value"], outputs: ["valueChange", "send", "userMentions"] }], pipes: { "async": i6.AsyncPipe, "translate": i2.TranslatePipe } });
|
|
2079
2187
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: MessageInputComponent, decorators: [{
|
|
2080
2188
|
type: Component,
|
|
2081
2189
|
args: [{
|
|
@@ -2117,9 +2225,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
2117
2225
|
args: [TextareaDirective, { static: false }]
|
|
2118
2226
|
}] } });
|
|
2119
2227
|
|
|
2228
|
+
/**
|
|
2229
|
+
* The `Modal` component displays its content in an overlay. The modal can be closed with a close button, if the user clicks outside of the modal content, or if the escape button is pressed. The modal can also be closed from outside.
|
|
2230
|
+
*/
|
|
2120
2231
|
class ModalComponent {
|
|
2121
2232
|
constructor() {
|
|
2233
|
+
/**
|
|
2234
|
+
* If `true` the modal will be displayed, if `false` the modal will be hidden
|
|
2235
|
+
*/
|
|
2122
2236
|
this.isOpen = false;
|
|
2237
|
+
/**
|
|
2238
|
+
* Emits `true` if the modal becomes visible, and `false` if the modal is closed.
|
|
2239
|
+
*/
|
|
2123
2240
|
this.isOpenChange = new EventEmitter();
|
|
2124
2241
|
this.watchForEscPress = (event) => {
|
|
2125
2242
|
if (event.key === 'Escape') {
|
|
@@ -2176,6 +2293,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
2176
2293
|
args: ['content']
|
|
2177
2294
|
}] } });
|
|
2178
2295
|
|
|
2296
|
+
/**
|
|
2297
|
+
* The `Notification` component displays a notification within the [`NotificationList`](./NotificationListComponent.mdx)
|
|
2298
|
+
*/
|
|
2179
2299
|
class NotificationComponent {
|
|
2180
2300
|
constructor() { }
|
|
2181
2301
|
}
|
|
@@ -2192,6 +2312,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
2192
2312
|
type: Input
|
|
2193
2313
|
}] } });
|
|
2194
2314
|
|
|
2315
|
+
/**
|
|
2316
|
+
* The `NotificationList` component displays the list of active notifications.
|
|
2317
|
+
*/
|
|
2195
2318
|
class NotificationListComponent {
|
|
2196
2319
|
constructor(notificationService) {
|
|
2197
2320
|
this.notificationService = notificationService;
|
|
@@ -2212,15 +2335,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
2212
2335
|
}]
|
|
2213
2336
|
}], ctorParameters: function () { return [{ type: NotificationService }]; } });
|
|
2214
2337
|
|
|
2338
|
+
/**
|
|
2339
|
+
* The `MessageActionsBox` component displays a list of message actions (i.e edit), that can be opened or closed. You can find the [list of the supported actions](../concepts/message-interactions.mdx) in the message interaction guide.
|
|
2340
|
+
*/
|
|
2215
2341
|
class MessageActionsBoxComponent {
|
|
2216
2342
|
constructor(chatClientService, notificationService, channelService) {
|
|
2217
2343
|
this.chatClientService = chatClientService;
|
|
2218
2344
|
this.notificationService = notificationService;
|
|
2219
2345
|
this.channelService = channelService;
|
|
2346
|
+
/**
|
|
2347
|
+
* Indicates if the list should be opened or closed. Adding a UI element to open and close the list is the parent's component responsibility.
|
|
2348
|
+
*/
|
|
2220
2349
|
this.isOpen = false;
|
|
2350
|
+
/**
|
|
2351
|
+
* Indicates if the message actions are belonging to a message that was sent by the current user or not.
|
|
2352
|
+
*/
|
|
2221
2353
|
this.isMine = false;
|
|
2354
|
+
/**
|
|
2355
|
+
* The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI.
|
|
2356
|
+
*/
|
|
2222
2357
|
this.enabledActions = [];
|
|
2358
|
+
/**
|
|
2359
|
+
* The number of authorized actions (it can be less or equal than the number of enabled actions)
|
|
2360
|
+
*/
|
|
2223
2361
|
this.displayedActionsCount = new EventEmitter();
|
|
2362
|
+
/**
|
|
2363
|
+
* An event which emits `true` if the edit message modal is open, and `false` when it is closed.
|
|
2364
|
+
*/
|
|
2224
2365
|
this.isEditing = new EventEmitter();
|
|
2225
2366
|
this.isEditModalOpen = false;
|
|
2226
2367
|
this.modalClosed = () => {
|
|
@@ -2350,6 +2491,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
2350
2491
|
args: [MessageInputComponent]
|
|
2351
2492
|
}] } });
|
|
2352
2493
|
|
|
2494
|
+
/**
|
|
2495
|
+
* The `Channel` component is a container component that displays the [`ChannelHeader`](./ChannelHeaderComponent.mdx), [`MessageList`](./MessageListComponent.mdx), [`NotificationList`](./NotificationListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components. You can also provide the [`Thread`](./ThreadComponent.mdx) component to use message [threads](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
|
|
2496
|
+
*/
|
|
2353
2497
|
class ChannelComponent {
|
|
2354
2498
|
constructor(channelService) {
|
|
2355
2499
|
this.channelService = channelService;
|
|
@@ -2450,6 +2594,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
2450
2594
|
args: [{ providedIn: 'root' }]
|
|
2451
2595
|
}], ctorParameters: function () { return []; } });
|
|
2452
2596
|
|
|
2597
|
+
/**
|
|
2598
|
+
* The `ChannelHeader` component displays the avatar and name of the currently active channel along with member and watcher information. You can read about [the difference between members and watchers](https://getstream.io/chat/docs/javascript/watch_channel/?language=javascript#watchers-vs-members) in the platform documentation. Please note that number of watchers is only displayed if the user has [`connect-events` capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript)
|
|
2599
|
+
*/
|
|
2453
2600
|
class ChannelHeaderComponent {
|
|
2454
2601
|
constructor(channelService, channelListToggleService) {
|
|
2455
2602
|
this.channelService = channelService;
|
|
@@ -2489,6 +2636,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
2489
2636
|
}]
|
|
2490
2637
|
}], ctorParameters: function () { return [{ type: ChannelService }, { type: ChannelListToggleService }]; } });
|
|
2491
2638
|
|
|
2639
|
+
/**
|
|
2640
|
+
* The `ChannelPreview` component displays a channel preview in the channel list, it consists of the image, name and latest message of the channel.
|
|
2641
|
+
*/
|
|
2492
2642
|
class ChannelPreviewComponent {
|
|
2493
2643
|
constructor(channelService, ngZone) {
|
|
2494
2644
|
this.channelService = channelService;
|
|
@@ -2576,6 +2726,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
2576
2726
|
type: Input
|
|
2577
2727
|
}] } });
|
|
2578
2728
|
|
|
2729
|
+
/**
|
|
2730
|
+
* The `ChannelList` component renders the list of channels.
|
|
2731
|
+
*/
|
|
2579
2732
|
class ChannelListComponent {
|
|
2580
2733
|
constructor(channelService, channelListToggleService) {
|
|
2581
2734
|
this.channelService = channelService;
|
|
@@ -2663,15 +2816,33 @@ const emojiReactionsMapping = {
|
|
|
2663
2816
|
wow: '😮',
|
|
2664
2817
|
sad: '😞',
|
|
2665
2818
|
};
|
|
2819
|
+
/**
|
|
2820
|
+
* The `MessageReactions` component displays the reactions of a message, the current user can add and remove reactions. You can read more about [message reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript) in the platform documentation.
|
|
2821
|
+
*/
|
|
2666
2822
|
class MessageReactionsComponent {
|
|
2667
2823
|
constructor(cdRef, channelService) {
|
|
2668
2824
|
this.cdRef = cdRef;
|
|
2669
2825
|
this.channelService = channelService;
|
|
2826
|
+
/**
|
|
2827
|
+
* The number of reactions grouped by [reaction types](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts)
|
|
2828
|
+
*/
|
|
2670
2829
|
this.messageReactionCounts = {};
|
|
2830
|
+
/**
|
|
2831
|
+
* Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.
|
|
2832
|
+
*/
|
|
2671
2833
|
this.isSelectorOpen = false;
|
|
2672
|
-
|
|
2834
|
+
/**
|
|
2835
|
+
* List of reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.
|
|
2836
|
+
*/
|
|
2673
2837
|
this.latestReactions = [];
|
|
2838
|
+
/**
|
|
2839
|
+
* List of the user's own reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.
|
|
2840
|
+
*/
|
|
2674
2841
|
this.ownReactions = [];
|
|
2842
|
+
/**
|
|
2843
|
+
* Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.
|
|
2844
|
+
*/
|
|
2845
|
+
this.isSelectorOpenChange = new EventEmitter();
|
|
2675
2846
|
this.eventHandler = (event) => {
|
|
2676
2847
|
var _a;
|
|
2677
2848
|
if (!((_a = this.selectorContainer) === null || _a === void 0 ? void 0 : _a.nativeElement.contains(event.target))) {
|
|
@@ -2770,12 +2941,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
2770
2941
|
type: Input
|
|
2771
2942
|
}], isSelectorOpen: [{
|
|
2772
2943
|
type: Input
|
|
2773
|
-
}], isSelectorOpenChange: [{
|
|
2774
|
-
type: Output
|
|
2775
2944
|
}], latestReactions: [{
|
|
2776
2945
|
type: Input
|
|
2777
2946
|
}], ownReactions: [{
|
|
2778
2947
|
type: Input
|
|
2948
|
+
}], isSelectorOpenChange: [{
|
|
2949
|
+
type: Output
|
|
2779
2950
|
}], selectorContainer: [{
|
|
2780
2951
|
type: ViewChild,
|
|
2781
2952
|
args: ['selectorContainer']
|
|
@@ -2784,11 +2955,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
2784
2955
|
args: ['selectorTooltip']
|
|
2785
2956
|
}] } });
|
|
2786
2957
|
|
|
2958
|
+
/**
|
|
2959
|
+
* The `Message` component displays a message with additional information such as sender and date, and enables [interaction with the message (i.e. edit or react)](../concepts/message-interactions.mdx).
|
|
2960
|
+
*/
|
|
2787
2961
|
class MessageComponent {
|
|
2788
2962
|
constructor(chatClientService, channelService) {
|
|
2789
2963
|
this.chatClientService = chatClientService;
|
|
2790
2964
|
this.channelService = channelService;
|
|
2965
|
+
/**
|
|
2966
|
+
* The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
|
|
2967
|
+
*/
|
|
2791
2968
|
this.enabledMessageActions = [];
|
|
2969
|
+
/**
|
|
2970
|
+
* Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
|
|
2971
|
+
*/
|
|
2792
2972
|
this.mode = 'main';
|
|
2793
2973
|
this.isActionBoxOpen = false;
|
|
2794
2974
|
this.isReactionSelectorOpen = false;
|
|
@@ -2969,12 +3149,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
2969
3149
|
args: ['container']
|
|
2970
3150
|
}] } });
|
|
2971
3151
|
|
|
3152
|
+
/**
|
|
3153
|
+
* The `Textarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.
|
|
3154
|
+
*/
|
|
2972
3155
|
class TextareaComponent {
|
|
2973
3156
|
constructor(emojiInputService) {
|
|
2974
3157
|
this.emojiInputService = emojiInputService;
|
|
2975
3158
|
this.class = 'str-chat__textarea';
|
|
3159
|
+
/**
|
|
3160
|
+
* The value of the input HTML element.
|
|
3161
|
+
*/
|
|
2976
3162
|
this.value = '';
|
|
3163
|
+
/**
|
|
3164
|
+
* Emits the current value of the input element when a user types.
|
|
3165
|
+
*/
|
|
2977
3166
|
this.valueChange = new EventEmitter();
|
|
3167
|
+
/**
|
|
3168
|
+
* Emits when a user triggers a message send event (this happens when they hit the `Enter` key).
|
|
3169
|
+
*/
|
|
2978
3170
|
this.send = new EventEmitter();
|
|
2979
3171
|
this.subscriptions = [];
|
|
2980
3172
|
this.subscriptions.push(this.emojiInputService.emojiInput$.subscribe((emoji) => {
|
|
@@ -3044,6 +3236,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
3044
3236
|
args: [{ providedIn: 'root' }]
|
|
3045
3237
|
}], ctorParameters: function () { return []; } });
|
|
3046
3238
|
|
|
3239
|
+
/**
|
|
3240
|
+
* The `AutocompleteTextarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.
|
|
3241
|
+
*/
|
|
3047
3242
|
class AutocompleteTextareaComponent {
|
|
3048
3243
|
constructor(channelService, chatClientService, transliterationService, emojiInputService) {
|
|
3049
3244
|
this.channelService = channelService;
|
|
@@ -3051,11 +3246,29 @@ class AutocompleteTextareaComponent {
|
|
|
3051
3246
|
this.transliterationService = transliterationService;
|
|
3052
3247
|
this.emojiInputService = emojiInputService;
|
|
3053
3248
|
this.class = 'str-chat__textarea';
|
|
3249
|
+
/**
|
|
3250
|
+
* The value of the input HTML element.
|
|
3251
|
+
*/
|
|
3054
3252
|
this.value = '';
|
|
3253
|
+
/**
|
|
3254
|
+
* If true, users can mention other users in messages. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.
|
|
3255
|
+
*/
|
|
3055
3256
|
this.areMentionsEnabled = true;
|
|
3257
|
+
/**
|
|
3258
|
+
* The scope for user mentions, either members of the current channel of members of the application. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.
|
|
3259
|
+
*/
|
|
3056
3260
|
this.mentionScope = 'channel';
|
|
3261
|
+
/**
|
|
3262
|
+
* Emits the current value of the input element when a user types.
|
|
3263
|
+
*/
|
|
3057
3264
|
this.valueChange = new EventEmitter();
|
|
3265
|
+
/**
|
|
3266
|
+
* Emits when a user triggers a message send event (this happens when they hit the `Enter` key).
|
|
3267
|
+
*/
|
|
3058
3268
|
this.send = new EventEmitter();
|
|
3269
|
+
/**
|
|
3270
|
+
* Emits the array of users that are mentioned in the message, it is updated when a user mentions a new user or deletes a mention.
|
|
3271
|
+
*/
|
|
3059
3272
|
this.userMentions = new EventEmitter();
|
|
3060
3273
|
this.autocompleteKey = 'autocompleteLabel';
|
|
3061
3274
|
this.mentionTriggerChar = '@';
|
|
@@ -3277,20 +3490,26 @@ const isOnSameDay = (date1, date2) => {
|
|
|
3277
3490
|
date1.getDate() === date2.getDate());
|
|
3278
3491
|
};
|
|
3279
3492
|
|
|
3493
|
+
/**
|
|
3494
|
+
* The `MessageList` component renders a scrollable list of messages.
|
|
3495
|
+
*/
|
|
3280
3496
|
class MessageListComponent {
|
|
3281
3497
|
constructor(channelService, chatClientService, imageLoadService) {
|
|
3282
3498
|
this.channelService = channelService;
|
|
3283
3499
|
this.chatClientService = chatClientService;
|
|
3284
3500
|
this.imageLoadService = imageLoadService;
|
|
3285
3501
|
/**
|
|
3286
|
-
* @deprecated https://getstream.io/chat/docs/
|
|
3502
|
+
* @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead. If true, the message reactions are displayed. Users can also react to messages if they have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
|
|
3287
3503
|
*/
|
|
3288
3504
|
this.areReactionsEnabled = undefined;
|
|
3289
3505
|
/**
|
|
3290
|
-
* @deprecated https://getstream.io/chat/docs/
|
|
3506
|
+
* @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead. The list of [actions that are enabled](./MessageActionsBoxComponent.mdx), please note that the user also has to have the necessary [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) for actions to work. Unathorized actions won't be displayed on the UI. The `MessgaeList` component makes the necessary checks before passing the actions to the `Message` component.
|
|
3291
3507
|
*/
|
|
3292
3508
|
/* eslint-disable-next-line @angular-eslint/no-input-rename */
|
|
3293
3509
|
this.enabledMessageActionsInput = undefined;
|
|
3510
|
+
/**
|
|
3511
|
+
* Determines if the message list should display channel messages or [thread messages](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
|
|
3512
|
+
*/
|
|
3294
3513
|
this.mode = 'main';
|
|
3295
3514
|
this.enabledMessageActions = [];
|
|
3296
3515
|
this.class = 'str-chat-angular__main-panel-inner str-chat-angular__message-list-host';
|
|
@@ -3548,6 +3767,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
3548
3767
|
args: ['parentMessageElement']
|
|
3549
3768
|
}] } });
|
|
3550
3769
|
|
|
3770
|
+
/**
|
|
3771
|
+
* The `Thread` component represents a [message thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript), it is a container component that displays a thread with a header, [`MessageList`](./MessageListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components.
|
|
3772
|
+
*/
|
|
3551
3773
|
class ThreadComponent {
|
|
3552
3774
|
constructor(channelService) {
|
|
3553
3775
|
this.channelService = channelService;
|