stream-chat-angular 3.6.0 → 4.0.0-theming-v2.2

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 (67) hide show
  1. package/assets/i18n/en.d.ts +4 -0
  2. package/assets/version.d.ts +1 -1
  3. package/bundles/stream-chat-angular.umd.js +299 -158
  4. package/bundles/stream-chat-angular.umd.js.map +1 -1
  5. package/esm2015/assets/i18n/en.js +10 -6
  6. package/esm2015/assets/version.js +2 -2
  7. package/esm2015/lib/attachment-list/attachment-list.component.js +20 -11
  8. package/esm2015/lib/attachment-preview-list/attachment-preview-list.component.js +11 -9
  9. package/esm2015/lib/avatar/avatar.component.js +2 -2
  10. package/esm2015/lib/channel/channel.component.js +13 -6
  11. package/esm2015/lib/channel-header/channel-header.component.js +2 -2
  12. package/esm2015/lib/channel-list/channel-list-toggle.service.js +5 -8
  13. package/esm2015/lib/channel-list/channel-list.component.js +14 -10
  14. package/esm2015/lib/channel-preview/channel-preview.component.js +16 -7
  15. package/esm2015/lib/channel.service.js +15 -7
  16. package/esm2015/lib/chat-client.service.js +9 -3
  17. package/esm2015/lib/icon/icon.component.js +2 -2
  18. package/esm2015/lib/loading-indicator/loading-indicator.component.js +5 -3
  19. package/esm2015/lib/loading-indicator-placeholder/loading-indicator-placeholder.component.js +2 -2
  20. package/esm2015/lib/message/message.component.js +26 -33
  21. package/esm2015/lib/message-actions-box/message-actions-box.component.js +3 -2
  22. package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +33 -10
  23. package/esm2015/lib/message-input/message-input.component.js +30 -20
  24. package/esm2015/lib/message-input/textarea/textarea.component.js +32 -9
  25. package/esm2015/lib/message-input/textarea.directive.js +8 -2
  26. package/esm2015/lib/message-input/textarea.interface.js +1 -1
  27. package/esm2015/lib/message-list/group-styles.js +7 -3
  28. package/esm2015/lib/message-list/message-list.component.js +16 -8
  29. package/esm2015/lib/message-reactions/message-reactions.component.js +11 -4
  30. package/esm2015/lib/modal/modal.component.js +3 -4
  31. package/esm2015/lib/notification/notification.component.js +2 -2
  32. package/esm2015/lib/notification-list/notification-list.component.js +12 -8
  33. package/esm2015/lib/stream-chat.module.js +18 -4
  34. package/esm2015/lib/theme.service.js +9 -2
  35. package/esm2015/lib/thread/thread.component.js +18 -11
  36. package/esm2015/public-api.js +1 -2
  37. package/fesm2015/stream-chat-angular.js +263 -137
  38. package/fesm2015/stream-chat-angular.js.map +1 -1
  39. package/lib/attachment-list/attachment-list.component.d.ts +4 -1
  40. package/lib/attachment-preview-list/attachment-preview-list.component.d.ts +3 -1
  41. package/lib/channel/channel.component.d.ts +5 -1
  42. package/lib/channel-header/channel-header.component.d.ts +1 -1
  43. package/lib/channel-list/channel-list-toggle.service.d.ts +2 -0
  44. package/lib/channel-list/channel-list.component.d.ts +4 -1
  45. package/lib/channel-preview/channel-preview.component.d.ts +2 -0
  46. package/lib/channel.service.d.ts +3 -1
  47. package/lib/icon/icon.component.d.ts +1 -1
  48. package/lib/loading-indicator/loading-indicator.component.d.ts +1 -0
  49. package/lib/message/message.component.d.ts +8 -3
  50. package/lib/message-actions-box/message-actions-box.component.d.ts +1 -0
  51. package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +12 -4
  52. package/lib/message-input/message-input.component.d.ts +10 -2
  53. package/lib/message-input/textarea/textarea.component.d.ts +13 -5
  54. package/lib/message-input/textarea.directive.d.ts +2 -1
  55. package/lib/message-input/textarea.interface.d.ts +1 -0
  56. package/lib/message-list/message-list.component.d.ts +4 -0
  57. package/lib/message-reactions/message-reactions.component.d.ts +4 -0
  58. package/lib/notification-list/notification-list.component.d.ts +5 -1
  59. package/lib/stream-chat.module.d.ts +2 -1
  60. package/lib/theme.service.d.ts +10 -2
  61. package/lib/thread/thread.component.d.ts +8 -6
  62. package/package.json +5 -3
  63. package/public-api.d.ts +0 -1
  64. package/src/assets/i18n/en.ts +9 -5
  65. package/src/assets/version.ts +1 -1
  66. package/esm2015/lib/device-width.js +0 -9
  67. package/lib/device-width.d.ts +0 -5
@@ -4,6 +4,7 @@ import { ImageLoadService } from '../message-list/image-load.service';
4
4
  import { ModalContext, DefaultStreamChatGenerics } from '../types';
5
5
  import { ChannelService } from '../channel.service';
6
6
  import { CustomTemplatesService } from '../custom-templates.service';
7
+ import { ThemeService } from '../theme.service';
7
8
  import * as i0 from "@angular/core";
8
9
  /**
9
10
  * The `AttachmentList` compontent displays the attachments of a message
@@ -20,11 +21,13 @@ export declare class AttachmentListComponent implements OnChanges {
20
21
  * The attachments to display
21
22
  */
22
23
  attachments: Attachment<DefaultStreamChatGenerics>[];
24
+ class: string;
23
25
  orderedAttachments: Attachment<DefaultStreamChatGenerics>[];
24
26
  imagesToView: Attachment<DefaultStreamChatGenerics>[];
25
27
  imagesToViewCurrentIndex: number;
28
+ themeVersion: '1' | '2';
26
29
  private modalContent;
27
- constructor(customTemplatesService: CustomTemplatesService, imageLoadService: ImageLoadService, channelService: ChannelService);
30
+ constructor(customTemplatesService: CustomTemplatesService, imageLoadService: ImageLoadService, channelService: ChannelService, themeService: ThemeService);
28
31
  ngOnChanges(): void;
29
32
  trackById(index: number): number;
30
33
  isImage(attachment: Attachment): boolean;
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
+ import { ThemeService } from '../theme.service';
3
4
  import { AttachmentUpload } from '../types';
4
5
  import * as i0 from "@angular/core";
5
6
  /**
@@ -18,7 +19,8 @@ export declare class AttachmentPreviewListComponent {
18
19
  * An output to notify the parent component if the user wants to delete a file
19
20
  */
20
21
  readonly deleteAttachment: EventEmitter<AttachmentUpload>;
21
- constructor();
22
+ themeVersion: '1' | '2';
23
+ constructor(themeService: ThemeService);
22
24
  attachmentUploadRetried(file: File): void;
23
25
  attachmentDeleted(upload: AttachmentUpload): void;
24
26
  trackByFile(_: number, item: AttachmentUpload): File;
@@ -1,16 +1,20 @@
1
1
  import { Observable, Subscription } from 'rxjs';
2
2
  import { ChannelService } from '../channel.service';
3
+ import { ThemeService } from '../theme.service';
3
4
  import * as i0 from "@angular/core";
4
5
  /**
5
6
  * The `Channel` component is a container component that displays the [`ChannelHeader`](./ChannelHeaderComponent.mdx), [`MessageList`](./MessageListComponent.mdx), [`NotificationList`](./NotificationListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components. You can also provide the [`Thread`](./ThreadComponent.mdx) component to use message [threads](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
6
7
  */
7
8
  export declare class ChannelComponent {
8
9
  private channelService;
10
+ private themeService;
9
11
  isError$: Observable<boolean>;
10
12
  isInitializing$: Observable<boolean>;
11
13
  isActiveThread$: Observable<boolean>;
14
+ isActiveChannel$: Observable<boolean>;
12
15
  subscriptions: Subscription[];
13
- constructor(channelService: ChannelService);
16
+ theme$: Observable<string>;
17
+ constructor(channelService: ChannelService, themeService: ThemeService);
14
18
  static ɵfac: i0.ɵɵFactoryDeclaration<ChannelComponent, never>;
15
19
  static ɵcmp: i0.ɵɵComponentDeclaration<ChannelComponent, "stream-channel", never, {}, {}, never, ["*", "[name=\"thread\"]"]>;
16
20
  }
@@ -33,5 +33,5 @@ export declare class ChannelHeaderComponent implements OnInit, OnDestroy {
33
33
  get displayText(): string | undefined;
34
34
  get avatarName(): string | undefined;
35
35
  static ɵfac: i0.ɵɵFactoryDeclaration<ChannelHeaderComponent, never>;
36
- static ɵcmp: i0.ɵɵComponentDeclaration<ChannelHeaderComponent, "stream-channel-header", never, {}, {}, never, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChannelHeaderComponent, "stream-channel-header", never, {}, {}, never, ["*"]>;
37
37
  }
@@ -2,6 +2,8 @@ import { Observable } from 'rxjs';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
4
  * The `ChannelListToggleService` can be used to toggle the channel list.
5
+ *
6
+ * @deprecated This service can only be used with [theming-v1](../concepts/theming-and-css.mdx), if you are using [thmeing-v2](../theming/introduction.mdx) please refer to our [responsive layout guide](../code-examples/responsive-layout.mdx)
5
7
  */
6
8
  export declare class ChannelListToggleService {
7
9
  /**
@@ -3,6 +3,7 @@ import { Observable, Subscription } from 'rxjs';
3
3
  import { Channel } from 'stream-chat';
4
4
  import { ChannelService } from '../channel.service';
5
5
  import { CustomTemplatesService } from '../custom-templates.service';
6
+ import { ThemeService } from '../theme.service';
6
7
  import { ChannelPreviewContext, DefaultStreamChatGenerics } from '../types';
7
8
  import { ChannelListToggleService } from './channel-list-toggle.service';
8
9
  import * as i0 from "@angular/core";
@@ -13,6 +14,7 @@ export declare class ChannelListComponent implements AfterViewInit, OnDestroy {
13
14
  private channelService;
14
15
  private channelListToggleService;
15
16
  private customTemplatesService;
17
+ private themeService;
16
18
  channels$: Observable<Channel<DefaultStreamChatGenerics>[] | undefined>;
17
19
  isError$: Observable<boolean>;
18
20
  isInitializing$: Observable<boolean>;
@@ -20,9 +22,10 @@ export declare class ChannelListComponent implements AfterViewInit, OnDestroy {
20
22
  isOpen$: Observable<boolean>;
21
23
  hasMoreChannels$: Observable<boolean>;
22
24
  customChannelPreviewTemplate: TemplateRef<ChannelPreviewContext> | undefined;
25
+ theme$: Observable<string>;
23
26
  subscriptions: Subscription[];
24
27
  private container;
25
- constructor(channelService: ChannelService, channelListToggleService: ChannelListToggleService, customTemplatesService: CustomTemplatesService);
28
+ constructor(channelService: ChannelService, channelListToggleService: ChannelListToggleService, customTemplatesService: CustomTemplatesService, themeService: ThemeService);
26
29
  ngAfterViewInit(): void;
27
30
  ngOnDestroy(): void;
28
31
  loadMoreChannels(): Promise<void>;
@@ -17,6 +17,7 @@ export declare class ChannelPreviewComponent implements OnInit, OnDestroy {
17
17
  channel: Channel<DefaultStreamChatGenerics> | undefined;
18
18
  isActive: boolean;
19
19
  isUnread: boolean;
20
+ unreadCount: number | undefined;
20
21
  latestMessage: string;
21
22
  private subscriptions;
22
23
  private canSendReadEvents;
@@ -29,6 +30,7 @@ export declare class ChannelPreviewComponent implements OnInit, OnDestroy {
29
30
  setAsActiveChannel(): void;
30
31
  private handleMessageEvent;
31
32
  private setLatestMessage;
33
+ private updateUnreadState;
32
34
  static ɵfac: i0.ɵɵFactoryDeclaration<ChannelPreviewComponent, never>;
33
35
  static ɵcmp: i0.ɵɵComponentDeclaration<ChannelPreviewComponent, "stream-channel-preview", never, { "channel": "channel"; }, {}, never, never>;
34
36
  }
@@ -2,6 +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, ClientEvent } from './chat-client.service';
5
+ import { NotificationService } from './notification.service';
5
6
  import { AttachmentUpload, DefaultStreamChatGenerics, MessageReactionType, StreamMessage } from './types';
6
7
  import * as i0 from "@angular/core";
7
8
  /**
@@ -10,6 +11,7 @@ import * as i0 from "@angular/core";
10
11
  export declare class ChannelService<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> {
11
12
  private chatClientService;
12
13
  private ngZone;
14
+ private notificationService;
13
15
  /**
14
16
  * Emits `false` if there are no more pages of channels that can be loaded.
15
17
  */
@@ -163,7 +165,7 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
163
165
  private messageListSetter;
164
166
  private threadListSetter;
165
167
  private parentMessageSetter;
166
- constructor(chatClientService: ChatClientService<T>, ngZone: NgZone);
168
+ constructor(chatClientService: ChatClientService<T>, ngZone: NgZone, notificationService: NotificationService);
167
169
  /**
168
170
  * 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.
169
171
  */
@@ -1,5 +1,5 @@
1
1
  import * as i0 from "@angular/core";
2
- export declare type Icon = 'action-icon' | 'delivered-icon' | 'reaction-icon' | 'connection-error' | 'send' | 'file-upload' | 'retry' | 'close' | 'file' | 'reply' | 'close-no-outline' | 'reply-in-thread' | 'arrow-left' | 'arrow-right' | 'menu' | 'arrow-up' | 'arrow-down';
2
+ export declare type Icon = 'action-icon' | 'delivered-icon' | 'reaction-icon' | 'connection-error' | 'send' | 'file-upload' | 'retry' | 'close' | 'file' | 'reply' | 'close-no-outline' | 'reply-in-thread' | 'arrow-left' | 'arrow-right' | 'menu' | 'arrow-up' | 'arrow-down' | 'chat-bubble' | 'attach' | 'unspecified-filetype' | 'download' | 'error';
3
3
  /**
4
4
  * The `Icon` component can be used to display different icons (i. e. message delivered icon).
5
5
  */
@@ -11,6 +11,7 @@ export declare class LoadingIndicatorComponent {
11
11
  * The color of the indicator
12
12
  */
13
13
  color: string;
14
+ linearGradientId: string;
14
15
  constructor();
15
16
  static ɵfac: i0.ɵɵFactoryDeclaration<LoadingIndicatorComponent, never>;
16
17
  static ɵcmp: i0.ɵɵComponentDeclaration<LoadingIndicatorComponent, "stream-loading-indicator", never, { "size": "size"; "color": "color"; }, {}, never, never>;
@@ -4,6 +4,8 @@ import { ChannelService } from '../channel.service';
4
4
  import { ChatClientService } from '../chat-client.service';
5
5
  import { AttachmentListContext, MentionTemplateContext, MessageActionsBoxContext, MessageReactionsContext, DefaultStreamChatGenerics, StreamMessage } from '../types';
6
6
  import { CustomTemplatesService } from '../custom-templates.service';
7
+ import { ThemeService } from '../theme.service';
8
+ import { NgxPopperjsTriggers, NgxPopperjsPlacements } from 'ngx-popperjs';
7
9
  import * as i0 from "@angular/core";
8
10
  declare type MessagePart = {
9
11
  content: string;
@@ -34,25 +36,29 @@ export declare class MessageComponent implements OnInit, OnChanges, OnDestroy {
34
36
  * Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
35
37
  */
36
38
  mode: 'thread' | 'main';
39
+ readonly themeVersion: '1' | '2';
37
40
  canReceiveReadEvents: boolean | undefined;
38
41
  canReactToMessage: boolean | undefined;
39
42
  isEditing: boolean | undefined;
40
43
  isActionBoxOpen: boolean;
41
44
  isReactionSelectorOpen: boolean;
42
- isPressedOnMobile: boolean;
43
45
  visibleMessageActionsCount: number;
44
46
  messageTextParts: MessagePart[];
45
47
  mentionTemplate: TemplateRef<MentionTemplateContext> | undefined;
46
48
  attachmentListTemplate: TemplateRef<AttachmentListContext> | undefined;
47
49
  messageActionsBoxTemplate: TemplateRef<MessageActionsBoxContext> | undefined;
48
50
  messageReactionsTemplate: TemplateRef<MessageReactionsContext> | undefined;
51
+ popperTriggerClick: NgxPopperjsTriggers;
52
+ popperTriggerHover: NgxPopperjsTriggers;
53
+ popperPlacementAuto: NgxPopperjsPlacements;
49
54
  private user;
50
55
  private subscriptions;
51
56
  private container;
52
- constructor(chatClientService: ChatClientService, channelService: ChannelService, customTemplatesService: CustomTemplatesService, cdRef: ChangeDetectorRef);
57
+ constructor(chatClientService: ChatClientService, channelService: ChannelService, customTemplatesService: CustomTemplatesService, cdRef: ChangeDetectorRef, themeService: ThemeService);
53
58
  ngOnInit(): void;
54
59
  ngOnChanges(changes: SimpleChanges): void;
55
60
  ngOnDestroy(): void;
61
+ get shouldDisplayThreadLink(): boolean;
56
62
  get isSentByCurrentUser(): boolean;
57
63
  get readByText(): string;
58
64
  get lastReadUser(): UserResponse<DefaultStreamChatGenerics> | undefined;
@@ -90,7 +96,6 @@ export declare class MessageComponent implements OnInit, OnChanges, OnDestroy {
90
96
  getAttachmentListContext(): AttachmentListContext;
91
97
  getMessageReactionsContext(): MessageReactionsContext;
92
98
  resendMessage(): void;
93
- textClicked(): void;
94
99
  setAsActiveParentMessage(): void;
95
100
  getMentionContext(messagePart: MessagePart): MentionTemplateContext;
96
101
  getMessageActionsBoxContext(): MessageActionsBoxContext;
@@ -16,6 +16,7 @@ export declare class MessageActionsBoxComponent implements OnChanges, OnDestroy
16
16
  private customTemplatesService;
17
17
  /**
18
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.
19
+ * @deprecated No need for this since [theme-v2](../theming/introduction.mdx)
19
20
  */
20
21
  isOpen: boolean;
21
22
  /**
@@ -1,4 +1,4 @@
1
- import { EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
1
+ import { AfterViewInit, EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
2
2
  import { MentionConfig } from 'angular-mentions';
3
3
  import { MentionAutcompleteListItemContext, MentionAutcompleteListItem, CommandAutocompleteListItemContext } from '../../types';
4
4
  import { UserResponse } from 'stream-chat';
@@ -8,21 +8,27 @@ import { ChatClientService } from '../../chat-client.service';
8
8
  import { TransliterationService } from '../../transliteration.service';
9
9
  import { EmojiInputService } from '../emoji-input.service';
10
10
  import { CustomTemplatesService } from '../../custom-templates.service';
11
+ import { ThemeService } from '../../theme.service';
11
12
  import * as i0 from "@angular/core";
12
13
  /**
13
14
  * The `AutocompleteTextarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.
14
15
  */
15
- export declare class AutocompleteTextareaComponent implements TextareaInterface, OnChanges {
16
+ export declare class AutocompleteTextareaComponent implements TextareaInterface, OnChanges, AfterViewInit {
16
17
  private channelService;
17
18
  private chatClientService;
18
19
  private transliterationService;
19
20
  private emojiInputService;
20
21
  private customTemplatesService;
22
+ private themeService;
21
23
  class: string;
22
24
  /**
23
25
  * The value of the input HTML element.
24
26
  */
25
27
  value: string;
28
+ /**
29
+ * Placeholder of the textarea
30
+ */
31
+ placeholder: string;
26
32
  /**
27
33
  * If true, users can mention other users in messages. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.
28
34
  */
@@ -55,8 +61,9 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
55
61
  private userMentionConfig;
56
62
  private slashCommandConfig;
57
63
  private searchTerm$;
58
- constructor(channelService: ChannelService, chatClientService: ChatClientService, transliterationService: TransliterationService, emojiInputService: EmojiInputService, customTemplatesService: CustomTemplatesService);
64
+ constructor(channelService: ChannelService, chatClientService: ChatClientService, transliterationService: TransliterationService, emojiInputService: EmojiInputService, customTemplatesService: CustomTemplatesService, themeService: ThemeService);
59
65
  ngOnChanges(changes: SimpleChanges): void;
66
+ ngAfterViewInit(): void;
60
67
  filter(searchString: string, items: {
61
68
  autocompleteLabel: string;
62
69
  }[]): {
@@ -67,9 +74,10 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
67
74
  inputChanged(): void;
68
75
  inputLeft(): void;
69
76
  sent(event: Event): void;
77
+ private adjustTextareaHeight;
70
78
  private transliterate;
71
79
  private updateMentionOptions;
72
80
  private updateMentionedUsersFromText;
73
81
  static ɵfac: i0.ɵɵFactoryDeclaration<AutocompleteTextareaComponent, 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>;
82
+ static ɵcmp: i0.ɵɵComponentDeclaration<AutocompleteTextareaComponent, "stream-autocomplete-textarea", never, { "value": "value"; "placeholder": "placeholder"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; }, { "valueChange": "valueChange"; "send": "send"; "userMentions": "userMentions"; }, never, never>;
75
83
  }
@@ -10,6 +10,7 @@ import { MessageInputConfigService } from './message-input-config.service';
10
10
  import { TextareaInterface } from './textarea.interface';
11
11
  import { EmojiInputService } from './emoji-input.service';
12
12
  import { CustomTemplatesService } from '../custom-templates.service';
13
+ import { ThemeService } from '../theme.service';
13
14
  import * as i0 from "@angular/core";
14
15
  /**
15
16
  * The `MessageInput` component displays an input where users can type their messages and upload files, and sends the message to the active channel. The component can be used to compose new messages or update existing ones. To send messages, the chat user needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
@@ -57,10 +58,12 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
57
58
  * Emits when a message was successfuly sent or updated
58
59
  */
59
60
  readonly messageUpdate: EventEmitter<void>;
61
+ class: string;
60
62
  isFileUploadAuthorized: boolean | undefined;
61
63
  canSendLinks: boolean | undefined;
62
64
  canSendMessages: boolean | undefined;
63
65
  attachmentUploads$: Observable<AttachmentUpload[]>;
66
+ attachmentUploadInProgressCounter$: Observable<number>;
64
67
  textareaValue: string;
65
68
  textareaRef: ComponentRef<TextareaInterface> | undefined;
66
69
  mentionedUsers: UserResponse[];
@@ -70,6 +73,9 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
70
73
  isCooldownInProgress: boolean;
71
74
  emojiPickerTemplate: TemplateRef<EmojiPickerContext> | undefined;
72
75
  attachmentPreviewListTemplate: TemplateRef<AttachmentPreviewListContext> | undefined;
76
+ textareaPlaceholder: string;
77
+ themeVersion: '1' | '2';
78
+ fileInputId: string;
73
79
  private fileInput;
74
80
  private textareaAnchor;
75
81
  private subscriptions;
@@ -78,7 +84,9 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
78
84
  private appSettings;
79
85
  private channel;
80
86
  private sendMessageSubcription;
81
- constructor(channelService: ChannelService, notificationService: NotificationService, attachmentService: AttachmentService, configService: MessageInputConfigService, textareaType: Type<TextareaInterface>, componentFactoryResolver: ComponentFactoryResolver, cdRef: ChangeDetectorRef, chatClient: ChatClientService, emojiInputService: EmojiInputService, customTemplatesService: CustomTemplatesService);
87
+ private readonly defaultTextareaPlaceholder;
88
+ private readonly slowModeTextareaPlaceholder;
89
+ constructor(channelService: ChannelService, notificationService: NotificationService, attachmentService: AttachmentService, configService: MessageInputConfigService, textareaType: Type<TextareaInterface>, componentFactoryResolver: ComponentFactoryResolver, cdRef: ChangeDetectorRef, chatClient: ChatClientService, emojiInputService: EmojiInputService, customTemplatesService: CustomTemplatesService, themeService: ThemeService);
82
90
  ngOnInit(): void;
83
91
  ngAfterViewInit(): void;
84
92
  ngOnChanges(changes: SimpleChanges): void;
@@ -105,7 +113,7 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
105
113
  mutes?: import("stream-chat").Mute<DefaultStreamChatGenerics>[] | undefined;
106
114
  };
107
115
  }>[];
108
- get disabledTextareaText(): "" | "streamChat.You can't send thread replies in this channel" | "streamChat.You can't send messages in this channel" | "streamChat.Slow Mode ON";
116
+ get disabledTextareaText(): "" | "streamChat.You can't send thread replies in this channel" | "streamChat.You can't send messages in this channel";
109
117
  filesSelected(fileList: FileList | null): Promise<void>;
110
118
  deselectMessageToQuote(): void;
111
119
  getEmojiPickerContext(): EmojiPickerContext;
@@ -1,17 +1,23 @@
1
- import { EventEmitter, OnChanges, OnDestroy } from '@angular/core';
1
+ import { AfterViewInit, EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { ThemeService } from '../../theme.service';
2
3
  import { EmojiInputService } from '../emoji-input.service';
3
4
  import { TextareaInterface } from '../textarea.interface';
4
5
  import * as i0 from "@angular/core";
5
6
  /**
6
7
  * The `Textarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.
7
8
  */
8
- export declare class TextareaComponent implements TextareaInterface, OnChanges, OnDestroy {
9
+ export declare class TextareaComponent implements TextareaInterface, OnChanges, OnDestroy, AfterViewInit {
9
10
  private emojiInputService;
11
+ private themeService;
10
12
  class: string;
11
13
  /**
12
14
  * The value of the input HTML element.
13
15
  */
14
16
  value: string;
17
+ /**
18
+ * Placeholder of the textarea
19
+ */
20
+ placeholder: string;
15
21
  /**
16
22
  * Emits the current value of the input element when a user types.
17
23
  */
@@ -22,11 +28,13 @@ export declare class TextareaComponent implements TextareaInterface, OnChanges,
22
28
  readonly send: EventEmitter<void>;
23
29
  private messageInput;
24
30
  private subscriptions;
25
- constructor(emojiInputService: EmojiInputService);
26
- ngOnChanges(): void;
31
+ constructor(emojiInputService: EmojiInputService, themeService: ThemeService);
32
+ ngOnChanges(changes: SimpleChanges): void;
33
+ ngAfterViewInit(): void;
27
34
  ngOnDestroy(): void;
28
35
  inputChanged(): void;
29
36
  sent(event: Event): void;
37
+ private adjustTextareaHeight;
30
38
  static ɵfac: i0.ɵɵFactoryDeclaration<TextareaComponent, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<TextareaComponent, "stream-textarea", never, { "value": "value"; }, { "valueChange": "valueChange"; "send": "send"; }, never, never>;
39
+ static ɵcmp: i0.ɵɵComponentDeclaration<TextareaComponent, "stream-textarea", never, { "value": "value"; "placeholder": "placeholder"; }, { "valueChange": "valueChange"; "send": "send"; }, never, never>;
32
40
  }
@@ -8,6 +8,7 @@ export declare class TextareaDirective implements OnChanges {
8
8
  areMentionsEnabled: boolean | undefined;
9
9
  mentionScope?: 'channel' | 'application';
10
10
  value: string;
11
+ placeholder: string | undefined;
11
12
  readonly valueChange: EventEmitter<string>;
12
13
  readonly send: EventEmitter<void>;
13
14
  readonly userMentions: EventEmitter<UserResponse<import("stream-chat").DefaultGenerics>[]>;
@@ -16,5 +17,5 @@ export declare class TextareaDirective implements OnChanges {
16
17
  constructor(viewContainerRef: ViewContainerRef);
17
18
  ngOnChanges(changes: SimpleChanges): void;
18
19
  static ɵfac: i0.ɵɵFactoryDeclaration<TextareaDirective, never>;
19
- static ɵdir: i0.ɵɵDirectiveDeclaration<TextareaDirective, "[streamTextarea]", never, { "componentRef": "componentRef"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "value": "value"; }, { "valueChange": "valueChange"; "send": "send"; "userMentions": "userMentions"; }, never>;
20
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TextareaDirective, "[streamTextarea]", never, { "componentRef": "componentRef"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "value": "value"; "placeholder": "placeholder"; }, { "valueChange": "valueChange"; "send": "send"; "userMentions": "userMentions"; }, never>;
20
21
  }
@@ -7,4 +7,5 @@ export interface TextareaInterface extends OnChanges {
7
7
  userMentions?: EventEmitter<UserResponse[]>;
8
8
  areMentionsEnabled?: boolean;
9
9
  mentionScope?: 'channel' | 'application';
10
+ placeholder?: string;
10
11
  }
@@ -60,6 +60,10 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
60
60
  scrolled(): void;
61
61
  getTypingIndicatorContext(): TypingIndicatorContext;
62
62
  getMessageContext(message: StreamMessage): MessageContext;
63
+ getTypingIndicatorText(users: UserResponse[]): string;
64
+ get replyCountParam(): {
65
+ replyCount: number | undefined;
66
+ };
63
67
  private preserveScrollbarPosition;
64
68
  private shouldLoadMoreMessages;
65
69
  private setMessages$;
@@ -2,6 +2,7 @@ import { AfterViewChecked, ChangeDetectorRef, EventEmitter, OnChanges, SimpleCha
2
2
  import { ReactionResponse } from 'stream-chat';
3
3
  import { ChannelService } from '../channel.service';
4
4
  import { MessageReactionType, DefaultStreamChatGenerics } from '../types';
5
+ import { NgxPopperjsTriggers, NgxPopperjsPlacements } from 'ngx-popperjs';
5
6
  import * as i0 from "@angular/core";
6
7
  /**
7
8
  * The `MessageReactions` component displays the reactions of a message, the current user can add and remove reactions. You can read more about [message reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript) in the platform documentation.
@@ -43,6 +44,8 @@ export declare class MessageReactionsComponent implements AfterViewChecked, OnCh
43
44
  private selectorContainer;
44
45
  private selectorTooltip;
45
46
  currentTooltipTarget: HTMLElement | undefined;
47
+ popperTriggerHover: NgxPopperjsTriggers;
48
+ popperPlacementAuto: NgxPopperjsPlacements;
46
49
  constructor(cdRef: ChangeDetectorRef, channelService: ChannelService);
47
50
  ngOnChanges(changes: SimpleChanges): void;
48
51
  ngAfterViewChecked(): void;
@@ -56,6 +59,7 @@ export declare class MessageReactionsComponent implements AfterViewChecked, OnCh
56
59
  hideTooltip(): void;
57
60
  trackByMessageReaction(index: number, item: MessageReactionType): MessageReactionType;
58
61
  react(type: MessageReactionType): void;
62
+ isOwnReaction(reactionType: MessageReactionType): boolean;
59
63
  private eventHandler;
60
64
  private watchForOutsideClicks;
61
65
  private stopWatchForOutsideClicks;
@@ -1,6 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { CustomTemplatesService } from '../custom-templates.service';
3
3
  import { NotificationService } from '../notification.service';
4
+ import { ThemeService } from '../theme.service';
4
5
  import { NotificationPayload } from '../types';
5
6
  import * as i0 from "@angular/core";
6
7
  /**
@@ -9,8 +10,11 @@ import * as i0 from "@angular/core";
9
10
  export declare class NotificationListComponent {
10
11
  readonly customTemplatesService: CustomTemplatesService;
11
12
  private notificationService;
13
+ private themeService;
12
14
  notifications$: Observable<NotificationPayload[]>;
13
- constructor(customTemplatesService: CustomTemplatesService, notificationService: NotificationService);
15
+ themeVersion: '1' | '2';
16
+ theme$: Observable<string>;
17
+ constructor(customTemplatesService: CustomTemplatesService, notificationService: NotificationService, themeService: ThemeService);
14
18
  trackById(_: number, item: NotificationPayload): string;
15
19
  getNotificationContentContext(notification: NotificationPayload): {
16
20
  dismissFn: Function;
@@ -22,8 +22,9 @@ import * as i20 from "./loading-indicator-placeholder/loading-indicator-placehol
22
22
  import * as i21 from "@angular/common";
23
23
  import * as i22 from "@ngx-translate/core";
24
24
  import * as i23 from "./stream-avatar.module";
25
+ import * as i24 from "ngx-popperjs";
25
26
  export declare class StreamChatModule {
26
27
  static ɵfac: i0.ɵɵFactoryDeclaration<StreamChatModule, never>;
27
- static ɵmod: i0.ɵɵNgModuleDeclaration<StreamChatModule, [typeof i1.ChannelComponent, typeof i2.ChannelHeaderComponent, typeof i3.ChannelListComponent, typeof i4.ChannelPreviewComponent, typeof i5.MessageComponent, typeof i6.MessageInputComponent, typeof i7.MessageListComponent, typeof i8.LoadingIndicatorComponent, typeof i9.IconComponent, typeof i10.MessageActionsBoxComponent, typeof i11.AttachmentListComponent, typeof i12.MessageReactionsComponent, typeof i13.NotificationComponent, typeof i14.NotificationListComponent, typeof i15.AttachmentPreviewListComponent, typeof i16.ModalComponent, typeof i17.TextareaDirective, typeof i18.ThreadComponent, typeof i19.IconPlaceholderComponent, typeof i20.LoadingIndicatorPlaceholderComponent], [typeof i21.CommonModule, typeof i22.TranslateModule, typeof i23.StreamAvatarModule], [typeof i1.ChannelComponent, typeof i2.ChannelHeaderComponent, typeof i3.ChannelListComponent, typeof i4.ChannelPreviewComponent, typeof i5.MessageComponent, typeof i6.MessageInputComponent, typeof i7.MessageListComponent, typeof i8.LoadingIndicatorComponent, typeof i9.IconComponent, typeof i10.MessageActionsBoxComponent, typeof i11.AttachmentListComponent, typeof i12.MessageReactionsComponent, typeof i13.NotificationComponent, typeof i14.NotificationListComponent, typeof i15.AttachmentPreviewListComponent, typeof i16.ModalComponent, typeof i23.StreamAvatarModule, typeof i18.ThreadComponent, typeof i19.IconPlaceholderComponent, typeof i20.LoadingIndicatorPlaceholderComponent]>;
28
+ static ɵmod: i0.ɵɵNgModuleDeclaration<StreamChatModule, [typeof i1.ChannelComponent, typeof i2.ChannelHeaderComponent, typeof i3.ChannelListComponent, typeof i4.ChannelPreviewComponent, typeof i5.MessageComponent, typeof i6.MessageInputComponent, typeof i7.MessageListComponent, typeof i8.LoadingIndicatorComponent, typeof i9.IconComponent, typeof i10.MessageActionsBoxComponent, typeof i11.AttachmentListComponent, typeof i12.MessageReactionsComponent, typeof i13.NotificationComponent, typeof i14.NotificationListComponent, typeof i15.AttachmentPreviewListComponent, typeof i16.ModalComponent, typeof i17.TextareaDirective, typeof i18.ThreadComponent, typeof i19.IconPlaceholderComponent, typeof i20.LoadingIndicatorPlaceholderComponent], [typeof i21.CommonModule, typeof i22.TranslateModule, typeof i23.StreamAvatarModule, typeof i24.NgxPopperjsModule], [typeof i1.ChannelComponent, typeof i2.ChannelHeaderComponent, typeof i3.ChannelListComponent, typeof i4.ChannelPreviewComponent, typeof i5.MessageComponent, typeof i6.MessageInputComponent, typeof i7.MessageListComponent, typeof i8.LoadingIndicatorComponent, typeof i9.IconComponent, typeof i10.MessageActionsBoxComponent, typeof i11.AttachmentListComponent, typeof i12.MessageReactionsComponent, typeof i13.NotificationComponent, typeof i14.NotificationListComponent, typeof i15.AttachmentPreviewListComponent, typeof i16.ModalComponent, typeof i23.StreamAvatarModule, typeof i18.ThreadComponent, typeof i19.IconPlaceholderComponent, typeof i20.LoadingIndicatorPlaceholderComponent]>;
28
29
  static ɵinj: i0.ɵɵInjectorDeclaration<StreamChatModule>;
29
30
  }
@@ -2,13 +2,17 @@ import { BehaviorSubject } from 'rxjs';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare type Theme = 'light' | 'dark';
4
4
  /**
5
- * The `ThemeService` can be used to change the theme of the chat UI and to customize the theme. Our [themeing guide](../concepts/themeing-and-css.mdx) gives a complete overview about the topic.
5
+ * The `ThemeService` can be used to change the theme of the chat UI and to customize the theme. Our [theming guide](../theming/introduction.mdx) gives a complete overview about the topic.
6
6
  */
7
7
  export declare class ThemeService {
8
8
  /**
9
9
  * A Subject that can be used to get or set the currently active theme.
10
10
  */
11
- theme$: BehaviorSubject<Theme>;
11
+ theme$: BehaviorSubject<string>;
12
+ /**
13
+ * Stream chat theme version - this is used internally by some UI components of the SDK, integrators shouldn't need to use this variable
14
+ */
15
+ themeVersion: '1' | '2';
12
16
  private _customLightThemeVariables;
13
17
  private _customDarkThemeVariables;
14
18
  private defaultDarkModeVariables;
@@ -16,6 +20,7 @@ export declare class ThemeService {
16
20
  constructor();
17
21
  /**
18
22
  * A getter that returns the currently set custom light theme variables.
23
+ * @deprecated Only use with [theme v1](../concepts/theming-and-css.mdx)
19
24
  * @returns An object where the keys are theme variables, and the values are the currently set CSS values.
20
25
  */
21
26
  get customLightThemeVariables(): {
@@ -23,6 +28,7 @@ export declare class ThemeService {
23
28
  } | undefined;
24
29
  /**
25
30
  * A setter that can be used to overwrite the values of the CSS theme variables of the light theme.
31
+ * @deprecated Only use with [theme v1](../concepts/theming-and-css.mdx)
26
32
  * @param variables An object where the keys are theme variables, and the values are CSS values.
27
33
  */
28
34
  set customLightThemeVariables(variables: {
@@ -30,6 +36,7 @@ export declare class ThemeService {
30
36
  } | undefined);
31
37
  /**
32
38
  * A getter that returns the currently set custom dark theme variables.
39
+ * @deprecated Only use with [theme v1](../concepts/theming-and-css.mdx)
33
40
  * @returns An object where the keys are theme variables, and the values are the currently set CSS values.
34
41
  */
35
42
  get customDarkThemeVariables(): {
@@ -37,6 +44,7 @@ export declare class ThemeService {
37
44
  } | undefined;
38
45
  /**
39
46
  * A setter that can be used to overwrite the values of the CSS theme variables of the dark theme.
47
+ * @deprecated Only use with [theme v1](../concepts/theming-and-css.mdx)
40
48
  * @param variables An object where the keys are theme variables, and the values are CSS values.
41
49
  */
42
50
  set customDarkThemeVariables(variables: {
@@ -1,7 +1,9 @@
1
1
  import { OnDestroy } from '@angular/core';
2
+ import { Channel } from 'stream-chat';
3
+ import { ChatClientService } from '../chat-client.service';
2
4
  import { ChannelService } from '../channel.service';
3
5
  import { CustomTemplatesService } from '../custom-templates.service';
4
- import { StreamMessage, ThreadHeaderContext } from '../types';
6
+ import { DefaultStreamChatGenerics, StreamMessage, ThreadHeaderContext } from '../types';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * The `Thread` component represents a [message thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript), it is a container component that displays a thread with a header, [`MessageList`](./MessageListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components.
@@ -9,16 +11,16 @@ import * as i0 from "@angular/core";
9
11
  export declare class ThreadComponent implements OnDestroy {
10
12
  customTemplatesService: CustomTemplatesService;
11
13
  private channelService;
14
+ private chatClientService;
12
15
  private class;
13
16
  parentMessage: StreamMessage | undefined;
17
+ channel: Channel<DefaultStreamChatGenerics> | undefined;
14
18
  private subscriptions;
15
- constructor(customTemplatesService: CustomTemplatesService, channelService: ChannelService);
19
+ constructor(customTemplatesService: CustomTemplatesService, channelService: ChannelService, chatClientService: ChatClientService);
16
20
  ngOnDestroy(): void;
17
21
  getThreadHeaderContext(): ThreadHeaderContext;
18
- getReplyCountParam(parentMessage: StreamMessage | undefined): {
19
- replyCount: number | undefined;
20
- };
21
22
  closeThread(): void;
23
+ get channelName(): string | undefined;
22
24
  static ɵfac: i0.ɵɵFactoryDeclaration<ThreadComponent, never>;
23
- static ɵcmp: i0.ɵɵComponentDeclaration<ThreadComponent, "stream-thread", never, {}, {}, never, ["[name=\"thread-message-list\"]", "[name=\"thread-message-input\"]"]>;
25
+ static ɵcmp: i0.ɵɵComponentDeclaration<ThreadComponent, "stream-thread", never, {}, {}, never, ["*"]>;
24
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "3.6.0",
3
+ "version": "4.0.0-theming-v2.2",
4
4
  "description": "Angular components to create chat conversations or livestream style chat",
5
5
  "author": "GetStream",
6
6
  "homepage": "https://getstream.io/chat/",
@@ -9,16 +9,18 @@
9
9
  "url": "https://github.com/GetStream/stream-chat-angular.git"
10
10
  },
11
11
  "peerDependencies": {
12
- "@angular/common": "^12.2.0 || ^13.0.0",
13
- "@angular/core": "^12.2.0 || ^13.0.0",
12
+ "@angular/common": "^12.2.0 || ^13.0.0 || ^14.0.0",
13
+ "@angular/core": "^12.2.0 || ^13.0.0 || ^14.0.0",
14
14
  "@ngx-translate/core": "^13.0.0 || ^14.0.0",
15
15
  "stream-chat": "^6.4.0"
16
16
  },
17
17
  "dependencies": {
18
18
  "angular-mentions": "^1.4.0",
19
19
  "@stream-io/transliterate": "^1.5.2",
20
+ "@popperjs/core": "^2.11.5",
20
21
  "dayjs": "^1.10.7",
21
22
  "emoji-regex": "^10.0.0",
23
+ "ngx-popperjs": "^12.2.1",
22
24
  "pretty-bytes": "^5.6.0",
23
25
  "tslib": "^2.3.0",
24
26
  "uuidv4": "^6.2.12"
package/public-api.d.ts CHANGED
@@ -38,7 +38,6 @@ export * from './lib/modal/modal.component';
38
38
  export * from './lib/read-by';
39
39
  export * from './lib/is-image-attachment';
40
40
  export * from './lib/is-image-file';
41
- export * from './lib/device-width';
42
41
  export * from './lib/message-preview';
43
42
  export * from './lib/notification.service';
44
43
  export * from './lib/transliteration.service';