stream-chat-angular 5.5.0 → 5.7.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/esm2020/assets/version.mjs +2 -2
- package/esm2020/lib/custom-templates.service.mjs +11 -1
- package/esm2020/lib/message/message.component.mjs +3 -3
- package/esm2020/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.mjs +16 -12
- package/esm2020/lib/message-input/message-input-config.service.mjs +1 -1
- package/esm2020/lib/message-input/message-input.component.mjs +14 -3
- package/esm2020/lib/message-input/textarea/textarea.component.mjs +13 -9
- package/esm2020/lib/message-input/textarea.directive.mjs +6 -2
- package/esm2020/lib/message-input/textarea.interface.mjs +1 -1
- package/esm2020/lib/types.mjs +1 -1
- package/fesm2015/stream-chat-angular.mjs +70 -34
- package/fesm2015/stream-chat-angular.mjs.map +1 -1
- package/fesm2020/stream-chat-angular.mjs +69 -34
- package/fesm2020/stream-chat-angular.mjs.map +1 -1
- package/lib/custom-templates.service.d.ts +11 -1
- package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +6 -4
- package/lib/message-input/message-input-config.service.d.ts +12 -0
- package/lib/message-input/message-input.component.d.ts +1 -0
- package/lib/message-input/textarea/textarea.component.d.ts +10 -4
- package/lib/message-input/textarea.directive.d.ts +2 -1
- package/lib/message-input/textarea.interface.d.ts +1 -0
- package/lib/types.d.ts +3 -0
- package/package.json +1 -1
- package/src/assets/version.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TemplateRef } from '@angular/core';
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
|
-
import { AttachmentContext, AttachmentListContext, AttachmentPreviewListContext, AvatarContext, ChannelActionsContext, ChannelHeaderInfoContext, ChannelPreviewContext, ChannelPreviewInfoContext, CommandAutocompleteListItemContext, CustomAttachmentListContext, CustomAttachmentPreviewListContext, CustomAttachmentUploadContext, CustomMetadataContext, DateSeparatorContext, DefaultStreamChatGenerics, DeliveredStatusContext, EmojiPickerContext, IconContext, MentionAutcompleteListItemContext, MentionTemplateContext, MessageActionBoxItemContext, MessageActionsBoxContext, MessageContext, MessageReactionsContext, MessageReactionsSelectorContext, ModalContext, NotificationContext, ReadStatusContext, SendingStatusContext, SystemMessageContext, ThreadHeaderContext, TypingIndicatorContext, UnreadMessagesIndicatorContext, UnreadMessagesNotificationContext } from './types';
|
|
3
|
+
import { AttachmentContext, AttachmentListContext, AttachmentPreviewListContext, AvatarContext, ChannelActionsContext, ChannelHeaderInfoContext, ChannelPreviewContext, ChannelPreviewInfoContext, CommandAutocompleteListItemContext, CustomAttachmentListContext, CustomAttachmentPreviewListContext, CustomAttachmentUploadContext, CustomMetadataContext, DateSeparatorContext, DefaultStreamChatGenerics, DeliveredStatusContext, EmojiPickerContext, IconContext, MentionAutcompleteListItemContext, MentionTemplateContext, MessageActionBoxItemContext, MessageActionsBoxContext, MessageContext, MessageReactionsContext, MessageReactionsSelectorContext, ModalContext, NotificationContext, ReadStatusContext, SendingStatusContext, SystemMessageContext, ThreadHeaderContext, ThreadReplyButtonContext, TypingIndicatorContext, UnreadMessagesIndicatorContext, UnreadMessagesNotificationContext } 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.
|
|
@@ -217,6 +217,16 @@ export declare class CustomTemplatesService<T extends DefaultStreamChatGenerics
|
|
|
217
217
|
* The template used to display custom attachments in the [message component](../../components/MessageComponent.mdx)
|
|
218
218
|
*/
|
|
219
219
|
customAttachmentListTemplate$: BehaviorSubject<TemplateRef<CustomAttachmentListContext<DefaultStreamChatGenerics>> | undefined>;
|
|
220
|
+
/**
|
|
221
|
+
* The template used to display the number of thread replies inside the [message component](../../components/MessageComponent.mdx)
|
|
222
|
+
*/
|
|
223
|
+
threadLinkButton$: BehaviorSubject<TemplateRef<ThreadReplyButtonContext<DefaultStreamChatGenerics>> | undefined>;
|
|
224
|
+
/**
|
|
225
|
+
* Template to display custom metadata inside the message bubble of the [message component](../components/MessageComponent.mdx)
|
|
226
|
+
*
|
|
227
|
+
* To properly position your template you should override the `grid-template-areas` of the `.str-chat__message-inner` selector
|
|
228
|
+
*/
|
|
229
|
+
customMessageMetadataInsideBubbleTemplate$: BehaviorSubject<TemplateRef<CustomMetadataContext<DefaultStreamChatGenerics>> | undefined>;
|
|
220
230
|
constructor();
|
|
221
231
|
static ɵfac: i0.ɵɵFactoryDeclaration<CustomTemplatesService<any>, never>;
|
|
222
232
|
static ɵprov: i0.ɵɵInjectableDeclaration<CustomTemplatesService<any>>;
|
|
@@ -8,7 +8,6 @@ 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';
|
|
12
11
|
import * as i0 from "@angular/core";
|
|
13
12
|
/**
|
|
14
13
|
* The `AutocompleteTextarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.
|
|
@@ -19,7 +18,6 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
|
|
|
19
18
|
private transliterationService;
|
|
20
19
|
private emojiInputService;
|
|
21
20
|
private customTemplatesService;
|
|
22
|
-
private themeService;
|
|
23
21
|
private cdRef;
|
|
24
22
|
class: string;
|
|
25
23
|
/**
|
|
@@ -58,6 +56,10 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
|
|
|
58
56
|
* Emits the array of users that are mentioned in the message, it is updated when a user mentions a new user or deletes a mention.
|
|
59
57
|
*/
|
|
60
58
|
readonly userMentions: EventEmitter<UserResponse<import("stream-chat").DefaultGenerics>[]>;
|
|
59
|
+
/**
|
|
60
|
+
* Emits any paste event that occured inside the textarea
|
|
61
|
+
*/
|
|
62
|
+
readonly pasteFromClipboard: EventEmitter<ClipboardEvent>;
|
|
61
63
|
mentionAutocompleteItemTemplate: TemplateRef<MentionAutcompleteListItemContext> | undefined;
|
|
62
64
|
commandAutocompleteItemTemplate: TemplateRef<CommandAutocompleteListItemContext> | undefined;
|
|
63
65
|
private readonly autocompleteKey;
|
|
@@ -71,7 +73,7 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
|
|
|
71
73
|
private slashCommandConfig;
|
|
72
74
|
private searchTerm$;
|
|
73
75
|
private isViewInited;
|
|
74
|
-
constructor(channelService: ChannelService, chatClientService: ChatClientService, transliterationService: TransliterationService, emojiInputService: EmojiInputService, customTemplatesService: CustomTemplatesService,
|
|
76
|
+
constructor(channelService: ChannelService, chatClientService: ChatClientService, transliterationService: TransliterationService, emojiInputService: EmojiInputService, customTemplatesService: CustomTemplatesService, cdRef: ChangeDetectorRef);
|
|
75
77
|
ngOnChanges(changes: SimpleChanges): void;
|
|
76
78
|
ngAfterViewInit(): void;
|
|
77
79
|
filter(searchString: string, items: {
|
|
@@ -89,5 +91,5 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
|
|
|
89
91
|
private updateMentionOptions;
|
|
90
92
|
private updateMentionedUsersFromText;
|
|
91
93
|
static ɵfac: i0.ɵɵFactoryDeclaration<AutocompleteTextareaComponent, never>;
|
|
92
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AutocompleteTextareaComponent, "stream-autocomplete-textarea", never, { "value": "value"; "placeholder": "placeholder"; "areMentionsEnabled": "areMentionsEnabled"; "inputMode": "inputMode"; "mentionScope": "mentionScope"; "autoFocus": "autoFocus"; }, { "valueChange": "valueChange"; "send": "send"; "userMentions": "userMentions"; }, never, never, false, never>;
|
|
94
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AutocompleteTextareaComponent, "stream-autocomplete-textarea", never, { "value": "value"; "placeholder": "placeholder"; "areMentionsEnabled": "areMentionsEnabled"; "inputMode": "inputMode"; "mentionScope": "mentionScope"; "autoFocus": "autoFocus"; }, { "valueChange": "valueChange"; "send": "send"; "userMentions": "userMentions"; "pasteFromClipboard": "pasteFromClipboard"; }, never, never, false, never>;
|
|
93
95
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MessageInputComponent } from './message-input.component';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
/**
|
|
3
4
|
* The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](../components/MessageInputComponent.mdx) components if your UI has more than one input component.
|
|
@@ -28,6 +29,17 @@ export declare class MessageInputConfigService {
|
|
|
28
29
|
* If `false`, the recording will added to the attachment preview, and users can continue composing the message.
|
|
29
30
|
*/
|
|
30
31
|
sendVoiceRecordingImmediately: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Override the message input's default event handler for [paste events](https://developer.mozilla.org/en-US/docs/Web/API/Element/paste_event)
|
|
34
|
+
*
|
|
35
|
+
* The event handler will receive the event object, and the [message input component](../../components/MessageInputComponent).
|
|
36
|
+
*
|
|
37
|
+
* You can use the public API of the message input component to update the composer. Typically you want to update the message text and/or attachments, this is how you can do these:
|
|
38
|
+
* - Change message text: `inputComponent.textareaValue = '<new value>'`
|
|
39
|
+
* - Upload file or image attachments: `inputComponent.attachmentService.filesSelected(<files>)`
|
|
40
|
+
* - Upload custom attachments: `inputComponent.attachmentService.customAttachments$.next(<custom attachments>)`
|
|
41
|
+
*/
|
|
42
|
+
customPasteEventHandler?: (event: ClipboardEvent, inputComponent: MessageInputComponent) => void;
|
|
31
43
|
constructor();
|
|
32
44
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputConfigService, never>;
|
|
33
45
|
static ɵprov: i0.ɵɵInjectableDeclaration<MessageInputConfigService>;
|
|
@@ -149,6 +149,7 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
|
|
|
149
149
|
};
|
|
150
150
|
}>[];
|
|
151
151
|
get disabledTextareaText(): "" | "streamChat.You can't send thread replies in this channel" | "streamChat.You can't send messages in this channel";
|
|
152
|
+
itemsPasted(event: ClipboardEvent): void;
|
|
152
153
|
filesSelected(fileList: FileList | null): Promise<void>;
|
|
153
154
|
deselectMessageToQuote(): void;
|
|
154
155
|
deselectMessageToEdit(): void;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { AfterViewInit, EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { ThemeService } from '../../theme.service';
|
|
3
2
|
import { EmojiInputService } from '../emoji-input.service';
|
|
4
3
|
import { TextareaInterface } from '../textarea.interface';
|
|
4
|
+
import { UserResponse } from 'stream-chat';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
7
7
|
* The `Textarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.
|
|
8
8
|
*/
|
|
9
9
|
export declare class TextareaComponent implements TextareaInterface, OnChanges, OnDestroy, AfterViewInit {
|
|
10
10
|
private emojiInputService;
|
|
11
|
-
private themeService;
|
|
12
11
|
class: string;
|
|
13
12
|
/**
|
|
14
13
|
* The value of the input HTML element.
|
|
@@ -34,10 +33,17 @@ export declare class TextareaComponent implements TextareaInterface, OnChanges,
|
|
|
34
33
|
* Emits when a user triggers a message send event (this happens when they hit the `Enter` key).
|
|
35
34
|
*/
|
|
36
35
|
readonly send: EventEmitter<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Emits any paste event that occured inside the textarea
|
|
38
|
+
*/
|
|
39
|
+
readonly pasteFromClipboard: EventEmitter<ClipboardEvent>;
|
|
37
40
|
private messageInput;
|
|
41
|
+
userMentions?: EventEmitter<UserResponse[]> | undefined;
|
|
42
|
+
areMentionsEnabled?: boolean | undefined;
|
|
43
|
+
mentionScope?: 'channel' | 'application' | undefined;
|
|
38
44
|
private subscriptions;
|
|
39
45
|
private isViewInited;
|
|
40
|
-
constructor(emojiInputService: EmojiInputService
|
|
46
|
+
constructor(emojiInputService: EmojiInputService);
|
|
41
47
|
ngOnChanges(changes: SimpleChanges): void;
|
|
42
48
|
ngAfterViewInit(): void;
|
|
43
49
|
ngOnDestroy(): void;
|
|
@@ -45,5 +51,5 @@ export declare class TextareaComponent implements TextareaInterface, OnChanges,
|
|
|
45
51
|
enterHit(event: Event): void;
|
|
46
52
|
private adjustTextareaHeight;
|
|
47
53
|
static ɵfac: i0.ɵɵFactoryDeclaration<TextareaComponent, never>;
|
|
48
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TextareaComponent, "stream-textarea", never, { "value": "value"; "placeholder": "placeholder"; "inputMode": "inputMode"; "autoFocus": "autoFocus"; }, { "valueChange": "valueChange"; "send": "send"; }, never, never, false, never>;
|
|
54
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextareaComponent, "stream-textarea", never, { "value": "value"; "placeholder": "placeholder"; "inputMode": "inputMode"; "autoFocus": "autoFocus"; }, { "valueChange": "valueChange"; "send": "send"; "pasteFromClipboard": "pasteFromClipboard"; }, never, never, false, never>;
|
|
49
55
|
}
|
|
@@ -14,10 +14,11 @@ export declare class TextareaDirective implements OnChanges {
|
|
|
14
14
|
readonly valueChange: EventEmitter<string>;
|
|
15
15
|
readonly send: EventEmitter<void>;
|
|
16
16
|
readonly userMentions: EventEmitter<UserResponse<import("stream-chat").DefaultGenerics>[]>;
|
|
17
|
+
readonly pasteFromClipboard: EventEmitter<ClipboardEvent>;
|
|
17
18
|
private subscriptions;
|
|
18
19
|
private unpropagatedChanges;
|
|
19
20
|
constructor(viewContainerRef: ViewContainerRef);
|
|
20
21
|
ngOnChanges(changes: SimpleChanges): void;
|
|
21
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<TextareaDirective, never>;
|
|
22
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TextareaDirective, "[streamTextarea]", never, { "componentRef": "componentRef"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "inputMode": "inputMode"; "value": "value"; "placeholder": "placeholder"; "autoFocus": "autoFocus"; }, { "valueChange": "valueChange"; "send": "send"; "userMentions": "userMentions"; }, never, never, false, never>;
|
|
23
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TextareaDirective, "[streamTextarea]", never, { "componentRef": "componentRef"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "inputMode": "inputMode"; "value": "value"; "placeholder": "placeholder"; "autoFocus": "autoFocus"; }, { "valueChange": "valueChange"; "send": "send"; "userMentions": "userMentions"; "pasteFromClipboard": "pasteFromClipboard"; }, never, never, false, never>;
|
|
23
24
|
}
|
|
@@ -5,6 +5,7 @@ export interface TextareaInterface {
|
|
|
5
5
|
valueChange: EventEmitter<string>;
|
|
6
6
|
send: EventEmitter<void>;
|
|
7
7
|
userMentions?: EventEmitter<UserResponse[]>;
|
|
8
|
+
pasteFromClipboard: EventEmitter<ClipboardEvent>;
|
|
8
9
|
areMentionsEnabled?: boolean;
|
|
9
10
|
mentionScope?: 'channel' | 'application';
|
|
10
11
|
placeholder?: string;
|
package/lib/types.d.ts
CHANGED
|
@@ -335,4 +335,7 @@ export declare type MediaRecording = {
|
|
|
335
335
|
export declare type CustomAttachmentPreviewListContext<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
336
336
|
attachmentService: AttachmentService<T>;
|
|
337
337
|
};
|
|
338
|
+
export declare type ThreadReplyButtonContext<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
339
|
+
message: StreamMessage<T>;
|
|
340
|
+
};
|
|
338
341
|
export {};
|
package/package.json
CHANGED
package/src/assets/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.
|
|
1
|
+
export const version = '5.7.0';
|