stream-chat-angular 4.56.0-perf-message-list.1 → 4.56.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 +126 -96
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/avatar/avatar.component.js +67 -36
- package/esm2015/lib/message-reactions/message-reactions.component.js +30 -12
- package/fesm2015/stream-chat-angular.js +96 -47
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/avatar/avatar.component.d.ts +14 -5
- package/lib/message-reactions/message-reactions.component.d.ts +11 -5
- 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.56.0
|
|
1
|
+
export declare const version = "4.56.0";
|
|
@@ -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.56.0
|
|
359
|
+
var version = '4.56.0';
|
|
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.
|
|
@@ -3116,9 +3116,10 @@
|
|
|
3116
3116
|
* The `Avatar` component displays the provided image, with fallback to the first letter of the optional name input.
|
|
3117
3117
|
*/
|
|
3118
3118
|
var AvatarComponent = /** @class */ (function () {
|
|
3119
|
-
function AvatarComponent(chatClientService, ngZone) {
|
|
3119
|
+
function AvatarComponent(chatClientService, ngZone, cdRef) {
|
|
3120
3120
|
this.chatClientService = chatClientService;
|
|
3121
3121
|
this.ngZone = ngZone;
|
|
3122
|
+
this.cdRef = cdRef;
|
|
3122
3123
|
/**
|
|
3123
3124
|
* The size in pixels of the avatar image.
|
|
3124
3125
|
*/
|
|
@@ -3133,93 +3134,116 @@
|
|
|
3133
3134
|
this.initialsType = 'first-letter-of-first-word';
|
|
3134
3135
|
this.isError = false;
|
|
3135
3136
|
this.isOnline = false;
|
|
3137
|
+
this.initials = '';
|
|
3138
|
+
this.isViewInited = false;
|
|
3139
|
+
this.subscriptions = [];
|
|
3136
3140
|
}
|
|
3137
|
-
AvatarComponent.prototype.
|
|
3141
|
+
AvatarComponent.prototype.ngOnInit = function () {
|
|
3138
3142
|
var _this = this;
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
.pipe(operators.filter(function (e) { return e.eventType === 'user.presence.changed'; }))
|
|
3147
|
-
.subscribe(function (event) {
|
|
3148
|
-
var _a;
|
|
3149
|
-
if (((_a = event.event.user) === null || _a === void 0 ? void 0 : _a.id) === otherMember_1.id) {
|
|
3150
|
-
_this.ngZone.run(function () {
|
|
3151
|
-
var _a;
|
|
3152
|
-
_this.isOnline = ((_a = event.event.user) === null || _a === void 0 ? void 0 : _a.online) || false;
|
|
3153
|
-
});
|
|
3154
|
-
}
|
|
3155
|
-
});
|
|
3143
|
+
this.subscriptions.push(this.chatClientService.user$.subscribe(function (u) {
|
|
3144
|
+
if ((u === null || u === void 0 ? void 0 : u.id) !== _this.userId) {
|
|
3145
|
+
_this.userId = u === null || u === void 0 ? void 0 : u.id;
|
|
3146
|
+
if (_this.type || _this.channel || _this.name) {
|
|
3147
|
+
_this.setInitials();
|
|
3148
|
+
_this.setFallbackChannelImage();
|
|
3149
|
+
_this.updateIsOnlineSubscription();
|
|
3156
3150
|
}
|
|
3157
|
-
|
|
3158
|
-
|
|
3151
|
+
if (_this.isViewInited) {
|
|
3152
|
+
_this.cdRef.detectChanges();
|
|
3159
3153
|
}
|
|
3160
3154
|
}
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3155
|
+
}));
|
|
3156
|
+
};
|
|
3157
|
+
AvatarComponent.prototype.ngOnChanges = function (changes) {
|
|
3158
|
+
if (changes['channel']) {
|
|
3159
|
+
this.updateIsOnlineSubscription();
|
|
3160
|
+
}
|
|
3161
|
+
if (changes.type || changes.name || changes.channel) {
|
|
3162
|
+
this.setInitials();
|
|
3163
|
+
}
|
|
3164
|
+
if (changes.type || changes.channel) {
|
|
3165
|
+
this.setFallbackChannelImage();
|
|
3165
3166
|
}
|
|
3166
3167
|
};
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
if ((_c = (_b = this.channel) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.name) {
|
|
3176
|
-
result = (_e = (_d = this.channel) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.name;
|
|
3177
|
-
}
|
|
3178
|
-
else {
|
|
3179
|
-
var otherMember = this.getOtherMemberIfOneToOneChannel();
|
|
3180
|
-
if (otherMember) {
|
|
3181
|
-
result = otherMember.name || otherMember.id || '';
|
|
3182
|
-
}
|
|
3183
|
-
else {
|
|
3184
|
-
result = '#';
|
|
3185
|
-
}
|
|
3186
|
-
}
|
|
3187
|
-
}
|
|
3188
|
-
var words = result.split(' ');
|
|
3189
|
-
var initials;
|
|
3190
|
-
if (this.initialsType === 'first-letter-of-each-word') {
|
|
3191
|
-
initials = words.map(function (w) { return w.charAt(0) || ''; }).join('');
|
|
3168
|
+
AvatarComponent.prototype.setFallbackChannelImage = function () {
|
|
3169
|
+
if (this.type !== 'channel') {
|
|
3170
|
+
this.fallbackChannelImage = undefined;
|
|
3171
|
+
}
|
|
3172
|
+
else {
|
|
3173
|
+
var otherMember = this.getOtherMemberIfOneToOneChannel();
|
|
3174
|
+
if (otherMember) {
|
|
3175
|
+
this.fallbackChannelImage = otherMember.image;
|
|
3192
3176
|
}
|
|
3193
3177
|
else {
|
|
3194
|
-
|
|
3178
|
+
this.fallbackChannelImage = undefined;
|
|
3195
3179
|
}
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3180
|
+
}
|
|
3181
|
+
};
|
|
3182
|
+
AvatarComponent.prototype.setInitials = function () {
|
|
3183
|
+
var _a, _b, _c, _d, _e;
|
|
3184
|
+
var result = '';
|
|
3185
|
+
if (this.type === 'user') {
|
|
3186
|
+
result = ((_a = this.name) === null || _a === void 0 ? void 0 : _a.toString()) || '';
|
|
3187
|
+
}
|
|
3188
|
+
else if (this.type === 'channel') {
|
|
3189
|
+
if ((_c = (_b = this.channel) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.name) {
|
|
3190
|
+
result = (_e = (_d = this.channel) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.name;
|
|
3205
3191
|
}
|
|
3206
3192
|
else {
|
|
3207
3193
|
var otherMember = this.getOtherMemberIfOneToOneChannel();
|
|
3208
3194
|
if (otherMember) {
|
|
3209
|
-
|
|
3195
|
+
result = otherMember.name || otherMember.id || '';
|
|
3210
3196
|
}
|
|
3211
3197
|
else {
|
|
3212
|
-
|
|
3198
|
+
result = '#';
|
|
3213
3199
|
}
|
|
3214
3200
|
}
|
|
3215
|
-
}
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3201
|
+
}
|
|
3202
|
+
var words = result.split(' ');
|
|
3203
|
+
var initials;
|
|
3204
|
+
if (this.initialsType === 'first-letter-of-each-word') {
|
|
3205
|
+
initials = words.map(function (w) { return w.charAt(0) || ''; }).join('');
|
|
3206
|
+
}
|
|
3207
|
+
else {
|
|
3208
|
+
initials = words[0].charAt(0) || '';
|
|
3209
|
+
}
|
|
3210
|
+
this.initials = initials;
|
|
3211
|
+
};
|
|
3212
|
+
AvatarComponent.prototype.updateIsOnlineSubscription = function () {
|
|
3213
|
+
var _this = this;
|
|
3214
|
+
var _a, _b;
|
|
3215
|
+
if (this.channel) {
|
|
3216
|
+
var otherMember_1 = this.getOtherMemberIfOneToOneChannel();
|
|
3217
|
+
if (otherMember_1) {
|
|
3218
|
+
this.isOnline = otherMember_1.online || false;
|
|
3219
|
+
this.isOnlineSubscription = this.chatClientService.events$
|
|
3220
|
+
.pipe(operators.filter(function (e) { return e.eventType === 'user.presence.changed'; }))
|
|
3221
|
+
.subscribe(function (event) {
|
|
3222
|
+
var _a;
|
|
3223
|
+
if (((_a = event.event.user) === null || _a === void 0 ? void 0 : _a.id) === otherMember_1.id) {
|
|
3224
|
+
_this.ngZone.run(function () {
|
|
3225
|
+
var _a;
|
|
3226
|
+
_this.isOnline = ((_a = event.event.user) === null || _a === void 0 ? void 0 : _a.online) || false;
|
|
3227
|
+
});
|
|
3228
|
+
}
|
|
3229
|
+
});
|
|
3230
|
+
}
|
|
3231
|
+
else {
|
|
3232
|
+
(_a = this.isOnlineSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
3233
|
+
}
|
|
3234
|
+
}
|
|
3235
|
+
else {
|
|
3236
|
+
this.isOnline = false;
|
|
3237
|
+
(_b = this.isOnlineSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
3238
|
+
}
|
|
3239
|
+
};
|
|
3240
|
+
AvatarComponent.prototype.ngAfterViewInit = function () {
|
|
3241
|
+
this.isViewInited = true;
|
|
3242
|
+
};
|
|
3219
3243
|
AvatarComponent.prototype.getOtherMemberIfOneToOneChannel = function () {
|
|
3220
3244
|
var _this = this;
|
|
3221
3245
|
var _a, _b;
|
|
3222
|
-
var otherMembers = Object.values(((_b = (_a = this.channel) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.members) || {}).filter(function (m) {
|
|
3246
|
+
var otherMembers = Object.values(((_b = (_a = this.channel) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.members) || {}).filter(function (m) { return m.user_id !== _this.userId; });
|
|
3223
3247
|
if (otherMembers.length === 1) {
|
|
3224
3248
|
return otherMembers[0].user;
|
|
3225
3249
|
}
|
|
@@ -3229,7 +3253,7 @@
|
|
|
3229
3253
|
};
|
|
3230
3254
|
return AvatarComponent;
|
|
3231
3255
|
}());
|
|
3232
|
-
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 });
|
|
3256
|
+
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 }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3233
3257
|
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 src=\"{{ imageUrl || fallbackChannelImage }}\"\n alt=\"{{ initials }}\"\n data-testid=\"avatar-img\"\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 fetchpriority=\"high\"\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: i9__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3234
3258
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AvatarComponent, decorators: [{
|
|
3235
3259
|
type: i0.Component,
|
|
@@ -3238,7 +3262,7 @@
|
|
|
3238
3262
|
templateUrl: './avatar.component.html',
|
|
3239
3263
|
styleUrls: ['./avatar.component.scss'],
|
|
3240
3264
|
}]
|
|
3241
|
-
}], ctorParameters: function () { return [{ type: ChatClientService }, { type: i0__namespace.NgZone }]; }, propDecorators: { name: [{
|
|
3265
|
+
}], ctorParameters: function () { return [{ type: ChatClientService }, { type: i0__namespace.NgZone }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { name: [{
|
|
3242
3266
|
type: i0.Input
|
|
3243
3267
|
}], imageUrl: [{
|
|
3244
3268
|
type: i0.Input
|
|
@@ -5544,6 +5568,11 @@
|
|
|
5544
5568
|
this.isLoading = true;
|
|
5545
5569
|
this.reactions = [];
|
|
5546
5570
|
this.shouldHandleReactionClick = true;
|
|
5571
|
+
this.existingReactions = [];
|
|
5572
|
+
this.reactionsCount = 0;
|
|
5573
|
+
this.reactionOptions = [];
|
|
5574
|
+
this.subscriptions = [];
|
|
5575
|
+
this.isViewInited = false;
|
|
5547
5576
|
this.isOpenChange = function (isOpen) {
|
|
5548
5577
|
_this.selectedReactionType = isOpen ? _this.selectedReactionType : undefined;
|
|
5549
5578
|
};
|
|
@@ -5554,6 +5583,16 @@
|
|
|
5554
5583
|
}
|
|
5555
5584
|
};
|
|
5556
5585
|
}
|
|
5586
|
+
MessageReactionsComponent.prototype.ngOnInit = function () {
|
|
5587
|
+
var _this = this;
|
|
5588
|
+
this.subscriptions.push(this.messageReactionsService.reactions$.subscribe(function (reactions) {
|
|
5589
|
+
_this.reactionOptions = Object.keys(reactions);
|
|
5590
|
+
_this.setExistingReactions();
|
|
5591
|
+
if (_this.isViewInited) {
|
|
5592
|
+
_this.cdRef.detectChanges();
|
|
5593
|
+
}
|
|
5594
|
+
}));
|
|
5595
|
+
};
|
|
5557
5596
|
MessageReactionsComponent.prototype.ngOnChanges = function (changes) {
|
|
5558
5597
|
var _this = this;
|
|
5559
5598
|
if (changes.isSelectorOpen) {
|
|
@@ -5561,6 +5600,9 @@
|
|
|
5561
5600
|
? setTimeout(function () { return _this.watchForOutsideClicks(); }) // setTimeout: wait for current click to bubble up, and only watch for clicks after that
|
|
5562
5601
|
: this.stopWatchForOutsideClicks();
|
|
5563
5602
|
}
|
|
5603
|
+
if (changes.messageReactionCounts) {
|
|
5604
|
+
this.setExistingReactions();
|
|
5605
|
+
}
|
|
5564
5606
|
if (changes.messageReactionCounts && this.messageReactionCounts) {
|
|
5565
5607
|
var reactionsCount = Object.keys(this.messageReactionCounts).reduce(function (acc, key) { return acc + (_this.messageReactionCounts[key] || 0); }, 0);
|
|
5566
5608
|
this.shouldHandleReactionClick =
|
|
@@ -5568,37 +5610,18 @@
|
|
|
5568
5610
|
!!this.messageReactionsService.customReactionClickHandler;
|
|
5569
5611
|
}
|
|
5570
5612
|
};
|
|
5613
|
+
MessageReactionsComponent.prototype.ngAfterViewInit = function () {
|
|
5614
|
+
this.isViewInited = true;
|
|
5615
|
+
};
|
|
5571
5616
|
MessageReactionsComponent.prototype.ngAfterViewChecked = function () {
|
|
5572
5617
|
if (this.tooltipText && !this.tooltipPositions) {
|
|
5573
5618
|
this.setTooltipPosition();
|
|
5574
5619
|
this.cdRef.detectChanges();
|
|
5575
5620
|
}
|
|
5576
5621
|
};
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
return Object.keys(this.messageReactionCounts)
|
|
5581
|
-
.filter(function (k) { return _this.reactionOptions.indexOf(k) !== -1; })
|
|
5582
|
-
.filter(function (k) { return _this.messageReactionCounts[k] > 0; });
|
|
5583
|
-
},
|
|
5584
|
-
enumerable: false,
|
|
5585
|
-
configurable: true
|
|
5586
|
-
});
|
|
5587
|
-
Object.defineProperty(MessageReactionsComponent.prototype, "reactionsCount", {
|
|
5588
|
-
get: function () {
|
|
5589
|
-
var _this = this;
|
|
5590
|
-
return this.existingReactions.reduce(function (total, reaction) { return total + _this.messageReactionCounts[reaction]; }, 0);
|
|
5591
|
-
},
|
|
5592
|
-
enumerable: false,
|
|
5593
|
-
configurable: true
|
|
5594
|
-
});
|
|
5595
|
-
Object.defineProperty(MessageReactionsComponent.prototype, "reactionOptions", {
|
|
5596
|
-
get: function () {
|
|
5597
|
-
return Object.keys(this.messageReactionsService.reactions);
|
|
5598
|
-
},
|
|
5599
|
-
enumerable: false,
|
|
5600
|
-
configurable: true
|
|
5601
|
-
});
|
|
5622
|
+
MessageReactionsComponent.prototype.ngOnDestroy = function () {
|
|
5623
|
+
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
5624
|
+
};
|
|
5602
5625
|
MessageReactionsComponent.prototype.getLatestUserByReaction = function (reactionType) {
|
|
5603
5626
|
var _a;
|
|
5604
5627
|
return (_a = this.latestReactions.find(function (r) { return r.type === reactionType && r.user; })) === null || _a === void 0 ? void 0 : _a.user;
|
|
@@ -5740,10 +5763,17 @@
|
|
|
5740
5763
|
});
|
|
5741
5764
|
});
|
|
5742
5765
|
};
|
|
5766
|
+
MessageReactionsComponent.prototype.setExistingReactions = function () {
|
|
5767
|
+
var _this = this;
|
|
5768
|
+
this.existingReactions = Object.keys(this.messageReactionCounts)
|
|
5769
|
+
.filter(function (k) { return _this.reactionOptions.indexOf(k) !== -1; })
|
|
5770
|
+
.filter(function (k) { return _this.messageReactionCounts[k] > 0; });
|
|
5771
|
+
this.reactionsCount = this.existingReactions.reduce(function (total, reaction) { return total + _this.messageReactionCounts[reaction]; }, 0);
|
|
5772
|
+
};
|
|
5743
5773
|
return MessageReactionsComponent;
|
|
5744
5774
|
}());
|
|
5745
5775
|
MessageReactionsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageReactionsComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: ChannelService }, { token: MessageReactionsService }, { token: CustomTemplatesService }, { token: ThemeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
5746
|
-
MessageReactionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: { messageId: "messageId", messageReactionCounts: "messageReactionCounts", isSelectorOpen: "isSelectorOpen", latestReactions: "latestReactions", ownReactions: "ownReactions" }, outputs: { isSelectorOpenChange: "isSelectorOpenChange" }, viewQueries: [{ propertyName: "selectorContainer", first: true, predicate: ["selectorContainer"], descendants: true }, { propertyName: "selectorTooltip", first: true, predicate: ["selectorTooltip"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n *ngIf=\"existingReactions.length > 0\"\n class=\"str-chat__reaction-list str-chat__message-reactions-container\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n [class.str-chat__reaction-list-hidden]=\"isSelectorOpen\"\n data-testid=\"reaction-list\"\n>\n <ul class=\"str-chat__message-reactions\">\n <li\n class=\"str-chat__message-reaction\"\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n [ngStyle]=\"{ cursor: shouldHandleReactionClick ? 'pointer' : 'default' }\"\n [class.str-chat__message-reaction-own]=\"isOwnReaction(reactionType)\"\n data-testclass=\"emoji\"\n (click)=\"reactionSelected(reactionType)\"\n (keyup.enter)=\"reactionSelected(reactionType)\"\n >\n <span class=\"emoji str-chat__message-reaction-emoji\">\n {{ getEmojiByReaction(reactionType) }} \n </span>\n <span\n data-testclass=\"reaction-list-reaction-count\"\n class=\"str-chat__message-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n <li>\n <span\n data-testid=\"reactions-count\"\n class=\"str-chat__reaction-list--counter\"\n >{{ reactionsCount }}</span\n >\n </li>\n </ul>\n</div>\n\n<div\n #selectorContainer\n class=\"str-chat__reaction-selector str-chat__message-reaction-selector\"\n *ngIf=\"isSelectorOpen\"\n data-testid=\"reaction-selector\"\n>\n <div\n *ngIf=\"tooltipText\"\n data-testid=\"tooltip\"\n #selectorTooltip\n class=\"str-chat__reaction-selector-tooltip\"\n [ngStyle]=\"{\n left: tooltipPositions?.tooltip + 'px',\n visibility: tooltipPositions ? 'visible' : 'hidden'\n }\"\n >\n <div\n class=\"arrow\"\n [ngStyle]=\"{ left: tooltipPositions?.arrow + 'px' }\"\n ></div>\n <span class=\"latest-user-username\">\n {{ tooltipText }}\n </span>\n </div>\n <ul\n class=\"str-chat__message-reactions-list str-chat__message-reactions-options\"\n >\n <li\n class=\"\n str-chat__message-reactions-option\n str-chat__message-reactions-list-item\n str-chat__emoji\n \"\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n [class.str-chat__message-reactions-option-selected]=\"\n isOwnReaction(reactionType)\n \"\n data-testclass=\"emoji-option\"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <div\n *ngIf=\"getLatestUserByReaction(reactionType) as user\"\n class=\"latest-user str-chat__message-reactions-last-user\"\n (click)=\"hideTooltip()\"\n (keyup.enter)=\"hideTooltip()\"\n (mouseenter)=\"showTooltip($event, reactionType)\"\n (mouseleave)=\"hideTooltip()\"\n attr.data-testid=\"{{ reactionType }}-last-user\"\n >\n <stream-avatar-placeholder\n attr.data-testid=\"{{ reactionType }}-avatar\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name || user.id\"\n [size]=\"20\"\n location=\"reaction\"\n ></stream-avatar-placeholder>\n </div>\n <span\n class=\"\n emoji\n str-chat__emoji-selector-emoji-angular\n str-chat__message-reaction-emoji\n \"\n >\n {{ getEmojiByReaction(reactionType) }}\n </span>\n <span\n *ngIf=\"\n messageReactionCounts[reactionType] &&\n messageReactionCounts[reactionType]! > 0\n \"\n class=\"str-chat__message-reactions-list-item__count\"\n attr.data-testid=\"{{ reactionType }}-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n </ul>\n</div>\n\n<ng-container *ngIf=\"selectedReactionType\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: {\n isOpen: !!selectedReactionType,\n messageId: messageId,\n reactionType: selectedReactionType,\n isOpenChangeHandler: isOpenChange\n }\n \"\n ></ng-container>\n</ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-messageId=\"messageId\"\n let-reactionType=\"reactionType\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n>\n <stream-modal\n class=\"str-chat__message-reactions-details-modal\"\n [isOpen]=\"isOpen\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n
|
|
5776
|
+
MessageReactionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: { messageId: "messageId", messageReactionCounts: "messageReactionCounts", isSelectorOpen: "isSelectorOpen", latestReactions: "latestReactions", ownReactions: "ownReactions" }, outputs: { isSelectorOpenChange: "isSelectorOpenChange" }, viewQueries: [{ propertyName: "selectorContainer", first: true, predicate: ["selectorContainer"], descendants: true }, { propertyName: "selectorTooltip", first: true, predicate: ["selectorTooltip"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n *ngIf=\"existingReactions.length > 0\"\n class=\"str-chat__reaction-list str-chat__message-reactions-container\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n [class.str-chat__reaction-list-hidden]=\"isSelectorOpen\"\n data-testid=\"reaction-list\"\n>\n <ul class=\"str-chat__message-reactions\">\n <li\n class=\"str-chat__message-reaction\"\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n [ngStyle]=\"{ cursor: shouldHandleReactionClick ? 'pointer' : 'default' }\"\n [class.str-chat__message-reaction-own]=\"isOwnReaction(reactionType)\"\n data-testclass=\"emoji\"\n (click)=\"reactionSelected(reactionType)\"\n (keyup.enter)=\"reactionSelected(reactionType)\"\n >\n <span class=\"emoji str-chat__message-reaction-emoji\">\n {{ getEmojiByReaction(reactionType) }} \n </span>\n <span\n data-testclass=\"reaction-list-reaction-count\"\n class=\"str-chat__message-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n <li>\n <span\n data-testid=\"reactions-count\"\n class=\"str-chat__reaction-list--counter\"\n >{{ reactionsCount }}</span\n >\n </li>\n </ul>\n</div>\n\n<div\n #selectorContainer\n class=\"str-chat__reaction-selector str-chat__message-reaction-selector\"\n *ngIf=\"isSelectorOpen\"\n data-testid=\"reaction-selector\"\n>\n <div\n *ngIf=\"tooltipText\"\n data-testid=\"tooltip\"\n #selectorTooltip\n class=\"str-chat__reaction-selector-tooltip\"\n [ngStyle]=\"{\n left: tooltipPositions?.tooltip + 'px',\n visibility: tooltipPositions ? 'visible' : 'hidden'\n }\"\n >\n <div\n class=\"arrow\"\n [ngStyle]=\"{ left: tooltipPositions?.arrow + 'px' }\"\n ></div>\n <span class=\"latest-user-username\">\n {{ tooltipText }}\n </span>\n </div>\n <ul\n class=\"str-chat__message-reactions-list str-chat__message-reactions-options\"\n >\n <li\n class=\"\n str-chat__message-reactions-option\n str-chat__message-reactions-list-item\n str-chat__emoji\n \"\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n [class.str-chat__message-reactions-option-selected]=\"\n isOwnReaction(reactionType)\n \"\n data-testclass=\"emoji-option\"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <div\n *ngIf=\"getLatestUserByReaction(reactionType) as user\"\n class=\"latest-user str-chat__message-reactions-last-user\"\n (click)=\"hideTooltip()\"\n (keyup.enter)=\"hideTooltip()\"\n (mouseenter)=\"showTooltip($event, reactionType)\"\n (mouseleave)=\"hideTooltip()\"\n attr.data-testid=\"{{ reactionType }}-last-user\"\n >\n <stream-avatar-placeholder\n attr.data-testid=\"{{ reactionType }}-avatar\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name || user.id\"\n [size]=\"20\"\n location=\"reaction\"\n ></stream-avatar-placeholder>\n </div>\n <span\n class=\"\n emoji\n str-chat__emoji-selector-emoji-angular\n str-chat__message-reaction-emoji\n \"\n >\n {{ getEmojiByReaction(reactionType) }}\n </span>\n <span\n *ngIf=\"\n messageReactionCounts[reactionType] &&\n messageReactionCounts[reactionType]! > 0\n \"\n class=\"str-chat__message-reactions-list-item__count\"\n attr.data-testid=\"{{ reactionType }}-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n </ul>\n</div>\n\n<ng-container *ngIf=\"selectedReactionType\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: {\n isOpen: !!selectedReactionType,\n messageId: messageId,\n reactionType: selectedReactionType,\n isOpenChangeHandler: isOpenChange,\n content: modalContent\n }\n \"\n ></ng-container>\n</ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-messageId=\"messageId\"\n let-reactionType=\"reactionType\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"str-chat__message-reactions-details-modal\"\n [isOpen]=\"isOpen\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n [content]=\"content\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div class=\"str-chat__message-reactions-details\">\n <div class=\"str-chat__message-reactions-details-reaction-types\">\n <div\n class=\"str-chat__message-reactions-details-reaction-type\"\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n [ngStyle]=\"{\n cursor: shouldHandleReactionClick ? 'pointer' : 'default'\n }\"\n attr.data-testid=\"reaction-details-selector-{{ reactionType }}\"\n [class.str-chat__message-reactions-details-reaction-type--selected]=\"\n reactionType === selectedReactionType\n \"\n (click)=\"selectedReactionType = reactionType; allUsers.scrollTop = 0\"\n (keyup.enter)=\"\n selectedReactionType = reactionType; allUsers.scrollTop = 0\n \"\n >\n <span class=\"emoji str-chat__message-reaction-emoji\">\n {{ getEmojiByReaction(reactionType) }} \n </span>\n <span class=\"str-chat__message-reaction-count\">\n {{ messageReactionCounts[reactionType] }}\n </span>\n </div>\n </div>\n <div\n class=\"\n emoji\n str-chat__message-reaction-emoji str-chat__message-reaction-emoji-big\n \"\n >\n {{ getEmojiByReaction(selectedReactionType!) }}\n </div>\n <div\n #allUsers\n data-testid=\"all-reacting-users\"\n class=\"str-chat__message-reactions-details-reacting-users\"\n >\n <stream-loading-indicator\n *ngIf=\"isLoading; else reactions\"\n ></stream-loading-indicator>\n <ng-template #reactions>\n <div\n class=\"str-chat__message-reactions-details-reacting-user\"\n *ngFor=\"\n let user of getAllUsersByReaction(selectedReactionType);\n trackBy: trackByUserId\n \"\n >\n <stream-avatar-placeholder\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n style=\"max-height: 100%; overflow-y: hidden\"\n [size]=\"30\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name\"\n type=\"user\"\n location=\"reaction\"\n [user]=\"user\"\n ></stream-avatar-placeholder>\n <span\n data-testclass=\"reaction-user-username\"\n class=\"str-chat__user-item--name\"\n >{{ user.name }}</span\n >\n </div>\n </ng-template>\n </div>\n </div>\n</ng-template>\n", styles: [".emoji {position: relative; display: inline-block; }"], components: [{ type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: ["name", "imageUrl", "size", "location", "channel", "user", "type", "initialsType", "showOnlineIndicator"] }, { type: ModalComponent, selector: "stream-modal", inputs: ["isOpen", "content"], outputs: ["isOpenChange"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i9__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i9__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i9__namespace.AsyncPipe } });
|
|
5747
5777
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageReactionsComponent, decorators: [{
|
|
5748
5778
|
type: i0.Component,
|
|
5749
5779
|
args: [{
|