stream-chat-angular 2.5.1 → 2.7.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.
Files changed (32) hide show
  1. package/README.md +2 -2
  2. package/assets/i18n/en.d.ts +1 -0
  3. package/assets/version.d.ts +1 -1
  4. package/bundles/stream-chat-angular.umd.js +323 -207
  5. package/bundles/stream-chat-angular.umd.js.map +1 -1
  6. package/esm2015/assets/i18n/en.js +2 -1
  7. package/esm2015/assets/version.js +2 -2
  8. package/esm2015/lib/attachment.service.js +3 -3
  9. package/esm2015/lib/channel-preview/channel-preview.component.js +22 -17
  10. package/esm2015/lib/channel.service.js +93 -87
  11. package/esm2015/lib/chat-client.service.js +35 -35
  12. package/esm2015/lib/is-image-file.js +5 -0
  13. package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +18 -11
  14. package/esm2015/lib/message-input/message-input-config.service.js +1 -1
  15. package/esm2015/lib/message-input/message-input.component.js +67 -10
  16. package/esm2015/lib/notification-list/notification-list.component.js +2 -2
  17. package/esm2015/lib/notification.service.js +7 -7
  18. package/esm2015/public-api.js +2 -1
  19. package/fesm2015/stream-chat-angular.js +251 -173
  20. package/fesm2015/stream-chat-angular.js.map +1 -1
  21. package/lib/channel-preview/channel-preview.component.d.ts +3 -2
  22. package/lib/channel.service.d.ts +2 -3
  23. package/lib/chat-client.service.d.ts +9 -6
  24. package/lib/is-image-file.d.ts +1 -0
  25. package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +2 -2
  26. package/lib/message-input/message-input-config.service.d.ts +3 -0
  27. package/lib/message-input/message-input.component.d.ts +8 -1
  28. package/lib/notification.service.d.ts +3 -2
  29. package/package.json +1 -1
  30. package/public-api.d.ts +1 -0
  31. package/src/assets/i18n/en.ts +1 -0
  32. package/src/assets/version.ts +1 -1
@@ -1,16 +1,17 @@
1
- import { OnDestroy, OnInit } from '@angular/core';
1
+ import { NgZone, OnDestroy, OnInit } from '@angular/core';
2
2
  import { Channel } from 'stream-chat';
3
3
  import { ChannelService } from '../channel.service';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class ChannelPreviewComponent implements OnInit, OnDestroy {
6
6
  private channelService;
7
+ private ngZone;
7
8
  channel: Channel | undefined;
8
9
  isActive: boolean;
9
10
  isUnread: boolean;
10
11
  latestMessage: string;
11
12
  private subscriptions;
12
13
  private canSendReadEvents;
13
- constructor(channelService: ChannelService);
14
+ constructor(channelService: ChannelService, ngZone: NgZone);
14
15
  ngOnInit(): void;
15
16
  ngOnDestroy(): void;
16
17
  get avatarImage(): unknown;
@@ -1,4 +1,4 @@
1
- import { ApplicationRef, NgZone } from '@angular/core';
1
+ import { NgZone } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { Attachment, Channel, ChannelFilters, ChannelOptions, ChannelSort, Event, UserResponse } from 'stream-chat';
4
4
  import { ChatClientService, Notification } from './chat-client.service';
@@ -7,7 +7,6 @@ import { AttachmentUpload, StreamMessage } from './types';
7
7
  import * as i0 from "@angular/core";
8
8
  export declare class ChannelService {
9
9
  private chatClientService;
10
- private appRef;
11
10
  private ngZone;
12
11
  hasMoreChannels$: Observable<boolean>;
13
12
  channels$: Observable<Channel[] | undefined>;
@@ -32,7 +31,7 @@ export declare class ChannelService {
32
31
  private options;
33
32
  private channelListSetter;
34
33
  private messageListSetter;
35
- constructor(chatClientService: ChatClientService, appRef: ApplicationRef, ngZone: NgZone);
34
+ constructor(chatClientService: ChatClientService, ngZone: NgZone);
36
35
  setAsActiveChannel(channel: Channel): void;
37
36
  loadMoreMessages(): Promise<void>;
38
37
  init(filters: ChannelFilters, sort?: ChannelSort, options?: ChannelOptions): Promise<void>;
@@ -1,23 +1,26 @@
1
- import { ApplicationRef, NgZone } from '@angular/core';
1
+ import { NgZone } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
- import { Event, StreamChat } from 'stream-chat';
3
+ import { OwnUserResponse } from 'stream-chat';
4
+ import { AppSettings, Event, StreamChat, TokenOrProvider } from 'stream-chat';
4
5
  import { NotificationService } from './notification.service';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare type Notification = {
7
- eventType: 'notification.added_to_channel' | 'notification.message_new' | 'notification.removed_from_channel';
8
+ eventType: string;
8
9
  event: Event;
9
10
  };
10
11
  export declare class ChatClientService {
11
12
  private ngZone;
12
- private appRef;
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;
19
- constructor(ngZone: NgZone, appRef: ApplicationRef, notificationService: NotificationService);
20
- init(apiKey: string, userId: string, userToken: string): Promise<void>;
20
+ private appSettingsSubject;
21
+ constructor(ngZone: NgZone, notificationService: NotificationService);
22
+ init(apiKey: string, userOrId: string | OwnUserResponse, userTokenOrProvider: TokenOrProvider): 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;
@@ -20,7 +20,7 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
20
20
  readonly send: EventEmitter<void>;
21
21
  readonly userMentions: EventEmitter<UserResponse<import("stream-chat").UnknownType>[]>;
22
22
  private readonly labelKey;
23
- private readonly triggerChar;
23
+ private readonly mentionTriggerChar;
24
24
  autocompleteConfig: MentionConfig;
25
25
  private messageInput;
26
26
  private subscriptions;
@@ -34,7 +34,7 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
34
34
  }[]): {
35
35
  autocompleteLabel: string;
36
36
  }[];
37
- mentioned(item: MentionAutcompleteListItem, triggerChar?: string): string;
37
+ itemSelectedFromAutocompleteList(item: MentionAutcompleteListItem, triggerChar?: string): string;
38
38
  autcompleteSearchTermChanged(searchTerm: string): void;
39
39
  inputChanged(): void;
40
40
  inputLeft(): void;
@@ -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.7.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.7.0';