stream-chat-angular 2.20.0 → 3.0.0-beta.3

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 (61) hide show
  1. package/assets/version.d.ts +1 -1
  2. package/bundles/stream-chat-angular.umd.js +623 -399
  3. package/bundles/stream-chat-angular.umd.js.map +1 -1
  4. package/esm2015/assets/version.js +2 -2
  5. package/esm2015/lib/attachment-list/attachment-list.component.js +27 -15
  6. package/esm2015/lib/attachment-preview-list/attachment-preview-list.component.js +28 -22
  7. package/esm2015/lib/avatar-placeholder/avatar-placeholder.component.js +41 -0
  8. package/esm2015/lib/channel-header/channel-header.component.js +26 -12
  9. package/esm2015/lib/channel-list/channel-list.component.js +23 -13
  10. package/esm2015/lib/channel-preview/channel-preview.component.js +3 -3
  11. package/esm2015/lib/channel.service.js +1 -1
  12. package/esm2015/lib/custom-templates.service.js +99 -0
  13. package/esm2015/lib/icon-placeholder/icon-placeholder.component.js +34 -0
  14. package/esm2015/lib/loading-indicator-placeholder/loading-indicator-placeholder.component.js +42 -0
  15. package/esm2015/lib/message/message.component.js +73 -23
  16. package/esm2015/lib/message-actions-box/message-actions-box.component.js +123 -95
  17. package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +13 -13
  18. package/esm2015/lib/message-input/message-input-config.service.js +1 -1
  19. package/esm2015/lib/message-input/message-input.component.js +43 -45
  20. package/esm2015/lib/message-input/textarea.directive.js +2 -18
  21. package/esm2015/lib/message-input/textarea.interface.js +1 -1
  22. package/esm2015/lib/message-list/message-list.component.js +32 -93
  23. package/esm2015/lib/message-reactions/message-reactions.component.js +3 -3
  24. package/esm2015/lib/modal/modal.component.js +9 -6
  25. package/esm2015/lib/notification/notification.component.js +5 -2
  26. package/esm2015/lib/notification-list/notification-list.component.js +12 -10
  27. package/esm2015/lib/stream-avatar.module.js +5 -4
  28. package/esm2015/lib/stream-chat.module.js +13 -3
  29. package/esm2015/lib/thread/thread.component.js +19 -11
  30. package/esm2015/lib/types.js +1 -1
  31. package/esm2015/public-api.js +5 -1
  32. package/fesm2015/stream-chat-angular.js +570 -318
  33. package/fesm2015/stream-chat-angular.js.map +1 -1
  34. package/lib/attachment-list/attachment-list.component.d.ts +7 -3
  35. package/lib/attachment-preview-list/attachment-preview-list.component.d.ts +17 -7
  36. package/lib/avatar-placeholder/avatar-placeholder.component.d.ts +25 -0
  37. package/lib/channel-header/channel-header.component.d.ts +13 -10
  38. package/lib/channel-list/channel-list.component.d.ts +12 -9
  39. package/lib/channel.service.d.ts +1 -2
  40. package/lib/custom-templates.service.d.ts +92 -0
  41. package/lib/icon-placeholder/icon-placeholder.component.d.ts +22 -0
  42. package/lib/loading-indicator-placeholder/loading-indicator-placeholder.component.d.ts +21 -0
  43. package/lib/message/message.component.d.ts +21 -28
  44. package/lib/message-actions-box/message-actions-box.component.d.ts +20 -25
  45. package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +6 -10
  46. package/lib/message-input/message-input-config.service.d.ts +0 -19
  47. package/lib/message-input/message-input.component.d.ts +15 -25
  48. package/lib/message-input/textarea.directive.d.ts +2 -5
  49. package/lib/message-input/textarea.interface.d.ts +1 -4
  50. package/lib/message-list/message-list.component.d.ts +10 -34
  51. package/lib/message-reactions/message-reactions.component.d.ts +1 -2
  52. package/lib/modal/modal.component.d.ts +7 -3
  53. package/lib/notification/notification.component.d.ts +6 -1
  54. package/lib/notification-list/notification-list.component.d.ts +4 -2
  55. package/lib/stream-avatar.module.d.ts +4 -3
  56. package/lib/stream-chat.module.d.ts +6 -4
  57. package/lib/thread/thread.component.d.ts +6 -3
  58. package/lib/types.d.ts +99 -1
  59. package/package.json +1 -1
  60. package/public-api.d.ts +4 -0
  61. package/src/assets/version.ts +1 -1
@@ -1,13 +1,15 @@
1
1
  import { OnChanges } from '@angular/core';
2
2
  import { Action, Attachment } from 'stream-chat';
3
3
  import { ImageLoadService } from '../message-list/image-load.service';
4
- import { DefaultAttachmentType } from '../types';
4
+ import { DefaultAttachmentType, ModalContext } from '../types';
5
5
  import { ChannelService } from '../channel.service';
6
+ import { CustomTemplatesService } from '../custom-templates.service';
6
7
  import * as i0 from "@angular/core";
7
8
  /**
8
9
  * The `AttachmentList` compontent displays the attachments of a message
9
10
  */
10
11
  export declare class AttachmentListComponent implements OnChanges {
12
+ readonly customTemplatesService: CustomTemplatesService;
11
13
  private imageLoadService;
12
14
  private channelService;
13
15
  /**
@@ -21,7 +23,8 @@ export declare class AttachmentListComponent implements OnChanges {
21
23
  orderedAttachments: Attachment<DefaultAttachmentType>[];
22
24
  imagesToView: Attachment<DefaultAttachmentType>[];
23
25
  imagesToViewCurrentIndex: number;
24
- constructor(imageLoadService: ImageLoadService, channelService: ChannelService);
26
+ private modalContent;
27
+ constructor(customTemplatesService: CustomTemplatesService, imageLoadService: ImageLoadService, channelService: ChannelService);
25
28
  ngOnChanges(): void;
26
29
  trackById(index: number): number;
27
30
  isImage(attachment: Attachment): boolean;
@@ -31,16 +34,17 @@ export declare class AttachmentListComponent implements OnChanges {
31
34
  imageLoaded(): void;
32
35
  hasFileSize(attachment: Attachment<DefaultAttachmentType>): boolean | "" | 0 | undefined;
33
36
  getFileSize(attachment: Attachment<DefaultAttachmentType>): string;
37
+ getModalContext(): ModalContext;
34
38
  trimUrl(url?: string | null): string | null;
35
39
  sendAction(action: Action): void;
36
40
  trackByActionValue(_: number, item: Action): string | undefined;
37
41
  openImageModal(attachments: Attachment[], selectedIndex?: number): void;
38
- closeImageModal(): void;
39
42
  stepImages(dir: -1 | 1): void;
40
43
  trackByImageUrl(_: number, item: Attachment): unknown;
41
44
  get isImageModalPrevButtonVisible(): boolean;
42
45
  get isImageModalNextButtonVisible(): boolean;
43
46
  private createGallery;
47
+ private closeImageModal;
44
48
  static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentListComponent, never>;
45
49
  static ɵcmp: i0.ɵɵComponentDeclaration<AttachmentListComponent, "stream-attachment-list", never, { "messageId": "messageId"; "attachments": "attachments"; }, {}, never, never>;
46
50
  }
@@ -1,17 +1,27 @@
1
+ import { EventEmitter } from '@angular/core';
1
2
  import { Observable } from 'rxjs';
2
- import { AttachmentService } from '../attachment.service';
3
3
  import { AttachmentUpload } from '../types';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * The `AttachmentPreviewList` compontent displays a preview of the attachments uploaded to a message. Users can delete attachments using the preview component, or retry upload if it failed previously.
7
7
  */
8
8
  export declare class AttachmentPreviewListComponent {
9
- private attachmentService;
10
- attachmentUploads$: Observable<AttachmentUpload[]>;
11
- constructor(attachmentService: AttachmentService);
12
- retryAttachmentUpload(file: File): Promise<void>;
13
- deleteAttachment(upload: AttachmentUpload): Promise<void>;
9
+ /**
10
+ * A stream that emits the current file uploads and their states
11
+ */
12
+ attachmentUploads$: Observable<AttachmentUpload[]> | undefined;
13
+ /**
14
+ * An output to notify the parent component if the user tries to retry a failed upload
15
+ */
16
+ readonly retryAttachmentUpload: EventEmitter<File>;
17
+ /**
18
+ * An output to notify the parent component if the user wants to delete a file
19
+ */
20
+ readonly deleteAttachment: EventEmitter<AttachmentUpload>;
21
+ constructor();
22
+ attachmentUploadRetried(file: File): void;
23
+ attachmentDeleted(upload: AttachmentUpload): void;
14
24
  trackByFile(_: number, item: AttachmentUpload): File;
15
25
  static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentPreviewListComponent, never>;
16
- static ɵcmp: i0.ɵɵComponentDeclaration<AttachmentPreviewListComponent, "stream-attachment-preview-list", never, {}, {}, never, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<AttachmentPreviewListComponent, "stream-attachment-preview-list", never, { "attachmentUploads$": "attachmentUploads$"; }, { "retryAttachmentUpload": "retryAttachmentUpload"; "deleteAttachment": "deleteAttachment"; }, never, never>;
17
27
  }
@@ -0,0 +1,25 @@
1
+ import { CustomTemplatesService } from '../custom-templates.service';
2
+ import { AvatarContext } from '../types';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * 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.
6
+ */
7
+ export declare class AvatarPlaceholderComponent {
8
+ customTemplatesService: CustomTemplatesService;
9
+ /**
10
+ * An optional name of the image, used for fallback image or image title (if `imageUrl` is provided)
11
+ */
12
+ name: string | undefined;
13
+ /**
14
+ * The URL of the image to be displayed. If the image can't be displayed the first letter of the name input is displayed.
15
+ */
16
+ imageUrl: string | undefined;
17
+ /**
18
+ * The size in pixels of the avatar image.
19
+ */
20
+ size: number;
21
+ constructor(customTemplatesService: CustomTemplatesService);
22
+ getAvatarContext(): AvatarContext;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<AvatarPlaceholderComponent, never>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<AvatarPlaceholderComponent, "stream-avatar-placeholder", never, { "name": "name"; "imageUrl": "imageUrl"; "size": "size"; }, {}, never, never>;
25
+ }
@@ -1,24 +1,27 @@
1
- import { TemplateRef } from '@angular/core';
1
+ import { ChangeDetectorRef, OnDestroy, OnInit, TemplateRef } from '@angular/core';
2
2
  import { Channel } from 'stream-chat';
3
3
  import { ChannelListToggleService } from '../channel-list/channel-list-toggle.service';
4
4
  import { ChannelService } from '../channel.service';
5
+ import { CustomTemplatesService } from '../custom-templates.service';
6
+ import { ChannelActionsContext } from '../types';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * The `ChannelHeader` component displays the avatar and name of the currently active channel along with member and watcher information. You can read about [the difference between members and watchers](https://getstream.io/chat/docs/javascript/watch_channel/?language=javascript#watchers-vs-members) in the platform documentation. Please note that number of watchers is only displayed if the user has [`connect-events` capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript)
8
10
  */
9
- export declare class ChannelHeaderComponent {
11
+ export declare class ChannelHeaderComponent implements OnInit, OnDestroy {
10
12
  private channelService;
11
13
  private channelListToggleService;
12
- /**
13
- * Template that can be used to add actions (such as edit, invite) to the channel header
14
- */
15
- channelActionsTemplate?: TemplateRef<{
16
- channel: Channel;
17
- }>;
14
+ private customTemplatesService;
15
+ private cdRef;
16
+ channelActionsTemplate?: TemplateRef<ChannelActionsContext>;
18
17
  activeChannel: Channel | undefined;
19
18
  canReceiveConnectEvents: boolean | undefined;
20
- constructor(channelService: ChannelService, channelListToggleService: ChannelListToggleService);
19
+ private subscriptions;
20
+ constructor(channelService: ChannelService, channelListToggleService: ChannelListToggleService, customTemplatesService: CustomTemplatesService, cdRef: ChangeDetectorRef);
21
+ ngOnInit(): void;
22
+ ngOnDestroy(): void;
21
23
  toggleMenu(event: Event): void;
24
+ getChannelActionsContext(): ChannelActionsContext;
22
25
  get memberCountParam(): {
23
26
  memberCount: unknown;
24
27
  };
@@ -26,5 +29,5 @@ export declare class ChannelHeaderComponent {
26
29
  watcherCount: number;
27
30
  };
28
31
  static ɵfac: i0.ɵɵFactoryDeclaration<ChannelHeaderComponent, never>;
29
- static ɵcmp: i0.ɵɵComponentDeclaration<ChannelHeaderComponent, "stream-channel-header", never, { "channelActionsTemplate": "channelActionsTemplate"; }, {}, never, never>;
32
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChannelHeaderComponent, "stream-channel-header", never, {}, {}, never, never>;
30
33
  }
@@ -1,31 +1,34 @@
1
- import { AfterViewInit, TemplateRef } from '@angular/core';
2
- import { Observable } from 'rxjs';
1
+ import { AfterViewInit, OnDestroy, TemplateRef } from '@angular/core';
2
+ import { Observable, Subscription } from 'rxjs';
3
3
  import { Channel } from 'stream-chat';
4
4
  import { ChannelService } from '../channel.service';
5
+ import { CustomTemplatesService } from '../custom-templates.service';
6
+ import { ChannelPreviewContext } from '../types';
5
7
  import { ChannelListToggleService } from './channel-list-toggle.service';
6
8
  import * as i0 from "@angular/core";
7
9
  /**
8
10
  * The `ChannelList` component renders the list of channels.
9
11
  */
10
- export declare class ChannelListComponent implements AfterViewInit {
12
+ export declare class ChannelListComponent implements AfterViewInit, OnDestroy {
11
13
  private channelService;
12
14
  private channelListToggleService;
13
- /**
14
- * By default, the [default preview component](./ChannelPreviewComponent.mdx) is used. To change the contents of the channel list, [provide your own custom template](./ChannelPreviewComponent.mdx/#customization).
15
- */
16
- customChannelPreviewTemplate: TemplateRef<any> | undefined;
15
+ private customTemplatesService;
17
16
  channels$: Observable<Channel[] | undefined>;
18
17
  isError$: Observable<boolean>;
19
18
  isInitializing$: Observable<boolean>;
20
19
  isLoadingMoreChannels: boolean;
21
20
  isOpen$: Observable<boolean>;
22
21
  hasMoreChannels$: Observable<boolean>;
22
+ customChannelPreviewTemplate: TemplateRef<ChannelPreviewContext> | undefined;
23
+ subscriptions: Subscription[];
23
24
  private container;
24
- constructor(channelService: ChannelService, channelListToggleService: ChannelListToggleService);
25
+ constructor(channelService: ChannelService, channelListToggleService: ChannelListToggleService, customTemplatesService: CustomTemplatesService);
25
26
  ngAfterViewInit(): void;
27
+ ngOnDestroy(): void;
26
28
  loadMoreChannels(): Promise<void>;
27
29
  trackByChannelId(index: number, item: Channel): string;
28
30
  channelSelected(): void;
31
+ getChannelPreviewContext(channel: Channel): ChannelPreviewContext;
29
32
  static ɵfac: i0.ɵɵFactoryDeclaration<ChannelListComponent, never>;
30
- static ɵcmp: i0.ɵɵComponentDeclaration<ChannelListComponent, "stream-channel-list", never, { "customChannelPreviewTemplate": "customChannelPreviewTemplate"; }, {}, never, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChannelListComponent, "stream-channel-list", never, {}, {}, never, never>;
31
34
  }
@@ -2,8 +2,7 @@ import { NgZone } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { Attachment, Channel, ChannelFilters, ChannelOptions, ChannelResponse, ChannelSort, Event, UserResponse } from 'stream-chat';
4
4
  import { ChatClientService, Notification } from './chat-client.service';
5
- import { MessageReactionType } from './message-reactions/message-reactions.component';
6
- import { AttachmentUpload, StreamMessage } from './types';
5
+ import { AttachmentUpload, MessageReactionType, StreamMessage } from './types';
7
6
  import * as i0 from "@angular/core";
8
7
  /**
9
8
  * The `ChannelService` provides data and interaction for the channel list and message list. TEST
@@ -0,0 +1,92 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { AttachmentListContext, AttachmentPreviewListContext, AvatarContext, ChannelActionsContext, ChannelPreviewContext, CommandAutocompleteListItemContext, EmojiPickerContext, IconContext, LoadingIndicatorContext, MentionAutcompleteListItemContext, MentionTemplateContext, MessageActionBoxItemContext, MessageActionsBoxContext, MessageContext, MessageInputContext, MessageReactionsContext, ModalContext, NotificationContext, ThreadHeaderContext, TypingIndicatorContext } from './types';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * A central location for registering your custom templates to override parts of the chat application
7
+ */
8
+ export declare class CustomTemplatesService {
9
+ /**
10
+ * The autocomplete list item template for mentioning users
11
+ */
12
+ mentionAutocompleteItemTemplate$: BehaviorSubject<TemplateRef<MentionAutcompleteListItemContext> | undefined>;
13
+ /**
14
+ * The autocomplete list item template for commands
15
+ */
16
+ commandAutocompleteItemTemplate$: BehaviorSubject<TemplateRef<CommandAutocompleteListItemContext> | undefined>;
17
+ /**
18
+ * Item in the channel list
19
+ */
20
+ channelPreviewTemplate$: BehaviorSubject<TemplateRef<ChannelPreviewContext> | undefined>;
21
+ /**
22
+ * The message input template used when editing a message
23
+ */
24
+ messageInputTemplate$: BehaviorSubject<TemplateRef<MessageInputContext> | undefined>;
25
+ /**
26
+ * The template used for displaying a mention inside a message
27
+ */
28
+ mentionTemplate$: BehaviorSubject<TemplateRef<MentionTemplateContext> | undefined>;
29
+ /**
30
+ * The template for emoji picker
31
+ */
32
+ emojiPickerTemplate$: BehaviorSubject<TemplateRef<EmojiPickerContext> | undefined>;
33
+ /**
34
+ * The typing indicator template used in the message list
35
+ */
36
+ typingIndicatorTemplate$: BehaviorSubject<TemplateRef<TypingIndicatorContext> | undefined>;
37
+ /**
38
+ * The template used to display a message in the message list
39
+ */
40
+ messageTemplate$: BehaviorSubject<TemplateRef<MessageContext> | undefined>;
41
+ /**
42
+ * The template for channel actions
43
+ */
44
+ channelActionsTemplate$: BehaviorSubject<TemplateRef<ChannelActionsContext> | undefined>;
45
+ /**
46
+ * The template used to display attachments of a message
47
+ */
48
+ attachmentListTemplate$: BehaviorSubject<TemplateRef<AttachmentListContext> | undefined>;
49
+ /**
50
+ * The template used to display attachments in the message input component
51
+ */
52
+ attachmentPreviewListTemplate$: BehaviorSubject<TemplateRef<AttachmentPreviewListContext> | undefined>;
53
+ /**
54
+ * The template used to display avatars for channels and users
55
+ */
56
+ avatarTemplate$: BehaviorSubject<TemplateRef<AvatarContext> | undefined>;
57
+ /**
58
+ * Template for displaying icons
59
+ */
60
+ iconTemplate$: BehaviorSubject<TemplateRef<IconContext> | undefined>;
61
+ /**
62
+ * Template for displaying the loading indicator (instead of the [default loading indicator](../components/LoadingIndicatorComponent.mdx))
63
+ */
64
+ loadingIndicatorTemplate$: BehaviorSubject<TemplateRef<LoadingIndicatorContext> | undefined>;
65
+ /**
66
+ * Template for displaying the message actions box (instead of the [default message actions box](../components/MessageActionsBoxComponent.mdx))
67
+ */
68
+ messageActionsBoxTemplate$: BehaviorSubject<TemplateRef<MessageActionsBoxContext> | undefined>;
69
+ /**
70
+ * The template used for displaying an item in the [message actions box](../components/MessageActionsBoxComponent.mdx)]
71
+ */
72
+ messageActionsBoxItemTemplate$: BehaviorSubject<TemplateRef<MessageActionBoxItemContext> | undefined>;
73
+ /**
74
+ * The template used to display the reactions of a message, and the selector to add a reaction to a message (instead of the [default message reactions component](../components/MessageReactionsComponent.mdx))
75
+ */
76
+ messageReactionsTemplate$: BehaviorSubject<TemplateRef<MessageReactionsContext> | undefined>;
77
+ /**
78
+ * The template used to display a modal window (instead of the [default modal](../components/ModalComponent.mdx))
79
+ */
80
+ modalTemplate$: BehaviorSubject<TemplateRef<ModalContext> | undefined>;
81
+ /**
82
+ * The template used to override the [default notification component](../components/NotificationComponent.mdx)
83
+ */
84
+ notificationTemplate$: BehaviorSubject<TemplateRef<NotificationContext> | undefined>;
85
+ /**
86
+ * The template used for header of thread
87
+ */
88
+ threadHeaderTemplate$: BehaviorSubject<TemplateRef<ThreadHeaderContext> | undefined>;
89
+ constructor();
90
+ static ɵfac: i0.ɵɵFactoryDeclaration<CustomTemplatesService, never>;
91
+ static ɵprov: i0.ɵɵInjectableDeclaration<CustomTemplatesService>;
92
+ }
@@ -0,0 +1,22 @@
1
+ import { CustomTemplatesService } from '../custom-templates.service';
2
+ import { Icon } from '../icon/icon.component';
3
+ import { IconContext } from '../types';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * The `IconPlaceholder` component displays the [default icons](./IconComponent.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.
7
+ */
8
+ export declare class IconPlaceholderComponent {
9
+ customTemplatesService: CustomTemplatesService;
10
+ /**
11
+ * The icon to display, the list of [supported icons](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/icon/icon.component.ts) can be found on GitHub.
12
+ */
13
+ icon: Icon | undefined;
14
+ /**
15
+ * The size of the icon (in pixels)
16
+ */
17
+ size: number | undefined;
18
+ constructor(customTemplatesService: CustomTemplatesService);
19
+ getIconContext(): IconContext;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<IconPlaceholderComponent, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<IconPlaceholderComponent, "stream-icon-placeholder", never, { "icon": "icon"; "size": "size"; }, {}, never, never>;
22
+ }
@@ -0,0 +1,21 @@
1
+ import { CustomTemplatesService } from '../custom-templates.service';
2
+ import { LoadingIndicatorContext } from '../types';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * The `LoadingInficatorPlaceholder` component displays the [default loading indicator](./LoadingIndicatorComponent.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.
6
+ */
7
+ export declare class LoadingIndicatorPlaceholderComponent {
8
+ customTemplatesService: CustomTemplatesService;
9
+ /**
10
+ * The size of the indicator (in pixels)
11
+ */
12
+ size: number;
13
+ /**
14
+ * The color of the indicator
15
+ */
16
+ color: string;
17
+ constructor(customTemplatesService: CustomTemplatesService);
18
+ getLoadingIndicatorContext(): LoadingIndicatorContext;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoadingIndicatorPlaceholderComponent, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<LoadingIndicatorPlaceholderComponent, "stream-loading-indicator-placeholder", never, { "size": "size"; "color": "color"; }, {}, never, never>;
21
+ }
@@ -1,8 +1,9 @@
1
- import { TemplateRef, OnChanges, SimpleChanges } from '@angular/core';
1
+ import { TemplateRef, OnChanges, SimpleChanges, OnDestroy, OnInit, ChangeDetectorRef } from '@angular/core';
2
2
  import { UserResponse } from 'stream-chat';
3
3
  import { ChannelService } from '../channel.service';
4
4
  import { ChatClientService } from '../chat-client.service';
5
- import { DefaultUserType, StreamMessage } from '../types';
5
+ import { AttachmentListContext, DefaultUserType, MentionTemplateContext, MessageActionsBoxContext, MessageReactionsContext, StreamMessage } from '../types';
6
+ import { CustomTemplatesService } from '../custom-templates.service';
6
7
  import * as i0 from "@angular/core";
7
8
  declare type MessagePart = {
8
9
  content: string;
@@ -12,17 +13,11 @@ declare type MessagePart = {
12
13
  /**
13
14
  * 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).
14
15
  */
15
- export declare class MessageComponent implements OnChanges {
16
+ export declare class MessageComponent implements OnInit, OnChanges, OnDestroy {
16
17
  private chatClientService;
17
18
  private channelService;
18
- /**
19
- * The input used for message edit. By default, the [default message input component](./MessageInputComponent.mdx) is used. To change the input for message edit, provide [your own custom template](./MessageInputComponent.mdx/#customization).
20
- */
21
- messageInputTemplate: TemplateRef<any> | undefined;
22
- /**
23
- * The template used to display a mention in a message. It receives the mentioned user in a variable called `user` with the type [`UserResponse`](https://github.com/GetStream/stream-chat-js/blob/master/src/types.ts). You can provide your own template if you want to [add actions to mentions](../code-examples/mention-actions.mdx).
24
- */
25
- mentionTemplate: TemplateRef<any> | undefined;
19
+ private customTemplatesService;
20
+ private cdRef;
26
21
  /**
27
22
  * The message to be displayed
28
23
  */
@@ -31,39 +26,33 @@ export declare class MessageComponent implements OnChanges {
31
26
  * The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
32
27
  */
33
28
  enabledMessageActions: string[];
34
- /**
35
- * If true, the message reactions are displayed. If you use the default chat UI you can also set this using the [`MessageList`](./MessageListComponent.mdx) component.
36
- * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead
37
- */
38
- areReactionsEnabled: boolean | undefined;
39
- /**
40
- * If true, the user can add reactions to the message. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
41
- * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead
42
- */
43
- canReactToMessage: boolean | undefined;
44
29
  /**
45
30
  * If `true`, the message status (sending, sent, who read the message) is displayed.
46
31
  */
47
32
  isLastSentMessage: boolean | undefined;
48
- /**
49
- * If true, the read indicator is displayed. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
50
- * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead
51
- */
52
- canReceiveReadEvents: boolean | undefined;
53
33
  /**
54
34
  * Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
55
35
  */
56
36
  mode: 'thread' | 'main';
37
+ canReceiveReadEvents: boolean | undefined;
38
+ canReactToMessage: boolean | undefined;
57
39
  isEditing: boolean | undefined;
58
40
  isActionBoxOpen: boolean;
59
41
  isReactionSelectorOpen: boolean;
60
42
  isPressedOnMobile: boolean;
61
43
  visibleMessageActionsCount: number;
62
44
  messageTextParts: MessagePart[];
45
+ mentionTemplate: TemplateRef<MentionTemplateContext> | undefined;
46
+ attachmentListTemplate: TemplateRef<AttachmentListContext> | undefined;
47
+ messageActionsBoxTemplate: TemplateRef<MessageActionsBoxContext> | undefined;
48
+ messageReactionsTemplate: TemplateRef<MessageReactionsContext> | undefined;
63
49
  private user;
50
+ private subscriptions;
64
51
  private container;
65
- constructor(chatClientService: ChatClientService, channelService: ChannelService);
52
+ constructor(chatClientService: ChatClientService, channelService: ChannelService, customTemplatesService: CustomTemplatesService, cdRef: ChangeDetectorRef);
53
+ ngOnInit(): void;
66
54
  ngOnChanges(changes: SimpleChanges): void;
55
+ ngOnDestroy(): void;
67
56
  get isSentByCurrentUser(): boolean;
68
57
  get readByText(): string;
69
58
  get lastReadUser(): UserResponse<DefaultUserType<import("../types").DefaultUserTypeInternal>> | undefined;
@@ -79,11 +68,15 @@ export declare class MessageComponent implements OnChanges {
79
68
  };
80
69
  get canDisplayReadStatus(): boolean;
81
70
  get quotedMessageAttachments(): import("stream-chat").Attachment<import("../types").DefaultAttachmentType>[];
71
+ getAttachmentListContext(): AttachmentListContext;
72
+ getMessageReactionsContext(): MessageReactionsContext;
82
73
  resendMessage(): void;
83
74
  textClicked(): void;
84
75
  setAsActiveParentMessage(): void;
76
+ getMentionContext(messagePart: MessagePart): MentionTemplateContext;
77
+ getMessageActionsBoxContext(): MessageActionsBoxContext;
85
78
  private createMessageParts;
86
79
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageComponent, never>;
87
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageComponent, "stream-message", never, { "messageInputTemplate": "messageInputTemplate"; "mentionTemplate": "mentionTemplate"; "message": "message"; "enabledMessageActions": "enabledMessageActions"; "areReactionsEnabled": "areReactionsEnabled"; "canReactToMessage": "canReactToMessage"; "isLastSentMessage": "isLastSentMessage"; "canReceiveReadEvents": "canReceiveReadEvents"; "mode": "mode"; }, {}, never, never>;
80
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageComponent, "stream-message", never, { "message": "message"; "enabledMessageActions": "enabledMessageActions"; "isLastSentMessage": "isLastSentMessage"; "mode": "mode"; }, {}, never, never>;
88
81
  }
89
82
  export {};
@@ -1,24 +1,19 @@
1
- import { EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
1
+ import { EventEmitter, OnChanges, OnDestroy, SimpleChanges, TemplateRef } from '@angular/core';
2
+ import { Subscription } from 'rxjs';
2
3
  import { ChannelService } from '../channel.service';
3
4
  import { ChatClientService } from '../chat-client.service';
5
+ import { CustomTemplatesService } from '../custom-templates.service';
4
6
  import { NotificationService } from '../notification.service';
5
- import { StreamMessage } from '../types';
7
+ import { MessageActionBoxItemContext, MessageActionItem, MessageInputContext, ModalContext, StreamMessage } from '../types';
6
8
  import * as i0 from "@angular/core";
7
- /**
8
- * @deprecated https://getstream.io/chat/docs/sdk/angular/components/message-actions/#required-enabledactions
9
- */
10
- export declare type MessageActions = 'edit' | 'delete' | 'edit-any' | 'delete-any' | 'pin' | 'quote' | 'flag' | 'mute';
11
9
  /**
12
10
  * The `MessageActionsBox` component displays a list of message actions (i.e edit), that can be opened or closed. You can find the [list of the supported actions](../concepts/message-interactions.mdx) in the message interaction guide.
13
11
  */
14
- export declare class MessageActionsBoxComponent implements OnChanges {
12
+ export declare class MessageActionsBoxComponent implements OnChanges, OnDestroy {
15
13
  private chatClientService;
16
14
  private notificationService;
17
15
  private channelService;
18
- /**
19
- * The input used for message edit. By default, the [default message input component](./MessageInputComponent.mdx) is used. To change the input for message edit, provide [your own custom template](./MessageInputComponent.mdx/#customization).
20
- */
21
- messageInputTemplate: TemplateRef<any> | undefined;
16
+ private customTemplatesService;
22
17
  /**
23
18
  * Indicates if the list should be opened or closed. Adding a UI element to open and close the list is the parent's component responsibility.
24
19
  */
@@ -44,23 +39,23 @@ export declare class MessageActionsBoxComponent implements OnChanges {
44
39
  */
45
40
  readonly isEditing: EventEmitter<boolean>;
46
41
  isEditModalOpen: boolean;
42
+ messageInputTemplate: TemplateRef<MessageInputContext> | undefined;
43
+ messageActionItemTemplate: TemplateRef<MessageActionBoxItemContext> | undefined;
44
+ modalTemplate: TemplateRef<ModalContext> | undefined;
45
+ subscriptions: Subscription[];
46
+ visibleMessageActionItems: MessageActionItem[];
47
+ private readonly messageActionItems;
47
48
  private messageInput;
48
- constructor(chatClientService: ChatClientService, notificationService: NotificationService, channelService: ChannelService);
49
+ private modalContent;
50
+ constructor(chatClientService: ChatClientService, notificationService: NotificationService, channelService: ChannelService, customTemplatesService: CustomTemplatesService);
49
51
  ngOnChanges(changes: SimpleChanges): void;
50
- get isQuoteVisible(): boolean;
51
- get isEditVisible(): boolean;
52
- get isDeleteVisible(): boolean;
53
- get isMuteVisible(): boolean;
54
- get isFlagVisible(): boolean;
55
- get isPinVisible(): boolean;
56
- pinClicked(): void;
57
- flagClicked(): Promise<void>;
58
- muteClicked(): void;
59
- quoteClicked(): void;
60
- editClicked(): void;
52
+ ngOnDestroy(): void;
53
+ getActionLabel(actionLabelOrTranslationKey: (() => string) | string): string;
61
54
  sendClicked(): void;
62
55
  modalClosed: () => void;
63
- deleteClicked(): Promise<void>;
56
+ getMessageInputContext(): MessageInputContext;
57
+ getEditModalContext(): ModalContext;
58
+ trackByActionName(_: number, item: MessageActionItem): "mute" | "delete" | "flag" | "quote" | "pin" | "edit";
64
59
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageActionsBoxComponent, never>;
65
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageActionsBoxComponent, "stream-message-actions-box", never, { "messageInputTemplate": "messageInputTemplate"; "isOpen": "isOpen"; "isMine": "isMine"; "message": "message"; "enabledActions": "enabledActions"; }, { "displayedActionsCount": "displayedActionsCount"; "isEditing": "isEditing"; }, never, never>;
60
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageActionsBoxComponent, "stream-message-actions-box", never, { "isOpen": "isOpen"; "isMine": "isMine"; "message": "message"; "enabledActions": "enabledActions"; }, { "displayedActionsCount": "displayedActionsCount"; "isEditing": "isEditing"; }, never, never>;
66
61
  }
@@ -7,6 +7,7 @@ import { TextareaInterface } from '../textarea.interface';
7
7
  import { ChatClientService } from '../../chat-client.service';
8
8
  import { TransliterationService } from '../../transliteration.service';
9
9
  import { EmojiInputService } from '../emoji-input.service';
10
+ import { CustomTemplatesService } from '../../custom-templates.service';
10
11
  import * as i0 from "@angular/core";
11
12
  /**
12
13
  * The `AutocompleteTextarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.
@@ -16,6 +17,7 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
16
17
  private chatClientService;
17
18
  private transliterationService;
18
19
  private emojiInputService;
20
+ private customTemplatesService;
19
21
  class: string;
20
22
  /**
21
23
  * The value of the input HTML element.
@@ -25,14 +27,6 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
25
27
  * If true, users can mention other users in messages. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.
26
28
  */
27
29
  areMentionsEnabled: boolean | undefined;
28
- /**
29
- * You can provide your own template for the autocomplete list for user mentions. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.
30
- */
31
- mentionAutocompleteItemTemplate: TemplateRef<MentionAutcompleteListItemContext> | undefined;
32
- /**
33
- * You can provide your own template for the autocomplete list for commands. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.
34
- */
35
- commandAutocompleteItemTemplate: TemplateRef<CommandAutocompleteListItemContext> | undefined;
36
30
  /**
37
31
  * The scope for user mentions, either members of the current channel of members of the application. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.
38
32
  */
@@ -49,6 +43,8 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
49
43
  * Emits the array of users that are mentioned in the message, it is updated when a user mentions a new user or deletes a mention.
50
44
  */
51
45
  readonly userMentions: EventEmitter<UserResponse<import("stream-chat").UR>[]>;
46
+ mentionAutocompleteItemTemplate: TemplateRef<MentionAutcompleteListItemContext> | undefined;
47
+ commandAutocompleteItemTemplate: TemplateRef<CommandAutocompleteListItemContext> | undefined;
52
48
  private readonly autocompleteKey;
53
49
  private readonly mentionTriggerChar;
54
50
  private readonly commandTriggerChar;
@@ -59,7 +55,7 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
59
55
  private userMentionConfig;
60
56
  private slashCommandConfig;
61
57
  private searchTerm$;
62
- constructor(channelService: ChannelService, chatClientService: ChatClientService, transliterationService: TransliterationService, emojiInputService: EmojiInputService);
58
+ constructor(channelService: ChannelService, chatClientService: ChatClientService, transliterationService: TransliterationService, emojiInputService: EmojiInputService, customTemplatesService: CustomTemplatesService);
63
59
  ngOnChanges(changes: SimpleChanges): void;
64
60
  filter(searchString: string, items: {
65
61
  autocompleteLabel: string;
@@ -75,5 +71,5 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
75
71
  private updateMentionOptions;
76
72
  private updateMentionedUsersFromText;
77
73
  static ɵfac: i0.ɵɵFactoryDeclaration<AutocompleteTextareaComponent, never>;
78
- static ɵcmp: i0.ɵɵComponentDeclaration<AutocompleteTextareaComponent, "stream-autocomplete-textarea", never, { "value": "value"; "areMentionsEnabled": "areMentionsEnabled"; "mentionAutocompleteItemTemplate": "mentionAutocompleteItemTemplate"; "commandAutocompleteItemTemplate": "commandAutocompleteItemTemplate"; "mentionScope": "mentionScope"; }, { "valueChange": "valueChange"; "send": "send"; "userMentions": "userMentions"; }, never, never>;
74
+ static ɵcmp: i0.ɵɵComponentDeclaration<AutocompleteTextareaComponent, "stream-autocomplete-textarea", never, { "value": "value"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; }, { "valueChange": "valueChange"; "send": "send"; "userMentions": "userMentions"; }, never, never>;
79
75
  }
@@ -1,5 +1,3 @@
1
- import { TemplateRef } from '@angular/core';
2
- import { CommandAutocompleteListItemContext, MentionAutcompleteListItemContext } from '../types';
3
1
  import * as i0 from "@angular/core";
4
2
  /**
5
3
  * The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](../components/MessageInputComponent.mdx) components if your UI has more than one input component.
@@ -13,23 +11,6 @@ export declare class MessageInputConfigService {
13
11
  * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.
14
12
  */
15
13
  areMentionsEnabled: boolean | undefined;
16
- /**
17
- * You can provide your own template for the autocomplete list for user mentions. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.
18
- */
19
- mentionAutocompleteItemTemplate: TemplateRef<MentionAutcompleteListItemContext> | undefined;
20
- /**
21
- * You can provide your own template for the autocomplete list for commands. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.
22
- */
23
- commandAutocompleteItemTemplate: TemplateRef<CommandAutocompleteListItemContext> | undefined;
24
- /**
25
- * You can add an emoji picker by [providing your own emoji picker template](../code-examples/emoji-picker.mdx)
26
- */
27
- emojiPickerTemplate: TemplateRef<void> | undefined;
28
- /**
29
- * You can narrow the accepted file types by providing the [accepted types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept). By default every file type is accepted.
30
- * @deprecated use [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript#file-uploads) instead
31
- */
32
- acceptedFileTypes: string[] | undefined;
33
14
  /**
34
15
  * If `false`, users can only upload one attachment per message
35
16
  */