stream-chat-angular 3.0.0-beta.2 → 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.
- package/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +499 -275
- 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 +27 -15
- package/esm2015/lib/attachment-preview-list/attachment-preview-list.component.js +28 -22
- package/esm2015/lib/avatar-placeholder/avatar-placeholder.component.js +41 -0
- package/esm2015/lib/channel-header/channel-header.component.js +4 -4
- package/esm2015/lib/channel-list/channel-list.component.js +4 -4
- package/esm2015/lib/channel-preview/channel-preview.component.js +3 -3
- package/esm2015/lib/channel.service.js +1 -1
- package/esm2015/lib/custom-templates.service.js +45 -1
- package/esm2015/lib/icon-placeholder/icon-placeholder.component.js +34 -0
- package/esm2015/lib/loading-indicator-placeholder/loading-indicator-placeholder.component.js +42 -0
- package/esm2015/lib/message/message.component.js +49 -8
- package/esm2015/lib/message-actions-box/message-actions-box.component.js +98 -86
- package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +3 -3
- package/esm2015/lib/message-input/message-input.component.js +21 -4
- package/esm2015/lib/message-list/message-list.component.js +3 -3
- package/esm2015/lib/message-reactions/message-reactions.component.js +3 -3
- package/esm2015/lib/modal/modal.component.js +9 -6
- package/esm2015/lib/notification/notification.component.js +5 -2
- package/esm2015/lib/notification-list/notification-list.component.js +12 -10
- package/esm2015/lib/stream-avatar.module.js +5 -4
- package/esm2015/lib/stream-chat.module.js +13 -3
- package/esm2015/lib/thread/thread.component.js +19 -11
- package/esm2015/lib/types.js +1 -1
- package/esm2015/public-api.js +4 -1
- package/fesm2015/stream-chat-angular.js +453 -199
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/attachment-list/attachment-list.component.d.ts +7 -3
- package/lib/attachment-preview-list/attachment-preview-list.component.d.ts +17 -7
- package/lib/avatar-placeholder/avatar-placeholder.component.d.ts +25 -0
- package/lib/channel.service.d.ts +1 -2
- package/lib/custom-templates.service.d.ts +45 -1
- package/lib/icon-placeholder/icon-placeholder.component.d.ts +22 -0
- package/lib/loading-indicator-placeholder/loading-indicator-placeholder.component.d.ts +21 -0
- package/lib/message/message.component.d.ts +12 -4
- package/lib/message-actions-box/message-actions-box.component.d.ts +9 -13
- package/lib/message-input/message-input.component.d.ts +5 -1
- package/lib/message-reactions/message-reactions.component.d.ts +1 -2
- package/lib/modal/modal.component.d.ts +7 -3
- package/lib/notification/notification.component.d.ts +6 -1
- package/lib/notification-list/notification-list.component.d.ts +4 -2
- package/lib/stream-avatar.module.d.ts +4 -3
- package/lib/stream-chat.module.d.ts +6 -4
- package/lib/thread/thread.component.d.ts +6 -3
- package/lib/types.d.ts +67 -1
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
- 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
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+
}
|
package/lib/channel.service.d.ts
CHANGED
|
@@ -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 './
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TemplateRef } from '@angular/core';
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
|
-
import { ChannelActionsContext, ChannelPreviewContext, CommandAutocompleteListItemContext, EmojiPickerContext, MentionAutcompleteListItemContext, MentionTemplateContext, MessageContext, MessageInputContext, TypingIndicatorContext } from './types';
|
|
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
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
6
6
|
* A central location for registering your custom templates to override parts of the chat application
|
|
@@ -42,6 +42,50 @@ export declare class CustomTemplatesService {
|
|
|
42
42
|
* The template for channel actions
|
|
43
43
|
*/
|
|
44
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>;
|
|
45
89
|
constructor();
|
|
46
90
|
static ɵfac: i0.ɵɵFactoryDeclaration<CustomTemplatesService, never>;
|
|
47
91
|
static ɵprov: i0.ɵɵInjectableDeclaration<CustomTemplatesService>;
|
|
@@ -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,8 @@
|
|
|
1
|
-
import { TemplateRef, OnChanges, SimpleChanges, OnDestroy } 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, MentionTemplateContext, StreamMessage } from '../types';
|
|
5
|
+
import { AttachmentListContext, DefaultUserType, MentionTemplateContext, MessageActionsBoxContext, MessageReactionsContext, StreamMessage } from '../types';
|
|
6
6
|
import { CustomTemplatesService } from '../custom-templates.service';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
declare type MessagePart = {
|
|
@@ -13,10 +13,11 @@ declare type MessagePart = {
|
|
|
13
13
|
/**
|
|
14
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).
|
|
15
15
|
*/
|
|
16
|
-
export declare class MessageComponent implements OnChanges, OnDestroy {
|
|
16
|
+
export declare class MessageComponent implements OnInit, OnChanges, OnDestroy {
|
|
17
17
|
private chatClientService;
|
|
18
18
|
private channelService;
|
|
19
19
|
private customTemplatesService;
|
|
20
|
+
private cdRef;
|
|
20
21
|
/**
|
|
21
22
|
* The message to be displayed
|
|
22
23
|
*/
|
|
@@ -42,10 +43,14 @@ export declare class MessageComponent implements OnChanges, OnDestroy {
|
|
|
42
43
|
visibleMessageActionsCount: number;
|
|
43
44
|
messageTextParts: MessagePart[];
|
|
44
45
|
mentionTemplate: TemplateRef<MentionTemplateContext> | undefined;
|
|
46
|
+
attachmentListTemplate: TemplateRef<AttachmentListContext> | undefined;
|
|
47
|
+
messageActionsBoxTemplate: TemplateRef<MessageActionsBoxContext> | undefined;
|
|
48
|
+
messageReactionsTemplate: TemplateRef<MessageReactionsContext> | undefined;
|
|
45
49
|
private user;
|
|
46
50
|
private subscriptions;
|
|
47
51
|
private container;
|
|
48
|
-
constructor(chatClientService: ChatClientService, channelService: ChannelService, customTemplatesService: CustomTemplatesService);
|
|
52
|
+
constructor(chatClientService: ChatClientService, channelService: ChannelService, customTemplatesService: CustomTemplatesService, cdRef: ChangeDetectorRef);
|
|
53
|
+
ngOnInit(): void;
|
|
49
54
|
ngOnChanges(changes: SimpleChanges): void;
|
|
50
55
|
ngOnDestroy(): void;
|
|
51
56
|
get isSentByCurrentUser(): boolean;
|
|
@@ -63,10 +68,13 @@ export declare class MessageComponent implements OnChanges, OnDestroy {
|
|
|
63
68
|
};
|
|
64
69
|
get canDisplayReadStatus(): boolean;
|
|
65
70
|
get quotedMessageAttachments(): import("stream-chat").Attachment<import("../types").DefaultAttachmentType>[];
|
|
71
|
+
getAttachmentListContext(): AttachmentListContext;
|
|
72
|
+
getMessageReactionsContext(): MessageReactionsContext;
|
|
66
73
|
resendMessage(): void;
|
|
67
74
|
textClicked(): void;
|
|
68
75
|
setAsActiveParentMessage(): void;
|
|
69
76
|
getMentionContext(messagePart: MessagePart): MentionTemplateContext;
|
|
77
|
+
getMessageActionsBoxContext(): MessageActionsBoxContext;
|
|
70
78
|
private createMessageParts;
|
|
71
79
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageComponent, never>;
|
|
72
80
|
static ɵcmp: i0.ɵɵComponentDeclaration<MessageComponent, "stream-message", never, { "message": "message"; "enabledMessageActions": "enabledMessageActions"; "isLastSentMessage": "isLastSentMessage"; "mode": "mode"; }, {}, never, never>;
|
|
@@ -4,7 +4,7 @@ import { ChannelService } from '../channel.service';
|
|
|
4
4
|
import { ChatClientService } from '../chat-client.service';
|
|
5
5
|
import { CustomTemplatesService } from '../custom-templates.service';
|
|
6
6
|
import { NotificationService } from '../notification.service';
|
|
7
|
-
import { MessageInputContext, StreamMessage } from '../types';
|
|
7
|
+
import { MessageActionBoxItemContext, MessageActionItem, MessageInputContext, ModalContext, StreamMessage } from '../types';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
/**
|
|
10
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.
|
|
@@ -40,26 +40,22 @@ export declare class MessageActionsBoxComponent implements OnChanges, OnDestroy
|
|
|
40
40
|
readonly isEditing: EventEmitter<boolean>;
|
|
41
41
|
isEditModalOpen: boolean;
|
|
42
42
|
messageInputTemplate: TemplateRef<MessageInputContext> | undefined;
|
|
43
|
+
messageActionItemTemplate: TemplateRef<MessageActionBoxItemContext> | undefined;
|
|
44
|
+
modalTemplate: TemplateRef<ModalContext> | undefined;
|
|
43
45
|
subscriptions: Subscription[];
|
|
46
|
+
visibleMessageActionItems: MessageActionItem[];
|
|
47
|
+
private readonly messageActionItems;
|
|
44
48
|
private messageInput;
|
|
49
|
+
private modalContent;
|
|
45
50
|
constructor(chatClientService: ChatClientService, notificationService: NotificationService, channelService: ChannelService, customTemplatesService: CustomTemplatesService);
|
|
46
51
|
ngOnChanges(changes: SimpleChanges): void;
|
|
47
52
|
ngOnDestroy(): void;
|
|
48
|
-
|
|
49
|
-
get isEditVisible(): boolean;
|
|
50
|
-
get isDeleteVisible(): boolean;
|
|
51
|
-
get isMuteVisible(): boolean;
|
|
52
|
-
get isFlagVisible(): boolean;
|
|
53
|
-
get isPinVisible(): boolean;
|
|
54
|
-
pinClicked(): void;
|
|
55
|
-
flagClicked(): Promise<void>;
|
|
56
|
-
muteClicked(): void;
|
|
57
|
-
quoteClicked(): void;
|
|
58
|
-
editClicked(): void;
|
|
53
|
+
getActionLabel(actionLabelOrTranslationKey: (() => string) | string): string;
|
|
59
54
|
sendClicked(): void;
|
|
60
55
|
modalClosed: () => void;
|
|
61
56
|
getMessageInputContext(): MessageInputContext;
|
|
62
|
-
|
|
57
|
+
getEditModalContext(): ModalContext;
|
|
58
|
+
trackByActionName(_: number, item: MessageActionItem): "mute" | "delete" | "flag" | "quote" | "pin" | "edit";
|
|
63
59
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageActionsBoxComponent, never>;
|
|
64
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>;
|
|
65
61
|
}
|
|
@@ -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, EmojiPickerContext, StreamMessage } from '../types';
|
|
8
|
+
import { AttachmentPreviewListContext, AttachmentUpload, EmojiPickerContext, StreamMessage } from '../types';
|
|
9
9
|
import { MessageInputConfigService } from './message-input-config.service';
|
|
10
10
|
import { TextareaInterface } from './textarea.interface';
|
|
11
11
|
import { EmojiInputService } from './emoji-input.service';
|
|
@@ -65,6 +65,7 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
|
|
|
65
65
|
cooldown$: Observable<number> | undefined;
|
|
66
66
|
isCooldownInProgress: boolean;
|
|
67
67
|
emojiPickerTemplate: TemplateRef<EmojiPickerContext> | undefined;
|
|
68
|
+
attachmentPreviewListTemplate: TemplateRef<AttachmentPreviewListContext> | undefined;
|
|
68
69
|
private fileInput;
|
|
69
70
|
private textareaAnchor;
|
|
70
71
|
private subscriptions;
|
|
@@ -84,6 +85,9 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
|
|
|
84
85
|
filesSelected(fileList: FileList | null): Promise<void>;
|
|
85
86
|
deselectMessageToQuote(): void;
|
|
86
87
|
getEmojiPickerContext(): EmojiPickerContext;
|
|
88
|
+
getAttachmentPreviewListContext(): AttachmentPreviewListContext;
|
|
89
|
+
private deleteUpload;
|
|
90
|
+
private retryUpload;
|
|
87
91
|
private clearFileInput;
|
|
88
92
|
private get isUpdate();
|
|
89
93
|
private initTextarea;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { AfterViewChecked, ChangeDetectorRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { ReactionResponse } from 'stream-chat';
|
|
3
3
|
import { ChannelService } from '../channel.service';
|
|
4
|
-
import { DefaultReactionType, DefaultUserType } from '../types';
|
|
4
|
+
import { DefaultReactionType, DefaultUserType, MessageReactionType } from '../types';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare type MessageReactionType = 'angry' | 'haha' | 'like' | 'love' | 'sad' | 'wow';
|
|
7
6
|
/**
|
|
8
7
|
* 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.
|
|
9
8
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
/**
|
|
4
4
|
* The `Modal` component displays its content in an overlay. The modal can be closed with a close button, if the user clicks outside of the modal content, or if the escape button is pressed. The modal can also be closed from outside.
|
|
@@ -8,11 +8,15 @@ export declare class ModalComponent implements OnChanges {
|
|
|
8
8
|
* If `true` the modal will be displayed, if `false` the modal will be hidden
|
|
9
9
|
*/
|
|
10
10
|
isOpen: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The content of the modal (can also be provided using `ng-content`)
|
|
13
|
+
*/
|
|
14
|
+
content: TemplateRef<void> | undefined;
|
|
11
15
|
/**
|
|
12
16
|
* Emits `true` if the modal becomes visible, and `false` if the modal is closed.
|
|
13
17
|
*/
|
|
14
18
|
readonly isOpenChange: EventEmitter<boolean>;
|
|
15
|
-
private
|
|
19
|
+
private innerContainer;
|
|
16
20
|
constructor();
|
|
17
21
|
ngOnChanges(changes: SimpleChanges): void;
|
|
18
22
|
close(): void;
|
|
@@ -21,5 +25,5 @@ export declare class ModalComponent implements OnChanges {
|
|
|
21
25
|
private watchForOutsideClicks;
|
|
22
26
|
private stopWatchForOutsideClicks;
|
|
23
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent, never>;
|
|
24
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "stream-modal", never, { "isOpen": "isOpen"; }, { "isOpenChange": "isOpenChange"; }, never, ["*"]>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "stream-modal", never, { "isOpen": "isOpen"; "content": "content"; }, { "isOpenChange": "isOpenChange"; }, never, ["*"]>;
|
|
25
29
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
1
2
|
import { NotificationType } from '../types';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
/**
|
|
@@ -8,7 +9,11 @@ export declare class NotificationComponent {
|
|
|
8
9
|
* The type of the notification
|
|
9
10
|
*/
|
|
10
11
|
type: NotificationType | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* The content of the notification (can also be provided using `ng-content`)
|
|
14
|
+
*/
|
|
15
|
+
content: TemplateRef<void> | undefined;
|
|
11
16
|
constructor();
|
|
12
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<NotificationComponent, never>;
|
|
13
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NotificationComponent, "stream-notification", never, { "type": "type"; }, {}, never, ["*"]>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NotificationComponent, "stream-notification", never, { "type": "type"; "content": "content"; }, {}, never, ["*"]>;
|
|
14
19
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { CustomTemplatesService } from '../custom-templates.service';
|
|
2
3
|
import { NotificationService } from '../notification.service';
|
|
3
4
|
import { NotificationPayload } from '../types';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
@@ -6,11 +7,12 @@ import * as i0 from "@angular/core";
|
|
|
6
7
|
* The `NotificationList` component displays the list of active notifications.
|
|
7
8
|
*/
|
|
8
9
|
export declare class NotificationListComponent {
|
|
10
|
+
readonly customTemplatesService: CustomTemplatesService;
|
|
9
11
|
private notificationService;
|
|
10
12
|
notifications$: Observable<NotificationPayload[]>;
|
|
11
|
-
constructor(notificationService: NotificationService);
|
|
13
|
+
constructor(customTemplatesService: CustomTemplatesService, notificationService: NotificationService);
|
|
12
14
|
trackById(_: number, item: NotificationPayload): string;
|
|
13
|
-
|
|
15
|
+
getNotificationContentContext(notification: NotificationPayload): {
|
|
14
16
|
dismissFn: Function;
|
|
15
17
|
};
|
|
16
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<NotificationListComponent, never>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./avatar/avatar.component";
|
|
3
|
-
import * as i2 from "
|
|
4
|
-
import * as i3 from "@
|
|
3
|
+
import * as i2 from "./avatar-placeholder/avatar-placeholder.component";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "@ngx-translate/core";
|
|
5
6
|
export declare class StreamAvatarModule {
|
|
6
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<StreamAvatarModule, never>;
|
|
7
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<StreamAvatarModule, [typeof i1.AvatarComponent], [typeof
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<StreamAvatarModule, [typeof i1.AvatarComponent, typeof i2.AvatarPlaceholderComponent], [typeof i3.CommonModule, typeof i4.TranslateModule], [typeof i1.AvatarComponent, typeof i2.AvatarPlaceholderComponent]>;
|
|
8
9
|
static ɵinj: i0.ɵɵInjectorDeclaration<StreamAvatarModule>;
|
|
9
10
|
}
|
|
@@ -17,11 +17,13 @@ import * as i15 from "./attachment-preview-list/attachment-preview-list.componen
|
|
|
17
17
|
import * as i16 from "./modal/modal.component";
|
|
18
18
|
import * as i17 from "./message-input/textarea.directive";
|
|
19
19
|
import * as i18 from "./thread/thread.component";
|
|
20
|
-
import * as i19 from "
|
|
21
|
-
import * as i20 from "
|
|
22
|
-
import * as i21 from "
|
|
20
|
+
import * as i19 from "./icon-placeholder/icon-placeholder.component";
|
|
21
|
+
import * as i20 from "./loading-indicator-placeholder/loading-indicator-placeholder.component";
|
|
22
|
+
import * as i21 from "@angular/common";
|
|
23
|
+
import * as i22 from "@ngx-translate/core";
|
|
24
|
+
import * as i23 from "./stream-avatar.module";
|
|
23
25
|
export declare class StreamChatModule {
|
|
24
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<StreamChatModule, never>;
|
|
25
|
-
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
|
|
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]>;
|
|
26
28
|
static ɵinj: i0.ɵɵInjectorDeclaration<StreamChatModule>;
|
|
27
29
|
}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { OnDestroy } from '@angular/core';
|
|
2
2
|
import { ChannelService } from '../channel.service';
|
|
3
|
-
import {
|
|
3
|
+
import { CustomTemplatesService } from '../custom-templates.service';
|
|
4
|
+
import { StreamMessage, ThreadHeaderContext } from '../types';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
/**
|
|
6
7
|
* 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.
|
|
7
8
|
*/
|
|
8
9
|
export declare class ThreadComponent implements OnDestroy {
|
|
10
|
+
customTemplatesService: CustomTemplatesService;
|
|
9
11
|
private channelService;
|
|
10
12
|
private class;
|
|
11
13
|
parentMessage: StreamMessage | undefined;
|
|
12
14
|
private subscriptions;
|
|
13
|
-
constructor(channelService: ChannelService);
|
|
15
|
+
constructor(customTemplatesService: CustomTemplatesService, channelService: ChannelService);
|
|
14
16
|
ngOnDestroy(): void;
|
|
15
|
-
|
|
17
|
+
getThreadHeaderContext(): ThreadHeaderContext;
|
|
18
|
+
getReplyCountParam(parentMessage: StreamMessage | undefined): {
|
|
16
19
|
replyCount: number | undefined;
|
|
17
20
|
};
|
|
18
21
|
closeThread(): void;
|
package/lib/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TemplateRef } from '@angular/core';
|
|
2
2
|
import { Observable, Subject } from 'rxjs';
|
|
3
|
-
import type { Attachment, Channel, ChannelMemberResponse, CommandResponse, Event, FormatMessageResponse, LiteralStringForUnion, Mute, UserResponse } from 'stream-chat';
|
|
3
|
+
import type { Attachment, Channel, ChannelMemberResponse, CommandResponse, Event, FormatMessageResponse, LiteralStringForUnion, Mute, ReactionResponse, UserResponse } from 'stream-chat';
|
|
4
|
+
import { Icon } from './icon/icon.component';
|
|
4
5
|
export declare type UnknownType = Record<string, unknown>;
|
|
5
6
|
export declare type CustomTrigger = {
|
|
6
7
|
[key: string]: {
|
|
@@ -98,3 +99,68 @@ export declare type MessageContext = {
|
|
|
98
99
|
export declare type ChannelActionsContext = {
|
|
99
100
|
channel: Channel;
|
|
100
101
|
};
|
|
102
|
+
export declare type AttachmentListContext = {
|
|
103
|
+
messageId: string;
|
|
104
|
+
attachments: Attachment<DefaultAttachmentType>[];
|
|
105
|
+
};
|
|
106
|
+
export declare type AvatarContext = {
|
|
107
|
+
name: string | undefined;
|
|
108
|
+
imageUrl: string | undefined;
|
|
109
|
+
size: number | undefined;
|
|
110
|
+
};
|
|
111
|
+
export declare type AttachmentPreviewListContext = {
|
|
112
|
+
attachmentUploads$: Observable<AttachmentUpload[]> | undefined;
|
|
113
|
+
retryUploadHandler: (f: File) => any;
|
|
114
|
+
deleteUploadHandler: (u: AttachmentUpload) => any;
|
|
115
|
+
};
|
|
116
|
+
export declare type IconContext = {
|
|
117
|
+
icon: Icon | undefined;
|
|
118
|
+
size: number | undefined;
|
|
119
|
+
};
|
|
120
|
+
export declare type LoadingIndicatorContext = {
|
|
121
|
+
size: number | undefined;
|
|
122
|
+
color: string | undefined;
|
|
123
|
+
};
|
|
124
|
+
export declare type MessageActionsBoxContext = {
|
|
125
|
+
isOpen: boolean;
|
|
126
|
+
isMine: boolean;
|
|
127
|
+
message: StreamMessage | undefined;
|
|
128
|
+
enabledActions: string[];
|
|
129
|
+
displayedActionsCountChaneHanler: (count: number) => any;
|
|
130
|
+
isEditingChangeHandler: (isEditing: boolean) => any;
|
|
131
|
+
};
|
|
132
|
+
export declare type MessageActionBoxItemContext = {
|
|
133
|
+
actionName: 'quote' | 'pin' | 'flag' | 'mute' | 'edit' | 'delete';
|
|
134
|
+
actionLabelOrTranslationKey: (() => string) | string;
|
|
135
|
+
actionHandler: () => any;
|
|
136
|
+
};
|
|
137
|
+
export declare type MessageActionItem = {
|
|
138
|
+
actionName: 'quote' | 'pin' | 'flag' | 'mute' | 'edit' | 'delete';
|
|
139
|
+
actionLabelOrTranslationKey: (() => string) | string;
|
|
140
|
+
isVisible: (enabledActions: string[], isMine: boolean, message: StreamMessage) => boolean;
|
|
141
|
+
actionHandler: (message: StreamMessage, isMine: boolean) => any;
|
|
142
|
+
};
|
|
143
|
+
export declare type MessageReactionsContext = {
|
|
144
|
+
messageId: string | undefined;
|
|
145
|
+
messageReactionCounts: {
|
|
146
|
+
[key in MessageReactionType]?: number;
|
|
147
|
+
};
|
|
148
|
+
isSelectorOpen: boolean;
|
|
149
|
+
latestReactions: ReactionResponse<DefaultReactionType, DefaultUserType>[];
|
|
150
|
+
ownReactions: ReactionResponse<DefaultReactionType, DefaultUserType>[];
|
|
151
|
+
isSelectorOpenChangeHandler: (isOpen: boolean) => any;
|
|
152
|
+
};
|
|
153
|
+
export declare type ModalContext = {
|
|
154
|
+
isOpen: boolean;
|
|
155
|
+
isOpenChangeHandler: (isOpen: boolean) => any;
|
|
156
|
+
content: TemplateRef<void>;
|
|
157
|
+
};
|
|
158
|
+
export declare type NotificationContext = {
|
|
159
|
+
type: NotificationType | undefined;
|
|
160
|
+
content: TemplateRef<void> | undefined;
|
|
161
|
+
};
|
|
162
|
+
export declare type ThreadHeaderContext = {
|
|
163
|
+
parentMessage: StreamMessage | undefined;
|
|
164
|
+
closeThreadHandler: Function;
|
|
165
|
+
};
|
|
166
|
+
export declare type MessageReactionType = 'angry' | 'haha' | 'like' | 'love' | 'sad' | 'wow';
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -4,8 +4,11 @@ export * from './lib/theme.service';
|
|
|
4
4
|
export * from './lib/attachment.service';
|
|
5
5
|
export * from './lib/stream-i18n.service';
|
|
6
6
|
export * from './lib/avatar/avatar.component';
|
|
7
|
+
export * from './lib/avatar-placeholder/avatar-placeholder.component';
|
|
7
8
|
export * from './lib/icon/icon.component';
|
|
9
|
+
export * from './lib/icon-placeholder/icon-placeholder.component';
|
|
8
10
|
export * from './lib/loading-indicator/loading-indicator.component';
|
|
11
|
+
export * from './lib/loading-indicator-placeholder/loading-indicator-placeholder.component';
|
|
9
12
|
export * from './lib/message-actions-box/message-actions-box.component';
|
|
10
13
|
export * from './lib/channel/channel.component';
|
|
11
14
|
export * from './lib/channel-header/channel-header.component';
|
package/src/assets/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '3.0.0-beta.
|
|
1
|
+
export const version = '3.0.0-beta.3';
|