stream-chat-angular 6.2.0 → 6.3.0-beta.2
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/i18n/en.d.ts +42 -0
- package/assets/version.d.ts +1 -1
- package/esm2020/assets/i18n/en.mjs +43 -1
- package/esm2020/assets/version.mjs +2 -2
- package/esm2020/lib/channel-list/channel-list.component.mjs +3 -3
- package/esm2020/lib/channel-preview/channel-preview.component.mjs +4 -1
- package/esm2020/lib/channel.service.mjs +6 -3
- package/esm2020/lib/custom-templates.service.mjs +9 -1
- package/esm2020/lib/icon/icon.component.mjs +1 -1
- package/esm2020/lib/message/message.component.mjs +21 -6
- package/esm2020/lib/message-actions.service.mjs +5 -1
- package/esm2020/lib/message-input/message-input.component.mjs +30 -5
- package/esm2020/lib/message-preview.mjs +3 -2
- package/esm2020/lib/modal/modal.component.mjs +3 -3
- package/esm2020/lib/modal/stream-modal.module.mjs +19 -0
- package/esm2020/lib/notification-list/stream-notification.module.mjs +20 -0
- package/esm2020/lib/paginated-list/stream-paginated-list.module.mjs +20 -0
- package/esm2020/lib/polls/base-poll.component.mjs +87 -0
- package/esm2020/lib/polls/poll/poll.component.mjs +34 -0
- package/esm2020/lib/polls/poll-actions/add-option/add-option.component.mjs +67 -0
- package/esm2020/lib/polls/poll-actions/poll-actions.component.mjs +137 -0
- package/esm2020/lib/polls/poll-actions/poll-answers-list/poll-answers-list.component.mjs +82 -0
- package/esm2020/lib/polls/poll-actions/poll-results/poll-results-list/poll-results-list.component.mjs +63 -0
- package/esm2020/lib/polls/poll-actions/poll-results/poll-vote/poll-vote.component.mjs +33 -0
- package/esm2020/lib/polls/poll-actions/poll-results/poll-vote-results-list/poll-vote-results-list.component.mjs +82 -0
- package/esm2020/lib/polls/poll-actions/upsert-answer/upsert-answer.component.mjs +60 -0
- package/esm2020/lib/polls/poll-composer/poll-composer.component.mjs +134 -0
- package/esm2020/lib/polls/poll-composer/validators.mjs +18 -0
- package/esm2020/lib/polls/poll-header/poll-header.component.mjs +80 -0
- package/esm2020/lib/polls/poll-option-selector/poll-option-selector.component.mjs +137 -0
- package/esm2020/lib/polls/poll-options-list/poll-options-list.component.mjs +39 -0
- package/esm2020/lib/polls/poll-preview/poll-preview.component.mjs +31 -0
- package/esm2020/lib/polls/stream-polls.module.mjs +108 -0
- package/esm2020/lib/polls/unique.validator.mjs +13 -0
- package/esm2020/lib/stream-chat.module.mjs +26 -19
- package/esm2020/lib/types.mjs +1 -1
- package/esm2020/public-api.mjs +18 -1
- package/fesm2015/stream-chat-angular.mjs +1333 -61
- package/fesm2015/stream-chat-angular.mjs.map +1 -1
- package/fesm2020/stream-chat-angular.mjs +1291 -59
- package/fesm2020/stream-chat-angular.mjs.map +1 -1
- package/lib/channel.service.d.ts +2 -1
- package/lib/custom-templates.service.d.ts +14 -0
- package/lib/icon/icon.component.d.ts +1 -1
- package/lib/message/message.component.d.ts +1 -1
- package/lib/message-actions.service.d.ts +4 -0
- package/lib/message-input/message-input.component.d.ts +11 -1
- package/lib/message-preview.d.ts +1 -1
- package/lib/modal/stream-modal.module.d.ts +9 -0
- package/lib/notification-list/stream-notification.module.d.ts +10 -0
- package/lib/paginated-list/stream-paginated-list.module.d.ts +10 -0
- package/lib/polls/base-poll.component.d.ts +43 -0
- package/lib/polls/poll/poll.component.d.ts +12 -0
- package/lib/polls/poll-actions/add-option/add-option.component.d.ts +22 -0
- package/lib/polls/poll-actions/poll-actions.component.d.ts +50 -0
- package/lib/polls/poll-actions/poll-answers-list/poll-answers-list.component.d.ts +25 -0
- package/lib/polls/poll-actions/poll-results/poll-results-list/poll-results-list.component.d.ts +22 -0
- package/lib/polls/poll-actions/poll-results/poll-vote/poll-vote.component.d.ts +20 -0
- package/lib/polls/poll-actions/poll-results/poll-vote-results-list/poll-vote-results-list.component.d.ts +24 -0
- package/lib/polls/poll-actions/upsert-answer/upsert-answer.component.d.ts +27 -0
- package/lib/polls/poll-composer/poll-composer.component.d.ts +43 -0
- package/lib/polls/poll-composer/validators.d.ts +3 -0
- package/lib/polls/poll-header/poll-header.component.d.ts +19 -0
- package/lib/polls/poll-option-selector/poll-option-selector.component.d.ts +27 -0
- package/lib/polls/poll-options-list/poll-options-list.component.d.ts +17 -0
- package/lib/polls/poll-preview/poll-preview.component.d.ts +13 -0
- package/lib/polls/stream-polls.module.d.ts +26 -0
- package/lib/polls/unique.validator.d.ts +2 -0
- package/lib/stream-chat.module.d.ts +20 -19
- package/lib/types.d.ts +2 -1
- package/package.json +6 -2
- package/public-api.d.ts +17 -0
- package/src/assets/i18n/en.ts +46 -0
- package/src/assets/styles/css/index.css +1 -1
- package/src/assets/styles/css/index.layout.css +1 -1
- package/src/assets/styles/scss/AttachmentList/AttachmentList-layout.scss +50 -0
- package/src/assets/styles/scss/AttachmentList/AttachmentList-theme.scss +56 -0
- package/src/assets/styles/scss/AttachmentPreviewList/AttachmentPreviewList-layout.scss +4 -1
- package/src/assets/styles/scss/AttachmentPreviewList/AttachmentPreviewList-theme.scss +11 -0
- package/src/assets/styles/scss/Autocomplete/Autocomplete-layout.scss +14 -0
- package/src/assets/styles/scss/Autocomplete/Autocomplete-theme.scss +11 -0
- package/src/assets/styles/scss/Dialog/Dialog-layout.scss +13 -5
- package/src/assets/styles/scss/DropzoneContainer/DropzoneContainer-layout.scss +14 -0
- package/src/assets/styles/scss/DropzoneContainer/DropzoneContainer-theme.scss +17 -0
- package/src/assets/styles/scss/Form/Form-layout.scss +40 -0
- package/src/assets/styles/scss/Form/Form-theme.scss +75 -10
- package/src/assets/styles/scss/Icon/Icon-layout.scss +6 -0
- package/src/assets/styles/scss/Icon/Icon-theme.scss +4 -0
- package/src/assets/styles/scss/LinkPreview/LinkPreview-layout.scss +18 -0
- package/src/assets/styles/scss/LinkPreview/LinkPreview-theme.scss +15 -0
- package/src/assets/styles/scss/Location/Location-layout.scss +52 -0
- package/src/assets/styles/scss/Location/Location-theme.scss +32 -0
- package/src/assets/styles/scss/Message/Message-layout.scss +37 -2
- package/src/assets/styles/scss/Message/Message-theme.scss +40 -1
- package/src/assets/styles/scss/MessageActionsBox/MessageActionsBox-theme.scss +8 -0
- package/src/assets/styles/scss/MessageInput/MessageInput-layout.scss +32 -13
- package/src/assets/styles/scss/MessageInput/MessageInput-theme.scss +28 -20
- package/src/assets/styles/scss/Modal/Modal-layout.scss +2 -0
- package/src/assets/styles/scss/Modal/Modal-theme.scss +21 -6
- package/src/assets/styles/scss/Poll/Poll-layout.scss +45 -44
- package/src/assets/styles/scss/Poll/Poll-theme.scss +8 -36
- package/src/assets/styles/scss/_icons.scss +1 -0
- package/src/assets/styles/scss/index.layout.scss +3 -1
- package/src/assets/styles/scss/index.scss +2 -0
- package/src/assets/version.ts +1 -1
- /package/src/assets/styles/scss/DragAndDropContainer/{DragAmdDropContainer-layout.scss → DragAndDropContainer-layout.scss} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, Component, Input, EventEmitter, Output, ViewChild, HostBinding, TemplateRef, ContentChild, ChangeDetectionStrategy, InjectionToken, Directive, NgModule, Inject, Optional } from '@angular/core';
|
|
3
|
-
import { BehaviorSubject, ReplaySubject, combineLatest, map as map$1, shareReplay as shareReplay$1, take as take$1, Subject, timer, merge, switchMap, distinctUntilChanged,
|
|
4
|
-
import { StreamChat } from 'stream-chat';
|
|
3
|
+
import { BehaviorSubject, ReplaySubject, combineLatest, map as map$1, shareReplay as shareReplay$1, take as take$1, pairwise, Subject, timer, merge, switchMap, distinctUntilChanged, filter as filter$1, of } from 'rxjs';
|
|
4
|
+
import { StreamChat, VotingVisibility, isVoteAnswer } from 'stream-chat';
|
|
5
5
|
import { take, shareReplay, map, first, filter, tap, debounceTime, throttleTime } from 'rxjs/operators';
|
|
6
6
|
import { v4 } from 'uuid';
|
|
7
7
|
import * as i6 from '@ngx-translate/core';
|
|
8
8
|
import { TranslateModule } from '@ngx-translate/core';
|
|
9
|
-
import * as
|
|
9
|
+
import * as i1 from '@angular/common';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
11
|
import Dayjs from 'dayjs';
|
|
12
12
|
import calendar from 'dayjs/plugin/calendar';
|
|
@@ -19,8 +19,10 @@ import fixWebmDuration from 'fix-webm-duration';
|
|
|
19
19
|
import transliterate from '@stream-io/transliterate';
|
|
20
20
|
import * as i8$1 from 'angular-mentions';
|
|
21
21
|
import { MentionModule } from 'angular-mentions';
|
|
22
|
+
import * as i1$1 from '@angular/forms';
|
|
23
|
+
import { FormGroup, FormControl, Validators, FormArray, ReactiveFormsModule } from '@angular/forms';
|
|
22
24
|
|
|
23
|
-
const version = '6.
|
|
25
|
+
const version = '6.3.0-beta.2';
|
|
24
26
|
|
|
25
27
|
/**
|
|
26
28
|
* The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](/chat/docs/sdk/angular/components/NotificationListComponent/) component displays the currently active notifications.
|
|
@@ -336,7 +338,7 @@ const getMessageTranslation = (message, channel, user) => {
|
|
|
336
338
|
}
|
|
337
339
|
};
|
|
338
340
|
|
|
339
|
-
const createMessagePreview = (user, text, attachments = [], mentionedUsers = [], parentId = undefined, quotedMessageId = undefined, customData) => {
|
|
341
|
+
const createMessagePreview = (user, text, attachments = [], mentionedUsers = [], parentId = undefined, quotedMessageId = undefined, customData, pollId = undefined) => {
|
|
340
342
|
const clientSideId = `${user.id}-${v4()}`;
|
|
341
343
|
return {
|
|
342
344
|
__html: text,
|
|
@@ -352,6 +354,7 @@ const createMessagePreview = (user, text, attachments = [], mentionedUsers = [],
|
|
|
352
354
|
mentioned_users: mentionedUsers,
|
|
353
355
|
parent_id: parentId,
|
|
354
356
|
quoted_message_id: quotedMessageId,
|
|
357
|
+
poll_id: pollId,
|
|
355
358
|
...customData,
|
|
356
359
|
};
|
|
357
360
|
};
|
|
@@ -842,8 +845,9 @@ class ChannelService {
|
|
|
842
845
|
* @param parentId Id of the parent message (if sending a thread reply)
|
|
843
846
|
* @param quotedMessageId Id of the message to quote (if sending a quote reply)
|
|
844
847
|
* @param customData
|
|
848
|
+
* @param pollId Id of the poll (if sending a poll message)
|
|
845
849
|
*/
|
|
846
|
-
async sendMessage(text, attachments = [], mentionedUsers = [], parentId = undefined, quotedMessageId = undefined, customData = undefined) {
|
|
850
|
+
async sendMessage(text, attachments = [], mentionedUsers = [], parentId = undefined, quotedMessageId = undefined, customData = undefined, pollId = undefined) {
|
|
847
851
|
let input = {
|
|
848
852
|
text,
|
|
849
853
|
attachments,
|
|
@@ -851,11 +855,12 @@ class ChannelService {
|
|
|
851
855
|
parentId,
|
|
852
856
|
quotedMessageId,
|
|
853
857
|
customData,
|
|
858
|
+
pollId,
|
|
854
859
|
};
|
|
855
860
|
if (this.beforeSendMessage) {
|
|
856
861
|
input = await this.beforeSendMessage(input);
|
|
857
862
|
}
|
|
858
|
-
const preview = createMessagePreview(this.chatClientService.chatClient.user, input.text, input.attachments, input.mentionedUsers, input.parentId, input.quotedMessageId, input.customData);
|
|
863
|
+
const preview = createMessagePreview(this.chatClientService.chatClient.user, input.text, input.attachments, input.mentionedUsers, input.parentId, input.quotedMessageId, input.customData, input.pollId);
|
|
859
864
|
const channel = this.activeChannelSubject.getValue();
|
|
860
865
|
channel.state.addMessageSorted(preview, true);
|
|
861
866
|
const response = await this.sendMessageRequest(preview, input.customData);
|
|
@@ -1145,6 +1150,7 @@ class ChannelService {
|
|
|
1145
1150
|
mentioned_users: preview.mentioned_users?.map((u) => u.id),
|
|
1146
1151
|
parent_id: preview.parent_id,
|
|
1147
1152
|
quoted_message_id: preview.quoted_message_id,
|
|
1153
|
+
poll_id: preview.poll_id,
|
|
1148
1154
|
...customData,
|
|
1149
1155
|
}); // TODO: find out why we need typecast here
|
|
1150
1156
|
channel.state.addMessageSorted({
|
|
@@ -2862,6 +2868,48 @@ const en = {
|
|
|
2862
2868
|
'You currently have {{count}} attachments, the maximum is {{max}}': 'You currently have {{count}} attachments, the maximum is {{max}}',
|
|
2863
2869
|
'and others': 'and others',
|
|
2864
2870
|
'Message was blocked by moderation policies': 'Message was blocked by moderation policies',
|
|
2871
|
+
'Vote ended': 'Vote ended',
|
|
2872
|
+
'Select one': 'Select one',
|
|
2873
|
+
'Select up to {{count}}': 'Select up to {{count}}',
|
|
2874
|
+
'Select one or more': 'Select one or more',
|
|
2875
|
+
'See all options ({{count}})': 'See all options ({{count}})',
|
|
2876
|
+
'Suggest an option': 'Suggest an option',
|
|
2877
|
+
'Add a comment': 'Add a comment',
|
|
2878
|
+
'Update your comment': 'Update your comment',
|
|
2879
|
+
'View {{ count }} comments': 'View {{ count }} comments',
|
|
2880
|
+
'View {{ count }} comment': 'View {{ count }} comment',
|
|
2881
|
+
'View results': 'View results',
|
|
2882
|
+
'End vote': 'End vote',
|
|
2883
|
+
'After a poll is closed, no more votes can be cast': 'After a poll is closed, no more votes can be cast',
|
|
2884
|
+
'Failed to end vote': 'Failed to end vote',
|
|
2885
|
+
'Failed to cast vote': 'Failed to cast vote',
|
|
2886
|
+
Anonymous: 'Anonymous',
|
|
2887
|
+
'{{ count }} votes': '{{ count }} votes',
|
|
2888
|
+
'Show all': 'Show all',
|
|
2889
|
+
'Poll results': 'Poll results',
|
|
2890
|
+
'Error loading votes': 'Error loading votes',
|
|
2891
|
+
'Poll comments': 'Poll comments',
|
|
2892
|
+
'Error loading answers': 'Error loading answers',
|
|
2893
|
+
Comment: 'Comment',
|
|
2894
|
+
'Failed to add comment': 'Failed to add comment',
|
|
2895
|
+
'Failed to add option ({{ message }})': 'Failed to add option ({{ message }})',
|
|
2896
|
+
'Option already exists': 'Option already exists',
|
|
2897
|
+
'You have reached the maximum number of votes allowed': 'You have reached the maximum number of votes allowed',
|
|
2898
|
+
'Create poll': 'Create poll',
|
|
2899
|
+
Create: 'Create',
|
|
2900
|
+
Question: 'Question',
|
|
2901
|
+
'Ask a question': 'Ask a question',
|
|
2902
|
+
'Question is required': 'Question is required',
|
|
2903
|
+
Options: 'Options',
|
|
2904
|
+
'Add an option': 'Add an option',
|
|
2905
|
+
'Multiple answers': 'Multiple answers',
|
|
2906
|
+
'Maximum number of votes': 'Maximum number of votes',
|
|
2907
|
+
'Provide a value between {{ min }} and {{ max }}': 'Provide a value between {{ min }} and {{ max }}',
|
|
2908
|
+
'Anonymous poll': 'Anonymous poll',
|
|
2909
|
+
'Allow option suggestions': 'Allow option suggestions',
|
|
2910
|
+
'Allow comments': 'Allow comments',
|
|
2911
|
+
'Failed to create poll': 'Failed to create poll',
|
|
2912
|
+
'Provide at least one option': 'Provide at least one option',
|
|
2865
2913
|
},
|
|
2866
2914
|
};
|
|
2867
2915
|
|
|
@@ -3035,7 +3083,7 @@ class AvatarComponent {
|
|
|
3035
3083
|
}
|
|
3036
3084
|
}
|
|
3037
3085
|
AvatarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AvatarComponent, deps: [{ token: ChatClientService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3038
|
-
AvatarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AvatarComponent, selector: "stream-avatar", inputs: { name: "name", imageUrl: "imageUrl", location: "location", channel: "channel", user: "user", type: "type", showOnlineIndicator: "showOnlineIndicator", initialsType: "initialsType" }, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"str-chat__avatar str-chat-angular__avatar str-chat__avatar--circle stream-chat__avatar--{{\n location\n }} stream-chat__avatar--{{\n initialsType === 'first-letter-of-first-word'\n ? 'one-letter'\n : 'multiple-letters'\n }}\"\n title=\"{{ name }}\"\n>\n <img\n *ngIf=\"(imageUrl || fallbackChannelImage) && !isError; else fallback\"\n class=\"str-chat__avatar-image\"\n data-testid=\"avatar-img\"\n fetchpriority=\"high\"\n src=\"{{ imageUrl || fallbackChannelImage }}\"\n alt=\"{{ initials }}\"\n (error)=\"isError = true\"\n />\n <ng-template #fallback>\n <div data-testid=\"fallback-img\" class=\"str-chat__avatar-fallback\">\n {{ initials }}\n </div>\n </ng-template>\n <div\n *ngIf=\"isOnline && showOnlineIndicator\"\n data-testid=\"online-indicator\"\n class=\"str-chat__avatar--online-indicator\"\n ></div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type:
|
|
3086
|
+
AvatarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AvatarComponent, selector: "stream-avatar", inputs: { name: "name", imageUrl: "imageUrl", location: "location", channel: "channel", user: "user", type: "type", showOnlineIndicator: "showOnlineIndicator", initialsType: "initialsType" }, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"str-chat__avatar str-chat-angular__avatar str-chat__avatar--circle stream-chat__avatar--{{\n location\n }} stream-chat__avatar--{{\n initialsType === 'first-letter-of-first-word'\n ? 'one-letter'\n : 'multiple-letters'\n }}\"\n title=\"{{ name }}\"\n>\n <img\n *ngIf=\"(imageUrl || fallbackChannelImage) && !isError; else fallback\"\n class=\"str-chat__avatar-image\"\n data-testid=\"avatar-img\"\n fetchpriority=\"high\"\n src=\"{{ imageUrl || fallbackChannelImage }}\"\n alt=\"{{ initials }}\"\n (error)=\"isError = true\"\n />\n <ng-template #fallback>\n <div data-testid=\"fallback-img\" class=\"str-chat__avatar-fallback\">\n {{ initials }}\n </div>\n </ng-template>\n <div\n *ngIf=\"isOnline && showOnlineIndicator\"\n data-testid=\"online-indicator\"\n class=\"str-chat__avatar--online-indicator\"\n ></div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3039
3087
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
3040
3088
|
type: Component,
|
|
3041
3089
|
args: [{ selector: 'stream-avatar', template: "<div\n class=\"str-chat__avatar str-chat-angular__avatar str-chat__avatar--circle stream-chat__avatar--{{\n location\n }} stream-chat__avatar--{{\n initialsType === 'first-letter-of-first-word'\n ? 'one-letter'\n : 'multiple-letters'\n }}\"\n title=\"{{ name }}\"\n>\n <img\n *ngIf=\"(imageUrl || fallbackChannelImage) && !isError; else fallback\"\n class=\"str-chat__avatar-image\"\n data-testid=\"avatar-img\"\n fetchpriority=\"high\"\n src=\"{{ imageUrl || fallbackChannelImage }}\"\n alt=\"{{ initials }}\"\n (error)=\"isError = true\"\n />\n <ng-template #fallback>\n <div data-testid=\"fallback-img\" class=\"str-chat__avatar-fallback\">\n {{ initials }}\n </div>\n </ng-template>\n <div\n *ngIf=\"isOnline && showOnlineIndicator\"\n data-testid=\"online-indicator\"\n class=\"str-chat__avatar--online-indicator\"\n ></div>\n</div>\n" }]
|
|
@@ -3293,6 +3341,14 @@ class CustomTemplatesService {
|
|
|
3293
3341
|
* The template has no effect if you're using a custom `messageTemplate$`
|
|
3294
3342
|
*/
|
|
3295
3343
|
this.messageBlockedTemplate$ = new BehaviorSubject(undefined);
|
|
3344
|
+
/**
|
|
3345
|
+
* Template to display polls inside [message component](/chat/docs/sdk/angular/components/MessageComponent/). There is no default template, but the `PollsModule` contains default components.
|
|
3346
|
+
*/
|
|
3347
|
+
this.pollTemplate$ = new BehaviorSubject(undefined);
|
|
3348
|
+
/**
|
|
3349
|
+
* Template to display poll composer inside [message input component](/chat/docs/sdk/angular/components/MessageInputComponent/). There is no default template, but the `PollsModule` contains default components.
|
|
3350
|
+
*/
|
|
3351
|
+
this.pollComposerTemplate$ = new BehaviorSubject(undefined);
|
|
3296
3352
|
}
|
|
3297
3353
|
}
|
|
3298
3354
|
CustomTemplatesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: CustomTemplatesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -3343,7 +3399,7 @@ class AvatarPlaceholderComponent {
|
|
|
3343
3399
|
}
|
|
3344
3400
|
}
|
|
3345
3401
|
AvatarPlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AvatarPlaceholderComponent, deps: [{ token: CustomTemplatesService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3346
|
-
AvatarPlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: { name: "name", imageUrl: "imageUrl", location: "location", channel: "channel", user: "user", type: "type", initialsType: "initialsType", showOnlineIndicator: "showOnlineIndicator" }, usesOnChanges: true, ngImport: i0, template: "<ng-template\n #defaultAvatar\n let-name=\"name\"\n let-imageUrl=\"imageUrl\"\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 [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", dependencies: [{ kind: "directive", type:
|
|
3402
|
+
AvatarPlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: { name: "name", imageUrl: "imageUrl", location: "location", channel: "channel", user: "user", type: "type", initialsType: "initialsType", showOnlineIndicator: "showOnlineIndicator" }, usesOnChanges: true, ngImport: i0, template: "<ng-template\n #defaultAvatar\n let-name=\"name\"\n let-imageUrl=\"imageUrl\"\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 [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", dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "location", "channel", "user", "type", "showOnlineIndicator", "initialsType"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
3347
3403
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AvatarPlaceholderComponent, decorators: [{
|
|
3348
3404
|
type: Component,
|
|
3349
3405
|
args: [{ selector: 'stream-avatar-placeholder', template: "<ng-template\n #defaultAvatar\n let-name=\"name\"\n let-imageUrl=\"imageUrl\"\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 [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" }]
|
|
@@ -3395,7 +3451,7 @@ class IconPlaceholderComponent {
|
|
|
3395
3451
|
}
|
|
3396
3452
|
}
|
|
3397
3453
|
IconPlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IconPlaceholderComponent, deps: [{ token: CustomTemplatesService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3398
|
-
IconPlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: { icon: "icon" }, usesOnChanges: true, ngImport: i0, template: "<ng-template #defaultIcon let-icon=\"icon\">\n <stream-icon [icon]=\"icon\"></stream-icon>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.iconTemplate$ | async) || defaultIcon;\n context: iconContext\n \"\n></ng-container>\n", dependencies: [{ kind: "directive", type:
|
|
3454
|
+
IconPlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: { icon: "icon" }, usesOnChanges: true, ngImport: i0, template: "<ng-template #defaultIcon let-icon=\"icon\">\n <stream-icon [icon]=\"icon\"></stream-icon>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.iconTemplate$ | async) || defaultIcon;\n context: iconContext\n \"\n></ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "stream-icon", inputs: ["icon"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
3399
3455
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IconPlaceholderComponent, decorators: [{
|
|
3400
3456
|
type: Component,
|
|
3401
3457
|
args: [{ selector: 'stream-icon-placeholder', template: "<ng-template #defaultIcon let-icon=\"icon\">\n <stream-icon [icon]=\"icon\"></stream-icon>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.iconTemplate$ | async) || defaultIcon;\n context: iconContext\n \"\n></ng-container>\n" }]
|
|
@@ -3425,7 +3481,7 @@ class LoadingIndicatorPlaceholderComponent {
|
|
|
3425
3481
|
}
|
|
3426
3482
|
}
|
|
3427
3483
|
LoadingIndicatorPlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: LoadingIndicatorPlaceholderComponent, deps: [{ token: CustomTemplatesService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3428
|
-
LoadingIndicatorPlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: LoadingIndicatorPlaceholderComponent, selector: "stream-loading-indicator-placeholder", ngImport: i0, template: "<ng-template #defaultLoadingIndicator>\n <stream-loading-indicator></stream-loading-indicator>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.loadingIndicatorTemplate$ | async) ||\n defaultLoadingIndicator\n \"\n></ng-container>\n", dependencies: [{ kind: "directive", type:
|
|
3484
|
+
LoadingIndicatorPlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: LoadingIndicatorPlaceholderComponent, selector: "stream-loading-indicator-placeholder", ngImport: i0, template: "<ng-template #defaultLoadingIndicator>\n <stream-loading-indicator></stream-loading-indicator>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.loadingIndicatorTemplate$ | async) ||\n defaultLoadingIndicator\n \"\n></ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LoadingIndicatorComponent, selector: "stream-loading-indicator" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
3429
3485
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: LoadingIndicatorPlaceholderComponent, decorators: [{
|
|
3430
3486
|
type: Component,
|
|
3431
3487
|
args: [{ selector: 'stream-loading-indicator-placeholder', template: "<ng-template #defaultLoadingIndicator>\n <stream-loading-indicator></stream-loading-indicator>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.loadingIndicatorTemplate$ | async) ||\n defaultLoadingIndicator\n \"\n></ng-container>\n" }]
|
|
@@ -3568,6 +3624,10 @@ class MessageActionsService {
|
|
|
3568
3624
|
* @internal
|
|
3569
3625
|
*/
|
|
3570
3626
|
this.messageMenuOpenedFor$ = new BehaviorSubject(undefined);
|
|
3627
|
+
/**
|
|
3628
|
+
* @internal
|
|
3629
|
+
*/
|
|
3630
|
+
this.modalOpenedForMessage = new BehaviorSubject(undefined);
|
|
3571
3631
|
this.hasDisplayedClipboardWarning = false;
|
|
3572
3632
|
combineLatest([
|
|
3573
3633
|
this.messageToEdit$,
|
|
@@ -3723,7 +3783,7 @@ class MessageReactionsSelectorComponent {
|
|
|
3723
3783
|
}
|
|
3724
3784
|
}
|
|
3725
3785
|
MessageReactionsSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageReactionsSelectorComponent, deps: [{ token: ChannelService }, { token: MessageReactionsService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3726
|
-
MessageReactionsSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageReactionsSelectorComponent, selector: "stream-message-reactions-selector", inputs: { ownReactions: "ownReactions", messageId: "messageId" }, ngImport: i0, template: "<div\n #selectorContainer\n data-testid=\"reaction-selector\"\n class=\"str-chat__reaction-selector str-chat-angular-v5__reaction-selector str-chat__message-reaction-selector\"\n>\n <ul\n class=\"str-chat__message-reactions-list str-chat__message-reactions-options\"\n >\n <li\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n class=\"str-chat__message-reactions-option str-chat__message-reactions-list-item str-chat__emoji\"\n data-testclass=\"emoji-option\"\n [attr.data-testid]=\"reactionType\"\n [class.str-chat__message-reactions-option-selected]=\"\n isOwnReaction(reactionType)\n \"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <span\n class=\"emoji str-chat__emoji-selector-emoji-angular str-chat__message-reaction-emoji\"\n >\n {{ getEmojiByReaction(reactionType) }}\n </span>\n </li>\n </ul>\n</div>\n", dependencies: [{ kind: "directive", type:
|
|
3786
|
+
MessageReactionsSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageReactionsSelectorComponent, selector: "stream-message-reactions-selector", inputs: { ownReactions: "ownReactions", messageId: "messageId" }, ngImport: i0, template: "<div\n #selectorContainer\n data-testid=\"reaction-selector\"\n class=\"str-chat__reaction-selector str-chat-angular-v5__reaction-selector str-chat__message-reaction-selector\"\n>\n <ul\n class=\"str-chat__message-reactions-list str-chat__message-reactions-options\"\n >\n <li\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n class=\"str-chat__message-reactions-option str-chat__message-reactions-list-item str-chat__emoji\"\n data-testclass=\"emoji-option\"\n [attr.data-testid]=\"reactionType\"\n [class.str-chat__message-reactions-option-selected]=\"\n isOwnReaction(reactionType)\n \"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <span\n class=\"emoji str-chat__emoji-selector-emoji-angular str-chat__message-reaction-emoji\"\n >\n {{ getEmojiByReaction(reactionType) }}\n </span>\n </li>\n </ul>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
3727
3787
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageReactionsSelectorComponent, decorators: [{
|
|
3728
3788
|
type: Component,
|
|
3729
3789
|
args: [{ selector: 'stream-message-reactions-selector', template: "<div\n #selectorContainer\n data-testid=\"reaction-selector\"\n class=\"str-chat__reaction-selector str-chat-angular-v5__reaction-selector str-chat__message-reaction-selector\"\n>\n <ul\n class=\"str-chat__message-reactions-list str-chat__message-reactions-options\"\n >\n <li\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n class=\"str-chat__message-reactions-option str-chat__message-reactions-list-item str-chat__emoji\"\n data-testclass=\"emoji-option\"\n [attr.data-testid]=\"reactionType\"\n [class.str-chat__message-reactions-option-selected]=\"\n isOwnReaction(reactionType)\n \"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <span\n class=\"emoji str-chat__emoji-selector-emoji-angular str-chat__message-reaction-emoji\"\n >\n {{ getEmojiByReaction(reactionType) }}\n </span>\n </li>\n </ul>\n</div>\n" }]
|
|
@@ -3835,7 +3895,7 @@ class MessageActionsBoxComponent {
|
|
|
3835
3895
|
}
|
|
3836
3896
|
}
|
|
3837
3897
|
MessageActionsBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageActionsBoxComponent, deps: [{ token: CustomTemplatesService }, { token: MessageActionsService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3838
|
-
MessageActionsBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: { isMine: "isMine", message: "message", messageTextHtmlElement: "messageTextHtmlElement", enabledActions: "enabledActions" }, usesOnChanges: true, ngImport: i0, template: "<div\n #actionBox\n data-testid=\"action-box\"\n class=\"str-chat__message-actions-box str-chat__message-actions-box-angular str-chat__message-actions-box--open\"\n>\n <ul class=\"str-chat__message-actions-list\">\n <ng-container\n *ngFor=\"let item of visibleMessageActionItems; trackBy: trackByActionName\"\n >\n <ng-container [ngSwitch]=\"item.actionName\">\n <ng-container *ngSwitchCase=\"'react'\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageReactionsSelectorTemplate$\n | async) || defaultReactionSelector;\n context: getReactionSelectorTemplateContext()\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageActionsBoxItemTemplate$ | async) ||\n defaultMessageActionItem;\n context: getMessageActionTemplateContext(item)\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </ul>\n</div>\n\n<ng-template\n #defaultMessageActionItem\n let-actionName=\"actionName\"\n let-actionHandler=\"actionHandler\"\n let-actionLabelOrTranslationKey=\"actionLabelOrTranslationKey\"\n let-actionHandlerExtraParams=\"actionHandlerExtraParams\"\n>\n <button\n class=\"str-chat__message-actions-list-item-button\"\n [attr.data-testid]=\"actionName + '-action'\"\n (click)=\"actionHandler(message, actionHandlerExtraParams)\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ getActionLabel(actionLabelOrTranslationKey) | translate }}\n </li>\n </button>\n</ng-template>\n\n<ng-template\n #defaultReactionSelector\n let-messageId=\"messageId\"\n let-ownReactions=\"ownReactions\"\n>\n <stream-message-reactions-selector\n [messageId]=\"message?.id\"\n [ownReactions]=\"message?.own_reactions || []\"\n ></stream-message-reactions-selector>\n</ng-template>\n", dependencies: [{ kind: "directive", type:
|
|
3898
|
+
MessageActionsBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: { isMine: "isMine", message: "message", messageTextHtmlElement: "messageTextHtmlElement", enabledActions: "enabledActions" }, usesOnChanges: true, ngImport: i0, template: "<div\n #actionBox\n data-testid=\"action-box\"\n class=\"str-chat__message-actions-box str-chat__message-actions-box-angular str-chat__message-actions-box--open\"\n>\n <ul class=\"str-chat__message-actions-list\">\n <ng-container\n *ngFor=\"let item of visibleMessageActionItems; trackBy: trackByActionName\"\n >\n <ng-container [ngSwitch]=\"item.actionName\">\n <ng-container *ngSwitchCase=\"'react'\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageReactionsSelectorTemplate$\n | async) || defaultReactionSelector;\n context: getReactionSelectorTemplateContext()\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageActionsBoxItemTemplate$ | async) ||\n defaultMessageActionItem;\n context: getMessageActionTemplateContext(item)\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </ul>\n</div>\n\n<ng-template\n #defaultMessageActionItem\n let-actionName=\"actionName\"\n let-actionHandler=\"actionHandler\"\n let-actionLabelOrTranslationKey=\"actionLabelOrTranslationKey\"\n let-actionHandlerExtraParams=\"actionHandlerExtraParams\"\n>\n <button\n class=\"str-chat__message-actions-list-item-button\"\n [attr.data-testid]=\"actionName + '-action'\"\n (click)=\"actionHandler(message, actionHandlerExtraParams)\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ getActionLabel(actionLabelOrTranslationKey) | translate }}\n </li>\n </button>\n</ng-template>\n\n<ng-template\n #defaultReactionSelector\n let-messageId=\"messageId\"\n let-ownReactions=\"ownReactions\"\n>\n <stream-message-reactions-selector\n [messageId]=\"message?.id\"\n [ownReactions]=\"message?.own_reactions || []\"\n ></stream-message-reactions-selector>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: MessageReactionsSelectorComponent, selector: "stream-message-reactions-selector", inputs: ["ownReactions", "messageId"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
3839
3899
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageActionsBoxComponent, decorators: [{
|
|
3840
3900
|
type: Component,
|
|
3841
3901
|
args: [{ selector: 'stream-message-actions-box', template: "<div\n #actionBox\n data-testid=\"action-box\"\n class=\"str-chat__message-actions-box str-chat__message-actions-box-angular str-chat__message-actions-box--open\"\n>\n <ul class=\"str-chat__message-actions-list\">\n <ng-container\n *ngFor=\"let item of visibleMessageActionItems; trackBy: trackByActionName\"\n >\n <ng-container [ngSwitch]=\"item.actionName\">\n <ng-container *ngSwitchCase=\"'react'\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageReactionsSelectorTemplate$\n | async) || defaultReactionSelector;\n context: getReactionSelectorTemplateContext()\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageActionsBoxItemTemplate$ | async) ||\n defaultMessageActionItem;\n context: getMessageActionTemplateContext(item)\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </ul>\n</div>\n\n<ng-template\n #defaultMessageActionItem\n let-actionName=\"actionName\"\n let-actionHandler=\"actionHandler\"\n let-actionLabelOrTranslationKey=\"actionLabelOrTranslationKey\"\n let-actionHandlerExtraParams=\"actionHandlerExtraParams\"\n>\n <button\n class=\"str-chat__message-actions-list-item-button\"\n [attr.data-testid]=\"actionName + '-action'\"\n (click)=\"actionHandler(message, actionHandlerExtraParams)\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ getActionLabel(actionLabelOrTranslationKey) | translate }}\n </li>\n </button>\n</ng-template>\n\n<ng-template\n #defaultReactionSelector\n let-messageId=\"messageId\"\n let-ownReactions=\"ownReactions\"\n>\n <stream-message-reactions-selector\n [messageId]=\"message?.id\"\n [ownReactions]=\"message?.own_reactions || []\"\n ></stream-message-reactions-selector>\n</ng-template>\n" }]
|
|
@@ -3856,7 +3916,7 @@ class NotificationComponent {
|
|
|
3856
3916
|
constructor() { }
|
|
3857
3917
|
}
|
|
3858
3918
|
NotificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3859
|
-
NotificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: NotificationComponent, selector: "stream-notification", inputs: { type: "type", content: "content" }, ngImport: i0, template: "<div\n data-testid=\"custom-notification\"\n class=\"str-chat__custom-notification notification-{{\n type\n }} str-chat__notification\"\n>\n <ng-container *ngIf=\"content; else elseContent\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </ng-container>\n <ng-template #elseContent>\n <ng-content></ng-content>\n </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type:
|
|
3919
|
+
NotificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: NotificationComponent, selector: "stream-notification", inputs: { type: "type", content: "content" }, ngImport: i0, template: "<div\n data-testid=\"custom-notification\"\n class=\"str-chat__custom-notification notification-{{\n type\n }} str-chat__notification\"\n>\n <ng-container *ngIf=\"content; else elseContent\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </ng-container>\n <ng-template #elseContent>\n <ng-content></ng-content>\n </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
3860
3920
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NotificationComponent, decorators: [{
|
|
3861
3921
|
type: Component,
|
|
3862
3922
|
args: [{ selector: 'stream-notification', template: "<div\n data-testid=\"custom-notification\"\n class=\"str-chat__custom-notification notification-{{\n type\n }} str-chat__notification\"\n>\n <ng-container *ngIf=\"content; else elseContent\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </ng-container>\n <ng-template #elseContent>\n <ng-content></ng-content>\n </ng-template>\n</div>\n" }]
|
|
@@ -3888,7 +3948,7 @@ class NotificationListComponent {
|
|
|
3888
3948
|
}
|
|
3889
3949
|
}
|
|
3890
3950
|
NotificationListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NotificationListComponent, deps: [{ token: CustomTemplatesService }, { token: NotificationService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3891
|
-
NotificationListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: NotificationListComponent, selector: "stream-notification-list", ngImport: i0, template: "<div\n data-testid=\"notification-list\"\n class=\"str-chat str-chat__theme-{{\n theme$ | async\n }} str-chat__list-notifications\"\n>\n <ng-container\n *ngFor=\"let notification of notifications$ | async; trackBy: trackById\"\n >\n <ng-template #notificationContent>\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: getNotificationContentContext(notification)\n \"\n ></ng-container>\n </ng-container>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.notificationTemplate$ | async) ||\n defaultNotification;\n context: { type: notification.type, content: notificationContent }\n \"\n ></ng-container>\n </ng-container>\n</div>\n\n<ng-template #defaultNotification let-type=\"type\" let-content=\"content\">\n <stream-notification [type]=\"type\" [content]=\"content\"></stream-notification>\n</ng-template>\n", dependencies: [{ kind: "directive", type:
|
|
3951
|
+
NotificationListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: NotificationListComponent, selector: "stream-notification-list", ngImport: i0, template: "<div\n data-testid=\"notification-list\"\n class=\"str-chat str-chat__theme-{{\n theme$ | async\n }} str-chat__list-notifications\"\n>\n <ng-container\n *ngFor=\"let notification of notifications$ | async; trackBy: trackById\"\n >\n <ng-template #notificationContent>\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: getNotificationContentContext(notification)\n \"\n ></ng-container>\n </ng-container>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.notificationTemplate$ | async) ||\n defaultNotification;\n context: { type: notification.type, content: notificationContent }\n \"\n ></ng-container>\n </ng-container>\n</div>\n\n<ng-template #defaultNotification let-type=\"type\" let-content=\"content\">\n <stream-notification [type]=\"type\" [content]=\"content\"></stream-notification>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NotificationComponent, selector: "stream-notification", inputs: ["type", "content"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
3892
3952
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NotificationListComponent, decorators: [{
|
|
3893
3953
|
type: Component,
|
|
3894
3954
|
args: [{ selector: 'stream-notification-list', template: "<div\n data-testid=\"notification-list\"\n class=\"str-chat str-chat__theme-{{\n theme$ | async\n }} str-chat__list-notifications\"\n>\n <ng-container\n *ngFor=\"let notification of notifications$ | async; trackBy: trackById\"\n >\n <ng-template #notificationContent>\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: getNotificationContentContext(notification)\n \"\n ></ng-container>\n </ng-container>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.notificationTemplate$ | async) ||\n defaultNotification;\n context: { type: notification.type, content: notificationContent }\n \"\n ></ng-container>\n </ng-container>\n</div>\n\n<ng-template #defaultNotification let-type=\"type\" let-content=\"content\">\n <stream-notification [type]=\"type\" [content]=\"content\"></stream-notification>\n</ng-template>\n" }]
|
|
@@ -3944,10 +4004,10 @@ class ModalComponent {
|
|
|
3944
4004
|
}
|
|
3945
4005
|
}
|
|
3946
4006
|
ModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3947
|
-
ModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ModalComponent, selector: "stream-modal", inputs: { isOpen: "isOpen", content: "content" }, outputs: { isOpenChange: "isOpenChange" }, viewQueries: [{ propertyName: "innerContainer", first: true, predicate: ["modalInner"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </div>\n <div
|
|
4007
|
+
ModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ModalComponent, selector: "stream-modal", inputs: { isOpen: "isOpen", content: "content" }, outputs: { isOpenChange: "isOpenChange" }, viewQueries: [{ propertyName: "innerContainer", first: true, predicate: ["modalInner"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </div>\n <div\n #modalInner\n class=\"str-chat__modal__inner\"\n (click)=\"$event.stopPropagation()\"\n (keyup.enter)=\"$event.stopPropagation()\"\n >\n <ng-container *ngIf=\"content; else elseContent\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </ng-container>\n <ng-template #elseContent>\n <ng-content></ng-content>\n </ng-template>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }] });
|
|
3948
4008
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalComponent, decorators: [{
|
|
3949
4009
|
type: Component,
|
|
3950
|
-
args: [{ selector: 'stream-modal', template: "<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </div>\n <div
|
|
4010
|
+
args: [{ selector: 'stream-modal', template: "<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </div>\n <div\n #modalInner\n class=\"str-chat__modal__inner\"\n (click)=\"$event.stopPropagation()\"\n (keyup.enter)=\"$event.stopPropagation()\"\n >\n <ng-container *ngIf=\"content; else elseContent\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </ng-container>\n <ng-template #elseContent>\n <ng-content></ng-content>\n </ng-template>\n </div>\n</div>\n" }]
|
|
3951
4011
|
}], ctorParameters: function () { return []; }, propDecorators: { isOpen: [{
|
|
3952
4012
|
type: Input
|
|
3953
4013
|
}], content: [{
|
|
@@ -4014,7 +4074,7 @@ class MessageBouncePromptComponent {
|
|
|
4014
4074
|
}
|
|
4015
4075
|
}
|
|
4016
4076
|
MessageBouncePromptComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageBouncePromptComponent, deps: [{ token: ChannelService }, { token: CustomTemplatesService }, { token: MessageActionsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4017
|
-
MessageBouncePromptComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageBouncePromptComponent, selector: "stream-message-bounce-prompt", host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: {\n message: message,\n isOpen: isModalOpen,\n isOpenChangeHandler: messageBounceModalOpenChanged,\n content: modalContent\n }\n \"\n></ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n *ngIf=\"isOpen\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div\n class=\"str-chat__message-bounce-prompt\"\n data-testid=\"message-bounce-prompt\"\n >\n <div class=\"str-chat__message-bounce-prompt-header\">\n {{\n \"streamChat.This message did not meet our content guidelines\"\n | translate\n }}\n </div>\n <div class=\"str-chat__message-bounce-actions\">\n <button\n class=\"str-chat__message-bounce-edit\"\n data-testid=\"message-bounce-edit\"\n type=\"button\"\n (click)=\"editMessage()\"\n (keyup.enter)=\"editMessage()\"\n >\n {{ \"streamChat.Edit Message\" | translate }}\n </button>\n <button\n class=\"str-chat__message-bounce-send\"\n data-testid=\"message-bounce-send\"\n (click)=\"resendMessage()\"\n (keyup.enter)=\"resendMessage()\"\n >\n {{ \"streamChat.Send Anyway\" | translate }}\n </button>\n <button\n class=\"str-chat__message-bounce-delete\"\n data-testid=\"message-bounce-delete\"\n (click)=\"deleteMessage()\"\n (keyup.enter)=\"deleteMessage()\"\n >\n {{ \"streamChat.Delete\" | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type:
|
|
4077
|
+
MessageBouncePromptComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageBouncePromptComponent, selector: "stream-message-bounce-prompt", host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: {\n message: message,\n isOpen: isModalOpen,\n isOpenChangeHandler: messageBounceModalOpenChanged,\n content: modalContent\n }\n \"\n></ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n *ngIf=\"isOpen\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div\n class=\"str-chat__message-bounce-prompt\"\n data-testid=\"message-bounce-prompt\"\n >\n <div class=\"str-chat__message-bounce-prompt-header\">\n {{\n \"streamChat.This message did not meet our content guidelines\"\n | translate\n }}\n </div>\n <div class=\"str-chat__message-bounce-actions\">\n <button\n class=\"str-chat__message-bounce-edit\"\n data-testid=\"message-bounce-edit\"\n type=\"button\"\n (click)=\"editMessage()\"\n (keyup.enter)=\"editMessage()\"\n >\n {{ \"streamChat.Edit Message\" | translate }}\n </button>\n <button\n class=\"str-chat__message-bounce-send\"\n data-testid=\"message-bounce-send\"\n (click)=\"resendMessage()\"\n (keyup.enter)=\"resendMessage()\"\n >\n {{ \"streamChat.Send Anyway\" | translate }}\n </button>\n <button\n class=\"str-chat__message-bounce-delete\"\n data-testid=\"message-bounce-delete\"\n (click)=\"deleteMessage()\"\n (keyup.enter)=\"deleteMessage()\"\n >\n {{ \"streamChat.Delete\" | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ModalComponent, selector: "stream-modal", inputs: ["isOpen", "content"], outputs: ["isOpenChange"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
4018
4078
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageBouncePromptComponent, decorators: [{
|
|
4019
4079
|
type: Component,
|
|
4020
4080
|
args: [{ selector: 'stream-message-bounce-prompt', template: "<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: {\n message: message,\n isOpen: isModalOpen,\n isOpenChangeHandler: messageBounceModalOpenChanged,\n content: modalContent\n }\n \"\n></ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n *ngIf=\"isOpen\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div\n class=\"str-chat__message-bounce-prompt\"\n data-testid=\"message-bounce-prompt\"\n >\n <div class=\"str-chat__message-bounce-prompt-header\">\n {{\n \"streamChat.This message did not meet our content guidelines\"\n | translate\n }}\n </div>\n <div class=\"str-chat__message-bounce-actions\">\n <button\n class=\"str-chat__message-bounce-edit\"\n data-testid=\"message-bounce-edit\"\n type=\"button\"\n (click)=\"editMessage()\"\n (keyup.enter)=\"editMessage()\"\n >\n {{ \"streamChat.Edit Message\" | translate }}\n </button>\n <button\n class=\"str-chat__message-bounce-send\"\n data-testid=\"message-bounce-send\"\n (click)=\"resendMessage()\"\n (keyup.enter)=\"resendMessage()\"\n >\n {{ \"streamChat.Send Anyway\" | translate }}\n </button>\n <button\n class=\"str-chat__message-bounce-delete\"\n data-testid=\"message-bounce-delete\"\n (click)=\"deleteMessage()\"\n (keyup.enter)=\"deleteMessage()\"\n >\n {{ \"streamChat.Delete\" | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n" }]
|
|
@@ -4049,7 +4109,7 @@ class ChannelComponent {
|
|
|
4049
4109
|
}
|
|
4050
4110
|
}
|
|
4051
4111
|
ChannelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ChannelComponent, deps: [{ token: ChannelService }, { token: ThemeService }, { token: CustomTemplatesService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4052
|
-
ChannelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ChannelComponent, selector: "stream-channel", ngImport: i0, template: "<div\n class=\"str-chat str-chat-channel messaging str-chat__channel str-chat__theme-{{\n theme$ | async\n }}\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false &&\n (isInitializing$ | async) === false &&\n (isActiveChannel$ | async) === true;\n else noChannel\n \"\n class=\"str-chat__container\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageBouncePromptTemplate$ | async) ||\n defaultMessageBouncePrompt\n \"\n ></ng-container>\n <ng-template #defaultMessageBouncePrompt>\n <stream-message-bounce-prompt></stream-message-bounce-prompt>\n </ng-template>\n <div class=\"str-chat__main-panel\">\n <ng-content></ng-content>\n </div>\n <ng-content\n *ngIf=\"isActiveThread$ | async\"\n select='[name=\"thread\"]'\n ></ng-content>\n </div>\n <ng-template #noChannel>\n <div\n *ngIf=\"\n (isInitializing$ | async) === false &&\n ((isError$ | async) === true || (isActiveChannel$ | async) === false)\n \"\n class=\"str-chat__empty-channel\"\n >\n <stream-icon icon=\"chat-bubble\"></stream-icon>\n <p class=\"str-chat__empty-channel-text\">\n {{ \"streamChat.No chats here yet\u2026\" | translate }}\n </p>\n <div class=\"str-chat__empty-channel-notifications\">\n <stream-notification-list></stream-notification-list>\n </div>\n </div>\n <div\n *ngIf=\"\n (isInitializing$ | async) === true &&\n (isError$ | async) === false &&\n (isActiveChannel$ | async) === false\n \"\n class=\"str-chat__loading-channel\"\n >\n <div class=\"str-chat__loading-channel-header\">\n <div class=\"str-chat__loading-channel-header-avatar\"></div>\n <div class=\"str-chat__loading-channel-header-end\">\n <div class=\"str-chat__loading-channel-header-name\"></div>\n <div class=\"str-chat__loading-channel-header-info\"></div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message-list\">\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message-input-row\">\n <div class=\"str-chat__loading-channel-message-input\"></div>\n <div class=\"str-chat__loading-channel-message-send\"></div>\n </div>\n </div>\n </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type:
|
|
4112
|
+
ChannelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ChannelComponent, selector: "stream-channel", ngImport: i0, template: "<div\n class=\"str-chat str-chat-channel messaging str-chat__channel str-chat__theme-{{\n theme$ | async\n }}\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false &&\n (isInitializing$ | async) === false &&\n (isActiveChannel$ | async) === true;\n else noChannel\n \"\n class=\"str-chat__container\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageBouncePromptTemplate$ | async) ||\n defaultMessageBouncePrompt\n \"\n ></ng-container>\n <ng-template #defaultMessageBouncePrompt>\n <stream-message-bounce-prompt></stream-message-bounce-prompt>\n </ng-template>\n <div class=\"str-chat__main-panel\">\n <ng-content></ng-content>\n </div>\n <ng-content\n *ngIf=\"isActiveThread$ | async\"\n select='[name=\"thread\"]'\n ></ng-content>\n </div>\n <ng-template #noChannel>\n <div\n *ngIf=\"\n (isInitializing$ | async) === false &&\n ((isError$ | async) === true || (isActiveChannel$ | async) === false)\n \"\n class=\"str-chat__empty-channel\"\n >\n <stream-icon icon=\"chat-bubble\"></stream-icon>\n <p class=\"str-chat__empty-channel-text\">\n {{ \"streamChat.No chats here yet\u2026\" | translate }}\n </p>\n <div class=\"str-chat__empty-channel-notifications\">\n <stream-notification-list></stream-notification-list>\n </div>\n </div>\n <div\n *ngIf=\"\n (isInitializing$ | async) === true &&\n (isError$ | async) === false &&\n (isActiveChannel$ | async) === false\n \"\n class=\"str-chat__loading-channel\"\n >\n <div class=\"str-chat__loading-channel-header\">\n <div class=\"str-chat__loading-channel-header-avatar\"></div>\n <div class=\"str-chat__loading-channel-header-end\">\n <div class=\"str-chat__loading-channel-header-name\"></div>\n <div class=\"str-chat__loading-channel-header-info\"></div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message-list\">\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message-input-row\">\n <div class=\"str-chat__loading-channel-message-input\"></div>\n <div class=\"str-chat__loading-channel-message-send\"></div>\n </div>\n </div>\n </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "stream-icon", inputs: ["icon"] }, { kind: "component", type: NotificationListComponent, selector: "stream-notification-list" }, { kind: "component", type: MessageBouncePromptComponent, selector: "stream-message-bounce-prompt" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
4053
4113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ChannelComponent, decorators: [{
|
|
4054
4114
|
type: Component,
|
|
4055
4115
|
args: [{ selector: 'stream-channel', template: "<div\n class=\"str-chat str-chat-channel messaging str-chat__channel str-chat__theme-{{\n theme$ | async\n }}\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false &&\n (isInitializing$ | async) === false &&\n (isActiveChannel$ | async) === true;\n else noChannel\n \"\n class=\"str-chat__container\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageBouncePromptTemplate$ | async) ||\n defaultMessageBouncePrompt\n \"\n ></ng-container>\n <ng-template #defaultMessageBouncePrompt>\n <stream-message-bounce-prompt></stream-message-bounce-prompt>\n </ng-template>\n <div class=\"str-chat__main-panel\">\n <ng-content></ng-content>\n </div>\n <ng-content\n *ngIf=\"isActiveThread$ | async\"\n select='[name=\"thread\"]'\n ></ng-content>\n </div>\n <ng-template #noChannel>\n <div\n *ngIf=\"\n (isInitializing$ | async) === false &&\n ((isError$ | async) === true || (isActiveChannel$ | async) === false)\n \"\n class=\"str-chat__empty-channel\"\n >\n <stream-icon icon=\"chat-bubble\"></stream-icon>\n <p class=\"str-chat__empty-channel-text\">\n {{ \"streamChat.No chats here yet\u2026\" | translate }}\n </p>\n <div class=\"str-chat__empty-channel-notifications\">\n <stream-notification-list></stream-notification-list>\n </div>\n </div>\n <div\n *ngIf=\"\n (isInitializing$ | async) === true &&\n (isError$ | async) === false &&\n (isActiveChannel$ | async) === false\n \"\n class=\"str-chat__loading-channel\"\n >\n <div class=\"str-chat__loading-channel-header\">\n <div class=\"str-chat__loading-channel-header-avatar\"></div>\n <div class=\"str-chat__loading-channel-header-end\">\n <div class=\"str-chat__loading-channel-header-name\"></div>\n <div class=\"str-chat__loading-channel-header-info\"></div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message-list\">\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message-input-row\">\n <div class=\"str-chat__loading-channel-message-input\"></div>\n <div class=\"str-chat__loading-channel-message-send\"></div>\n </div>\n </div>\n </ng-template>\n</div>\n" }]
|
|
@@ -4137,7 +4197,7 @@ class ChannelHeaderComponent {
|
|
|
4137
4197
|
}
|
|
4138
4198
|
}
|
|
4139
4199
|
ChannelHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ChannelHeaderComponent, deps: [{ token: ChannelService }, { token: CustomTemplatesService }, { token: i0.ChangeDetectorRef }, { token: ChatClientService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4140
|
-
ChannelHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ChannelHeaderComponent, selector: "stream-channel-header", ngImport: i0, template: "<div class=\"str-chat__header-livestream str-chat__channel-header\">\n <ng-content></ng-content>\n <stream-avatar-placeholder\n type=\"channel\"\n location=\"channel-header\"\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ avatarName }}\"\n [channel]=\"activeChannel\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__header-livestream-left str-chat__channel-header-end\">\n <p\n data-testid=\"name\"\n class=\"str-chat__header-livestream-left--title str-chat__channel-header-title\"\n >\n {{ displayText }}\n </p>\n <ng-container\n *ngTemplateOutlet=\"\n channelHeaderInfoTemplate || defaultChannelInfo;\n context: getChannelInfoContext()\n \"\n ></ng-container>\n <ng-template #defaultChannelInfo>\n <p\n data-testid=\"info\"\n class=\"str-chat__header-livestream-left--members str-chat__channel-header-info\"\n >\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{canReceiveConnectEvents ? ('streamChat.{{ watcherCount }} online' |\n translate:watcherCountParam) : ''}}\n </p>\n </ng-template>\n </div>\n <ng-container *ngIf=\"channelActionsTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n channelActionsTemplate;\n context: getChannelActionsContext()\n \"\n ></ng-container>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type:
|
|
4200
|
+
ChannelHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ChannelHeaderComponent, selector: "stream-channel-header", ngImport: i0, template: "<div class=\"str-chat__header-livestream str-chat__channel-header\">\n <ng-content></ng-content>\n <stream-avatar-placeholder\n type=\"channel\"\n location=\"channel-header\"\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ avatarName }}\"\n [channel]=\"activeChannel\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__header-livestream-left str-chat__channel-header-end\">\n <p\n data-testid=\"name\"\n class=\"str-chat__header-livestream-left--title str-chat__channel-header-title\"\n >\n {{ displayText }}\n </p>\n <ng-container\n *ngTemplateOutlet=\"\n channelHeaderInfoTemplate || defaultChannelInfo;\n context: getChannelInfoContext()\n \"\n ></ng-container>\n <ng-template #defaultChannelInfo>\n <p\n data-testid=\"info\"\n class=\"str-chat__header-livestream-left--members str-chat__channel-header-info\"\n >\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{canReceiveConnectEvents ? ('streamChat.{{ watcherCount }} online' |\n translate:watcherCountParam) : ''}}\n </p>\n </ng-template>\n </div>\n <ng-container *ngIf=\"channelActionsTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n channelActionsTemplate;\n context: getChannelActionsContext()\n \"\n ></ng-container>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: ["name", "imageUrl", "location", "channel", "user", "type", "initialsType", "showOnlineIndicator"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
4141
4201
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ChannelHeaderComponent, decorators: [{
|
|
4142
4202
|
type: Component,
|
|
4143
4203
|
args: [{ selector: 'stream-channel-header', template: "<div class=\"str-chat__header-livestream str-chat__channel-header\">\n <ng-content></ng-content>\n <stream-avatar-placeholder\n type=\"channel\"\n location=\"channel-header\"\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ avatarName }}\"\n [channel]=\"activeChannel\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__header-livestream-left str-chat__channel-header-end\">\n <p\n data-testid=\"name\"\n class=\"str-chat__header-livestream-left--title str-chat__channel-header-title\"\n >\n {{ displayText }}\n </p>\n <ng-container\n *ngTemplateOutlet=\"\n channelHeaderInfoTemplate || defaultChannelInfo;\n context: getChannelInfoContext()\n \"\n ></ng-container>\n <ng-template #defaultChannelInfo>\n <p\n data-testid=\"info\"\n class=\"str-chat__header-livestream-left--members str-chat__channel-header-info\"\n >\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{canReceiveConnectEvents ? ('streamChat.{{ watcherCount }} online' |\n translate:watcherCountParam) : ''}}\n </p>\n </ng-template>\n </div>\n <ng-container *ngIf=\"channelActionsTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n channelActionsTemplate;\n context: getChannelActionsContext()\n \"\n ></ng-container>\n </ng-container>\n</div>\n" }]
|
|
@@ -4323,6 +4383,9 @@ class ChannelPreviewComponent {
|
|
|
4323
4383
|
else if (message?.attachments && message.attachments.length) {
|
|
4324
4384
|
this.latestMessageText = 'streamChat.🏙 Attachment...';
|
|
4325
4385
|
}
|
|
4386
|
+
else if (message?.poll_id) {
|
|
4387
|
+
this.latestMessageText = `📊 ${message.poll?.name}`;
|
|
4388
|
+
}
|
|
4326
4389
|
if (this.latestMessage && this.latestMessage.type === 'regular') {
|
|
4327
4390
|
this.latestMessageTime = isOnSeparateDate(new Date(), this.latestMessage.created_at)
|
|
4328
4391
|
? this.dateParser.parseDate(this.latestMessage.created_at)
|
|
@@ -4357,7 +4420,7 @@ class ChannelPreviewComponent {
|
|
|
4357
4420
|
}
|
|
4358
4421
|
}
|
|
4359
4422
|
ChannelPreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ChannelPreviewComponent, deps: [{ token: ChannelService }, { token: i0.NgZone }, { token: ChatClientService }, { token: MessageService }, { token: CustomTemplatesService }, { token: DateParserService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4360
|
-
ChannelPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: { channel: "channel" }, ngImport: i0, template: "<button\n class=\"str-chat__channel-preview-messenger str-chat__channel-preview\"\n data-testid=\"channel-preview-container\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar-placeholder\n type=\"channel\"\n location=\"channel-preview\"\n name=\"{{ avatarName }}\"\n imageUrl=\"{{ avatarImage }}\"\n [channel]=\"channel\"\n ></stream-avatar-placeholder>\n </div>\n <div\n class=\"str-chat__channel-preview-messenger--right str-chat__channel-preview-end\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.channelPreviewInfoTemplate$ | async) ||\n defaultChannelInfo;\n context: {\n channelDisplayTitle: title,\n channel: channel,\n unreadCount: unreadCount,\n latestMessageText: latestMessageText,\n latestMessageStatus: latestMessageStatus,\n latestMessageTime: latestMessageTime,\n latestMessage: latestMessage\n }\n \"\n ></ng-container>\n <ng-template\n #defaultChannelInfo\n let-channelDisplayTitle=\"channelDisplayTitle\"\n let-unreadCount=\"unreadCount\"\n let-latestMessageText=\"latestMessageText\"\n let-latestMessageStatus=\"latestMessageStatus\"\n let-latestMessageTime=\"latestMessageTime\"\n >\n <div class=\"str-chat__channel-preview-end-first-row\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{\n channelDisplayTitle\n }}</span>\n </div>\n <div\n *ngIf=\"unreadCount\"\n data-testid=\"unread-badge\"\n class=\"str-chat__channel-preview-unread-badge\"\n >\n {{ unreadCount }}\n </div>\n </div>\n <div class=\"str-chat__channel-preview-end-second-row\">\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n <ng-container *ngIf=\"displayAs === 'text'; else asHTML\">\n {{ latestMessageText | translate }}\n </ng-container>\n <ng-template #asHTML>\n <span\n data-testid=\"html-content\"\n [innerHTML]=\"latestMessageText | translate\"\n ></span>\n </ng-template>\n </div>\n <div\n *ngIf=\"latestMessageStatus\"\n data-testid=\"latest-message-status\"\n class=\"str-chat__channel-preview-messenger--status str-chat__channel-preview-messenger--status-{{\n latestMessageStatus\n }}\"\n >\n <stream-icon-placeholder\n [icon]=\"latestMessageStatus === 'delivered' ? 'delivered' : 'read'\"\n ></stream-icon-placeholder>\n </div>\n <div\n *ngIf=\"latestMessageTime\"\n data-testid=\"latest-message-time\"\n class=\"str-chat__channel-preview-messenger--time\"\n >\n {{ latestMessageTime }}\n </div>\n </div>\n </ng-template>\n </div>\n</button>\n", dependencies: [{ kind: "directive", type:
|
|
4423
|
+
ChannelPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: { channel: "channel" }, ngImport: i0, template: "<button\n class=\"str-chat__channel-preview-messenger str-chat__channel-preview\"\n data-testid=\"channel-preview-container\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar-placeholder\n type=\"channel\"\n location=\"channel-preview\"\n name=\"{{ avatarName }}\"\n imageUrl=\"{{ avatarImage }}\"\n [channel]=\"channel\"\n ></stream-avatar-placeholder>\n </div>\n <div\n class=\"str-chat__channel-preview-messenger--right str-chat__channel-preview-end\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.channelPreviewInfoTemplate$ | async) ||\n defaultChannelInfo;\n context: {\n channelDisplayTitle: title,\n channel: channel,\n unreadCount: unreadCount,\n latestMessageText: latestMessageText,\n latestMessageStatus: latestMessageStatus,\n latestMessageTime: latestMessageTime,\n latestMessage: latestMessage\n }\n \"\n ></ng-container>\n <ng-template\n #defaultChannelInfo\n let-channelDisplayTitle=\"channelDisplayTitle\"\n let-unreadCount=\"unreadCount\"\n let-latestMessageText=\"latestMessageText\"\n let-latestMessageStatus=\"latestMessageStatus\"\n let-latestMessageTime=\"latestMessageTime\"\n >\n <div class=\"str-chat__channel-preview-end-first-row\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{\n channelDisplayTitle\n }}</span>\n </div>\n <div\n *ngIf=\"unreadCount\"\n data-testid=\"unread-badge\"\n class=\"str-chat__channel-preview-unread-badge\"\n >\n {{ unreadCount }}\n </div>\n </div>\n <div class=\"str-chat__channel-preview-end-second-row\">\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n <ng-container *ngIf=\"displayAs === 'text'; else asHTML\">\n {{ latestMessageText | translate }}\n </ng-container>\n <ng-template #asHTML>\n <span\n data-testid=\"html-content\"\n [innerHTML]=\"latestMessageText | translate\"\n ></span>\n </ng-template>\n </div>\n <div\n *ngIf=\"latestMessageStatus\"\n data-testid=\"latest-message-status\"\n class=\"str-chat__channel-preview-messenger--status str-chat__channel-preview-messenger--status-{{\n latestMessageStatus\n }}\"\n >\n <stream-icon-placeholder\n [icon]=\"latestMessageStatus === 'delivered' ? 'delivered' : 'read'\"\n ></stream-icon-placeholder>\n </div>\n <div\n *ngIf=\"latestMessageTime\"\n data-testid=\"latest-message-time\"\n class=\"str-chat__channel-preview-messenger--time\"\n >\n {{ latestMessageTime }}\n </div>\n </div>\n </ng-template>\n </div>\n</button>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: ["name", "imageUrl", "location", "channel", "user", "type", "initialsType", "showOnlineIndicator"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
4361
4424
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ChannelPreviewComponent, decorators: [{
|
|
4362
4425
|
type: Component,
|
|
4363
4426
|
args: [{ selector: 'stream-channel-preview', template: "<button\n class=\"str-chat__channel-preview-messenger str-chat__channel-preview\"\n data-testid=\"channel-preview-container\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar-placeholder\n type=\"channel\"\n location=\"channel-preview\"\n name=\"{{ avatarName }}\"\n imageUrl=\"{{ avatarImage }}\"\n [channel]=\"channel\"\n ></stream-avatar-placeholder>\n </div>\n <div\n class=\"str-chat__channel-preview-messenger--right str-chat__channel-preview-end\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.channelPreviewInfoTemplate$ | async) ||\n defaultChannelInfo;\n context: {\n channelDisplayTitle: title,\n channel: channel,\n unreadCount: unreadCount,\n latestMessageText: latestMessageText,\n latestMessageStatus: latestMessageStatus,\n latestMessageTime: latestMessageTime,\n latestMessage: latestMessage\n }\n \"\n ></ng-container>\n <ng-template\n #defaultChannelInfo\n let-channelDisplayTitle=\"channelDisplayTitle\"\n let-unreadCount=\"unreadCount\"\n let-latestMessageText=\"latestMessageText\"\n let-latestMessageStatus=\"latestMessageStatus\"\n let-latestMessageTime=\"latestMessageTime\"\n >\n <div class=\"str-chat__channel-preview-end-first-row\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{\n channelDisplayTitle\n }}</span>\n </div>\n <div\n *ngIf=\"unreadCount\"\n data-testid=\"unread-badge\"\n class=\"str-chat__channel-preview-unread-badge\"\n >\n {{ unreadCount }}\n </div>\n </div>\n <div class=\"str-chat__channel-preview-end-second-row\">\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n <ng-container *ngIf=\"displayAs === 'text'; else asHTML\">\n {{ latestMessageText | translate }}\n </ng-container>\n <ng-template #asHTML>\n <span\n data-testid=\"html-content\"\n [innerHTML]=\"latestMessageText | translate\"\n ></span>\n </ng-template>\n </div>\n <div\n *ngIf=\"latestMessageStatus\"\n data-testid=\"latest-message-status\"\n class=\"str-chat__channel-preview-messenger--status str-chat__channel-preview-messenger--status-{{\n latestMessageStatus\n }}\"\n >\n <stream-icon-placeholder\n [icon]=\"latestMessageStatus === 'delivered' ? 'delivered' : 'read'\"\n ></stream-icon-placeholder>\n </div>\n <div\n *ngIf=\"latestMessageTime\"\n data-testid=\"latest-message-time\"\n class=\"str-chat__channel-preview-messenger--time\"\n >\n {{ latestMessageTime }}\n </div>\n </div>\n </ng-template>\n </div>\n</button>\n" }]
|
|
@@ -4432,7 +4495,7 @@ class PaginatedListComponent {
|
|
|
4432
4495
|
}
|
|
4433
4496
|
}
|
|
4434
4497
|
PaginatedListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PaginatedListComponent, deps: [{ token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
4435
|
-
PaginatedListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PaginatedListComponent, selector: "stream-paginated-list", inputs: { items: "items", isLoading: "isLoading", hasMore: "hasMore", trackBy: "trackBy" }, outputs: { loadMore: "loadMore" }, queries: [{ propertyName: "itemTempalteRef", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "scrollContainer", first: true, predicate: ["container"], descendants: true }], ngImport: i0, template: "<div class=\"stream-chat__paginated-list\" #container>\n <div\n data-testid=\"item\"\n class=\"stream-chat__paginated-list-item\"\n *ngFor=\"let item of items; let index = index; trackBy: trackBy\"\n >\n <ng-template\n *ngIf=\"itemTempalteRef\"\n [ngTemplateOutlet]=\"itemTempalteRef\"\n [ngTemplateOutletContext]=\"{ item: item, index: index }\"\n ></ng-template>\n </div>\n <button\n *ngIf=\"hasMore && !isScrollable\"\n class=\"str-chat__load-more-button__button str-chat__cta-button\"\n data-testid=\"load-more-button\"\n [disabled]=\"isLoading\"\n (click)=\"loadMore.emit()\"\n (keyup.enter)=\"loadMore.emit()\"\n >\n <span>{{ \"Load more\" | translate }}</span>\n </button>\n <stream-loading-indicator-placeholder\n data-testid=\"loading-indicator\"\n *ngIf=\"isLoading\"\n ></stream-loading-indicator-placeholder>\n</div>\n", dependencies: [{ kind: "directive", type:
|
|
4498
|
+
PaginatedListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PaginatedListComponent, selector: "stream-paginated-list", inputs: { items: "items", isLoading: "isLoading", hasMore: "hasMore", trackBy: "trackBy" }, outputs: { loadMore: "loadMore" }, queries: [{ propertyName: "itemTempalteRef", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "scrollContainer", first: true, predicate: ["container"], descendants: true }], ngImport: i0, template: "<div class=\"stream-chat__paginated-list\" #container>\n <div\n data-testid=\"item\"\n class=\"stream-chat__paginated-list-item\"\n *ngFor=\"let item of items; let index = index; trackBy: trackBy\"\n >\n <ng-template\n *ngIf=\"itemTempalteRef\"\n [ngTemplateOutlet]=\"itemTempalteRef\"\n [ngTemplateOutletContext]=\"{ item: item, index: index }\"\n ></ng-template>\n </div>\n <button\n *ngIf=\"hasMore && !isScrollable\"\n class=\"str-chat__load-more-button__button str-chat__cta-button\"\n data-testid=\"load-more-button\"\n [disabled]=\"isLoading\"\n (click)=\"loadMore.emit()\"\n (keyup.enter)=\"loadMore.emit()\"\n >\n <span>{{ \"Load more\" | translate }}</span>\n </button>\n <stream-loading-indicator-placeholder\n data-testid=\"loading-indicator\"\n *ngIf=\"isLoading\"\n ></stream-loading-indicator-placeholder>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LoadingIndicatorPlaceholderComponent, selector: "stream-loading-indicator-placeholder" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
4436
4499
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PaginatedListComponent, decorators: [{
|
|
4437
4500
|
type: Component,
|
|
4438
4501
|
args: [{ selector: 'stream-paginated-list', template: "<div class=\"stream-chat__paginated-list\" #container>\n <div\n data-testid=\"item\"\n class=\"stream-chat__paginated-list-item\"\n *ngFor=\"let item of items; let index = index; trackBy: trackBy\"\n >\n <ng-template\n *ngIf=\"itemTempalteRef\"\n [ngTemplateOutlet]=\"itemTempalteRef\"\n [ngTemplateOutletContext]=\"{ item: item, index: index }\"\n ></ng-template>\n </div>\n <button\n *ngIf=\"hasMore && !isScrollable\"\n class=\"str-chat__load-more-button__button str-chat__cta-button\"\n data-testid=\"load-more-button\"\n [disabled]=\"isLoading\"\n (click)=\"loadMore.emit()\"\n (keyup.enter)=\"loadMore.emit()\"\n >\n <span>{{ \"Load more\" | translate }}</span>\n </button>\n <stream-loading-indicator-placeholder\n data-testid=\"loading-indicator\"\n *ngIf=\"isLoading\"\n ></stream-loading-indicator-placeholder>\n</div>\n" }]
|
|
@@ -4484,7 +4547,7 @@ class ChannelListComponent {
|
|
|
4484
4547
|
}
|
|
4485
4548
|
}
|
|
4486
4549
|
ChannelListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ChannelListComponent, deps: [{ token: ChannelService }, { token: CustomTemplatesService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4487
|
-
ChannelListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ChannelListComponent, selector: "stream-channel-list", ngImport: i0, template: "<div\n #container\n data-testid=\"channel-list-container\"\n class=\"str-chat str-chat-angular__channel-list str-chat__channel-list str-chat-channel-list messaging str-chat__theme-{{\n theme$ | async\n }}\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false && (isInitializing$ | async) === false;\n else statusIndicator\n \"\n class=\"str-chat__channel-list-messenger\"\n >\n <div class=\"str-chat__channel-list-messenger__main\">\n <ng-content select=\"[channel-list-top]\"></ng-content>\n <div\n *ngIf=\"!(channels$ | async)?.length\"\n class=\"str-chat__channel-list-empty\"\n >\n <stream-icon icon=\"chat-bubble\"></stream-icon>\n <p data-testid=\"empty-channel-list-indicator\">\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n </div>\n <p\n *ngIf=\"!(channels$ | async)?.length\"\n class=\"str-chat__channel-list-empty-v1\"\n data-testid=\"empty-channel-list-indicator\"\n >\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n <stream-paginated-list\n [items]=\"(channels$ | async) ?? []\"\n [hasMore]=\"(hasMoreChannels$ | async) ?? false\"\n [isLoading]=\"isLoadingMoreChannels\"\n (loadMore)=\"loadMoreChannels()\"\n [trackBy]=\"trackByChannelId\"\n >\n <ng-template let-channel=\"item\">\n <ng-template #defaultTemplate let-channelInput=\"channel\">\n <stream-channel-preview\n data-testclass=\"channel-preview\"\n [channel]=\"channelInput\"\n ></stream-channel-preview>\n </ng-template>\n <div>\n <ng-container\n *ngTemplateOutlet=\"\n customChannelPreviewTemplate || defaultTemplate;\n context: { channel: channel }\n \"\n ></ng-container>\n </div>\n </ng-template>\n </stream-paginated-list>\n <ng-content select=\"[channel-list-bottom]\"></ng-content>\n </div>\n </div>\n</div>\n\n<ng-template #statusIndicator>\n <ng-container *ngIf=\"isError$ | async\">\n <ng-container *ngTemplateOutlet=\"chatDown\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isInitializing$ | async\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #chatDown>\n <div data-testid=\"chatdown-container\" class=\"str-chat__down\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannels>\n <div\n data-testid=\"loading-indicator-full-size\"\n class=\"str-chat__loading-channels\"\n >\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannel>\n <div\n class=\"str-chat__loading-channels-item str-chat__channel-preview-loading\"\n >\n <div class=\"str-chat__loading-channels-avatar\"></div>\n <div\n class=\"str-chat__loading-channels-meta str-chat__channel-preview-end-loading\"\n >\n <div class=\"str-chat__loading-channels-username\"></div>\n <div class=\"str-chat__loading-channels-status\"></div>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type:
|
|
4550
|
+
ChannelListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ChannelListComponent, selector: "stream-channel-list", ngImport: i0, template: "<div\n #container\n data-testid=\"channel-list-container\"\n class=\"str-chat str-chat-angular__channel-list str-chat__channel-list str-chat-channel-list messaging str-chat__theme-{{\n theme$ | async\n }}\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false && (isInitializing$ | async) === false;\n else statusIndicator\n \"\n class=\"str-chat__channel-list-messenger\"\n >\n <div class=\"str-chat__channel-list-messenger__main\">\n <ng-content select=\"[channel-list-top]\"></ng-content>\n <div\n *ngIf=\"!(channels$ | async)?.length\"\n class=\"str-chat__channel-list-empty\"\n >\n <stream-icon icon=\"chat-bubble\"></stream-icon>\n <p data-testid=\"empty-channel-list-indicator\">\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n </div>\n <p\n *ngIf=\"!(channels$ | async)?.length\"\n class=\"str-chat__channel-list-empty-v1\"\n data-testid=\"empty-channel-list-indicator\"\n >\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n <stream-paginated-list\n [items]=\"(channels$ | async) ?? []\"\n [hasMore]=\"(hasMoreChannels$ | async) ?? false\"\n [isLoading]=\"isLoadingMoreChannels\"\n (loadMore)=\"loadMoreChannels()\"\n [trackBy]=\"trackByChannelId\"\n >\n <ng-template let-channel=\"item\">\n <ng-template #defaultTemplate let-channelInput=\"channel\">\n <stream-channel-preview\n data-testclass=\"channel-preview\"\n [channel]=\"channelInput\"\n ></stream-channel-preview>\n </ng-template>\n <div>\n <ng-container\n *ngTemplateOutlet=\"\n customChannelPreviewTemplate || defaultTemplate;\n context: { channel: channel }\n \"\n ></ng-container>\n </div>\n </ng-template>\n </stream-paginated-list>\n <ng-content select=\"[channel-list-bottom]\"></ng-content>\n </div>\n </div>\n</div>\n\n<ng-template #statusIndicator>\n <ng-container *ngIf=\"isError$ | async\">\n <ng-container *ngTemplateOutlet=\"chatDown\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isInitializing$ | async\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #chatDown>\n <div data-testid=\"chatdown-container\" class=\"str-chat__down\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannels>\n <div\n data-testid=\"loading-indicator-full-size\"\n class=\"str-chat__loading-channels\"\n >\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannel>\n <div\n class=\"str-chat__loading-channels-item str-chat__channel-preview-loading\"\n >\n <div class=\"str-chat__loading-channels-avatar\"></div>\n <div\n class=\"str-chat__loading-channels-meta str-chat__channel-preview-end-loading\"\n >\n <div class=\"str-chat__loading-channels-username\"></div>\n <div class=\"str-chat__loading-channels-status\"></div>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "stream-icon", inputs: ["icon"] }, { kind: "component", type: PaginatedListComponent, selector: "stream-paginated-list", inputs: ["items", "isLoading", "hasMore", "trackBy"], outputs: ["loadMore"] }, { kind: "component", type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: ["channel"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
4488
4551
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ChannelListComponent, decorators: [{
|
|
4489
4552
|
type: Component,
|
|
4490
4553
|
args: [{ selector: 'stream-channel-list', template: "<div\n #container\n data-testid=\"channel-list-container\"\n class=\"str-chat str-chat-angular__channel-list str-chat__channel-list str-chat-channel-list messaging str-chat__theme-{{\n theme$ | async\n }}\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false && (isInitializing$ | async) === false;\n else statusIndicator\n \"\n class=\"str-chat__channel-list-messenger\"\n >\n <div class=\"str-chat__channel-list-messenger__main\">\n <ng-content select=\"[channel-list-top]\"></ng-content>\n <div\n *ngIf=\"!(channels$ | async)?.length\"\n class=\"str-chat__channel-list-empty\"\n >\n <stream-icon icon=\"chat-bubble\"></stream-icon>\n <p data-testid=\"empty-channel-list-indicator\">\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n </div>\n <p\n *ngIf=\"!(channels$ | async)?.length\"\n class=\"str-chat__channel-list-empty-v1\"\n data-testid=\"empty-channel-list-indicator\"\n >\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n <stream-paginated-list\n [items]=\"(channels$ | async) ?? []\"\n [hasMore]=\"(hasMoreChannels$ | async) ?? false\"\n [isLoading]=\"isLoadingMoreChannels\"\n (loadMore)=\"loadMoreChannels()\"\n [trackBy]=\"trackByChannelId\"\n >\n <ng-template let-channel=\"item\">\n <ng-template #defaultTemplate let-channelInput=\"channel\">\n <stream-channel-preview\n data-testclass=\"channel-preview\"\n [channel]=\"channelInput\"\n ></stream-channel-preview>\n </ng-template>\n <div>\n <ng-container\n *ngTemplateOutlet=\"\n customChannelPreviewTemplate || defaultTemplate;\n context: { channel: channel }\n \"\n ></ng-container>\n </div>\n </ng-template>\n </stream-paginated-list>\n <ng-content select=\"[channel-list-bottom]\"></ng-content>\n </div>\n </div>\n</div>\n\n<ng-template #statusIndicator>\n <ng-container *ngIf=\"isError$ | async\">\n <ng-container *ngTemplateOutlet=\"chatDown\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isInitializing$ | async\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #chatDown>\n <div data-testid=\"chatdown-container\" class=\"str-chat__down\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannels>\n <div\n data-testid=\"loading-indicator-full-size\"\n class=\"str-chat__loading-channels\"\n >\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannel>\n <div\n class=\"str-chat__loading-channels-item str-chat__channel-preview-loading\"\n >\n <div class=\"str-chat__loading-channels-avatar\"></div>\n <div\n class=\"str-chat__loading-channels-meta str-chat__channel-preview-end-loading\"\n >\n <div class=\"str-chat__loading-channels-username\"></div>\n <div class=\"str-chat__loading-channels-status\"></div>\n </div>\n </div>\n</ng-template>\n" }]
|
|
@@ -4673,7 +4736,7 @@ class VoiceRecordingWavebarComponent {
|
|
|
4673
4736
|
}
|
|
4674
4737
|
}
|
|
4675
4738
|
VoiceRecordingWavebarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: VoiceRecordingWavebarComponent, deps: [{ token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
4676
|
-
VoiceRecordingWavebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: VoiceRecordingWavebarComponent, selector: "stream-voice-recording-wavebar", inputs: { audioElement: "audioElement", waveFormData: "waveFormData", duration: "duration" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<!--eslint-disable @angular-eslint/template/click-events-have-key-events-->\n<div\n #container\n class=\"str-chat__wave-progress-bar__track\"\n data-testid=\"wave-progress-bar-track\"\n role=\"progressbar\"\n (mousedown)=\"isDragging = true\"\n (mouseup)=\"isDragging = false\"\n (mouseleave)=\"isDragging = false\"\n (mousemove)=\"isDragging ? seek($event) : null\"\n (click)=\"seek($event)\"\n>\n <!--eslint-enable @angular-eslint/template/click-events-have-key-events-->\n <div\n *ngFor=\"\n let dataPoint of resampledWaveFormData;\n let i = index;\n trackBy: trackByIndex\n \"\n class=\"str-chat__wave-progress-bar__amplitude-bar\"\n [class.str-chat__wave-progress-bar__amplitude-bar--active]=\"\n progress > i / resampledWaveFormData.length\n \"\n [style.--str-chat__wave-progress-bar__amplitude-bar-height]=\"\n dataPoint ? dataPoint * 100 + '%' : '0%'\n \"\n ></div>\n <div\n class=\"str-chat__wave-progress-bar__progress-indicator\"\n data-testid=\"wave-progress-bar-progress-indicator\"\n [ngStyle]=\"{ 'inset-inline-start': progress * 100 + '%' }\"\n ></div>\n</div>\n", dependencies: [{ kind: "directive", type:
|
|
4739
|
+
VoiceRecordingWavebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: VoiceRecordingWavebarComponent, selector: "stream-voice-recording-wavebar", inputs: { audioElement: "audioElement", waveFormData: "waveFormData", duration: "duration" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<!--eslint-disable @angular-eslint/template/click-events-have-key-events-->\n<div\n #container\n class=\"str-chat__wave-progress-bar__track\"\n data-testid=\"wave-progress-bar-track\"\n role=\"progressbar\"\n (mousedown)=\"isDragging = true\"\n (mouseup)=\"isDragging = false\"\n (mouseleave)=\"isDragging = false\"\n (mousemove)=\"isDragging ? seek($event) : null\"\n (click)=\"seek($event)\"\n>\n <!--eslint-enable @angular-eslint/template/click-events-have-key-events-->\n <div\n *ngFor=\"\n let dataPoint of resampledWaveFormData;\n let i = index;\n trackBy: trackByIndex\n \"\n class=\"str-chat__wave-progress-bar__amplitude-bar\"\n [class.str-chat__wave-progress-bar__amplitude-bar--active]=\"\n progress > i / resampledWaveFormData.length\n \"\n [style.--str-chat__wave-progress-bar__amplitude-bar-height]=\"\n dataPoint ? dataPoint * 100 + '%' : '0%'\n \"\n ></div>\n <div\n class=\"str-chat__wave-progress-bar__progress-indicator\"\n data-testid=\"wave-progress-bar-progress-indicator\"\n [ngStyle]=\"{ 'inset-inline-start': progress * 100 + '%' }\"\n ></div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
4677
4740
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: VoiceRecordingWavebarComponent, decorators: [{
|
|
4678
4741
|
type: Component,
|
|
4679
4742
|
args: [{ selector: 'stream-voice-recording-wavebar', template: "<!--eslint-disable @angular-eslint/template/click-events-have-key-events-->\n<div\n #container\n class=\"str-chat__wave-progress-bar__track\"\n data-testid=\"wave-progress-bar-track\"\n role=\"progressbar\"\n (mousedown)=\"isDragging = true\"\n (mouseup)=\"isDragging = false\"\n (mouseleave)=\"isDragging = false\"\n (mousemove)=\"isDragging ? seek($event) : null\"\n (click)=\"seek($event)\"\n>\n <!--eslint-enable @angular-eslint/template/click-events-have-key-events-->\n <div\n *ngFor=\"\n let dataPoint of resampledWaveFormData;\n let i = index;\n trackBy: trackByIndex\n \"\n class=\"str-chat__wave-progress-bar__amplitude-bar\"\n [class.str-chat__wave-progress-bar__amplitude-bar--active]=\"\n progress > i / resampledWaveFormData.length\n \"\n [style.--str-chat__wave-progress-bar__amplitude-bar-height]=\"\n dataPoint ? dataPoint * 100 + '%' : '0%'\n \"\n ></div>\n <div\n class=\"str-chat__wave-progress-bar__progress-indicator\"\n data-testid=\"wave-progress-bar-progress-indicator\"\n [ngStyle]=\"{ 'inset-inline-start': progress * 100 + '%' }\"\n ></div>\n</div>\n" }]
|
|
@@ -4760,7 +4823,7 @@ class VoiceRecordingComponent {
|
|
|
4760
4823
|
}
|
|
4761
4824
|
}
|
|
4762
4825
|
VoiceRecordingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: VoiceRecordingComponent, deps: [{ token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
4763
|
-
VoiceRecordingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: VoiceRecordingComponent, selector: "stream-voice-recording", inputs: { attachment: "attachment" }, viewQueries: [{ propertyName: "audioElement", first: true, predicate: ["audioElement"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"str-chat__message-attachment__voice-recording-widget\"\n data-testid=\"voice-recording-widget\"\n [class.str-chat__message-attachment__voice-recording-widget--error]=\"isError\"\n>\n <!-- Empty event handlers to trigger change detection -->\n <audio\n #audioElement\n (play)=\"(null)\"\n (pause)=\"(null)\"\n (ended)=\"(null)\"\n (error)=\"isError = true\"\n (abort)=\"isError = true\"\n >\n <source\n data-testid=\"audio-source\"\n [src]=\"attachment?.asset_url\"\n [type]=\"attachment?.mime_type\"\n />\n </audio>\n <button\n class=\"str-chat__message-attachment-audio-widget--play-button\"\n data-testid=\"play-button\"\n (click)=\"togglePlay()\"\n >\n <stream-icon-placeholder\n [icon]=\"audioElement?.paused ? 'play' : 'pause'\"\n ></stream-icon-placeholder>\n </button>\n <div class=\"str-chat__message-attachment__voice-recording-widget__metadata\">\n <div class=\"str-chat__message-attachment-voice-recording-widget--first-row\">\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__title\"\n data-testid=\"voice-recording-title\"\n [title]=\"attachment?.title\"\n >\n {{ attachment?.title }}\n </div>\n </div>\n\n <ng-container *ngIf=\"isError; else state\">\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__error-message\"\n >\n <stream-icon-placeholder icon=\"error\"></stream-icon-placeholder>\n <span data-testid=\"error-message\">{{\n \"streamChat.Error playing audio\" | translate\n }}</span>\n </div>\n </ng-container>\n <ng-template #state>\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__audio-state\"\n >\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__timer\"\n >\n <span\n *ngIf=\"!!attachment?.duration; else fileSizeTemplate\"\n data-testid=\"duration\"\n >\n {{\n secondsElapsed > 0 || !audioElement.paused\n ? secondsElapsedFormatted\n : durationFormatted\n }}</span\n >\n <ng-template #fileSizeTemplate>\n <span\n class=\"str-chat__message-attachment-file--item-size\"\n data-testid=\"file-size-indicator\"\n >\n {{ fileSize }}\n </span>\n </ng-template>\n </div>\n <stream-voice-recording-wavebar\n *ngIf=\"attachment?.waveform_data && attachment?.duration\"\n [waveFormData]=\"attachment?.waveform_data || []\"\n [duration]=\"attachment?.duration\"\n [audioElement]=\"audioElement\"\n ></stream-voice-recording-wavebar>\n </div>\n </ng-template>\n </div>\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__right-section\"\n >\n <button\n *ngIf=\"!audioElement?.paused; else fileIcon\"\n class=\"str-chat__message_attachment__playback-rate-button\"\n data-testid=\"playback-rate-button\"\n (click)=\"setPlaybackRate()\"\n >\n {{ audioElement?.playbackRate | number : \"1.1-1\" }}x\n </button>\n <ng-template #fileIcon>\n <stream-icon-placeholder\n class=\"str-chat__attachment-type-icon\"\n icon=\"audio-file\"\n ></stream-icon-placeholder>\n </ng-template>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type:
|
|
4826
|
+
VoiceRecordingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: VoiceRecordingComponent, selector: "stream-voice-recording", inputs: { attachment: "attachment" }, viewQueries: [{ propertyName: "audioElement", first: true, predicate: ["audioElement"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"str-chat__message-attachment__voice-recording-widget\"\n data-testid=\"voice-recording-widget\"\n [class.str-chat__message-attachment__voice-recording-widget--error]=\"isError\"\n>\n <!-- Empty event handlers to trigger change detection -->\n <audio\n #audioElement\n (play)=\"(null)\"\n (pause)=\"(null)\"\n (ended)=\"(null)\"\n (error)=\"isError = true\"\n (abort)=\"isError = true\"\n >\n <source\n data-testid=\"audio-source\"\n [src]=\"attachment?.asset_url\"\n [type]=\"attachment?.mime_type\"\n />\n </audio>\n <button\n class=\"str-chat__message-attachment-audio-widget--play-button\"\n data-testid=\"play-button\"\n (click)=\"togglePlay()\"\n >\n <stream-icon-placeholder\n [icon]=\"audioElement?.paused ? 'play' : 'pause'\"\n ></stream-icon-placeholder>\n </button>\n <div class=\"str-chat__message-attachment__voice-recording-widget__metadata\">\n <div class=\"str-chat__message-attachment-voice-recording-widget--first-row\">\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__title\"\n data-testid=\"voice-recording-title\"\n [title]=\"attachment?.title\"\n >\n {{ attachment?.title }}\n </div>\n </div>\n\n <ng-container *ngIf=\"isError; else state\">\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__error-message\"\n >\n <stream-icon-placeholder icon=\"error\"></stream-icon-placeholder>\n <span data-testid=\"error-message\">{{\n \"streamChat.Error playing audio\" | translate\n }}</span>\n </div>\n </ng-container>\n <ng-template #state>\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__audio-state\"\n >\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__timer\"\n >\n <span\n *ngIf=\"!!attachment?.duration; else fileSizeTemplate\"\n data-testid=\"duration\"\n >\n {{\n secondsElapsed > 0 || !audioElement.paused\n ? secondsElapsedFormatted\n : durationFormatted\n }}</span\n >\n <ng-template #fileSizeTemplate>\n <span\n class=\"str-chat__message-attachment-file--item-size\"\n data-testid=\"file-size-indicator\"\n >\n {{ fileSize }}\n </span>\n </ng-template>\n </div>\n <stream-voice-recording-wavebar\n *ngIf=\"attachment?.waveform_data && attachment?.duration\"\n [waveFormData]=\"attachment?.waveform_data || []\"\n [duration]=\"attachment?.duration\"\n [audioElement]=\"audioElement\"\n ></stream-voice-recording-wavebar>\n </div>\n </ng-template>\n </div>\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__right-section\"\n >\n <button\n *ngIf=\"!audioElement?.paused; else fileIcon\"\n class=\"str-chat__message_attachment__playback-rate-button\"\n data-testid=\"playback-rate-button\"\n (click)=\"setPlaybackRate()\"\n >\n {{ audioElement?.playbackRate | number : \"1.1-1\" }}x\n </button>\n <ng-template #fileIcon>\n <stream-icon-placeholder\n class=\"str-chat__attachment-type-icon\"\n icon=\"audio-file\"\n ></stream-icon-placeholder>\n </ng-template>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "component", type: VoiceRecordingWavebarComponent, selector: "stream-voice-recording-wavebar", inputs: ["audioElement", "waveFormData", "duration"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
4764
4827
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: VoiceRecordingComponent, decorators: [{
|
|
4765
4828
|
type: Component,
|
|
4766
4829
|
args: [{ selector: 'stream-voice-recording', template: "<div\n class=\"str-chat__message-attachment__voice-recording-widget\"\n data-testid=\"voice-recording-widget\"\n [class.str-chat__message-attachment__voice-recording-widget--error]=\"isError\"\n>\n <!-- Empty event handlers to trigger change detection -->\n <audio\n #audioElement\n (play)=\"(null)\"\n (pause)=\"(null)\"\n (ended)=\"(null)\"\n (error)=\"isError = true\"\n (abort)=\"isError = true\"\n >\n <source\n data-testid=\"audio-source\"\n [src]=\"attachment?.asset_url\"\n [type]=\"attachment?.mime_type\"\n />\n </audio>\n <button\n class=\"str-chat__message-attachment-audio-widget--play-button\"\n data-testid=\"play-button\"\n (click)=\"togglePlay()\"\n >\n <stream-icon-placeholder\n [icon]=\"audioElement?.paused ? 'play' : 'pause'\"\n ></stream-icon-placeholder>\n </button>\n <div class=\"str-chat__message-attachment__voice-recording-widget__metadata\">\n <div class=\"str-chat__message-attachment-voice-recording-widget--first-row\">\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__title\"\n data-testid=\"voice-recording-title\"\n [title]=\"attachment?.title\"\n >\n {{ attachment?.title }}\n </div>\n </div>\n\n <ng-container *ngIf=\"isError; else state\">\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__error-message\"\n >\n <stream-icon-placeholder icon=\"error\"></stream-icon-placeholder>\n <span data-testid=\"error-message\">{{\n \"streamChat.Error playing audio\" | translate\n }}</span>\n </div>\n </ng-container>\n <ng-template #state>\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__audio-state\"\n >\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__timer\"\n >\n <span\n *ngIf=\"!!attachment?.duration; else fileSizeTemplate\"\n data-testid=\"duration\"\n >\n {{\n secondsElapsed > 0 || !audioElement.paused\n ? secondsElapsedFormatted\n : durationFormatted\n }}</span\n >\n <ng-template #fileSizeTemplate>\n <span\n class=\"str-chat__message-attachment-file--item-size\"\n data-testid=\"file-size-indicator\"\n >\n {{ fileSize }}\n </span>\n </ng-template>\n </div>\n <stream-voice-recording-wavebar\n *ngIf=\"attachment?.waveform_data && attachment?.duration\"\n [waveFormData]=\"attachment?.waveform_data || []\"\n [duration]=\"attachment?.duration\"\n [audioElement]=\"audioElement\"\n ></stream-voice-recording-wavebar>\n </div>\n </ng-template>\n </div>\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__right-section\"\n >\n <button\n *ngIf=\"!audioElement?.paused; else fileIcon\"\n class=\"str-chat__message_attachment__playback-rate-button\"\n data-testid=\"playback-rate-button\"\n (click)=\"setPlaybackRate()\"\n >\n {{ audioElement?.playbackRate | number : \"1.1-1\" }}x\n </button>\n <ng-template #fileIcon>\n <stream-icon-placeholder\n class=\"str-chat__attachment-type-icon\"\n icon=\"audio-file\"\n ></stream-icon-placeholder>\n </ng-template>\n </div>\n</div>\n" }]
|
|
@@ -4971,7 +5034,7 @@ class AttachmentListComponent {
|
|
|
4971
5034
|
}
|
|
4972
5035
|
}
|
|
4973
5036
|
AttachmentListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AttachmentListComponent, deps: [{ token: CustomTemplatesService }, { token: ChannelService }, { token: AttachmentConfigurationService }, { token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4974
|
-
AttachmentListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AttachmentListComponent, selector: "stream-attachment-list", inputs: { messageId: "messageId", parentMessageId: "parentMessageId", attachments: "attachments" }, outputs: { imageModalStateChange: "imageModalStateChange" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "modalContent", first: true, predicate: ["modalContent"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div\n *ngIf=\"\n orderedAttachments.length > 0 ||\n (customAttachments.length > 0 && customAttachmentsTemplate)\n \"\n class=\"str-chat__attachment-list\"\n>\n <ng-container\n *ngFor=\"let attachment of orderedAttachments; trackBy: trackByUrl\"\n >\n <div\n data-testclass=\"attachment-container\"\n class=\"str-chat__message-attachment str-chat__message-attachment--{{\n attachment.type\n }} str-chat__message-attachment-dynamic-size\"\n [class.str-chat__message-attachment--card]=\"isCard(attachment)\"\n [class.str-chat-angular__message-attachment-file-single]=\"\n isFile(attachment)\n \"\n [class.str-chat__message-attachment--voice-recording]=\"\n isVoiceMessage(attachment)\n \"\n [class.str-chat__message-attachment-with-actions]=\"\n !isGalleryType(attachment) &&\n attachment.actions &&\n attachment.actions.length > 0\n \"\n [class.str-chat__message-attachment--svg-image]=\"isSvg(attachment)\"\n >\n <ng-container *ngIf=\"isImage(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.imageAttachmentTemplate$ | async) ||\n defaultImage;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultImage let-attachmentContext=\"attachment\">\n <img\n #imgElement\n class=\"str-chat__message-attachment--img\"\n data-testclass=\"image\"\n [src]=\"\n getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).url\n \"\n [alt]=\"attachmentContext?.fallback\"\n [ngStyle]=\"{\n height: getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).height,\n width: getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).width,\n '--original-height': getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).originalHeight,\n '--original-width': getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).originalWidth\n }\"\n (click)=\"openImageModal([attachmentContext])\"\n (keyup.enter)=\"openImageModal([attachmentContext])\"\n />\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isGallery(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.galleryAttachmentTemplate$ | async) ||\n defaultGallery;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultGallery let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__gallery\"\n data-testid=\"image-gallery\"\n [class.str-chat__gallery--square]=\"\n (attachmentContext?.images)!.length > 3\n \"\n [class.str-chat__gallery-two-rows]=\"\n (attachmentContext?.images)!.length > 2\n \"\n >\n <ng-container\n *ngFor=\"\n let galleryImage of attachmentContext.images;\n let index = index;\n let isLast = last;\n trackBy: trackByImageUrl\n \"\n >\n <button\n *ngIf=\"index < 3 || (index === 3 && isLast)\"\n class=\"str-chat__gallery-image\"\n data-testclass=\"gallery-image\"\n [class.str-chat__message-attachment--svg-image]=\"\n isSvg(galleryImage)\n \"\n (click)=\"openImageModal(attachmentContext.images!, index)\"\n (keyup.enter)=\"openImageModal(attachmentContext.images!, index)\"\n >\n <img\n #imgElement\n fetchpriority=\"low\"\n loading=\"lazy\"\n [src]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).url\n \"\n [alt]=\"galleryImage.fallback\"\n [style.--original-height]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).originalHeight\n \"\n [style.--original-width]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).originalWidth\n \"\n [ngStyle]=\"{\n height: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).height,\n width: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).width\n }\"\n />\n </button>\n <button\n *ngIf=\"index === 3 && !isLast\"\n #element\n class=\"str-chat__gallery-placeholder\"\n data-testclass=\"gallery-image\"\n data-testid=\"more-image-button\"\n [class.str-chat__message-attachment--svg-image]=\"\n isSvg(galleryImage)\n \"\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).url +\n ')',\n height: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).height,\n width: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).width,\n '--original-height': getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).originalHeight,\n '--original-width': getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).originalWidth\n }\"\n (click)=\"openImageModal(attachmentContext.images!, index)\"\n (keyup.enter)=\"openImageModal(attachmentContext.images!, index)\"\n >\n <p\n [innerHTML]=\"\n 'streamChat.{{ imageCount }} more'\n | translate\n : { imageCount: attachmentContext!.images!.length - 4 }\n \"\n ></p>\n </button>\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isVideo(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.videoAttachmentTemplate$ | async) ||\n defaultVideo;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultVideo let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__player-wrapper\"\n data-testclass=\"video-attachment-parent\"\n [style.--original-height]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .originalHeight\n \"\n [style.--original-width]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .originalWidth\n \"\n [ngStyle]=\"{\n height: getVideoAttachmentConfiguration(\n attachmentContext,\n videoElement\n ).height,\n width: getVideoAttachmentConfiguration(\n attachmentContext,\n videoElement\n ).width\n }\"\n >\n <video\n #videoElement\n class=\"str-chat__video-angular\"\n controls\n data-testclass=\"video-attachment\"\n [src]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .url\n \"\n [poster]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .thumbUrl\n \"\n ></video>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isFile(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.fileAttachmentTemplate$ | async) ||\n defaultFile;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultFile let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__message-attachment-file--item str-chat-angular__message-attachment-file-single\"\n >\n <stream-icon-placeholder\n class=\"str-chat__attachment-type-icon\"\n icon=\"unspecified-filetype\"\n ></stream-icon-placeholder>\n <div class=\"str-chat__message-attachment-file--item-text\">\n <a\n class=\"str-chat__message-attachment-file--item-first-row\"\n data-testclass=\"file-link\"\n target=\"_blank\"\n href=\"{{ attachmentContext.asset_url }}\"\n >\n <div\n data-testclass=\"file-title\"\n class=\"str-chat__message-attachment-file--item-name\"\n >\n {{ attachmentContext.title }}\n </div>\n <stream-icon-placeholder\n class=\"str-chat__message-attachment-download-icon\"\n icon=\"download\"\n ></stream-icon-placeholder>\n </a>\n <span\n *ngIf=\"hasFileSize(attachmentContext)\"\n class=\"str-chat__message-attachment-file--item-size\"\n data-testclass=\"size\"\n >{{ getFileSize(attachmentContext) }}</span\n >\n </div>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isVoiceMessage(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.voiceRecordingAttachmentTemplate$\n | async) || defaultRecording;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultRecording>\n <stream-voice-recording\n data-testclass=\"voice-recording\"\n [attachment]=\"attachment\"\n ></stream-voice-recording>\n </ng-template>\n </ng-container>\n <ng-container\n *ngIf=\"\n isCard(attachment) &&\n getCardAttachmentConfiguration(attachment) as attachmentConfiguration\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.cardAttachmentTemplate$ | async) ||\n defaultCard;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultCard let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__message-attachment-card str-chat__message-attachment-card--{{\n attachmentContext.type\n }}\"\n >\n <div\n *ngIf=\"attachmentConfiguration.url\"\n class=\"str-chat__message-attachment-card--header\"\n >\n <a\n *ngIf=\"attachmentContext.type === 'video'; else cardImage\"\n [href]=\"\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n \"\n target=\"_blank\"\n data-testclass=\"scraped-video\"\n >\n <ng-content *ngTemplateOutlet=\"cardImage\"></ng-content>\n <div\n class=\"str-chat__message-attachment-card--video-play\"\n ></div>\n <stream-icon-placeholder icon=\"play\"></stream-icon-placeholder>\n </a>\n <ng-template #cardImage>\n <img\n fetchpriority=\"low\"\n loading=\"lazy\"\n data-testclass=\"card-img\"\n alt=\"{{ attachmentConfiguration.url }}\"\n src=\"{{ attachmentConfiguration.url }}\"\n [ngStyle]=\"{\n height: attachmentConfiguration.height,\n width: attachmentConfiguration.width\n }\"\n />\n </ng-template>\n </div>\n <div class=\"str-chat__message-attachment-card--content\">\n <div class=\"str-chat__message-attachment-card--flex\">\n <div\n *ngIf=\"attachmentContext.title\"\n data-testclass=\"card-title\"\n class=\"str-chat__message-attachment-card--title\"\n >\n {{ attachmentContext.title }}\n </div>\n <div\n *ngIf=\"attachmentContext.text\"\n class=\"str-chat__message-attachment-card--text\"\n data-testclass=\"card-text\"\n >\n {{ attachmentContext.text }}\n </div>\n <a\n *ngIf=\"\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n \"\n class=\"str-chat__message-attachment-card--url\"\n data-testclass=\"url-link\"\n noopener\n noreferrer\n target=\"_blank\"\n href=\"{{\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n }}\"\n >\n {{\n trimUrl(\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n )\n }}\n </a>\n </div>\n </div>\n </div>\n </ng-template>\n </ng-container>\n <ng-container\n *ngIf=\"\n !isGalleryType(attachment) &&\n attachment.actions &&\n attachment.actions.length > 0\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentActionsTemplate$ | async) ||\n defaultActions;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultActions let-attachmentContext=\"attachment\">\n <div class=\"str-chat__message-attachment-actions\">\n <div class=\"str-chat__message-attachment-actions-form\">\n <button\n *ngFor=\"\n let action of attachmentContext.actions;\n trackBy: trackByActionValue\n \"\n data-testclass=\"attachment-action\"\n class=\"str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--{{\n action.style\n }}\"\n (click)=\"sendAction(action)\"\n (keyup.enter)=\"sendAction(action)\"\n >\n {{ action.text }}\n </button>\n </div>\n </div>\n </ng-template>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"customAttachmentsTemplate\">\n <ng-template\n *ngTemplateOutlet=\"\n customAttachmentsTemplate;\n context: {\n messageId: messageId,\n parentMessageId: parentMessageId,\n attachments: customAttachments\n }\n \"\n ></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"imagesToView && imagesToView.length > 0\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n </ng-container>\n</div>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"stream-chat-angular__image-modal-host\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div class=\"stream-chat-angular__image-modal str-chat__image-carousel\">\n <img\n #imgElement\n class=\"stream-chat-angular__image-modal-image str-chat__image-carousel-image\"\n data-testid=\"modal-image\"\n [src]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).url\n \"\n [style.--original-height]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).originalHeight\n \"\n [style.--original-width]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).originalWidth\n \"\n [alt]=\"imagesToView[imagesToViewCurrentIndex].fallback\"\n [ngStyle]=\"{\n width: getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).width,\n height: getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).height\n }\"\n />\n <div>\n <button\n class=\"stream-chat-angular__image-modal-stepper str-chat__image-carousel-stepper str-chat__image-carousel-stepper-prev\"\n data-testid=\"image-modal-prev\"\n type=\"button\"\n [ngStyle]=\"{\n visibility: isImageModalPrevButtonVisible ? 'visible' : 'hidden'\n }\"\n (click)=\"stepImages(-1)\"\n (keyup.enter)=\"stepImages(-1)\"\n >\n <stream-icon-placeholder icon=\"arrow-left\"></stream-icon-placeholder>\n </button>\n <button\n class=\"stream-chat-angular__image-modal-stepper str-chat__image-carousel-stepper str-chat__image-carousel-stepper-next\"\n type=\"button\"\n data-testid=\"image-modal-next\"\n [ngStyle]=\"{\n visibility: isImageModalNextButtonVisible ? 'visible' : 'hidden'\n }\"\n (click)=\"stepImages(1)\"\n (keyup.enter)=\"stepImages(1)\"\n >\n <stream-icon-placeholder icon=\"arrow-right\"></stream-icon-placeholder>\n </button>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: VoiceRecordingComponent, selector: "stream-voice-recording", inputs: ["attachment"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "component", type: ModalComponent, selector: "stream-modal", inputs: ["isOpen", "content"], outputs: ["isOpenChange"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
5037
|
+
AttachmentListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AttachmentListComponent, selector: "stream-attachment-list", inputs: { messageId: "messageId", parentMessageId: "parentMessageId", attachments: "attachments" }, outputs: { imageModalStateChange: "imageModalStateChange" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "modalContent", first: true, predicate: ["modalContent"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div\n *ngIf=\"\n orderedAttachments.length > 0 ||\n (customAttachments.length > 0 && customAttachmentsTemplate)\n \"\n class=\"str-chat__attachment-list\"\n>\n <ng-container\n *ngFor=\"let attachment of orderedAttachments; trackBy: trackByUrl\"\n >\n <div\n data-testclass=\"attachment-container\"\n class=\"str-chat__message-attachment str-chat__message-attachment--{{\n attachment.type\n }} str-chat__message-attachment-dynamic-size\"\n [class.str-chat__message-attachment--card]=\"isCard(attachment)\"\n [class.str-chat-angular__message-attachment-file-single]=\"\n isFile(attachment)\n \"\n [class.str-chat__message-attachment--voice-recording]=\"\n isVoiceMessage(attachment)\n \"\n [class.str-chat__message-attachment-with-actions]=\"\n !isGalleryType(attachment) &&\n attachment.actions &&\n attachment.actions.length > 0\n \"\n [class.str-chat__message-attachment--svg-image]=\"isSvg(attachment)\"\n >\n <ng-container *ngIf=\"isImage(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.imageAttachmentTemplate$ | async) ||\n defaultImage;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultImage let-attachmentContext=\"attachment\">\n <img\n #imgElement\n class=\"str-chat__message-attachment--img\"\n data-testclass=\"image\"\n [src]=\"\n getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).url\n \"\n [alt]=\"attachmentContext?.fallback\"\n [ngStyle]=\"{\n height: getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).height,\n width: getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).width,\n '--original-height': getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).originalHeight,\n '--original-width': getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).originalWidth\n }\"\n (click)=\"openImageModal([attachmentContext])\"\n (keyup.enter)=\"openImageModal([attachmentContext])\"\n />\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isGallery(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.galleryAttachmentTemplate$ | async) ||\n defaultGallery;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultGallery let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__gallery\"\n data-testid=\"image-gallery\"\n [class.str-chat__gallery--square]=\"\n (attachmentContext?.images)!.length > 3\n \"\n [class.str-chat__gallery-two-rows]=\"\n (attachmentContext?.images)!.length > 2\n \"\n >\n <ng-container\n *ngFor=\"\n let galleryImage of attachmentContext.images;\n let index = index;\n let isLast = last;\n trackBy: trackByImageUrl\n \"\n >\n <button\n *ngIf=\"index < 3 || (index === 3 && isLast)\"\n class=\"str-chat__gallery-image\"\n data-testclass=\"gallery-image\"\n [class.str-chat__message-attachment--svg-image]=\"\n isSvg(galleryImage)\n \"\n (click)=\"openImageModal(attachmentContext.images!, index)\"\n (keyup.enter)=\"openImageModal(attachmentContext.images!, index)\"\n >\n <img\n #imgElement\n fetchpriority=\"low\"\n loading=\"lazy\"\n [src]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).url\n \"\n [alt]=\"galleryImage.fallback\"\n [style.--original-height]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).originalHeight\n \"\n [style.--original-width]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).originalWidth\n \"\n [ngStyle]=\"{\n height: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).height,\n width: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).width\n }\"\n />\n </button>\n <button\n *ngIf=\"index === 3 && !isLast\"\n #element\n class=\"str-chat__gallery-placeholder\"\n data-testclass=\"gallery-image\"\n data-testid=\"more-image-button\"\n [class.str-chat__message-attachment--svg-image]=\"\n isSvg(galleryImage)\n \"\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).url +\n ')',\n height: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).height,\n width: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).width,\n '--original-height': getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).originalHeight,\n '--original-width': getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).originalWidth\n }\"\n (click)=\"openImageModal(attachmentContext.images!, index)\"\n (keyup.enter)=\"openImageModal(attachmentContext.images!, index)\"\n >\n <p\n [innerHTML]=\"\n 'streamChat.{{ imageCount }} more'\n | translate\n : { imageCount: attachmentContext!.images!.length - 4 }\n \"\n ></p>\n </button>\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isVideo(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.videoAttachmentTemplate$ | async) ||\n defaultVideo;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultVideo let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__player-wrapper\"\n data-testclass=\"video-attachment-parent\"\n [style.--original-height]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .originalHeight\n \"\n [style.--original-width]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .originalWidth\n \"\n [ngStyle]=\"{\n height: getVideoAttachmentConfiguration(\n attachmentContext,\n videoElement\n ).height,\n width: getVideoAttachmentConfiguration(\n attachmentContext,\n videoElement\n ).width\n }\"\n >\n <video\n #videoElement\n class=\"str-chat__video-angular\"\n controls\n data-testclass=\"video-attachment\"\n [src]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .url\n \"\n [poster]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .thumbUrl\n \"\n ></video>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isFile(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.fileAttachmentTemplate$ | async) ||\n defaultFile;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultFile let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__message-attachment-file--item str-chat-angular__message-attachment-file-single\"\n >\n <stream-icon-placeholder\n class=\"str-chat__attachment-type-icon\"\n icon=\"unspecified-filetype\"\n ></stream-icon-placeholder>\n <div class=\"str-chat__message-attachment-file--item-text\">\n <a\n class=\"str-chat__message-attachment-file--item-first-row\"\n data-testclass=\"file-link\"\n target=\"_blank\"\n href=\"{{ attachmentContext.asset_url }}\"\n >\n <div\n data-testclass=\"file-title\"\n class=\"str-chat__message-attachment-file--item-name\"\n >\n {{ attachmentContext.title }}\n </div>\n <stream-icon-placeholder\n class=\"str-chat__message-attachment-download-icon\"\n icon=\"download\"\n ></stream-icon-placeholder>\n </a>\n <span\n *ngIf=\"hasFileSize(attachmentContext)\"\n class=\"str-chat__message-attachment-file--item-size\"\n data-testclass=\"size\"\n >{{ getFileSize(attachmentContext) }}</span\n >\n </div>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isVoiceMessage(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.voiceRecordingAttachmentTemplate$\n | async) || defaultRecording;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultRecording>\n <stream-voice-recording\n data-testclass=\"voice-recording\"\n [attachment]=\"attachment\"\n ></stream-voice-recording>\n </ng-template>\n </ng-container>\n <ng-container\n *ngIf=\"\n isCard(attachment) &&\n getCardAttachmentConfiguration(attachment) as attachmentConfiguration\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.cardAttachmentTemplate$ | async) ||\n defaultCard;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultCard let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__message-attachment-card str-chat__message-attachment-card--{{\n attachmentContext.type\n }}\"\n >\n <div\n *ngIf=\"attachmentConfiguration.url\"\n class=\"str-chat__message-attachment-card--header\"\n >\n <a\n *ngIf=\"attachmentContext.type === 'video'; else cardImage\"\n [href]=\"\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n \"\n target=\"_blank\"\n data-testclass=\"scraped-video\"\n >\n <ng-content *ngTemplateOutlet=\"cardImage\"></ng-content>\n <div\n class=\"str-chat__message-attachment-card--video-play\"\n ></div>\n <stream-icon-placeholder icon=\"play\"></stream-icon-placeholder>\n </a>\n <ng-template #cardImage>\n <img\n fetchpriority=\"low\"\n loading=\"lazy\"\n data-testclass=\"card-img\"\n alt=\"{{ attachmentConfiguration.url }}\"\n src=\"{{ attachmentConfiguration.url }}\"\n [ngStyle]=\"{\n height: attachmentConfiguration.height,\n width: attachmentConfiguration.width\n }\"\n />\n </ng-template>\n </div>\n <div class=\"str-chat__message-attachment-card--content\">\n <div class=\"str-chat__message-attachment-card--flex\">\n <div\n *ngIf=\"attachmentContext.title\"\n data-testclass=\"card-title\"\n class=\"str-chat__message-attachment-card--title\"\n >\n {{ attachmentContext.title }}\n </div>\n <div\n *ngIf=\"attachmentContext.text\"\n class=\"str-chat__message-attachment-card--text\"\n data-testclass=\"card-text\"\n >\n {{ attachmentContext.text }}\n </div>\n <a\n *ngIf=\"\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n \"\n class=\"str-chat__message-attachment-card--url\"\n data-testclass=\"url-link\"\n noopener\n noreferrer\n target=\"_blank\"\n href=\"{{\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n }}\"\n >\n {{\n trimUrl(\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n )\n }}\n </a>\n </div>\n </div>\n </div>\n </ng-template>\n </ng-container>\n <ng-container\n *ngIf=\"\n !isGalleryType(attachment) &&\n attachment.actions &&\n attachment.actions.length > 0\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentActionsTemplate$ | async) ||\n defaultActions;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultActions let-attachmentContext=\"attachment\">\n <div class=\"str-chat__message-attachment-actions\">\n <div class=\"str-chat__message-attachment-actions-form\">\n <button\n *ngFor=\"\n let action of attachmentContext.actions;\n trackBy: trackByActionValue\n \"\n data-testclass=\"attachment-action\"\n class=\"str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--{{\n action.style\n }}\"\n (click)=\"sendAction(action)\"\n (keyup.enter)=\"sendAction(action)\"\n >\n {{ action.text }}\n </button>\n </div>\n </div>\n </ng-template>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"customAttachmentsTemplate\">\n <ng-template\n *ngTemplateOutlet=\"\n customAttachmentsTemplate;\n context: {\n messageId: messageId,\n parentMessageId: parentMessageId,\n attachments: customAttachments\n }\n \"\n ></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"imagesToView && imagesToView.length > 0\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n </ng-container>\n</div>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"stream-chat-angular__image-modal-host\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div class=\"stream-chat-angular__image-modal str-chat__image-carousel\">\n <img\n #imgElement\n class=\"stream-chat-angular__image-modal-image str-chat__image-carousel-image\"\n data-testid=\"modal-image\"\n [src]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).url\n \"\n [style.--original-height]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).originalHeight\n \"\n [style.--original-width]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).originalWidth\n \"\n [alt]=\"imagesToView[imagesToViewCurrentIndex].fallback\"\n [ngStyle]=\"{\n width: getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).width,\n height: getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).height\n }\"\n />\n <div>\n <button\n class=\"stream-chat-angular__image-modal-stepper str-chat__image-carousel-stepper str-chat__image-carousel-stepper-prev\"\n data-testid=\"image-modal-prev\"\n type=\"button\"\n [ngStyle]=\"{\n visibility: isImageModalPrevButtonVisible ? 'visible' : 'hidden'\n }\"\n (click)=\"stepImages(-1)\"\n (keyup.enter)=\"stepImages(-1)\"\n >\n <stream-icon-placeholder icon=\"arrow-left\"></stream-icon-placeholder>\n </button>\n <button\n class=\"stream-chat-angular__image-modal-stepper str-chat__image-carousel-stepper str-chat__image-carousel-stepper-next\"\n type=\"button\"\n data-testid=\"image-modal-next\"\n [ngStyle]=\"{\n visibility: isImageModalNextButtonVisible ? 'visible' : 'hidden'\n }\"\n (click)=\"stepImages(1)\"\n (keyup.enter)=\"stepImages(1)\"\n >\n <stream-icon-placeholder icon=\"arrow-right\"></stream-icon-placeholder>\n </button>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: VoiceRecordingComponent, selector: "stream-voice-recording", inputs: ["attachment"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "component", type: ModalComponent, selector: "stream-modal", inputs: ["isOpen", "content"], outputs: ["isOpenChange"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
4975
5038
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AttachmentListComponent, decorators: [{
|
|
4976
5039
|
type: Component,
|
|
4977
5040
|
args: [{ selector: 'stream-attachment-list', template: "<div\n *ngIf=\"\n orderedAttachments.length > 0 ||\n (customAttachments.length > 0 && customAttachmentsTemplate)\n \"\n class=\"str-chat__attachment-list\"\n>\n <ng-container\n *ngFor=\"let attachment of orderedAttachments; trackBy: trackByUrl\"\n >\n <div\n data-testclass=\"attachment-container\"\n class=\"str-chat__message-attachment str-chat__message-attachment--{{\n attachment.type\n }} str-chat__message-attachment-dynamic-size\"\n [class.str-chat__message-attachment--card]=\"isCard(attachment)\"\n [class.str-chat-angular__message-attachment-file-single]=\"\n isFile(attachment)\n \"\n [class.str-chat__message-attachment--voice-recording]=\"\n isVoiceMessage(attachment)\n \"\n [class.str-chat__message-attachment-with-actions]=\"\n !isGalleryType(attachment) &&\n attachment.actions &&\n attachment.actions.length > 0\n \"\n [class.str-chat__message-attachment--svg-image]=\"isSvg(attachment)\"\n >\n <ng-container *ngIf=\"isImage(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.imageAttachmentTemplate$ | async) ||\n defaultImage;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultImage let-attachmentContext=\"attachment\">\n <img\n #imgElement\n class=\"str-chat__message-attachment--img\"\n data-testclass=\"image\"\n [src]=\"\n getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).url\n \"\n [alt]=\"attachmentContext?.fallback\"\n [ngStyle]=\"{\n height: getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).height,\n width: getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).width,\n '--original-height': getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).originalHeight,\n '--original-width': getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).originalWidth\n }\"\n (click)=\"openImageModal([attachmentContext])\"\n (keyup.enter)=\"openImageModal([attachmentContext])\"\n />\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isGallery(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.galleryAttachmentTemplate$ | async) ||\n defaultGallery;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultGallery let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__gallery\"\n data-testid=\"image-gallery\"\n [class.str-chat__gallery--square]=\"\n (attachmentContext?.images)!.length > 3\n \"\n [class.str-chat__gallery-two-rows]=\"\n (attachmentContext?.images)!.length > 2\n \"\n >\n <ng-container\n *ngFor=\"\n let galleryImage of attachmentContext.images;\n let index = index;\n let isLast = last;\n trackBy: trackByImageUrl\n \"\n >\n <button\n *ngIf=\"index < 3 || (index === 3 && isLast)\"\n class=\"str-chat__gallery-image\"\n data-testclass=\"gallery-image\"\n [class.str-chat__message-attachment--svg-image]=\"\n isSvg(galleryImage)\n \"\n (click)=\"openImageModal(attachmentContext.images!, index)\"\n (keyup.enter)=\"openImageModal(attachmentContext.images!, index)\"\n >\n <img\n #imgElement\n fetchpriority=\"low\"\n loading=\"lazy\"\n [src]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).url\n \"\n [alt]=\"galleryImage.fallback\"\n [style.--original-height]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).originalHeight\n \"\n [style.--original-width]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).originalWidth\n \"\n [ngStyle]=\"{\n height: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).height,\n width: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).width\n }\"\n />\n </button>\n <button\n *ngIf=\"index === 3 && !isLast\"\n #element\n class=\"str-chat__gallery-placeholder\"\n data-testclass=\"gallery-image\"\n data-testid=\"more-image-button\"\n [class.str-chat__message-attachment--svg-image]=\"\n isSvg(galleryImage)\n \"\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).url +\n ')',\n height: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).height,\n width: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).width,\n '--original-height': getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).originalHeight,\n '--original-width': getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).originalWidth\n }\"\n (click)=\"openImageModal(attachmentContext.images!, index)\"\n (keyup.enter)=\"openImageModal(attachmentContext.images!, index)\"\n >\n <p\n [innerHTML]=\"\n 'streamChat.{{ imageCount }} more'\n | translate\n : { imageCount: attachmentContext!.images!.length - 4 }\n \"\n ></p>\n </button>\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isVideo(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.videoAttachmentTemplate$ | async) ||\n defaultVideo;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultVideo let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__player-wrapper\"\n data-testclass=\"video-attachment-parent\"\n [style.--original-height]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .originalHeight\n \"\n [style.--original-width]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .originalWidth\n \"\n [ngStyle]=\"{\n height: getVideoAttachmentConfiguration(\n attachmentContext,\n videoElement\n ).height,\n width: getVideoAttachmentConfiguration(\n attachmentContext,\n videoElement\n ).width\n }\"\n >\n <video\n #videoElement\n class=\"str-chat__video-angular\"\n controls\n data-testclass=\"video-attachment\"\n [src]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .url\n \"\n [poster]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .thumbUrl\n \"\n ></video>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isFile(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.fileAttachmentTemplate$ | async) ||\n defaultFile;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultFile let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__message-attachment-file--item str-chat-angular__message-attachment-file-single\"\n >\n <stream-icon-placeholder\n class=\"str-chat__attachment-type-icon\"\n icon=\"unspecified-filetype\"\n ></stream-icon-placeholder>\n <div class=\"str-chat__message-attachment-file--item-text\">\n <a\n class=\"str-chat__message-attachment-file--item-first-row\"\n data-testclass=\"file-link\"\n target=\"_blank\"\n href=\"{{ attachmentContext.asset_url }}\"\n >\n <div\n data-testclass=\"file-title\"\n class=\"str-chat__message-attachment-file--item-name\"\n >\n {{ attachmentContext.title }}\n </div>\n <stream-icon-placeholder\n class=\"str-chat__message-attachment-download-icon\"\n icon=\"download\"\n ></stream-icon-placeholder>\n </a>\n <span\n *ngIf=\"hasFileSize(attachmentContext)\"\n class=\"str-chat__message-attachment-file--item-size\"\n data-testclass=\"size\"\n >{{ getFileSize(attachmentContext) }}</span\n >\n </div>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isVoiceMessage(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.voiceRecordingAttachmentTemplate$\n | async) || defaultRecording;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultRecording>\n <stream-voice-recording\n data-testclass=\"voice-recording\"\n [attachment]=\"attachment\"\n ></stream-voice-recording>\n </ng-template>\n </ng-container>\n <ng-container\n *ngIf=\"\n isCard(attachment) &&\n getCardAttachmentConfiguration(attachment) as attachmentConfiguration\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.cardAttachmentTemplate$ | async) ||\n defaultCard;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultCard let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__message-attachment-card str-chat__message-attachment-card--{{\n attachmentContext.type\n }}\"\n >\n <div\n *ngIf=\"attachmentConfiguration.url\"\n class=\"str-chat__message-attachment-card--header\"\n >\n <a\n *ngIf=\"attachmentContext.type === 'video'; else cardImage\"\n [href]=\"\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n \"\n target=\"_blank\"\n data-testclass=\"scraped-video\"\n >\n <ng-content *ngTemplateOutlet=\"cardImage\"></ng-content>\n <div\n class=\"str-chat__message-attachment-card--video-play\"\n ></div>\n <stream-icon-placeholder icon=\"play\"></stream-icon-placeholder>\n </a>\n <ng-template #cardImage>\n <img\n fetchpriority=\"low\"\n loading=\"lazy\"\n data-testclass=\"card-img\"\n alt=\"{{ attachmentConfiguration.url }}\"\n src=\"{{ attachmentConfiguration.url }}\"\n [ngStyle]=\"{\n height: attachmentConfiguration.height,\n width: attachmentConfiguration.width\n }\"\n />\n </ng-template>\n </div>\n <div class=\"str-chat__message-attachment-card--content\">\n <div class=\"str-chat__message-attachment-card--flex\">\n <div\n *ngIf=\"attachmentContext.title\"\n data-testclass=\"card-title\"\n class=\"str-chat__message-attachment-card--title\"\n >\n {{ attachmentContext.title }}\n </div>\n <div\n *ngIf=\"attachmentContext.text\"\n class=\"str-chat__message-attachment-card--text\"\n data-testclass=\"card-text\"\n >\n {{ attachmentContext.text }}\n </div>\n <a\n *ngIf=\"\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n \"\n class=\"str-chat__message-attachment-card--url\"\n data-testclass=\"url-link\"\n noopener\n noreferrer\n target=\"_blank\"\n href=\"{{\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n }}\"\n >\n {{\n trimUrl(\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n )\n }}\n </a>\n </div>\n </div>\n </div>\n </ng-template>\n </ng-container>\n <ng-container\n *ngIf=\"\n !isGalleryType(attachment) &&\n attachment.actions &&\n attachment.actions.length > 0\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentActionsTemplate$ | async) ||\n defaultActions;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultActions let-attachmentContext=\"attachment\">\n <div class=\"str-chat__message-attachment-actions\">\n <div class=\"str-chat__message-attachment-actions-form\">\n <button\n *ngFor=\"\n let action of attachmentContext.actions;\n trackBy: trackByActionValue\n \"\n data-testclass=\"attachment-action\"\n class=\"str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--{{\n action.style\n }}\"\n (click)=\"sendAction(action)\"\n (keyup.enter)=\"sendAction(action)\"\n >\n {{ action.text }}\n </button>\n </div>\n </div>\n </ng-template>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"customAttachmentsTemplate\">\n <ng-template\n *ngTemplateOutlet=\"\n customAttachmentsTemplate;\n context: {\n messageId: messageId,\n parentMessageId: parentMessageId,\n attachments: customAttachments\n }\n \"\n ></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"imagesToView && imagesToView.length > 0\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n </ng-container>\n</div>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"stream-chat-angular__image-modal-host\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div class=\"stream-chat-angular__image-modal str-chat__image-carousel\">\n <img\n #imgElement\n class=\"stream-chat-angular__image-modal-image str-chat__image-carousel-image\"\n data-testid=\"modal-image\"\n [src]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).url\n \"\n [style.--original-height]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).originalHeight\n \"\n [style.--original-width]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).originalWidth\n \"\n [alt]=\"imagesToView[imagesToViewCurrentIndex].fallback\"\n [ngStyle]=\"{\n width: getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).width,\n height: getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).height\n }\"\n />\n <div>\n <button\n class=\"stream-chat-angular__image-modal-stepper str-chat__image-carousel-stepper str-chat__image-carousel-stepper-prev\"\n data-testid=\"image-modal-prev\"\n type=\"button\"\n [ngStyle]=\"{\n visibility: isImageModalPrevButtonVisible ? 'visible' : 'hidden'\n }\"\n (click)=\"stepImages(-1)\"\n (keyup.enter)=\"stepImages(-1)\"\n >\n <stream-icon-placeholder icon=\"arrow-left\"></stream-icon-placeholder>\n </button>\n <button\n class=\"stream-chat-angular__image-modal-stepper str-chat__image-carousel-stepper str-chat__image-carousel-stepper-next\"\n type=\"button\"\n data-testid=\"image-modal-next\"\n [ngStyle]=\"{\n visibility: isImageModalNextButtonVisible ? 'visible' : 'hidden'\n }\"\n (click)=\"stepImages(1)\"\n (keyup.enter)=\"stepImages(1)\"\n >\n <stream-icon-placeholder icon=\"arrow-right\"></stream-icon-placeholder>\n </button>\n </div>\n </div>\n</ng-template>\n" }]
|
|
@@ -5175,7 +5238,7 @@ class MessageReactionsComponent {
|
|
|
5175
5238
|
}
|
|
5176
5239
|
}
|
|
5177
5240
|
MessageReactionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageReactionsComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: MessageReactionsService }, { token: CustomTemplatesService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5178
|
-
MessageReactionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: { messageId: "messageId", messageReactionGroups: "messageReactionGroups", messageReactionCounts: "messageReactionCounts", latestReactions: "latestReactions", ownReactions: "ownReactions" }, viewQueries: [{ propertyName: "selectorContainer", first: true, predicate: ["selectorContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n *ngIf=\"existingReactions.length > 0\"\n data-testid=\"reaction-list\"\n class=\"str-chat__reaction-list str-chat__message-reactions-container\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n>\n <ul class=\"str-chat__message-reactions\">\n <li\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n class=\"str-chat__message-reaction\"\n data-testclass=\"emoji\"\n [class.str-chat__message-reaction-own]=\"isOwnReaction(reactionType)\"\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 {{ messageReactionGroups?.[reactionType]?.count ?? 0 }}\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 [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\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 *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n class=\"str-chat__message-reactions-details-reaction-type\"\n attr.data-testid=\"reaction-details-selector-{{ reactionType }}\"\n [class.str-chat__message-reactions-details-reaction-type--selected]=\"\n reactionType === selectedReactionType\n \"\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 class=\"str-chat__message-reaction-count\">\n {{ messageReactionGroups?.[reactionType]?.count ?? 0 }}\n </span>\n </div>\n </div>\n <div\n class=\"emoji str-chat__message-reaction-emoji str-chat__message-reaction-emoji-big\"\n >\n {{ getEmojiByReaction(selectedReactionType!) }}\n </div>\n <div\n data-testid=\"all-reacting-users\"\n class=\"str-chat__message-reactions-details-reacting-users\"\n >\n <ng-container\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n >\n <stream-user-list\n attr.data-testid=\"{{ reactionType }}-user-list\"\n [style.display]=\"\n selectedReactionType === reactionType ? 'block' : 'none'\n \"\n [users]=\"usersByReactions[reactionType]?.users || []\"\n [isLoading]=\"isLoading\"\n [hasMore]=\"!!usersByReactions[reactionType]?.next || false\"\n (loadMore)=\"loadNextPageOfReactions()\"\n ></stream-user-list>\n </ng-container>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type:
|
|
5241
|
+
MessageReactionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: { messageId: "messageId", messageReactionGroups: "messageReactionGroups", messageReactionCounts: "messageReactionCounts", latestReactions: "latestReactions", ownReactions: "ownReactions" }, viewQueries: [{ propertyName: "selectorContainer", first: true, predicate: ["selectorContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n *ngIf=\"existingReactions.length > 0\"\n data-testid=\"reaction-list\"\n class=\"str-chat__reaction-list str-chat__message-reactions-container\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n>\n <ul class=\"str-chat__message-reactions\">\n <li\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n class=\"str-chat__message-reaction\"\n data-testclass=\"emoji\"\n [class.str-chat__message-reaction-own]=\"isOwnReaction(reactionType)\"\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 {{ messageReactionGroups?.[reactionType]?.count ?? 0 }}\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 [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\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 *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n class=\"str-chat__message-reactions-details-reaction-type\"\n attr.data-testid=\"reaction-details-selector-{{ reactionType }}\"\n [class.str-chat__message-reactions-details-reaction-type--selected]=\"\n reactionType === selectedReactionType\n \"\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 class=\"str-chat__message-reaction-count\">\n {{ messageReactionGroups?.[reactionType]?.count ?? 0 }}\n </span>\n </div>\n </div>\n <div\n class=\"emoji str-chat__message-reaction-emoji str-chat__message-reaction-emoji-big\"\n >\n {{ getEmojiByReaction(selectedReactionType!) }}\n </div>\n <div\n data-testid=\"all-reacting-users\"\n class=\"str-chat__message-reactions-details-reacting-users\"\n >\n <ng-container\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n >\n <stream-user-list\n attr.data-testid=\"{{ reactionType }}-user-list\"\n [style.display]=\"\n selectedReactionType === reactionType ? 'block' : 'none'\n \"\n [users]=\"usersByReactions[reactionType]?.users || []\"\n [isLoading]=\"isLoading\"\n [hasMore]=\"!!usersByReactions[reactionType]?.next || false\"\n (loadMore)=\"loadNextPageOfReactions()\"\n ></stream-user-list>\n </ng-container>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ModalComponent, selector: "stream-modal", inputs: ["isOpen", "content"], outputs: ["isOpenChange"] }, { kind: "component", type: UserListComponent, selector: "stream-user-list", inputs: ["users", "isLoading", "hasMore"], outputs: ["loadMore"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
5179
5242
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageReactionsComponent, decorators: [{
|
|
5180
5243
|
type: Component,
|
|
5181
5244
|
args: [{ selector: 'stream-message-reactions', template: "<div\n *ngIf=\"existingReactions.length > 0\"\n data-testid=\"reaction-list\"\n class=\"str-chat__reaction-list str-chat__message-reactions-container\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n>\n <ul class=\"str-chat__message-reactions\">\n <li\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n class=\"str-chat__message-reaction\"\n data-testclass=\"emoji\"\n [class.str-chat__message-reaction-own]=\"isOwnReaction(reactionType)\"\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 {{ messageReactionGroups?.[reactionType]?.count ?? 0 }}\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 [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\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 *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n class=\"str-chat__message-reactions-details-reaction-type\"\n attr.data-testid=\"reaction-details-selector-{{ reactionType }}\"\n [class.str-chat__message-reactions-details-reaction-type--selected]=\"\n reactionType === selectedReactionType\n \"\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 class=\"str-chat__message-reaction-count\">\n {{ messageReactionGroups?.[reactionType]?.count ?? 0 }}\n </span>\n </div>\n </div>\n <div\n class=\"emoji str-chat__message-reaction-emoji str-chat__message-reaction-emoji-big\"\n >\n {{ getEmojiByReaction(selectedReactionType!) }}\n </div>\n <div\n data-testid=\"all-reacting-users\"\n class=\"str-chat__message-reactions-details-reacting-users\"\n >\n <ng-container\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n >\n <stream-user-list\n attr.data-testid=\"{{ reactionType }}-user-list\"\n [style.display]=\"\n selectedReactionType === reactionType ? 'block' : 'none'\n \"\n [users]=\"usersByReactions[reactionType]?.users || []\"\n [isLoading]=\"isLoading\"\n [hasMore]=\"!!usersByReactions[reactionType]?.next || false\"\n (loadMore)=\"loadNextPageOfReactions()\"\n ></stream-user-list>\n </ng-container>\n </div>\n </div>\n</ng-template>\n" }]
|
|
@@ -5319,7 +5382,7 @@ class MessageTextComponent {
|
|
|
5319
5382
|
}
|
|
5320
5383
|
}
|
|
5321
5384
|
MessageTextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageTextComponent, deps: [{ token: MessageService }, { token: CustomTemplatesService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5322
|
-
MessageTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageTextComponent, selector: "stream-message-text", inputs: { message: "message", isQuoted: "isQuoted", shouldTranslate: "shouldTranslate" }, usesOnChanges: true, ngImport: i0, template: "<p\n [class.str-chat__quoted-message-text-value]=\"isQuoted\"\n [class.str-chat__message-text-value]=\"!isQuoted\"\n *ngIf=\"message?.text\"\n data-testid=\"text\"\n>\n <ng-container *ngIf=\"messageTextParts; else defaultContent\">\n <!-- eslint-disable-next-line @angular-eslint/template/use-track-by-function -->\n <ng-container *ngFor=\"let part of messageTextParts\">\n <span\n *ngIf=\"part.type === 'text'; else mention\"\n [innerHTML]=\"part.content\"\n ></span>\n <ng-template #mention>\n <ng-template #defaultMention let-content=\"content\">\n <span class=\"str-chat__message-mention\">{{ content }}</span>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.mentionTemplate$ | async) || defaultMention;\n context: getMentionContext(part)\n \"\n ></ng-container>\n </ng-template>\n </ng-container>\n </ng-container>\n <ng-template #defaultContent>\n <ng-container *ngIf=\"displayAs === 'text'; else asHTML\">\n {{ messageText || \"\" }}\n </ng-container>\n <ng-template #asHTML\n ><span data-testid=\"html-content\" [innerHTML]=\"messageText\"></span\n ></ng-template>\n </ng-template>\n</p>\n", dependencies: [{ kind: "directive", type:
|
|
5385
|
+
MessageTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageTextComponent, selector: "stream-message-text", inputs: { message: "message", isQuoted: "isQuoted", shouldTranslate: "shouldTranslate" }, usesOnChanges: true, ngImport: i0, template: "<p\n [class.str-chat__quoted-message-text-value]=\"isQuoted\"\n [class.str-chat__message-text-value]=\"!isQuoted\"\n *ngIf=\"message?.text\"\n data-testid=\"text\"\n>\n <ng-container *ngIf=\"messageTextParts; else defaultContent\">\n <!-- eslint-disable-next-line @angular-eslint/template/use-track-by-function -->\n <ng-container *ngFor=\"let part of messageTextParts\">\n <span\n *ngIf=\"part.type === 'text'; else mention\"\n [innerHTML]=\"part.content\"\n ></span>\n <ng-template #mention>\n <ng-template #defaultMention let-content=\"content\">\n <span class=\"str-chat__message-mention\">{{ content }}</span>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.mentionTemplate$ | async) || defaultMention;\n context: getMentionContext(part)\n \"\n ></ng-container>\n </ng-template>\n </ng-container>\n </ng-container>\n <ng-template #defaultContent>\n <ng-container *ngIf=\"displayAs === 'text'; else asHTML\">\n {{ messageText || \"\" }}\n </ng-container>\n <ng-template #asHTML\n ><span data-testid=\"html-content\" [innerHTML]=\"messageText\"></span\n ></ng-template>\n </ng-template>\n</p>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
5323
5386
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageTextComponent, decorators: [{
|
|
5324
5387
|
type: Component,
|
|
5325
5388
|
args: [{ selector: 'stream-message-text', template: "<p\n [class.str-chat__quoted-message-text-value]=\"isQuoted\"\n [class.str-chat__message-text-value]=\"!isQuoted\"\n *ngIf=\"message?.text\"\n data-testid=\"text\"\n>\n <ng-container *ngIf=\"messageTextParts; else defaultContent\">\n <!-- eslint-disable-next-line @angular-eslint/template/use-track-by-function -->\n <ng-container *ngFor=\"let part of messageTextParts\">\n <span\n *ngIf=\"part.type === 'text'; else mention\"\n [innerHTML]=\"part.content\"\n ></span>\n <ng-template #mention>\n <ng-template #defaultMention let-content=\"content\">\n <span class=\"str-chat__message-mention\">{{ content }}</span>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.mentionTemplate$ | async) || defaultMention;\n context: getMentionContext(part)\n \"\n ></ng-container>\n </ng-template>\n </ng-container>\n </ng-container>\n <ng-template #defaultContent>\n <ng-container *ngIf=\"displayAs === 'text'; else asHTML\">\n {{ messageText || \"\" }}\n </ng-container>\n <ng-template #asHTML\n ><span data-testid=\"html-content\" [innerHTML]=\"messageText\"></span\n ></ng-template>\n </ng-template>\n</p>\n" }]
|
|
@@ -5381,7 +5444,7 @@ class MessageComponent {
|
|
|
5381
5444
|
this.isEditedFlagOpened = false;
|
|
5382
5445
|
this.shouldDisplayTranslationNotice = false;
|
|
5383
5446
|
this.displayedMessageTextContent = 'original';
|
|
5384
|
-
this.
|
|
5447
|
+
this.nestedModalState = 'closed';
|
|
5385
5448
|
this.shouldDisplayThreadLink = false;
|
|
5386
5449
|
this.isSentByCurrentUser = false;
|
|
5387
5450
|
this.readByText = '';
|
|
@@ -5453,6 +5516,11 @@ class MessageComponent {
|
|
|
5453
5516
|
}
|
|
5454
5517
|
}
|
|
5455
5518
|
}));
|
|
5519
|
+
this.subscriptions.push(this.messageActionsService.modalOpenedForMessage.subscribe((messageId) => {
|
|
5520
|
+
if (messageId === this.message?.id) {
|
|
5521
|
+
this.nestedModalState = 'opened';
|
|
5522
|
+
}
|
|
5523
|
+
}));
|
|
5456
5524
|
}
|
|
5457
5525
|
ngOnChanges(changes) {
|
|
5458
5526
|
if (changes.message) {
|
|
@@ -5546,6 +5614,16 @@ class MessageComponent {
|
|
|
5546
5614
|
this.messageMenuTrigger?.hide();
|
|
5547
5615
|
}
|
|
5548
5616
|
}));
|
|
5617
|
+
this.subscriptions.push(this.messageActionsService.modalOpenedForMessage
|
|
5618
|
+
.pipe(pairwise())
|
|
5619
|
+
.subscribe(([oldId, newId]) => {
|
|
5620
|
+
if (newId === this.message?.id) {
|
|
5621
|
+
this.nestedModalState = 'opened';
|
|
5622
|
+
}
|
|
5623
|
+
else if (oldId === this.message?.id && newId === undefined) {
|
|
5624
|
+
this.nestedModalState = 'closed';
|
|
5625
|
+
}
|
|
5626
|
+
}));
|
|
5549
5627
|
}
|
|
5550
5628
|
ngOnDestroy() {
|
|
5551
5629
|
this.subscriptions.forEach((s) => s.unsubscribe());
|
|
@@ -5610,7 +5688,7 @@ class MessageComponent {
|
|
|
5610
5688
|
messageId: this.message?.id || '',
|
|
5611
5689
|
attachments: this.message?.attachments || [],
|
|
5612
5690
|
parentMessageId: this.message?.parent_id,
|
|
5613
|
-
imageModalStateChangeHandler: (state) => (this.
|
|
5691
|
+
imageModalStateChangeHandler: (state) => (this.nestedModalState = state),
|
|
5614
5692
|
};
|
|
5615
5693
|
}
|
|
5616
5694
|
getMessageContext() {
|
|
@@ -5788,10 +5866,10 @@ class MessageComponent {
|
|
|
5788
5866
|
}
|
|
5789
5867
|
}
|
|
5790
5868
|
MessageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageComponent, deps: [{ token: ChatClientService }, { token: ChannelService }, { token: CustomTemplatesService }, { token: i0.ChangeDetectorRef }, { token: DateParserService }, { token: MessageActionsService }, { token: i0.NgZone }, { token: i6.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5791
|
-
MessageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageComponent, selector: "stream-message", inputs: { message: "message", enabledMessageActions: "enabledMessageActions", isLastSentMessage: "isLastSentMessage", mode: "mode", isHighlighted: "isHighlighted", scroll$: "scroll$" }, viewQueries: [{ propertyName: "messageMenuTrigger", first: true, predicate: ["messageMenuTrigger"], descendants: true }, { propertyName: "messageMenuFloat", first: true, predicate: ["messageMenuFloat"], descendants: true }, { propertyName: "messageTextElement", first: true, predicate: ["messageTextElement"], descendants: true }, { propertyName: "messageBubble", first: true, predicate: ["messageBubble"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container\n *ngIf=\"\n message?.type === 'error' &&\n (message?.moderation_details?.action ===\n 'MESSAGE_RESPONSE_ACTION_REMOVE' ||\n message?.moderation?.action === 'remove');\n else notBlockedMessage\n \"\n>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageBlockedTemplate$ | async) ||\n defaultBlockedMessage;\n context: getMessageBlockedContext()\n \"\n ></ng-container>\n <ng-template #defaultBlockedMessage>\n <stream-message-blocked\n [message]=\"message\"\n [isMyMessage]=\"isSentByCurrentUser\"\n ></stream-message-blocked>\n </ng-template>\n</ng-container>\n<ng-template #notBlockedMessage>\n <div\n data-testid=\"message-container\"\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }} str-chat__message-menu-{{ areMessageOptionsOpen ? 'opened' : 'closed' }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message--other]=\"!isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"hasReactions\"\n [class.str-chat__message--highlighted]=\"isHighlighted\"\n [class.str-chat__message-with-thread-link]=\"shouldDisplayThreadLink\"\n [class.str-chat__message-send-can-be-retried]=\"\n (message?.status === 'failed' && message?.errorStatusCode !== 403) ||\n (message?.type === 'error' && message?.moderation_details)\n \"\n [class.str-chat__message-with-touch-support]=\"hasTouchSupport\"\n [class.str-chat__message-without-touch-support]=\"!hasTouchSupport\"\n >\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <stream-avatar-placeholder\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n type=\"user\"\n location=\"message-sender\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n [user]=\"message?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__message-inner\">\n <div\n *ngIf=\"!hasTouchSupport && areOptionsVisible\"\n class=\"str-chat__message-simple__actions str-chat__message-options\"\n data-testid=\"message-options\"\n [class.str-chat__message-actions-open]=\"areMessageOptionsOpen\"\n >\n <div\n #messageActionsToggle\n data-testid=\"message-actions-container\"\n class=\"str-chat__message-actions-container str-chat__message-simple__actions__action str-chat__message-simple__actions__action--options\"\n [floatUiLoose]=\"messageMenuFloat\"\n [looseTrigger]=\"\n messageActionsService.customActionClickHandler\n ? 'none'\n : 'click'\n \"\n [hideOnScroll]=\"false\"\n [hideOnClickOutside]=\"true\"\n [hideOnMouseLeave]=\"false\"\n [disableAnimation]=\"false\"\n [preventOverflow]=\"true\"\n [positionFixed]=\"true\"\n (onSHown)=\"areMessageOptionsOpen = true\"\n (onHidden)=\"areMessageOptionsOpen = false\"\n >\n <div\n *ngIf=\"visibleMessageActionsCount > 0\"\n class=\"str-chat__message-actions-box-button\"\n data-testid=\"message-options-button\"\n (click)=\"messageOptionsButtonClicked()\"\n (keyup.enter)=\"messageOptionsButtonClicked()\"\n >\n <stream-icon-placeholder\n icon=\"action\"\n class=\"str-chat__message-action-icon\"\n ></stream-icon-placeholder>\n </div>\n </div>\n </div>\n <ng-container\n *ngIf=\"\n customTemplatesService.customMessageMetadataInsideBubbleTemplate$\n | async\n \"\n >\n <ng-template\n *ngTemplateOutlet=\"\n (customTemplatesService.customMessageMetadataInsideBubbleTemplate$\n | async)!;\n context: { message: message }\n \"\n ></ng-template>\n </ng-container>\n <div class=\"str-chat__message-reactions-host\">\n <ng-template\n #defaultMessageReactions\n let-messageReactionCounts=\"messageReactionCounts\"\n let-latestReactions=\"latestReactions\"\n let-messageId=\"messageId\"\n let-ownReactions=\"ownReactions\"\n let-messageReactionGroups=\"messageReactionGroups\"\n >\n <stream-message-reactions\n [messageReactionCounts]=\"messageReactionCounts\"\n [latestReactions]=\"latestReactions\"\n [messageId]=\"messageId\"\n [ownReactions]=\"ownReactions\"\n [messageReactionGroups]=\"messageReactionGroups\"\n ></stream-message-reactions>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageReactionsTemplate$ | async) ||\n defaultMessageReactions;\n context: getMessageReactionsContext()\n \"\n ></ng-container>\n </div>\n <float-ui-content #messageMenuFloat>\n <ng-template\n #defaultMessageActionsBox\n let-isMine=\"isMine\"\n let-messageInput=\"message\"\n let-enabledActions=\"enabledActions\"\n let-messageTextHtmlElement=\"messageTextHtmlElement\"\n >\n <stream-message-actions-box\n [isMine]=\"isMine\"\n [message]=\"messageInput\"\n [enabledActions]=\"enabledActions\"\n [messageTextHtmlElement]=\"messageTextHtmlElement\"\n ></stream-message-actions-box>\n </ng-template>\n <ng-container>\n <div\n (click)=\"messageActionsBoxClicked(messageMenuFloat)\"\n (keyup.enter)=\"messageActionsBoxClicked(messageMenuFloat)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageActionsBoxTemplate$\n | async) || defaultMessageActionsBox;\n context: getMessageActionsBoxContext()\n \"\n >\n </ng-container>\n </div>\n </ng-container>\n </float-ui-content>\n <div\n class=\"str-chat__message-bubble str-chat-angular__message-bubble\"\n [class.str-chat-angular__message-bubble--attachment-modal-open]=\"\n imageAttachmentModalState === 'opened'\n \"\n data-testid=\"message-bubble\"\n [floatUiLoose]=\"messageMenuFloat\"\n #messageMenuTrigger=\"floatUiLoose\"\n #messageBubble\n looseTrigger=\"none\"\n [hideOnScroll]=\"false\"\n [hideOnClickOutside]=\"true\"\n [hideOnMouseLeave]=\"false\"\n [disableAnimation]=\"true\"\n [preventOverflow]=\"true\"\n (onShown)=\"areMessageOptionsOpen = true\"\n (onHidden)=\"areMessageOptionsOpen = false\"\n [positionFixed]=\"true\"\n >\n <ng-container *ngIf=\"hasAttachment && !message?.quoted_message\">\n <div class=\"str-chat__attachments-container\">\n <ng-container\n *ngTemplateOutlet=\"attachmentsTemplate\"\n ></ng-container>\n </div>\n </ng-container>\n <div\n *ngIf=\"\n message?.text || (message?.quoted_message && hasAttachment)\n \"\n class=\"str-chat__message-text\"\n tabindex=\"0\"\n [class.str-chat__message-text--pointer-cursor]=\"\n (message?.status === 'failed' &&\n message?.errorStatusCode !== 403) ||\n (this.message?.type === 'error' &&\n this.message?.moderation_details) ||\n message?.message_text_updated_at\n \"\n (click)=\"messageClicked()\"\n (keyup.enter)=\"messageClicked()\"\n >\n <div\n data-testid=\"inner-message\"\n class=\"str-chat__message-text-inner str-chat__message-simple-text-inner\"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n >\n <ng-container *ngTemplateOutlet=\"quotedMessage\"></ng-container>\n <ng-container *ngIf=\"hasAttachment && message?.quoted_message\">\n <ng-container\n *ngTemplateOutlet=\"attachmentsTemplate\"\n ></ng-container>\n </ng-container>\n <div\n *ngIf=\"message?.type === 'error'\"\n data-testid=\"client-error-message\"\n class=\"str-chat__simple-message--error-message str-chat__message--error-message\"\n >\n <ng-container *ngIf=\"!message?.moderation_details\">{{\n \"streamChat.Error \u00B7 Unsent\" | translate\n }}</ng-container>\n </div>\n <div\n *ngIf=\"message?.status === 'failed'\"\n data-testid=\"error-message\"\n class=\"str-chat__simple-message--error-message str-chat__message--error-message\"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed \u00B7 Unauthorized\"\n : \"streamChat.Message Failed \u00B7 Click to try again\"\n ) | translate\n }}\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageTextTemplate$ | async) ||\n defaultText;\n context: getMessageTextContext()\n \"\n ></ng-container>\n <ng-template\n #defaultText\n let-message=\"message\"\n let-isQuoted=\"isQuoted\"\n let-shouldTranslate=\"shouldTranslate\"\n >\n <stream-message-text\n [message]=\"message\"\n [isQuoted]=\"isQuoted\"\n [shouldTranslate]=\"shouldTranslate\"\n data-testid=\"quoted-message-text\"\n ></stream-message-text>\n </ng-template>\n </div>\n </div>\n <stream-icon-placeholder\n class=\"str-chat__message-error-icon\"\n icon=\"error\"\n ></stream-icon-placeholder>\n </div>\n </div>\n <ng-container\n *ngTemplateOutlet=\"replyCountButton; context: { message: message }\"\n ></ng-container>\n\n <ng-container *ngTemplateOutlet=\"messageDateAndSender\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n\n <ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n </ng-template>\n\n <ng-template #systemMessage>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.systemMessageTemplate$ | async) ||\n defaultSystemMessage;\n context: getMessageContext()\n \"\n ></ng-container>\n <ng-template #defaultSystemMessage let-messageInput=\"message\">\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ messageInput?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n </ng-template>\n </ng-template>\n\n <ng-template #quotedMessage>\n <div\n *ngIf=\"message?.quoted_message\"\n class=\"quoted-message str-chat__quoted-message-preview\"\n data-testid=\"quoted-message-container\"\n [class.mine]=\"isSentByCurrentUser\"\n (click)=\"\n jumpToMessage(\n (message?.quoted_message)!.id,\n message?.quoted_message?.parent_id\n )\n \"\n (keyup.enter)=\"\n jumpToMessage(\n (message?.quoted_message)!.id,\n message?.quoted_message?.parent_id\n )\n \"\n >\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [imageUrl]=\"message?.quoted_message?.user?.image\"\n [name]=\"\n message?.quoted_message?.user?.name ||\n message?.quoted_message?.user?.id\n \"\n [user]=\"message?.quoted_message?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"quoted-message-inner str-chat__quoted-message-bubble\">\n <ng-container\n *ngIf=\"\n message?.quoted_message?.attachments &&\n message?.quoted_message?.attachments?.length\n \"\n >\n <ng-template\n #defaultAttachments\n let-messageId=\"messageId\"\n let-attachments=\"attachments\"\n let-parentMessageId=\"parentMessageId\"\n let-imageModalStateChangeHandler=\"imageModalStateChangeHandler\"\n >\n <stream-attachment-list\n [messageId]=\"messageId\"\n [attachments]=\"attachments\"\n [parentMessageId]=\"parentMessageId\"\n (imageModalStateChange)=\"imageModalStateChangeHandler($event)\"\n ></stream-attachment-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentListTemplate$ | async) ||\n defaultAttachments;\n context: getQuotedMessageAttachmentListContext()\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"message?.quoted_message\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageTextTemplate$ | async) ||\n defaultText;\n context: getQuotedMessageTextContext()\n \"\n ></ng-container>\n <ng-template\n #defaultText\n let-message=\"message\"\n let-isQuoted=\"isQuoted\"\n let-shouldTranslate=\"shouldTranslate\"\n >\n <stream-message-text\n [message]=\"message\"\n [isQuoted]=\"isQuoted\"\n [shouldTranslate]=\"shouldTranslate\"\n data-testid=\"quoted-message-text\"\n ></stream-message-text>\n </ng-template>\n </ng-container>\n </div>\n </div>\n </ng-template>\n\n <ng-template #messageDateAndSender>\n <ng-container>\n <div\n *ngIf=\"shouldDisplayTranslationNotice\"\n class=\"str-chat__translation-notice\"\n data-testid=\"translation-notice\"\n >\n <button\n *ngIf=\"displayedMessageTextContent === 'translation'\"\n data-testid=\"see-original\"\n translate\n (click)=\"displayOriginalMessage()\"\n (keyup.enter)=\"displayOriginalMessage()\"\n >\n streamChat.See original (automatically translated)\n </button>\n <button\n *ngIf=\"displayedMessageTextContent === 'original'\"\n data-testid=\"see-translation\"\n translate\n (click)=\"displayTranslatedMessage()\"\n (keyup.enter)=\"displayTranslatedMessage()\"\n >\n streamChat.See translation\n </button>\n </div>\n <ng-container\n *ngIf=\"customTemplatesService.customMessageMetadataTemplate$ | async\"\n >\n <div class=\"str-chat__custom-message-metadata\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.customMessageMetadataTemplate$ | async)!;\n context: getMessageMetadataContext()\n \"\n ></ng-container>\n </div>\n </ng-container>\n <div\n class=\"str-chat__message-data str-chat__message-simple-data str-chat__message-metadata\"\n >\n <ng-container *ngTemplateOutlet=\"messageStatus\"></ng-container>\n\n <span\n *ngIf=\"!isSentByCurrentUser\"\n data-testid=\"sender\"\n class=\"str-chat__message-simple-name str-chat__message-sender-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span\n data-testid=\"date\"\n class=\"str-chat__message-simple-timestamp str-chat__message-simple-time\"\n >\n {{ parsedDate }}\n </span>\n <ng-container *ngIf=\"message?.message_text_updated_at\">\n <span\n data-testid=\"edited-flag\"\n class=\"str-chat__mesage-simple-edited\"\n translate\n >streamChat.Edited</span\n >\n <div\n data-testid=\"edited-timestamp\"\n class=\"str-chat__message-edited-timestamp\"\n [ngClass]=\"{\n 'str-chat__message-edited-timestamp--open': isEditedFlagOpened,\n 'str-chat__message-edited-timestamp--collapsed':\n !isEditedFlagOpened\n }\"\n >\n <span translate>streamChat.Edited</span>\n <time\n dateTime=\"{{ message?.message_text_updated_at }}\"\n title=\"{{ message?.message_text_updated_at }}\"\n >\n {{ pasedEditedDate }}\n </time>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </ng-template>\n\n <ng-template #messageStatus>\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n mode === 'main' &&\n isMessageDeliveredAndRead &&\n canDisplayReadStatus;\n else deliveredStatus\n \"\n >\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n <ng-template #deliveredStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.deliveredStatusTemplate$ | async) ||\n defaultDeliveredStatus;\n context: getDeliveredStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultDeliveredStatus>\n <span\n *ngIf=\"mode === 'main'\"\n class=\"str-chat__message-simple-status str-chat__message-simple-status-angular str-chat__message-status\"\n data-testid=\"delivered-indicator\"\n tabindex=\"0\"\n [floatUiLoose]=\"floatingContent\"\n loosePlacement=\"top\"\n [looseTrigger]=\"hasTouchSupport ? 'click' : 'hover'\"\n [disableAnimation]=\"true\"\n [hideOnClickOutside]=\"true\"\n [positionFixed]=\"true\"\n [preventOverflow]=\"true\"\n >\n <float-ui-content #floatingContent>\n <div class=\"str-chat__tooltip str-chat__tooltip-angular\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n </float-ui-content>\n <stream-icon-placeholder\n data-testid=\"delivered-icon\"\n icon=\"delivered\"\n ></stream-icon-placeholder>\n </span>\n </ng-template>\n <ng-template #sendingStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.sendingStatusTemplate$ | async) ||\n defaultSendingStatus;\n context: getSendingStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultSendingStatus>\n <span\n class=\"str-chat__message-simple-status str-chat__message-simple-status-angular str-chat__message-status\"\n data-testid=\"sending-indicator\"\n tabindex=\"0\"\n [floatUiLoose]=\"floatingContent\"\n loosePlacement=\"top\"\n [looseTrigger]=\"hasTouchSupport ? 'click' : 'hover'\"\n [disableAnimation]=\"true\"\n [hideOnClickOutside]=\"true\"\n [positionFixed]=\"true\"\n [preventOverflow]=\"true\"\n >\n <float-ui-content #floatingContent>\n <div class=\"str-chat__tooltip str-chat__tooltip-angular\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n </float-ui-content>\n <stream-loading-indicator-placeholder\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator-placeholder>\n </span>\n </ng-template>\n <ng-template #readStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.readStatusTemplate$ | async) ||\n defaultReadStatus;\n context: getReadStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultReadStatus let-readByText=\"readByText\">\n <span\n class=\"str-chat__message-simple-status str-chat__message-simple-status-angular str-chat__message-status\"\n data-testid=\"read-indicator\"\n tabindex=\"0\"\n [floatUiLoose]=\"floatingContent\"\n loosePlacement=\"top\"\n [looseTrigger]=\"hasTouchSupport ? 'click' : 'hover'\"\n [disableAnimation]=\"true\"\n [hideOnClickOutside]=\"true\"\n [positionFixed]=\"true\"\n [preventOverflow]=\"true\"\n >\n <float-ui-content #floatingContent>\n <div\n class=\"str-chat__tooltip str-chat__tooltip-angular\"\n data-testid=\"read-by-tooltip\"\n >\n {{ readByText }}\n </div>\n </float-ui-content>\n <stream-icon-placeholder icon=\"read\"></stream-icon-placeholder>\n </span>\n </ng-template>\n </ng-container>\n </ng-template>\n\n <ng-template #replyCountButton>\n <div\n class=\"str-chat__message-simple-reply-button str-chat__message-replies-count-button-wrapper\"\n >\n <ng-container *ngIf=\"shouldDisplayThreadLink\">\n <ng-template\n *ngTemplateOutlet=\"\n (customTemplatesService.threadLinkButton$ | async) || defaultButton;\n context: { message: message }\n \"\n ></ng-template>\n </ng-container>\n <ng-template #defaultButton let-message=\"message\">\n <button\n class=\"str-chat__message-replies-count-button\"\n data-testid=\"reply-count-button\"\n (click)=\"setAsActiveParentMessage()\"\n >\n {{message?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </button>\n </ng-template>\n </div>\n </ng-template>\n\n <ng-template #attachmentsTemplate>\n <ng-template\n #defaultAttachments\n let-messageId=\"messageId\"\n let-attachments=\"attachments\"\n let-parentMessageId=\"parentMessageId\"\n let-imageModalStateChangeHandler=\"imageModalStateChangeHandler\"\n >\n <stream-attachment-list\n [messageId]=\"messageId\"\n [attachments]=\"attachments\"\n [parentMessageId]=\"parentMessageId\"\n (imageModalStateChange)=\"imageModalStateChangeHandler($event)\"\n ></stream-attachment-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentListTemplate$ | async) ||\n defaultAttachments;\n context: getAttachmentListContext()\n \"\n ></ng-container>\n </ng-template>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i8.NgxFloatUiContentComponent, selector: "float-ui-content", exportAs: ["ngxFloatUiContent"] }, { kind: "directive", type: i8.NgxFloatUiLooseDirective, selector: "[floatUiLoose]", inputs: ["floatUiLoose", "loosePlacement", "looseTrigger"], exportAs: ["floatUiLoose"] }, { kind: "component", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: ["name", "imageUrl", "location", "channel", "user", "type", "initialsType", "showOnlineIndicator"] }, { kind: "directive", type: i6.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "component", type: LoadingIndicatorPlaceholderComponent, selector: "stream-loading-indicator-placeholder" }, { kind: "component", type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: ["isMine", "message", "messageTextHtmlElement", "enabledActions"] }, { kind: "component", type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["messageId", "parentMessageId", "attachments"], outputs: ["imageModalStateChange"] }, { kind: "component", type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: ["messageId", "messageReactionGroups", "messageReactionCounts", "latestReactions", "ownReactions"] }, { kind: "component", type: MessageTextComponent, selector: "stream-message-text", inputs: ["message", "isQuoted", "shouldTranslate"] }, { kind: "component", type: MessageBlockedComponent, selector: "stream-message-blocked", inputs: ["message", "isMyMessage"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5869
|
+
MessageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageComponent, selector: "stream-message", inputs: { message: "message", enabledMessageActions: "enabledMessageActions", isLastSentMessage: "isLastSentMessage", mode: "mode", isHighlighted: "isHighlighted", scroll$: "scroll$" }, viewQueries: [{ propertyName: "messageMenuTrigger", first: true, predicate: ["messageMenuTrigger"], descendants: true }, { propertyName: "messageMenuFloat", first: true, predicate: ["messageMenuFloat"], descendants: true }, { propertyName: "messageTextElement", first: true, predicate: ["messageTextElement"], descendants: true }, { propertyName: "messageBubble", first: true, predicate: ["messageBubble"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container\n *ngIf=\"\n message?.type === 'error' &&\n (message?.moderation_details?.action ===\n 'MESSAGE_RESPONSE_ACTION_REMOVE' ||\n message?.moderation?.action === 'remove');\n else notBlockedMessage\n \"\n>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageBlockedTemplate$ | async) ||\n defaultBlockedMessage;\n context: getMessageBlockedContext()\n \"\n ></ng-container>\n <ng-template #defaultBlockedMessage>\n <stream-message-blocked\n [message]=\"message\"\n [isMyMessage]=\"isSentByCurrentUser\"\n ></stream-message-blocked>\n </ng-template>\n</ng-container>\n<ng-template #notBlockedMessage>\n <div\n data-testid=\"message-container\"\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }} str-chat__message-menu-{{ areMessageOptionsOpen ? 'opened' : 'closed' }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message--other]=\"!isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"hasReactions\"\n [class.str-chat__message--highlighted]=\"isHighlighted\"\n [class.str-chat__message-with-thread-link]=\"shouldDisplayThreadLink\"\n [class.str-chat__message-send-can-be-retried]=\"\n (message?.status === 'failed' && message?.errorStatusCode !== 403) ||\n (message?.type === 'error' && message?.moderation_details)\n \"\n [class.str-chat__message-with-touch-support]=\"hasTouchSupport\"\n [class.str-chat__message-without-touch-support]=\"!hasTouchSupport\"\n >\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <stream-avatar-placeholder\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n type=\"user\"\n location=\"message-sender\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n [user]=\"message?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__message-inner\">\n <div\n *ngIf=\"!hasTouchSupport && areOptionsVisible\"\n class=\"str-chat__message-simple__actions str-chat__message-options\"\n data-testid=\"message-options\"\n [class.str-chat__message-actions-open]=\"areMessageOptionsOpen\"\n >\n <div\n #messageActionsToggle\n data-testid=\"message-actions-container\"\n class=\"str-chat__message-actions-container str-chat__message-simple__actions__action str-chat__message-simple__actions__action--options\"\n [floatUiLoose]=\"messageMenuFloat\"\n [looseTrigger]=\"\n messageActionsService.customActionClickHandler\n ? 'none'\n : 'click'\n \"\n [hideOnScroll]=\"false\"\n [hideOnClickOutside]=\"true\"\n [hideOnMouseLeave]=\"false\"\n [disableAnimation]=\"false\"\n [preventOverflow]=\"true\"\n [positionFixed]=\"true\"\n (onSHown)=\"areMessageOptionsOpen = true\"\n (onHidden)=\"areMessageOptionsOpen = false\"\n >\n <div\n *ngIf=\"visibleMessageActionsCount > 0\"\n class=\"str-chat__message-actions-box-button\"\n data-testid=\"message-options-button\"\n (click)=\"messageOptionsButtonClicked()\"\n (keyup.enter)=\"messageOptionsButtonClicked()\"\n >\n <stream-icon-placeholder\n icon=\"action\"\n class=\"str-chat__message-action-icon\"\n ></stream-icon-placeholder>\n </div>\n </div>\n </div>\n <ng-container\n *ngIf=\"\n customTemplatesService.customMessageMetadataInsideBubbleTemplate$\n | async\n \"\n >\n <ng-template\n *ngTemplateOutlet=\"\n (customTemplatesService.customMessageMetadataInsideBubbleTemplate$\n | async)!;\n context: { message: message }\n \"\n ></ng-template>\n </ng-container>\n <div class=\"str-chat__message-reactions-host\">\n <ng-template\n #defaultMessageReactions\n let-messageReactionCounts=\"messageReactionCounts\"\n let-latestReactions=\"latestReactions\"\n let-messageId=\"messageId\"\n let-ownReactions=\"ownReactions\"\n let-messageReactionGroups=\"messageReactionGroups\"\n >\n <stream-message-reactions\n [messageReactionCounts]=\"messageReactionCounts\"\n [latestReactions]=\"latestReactions\"\n [messageId]=\"messageId\"\n [ownReactions]=\"ownReactions\"\n [messageReactionGroups]=\"messageReactionGroups\"\n ></stream-message-reactions>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageReactionsTemplate$ | async) ||\n defaultMessageReactions;\n context: getMessageReactionsContext()\n \"\n ></ng-container>\n </div>\n <float-ui-content #messageMenuFloat>\n <ng-template\n #defaultMessageActionsBox\n let-isMine=\"isMine\"\n let-messageInput=\"message\"\n let-enabledActions=\"enabledActions\"\n let-messageTextHtmlElement=\"messageTextHtmlElement\"\n >\n <stream-message-actions-box\n [isMine]=\"isMine\"\n [message]=\"messageInput\"\n [enabledActions]=\"enabledActions\"\n [messageTextHtmlElement]=\"messageTextHtmlElement\"\n ></stream-message-actions-box>\n </ng-template>\n <ng-container>\n <div\n (click)=\"messageActionsBoxClicked(messageMenuFloat)\"\n (keyup.enter)=\"messageActionsBoxClicked(messageMenuFloat)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageActionsBoxTemplate$\n | async) || defaultMessageActionsBox;\n context: getMessageActionsBoxContext()\n \"\n >\n </ng-container>\n </div>\n </ng-container>\n </float-ui-content>\n <div\n class=\"str-chat__message-bubble str-chat-angular__message-bubble\"\n [class.str-chat-angular__message-bubble--attachment-modal-open]=\"\n nestedModalState === 'opened'\n \"\n data-testid=\"message-bubble\"\n [floatUiLoose]=\"messageMenuFloat\"\n #messageMenuTrigger=\"floatUiLoose\"\n #messageBubble\n looseTrigger=\"none\"\n [hideOnScroll]=\"false\"\n [hideOnClickOutside]=\"true\"\n [hideOnMouseLeave]=\"false\"\n [disableAnimation]=\"true\"\n [preventOverflow]=\"true\"\n (onShown)=\"areMessageOptionsOpen = true\"\n (onHidden)=\"areMessageOptionsOpen = false\"\n [positionFixed]=\"true\"\n >\n <ng-container *ngIf=\"hasAttachment && !message?.quoted_message\">\n <div class=\"str-chat__attachments-container\">\n <ng-container\n *ngTemplateOutlet=\"attachmentsTemplate\"\n ></ng-container>\n </div>\n </ng-container>\n <ng-container\n *ngIf=\"\n message?.poll_id &&\n (customTemplatesService.pollTemplate$ | async)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.pollTemplate$ | async)!;\n context: {\n pollId: message?.poll_id,\n messageId: message?.id,\n isQuote: false\n }\n \"\n ></ng-container>\n </ng-container>\n <div\n *ngIf=\"\n message?.text || (message?.quoted_message && hasAttachment)\n \"\n class=\"str-chat__message-text\"\n tabindex=\"0\"\n [class.str-chat__message-text--pointer-cursor]=\"\n (message?.status === 'failed' &&\n message?.errorStatusCode !== 403) ||\n (this.message?.type === 'error' &&\n this.message?.moderation_details) ||\n message?.message_text_updated_at\n \"\n (click)=\"messageClicked()\"\n (keyup.enter)=\"messageClicked()\"\n >\n <div\n data-testid=\"inner-message\"\n class=\"str-chat__message-text-inner str-chat__message-simple-text-inner\"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n >\n <ng-container *ngTemplateOutlet=\"quotedMessage\"></ng-container>\n <ng-container *ngIf=\"hasAttachment && message?.quoted_message\">\n <ng-container\n *ngTemplateOutlet=\"attachmentsTemplate\"\n ></ng-container>\n </ng-container>\n <div\n *ngIf=\"message?.type === 'error'\"\n data-testid=\"client-error-message\"\n class=\"str-chat__simple-message--error-message str-chat__message--error-message\"\n >\n <ng-container *ngIf=\"!message?.moderation_details\">{{\n \"streamChat.Error \u00B7 Unsent\" | translate\n }}</ng-container>\n </div>\n <div\n *ngIf=\"message?.status === 'failed'\"\n data-testid=\"error-message\"\n class=\"str-chat__simple-message--error-message str-chat__message--error-message\"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed \u00B7 Unauthorized\"\n : \"streamChat.Message Failed \u00B7 Click to try again\"\n ) | translate\n }}\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageTextTemplate$ | async) ||\n defaultText;\n context: getMessageTextContext()\n \"\n ></ng-container>\n <ng-template\n #defaultText\n let-message=\"message\"\n let-isQuoted=\"isQuoted\"\n let-shouldTranslate=\"shouldTranslate\"\n >\n <stream-message-text\n [message]=\"message\"\n [isQuoted]=\"isQuoted\"\n [shouldTranslate]=\"shouldTranslate\"\n data-testid=\"quoted-message-text\"\n ></stream-message-text>\n </ng-template>\n </div>\n </div>\n <stream-icon-placeholder\n class=\"str-chat__message-error-icon\"\n icon=\"error\"\n ></stream-icon-placeholder>\n </div>\n </div>\n <ng-container\n *ngTemplateOutlet=\"replyCountButton; context: { message: message }\"\n ></ng-container>\n\n <ng-container *ngTemplateOutlet=\"messageDateAndSender\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n\n <ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n </ng-template>\n\n <ng-template #systemMessage>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.systemMessageTemplate$ | async) ||\n defaultSystemMessage;\n context: getMessageContext()\n \"\n ></ng-container>\n <ng-template #defaultSystemMessage let-messageInput=\"message\">\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ messageInput?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n </ng-template>\n </ng-template>\n\n <ng-template #quotedMessage>\n <div\n *ngIf=\"message?.quoted_message\"\n class=\"quoted-message str-chat__quoted-message-preview\"\n data-testid=\"quoted-message-container\"\n [class.mine]=\"isSentByCurrentUser\"\n (click)=\"\n jumpToMessage(\n (message?.quoted_message)!.id,\n message?.quoted_message?.parent_id\n )\n \"\n (keyup.enter)=\"\n jumpToMessage(\n (message?.quoted_message)!.id,\n message?.quoted_message?.parent_id\n )\n \"\n >\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [imageUrl]=\"message?.quoted_message?.user?.image\"\n [name]=\"\n message?.quoted_message?.user?.name ||\n message?.quoted_message?.user?.id\n \"\n [user]=\"message?.quoted_message?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"quoted-message-inner str-chat__quoted-message-bubble\">\n <ng-container\n *ngIf=\"\n message?.quoted_message?.attachments &&\n message?.quoted_message?.attachments?.length\n \"\n >\n <ng-template\n #defaultAttachments\n let-messageId=\"messageId\"\n let-attachments=\"attachments\"\n let-parentMessageId=\"parentMessageId\"\n let-imageModalStateChangeHandler=\"imageModalStateChangeHandler\"\n >\n <stream-attachment-list\n [messageId]=\"messageId\"\n [attachments]=\"attachments\"\n [parentMessageId]=\"parentMessageId\"\n (imageModalStateChange)=\"imageModalStateChangeHandler($event)\"\n ></stream-attachment-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentListTemplate$ | async) ||\n defaultAttachments;\n context: getQuotedMessageAttachmentListContext()\n \"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"\n message?.quoted_message?.poll_id &&\n (customTemplatesService.pollTemplate$ | async)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.pollTemplate$ | async)!;\n context: {\n pollId: message?.quoted_message?.poll_id,\n messageId: message?.quoted_message?.id,\n isQuote: true\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"message?.quoted_message\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageTextTemplate$ | async) ||\n defaultText;\n context: getQuotedMessageTextContext()\n \"\n ></ng-container>\n <ng-template\n #defaultText\n let-message=\"message\"\n let-isQuoted=\"isQuoted\"\n let-shouldTranslate=\"shouldTranslate\"\n >\n <stream-message-text\n [message]=\"message\"\n [isQuoted]=\"isQuoted\"\n [shouldTranslate]=\"shouldTranslate\"\n data-testid=\"quoted-message-text\"\n ></stream-message-text>\n </ng-template>\n </ng-container>\n </div>\n </div>\n </ng-template>\n\n <ng-template #messageDateAndSender>\n <ng-container>\n <div\n *ngIf=\"shouldDisplayTranslationNotice\"\n class=\"str-chat__translation-notice\"\n data-testid=\"translation-notice\"\n >\n <button\n *ngIf=\"displayedMessageTextContent === 'translation'\"\n data-testid=\"see-original\"\n translate\n (click)=\"displayOriginalMessage()\"\n (keyup.enter)=\"displayOriginalMessage()\"\n >\n streamChat.See original (automatically translated)\n </button>\n <button\n *ngIf=\"displayedMessageTextContent === 'original'\"\n data-testid=\"see-translation\"\n translate\n (click)=\"displayTranslatedMessage()\"\n (keyup.enter)=\"displayTranslatedMessage()\"\n >\n streamChat.See translation\n </button>\n </div>\n <ng-container\n *ngIf=\"customTemplatesService.customMessageMetadataTemplate$ | async\"\n >\n <div class=\"str-chat__custom-message-metadata\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.customMessageMetadataTemplate$ | async)!;\n context: getMessageMetadataContext()\n \"\n ></ng-container>\n </div>\n </ng-container>\n <div\n class=\"str-chat__message-data str-chat__message-simple-data str-chat__message-metadata\"\n >\n <ng-container *ngTemplateOutlet=\"messageStatus\"></ng-container>\n\n <span\n *ngIf=\"!isSentByCurrentUser\"\n data-testid=\"sender\"\n class=\"str-chat__message-simple-name str-chat__message-sender-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span\n data-testid=\"date\"\n class=\"str-chat__message-simple-timestamp str-chat__message-simple-time\"\n >\n {{ parsedDate }}\n </span>\n <ng-container *ngIf=\"message?.message_text_updated_at\">\n <span\n data-testid=\"edited-flag\"\n class=\"str-chat__mesage-simple-edited\"\n translate\n >streamChat.Edited</span\n >\n <div\n data-testid=\"edited-timestamp\"\n class=\"str-chat__message-edited-timestamp\"\n [ngClass]=\"{\n 'str-chat__message-edited-timestamp--open': isEditedFlagOpened,\n 'str-chat__message-edited-timestamp--collapsed':\n !isEditedFlagOpened\n }\"\n >\n <span translate>streamChat.Edited</span>\n <time\n dateTime=\"{{ message?.message_text_updated_at }}\"\n title=\"{{ message?.message_text_updated_at }}\"\n >\n {{ pasedEditedDate }}\n </time>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </ng-template>\n\n <ng-template #messageStatus>\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n mode === 'main' &&\n isMessageDeliveredAndRead &&\n canDisplayReadStatus;\n else deliveredStatus\n \"\n >\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n <ng-template #deliveredStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.deliveredStatusTemplate$ | async) ||\n defaultDeliveredStatus;\n context: getDeliveredStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultDeliveredStatus>\n <span\n *ngIf=\"mode === 'main'\"\n class=\"str-chat__message-simple-status str-chat__message-simple-status-angular str-chat__message-status\"\n data-testid=\"delivered-indicator\"\n tabindex=\"0\"\n [floatUiLoose]=\"floatingContent\"\n loosePlacement=\"top\"\n [looseTrigger]=\"hasTouchSupport ? 'click' : 'hover'\"\n [disableAnimation]=\"true\"\n [hideOnClickOutside]=\"true\"\n [positionFixed]=\"true\"\n [preventOverflow]=\"true\"\n >\n <float-ui-content #floatingContent>\n <div class=\"str-chat__tooltip str-chat__tooltip-angular\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n </float-ui-content>\n <stream-icon-placeholder\n data-testid=\"delivered-icon\"\n icon=\"delivered\"\n ></stream-icon-placeholder>\n </span>\n </ng-template>\n <ng-template #sendingStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.sendingStatusTemplate$ | async) ||\n defaultSendingStatus;\n context: getSendingStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultSendingStatus>\n <span\n class=\"str-chat__message-simple-status str-chat__message-simple-status-angular str-chat__message-status\"\n data-testid=\"sending-indicator\"\n tabindex=\"0\"\n [floatUiLoose]=\"floatingContent\"\n loosePlacement=\"top\"\n [looseTrigger]=\"hasTouchSupport ? 'click' : 'hover'\"\n [disableAnimation]=\"true\"\n [hideOnClickOutside]=\"true\"\n [positionFixed]=\"true\"\n [preventOverflow]=\"true\"\n >\n <float-ui-content #floatingContent>\n <div class=\"str-chat__tooltip str-chat__tooltip-angular\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n </float-ui-content>\n <stream-loading-indicator-placeholder\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator-placeholder>\n </span>\n </ng-template>\n <ng-template #readStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.readStatusTemplate$ | async) ||\n defaultReadStatus;\n context: getReadStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultReadStatus let-readByText=\"readByText\">\n <span\n class=\"str-chat__message-simple-status str-chat__message-simple-status-angular str-chat__message-status\"\n data-testid=\"read-indicator\"\n tabindex=\"0\"\n [floatUiLoose]=\"floatingContent\"\n loosePlacement=\"top\"\n [looseTrigger]=\"hasTouchSupport ? 'click' : 'hover'\"\n [disableAnimation]=\"true\"\n [hideOnClickOutside]=\"true\"\n [positionFixed]=\"true\"\n [preventOverflow]=\"true\"\n >\n <float-ui-content #floatingContent>\n <div\n class=\"str-chat__tooltip str-chat__tooltip-angular\"\n data-testid=\"read-by-tooltip\"\n >\n {{ readByText }}\n </div>\n </float-ui-content>\n <stream-icon-placeholder icon=\"read\"></stream-icon-placeholder>\n </span>\n </ng-template>\n </ng-container>\n </ng-template>\n\n <ng-template #replyCountButton>\n <div\n class=\"str-chat__message-simple-reply-button str-chat__message-replies-count-button-wrapper\"\n >\n <ng-container *ngIf=\"shouldDisplayThreadLink\">\n <ng-template\n *ngTemplateOutlet=\"\n (customTemplatesService.threadLinkButton$ | async) || defaultButton;\n context: { message: message }\n \"\n ></ng-template>\n </ng-container>\n <ng-template #defaultButton let-message=\"message\">\n <button\n class=\"str-chat__message-replies-count-button\"\n data-testid=\"reply-count-button\"\n (click)=\"setAsActiveParentMessage()\"\n >\n {{message?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </button>\n </ng-template>\n </div>\n </ng-template>\n\n <ng-template #attachmentsTemplate>\n <ng-template\n #defaultAttachments\n let-messageId=\"messageId\"\n let-attachments=\"attachments\"\n let-parentMessageId=\"parentMessageId\"\n let-imageModalStateChangeHandler=\"imageModalStateChangeHandler\"\n >\n <stream-attachment-list\n [messageId]=\"messageId\"\n [attachments]=\"attachments\"\n [parentMessageId]=\"parentMessageId\"\n (imageModalStateChange)=\"imageModalStateChangeHandler($event)\"\n ></stream-attachment-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentListTemplate$ | async) ||\n defaultAttachments;\n context: getAttachmentListContext()\n \"\n ></ng-container>\n </ng-template>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i8.NgxFloatUiContentComponent, selector: "float-ui-content", exportAs: ["ngxFloatUiContent"] }, { kind: "directive", type: i8.NgxFloatUiLooseDirective, selector: "[floatUiLoose]", inputs: ["floatUiLoose", "loosePlacement", "looseTrigger"], exportAs: ["floatUiLoose"] }, { kind: "component", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: ["name", "imageUrl", "location", "channel", "user", "type", "initialsType", "showOnlineIndicator"] }, { kind: "directive", type: i6.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "component", type: LoadingIndicatorPlaceholderComponent, selector: "stream-loading-indicator-placeholder" }, { kind: "component", type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: ["isMine", "message", "messageTextHtmlElement", "enabledActions"] }, { kind: "component", type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["messageId", "parentMessageId", "attachments"], outputs: ["imageModalStateChange"] }, { kind: "component", type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: ["messageId", "messageReactionGroups", "messageReactionCounts", "latestReactions", "ownReactions"] }, { kind: "component", type: MessageTextComponent, selector: "stream-message-text", inputs: ["message", "isQuoted", "shouldTranslate"] }, { kind: "component", type: MessageBlockedComponent, selector: "stream-message-blocked", inputs: ["message", "isMyMessage"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5792
5870
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageComponent, decorators: [{
|
|
5793
5871
|
type: Component,
|
|
5794
|
-
args: [{ selector: 'stream-message', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container\n *ngIf=\"\n message?.type === 'error' &&\n (message?.moderation_details?.action ===\n 'MESSAGE_RESPONSE_ACTION_REMOVE' ||\n message?.moderation?.action === 'remove');\n else notBlockedMessage\n \"\n>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageBlockedTemplate$ | async) ||\n defaultBlockedMessage;\n context: getMessageBlockedContext()\n \"\n ></ng-container>\n <ng-template #defaultBlockedMessage>\n <stream-message-blocked\n [message]=\"message\"\n [isMyMessage]=\"isSentByCurrentUser\"\n ></stream-message-blocked>\n </ng-template>\n</ng-container>\n<ng-template #notBlockedMessage>\n <div\n data-testid=\"message-container\"\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }} str-chat__message-menu-{{ areMessageOptionsOpen ? 'opened' : 'closed' }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message--other]=\"!isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"hasReactions\"\n [class.str-chat__message--highlighted]=\"isHighlighted\"\n [class.str-chat__message-with-thread-link]=\"shouldDisplayThreadLink\"\n [class.str-chat__message-send-can-be-retried]=\"\n (message?.status === 'failed' && message?.errorStatusCode !== 403) ||\n (message?.type === 'error' && message?.moderation_details)\n \"\n [class.str-chat__message-with-touch-support]=\"hasTouchSupport\"\n [class.str-chat__message-without-touch-support]=\"!hasTouchSupport\"\n >\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <stream-avatar-placeholder\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n type=\"user\"\n location=\"message-sender\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n [user]=\"message?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__message-inner\">\n <div\n *ngIf=\"!hasTouchSupport && areOptionsVisible\"\n class=\"str-chat__message-simple__actions str-chat__message-options\"\n data-testid=\"message-options\"\n [class.str-chat__message-actions-open]=\"areMessageOptionsOpen\"\n >\n <div\n #messageActionsToggle\n data-testid=\"message-actions-container\"\n class=\"str-chat__message-actions-container str-chat__message-simple__actions__action str-chat__message-simple__actions__action--options\"\n [floatUiLoose]=\"messageMenuFloat\"\n [looseTrigger]=\"\n messageActionsService.customActionClickHandler\n ? 'none'\n : 'click'\n \"\n [hideOnScroll]=\"false\"\n [hideOnClickOutside]=\"true\"\n [hideOnMouseLeave]=\"false\"\n [disableAnimation]=\"false\"\n [preventOverflow]=\"true\"\n [positionFixed]=\"true\"\n (onSHown)=\"areMessageOptionsOpen = true\"\n (onHidden)=\"areMessageOptionsOpen = false\"\n >\n <div\n *ngIf=\"visibleMessageActionsCount > 0\"\n class=\"str-chat__message-actions-box-button\"\n data-testid=\"message-options-button\"\n (click)=\"messageOptionsButtonClicked()\"\n (keyup.enter)=\"messageOptionsButtonClicked()\"\n >\n <stream-icon-placeholder\n icon=\"action\"\n class=\"str-chat__message-action-icon\"\n ></stream-icon-placeholder>\n </div>\n </div>\n </div>\n <ng-container\n *ngIf=\"\n customTemplatesService.customMessageMetadataInsideBubbleTemplate$\n | async\n \"\n >\n <ng-template\n *ngTemplateOutlet=\"\n (customTemplatesService.customMessageMetadataInsideBubbleTemplate$\n | async)!;\n context: { message: message }\n \"\n ></ng-template>\n </ng-container>\n <div class=\"str-chat__message-reactions-host\">\n <ng-template\n #defaultMessageReactions\n let-messageReactionCounts=\"messageReactionCounts\"\n let-latestReactions=\"latestReactions\"\n let-messageId=\"messageId\"\n let-ownReactions=\"ownReactions\"\n let-messageReactionGroups=\"messageReactionGroups\"\n >\n <stream-message-reactions\n [messageReactionCounts]=\"messageReactionCounts\"\n [latestReactions]=\"latestReactions\"\n [messageId]=\"messageId\"\n [ownReactions]=\"ownReactions\"\n [messageReactionGroups]=\"messageReactionGroups\"\n ></stream-message-reactions>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageReactionsTemplate$ | async) ||\n defaultMessageReactions;\n context: getMessageReactionsContext()\n \"\n ></ng-container>\n </div>\n <float-ui-content #messageMenuFloat>\n <ng-template\n #defaultMessageActionsBox\n let-isMine=\"isMine\"\n let-messageInput=\"message\"\n let-enabledActions=\"enabledActions\"\n let-messageTextHtmlElement=\"messageTextHtmlElement\"\n >\n <stream-message-actions-box\n [isMine]=\"isMine\"\n [message]=\"messageInput\"\n [enabledActions]=\"enabledActions\"\n [messageTextHtmlElement]=\"messageTextHtmlElement\"\n ></stream-message-actions-box>\n </ng-template>\n <ng-container>\n <div\n (click)=\"messageActionsBoxClicked(messageMenuFloat)\"\n (keyup.enter)=\"messageActionsBoxClicked(messageMenuFloat)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageActionsBoxTemplate$\n | async) || defaultMessageActionsBox;\n context: getMessageActionsBoxContext()\n \"\n >\n </ng-container>\n </div>\n </ng-container>\n </float-ui-content>\n <div\n class=\"str-chat__message-bubble str-chat-angular__message-bubble\"\n [class.str-chat-angular__message-bubble--attachment-modal-open]=\"\n imageAttachmentModalState === 'opened'\n \"\n data-testid=\"message-bubble\"\n [floatUiLoose]=\"messageMenuFloat\"\n #messageMenuTrigger=\"floatUiLoose\"\n #messageBubble\n looseTrigger=\"none\"\n [hideOnScroll]=\"false\"\n [hideOnClickOutside]=\"true\"\n [hideOnMouseLeave]=\"false\"\n [disableAnimation]=\"true\"\n [preventOverflow]=\"true\"\n (onShown)=\"areMessageOptionsOpen = true\"\n (onHidden)=\"areMessageOptionsOpen = false\"\n [positionFixed]=\"true\"\n >\n <ng-container *ngIf=\"hasAttachment && !message?.quoted_message\">\n <div class=\"str-chat__attachments-container\">\n <ng-container\n *ngTemplateOutlet=\"attachmentsTemplate\"\n ></ng-container>\n </div>\n </ng-container>\n <div\n *ngIf=\"\n message?.text || (message?.quoted_message && hasAttachment)\n \"\n class=\"str-chat__message-text\"\n tabindex=\"0\"\n [class.str-chat__message-text--pointer-cursor]=\"\n (message?.status === 'failed' &&\n message?.errorStatusCode !== 403) ||\n (this.message?.type === 'error' &&\n this.message?.moderation_details) ||\n message?.message_text_updated_at\n \"\n (click)=\"messageClicked()\"\n (keyup.enter)=\"messageClicked()\"\n >\n <div\n data-testid=\"inner-message\"\n class=\"str-chat__message-text-inner str-chat__message-simple-text-inner\"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n >\n <ng-container *ngTemplateOutlet=\"quotedMessage\"></ng-container>\n <ng-container *ngIf=\"hasAttachment && message?.quoted_message\">\n <ng-container\n *ngTemplateOutlet=\"attachmentsTemplate\"\n ></ng-container>\n </ng-container>\n <div\n *ngIf=\"message?.type === 'error'\"\n data-testid=\"client-error-message\"\n class=\"str-chat__simple-message--error-message str-chat__message--error-message\"\n >\n <ng-container *ngIf=\"!message?.moderation_details\">{{\n \"streamChat.Error \u00B7 Unsent\" | translate\n }}</ng-container>\n </div>\n <div\n *ngIf=\"message?.status === 'failed'\"\n data-testid=\"error-message\"\n class=\"str-chat__simple-message--error-message str-chat__message--error-message\"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed \u00B7 Unauthorized\"\n : \"streamChat.Message Failed \u00B7 Click to try again\"\n ) | translate\n }}\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageTextTemplate$ | async) ||\n defaultText;\n context: getMessageTextContext()\n \"\n ></ng-container>\n <ng-template\n #defaultText\n let-message=\"message\"\n let-isQuoted=\"isQuoted\"\n let-shouldTranslate=\"shouldTranslate\"\n >\n <stream-message-text\n [message]=\"message\"\n [isQuoted]=\"isQuoted\"\n [shouldTranslate]=\"shouldTranslate\"\n data-testid=\"quoted-message-text\"\n ></stream-message-text>\n </ng-template>\n </div>\n </div>\n <stream-icon-placeholder\n class=\"str-chat__message-error-icon\"\n icon=\"error\"\n ></stream-icon-placeholder>\n </div>\n </div>\n <ng-container\n *ngTemplateOutlet=\"replyCountButton; context: { message: message }\"\n ></ng-container>\n\n <ng-container *ngTemplateOutlet=\"messageDateAndSender\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n\n <ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n </ng-template>\n\n <ng-template #systemMessage>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.systemMessageTemplate$ | async) ||\n defaultSystemMessage;\n context: getMessageContext()\n \"\n ></ng-container>\n <ng-template #defaultSystemMessage let-messageInput=\"message\">\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ messageInput?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n </ng-template>\n </ng-template>\n\n <ng-template #quotedMessage>\n <div\n *ngIf=\"message?.quoted_message\"\n class=\"quoted-message str-chat__quoted-message-preview\"\n data-testid=\"quoted-message-container\"\n [class.mine]=\"isSentByCurrentUser\"\n (click)=\"\n jumpToMessage(\n (message?.quoted_message)!.id,\n message?.quoted_message?.parent_id\n )\n \"\n (keyup.enter)=\"\n jumpToMessage(\n (message?.quoted_message)!.id,\n message?.quoted_message?.parent_id\n )\n \"\n >\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [imageUrl]=\"message?.quoted_message?.user?.image\"\n [name]=\"\n message?.quoted_message?.user?.name ||\n message?.quoted_message?.user?.id\n \"\n [user]=\"message?.quoted_message?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"quoted-message-inner str-chat__quoted-message-bubble\">\n <ng-container\n *ngIf=\"\n message?.quoted_message?.attachments &&\n message?.quoted_message?.attachments?.length\n \"\n >\n <ng-template\n #defaultAttachments\n let-messageId=\"messageId\"\n let-attachments=\"attachments\"\n let-parentMessageId=\"parentMessageId\"\n let-imageModalStateChangeHandler=\"imageModalStateChangeHandler\"\n >\n <stream-attachment-list\n [messageId]=\"messageId\"\n [attachments]=\"attachments\"\n [parentMessageId]=\"parentMessageId\"\n (imageModalStateChange)=\"imageModalStateChangeHandler($event)\"\n ></stream-attachment-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentListTemplate$ | async) ||\n defaultAttachments;\n context: getQuotedMessageAttachmentListContext()\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"message?.quoted_message\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageTextTemplate$ | async) ||\n defaultText;\n context: getQuotedMessageTextContext()\n \"\n ></ng-container>\n <ng-template\n #defaultText\n let-message=\"message\"\n let-isQuoted=\"isQuoted\"\n let-shouldTranslate=\"shouldTranslate\"\n >\n <stream-message-text\n [message]=\"message\"\n [isQuoted]=\"isQuoted\"\n [shouldTranslate]=\"shouldTranslate\"\n data-testid=\"quoted-message-text\"\n ></stream-message-text>\n </ng-template>\n </ng-container>\n </div>\n </div>\n </ng-template>\n\n <ng-template #messageDateAndSender>\n <ng-container>\n <div\n *ngIf=\"shouldDisplayTranslationNotice\"\n class=\"str-chat__translation-notice\"\n data-testid=\"translation-notice\"\n >\n <button\n *ngIf=\"displayedMessageTextContent === 'translation'\"\n data-testid=\"see-original\"\n translate\n (click)=\"displayOriginalMessage()\"\n (keyup.enter)=\"displayOriginalMessage()\"\n >\n streamChat.See original (automatically translated)\n </button>\n <button\n *ngIf=\"displayedMessageTextContent === 'original'\"\n data-testid=\"see-translation\"\n translate\n (click)=\"displayTranslatedMessage()\"\n (keyup.enter)=\"displayTranslatedMessage()\"\n >\n streamChat.See translation\n </button>\n </div>\n <ng-container\n *ngIf=\"customTemplatesService.customMessageMetadataTemplate$ | async\"\n >\n <div class=\"str-chat__custom-message-metadata\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.customMessageMetadataTemplate$ | async)!;\n context: getMessageMetadataContext()\n \"\n ></ng-container>\n </div>\n </ng-container>\n <div\n class=\"str-chat__message-data str-chat__message-simple-data str-chat__message-metadata\"\n >\n <ng-container *ngTemplateOutlet=\"messageStatus\"></ng-container>\n\n <span\n *ngIf=\"!isSentByCurrentUser\"\n data-testid=\"sender\"\n class=\"str-chat__message-simple-name str-chat__message-sender-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span\n data-testid=\"date\"\n class=\"str-chat__message-simple-timestamp str-chat__message-simple-time\"\n >\n {{ parsedDate }}\n </span>\n <ng-container *ngIf=\"message?.message_text_updated_at\">\n <span\n data-testid=\"edited-flag\"\n class=\"str-chat__mesage-simple-edited\"\n translate\n >streamChat.Edited</span\n >\n <div\n data-testid=\"edited-timestamp\"\n class=\"str-chat__message-edited-timestamp\"\n [ngClass]=\"{\n 'str-chat__message-edited-timestamp--open': isEditedFlagOpened,\n 'str-chat__message-edited-timestamp--collapsed':\n !isEditedFlagOpened\n }\"\n >\n <span translate>streamChat.Edited</span>\n <time\n dateTime=\"{{ message?.message_text_updated_at }}\"\n title=\"{{ message?.message_text_updated_at }}\"\n >\n {{ pasedEditedDate }}\n </time>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </ng-template>\n\n <ng-template #messageStatus>\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n mode === 'main' &&\n isMessageDeliveredAndRead &&\n canDisplayReadStatus;\n else deliveredStatus\n \"\n >\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n <ng-template #deliveredStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.deliveredStatusTemplate$ | async) ||\n defaultDeliveredStatus;\n context: getDeliveredStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultDeliveredStatus>\n <span\n *ngIf=\"mode === 'main'\"\n class=\"str-chat__message-simple-status str-chat__message-simple-status-angular str-chat__message-status\"\n data-testid=\"delivered-indicator\"\n tabindex=\"0\"\n [floatUiLoose]=\"floatingContent\"\n loosePlacement=\"top\"\n [looseTrigger]=\"hasTouchSupport ? 'click' : 'hover'\"\n [disableAnimation]=\"true\"\n [hideOnClickOutside]=\"true\"\n [positionFixed]=\"true\"\n [preventOverflow]=\"true\"\n >\n <float-ui-content #floatingContent>\n <div class=\"str-chat__tooltip str-chat__tooltip-angular\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n </float-ui-content>\n <stream-icon-placeholder\n data-testid=\"delivered-icon\"\n icon=\"delivered\"\n ></stream-icon-placeholder>\n </span>\n </ng-template>\n <ng-template #sendingStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.sendingStatusTemplate$ | async) ||\n defaultSendingStatus;\n context: getSendingStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultSendingStatus>\n <span\n class=\"str-chat__message-simple-status str-chat__message-simple-status-angular str-chat__message-status\"\n data-testid=\"sending-indicator\"\n tabindex=\"0\"\n [floatUiLoose]=\"floatingContent\"\n loosePlacement=\"top\"\n [looseTrigger]=\"hasTouchSupport ? 'click' : 'hover'\"\n [disableAnimation]=\"true\"\n [hideOnClickOutside]=\"true\"\n [positionFixed]=\"true\"\n [preventOverflow]=\"true\"\n >\n <float-ui-content #floatingContent>\n <div class=\"str-chat__tooltip str-chat__tooltip-angular\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n </float-ui-content>\n <stream-loading-indicator-placeholder\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator-placeholder>\n </span>\n </ng-template>\n <ng-template #readStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.readStatusTemplate$ | async) ||\n defaultReadStatus;\n context: getReadStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultReadStatus let-readByText=\"readByText\">\n <span\n class=\"str-chat__message-simple-status str-chat__message-simple-status-angular str-chat__message-status\"\n data-testid=\"read-indicator\"\n tabindex=\"0\"\n [floatUiLoose]=\"floatingContent\"\n loosePlacement=\"top\"\n [looseTrigger]=\"hasTouchSupport ? 'click' : 'hover'\"\n [disableAnimation]=\"true\"\n [hideOnClickOutside]=\"true\"\n [positionFixed]=\"true\"\n [preventOverflow]=\"true\"\n >\n <float-ui-content #floatingContent>\n <div\n class=\"str-chat__tooltip str-chat__tooltip-angular\"\n data-testid=\"read-by-tooltip\"\n >\n {{ readByText }}\n </div>\n </float-ui-content>\n <stream-icon-placeholder icon=\"read\"></stream-icon-placeholder>\n </span>\n </ng-template>\n </ng-container>\n </ng-template>\n\n <ng-template #replyCountButton>\n <div\n class=\"str-chat__message-simple-reply-button str-chat__message-replies-count-button-wrapper\"\n >\n <ng-container *ngIf=\"shouldDisplayThreadLink\">\n <ng-template\n *ngTemplateOutlet=\"\n (customTemplatesService.threadLinkButton$ | async) || defaultButton;\n context: { message: message }\n \"\n ></ng-template>\n </ng-container>\n <ng-template #defaultButton let-message=\"message\">\n <button\n class=\"str-chat__message-replies-count-button\"\n data-testid=\"reply-count-button\"\n (click)=\"setAsActiveParentMessage()\"\n >\n {{message?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </button>\n </ng-template>\n </div>\n </ng-template>\n\n <ng-template #attachmentsTemplate>\n <ng-template\n #defaultAttachments\n let-messageId=\"messageId\"\n let-attachments=\"attachments\"\n let-parentMessageId=\"parentMessageId\"\n let-imageModalStateChangeHandler=\"imageModalStateChangeHandler\"\n >\n <stream-attachment-list\n [messageId]=\"messageId\"\n [attachments]=\"attachments\"\n [parentMessageId]=\"parentMessageId\"\n (imageModalStateChange)=\"imageModalStateChangeHandler($event)\"\n ></stream-attachment-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentListTemplate$ | async) ||\n defaultAttachments;\n context: getAttachmentListContext()\n \"\n ></ng-container>\n </ng-template>\n</ng-template>\n" }]
|
|
5872
|
+
args: [{ selector: 'stream-message', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container\n *ngIf=\"\n message?.type === 'error' &&\n (message?.moderation_details?.action ===\n 'MESSAGE_RESPONSE_ACTION_REMOVE' ||\n message?.moderation?.action === 'remove');\n else notBlockedMessage\n \"\n>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageBlockedTemplate$ | async) ||\n defaultBlockedMessage;\n context: getMessageBlockedContext()\n \"\n ></ng-container>\n <ng-template #defaultBlockedMessage>\n <stream-message-blocked\n [message]=\"message\"\n [isMyMessage]=\"isSentByCurrentUser\"\n ></stream-message-blocked>\n </ng-template>\n</ng-container>\n<ng-template #notBlockedMessage>\n <div\n data-testid=\"message-container\"\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }} str-chat__message-menu-{{ areMessageOptionsOpen ? 'opened' : 'closed' }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message--other]=\"!isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"hasReactions\"\n [class.str-chat__message--highlighted]=\"isHighlighted\"\n [class.str-chat__message-with-thread-link]=\"shouldDisplayThreadLink\"\n [class.str-chat__message-send-can-be-retried]=\"\n (message?.status === 'failed' && message?.errorStatusCode !== 403) ||\n (message?.type === 'error' && message?.moderation_details)\n \"\n [class.str-chat__message-with-touch-support]=\"hasTouchSupport\"\n [class.str-chat__message-without-touch-support]=\"!hasTouchSupport\"\n >\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <stream-avatar-placeholder\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n type=\"user\"\n location=\"message-sender\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n [user]=\"message?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__message-inner\">\n <div\n *ngIf=\"!hasTouchSupport && areOptionsVisible\"\n class=\"str-chat__message-simple__actions str-chat__message-options\"\n data-testid=\"message-options\"\n [class.str-chat__message-actions-open]=\"areMessageOptionsOpen\"\n >\n <div\n #messageActionsToggle\n data-testid=\"message-actions-container\"\n class=\"str-chat__message-actions-container str-chat__message-simple__actions__action str-chat__message-simple__actions__action--options\"\n [floatUiLoose]=\"messageMenuFloat\"\n [looseTrigger]=\"\n messageActionsService.customActionClickHandler\n ? 'none'\n : 'click'\n \"\n [hideOnScroll]=\"false\"\n [hideOnClickOutside]=\"true\"\n [hideOnMouseLeave]=\"false\"\n [disableAnimation]=\"false\"\n [preventOverflow]=\"true\"\n [positionFixed]=\"true\"\n (onSHown)=\"areMessageOptionsOpen = true\"\n (onHidden)=\"areMessageOptionsOpen = false\"\n >\n <div\n *ngIf=\"visibleMessageActionsCount > 0\"\n class=\"str-chat__message-actions-box-button\"\n data-testid=\"message-options-button\"\n (click)=\"messageOptionsButtonClicked()\"\n (keyup.enter)=\"messageOptionsButtonClicked()\"\n >\n <stream-icon-placeholder\n icon=\"action\"\n class=\"str-chat__message-action-icon\"\n ></stream-icon-placeholder>\n </div>\n </div>\n </div>\n <ng-container\n *ngIf=\"\n customTemplatesService.customMessageMetadataInsideBubbleTemplate$\n | async\n \"\n >\n <ng-template\n *ngTemplateOutlet=\"\n (customTemplatesService.customMessageMetadataInsideBubbleTemplate$\n | async)!;\n context: { message: message }\n \"\n ></ng-template>\n </ng-container>\n <div class=\"str-chat__message-reactions-host\">\n <ng-template\n #defaultMessageReactions\n let-messageReactionCounts=\"messageReactionCounts\"\n let-latestReactions=\"latestReactions\"\n let-messageId=\"messageId\"\n let-ownReactions=\"ownReactions\"\n let-messageReactionGroups=\"messageReactionGroups\"\n >\n <stream-message-reactions\n [messageReactionCounts]=\"messageReactionCounts\"\n [latestReactions]=\"latestReactions\"\n [messageId]=\"messageId\"\n [ownReactions]=\"ownReactions\"\n [messageReactionGroups]=\"messageReactionGroups\"\n ></stream-message-reactions>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageReactionsTemplate$ | async) ||\n defaultMessageReactions;\n context: getMessageReactionsContext()\n \"\n ></ng-container>\n </div>\n <float-ui-content #messageMenuFloat>\n <ng-template\n #defaultMessageActionsBox\n let-isMine=\"isMine\"\n let-messageInput=\"message\"\n let-enabledActions=\"enabledActions\"\n let-messageTextHtmlElement=\"messageTextHtmlElement\"\n >\n <stream-message-actions-box\n [isMine]=\"isMine\"\n [message]=\"messageInput\"\n [enabledActions]=\"enabledActions\"\n [messageTextHtmlElement]=\"messageTextHtmlElement\"\n ></stream-message-actions-box>\n </ng-template>\n <ng-container>\n <div\n (click)=\"messageActionsBoxClicked(messageMenuFloat)\"\n (keyup.enter)=\"messageActionsBoxClicked(messageMenuFloat)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageActionsBoxTemplate$\n | async) || defaultMessageActionsBox;\n context: getMessageActionsBoxContext()\n \"\n >\n </ng-container>\n </div>\n </ng-container>\n </float-ui-content>\n <div\n class=\"str-chat__message-bubble str-chat-angular__message-bubble\"\n [class.str-chat-angular__message-bubble--attachment-modal-open]=\"\n nestedModalState === 'opened'\n \"\n data-testid=\"message-bubble\"\n [floatUiLoose]=\"messageMenuFloat\"\n #messageMenuTrigger=\"floatUiLoose\"\n #messageBubble\n looseTrigger=\"none\"\n [hideOnScroll]=\"false\"\n [hideOnClickOutside]=\"true\"\n [hideOnMouseLeave]=\"false\"\n [disableAnimation]=\"true\"\n [preventOverflow]=\"true\"\n (onShown)=\"areMessageOptionsOpen = true\"\n (onHidden)=\"areMessageOptionsOpen = false\"\n [positionFixed]=\"true\"\n >\n <ng-container *ngIf=\"hasAttachment && !message?.quoted_message\">\n <div class=\"str-chat__attachments-container\">\n <ng-container\n *ngTemplateOutlet=\"attachmentsTemplate\"\n ></ng-container>\n </div>\n </ng-container>\n <ng-container\n *ngIf=\"\n message?.poll_id &&\n (customTemplatesService.pollTemplate$ | async)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.pollTemplate$ | async)!;\n context: {\n pollId: message?.poll_id,\n messageId: message?.id,\n isQuote: false\n }\n \"\n ></ng-container>\n </ng-container>\n <div\n *ngIf=\"\n message?.text || (message?.quoted_message && hasAttachment)\n \"\n class=\"str-chat__message-text\"\n tabindex=\"0\"\n [class.str-chat__message-text--pointer-cursor]=\"\n (message?.status === 'failed' &&\n message?.errorStatusCode !== 403) ||\n (this.message?.type === 'error' &&\n this.message?.moderation_details) ||\n message?.message_text_updated_at\n \"\n (click)=\"messageClicked()\"\n (keyup.enter)=\"messageClicked()\"\n >\n <div\n data-testid=\"inner-message\"\n class=\"str-chat__message-text-inner str-chat__message-simple-text-inner\"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n >\n <ng-container *ngTemplateOutlet=\"quotedMessage\"></ng-container>\n <ng-container *ngIf=\"hasAttachment && message?.quoted_message\">\n <ng-container\n *ngTemplateOutlet=\"attachmentsTemplate\"\n ></ng-container>\n </ng-container>\n <div\n *ngIf=\"message?.type === 'error'\"\n data-testid=\"client-error-message\"\n class=\"str-chat__simple-message--error-message str-chat__message--error-message\"\n >\n <ng-container *ngIf=\"!message?.moderation_details\">{{\n \"streamChat.Error \u00B7 Unsent\" | translate\n }}</ng-container>\n </div>\n <div\n *ngIf=\"message?.status === 'failed'\"\n data-testid=\"error-message\"\n class=\"str-chat__simple-message--error-message str-chat__message--error-message\"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed \u00B7 Unauthorized\"\n : \"streamChat.Message Failed \u00B7 Click to try again\"\n ) | translate\n }}\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageTextTemplate$ | async) ||\n defaultText;\n context: getMessageTextContext()\n \"\n ></ng-container>\n <ng-template\n #defaultText\n let-message=\"message\"\n let-isQuoted=\"isQuoted\"\n let-shouldTranslate=\"shouldTranslate\"\n >\n <stream-message-text\n [message]=\"message\"\n [isQuoted]=\"isQuoted\"\n [shouldTranslate]=\"shouldTranslate\"\n data-testid=\"quoted-message-text\"\n ></stream-message-text>\n </ng-template>\n </div>\n </div>\n <stream-icon-placeholder\n class=\"str-chat__message-error-icon\"\n icon=\"error\"\n ></stream-icon-placeholder>\n </div>\n </div>\n <ng-container\n *ngTemplateOutlet=\"replyCountButton; context: { message: message }\"\n ></ng-container>\n\n <ng-container *ngTemplateOutlet=\"messageDateAndSender\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n\n <ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n </ng-template>\n\n <ng-template #systemMessage>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.systemMessageTemplate$ | async) ||\n defaultSystemMessage;\n context: getMessageContext()\n \"\n ></ng-container>\n <ng-template #defaultSystemMessage let-messageInput=\"message\">\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ messageInput?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n </ng-template>\n </ng-template>\n\n <ng-template #quotedMessage>\n <div\n *ngIf=\"message?.quoted_message\"\n class=\"quoted-message str-chat__quoted-message-preview\"\n data-testid=\"quoted-message-container\"\n [class.mine]=\"isSentByCurrentUser\"\n (click)=\"\n jumpToMessage(\n (message?.quoted_message)!.id,\n message?.quoted_message?.parent_id\n )\n \"\n (keyup.enter)=\"\n jumpToMessage(\n (message?.quoted_message)!.id,\n message?.quoted_message?.parent_id\n )\n \"\n >\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [imageUrl]=\"message?.quoted_message?.user?.image\"\n [name]=\"\n message?.quoted_message?.user?.name ||\n message?.quoted_message?.user?.id\n \"\n [user]=\"message?.quoted_message?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"quoted-message-inner str-chat__quoted-message-bubble\">\n <ng-container\n *ngIf=\"\n message?.quoted_message?.attachments &&\n message?.quoted_message?.attachments?.length\n \"\n >\n <ng-template\n #defaultAttachments\n let-messageId=\"messageId\"\n let-attachments=\"attachments\"\n let-parentMessageId=\"parentMessageId\"\n let-imageModalStateChangeHandler=\"imageModalStateChangeHandler\"\n >\n <stream-attachment-list\n [messageId]=\"messageId\"\n [attachments]=\"attachments\"\n [parentMessageId]=\"parentMessageId\"\n (imageModalStateChange)=\"imageModalStateChangeHandler($event)\"\n ></stream-attachment-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentListTemplate$ | async) ||\n defaultAttachments;\n context: getQuotedMessageAttachmentListContext()\n \"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"\n message?.quoted_message?.poll_id &&\n (customTemplatesService.pollTemplate$ | async)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.pollTemplate$ | async)!;\n context: {\n pollId: message?.quoted_message?.poll_id,\n messageId: message?.quoted_message?.id,\n isQuote: true\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"message?.quoted_message\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageTextTemplate$ | async) ||\n defaultText;\n context: getQuotedMessageTextContext()\n \"\n ></ng-container>\n <ng-template\n #defaultText\n let-message=\"message\"\n let-isQuoted=\"isQuoted\"\n let-shouldTranslate=\"shouldTranslate\"\n >\n <stream-message-text\n [message]=\"message\"\n [isQuoted]=\"isQuoted\"\n [shouldTranslate]=\"shouldTranslate\"\n data-testid=\"quoted-message-text\"\n ></stream-message-text>\n </ng-template>\n </ng-container>\n </div>\n </div>\n </ng-template>\n\n <ng-template #messageDateAndSender>\n <ng-container>\n <div\n *ngIf=\"shouldDisplayTranslationNotice\"\n class=\"str-chat__translation-notice\"\n data-testid=\"translation-notice\"\n >\n <button\n *ngIf=\"displayedMessageTextContent === 'translation'\"\n data-testid=\"see-original\"\n translate\n (click)=\"displayOriginalMessage()\"\n (keyup.enter)=\"displayOriginalMessage()\"\n >\n streamChat.See original (automatically translated)\n </button>\n <button\n *ngIf=\"displayedMessageTextContent === 'original'\"\n data-testid=\"see-translation\"\n translate\n (click)=\"displayTranslatedMessage()\"\n (keyup.enter)=\"displayTranslatedMessage()\"\n >\n streamChat.See translation\n </button>\n </div>\n <ng-container\n *ngIf=\"customTemplatesService.customMessageMetadataTemplate$ | async\"\n >\n <div class=\"str-chat__custom-message-metadata\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.customMessageMetadataTemplate$ | async)!;\n context: getMessageMetadataContext()\n \"\n ></ng-container>\n </div>\n </ng-container>\n <div\n class=\"str-chat__message-data str-chat__message-simple-data str-chat__message-metadata\"\n >\n <ng-container *ngTemplateOutlet=\"messageStatus\"></ng-container>\n\n <span\n *ngIf=\"!isSentByCurrentUser\"\n data-testid=\"sender\"\n class=\"str-chat__message-simple-name str-chat__message-sender-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span\n data-testid=\"date\"\n class=\"str-chat__message-simple-timestamp str-chat__message-simple-time\"\n >\n {{ parsedDate }}\n </span>\n <ng-container *ngIf=\"message?.message_text_updated_at\">\n <span\n data-testid=\"edited-flag\"\n class=\"str-chat__mesage-simple-edited\"\n translate\n >streamChat.Edited</span\n >\n <div\n data-testid=\"edited-timestamp\"\n class=\"str-chat__message-edited-timestamp\"\n [ngClass]=\"{\n 'str-chat__message-edited-timestamp--open': isEditedFlagOpened,\n 'str-chat__message-edited-timestamp--collapsed':\n !isEditedFlagOpened\n }\"\n >\n <span translate>streamChat.Edited</span>\n <time\n dateTime=\"{{ message?.message_text_updated_at }}\"\n title=\"{{ message?.message_text_updated_at }}\"\n >\n {{ pasedEditedDate }}\n </time>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </ng-template>\n\n <ng-template #messageStatus>\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n mode === 'main' &&\n isMessageDeliveredAndRead &&\n canDisplayReadStatus;\n else deliveredStatus\n \"\n >\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n <ng-template #deliveredStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.deliveredStatusTemplate$ | async) ||\n defaultDeliveredStatus;\n context: getDeliveredStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultDeliveredStatus>\n <span\n *ngIf=\"mode === 'main'\"\n class=\"str-chat__message-simple-status str-chat__message-simple-status-angular str-chat__message-status\"\n data-testid=\"delivered-indicator\"\n tabindex=\"0\"\n [floatUiLoose]=\"floatingContent\"\n loosePlacement=\"top\"\n [looseTrigger]=\"hasTouchSupport ? 'click' : 'hover'\"\n [disableAnimation]=\"true\"\n [hideOnClickOutside]=\"true\"\n [positionFixed]=\"true\"\n [preventOverflow]=\"true\"\n >\n <float-ui-content #floatingContent>\n <div class=\"str-chat__tooltip str-chat__tooltip-angular\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n </float-ui-content>\n <stream-icon-placeholder\n data-testid=\"delivered-icon\"\n icon=\"delivered\"\n ></stream-icon-placeholder>\n </span>\n </ng-template>\n <ng-template #sendingStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.sendingStatusTemplate$ | async) ||\n defaultSendingStatus;\n context: getSendingStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultSendingStatus>\n <span\n class=\"str-chat__message-simple-status str-chat__message-simple-status-angular str-chat__message-status\"\n data-testid=\"sending-indicator\"\n tabindex=\"0\"\n [floatUiLoose]=\"floatingContent\"\n loosePlacement=\"top\"\n [looseTrigger]=\"hasTouchSupport ? 'click' : 'hover'\"\n [disableAnimation]=\"true\"\n [hideOnClickOutside]=\"true\"\n [positionFixed]=\"true\"\n [preventOverflow]=\"true\"\n >\n <float-ui-content #floatingContent>\n <div class=\"str-chat__tooltip str-chat__tooltip-angular\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n </float-ui-content>\n <stream-loading-indicator-placeholder\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator-placeholder>\n </span>\n </ng-template>\n <ng-template #readStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.readStatusTemplate$ | async) ||\n defaultReadStatus;\n context: getReadStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultReadStatus let-readByText=\"readByText\">\n <span\n class=\"str-chat__message-simple-status str-chat__message-simple-status-angular str-chat__message-status\"\n data-testid=\"read-indicator\"\n tabindex=\"0\"\n [floatUiLoose]=\"floatingContent\"\n loosePlacement=\"top\"\n [looseTrigger]=\"hasTouchSupport ? 'click' : 'hover'\"\n [disableAnimation]=\"true\"\n [hideOnClickOutside]=\"true\"\n [positionFixed]=\"true\"\n [preventOverflow]=\"true\"\n >\n <float-ui-content #floatingContent>\n <div\n class=\"str-chat__tooltip str-chat__tooltip-angular\"\n data-testid=\"read-by-tooltip\"\n >\n {{ readByText }}\n </div>\n </float-ui-content>\n <stream-icon-placeholder icon=\"read\"></stream-icon-placeholder>\n </span>\n </ng-template>\n </ng-container>\n </ng-template>\n\n <ng-template #replyCountButton>\n <div\n class=\"str-chat__message-simple-reply-button str-chat__message-replies-count-button-wrapper\"\n >\n <ng-container *ngIf=\"shouldDisplayThreadLink\">\n <ng-template\n *ngTemplateOutlet=\"\n (customTemplatesService.threadLinkButton$ | async) || defaultButton;\n context: { message: message }\n \"\n ></ng-template>\n </ng-container>\n <ng-template #defaultButton let-message=\"message\">\n <button\n class=\"str-chat__message-replies-count-button\"\n data-testid=\"reply-count-button\"\n (click)=\"setAsActiveParentMessage()\"\n >\n {{message?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </button>\n </ng-template>\n </div>\n </ng-template>\n\n <ng-template #attachmentsTemplate>\n <ng-template\n #defaultAttachments\n let-messageId=\"messageId\"\n let-attachments=\"attachments\"\n let-parentMessageId=\"parentMessageId\"\n let-imageModalStateChangeHandler=\"imageModalStateChangeHandler\"\n >\n <stream-attachment-list\n [messageId]=\"messageId\"\n [attachments]=\"attachments\"\n [parentMessageId]=\"parentMessageId\"\n (imageModalStateChange)=\"imageModalStateChangeHandler($event)\"\n ></stream-attachment-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentListTemplate$ | async) ||\n defaultAttachments;\n context: getAttachmentListContext()\n \"\n ></ng-container>\n </ng-template>\n</ng-template>\n" }]
|
|
5795
5873
|
}], ctorParameters: function () { return [{ type: ChatClientService }, { type: ChannelService }, { type: CustomTemplatesService }, { type: i0.ChangeDetectorRef }, { type: DateParserService }, { type: MessageActionsService }, { type: i0.NgZone }, { type: i6.TranslateService }]; }, propDecorators: { message: [{
|
|
5796
5874
|
type: Input
|
|
5797
5875
|
}], enabledMessageActions: [{
|
|
@@ -6528,7 +6606,7 @@ class AttachmentPreviewListComponent {
|
|
|
6528
6606
|
}
|
|
6529
6607
|
}
|
|
6530
6608
|
AttachmentPreviewListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AttachmentPreviewListComponent, deps: [{ token: CustomTemplatesService }, { token: AttachmentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6531
|
-
AttachmentPreviewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list", inputs: { attachmentUploads$: "attachmentUploads$" }, outputs: { retryAttachmentUpload: "retryAttachmentUpload", deleteAttachment: "deleteAttachment" }, ngImport: i0, template: "<div\n *ngIf=\"\n (attachmentUploads$ | async)?.length ||\n (customAttachments.length > 0 && customAttachmentsPreview)\n \"\n class=\"str-chat__attachment-preview-list\"\n>\n <div class=\"str-chat__attachment-list-scroll-container\">\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"str-chat__attachment-preview-image\"\n data-testclass=\"attachment-image-preview\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n deleteButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"str-chat__attachment-preview-image-loading\"\n >\n <stream-loading-indicator-placeholder\n data-testclass=\"loading-indicator\"\n ></stream-loading-indicator-placeholder>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n retryButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n class=\"str-chat__attachment-preview-thumbnail\"\n data-testclass=\"attachment-image\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"{{ attachmentUpload.file.name }}\"\n />\n </div>\n <div\n *ngIf=\"\n attachmentUpload.type === 'file' ||\n attachmentUpload.type === 'video' ||\n attachmentUpload.type === 'voiceRecording'\n \"\n class=\"str-chat__attachment-preview-file str-chat__attachment-preview-type-{{\n attachmentUpload.type\n }}\"\n data-testclass=\"attachment-file-preview\"\n >\n <stream-icon-placeholder\n class=\"str-chat__attachment-preview-file-icon\"\n icon=\"unspecified-filetype\"\n ></stream-icon-placeholder>\n\n <div class=\"str-chat__attachment-preview-file-end\">\n <div\n class=\"str-chat__attachment-preview-file-name\"\n title=\"{{ attachmentUpload.file.name }}\"\n >\n {{ attachmentUpload.file.name }}\n </div>\n <a\n *ngIf=\"attachmentUpload.state === 'success'\"\n class=\"str-chat__attachment-preview-file-download\"\n data-testclass=\"file-download-link\"\n download\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n >\n <stream-icon-placeholder icon=\"download\"></stream-icon-placeholder>\n </a>\n <stream-loading-indicator-placeholder\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n data-testclass=\"loading-indicator\"\n ></stream-loading-indicator-placeholder>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n deleteButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n retryButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"customAttachmentsPreview\">\n <ng-template\n *ngTemplateOutlet=\"\n customAttachmentsPreview;\n context: { service: attachmentService }\n \"\n ></ng-template>\n </ng-container>\n </div>\n</div>\n\n<ng-template #deleteButton let-attachmentUpload=\"attachmentUpload\">\n <div\n class=\"str-chat__attachment-preview-delete\"\n data-testclass=\"file-delete\"\n role=\"button\"\n (click)=\"attachmentDeleted(attachmentUpload)\"\n (keyup.enter)=\"attachmentDeleted(attachmentUpload)\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </div>\n</ng-template>\n\n<ng-template #retryButton let-attachmentUpload=\"attachmentUpload\">\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n data-testclass=\"upload-retry\"\n class=\"str-chat__attachment-preview-error str-chat__attachment-preview-error-{{\n attachmentUpload.type === 'image' ? 'image' : 'file'\n }}\"\n (click)=\"attachmentUploadRetried(attachmentUpload.file)\"\n (keyup.enter)=\"attachmentUploadRetried(attachmentUpload.file)\"\n >\n <stream-icon-placeholder icon=\"retry\"></stream-icon-placeholder>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type:
|
|
6609
|
+
AttachmentPreviewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list", inputs: { attachmentUploads$: "attachmentUploads$" }, outputs: { retryAttachmentUpload: "retryAttachmentUpload", deleteAttachment: "deleteAttachment" }, ngImport: i0, template: "<div\n *ngIf=\"\n (attachmentUploads$ | async)?.length ||\n (customAttachments.length > 0 && customAttachmentsPreview)\n \"\n class=\"str-chat__attachment-preview-list\"\n>\n <div class=\"str-chat__attachment-list-scroll-container\">\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"str-chat__attachment-preview-image\"\n data-testclass=\"attachment-image-preview\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n deleteButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"str-chat__attachment-preview-image-loading\"\n >\n <stream-loading-indicator-placeholder\n data-testclass=\"loading-indicator\"\n ></stream-loading-indicator-placeholder>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n retryButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n class=\"str-chat__attachment-preview-thumbnail\"\n data-testclass=\"attachment-image\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"{{ attachmentUpload.file.name }}\"\n />\n </div>\n <div\n *ngIf=\"\n attachmentUpload.type === 'file' ||\n attachmentUpload.type === 'video' ||\n attachmentUpload.type === 'voiceRecording'\n \"\n class=\"str-chat__attachment-preview-file str-chat__attachment-preview-type-{{\n attachmentUpload.type\n }}\"\n data-testclass=\"attachment-file-preview\"\n >\n <stream-icon-placeholder\n class=\"str-chat__attachment-preview-file-icon\"\n icon=\"unspecified-filetype\"\n ></stream-icon-placeholder>\n\n <div class=\"str-chat__attachment-preview-file-end\">\n <div\n class=\"str-chat__attachment-preview-file-name\"\n title=\"{{ attachmentUpload.file.name }}\"\n >\n {{ attachmentUpload.file.name }}\n </div>\n <a\n *ngIf=\"attachmentUpload.state === 'success'\"\n class=\"str-chat__attachment-preview-file-download\"\n data-testclass=\"file-download-link\"\n download\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n >\n <stream-icon-placeholder icon=\"download\"></stream-icon-placeholder>\n </a>\n <stream-loading-indicator-placeholder\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n data-testclass=\"loading-indicator\"\n ></stream-loading-indicator-placeholder>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n deleteButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n retryButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"customAttachmentsPreview\">\n <ng-template\n *ngTemplateOutlet=\"\n customAttachmentsPreview;\n context: { service: attachmentService }\n \"\n ></ng-template>\n </ng-container>\n </div>\n</div>\n\n<ng-template #deleteButton let-attachmentUpload=\"attachmentUpload\">\n <div\n class=\"str-chat__attachment-preview-delete\"\n data-testclass=\"file-delete\"\n role=\"button\"\n (click)=\"attachmentDeleted(attachmentUpload)\"\n (keyup.enter)=\"attachmentDeleted(attachmentUpload)\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </div>\n</ng-template>\n\n<ng-template #retryButton let-attachmentUpload=\"attachmentUpload\">\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n data-testclass=\"upload-retry\"\n class=\"str-chat__attachment-preview-error str-chat__attachment-preview-error-{{\n attachmentUpload.type === 'image' ? 'image' : 'file'\n }}\"\n (click)=\"attachmentUploadRetried(attachmentUpload.file)\"\n (keyup.enter)=\"attachmentUploadRetried(attachmentUpload.file)\"\n >\n <stream-icon-placeholder icon=\"retry\"></stream-icon-placeholder>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "component", type: LoadingIndicatorPlaceholderComponent, selector: "stream-loading-indicator-placeholder" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
6532
6610
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AttachmentPreviewListComponent, decorators: [{
|
|
6533
6611
|
type: Component,
|
|
6534
6612
|
args: [{ selector: 'stream-attachment-preview-list', template: "<div\n *ngIf=\"\n (attachmentUploads$ | async)?.length ||\n (customAttachments.length > 0 && customAttachmentsPreview)\n \"\n class=\"str-chat__attachment-preview-list\"\n>\n <div class=\"str-chat__attachment-list-scroll-container\">\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"str-chat__attachment-preview-image\"\n data-testclass=\"attachment-image-preview\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n deleteButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"str-chat__attachment-preview-image-loading\"\n >\n <stream-loading-indicator-placeholder\n data-testclass=\"loading-indicator\"\n ></stream-loading-indicator-placeholder>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n retryButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n class=\"str-chat__attachment-preview-thumbnail\"\n data-testclass=\"attachment-image\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"{{ attachmentUpload.file.name }}\"\n />\n </div>\n <div\n *ngIf=\"\n attachmentUpload.type === 'file' ||\n attachmentUpload.type === 'video' ||\n attachmentUpload.type === 'voiceRecording'\n \"\n class=\"str-chat__attachment-preview-file str-chat__attachment-preview-type-{{\n attachmentUpload.type\n }}\"\n data-testclass=\"attachment-file-preview\"\n >\n <stream-icon-placeholder\n class=\"str-chat__attachment-preview-file-icon\"\n icon=\"unspecified-filetype\"\n ></stream-icon-placeholder>\n\n <div class=\"str-chat__attachment-preview-file-end\">\n <div\n class=\"str-chat__attachment-preview-file-name\"\n title=\"{{ attachmentUpload.file.name }}\"\n >\n {{ attachmentUpload.file.name }}\n </div>\n <a\n *ngIf=\"attachmentUpload.state === 'success'\"\n class=\"str-chat__attachment-preview-file-download\"\n data-testclass=\"file-download-link\"\n download\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n >\n <stream-icon-placeholder icon=\"download\"></stream-icon-placeholder>\n </a>\n <stream-loading-indicator-placeholder\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n data-testclass=\"loading-indicator\"\n ></stream-loading-indicator-placeholder>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n deleteButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n retryButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"customAttachmentsPreview\">\n <ng-template\n *ngTemplateOutlet=\"\n customAttachmentsPreview;\n context: { service: attachmentService }\n \"\n ></ng-template>\n </ng-container>\n </div>\n</div>\n\n<ng-template #deleteButton let-attachmentUpload=\"attachmentUpload\">\n <div\n class=\"str-chat__attachment-preview-delete\"\n data-testclass=\"file-delete\"\n role=\"button\"\n (click)=\"attachmentDeleted(attachmentUpload)\"\n (keyup.enter)=\"attachmentDeleted(attachmentUpload)\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </div>\n</ng-template>\n\n<ng-template #retryButton let-attachmentUpload=\"attachmentUpload\">\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n data-testclass=\"upload-retry\"\n class=\"str-chat__attachment-preview-error str-chat__attachment-preview-error-{{\n attachmentUpload.type === 'image' ? 'image' : 'file'\n }}\"\n (click)=\"attachmentUploadRetried(attachmentUpload.file)\"\n (keyup.enter)=\"attachmentUploadRetried(attachmentUpload.file)\"\n >\n <stream-icon-placeholder icon=\"retry\"></stream-icon-placeholder>\n </div>\n</ng-template>\n" }]
|
|
@@ -6579,6 +6657,10 @@ class MessageInputComponent {
|
|
|
6579
6657
|
* You can enable/disable voice recordings with this input
|
|
6580
6658
|
*/
|
|
6581
6659
|
this.displayVoiceRecordingButton = false;
|
|
6660
|
+
/**
|
|
6661
|
+
* You can enable/disable polls with this input
|
|
6662
|
+
*/
|
|
6663
|
+
this.displayPollCreateButton = false;
|
|
6582
6664
|
/**
|
|
6583
6665
|
* Emits when a message was successfuly sent or updated
|
|
6584
6666
|
*/
|
|
@@ -6590,10 +6672,19 @@ class MessageInputComponent {
|
|
|
6590
6672
|
this.typingStart$ = new Subject();
|
|
6591
6673
|
this.isCooldownInProgress = false;
|
|
6592
6674
|
this.fileInputId = v4();
|
|
6675
|
+
this.isComposerOpen = false;
|
|
6593
6676
|
this.subscriptions = [];
|
|
6594
6677
|
this.isViewInited = false;
|
|
6595
6678
|
this.defaultTextareaPlaceholder = 'streamChat.Type your message';
|
|
6596
6679
|
this.slowModeTextareaPlaceholder = 'streamChat.Slow Mode ON';
|
|
6680
|
+
this.closePollComposer = () => {
|
|
6681
|
+
this.isComposerOpen = false;
|
|
6682
|
+
};
|
|
6683
|
+
this.addPoll = (pollId) => {
|
|
6684
|
+
this.isComposerOpen = false;
|
|
6685
|
+
this.pollId = pollId;
|
|
6686
|
+
void this.messageSent();
|
|
6687
|
+
};
|
|
6597
6688
|
this.textareaPlaceholder = this.defaultTextareaPlaceholder;
|
|
6598
6689
|
this.subscriptions.push(this.attachmentService.attachmentUploadInProgressCounter$.subscribe((counter) => {
|
|
6599
6690
|
if (counter === 0 && this.hideNotification) {
|
|
@@ -6605,6 +6696,7 @@ class MessageInputComponent {
|
|
|
6605
6696
|
if (channel && this.channel && channel.id !== this.channel.id) {
|
|
6606
6697
|
this.textareaValue = '';
|
|
6607
6698
|
this.attachmentService.resetAttachmentUploads();
|
|
6699
|
+
this.pollId = undefined;
|
|
6608
6700
|
this.voiceRecorderService.isRecorderVisible$.next(false);
|
|
6609
6701
|
}
|
|
6610
6702
|
const capabilities = channel?.data?.own_capabilities;
|
|
@@ -6612,6 +6704,7 @@ class MessageInputComponent {
|
|
|
6612
6704
|
this.isFileUploadAuthorized =
|
|
6613
6705
|
capabilities.indexOf('upload-file') !== -1;
|
|
6614
6706
|
this.canSendLinks = capabilities.indexOf('send-links') !== -1;
|
|
6707
|
+
this.canSendPolls = capabilities.indexOf('send-poll') !== -1;
|
|
6615
6708
|
this.channel = channel;
|
|
6616
6709
|
this.setCanSendMessages();
|
|
6617
6710
|
}
|
|
@@ -6748,7 +6841,8 @@ class MessageInputComponent {
|
|
|
6748
6841
|
text = text.replace(/\n+$/g, ''); // ending empty lines
|
|
6749
6842
|
const textContainsOnlySpaceChars = !text.replace(/ /g, ''); //spcae
|
|
6750
6843
|
if ((!text || textContainsOnlySpaceChars) &&
|
|
6751
|
-
(!attachments || attachments.length === 0)
|
|
6844
|
+
(!attachments || attachments.length === 0) &&
|
|
6845
|
+
!this.pollId) {
|
|
6752
6846
|
return;
|
|
6753
6847
|
}
|
|
6754
6848
|
if (textContainsOnlySpaceChars) {
|
|
@@ -6758,8 +6852,10 @@ class MessageInputComponent {
|
|
|
6758
6852
|
this.notificationService.addTemporaryNotification('streamChat.Sending links is not allowed in this conversation');
|
|
6759
6853
|
return;
|
|
6760
6854
|
}
|
|
6855
|
+
const pollId = this.pollId;
|
|
6761
6856
|
if (!this.isUpdate) {
|
|
6762
6857
|
this.textareaValue = '';
|
|
6858
|
+
this.pollId = undefined;
|
|
6763
6859
|
}
|
|
6764
6860
|
try {
|
|
6765
6861
|
const message = await (this.isUpdate
|
|
@@ -6768,7 +6864,7 @@ class MessageInputComponent {
|
|
|
6768
6864
|
text: text,
|
|
6769
6865
|
attachments: attachments,
|
|
6770
6866
|
})
|
|
6771
|
-
: this.channelService.sendMessage(text, attachments, this.mentionedUsers, this.parentMessageId, this.quotedMessage?.id));
|
|
6867
|
+
: this.channelService.sendMessage(text, attachments, this.mentionedUsers, this.parentMessageId, this.quotedMessage?.id, undefined, pollId));
|
|
6772
6868
|
this.messageUpdate.emit({ message });
|
|
6773
6869
|
if (this.isUpdate) {
|
|
6774
6870
|
this.deselectMessageToEdit();
|
|
@@ -6857,6 +6953,9 @@ class MessageInputComponent {
|
|
|
6857
6953
|
this.voiceRecorderService.isRecorderVisible$.next(true);
|
|
6858
6954
|
}
|
|
6859
6955
|
}
|
|
6956
|
+
openPollComposer() {
|
|
6957
|
+
this.isComposerOpen = true;
|
|
6958
|
+
}
|
|
6860
6959
|
async voiceRecordingReady(recording) {
|
|
6861
6960
|
try {
|
|
6862
6961
|
await this.attachmentService.uploadVoiceRecording(recording);
|
|
@@ -6965,17 +7064,19 @@ class MessageInputComponent {
|
|
|
6965
7064
|
if (this.isUpdate) {
|
|
6966
7065
|
this.attachmentService.createFromAttachments(this.message.attachments || []);
|
|
6967
7066
|
this.textareaValue = this.message.text || '';
|
|
7067
|
+
this.pollId = this.message.poll_id;
|
|
6968
7068
|
}
|
|
6969
7069
|
else {
|
|
6970
7070
|
this.textareaValue = '';
|
|
7071
|
+
this.pollId = undefined;
|
|
6971
7072
|
}
|
|
6972
7073
|
}
|
|
6973
7074
|
}
|
|
6974
7075
|
MessageInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageInputComponent, deps: [{ token: ChannelService }, { token: NotificationService }, { token: AttachmentService }, { token: MessageInputConfigService }, { token: textareaInjectionToken }, { token: i0.ComponentFactoryResolver }, { token: i0.ChangeDetectorRef }, { token: EmojiInputService }, { token: CustomTemplatesService }, { token: MessageActionsService }, { token: VoiceRecorderService }, { token: AudioRecorderService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
6975
|
-
MessageInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageInputComponent, selector: "stream-message-input", inputs: { isFileUploadEnabled: "isFileUploadEnabled", areMentionsEnabled: "areMentionsEnabled", mentionScope: "mentionScope", mode: "mode", isMultipleFileUploadEnabled: "isMultipleFileUploadEnabled", message: "message", sendMessage$: "sendMessage$", inputMode: "inputMode", autoFocus: "autoFocus", watchForMessageToEdit: "watchForMessageToEdit", displaySendButton: "displaySendButton", displayVoiceRecordingButton: "displayVoiceRecordingButton" }, outputs: { messageUpdate: "messageUpdate" }, host: { properties: { "class": "this.class" } }, providers: [AttachmentService, EmojiInputService, VoiceRecorderService], queries: [{ propertyName: "voiceRecorderRef", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "textareaAnchor", first: true, predicate: TextareaDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"str-chat__message-input str-chat-angular__message-input\"\n [style.display]=\"isVoiceRecording ? 'none' : 'flex'\"\n>\n <div *ngIf=\"quotedMessage\" class=\"str-chat__quoted-message-preview-header\">\n <div class=\"str-chat__quoted-message-reply-to-message\">\n {{ \"streamChat.Reply to Message\" | translate }}\n </div>\n <button\n class=\"str-chat__quoted-message-remove\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n <div *ngIf=\"isUpdate\" class=\"str-chat__quoted-message-preview-header\">\n <div class=\"str-chat__quoted-message-reply-to-message\">\n {{ \"streamChat.Edit Message\" | translate }}\n </div>\n <button\n class=\"str-chat__quoted-message-remove\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToEdit()\"\n (keyup.enter)=\"deselectMessageToEdit()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n <ng-container *ngIf=\"canSendMessages; else notAllowed\">\n <div\n class=\"str-chat__message-input-inner str-chat-angular__message-input-inner\"\n >\n <ng-content select=\"[message-input-start]\"></ng-content>\n <ng-container\n *ngIf=\"isFileUploadEnabled && isFileUploadAuthorized && canSendMessages\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customAttachmentUploadTemplate || defaultAttachmentUpload;\n context: getAttachmentUploadContext()\n \"\n ></ng-container>\n <ng-template #defaultAttachmentUpload>\n <div\n class=\"str-chat__file-input-container\"\n data-testid=\"file-upload-button\"\n >\n <input\n #fileInput\n type=\"file\"\n class=\"str-chat__file-input\"\n data-testid=\"file-input\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n id=\"{{ fileInputId }}\"\n [disabled]=\"\n (attachmentService.attachmentsCounter$ | async)! >=\n attachmentService.maxNumberOfAttachments\n \"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <label class=\"str-chat__file-input-label\" for=\"{{ fileInputId }}\">\n <stream-icon-placeholder icon=\"attach\"></stream-icon-placeholder>\n </label>\n </div>\n </ng-template>\n </ng-container>\n <div class=\"str-chat__message-textarea-container\">\n <div\n *ngIf=\"quotedMessage\"\n data-testid=\"quoted-message-container\"\n class=\"str-chat__quoted-message-preview\"\n >\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [imageUrl]=\"quotedMessage.user?.image\"\n [name]=\"quotedMessage.user?.name || quotedMessage.user?.id\"\n [user]=\"quotedMessage.user || undefined\"\n ></stream-avatar-placeholder>\n <div\n class=\"quoted-message-preview-content-inner str-chat__quoted-message-bubble\"\n >\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage.id\"\n ></stream-attachment-list>\n <div class=\"str-chat__quoted-message-text\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageTextTemplate$ | async) ||\n defaultText;\n context: getQuotedMessageTextContext()\n \"\n ></ng-container>\n <ng-template\n #defaultText\n let-message=\"message\"\n let-isQuoted=\"isQuoted\"\n let-shouldTranslate=\"shouldTranslate\"\n >\n <stream-message-text\n [message]=\"message\"\n [isQuoted]=\"isQuoted\"\n [shouldTranslate]=\"shouldTranslate\"\n data-testid=\"quoted-message-text\"\n ></stream-message-text>\n </ng-template>\n </div>\n </div>\n </div>\n <ng-template\n #defaultAttachmentsPreview\n let-attachmentUploads$=\"attachmentUploads$\"\n let-retryUploadHandler=\"retryUploadHandler\"\n let-deleteUploadHandler=\"deleteUploadHandler\"\n >\n <stream-attachment-preview-list\n class=\"str-chat__attachment-preview-list-angular-host\"\n [attachmentUploads$]=\"attachmentUploads$\"\n (retryAttachmentUpload)=\"retryUploadHandler($event)\"\n (deleteAttachment)=\"deleteUploadHandler($event)\"\n ></stream-attachment-preview-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n attachmentPreviewListTemplate || defaultAttachmentsPreview;\n context: getAttachmentPreviewListContext()\n \"\n ></ng-container>\n <div class=\"str-chat__message-textarea-with-emoji-picker\">\n <ng-container\n streamTextarea\n [componentRef]=\"textareaRef\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionScope]=\"mentionScope\"\n [inputMode]=\"inputMode\"\n [autoFocus]=\"autoFocus\"\n [placeholder]=\"textareaPlaceholder\"\n [(value)]=\"textareaValue\"\n (valueChange)=\"typingStart$.next()\"\n (send)=\"messageSent()\"\n (userMentions)=\"mentionedUsers = $event\"\n (pasteFromClipboard)=\"itemsPasted($event)\"\n ></ng-container>\n <ng-container *ngIf=\"emojiPickerTemplate\" data-testid=\"emoji-picker\">\n <ng-container\n *ngTemplateOutlet=\"\n emojiPickerTemplate;\n context: getEmojiPickerContext()\n \"\n ></ng-container>\n </ng-container>\n </div>\n </div>\n <button\n *ngIf=\"canSendMessages && !isCooldownInProgress && displaySendButton\"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n [disabled]=\"\n (attachmentUploadInProgressCounter$ | async)! > 0 ||\n (attachmentService.attachmentsCounter$ | async)! >\n attachmentService.maxNumberOfAttachments ||\n (!textareaValue &&\n (attachmentUploads$ | async)!.length === 0 &&\n (customAttachments$ | async)!.length === 0)\n \"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon-placeholder icon=\"send\"></stream-icon-placeholder>\n </button>\n <div\n *ngIf=\"isCooldownInProgress\"\n class=\"str-chat__message-input-cooldown\"\n data-testid=\"cooldown-timer\"\n >\n {{ cooldown$ | async }}\n </div>\n <button\n *ngIf=\"displayVoiceRecordingButton\"\n class=\"str-chat__start-recording-audio-button\"\n data-testid=\"start-voice-recording\"\n [disabled]=\"\n voiceRecorderService.isRecorderVisible$.value ||\n audioRecorder?.isRecording ||\n (attachmentService.attachmentsCounter$ | async)! >=\n attachmentService.maxNumberOfAttachments\n \"\n (click)=\"startVoiceRecording()\"\n (keyup.enter)=\"startVoiceRecording()\"\n >\n <stream-icon-placeholder icon=\"mic\"></stream-icon-placeholder>\n </button>\n <ng-content select=\"[message-input-end]\"></ng-content>\n </div>\n </ng-container>\n <ng-template #notAllowed>\n <div\n class=\"str-chat__message-input-not-allowed\"\n data-testid=\"disabled-textarea\"\n >\n {{ disabledTextareaText | translate }}\n </div>\n </ng-template>\n</div>\n<ng-template\n *ngIf=\"voiceRecorderRef\"\n [ngTemplateOutlet]=\"voiceRecorderRef\"\n [ngTemplateOutletContext]=\"{ service: voiceRecorderService }\"\n></ng-template>\n", dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: ["name", "imageUrl", "location", "channel", "user", "type", "initialsType", "showOnlineIndicator"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "component", type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["messageId", "parentMessageId", "attachments"], outputs: ["imageModalStateChange"] }, { kind: "component", type: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list", inputs: ["attachmentUploads$"], outputs: ["retryAttachmentUpload", "deleteAttachment"] }, { kind: "directive", type: TextareaDirective, selector: "[streamTextarea]", inputs: ["componentRef", "areMentionsEnabled", "mentionScope", "inputMode", "value", "placeholder", "autoFocus"], outputs: ["valueChange", "send", "userMentions", "pasteFromClipboard"] }, { kind: "component", type: MessageTextComponent, selector: "stream-message-text", inputs: ["message", "isQuoted", "shouldTranslate"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
7076
|
+
MessageInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageInputComponent, selector: "stream-message-input", inputs: { isFileUploadEnabled: "isFileUploadEnabled", areMentionsEnabled: "areMentionsEnabled", mentionScope: "mentionScope", mode: "mode", isMultipleFileUploadEnabled: "isMultipleFileUploadEnabled", message: "message", sendMessage$: "sendMessage$", inputMode: "inputMode", autoFocus: "autoFocus", watchForMessageToEdit: "watchForMessageToEdit", displaySendButton: "displaySendButton", displayVoiceRecordingButton: "displayVoiceRecordingButton", displayPollCreateButton: "displayPollCreateButton" }, outputs: { messageUpdate: "messageUpdate" }, host: { properties: { "class": "this.class" } }, providers: [AttachmentService, EmojiInputService, VoiceRecorderService], queries: [{ propertyName: "voiceRecorderRef", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "textareaAnchor", first: true, predicate: TextareaDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"str-chat__message-input str-chat-angular__message-input\"\n [style.display]=\"isVoiceRecording ? 'none' : 'flex'\"\n>\n <div *ngIf=\"quotedMessage\" class=\"str-chat__quoted-message-preview-header\">\n <div class=\"str-chat__quoted-message-reply-to-message\">\n {{ \"streamChat.Reply to Message\" | translate }}\n </div>\n <button\n class=\"str-chat__quoted-message-remove\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n <div *ngIf=\"isUpdate\" class=\"str-chat__quoted-message-preview-header\">\n <div class=\"str-chat__quoted-message-reply-to-message\">\n {{ \"streamChat.Edit Message\" | translate }}\n </div>\n <button\n class=\"str-chat__quoted-message-remove\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToEdit()\"\n (keyup.enter)=\"deselectMessageToEdit()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n <ng-container *ngIf=\"canSendMessages; else notAllowed\">\n <div\n class=\"str-chat__message-input-inner str-chat-angular__message-input-inner\"\n >\n <ng-content select=\"[message-input-start]\"></ng-content>\n <ng-container\n *ngIf=\"isFileUploadEnabled && isFileUploadAuthorized && canSendMessages\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customAttachmentUploadTemplate || defaultAttachmentUpload;\n context: getAttachmentUploadContext()\n \"\n ></ng-container>\n <ng-template #defaultAttachmentUpload>\n <div\n class=\"str-chat__file-input-container\"\n data-testid=\"file-upload-button\"\n >\n <input\n #fileInput\n type=\"file\"\n class=\"str-chat__file-input\"\n data-testid=\"file-input\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n id=\"{{ fileInputId }}\"\n [disabled]=\"\n (attachmentService.attachmentsCounter$ | async)! >=\n attachmentService.maxNumberOfAttachments\n \"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <label class=\"str-chat__file-input-label\" for=\"{{ fileInputId }}\">\n <stream-icon-placeholder icon=\"attach\"></stream-icon-placeholder>\n </label>\n </div>\n </ng-template>\n </ng-container>\n <ng-container\n *ngIf=\"canSendPolls && displayPollCreateButton && mode !== 'thread'\"\n >\n <button\n class=\"str-chat-angular__create-poll\"\n (click)=\"openPollComposer()\"\n >\n <stream-icon-placeholder icon=\"poll\"></stream-icon-placeholder>\n </button>\n </ng-container>\n <div class=\"str-chat__message-textarea-container\">\n <div\n *ngIf=\"quotedMessage\"\n data-testid=\"quoted-message-container\"\n class=\"str-chat__quoted-message-preview\"\n >\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [imageUrl]=\"quotedMessage.user?.image\"\n [name]=\"quotedMessage.user?.name || quotedMessage.user?.id\"\n [user]=\"quotedMessage.user || undefined\"\n ></stream-avatar-placeholder>\n <div\n class=\"quoted-message-preview-content-inner str-chat__quoted-message-bubble\"\n >\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage.id\"\n ></stream-attachment-list>\n <ng-container\n *ngIf=\"\n quotedMessage?.poll_id &&\n (customTemplatesService.pollTemplate$ | async)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.pollTemplate$ | async)!;\n context: {\n pollId: quotedMessage?.poll_id,\n messageId: quotedMessage?.id,\n isQuote: true\n }\n \"\n ></ng-container>\n </ng-container>\n <div class=\"str-chat__quoted-message-text\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageTextTemplate$ | async) ||\n defaultText;\n context: getQuotedMessageTextContext()\n \"\n ></ng-container>\n <ng-template\n #defaultText\n let-message=\"message\"\n let-isQuoted=\"isQuoted\"\n let-shouldTranslate=\"shouldTranslate\"\n >\n <stream-message-text\n [message]=\"message\"\n [isQuoted]=\"isQuoted\"\n [shouldTranslate]=\"shouldTranslate\"\n data-testid=\"quoted-message-text\"\n ></stream-message-text>\n </ng-template>\n </div>\n </div>\n </div>\n <ng-template\n #defaultAttachmentsPreview\n let-attachmentUploads$=\"attachmentUploads$\"\n let-retryUploadHandler=\"retryUploadHandler\"\n let-deleteUploadHandler=\"deleteUploadHandler\"\n >\n <stream-attachment-preview-list\n class=\"str-chat__attachment-preview-list-angular-host\"\n [attachmentUploads$]=\"attachmentUploads$\"\n (retryAttachmentUpload)=\"retryUploadHandler($event)\"\n (deleteAttachment)=\"deleteUploadHandler($event)\"\n ></stream-attachment-preview-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n attachmentPreviewListTemplate || defaultAttachmentsPreview;\n context: getAttachmentPreviewListContext()\n \"\n ></ng-container>\n <div class=\"str-chat__message-textarea-with-emoji-picker\">\n <ng-container\n streamTextarea\n [componentRef]=\"textareaRef\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionScope]=\"mentionScope\"\n [inputMode]=\"inputMode\"\n [autoFocus]=\"autoFocus\"\n [placeholder]=\"textareaPlaceholder\"\n [(value)]=\"textareaValue\"\n (valueChange)=\"typingStart$.next()\"\n (send)=\"messageSent()\"\n (userMentions)=\"mentionedUsers = $event\"\n (pasteFromClipboard)=\"itemsPasted($event)\"\n ></ng-container>\n <ng-container *ngIf=\"emojiPickerTemplate\" data-testid=\"emoji-picker\">\n <ng-container\n *ngTemplateOutlet=\"\n emojiPickerTemplate;\n context: getEmojiPickerContext()\n \"\n ></ng-container>\n </ng-container>\n </div>\n </div>\n <button\n *ngIf=\"canSendMessages && !isCooldownInProgress && displaySendButton\"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n [disabled]=\"\n (attachmentUploadInProgressCounter$ | async)! > 0 ||\n (attachmentService.attachmentsCounter$ | async)! >\n attachmentService.maxNumberOfAttachments ||\n (!textareaValue &&\n (attachmentUploads$ | async)!.length === 0 &&\n (customAttachments$ | async)!.length === 0)\n \"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon-placeholder icon=\"send\"></stream-icon-placeholder>\n </button>\n <div\n *ngIf=\"isCooldownInProgress\"\n class=\"str-chat__message-input-cooldown\"\n data-testid=\"cooldown-timer\"\n >\n {{ cooldown$ | async }}\n </div>\n <button\n *ngIf=\"displayVoiceRecordingButton\"\n class=\"str-chat__start-recording-audio-button\"\n data-testid=\"start-voice-recording\"\n [disabled]=\"\n voiceRecorderService.isRecorderVisible$.value ||\n audioRecorder?.isRecording ||\n (attachmentService.attachmentsCounter$ | async)! >=\n attachmentService.maxNumberOfAttachments\n \"\n (click)=\"startVoiceRecording()\"\n (keyup.enter)=\"startVoiceRecording()\"\n >\n <stream-icon-placeholder icon=\"mic\"></stream-icon-placeholder>\n </button>\n <ng-content select=\"[message-input-end]\"></ng-content>\n </div>\n </ng-container>\n <ng-template #notAllowed>\n <div\n class=\"str-chat__message-input-not-allowed\"\n data-testid=\"disabled-textarea\"\n >\n {{ disabledTextareaText | translate }}\n </div>\n </ng-template>\n</div>\n<ng-template\n *ngIf=\"voiceRecorderRef\"\n [ngTemplateOutlet]=\"voiceRecorderRef\"\n [ngTemplateOutletContext]=\"{ service: voiceRecorderService }\"\n></ng-template>\n<ng-template\n *ngIf=\"\n isComposerOpen && (customTemplatesService.pollComposerTemplate$ | async)\n \"\n [ngTemplateOutlet]=\"(customTemplatesService.pollComposerTemplate$ | async)!\"\n [ngTemplateOutletContext]=\"{\n pollCompose: addPoll,\n cancel: closePollComposer\n }\"\n></ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: ["name", "imageUrl", "location", "channel", "user", "type", "initialsType", "showOnlineIndicator"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "component", type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["messageId", "parentMessageId", "attachments"], outputs: ["imageModalStateChange"] }, { kind: "component", type: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list", inputs: ["attachmentUploads$"], outputs: ["retryAttachmentUpload", "deleteAttachment"] }, { kind: "directive", type: TextareaDirective, selector: "[streamTextarea]", inputs: ["componentRef", "areMentionsEnabled", "mentionScope", "inputMode", "value", "placeholder", "autoFocus"], outputs: ["valueChange", "send", "userMentions", "pasteFromClipboard"] }, { kind: "component", type: MessageTextComponent, selector: "stream-message-text", inputs: ["message", "isQuoted", "shouldTranslate"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
6976
7077
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageInputComponent, decorators: [{
|
|
6977
7078
|
type: Component,
|
|
6978
|
-
args: [{ selector: 'stream-message-input', providers: [AttachmentService, EmojiInputService, VoiceRecorderService], template: "<div\n class=\"str-chat__message-input str-chat-angular__message-input\"\n [style.display]=\"isVoiceRecording ? 'none' : 'flex'\"\n>\n <div *ngIf=\"quotedMessage\" class=\"str-chat__quoted-message-preview-header\">\n <div class=\"str-chat__quoted-message-reply-to-message\">\n {{ \"streamChat.Reply to Message\" | translate }}\n </div>\n <button\n class=\"str-chat__quoted-message-remove\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n <div *ngIf=\"isUpdate\" class=\"str-chat__quoted-message-preview-header\">\n <div class=\"str-chat__quoted-message-reply-to-message\">\n {{ \"streamChat.Edit Message\" | translate }}\n </div>\n <button\n class=\"str-chat__quoted-message-remove\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToEdit()\"\n (keyup.enter)=\"deselectMessageToEdit()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n <ng-container *ngIf=\"canSendMessages; else notAllowed\">\n <div\n class=\"str-chat__message-input-inner str-chat-angular__message-input-inner\"\n >\n <ng-content select=\"[message-input-start]\"></ng-content>\n <ng-container\n *ngIf=\"isFileUploadEnabled && isFileUploadAuthorized && canSendMessages\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customAttachmentUploadTemplate || defaultAttachmentUpload;\n context: getAttachmentUploadContext()\n \"\n ></ng-container>\n <ng-template #defaultAttachmentUpload>\n <div\n class=\"str-chat__file-input-container\"\n data-testid=\"file-upload-button\"\n >\n <input\n #fileInput\n type=\"file\"\n class=\"str-chat__file-input\"\n data-testid=\"file-input\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n id=\"{{ fileInputId }}\"\n [disabled]=\"\n (attachmentService.attachmentsCounter$ | async)! >=\n attachmentService.maxNumberOfAttachments\n \"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <label class=\"str-chat__file-input-label\" for=\"{{ fileInputId }}\">\n <stream-icon-placeholder icon=\"attach\"></stream-icon-placeholder>\n </label>\n </div>\n </ng-template>\n </ng-container>\n <div class=\"str-chat__message-textarea-container\">\n <div\n *ngIf=\"quotedMessage\"\n data-testid=\"quoted-message-container\"\n class=\"str-chat__quoted-message-preview\"\n >\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [imageUrl]=\"quotedMessage.user?.image\"\n [name]=\"quotedMessage.user?.name || quotedMessage.user?.id\"\n [user]=\"quotedMessage.user || undefined\"\n ></stream-avatar-placeholder>\n <div\n class=\"quoted-message-preview-content-inner str-chat__quoted-message-bubble\"\n >\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage.id\"\n ></stream-attachment-list>\n <div class=\"str-chat__quoted-message-text\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageTextTemplate$ | async) ||\n defaultText;\n context: getQuotedMessageTextContext()\n \"\n ></ng-container>\n <ng-template\n #defaultText\n let-message=\"message\"\n let-isQuoted=\"isQuoted\"\n let-shouldTranslate=\"shouldTranslate\"\n >\n <stream-message-text\n [message]=\"message\"\n [isQuoted]=\"isQuoted\"\n [shouldTranslate]=\"shouldTranslate\"\n data-testid=\"quoted-message-text\"\n ></stream-message-text>\n </ng-template>\n </div>\n </div>\n </div>\n <ng-template\n #defaultAttachmentsPreview\n let-attachmentUploads$=\"attachmentUploads$\"\n let-retryUploadHandler=\"retryUploadHandler\"\n let-deleteUploadHandler=\"deleteUploadHandler\"\n >\n <stream-attachment-preview-list\n class=\"str-chat__attachment-preview-list-angular-host\"\n [attachmentUploads$]=\"attachmentUploads$\"\n (retryAttachmentUpload)=\"retryUploadHandler($event)\"\n (deleteAttachment)=\"deleteUploadHandler($event)\"\n ></stream-attachment-preview-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n attachmentPreviewListTemplate || defaultAttachmentsPreview;\n context: getAttachmentPreviewListContext()\n \"\n ></ng-container>\n <div class=\"str-chat__message-textarea-with-emoji-picker\">\n <ng-container\n streamTextarea\n [componentRef]=\"textareaRef\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionScope]=\"mentionScope\"\n [inputMode]=\"inputMode\"\n [autoFocus]=\"autoFocus\"\n [placeholder]=\"textareaPlaceholder\"\n [(value)]=\"textareaValue\"\n (valueChange)=\"typingStart$.next()\"\n (send)=\"messageSent()\"\n (userMentions)=\"mentionedUsers = $event\"\n (pasteFromClipboard)=\"itemsPasted($event)\"\n ></ng-container>\n <ng-container *ngIf=\"emojiPickerTemplate\" data-testid=\"emoji-picker\">\n <ng-container\n *ngTemplateOutlet=\"\n emojiPickerTemplate;\n context: getEmojiPickerContext()\n \"\n ></ng-container>\n </ng-container>\n </div>\n </div>\n <button\n *ngIf=\"canSendMessages && !isCooldownInProgress && displaySendButton\"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n [disabled]=\"\n (attachmentUploadInProgressCounter$ | async)! > 0 ||\n (attachmentService.attachmentsCounter$ | async)! >\n attachmentService.maxNumberOfAttachments ||\n (!textareaValue &&\n (attachmentUploads$ | async)!.length === 0 &&\n (customAttachments$ | async)!.length === 0)\n \"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon-placeholder icon=\"send\"></stream-icon-placeholder>\n </button>\n <div\n *ngIf=\"isCooldownInProgress\"\n class=\"str-chat__message-input-cooldown\"\n data-testid=\"cooldown-timer\"\n >\n {{ cooldown$ | async }}\n </div>\n <button\n *ngIf=\"displayVoiceRecordingButton\"\n class=\"str-chat__start-recording-audio-button\"\n data-testid=\"start-voice-recording\"\n [disabled]=\"\n voiceRecorderService.isRecorderVisible$.value ||\n audioRecorder?.isRecording ||\n (attachmentService.attachmentsCounter$ | async)! >=\n attachmentService.maxNumberOfAttachments\n \"\n (click)=\"startVoiceRecording()\"\n (keyup.enter)=\"startVoiceRecording()\"\n >\n <stream-icon-placeholder icon=\"mic\"></stream-icon-placeholder>\n </button>\n <ng-content select=\"[message-input-end]\"></ng-content>\n </div>\n </ng-container>\n <ng-template #notAllowed>\n <div\n class=\"str-chat__message-input-not-allowed\"\n data-testid=\"disabled-textarea\"\n >\n {{ disabledTextareaText | translate }}\n </div>\n </ng-template>\n</div>\n<ng-template\n *ngIf=\"voiceRecorderRef\"\n [ngTemplateOutlet]=\"voiceRecorderRef\"\n [ngTemplateOutletContext]=\"{ service: voiceRecorderService }\"\n></ng-template>\n" }]
|
|
7079
|
+
args: [{ selector: 'stream-message-input', providers: [AttachmentService, EmojiInputService, VoiceRecorderService], template: "<div\n class=\"str-chat__message-input str-chat-angular__message-input\"\n [style.display]=\"isVoiceRecording ? 'none' : 'flex'\"\n>\n <div *ngIf=\"quotedMessage\" class=\"str-chat__quoted-message-preview-header\">\n <div class=\"str-chat__quoted-message-reply-to-message\">\n {{ \"streamChat.Reply to Message\" | translate }}\n </div>\n <button\n class=\"str-chat__quoted-message-remove\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n <div *ngIf=\"isUpdate\" class=\"str-chat__quoted-message-preview-header\">\n <div class=\"str-chat__quoted-message-reply-to-message\">\n {{ \"streamChat.Edit Message\" | translate }}\n </div>\n <button\n class=\"str-chat__quoted-message-remove\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToEdit()\"\n (keyup.enter)=\"deselectMessageToEdit()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n <ng-container *ngIf=\"canSendMessages; else notAllowed\">\n <div\n class=\"str-chat__message-input-inner str-chat-angular__message-input-inner\"\n >\n <ng-content select=\"[message-input-start]\"></ng-content>\n <ng-container\n *ngIf=\"isFileUploadEnabled && isFileUploadAuthorized && canSendMessages\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customAttachmentUploadTemplate || defaultAttachmentUpload;\n context: getAttachmentUploadContext()\n \"\n ></ng-container>\n <ng-template #defaultAttachmentUpload>\n <div\n class=\"str-chat__file-input-container\"\n data-testid=\"file-upload-button\"\n >\n <input\n #fileInput\n type=\"file\"\n class=\"str-chat__file-input\"\n data-testid=\"file-input\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n id=\"{{ fileInputId }}\"\n [disabled]=\"\n (attachmentService.attachmentsCounter$ | async)! >=\n attachmentService.maxNumberOfAttachments\n \"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <label class=\"str-chat__file-input-label\" for=\"{{ fileInputId }}\">\n <stream-icon-placeholder icon=\"attach\"></stream-icon-placeholder>\n </label>\n </div>\n </ng-template>\n </ng-container>\n <ng-container\n *ngIf=\"canSendPolls && displayPollCreateButton && mode !== 'thread'\"\n >\n <button\n class=\"str-chat-angular__create-poll\"\n (click)=\"openPollComposer()\"\n >\n <stream-icon-placeholder icon=\"poll\"></stream-icon-placeholder>\n </button>\n </ng-container>\n <div class=\"str-chat__message-textarea-container\">\n <div\n *ngIf=\"quotedMessage\"\n data-testid=\"quoted-message-container\"\n class=\"str-chat__quoted-message-preview\"\n >\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [imageUrl]=\"quotedMessage.user?.image\"\n [name]=\"quotedMessage.user?.name || quotedMessage.user?.id\"\n [user]=\"quotedMessage.user || undefined\"\n ></stream-avatar-placeholder>\n <div\n class=\"quoted-message-preview-content-inner str-chat__quoted-message-bubble\"\n >\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage.id\"\n ></stream-attachment-list>\n <ng-container\n *ngIf=\"\n quotedMessage?.poll_id &&\n (customTemplatesService.pollTemplate$ | async)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.pollTemplate$ | async)!;\n context: {\n pollId: quotedMessage?.poll_id,\n messageId: quotedMessage?.id,\n isQuote: true\n }\n \"\n ></ng-container>\n </ng-container>\n <div class=\"str-chat__quoted-message-text\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageTextTemplate$ | async) ||\n defaultText;\n context: getQuotedMessageTextContext()\n \"\n ></ng-container>\n <ng-template\n #defaultText\n let-message=\"message\"\n let-isQuoted=\"isQuoted\"\n let-shouldTranslate=\"shouldTranslate\"\n >\n <stream-message-text\n [message]=\"message\"\n [isQuoted]=\"isQuoted\"\n [shouldTranslate]=\"shouldTranslate\"\n data-testid=\"quoted-message-text\"\n ></stream-message-text>\n </ng-template>\n </div>\n </div>\n </div>\n <ng-template\n #defaultAttachmentsPreview\n let-attachmentUploads$=\"attachmentUploads$\"\n let-retryUploadHandler=\"retryUploadHandler\"\n let-deleteUploadHandler=\"deleteUploadHandler\"\n >\n <stream-attachment-preview-list\n class=\"str-chat__attachment-preview-list-angular-host\"\n [attachmentUploads$]=\"attachmentUploads$\"\n (retryAttachmentUpload)=\"retryUploadHandler($event)\"\n (deleteAttachment)=\"deleteUploadHandler($event)\"\n ></stream-attachment-preview-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n attachmentPreviewListTemplate || defaultAttachmentsPreview;\n context: getAttachmentPreviewListContext()\n \"\n ></ng-container>\n <div class=\"str-chat__message-textarea-with-emoji-picker\">\n <ng-container\n streamTextarea\n [componentRef]=\"textareaRef\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionScope]=\"mentionScope\"\n [inputMode]=\"inputMode\"\n [autoFocus]=\"autoFocus\"\n [placeholder]=\"textareaPlaceholder\"\n [(value)]=\"textareaValue\"\n (valueChange)=\"typingStart$.next()\"\n (send)=\"messageSent()\"\n (userMentions)=\"mentionedUsers = $event\"\n (pasteFromClipboard)=\"itemsPasted($event)\"\n ></ng-container>\n <ng-container *ngIf=\"emojiPickerTemplate\" data-testid=\"emoji-picker\">\n <ng-container\n *ngTemplateOutlet=\"\n emojiPickerTemplate;\n context: getEmojiPickerContext()\n \"\n ></ng-container>\n </ng-container>\n </div>\n </div>\n <button\n *ngIf=\"canSendMessages && !isCooldownInProgress && displaySendButton\"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n [disabled]=\"\n (attachmentUploadInProgressCounter$ | async)! > 0 ||\n (attachmentService.attachmentsCounter$ | async)! >\n attachmentService.maxNumberOfAttachments ||\n (!textareaValue &&\n (attachmentUploads$ | async)!.length === 0 &&\n (customAttachments$ | async)!.length === 0)\n \"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon-placeholder icon=\"send\"></stream-icon-placeholder>\n </button>\n <div\n *ngIf=\"isCooldownInProgress\"\n class=\"str-chat__message-input-cooldown\"\n data-testid=\"cooldown-timer\"\n >\n {{ cooldown$ | async }}\n </div>\n <button\n *ngIf=\"displayVoiceRecordingButton\"\n class=\"str-chat__start-recording-audio-button\"\n data-testid=\"start-voice-recording\"\n [disabled]=\"\n voiceRecorderService.isRecorderVisible$.value ||\n audioRecorder?.isRecording ||\n (attachmentService.attachmentsCounter$ | async)! >=\n attachmentService.maxNumberOfAttachments\n \"\n (click)=\"startVoiceRecording()\"\n (keyup.enter)=\"startVoiceRecording()\"\n >\n <stream-icon-placeholder icon=\"mic\"></stream-icon-placeholder>\n </button>\n <ng-content select=\"[message-input-end]\"></ng-content>\n </div>\n </ng-container>\n <ng-template #notAllowed>\n <div\n class=\"str-chat__message-input-not-allowed\"\n data-testid=\"disabled-textarea\"\n >\n {{ disabledTextareaText | translate }}\n </div>\n </ng-template>\n</div>\n<ng-template\n *ngIf=\"voiceRecorderRef\"\n [ngTemplateOutlet]=\"voiceRecorderRef\"\n [ngTemplateOutletContext]=\"{ service: voiceRecorderService }\"\n></ng-template>\n<ng-template\n *ngIf=\"\n isComposerOpen && (customTemplatesService.pollComposerTemplate$ | async)\n \"\n [ngTemplateOutlet]=\"(customTemplatesService.pollComposerTemplate$ | async)!\"\n [ngTemplateOutletContext]=\"{\n pollCompose: addPoll,\n cancel: closePollComposer\n }\"\n></ng-template>\n" }]
|
|
6979
7080
|
}], ctorParameters: function () { return [{ type: ChannelService }, { type: NotificationService }, { type: AttachmentService }, { type: MessageInputConfigService }, { type: i0.Type, decorators: [{
|
|
6980
7081
|
type: Inject,
|
|
6981
7082
|
args: [textareaInjectionToken]
|
|
@@ -7005,6 +7106,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
7005
7106
|
type: Input
|
|
7006
7107
|
}], displayVoiceRecordingButton: [{
|
|
7007
7108
|
type: Input
|
|
7109
|
+
}], displayPollCreateButton: [{
|
|
7110
|
+
type: Input
|
|
7008
7111
|
}], messageUpdate: [{
|
|
7009
7112
|
type: Output
|
|
7010
7113
|
}], voiceRecorderRef: [{
|
|
@@ -7438,7 +7541,7 @@ class AutocompleteTextareaComponent {
|
|
|
7438
7541
|
}
|
|
7439
7542
|
}
|
|
7440
7543
|
AutocompleteTextareaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AutocompleteTextareaComponent, deps: [{ token: ChannelService }, { token: ChatClientService }, { token: TransliterationService }, { token: EmojiInputService }, { token: CustomTemplatesService }, { token: i0.ChangeDetectorRef }, { token: MessageInputConfigService }], target: i0.ɵɵFactoryTarget.Component });
|
|
7441
|
-
AutocompleteTextareaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AutocompleteTextareaComponent, selector: "stream-autocomplete-textarea", inputs: { value: "value", placeholder: "placeholder", areMentionsEnabled: "areMentionsEnabled", inputMode: "inputMode", mentionScope: "mentionScope", autoFocus: "autoFocus" }, outputs: { valueChange: "valueChange", send: "send", userMentions: "userMentions", pasteFromClipboard: "pasteFromClipboard" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<textarea\n #input\n data-testid=\"textarea\"\n class=\"rta__textarea str-chat__textarea__textarea str-chat__angular-textarea str-chat__message-textarea\"\n rows=\"1\"\n [value]=\"value || ''\"\n [autofocus]=\"autoFocus\"\n placeholder=\"{{ placeholder | translate }}\"\n [mentionConfig]=\"autocompleteConfig\"\n [mentionListTemplate]=\"autocompleteItem\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"enterHit($event)\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n (blur)=\"inputLeft()\"\n (paste)=\"pasteFromClipboard.emit($event)\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <ng-container *ngIf=\"item.templateRef; else builtinItem\">\n <ng-container\n *ngTemplateOutlet=\"item.templateRef; context: { item: item }\"\n ></ng-container>\n </ng-container>\n <ng-template #builtinItem>\n <div\n class=\"rta rta__item str-chat__emojisearch__item\"\n [ngSwitch]=\"item.type\"\n >\n <div *ngSwitchCase=\"'mention'\" class=\"rta__entity\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n <div *ngSwitchCase=\"'command'\" class=\"rta__entity\">\n <ng-container\n *ngTemplateOutlet=\"\n commandAutocompleteItemTemplate || defaultCommandTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n </ng-template>\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 type=\"user\"\n location=\"autocomplete-item\"\n [imageUrl]=\"item.image || item.user?.image\"\n [name]=\"item.autocompleteLabel\"\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>\n</ng-template>\n", dependencies: [{ kind: "directive", type:
|
|
7544
|
+
AutocompleteTextareaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AutocompleteTextareaComponent, selector: "stream-autocomplete-textarea", inputs: { value: "value", placeholder: "placeholder", areMentionsEnabled: "areMentionsEnabled", inputMode: "inputMode", mentionScope: "mentionScope", autoFocus: "autoFocus" }, outputs: { valueChange: "valueChange", send: "send", userMentions: "userMentions", pasteFromClipboard: "pasteFromClipboard" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<textarea\n #input\n data-testid=\"textarea\"\n class=\"rta__textarea str-chat__textarea__textarea str-chat__angular-textarea str-chat__message-textarea\"\n rows=\"1\"\n [value]=\"value || ''\"\n [autofocus]=\"autoFocus\"\n placeholder=\"{{ placeholder | translate }}\"\n [mentionConfig]=\"autocompleteConfig\"\n [mentionListTemplate]=\"autocompleteItem\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"enterHit($event)\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n (blur)=\"inputLeft()\"\n (paste)=\"pasteFromClipboard.emit($event)\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <ng-container *ngIf=\"item.templateRef; else builtinItem\">\n <ng-container\n *ngTemplateOutlet=\"item.templateRef; context: { item: item }\"\n ></ng-container>\n </ng-container>\n <ng-template #builtinItem>\n <div\n class=\"rta rta__item str-chat__emojisearch__item\"\n [ngSwitch]=\"item.type\"\n >\n <div *ngSwitchCase=\"'mention'\" class=\"rta__entity\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n <div *ngSwitchCase=\"'command'\" class=\"rta__entity\">\n <ng-container\n *ngTemplateOutlet=\"\n commandAutocompleteItemTemplate || defaultCommandTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n </ng-template>\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 type=\"user\"\n location=\"autocomplete-item\"\n [imageUrl]=\"item.image || item.user?.image\"\n [name]=\"item.autocompleteLabel\"\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>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i8$1.MentionDirective, selector: "[mention], [mentionConfig]", inputs: ["mentionConfig", "mention", "mentionListTemplate"], outputs: ["searchTerm", "itemSelected", "opened", "closed"] }, { kind: "component", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: ["name", "imageUrl", "location", "channel", "user", "type", "initialsType", "showOnlineIndicator"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
7442
7545
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AutocompleteTextareaComponent, decorators: [{
|
|
7443
7546
|
type: Component,
|
|
7444
7547
|
args: [{ selector: 'stream-autocomplete-textarea', template: "<textarea\n #input\n data-testid=\"textarea\"\n class=\"rta__textarea str-chat__textarea__textarea str-chat__angular-textarea str-chat__message-textarea\"\n rows=\"1\"\n [value]=\"value || ''\"\n [autofocus]=\"autoFocus\"\n placeholder=\"{{ placeholder | translate }}\"\n [mentionConfig]=\"autocompleteConfig\"\n [mentionListTemplate]=\"autocompleteItem\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"enterHit($event)\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n (blur)=\"inputLeft()\"\n (paste)=\"pasteFromClipboard.emit($event)\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <ng-container *ngIf=\"item.templateRef; else builtinItem\">\n <ng-container\n *ngTemplateOutlet=\"item.templateRef; context: { item: item }\"\n ></ng-container>\n </ng-container>\n <ng-template #builtinItem>\n <div\n class=\"rta rta__item str-chat__emojisearch__item\"\n [ngSwitch]=\"item.type\"\n >\n <div *ngSwitchCase=\"'mention'\" class=\"rta__entity\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n <div *ngSwitchCase=\"'command'\" class=\"rta__entity\">\n <ng-container\n *ngTemplateOutlet=\"\n commandAutocompleteItemTemplate || defaultCommandTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n </ng-template>\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 type=\"user\"\n location=\"autocomplete-item\"\n [imageUrl]=\"item.image || item.user?.image\"\n [name]=\"item.autocompleteLabel\"\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>\n</ng-template>\n" }]
|
|
@@ -8527,7 +8630,7 @@ class MessageListComponent {
|
|
|
8527
8630
|
}
|
|
8528
8631
|
}
|
|
8529
8632
|
MessageListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageListComponent, deps: [{ token: ChannelService }, { token: ChatClientService }, { token: CustomTemplatesService }, { token: DateParserService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
8530
|
-
MessageListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageListComponent, selector: "stream-message-list", inputs: { mode: "mode", direction: "direction", hideJumpToLatestButtonDuringScroll: "hideJumpToLatestButtonDuringScroll", displayDateSeparator: "displayDateSeparator", displayUnreadSeparator: "displayUnreadSeparator", dateSeparatorTextPos: "dateSeparatorTextPos", openMessageListAt: "openMessageListAt", hideUnreadCountForNotificationAndIndicator: "hideUnreadCountForNotificationAndIndicator", displayLoadingIndicator: "displayLoadingIndicator" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true }, { propertyName: "parentMessageElement", first: true, predicate: ["parentMessageElement"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container\n *ngIf=\"\n lastReadMessageId &&\n isUnreadNotificationVisible &&\n openMessageListAt === 'last-message' &&\n displayUnreadSeparator\n \"\n>\n <ng-container\n *ngTemplateOutlet=\"\n customnewMessagesNotificationTemplate ||\n defaultUnreadMessagesNotification;\n context: {\n unreadCount: unreadCount,\n onDismiss: messageNotificationDismissClicked,\n onJump: messageNotificationJumpClicked\n }\n \"\n ></ng-container>\n</ng-container>\n<ng-template\n #defaultUnreadMessagesNotification\n let-unreadCount=\"unreadCount\"\n let-onDismiss=\"onDismiss\"\n let-onJump=\"onJump\"\n>\n <div\n class=\"str-chat__unread-messages-notification\"\n data-testid=\"unread-messages-notification\"\n >\n <button\n data-testid=\"unread-messages-notification-jump-to-message\"\n (click)=\"onJump()\"\n >\n <ng-container\n *ngIf=\"\n unreadCount > 0 && !hideUnreadCountForNotificationAndIndicator;\n else noUnreadCount\n \"\n >\n {{\n (unreadCount === 1\n ? \"streamChat.\\{\\{count\\}\\} unread message\"\n : \"streamChat.\\{\\{count\\}\\} unread messages\"\n ) | translate : { count: unreadCount }\n }}\n </ng-container>\n <ng-template #noUnreadCount>\n {{ \"streamChat.Unread messages\" | translate }}\n </ng-template>\n </button>\n <button\n data-testid=\"unread-messages-notification-dismiss\"\n (click)=\"onDismiss()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n</ng-template>\n<div #scrollContainer data-testid=\"scroll-container\" class=\"str-chat__list\">\n <ng-container *ngIf=\"mode === 'main' && isEmpty && emptyListTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyListTemplate\"></ng-container>\n </ng-container>\n <div class=\"str-chat__reverse-infinite-scroll str-chat__message-list-scroll\">\n <ul class=\"str-chat__ul\">\n <li\n *ngIf=\"mode === 'thread' && parentMessage\"\n #parentMessageElement\n data-testid=\"parent-message\"\n class=\"str-chat__parent-message-li\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: parentMessage, index: 'parent' }\n \"\n ></ng-container>\n <div data-testid=\"reply-count\" class=\"str-chat__thread-start\">\n {{parentMessage.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </div>\n </li>\n <ng-container *ngIf=\"mode === 'thread' && isEmpty && emptyListTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyListTemplate\"></ng-container>\n </ng-container>\n <stream-loading-indicator-placeholder\n *ngIf=\"\n ((loadingState === 'loading-top' && direction === 'bottom-to-top') ||\n (loadingState === 'loading-bottom' &&\n direction === 'top-to-bottom')) &&\n displayLoadingIndicator;\n else loadingIndicatorPlaceholder\n \"\n data-testid=\"top-loading-indicator\"\n ></stream-loading-indicator-placeholder>\n <ng-container *ngIf=\"messages$ | async as messages\">\n <ng-container\n *ngFor=\"\n let message of messages;\n let i = index;\n let isFirst = first;\n let isLast = last;\n trackBy: trackByMessageId\n \"\n >\n <ng-container *ngIf=\"isFirst\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: message.created_at,\n parsedDate: parseDate(message.created_at)\n }\n \"\n ></ng-container>\n </ng-container>\n <li\n tabindex=\"0\"\n data-testclass=\"message\"\n class=\"str-chat__li str-chat__li--{{ groupStyles[i] }}\"\n id=\"{{ message.id }}\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: message, index: i }\n \"\n ></ng-container>\n </li>\n <ng-container\n *ngIf=\"\n (lastReadMessageId === message?.id &&\n direction === 'bottom-to-top') ||\n (direction === 'top-to-bottom' &&\n lastReadMessageId === messages[i + 1]?.id)\n \"\n >\n <li\n *ngIf=\"displayUnreadSeparator\"\n id=\"stream-chat-new-message-indicator\"\n data-testid=\"new-messages-indicator\"\n class=\"str-chat__li str-chat__unread-messages-separator-wrapper\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customnewMessagesIndicatorTemplate ||\n defaultNewMessagesIndicator;\n context: { unreadCount: unreadCount }\n \"\n ></ng-container>\n </li>\n </ng-container>\n <ng-container *ngIf=\"isNextMessageOnSeparateDate[i]\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: messages[i + 1].created_at,\n parsedDate: parseDate(messages[i + 1].created_at)\n }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n <stream-loading-indicator-placeholder\n *ngIf=\"\n ((loadingState === 'loading-bottom' &&\n direction === 'bottom-to-top') ||\n (loadingState === 'loading-top' &&\n direction === 'top-to-bottom')) &&\n displayLoadingIndicator;\n else loadingIndicatorPlaceholder\n \"\n data-testid=\"bottom-loading-indicator\"\n ></stream-loading-indicator-placeholder>\n <ng-template #loadingIndicatorPlaceholder>\n <div class=\"str-chat__loading-indicator-placeholder\"></div>\n </ng-template>\n </ul>\n <ng-template #defaultTypingIndicator let-usersTyping$=\"usersTyping$\">\n <!-- eslint-disable-next-line @angular-eslint/template/no-any -->\n <ng-container *ngIf=\"$any(usersTyping$ | async) as users\">\n <div\n *ngIf=\"users.length > 0\"\n data-testid=\"typing-indicator\"\n class=\"str-chat__typing-indicator str-chat__typing-indicator--typing\"\n >\n <div class=\"str-chat__typing-indicator__dots\">\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n </div>\n <div\n data-testid=\"typing-users\"\n class=\"str-chat__typing-indicator__users\"\n >\n {{\n users.length === 1\n ? (\"streamChat.user is typing\"\n | translate : { user: getTypingIndicatorText(users) })\n : (\"streamChat.users are typing\"\n | translate : { users: getTypingIndicatorText(users) })\n }}\n </div>\n </div>\n </ng-container>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n typingIndicatorTemplate || defaultTypingIndicator;\n context: getTypingIndicatorContext()\n \"\n ></ng-container>\n </div>\n</div>\n<div class=\"str-chat__jump-to-latest-message\">\n <button\n *ngIf=\"isUserScrolled && isJumpToLatestButtonVisible\"\n data-testid=\"scroll-to-latest\"\n class=\"str-chat__message-notification-scroll-to-latest str-chat__message-notification-scroll-to-latest-right str-chat__circle-fab\"\n (keyup.enter)=\"jumpToLatestMessage()\"\n (click)=\"jumpToLatestMessage()\"\n >\n <stream-icon\n class=\"str-chat__jump-to-latest-icon str-chat__circle-fab-icon\"\n [icon]=\"direction === 'bottom-to-top' ? 'arrow-down' : 'arrow-up'\"\n ></stream-icon>\n <div\n *ngIf=\"newMessageCountWhileBeingScrolled > 0\"\n class=\"str-chat__message-notification str-chat__message-notification-scroll-to-latest-unread-count str-chat__jump-to-latest-unread-count\"\n >\n {{ newMessageCountWhileBeingScrolled }}\n </div>\n </button>\n</div>\n\n<ng-template #messageTemplateContainer let-message=\"message\" let-index=\"index\">\n <ng-template\n #defaultMessageTemplate\n let-messageInput=\"message\"\n let-isLastSentMessage=\"isLastSentMessage\"\n let-enabledMessageActions=\"enabledMessageActions\"\n let-mode=\"mode\"\n let-isHighlighted=\"isHighlighted\"\n let-scroll$=\"scroll$\"\n >\n <stream-message\n [message]=\"messageInput\"\n [isLastSentMessage]=\"isLastSentMessage\"\n [enabledMessageActions]=\"enabledMessageActions\"\n [mode]=\"mode\"\n [isHighlighted]=\"isHighlighted\"\n [scroll$]=\"scroll$\"\n ></stream-message>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplate || defaultMessageTemplate;\n context: {\n message: message,\n isLastSentMessage: !!(\n lastSentMessageId && message?.id === lastSentMessageId\n ),\n enabledMessageActions: enabledMessageActions,\n mode: mode,\n isHighlighted: message?.id === highlightedMessageId,\n scroll$: scroll$\n }\n \"\n ></ng-container>\n</ng-template>\n\n<ng-template #dateSeparator let-date=\"date\" let-parsedDate=\"parsedDate\">\n <ng-container *ngIf=\"displayDateSeparator\">\n <ng-container\n *ngTemplateOutlet=\"\n customDateSeparatorTemplate || defaultDateSeparator;\n context: {\n date: date,\n parsedDate: parsedDate\n }\n \"\n ></ng-container>\n </ng-container>\n\n <ng-template\n #defaultDateSeparator\n let-date=\"date\"\n let-parsedDate=\"parsedDate\"\n >\n <div data-testid=\"date-separator\" class=\"str-chat__date-separator\">\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'right' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n <div class=\"str-chat__date-separator-date\">\n {{ parsedDate }}\n </div>\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'left' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #defaultNewMessagesIndicator let-unreadCount=\"unreadCount\">\n <div class=\"str-chat__unread-messages-separator\">\n <ng-container\n *ngIf=\"\n unreadCount > 0 && !hideUnreadCountForNotificationAndIndicator;\n else noUnreadCount\n \"\n >\n {{\n (unreadCount === 1\n ? \"streamChat.\\{\\{count\\}\\} unread message\"\n : \"streamChat.\\{\\{count\\}\\} unread messages\"\n ) | translate : { count: unreadCount }\n }}\n </ng-container>\n <ng-template #noUnreadCount>\n {{ \"streamChat.Unread messages\" | translate }}\n </ng-template>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "stream-icon", inputs: ["icon"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "component", type: LoadingIndicatorPlaceholderComponent, selector: "stream-loading-indicator-placeholder" }, { kind: "component", type: MessageComponent, selector: "stream-message", inputs: ["message", "enabledMessageActions", "isLastSentMessage", "mode", "isHighlighted", "scroll$"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8633
|
+
MessageListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: MessageListComponent, selector: "stream-message-list", inputs: { mode: "mode", direction: "direction", hideJumpToLatestButtonDuringScroll: "hideJumpToLatestButtonDuringScroll", displayDateSeparator: "displayDateSeparator", displayUnreadSeparator: "displayUnreadSeparator", dateSeparatorTextPos: "dateSeparatorTextPos", openMessageListAt: "openMessageListAt", hideUnreadCountForNotificationAndIndicator: "hideUnreadCountForNotificationAndIndicator", displayLoadingIndicator: "displayLoadingIndicator" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true }, { propertyName: "parentMessageElement", first: true, predicate: ["parentMessageElement"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container\n *ngIf=\"\n lastReadMessageId &&\n isUnreadNotificationVisible &&\n openMessageListAt === 'last-message' &&\n displayUnreadSeparator\n \"\n>\n <ng-container\n *ngTemplateOutlet=\"\n customnewMessagesNotificationTemplate ||\n defaultUnreadMessagesNotification;\n context: {\n unreadCount: unreadCount,\n onDismiss: messageNotificationDismissClicked,\n onJump: messageNotificationJumpClicked\n }\n \"\n ></ng-container>\n</ng-container>\n<ng-template\n #defaultUnreadMessagesNotification\n let-unreadCount=\"unreadCount\"\n let-onDismiss=\"onDismiss\"\n let-onJump=\"onJump\"\n>\n <div\n class=\"str-chat__unread-messages-notification\"\n data-testid=\"unread-messages-notification\"\n >\n <button\n data-testid=\"unread-messages-notification-jump-to-message\"\n (click)=\"onJump()\"\n >\n <ng-container\n *ngIf=\"\n unreadCount > 0 && !hideUnreadCountForNotificationAndIndicator;\n else noUnreadCount\n \"\n >\n {{\n (unreadCount === 1\n ? \"streamChat.\\{\\{count\\}\\} unread message\"\n : \"streamChat.\\{\\{count\\}\\} unread messages\"\n ) | translate : { count: unreadCount }\n }}\n </ng-container>\n <ng-template #noUnreadCount>\n {{ \"streamChat.Unread messages\" | translate }}\n </ng-template>\n </button>\n <button\n data-testid=\"unread-messages-notification-dismiss\"\n (click)=\"onDismiss()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n</ng-template>\n<div #scrollContainer data-testid=\"scroll-container\" class=\"str-chat__list\">\n <ng-container *ngIf=\"mode === 'main' && isEmpty && emptyListTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyListTemplate\"></ng-container>\n </ng-container>\n <div class=\"str-chat__reverse-infinite-scroll str-chat__message-list-scroll\">\n <ul class=\"str-chat__ul\">\n <li\n *ngIf=\"mode === 'thread' && parentMessage\"\n #parentMessageElement\n data-testid=\"parent-message\"\n class=\"str-chat__parent-message-li\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: parentMessage, index: 'parent' }\n \"\n ></ng-container>\n <div data-testid=\"reply-count\" class=\"str-chat__thread-start\">\n {{parentMessage.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </div>\n </li>\n <ng-container *ngIf=\"mode === 'thread' && isEmpty && emptyListTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyListTemplate\"></ng-container>\n </ng-container>\n <stream-loading-indicator-placeholder\n *ngIf=\"\n ((loadingState === 'loading-top' && direction === 'bottom-to-top') ||\n (loadingState === 'loading-bottom' &&\n direction === 'top-to-bottom')) &&\n displayLoadingIndicator;\n else loadingIndicatorPlaceholder\n \"\n data-testid=\"top-loading-indicator\"\n ></stream-loading-indicator-placeholder>\n <ng-container *ngIf=\"messages$ | async as messages\">\n <ng-container\n *ngFor=\"\n let message of messages;\n let i = index;\n let isFirst = first;\n let isLast = last;\n trackBy: trackByMessageId\n \"\n >\n <ng-container *ngIf=\"isFirst\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: message.created_at,\n parsedDate: parseDate(message.created_at)\n }\n \"\n ></ng-container>\n </ng-container>\n <li\n tabindex=\"0\"\n data-testclass=\"message\"\n class=\"str-chat__li str-chat__li--{{ groupStyles[i] }}\"\n id=\"{{ message.id }}\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: message, index: i }\n \"\n ></ng-container>\n </li>\n <ng-container\n *ngIf=\"\n (lastReadMessageId === message?.id &&\n direction === 'bottom-to-top') ||\n (direction === 'top-to-bottom' &&\n lastReadMessageId === messages[i + 1]?.id)\n \"\n >\n <li\n *ngIf=\"displayUnreadSeparator\"\n id=\"stream-chat-new-message-indicator\"\n data-testid=\"new-messages-indicator\"\n class=\"str-chat__li str-chat__unread-messages-separator-wrapper\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customnewMessagesIndicatorTemplate ||\n defaultNewMessagesIndicator;\n context: { unreadCount: unreadCount }\n \"\n ></ng-container>\n </li>\n </ng-container>\n <ng-container *ngIf=\"isNextMessageOnSeparateDate[i]\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: messages[i + 1].created_at,\n parsedDate: parseDate(messages[i + 1].created_at)\n }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n <stream-loading-indicator-placeholder\n *ngIf=\"\n ((loadingState === 'loading-bottom' &&\n direction === 'bottom-to-top') ||\n (loadingState === 'loading-top' &&\n direction === 'top-to-bottom')) &&\n displayLoadingIndicator;\n else loadingIndicatorPlaceholder\n \"\n data-testid=\"bottom-loading-indicator\"\n ></stream-loading-indicator-placeholder>\n <ng-template #loadingIndicatorPlaceholder>\n <div class=\"str-chat__loading-indicator-placeholder\"></div>\n </ng-template>\n </ul>\n <ng-template #defaultTypingIndicator let-usersTyping$=\"usersTyping$\">\n <!-- eslint-disable-next-line @angular-eslint/template/no-any -->\n <ng-container *ngIf=\"$any(usersTyping$ | async) as users\">\n <div\n *ngIf=\"users.length > 0\"\n data-testid=\"typing-indicator\"\n class=\"str-chat__typing-indicator str-chat__typing-indicator--typing\"\n >\n <div class=\"str-chat__typing-indicator__dots\">\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n </div>\n <div\n data-testid=\"typing-users\"\n class=\"str-chat__typing-indicator__users\"\n >\n {{\n users.length === 1\n ? (\"streamChat.user is typing\"\n | translate : { user: getTypingIndicatorText(users) })\n : (\"streamChat.users are typing\"\n | translate : { users: getTypingIndicatorText(users) })\n }}\n </div>\n </div>\n </ng-container>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n typingIndicatorTemplate || defaultTypingIndicator;\n context: getTypingIndicatorContext()\n \"\n ></ng-container>\n </div>\n</div>\n<div class=\"str-chat__jump-to-latest-message\">\n <button\n *ngIf=\"isUserScrolled && isJumpToLatestButtonVisible\"\n data-testid=\"scroll-to-latest\"\n class=\"str-chat__message-notification-scroll-to-latest str-chat__message-notification-scroll-to-latest-right str-chat__circle-fab\"\n (keyup.enter)=\"jumpToLatestMessage()\"\n (click)=\"jumpToLatestMessage()\"\n >\n <stream-icon\n class=\"str-chat__jump-to-latest-icon str-chat__circle-fab-icon\"\n [icon]=\"direction === 'bottom-to-top' ? 'arrow-down' : 'arrow-up'\"\n ></stream-icon>\n <div\n *ngIf=\"newMessageCountWhileBeingScrolled > 0\"\n class=\"str-chat__message-notification str-chat__message-notification-scroll-to-latest-unread-count str-chat__jump-to-latest-unread-count\"\n >\n {{ newMessageCountWhileBeingScrolled }}\n </div>\n </button>\n</div>\n\n<ng-template #messageTemplateContainer let-message=\"message\" let-index=\"index\">\n <ng-template\n #defaultMessageTemplate\n let-messageInput=\"message\"\n let-isLastSentMessage=\"isLastSentMessage\"\n let-enabledMessageActions=\"enabledMessageActions\"\n let-mode=\"mode\"\n let-isHighlighted=\"isHighlighted\"\n let-scroll$=\"scroll$\"\n >\n <stream-message\n [message]=\"messageInput\"\n [isLastSentMessage]=\"isLastSentMessage\"\n [enabledMessageActions]=\"enabledMessageActions\"\n [mode]=\"mode\"\n [isHighlighted]=\"isHighlighted\"\n [scroll$]=\"scroll$\"\n ></stream-message>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplate || defaultMessageTemplate;\n context: {\n message: message,\n isLastSentMessage: !!(\n lastSentMessageId && message?.id === lastSentMessageId\n ),\n enabledMessageActions: enabledMessageActions,\n mode: mode,\n isHighlighted: message?.id === highlightedMessageId,\n scroll$: scroll$\n }\n \"\n ></ng-container>\n</ng-template>\n\n<ng-template #dateSeparator let-date=\"date\" let-parsedDate=\"parsedDate\">\n <ng-container *ngIf=\"displayDateSeparator\">\n <ng-container\n *ngTemplateOutlet=\"\n customDateSeparatorTemplate || defaultDateSeparator;\n context: {\n date: date,\n parsedDate: parsedDate\n }\n \"\n ></ng-container>\n </ng-container>\n\n <ng-template\n #defaultDateSeparator\n let-date=\"date\"\n let-parsedDate=\"parsedDate\"\n >\n <div data-testid=\"date-separator\" class=\"str-chat__date-separator\">\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'right' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n <div class=\"str-chat__date-separator-date\">\n {{ parsedDate }}\n </div>\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'left' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #defaultNewMessagesIndicator let-unreadCount=\"unreadCount\">\n <div class=\"str-chat__unread-messages-separator\">\n <ng-container\n *ngIf=\"\n unreadCount > 0 && !hideUnreadCountForNotificationAndIndicator;\n else noUnreadCount\n \"\n >\n {{\n (unreadCount === 1\n ? \"streamChat.\\{\\{count\\}\\} unread message\"\n : \"streamChat.\\{\\{count\\}\\} unread messages\"\n ) | translate : { count: unreadCount }\n }}\n </ng-container>\n <ng-template #noUnreadCount>\n {{ \"streamChat.Unread messages\" | translate }}\n </ng-template>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "stream-icon", inputs: ["icon"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "component", type: LoadingIndicatorPlaceholderComponent, selector: "stream-loading-indicator-placeholder" }, { kind: "component", type: MessageComponent, selector: "stream-message", inputs: ["message", "enabledMessageActions", "isLastSentMessage", "mode", "isHighlighted", "scroll$"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8531
8634
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MessageListComponent, decorators: [{
|
|
8532
8635
|
type: Component,
|
|
8533
8636
|
args: [{ selector: 'stream-message-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container\n *ngIf=\"\n lastReadMessageId &&\n isUnreadNotificationVisible &&\n openMessageListAt === 'last-message' &&\n displayUnreadSeparator\n \"\n>\n <ng-container\n *ngTemplateOutlet=\"\n customnewMessagesNotificationTemplate ||\n defaultUnreadMessagesNotification;\n context: {\n unreadCount: unreadCount,\n onDismiss: messageNotificationDismissClicked,\n onJump: messageNotificationJumpClicked\n }\n \"\n ></ng-container>\n</ng-container>\n<ng-template\n #defaultUnreadMessagesNotification\n let-unreadCount=\"unreadCount\"\n let-onDismiss=\"onDismiss\"\n let-onJump=\"onJump\"\n>\n <div\n class=\"str-chat__unread-messages-notification\"\n data-testid=\"unread-messages-notification\"\n >\n <button\n data-testid=\"unread-messages-notification-jump-to-message\"\n (click)=\"onJump()\"\n >\n <ng-container\n *ngIf=\"\n unreadCount > 0 && !hideUnreadCountForNotificationAndIndicator;\n else noUnreadCount\n \"\n >\n {{\n (unreadCount === 1\n ? \"streamChat.\\{\\{count\\}\\} unread message\"\n : \"streamChat.\\{\\{count\\}\\} unread messages\"\n ) | translate : { count: unreadCount }\n }}\n </ng-container>\n <ng-template #noUnreadCount>\n {{ \"streamChat.Unread messages\" | translate }}\n </ng-template>\n </button>\n <button\n data-testid=\"unread-messages-notification-dismiss\"\n (click)=\"onDismiss()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n</ng-template>\n<div #scrollContainer data-testid=\"scroll-container\" class=\"str-chat__list\">\n <ng-container *ngIf=\"mode === 'main' && isEmpty && emptyListTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyListTemplate\"></ng-container>\n </ng-container>\n <div class=\"str-chat__reverse-infinite-scroll str-chat__message-list-scroll\">\n <ul class=\"str-chat__ul\">\n <li\n *ngIf=\"mode === 'thread' && parentMessage\"\n #parentMessageElement\n data-testid=\"parent-message\"\n class=\"str-chat__parent-message-li\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: parentMessage, index: 'parent' }\n \"\n ></ng-container>\n <div data-testid=\"reply-count\" class=\"str-chat__thread-start\">\n {{parentMessage.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </div>\n </li>\n <ng-container *ngIf=\"mode === 'thread' && isEmpty && emptyListTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyListTemplate\"></ng-container>\n </ng-container>\n <stream-loading-indicator-placeholder\n *ngIf=\"\n ((loadingState === 'loading-top' && direction === 'bottom-to-top') ||\n (loadingState === 'loading-bottom' &&\n direction === 'top-to-bottom')) &&\n displayLoadingIndicator;\n else loadingIndicatorPlaceholder\n \"\n data-testid=\"top-loading-indicator\"\n ></stream-loading-indicator-placeholder>\n <ng-container *ngIf=\"messages$ | async as messages\">\n <ng-container\n *ngFor=\"\n let message of messages;\n let i = index;\n let isFirst = first;\n let isLast = last;\n trackBy: trackByMessageId\n \"\n >\n <ng-container *ngIf=\"isFirst\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: message.created_at,\n parsedDate: parseDate(message.created_at)\n }\n \"\n ></ng-container>\n </ng-container>\n <li\n tabindex=\"0\"\n data-testclass=\"message\"\n class=\"str-chat__li str-chat__li--{{ groupStyles[i] }}\"\n id=\"{{ message.id }}\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: message, index: i }\n \"\n ></ng-container>\n </li>\n <ng-container\n *ngIf=\"\n (lastReadMessageId === message?.id &&\n direction === 'bottom-to-top') ||\n (direction === 'top-to-bottom' &&\n lastReadMessageId === messages[i + 1]?.id)\n \"\n >\n <li\n *ngIf=\"displayUnreadSeparator\"\n id=\"stream-chat-new-message-indicator\"\n data-testid=\"new-messages-indicator\"\n class=\"str-chat__li str-chat__unread-messages-separator-wrapper\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customnewMessagesIndicatorTemplate ||\n defaultNewMessagesIndicator;\n context: { unreadCount: unreadCount }\n \"\n ></ng-container>\n </li>\n </ng-container>\n <ng-container *ngIf=\"isNextMessageOnSeparateDate[i]\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: messages[i + 1].created_at,\n parsedDate: parseDate(messages[i + 1].created_at)\n }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n <stream-loading-indicator-placeholder\n *ngIf=\"\n ((loadingState === 'loading-bottom' &&\n direction === 'bottom-to-top') ||\n (loadingState === 'loading-top' &&\n direction === 'top-to-bottom')) &&\n displayLoadingIndicator;\n else loadingIndicatorPlaceholder\n \"\n data-testid=\"bottom-loading-indicator\"\n ></stream-loading-indicator-placeholder>\n <ng-template #loadingIndicatorPlaceholder>\n <div class=\"str-chat__loading-indicator-placeholder\"></div>\n </ng-template>\n </ul>\n <ng-template #defaultTypingIndicator let-usersTyping$=\"usersTyping$\">\n <!-- eslint-disable-next-line @angular-eslint/template/no-any -->\n <ng-container *ngIf=\"$any(usersTyping$ | async) as users\">\n <div\n *ngIf=\"users.length > 0\"\n data-testid=\"typing-indicator\"\n class=\"str-chat__typing-indicator str-chat__typing-indicator--typing\"\n >\n <div class=\"str-chat__typing-indicator__dots\">\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n </div>\n <div\n data-testid=\"typing-users\"\n class=\"str-chat__typing-indicator__users\"\n >\n {{\n users.length === 1\n ? (\"streamChat.user is typing\"\n | translate : { user: getTypingIndicatorText(users) })\n : (\"streamChat.users are typing\"\n | translate : { users: getTypingIndicatorText(users) })\n }}\n </div>\n </div>\n </ng-container>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n typingIndicatorTemplate || defaultTypingIndicator;\n context: getTypingIndicatorContext()\n \"\n ></ng-container>\n </div>\n</div>\n<div class=\"str-chat__jump-to-latest-message\">\n <button\n *ngIf=\"isUserScrolled && isJumpToLatestButtonVisible\"\n data-testid=\"scroll-to-latest\"\n class=\"str-chat__message-notification-scroll-to-latest str-chat__message-notification-scroll-to-latest-right str-chat__circle-fab\"\n (keyup.enter)=\"jumpToLatestMessage()\"\n (click)=\"jumpToLatestMessage()\"\n >\n <stream-icon\n class=\"str-chat__jump-to-latest-icon str-chat__circle-fab-icon\"\n [icon]=\"direction === 'bottom-to-top' ? 'arrow-down' : 'arrow-up'\"\n ></stream-icon>\n <div\n *ngIf=\"newMessageCountWhileBeingScrolled > 0\"\n class=\"str-chat__message-notification str-chat__message-notification-scroll-to-latest-unread-count str-chat__jump-to-latest-unread-count\"\n >\n {{ newMessageCountWhileBeingScrolled }}\n </div>\n </button>\n</div>\n\n<ng-template #messageTemplateContainer let-message=\"message\" let-index=\"index\">\n <ng-template\n #defaultMessageTemplate\n let-messageInput=\"message\"\n let-isLastSentMessage=\"isLastSentMessage\"\n let-enabledMessageActions=\"enabledMessageActions\"\n let-mode=\"mode\"\n let-isHighlighted=\"isHighlighted\"\n let-scroll$=\"scroll$\"\n >\n <stream-message\n [message]=\"messageInput\"\n [isLastSentMessage]=\"isLastSentMessage\"\n [enabledMessageActions]=\"enabledMessageActions\"\n [mode]=\"mode\"\n [isHighlighted]=\"isHighlighted\"\n [scroll$]=\"scroll$\"\n ></stream-message>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplate || defaultMessageTemplate;\n context: {\n message: message,\n isLastSentMessage: !!(\n lastSentMessageId && message?.id === lastSentMessageId\n ),\n enabledMessageActions: enabledMessageActions,\n mode: mode,\n isHighlighted: message?.id === highlightedMessageId,\n scroll$: scroll$\n }\n \"\n ></ng-container>\n</ng-template>\n\n<ng-template #dateSeparator let-date=\"date\" let-parsedDate=\"parsedDate\">\n <ng-container *ngIf=\"displayDateSeparator\">\n <ng-container\n *ngTemplateOutlet=\"\n customDateSeparatorTemplate || defaultDateSeparator;\n context: {\n date: date,\n parsedDate: parsedDate\n }\n \"\n ></ng-container>\n </ng-container>\n\n <ng-template\n #defaultDateSeparator\n let-date=\"date\"\n let-parsedDate=\"parsedDate\"\n >\n <div data-testid=\"date-separator\" class=\"str-chat__date-separator\">\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'right' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n <div class=\"str-chat__date-separator-date\">\n {{ parsedDate }}\n </div>\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'left' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #defaultNewMessagesIndicator let-unreadCount=\"unreadCount\">\n <div class=\"str-chat__unread-messages-separator\">\n <ng-container\n *ngIf=\"\n unreadCount > 0 && !hideUnreadCountForNotificationAndIndicator;\n else noUnreadCount\n \"\n >\n {{\n (unreadCount === 1\n ? \"streamChat.\\{\\{count\\}\\} unread message\"\n : \"streamChat.\\{\\{count\\}\\} unread messages\"\n ) | translate : { count: unreadCount }\n }}\n </ng-container>\n <ng-template #noUnreadCount>\n {{ \"streamChat.Unread messages\" | translate }}\n </ng-template>\n </div>\n</ng-template>\n" }]
|
|
@@ -8593,7 +8696,7 @@ class ThreadComponent {
|
|
|
8593
8696
|
}
|
|
8594
8697
|
}
|
|
8595
8698
|
ThreadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ThreadComponent, deps: [{ token: CustomTemplatesService }, { token: ChannelService }, { token: ChatClientService }], target: i0.ɵɵFactoryTarget.Component });
|
|
8596
|
-
ThreadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ThreadComponent, selector: "stream-thread", host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<div class=\"str-chat__thread-container\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.threadHeaderTemplate$ | async) ||\n defaultThreadHeader;\n context: getThreadHeaderContext()\n \"\n ></ng-container>\n <ng-content></ng-content>\n</div>\n\n<ng-template\n #defaultThreadHeader\n let-parentMessage=\"parentMessage\"\n let-closeThreadHandler=\"closeThreadHandler\"\n>\n <div class=\"str-chat__thread-header\">\n <div class=\"str-chat__thread-header-details\">\n <div class=\"str-chat__thread-header-name\" translate>\n streamChat.Thread\n </div>\n <div\n class=\"str-chat__thread-header-channel-name\"\n data-testid=\"channel-name\"\n >\n {{ channelName }}\n </div>\n </div>\n <button\n class=\"str-chat__square-button str-chat__close-thread-button\"\n data-testid=\"close-button\"\n (click)=\"closeThreadHandler()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type:
|
|
8699
|
+
ThreadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ThreadComponent, selector: "stream-thread", host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<div class=\"str-chat__thread-container\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.threadHeaderTemplate$ | async) ||\n defaultThreadHeader;\n context: getThreadHeaderContext()\n \"\n ></ng-container>\n <ng-content></ng-content>\n</div>\n\n<ng-template\n #defaultThreadHeader\n let-parentMessage=\"parentMessage\"\n let-closeThreadHandler=\"closeThreadHandler\"\n>\n <div class=\"str-chat__thread-header\">\n <div class=\"str-chat__thread-header-details\">\n <div class=\"str-chat__thread-header-name\" translate>\n streamChat.Thread\n </div>\n <div\n class=\"str-chat__thread-header-channel-name\"\n data-testid=\"channel-name\"\n >\n {{ channelName }}\n </div>\n </div>\n <button\n class=\"str-chat__square-button str-chat__close-thread-button\"\n data-testid=\"close-button\"\n (click)=\"closeThreadHandler()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i6.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
8597
8700
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ThreadComponent, decorators: [{
|
|
8598
8701
|
type: Component,
|
|
8599
8702
|
args: [{ selector: 'stream-thread', template: "<div class=\"str-chat__thread-container\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.threadHeaderTemplate$ | async) ||\n defaultThreadHeader;\n context: getThreadHeaderContext()\n \"\n ></ng-container>\n <ng-content></ng-content>\n</div>\n\n<ng-template\n #defaultThreadHeader\n let-parentMessage=\"parentMessage\"\n let-closeThreadHandler=\"closeThreadHandler\"\n>\n <div class=\"str-chat__thread-header\">\n <div class=\"str-chat__thread-header-details\">\n <div class=\"str-chat__thread-header-name\" translate>\n streamChat.Thread\n </div>\n <div\n class=\"str-chat__thread-header-channel-name\"\n data-testid=\"channel-name\"\n >\n {{ channelName }}\n </div>\n </div>\n <button\n class=\"str-chat__square-button str-chat__close-thread-button\"\n data-testid=\"close-button\"\n (click)=\"closeThreadHandler()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n</ng-template>\n" }]
|
|
@@ -8660,6 +8763,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
8660
8763
|
}]
|
|
8661
8764
|
}] });
|
|
8662
8765
|
|
|
8766
|
+
class StreamModalModule {
|
|
8767
|
+
}
|
|
8768
|
+
StreamModalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
8769
|
+
StreamModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: StreamModalModule, declarations: [ModalComponent], imports: [CommonModule, IconModule], exports: [ModalComponent] });
|
|
8770
|
+
StreamModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamModalModule, imports: [CommonModule, IconModule] });
|
|
8771
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamModalModule, decorators: [{
|
|
8772
|
+
type: NgModule,
|
|
8773
|
+
args: [{
|
|
8774
|
+
declarations: [ModalComponent],
|
|
8775
|
+
imports: [CommonModule, IconModule],
|
|
8776
|
+
exports: [ModalComponent],
|
|
8777
|
+
}]
|
|
8778
|
+
}] });
|
|
8779
|
+
|
|
8780
|
+
class StreamNotificationModule {
|
|
8781
|
+
}
|
|
8782
|
+
StreamNotificationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamNotificationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
8783
|
+
StreamNotificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: StreamNotificationModule, declarations: [NotificationComponent, NotificationListComponent], imports: [CommonModule, TranslateModule], exports: [NotificationComponent, NotificationListComponent] });
|
|
8784
|
+
StreamNotificationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamNotificationModule, imports: [CommonModule, TranslateModule] });
|
|
8785
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamNotificationModule, decorators: [{
|
|
8786
|
+
type: NgModule,
|
|
8787
|
+
args: [{
|
|
8788
|
+
declarations: [NotificationComponent, NotificationListComponent],
|
|
8789
|
+
imports: [CommonModule, TranslateModule],
|
|
8790
|
+
exports: [NotificationComponent, NotificationListComponent],
|
|
8791
|
+
}]
|
|
8792
|
+
}] });
|
|
8793
|
+
|
|
8794
|
+
class StreamPaginatedListModule {
|
|
8795
|
+
}
|
|
8796
|
+
StreamPaginatedListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamPaginatedListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
8797
|
+
StreamPaginatedListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: StreamPaginatedListModule, declarations: [PaginatedListComponent], imports: [CommonModule, TranslateModule, IconModule], exports: [PaginatedListComponent] });
|
|
8798
|
+
StreamPaginatedListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamPaginatedListModule, imports: [CommonModule, TranslateModule, IconModule] });
|
|
8799
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamPaginatedListModule, decorators: [{
|
|
8800
|
+
type: NgModule,
|
|
8801
|
+
args: [{
|
|
8802
|
+
declarations: [PaginatedListComponent],
|
|
8803
|
+
imports: [CommonModule, TranslateModule, IconModule],
|
|
8804
|
+
exports: [PaginatedListComponent],
|
|
8805
|
+
}]
|
|
8806
|
+
}] });
|
|
8807
|
+
|
|
8663
8808
|
class StreamChatModule {
|
|
8664
8809
|
}
|
|
8665
8810
|
StreamChatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamChatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -8673,23 +8818,22 @@ StreamChatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
8673
8818
|
MessageActionsBoxComponent,
|
|
8674
8819
|
AttachmentListComponent,
|
|
8675
8820
|
MessageReactionsComponent,
|
|
8676
|
-
NotificationComponent,
|
|
8677
|
-
NotificationListComponent,
|
|
8678
8821
|
AttachmentPreviewListComponent,
|
|
8679
|
-
ModalComponent,
|
|
8680
8822
|
TextareaDirective,
|
|
8681
8823
|
ThreadComponent,
|
|
8682
8824
|
MessageBouncePromptComponent,
|
|
8683
8825
|
MessageReactionsSelectorComponent,
|
|
8684
8826
|
UserListComponent,
|
|
8685
|
-
PaginatedListComponent,
|
|
8686
8827
|
MessageTextComponent,
|
|
8687
8828
|
MessageBlockedComponent], imports: [CommonModule,
|
|
8688
8829
|
NgxFloatUiModule,
|
|
8689
8830
|
StreamAvatarModule,
|
|
8690
8831
|
TranslateModule,
|
|
8691
8832
|
VoiceRecordingModule,
|
|
8692
|
-
IconModule
|
|
8833
|
+
IconModule,
|
|
8834
|
+
StreamModalModule,
|
|
8835
|
+
StreamNotificationModule,
|
|
8836
|
+
StreamPaginatedListModule], exports: [ChannelComponent,
|
|
8693
8837
|
ChannelHeaderComponent,
|
|
8694
8838
|
ChannelListComponent,
|
|
8695
8839
|
ChannelPreviewComponent,
|
|
@@ -8702,25 +8846,32 @@ StreamChatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
8702
8846
|
NotificationComponent,
|
|
8703
8847
|
NotificationListComponent,
|
|
8704
8848
|
AttachmentPreviewListComponent,
|
|
8705
|
-
|
|
8849
|
+
StreamModalModule,
|
|
8706
8850
|
StreamAvatarModule,
|
|
8707
8851
|
ThreadComponent,
|
|
8708
8852
|
MessageBouncePromptComponent,
|
|
8709
8853
|
VoiceRecordingModule,
|
|
8710
8854
|
MessageReactionsSelectorComponent,
|
|
8711
8855
|
UserListComponent,
|
|
8712
|
-
|
|
8856
|
+
StreamPaginatedListModule,
|
|
8713
8857
|
IconModule,
|
|
8714
8858
|
MessageTextComponent,
|
|
8715
|
-
MessageBlockedComponent
|
|
8859
|
+
MessageBlockedComponent,
|
|
8860
|
+
StreamNotificationModule] });
|
|
8716
8861
|
StreamChatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamChatModule, providers: [VoiceRecorderService], imports: [CommonModule,
|
|
8717
8862
|
NgxFloatUiModule,
|
|
8718
8863
|
StreamAvatarModule,
|
|
8719
8864
|
TranslateModule,
|
|
8720
8865
|
VoiceRecordingModule,
|
|
8721
|
-
IconModule,
|
|
8866
|
+
IconModule,
|
|
8867
|
+
StreamModalModule,
|
|
8868
|
+
StreamNotificationModule,
|
|
8869
|
+
StreamPaginatedListModule, StreamModalModule,
|
|
8870
|
+
StreamAvatarModule,
|
|
8722
8871
|
VoiceRecordingModule,
|
|
8723
|
-
|
|
8872
|
+
StreamPaginatedListModule,
|
|
8873
|
+
IconModule,
|
|
8874
|
+
StreamNotificationModule] });
|
|
8724
8875
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamChatModule, decorators: [{
|
|
8725
8876
|
type: NgModule,
|
|
8726
8877
|
args: [{
|
|
@@ -8735,16 +8886,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
8735
8886
|
MessageActionsBoxComponent,
|
|
8736
8887
|
AttachmentListComponent,
|
|
8737
8888
|
MessageReactionsComponent,
|
|
8738
|
-
NotificationComponent,
|
|
8739
|
-
NotificationListComponent,
|
|
8740
8889
|
AttachmentPreviewListComponent,
|
|
8741
|
-
ModalComponent,
|
|
8742
8890
|
TextareaDirective,
|
|
8743
8891
|
ThreadComponent,
|
|
8744
8892
|
MessageBouncePromptComponent,
|
|
8745
8893
|
MessageReactionsSelectorComponent,
|
|
8746
8894
|
UserListComponent,
|
|
8747
|
-
PaginatedListComponent,
|
|
8748
8895
|
MessageTextComponent,
|
|
8749
8896
|
MessageBlockedComponent,
|
|
8750
8897
|
],
|
|
@@ -8755,6 +8902,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
8755
8902
|
TranslateModule,
|
|
8756
8903
|
VoiceRecordingModule,
|
|
8757
8904
|
IconModule,
|
|
8905
|
+
StreamModalModule,
|
|
8906
|
+
StreamNotificationModule,
|
|
8907
|
+
StreamPaginatedListModule,
|
|
8758
8908
|
],
|
|
8759
8909
|
exports: [
|
|
8760
8910
|
ChannelComponent,
|
|
@@ -8770,17 +8920,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
8770
8920
|
NotificationComponent,
|
|
8771
8921
|
NotificationListComponent,
|
|
8772
8922
|
AttachmentPreviewListComponent,
|
|
8773
|
-
|
|
8923
|
+
StreamModalModule,
|
|
8774
8924
|
StreamAvatarModule,
|
|
8775
8925
|
ThreadComponent,
|
|
8776
8926
|
MessageBouncePromptComponent,
|
|
8777
8927
|
VoiceRecordingModule,
|
|
8778
8928
|
MessageReactionsSelectorComponent,
|
|
8779
8929
|
UserListComponent,
|
|
8780
|
-
|
|
8930
|
+
StreamPaginatedListModule,
|
|
8781
8931
|
IconModule,
|
|
8782
8932
|
MessageTextComponent,
|
|
8783
8933
|
MessageBlockedComponent,
|
|
8934
|
+
StreamNotificationModule,
|
|
8784
8935
|
],
|
|
8785
8936
|
providers: [VoiceRecorderService],
|
|
8786
8937
|
}]
|
|
@@ -8859,7 +9010,7 @@ class VoiceRecorderWavebarComponent {
|
|
|
8859
9010
|
}
|
|
8860
9011
|
}
|
|
8861
9012
|
VoiceRecorderWavebarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: VoiceRecorderWavebarComponent, deps: [{ token: AmplitudeRecorderService }, { token: AudioRecorderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
8862
|
-
VoiceRecorderWavebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: VoiceRecorderWavebarComponent, selector: "stream-voice-recorder-wavebar", ngImport: i0, template: "<div\n class=\"str-chat__recording-timer\"\n [class.str-chat__recording-timer--hours]=\"isLongerThanOneHour\"\n>\n {{ formattedDuration }}\n</div>\n<div class=\"str-chat__waveform-box-container\">\n <div class=\"str-chat__audio_recorder__waveform-box\">\n <div\n *ngFor=\"let amplitude of amplitudes$ | async; trackBy: trackByIndex\"\n class=\"str-chat__wave-progress-bar__amplitude-bar\"\n [style.--str-chat__wave-progress-bar__amplitude-bar-height]=\"\n (amplitude ?? 0) * 100 + '%'\n \"\n ></div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type:
|
|
9013
|
+
VoiceRecorderWavebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: VoiceRecorderWavebarComponent, selector: "stream-voice-recorder-wavebar", ngImport: i0, template: "<div\n class=\"str-chat__recording-timer\"\n [class.str-chat__recording-timer--hours]=\"isLongerThanOneHour\"\n>\n {{ formattedDuration }}\n</div>\n<div class=\"str-chat__waveform-box-container\">\n <div class=\"str-chat__audio_recorder__waveform-box\">\n <div\n *ngFor=\"let amplitude of amplitudes$ | async; trackBy: trackByIndex\"\n class=\"str-chat__wave-progress-bar__amplitude-bar\"\n [style.--str-chat__wave-progress-bar__amplitude-bar-height]=\"\n (amplitude ?? 0) * 100 + '%'\n \"\n ></div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
8863
9014
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: VoiceRecorderWavebarComponent, decorators: [{
|
|
8864
9015
|
type: Component,
|
|
8865
9016
|
args: [{ selector: 'stream-voice-recorder-wavebar', template: "<div\n class=\"str-chat__recording-timer\"\n [class.str-chat__recording-timer--hours]=\"isLongerThanOneHour\"\n>\n {{ formattedDuration }}\n</div>\n<div class=\"str-chat__waveform-box-container\">\n <div class=\"str-chat__audio_recorder__waveform-box\">\n <div\n *ngFor=\"let amplitude of amplitudes$ | async; trackBy: trackByIndex\"\n class=\"str-chat__wave-progress-bar__amplitude-bar\"\n [style.--str-chat__wave-progress-bar__amplitude-bar-height]=\"\n (amplitude ?? 0) * 100 + '%'\n \"\n ></div>\n </div>\n</div>\n" }]
|
|
@@ -8928,7 +9079,7 @@ class VoiceRecorderComponent {
|
|
|
8928
9079
|
}
|
|
8929
9080
|
}
|
|
8930
9081
|
VoiceRecorderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: VoiceRecorderComponent, deps: [{ token: AudioRecorderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
8931
|
-
VoiceRecorderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: VoiceRecorderComponent, selector: "stream-voice-recorder", inputs: { voiceRecorderService: "voiceRecorderService" }, providers: [], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"str-chat__audio_recorder-container\"\n *ngIf=\"voiceRecorderService?.isRecorderVisible$ | async\"\n>\n <div class=\"str-chat__audio_recorder\" data-testid=\"audio-recorder\">\n <button\n class=\"str-chat__audio_recorder__cancel-button\"\n data-testid=\"cancel-recording-audio-button\"\n [disabled]=\"isLoading\"\n (click)=\"cancel()\"\n (keyup.enter)=\"cancel()\"\n >\n <stream-icon-placeholder icon=\"bin\"></stream-icon-placeholder>\n </button>\n <stream-voice-recorder-wavebar\n *ngIf=\"\n (recordState === MediaRecordingState.RECORDING ||\n recordState === MediaRecordingState.PAUSED) &&\n !recording\n \"\n ></stream-voice-recorder-wavebar>\n <!-- eslint-disable @angular-eslint/template/no-any -->\n <stream-voice-recording\n [attachment]=\"$any(recording)\"\n *ngIf=\"!!recording\"\n ></stream-voice-recording>\n <!-- eslint-enable @angular-eslint/template/no-any -->\n <button\n *ngIf=\"recordState === MediaRecordingState.PAUSED && !recording\"\n class=\"str-chat__audio_recorder__resume-recording-button\"\n (click)=\"resume()\"\n (keyup.enter)=\"resume()\"\n >\n <stream-icon-placeholder icon=\"mic\"></stream-icon-placeholder>\n </button>\n <button\n *ngIf=\"recordState === MediaRecordingState.RECORDING && !recording\"\n class=\"str-chat__audio_recorder__pause-recording-button\"\n data-testid=\"pause-recording-audio-button\"\n (click)=\"pause()\"\n (keyup.enter)=\"pause()\"\n >\n <stream-icon-placeholder icon=\"pause\"></stream-icon-placeholder>\n </button>\n <ng-container\n *ngIf=\"recordState === MediaRecordingState.STOPPED; else stopButton\"\n >\n <button\n class=\"str-chat__audio_recorder__complete-button\"\n data-testid=\"audio-recorder-complete-button\"\n [disabled]=\"!recording\"\n (click)=\"uploadRecording()\"\n (keyup.enter)=\"uploadRecording()\"\n >\n <stream-loading-indicator\n *ngIf=\"isLoading; else sendIcon\"\n ></stream-loading-indicator>\n <ng-template #sendIcon>\n <stream-icon-placeholder icon=\"send\"></stream-icon-placeholder>\n </ng-template>\n </button>\n </ng-container>\n <ng-template #stopButton>\n <button\n class=\"str-chat__audio_recorder__stop-button\"\n data-testid=\"audio-recorder-stop-button\"\n [disabled]=\"recordState === MediaRecordingState.STOPPED\"\n (click)=\"stop()\"\n (keyup.enter)=\"stop()\"\n >\n <stream-icon-placeholder icon=\"delivered\"></stream-icon-placeholder>\n </button>\n </ng-template>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type:
|
|
9082
|
+
VoiceRecorderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: VoiceRecorderComponent, selector: "stream-voice-recorder", inputs: { voiceRecorderService: "voiceRecorderService" }, providers: [], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"str-chat__audio_recorder-container\"\n *ngIf=\"voiceRecorderService?.isRecorderVisible$ | async\"\n>\n <div class=\"str-chat__audio_recorder\" data-testid=\"audio-recorder\">\n <button\n class=\"str-chat__audio_recorder__cancel-button\"\n data-testid=\"cancel-recording-audio-button\"\n [disabled]=\"isLoading\"\n (click)=\"cancel()\"\n (keyup.enter)=\"cancel()\"\n >\n <stream-icon-placeholder icon=\"bin\"></stream-icon-placeholder>\n </button>\n <stream-voice-recorder-wavebar\n *ngIf=\"\n (recordState === MediaRecordingState.RECORDING ||\n recordState === MediaRecordingState.PAUSED) &&\n !recording\n \"\n ></stream-voice-recorder-wavebar>\n <!-- eslint-disable @angular-eslint/template/no-any -->\n <stream-voice-recording\n [attachment]=\"$any(recording)\"\n *ngIf=\"!!recording\"\n ></stream-voice-recording>\n <!-- eslint-enable @angular-eslint/template/no-any -->\n <button\n *ngIf=\"recordState === MediaRecordingState.PAUSED && !recording\"\n class=\"str-chat__audio_recorder__resume-recording-button\"\n (click)=\"resume()\"\n (keyup.enter)=\"resume()\"\n >\n <stream-icon-placeholder icon=\"mic\"></stream-icon-placeholder>\n </button>\n <button\n *ngIf=\"recordState === MediaRecordingState.RECORDING && !recording\"\n class=\"str-chat__audio_recorder__pause-recording-button\"\n data-testid=\"pause-recording-audio-button\"\n (click)=\"pause()\"\n (keyup.enter)=\"pause()\"\n >\n <stream-icon-placeholder icon=\"pause\"></stream-icon-placeholder>\n </button>\n <ng-container\n *ngIf=\"recordState === MediaRecordingState.STOPPED; else stopButton\"\n >\n <button\n class=\"str-chat__audio_recorder__complete-button\"\n data-testid=\"audio-recorder-complete-button\"\n [disabled]=\"!recording\"\n (click)=\"uploadRecording()\"\n (keyup.enter)=\"uploadRecording()\"\n >\n <stream-loading-indicator\n *ngIf=\"isLoading; else sendIcon\"\n ></stream-loading-indicator>\n <ng-template #sendIcon>\n <stream-icon-placeholder icon=\"send\"></stream-icon-placeholder>\n </ng-template>\n </button>\n </ng-container>\n <ng-template #stopButton>\n <button\n class=\"str-chat__audio_recorder__stop-button\"\n data-testid=\"audio-recorder-stop-button\"\n [disabled]=\"recordState === MediaRecordingState.STOPPED\"\n (click)=\"stop()\"\n (keyup.enter)=\"stop()\"\n >\n <stream-icon-placeholder icon=\"delivered\"></stream-icon-placeholder>\n </button>\n </ng-template>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: VoiceRecordingComponent, selector: "stream-voice-recording", inputs: ["attachment"] }, { kind: "component", type: IconPlaceholderComponent, selector: "stream-icon-placeholder", inputs: ["icon"] }, { kind: "component", type: LoadingIndicatorComponent, selector: "stream-loading-indicator" }, { kind: "component", type: VoiceRecorderWavebarComponent, selector: "stream-voice-recorder-wavebar" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
8932
9083
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: VoiceRecorderComponent, decorators: [{
|
|
8933
9084
|
type: Component,
|
|
8934
9085
|
args: [{ selector: 'stream-voice-recorder', providers: [], template: "<div\n class=\"str-chat__audio_recorder-container\"\n *ngIf=\"voiceRecorderService?.isRecorderVisible$ | async\"\n>\n <div class=\"str-chat__audio_recorder\" data-testid=\"audio-recorder\">\n <button\n class=\"str-chat__audio_recorder__cancel-button\"\n data-testid=\"cancel-recording-audio-button\"\n [disabled]=\"isLoading\"\n (click)=\"cancel()\"\n (keyup.enter)=\"cancel()\"\n >\n <stream-icon-placeholder icon=\"bin\"></stream-icon-placeholder>\n </button>\n <stream-voice-recorder-wavebar\n *ngIf=\"\n (recordState === MediaRecordingState.RECORDING ||\n recordState === MediaRecordingState.PAUSED) &&\n !recording\n \"\n ></stream-voice-recorder-wavebar>\n <!-- eslint-disable @angular-eslint/template/no-any -->\n <stream-voice-recording\n [attachment]=\"$any(recording)\"\n *ngIf=\"!!recording\"\n ></stream-voice-recording>\n <!-- eslint-enable @angular-eslint/template/no-any -->\n <button\n *ngIf=\"recordState === MediaRecordingState.PAUSED && !recording\"\n class=\"str-chat__audio_recorder__resume-recording-button\"\n (click)=\"resume()\"\n (keyup.enter)=\"resume()\"\n >\n <stream-icon-placeholder icon=\"mic\"></stream-icon-placeholder>\n </button>\n <button\n *ngIf=\"recordState === MediaRecordingState.RECORDING && !recording\"\n class=\"str-chat__audio_recorder__pause-recording-button\"\n data-testid=\"pause-recording-audio-button\"\n (click)=\"pause()\"\n (keyup.enter)=\"pause()\"\n >\n <stream-icon-placeholder icon=\"pause\"></stream-icon-placeholder>\n </button>\n <ng-container\n *ngIf=\"recordState === MediaRecordingState.STOPPED; else stopButton\"\n >\n <button\n class=\"str-chat__audio_recorder__complete-button\"\n data-testid=\"audio-recorder-complete-button\"\n [disabled]=\"!recording\"\n (click)=\"uploadRecording()\"\n (keyup.enter)=\"uploadRecording()\"\n >\n <stream-loading-indicator\n *ngIf=\"isLoading; else sendIcon\"\n ></stream-loading-indicator>\n <ng-template #sendIcon>\n <stream-icon-placeholder icon=\"send\"></stream-icon-placeholder>\n </ng-template>\n </button>\n </ng-container>\n <ng-template #stopButton>\n <button\n class=\"str-chat__audio_recorder__stop-button\"\n data-testid=\"audio-recorder-stop-button\"\n [disabled]=\"recordState === MediaRecordingState.STOPPED\"\n (click)=\"stop()\"\n (keyup.enter)=\"stop()\"\n >\n <stream-icon-placeholder icon=\"delivered\"></stream-icon-placeholder>\n </button>\n </ng-template>\n </div>\n</div>\n" }]
|
|
@@ -9020,6 +9171,1087 @@ async function encodeWebmToMp3(blob, lameJs) {
|
|
|
9020
9171
|
}
|
|
9021
9172
|
/* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument */
|
|
9022
9173
|
|
|
9174
|
+
function atLeastOneOption() {
|
|
9175
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9176
|
+
return (control) => {
|
|
9177
|
+
const formArray = control;
|
|
9178
|
+
const hasAtLeastOne = formArray.value.some((item) => !!item);
|
|
9179
|
+
return hasAtLeastOne ? null : { atLeastOne: true };
|
|
9180
|
+
};
|
|
9181
|
+
}
|
|
9182
|
+
function maximumNumberOfVotes(canHaveMultipleVotes) {
|
|
9183
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9184
|
+
return (control) => {
|
|
9185
|
+
const formControl = control;
|
|
9186
|
+
return canHaveMultipleVotes.value && !formControl.value
|
|
9187
|
+
? { maximumNumberOfVotes: true }
|
|
9188
|
+
: null;
|
|
9189
|
+
};
|
|
9190
|
+
}
|
|
9191
|
+
|
|
9192
|
+
/**
|
|
9193
|
+
*
|
|
9194
|
+
*/
|
|
9195
|
+
class PollComposerComponent {
|
|
9196
|
+
constructor(customTemplatesService, chatService, notificationService) {
|
|
9197
|
+
this.customTemplatesService = customTemplatesService;
|
|
9198
|
+
this.chatService = chatService;
|
|
9199
|
+
this.notificationService = notificationService;
|
|
9200
|
+
/**
|
|
9201
|
+
* Emitted when a poll is created, the poll id is emitted
|
|
9202
|
+
*/
|
|
9203
|
+
this.pollCompose = new EventEmitter();
|
|
9204
|
+
/**
|
|
9205
|
+
* Emitted when the poll composing is cancelled
|
|
9206
|
+
*/
|
|
9207
|
+
this.cancel = new EventEmitter();
|
|
9208
|
+
this.formGroup = new FormGroup({
|
|
9209
|
+
name: new FormControl('', [Validators.required]),
|
|
9210
|
+
options: new FormArray([new FormControl('')], [atLeastOneOption()]),
|
|
9211
|
+
multiple_answers: new FormControl(false),
|
|
9212
|
+
maximum_number_of_votes: new FormControl(null, [
|
|
9213
|
+
Validators.min(2),
|
|
9214
|
+
Validators.max(10),
|
|
9215
|
+
]),
|
|
9216
|
+
is_anonymous: new FormControl(false),
|
|
9217
|
+
allow_user_suggested_options: new FormControl(false),
|
|
9218
|
+
allow_answers: new FormControl(false),
|
|
9219
|
+
});
|
|
9220
|
+
this.isModalOpen = true;
|
|
9221
|
+
this.formGroup
|
|
9222
|
+
.get('maximum_number_of_votes')
|
|
9223
|
+
?.addValidators([
|
|
9224
|
+
maximumNumberOfVotes(this.formGroup.get('multiple_answers')),
|
|
9225
|
+
]);
|
|
9226
|
+
this.formGroup.get('maximum_number_of_votes')?.disable();
|
|
9227
|
+
this.formGroup.valueChanges.subscribe((value) => {
|
|
9228
|
+
if (value.multiple_answers &&
|
|
9229
|
+
this.formGroup.get('maximum_number_of_votes')?.disabled) {
|
|
9230
|
+
this.formGroup.get('maximum_number_of_votes')?.enable();
|
|
9231
|
+
}
|
|
9232
|
+
else if (!value.multiple_answers &&
|
|
9233
|
+
this.formGroup.get('maximum_number_of_votes')?.enabled) {
|
|
9234
|
+
this.formGroup.get('maximum_number_of_votes')?.disable();
|
|
9235
|
+
}
|
|
9236
|
+
});
|
|
9237
|
+
}
|
|
9238
|
+
optionChanged(index) {
|
|
9239
|
+
const control = this.options.at(index);
|
|
9240
|
+
const penultimateIndex = this.options.length - 2;
|
|
9241
|
+
if (index === this.options.length - 1 && control.value?.length === 1) {
|
|
9242
|
+
this.addOption();
|
|
9243
|
+
}
|
|
9244
|
+
else if (index === penultimateIndex &&
|
|
9245
|
+
control.value?.length === 0 &&
|
|
9246
|
+
this.options.at(this.options.length - 1).value?.length === 0) {
|
|
9247
|
+
this.removeLastOption();
|
|
9248
|
+
}
|
|
9249
|
+
}
|
|
9250
|
+
get options() {
|
|
9251
|
+
return this.formGroup.get('options');
|
|
9252
|
+
}
|
|
9253
|
+
addOption() {
|
|
9254
|
+
const control = new FormControl('', []);
|
|
9255
|
+
this.options.push(control);
|
|
9256
|
+
}
|
|
9257
|
+
removeLastOption() {
|
|
9258
|
+
this.options.removeAt(this.options.length - 1);
|
|
9259
|
+
}
|
|
9260
|
+
getModalContext() {
|
|
9261
|
+
return {
|
|
9262
|
+
isOpen: this.isModalOpen,
|
|
9263
|
+
isOpenChangeHandler: (isOpen) => {
|
|
9264
|
+
if (!isOpen) {
|
|
9265
|
+
this.cancel.emit();
|
|
9266
|
+
}
|
|
9267
|
+
this.isModalOpen = isOpen;
|
|
9268
|
+
},
|
|
9269
|
+
content: this.formContent,
|
|
9270
|
+
};
|
|
9271
|
+
}
|
|
9272
|
+
async createPoll() {
|
|
9273
|
+
try {
|
|
9274
|
+
const maxVotesControl = this.formGroup.get('maximum_number_of_votes');
|
|
9275
|
+
const response = await this.chatService.chatClient.polls.createPoll({
|
|
9276
|
+
name: this.formGroup.get('name').value,
|
|
9277
|
+
options: this.formGroup
|
|
9278
|
+
.get('options')
|
|
9279
|
+
.value.filter((v) => !!v)
|
|
9280
|
+
.map((v) => ({ text: v })),
|
|
9281
|
+
enforce_unique_vote: !this.formGroup.get('multiple_answers')?.value,
|
|
9282
|
+
max_votes_allowed: maxVotesControl?.value
|
|
9283
|
+
? +maxVotesControl.value
|
|
9284
|
+
: undefined,
|
|
9285
|
+
voting_visibility: this.formGroup.get('is_anonymous')?.value
|
|
9286
|
+
? VotingVisibility.anonymous
|
|
9287
|
+
: VotingVisibility.public,
|
|
9288
|
+
allow_user_suggested_options: !!this.formGroup.get('allow_user_suggested_options')?.value,
|
|
9289
|
+
allow_answers: !!this.formGroup.get('allow_answers')?.value,
|
|
9290
|
+
});
|
|
9291
|
+
this.pollCompose.emit(response?.id);
|
|
9292
|
+
}
|
|
9293
|
+
catch (error) {
|
|
9294
|
+
this.notificationService.addTemporaryNotification('streamChat.Failed to create poll');
|
|
9295
|
+
throw error;
|
|
9296
|
+
}
|
|
9297
|
+
}
|
|
9298
|
+
}
|
|
9299
|
+
PollComposerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollComposerComponent, deps: [{ token: CustomTemplatesService }, { token: ChatClientService }, { token: NotificationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
9300
|
+
PollComposerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollComposerComponent, selector: "stream-poll-composer", outputs: { pollCompose: "pollCompose", cancel: "cancel" }, viewQueries: [{ propertyName: "formContent", first: true, predicate: ["formContent"], descendants: true }], ngImport: i0, template: "<ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n</ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"str-chat-angular__create-poll-modal str-chat__create-poll-modal\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #formContent>\n <div\n class=\"str-chat__dialog str-chat__poll-creation-dialog\"\n data-testid=\"poll-creation-dialog\"\n >\n <div class=\"str-chat__modal-header\">\n <div class=\"str-chat__modal-header__title\">\n {{ \"streamChat.Create poll\" | translate }}\n </div>\n </div>\n <div class=\"str-chat__dialog__body\">\n <form [formGroup]=\"formGroup\" autocomplete=\"off\">\n <div\n class=\"str-chat__form__field str-chat__form__input-field str-chat__form__input-field--with-label\"\n [class.str-chat__form__input-field--has-error]=\"\n formGroup.get('name')?.errors && formGroup.get('name')?.touched\n \"\n >\n <label class=\"str-chat__form__field-label\" htmlFor=\"name\">\n {{ \"streamChat.Question\" | translate }}\n </label>\n <div class=\"str-chat__form__input-field__value\">\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"name\")?.errors?.required &&\n formGroup.get(\"name\")?.touched\n ? \"streamChat.Question is required\"\n : \"\"\n ) | translate\n }}\n </div>\n <input\n id=\"name\"\n type=\"text\"\n formControlName=\"name\"\n placeholder=\"{{ 'streamChat.Ask a question' | translate }}\"\n />\n </div>\n </div>\n <fieldset class=\"str-chat__form__field str-chat__form__input-fieldset\">\n <legend class=\"str-chat__form__field-label\">\n {{ \"streamChat.Options\" | translate }}\n </legend>\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"options\")?.errors?.atLeastOne &&\n formGroup.get(\"options\")?.touched\n ? \"streamChat.Provide at least one option\"\n : \"\"\n ) | translate\n }}\n </div>\n <ng-container formArrayName=\"options\">\n <div class=\"str-chat__form__input-fieldset__values\">\n <!-- eslint-disable @angular-eslint/template/use-track-by-function -->\n <ng-container\n *ngFor=\"let option of options.controls; let i = index\"\n >\n <!-- eslint-enable @angular-eslint/template/use-track-by-function -->\n <div class=\"str-chat__drag-and-drop-container__item\">\n <div class=\"str-chat__form__input-field\">\n <input\n id=\"option{{ i }}\"\n name=\"option{{ i }}\"\n type=\"text\"\n [formControl]=\"option\"\n (input)=\"optionChanged(i)\"\n placeholder=\"{{ 'streamChat.Add an option' | translate }}\"\n />\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </fieldset>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'multiple_answers',\n control: formGroup.get('multiple_answers'),\n label: 'streamChat.Multiple answers' | translate\n }\n \"\n ></ng-container>\n <div\n *ngIf=\"formGroup.get('multiple_answers')?.value\"\n class=\"str-chat__form__field str-chat__form__input-field str-chat__form__input-field--with-label\"\n [class.str-chat__form__input-field--has-error]=\"\n formGroup.get('maximum_number_of_votes')?.errors &&\n formGroup.get('maximum_number_of_votes')?.touched\n \"\n >\n <label class=\"str-chat__form__field-label\" htmlFor=\"name\">\n {{ \"streamChat.Maximum number of votes\" | translate }}\n </label>\n <div class=\"str-chat__form__input-field__value\">\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"maximum_number_of_votes\")?.errors &&\n formGroup.get(\"maximum_number_of_votes\")?.touched\n ? \"streamChat.Provide a value between {{ min }}\n and {{ max }}\" : \"\" ) | translate: { min: 2, max: 10 } }}\n </div>\n <input\n id=\"maximum_number_of_votes\"\n type=\"text\"\n formControlName=\"maximum_number_of_votes\"\n placeholder=\"{{ 'streamChat.Provide a value between ' \n + '{{ min }} and {{ max }}' | translate: { min: 2, max: 10 } }}\"\n />\n </div>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'is_anonymous',\n control: formGroup.get('is_anonymous'),\n label: 'streamChat.Anonymous poll' | translate\n }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'allow_user_suggested_options',\n control: formGroup.get('allow_user_suggested_options'),\n label: 'streamChat.Allow option suggestions' | translate\n }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'allow_answers',\n control: formGroup.get('allow_answers'),\n label: 'streamChat.Allow comments' | translate\n }\n \"\n ></ng-container>\n </form>\n </div>\n <stream-notification-list></stream-notification-list>\n <div class=\"str-chat__dialog__controls\">\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel\"\n (click)=\"cancel.emit()\"\n type=\"button\"\n >\n {{ \"streamChat.Cancel\" | translate }}\n </button>\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--submit\"\n (click)=\"createPoll()\"\n [disabled]=\"formGroup.invalid\"\n type=\"submit\"\n >\n {{ \"streamChat.Create\" | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n\n<ng-template #switch let-control=\"control\" let-label=\"label\" let-name=\"name\">\n <div class=\"str-chat__form__field str-chat__form__switch-field\">\n <label>\n <div class=\"str-chat__form__field str-chat__form__switch-field-content\">\n <div class=\"str-chat__form__field str-chat__form__switch-field__text\">\n {{ label | translate }}\n </div>\n </div>\n <input\n type=\"checkbox\"\n [checked]=\"control.value\"\n id=\"{{ name }}\"\n name=\"{{ name }}\"\n />\n <div\n class=\"str-chat__form__switch-field__switch\"\n [class.str-chat__form__switch-field__switch--on]=\"control.value\"\n (click)=\"control.setValue(!control.value, { emitEvent: true })\"\n (keyup.enter)=\"control.setValue(!control.value, { emitEvent: true })\"\n >\n <div class=\"str-chat__form__switch-field__switch-handle\"></div>\n </div>\n </label>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ModalComponent, selector: "stream-modal", inputs: ["isOpen", "content"], outputs: ["isOpenChange"] }, { kind: "component", type: NotificationListComponent, selector: "stream-notification-list" }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
|
|
9301
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollComposerComponent, decorators: [{
|
|
9302
|
+
type: Component,
|
|
9303
|
+
args: [{ selector: 'stream-poll-composer', template: "<ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n</ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"str-chat-angular__create-poll-modal str-chat__create-poll-modal\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #formContent>\n <div\n class=\"str-chat__dialog str-chat__poll-creation-dialog\"\n data-testid=\"poll-creation-dialog\"\n >\n <div class=\"str-chat__modal-header\">\n <div class=\"str-chat__modal-header__title\">\n {{ \"streamChat.Create poll\" | translate }}\n </div>\n </div>\n <div class=\"str-chat__dialog__body\">\n <form [formGroup]=\"formGroup\" autocomplete=\"off\">\n <div\n class=\"str-chat__form__field str-chat__form__input-field str-chat__form__input-field--with-label\"\n [class.str-chat__form__input-field--has-error]=\"\n formGroup.get('name')?.errors && formGroup.get('name')?.touched\n \"\n >\n <label class=\"str-chat__form__field-label\" htmlFor=\"name\">\n {{ \"streamChat.Question\" | translate }}\n </label>\n <div class=\"str-chat__form__input-field__value\">\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"name\")?.errors?.required &&\n formGroup.get(\"name\")?.touched\n ? \"streamChat.Question is required\"\n : \"\"\n ) | translate\n }}\n </div>\n <input\n id=\"name\"\n type=\"text\"\n formControlName=\"name\"\n placeholder=\"{{ 'streamChat.Ask a question' | translate }}\"\n />\n </div>\n </div>\n <fieldset class=\"str-chat__form__field str-chat__form__input-fieldset\">\n <legend class=\"str-chat__form__field-label\">\n {{ \"streamChat.Options\" | translate }}\n </legend>\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"options\")?.errors?.atLeastOne &&\n formGroup.get(\"options\")?.touched\n ? \"streamChat.Provide at least one option\"\n : \"\"\n ) | translate\n }}\n </div>\n <ng-container formArrayName=\"options\">\n <div class=\"str-chat__form__input-fieldset__values\">\n <!-- eslint-disable @angular-eslint/template/use-track-by-function -->\n <ng-container\n *ngFor=\"let option of options.controls; let i = index\"\n >\n <!-- eslint-enable @angular-eslint/template/use-track-by-function -->\n <div class=\"str-chat__drag-and-drop-container__item\">\n <div class=\"str-chat__form__input-field\">\n <input\n id=\"option{{ i }}\"\n name=\"option{{ i }}\"\n type=\"text\"\n [formControl]=\"option\"\n (input)=\"optionChanged(i)\"\n placeholder=\"{{ 'streamChat.Add an option' | translate }}\"\n />\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </fieldset>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'multiple_answers',\n control: formGroup.get('multiple_answers'),\n label: 'streamChat.Multiple answers' | translate\n }\n \"\n ></ng-container>\n <div\n *ngIf=\"formGroup.get('multiple_answers')?.value\"\n class=\"str-chat__form__field str-chat__form__input-field str-chat__form__input-field--with-label\"\n [class.str-chat__form__input-field--has-error]=\"\n formGroup.get('maximum_number_of_votes')?.errors &&\n formGroup.get('maximum_number_of_votes')?.touched\n \"\n >\n <label class=\"str-chat__form__field-label\" htmlFor=\"name\">\n {{ \"streamChat.Maximum number of votes\" | translate }}\n </label>\n <div class=\"str-chat__form__input-field__value\">\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"maximum_number_of_votes\")?.errors &&\n formGroup.get(\"maximum_number_of_votes\")?.touched\n ? \"streamChat.Provide a value between {{ min }}\n and {{ max }}\" : \"\" ) | translate: { min: 2, max: 10 } }}\n </div>\n <input\n id=\"maximum_number_of_votes\"\n type=\"text\"\n formControlName=\"maximum_number_of_votes\"\n placeholder=\"{{ 'streamChat.Provide a value between ' \n + '{{ min }} and {{ max }}' | translate: { min: 2, max: 10 } }}\"\n />\n </div>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'is_anonymous',\n control: formGroup.get('is_anonymous'),\n label: 'streamChat.Anonymous poll' | translate\n }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'allow_user_suggested_options',\n control: formGroup.get('allow_user_suggested_options'),\n label: 'streamChat.Allow option suggestions' | translate\n }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'allow_answers',\n control: formGroup.get('allow_answers'),\n label: 'streamChat.Allow comments' | translate\n }\n \"\n ></ng-container>\n </form>\n </div>\n <stream-notification-list></stream-notification-list>\n <div class=\"str-chat__dialog__controls\">\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel\"\n (click)=\"cancel.emit()\"\n type=\"button\"\n >\n {{ \"streamChat.Cancel\" | translate }}\n </button>\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--submit\"\n (click)=\"createPoll()\"\n [disabled]=\"formGroup.invalid\"\n type=\"submit\"\n >\n {{ \"streamChat.Create\" | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n\n<ng-template #switch let-control=\"control\" let-label=\"label\" let-name=\"name\">\n <div class=\"str-chat__form__field str-chat__form__switch-field\">\n <label>\n <div class=\"str-chat__form__field str-chat__form__switch-field-content\">\n <div class=\"str-chat__form__field str-chat__form__switch-field__text\">\n {{ label | translate }}\n </div>\n </div>\n <input\n type=\"checkbox\"\n [checked]=\"control.value\"\n id=\"{{ name }}\"\n name=\"{{ name }}\"\n />\n <div\n class=\"str-chat__form__switch-field__switch\"\n [class.str-chat__form__switch-field__switch--on]=\"control.value\"\n (click)=\"control.setValue(!control.value, { emitEvent: true })\"\n (keyup.enter)=\"control.setValue(!control.value, { emitEvent: true })\"\n >\n <div class=\"str-chat__form__switch-field__switch-handle\"></div>\n </div>\n </label>\n </div>\n</ng-template>\n" }]
|
|
9304
|
+
}], ctorParameters: function () { return [{ type: CustomTemplatesService }, { type: ChatClientService }, { type: NotificationService }]; }, propDecorators: { pollCompose: [{
|
|
9305
|
+
type: Output
|
|
9306
|
+
}], cancel: [{
|
|
9307
|
+
type: Output
|
|
9308
|
+
}], formContent: [{
|
|
9309
|
+
type: ViewChild,
|
|
9310
|
+
args: ['formContent']
|
|
9311
|
+
}] } });
|
|
9312
|
+
|
|
9313
|
+
/**
|
|
9314
|
+
* @internal
|
|
9315
|
+
*/
|
|
9316
|
+
class BasePollComponent {
|
|
9317
|
+
constructor(customTemplatesService, chatClientService, cdRef, channelService, notificationService) {
|
|
9318
|
+
this.customTemplatesService = customTemplatesService;
|
|
9319
|
+
this.chatClientService = chatClientService;
|
|
9320
|
+
this.cdRef = cdRef;
|
|
9321
|
+
this.channelService = channelService;
|
|
9322
|
+
this.notificationService = notificationService;
|
|
9323
|
+
this.canVote = false;
|
|
9324
|
+
this.canQueryVotes = false;
|
|
9325
|
+
this.isViewInited = false;
|
|
9326
|
+
this.capabilitySubscription = this.channelService.activeChannel$.subscribe((channel) => {
|
|
9327
|
+
if (channel) {
|
|
9328
|
+
const capabilities = channel.data?.own_capabilities;
|
|
9329
|
+
this.canVote = capabilities.indexOf('cast-poll-vote') !== -1;
|
|
9330
|
+
this.canQueryVotes = capabilities.indexOf('query-poll-votes') !== -1;
|
|
9331
|
+
}
|
|
9332
|
+
});
|
|
9333
|
+
}
|
|
9334
|
+
ngOnChanges(changes) {
|
|
9335
|
+
if (changes['pollId']) {
|
|
9336
|
+
if (this.pollId) {
|
|
9337
|
+
this.setupStateStoreSelector();
|
|
9338
|
+
}
|
|
9339
|
+
else {
|
|
9340
|
+
this.pollStateUnsubscribe?.();
|
|
9341
|
+
}
|
|
9342
|
+
this.dismissNotificationFn?.();
|
|
9343
|
+
}
|
|
9344
|
+
}
|
|
9345
|
+
ngAfterViewInit() {
|
|
9346
|
+
this.isViewInited = true;
|
|
9347
|
+
}
|
|
9348
|
+
ngOnDestroy() {
|
|
9349
|
+
this.pollStateUnsubscribe?.();
|
|
9350
|
+
this.dismissNotificationFn?.();
|
|
9351
|
+
this.capabilitySubscription?.unsubscribe();
|
|
9352
|
+
}
|
|
9353
|
+
get poll() {
|
|
9354
|
+
return this.chatClientService.chatClient.polls.fromState(this.pollId ?? '');
|
|
9355
|
+
}
|
|
9356
|
+
setupStateStoreSelector() {
|
|
9357
|
+
this.pollStateUnsubscribe?.();
|
|
9358
|
+
const poll = this.chatClientService.chatClient.polls.fromState(this.pollId ?? '');
|
|
9359
|
+
if (poll) {
|
|
9360
|
+
this.pollStateUnsubscribe = this.stateStoreSelector(poll, () => {
|
|
9361
|
+
this.markForCheck();
|
|
9362
|
+
});
|
|
9363
|
+
}
|
|
9364
|
+
}
|
|
9365
|
+
addNotification(...args) {
|
|
9366
|
+
this.dismissNotificationFn?.();
|
|
9367
|
+
this.dismissNotificationFn =
|
|
9368
|
+
this.notificationService.addTemporaryNotification(...args);
|
|
9369
|
+
}
|
|
9370
|
+
get currentUser() {
|
|
9371
|
+
return this.chatClientService.chatClient.user;
|
|
9372
|
+
}
|
|
9373
|
+
markForCheck() {
|
|
9374
|
+
if (this.isViewInited) {
|
|
9375
|
+
this.cdRef.detectChanges();
|
|
9376
|
+
}
|
|
9377
|
+
}
|
|
9378
|
+
}
|
|
9379
|
+
BasePollComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BasePollComponent, deps: [{ token: CustomTemplatesService }, { token: ChatClientService }, { token: i0.ChangeDetectorRef }, { token: ChannelService }, { token: NotificationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
9380
|
+
BasePollComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: BasePollComponent, selector: "stream-base-poll", inputs: { pollId: "pollId", messageId: "messageId" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9381
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BasePollComponent, decorators: [{
|
|
9382
|
+
type: Component,
|
|
9383
|
+
args: [{
|
|
9384
|
+
selector: 'stream-base-poll',
|
|
9385
|
+
template: '',
|
|
9386
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9387
|
+
}]
|
|
9388
|
+
}], ctorParameters: function () { return [{ type: CustomTemplatesService }, { type: ChatClientService }, { type: i0.ChangeDetectorRef }, { type: ChannelService }, { type: NotificationService }]; }, propDecorators: { pollId: [{
|
|
9389
|
+
type: Input
|
|
9390
|
+
}], messageId: [{
|
|
9391
|
+
type: Input
|
|
9392
|
+
}] } });
|
|
9393
|
+
|
|
9394
|
+
/**
|
|
9395
|
+
*
|
|
9396
|
+
*/
|
|
9397
|
+
class PollHeaderComponent extends BasePollComponent {
|
|
9398
|
+
constructor() {
|
|
9399
|
+
super(...arguments);
|
|
9400
|
+
this.name = '';
|
|
9401
|
+
this.selectionInstructions = {
|
|
9402
|
+
text: '',
|
|
9403
|
+
count: undefined,
|
|
9404
|
+
};
|
|
9405
|
+
}
|
|
9406
|
+
stateStoreSelector(poll, markForCheck) {
|
|
9407
|
+
const unsubscribe = poll.state.subscribeWithSelector((state) => ({
|
|
9408
|
+
name: state.name,
|
|
9409
|
+
is_closed: state.is_closed,
|
|
9410
|
+
enforce_unique_vote: state.enforce_unique_vote,
|
|
9411
|
+
max_votes_allowed: state.max_votes_allowed,
|
|
9412
|
+
options: state.options,
|
|
9413
|
+
}), (state) => {
|
|
9414
|
+
const name = state.name;
|
|
9415
|
+
const selectionInstructions = this.getSelectionInstructions(state);
|
|
9416
|
+
let changed = false;
|
|
9417
|
+
if (name !== this.name) {
|
|
9418
|
+
this.name = name;
|
|
9419
|
+
changed = true;
|
|
9420
|
+
}
|
|
9421
|
+
if (selectionInstructions.text !== this.selectionInstructions.text ||
|
|
9422
|
+
selectionInstructions.count !== this.selectionInstructions.count) {
|
|
9423
|
+
this.selectionInstructions = selectionInstructions;
|
|
9424
|
+
changed = true;
|
|
9425
|
+
}
|
|
9426
|
+
if (changed) {
|
|
9427
|
+
markForCheck();
|
|
9428
|
+
}
|
|
9429
|
+
});
|
|
9430
|
+
return unsubscribe;
|
|
9431
|
+
}
|
|
9432
|
+
getSelectionInstructions(state) {
|
|
9433
|
+
if (state.is_closed)
|
|
9434
|
+
return {
|
|
9435
|
+
text: 'streamChat.Vote ended',
|
|
9436
|
+
count: undefined,
|
|
9437
|
+
};
|
|
9438
|
+
if (state.enforce_unique_vote || state.options.length === 1) {
|
|
9439
|
+
return {
|
|
9440
|
+
text: 'streamChat.Select one',
|
|
9441
|
+
count: undefined,
|
|
9442
|
+
};
|
|
9443
|
+
}
|
|
9444
|
+
if (state.max_votes_allowed)
|
|
9445
|
+
return {
|
|
9446
|
+
text: 'streamChat.Select up to {{count}}',
|
|
9447
|
+
count: state.max_votes_allowed > state.options.length
|
|
9448
|
+
? state.options.length
|
|
9449
|
+
: state.max_votes_allowed,
|
|
9450
|
+
};
|
|
9451
|
+
if (state.options.length > 1) {
|
|
9452
|
+
return {
|
|
9453
|
+
text: 'streamChat.Select one or more',
|
|
9454
|
+
count: undefined,
|
|
9455
|
+
};
|
|
9456
|
+
}
|
|
9457
|
+
return {
|
|
9458
|
+
text: '',
|
|
9459
|
+
count: undefined,
|
|
9460
|
+
};
|
|
9461
|
+
}
|
|
9462
|
+
}
|
|
9463
|
+
PollHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollHeaderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9464
|
+
PollHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollHeaderComponent, selector: "stream-poll-header", usesInheritance: true, ngImport: i0, template: "<div class=\"str-chat__poll-header\">\n <div class=\"str-chat__poll-title\">{{ name }}</div>\n <div class=\"str-chat__poll-subtitle\">\n {{ selectionInstructions.text | translate : selectionInstructions }}\n </div>\n</div>\n", dependencies: [{ kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9465
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollHeaderComponent, decorators: [{
|
|
9466
|
+
type: Component,
|
|
9467
|
+
args: [{ selector: 'stream-poll-header', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"str-chat__poll-header\">\n <div class=\"str-chat__poll-title\">{{ name }}</div>\n <div class=\"str-chat__poll-subtitle\">\n {{ selectionInstructions.text | translate : selectionInstructions }}\n </div>\n</div>\n" }]
|
|
9468
|
+
}] });
|
|
9469
|
+
|
|
9470
|
+
/**
|
|
9471
|
+
*
|
|
9472
|
+
*/
|
|
9473
|
+
class PollOptionSelectorComponent extends BasePollComponent {
|
|
9474
|
+
constructor() {
|
|
9475
|
+
super(...arguments);
|
|
9476
|
+
this.displayAvatarCount = 3;
|
|
9477
|
+
this.voteCountVerbose = false;
|
|
9478
|
+
this.isClosed = false;
|
|
9479
|
+
this.latestVotes = [];
|
|
9480
|
+
this.isWinner = false;
|
|
9481
|
+
this.voteCount = 0;
|
|
9482
|
+
this.winningOptionCount = 0;
|
|
9483
|
+
this.maxVoteAllowedCount = 0;
|
|
9484
|
+
this.ownVoteCount = 0;
|
|
9485
|
+
}
|
|
9486
|
+
ngOnChanges(changes) {
|
|
9487
|
+
super.ngOnChanges(changes);
|
|
9488
|
+
if (changes['option']) {
|
|
9489
|
+
this.setupStateStoreSelector();
|
|
9490
|
+
}
|
|
9491
|
+
}
|
|
9492
|
+
async toggleVote() {
|
|
9493
|
+
if (!this.canVote || !this.option?.id || !this.messageId || this.isClosed)
|
|
9494
|
+
return;
|
|
9495
|
+
const haveVotedForTheOption = !!this.ownVote;
|
|
9496
|
+
if (!haveVotedForTheOption &&
|
|
9497
|
+
this.maxVoteAllowedCount > 0 &&
|
|
9498
|
+
this.ownVoteCount >= this.maxVoteAllowedCount) {
|
|
9499
|
+
this.addNotification('streamChat.You have reached the maximum number of votes allowed');
|
|
9500
|
+
return;
|
|
9501
|
+
}
|
|
9502
|
+
try {
|
|
9503
|
+
await (haveVotedForTheOption
|
|
9504
|
+
? this.poll?.removeVote(this.ownVote.id, this.messageId)
|
|
9505
|
+
: this.poll?.castVote(this.option?.id, this.messageId));
|
|
9506
|
+
}
|
|
9507
|
+
catch (error) {
|
|
9508
|
+
this.notificationService.addTemporaryNotification('streamChat.Failed to cast vote');
|
|
9509
|
+
throw error;
|
|
9510
|
+
}
|
|
9511
|
+
}
|
|
9512
|
+
trackByVoteId(_, vote) {
|
|
9513
|
+
return vote.id;
|
|
9514
|
+
}
|
|
9515
|
+
stateStoreSelector(poll, markForCheck) {
|
|
9516
|
+
const unsubscribe = poll.state.subscribeWithSelector((nextValue) => {
|
|
9517
|
+
return {
|
|
9518
|
+
is_closed: nextValue.is_closed,
|
|
9519
|
+
latest_votes_by_option: nextValue.latest_votes_by_option,
|
|
9520
|
+
maxVotedOptionIds: nextValue.maxVotedOptionIds,
|
|
9521
|
+
ownVotesByOptionId: nextValue.ownVotesByOptionId,
|
|
9522
|
+
vote_counts_by_option: nextValue.vote_counts_by_option,
|
|
9523
|
+
voting_visibility: nextValue.voting_visibility,
|
|
9524
|
+
max_votes_allowed: nextValue.max_votes_allowed,
|
|
9525
|
+
};
|
|
9526
|
+
}, (state) => {
|
|
9527
|
+
const isClosed = state.is_closed;
|
|
9528
|
+
const latestVotes = state.latest_votes_by_option[this.option?.id ?? '']?.filter((vote) => !!vote.user && !isVoteAnswer(vote)) ?? [];
|
|
9529
|
+
const isWinner = state.maxVotedOptionIds.includes(this.option?.id ?? '') &&
|
|
9530
|
+
state.maxVotedOptionIds.length === 1;
|
|
9531
|
+
const ownVote = state.ownVotesByOptionId[this.option?.id ?? ''];
|
|
9532
|
+
const voteCount = state.vote_counts_by_option[this.option?.id ?? ''];
|
|
9533
|
+
const votingVisibility = state.voting_visibility;
|
|
9534
|
+
const winningOptionCount = state.vote_counts_by_option[state.maxVotedOptionIds?.[0] ?? ''];
|
|
9535
|
+
const maxVoteAllowedCount = state.max_votes_allowed;
|
|
9536
|
+
const ownVoteCount = Object.keys(state.ownVotesByOptionId).length;
|
|
9537
|
+
let changed = false;
|
|
9538
|
+
if (isClosed !== this.isClosed) {
|
|
9539
|
+
this.isClosed = isClosed ?? false;
|
|
9540
|
+
changed = true;
|
|
9541
|
+
}
|
|
9542
|
+
if (latestVotes !== this.latestVotes) {
|
|
9543
|
+
this.latestVotes = latestVotes ?? [];
|
|
9544
|
+
changed = true;
|
|
9545
|
+
}
|
|
9546
|
+
if (isWinner !== this.isWinner) {
|
|
9547
|
+
this.isWinner = isWinner ?? false;
|
|
9548
|
+
changed = true;
|
|
9549
|
+
}
|
|
9550
|
+
if (ownVote !== this.ownVote) {
|
|
9551
|
+
this.ownVote = ownVote ?? undefined;
|
|
9552
|
+
changed = true;
|
|
9553
|
+
}
|
|
9554
|
+
if (voteCount !== this.voteCount) {
|
|
9555
|
+
this.voteCount = voteCount ?? 0;
|
|
9556
|
+
changed = true;
|
|
9557
|
+
}
|
|
9558
|
+
if (votingVisibility !== this.votingVisibility) {
|
|
9559
|
+
this.votingVisibility = votingVisibility ?? undefined;
|
|
9560
|
+
changed = true;
|
|
9561
|
+
}
|
|
9562
|
+
if (winningOptionCount !== this.winningOptionCount) {
|
|
9563
|
+
this.winningOptionCount = winningOptionCount ?? 0;
|
|
9564
|
+
changed = true;
|
|
9565
|
+
}
|
|
9566
|
+
if (maxVoteAllowedCount !== this.maxVoteAllowedCount) {
|
|
9567
|
+
this.maxVoteAllowedCount = maxVoteAllowedCount ?? 0;
|
|
9568
|
+
changed = true;
|
|
9569
|
+
}
|
|
9570
|
+
if (ownVoteCount !== this.ownVoteCount) {
|
|
9571
|
+
this.ownVoteCount = ownVoteCount ?? 0;
|
|
9572
|
+
changed = true;
|
|
9573
|
+
}
|
|
9574
|
+
if (this.dismissNotificationFn &&
|
|
9575
|
+
this.maxVoteAllowedCount > 0 &&
|
|
9576
|
+
this.ownVoteCount <= this.maxVoteAllowedCount) {
|
|
9577
|
+
this.dismissNotificationFn();
|
|
9578
|
+
changed = true;
|
|
9579
|
+
}
|
|
9580
|
+
if (changed) {
|
|
9581
|
+
markForCheck();
|
|
9582
|
+
}
|
|
9583
|
+
});
|
|
9584
|
+
return unsubscribe;
|
|
9585
|
+
}
|
|
9586
|
+
}
|
|
9587
|
+
PollOptionSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollOptionSelectorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9588
|
+
PollOptionSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollOptionSelectorComponent, selector: "stream-poll-option-selector", inputs: { option: "option", displayAvatarCount: "displayAvatarCount", voteCountVerbose: "voteCountVerbose" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"str-chat__poll-option\"\n [class.str-chat__poll-option--votable]=\"\n !isClosed &&\n canVote &&\n maxVoteAllowedCount &&\n ownVoteCount < maxVoteAllowedCount &&\n !ownVote\n \"\n (click)=\"toggleVote()\"\n (keyup.enter)=\"toggleVote()\"\n>\n <ng-container *ngIf=\"canVote\">\n <ng-container *ngTemplateOutlet=\"checkmark\"></ng-container>\n </ng-container>\n <div class=\"str-chat__poll-option-data\">\n <p class=\"str-chat__poll-option-text\">{{ option?.text }}</p>\n <ng-container *ngIf=\"displayAvatarCount && votingVisibility === 'public'\">\n <div\n *ngFor=\"let vote of latestVotes; trackBy: trackByVoteId\"\n class=\"str-chat__poll-option-voters\"\n >\n <stream-avatar-placeholder\n location=\"poll-voter\"\n [user]=\"vote.user\"\n [imageUrl]=\"vote.user?.image\"\n [name]=\"vote.user?.name\"\n type=\"user\"\n ></stream-avatar-placeholder>\n </div>\n </ng-container>\n <div class=\"str-chat__poll-option-vote-count\">\n <ng-container *ngIf=\"voteCountVerbose; else count\">\n {{ 'streamChat.{{ count }} votes' | translate:{count: voteCount} }}\n </ng-container>\n <ng-template #count>\n {{ voteCount }}\n </ng-template>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"amountBar\"></ng-container>\n</div>\n\n<ng-template #checkmark>\n <div\n class=\"str-chat__checkmark\"\n [class.str-chat__checkmark--checked]=\"!!ownVote\"\n ></div>\n</ng-template>\n\n<ng-template #amountBar>\n <div\n class=\"str-chat__amount-bar str-chat__poll-option__votes-bar\"\n [class.str-chat__poll-option__votes-bar--winner]=\"isClosed && isWinner\"\n role=\"progressbar\"\n [ngStyle]=\"{\n '--str-chat__amount-bar-fulfillment':\n (winningOptionCount && voteCount / winningOptionCount) * 100 + '%'\n }\"\n ></div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: ["name", "imageUrl", "location", "channel", "user", "type", "initialsType", "showOnlineIndicator"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9589
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollOptionSelectorComponent, decorators: [{
|
|
9590
|
+
type: Component,
|
|
9591
|
+
args: [{ selector: 'stream-poll-option-selector', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"str-chat__poll-option\"\n [class.str-chat__poll-option--votable]=\"\n !isClosed &&\n canVote &&\n maxVoteAllowedCount &&\n ownVoteCount < maxVoteAllowedCount &&\n !ownVote\n \"\n (click)=\"toggleVote()\"\n (keyup.enter)=\"toggleVote()\"\n>\n <ng-container *ngIf=\"canVote\">\n <ng-container *ngTemplateOutlet=\"checkmark\"></ng-container>\n </ng-container>\n <div class=\"str-chat__poll-option-data\">\n <p class=\"str-chat__poll-option-text\">{{ option?.text }}</p>\n <ng-container *ngIf=\"displayAvatarCount && votingVisibility === 'public'\">\n <div\n *ngFor=\"let vote of latestVotes; trackBy: trackByVoteId\"\n class=\"str-chat__poll-option-voters\"\n >\n <stream-avatar-placeholder\n location=\"poll-voter\"\n [user]=\"vote.user\"\n [imageUrl]=\"vote.user?.image\"\n [name]=\"vote.user?.name\"\n type=\"user\"\n ></stream-avatar-placeholder>\n </div>\n </ng-container>\n <div class=\"str-chat__poll-option-vote-count\">\n <ng-container *ngIf=\"voteCountVerbose; else count\">\n {{ 'streamChat.{{ count }} votes' | translate:{count: voteCount} }}\n </ng-container>\n <ng-template #count>\n {{ voteCount }}\n </ng-template>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"amountBar\"></ng-container>\n</div>\n\n<ng-template #checkmark>\n <div\n class=\"str-chat__checkmark\"\n [class.str-chat__checkmark--checked]=\"!!ownVote\"\n ></div>\n</ng-template>\n\n<ng-template #amountBar>\n <div\n class=\"str-chat__amount-bar str-chat__poll-option__votes-bar\"\n [class.str-chat__poll-option__votes-bar--winner]=\"isClosed && isWinner\"\n role=\"progressbar\"\n [ngStyle]=\"{\n '--str-chat__amount-bar-fulfillment':\n (winningOptionCount && voteCount / winningOptionCount) * 100 + '%'\n }\"\n ></div>\n</ng-template>\n" }]
|
|
9592
|
+
}], propDecorators: { option: [{
|
|
9593
|
+
type: Input
|
|
9594
|
+
}], displayAvatarCount: [{
|
|
9595
|
+
type: Input
|
|
9596
|
+
}], voteCountVerbose: [{
|
|
9597
|
+
type: Input
|
|
9598
|
+
}] } });
|
|
9599
|
+
|
|
9600
|
+
/**
|
|
9601
|
+
*
|
|
9602
|
+
*/
|
|
9603
|
+
class PollOptionsListComponent extends BasePollComponent {
|
|
9604
|
+
constructor() {
|
|
9605
|
+
super(...arguments);
|
|
9606
|
+
/**
|
|
9607
|
+
* How many options should be displayed. If there are more options than this number, use the poll actions to display all options
|
|
9608
|
+
*/
|
|
9609
|
+
this.maxOptionsDisplayed = 10;
|
|
9610
|
+
this.options = [];
|
|
9611
|
+
}
|
|
9612
|
+
stateStoreSelector(poll, markForCheck) {
|
|
9613
|
+
const unsubscribe = poll.state.subscribeWithSelector((state) => ({
|
|
9614
|
+
options: state.options,
|
|
9615
|
+
}), (state) => {
|
|
9616
|
+
this.options = state.options;
|
|
9617
|
+
markForCheck();
|
|
9618
|
+
});
|
|
9619
|
+
return unsubscribe;
|
|
9620
|
+
}
|
|
9621
|
+
trackByOptionId(_, option) {
|
|
9622
|
+
return option.id;
|
|
9623
|
+
}
|
|
9624
|
+
}
|
|
9625
|
+
PollOptionsListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollOptionsListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9626
|
+
PollOptionsListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollOptionsListComponent, selector: "stream-poll-options-list", inputs: { maxOptionsDisplayed: "maxOptionsDisplayed" }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"str-chat__poll-option-list\"\n [class.str-chat__poll-option-list--full]=\"\n !maxOptionsDisplayed || maxOptionsDisplayed === options.length\n \"\n>\n <ng-container\n *ngFor=\"\n let option of options | slice : 0 : maxOptionsDisplayed;\n trackBy: trackByOptionId\n \"\n >\n <stream-poll-option-selector\n [option]=\"option\"\n [messageId]=\"messageId\"\n [pollId]=\"pollId\"\n ></stream-poll-option-selector>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: PollOptionSelectorComponent, selector: "stream-poll-option-selector", inputs: ["option", "displayAvatarCount", "voteCountVerbose"] }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9627
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollOptionsListComponent, decorators: [{
|
|
9628
|
+
type: Component,
|
|
9629
|
+
args: [{ selector: 'stream-poll-options-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"str-chat__poll-option-list\"\n [class.str-chat__poll-option-list--full]=\"\n !maxOptionsDisplayed || maxOptionsDisplayed === options.length\n \"\n>\n <ng-container\n *ngFor=\"\n let option of options | slice : 0 : maxOptionsDisplayed;\n trackBy: trackByOptionId\n \"\n >\n <stream-poll-option-selector\n [option]=\"option\"\n [messageId]=\"messageId\"\n [pollId]=\"pollId\"\n ></stream-poll-option-selector>\n </ng-container>\n</div>\n" }]
|
|
9630
|
+
}], propDecorators: { maxOptionsDisplayed: [{
|
|
9631
|
+
type: Input
|
|
9632
|
+
}] } });
|
|
9633
|
+
|
|
9634
|
+
/**
|
|
9635
|
+
*
|
|
9636
|
+
*/
|
|
9637
|
+
class PollVoteComponent {
|
|
9638
|
+
constructor(translateService, dateParser) {
|
|
9639
|
+
this.translateService = translateService;
|
|
9640
|
+
this.dateParser = dateParser;
|
|
9641
|
+
this.anonymousTranslation = 'Anonymous';
|
|
9642
|
+
this.translateService
|
|
9643
|
+
.get('streamChat.Anonymous')
|
|
9644
|
+
.subscribe((translation) => {
|
|
9645
|
+
this.anonymousTranslation = translation;
|
|
9646
|
+
});
|
|
9647
|
+
}
|
|
9648
|
+
parseDate(date) {
|
|
9649
|
+
return this.dateParser.parseDateTime(new Date(date));
|
|
9650
|
+
}
|
|
9651
|
+
}
|
|
9652
|
+
PollVoteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollVoteComponent, deps: [{ token: i6.TranslateService }, { token: DateParserService }], target: i0.ɵɵFactoryTarget.Component });
|
|
9653
|
+
PollVoteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollVoteComponent, selector: "stream-poll-vote", inputs: { vote: "vote" }, ngImport: i0, template: "<div class=\"str-chat__poll-vote\">\n <div class=\"str-chat__poll-vote__author\">\n <stream-avatar-placeholder\n location=\"poll-voter\"\n [user]=\"vote?.user\"\n [imageUrl]=\"vote?.user?.image\"\n [name]=\"vote?.user?.name ?? anonymousTranslation\"\n type=\"user\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__poll-vote__author__name\">\n {{ vote?.user?.name ?? anonymousTranslation }}\n </div>\n </div>\n <div *ngIf=\"vote?.created_at\" class=\"str-chat__poll-vote__timestamp\">\n {{ parseDate(vote!.created_at) }}\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: ["name", "imageUrl", "location", "channel", "user", "type", "initialsType", "showOnlineIndicator"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9654
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollVoteComponent, decorators: [{
|
|
9655
|
+
type: Component,
|
|
9656
|
+
args: [{ selector: 'stream-poll-vote', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"str-chat__poll-vote\">\n <div class=\"str-chat__poll-vote__author\">\n <stream-avatar-placeholder\n location=\"poll-voter\"\n [user]=\"vote?.user\"\n [imageUrl]=\"vote?.user?.image\"\n [name]=\"vote?.user?.name ?? anonymousTranslation\"\n type=\"user\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__poll-vote__author__name\">\n {{ vote?.user?.name ?? anonymousTranslation }}\n </div>\n </div>\n <div *ngIf=\"vote?.created_at\" class=\"str-chat__poll-vote__timestamp\">\n {{ parseDate(vote!.created_at) }}\n </div>\n</div>\n" }]
|
|
9657
|
+
}], ctorParameters: function () { return [{ type: i6.TranslateService }, { type: DateParserService }]; }, propDecorators: { vote: [{
|
|
9658
|
+
type: Input
|
|
9659
|
+
}] } });
|
|
9660
|
+
|
|
9661
|
+
/**
|
|
9662
|
+
*
|
|
9663
|
+
*/
|
|
9664
|
+
class PollVoteResultsListComponent extends BasePollComponent {
|
|
9665
|
+
constructor() {
|
|
9666
|
+
super(...arguments);
|
|
9667
|
+
this.isWinner = false;
|
|
9668
|
+
this.voteCount = 0;
|
|
9669
|
+
this.isLoading = false;
|
|
9670
|
+
this.votes = [];
|
|
9671
|
+
this.trackByVoteId = (_, vote) => {
|
|
9672
|
+
return vote.id;
|
|
9673
|
+
};
|
|
9674
|
+
}
|
|
9675
|
+
ngOnChanges(changes) {
|
|
9676
|
+
super.ngOnChanges(changes);
|
|
9677
|
+
if (changes['option']) {
|
|
9678
|
+
this.setupStateStoreSelector();
|
|
9679
|
+
this.next = undefined;
|
|
9680
|
+
this.votes = [];
|
|
9681
|
+
void this.loadVotes();
|
|
9682
|
+
}
|
|
9683
|
+
}
|
|
9684
|
+
async loadVotes() {
|
|
9685
|
+
if (!this.poll) {
|
|
9686
|
+
return;
|
|
9687
|
+
}
|
|
9688
|
+
try {
|
|
9689
|
+
this.isLoading = true;
|
|
9690
|
+
const response = await this.poll.queryOptionVotes({
|
|
9691
|
+
filter: {
|
|
9692
|
+
option_id: this.option?.id ?? '',
|
|
9693
|
+
},
|
|
9694
|
+
sort: { created_at: -1 },
|
|
9695
|
+
options: {
|
|
9696
|
+
next: this.next,
|
|
9697
|
+
},
|
|
9698
|
+
});
|
|
9699
|
+
this.next = response.next;
|
|
9700
|
+
this.votes = [...this.votes, ...response.votes];
|
|
9701
|
+
this.markForCheck();
|
|
9702
|
+
}
|
|
9703
|
+
catch (error) {
|
|
9704
|
+
this.notificationService.addTemporaryNotification('streamChat.Error loading votes');
|
|
9705
|
+
throw error;
|
|
9706
|
+
this.markForCheck();
|
|
9707
|
+
}
|
|
9708
|
+
finally {
|
|
9709
|
+
this.isLoading = false;
|
|
9710
|
+
this.markForCheck();
|
|
9711
|
+
}
|
|
9712
|
+
}
|
|
9713
|
+
stateStoreSelector(poll, markForCheck) {
|
|
9714
|
+
const subscribe = poll.state.subscribeWithSelector((state) => ({
|
|
9715
|
+
voteCount: state.vote_counts_by_option[this.option?.id ?? ''],
|
|
9716
|
+
maxVotedOptionIds: state.maxVotedOptionIds,
|
|
9717
|
+
}), (state) => {
|
|
9718
|
+
this.isWinner =
|
|
9719
|
+
state.maxVotedOptionIds?.includes(this.option?.id ?? '') &&
|
|
9720
|
+
state.maxVotedOptionIds.length === 1;
|
|
9721
|
+
this.voteCount = state.voteCount ?? 0;
|
|
9722
|
+
markForCheck();
|
|
9723
|
+
});
|
|
9724
|
+
return subscribe;
|
|
9725
|
+
}
|
|
9726
|
+
}
|
|
9727
|
+
PollVoteResultsListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollVoteResultsListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9728
|
+
PollVoteResultsListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollVoteResultsListComponent, selector: "stream-poll-vote-results-list", inputs: { option: "option" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"str-chat__poll-option str-chat__poll-option--full-vote-list\">\n <div class=\"str-chat__poll-option__header\">\n <div class=\"str-chat__poll-option__option-text\">{{ option?.text }}</div>\n <div class=\"str-chat__poll-result-option-vote-counter\">\n <div\n *ngIf=\"isWinner\"\n class=\"str-chat__poll-result-winning-option-icon\"\n ></div>\n <span class=\"str-chat__poll-result-option-vote-count\">\n {{ 'streamChat.{{ count }} votes' | translate:{count: voteCount ?? 0} }}\n </span>\n </div>\n </div>\n <stream-paginated-list\n class=\"str-chat__poll-vote-listing\"\n [items]=\"votes\"\n [hasMore]=\"next !== undefined\"\n [isLoading]=\"isLoading\"\n [trackBy]=\"trackByVoteId\"\n (loadMore)=\"loadVotes()\"\n >\n <ng-template let-vote=\"item\">\n <stream-poll-vote [vote]=\"vote\"></stream-poll-vote>\n </ng-template>\n </stream-paginated-list>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PaginatedListComponent, selector: "stream-paginated-list", inputs: ["items", "isLoading", "hasMore", "trackBy"], outputs: ["loadMore"] }, { kind: "component", type: PollVoteComponent, selector: "stream-poll-vote", inputs: ["vote"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9729
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollVoteResultsListComponent, decorators: [{
|
|
9730
|
+
type: Component,
|
|
9731
|
+
args: [{ selector: 'stream-poll-vote-results-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"str-chat__poll-option str-chat__poll-option--full-vote-list\">\n <div class=\"str-chat__poll-option__header\">\n <div class=\"str-chat__poll-option__option-text\">{{ option?.text }}</div>\n <div class=\"str-chat__poll-result-option-vote-counter\">\n <div\n *ngIf=\"isWinner\"\n class=\"str-chat__poll-result-winning-option-icon\"\n ></div>\n <span class=\"str-chat__poll-result-option-vote-count\">\n {{ 'streamChat.{{ count }} votes' | translate:{count: voteCount ?? 0} }}\n </span>\n </div>\n </div>\n <stream-paginated-list\n class=\"str-chat__poll-vote-listing\"\n [items]=\"votes\"\n [hasMore]=\"next !== undefined\"\n [isLoading]=\"isLoading\"\n [trackBy]=\"trackByVoteId\"\n (loadMore)=\"loadVotes()\"\n >\n <ng-template let-vote=\"item\">\n <stream-poll-vote [vote]=\"vote\"></stream-poll-vote>\n </ng-template>\n </stream-paginated-list>\n</div>\n" }]
|
|
9732
|
+
}], propDecorators: { option: [{
|
|
9733
|
+
type: Input
|
|
9734
|
+
}] } });
|
|
9735
|
+
|
|
9736
|
+
/**
|
|
9737
|
+
*
|
|
9738
|
+
*/
|
|
9739
|
+
class PollResultsListComponent extends BasePollComponent {
|
|
9740
|
+
constructor() {
|
|
9741
|
+
super(...arguments);
|
|
9742
|
+
this.class = 'str-chat__modal__poll-results';
|
|
9743
|
+
this.name = '';
|
|
9744
|
+
this.options = [];
|
|
9745
|
+
this.votePreviewCount = 5;
|
|
9746
|
+
this.maxVotedOptionIds = [];
|
|
9747
|
+
this.voteCountsByOption = {};
|
|
9748
|
+
this.latestVotesByOption = {};
|
|
9749
|
+
}
|
|
9750
|
+
stateStoreSelector(poll, markForCheck) {
|
|
9751
|
+
const unsubscribe = poll.state.subscribeWithSelector((state) => ({
|
|
9752
|
+
name: state.name,
|
|
9753
|
+
options: state.options,
|
|
9754
|
+
maxVotedOptionIds: state.maxVotedOptionIds,
|
|
9755
|
+
vote_counts_by_option: state.vote_counts_by_option,
|
|
9756
|
+
latest_votes_by_option: state.latest_votes_by_option,
|
|
9757
|
+
}), (state) => {
|
|
9758
|
+
this.name = state.name;
|
|
9759
|
+
this.options = [...state.options];
|
|
9760
|
+
this.options.sort((a, b) => {
|
|
9761
|
+
return ((state.vote_counts_by_option[b.id] ?? 0) -
|
|
9762
|
+
(state.vote_counts_by_option[a.id] ?? 0));
|
|
9763
|
+
});
|
|
9764
|
+
this.maxVotedOptionIds = state.maxVotedOptionIds;
|
|
9765
|
+
this.voteCountsByOption = state.vote_counts_by_option;
|
|
9766
|
+
this.latestVotesByOption = state.latest_votes_by_option;
|
|
9767
|
+
markForCheck();
|
|
9768
|
+
});
|
|
9769
|
+
return unsubscribe;
|
|
9770
|
+
}
|
|
9771
|
+
isWinner(optionId) {
|
|
9772
|
+
return (this.maxVotedOptionIds.length === 1 &&
|
|
9773
|
+
this.maxVotedOptionIds[0] === optionId);
|
|
9774
|
+
}
|
|
9775
|
+
trackByOptionId(_, option) {
|
|
9776
|
+
return option.id;
|
|
9777
|
+
}
|
|
9778
|
+
trackByVoteId(_, vote) {
|
|
9779
|
+
return vote.id;
|
|
9780
|
+
}
|
|
9781
|
+
}
|
|
9782
|
+
PollResultsListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollResultsListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9783
|
+
PollResultsListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollResultsListComponent, selector: "stream-poll-results-list", host: { properties: { "class": "this.class" } }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"str-chat__modal__poll-results\"\n [class.str-chat__modal__poll-results--option-detail]=\"optionToView\"\n>\n <div class=\"str-chat__modal-header\">\n <!-- eslint-disable-next-line @angular-eslint/template/accessibility-elements-content -->\n <button\n *ngIf=\"optionToView\"\n class=\"str-chat__modal-header__go-back-button\"\n (click)=\"optionToView = undefined\"\n ></button>\n <div class=\"str-chat__modal-header__title\" translate>\n streamChat.Poll results\n </div>\n </div>\n <ng-container *ngIf=\"optionToView; else allOptions\">\n <div class=\"str-chat__modal__poll-results__body\">\n <stream-poll-vote-results-list\n [option]=\"optionToView\"\n [messageId]=\"messageId\"\n [pollId]=\"pollId\"\n ></stream-poll-vote-results-list>\n </div>\n </ng-container>\n <ng-template #allOptions>\n <div class=\"str-chat__modal__poll-results__body\">\n <div class=\"str-chat__modal__poll-results__title\">{{ name }}</div>\n <div class=\"str-chat__modal__poll-results__option-list\">\n <div\n *ngFor=\"let option of options; trackBy: trackByOptionId\"\n class=\"str-chat__poll-option\"\n >\n <div class=\"str-chat__poll-option__header\">\n <div class=\"str-chat__poll-option__option-text\">\n {{ option.text }}\n </div>\n <div class=\"str-chat__poll-result-option-vote-counter\">\n <div\n *ngIf=\"isWinner(option.id)\"\n class=\"str-chat__poll-result-winning-option-icon\"\n ></div>\n <span class=\"str-chat__poll-result-option-vote-count\">\n {{ 'streamChat.{{ count }} votes' | translate:{count:\n voteCountsByOption[option.id] ?? 0} }}\n </span>\n </div>\n </div>\n <ng-container *ngIf=\"latestVotesByOption[option?.id ?? '']\">\n <div class=\"str-chat__poll-vote-listing\">\n <ng-container\n *ngFor=\"\n let vote of latestVotesByOption[option?.id ?? '']\n | slice : 0 : votePreviewCount;\n trackBy: trackByVoteId\n \"\n >\n <stream-poll-vote [vote]=\"vote\"></stream-poll-vote>\n </ng-container>\n </div>\n </ng-container>\n <button\n *ngIf=\"\n voteCountsByOption[option?.id ?? ''] > votePreviewCount &&\n canQueryVotes\n \"\n class=\"str-chat__poll-option__show-all-votes-button\"\n translate\n (click)=\"optionToView = option\"\n >\n streamChat.Show all\n </button>\n </div>\n </div>\n </div>\n </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: PollVoteResultsListComponent, selector: "stream-poll-vote-results-list", inputs: ["option"] }, { kind: "component", type: PollVoteComponent, selector: "stream-poll-vote", inputs: ["vote"] }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9784
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollResultsListComponent, decorators: [{
|
|
9785
|
+
type: Component,
|
|
9786
|
+
args: [{ selector: 'stream-poll-results-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"str-chat__modal__poll-results\"\n [class.str-chat__modal__poll-results--option-detail]=\"optionToView\"\n>\n <div class=\"str-chat__modal-header\">\n <!-- eslint-disable-next-line @angular-eslint/template/accessibility-elements-content -->\n <button\n *ngIf=\"optionToView\"\n class=\"str-chat__modal-header__go-back-button\"\n (click)=\"optionToView = undefined\"\n ></button>\n <div class=\"str-chat__modal-header__title\" translate>\n streamChat.Poll results\n </div>\n </div>\n <ng-container *ngIf=\"optionToView; else allOptions\">\n <div class=\"str-chat__modal__poll-results__body\">\n <stream-poll-vote-results-list\n [option]=\"optionToView\"\n [messageId]=\"messageId\"\n [pollId]=\"pollId\"\n ></stream-poll-vote-results-list>\n </div>\n </ng-container>\n <ng-template #allOptions>\n <div class=\"str-chat__modal__poll-results__body\">\n <div class=\"str-chat__modal__poll-results__title\">{{ name }}</div>\n <div class=\"str-chat__modal__poll-results__option-list\">\n <div\n *ngFor=\"let option of options; trackBy: trackByOptionId\"\n class=\"str-chat__poll-option\"\n >\n <div class=\"str-chat__poll-option__header\">\n <div class=\"str-chat__poll-option__option-text\">\n {{ option.text }}\n </div>\n <div class=\"str-chat__poll-result-option-vote-counter\">\n <div\n *ngIf=\"isWinner(option.id)\"\n class=\"str-chat__poll-result-winning-option-icon\"\n ></div>\n <span class=\"str-chat__poll-result-option-vote-count\">\n {{ 'streamChat.{{ count }} votes' | translate:{count:\n voteCountsByOption[option.id] ?? 0} }}\n </span>\n </div>\n </div>\n <ng-container *ngIf=\"latestVotesByOption[option?.id ?? '']\">\n <div class=\"str-chat__poll-vote-listing\">\n <ng-container\n *ngFor=\"\n let vote of latestVotesByOption[option?.id ?? '']\n | slice : 0 : votePreviewCount;\n trackBy: trackByVoteId\n \"\n >\n <stream-poll-vote [vote]=\"vote\"></stream-poll-vote>\n </ng-container>\n </div>\n </ng-container>\n <button\n *ngIf=\"\n voteCountsByOption[option?.id ?? ''] > votePreviewCount &&\n canQueryVotes\n \"\n class=\"str-chat__poll-option__show-all-votes-button\"\n translate\n (click)=\"optionToView = option\"\n >\n streamChat.Show all\n </button>\n </div>\n </div>\n </div>\n </ng-template>\n</div>\n" }]
|
|
9787
|
+
}], propDecorators: { class: [{
|
|
9788
|
+
type: HostBinding,
|
|
9789
|
+
args: ['class']
|
|
9790
|
+
}] } });
|
|
9791
|
+
|
|
9792
|
+
/**
|
|
9793
|
+
*
|
|
9794
|
+
*/
|
|
9795
|
+
class PollAnswersListComponent extends BasePollComponent {
|
|
9796
|
+
constructor() {
|
|
9797
|
+
super(...arguments);
|
|
9798
|
+
this.class = 'str-chat__modal__poll-answer-list';
|
|
9799
|
+
/**
|
|
9800
|
+
* The even that's emitted when the update/add comment button is clicked
|
|
9801
|
+
*/
|
|
9802
|
+
this.upsertOwnAnswer = new EventEmitter();
|
|
9803
|
+
this.isLoading = false;
|
|
9804
|
+
this.answers = [];
|
|
9805
|
+
this.isClosed = false;
|
|
9806
|
+
}
|
|
9807
|
+
ngOnChanges(changes) {
|
|
9808
|
+
super.ngOnChanges(changes);
|
|
9809
|
+
if (changes['pollId']) {
|
|
9810
|
+
void this.queryAnswers();
|
|
9811
|
+
}
|
|
9812
|
+
}
|
|
9813
|
+
async queryAnswers() {
|
|
9814
|
+
if (!this.poll) {
|
|
9815
|
+
return;
|
|
9816
|
+
}
|
|
9817
|
+
try {
|
|
9818
|
+
this.isLoading = true;
|
|
9819
|
+
const response = await this.poll.queryAnswers({
|
|
9820
|
+
filter: {},
|
|
9821
|
+
sort: { created_at: -1 },
|
|
9822
|
+
options: {
|
|
9823
|
+
next: this.next,
|
|
9824
|
+
},
|
|
9825
|
+
});
|
|
9826
|
+
this.next = response.next;
|
|
9827
|
+
this.answers = [...this.answers, ...response.votes];
|
|
9828
|
+
this.markForCheck();
|
|
9829
|
+
}
|
|
9830
|
+
catch (error) {
|
|
9831
|
+
this.notificationService.addTemporaryNotification('streamChat.Error loading answers');
|
|
9832
|
+
this.markForCheck();
|
|
9833
|
+
throw error;
|
|
9834
|
+
}
|
|
9835
|
+
finally {
|
|
9836
|
+
this.isLoading = false;
|
|
9837
|
+
this.markForCheck();
|
|
9838
|
+
}
|
|
9839
|
+
}
|
|
9840
|
+
trackByAnswerId(_, answer) {
|
|
9841
|
+
return answer.id;
|
|
9842
|
+
}
|
|
9843
|
+
stateStoreSelector(poll, markForCheck) {
|
|
9844
|
+
const unsubscribe = poll.state.subscribeWithSelector((state) => ({
|
|
9845
|
+
is_closed: state.is_closed,
|
|
9846
|
+
own_answer: state.ownAnswer,
|
|
9847
|
+
}), (state) => {
|
|
9848
|
+
this.isClosed = state.is_closed ?? false;
|
|
9849
|
+
this.ownAnswer = state.own_answer ?? undefined;
|
|
9850
|
+
markForCheck();
|
|
9851
|
+
});
|
|
9852
|
+
return unsubscribe;
|
|
9853
|
+
}
|
|
9854
|
+
}
|
|
9855
|
+
PollAnswersListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollAnswersListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9856
|
+
PollAnswersListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollAnswersListComponent, selector: "stream-poll-answers-list", outputs: { upsertOwnAnswer: "upsertOwnAnswer" }, host: { properties: { "class": "this.class" } }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"str-chat__modal__poll-answer-list\">\n <div class=\"str-chat__modal-header\">\n <div class=\"str-chat__modal-header__title\" translate>\n streamChat.Poll comments\n </div>\n </div>\n <div class=\"str-chat__modal__poll-answer-list__body\">\n <div class=\"str-chat__poll-answer-list\">\n <stream-paginated-list\n class=\"str-chat__poll-answer-list\"\n [items]=\"answers\"\n [hasMore]=\"next !== undefined\"\n [isLoading]=\"isLoading\"\n [trackBy]=\"trackByAnswerId\"\n (loadMore)=\"queryAnswers()\"\n >\n <ng-template let-answer=\"item\">\n <div class=\"str-chat__poll-answer\">\n <p *ngIf=\"answer.answer_text\" class=\"str-chat__poll-answer__text\">\n {{ answer.answer_text }}\n </p>\n <stream-poll-vote [vote]=\"answer\"></stream-poll-vote>\n </div>\n </ng-template>\n </stream-paginated-list>\n <button\n *ngIf=\"!isClosed\"\n class=\"str-chat__poll-action\"\n (click)=\"upsertOwnAnswer.emit()\"\n >\n {{\n (ownAnswer\n ? \"streamChat.Update your comment\"\n : \"streamChat.Add a comment\"\n ) | translate\n }}\n </button>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: PaginatedListComponent, selector: "stream-paginated-list", inputs: ["items", "isLoading", "hasMore", "trackBy"], outputs: ["loadMore"] }, { kind: "component", type: PollVoteComponent, selector: "stream-poll-vote", inputs: ["vote"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9857
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollAnswersListComponent, decorators: [{
|
|
9858
|
+
type: Component,
|
|
9859
|
+
args: [{ selector: 'stream-poll-answers-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"str-chat__modal__poll-answer-list\">\n <div class=\"str-chat__modal-header\">\n <div class=\"str-chat__modal-header__title\" translate>\n streamChat.Poll comments\n </div>\n </div>\n <div class=\"str-chat__modal__poll-answer-list__body\">\n <div class=\"str-chat__poll-answer-list\">\n <stream-paginated-list\n class=\"str-chat__poll-answer-list\"\n [items]=\"answers\"\n [hasMore]=\"next !== undefined\"\n [isLoading]=\"isLoading\"\n [trackBy]=\"trackByAnswerId\"\n (loadMore)=\"queryAnswers()\"\n >\n <ng-template let-answer=\"item\">\n <div class=\"str-chat__poll-answer\">\n <p *ngIf=\"answer.answer_text\" class=\"str-chat__poll-answer__text\">\n {{ answer.answer_text }}\n </p>\n <stream-poll-vote [vote]=\"answer\"></stream-poll-vote>\n </div>\n </ng-template>\n </stream-paginated-list>\n <button\n *ngIf=\"!isClosed\"\n class=\"str-chat__poll-action\"\n (click)=\"upsertOwnAnswer.emit()\"\n >\n {{\n (ownAnswer\n ? \"streamChat.Update your comment\"\n : \"streamChat.Add a comment\"\n ) | translate\n }}\n </button>\n </div>\n </div>\n</div>\n" }]
|
|
9860
|
+
}], propDecorators: { class: [{
|
|
9861
|
+
type: HostBinding,
|
|
9862
|
+
args: ['class']
|
|
9863
|
+
}], upsertOwnAnswer: [{
|
|
9864
|
+
type: Output
|
|
9865
|
+
}] } });
|
|
9866
|
+
|
|
9867
|
+
/**
|
|
9868
|
+
*
|
|
9869
|
+
*/
|
|
9870
|
+
class UpsertAnswerComponent extends BasePollComponent {
|
|
9871
|
+
constructor() {
|
|
9872
|
+
super(...arguments);
|
|
9873
|
+
this.class = 'str-chat__dialog';
|
|
9874
|
+
/**
|
|
9875
|
+
* The callback to close the modal the component is displayed in
|
|
9876
|
+
*/
|
|
9877
|
+
this.closeModal = () => { };
|
|
9878
|
+
this.formGroup = new FormGroup({
|
|
9879
|
+
comment: new FormControl('', [Validators.required]),
|
|
9880
|
+
});
|
|
9881
|
+
}
|
|
9882
|
+
ngOnChanges(changes) {
|
|
9883
|
+
super.ngOnChanges(changes);
|
|
9884
|
+
if (changes['answer']) {
|
|
9885
|
+
this.formGroup.get('comment')?.setValue(this.answer?.answer_text ?? '');
|
|
9886
|
+
}
|
|
9887
|
+
}
|
|
9888
|
+
async addComment() {
|
|
9889
|
+
if (this.formGroup.invalid || !this.messageId) {
|
|
9890
|
+
return;
|
|
9891
|
+
}
|
|
9892
|
+
try {
|
|
9893
|
+
await this.poll?.addAnswer(this.formGroup.value.comment, this.messageId);
|
|
9894
|
+
this.closeModal();
|
|
9895
|
+
this.markForCheck();
|
|
9896
|
+
}
|
|
9897
|
+
catch (error) {
|
|
9898
|
+
this.notificationService.addTemporaryNotification('streamChat.Failed to add comment');
|
|
9899
|
+
this.markForCheck();
|
|
9900
|
+
throw error;
|
|
9901
|
+
}
|
|
9902
|
+
}
|
|
9903
|
+
stateStoreSelector(_, __) {
|
|
9904
|
+
return () => { };
|
|
9905
|
+
}
|
|
9906
|
+
}
|
|
9907
|
+
UpsertAnswerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UpsertAnswerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9908
|
+
UpsertAnswerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: UpsertAnswerComponent, selector: "stream-upsert-answer", inputs: { answer: "answer", closeModal: "closeModal" }, host: { properties: { "class": "this.class" } }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"str-chat__dialog str-chat__dialog--form str-chat__prompt-dialog str-chat__modal__poll-add-comment\"\n>\n <div class=\"str-chat__dialog__body\">\n <div class=\"str-chat__dialog__title\">\n {{\n (answer ? \"streamChat.Update your comment\" : \"streamChat.Add a comment\")\n | translate\n }}\n </div>\n <form [formGroup]=\"formGroup\" (ngSubmit)=\"addComment()\">\n <div class=\"str-chat__dialog__field\">\n <input formControlName=\"comment\" id=\"comment\" type=\"text\" />\n </div>\n <div class=\"str-chat__dialog__controls\">\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel\"\n onClick=\"{close}\"\n type=\"button\"\n (click)=\"closeModal()\"\n >\n {{ \"streamChat.Cancel\" | translate }}\n </button>\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--submit\"\n type=\"submit\"\n [disabled]=\"formGroup.invalid\"\n >\n {{ \"streamChat.Send\" | translate }}\n </button>\n </div>\n </form>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9909
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UpsertAnswerComponent, decorators: [{
|
|
9910
|
+
type: Component,
|
|
9911
|
+
args: [{ selector: 'stream-upsert-answer', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"str-chat__dialog str-chat__dialog--form str-chat__prompt-dialog str-chat__modal__poll-add-comment\"\n>\n <div class=\"str-chat__dialog__body\">\n <div class=\"str-chat__dialog__title\">\n {{\n (answer ? \"streamChat.Update your comment\" : \"streamChat.Add a comment\")\n | translate\n }}\n </div>\n <form [formGroup]=\"formGroup\" (ngSubmit)=\"addComment()\">\n <div class=\"str-chat__dialog__field\">\n <input formControlName=\"comment\" id=\"comment\" type=\"text\" />\n </div>\n <div class=\"str-chat__dialog__controls\">\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel\"\n onClick=\"{close}\"\n type=\"button\"\n (click)=\"closeModal()\"\n >\n {{ \"streamChat.Cancel\" | translate }}\n </button>\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--submit\"\n type=\"submit\"\n [disabled]=\"formGroup.invalid\"\n >\n {{ \"streamChat.Send\" | translate }}\n </button>\n </div>\n </form>\n </div>\n</div>\n" }]
|
|
9912
|
+
}], propDecorators: { class: [{
|
|
9913
|
+
type: HostBinding,
|
|
9914
|
+
args: ['class']
|
|
9915
|
+
}], answer: [{
|
|
9916
|
+
type: Input
|
|
9917
|
+
}], closeModal: [{
|
|
9918
|
+
type: Input
|
|
9919
|
+
}] } });
|
|
9920
|
+
|
|
9921
|
+
function createUniqueValidator(isUnique) {
|
|
9922
|
+
return (control) => {
|
|
9923
|
+
const value = control.value;
|
|
9924
|
+
if (!value) {
|
|
9925
|
+
return null;
|
|
9926
|
+
}
|
|
9927
|
+
if (!isUnique(value)) {
|
|
9928
|
+
return { duplicate: true };
|
|
9929
|
+
}
|
|
9930
|
+
return null;
|
|
9931
|
+
};
|
|
9932
|
+
}
|
|
9933
|
+
|
|
9934
|
+
/**
|
|
9935
|
+
*
|
|
9936
|
+
*/
|
|
9937
|
+
class AddOptionComponent extends BasePollComponent {
|
|
9938
|
+
constructor() {
|
|
9939
|
+
super(...arguments);
|
|
9940
|
+
this.class = 'str-chat__dialog';
|
|
9941
|
+
/**
|
|
9942
|
+
* The callback to close the modal the component is displayed in
|
|
9943
|
+
*/
|
|
9944
|
+
this.closeModal = () => { };
|
|
9945
|
+
this.formGroup = new FormGroup({
|
|
9946
|
+
text: new FormControl('', [
|
|
9947
|
+
Validators.required,
|
|
9948
|
+
createUniqueValidator((value) => {
|
|
9949
|
+
return !this.options.some((option) => option.text.trim().toLowerCase() === value.trim().toLowerCase());
|
|
9950
|
+
}),
|
|
9951
|
+
]),
|
|
9952
|
+
});
|
|
9953
|
+
this.options = [];
|
|
9954
|
+
}
|
|
9955
|
+
async addOption() {
|
|
9956
|
+
if (this.formGroup.invalid || !this.messageId) {
|
|
9957
|
+
return;
|
|
9958
|
+
}
|
|
9959
|
+
try {
|
|
9960
|
+
await this.poll?.createOption({
|
|
9961
|
+
text: this.formGroup.value.text,
|
|
9962
|
+
});
|
|
9963
|
+
this.closeModal();
|
|
9964
|
+
this.markForCheck();
|
|
9965
|
+
}
|
|
9966
|
+
catch (error) {
|
|
9967
|
+
this.notificationService.addTemporaryNotification('streamChat.Failed to add option ({{ message }})', 'error', undefined, { message: error });
|
|
9968
|
+
this.markForCheck();
|
|
9969
|
+
throw error;
|
|
9970
|
+
}
|
|
9971
|
+
}
|
|
9972
|
+
stateStoreSelector(poll, markForCheck) {
|
|
9973
|
+
const unsubscribe = poll.state.subscribeWithSelector((state) => ({
|
|
9974
|
+
options: state.options,
|
|
9975
|
+
}), (state) => {
|
|
9976
|
+
this.options = state.options;
|
|
9977
|
+
markForCheck();
|
|
9978
|
+
});
|
|
9979
|
+
return unsubscribe;
|
|
9980
|
+
}
|
|
9981
|
+
}
|
|
9982
|
+
AddOptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AddOptionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9983
|
+
AddOptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AddOptionComponent, selector: "stream-add-option", inputs: { closeModal: "closeModal" }, host: { properties: { "class": "this.class" } }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"str-chat__dialog str-chat__dialog--form str-chat__prompt-dialog str-chat__modal__suggest-poll-option\"\n>\n <div class=\"str-chat__dialog__body\">\n <div class=\"str-chat__dialog__title\">\n {{ \"streamChat.Suggest an option\" | translate }}\n </div>\n <form [formGroup]=\"formGroup\">\n <div class=\"str-chat__dialog__field\">\n <input formControlName=\"text\" id=\"text\" type=\"text\" />\n <div class=\"str-chat__form-field-error\">\n {{\n formGroup.get(\"text\")?.errors?.duplicate\n ? (\"streamChat.Option already exists\" | translate)\n : \"\"\n }}\n </div>\n </div>\n <div class=\"str-chat__dialog__controls\">\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel\"\n type=\"button\"\n (click)=\"closeModal()\"\n (keyup.enter)=\"closeModal()\"\n >\n {{ \"streamChat.Cancel\" | translate }}\n </button>\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--submit\"\n type=\"submit\"\n (click)=\"addOption()\"\n (keyup.enter)=\"addOption()\"\n [disabled]=\"formGroup.invalid\"\n >\n {{ \"streamChat.Send\" | translate }}\n </button>\n </div>\n </form>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AddOptionComponent, decorators: [{
|
|
9985
|
+
type: Component,
|
|
9986
|
+
args: [{ selector: 'stream-add-option', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"str-chat__dialog str-chat__dialog--form str-chat__prompt-dialog str-chat__modal__suggest-poll-option\"\n>\n <div class=\"str-chat__dialog__body\">\n <div class=\"str-chat__dialog__title\">\n {{ \"streamChat.Suggest an option\" | translate }}\n </div>\n <form [formGroup]=\"formGroup\">\n <div class=\"str-chat__dialog__field\">\n <input formControlName=\"text\" id=\"text\" type=\"text\" />\n <div class=\"str-chat__form-field-error\">\n {{\n formGroup.get(\"text\")?.errors?.duplicate\n ? (\"streamChat.Option already exists\" | translate)\n : \"\"\n }}\n </div>\n </div>\n <div class=\"str-chat__dialog__controls\">\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel\"\n type=\"button\"\n (click)=\"closeModal()\"\n (keyup.enter)=\"closeModal()\"\n >\n {{ \"streamChat.Cancel\" | translate }}\n </button>\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--submit\"\n type=\"submit\"\n (click)=\"addOption()\"\n (keyup.enter)=\"addOption()\"\n [disabled]=\"formGroup.invalid\"\n >\n {{ \"streamChat.Send\" | translate }}\n </button>\n </div>\n </form>\n </div>\n</div>\n" }]
|
|
9987
|
+
}], propDecorators: { class: [{
|
|
9988
|
+
type: HostBinding,
|
|
9989
|
+
args: ['class']
|
|
9990
|
+
}], closeModal: [{
|
|
9991
|
+
type: Input
|
|
9992
|
+
}] } });
|
|
9993
|
+
|
|
9994
|
+
/**
|
|
9995
|
+
*
|
|
9996
|
+
*/
|
|
9997
|
+
class PollActionsComponent extends BasePollComponent {
|
|
9998
|
+
constructor(customTemplatesService, chatClientService, cdRef, channelService, notificationService, messageService) {
|
|
9999
|
+
super(customTemplatesService, chatClientService, cdRef, channelService, notificationService);
|
|
10000
|
+
this.messageService = messageService;
|
|
10001
|
+
/**
|
|
10002
|
+
* If there are more options than this number, the "See all options" button will be displayed
|
|
10003
|
+
*/
|
|
10004
|
+
this.maxOptionsDisplayed = 10;
|
|
10005
|
+
/**
|
|
10006
|
+
* The maximum number of options allowed for the poll, this is defined by Stream API
|
|
10007
|
+
*/
|
|
10008
|
+
this.maxPollOptions = 100;
|
|
10009
|
+
this.name = '';
|
|
10010
|
+
this.options = [];
|
|
10011
|
+
this.isClosed = false;
|
|
10012
|
+
this.allowUserSuggestions = false;
|
|
10013
|
+
this.allowAnswers = false;
|
|
10014
|
+
this.answerCount = 0;
|
|
10015
|
+
this.isOwnPoll = false;
|
|
10016
|
+
this.selectedAction = undefined;
|
|
10017
|
+
this.isModalOpen = false;
|
|
10018
|
+
this.modalOpened = (action) => {
|
|
10019
|
+
this.selectedAction = action;
|
|
10020
|
+
if (!this.isModalOpen) {
|
|
10021
|
+
this.isModalOpen = true;
|
|
10022
|
+
this.messageService.modalOpenedForMessage.next(this.messageId);
|
|
10023
|
+
}
|
|
10024
|
+
};
|
|
10025
|
+
this.modalClosed = () => {
|
|
10026
|
+
this.selectedAction = undefined;
|
|
10027
|
+
if (this.isModalOpen) {
|
|
10028
|
+
this.isModalOpen = false;
|
|
10029
|
+
this.messageService.modalOpenedForMessage.next(undefined);
|
|
10030
|
+
this.markForCheck();
|
|
10031
|
+
}
|
|
10032
|
+
};
|
|
10033
|
+
}
|
|
10034
|
+
stateStoreSelector(poll, markForCheck) {
|
|
10035
|
+
const unsubscribe = poll.state.subscribeWithSelector((state) => ({
|
|
10036
|
+
options: state.options,
|
|
10037
|
+
is_closed: state.is_closed,
|
|
10038
|
+
allow_user_suggested_options: state.allow_user_suggested_options,
|
|
10039
|
+
allow_answers: state.allow_answers,
|
|
10040
|
+
answer_count: state.answers_count,
|
|
10041
|
+
created_by: state.created_by,
|
|
10042
|
+
name: state.name,
|
|
10043
|
+
own_answer: state.ownAnswer,
|
|
10044
|
+
max_votes_allowed: state.max_votes_allowed,
|
|
10045
|
+
own_votes_by_option_id: state.ownVotesByOptionId,
|
|
10046
|
+
}), (state) => {
|
|
10047
|
+
this.options = state.options;
|
|
10048
|
+
this.isClosed = state.is_closed ?? false;
|
|
10049
|
+
this.allowUserSuggestions = state.allow_user_suggested_options ?? false;
|
|
10050
|
+
this.allowAnswers = state.allow_answers ?? false;
|
|
10051
|
+
this.answerCount = state.answer_count ?? 0;
|
|
10052
|
+
this.isOwnPoll = state.created_by?.id === this.currentUser?.id;
|
|
10053
|
+
this.name = state.name;
|
|
10054
|
+
this.ownAnwer = state.own_answer ?? undefined;
|
|
10055
|
+
markForCheck();
|
|
10056
|
+
});
|
|
10057
|
+
return unsubscribe;
|
|
10058
|
+
}
|
|
10059
|
+
async closePoll() {
|
|
10060
|
+
try {
|
|
10061
|
+
await this.poll?.close();
|
|
10062
|
+
this.modalClosed();
|
|
10063
|
+
this.markForCheck();
|
|
10064
|
+
}
|
|
10065
|
+
catch (error) {
|
|
10066
|
+
this.notificationService.addTemporaryNotification('streamChat.Failed to end vote');
|
|
10067
|
+
throw error;
|
|
10068
|
+
}
|
|
10069
|
+
}
|
|
10070
|
+
getModalContext() {
|
|
10071
|
+
return {
|
|
10072
|
+
isOpen: this.isModalOpen,
|
|
10073
|
+
isOpenChangeHandler: (isOpen) => {
|
|
10074
|
+
if (isOpen) {
|
|
10075
|
+
this.modalOpened(this.selectedAction);
|
|
10076
|
+
}
|
|
10077
|
+
else {
|
|
10078
|
+
this.modalClosed();
|
|
10079
|
+
}
|
|
10080
|
+
},
|
|
10081
|
+
content: this[this.selectedAction],
|
|
10082
|
+
};
|
|
10083
|
+
}
|
|
10084
|
+
}
|
|
10085
|
+
PollActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollActionsComponent, deps: [{ token: CustomTemplatesService }, { token: ChatClientService }, { token: i0.ChangeDetectorRef }, { token: ChannelService }, { token: NotificationService }, { token: MessageActionsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
10086
|
+
PollActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollActionsComponent, selector: "stream-poll-actions", inputs: { maxOptionsDisplayed: "maxOptionsDisplayed", maxPollOptions: "maxPollOptions" }, viewQueries: [{ propertyName: "allOptions", first: true, predicate: ["allOptions"], descendants: true }, { propertyName: "suggestOption", first: true, predicate: ["suggestOption"], descendants: true }, { propertyName: "addAnswer", first: true, predicate: ["addAnswer"], descendants: true }, { propertyName: "viewComments", first: true, predicate: ["viewComments"], descendants: true }, { propertyName: "viewResults", first: true, predicate: ["viewResults"], descendants: true }, { propertyName: "endVote", first: true, predicate: ["endVote"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"str-chat__poll-actions\">\n <ng-container\n *ngIf=\"maxOptionsDisplayed && options.length > maxOptionsDisplayed\"\n >\n <button class=\"str-chat__poll-action\" (click)=\"modalOpened('allOptions')\">\n {{ \"streamChat.See all options ({{count}})\" | translate:{count:\n options.length} }}\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"\n allowUserSuggestions &&\n canVote &&\n !isClosed &&\n options.length < maxPollOptions\n \"\n >\n <button\n class=\"str-chat__poll-action\"\n (click)=\"modalOpened('suggestOption')\"\n >\n {{ \"streamChat.Suggest an option\" | translate }}\n </button>\n </ng-container>\n <ng-container *ngIf=\"allowAnswers && canVote && !isClosed\">\n <button\n class=\"str-chat__poll-action\"\n (click)=\"modalOpened('addAnswer')\"\n (keyup.enter)=\"modalOpened('addAnswer')\"\n >\n <ng-container *ngIf=\"ownAnwer; else newAnswer\">\n {{ \"streamChat.Update your comment\" | translate }}\n </ng-container>\n <ng-template #newAnswer>\n {{ \"streamChat.Add a comment\" | translate }}\n </ng-template>\n </button>\n </ng-container>\n <ng-container *ngIf=\"answerCount > 0 && canQueryVotes\">\n <button class=\"str-chat__poll-action\" (click)=\"modalOpened('viewComments')\">\n {{ (answerCount === 1 ? \"streamChat.View {{ count }} comment\" :\n \"streamChat.View {{ count }} comments\") | translate:{count: answerCount}\n }}\n </button>\n </ng-container>\n <ng-container *ngIf=\"canQueryVotes\">\n <button class=\"str-chat__poll-action\" (click)=\"modalOpened('viewResults')\">\n {{ \"streamChat.View results\" | translate }}\n </button>\n </ng-container>\n <ng-container *ngIf=\"isOwnPoll && !isClosed\">\n <button class=\"str-chat__poll-action\" (click)=\"modalOpened('endVote')\">\n {{ \"streamChat.End vote\" | translate }}\n </button>\n </ng-container>\n</div>\n\n<ng-container *ngIf=\"selectedAction\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n</ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"str-chat__poll-actions str-chat-angular__poll-actions\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #allOptions>\n <div class=\"str-chat__modal__poll-option-list str-chat-angular__poll-actions\">\n <div class=\"str-chat__modal-header\">\n <div class=\"str-chat__modal-header__title\" translate>\n streamChat.Poll options\n </div>\n </div>\n <div class=\"str-chat__modal__poll-option-list__body\">\n <div class=\"str-chat__modal__poll-option-list__title\">{{ name }}</div>\n <stream-poll-options-list\n [pollId]=\"pollId\"\n [messageId]=\"messageId\"\n [maxOptionsDisplayed]=\"undefined\"\n ></stream-poll-options-list>\n <stream-notification-list></stream-notification-list>\n </div>\n </div>\n</ng-template>\n<ng-template #suggestOption>\n <stream-add-option\n [pollId]=\"pollId\"\n [messageId]=\"messageId\"\n [closeModal]=\"modalClosed\"\n ></stream-add-option>\n <stream-notification-list></stream-notification-list>\n</ng-template>\n<ng-template #addAnswer>\n <stream-upsert-answer\n [pollId]=\"pollId\"\n [messageId]=\"messageId\"\n [answer]=\"ownAnwer\"\n [closeModal]=\"modalClosed\"\n ></stream-upsert-answer>\n <stream-notification-list></stream-notification-list>\n</ng-template>\n<ng-template #viewComments>\n <stream-poll-answers-list\n (upsertOwnAnswer)=\"modalOpened('addAnswer')\"\n [pollId]=\"pollId\"\n [messageId]=\"messageId\"\n ></stream-poll-answers-list>\n <stream-notification-list></stream-notification-list>\n</ng-template>\n<ng-template #viewResults>\n <stream-poll-results-list\n [messageId]=\"messageId\"\n [pollId]=\"pollId\"\n ></stream-poll-results-list>\n <stream-notification-list></stream-notification-list>\n</ng-template>\n<ng-template #endVote>\n <div\n class=\"str-chat__dialog str-chat__dialog--prompt str-chat__modal__end-vote\"\n >\n <div class=\"str-chat__dialog__body\">\n <div class=\"str-chat__dialog__title\" translate>streamChat.End vote</div>\n <div class=\"str-chat__dialog__prompt\" translate>\n streamChat.After a poll is closed, no more votes can be cast\n </div>\n <stream-notification-list></stream-notification-list>\n <div class=\"str-chat__dialog__controls\">\n <button\n class=\"str-chat__dialog__controls-button\"\n (click)=\"modalClosed()\"\n >\n {{ \"streamChat.Cancel\" | translate }}\n </button>\n <button class=\"str-chat__dialog__controls-button\" (click)=\"closePoll()\">\n {{ \"streamChat.End vote\" | translate }}\n </button>\n </div>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i6.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: ModalComponent, selector: "stream-modal", inputs: ["isOpen", "content"], outputs: ["isOpenChange"] }, { kind: "component", type: NotificationListComponent, selector: "stream-notification-list" }, { kind: "component", type: PollOptionsListComponent, selector: "stream-poll-options-list", inputs: ["maxOptionsDisplayed"] }, { kind: "component", type: PollResultsListComponent, selector: "stream-poll-results-list" }, { kind: "component", type: PollAnswersListComponent, selector: "stream-poll-answers-list", outputs: ["upsertOwnAnswer"] }, { kind: "component", type: UpsertAnswerComponent, selector: "stream-upsert-answer", inputs: ["answer", "closeModal"] }, { kind: "component", type: AddOptionComponent, selector: "stream-add-option", inputs: ["closeModal"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10087
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollActionsComponent, decorators: [{
|
|
10088
|
+
type: Component,
|
|
10089
|
+
args: [{ selector: 'stream-poll-actions', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"str-chat__poll-actions\">\n <ng-container\n *ngIf=\"maxOptionsDisplayed && options.length > maxOptionsDisplayed\"\n >\n <button class=\"str-chat__poll-action\" (click)=\"modalOpened('allOptions')\">\n {{ \"streamChat.See all options ({{count}})\" | translate:{count:\n options.length} }}\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"\n allowUserSuggestions &&\n canVote &&\n !isClosed &&\n options.length < maxPollOptions\n \"\n >\n <button\n class=\"str-chat__poll-action\"\n (click)=\"modalOpened('suggestOption')\"\n >\n {{ \"streamChat.Suggest an option\" | translate }}\n </button>\n </ng-container>\n <ng-container *ngIf=\"allowAnswers && canVote && !isClosed\">\n <button\n class=\"str-chat__poll-action\"\n (click)=\"modalOpened('addAnswer')\"\n (keyup.enter)=\"modalOpened('addAnswer')\"\n >\n <ng-container *ngIf=\"ownAnwer; else newAnswer\">\n {{ \"streamChat.Update your comment\" | translate }}\n </ng-container>\n <ng-template #newAnswer>\n {{ \"streamChat.Add a comment\" | translate }}\n </ng-template>\n </button>\n </ng-container>\n <ng-container *ngIf=\"answerCount > 0 && canQueryVotes\">\n <button class=\"str-chat__poll-action\" (click)=\"modalOpened('viewComments')\">\n {{ (answerCount === 1 ? \"streamChat.View {{ count }} comment\" :\n \"streamChat.View {{ count }} comments\") | translate:{count: answerCount}\n }}\n </button>\n </ng-container>\n <ng-container *ngIf=\"canQueryVotes\">\n <button class=\"str-chat__poll-action\" (click)=\"modalOpened('viewResults')\">\n {{ \"streamChat.View results\" | translate }}\n </button>\n </ng-container>\n <ng-container *ngIf=\"isOwnPoll && !isClosed\">\n <button class=\"str-chat__poll-action\" (click)=\"modalOpened('endVote')\">\n {{ \"streamChat.End vote\" | translate }}\n </button>\n </ng-container>\n</div>\n\n<ng-container *ngIf=\"selectedAction\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n</ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"str-chat__poll-actions str-chat-angular__poll-actions\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #allOptions>\n <div class=\"str-chat__modal__poll-option-list str-chat-angular__poll-actions\">\n <div class=\"str-chat__modal-header\">\n <div class=\"str-chat__modal-header__title\" translate>\n streamChat.Poll options\n </div>\n </div>\n <div class=\"str-chat__modal__poll-option-list__body\">\n <div class=\"str-chat__modal__poll-option-list__title\">{{ name }}</div>\n <stream-poll-options-list\n [pollId]=\"pollId\"\n [messageId]=\"messageId\"\n [maxOptionsDisplayed]=\"undefined\"\n ></stream-poll-options-list>\n <stream-notification-list></stream-notification-list>\n </div>\n </div>\n</ng-template>\n<ng-template #suggestOption>\n <stream-add-option\n [pollId]=\"pollId\"\n [messageId]=\"messageId\"\n [closeModal]=\"modalClosed\"\n ></stream-add-option>\n <stream-notification-list></stream-notification-list>\n</ng-template>\n<ng-template #addAnswer>\n <stream-upsert-answer\n [pollId]=\"pollId\"\n [messageId]=\"messageId\"\n [answer]=\"ownAnwer\"\n [closeModal]=\"modalClosed\"\n ></stream-upsert-answer>\n <stream-notification-list></stream-notification-list>\n</ng-template>\n<ng-template #viewComments>\n <stream-poll-answers-list\n (upsertOwnAnswer)=\"modalOpened('addAnswer')\"\n [pollId]=\"pollId\"\n [messageId]=\"messageId\"\n ></stream-poll-answers-list>\n <stream-notification-list></stream-notification-list>\n</ng-template>\n<ng-template #viewResults>\n <stream-poll-results-list\n [messageId]=\"messageId\"\n [pollId]=\"pollId\"\n ></stream-poll-results-list>\n <stream-notification-list></stream-notification-list>\n</ng-template>\n<ng-template #endVote>\n <div\n class=\"str-chat__dialog str-chat__dialog--prompt str-chat__modal__end-vote\"\n >\n <div class=\"str-chat__dialog__body\">\n <div class=\"str-chat__dialog__title\" translate>streamChat.End vote</div>\n <div class=\"str-chat__dialog__prompt\" translate>\n streamChat.After a poll is closed, no more votes can be cast\n </div>\n <stream-notification-list></stream-notification-list>\n <div class=\"str-chat__dialog__controls\">\n <button\n class=\"str-chat__dialog__controls-button\"\n (click)=\"modalClosed()\"\n >\n {{ \"streamChat.Cancel\" | translate }}\n </button>\n <button class=\"str-chat__dialog__controls-button\" (click)=\"closePoll()\">\n {{ \"streamChat.End vote\" | translate }}\n </button>\n </div>\n </div>\n </div>\n</ng-template>\n" }]
|
|
10090
|
+
}], ctorParameters: function () { return [{ type: CustomTemplatesService }, { type: ChatClientService }, { type: i0.ChangeDetectorRef }, { type: ChannelService }, { type: NotificationService }, { type: MessageActionsService }]; }, propDecorators: { maxOptionsDisplayed: [{
|
|
10091
|
+
type: Input
|
|
10092
|
+
}], maxPollOptions: [{
|
|
10093
|
+
type: Input
|
|
10094
|
+
}], allOptions: [{
|
|
10095
|
+
type: ViewChild,
|
|
10096
|
+
args: ['allOptions']
|
|
10097
|
+
}], suggestOption: [{
|
|
10098
|
+
type: ViewChild,
|
|
10099
|
+
args: ['suggestOption']
|
|
10100
|
+
}], addAnswer: [{
|
|
10101
|
+
type: ViewChild,
|
|
10102
|
+
args: ['addAnswer']
|
|
10103
|
+
}], viewComments: [{
|
|
10104
|
+
type: ViewChild,
|
|
10105
|
+
args: ['viewComments']
|
|
10106
|
+
}], viewResults: [{
|
|
10107
|
+
type: ViewChild,
|
|
10108
|
+
args: ['viewResults']
|
|
10109
|
+
}], endVote: [{
|
|
10110
|
+
type: ViewChild,
|
|
10111
|
+
args: ['endVote']
|
|
10112
|
+
}] } });
|
|
10113
|
+
|
|
10114
|
+
/**
|
|
10115
|
+
*
|
|
10116
|
+
*/
|
|
10117
|
+
class PollComponent extends BasePollComponent {
|
|
10118
|
+
constructor() {
|
|
10119
|
+
super(...arguments);
|
|
10120
|
+
this.isClosed = false;
|
|
10121
|
+
}
|
|
10122
|
+
stateStoreSelector(poll, markForCheck) {
|
|
10123
|
+
const unsubscribe = poll.state.subscribeWithSelector((state) => {
|
|
10124
|
+
return {
|
|
10125
|
+
is_closed: state.is_closed,
|
|
10126
|
+
};
|
|
10127
|
+
}, (state) => {
|
|
10128
|
+
this.isClosed = state.is_closed ?? false;
|
|
10129
|
+
markForCheck();
|
|
10130
|
+
});
|
|
10131
|
+
return unsubscribe;
|
|
10132
|
+
}
|
|
10133
|
+
}
|
|
10134
|
+
PollComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
10135
|
+
PollComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollComponent, selector: "stream-poll", usesInheritance: true, ngImport: i0, template: "<div class=\"str-chat__poll\" [class.str-chat__poll--closed]=\"isClosed\">\n <div #header><ng-content select=\"[poll-header]\"></ng-content></div>\n <ng-container *ngIf=\"!header.hasChildNodes()\">\n <stream-poll-header [pollId]=\"pollId\" [messageId]=\"messageId\">\n </stream-poll-header>\n </ng-container>\n <div #options><ng-content select=\"[poll-options-list]\"></ng-content></div>\n <ng-container *ngIf=\"!options.hasChildNodes()\">\n <stream-poll-options-list [pollId]=\"pollId\" [messageId]=\"messageId\">\n </stream-poll-options-list>\n </ng-container>\n <div #actions><ng-content select=\"[poll-actions]\"></ng-content></div>\n <ng-container *ngIf=\"!actions.hasChildNodes()\">\n <stream-poll-actions [pollId]=\"pollId\" [messageId]=\"messageId\">\n </stream-poll-actions>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PollHeaderComponent, selector: "stream-poll-header" }, { kind: "component", type: PollOptionsListComponent, selector: "stream-poll-options-list", inputs: ["maxOptionsDisplayed"] }, { kind: "component", type: PollActionsComponent, selector: "stream-poll-actions", inputs: ["maxOptionsDisplayed", "maxPollOptions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollComponent, decorators: [{
|
|
10137
|
+
type: Component,
|
|
10138
|
+
args: [{ selector: 'stream-poll', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"str-chat__poll\" [class.str-chat__poll--closed]=\"isClosed\">\n <div #header><ng-content select=\"[poll-header]\"></ng-content></div>\n <ng-container *ngIf=\"!header.hasChildNodes()\">\n <stream-poll-header [pollId]=\"pollId\" [messageId]=\"messageId\">\n </stream-poll-header>\n </ng-container>\n <div #options><ng-content select=\"[poll-options-list]\"></ng-content></div>\n <ng-container *ngIf=\"!options.hasChildNodes()\">\n <stream-poll-options-list [pollId]=\"pollId\" [messageId]=\"messageId\">\n </stream-poll-options-list>\n </ng-container>\n <div #actions><ng-content select=\"[poll-actions]\"></ng-content></div>\n <ng-container *ngIf=\"!actions.hasChildNodes()\">\n <stream-poll-actions [pollId]=\"pollId\" [messageId]=\"messageId\">\n </stream-poll-actions>\n </ng-container>\n</div>\n" }]
|
|
10139
|
+
}] });
|
|
10140
|
+
|
|
10141
|
+
/**
|
|
10142
|
+
*
|
|
10143
|
+
*/
|
|
10144
|
+
class PollPreviewComponent extends BasePollComponent {
|
|
10145
|
+
constructor() {
|
|
10146
|
+
super(...arguments);
|
|
10147
|
+
this.name = '';
|
|
10148
|
+
this.isClosed = false;
|
|
10149
|
+
}
|
|
10150
|
+
stateStoreSelector(poll, markForCheck) {
|
|
10151
|
+
const unsubscribe = poll.state.subscribeWithSelector((state) => ({
|
|
10152
|
+
name: state.name,
|
|
10153
|
+
is_closed: state.is_closed,
|
|
10154
|
+
}), (state) => {
|
|
10155
|
+
this.name = state.name;
|
|
10156
|
+
this.isClosed = state.is_closed ?? false;
|
|
10157
|
+
markForCheck();
|
|
10158
|
+
});
|
|
10159
|
+
return unsubscribe;
|
|
10160
|
+
}
|
|
10161
|
+
}
|
|
10162
|
+
PollPreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollPreviewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
10163
|
+
PollPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollPreviewComponent, selector: "stream-poll-preview", usesInheritance: true, ngImport: i0, template: "<div\n class=\"str-chat__quoted-poll-preview\"\n [class.str-chat__quoted-poll-preview--closed]=\"isClosed\"\n>\n <div class=\"str-chat__quoted-poll-preview__icon\">\uD83D\uDCCA</div>\n <div class=\"str-chat__quoted-poll-preview__name\">{{ name }}</div>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollPreviewComponent, decorators: [{
|
|
10165
|
+
type: Component,
|
|
10166
|
+
args: [{ selector: 'stream-poll-preview', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"str-chat__quoted-poll-preview\"\n [class.str-chat__quoted-poll-preview--closed]=\"isClosed\"\n>\n <div class=\"str-chat__quoted-poll-preview__icon\">\uD83D\uDCCA</div>\n <div class=\"str-chat__quoted-poll-preview__name\">{{ name }}</div>\n</div>\n" }]
|
|
10167
|
+
}] });
|
|
10168
|
+
|
|
10169
|
+
class StreamPollsModule {
|
|
10170
|
+
}
|
|
10171
|
+
StreamPollsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamPollsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
10172
|
+
StreamPollsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: StreamPollsModule, declarations: [PollComposerComponent,
|
|
10173
|
+
PollComponent,
|
|
10174
|
+
PollHeaderComponent,
|
|
10175
|
+
PollOptionsListComponent,
|
|
10176
|
+
PollOptionSelectorComponent,
|
|
10177
|
+
PollActionsComponent,
|
|
10178
|
+
PollResultsListComponent,
|
|
10179
|
+
PollVoteResultsListComponent,
|
|
10180
|
+
PollVoteComponent,
|
|
10181
|
+
PollAnswersListComponent,
|
|
10182
|
+
UpsertAnswerComponent,
|
|
10183
|
+
AddOptionComponent,
|
|
10184
|
+
PollPreviewComponent], imports: [CommonModule,
|
|
10185
|
+
TranslateModule,
|
|
10186
|
+
StreamAvatarModule,
|
|
10187
|
+
StreamModalModule,
|
|
10188
|
+
StreamNotificationModule,
|
|
10189
|
+
StreamPaginatedListModule,
|
|
10190
|
+
ReactiveFormsModule], exports: [PollComposerComponent,
|
|
10191
|
+
PollComponent,
|
|
10192
|
+
PollHeaderComponent,
|
|
10193
|
+
PollOptionsListComponent,
|
|
10194
|
+
PollOptionSelectorComponent,
|
|
10195
|
+
PollActionsComponent,
|
|
10196
|
+
PollResultsListComponent,
|
|
10197
|
+
PollVoteResultsListComponent,
|
|
10198
|
+
PollVoteComponent,
|
|
10199
|
+
PollAnswersListComponent,
|
|
10200
|
+
UpsertAnswerComponent,
|
|
10201
|
+
AddOptionComponent,
|
|
10202
|
+
PollPreviewComponent] });
|
|
10203
|
+
StreamPollsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamPollsModule, imports: [CommonModule,
|
|
10204
|
+
TranslateModule,
|
|
10205
|
+
StreamAvatarModule,
|
|
10206
|
+
StreamModalModule,
|
|
10207
|
+
StreamNotificationModule,
|
|
10208
|
+
StreamPaginatedListModule,
|
|
10209
|
+
ReactiveFormsModule] });
|
|
10210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamPollsModule, decorators: [{
|
|
10211
|
+
type: NgModule,
|
|
10212
|
+
args: [{
|
|
10213
|
+
declarations: [
|
|
10214
|
+
PollComposerComponent,
|
|
10215
|
+
PollComponent,
|
|
10216
|
+
PollHeaderComponent,
|
|
10217
|
+
PollOptionsListComponent,
|
|
10218
|
+
PollOptionSelectorComponent,
|
|
10219
|
+
PollActionsComponent,
|
|
10220
|
+
PollResultsListComponent,
|
|
10221
|
+
PollVoteResultsListComponent,
|
|
10222
|
+
PollVoteComponent,
|
|
10223
|
+
PollAnswersListComponent,
|
|
10224
|
+
UpsertAnswerComponent,
|
|
10225
|
+
AddOptionComponent,
|
|
10226
|
+
PollPreviewComponent,
|
|
10227
|
+
],
|
|
10228
|
+
imports: [
|
|
10229
|
+
CommonModule,
|
|
10230
|
+
TranslateModule,
|
|
10231
|
+
StreamAvatarModule,
|
|
10232
|
+
StreamModalModule,
|
|
10233
|
+
StreamNotificationModule,
|
|
10234
|
+
StreamPaginatedListModule,
|
|
10235
|
+
ReactiveFormsModule,
|
|
10236
|
+
],
|
|
10237
|
+
exports: [
|
|
10238
|
+
PollComposerComponent,
|
|
10239
|
+
PollComponent,
|
|
10240
|
+
PollHeaderComponent,
|
|
10241
|
+
PollOptionsListComponent,
|
|
10242
|
+
PollOptionSelectorComponent,
|
|
10243
|
+
PollActionsComponent,
|
|
10244
|
+
PollResultsListComponent,
|
|
10245
|
+
PollVoteResultsListComponent,
|
|
10246
|
+
PollVoteComponent,
|
|
10247
|
+
PollAnswersListComponent,
|
|
10248
|
+
UpsertAnswerComponent,
|
|
10249
|
+
AddOptionComponent,
|
|
10250
|
+
PollPreviewComponent,
|
|
10251
|
+
],
|
|
10252
|
+
}]
|
|
10253
|
+
}] });
|
|
10254
|
+
|
|
9023
10255
|
/*
|
|
9024
10256
|
* Public API Surface of stream-chat-angular
|
|
9025
10257
|
*/
|
|
@@ -9030,5 +10262,5 @@ async function encodeWebmToMp3(blob, lameJs) {
|
|
|
9030
10262
|
* Generated bundle index. Do not edit.
|
|
9031
10263
|
*/
|
|
9032
10264
|
|
|
9033
|
-
export { AmplitudeRecorderService, AttachmentConfigurationService, AttachmentListComponent, AttachmentPreviewListComponent, AttachmentService, AudioRecorderService, AutocompleteTextareaComponent, AvatarComponent, AvatarPlaceholderComponent, ChannelComponent, ChannelHeaderComponent, ChannelListComponent, ChannelPreviewComponent, ChannelQuery, ChannelService, ChatClientService, CustomTemplatesService, DEFAULT_AMPLITUDE_RECORDER_CONFIG, DateParserService, EmojiInputService, IconComponent, IconModule, IconPlaceholderComponent, LoadingIndicatorComponent, LoadingIndicatorPlaceholderComponent, MediaRecordingState, MessageActionsBoxComponent, MessageActionsService, MessageBlockedComponent, MessageBouncePromptComponent, MessageComponent, MessageInputComponent, MessageInputConfigService, MessageListComponent, MessageReactionsComponent, MessageReactionsSelectorComponent, MessageReactionsService, MessageService, MessageTextComponent, ModalComponent, MultimediaRecorder, NotificationComponent, NotificationListComponent, NotificationService, PaginatedListComponent, StreamAutocompleteTextareaModule, StreamAvatarModule, StreamChatModule, StreamI18nService, StreamTextareaModule, TextareaComponent, TextareaDirective, ThemeService, ThreadComponent, TranscoderService, TransliterationService, UserListComponent, VirtualizedListService, VirtualizedMessageListService, VoiceRecorderComponent, VoiceRecorderModule, VoiceRecorderService, VoiceRecorderWavebarComponent, VoiceRecordingComponent, VoiceRecordingModule, VoiceRecordingWavebarComponent, createFileFromBlobs, createMessagePreview, createUriFromBlob, encodeWebmToMp3, formatDuration, getChannelDisplayText, getExtensionFromMimeType, getGroupStyles, getMessageTranslation, getReadBy, isImageAttachment, isImageFile, isOnSeparateDate, isSafari, listUsers, parseDate, readBlobAsArrayBuffer, textareaInjectionToken };
|
|
10265
|
+
export { AddOptionComponent, AmplitudeRecorderService, AttachmentConfigurationService, AttachmentListComponent, AttachmentPreviewListComponent, AttachmentService, AudioRecorderService, AutocompleteTextareaComponent, AvatarComponent, AvatarPlaceholderComponent, ChannelComponent, ChannelHeaderComponent, ChannelListComponent, ChannelPreviewComponent, ChannelQuery, ChannelService, ChatClientService, CustomTemplatesService, DEFAULT_AMPLITUDE_RECORDER_CONFIG, DateParserService, EmojiInputService, IconComponent, IconModule, IconPlaceholderComponent, LoadingIndicatorComponent, LoadingIndicatorPlaceholderComponent, MediaRecordingState, MessageActionsBoxComponent, MessageActionsService, MessageBlockedComponent, MessageBouncePromptComponent, MessageComponent, MessageInputComponent, MessageInputConfigService, MessageListComponent, MessageReactionsComponent, MessageReactionsSelectorComponent, MessageReactionsService, MessageService, MessageTextComponent, ModalComponent, MultimediaRecorder, NotificationComponent, NotificationListComponent, NotificationService, PaginatedListComponent, PollActionsComponent, PollAnswersListComponent, PollComponent, PollComposerComponent, PollHeaderComponent, PollOptionSelectorComponent, PollOptionsListComponent, PollPreviewComponent, PollResultsListComponent, PollVoteComponent, PollVoteResultsListComponent, StreamAutocompleteTextareaModule, StreamAvatarModule, StreamChatModule, StreamI18nService, StreamModalModule, StreamNotificationModule, StreamPaginatedListModule, StreamPollsModule, StreamTextareaModule, TextareaComponent, TextareaDirective, ThemeService, ThreadComponent, TranscoderService, TransliterationService, UpsertAnswerComponent, UserListComponent, VirtualizedListService, VirtualizedMessageListService, VoiceRecorderComponent, VoiceRecorderModule, VoiceRecorderService, VoiceRecorderWavebarComponent, VoiceRecordingComponent, VoiceRecordingModule, VoiceRecordingWavebarComponent, createFileFromBlobs, createMessagePreview, createUriFromBlob, encodeWebmToMp3, formatDuration, getChannelDisplayText, getExtensionFromMimeType, getGroupStyles, getMessageTranslation, getReadBy, isImageAttachment, isImageFile, isOnSeparateDate, isSafari, listUsers, parseDate, readBlobAsArrayBuffer, textareaInjectionToken };
|
|
9034
10266
|
//# sourceMappingURL=stream-chat-angular.mjs.map
|