stream-chat-angular 3.0.0-beta.7 → 3.0.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.
@@ -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 { EventEmitter, OnChanges, OnDestroy, SimpleChanges, TemplateRef } from '@angular/core';
2
- import { Subscription } from 'rxjs';
2
+ import { Observable, Subscription } from 'rxjs';
3
3
  import { ChannelService } from '../channel.service';
4
4
  import { ChatClientService } from '../chat-client.service';
5
5
  import { CustomTemplatesService } from '../custom-templates.service';
@@ -44,9 +44,10 @@ export declare class MessageActionsBoxComponent implements OnChanges, OnDestroy
44
44
  modalTemplate: TemplateRef<ModalContext> | undefined;
45
45
  subscriptions: Subscription[];
46
46
  visibleMessageActionItems: MessageActionItem[];
47
+ sendMessage$: Observable<void>;
47
48
  private readonly messageActionItems;
48
- private messageInput;
49
49
  private modalContent;
50
+ private sendMessageSubject;
50
51
  constructor(chatClientService: ChatClientService, notificationService: NotificationService, channelService: ChannelService, customTemplatesService: CustomTemplatesService);
51
52
  ngOnChanges(changes: SimpleChanges): void;
52
53
  ngOnDestroy(): void;
@@ -49,6 +49,10 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
49
49
  * The message to edit
50
50
  */
51
51
  message: StreamMessage | undefined;
52
+ /**
53
+ * An observable that can be used to trigger message sending from the outside
54
+ */
55
+ sendMessage$: Observable<void> | undefined;
52
56
  /**
53
57
  * Emits when a message was successfuly sent or updated
54
58
  */
@@ -73,6 +77,7 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
73
77
  private isViewInited;
74
78
  private appSettings;
75
79
  private channel;
80
+ private sendMessageSubcription;
76
81
  constructor(channelService: ChannelService, notificationService: NotificationService, attachmentService: AttachmentService, configService: MessageInputConfigService, textareaType: Type<TextareaInterface>, componentFactoryResolver: ComponentFactoryResolver, cdRef: ChangeDetectorRef, chatClient: ChatClientService, emojiInputService: EmojiInputService, customTemplatesService: CustomTemplatesService);
77
82
  ngOnInit(): void;
78
83
  ngAfterViewInit(): void;
@@ -116,5 +121,5 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
116
121
  private startCooldown;
117
122
  private stopCooldown;
118
123
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputComponent, never>;
119
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "stream-message-input", never, { "isFileUploadEnabled": "isFileUploadEnabled"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "mode": "mode"; "isMultipleFileUploadEnabled": "isMultipleFileUploadEnabled"; "message": "message"; }, { "messageUpdate": "messageUpdate"; }, never, never>;
124
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "stream-message-input", never, { "isFileUploadEnabled": "isFileUploadEnabled"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "mode": "mode"; "isMultipleFileUploadEnabled": "isMultipleFileUploadEnabled"; "message": "message"; "sendMessage$": "sendMessage$"; }, { "messageUpdate": "messageUpdate"; }, never, never>;
120
125
  }
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 = {
@@ -86,6 +86,7 @@ export declare type MessageInputContext = {
86
86
  isMultipleFileUploadEnabled: boolean | undefined;
87
87
  message: StreamMessage | undefined;
88
88
  messageUpdateHandler: Function | undefined;
89
+ sendMessage$: Observable<void>;
89
90
  };
90
91
  export declare type MentionTemplateContext = {
91
92
  content: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "3.0.0-beta.7",
3
+ "version": "3.0.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.2.0"
15
+ "stream-chat": "^6.4.0"
16
16
  },
17
17
  "dependencies": {
18
18
  "angular-mentions": "^1.4.0",