stream-chat-angular 3.0.0-beta.9 → 3.1.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 (35) hide show
  1. package/README.md +44 -12
  2. package/assets/version.d.ts +1 -1
  3. package/bundles/stream-chat-angular.umd.js +188 -96
  4. package/bundles/stream-chat-angular.umd.js.map +1 -1
  5. package/esm2015/assets/version.js +2 -2
  6. package/esm2015/lib/attachment-list/attachment-list.component.js +9 -2
  7. package/esm2015/lib/attachment-preview-list/attachment-preview-list.component.js +2 -2
  8. package/esm2015/lib/attachment.service.js +10 -1
  9. package/esm2015/lib/channel.service.js +42 -17
  10. package/esm2015/lib/icon/icon.component.js +2 -2
  11. package/esm2015/lib/message/message.component.js +7 -2
  12. package/esm2015/lib/message-input/message-input.component.js +8 -3
  13. package/esm2015/lib/message-list/message-list.component.js +87 -43
  14. package/esm2015/lib/types.js +1 -1
  15. package/fesm2015/stream-chat-angular.js +169 -75
  16. package/fesm2015/stream-chat-angular.js.map +1 -1
  17. package/lib/attachment-list/attachment-list.component.d.ts +1 -0
  18. package/lib/channel.service.d.ts +28 -2
  19. package/lib/icon/icon.component.d.ts +1 -1
  20. package/lib/message-list/message-list.component.d.ts +9 -2
  21. package/lib/types.d.ts +1 -1
  22. package/package.json +2 -2
  23. package/src/assets/styles/css/index.css +1 -1
  24. package/src/assets/styles/css/index.css.map +1 -1
  25. package/src/assets/styles/scss/ActionsBox.scss +2 -2
  26. package/src/assets/styles/scss/ChannelList.scss +6 -0
  27. package/src/assets/styles/scss/ChannelSearch.scss +12 -1
  28. package/src/assets/styles/scss/Message.scss +104 -93
  29. package/src/assets/styles/scss/MessageInput.scss +8 -2
  30. package/src/assets/styles/scss/MessageInputFlat.scss +6 -0
  31. package/src/assets/styles/scss/MessageNotification.scss +6 -18
  32. package/src/assets/styles/scss/Thread.scss +25 -5
  33. package/src/assets/styles/scss/VirtualMessage.scss +1 -0
  34. package/src/assets/styles/scss/_base.scss +4 -0
  35. package/src/assets/version.ts +1 -1
@@ -30,6 +30,7 @@ export declare class AttachmentListComponent implements OnChanges {
30
30
  isImage(attachment: Attachment): boolean;
31
31
  isFile(attachment: Attachment): boolean;
32
32
  isGallery(attachment: Attachment): boolean;
33
+ isVideo(attachment: Attachment): boolean | "" | undefined;
33
34
  isCard(attachment: Attachment): boolean;
34
35
  imageLoaded(): void;
35
36
  hasFileSize(attachment: Attachment<DefaultStreamChatGenerics>): boolean | "" | 0 | undefined;
@@ -5,7 +5,7 @@ import { ChatClientService, ClientEvent } from './chat-client.service';
5
5
  import { AttachmentUpload, DefaultStreamChatGenerics, MessageReactionType, StreamMessage } from './types';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
- * The `ChannelService` provides data and interaction for the channel list and message list. TEST
8
+ * The `ChannelService` provides data and interaction for the channel list and message list.
9
9
  */
10
10
  export declare class ChannelService<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> {
11
11
  private chatClientService;
@@ -118,6 +118,26 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
118
118
  * Custom event handler to call if a new message received from a channel that is being watched, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)
119
119
  */
120
120
  customNewMessageHandler?: (event: Event, channel: Channel<T>, channelListSetter: (channels: (Channel<T> | ChannelResponse<T>)[]) => void, messageListSetter: (messages: StreamMessage<T>[]) => void, threadListSetter: (messages: StreamMessage<T>[]) => void, parentMessageSetter: (message: StreamMessage<T> | undefined) => void) => void;
121
+ /**
122
+ * You can override the default file upload request - you can use this to upload files to your own CDN
123
+ */
124
+ customFileUploadRequest?: (file: File, channel: Channel<T>) => Promise<{
125
+ file: string;
126
+ }>;
127
+ /**
128
+ * You can override the default image upload request - you can use this to upload images to your own CDN
129
+ */
130
+ customImageUploadRequest?: (file: File, channel: Channel<T>) => Promise<{
131
+ file: string;
132
+ }>;
133
+ /**
134
+ * You can override the default file delete request - override this if you use your own CDN
135
+ */
136
+ customFileDeleteRequest?: (url: string, channel: Channel<T>) => Promise<void>;
137
+ /**
138
+ * You can override the default image delete request - override this if you use your own CDN
139
+ */
140
+ customImageDeleteRequest?: (url: string, channel: Channel<T>) => Promise<void>;
121
141
  private channelsSubject;
122
142
  private activeChannelSubject;
123
143
  private activeChannelMessagesSubject;
@@ -143,6 +163,10 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
143
163
  * @param channel
144
164
  */
145
165
  setAsActiveChannel(channel: Channel<T>): void;
166
+ /**
167
+ * Deselects the currently active (if any) channel
168
+ */
169
+ deselectActiveChannel(): void;
146
170
  /**
147
171
  * Sets the given `message` as an active parent message. If `undefined` is provided, it will deleselect the current parent message.
148
172
  * @param message
@@ -161,8 +185,10 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
161
185
  * @param filters
162
186
  * @param sort
163
187
  * @param options
188
+ * @param shouldSetActiveChannel Decides if the first channel in the result should be made as an active channel, or no channel should be marked as active
189
+ * @returns the list of channels found by the query
164
190
  */
165
- init(filters: ChannelFilters<T>, sort?: ChannelSort<T>, options?: ChannelOptions): Promise<void>;
191
+ init(filters: ChannelFilters<T>, sort?: ChannelSort<T>, options?: ChannelOptions, shouldSetActiveChannel?: boolean): Promise<Channel<T>[]>;
166
192
  /**
167
193
  * Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./ChatClientService.mdx/#disconnectuser).
168
194
  */
@@ -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';
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';
3
3
  /**
4
4
  * The `Icon` component can be used to display different icons (i. e. message delivered icon).
5
5
  */
@@ -20,13 +20,17 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
20
20
  * Determines if the message list should display channel messages or [thread messages](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
21
21
  */
22
22
  mode: 'main' | 'thread';
23
+ /**
24
+ * The direction of the messages in the list, `bottom-to-top` means newest message is at the bottom of the message list and users scroll upwards to load older messages
25
+ */
26
+ direction: 'bottom-to-top' | 'top-to-bottom';
23
27
  typingIndicatorTemplate: TemplateRef<TypingIndicatorContext> | undefined;
24
28
  messageTemplate: TemplateRef<MessageContext> | undefined;
25
29
  messages$: Observable<StreamMessage[]>;
26
30
  enabledMessageActions: string[];
27
31
  private class;
28
32
  unreadMessageCount: number;
29
- isUserScrolledUp: boolean | undefined;
33
+ isUserScrolled: boolean | undefined;
30
34
  groupStyles: GroupStyle[];
31
35
  lastSentMessageId: string | undefined;
32
36
  parentMessage: StreamMessage | undefined;
@@ -50,14 +54,17 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
50
54
  ngOnDestroy(): void;
51
55
  trackByMessageId(index: number, item: StreamMessage): string;
52
56
  trackByUserId(index: number, user: UserResponse): string;
57
+ scrollToLatestMessage(): void;
53
58
  scrollToBottom(): void;
59
+ scrollToTop(): void;
54
60
  scrolled(): void;
55
61
  getTypingIndicatorContext(): TypingIndicatorContext;
56
62
  getMessageContext(message: StreamMessage): MessageContext;
57
63
  private preserveScrollbarPosition;
64
+ private shouldLoadMoreMessages;
58
65
  private setMessages$;
59
66
  private resetScrollState;
60
67
  private get usersTyping$();
61
68
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageListComponent, never>;
62
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageListComponent, "stream-message-list", never, { "mode": "mode"; }, {}, never, never>;
69
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageListComponent, "stream-message-list", never, { "mode": "mode"; "direction": "direction"; }, {}, never, never>;
63
70
  }
package/lib/types.d.ts CHANGED
@@ -50,7 +50,7 @@ export declare type AttachmentUpload = {
50
50
  file: File;
51
51
  state: 'error' | 'success' | 'uploading';
52
52
  url?: string;
53
- type: 'image' | 'file';
53
+ type: 'image' | 'file' | 'video';
54
54
  previewUri?: string | ArrayBuffer;
55
55
  };
56
56
  export declare type MentionAutcompleteListItemContext = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "3.0.0-beta.9",
3
+ "version": "3.1.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/",
@@ -12,7 +12,7 @@
12
12
  "@angular/common": "^12.2.0 || ^13.0.0",
13
13
  "@angular/core": "^12.2.0 || ^13.0.0",
14
14
  "@ngx-translate/core": "^13.0.0 || ^14.0.0",
15
- "stream-chat": "^6.3.0"
15
+ "stream-chat": "^6.4.0"
16
16
  },
17
17
  "dependencies": {
18
18
  "angular-mentions": "^1.4.0",