stream-chat-angular 2.19.0 → 2.20.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/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +165 -156
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/channel-header/channel-header.component.js +8 -5
- package/esm2015/lib/channel.service.js +71 -59
- package/esm2015/lib/chat-client.service.js +26 -2
- package/esm2015/lib/notification/notification.component.js +1 -1
- package/esm2015/lib/notification-list/notification-list.component.js +7 -4
- package/esm2015/lib/notification.service.js +34 -18
- package/esm2015/lib/types.js +1 -1
- package/fesm2015/stream-chat-angular.js +139 -82
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/channel-header/channel-header.component.d.ts +8 -1
- package/lib/channel.service.d.ts +13 -13
- package/lib/chat-client.service.d.ts +7 -1
- package/lib/notification/notification.component.d.ts +1 -1
- package/lib/notification-list/notification-list.component.d.ts +6 -2
- package/lib/notification.service.d.ts +14 -13
- package/lib/types.d.ts +11 -0
- package/package.json +1 -1
- package/src/assets/version.ts +1 -1
|
@@ -17,7 +17,7 @@ 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.20.0';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
|
|
@@ -29,40 +29,56 @@ class NotificationService {
|
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Displays a notification for the given amount of time.
|
|
32
|
-
* @param
|
|
32
|
+
* @param content The text of the notification or the HTML template for the notification
|
|
33
33
|
* @param type The type of the notification
|
|
34
34
|
* @param timeout The number of milliseconds while the notification should be visible
|
|
35
|
-
* @param translateParams Translation parameters for the `text
|
|
35
|
+
* @param translateParams Translation parameters for the `content` (for text notifications)
|
|
36
|
+
* @param templateContext The input of the notification template (for HTML notifications)
|
|
36
37
|
* @returns A method to clear the notification (before the timeout).
|
|
37
38
|
*/
|
|
38
|
-
addTemporaryNotification(
|
|
39
|
-
this.
|
|
40
|
-
const id = setTimeout(() => this.removeNotification(
|
|
41
|
-
|
|
39
|
+
addTemporaryNotification(content, type = 'error', timeout = 5000, translateParams, templateContext) {
|
|
40
|
+
const notification = this.createNotification(content, type, translateParams, templateContext);
|
|
41
|
+
const id = setTimeout(() => this.removeNotification(notification.id), timeout);
|
|
42
|
+
notification.dismissFn = () => {
|
|
42
43
|
clearTimeout(id);
|
|
43
|
-
this.removeNotification(
|
|
44
|
+
this.removeNotification(notification.id);
|
|
44
45
|
};
|
|
46
|
+
this.notificationsSubject.next([
|
|
47
|
+
...this.notificationsSubject.getValue(),
|
|
48
|
+
notification,
|
|
49
|
+
]);
|
|
50
|
+
return notification.dismissFn;
|
|
45
51
|
}
|
|
46
52
|
/**
|
|
47
53
|
* Displays a notification, that will be visible until it's removed.
|
|
48
|
-
* @param
|
|
54
|
+
* @param content The text of the notification or the HTML template for the notification
|
|
49
55
|
* @param type The type of the notification
|
|
50
|
-
* @param translateParams Translation parameters for the `text
|
|
56
|
+
* @param translateParams Translation parameters for the `content` (for text notifications)
|
|
57
|
+
* @param templateContext The input of the notification template (for HTML notifications)
|
|
51
58
|
* @returns A method to clear the notification.
|
|
52
59
|
*/
|
|
53
|
-
addPermanentNotification(
|
|
54
|
-
this.
|
|
55
|
-
return () => this.removeNotification(text);
|
|
56
|
-
}
|
|
57
|
-
addNotification(text, type, translateParams) {
|
|
60
|
+
addPermanentNotification(content, type = 'error', translateParams, templateContext) {
|
|
61
|
+
const notification = this.createNotification(content, type, translateParams, templateContext);
|
|
58
62
|
this.notificationsSubject.next([
|
|
59
63
|
...this.notificationsSubject.getValue(),
|
|
60
|
-
|
|
64
|
+
notification,
|
|
61
65
|
]);
|
|
66
|
+
return notification.dismissFn;
|
|
67
|
+
}
|
|
68
|
+
createNotification(content, type, translateParams, templateContext) {
|
|
69
|
+
const id = new Date().getTime().toString() + Math.random().toString();
|
|
70
|
+
return {
|
|
71
|
+
id,
|
|
72
|
+
[typeof content === 'string' ? 'text' : 'template']: content,
|
|
73
|
+
type,
|
|
74
|
+
translateParams,
|
|
75
|
+
templateContext,
|
|
76
|
+
dismissFn: () => this.removeNotification(id),
|
|
77
|
+
};
|
|
62
78
|
}
|
|
63
|
-
removeNotification(
|
|
79
|
+
removeNotification(id) {
|
|
64
80
|
const notifications = this.notificationsSubject.getValue();
|
|
65
|
-
const index = notifications.findIndex((n) => n.
|
|
81
|
+
const index = notifications.findIndex((n) => n.id === id);
|
|
66
82
|
if (index === -1) {
|
|
67
83
|
return;
|
|
68
84
|
}
|
|
@@ -89,9 +105,11 @@ class ChatClientService {
|
|
|
89
105
|
this.notificationSubject = new ReplaySubject(1);
|
|
90
106
|
this.connectionStateSubject = new ReplaySubject(1);
|
|
91
107
|
this.appSettingsSubject = new BehaviorSubject(undefined);
|
|
108
|
+
this.pendingInvitesSubject = new BehaviorSubject([]);
|
|
92
109
|
this.notification$ = this.notificationSubject.asObservable();
|
|
93
110
|
this.connectionState$ = this.connectionStateSubject.asObservable();
|
|
94
111
|
this.appSettings$ = this.appSettingsSubject.asObservable();
|
|
112
|
+
this.pendingInvites$ = this.pendingInvitesSubject.asObservable();
|
|
95
113
|
}
|
|
96
114
|
/**
|
|
97
115
|
* Creates a [`StreamChat`](https://github.com/GetStream/stream-chat-js/blob/668b3e5521339f4e14fc657834531b4c8bf8176b/src/client.ts#L124) instance using the provided `apiKey`, and connects a user with the given meta data and token. More info about [connecting users](https://getstream.io/chat/docs/javascript/init_and_users/?language=javascript) can be found in the platform documentation.
|
|
@@ -100,16 +118,20 @@ class ChatClientService {
|
|
|
100
118
|
* @param userTokenOrProvider
|
|
101
119
|
*/
|
|
102
120
|
init(apiKey, userOrId, userTokenOrProvider) {
|
|
121
|
+
var _a;
|
|
103
122
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
123
|
this.chatClient = StreamChat.getInstance(apiKey);
|
|
124
|
+
this.chatClient.devToken;
|
|
105
125
|
yield this.ngZone.runOutsideAngular(() => __awaiter(this, void 0, void 0, function* () {
|
|
106
126
|
const user = typeof userOrId === 'string' ? { id: userOrId } : userOrId;
|
|
107
127
|
yield this.chatClient.connectUser(user, userTokenOrProvider);
|
|
108
128
|
this.chatClient.setUserAgent(`stream-chat-angular-${version}-${this.chatClient.getUserAgent()}`);
|
|
109
|
-
this.chatClient.getAppSettings;
|
|
110
129
|
}));
|
|
130
|
+
const channels = yield this.chatClient.queryChannels({ invite: 'pending' }, {}, { user_id: (_a = this.chatClient.user) === null || _a === void 0 ? void 0 : _a.id });
|
|
131
|
+
this.pendingInvitesSubject.next(channels);
|
|
111
132
|
this.appSettingsSubject.next(undefined);
|
|
112
133
|
this.chatClient.on((e) => {
|
|
134
|
+
this.updatePendingInvites(e);
|
|
113
135
|
this.notificationSubject.next({
|
|
114
136
|
eventType: e.type,
|
|
115
137
|
event: e,
|
|
@@ -138,6 +160,7 @@ class ChatClientService {
|
|
|
138
160
|
*/
|
|
139
161
|
disconnectUser() {
|
|
140
162
|
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
this.pendingInvitesSubject.next([]);
|
|
141
164
|
yield this.chatClient.disconnectUser();
|
|
142
165
|
});
|
|
143
166
|
}
|
|
@@ -182,6 +205,23 @@ class ChatClientService {
|
|
|
182
205
|
return result.users;
|
|
183
206
|
});
|
|
184
207
|
}
|
|
208
|
+
updatePendingInvites(e) {
|
|
209
|
+
var _a, _b, _c;
|
|
210
|
+
if (((_b = (_a = e.member) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.id) === ((_c = this.chatClient.user) === null || _c === void 0 ? void 0 : _c.id) && e.channel) {
|
|
211
|
+
const pendingInvites = this.pendingInvitesSubject.getValue();
|
|
212
|
+
if (e.type === 'notification.invited') {
|
|
213
|
+
this.pendingInvitesSubject.next([...pendingInvites, e.channel]);
|
|
214
|
+
}
|
|
215
|
+
else if (e.type === 'notification.invite_accepted' ||
|
|
216
|
+
e.type === 'notification.invite_rejected') {
|
|
217
|
+
const index = pendingInvites.findIndex((i) => { var _a; return (i === null || i === void 0 ? void 0 : i.cid) === ((_a = e.channel) === null || _a === void 0 ? void 0 : _a.cid); });
|
|
218
|
+
if (index !== -1) {
|
|
219
|
+
pendingInvites.splice(index, 1);
|
|
220
|
+
this.pendingInvitesSubject.next([...pendingInvites]);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
185
225
|
}
|
|
186
226
|
ChatClientService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: ChatClientService, deps: [{ token: i0.NgZone }, { token: NotificationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
187
227
|
ChatClientService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: ChatClientService, providedIn: 'root' });
|
|
@@ -244,7 +284,14 @@ class ChannelService {
|
|
|
244
284
|
this.usersTypingInChannelSubject = new BehaviorSubject([]);
|
|
245
285
|
this.usersTypingInThreadSubject = new BehaviorSubject([]);
|
|
246
286
|
this.channelListSetter = (channels) => {
|
|
247
|
-
this.channelsSubject.
|
|
287
|
+
const currentChannels = this.channelsSubject.getValue() || [];
|
|
288
|
+
const newChannels = channels.filter((c) => !currentChannels.find((channel) => channel.cid === c.cid));
|
|
289
|
+
const deletedChannels = currentChannels.filter((c) => !(channels === null || channels === void 0 ? void 0 : channels.find((channel) => channel.cid === c.cid)));
|
|
290
|
+
this.addChannelsFromNotification(newChannels);
|
|
291
|
+
this.removeChannelsFromChannelList(deletedChannels.map((c) => c.cid));
|
|
292
|
+
if (!newChannels.length && !deletedChannels.length) {
|
|
293
|
+
this.channelsSubject.next(channels);
|
|
294
|
+
}
|
|
248
295
|
};
|
|
249
296
|
this.messageListSetter = (messages) => {
|
|
250
297
|
this.activeChannelMessagesSubject.next(messages);
|
|
@@ -641,75 +688,80 @@ class ChannelService {
|
|
|
641
688
|
});
|
|
642
689
|
}
|
|
643
690
|
handleNotification(notification) {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
break;
|
|
656
|
-
}
|
|
657
|
-
case 'notification.added_to_channel': {
|
|
658
|
-
yield this.ngZone.run(() => __awaiter(this, void 0, void 0, function* () {
|
|
659
|
-
if (this.customAddedToChannelNotificationHandler) {
|
|
660
|
-
this.customAddedToChannelNotificationHandler(notification, this.channelListSetter);
|
|
661
|
-
}
|
|
662
|
-
else {
|
|
663
|
-
yield this.handleAddedToChannelNotification(notification);
|
|
664
|
-
}
|
|
665
|
-
}));
|
|
666
|
-
break;
|
|
667
|
-
}
|
|
668
|
-
case 'notification.removed_from_channel': {
|
|
669
|
-
this.ngZone.run(() => {
|
|
670
|
-
if (this.customRemovedFromChannelNotificationHandler) {
|
|
671
|
-
this.customRemovedFromChannelNotificationHandler(notification, this.channelListSetter);
|
|
672
|
-
}
|
|
673
|
-
else {
|
|
674
|
-
this.handleRemovedFromChannelNotification(notification);
|
|
675
|
-
}
|
|
676
|
-
});
|
|
677
|
-
}
|
|
691
|
+
switch (notification.eventType) {
|
|
692
|
+
case 'notification.message_new': {
|
|
693
|
+
this.ngZone.run(() => {
|
|
694
|
+
if (this.customNewMessageNotificationHandler) {
|
|
695
|
+
this.customNewMessageNotificationHandler(notification, this.channelListSetter);
|
|
696
|
+
}
|
|
697
|
+
else {
|
|
698
|
+
this.handleNewMessageNotification(notification);
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
break;
|
|
678
702
|
}
|
|
679
|
-
|
|
703
|
+
case 'notification.added_to_channel': {
|
|
704
|
+
this.ngZone.run(() => {
|
|
705
|
+
if (this.customAddedToChannelNotificationHandler) {
|
|
706
|
+
this.customAddedToChannelNotificationHandler(notification, this.channelListSetter);
|
|
707
|
+
}
|
|
708
|
+
else {
|
|
709
|
+
this.handleAddedToChannelNotification(notification);
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
break;
|
|
713
|
+
}
|
|
714
|
+
case 'notification.removed_from_channel': {
|
|
715
|
+
this.ngZone.run(() => {
|
|
716
|
+
if (this.customRemovedFromChannelNotificationHandler) {
|
|
717
|
+
this.customRemovedFromChannelNotificationHandler(notification, this.channelListSetter);
|
|
718
|
+
}
|
|
719
|
+
else {
|
|
720
|
+
this.handleRemovedFromChannelNotification(notification);
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
}
|
|
680
725
|
}
|
|
681
726
|
handleRemovedFromChannelNotification(notification) {
|
|
682
727
|
const channelIdToBeRemoved = notification.event.channel.cid;
|
|
683
|
-
this.
|
|
728
|
+
this.removeChannelsFromChannelList([channelIdToBeRemoved]);
|
|
684
729
|
}
|
|
685
730
|
handleNewMessageNotification(notification) {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
}
|
|
731
|
+
if (notification.event.channel) {
|
|
732
|
+
this.addChannelsFromNotification([notification.event.channel]);
|
|
733
|
+
}
|
|
689
734
|
}
|
|
690
735
|
handleAddedToChannelNotification(notification) {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
}
|
|
736
|
+
if (notification.event.channel) {
|
|
737
|
+
this.addChannelsFromNotification([notification.event.channel]);
|
|
738
|
+
}
|
|
694
739
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
const channel = this.chatClientService.chatClient.channel(
|
|
699
|
-
|
|
740
|
+
addChannelsFromNotification(channelResponses) {
|
|
741
|
+
const newChannels = [];
|
|
742
|
+
channelResponses.forEach((channelResponse) => {
|
|
743
|
+
const channel = this.chatClientService.chatClient.channel(channelResponse.type, channelResponse.id);
|
|
744
|
+
void channel.watch();
|
|
700
745
|
this.watchForChannelEvents(channel);
|
|
701
|
-
|
|
702
|
-
channel,
|
|
703
|
-
...(this.channelsSubject.getValue() || []),
|
|
704
|
-
]);
|
|
746
|
+
newChannels.push(channel);
|
|
705
747
|
});
|
|
748
|
+
this.channelsSubject.next([
|
|
749
|
+
...newChannels,
|
|
750
|
+
...(this.channelsSubject.getValue() || []),
|
|
751
|
+
]);
|
|
706
752
|
}
|
|
707
|
-
|
|
708
|
-
|
|
753
|
+
removeChannelsFromChannelList(cids) {
|
|
754
|
+
var _a;
|
|
755
|
+
const channels = this.channels.filter((c) => !cids.includes(c.cid || ''));
|
|
709
756
|
if (channels.length < this.channels.length) {
|
|
710
757
|
this.channelsSubject.next(channels);
|
|
711
|
-
if (this.activeChannelSubject.getValue()
|
|
712
|
-
|
|
758
|
+
if (cids.includes(((_a = this.activeChannelSubject.getValue()) === null || _a === void 0 ? void 0 : _a.cid) || '')) {
|
|
759
|
+
if (channels.length > 0) {
|
|
760
|
+
this.setAsActiveChannel(channels[0]);
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
this.activeChannelSubject.next(undefined);
|
|
764
|
+
}
|
|
713
765
|
}
|
|
714
766
|
}
|
|
715
767
|
}
|
|
@@ -927,10 +979,10 @@ class ChannelService {
|
|
|
927
979
|
this.channelsSubject.next([channel, ...this.channels]);
|
|
928
980
|
}
|
|
929
981
|
handleChannelHidden(event) {
|
|
930
|
-
this.
|
|
982
|
+
this.removeChannelsFromChannelList([event.channel.cid]);
|
|
931
983
|
}
|
|
932
984
|
handleChannelDeleted(event) {
|
|
933
|
-
this.
|
|
985
|
+
this.removeChannelsFromChannelList([event.channel.cid]);
|
|
934
986
|
}
|
|
935
987
|
handleChannelVisible(event, channel) {
|
|
936
988
|
if (!this.channels.find((c) => c.cid === event.cid)) {
|
|
@@ -2354,12 +2406,15 @@ class NotificationListComponent {
|
|
|
2354
2406
|
this.notificationService = notificationService;
|
|
2355
2407
|
this.notifications$ = this.notificationService.notifications$;
|
|
2356
2408
|
}
|
|
2357
|
-
|
|
2358
|
-
return item;
|
|
2409
|
+
trackById(_, item) {
|
|
2410
|
+
return item.id;
|
|
2411
|
+
}
|
|
2412
|
+
getTemplateContext(notification) {
|
|
2413
|
+
return Object.assign(Object.assign({}, notification.templateContext), { dismissFn: notification.dismissFn });
|
|
2359
2414
|
}
|
|
2360
2415
|
}
|
|
2361
2416
|
NotificationListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NotificationListComponent, deps: [{ token: NotificationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2362
|
-
NotificationListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: NotificationListComponent, selector: "stream-notification-list", ngImport: i0, template: "<div class=\"str-chat__list-notifications\">\n <stream-notification\n *ngFor=\"let notification of notifications$ | async; trackBy:
|
|
2417
|
+
NotificationListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: NotificationListComponent, selector: "stream-notification-list", ngImport: i0, template: "<div class=\"str-chat__list-notifications\">\n <stream-notification\n *ngFor=\"let notification of notifications$ | async; trackBy: trackById\"\n [type]=\"notification.type\"\n >\n <div\n *ngIf=\"notification.text !== undefined\"\n data-testclass=\"notification-content\"\n >\n {{ notification.text | translate: notification.translateParams }}\n </div>\n <ng-container *ngIf=\"notification.template !== undefined\">\n <ng-container\n *ngTemplateOutlet=\"\n notification.template;\n context: getTemplateContext(notification)\n \"\n ></ng-container>\n </ng-container>\n </stream-notification>\n</div>\n", components: [{ type: NotificationComponent, selector: "stream-notification", inputs: ["type"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i6.AsyncPipe, "translate": i2.TranslatePipe } });
|
|
2363
2418
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NotificationListComponent, decorators: [{
|
|
2364
2419
|
type: Component,
|
|
2365
2420
|
args: [{
|
|
@@ -2660,7 +2715,7 @@ class ChannelHeaderComponent {
|
|
|
2660
2715
|
}
|
|
2661
2716
|
}
|
|
2662
2717
|
ChannelHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: ChannelHeaderComponent, deps: [{ token: ChannelService }, { token: ChannelListToggleService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2663
|
-
ChannelHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelHeaderComponent, selector: "stream-channel-header", ngImport: i0, 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 <stream-icon icon=\"menu\"></stream-icon>\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: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate": i2.TranslatePipe } });
|
|
2718
|
+
ChannelHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelHeaderComponent, selector: "stream-channel-header", inputs: { channelActionsTemplate: "channelActionsTemplate" }, ngImport: i0, 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 <stream-icon icon=\"menu\"></stream-icon>\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 <ng-container *ngIf=\"channelActionsTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n channelActionsTemplate;\n context: { channel: activeChannel }\n \"\n ></ng-container>\n </ng-container>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "translate": i2.TranslatePipe } });
|
|
2664
2719
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: ChannelHeaderComponent, decorators: [{
|
|
2665
2720
|
type: Component,
|
|
2666
2721
|
args: [{
|
|
@@ -2668,7 +2723,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
2668
2723
|
templateUrl: './channel-header.component.html',
|
|
2669
2724
|
styles: [],
|
|
2670
2725
|
}]
|
|
2671
|
-
}], ctorParameters: function () { return [{ type: ChannelService }, { type: ChannelListToggleService }]; }
|
|
2726
|
+
}], ctorParameters: function () { return [{ type: ChannelService }, { type: ChannelListToggleService }]; }, propDecorators: { channelActionsTemplate: [{
|
|
2727
|
+
type: Input
|
|
2728
|
+
}] } });
|
|
2672
2729
|
|
|
2673
2730
|
/**
|
|
2674
2731
|
* The `ChannelPreview` component displays a channel preview in the channel list, it consists of the image, name and latest message of the channel.
|