stream-chat-angular 3.3.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +94 -41
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/avatar/avatar.component.js +37 -8
- package/esm2015/lib/avatar-placeholder/avatar-placeholder.component.js +14 -2
- package/esm2015/lib/channel-header/channel-header.component.js +4 -11
- package/esm2015/lib/channel-preview/channel-preview.component.js +4 -11
- package/esm2015/lib/channel.service.js +31 -7
- package/esm2015/lib/message/message.component.js +2 -2
- package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +2 -2
- package/esm2015/lib/message-input/message-input.component.js +2 -2
- package/esm2015/lib/message-list/message-list.component.js +2 -2
- package/esm2015/lib/message-reactions/message-reactions.component.js +1 -1
- package/esm2015/lib/types.js +1 -1
- package/fesm2015/stream-chat-angular.js +89 -39
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/avatar/avatar.component.d.ts +22 -2
- package/lib/avatar-placeholder/avatar-placeholder.component.d.ts +19 -2
- package/lib/channel.service.d.ts +11 -4
- package/lib/message/message.component.d.ts +0 -3
- package/lib/types.d.ts +7 -1
- package/package.json +1 -1
- package/src/assets/version.ts +1 -1
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { Channel, User } from 'stream-chat';
|
|
2
|
+
import { ChatClientService } from '../chat-client.service';
|
|
3
|
+
import { AvatarLocation, AvatarType, DefaultStreamChatGenerics } from '../types';
|
|
1
4
|
import * as i0 from "@angular/core";
|
|
2
5
|
/**
|
|
3
6
|
* The `Avatar` component displays the provided image, with fallback to the first letter of the optional name input.
|
|
4
7
|
*/
|
|
5
8
|
export declare class AvatarComponent {
|
|
9
|
+
private chatClientService;
|
|
6
10
|
/**
|
|
7
11
|
* An optional name of the image, used for fallback image or image title (if `imageUrl` is provided)
|
|
8
12
|
*/
|
|
@@ -15,10 +19,26 @@ export declare class AvatarComponent {
|
|
|
15
19
|
* The size in pixels of the avatar image.
|
|
16
20
|
*/
|
|
17
21
|
size: number;
|
|
22
|
+
/**
|
|
23
|
+
* The location the avatar will be displayed in
|
|
24
|
+
*/
|
|
25
|
+
location: AvatarLocation | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The channel the avatar belongs to (if avatar of a channel is displayed)
|
|
28
|
+
*/
|
|
29
|
+
channel?: Channel<DefaultStreamChatGenerics>;
|
|
30
|
+
/**
|
|
31
|
+
* The user the avatar belongs to (if avatar of a user is displayed)
|
|
32
|
+
*/
|
|
33
|
+
user?: User<DefaultStreamChatGenerics>;
|
|
34
|
+
/**
|
|
35
|
+
* The type of the avatar: channel if channel avatar is displayed, user if user avatar is displayed
|
|
36
|
+
*/
|
|
37
|
+
type: AvatarType | undefined;
|
|
18
38
|
isLoaded: boolean;
|
|
19
39
|
isError: boolean;
|
|
20
|
-
constructor();
|
|
40
|
+
constructor(chatClientService: ChatClientService);
|
|
21
41
|
get initials(): string;
|
|
22
42
|
static ɵfac: i0.ɵɵFactoryDeclaration<AvatarComponent, never>;
|
|
23
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AvatarComponent, "stream-avatar", never, { "name": "name"; "imageUrl": "imageUrl"; "size": "size"; }, {}, never, never>;
|
|
43
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AvatarComponent, "stream-avatar", never, { "name": "name"; "imageUrl": "imageUrl"; "size": "size"; "location": "location"; "channel": "channel"; "user": "user"; "type": "type"; }, {}, never, never>;
|
|
24
44
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Channel, User } from 'stream-chat';
|
|
1
2
|
import { CustomTemplatesService } from '../custom-templates.service';
|
|
2
|
-
import { AvatarContext } from '../types';
|
|
3
|
+
import { AvatarContext, AvatarLocation, AvatarType, DefaultStreamChatGenerics } from '../types';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
/**
|
|
5
6
|
* The `AvatarPlaceholder` component displays the [default avatar](./AvatarComponent.mdx) unless a [custom template](../services/CustomTemplatesService.mdx) is provided. This componet is used by the SDK internally, you likely won't need to use it.
|
|
@@ -18,8 +19,24 @@ export declare class AvatarPlaceholderComponent {
|
|
|
18
19
|
* The size in pixels of the avatar image.
|
|
19
20
|
*/
|
|
20
21
|
size: number;
|
|
22
|
+
/**
|
|
23
|
+
* The location the avatar will be displayed in
|
|
24
|
+
*/
|
|
25
|
+
location: AvatarLocation | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The channel the avatar belongs to (if avatar of a channel is displayed)
|
|
28
|
+
*/
|
|
29
|
+
channel?: Channel<DefaultStreamChatGenerics>;
|
|
30
|
+
/**
|
|
31
|
+
* The user the avatar belongs to (if avatar of a user is displayed)
|
|
32
|
+
*/
|
|
33
|
+
user?: User<DefaultStreamChatGenerics>;
|
|
34
|
+
/**
|
|
35
|
+
* The type of the avatar: channel if channel avatar is displayed, user if user avatar is displayed
|
|
36
|
+
*/
|
|
37
|
+
type: AvatarType | undefined;
|
|
21
38
|
constructor(customTemplatesService: CustomTemplatesService);
|
|
22
39
|
getAvatarContext(): AvatarContext;
|
|
23
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<AvatarPlaceholderComponent, never>;
|
|
24
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AvatarPlaceholderComponent, "stream-avatar-placeholder", never, { "name": "name"; "imageUrl": "imageUrl"; "size": "size"; }, {}, never, never>;
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AvatarPlaceholderComponent, "stream-avatar-placeholder", never, { "name": "name"; "imageUrl": "imageUrl"; "size": "size"; "location": "location"; "channel": "channel"; "user": "user"; "type": "type"; }, {}, never, never>;
|
|
25
42
|
}
|
package/lib/channel.service.d.ts
CHANGED
|
@@ -140,10 +140,6 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
|
|
|
140
140
|
* You can override the default image delete request - override this if you use your own CDN
|
|
141
141
|
*/
|
|
142
142
|
customImageDeleteRequest?: (url: string, channel: Channel<T>) => Promise<void>;
|
|
143
|
-
/**
|
|
144
|
-
* If set to false, read events won't be sent as new messages are received
|
|
145
|
-
*/
|
|
146
|
-
shouldMarkActiveChannelAsRead: boolean;
|
|
147
143
|
private channelsSubject;
|
|
148
144
|
private activeChannelSubject;
|
|
149
145
|
private activeChannelMessagesSubject;
|
|
@@ -159,11 +155,22 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
|
|
|
159
155
|
private messageToQuoteSubject;
|
|
160
156
|
private usersTypingInChannelSubject;
|
|
161
157
|
private usersTypingInThreadSubject;
|
|
158
|
+
private _shouldMarkActiveChannelAsRead;
|
|
159
|
+
private shouldSetActiveChannel;
|
|
160
|
+
private clientEventsSubscription;
|
|
162
161
|
private channelListSetter;
|
|
163
162
|
private messageListSetter;
|
|
164
163
|
private threadListSetter;
|
|
165
164
|
private parentMessageSetter;
|
|
166
165
|
constructor(chatClientService: ChatClientService<T>, ngZone: NgZone);
|
|
166
|
+
/**
|
|
167
|
+
* If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.
|
|
168
|
+
*/
|
|
169
|
+
get shouldMarkActiveChannelAsRead(): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.
|
|
172
|
+
*/
|
|
173
|
+
set shouldMarkActiveChannelAsRead(shouldMarkActiveChannelAsRead: boolean);
|
|
167
174
|
/**
|
|
168
175
|
* Sets the given `channel` as active and marks it as read.
|
|
169
176
|
* @param channel
|
|
@@ -69,9 +69,6 @@ export declare class MessageComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
69
69
|
get canDisplayReadStatus(): boolean;
|
|
70
70
|
get quotedMessageAttachments(): import("stream-chat").Attachment<{
|
|
71
71
|
attachmentType: import("stream-chat").UR & import("../types").UnknownType & {
|
|
72
|
-
/**
|
|
73
|
-
* The `Message` component displays a message with additional information such as sender and date, and enables [interaction with the message (i.e. edit or react)](../concepts/message-interactions.mdx).
|
|
74
|
-
*/
|
|
75
72
|
asset_url?: string | undefined;
|
|
76
73
|
id?: string | undefined;
|
|
77
74
|
images?: import("stream-chat").Attachment<DefaultStreamChatGenerics>[] | undefined;
|
package/lib/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TemplateRef } from '@angular/core';
|
|
2
2
|
import { Observable, Subject } from 'rxjs';
|
|
3
|
-
import type { Attachment, Channel, ChannelMemberResponse, CommandResponse, Event, ExtendableGenerics, FormatMessageResponse, LiteralStringForUnion, Mute, ReactionResponse, UserResponse } from 'stream-chat';
|
|
3
|
+
import type { Attachment, Channel, ChannelMemberResponse, CommandResponse, Event, ExtendableGenerics, FormatMessageResponse, LiteralStringForUnion, Mute, ReactionResponse, User, UserResponse } from 'stream-chat';
|
|
4
4
|
import { Icon } from './icon/icon.component';
|
|
5
5
|
export declare type UnknownType = Record<string, unknown>;
|
|
6
6
|
export declare type CustomTrigger = {
|
|
@@ -111,10 +111,16 @@ export declare type AttachmentListContext = {
|
|
|
111
111
|
messageId: string;
|
|
112
112
|
attachments: Attachment<DefaultStreamChatGenerics>[];
|
|
113
113
|
};
|
|
114
|
+
export declare type AvatarType = 'channel' | 'user';
|
|
115
|
+
export declare type AvatarLocation = 'channel-preview' | 'channel-header' | 'message-sender' | 'message-reader' | 'quoted-message-sender' | 'autocomplete-item' | 'typing-indicator' | 'reaction';
|
|
114
116
|
export declare type AvatarContext = {
|
|
115
117
|
name: string | undefined;
|
|
116
118
|
imageUrl: string | undefined;
|
|
117
119
|
size: number | undefined;
|
|
120
|
+
type: AvatarType | undefined;
|
|
121
|
+
location: AvatarLocation | undefined;
|
|
122
|
+
channel?: Channel<DefaultStreamChatGenerics>;
|
|
123
|
+
user?: User<DefaultStreamChatGenerics>;
|
|
118
124
|
};
|
|
119
125
|
export declare type AttachmentPreviewListContext = {
|
|
120
126
|
attachmentUploads$: Observable<AttachmentUpload[]> | undefined;
|
package/package.json
CHANGED
package/src/assets/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '3.
|
|
1
|
+
export const version = '3.5.0';
|