stream-chat-angular 4.45.0 → 4.45.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 +29 -51
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/avatar/avatar.component.js +23 -35
- package/fesm2015/stream-chat-angular.js +23 -34
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/avatar/avatar.component.d.ts +1 -1
- 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.45.
|
|
1
|
+
export declare const version = "4.45.1";
|
|
@@ -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.45.
|
|
359
|
+
var version = '4.45.1';
|
|
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.
|
|
@@ -2880,56 +2880,34 @@
|
|
|
2880
2880
|
this.isOnline = false;
|
|
2881
2881
|
}
|
|
2882
2882
|
AvatarComponent.prototype.ngOnChanges = function (changes) {
|
|
2883
|
-
var
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
.
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
_this.isOnline = ((_a = event.event.user) === null || _a === void 0 ? void 0 : _a.online) || false;
|
|
2902
|
-
});
|
|
2903
|
-
}
|
|
2904
|
-
});
|
|
2905
|
-
_f.label = 1;
|
|
2906
|
-
case 1:
|
|
2907
|
-
_f.trys.push([1, 3, , 4]);
|
|
2908
|
-
return [4 /*yield*/, this.chatClientService.chatClient.queryUsers({
|
|
2909
|
-
id: { $eq: otherMember_1.id },
|
|
2910
|
-
})];
|
|
2911
|
-
case 2:
|
|
2912
|
-
response = _f.sent();
|
|
2913
|
-
this.isOnline = ((_a = response.users[0]) === null || _a === void 0 ? void 0 : _a.online) || false;
|
|
2914
|
-
return [3 /*break*/, 4];
|
|
2915
|
-
case 3:
|
|
2916
|
-
error_1 = _f.sent();
|
|
2917
|
-
// Fallback if we can't query user -> for example due to permission problems
|
|
2918
|
-
this.isOnline = otherMember_1.online || false;
|
|
2919
|
-
return [3 /*break*/, 4];
|
|
2920
|
-
case 4: return [3 /*break*/, 6];
|
|
2921
|
-
case 5:
|
|
2922
|
-
(_b = this.isOnlineSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
2923
|
-
_f.label = 6;
|
|
2924
|
-
case 6: return [3 /*break*/, 8];
|
|
2925
|
-
case 7:
|
|
2926
|
-
this.isOnline = false;
|
|
2927
|
-
(_c = this.isOnlineSubscription) === null || _c === void 0 ? void 0 : _c.unsubscribe();
|
|
2928
|
-
_f.label = 8;
|
|
2929
|
-
case 8: return [2 /*return*/];
|
|
2883
|
+
var _this = this;
|
|
2884
|
+
var _a, _b;
|
|
2885
|
+
if (changes['channel']) {
|
|
2886
|
+
if (this.channel) {
|
|
2887
|
+
var otherMember_1 = this.getOtherMemberIfOneToOneChannel();
|
|
2888
|
+
if (otherMember_1) {
|
|
2889
|
+
this.isOnline = otherMember_1.online || false;
|
|
2890
|
+
this.isOnlineSubscription = this.chatClientService.events$
|
|
2891
|
+
.pipe(operators.filter(function (e) { return e.eventType === 'user.presence.changed'; }))
|
|
2892
|
+
.subscribe(function (event) {
|
|
2893
|
+
var _a;
|
|
2894
|
+
if (((_a = event.event.user) === null || _a === void 0 ? void 0 : _a.id) === otherMember_1.id) {
|
|
2895
|
+
_this.ngZone.run(function () {
|
|
2896
|
+
var _a;
|
|
2897
|
+
_this.isOnline = ((_a = event.event.user) === null || _a === void 0 ? void 0 : _a.online) || false;
|
|
2898
|
+
});
|
|
2899
|
+
}
|
|
2900
|
+
});
|
|
2930
2901
|
}
|
|
2931
|
-
|
|
2932
|
-
|
|
2902
|
+
else {
|
|
2903
|
+
(_a = this.isOnlineSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
else {
|
|
2907
|
+
this.isOnline = false;
|
|
2908
|
+
(_b = this.isOnlineSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2933
2911
|
};
|
|
2934
2912
|
Object.defineProperty(AvatarComponent.prototype, "initials", {
|
|
2935
2913
|
get: function () {
|
|
@@ -2997,7 +2975,7 @@
|
|
|
2997
2975
|
return AvatarComponent;
|
|
2998
2976
|
}());
|
|
2999
2977
|
AvatarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AvatarComponent, deps: [{ token: ChatClientService }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3000
|
-
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", location: "location", channel: "channel", user: "user", type: "type", showOnlineIndicator: "showOnlineIndicator", initialsType: "initialsType" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div\n class=\"str-chat__avatar str-chat__avatar--circle stream-chat__avatar--{{\n location\n }}\"\n title=\"{{ name }}\"\n [style]=\"{\n flexBasis: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n fontSize:\n initialsType === 'first-letter-of-first-word'\n ? 'calc(var(--str-chat__spacing-px, 1px) * ' + size / 2 + ')'\n : 'calc(var(--str-chat__spacing-px, 1px) * ' + size / 3 + ')',\n height: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n lineHeight: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n width: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')'\n }\"\n>\n <img\n *ngIf=\"(imageUrl || fallbackChannelImage) && !isError; else fallback\"\n class=\"str-chat__avatar-image str-chat__avatar-image{{\n isLoaded ? ' str-chat__avatar-image--loaded' : ''\n }}\"\n src=\"{{ imageUrl || fallbackChannelImage }}\"\n alt=\"{{ initials }}\"\n data-testid=\"avatar-img\"\n (load)=\"isLoaded = true\"\n (error)=\"isError = true\"\n [style]=\"{\n flexBasis: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n height: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n objectFit: 'cover',\n width: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')'\n }\"\n />\n <ng-template #fallback>\n <div\n data-testid=\"fallback-img\"\n style=\"overflow: hidden; white-space: nowrap; text-overflow: ellipsis\"\n class=\"str-chat__avatar-fallback\"\n >\n {{ initials }}\n </div>\n </ng-template>\n <div\n data-testid=\"online-indicator\"\n *ngIf=\"isOnline\"\n class=\"str-chat__avatar--online-indicator\"\n ></div>\n</div>\n", styles: [""], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2978
|
+
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", location: "location", channel: "channel", user: "user", type: "type", showOnlineIndicator: "showOnlineIndicator", initialsType: "initialsType" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div\n class=\"str-chat__avatar str-chat__avatar--circle stream-chat__avatar--{{\n location\n }}\"\n title=\"{{ name }}\"\n [style]=\"{\n flexBasis: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n fontSize:\n initialsType === 'first-letter-of-first-word'\n ? 'calc(var(--str-chat__spacing-px, 1px) * ' + size / 2 + ')'\n : 'calc(var(--str-chat__spacing-px, 1px) * ' + size / 3 + ')',\n height: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n lineHeight: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n width: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')'\n }\"\n>\n <img\n *ngIf=\"(imageUrl || fallbackChannelImage) && !isError; else fallback\"\n class=\"str-chat__avatar-image str-chat__avatar-image{{\n isLoaded ? ' str-chat__avatar-image--loaded' : ''\n }}\"\n src=\"{{ imageUrl || fallbackChannelImage }}\"\n alt=\"{{ initials }}\"\n data-testid=\"avatar-img\"\n (load)=\"isLoaded = true\"\n (error)=\"isError = true\"\n [style]=\"{\n flexBasis: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n height: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n objectFit: 'cover',\n width: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')'\n }\"\n />\n <ng-template #fallback>\n <div\n data-testid=\"fallback-img\"\n style=\"overflow: hidden; white-space: nowrap; text-overflow: ellipsis\"\n class=\"str-chat__avatar-fallback\"\n >\n {{ initials }}\n </div>\n </ng-template>\n <div\n data-testid=\"online-indicator\"\n *ngIf=\"isOnline && showOnlineIndicator\"\n class=\"str-chat__avatar--online-indicator\"\n ></div>\n</div>\n", styles: [""], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3001
2979
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AvatarComponent, decorators: [{
|
|
3002
2980
|
type: i0.Component,
|
|
3003
2981
|
args: [{
|