stream-chat-angular 2.5.1 → 2.6.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.
@@ -1,6 +1,6 @@
1
1
  import { ApplicationRef, NgZone } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
- import { Event, StreamChat } from 'stream-chat';
3
+ import { AppSettings, Event, StreamChat } from 'stream-chat';
4
4
  import { NotificationService } from './notification.service';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare type Notification = {
@@ -13,11 +13,14 @@ export declare class ChatClientService {
13
13
  private notificationService;
14
14
  chatClient: StreamChat;
15
15
  notification$: Observable<Notification>;
16
+ appSettings$: Observable<AppSettings | undefined>;
16
17
  connectionState$: Observable<'offline' | 'online'>;
17
18
  private notificationSubject;
18
19
  private connectionStateSubject;
20
+ private appSettingsSubject;
19
21
  constructor(ngZone: NgZone, appRef: ApplicationRef, notificationService: NotificationService);
20
22
  init(apiKey: string, userId: string, userToken: string): Promise<void>;
23
+ getAppSettings(): Promise<void>;
21
24
  flagMessage(messageId: string): Promise<void>;
22
25
  autocompleteUsers(searchTerm: string): Promise<import("stream-chat").UserResponse<import("stream-chat").UnknownType>[]>;
23
26
  static ɵfac: i0.ɵɵFactoryDeclaration<ChatClientService, never>;
@@ -0,0 +1 @@
1
+ export declare const isImageFile: (file: File) => boolean;
@@ -5,6 +5,9 @@ export declare class MessageInputConfigService {
5
5
  isFileUploadEnabled: boolean | undefined;
6
6
  areMentionsEnabled: boolean | undefined;
7
7
  mentionAutocompleteItemTemplate: TemplateRef<MentionAutcompleteListItemContext> | undefined;
8
+ /**
9
+ * @deprecated https://getstream.io/chat/docs/sdk/angular/services/message-input-config/#overview
10
+ */
8
11
  acceptedFileTypes: string[] | undefined;
9
12
  isMultipleFileUploadEnabled: boolean | undefined;
10
13
  mentionScope: 'channel' | 'application' | undefined;
@@ -1,4 +1,5 @@
1
1
  import { AfterViewInit, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges, TemplateRef, Type } from '@angular/core';
2
+ import { ChatClientService } from '../chat-client.service';
2
3
  import { Observable } from 'rxjs';
3
4
  import { UserResponse } from 'stream-chat';
4
5
  import { AttachmentService } from '../attachment.service';
@@ -16,10 +17,14 @@ export declare class MessageInputComponent implements OnChanges, OnDestroy, Afte
16
17
  private textareaType;
17
18
  private componentFactoryResolver;
18
19
  private cdRef;
20
+ private chatClient;
19
21
  isFileUploadEnabled: boolean | undefined;
20
22
  areMentionsEnabled: boolean | undefined;
21
23
  mentionScope: 'channel' | 'application' | undefined;
22
24
  mentionAutocompleteItemTemplate: TemplateRef<MentionAutcompleteListItemContext> | undefined;
25
+ /**
26
+ * @deprecated https://getstream.io/chat/docs/sdk/angular/components/message-input/#caution-acceptedfiletypes
27
+ */
23
28
  acceptedFileTypes: string[] | undefined;
24
29
  isMultipleFileUploadEnabled: boolean | undefined;
25
30
  message: StreamMessage | undefined;
@@ -36,7 +41,8 @@ export declare class MessageInputComponent implements OnChanges, OnDestroy, Afte
36
41
  private subscriptions;
37
42
  private hideNotification;
38
43
  private isViewInited;
39
- constructor(channelService: ChannelService, notificationService: NotificationService, attachmentService: AttachmentService, configService: MessageInputConfigService, textareaType: Type<TextareaInterface>, componentFactoryResolver: ComponentFactoryResolver, cdRef: ChangeDetectorRef);
44
+ private appSettings;
45
+ constructor(channelService: ChannelService, notificationService: NotificationService, attachmentService: AttachmentService, configService: MessageInputConfigService, textareaType: Type<TextareaInterface>, componentFactoryResolver: ComponentFactoryResolver, cdRef: ChangeDetectorRef, chatClient: ChatClientService);
40
46
  ngAfterViewInit(): void;
41
47
  ngOnChanges(changes: SimpleChanges): void;
42
48
  ngOnDestroy(): void;
@@ -47,6 +53,7 @@ export declare class MessageInputComponent implements OnChanges, OnDestroy, Afte
47
53
  private clearFileInput;
48
54
  private get isUpdate();
49
55
  private initTextarea;
56
+ private areAttachemntsValid;
50
57
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputComponent, never>;
51
58
  static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "stream-message-input", never, { "isFileUploadEnabled": "isFileUploadEnabled"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "mentionAutocompleteItemTemplate": "mentionAutocompleteItemTemplate"; "acceptedFileTypes": "acceptedFileTypes"; "isMultipleFileUploadEnabled": "isMultipleFileUploadEnabled"; "message": "message"; }, { "messageUpdate": "messageUpdate"; }, never, never>;
52
59
  }
@@ -4,13 +4,14 @@ export declare type NotificationType = 'success' | 'error';
4
4
  export declare type NotificationPayload = {
5
5
  type: NotificationType;
6
6
  text: string;
7
+ translateParams?: Object;
7
8
  };
8
9
  export declare class NotificationService {
9
10
  notifications$: Observable<NotificationPayload[]>;
10
11
  private notificationsSubject;
11
12
  constructor();
12
- addTemporaryNotification(text: string, type?: NotificationType, timeout?: number): () => void;
13
- addPermanentNotification(text: string, type?: NotificationType): () => void;
13
+ addTemporaryNotification(text: string, type?: NotificationType, timeout?: number, translateParams?: Object): () => void;
14
+ addPermanentNotification(text: string, type?: NotificationType, translateParams?: Object): () => void;
14
15
  private addNotification;
15
16
  private removeNotification;
16
17
  static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "2.5.1",
3
+ "version": "2.6.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/",
package/public-api.d.ts CHANGED
@@ -32,6 +32,7 @@ export * from './lib/notification-list/notification-list.component';
32
32
  export * from './lib/modal/modal.component';
33
33
  export * from './lib/read-by';
34
34
  export * from './lib/is-image-attachment';
35
+ export * from './lib/is-image-file';
35
36
  export * from './lib/device-width';
36
37
  export * from './lib/message-preview';
37
38
  export * from './lib/notification.service';
@@ -90,5 +90,6 @@ export const en = {
90
90
  'Sending links is not allowed in this conversation',
91
91
  "You can't send messages in this channel":
92
92
  "You can't send messages in this channel",
93
+ 'Unsupported file type: {{type}}': 'Unsupported file type: {{type}}',
93
94
  },
94
95
  };
@@ -1 +1 @@
1
- export const version = '2.5.1';
1
+ export const version = '2.6.0';