stream-chat-angular 4.0.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/en.d.ts +2 -0
- package/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +669 -204
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/i18n/en.js +3 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/attachment-configuration.service.js +158 -0
- package/esm2015/lib/attachment-list/attachment-list.component.js +64 -25
- package/esm2015/lib/attachment.service.js +4 -1
- package/esm2015/lib/avatar/avatar.component.js +30 -6
- package/esm2015/lib/channel-preview/channel-preview.component.js +4 -4
- package/esm2015/lib/channel.service.js +127 -18
- package/esm2015/lib/message/message.component.js +17 -9
- package/esm2015/lib/message-actions-box/message-actions-box.component.js +5 -3
- package/esm2015/lib/message-list/image-load.service.js +2 -1
- package/esm2015/lib/message-list/message-list.component.js +158 -75
- package/esm2015/lib/types.js +1 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/stream-chat-angular.js +598 -170
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/attachment-configuration.service.d.ts +58 -0
- package/lib/attachment-list/attachment-list.component.d.ts +12 -8
- package/lib/avatar/avatar.component.d.ts +2 -0
- package/lib/channel.service.d.ts +35 -3
- package/lib/message/message.component.d.ts +7 -21
- package/lib/message-list/image-load.service.d.ts +1 -0
- package/lib/message-list/message-list.component.d.ts +14 -9
- package/lib/types.d.ts +10 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/src/assets/i18n/en.ts +2 -0
- package/src/assets/styles/css/index.css +1 -1
- package/src/assets/styles/css/index.css.map +1 -1
- package/src/assets/styles/scss/Attachment.scss +45 -2
- package/src/assets/styles/scss/Gallery.scss +12 -6
- package/src/assets/styles/scss/ImageCarousel.scss +6 -0
- package/src/assets/styles/scss/Message.scss +8 -2
- package/src/assets/styles/v2/css/index.css +1 -1
- package/src/assets/styles/v2/css/index.css.map +1 -1
- package/src/assets/styles/v2/css/index.layout.css +1 -1
- package/src/assets/styles/v2/css/index.layout.css.map +1 -1
- package/src/assets/styles/v2/scss/AttachmentList/AttachmentList-layout.scss +72 -46
- package/src/assets/styles/v2/scss/Message/Message-layout.scss +0 -16
- package/src/assets/styles/v2/scss/MessageReactions/MessageReactions-layout.scss +1 -10
- package/src/assets/styles/v2/scss/Tooltip/Tooltip-layout.scss +2 -23
- package/src/assets/version.ts +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Attachment } from 'stream-chat';
|
|
2
|
+
import { AttachmentConfigration, DefaultStreamChatGenerics, VideoAttachmentConfiguration } from './types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* The `AttachmentConfigurationService` provides customization for certain attributes of attachments displayed inside the message component. If you're using your own CDN, you can integrate resizing features of it by providing your own handlers.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AttachmentConfigurationService<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> {
|
|
8
|
+
/**
|
|
9
|
+
* A custom handler can be provided to override the default image attachment (images uploaded from files) configuration. By default the SDK uses fixed image height (a size that's known before image is loaded), if you override that with dynamic image height (for example: height: 100%) the scrolling logic inside the message list can break.
|
|
10
|
+
*/
|
|
11
|
+
customImageAttachmentConfigurationHandler?: (a: Attachment<T>, type: 'gallery' | 'single' | 'carousel', containerElement: HTMLElement) => AttachmentConfigration;
|
|
12
|
+
/**
|
|
13
|
+
* A custom handler can be provided to override the default video attachment (videos uploaded from files) configuration. By default the SDK uses fixed height (a size that's known before video is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.
|
|
14
|
+
*/
|
|
15
|
+
customVideoAttachmentConfigurationHandler?: (a: Attachment<T>, containerElement: HTMLElement) => VideoAttachmentConfiguration;
|
|
16
|
+
/**
|
|
17
|
+
* A custom handler can be provided to override the default giphy attachment (GIFs sent with the /giphy command) configuration. By default the SDK uses fixed height (a size that's known before the GIF is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.
|
|
18
|
+
*/
|
|
19
|
+
customGiphyAttachmentConfigurationHandler?: (a: Attachment<T>) => AttachmentConfigration;
|
|
20
|
+
/**
|
|
21
|
+
* A custom handler can be provided to override the default scraped image attachment (images found in links inside messages) configuration. By default the SDK uses fixed height (a size that's known before image is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.
|
|
22
|
+
*/
|
|
23
|
+
customScrapedImageAttachmentConfigurationHandler?: (a: Attachment<T>) => AttachmentConfigration;
|
|
24
|
+
/**
|
|
25
|
+
* You can turn on/off thumbnail generation for video attachments
|
|
26
|
+
*/
|
|
27
|
+
shouldGenerateVideoThumbnail: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Handles the configuration for image attachments, it's possible to provide your own function to override the default logic
|
|
30
|
+
* @param attachment The attachment to configure
|
|
31
|
+
* @param location Specifies where the image is being displayed
|
|
32
|
+
* @param element The default resizing logics reads the height/max-height and max-width propperties of this element and reduces file size based on the given values. File size reduction is done by Stream's CDN.
|
|
33
|
+
*/
|
|
34
|
+
getImageAttachmentConfiguration(attachment: Attachment<T>, location: 'gallery' | 'single' | 'carousel', element: HTMLElement): AttachmentConfigration;
|
|
35
|
+
/**
|
|
36
|
+
* Handles the configuration for video attachments, it's possible to provide your own function to override the default logic
|
|
37
|
+
* @param attachment The attachment to configure
|
|
38
|
+
* @param element The default resizing logics reads the height/max-height and max-width propperties of this element and reduces file size based on the given values. File size reduction is done by Stream's CDN.
|
|
39
|
+
*/
|
|
40
|
+
getVideoAttachmentConfiguration(attachment: Attachment<T>, element: HTMLElement): VideoAttachmentConfiguration;
|
|
41
|
+
/**
|
|
42
|
+
* Handles the configuration for giphy attachments, it's possible to provide your own function to override the default logic
|
|
43
|
+
* @param attachment The attachment to configure
|
|
44
|
+
*/
|
|
45
|
+
getGiphyAttachmentConfiguration(attachment: Attachment<T>): AttachmentConfigration;
|
|
46
|
+
/**
|
|
47
|
+
* Handles the configuration for scraped image attachments, it's possible to provide your own function to override the default logic
|
|
48
|
+
* @param attachment The attachment to configure
|
|
49
|
+
*/
|
|
50
|
+
getScrapedImageAttachmentConfiguration(attachment: Attachment<T>): AttachmentConfigration;
|
|
51
|
+
private addResizingParamsToUrl;
|
|
52
|
+
private getSizingRestrictions;
|
|
53
|
+
private getSizeRestrictions;
|
|
54
|
+
private getCSSSizeRestriction;
|
|
55
|
+
private getValueRepresentationOfCSSProperty;
|
|
56
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentConfigurationService<any>, never>;
|
|
57
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AttachmentConfigurationService<any>>;
|
|
58
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OnChanges } from '@angular/core';
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { Action, Attachment } from 'stream-chat';
|
|
3
|
-
import {
|
|
4
|
-
import { ModalContext, DefaultStreamChatGenerics } from '../types';
|
|
3
|
+
import { ModalContext, DefaultStreamChatGenerics, AttachmentConfigration, VideoAttachmentConfiguration } from '../types';
|
|
5
4
|
import { ChannelService } from '../channel.service';
|
|
6
5
|
import { CustomTemplatesService } from '../custom-templates.service';
|
|
6
|
+
import { AttachmentConfigurationService } from '../attachment-configuration.service';
|
|
7
7
|
import { ThemeService } from '../theme.service';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
/**
|
|
@@ -11,8 +11,8 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class AttachmentListComponent implements OnChanges {
|
|
13
13
|
readonly customTemplatesService: CustomTemplatesService;
|
|
14
|
-
private imageLoadService;
|
|
15
14
|
private channelService;
|
|
15
|
+
private attachmentConfigurationService;
|
|
16
16
|
/**
|
|
17
17
|
* The id of the message the attachments belong to
|
|
18
18
|
*/
|
|
@@ -31,16 +31,16 @@ export declare class AttachmentListComponent implements OnChanges {
|
|
|
31
31
|
imagesToViewCurrentIndex: number;
|
|
32
32
|
themeVersion: '1' | '2';
|
|
33
33
|
private modalContent;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
private attachmentConfigurations;
|
|
35
|
+
constructor(customTemplatesService: CustomTemplatesService, channelService: ChannelService, attachmentConfigurationService: AttachmentConfigurationService, themeService: ThemeService);
|
|
36
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
37
|
+
trackByUrl(_: number, attachment: Attachment): unknown;
|
|
37
38
|
isImage(attachment: Attachment): boolean;
|
|
38
39
|
isSvg(attachment: Attachment): boolean;
|
|
39
40
|
isFile(attachment: Attachment): boolean;
|
|
40
41
|
isGallery(attachment: Attachment): boolean;
|
|
41
42
|
isVideo(attachment: Attachment): boolean | "" | undefined;
|
|
42
43
|
isCard(attachment: Attachment): boolean;
|
|
43
|
-
imageLoaded(): void;
|
|
44
44
|
hasFileSize(attachment: Attachment<DefaultStreamChatGenerics>): boolean | "" | 0 | undefined;
|
|
45
45
|
getFileSize(attachment: Attachment<DefaultStreamChatGenerics>): string;
|
|
46
46
|
getModalContext(): ModalContext;
|
|
@@ -50,6 +50,10 @@ export declare class AttachmentListComponent implements OnChanges {
|
|
|
50
50
|
openImageModal(attachments: Attachment[], selectedIndex?: number): void;
|
|
51
51
|
stepImages(dir: -1 | 1): void;
|
|
52
52
|
trackByImageUrl(_: number, item: Attachment): unknown;
|
|
53
|
+
getImageAttachmentConfiguration(attachment: Attachment, type: 'gallery' | 'single', element: HTMLElement): AttachmentConfigration;
|
|
54
|
+
getCarouselImageAttachmentConfiguration(attachment: Attachment, element: HTMLElement): AttachmentConfigration;
|
|
55
|
+
getVideoAttachmentConfiguration(attachment: Attachment, element: HTMLElement): VideoAttachmentConfiguration;
|
|
56
|
+
getCardAttachmentConfiguration(attachment: Attachment): AttachmentConfigration;
|
|
53
57
|
get isImageModalPrevButtonVisible(): boolean;
|
|
54
58
|
get isImageModalNextButtonVisible(): boolean;
|
|
55
59
|
private createGallery;
|
|
@@ -39,6 +39,8 @@ export declare class AvatarComponent {
|
|
|
39
39
|
isError: boolean;
|
|
40
40
|
constructor(chatClientService: ChatClientService);
|
|
41
41
|
get initials(): string;
|
|
42
|
+
get fallbackChannelImage(): string | undefined;
|
|
43
|
+
private getOtherMemberIfOneToOneChannel;
|
|
42
44
|
static ɵfac: i0.ɵɵFactoryDeclaration<AvatarComponent, never>;
|
|
43
45
|
static ɵcmp: i0.ɵɵComponentDeclaration<AvatarComponent, "stream-avatar", never, { "name": "name"; "imageUrl": "imageUrl"; "size": "size"; "location": "location"; "channel": "channel"; "user": "user"; "type": "type"; }, {}, never, never>;
|
|
44
46
|
}
|
package/lib/channel.service.d.ts
CHANGED
|
@@ -56,6 +56,10 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
|
|
|
56
56
|
* Emits the list of currently loaded messages of the active channel.
|
|
57
57
|
*/
|
|
58
58
|
activeChannelMessages$: Observable<StreamMessage<T>[]>;
|
|
59
|
+
/**
|
|
60
|
+
* Emits the list of pinned messages of the active channel.
|
|
61
|
+
*/
|
|
62
|
+
activeChannelPinnedMessages$: Observable<StreamMessage<T>[]>;
|
|
59
63
|
/**
|
|
60
64
|
* Emits the id of the currently selected parent message. If no message is selected, it emits undefined.
|
|
61
65
|
*/
|
|
@@ -72,6 +76,13 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
|
|
|
72
76
|
* Emits the currently selected message to quote
|
|
73
77
|
*/
|
|
74
78
|
messageToQuote$: Observable<StreamMessage<T> | undefined>;
|
|
79
|
+
/**
|
|
80
|
+
* Emits the ID of the message the message list should jump to (can be a channel message or thread message)
|
|
81
|
+
*/
|
|
82
|
+
jumpToMessage$: Observable<{
|
|
83
|
+
id?: string;
|
|
84
|
+
parentId?: string;
|
|
85
|
+
}>;
|
|
75
86
|
/**
|
|
76
87
|
* Emits the list of users that are currently typing in the channel (current user is not included)
|
|
77
88
|
*/
|
|
@@ -145,10 +156,12 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
|
|
|
145
156
|
private channelsSubject;
|
|
146
157
|
private activeChannelSubject;
|
|
147
158
|
private activeChannelMessagesSubject;
|
|
159
|
+
private activeChannelPinnedMessagesSubject;
|
|
148
160
|
private hasMoreChannelsSubject;
|
|
149
161
|
private activeChannelSubscriptions;
|
|
150
162
|
private activeParentMessageIdSubject;
|
|
151
163
|
private activeThreadMessagesSubject;
|
|
164
|
+
private jumpToMessageSubject;
|
|
152
165
|
private latestMessageDateByUserByChannelsSubject;
|
|
153
166
|
private filters;
|
|
154
167
|
private sort;
|
|
@@ -186,16 +199,19 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
|
|
|
186
199
|
/**
|
|
187
200
|
* Sets the given `message` as an active parent message. If `undefined` is provided, it will deleselect the current parent message.
|
|
188
201
|
* @param message
|
|
202
|
+
* @param loadMessagesForm
|
|
189
203
|
*/
|
|
190
|
-
setAsActiveParentMessage(message: StreamMessage<T> | undefined): Promise<void>;
|
|
204
|
+
setAsActiveParentMessage(message: StreamMessage<T> | undefined, loadMessagesForm?: 'request' | 'state'): Promise<void>;
|
|
191
205
|
/**
|
|
192
206
|
* Loads the next page of messages of the active channel. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.
|
|
207
|
+
* @param direction
|
|
193
208
|
*/
|
|
194
|
-
loadMoreMessages(): Promise<void>;
|
|
209
|
+
loadMoreMessages(direction?: 'older' | 'newer'): Promise<void>;
|
|
195
210
|
/**
|
|
196
211
|
* Loads the next page of messages of the active thread. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.
|
|
212
|
+
* @param direction
|
|
197
213
|
*/
|
|
198
|
-
loadMoreThreadReplies(): Promise<void>;
|
|
214
|
+
loadMoreThreadReplies(direction?: 'older' | 'newer'): Promise<void>;
|
|
199
215
|
/**
|
|
200
216
|
* Queries the channels with the given filters, sorts and options. More info about [channel querying](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript) can be found in the platform documentation. By default the first channel in the list will be set as active channel and will be marked as read.
|
|
201
217
|
* @param filters
|
|
@@ -281,6 +297,22 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
|
|
|
281
297
|
*/
|
|
282
298
|
selectMessageToQuote(message: StreamMessage | undefined): void;
|
|
283
299
|
private sendMessageRequest;
|
|
300
|
+
/**
|
|
301
|
+
* Jumps to the selected message inside the message list, if the message is not yet loaded, it'll load the message (and it's surroundings) from the API.
|
|
302
|
+
* @param messageId The ID of the message to be loaded, 'latest' means jump to the latest messages
|
|
303
|
+
* @param parentMessageId The ID of the parent message if we want to load a thread message
|
|
304
|
+
*/
|
|
305
|
+
jumpToMessage(messageId: string, parentMessageId?: string): Promise<void>;
|
|
306
|
+
/**
|
|
307
|
+
* Pins the given message in the channel
|
|
308
|
+
* @param message
|
|
309
|
+
*/
|
|
310
|
+
pinMessage(message: StreamMessage<DefaultStreamChatGenerics>): Promise<void>;
|
|
311
|
+
/**
|
|
312
|
+
* Removes the given message from pinned messages
|
|
313
|
+
* @param message
|
|
314
|
+
*/
|
|
315
|
+
unpinMessage(message: StreamMessage<DefaultStreamChatGenerics>): Promise<void>;
|
|
284
316
|
private handleNotification;
|
|
285
317
|
private handleRemovedFromChannelNotification;
|
|
286
318
|
private handleNewMessageNotification;
|
|
@@ -36,6 +36,10 @@ export declare class MessageComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
36
36
|
* Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
|
|
37
37
|
*/
|
|
38
38
|
mode: 'thread' | 'main';
|
|
39
|
+
/**
|
|
40
|
+
* Highlighting is used to add visual emphasize to a message when jumping to the message
|
|
41
|
+
*/
|
|
42
|
+
isHighlighted: boolean;
|
|
39
43
|
readonly themeVersion: '1' | '2';
|
|
40
44
|
canReceiveReadEvents: boolean | undefined;
|
|
41
45
|
canReactToMessage: boolean | undefined;
|
|
@@ -51,6 +55,7 @@ export declare class MessageComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
51
55
|
popperTriggerClick: NgxPopperjsTriggers;
|
|
52
56
|
popperTriggerHover: NgxPopperjsTriggers;
|
|
53
57
|
popperPlacementAuto: NgxPopperjsPlacements;
|
|
58
|
+
private quotedMessageAttachments;
|
|
54
59
|
private user;
|
|
55
60
|
private subscriptions;
|
|
56
61
|
private container;
|
|
@@ -73,26 +78,6 @@ export declare class MessageComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
73
78
|
replyCount: number | undefined;
|
|
74
79
|
};
|
|
75
80
|
get canDisplayReadStatus(): boolean;
|
|
76
|
-
get quotedMessageAttachments(): import("stream-chat").Attachment<{
|
|
77
|
-
attachmentType: import("stream-chat").UR & import("../types").UnknownType & {
|
|
78
|
-
asset_url?: string | undefined;
|
|
79
|
-
id?: string | undefined;
|
|
80
|
-
images?: import("stream-chat").Attachment<DefaultStreamChatGenerics>[] | undefined;
|
|
81
|
-
mime_type?: string | undefined;
|
|
82
|
-
};
|
|
83
|
-
channelType: import("stream-chat").UR & import("../types").UnknownType & {
|
|
84
|
-
image?: string | undefined;
|
|
85
|
-
member_count?: number | undefined;
|
|
86
|
-
subtitle?: string | undefined;
|
|
87
|
-
};
|
|
88
|
-
commandType: string & {};
|
|
89
|
-
eventType: import("stream-chat").UR & import("../types").UnknownType;
|
|
90
|
-
messageType: {};
|
|
91
|
-
reactionType: import("stream-chat").UR & import("../types").UnknownType;
|
|
92
|
-
userType: import("stream-chat").UR & import("../types").UnknownType & import("../types").DefaultUserTypeInternal & {
|
|
93
|
-
mutes?: import("stream-chat").Mute<DefaultStreamChatGenerics>[] | undefined;
|
|
94
|
-
};
|
|
95
|
-
}>[];
|
|
96
81
|
getAttachmentListContext(): AttachmentListContext;
|
|
97
82
|
getQuotedMessageAttachmentListContext(): AttachmentListContext;
|
|
98
83
|
getMessageReactionsContext(): MessageReactionsContext;
|
|
@@ -100,8 +85,9 @@ export declare class MessageComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
100
85
|
setAsActiveParentMessage(): void;
|
|
101
86
|
getMentionContext(messagePart: MessagePart): MentionTemplateContext;
|
|
102
87
|
getMessageActionsBoxContext(): MessageActionsBoxContext;
|
|
88
|
+
jumpToMessage(messageId: string, parentMessageId?: string): void;
|
|
103
89
|
private createMessageParts;
|
|
104
90
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageComponent, never>;
|
|
105
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MessageComponent, "stream-message", never, { "message": "message"; "enabledMessageActions": "enabledMessageActions"; "isLastSentMessage": "isLastSentMessage"; "mode": "mode"; }, {}, never, never>;
|
|
91
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MessageComponent, "stream-message", never, { "message": "message"; "enabledMessageActions": "enabledMessageActions"; "isLastSentMessage": "isLastSentMessage"; "mode": "mode"; "isHighlighted": "isHighlighted"; }, {}, never, never>;
|
|
106
92
|
}
|
|
107
93
|
export {};
|
|
@@ -2,6 +2,7 @@ import { Subject } from 'rxjs';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
/**
|
|
4
4
|
* The `ImageLoadService` is used to position the scrollbar in the message list
|
|
5
|
+
* @deprecated - This class is no longer used by SDK components as image sizes are fixed
|
|
5
6
|
*/
|
|
6
7
|
export declare class ImageLoadService {
|
|
7
8
|
/**
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { AfterViewChecked, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
|
|
1
|
+
import { AfterViewChecked, AfterViewInit, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
|
|
2
2
|
import { ChannelService } from '../channel.service';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { MessageContext, StreamMessage, TypingIndicatorContext } from '../types';
|
|
5
5
|
import { ChatClientService } from '../chat-client.service';
|
|
6
6
|
import { GroupStyle } from './group-styles';
|
|
7
|
-
import { ImageLoadService } from './image-load.service';
|
|
8
7
|
import { UserResponse } from 'stream-chat';
|
|
9
8
|
import { CustomTemplatesService } from '../custom-templates.service';
|
|
10
9
|
import * as i0 from "@angular/core";
|
|
11
10
|
/**
|
|
12
11
|
* The `MessageList` component renders a scrollable list of messages.
|
|
13
12
|
*/
|
|
14
|
-
export declare class MessageListComponent implements AfterViewChecked, OnChanges, OnInit, OnDestroy {
|
|
13
|
+
export declare class MessageListComponent implements AfterViewChecked, OnChanges, OnInit, OnDestroy, AfterViewInit {
|
|
15
14
|
private channelService;
|
|
16
15
|
private chatClientService;
|
|
17
|
-
private imageLoadService;
|
|
18
16
|
private customTemplatesService;
|
|
19
17
|
/**
|
|
20
18
|
* Determines if the message list should display channel messages or [thread messages](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
|
|
@@ -34,27 +32,30 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
|
|
|
34
32
|
groupStyles: GroupStyle[];
|
|
35
33
|
lastSentMessageId: string | undefined;
|
|
36
34
|
parentMessage: StreamMessage | undefined;
|
|
35
|
+
highlightedMessageId: string | undefined;
|
|
37
36
|
private scrollContainer;
|
|
38
37
|
private parentMessageElement;
|
|
39
|
-
private
|
|
38
|
+
private latestMessage;
|
|
40
39
|
private hasNewMessages;
|
|
41
40
|
private containerHeight;
|
|
42
|
-
private
|
|
41
|
+
private oldestMessage;
|
|
43
42
|
private olderMassagesLoaded;
|
|
44
43
|
private isNewMessageSentByUser;
|
|
45
|
-
private readonly isUserScrolledUpThreshold;
|
|
46
44
|
private subscriptions;
|
|
45
|
+
private newMessageSubscription;
|
|
47
46
|
private prevScrollTop;
|
|
48
47
|
private usersTypingInChannel$;
|
|
49
48
|
private usersTypingInThread$;
|
|
50
|
-
|
|
49
|
+
private isLatestMessageInList;
|
|
50
|
+
constructor(channelService: ChannelService, chatClientService: ChatClientService, customTemplatesService: CustomTemplatesService);
|
|
51
51
|
ngOnInit(): void;
|
|
52
52
|
ngOnChanges(changes: SimpleChanges): void;
|
|
53
|
+
ngAfterViewInit(): void;
|
|
53
54
|
ngAfterViewChecked(): void;
|
|
54
55
|
ngOnDestroy(): void;
|
|
55
56
|
trackByMessageId(index: number, item: StreamMessage): string;
|
|
56
57
|
trackByUserId(index: number, user: UserResponse): string;
|
|
57
|
-
|
|
58
|
+
jumpToLatestMessage(): void;
|
|
58
59
|
scrollToBottom(): void;
|
|
59
60
|
scrollToTop(): void;
|
|
60
61
|
scrolled(): void;
|
|
@@ -65,10 +66,14 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
|
|
|
65
66
|
replyCount: number | undefined;
|
|
66
67
|
};
|
|
67
68
|
private preserveScrollbarPosition;
|
|
69
|
+
private getScrollPosition;
|
|
68
70
|
private shouldLoadMoreMessages;
|
|
69
71
|
private setMessages$;
|
|
70
72
|
private resetScrollState;
|
|
71
73
|
private get usersTyping$();
|
|
74
|
+
private scrollMessageIntoView;
|
|
75
|
+
private scrollToLatestMessage;
|
|
76
|
+
private newMessageReceived;
|
|
72
77
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageListComponent, never>;
|
|
73
78
|
static ɵcmp: i0.ɵɵComponentDeclaration<MessageListComponent, "stream-message-list", never, { "mode": "mode"; "direction": "direction"; }, {}, never, never>;
|
|
74
79
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export declare type AttachmentUpload = {
|
|
|
52
52
|
url?: string;
|
|
53
53
|
type: 'image' | 'file' | 'video';
|
|
54
54
|
previewUri?: string | ArrayBuffer;
|
|
55
|
+
thumb_url?: string;
|
|
55
56
|
};
|
|
56
57
|
export declare type MentionAutcompleteListItemContext = {
|
|
57
58
|
item: MentionAutcompleteListItem;
|
|
@@ -103,6 +104,7 @@ export declare type MessageContext = {
|
|
|
103
104
|
enabledMessageActions: string[];
|
|
104
105
|
isLastSentMessage: boolean | undefined;
|
|
105
106
|
mode: 'thread' | 'main';
|
|
107
|
+
isHighlighted: boolean;
|
|
106
108
|
};
|
|
107
109
|
export declare type ChannelActionsContext<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
108
110
|
channel: Channel<T>;
|
|
@@ -179,3 +181,11 @@ export declare type ThreadHeaderContext = {
|
|
|
179
181
|
closeThreadHandler: Function;
|
|
180
182
|
};
|
|
181
183
|
export declare type MessageReactionType = 'angry' | 'haha' | 'like' | 'love' | 'sad' | 'wow';
|
|
184
|
+
export declare type AttachmentConfigration = {
|
|
185
|
+
url: string;
|
|
186
|
+
height: string;
|
|
187
|
+
width: string;
|
|
188
|
+
};
|
|
189
|
+
export declare type VideoAttachmentConfiguration = AttachmentConfigration & {
|
|
190
|
+
thumbUrl?: string;
|
|
191
|
+
};
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './lib/chat-client.service';
|
|
|
2
2
|
export * from './lib/channel.service';
|
|
3
3
|
export * from './lib/theme.service';
|
|
4
4
|
export * from './lib/attachment.service';
|
|
5
|
+
export * from './lib/attachment-configuration.service';
|
|
5
6
|
export * from './lib/stream-i18n.service';
|
|
6
7
|
export * from './lib/avatar/avatar.component';
|
|
7
8
|
export * from './lib/avatar-placeholder/avatar-placeholder.component';
|
package/src/assets/i18n/en.ts
CHANGED
|
@@ -37,6 +37,7 @@ export const en = {
|
|
|
37
37
|
'Message has been successfully flagged':
|
|
38
38
|
'Message has been successfully flagged',
|
|
39
39
|
'Message pinned': 'Message pinned',
|
|
40
|
+
'Message unpinned': 'Message unpinned',
|
|
40
41
|
Mute: 'Mute',
|
|
41
42
|
New: 'New',
|
|
42
43
|
'New Messages!': 'New Messages!',
|
|
@@ -95,6 +96,7 @@ export const en = {
|
|
|
95
96
|
"You can't send thread replies in this channel":
|
|
96
97
|
"You can't send thread replies in this channel",
|
|
97
98
|
'Unsupported file type: {{type}}': 'Unsupported file type: {{type}}',
|
|
99
|
+
'Message not found': 'Message not found',
|
|
98
100
|
'No chats here yet…': 'No chats here yet…',
|
|
99
101
|
'user is typing': '{{ user }} is typing',
|
|
100
102
|
'users are typing': '{{ users }} are typing',
|