stream-chat-angular 4.55.1 → 4.56.0-perf-message-list.1
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 +380 -198
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/attachment-configuration.service.js +2 -2
- package/esm2015/lib/attachment-list/attachment-list.component.js +2 -2
- package/esm2015/lib/avatar/avatar.component.js +2 -3
- package/esm2015/lib/message/message.component.js +52 -25
- package/esm2015/lib/message-actions-box/message-actions-box.component.js +60 -81
- package/esm2015/lib/message-actions.service.js +108 -0
- package/esm2015/lib/message-list/message-list.component.js +114 -42
- package/esm2015/lib/message-reactions.service.js +2 -2
- package/esm2015/lib/types.js +1 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/stream-chat-angular.js +330 -151
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/avatar/avatar.component.d.ts +0 -1
- package/lib/message/message.component.d.ts +7 -3
- package/lib/message-actions-box/message-actions-box.component.d.ts +24 -9
- package/lib/message-actions.service.d.ts +37 -0
- package/lib/message-list/message-list.component.d.ts +6 -1
- package/lib/message-reactions.service.d.ts +1 -1
- package/lib/types.d.ts +15 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/src/assets/version.ts +1 -1
|
@@ -45,7 +45,6 @@ export declare class AvatarComponent implements OnChanges {
|
|
|
45
45
|
* If channel/user image isn't provided the initials of the name of the channel/user is shown instead, you can choose how the initals should be computed
|
|
46
46
|
*/
|
|
47
47
|
initialsType: 'first-letter-of-first-word' | 'first-letter-of-each-word';
|
|
48
|
-
isLoaded: boolean;
|
|
49
48
|
isError: boolean;
|
|
50
49
|
isOnline: boolean;
|
|
51
50
|
private isOnlineSubscription?;
|
|
@@ -8,6 +8,7 @@ import { ThemeService } from '../theme.service';
|
|
|
8
8
|
import { NgxPopperjsTriggers, NgxPopperjsPlacements } from 'ngx-popperjs';
|
|
9
9
|
import { DateParserService } from '../date-parser.service';
|
|
10
10
|
import { MessageService } from '../message.service';
|
|
11
|
+
import { MessageActionsService } from '../message-actions.service';
|
|
11
12
|
import * as i0 from "@angular/core";
|
|
12
13
|
declare type MessagePart = {
|
|
13
14
|
content: string;
|
|
@@ -25,6 +26,7 @@ export declare class MessageComponent implements OnInit, OnChanges, OnDestroy, A
|
|
|
25
26
|
private dateParser;
|
|
26
27
|
private ngZone;
|
|
27
28
|
private messageService;
|
|
29
|
+
private messageActionsService;
|
|
28
30
|
/**
|
|
29
31
|
* The message to be displayed
|
|
30
32
|
*/
|
|
@@ -47,6 +49,8 @@ export declare class MessageComponent implements OnInit, OnChanges, OnDestroy, A
|
|
|
47
49
|
isHighlighted: boolean;
|
|
48
50
|
/**
|
|
49
51
|
* A list of custom message actions to be displayed in the action box
|
|
52
|
+
*
|
|
53
|
+
* @deprecated please use the [`MessageActionsService`](https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService) to set this property.
|
|
50
54
|
*/
|
|
51
55
|
customActions: CustomMessageActionItem[];
|
|
52
56
|
readonly themeVersion: '1' | '2';
|
|
@@ -81,13 +85,13 @@ export declare class MessageComponent implements OnInit, OnChanges, OnDestroy, A
|
|
|
81
85
|
};
|
|
82
86
|
canDisplayReadStatus: boolean;
|
|
83
87
|
private quotedMessageAttachments;
|
|
84
|
-
user: UserResponse<DefaultStreamChatGenerics> | undefined;
|
|
85
|
-
optionsRenderTimeoutEnded: boolean;
|
|
86
88
|
private subscriptions;
|
|
89
|
+
private isViewInited;
|
|
90
|
+
private userId?;
|
|
87
91
|
private container;
|
|
88
92
|
private readonly urlRegexp;
|
|
89
93
|
private emojiRegexp;
|
|
90
|
-
constructor(chatClientService: ChatClientService, channelService: ChannelService, customTemplatesService: CustomTemplatesService, cdRef: ChangeDetectorRef, themeService: ThemeService, dateParser: DateParserService, ngZone: NgZone, messageService: MessageService);
|
|
94
|
+
constructor(chatClientService: ChatClientService, channelService: ChannelService, customTemplatesService: CustomTemplatesService, cdRef: ChangeDetectorRef, themeService: ThemeService, dateParser: DateParserService, ngZone: NgZone, messageService: MessageService, messageActionsService: MessageActionsService);
|
|
91
95
|
ngOnInit(): void;
|
|
92
96
|
ngOnChanges(changes: SimpleChanges): void;
|
|
93
97
|
ngAfterViewInit(): void;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { ChannelService } from '../channel.service';
|
|
4
|
-
import { ChatClientService } from '../chat-client.service';
|
|
5
3
|
import { CustomTemplatesService } from '../custom-templates.service';
|
|
6
|
-
import { NotificationService } from '../notification.service';
|
|
7
4
|
import { CustomMessageActionItem, MessageActionBoxItemContext, MessageActionItem, MessageInputContext, ModalContext, StreamMessage } from '../types';
|
|
5
|
+
import { MessageActionsService } from '../message-actions.service';
|
|
8
6
|
import * as i0 from "@angular/core";
|
|
9
7
|
/**
|
|
10
8
|
* 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.
|
|
11
9
|
*/
|
|
12
|
-
export declare class MessageActionsBoxComponent implements OnChanges {
|
|
13
|
-
private chatClientService;
|
|
14
|
-
private notificationService;
|
|
15
|
-
private channelService;
|
|
10
|
+
export declare class MessageActionsBoxComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit {
|
|
16
11
|
readonly customTemplatesService: CustomTemplatesService;
|
|
12
|
+
private messageActionsService;
|
|
13
|
+
private cdRef;
|
|
17
14
|
/**
|
|
18
15
|
* Indicates if the list should be opened or closed. Adding a UI element to open and close the list is the parent's component responsibility.
|
|
19
16
|
* @deprecated No need for this since [theme-v2](../theming/introduction.mdx)
|
|
@@ -33,14 +30,26 @@ export declare class MessageActionsBoxComponent implements OnChanges {
|
|
|
33
30
|
enabledActions: string[];
|
|
34
31
|
/**
|
|
35
32
|
* A list of custom message actions to be displayed in the action box
|
|
33
|
+
*
|
|
34
|
+
* In the next major release this will be released with `messageReactionsService.customActions$`
|
|
35
|
+
*
|
|
36
|
+
* More information: https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService
|
|
36
37
|
*/
|
|
37
38
|
customActions: CustomMessageActionItem[];
|
|
38
39
|
/**
|
|
39
40
|
* The number of authorized actions (it can be less or equal than the number of enabled actions)
|
|
41
|
+
*
|
|
42
|
+
* @deprecated components should use `messageReactionsService.getAuthorizedMessageActionsCount` method
|
|
43
|
+
*
|
|
44
|
+
* More information: https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService
|
|
40
45
|
*/
|
|
41
46
|
readonly displayedActionsCount: EventEmitter<number>;
|
|
42
47
|
/**
|
|
43
48
|
* An event which emits `true` if the edit message modal is open, and `false` when it is closed.
|
|
49
|
+
*
|
|
50
|
+
* @deprecated components should use `messageReactionsService.getAuthorizedMessageActionsCount` method
|
|
51
|
+
*
|
|
52
|
+
* More information: https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService
|
|
44
53
|
*/
|
|
45
54
|
readonly isEditing: EventEmitter<boolean>;
|
|
46
55
|
isEditModalOpen: boolean;
|
|
@@ -52,8 +61,13 @@ export declare class MessageActionsBoxComponent implements OnChanges {
|
|
|
52
61
|
private readonly messageActionItems;
|
|
53
62
|
private modalContent;
|
|
54
63
|
private sendMessageSubject;
|
|
55
|
-
|
|
64
|
+
private subscriptions;
|
|
65
|
+
private isViewInited;
|
|
66
|
+
constructor(customTemplatesService: CustomTemplatesService, messageActionsService: MessageActionsService, cdRef: ChangeDetectorRef);
|
|
67
|
+
ngOnInit(): void;
|
|
56
68
|
ngOnChanges(changes: SimpleChanges): void;
|
|
69
|
+
ngAfterViewInit(): void;
|
|
70
|
+
ngOnDestroy(): void;
|
|
57
71
|
getActionLabel(actionLabelOrTranslationKey: ((message: StreamMessage) => string) | string): string;
|
|
58
72
|
getMessageActionTemplateContext(item: MessageActionItem | CustomMessageActionItem): MessageActionBoxItemContext<any>;
|
|
59
73
|
sendClicked(): void;
|
|
@@ -61,6 +75,7 @@ export declare class MessageActionsBoxComponent implements OnChanges {
|
|
|
61
75
|
getMessageInputContext(): MessageInputContext;
|
|
62
76
|
getEditModalContext(): ModalContext;
|
|
63
77
|
trackByActionName(_: number, item: MessageActionItem | CustomMessageActionItem): string;
|
|
78
|
+
private setVisibleActions;
|
|
64
79
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageActionsBoxComponent, never>;
|
|
65
80
|
static ɵcmp: i0.ɵɵComponentDeclaration<MessageActionsBoxComponent, "stream-message-actions-box", never, { "isOpen": "isOpen"; "isMine": "isMine"; "message": "message"; "enabledActions": "enabledActions"; "customActions": "customActions"; }, { "displayedActionsCount": "displayedActionsCount"; "isEditing": "isEditing"; }, never, never>;
|
|
66
81
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
|
+
import { CustomMessageActionItem, DefaultStreamChatGenerics, MessageActionItem, StreamMessage } from './types';
|
|
3
|
+
import { ChatClientService } from './chat-client.service';
|
|
4
|
+
import { NotificationService } from './notification.service';
|
|
5
|
+
import { ChannelService } from './channel.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* The message actions service provides customization options for the [message actions](../../components/MessageActionsBoxComponent)
|
|
9
|
+
*/
|
|
10
|
+
export declare class MessageActionsService<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> {
|
|
11
|
+
private chatClientService;
|
|
12
|
+
private notificationService;
|
|
13
|
+
private channelService;
|
|
14
|
+
/**
|
|
15
|
+
* Default actions - these are the actions that are handled by the built-in component
|
|
16
|
+
*/
|
|
17
|
+
readonly defaultActions: MessageActionItem<T>[];
|
|
18
|
+
/**
|
|
19
|
+
* The built-in components will handle changes to this observable.
|
|
20
|
+
*/
|
|
21
|
+
messageToEdit$: BehaviorSubject<StreamMessage<T> | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* You can pass your own custom actions that will be displayed inside the built-in message actions component
|
|
24
|
+
*/
|
|
25
|
+
customActions$: BehaviorSubject<CustomMessageActionItem<DefaultStreamChatGenerics>[]>;
|
|
26
|
+
constructor(chatClientService: ChatClientService, notificationService: NotificationService, channelService: ChannelService);
|
|
27
|
+
/**
|
|
28
|
+
* This method returns how many authorized actions are available to the given message
|
|
29
|
+
*
|
|
30
|
+
* @param message
|
|
31
|
+
* @param enabledActions
|
|
32
|
+
* @returns the count
|
|
33
|
+
*/
|
|
34
|
+
getAuthorizedMessageActionsCount(message: StreamMessage<T>, enabledActions: string[]): number;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MessageActionsService<any>, never>;
|
|
36
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MessageActionsService<any>>;
|
|
37
|
+
}
|
|
@@ -7,6 +7,7 @@ import { GroupStyle } from './group-styles';
|
|
|
7
7
|
import { UserResponse } from 'stream-chat';
|
|
8
8
|
import { CustomTemplatesService } from '../custom-templates.service';
|
|
9
9
|
import { DateParserService } from '../date-parser.service';
|
|
10
|
+
import { MessageActionsService } from '../message-actions.service';
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
11
12
|
/**
|
|
12
13
|
* The `MessageList` component renders a scrollable list of messages.
|
|
@@ -18,6 +19,7 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
|
|
|
18
19
|
private dateParser;
|
|
19
20
|
private ngZone;
|
|
20
21
|
private cdRef;
|
|
22
|
+
private messageActionsService;
|
|
21
23
|
/**
|
|
22
24
|
* Determines if the message list should display channel messages or [thread messages](https://getstream.io/chat/docs/javascript/threads/?language=javascript).
|
|
23
25
|
*/
|
|
@@ -38,6 +40,8 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
|
|
|
38
40
|
hideJumpToLatestButtonDuringScroll: boolean;
|
|
39
41
|
/**
|
|
40
42
|
* A list of custom message actions to be displayed in the message action box
|
|
43
|
+
*
|
|
44
|
+
* @deprecated please use the [`MessageActionsService`](https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService) to set this property.
|
|
41
45
|
*/
|
|
42
46
|
customMessageActions: CustomMessageActionItem<any>[];
|
|
43
47
|
/**
|
|
@@ -93,8 +97,9 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
|
|
|
93
97
|
private isLatestMessageInList;
|
|
94
98
|
private channelId?;
|
|
95
99
|
private parsedDates;
|
|
100
|
+
private isViewInited;
|
|
96
101
|
private get class();
|
|
97
|
-
constructor(channelService: ChannelService, chatClientService: ChatClientService, customTemplatesService: CustomTemplatesService, dateParser: DateParserService, ngZone: NgZone, cdRef: ChangeDetectorRef);
|
|
102
|
+
constructor(channelService: ChannelService, chatClientService: ChatClientService, customTemplatesService: CustomTemplatesService, dateParser: DateParserService, ngZone: NgZone, cdRef: ChangeDetectorRef, messageActionsService: MessageActionsService);
|
|
98
103
|
ngOnInit(): void;
|
|
99
104
|
ngOnChanges(changes: SimpleChanges): void;
|
|
100
105
|
ngAfterViewInit(): void;
|
|
@@ -2,7 +2,7 @@ import { MessageReactionClickDetails, MessageReactionType } from './types';
|
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
/**
|
|
5
|
-
* The `MessageReactionsService`
|
|
5
|
+
* The `MessageReactionsService` provides customization options to message [reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript).
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
export declare class MessageReactionsService {
|
package/lib/types.d.ts
CHANGED
|
@@ -157,12 +157,27 @@ export declare type MessageActionsBoxContext = {
|
|
|
157
157
|
isMine: boolean;
|
|
158
158
|
message: StreamMessage | undefined;
|
|
159
159
|
enabledActions: string[];
|
|
160
|
+
/**
|
|
161
|
+
* @deprecated please use `messageReactionsService.customActions$`
|
|
162
|
+
*
|
|
163
|
+
* More information: https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService
|
|
164
|
+
*/
|
|
160
165
|
customActions: CustomMessageActionItem[];
|
|
161
166
|
/**
|
|
162
167
|
* @deprecated because the name contains typos, use the `displayedActionsCountChangeHandler` instead
|
|
163
168
|
*/
|
|
164
169
|
displayedActionsCountChaneHanler: (count: number) => any;
|
|
170
|
+
/**
|
|
171
|
+
* @deprecated components should use `messageReactionsService.getAuthorizedMessageActionsCount` method
|
|
172
|
+
*
|
|
173
|
+
* More information: https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService
|
|
174
|
+
*/
|
|
165
175
|
displayedActionsCountChangeHandler: (count: number) => any;
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated components should use `messageReactionsService.getAuthorizedMessageActionsCount` method
|
|
178
|
+
*
|
|
179
|
+
* More information: https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService
|
|
180
|
+
*/
|
|
166
181
|
isEditingChangeHandler: (isEditing: boolean) => any;
|
|
167
182
|
};
|
|
168
183
|
export declare type MessageActionBoxItemContext<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
package/src/assets/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.
|
|
1
|
+
export const version = '4.56.0-perf-message-list.1';
|