stream-chat-angular 4.39.5 → 4.39.7
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 +30 -51
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/avatar-placeholder/avatar-placeholder.component.js +8 -43
- package/esm2015/lib/channel.service.js +24 -12
- package/fesm2015/stream-chat-angular.js +28 -50
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/avatar-placeholder/avatar-placeholder.component.d.ts +3 -12
- package/lib/channel.service.d.ts +10 -21
- package/package.json +1 -1
- package/src/assets/version.ts +1 -1
package/assets/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.39.
|
|
1
|
+
export declare const version = "4.39.7";
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
var version = '4.39.
|
|
359
|
+
var version = '4.39.7';
|
|
360
360
|
|
|
361
361
|
/**
|
|
362
362
|
* The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
|
|
@@ -709,6 +709,7 @@
|
|
|
709
709
|
this.activeChannelPinnedMessagesSubject = new rxjs.BehaviorSubject([]);
|
|
710
710
|
this.hasMoreChannelsSubject = new rxjs.ReplaySubject(1);
|
|
711
711
|
this.activeChannelSubscriptions = [];
|
|
712
|
+
this.channelSubscriptions = {};
|
|
712
713
|
this.activeParentMessageIdSubject = new rxjs.BehaviorSubject(undefined);
|
|
713
714
|
this.activeThreadMessagesSubject = new rxjs.BehaviorSubject([]);
|
|
714
715
|
this.jumpToMessageSubject = new rxjs.BehaviorSubject({ id: undefined, parentId: undefined });
|
|
@@ -720,12 +721,13 @@
|
|
|
720
721
|
this._shouldMarkActiveChannelAsRead = true;
|
|
721
722
|
this.isStateRecoveryInProgress = false;
|
|
722
723
|
this.channelQueryStateSubject = new rxjs.BehaviorSubject(undefined);
|
|
723
|
-
this.channelListSetter = function (channels) {
|
|
724
|
+
this.channelListSetter = function (channels, shouldStopWatchingRemovedChannels) {
|
|
725
|
+
if (shouldStopWatchingRemovedChannels === void 0) { shouldStopWatchingRemovedChannels = true; }
|
|
724
726
|
var currentChannels = _this.channelsSubject.getValue() || [];
|
|
725
727
|
var newChannels = channels.filter(function (c) { return !currentChannels.find(function (channel) { return channel.cid === c.cid; }); });
|
|
726
728
|
var deletedChannels = currentChannels.filter(function (c) { return !(channels === null || channels === void 0 ? void 0 : channels.find(function (channel) { return channel.cid === c.cid; })); });
|
|
727
729
|
void _this.addChannelsFromNotification(newChannels);
|
|
728
|
-
_this.removeChannelsFromChannelList(deletedChannels.map(function (c) { return c.cid; }));
|
|
730
|
+
_this.removeChannelsFromChannelList(deletedChannels.map(function (c) { return c.cid; }), shouldStopWatchingRemovedChannels);
|
|
729
731
|
};
|
|
730
732
|
this.messageListSetter = function (messages) {
|
|
731
733
|
_this.activeChannelMessagesSubject.next(messages);
|
|
@@ -1009,6 +1011,7 @@
|
|
|
1009
1011
|
* Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./ChatClientService.mdx/#disconnectuser).
|
|
1010
1012
|
*/
|
|
1011
1013
|
ChannelService.prototype.reset = function () {
|
|
1014
|
+
var _this = this;
|
|
1012
1015
|
var _a, _b;
|
|
1013
1016
|
this.deselectActiveChannel();
|
|
1014
1017
|
this.channelsSubject.next(undefined);
|
|
@@ -1016,6 +1019,10 @@
|
|
|
1016
1019
|
(_a = this.clientEventsSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1017
1020
|
(_b = this.dismissErrorNotification) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
1018
1021
|
this.dismissErrorNotification = undefined;
|
|
1022
|
+
Object.keys(this.channelSubscriptions).forEach(function (cid) {
|
|
1023
|
+
_this.channelSubscriptions[cid]();
|
|
1024
|
+
});
|
|
1025
|
+
this.channelSubscriptions = {};
|
|
1019
1026
|
};
|
|
1020
1027
|
/**
|
|
1021
1028
|
* Loads the next page of channels. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.
|
|
@@ -1546,7 +1553,7 @@
|
|
|
1546
1553
|
};
|
|
1547
1554
|
ChannelService.prototype.handleRemovedFromChannelNotification = function (clientEvent) {
|
|
1548
1555
|
var channelIdToBeRemoved = clientEvent.event.channel.cid;
|
|
1549
|
-
this.removeChannelsFromChannelList([channelIdToBeRemoved]);
|
|
1556
|
+
this.removeChannelsFromChannelList([channelIdToBeRemoved], true);
|
|
1550
1557
|
};
|
|
1551
1558
|
ChannelService.prototype.handleNewMessageNotification = function (clientEvent) {
|
|
1552
1559
|
if (clientEvent.event.channel) {
|
|
@@ -1586,14 +1593,20 @@
|
|
|
1586
1593
|
});
|
|
1587
1594
|
});
|
|
1588
1595
|
};
|
|
1589
|
-
ChannelService.prototype.removeChannelsFromChannelList = function (cids) {
|
|
1596
|
+
ChannelService.prototype.removeChannelsFromChannelList = function (cids, shouldStopWatching) {
|
|
1590
1597
|
var _this = this;
|
|
1591
1598
|
var _a;
|
|
1592
1599
|
var channels = this.channels.filter(function (c) { return !cids.includes(c.cid || ''); });
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1600
|
+
if (shouldStopWatching) {
|
|
1601
|
+
cids.forEach(function (cid) {
|
|
1602
|
+
var _a;
|
|
1603
|
+
if (_this.channelSubscriptions[cid]) {
|
|
1604
|
+
_this.channelSubscriptions[cid]();
|
|
1605
|
+
delete _this.channelSubscriptions.cid;
|
|
1606
|
+
}
|
|
1607
|
+
void ((_a = _this.chatClientService.chatClient.activeChannels[cid]) === null || _a === void 0 ? void 0 : _a.stopWatching());
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1597
1610
|
if (channels.length < this.channels.length) {
|
|
1598
1611
|
this.channelsSubject.next(channels);
|
|
1599
1612
|
if (cids.includes(((_a = this.activeChannelSubject.getValue()) === null || _a === void 0 ? void 0 : _a.cid) || '')) {
|
|
@@ -1815,7 +1828,7 @@
|
|
|
1815
1828
|
};
|
|
1816
1829
|
ChannelService.prototype.watchForChannelEvents = function (channel) {
|
|
1817
1830
|
var _this = this;
|
|
1818
|
-
channel.on(function (event) {
|
|
1831
|
+
var unsubscribe = channel.on(function (event) {
|
|
1819
1832
|
switch (event.type) {
|
|
1820
1833
|
case 'message.new': {
|
|
1821
1834
|
_this.ngZone.run(function () {
|
|
@@ -1885,6 +1898,7 @@
|
|
|
1885
1898
|
}
|
|
1886
1899
|
}
|
|
1887
1900
|
});
|
|
1901
|
+
this.channelSubscriptions[channel.cid] = unsubscribe.unsubscribe;
|
|
1888
1902
|
};
|
|
1889
1903
|
ChannelService.prototype.handleNewMessage = function (_, channel) {
|
|
1890
1904
|
var channelIndex = this.channels.findIndex(function (c) { return c.cid === channel.cid; });
|
|
@@ -1892,10 +1906,10 @@
|
|
|
1892
1906
|
this.channelsSubject.next(__spreadArray([channel], __read(this.channels)));
|
|
1893
1907
|
};
|
|
1894
1908
|
ChannelService.prototype.handleChannelHidden = function (event) {
|
|
1895
|
-
this.removeChannelsFromChannelList([event.channel.cid]);
|
|
1909
|
+
this.removeChannelsFromChannelList([event.channel.cid], false);
|
|
1896
1910
|
};
|
|
1897
1911
|
ChannelService.prototype.handleChannelDeleted = function (event) {
|
|
1898
|
-
this.removeChannelsFromChannelList([event.channel.cid]);
|
|
1912
|
+
this.removeChannelsFromChannelList([event.channel.cid], true);
|
|
1899
1913
|
};
|
|
1900
1914
|
ChannelService.prototype.handleChannelVisible = function (event, channel) {
|
|
1901
1915
|
var _this = this;
|
|
@@ -3166,11 +3180,8 @@
|
|
|
3166
3180
|
* The `AvatarPlaceholder` component displays the [default avatar](./AvatarComponent.mdx) unless a [custom template](../services/CustomTemplatesService.mdx) is provided. This component is used by the SDK internally, you likely won't need to use it.
|
|
3167
3181
|
*/
|
|
3168
3182
|
var AvatarPlaceholderComponent = /** @class */ (function () {
|
|
3169
|
-
function AvatarPlaceholderComponent(customTemplatesService
|
|
3183
|
+
function AvatarPlaceholderComponent(customTemplatesService) {
|
|
3170
3184
|
this.customTemplatesService = customTemplatesService;
|
|
3171
|
-
this.hostElement = hostElement;
|
|
3172
|
-
this.cdRef = cdRef;
|
|
3173
|
-
this.themeService = themeService;
|
|
3174
3185
|
/**
|
|
3175
3186
|
* The size in pixels of the avatar image.
|
|
3176
3187
|
*/
|
|
@@ -3194,28 +3205,7 @@
|
|
|
3194
3205
|
initialsType: undefined,
|
|
3195
3206
|
showOnlineIndicator: undefined,
|
|
3196
3207
|
};
|
|
3197
|
-
this.isVisible = true;
|
|
3198
3208
|
}
|
|
3199
|
-
AvatarPlaceholderComponent.prototype.ngAfterViewInit = function () {
|
|
3200
|
-
var _this = this;
|
|
3201
|
-
var _a, _b;
|
|
3202
|
-
var elementToObserve = (_b = (_a = this.hostElement.nativeElement.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement;
|
|
3203
|
-
if (this.location !== 'message-sender' ||
|
|
3204
|
-
!elementToObserve ||
|
|
3205
|
-
!elementToObserve.classList.contains('str-chat__li') ||
|
|
3206
|
-
this.themeService.themeVersion === '1') {
|
|
3207
|
-
this.isVisible = true;
|
|
3208
|
-
this.cdRef.detectChanges();
|
|
3209
|
-
return;
|
|
3210
|
-
}
|
|
3211
|
-
this.checkIfVisible();
|
|
3212
|
-
this.mutationObserver = new MutationObserver(function () {
|
|
3213
|
-
_this.checkIfVisible();
|
|
3214
|
-
});
|
|
3215
|
-
this.mutationObserver.observe(elementToObserve, {
|
|
3216
|
-
attributeFilter: ['class'],
|
|
3217
|
-
});
|
|
3218
|
-
};
|
|
3219
3209
|
AvatarPlaceholderComponent.prototype.ngOnChanges = function () {
|
|
3220
3210
|
this.context = {
|
|
3221
3211
|
name: this.name,
|
|
@@ -3229,21 +3219,10 @@
|
|
|
3229
3219
|
showOnlineIndicator: this.showOnlineIndicator,
|
|
3230
3220
|
};
|
|
3231
3221
|
};
|
|
3232
|
-
AvatarPlaceholderComponent.prototype.ngOnDestroy = function () {
|
|
3233
|
-
var _a;
|
|
3234
|
-
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
3235
|
-
};
|
|
3236
|
-
AvatarPlaceholderComponent.prototype.checkIfVisible = function () {
|
|
3237
|
-
var isVisible = getComputedStyle(this.hostElement.nativeElement).getPropertyValue('visibility') === 'visible';
|
|
3238
|
-
if (isVisible !== this.isVisible) {
|
|
3239
|
-
this.isVisible = isVisible;
|
|
3240
|
-
this.cdRef.detectChanges();
|
|
3241
|
-
}
|
|
3242
|
-
};
|
|
3243
3222
|
return AvatarPlaceholderComponent;
|
|
3244
3223
|
}());
|
|
3245
|
-
AvatarPlaceholderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AvatarPlaceholderComponent, deps: [{ token: CustomTemplatesService }
|
|
3246
|
-
AvatarPlaceholderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: { name: "name", imageUrl: "imageUrl", size: "size", location: "location", channel: "channel", user: "user", type: "type", initialsType: "initialsType", showOnlineIndicator: "showOnlineIndicator" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-template\n #defaultAvatar\n let-name=\"name\"\n let-imageUrl=\"imageUrl\"\n let-size=\"size\"\n let-type=\"type\"\n let-channel=\"channel\"\n let-user=\"user\"\n let-location=\"location\"\n let-initialsType=\"initialsType\"\n let-showOnlineIndicator=\"showOnlineIndicator\"\n>\n <stream-avatar\n [name]=\"name\"\n [imageUrl]=\"imageUrl\"\n [size]=\"size\"\n [type]=\"type\"\n [channel]=\"channel\"\n [user]=\"user\"\n [location]=\"location\"\n [initialsType]=\"initialsType\"\n [showOnlineIndicator]=\"showOnlineIndicator\"\n ></stream-avatar>\n</ng-template>\n<ng-container
|
|
3224
|
+
AvatarPlaceholderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AvatarPlaceholderComponent, deps: [{ token: CustomTemplatesService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3225
|
+
AvatarPlaceholderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: { name: "name", imageUrl: "imageUrl", size: "size", location: "location", channel: "channel", user: "user", type: "type", initialsType: "initialsType", showOnlineIndicator: "showOnlineIndicator" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-template\n #defaultAvatar\n let-name=\"name\"\n let-imageUrl=\"imageUrl\"\n let-size=\"size\"\n let-type=\"type\"\n let-channel=\"channel\"\n let-user=\"user\"\n let-location=\"location\"\n let-initialsType=\"initialsType\"\n let-showOnlineIndicator=\"showOnlineIndicator\"\n>\n <stream-avatar\n [name]=\"name\"\n [imageUrl]=\"imageUrl\"\n [size]=\"size\"\n [type]=\"type\"\n [channel]=\"channel\"\n [user]=\"user\"\n [location]=\"location\"\n [initialsType]=\"initialsType\"\n [showOnlineIndicator]=\"showOnlineIndicator\"\n ></stream-avatar>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.avatarTemplate$ | async) || defaultAvatar;\n context: context\n \"\n></ng-container>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size", "location", "channel", "user", "type", "showOnlineIndicator", "initialsType"] }], directives: [{ type: i5__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i5__namespace.AsyncPipe } });
|
|
3247
3226
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AvatarPlaceholderComponent, decorators: [{
|
|
3248
3227
|
type: i0.Component,
|
|
3249
3228
|
args: [{
|
|
@@ -3251,7 +3230,7 @@
|
|
|
3251
3230
|
templateUrl: './avatar-placeholder.component.html',
|
|
3252
3231
|
styles: [],
|
|
3253
3232
|
}]
|
|
3254
|
-
}], ctorParameters: function () { return [{ type: CustomTemplatesService }
|
|
3233
|
+
}], ctorParameters: function () { return [{ type: CustomTemplatesService }]; }, propDecorators: { name: [{
|
|
3255
3234
|
type: i0.Input
|
|
3256
3235
|
}], imageUrl: [{
|
|
3257
3236
|
type: i0.Input
|