stream-chat-angular 2.13.1 → 2.14.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.
@@ -69,6 +69,8 @@ export declare class ChannelService {
69
69
  /**
70
70
  * Custom event handler to call if a new message received from a channel that is not being watched, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)
71
71
  */
72
+ usersTypingInChannel$: Observable<UserResponse[]>;
73
+ usersTypingInThread$: Observable<UserResponse[]>;
72
74
  customNewMessageNotificationHandler?: (notification: Notification, channelListSetter: (channels: Channel[]) => void) => void;
73
75
  /**
74
76
  * Custom event handler to call when the user is added to a channel, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)
@@ -114,6 +116,8 @@ export declare class ChannelService {
114
116
  private options;
115
117
  private readonly messagePageSize;
116
118
  private messageToQuoteSubject;
119
+ private usersTypingInChannelSubject;
120
+ private usersTypingInThreadSubject;
117
121
  private channelListSetter;
118
122
  private messageListSetter;
119
123
  private threadListSetter;
@@ -224,6 +228,16 @@ export declare class ChannelService {
224
228
  private addChannelFromNotification;
225
229
  private removeFromChannelList;
226
230
  private watchForActiveChannelEvents;
231
+ /**
232
+ * Call this method if user started typing in the active channel
233
+ * @param parentId The id of the parent message, if user is typing in a thread
234
+ */
235
+ typingStarted(parentId?: string): Promise<void>;
236
+ /**
237
+ * Call this method if user stopped typing in the active channel
238
+ * @param parentId The id of the parent message, if user were typing in a thread
239
+ */
240
+ typingStopped(parentId?: string): Promise<void>;
227
241
  private messageUpdated;
228
242
  private messageReactionEventReceived;
229
243
  private formatMessage;
@@ -241,6 +255,8 @@ export declare class ChannelService {
241
255
  private get channels();
242
256
  private get canSendReadEvents();
243
257
  private transformToStreamMessage;
258
+ private handleTypingStartEvent;
259
+ private handleTypingStopEvent;
244
260
  static ɵfac: i0.ɵɵFactoryDeclaration<ChannelService, never>;
245
261
  static ɵprov: i0.ɵɵInjectableDeclaration<ChannelService>;
246
262
  }
@@ -1,11 +1,11 @@
1
1
  import { Subject } from 'rxjs';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
- *
4
+ * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this service, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)
5
5
  */
6
6
  export declare class EmojiInputService {
7
7
  /**
8
- *
8
+ * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this Subject, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)
9
9
  */
10
10
  emojiInput$: Subject<string>;
11
11
  constructor();
@@ -1,6 +1,6 @@
1
1
  import { AfterViewInit, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges, TemplateRef, Type } from '@angular/core';
2
2
  import { ChatClientService } from '../chat-client.service';
3
- import { Observable } from 'rxjs';
3
+ import { Observable, Subject } from 'rxjs';
4
4
  import { UserResponse } from 'stream-chat';
5
5
  import { AttachmentService } from '../attachment.service';
6
6
  import { ChannelService } from '../channel.service';
@@ -42,6 +42,7 @@ export declare class MessageInputComponent implements OnChanges, OnDestroy, Afte
42
42
  textareaRef: ComponentRef<TextareaInterface> | undefined;
43
43
  mentionedUsers: UserResponse[];
44
44
  quotedMessage: undefined | StreamMessage;
45
+ typingStart$: Subject<void>;
45
46
  private fileInput;
46
47
  private textareaAnchor;
47
48
  private subscriptions;
@@ -64,6 +65,7 @@ export declare class MessageInputComponent implements OnChanges, OnDestroy, Afte
64
65
  private initTextarea;
65
66
  private areAttachemntsValid;
66
67
  private setCanSendMessages;
68
+ private get parentMessageId();
67
69
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputComponent, never>;
68
70
  static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "stream-message-input", never, { "isFileUploadEnabled": "isFileUploadEnabled"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "mentionAutocompleteItemTemplate": "mentionAutocompleteItemTemplate"; "commandAutocompleteItemTemplate": "commandAutocompleteItemTemplate"; "emojiPickerTemplate": "emojiPickerTemplate"; "mode": "mode"; "acceptedFileTypes": "acceptedFileTypes"; "isMultipleFileUploadEnabled": "isMultipleFileUploadEnabled"; "message": "message"; }, { "messageUpdate": "messageUpdate"; }, never, never>;
69
71
  }
@@ -1,10 +1,11 @@
1
1
  import { AfterViewChecked, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
2
2
  import { ChannelService } from '../channel.service';
3
3
  import { Observable } from 'rxjs';
4
- import { StreamMessage } from '../types';
4
+ import { DefaultUserType, StreamMessage } from '../types';
5
5
  import { ChatClientService } from '../chat-client.service';
6
6
  import { GroupStyle } from './group-styles';
7
7
  import { ImageLoadService } from './image-load.service';
8
+ import { UserResponse } from 'stream-chat';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class MessageListComponent implements AfterViewChecked, OnChanges, OnInit, OnDestroy {
10
11
  private channelService;
@@ -13,6 +14,9 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
13
14
  messageTemplate: TemplateRef<any> | undefined;
14
15
  messageInputTemplate: TemplateRef<any> | undefined;
15
16
  mentionTemplate: TemplateRef<any> | undefined;
17
+ typingIndicatorTemplate: TemplateRef<{
18
+ usersTyping$: Observable<UserResponse<DefaultUserType>[]>;
19
+ }> | undefined;
16
20
  /**
17
21
  * @deprecated https://getstream.io/chat/docs/sdk/angular/components/message_list/#caution-arereactionsenabled-deprecated
18
22
  */
@@ -44,12 +48,16 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
44
48
  private readonly isUserScrolledUpThreshold;
45
49
  private subscriptions;
46
50
  private prevScrollTop;
51
+ private usersTypingInChannel$;
52
+ private usersTypingInThread$;
47
53
  constructor(channelService: ChannelService, chatClientService: ChatClientService, imageLoadService: ImageLoadService);
48
54
  ngOnInit(): void;
49
55
  ngOnChanges(changes: SimpleChanges): void;
50
56
  ngAfterViewChecked(): void;
51
57
  ngOnDestroy(): void;
58
+ get usersTyping$(): Observable<UserResponse<DefaultUserType<import("../types").DefaultUserTypeInternal>>[]>;
52
59
  trackByMessageId(index: number, item: StreamMessage): string;
60
+ trackByUserId(index: number, user: UserResponse): string;
53
61
  scrollToBottom(): void;
54
62
  scrolled(): void;
55
63
  private preserveScrollbarPosition;
@@ -57,5 +65,5 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
57
65
  private setMessages$;
58
66
  private resetScrollState;
59
67
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageListComponent, never>;
60
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageListComponent, "stream-message-list", never, { "messageTemplate": "messageTemplate"; "messageInputTemplate": "messageInputTemplate"; "mentionTemplate": "mentionTemplate"; "areReactionsEnabled": "areReactionsEnabled"; "enabledMessageActionsInput": "enabledMessageActions"; "mode": "mode"; }, {}, never, never>;
68
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageListComponent, "stream-message-list", never, { "messageTemplate": "messageTemplate"; "messageInputTemplate": "messageInputTemplate"; "mentionTemplate": "mentionTemplate"; "typingIndicatorTemplate": "typingIndicatorTemplate"; "areReactionsEnabled": "areReactionsEnabled"; "enabledMessageActionsInput": "enabledMessageActions"; "mode": "mode"; }, {}, never, never>;
61
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "2.13.1",
3
+ "version": "2.14.0",
4
4
  "description": "Angular components to create chat conversations or livestream style chat",
5
5
  "author": "GetStream",
6
6
  "homepage": "https://getstream.io/chat/",
@@ -1 +1 @@
1
- export const version = '2.13.1';
1
+ export const version = '2.14.0';