stream-chat-angular 2.7.0 → 2.9.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.
- package/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +137 -46
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/attachment-list/attachment-list.component.js +21 -8
- package/esm2015/lib/attachment-preview-list/attachment-preview-list.component.js +2 -2
- package/esm2015/lib/channel.service.js +20 -2
- package/esm2015/lib/chat-client.service.js +1 -1
- package/esm2015/lib/message/message.component.js +2 -2
- package/esm2015/lib/message-actions-box/message-actions-box.component.js +2 -2
- package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +35 -9
- package/esm2015/lib/message-input/message-input-config.service.js +1 -1
- package/esm2015/lib/message-input/message-input.component.js +10 -2
- package/esm2015/lib/message-input/textarea.directive.js +10 -2
- package/esm2015/lib/message-input/textarea.interface.js +1 -1
- package/esm2015/lib/message-list/message-list.component.js +7 -1
- package/esm2015/lib/types.js +1 -1
- package/fesm2015/stream-chat-angular.js +107 -29
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/attachment-list/attachment-list.component.d.ts +8 -3
- package/lib/attachment.service.d.ts +1 -1
- package/lib/channel.service.d.ts +2 -1
- package/lib/chat-client.service.d.ts +3 -3
- package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +7 -4
- package/lib/message-input/message-input-config.service.d.ts +2 -1
- package/lib/message-input/message-input.component.d.ts +3 -2
- package/lib/message-input/textarea.directive.d.ts +4 -3
- package/lib/message-input/textarea.interface.d.ts +2 -1
- package/lib/message-preview.d.ts +1 -1
- package/lib/read-by.d.ts +1 -1
- package/lib/types.d.ts +7 -1
- package/package.json +3 -3
- package/src/assets/version.ts +1 -1
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { OnChanges } from '@angular/core';
|
|
2
|
-
import { Attachment } from 'stream-chat';
|
|
2
|
+
import { Action, Attachment } from 'stream-chat';
|
|
3
3
|
import { ImageLoadService } from '../message-list/image-load.service';
|
|
4
4
|
import { DefaultAttachmentType } from '../types';
|
|
5
|
+
import { ChannelService } from '../channel.service';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class AttachmentListComponent implements OnChanges {
|
|
7
8
|
private imageLoadService;
|
|
9
|
+
private channelService;
|
|
10
|
+
messageId: string | undefined;
|
|
8
11
|
attachments: Attachment<DefaultAttachmentType>[];
|
|
9
12
|
orderedAttachments: Attachment<DefaultAttachmentType>[];
|
|
10
|
-
constructor(imageLoadService: ImageLoadService);
|
|
13
|
+
constructor(imageLoadService: ImageLoadService, channelService: ChannelService);
|
|
11
14
|
ngOnChanges(): void;
|
|
12
15
|
trackById(index: number): number;
|
|
13
16
|
isImage(attachment: Attachment): boolean;
|
|
@@ -17,6 +20,8 @@ export declare class AttachmentListComponent implements OnChanges {
|
|
|
17
20
|
hasFileSize(attachment: Attachment<DefaultAttachmentType>): boolean | 0 | undefined;
|
|
18
21
|
getFileSize(attachment: Attachment<DefaultAttachmentType>): string;
|
|
19
22
|
trimUrl(url?: string | null): string | null;
|
|
23
|
+
sendAction(action: Action): void;
|
|
24
|
+
trackByActionValue(_: number, item: Action): string | undefined;
|
|
20
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentListComponent, never>;
|
|
21
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AttachmentListComponent, "stream-attachment-list", never, { "attachments": "attachments"; }, {}, never, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AttachmentListComponent, "stream-attachment-list", never, { "messageId": "messageId"; "attachments": "attachments"; }, {}, never, never>;
|
|
22
27
|
}
|
|
@@ -16,7 +16,7 @@ export declare class AttachmentService {
|
|
|
16
16
|
filesSelected(fileList: FileList | null): Promise<void>;
|
|
17
17
|
retryAttachmentUpload(file: File): Promise<void>;
|
|
18
18
|
deleteAttachment(upload: AttachmentUpload): Promise<void>;
|
|
19
|
-
mapToAttachments(): Attachment<import("stream-chat").
|
|
19
|
+
mapToAttachments(): Attachment<import("stream-chat").UR>[];
|
|
20
20
|
createFromAttachments(attachments: Attachment[]): void;
|
|
21
21
|
private createPreview;
|
|
22
22
|
private uploadAttachments;
|
package/lib/channel.service.d.ts
CHANGED
|
@@ -44,7 +44,8 @@ export declare class ChannelService {
|
|
|
44
44
|
deleteMessage(message: StreamMessage): Promise<void>;
|
|
45
45
|
uploadAttachments(uploads: AttachmentUpload[]): Promise<AttachmentUpload[]>;
|
|
46
46
|
deleteAttachment(attachmentUpload: AttachmentUpload): Promise<void>;
|
|
47
|
-
autocompleteMembers(searchTerm: string): Promise<import("stream-chat").ChannelMemberResponse<import("stream-chat").
|
|
47
|
+
autocompleteMembers(searchTerm: string): Promise<import("stream-chat").ChannelMemberResponse<import("stream-chat").UR>[]>;
|
|
48
|
+
sendAction(messageId: string, formData: Record<string, string>): Promise<void>;
|
|
48
49
|
private sendMessageRequest;
|
|
49
50
|
private handleNotification;
|
|
50
51
|
private handleRemovedFromChannelNotification;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgZone } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { OwnUserResponse } from 'stream-chat';
|
|
3
|
+
import { OwnUserResponse, UserResponse } from 'stream-chat';
|
|
4
4
|
import { AppSettings, Event, StreamChat, TokenOrProvider } from 'stream-chat';
|
|
5
5
|
import { NotificationService } from './notification.service';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
@@ -19,10 +19,10 @@ export declare class ChatClientService {
|
|
|
19
19
|
private connectionStateSubject;
|
|
20
20
|
private appSettingsSubject;
|
|
21
21
|
constructor(ngZone: NgZone, notificationService: NotificationService);
|
|
22
|
-
init(apiKey: string, userOrId: string | OwnUserResponse, userTokenOrProvider: TokenOrProvider): Promise<void>;
|
|
22
|
+
init(apiKey: string, userOrId: string | OwnUserResponse | UserResponse, userTokenOrProvider: TokenOrProvider): Promise<void>;
|
|
23
23
|
getAppSettings(): Promise<void>;
|
|
24
24
|
flagMessage(messageId: string): Promise<void>;
|
|
25
|
-
autocompleteUsers(searchTerm: string): Promise<
|
|
25
|
+
autocompleteUsers(searchTerm: string): Promise<UserResponse<import("stream-chat").UR>[]>;
|
|
26
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatClientService, never>;
|
|
27
27
|
static ɵprov: i0.ɵɵInjectableDeclaration<ChatClientService>;
|
|
28
28
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
|
|
2
2
|
import { MentionConfig } from 'angular-mentions';
|
|
3
|
-
import { MentionAutcompleteListItemContext, MentionAutcompleteListItem } from '../../types';
|
|
3
|
+
import { MentionAutcompleteListItemContext, MentionAutcompleteListItem, CommandAutocompleteListItemContext } from '../../types';
|
|
4
4
|
import { UserResponse } from 'stream-chat';
|
|
5
5
|
import { ChannelService } from '../../channel.service';
|
|
6
6
|
import { TextareaInterface } from '../textarea.interface';
|
|
@@ -15,17 +15,20 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
|
|
|
15
15
|
value: string;
|
|
16
16
|
areMentionsEnabled: boolean | undefined;
|
|
17
17
|
mentionAutocompleteItemTemplate: TemplateRef<MentionAutcompleteListItemContext> | undefined;
|
|
18
|
+
commandAutocompleteItemTemplate: TemplateRef<CommandAutocompleteListItemContext> | undefined;
|
|
18
19
|
mentionScope: 'channel' | 'application';
|
|
19
20
|
readonly valueChange: EventEmitter<string>;
|
|
20
21
|
readonly send: EventEmitter<void>;
|
|
21
|
-
readonly userMentions: EventEmitter<UserResponse<import("stream-chat").
|
|
22
|
-
private readonly
|
|
22
|
+
readonly userMentions: EventEmitter<UserResponse<import("stream-chat").UR>[]>;
|
|
23
|
+
private readonly autocompleteKey;
|
|
23
24
|
private readonly mentionTriggerChar;
|
|
25
|
+
private readonly commandTriggerChar;
|
|
24
26
|
autocompleteConfig: MentionConfig;
|
|
25
27
|
private messageInput;
|
|
26
28
|
private subscriptions;
|
|
27
29
|
private mentionedUsers;
|
|
28
30
|
private userMentionConfig;
|
|
31
|
+
private slashCommandConfig;
|
|
29
32
|
private searchTerm$;
|
|
30
33
|
constructor(channelService: ChannelService, chatClientService: ChatClientService, transliterationService: TransliterationService);
|
|
31
34
|
ngOnChanges(changes: SimpleChanges): void;
|
|
@@ -43,5 +46,5 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
|
|
|
43
46
|
private updateMentionOptions;
|
|
44
47
|
private updateMentionedUsersFromText;
|
|
45
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<AutocompleteTextareaComponent, never>;
|
|
46
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AutocompleteTextareaComponent, "stream-autocomplete-textarea", never, { "value": "value"; "areMentionsEnabled": "areMentionsEnabled"; "mentionAutocompleteItemTemplate": "mentionAutocompleteItemTemplate"; "mentionScope": "mentionScope"; }, { "valueChange": "valueChange"; "send": "send"; "userMentions": "userMentions"; }, never, never>;
|
|
49
|
+
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>;
|
|
47
50
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { TemplateRef } from '@angular/core';
|
|
2
|
-
import { MentionAutcompleteListItemContext } from '../types';
|
|
2
|
+
import { CommandAutocompleteListItemContext, MentionAutcompleteListItemContext } from '../types';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class MessageInputConfigService {
|
|
5
5
|
isFileUploadEnabled: boolean | undefined;
|
|
6
6
|
areMentionsEnabled: boolean | undefined;
|
|
7
7
|
mentionAutocompleteItemTemplate: TemplateRef<MentionAutcompleteListItemContext> | undefined;
|
|
8
|
+
commandAutocompleteItemTemplate: TemplateRef<CommandAutocompleteListItemContext> | undefined;
|
|
8
9
|
/**
|
|
9
10
|
* @deprecated https://getstream.io/chat/docs/sdk/angular/services/message-input-config/#overview
|
|
10
11
|
*/
|
|
@@ -5,7 +5,7 @@ import { UserResponse } from 'stream-chat';
|
|
|
5
5
|
import { AttachmentService } from '../attachment.service';
|
|
6
6
|
import { ChannelService } from '../channel.service';
|
|
7
7
|
import { NotificationService } from '../notification.service';
|
|
8
|
-
import { AttachmentUpload, MentionAutcompleteListItemContext, StreamMessage } from '../types';
|
|
8
|
+
import { AttachmentUpload, CommandAutocompleteListItemContext, MentionAutcompleteListItemContext, StreamMessage } from '../types';
|
|
9
9
|
import { MessageInputConfigService } from './message-input-config.service';
|
|
10
10
|
import { TextareaInterface } from './textarea.interface';
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
@@ -22,6 +22,7 @@ export declare class MessageInputComponent implements OnChanges, OnDestroy, Afte
|
|
|
22
22
|
areMentionsEnabled: boolean | undefined;
|
|
23
23
|
mentionScope: 'channel' | 'application' | undefined;
|
|
24
24
|
mentionAutocompleteItemTemplate: TemplateRef<MentionAutcompleteListItemContext> | undefined;
|
|
25
|
+
commandAutocompleteItemTemplate: TemplateRef<CommandAutocompleteListItemContext> | undefined;
|
|
25
26
|
/**
|
|
26
27
|
* @deprecated https://getstream.io/chat/docs/sdk/angular/components/message-input/#caution-acceptedfiletypes
|
|
27
28
|
*/
|
|
@@ -55,5 +56,5 @@ export declare class MessageInputComponent implements OnChanges, OnDestroy, Afte
|
|
|
55
56
|
private initTextarea;
|
|
56
57
|
private areAttachemntsValid;
|
|
57
58
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputComponent, never>;
|
|
58
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "stream-message-input", never, { "isFileUploadEnabled": "isFileUploadEnabled"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "mentionAutocompleteItemTemplate": "mentionAutocompleteItemTemplate"; "acceptedFileTypes": "acceptedFileTypes"; "isMultipleFileUploadEnabled": "isMultipleFileUploadEnabled"; "message": "message"; }, { "messageUpdate": "messageUpdate"; }, never, never>;
|
|
59
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "stream-message-input", never, { "isFileUploadEnabled": "isFileUploadEnabled"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "mentionAutocompleteItemTemplate": "mentionAutocompleteItemTemplate"; "commandAutocompleteItemTemplate": "commandAutocompleteItemTemplate"; "acceptedFileTypes": "acceptedFileTypes"; "isMultipleFileUploadEnabled": "isMultipleFileUploadEnabled"; "message": "message"; }, { "messageUpdate": "messageUpdate"; }, never, never>;
|
|
59
60
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentRef, EventEmitter, OnChanges, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
2
2
|
import { UserResponse } from 'stream-chat';
|
|
3
|
-
import { MentionAutcompleteListItemContext } from '../types';
|
|
3
|
+
import { CommandAutocompleteListItemContext, MentionAutcompleteListItemContext } from '../types';
|
|
4
4
|
import { TextareaInterface } from './textarea.interface';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class TextareaDirective implements OnChanges {
|
|
@@ -9,14 +9,15 @@ export declare class TextareaDirective implements OnChanges {
|
|
|
9
9
|
areMentionsEnabled: boolean | undefined;
|
|
10
10
|
mentionAutocompleteItemTemplate: TemplateRef<MentionAutcompleteListItemContext> | undefined;
|
|
11
11
|
mentionScope?: 'channel' | 'application';
|
|
12
|
+
commandAutocompleteItemTemplate: TemplateRef<CommandAutocompleteListItemContext> | undefined;
|
|
12
13
|
value: string;
|
|
13
14
|
readonly valueChange: EventEmitter<string>;
|
|
14
15
|
readonly send: EventEmitter<void>;
|
|
15
|
-
readonly userMentions: EventEmitter<UserResponse<import("stream-chat").
|
|
16
|
+
readonly userMentions: EventEmitter<UserResponse<import("stream-chat").UR>[]>;
|
|
16
17
|
private subscriptions;
|
|
17
18
|
private unpropagatedChanges;
|
|
18
19
|
constructor(viewContainerRef: ViewContainerRef);
|
|
19
20
|
ngOnChanges(changes: SimpleChanges): void;
|
|
20
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<TextareaDirective, never>;
|
|
21
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TextareaDirective, "[streamTextarea]", never, { "componentRef": "componentRef"; "areMentionsEnabled": "areMentionsEnabled"; "mentionAutocompleteItemTemplate": "mentionAutocompleteItemTemplate"; "mentionScope": "mentionScope"; "value": "value"; }, { "valueChange": "valueChange"; "send": "send"; "userMentions": "userMentions"; }, never>;
|
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TextareaDirective, "[streamTextarea]", never, { "componentRef": "componentRef"; "areMentionsEnabled": "areMentionsEnabled"; "mentionAutocompleteItemTemplate": "mentionAutocompleteItemTemplate"; "mentionScope": "mentionScope"; "commandAutocompleteItemTemplate": "commandAutocompleteItemTemplate"; "value": "value"; }, { "valueChange": "valueChange"; "send": "send"; "userMentions": "userMentions"; }, never>;
|
|
22
23
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, OnChanges, TemplateRef } from '@angular/core';
|
|
2
2
|
import { UserResponse } from 'stream-chat';
|
|
3
|
-
import { MentionAutcompleteListItemContext } from '../types';
|
|
3
|
+
import { CommandAutocompleteListItemContext, MentionAutcompleteListItemContext } from '../types';
|
|
4
4
|
export interface TextareaInterface extends OnChanges {
|
|
5
5
|
value: string;
|
|
6
6
|
valueChange: EventEmitter<string>;
|
|
@@ -8,5 +8,6 @@ export interface TextareaInterface extends OnChanges {
|
|
|
8
8
|
userMentions?: EventEmitter<UserResponse[]>;
|
|
9
9
|
areMentionsEnabled?: boolean;
|
|
10
10
|
mentionAutocompleteItemTemplate?: TemplateRef<MentionAutcompleteListItemContext> | undefined;
|
|
11
|
+
commandAutocompleteItemTemplate?: TemplateRef<CommandAutocompleteListItemContext> | undefined;
|
|
11
12
|
mentionScope?: 'channel' | 'application';
|
|
12
13
|
}
|
package/lib/message-preview.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Attachment, MessageResponse, UserResponse } from 'stream-chat';
|
|
2
|
-
export declare const createMessagePreview: (user: UserResponse, text: string, attachments: Attachment[], mentionedUsers: UserResponse[]) => MessageResponse<import("stream-chat").
|
|
2
|
+
export declare const createMessagePreview: (user: UserResponse, text: string, attachments: Attachment[], mentionedUsers: UserResponse[]) => MessageResponse<import("stream-chat").UR, import("stream-chat").UR, import("stream-chat").LiteralStringForUnion, import("stream-chat").UR, import("stream-chat").UR, import("stream-chat").UR>;
|
package/lib/read-by.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Channel, FormatMessageResponse, UserResponse } from 'stream-chat';
|
|
2
|
-
export declare const getReadBy: (message: FormatMessageResponse, channel: Channel) => UserResponse<import("stream-chat").
|
|
2
|
+
export declare const getReadBy: (message: FormatMessageResponse, channel: Channel) => UserResponse<import("stream-chat").UR>[];
|
package/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChannelMemberResponse, Event, FormatMessageResponse, LiteralStringForUnion, Mute, UserResponse } from 'stream-chat';
|
|
1
|
+
import type { ChannelMemberResponse, CommandResponse, Event, FormatMessageResponse, LiteralStringForUnion, Mute, UserResponse } from 'stream-chat';
|
|
2
2
|
export declare type UnknownType = Record<string, unknown>;
|
|
3
3
|
export declare type CustomTrigger = {
|
|
4
4
|
[key: string]: {
|
|
@@ -50,6 +50,12 @@ export declare type AttachmentUpload = {
|
|
|
50
50
|
export declare type MentionAutcompleteListItemContext = {
|
|
51
51
|
item: MentionAutcompleteListItem;
|
|
52
52
|
};
|
|
53
|
+
export declare type CommandAutocompleteListItemContext = {
|
|
54
|
+
item: ComandAutocompleteListItem;
|
|
55
|
+
};
|
|
53
56
|
export declare type MentionAutcompleteListItem = (ChannelMemberResponse | UserResponse) & {
|
|
54
57
|
autocompleteLabel: string;
|
|
55
58
|
};
|
|
59
|
+
export declare type ComandAutocompleteListItem = CommandResponse & {
|
|
60
|
+
autocompleteLabel: string;
|
|
61
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-angular",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.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,9 +12,9 @@
|
|
|
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": "
|
|
15
|
+
"stream-chat": ">=4.3.0",
|
|
16
16
|
"stream-chat-css": "1.0.23",
|
|
17
|
-
"@stream-io/stream-chat-css": "
|
|
17
|
+
"@stream-io/stream-chat-css": "2.0.1"
|
|
18
18
|
},
|
|
19
19
|
"peerDependenciesMeta": {
|
|
20
20
|
"stream-chat-css": {
|
package/src/assets/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.
|
|
1
|
+
export const version = '2.9.0';
|