stream-chat-angular 4.0.0-theming-v2.11 → 4.0.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 +37 -20
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/channel.service.js +19 -17
- package/esm2015/lib/chat-client.service.js +5 -3
- package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +4 -3
- package/fesm2015/stream-chat-angular.js +26 -21
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +1 -0
- package/package.json +1 -1
- package/src/assets/styles/css/index.css +1 -1
- package/src/assets/styles/css/index.css.map +1 -1
- package/src/assets/styles/scss/Attachment.scss +11 -8
- package/src/assets/styles/scss/MessageInput.scss +1 -0
- package/src/assets/styles/v2/css/index.css +1 -1
- package/src/assets/styles/v2/css/index.css.map +1 -1
- package/src/assets/styles/v2/css/index.layout.css +1 -1
- package/src/assets/styles/v2/css/index.layout.css.map +1 -1
- package/src/assets/styles/v2/scss/AttachmentList/AttachmentList-layout.scss +133 -26
- package/src/assets/styles/v2/scss/AttachmentList/AttachmentList-theme.scss +28 -21
- package/src/assets/styles/v2/scss/Autocomplete/Autocomplete-layout.scss +11 -1
- package/src/assets/styles/v2/scss/Autocomplete/Autocomplete-theme.scss +35 -0
- package/src/assets/styles/v2/scss/Avatar/Avatar-layout.scss +2 -0
- package/src/assets/styles/v2/scss/ChannelPreview/ChannelPreview-theme.scss +3 -5
- package/src/assets/styles/v2/scss/ChannelSearch/ChannelSearch-layout.scss +2 -1
- package/src/assets/styles/v2/scss/Message/Message-layout.scss +73 -23
- package/src/assets/styles/v2/scss/Message/Message-theme.scss +16 -0
- package/src/assets/styles/v2/scss/MessageInput/MessageInput-layout.scss +33 -2
- package/src/assets/styles/v2/scss/MessageInput/MessageInput-theme.scss +16 -0
- package/src/assets/styles/v2/scss/MessageList/{VirtualMessageList-layout.scss → VirtualizedMessageList-layout.scss} +12 -0
- package/src/assets/styles/v2/scss/MessageList/{VirtualMessageList-theme.scss → VirtualizedMessageList-theme.scss} +0 -0
- package/src/assets/styles/v2/scss/MessageReactions/MessageReactions-layout.scss +1 -0
- package/src/assets/styles/v2/scss/Modal/Modal-theme.scss +7 -0
- package/src/assets/styles/v2/scss/Thread/Thread-layout.scss +1 -2
- package/src/assets/styles/v2/scss/Tooltip/Tooltip-layout.scss +1 -1
- package/src/assets/styles/v2/scss/TypingIndicator/TypingIndicator-layout.scss +4 -0
- package/src/assets/styles/v2/scss/_global-theme-variables.scss +7 -0
- package/src/assets/styles/v2/scss/_utils.scss +1 -1
- package/src/assets/styles/v2/scss/index.layout.scss +1 -1
- package/src/assets/styles/v2/scss/index.scss +1 -1
- package/src/assets/styles/vendor/react-image-gallery.scss +6 -0
- package/src/assets/version.ts +1 -1
package/assets/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.0.0
|
|
1
|
+
export declare const version = "4.0.0";
|
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
-
var version = '4.0.0
|
|
358
|
+
var version = '4.0.0';
|
|
359
359
|
|
|
360
360
|
/**
|
|
361
361
|
* The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
|
|
@@ -475,7 +475,7 @@
|
|
|
475
475
|
this.chatClient = streamChat.StreamChat.getInstance(apiKey);
|
|
476
476
|
this.chatClient.devToken;
|
|
477
477
|
return [4 /*yield*/, this.ngZone.runOutsideAngular(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
478
|
-
var user, _d, error_1;
|
|
478
|
+
var user, _d, error_1, sdkPrefix;
|
|
479
479
|
return __generator(this, function (_e) {
|
|
480
480
|
switch (_e.label) {
|
|
481
481
|
case 0:
|
|
@@ -501,8 +501,10 @@
|
|
|
501
501
|
throw error_1;
|
|
502
502
|
case 7:
|
|
503
503
|
this.userSubject.next(this.chatClient.user);
|
|
504
|
-
|
|
505
|
-
|
|
504
|
+
sdkPrefix = 'stream-chat-angular';
|
|
505
|
+
if (!this.chatClient.getUserAgent().includes(sdkPrefix)) {
|
|
506
|
+
this.chatClient.setUserAgent(sdkPrefix + "-" + version + "-" + this.chatClient.getUserAgent());
|
|
507
|
+
}
|
|
506
508
|
return [2 /*return*/];
|
|
507
509
|
}
|
|
508
510
|
});
|
|
@@ -703,11 +705,8 @@
|
|
|
703
705
|
var currentChannels = _this.channelsSubject.getValue() || [];
|
|
704
706
|
var newChannels = channels.filter(function (c) { return !currentChannels.find(function (channel) { return channel.cid === c.cid; }); });
|
|
705
707
|
var deletedChannels = currentChannels.filter(function (c) { return !(channels === null || channels === void 0 ? void 0 : channels.find(function (channel) { return channel.cid === c.cid; })); });
|
|
706
|
-
_this.addChannelsFromNotification(newChannels);
|
|
708
|
+
void _this.addChannelsFromNotification(newChannels);
|
|
707
709
|
_this.removeChannelsFromChannelList(deletedChannels.map(function (c) { return c.cid; }));
|
|
708
|
-
if (!newChannels.length && !deletedChannels.length) {
|
|
709
|
-
_this.channelsSubject.next(channels);
|
|
710
|
-
}
|
|
711
710
|
};
|
|
712
711
|
this.messageListSetter = function (messages) {
|
|
713
712
|
_this.activeChannelMessagesSubject.next(messages);
|
|
@@ -1354,24 +1353,41 @@
|
|
|
1354
1353
|
};
|
|
1355
1354
|
ChannelService.prototype.handleNewMessageNotification = function (clientEvent) {
|
|
1356
1355
|
if (clientEvent.event.channel) {
|
|
1357
|
-
this.addChannelsFromNotification([clientEvent.event.channel]);
|
|
1356
|
+
void this.addChannelsFromNotification([clientEvent.event.channel]);
|
|
1358
1357
|
}
|
|
1359
1358
|
};
|
|
1360
1359
|
ChannelService.prototype.handleAddedToChannelNotification = function (clientEvent) {
|
|
1361
1360
|
if (clientEvent.event.channel) {
|
|
1362
|
-
this.addChannelsFromNotification([clientEvent.event.channel]);
|
|
1361
|
+
void this.addChannelsFromNotification([clientEvent.event.channel]);
|
|
1363
1362
|
}
|
|
1364
1363
|
};
|
|
1365
1364
|
ChannelService.prototype.addChannelsFromNotification = function (channelResponses) {
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1365
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1366
|
+
var newChannels, watchRequests, currentChannels;
|
|
1367
|
+
var _this = this;
|
|
1368
|
+
return __generator(this, function (_h) {
|
|
1369
|
+
switch (_h.label) {
|
|
1370
|
+
case 0:
|
|
1371
|
+
newChannels = [];
|
|
1372
|
+
watchRequests = [];
|
|
1373
|
+
channelResponses.forEach(function (channelResponse) {
|
|
1374
|
+
var channel = _this.chatClientService.chatClient.channel(channelResponse.type, channelResponse.id);
|
|
1375
|
+
watchRequests.push(channel.watch());
|
|
1376
|
+
newChannels.push(channel);
|
|
1377
|
+
});
|
|
1378
|
+
return [4 /*yield*/, Promise.all(watchRequests)];
|
|
1379
|
+
case 1:
|
|
1380
|
+
_h.sent();
|
|
1381
|
+
currentChannels = this.channelsSubject.getValue() || [];
|
|
1382
|
+
newChannels = newChannels.filter(function (newChannel) { return !currentChannels.find(function (c) { return c.cid === newChannel.cid; }); });
|
|
1383
|
+
if (newChannels.length > 0) {
|
|
1384
|
+
newChannels.forEach(function (c) { return _this.watchForChannelEvents(c); });
|
|
1385
|
+
this.channelsSubject.next(__spreadArray(__spreadArray([], __read(newChannels)), __read(currentChannels)));
|
|
1386
|
+
}
|
|
1387
|
+
return [2 /*return*/];
|
|
1388
|
+
}
|
|
1389
|
+
});
|
|
1373
1390
|
});
|
|
1374
|
-
this.channelsSubject.next(__spreadArray(__spreadArray([], __read(newChannels)), __read((this.channelsSubject.getValue() || []))));
|
|
1375
1391
|
};
|
|
1376
1392
|
ChannelService.prototype.removeChannelsFromChannelList = function (cids) {
|
|
1377
1393
|
var _a;
|
|
@@ -4897,6 +4913,7 @@
|
|
|
4897
4913
|
this.userMentionConfig,
|
|
4898
4914
|
this.slashCommandConfig,
|
|
4899
4915
|
];
|
|
4916
|
+
this.themeVersion = this.themeService.themeVersion;
|
|
4900
4917
|
}
|
|
4901
4918
|
AutocompleteTextareaComponent.prototype.ngOnChanges = function (changes) {
|
|
4902
4919
|
if (changes.areMentionsEnabled) {
|
|
@@ -4959,7 +4976,7 @@
|
|
|
4959
4976
|
this.send.next();
|
|
4960
4977
|
};
|
|
4961
4978
|
AutocompleteTextareaComponent.prototype.adjustTextareaHeight = function () {
|
|
4962
|
-
if (this.
|
|
4979
|
+
if (this.themeVersion === '2') {
|
|
4963
4980
|
this.messageInput.nativeElement.style.height = '';
|
|
4964
4981
|
this.messageInput.nativeElement.style.height = this.messageInput.nativeElement.scrollHeight + "px";
|
|
4965
4982
|
}
|
|
@@ -5021,7 +5038,7 @@
|
|
|
5021
5038
|
return AutocompleteTextareaComponent;
|
|
5022
5039
|
}());
|
|
5023
5040
|
AutocompleteTextareaComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AutocompleteTextareaComponent, deps: [{ token: ChannelService }, { token: ChatClientService }, { token: TransliterationService }, { token: EmojiInputService }, { token: CustomTemplatesService }, { token: ThemeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
5024
|
-
AutocompleteTextareaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AutocompleteTextareaComponent, selector: "stream-autocomplete-textarea", inputs: { value: "value", placeholder: "placeholder", areMentionsEnabled: "areMentionsEnabled", mentionScope: "mentionScope" }, outputs: { valueChange: "valueChange", send: "send", userMentions: "userMentions" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ placeholder | translate }}\"\n class=\"\n rta__textarea\n str-chat__textarea__textarea\n str-chat__angular-textarea\n str-chat__message-textarea\n \"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n [mentionConfig]=\"autocompleteConfig\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n [mentionListTemplate]=\"autocompleteItem\"\n (blur)=\"inputLeft()\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <div class=\"rta rta__item str-chat__emojisearch__item\" [ngSwitch]=\"item.type\">\n <div class=\"rta__entity\" *ngSwitchCase=\"'mention'\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n <div class=\"rta__entity\" *ngSwitchCase=\"'command'\">\n <ng-container\n *ngTemplateOutlet=\"\n commandAutocompleteItemTemplate || defaultCommandTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #defaultCommandTemplate let-item=\"item\">\n <div class=\"str-chat__slash-command\">\n <span class=\"str-chat__slash-command-header\">\n <strong\n class=\"str-chat__slash-command-name\"\n data-testclass=\"command-name\"\n >{{ item.name }}</strong\n >\n <span class=\"str-chat__slash-command-args\"\n >/{{ item.name }} {{ item.args }}</span\n >\n </span>\n <br />\n </div>\n</ng-template>\n\n<ng-template #defaultMentionTemplate let-item=\"item\">\n <div class=\"str-chat__user-item\">\n <stream-avatar-placeholder\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n style=\"height:
|
|
5041
|
+
AutocompleteTextareaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AutocompleteTextareaComponent, selector: "stream-autocomplete-textarea", inputs: { value: "value", placeholder: "placeholder", areMentionsEnabled: "areMentionsEnabled", mentionScope: "mentionScope" }, outputs: { valueChange: "valueChange", send: "send", userMentions: "userMentions" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ placeholder | translate }}\"\n class=\"\n rta__textarea\n str-chat__textarea__textarea\n str-chat__angular-textarea\n str-chat__message-textarea\n \"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n [mentionConfig]=\"autocompleteConfig\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n [mentionListTemplate]=\"autocompleteItem\"\n (blur)=\"inputLeft()\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <div class=\"rta rta__item str-chat__emojisearch__item\" [ngSwitch]=\"item.type\">\n <div class=\"rta__entity\" *ngSwitchCase=\"'mention'\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n <div class=\"rta__entity\" *ngSwitchCase=\"'command'\">\n <ng-container\n *ngTemplateOutlet=\"\n commandAutocompleteItemTemplate || defaultCommandTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #defaultCommandTemplate let-item=\"item\">\n <div class=\"str-chat__slash-command\">\n <span class=\"str-chat__slash-command-header\">\n <strong\n class=\"str-chat__slash-command-name\"\n data-testclass=\"command-name\"\n >{{ item.name }}</strong\n >\n <span class=\"str-chat__slash-command-args\"\n >/{{ item.name }} {{ item.args }}</span\n >\n </span>\n <br />\n </div>\n</ng-template>\n\n<ng-template #defaultMentionTemplate let-item=\"item\">\n <div class=\"str-chat__user-item\">\n <stream-avatar-placeholder\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n [style]=\"'height: ' + themeVersion === '2' ? 56 : 20 + 'px'\"\n [size]=\"themeVersion === '2' ? 56 : 20\"\n [imageUrl]=\"item.image || item.user?.image\"\n [name]=\"item.autocompleteLabel\"\n type=\"user\"\n location=\"autocomplete-item\"\n [user]=\"item.user || item\"\n ></stream-avatar-placeholder>\n <span data-testclass=\"username\" class=\"str-chat__user-item--name\">{{\n item.autocompleteLabel\n }}</span>\n <div *ngIf=\"themeVersion === '2'\" class=\"str-chat__user-item-at\">@</div>\n </div>\n</ng-template>\n", components: [{ type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: ["name", "imageUrl", "size", "location", "channel", "user", "type"] }], directives: [{ type: i8__namespace$1.MentionDirective, selector: "[mention], [mentionConfig]", inputs: ["mentionConfig", "mention", "mentionListTemplate"], outputs: ["searchTerm", "itemSelected", "opened", "closed"] }, { type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i7__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i8__namespace.TranslatePipe } });
|
|
5025
5042
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AutocompleteTextareaComponent, decorators: [{
|
|
5026
5043
|
type: i0.Component,
|
|
5027
5044
|
args: [{
|