@progress/kendo-angular-conversational-ui 21.0.0-develop.8 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chat/api/files-layout.d.ts +12 -0
- package/chat/api/index.d.ts +4 -1
- package/chat/api/message-settings.interface.d.ts +41 -0
- package/chat/api/message-width-mode.d.ts +1 -1
- package/chat/api/message.interface.d.ts +5 -1
- package/chat/api/suggestions-layout.d.ts +20 -0
- package/chat/api/timestamp-visibility.d.ts +10 -0
- package/chat/chat.component.d.ts +114 -35
- package/chat/chat.directives.d.ts +18 -0
- package/chat/chat.module.d.ts +15 -8
- package/chat/common/chat.service.d.ts +36 -3
- package/chat/common/models/model-fields.d.ts +0 -6
- package/chat/common/scroll-button.component.d.ts +32 -0
- package/chat/common/scroll.service.d.ts +39 -0
- package/chat/common/utils.d.ts +13 -1
- package/chat/l10n/messages.d.ts +9 -1
- package/chat/message-list.component.d.ts +22 -3
- package/chat/message.component.d.ts +40 -16
- package/chat/suggested-actions.component.d.ts +30 -5
- package/chat/templates/author-message-content-template.directive.d.ts +28 -0
- package/chat/templates/author-message-template.directive.d.ts +28 -0
- package/chat/templates/message-content-template.directive.d.ts +28 -0
- package/chat/templates/message-template.directive.d.ts +1 -1
- package/chat/templates/no-data-template.directive.d.ts +27 -0
- package/chat/templates/receiver-message-content-template.directive.d.ts +28 -0
- package/chat/templates/receiver-message-template.directive.d.ts +28 -0
- package/chat/templates/user-status-template.directive.d.ts +27 -0
- package/codemods/utils.js +477 -375
- package/codemods/v20/chat-user.js +7 -5
- package/codemods/v21/chat-messagetoolbarvisibility.js +53 -0
- package/codemods/v21/chat-pinnedbyfield.js +19 -0
- package/conversational-ui.module.d.ts +18 -11
- package/directives.d.ts +9 -2
- package/esm2022/chat/api/index.mjs +4 -1
- package/{chat/api/message-toolbar-visibility.d.ts → esm2022/chat/api/message-settings.interface.mjs} +1 -4
- package/esm2022/chat/api/suggestions-layout.mjs +5 -0
- package/esm2022/chat/api/timestamp-visibility.mjs +5 -0
- package/esm2022/chat/builtin-actions.mjs +2 -0
- package/esm2022/chat/chat-file.component.mjs +2 -2
- package/esm2022/chat/chat.component.mjs +298 -72
- package/esm2022/chat/chat.directives.mjs +18 -0
- package/esm2022/chat/chat.module.mjs +16 -9
- package/esm2022/chat/common/chat.service.mjs +86 -4
- package/esm2022/chat/common/models/default-model-fields.mjs +0 -1
- package/esm2022/chat/common/scroll-button.component.mjs +81 -0
- package/esm2022/chat/common/scroll.service.mjs +110 -0
- package/esm2022/chat/common/utils.mjs +22 -3
- package/esm2022/chat/l10n/messages.mjs +13 -1
- package/esm2022/chat/message-attachments.component.mjs +2 -2
- package/esm2022/chat/message-box.component.mjs +5 -2
- package/esm2022/chat/message-list.component.mjs +184 -40
- package/esm2022/chat/message.component.mjs +487 -326
- package/esm2022/chat/suggested-actions.component.mjs +298 -80
- package/esm2022/chat/templates/author-message-content-template.directive.mjs +39 -0
- package/esm2022/chat/templates/author-message-template.directive.mjs +39 -0
- package/esm2022/chat/templates/message-content-template.directive.mjs +39 -0
- package/esm2022/chat/templates/message-template.directive.mjs +1 -1
- package/esm2022/chat/templates/no-data-template.directive.mjs +38 -0
- package/esm2022/chat/templates/receiver-message-content-template.directive.mjs +39 -0
- package/esm2022/chat/templates/receiver-message-template.directive.mjs +39 -0
- package/esm2022/chat/templates/user-status-template.directive.mjs +38 -0
- package/esm2022/conversational-ui.module.mjs +19 -12
- package/esm2022/directives.mjs +15 -1
- package/esm2022/index.mjs +7 -0
- package/esm2022/package-metadata.mjs +2 -2
- package/fesm2022/progress-kendo-angular-conversational-ui.mjs +1825 -568
- package/index.d.ts +7 -0
- package/package.json +26 -14
- /package/esm2022/chat/api/{message-toolbar-visibility.mjs → files-layout.mjs} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* The layout of the files in the message bubble.
|
|
7
|
+
*
|
|
8
|
+
* 'horizontal' - Files are laid out in a row and are horizontally scrollable.
|
|
9
|
+
* 'vertical' - Files are displayed in a vertical stack.
|
|
10
|
+
* 'wrap' - Files wrap to new lines when space is limited.
|
|
11
|
+
*/
|
|
12
|
+
export type FilesLayoutMode = 'horizontal' | 'vertical' | 'wrap';
|
package/chat/api/index.d.ts
CHANGED
|
@@ -8,11 +8,14 @@ export * from './chat-file-interface';
|
|
|
8
8
|
export * from './chat-suggestion.interface';
|
|
9
9
|
export * from './execute-action-event';
|
|
10
10
|
export * from './message-action';
|
|
11
|
-
export * from './message-toolbar-visibility';
|
|
12
11
|
export * from './message-width-mode';
|
|
13
12
|
export * from './message.interface';
|
|
13
|
+
export * from './message-settings.interface';
|
|
14
14
|
export * from './post-message-event';
|
|
15
15
|
export * from './user.interface';
|
|
16
16
|
export * from './file-action';
|
|
17
17
|
export * from './file-download-event.interface';
|
|
18
18
|
export * from './send-button-settings';
|
|
19
|
+
export * from './files-layout';
|
|
20
|
+
export * from './suggestions-layout';
|
|
21
|
+
export * from './timestamp-visibility';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { FileAction } from "./file-action";
|
|
6
|
+
import { MessageAction } from "./message-action";
|
|
7
|
+
import { MessageWidthMode } from "./message-width-mode";
|
|
8
|
+
/**
|
|
9
|
+
* Represents the settings for the Chat message ([see example](slug:databinding_chat)).
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export interface MessageSettings {
|
|
13
|
+
/**
|
|
14
|
+
* If set to `true`, enables the expanding/collapsing of long messages.
|
|
15
|
+
*/
|
|
16
|
+
allowMessageCollapse?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Sets the array of actions that will be displayed in the message toolbar.
|
|
19
|
+
*/
|
|
20
|
+
messageToolbarActions?: MessageAction[];
|
|
21
|
+
/**
|
|
22
|
+
* Sets the array of actions that will be displayed in the message context menu.
|
|
23
|
+
*/
|
|
24
|
+
messageContextMenuActions?: MessageAction[];
|
|
25
|
+
/**
|
|
26
|
+
* Sets the array of actions that will be displayed for the message files.
|
|
27
|
+
*/
|
|
28
|
+
fileActions?: FileAction[];
|
|
29
|
+
/**
|
|
30
|
+
* Sets the mode that will be used to determine the message width.
|
|
31
|
+
*/
|
|
32
|
+
messageWidthMode?: MessageWidthMode;
|
|
33
|
+
/**
|
|
34
|
+
* Sets the visibility of the author's avatar for the message group.
|
|
35
|
+
*/
|
|
36
|
+
showAvatar?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Sets the visibility of the author's username for the message group.
|
|
39
|
+
*/
|
|
40
|
+
showUsername?: boolean;
|
|
41
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Defines the possible modes for message width in the
|
|
6
|
+
* Defines the possible modes for message width in the Chat component.
|
|
7
7
|
* - `full`: The message takes the full width of the chat container.
|
|
8
8
|
* - `standard`: (Default) The message width is standard, allowing for a more compact layout.
|
|
9
9
|
*/
|
|
@@ -14,7 +14,7 @@ export interface Message {
|
|
|
14
14
|
/**
|
|
15
15
|
* Sets a unique ID for the message.
|
|
16
16
|
*/
|
|
17
|
-
id
|
|
17
|
+
id: string | number;
|
|
18
18
|
/**
|
|
19
19
|
* Sets the text content for the message. Some messages may contain only attachments or quick actions.
|
|
20
20
|
*/
|
|
@@ -65,4 +65,8 @@ export interface Message {
|
|
|
65
65
|
* Indicates if the message is still being typed by the user. If `true`, the Chat shows a typing indicator.
|
|
66
66
|
*/
|
|
67
67
|
typing?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Provides a reference to the original data item, if any.
|
|
70
|
+
*/
|
|
71
|
+
dataItem?: any;
|
|
68
72
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* Defines the layout for the suggestions list.
|
|
7
|
+
*
|
|
8
|
+
* 'scroll' - The list is scrollable when the content overflows.
|
|
9
|
+
* 'wrap' - The list wraps to new lines when space is limited.
|
|
10
|
+
* 'scrollbuttons' - The list is scrollable with navigation buttons when the content overflows.
|
|
11
|
+
*/
|
|
12
|
+
export type SuggestionsLayoutMode = 'scroll' | 'wrap' | 'scrollbuttons';
|
|
13
|
+
/**
|
|
14
|
+
* Defines the layout for the quick actions list.
|
|
15
|
+
*
|
|
16
|
+
* 'scroll' - The list is scrollable when the content overflows.
|
|
17
|
+
* 'wrap' - The list wraps to new lines when space is limited.
|
|
18
|
+
* 'scrollbuttons' - The list is scrollable with navigation buttons when the content overflows.
|
|
19
|
+
*/
|
|
20
|
+
export type QuickActionsLayoutMode = 'scroll' | 'wrap' | 'scrollbuttons';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* Defines the possible modes for timestamp visibility in the Chat component.
|
|
7
|
+
* - `focus`: Timestamps are only visible for selected/focused messages (default Chat behavior).
|
|
8
|
+
* - `hidden`: Timestamps are hidden for all messages.
|
|
9
|
+
*/
|
|
10
|
+
export type TimestampVisibilityMode = 'focus' | 'hidden';
|
package/chat/chat.component.d.ts
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
import { AfterViewInit, ElementRef, EventEmitter, OnDestroy, NgZone, Renderer2, SimpleChanges, OnInit, ViewContainerRef } from '@angular/core';
|
|
6
6
|
import { AttachmentTemplateDirective } from './templates/attachment-template.directive';
|
|
7
7
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
-
import {
|
|
9
|
-
import { ExecuteActionEvent, FileAction, Message, SendMessageEvent, FileActionEvent, FileDownloadEvent, SendButtonSettings, MessageToolbarVisibility } from './api';
|
|
8
|
+
import { ExecuteActionEvent, FileAction, Message, SendMessageEvent, FileActionEvent, FileDownloadEvent, SendButtonSettings, FilesLayoutMode, MessageSettings } from './api';
|
|
10
9
|
import { MessageBoxType } from './common/models/message-box-options';
|
|
11
10
|
import { ChatMessageBoxTemplateDirective } from './templates/message-box.directive';
|
|
12
11
|
import { MessageBoxComponent } from './message-box.component';
|
|
@@ -22,6 +21,11 @@ import { ConversationalUIModelFields } from './common/models/model-fields';
|
|
|
22
21
|
import { ChatTimestampTemplateDirective } from './templates/timestamp-template.directive';
|
|
23
22
|
import { ChatStatusTemplateDirective } from './templates/status-template.directive';
|
|
24
23
|
import { ChatSuggestionTemplateDirective } from './templates/suggestion-template.directive';
|
|
24
|
+
import { ContextMenuComponent, ContextMenuPopupEvent } from '@progress/kendo-angular-menu';
|
|
25
|
+
import { NoDataTemplateDirective, MessageTemplateDirective, AuthorMessageContentTemplateDirective, ReceiverMessageContentTemplateDirective, ReceiverMessageTemplateDirective, AuthorMessageTemplateDirective, MessageContentTemplateDirective } from './chat.directives';
|
|
26
|
+
import { ChatUserStatusTemplateDirective } from './templates/user-status-template.directive';
|
|
27
|
+
import { QuickActionsLayoutMode, SuggestionsLayoutMode } from './api/suggestions-layout';
|
|
28
|
+
import { TimestampVisibilityMode } from './api/timestamp-visibility';
|
|
25
29
|
import * as i0 from "@angular/core";
|
|
26
30
|
/**
|
|
27
31
|
* Represents the [Kendo UI Chat component for Angular](slug:overview_convui).
|
|
@@ -40,7 +44,7 @@ import * as i0 from "@angular/core";
|
|
|
40
44
|
* ```
|
|
41
45
|
*
|
|
42
46
|
* @remarks
|
|
43
|
-
* Supported children components are: {@link CustomMessagesComponent}, {@link HeroCardComponent}, {@link AttachmentTemplateDirective}, {@link ChatHeaderTemplateDirective}, {@link ChatMessageBoxTemplateDirective}, {@link
|
|
47
|
+
* Supported children components are: {@link CustomMessagesComponent}, {@link HeroCardComponent}, {@link AttachmentTemplateDirective}, {@link ChatHeaderTemplateDirective}, {@link ChatMessageBoxTemplateDirective}, {@link MessageContentTemplateDirective}, {@link MessageTemplateDirective},{@link ChatStatusTemplateDirective}, {@link ChatSuggestionTemplateDirective}, {@link ChatTimestampTemplateDirective}, {@link ChatNoDataTemplateDirective}, {@link ChatUserStatusTemplateDirective}, {@link AuthorMessageContentTemplateDirective}, {@link ReceiverMessageContentTemplateDirective}, {@link ReceiverMessageTemplateDirective}, {@link AuthorMessageTemplateDirective}.
|
|
44
48
|
*/
|
|
45
49
|
export declare class ChatComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
46
50
|
private localization;
|
|
@@ -49,13 +53,13 @@ export declare class ChatComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
49
53
|
private element;
|
|
50
54
|
private chatService;
|
|
51
55
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* For more information,
|
|
56
|
+
* Sets the Chat messages.
|
|
57
|
+
* Accepts an array of `Message` objects, but can also accept custom data types.
|
|
58
|
+
* For more information, check [Data Binding](slug:databinding_chat) section in the documentation.
|
|
55
59
|
*/
|
|
56
|
-
messages:
|
|
60
|
+
messages: any[];
|
|
57
61
|
/**
|
|
58
|
-
*
|
|
62
|
+
* Sets the ID that represents the local user.
|
|
59
63
|
*/
|
|
60
64
|
authorId: string | number;
|
|
61
65
|
/**
|
|
@@ -83,13 +87,34 @@ export declare class ChatComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
83
87
|
*/
|
|
84
88
|
placeholder: string;
|
|
85
89
|
/**
|
|
86
|
-
*
|
|
90
|
+
* Controls the width of the message between the predefined options.
|
|
87
91
|
*
|
|
88
92
|
* @default 'standard'
|
|
89
93
|
*/
|
|
90
94
|
messageWidthMode: MessageWidthMode;
|
|
95
|
+
/**
|
|
96
|
+
* Controls the visibility of timestamps in messages.
|
|
97
|
+
*
|
|
98
|
+
* @default 'focus'
|
|
99
|
+
*/
|
|
100
|
+
timestampVisibility: TimestampVisibilityMode;
|
|
101
|
+
/**
|
|
102
|
+
* Controls the visibility of usernames in messages.
|
|
103
|
+
* When set to `true`, the username displays above each message bubble.
|
|
104
|
+
*
|
|
105
|
+
* @default true
|
|
106
|
+
*/
|
|
107
|
+
showUsername: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Controls the avatar visibility for the messages.
|
|
110
|
+
* When set to `true`, the user avatar displays next to each message bubble.
|
|
111
|
+
*
|
|
112
|
+
* @default true
|
|
113
|
+
*/
|
|
114
|
+
showAvatar: boolean;
|
|
91
115
|
/**
|
|
92
116
|
* Enables the expand or collapse functionality for messages.
|
|
117
|
+
*
|
|
93
118
|
* @default false
|
|
94
119
|
*/
|
|
95
120
|
allowMessageCollapse: boolean;
|
|
@@ -106,35 +131,47 @@ export declare class ChatComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
106
131
|
*/
|
|
107
132
|
enableFileSelect: boolean | FileSelectSettings;
|
|
108
133
|
/**
|
|
109
|
-
*
|
|
134
|
+
* Sets the actions of the message toolbar.
|
|
110
135
|
* These actions display in the message toolbar and let you perform specific operations on the message.
|
|
136
|
+
*
|
|
111
137
|
* @default []
|
|
112
138
|
*/
|
|
113
139
|
messageToolbarActions: MessageAction[];
|
|
114
140
|
/**
|
|
115
141
|
* Sets the value of the Message Box.
|
|
142
|
+
*
|
|
116
143
|
* @default ''
|
|
117
144
|
*/
|
|
118
145
|
inputValue: string;
|
|
119
146
|
/**
|
|
120
|
-
*
|
|
147
|
+
* Sets the settings for the author's messages.
|
|
148
|
+
*/
|
|
149
|
+
authorMessageSettings: MessageSettings;
|
|
150
|
+
/**
|
|
151
|
+
* Sets the settings for the receivers' messages.
|
|
152
|
+
*/
|
|
153
|
+
receiverMessageSettings: MessageSettings;
|
|
154
|
+
/**
|
|
155
|
+
* Sets the default actions that display in the message context menu.
|
|
121
156
|
*
|
|
122
157
|
* @default [{ id: 'copy', label: 'Copy', icon: 'copy', svgIcon: copyIcon, disabled: false }, { id: 'reply', label: 'Reply', icon: 'undo', svgIcon: undoIcon, disabled: false }]
|
|
123
158
|
*/
|
|
124
159
|
defaultContextMenuActions: MessageAction[];
|
|
125
160
|
/**
|
|
126
|
-
*
|
|
161
|
+
* Sets the actions that display in the message as a context menu.
|
|
127
162
|
* These actions display as menu items and let you perform specific operations on the message.
|
|
128
163
|
* The default actions are `copy` and `reply` and are defined by their `id`.
|
|
129
164
|
*/
|
|
130
165
|
set messageContextMenuActions(actions: MessageAction[] | null);
|
|
131
166
|
get messageContextMenuActions(): MessageAction[];
|
|
132
167
|
/**
|
|
133
|
-
*
|
|
168
|
+
* Sets the default actions that display in the file actions DropDownButton.
|
|
169
|
+
*
|
|
170
|
+
* @default [{ id: 'download', label: 'Download', icon: 'download', svgIcon: downloadIcon, disabled: false }]
|
|
134
171
|
*/
|
|
135
172
|
defaultFileActions: FileAction[];
|
|
136
173
|
/**
|
|
137
|
-
*
|
|
174
|
+
* Sets the actions that display in the file as items of a DropDownButton.
|
|
138
175
|
* These actions display when you click the file DropDownButton and let you perform specific operations on the file.
|
|
139
176
|
* The default action is `download` and is defined by its `id`.
|
|
140
177
|
*
|
|
@@ -143,17 +180,30 @@ export declare class ChatComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
143
180
|
set fileActions(actions: FileAction[] | null);
|
|
144
181
|
get fileActions(): FileAction[];
|
|
145
182
|
/**
|
|
146
|
-
* Sets the
|
|
147
|
-
*
|
|
148
|
-
* @default
|
|
183
|
+
* Sets the layout of the files in the message bubble.
|
|
184
|
+
*
|
|
185
|
+
* @default 'vertical'
|
|
149
186
|
*/
|
|
150
|
-
|
|
187
|
+
set messageFilesLayout(layout: FilesLayoutMode);
|
|
188
|
+
/**
|
|
189
|
+
* Sets the layout of the suggestions above the message input box.
|
|
190
|
+
*
|
|
191
|
+
* @default 'scroll'
|
|
192
|
+
*/
|
|
193
|
+
set suggestionsLayout(layoutMode: SuggestionsLayoutMode);
|
|
194
|
+
/**
|
|
195
|
+
* Sets the layout of the quick actions suggested below the messages.
|
|
196
|
+
*
|
|
197
|
+
* @default 'scroll'
|
|
198
|
+
*/
|
|
199
|
+
set quickActionsLayout(layoutMode: QuickActionsLayoutMode);
|
|
151
200
|
/**
|
|
152
|
-
* Sets the
|
|
201
|
+
* Sets the suggestions that display in the message input box.
|
|
202
|
+
* Suggestions display as a list of clickable items that let you quickly insert predefined text into the message input.
|
|
153
203
|
*
|
|
154
|
-
* @default
|
|
204
|
+
* @default []
|
|
155
205
|
*/
|
|
156
|
-
|
|
206
|
+
suggestions: ChatSuggestion[];
|
|
157
207
|
/**
|
|
158
208
|
* Sets the send button settings for the Chat component.
|
|
159
209
|
* Allows customization of the send button appearance, icons and disabled state.
|
|
@@ -163,69 +213,77 @@ export declare class ChatComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
163
213
|
sendButtonSettings: SendButtonSettings;
|
|
164
214
|
/**
|
|
165
215
|
* Sets the names of the model fields from which the Chat reads its data.
|
|
166
|
-
* Lets you map custom data
|
|
216
|
+
* Lets you map custom data types to the expected `Message` format.
|
|
167
217
|
*/
|
|
168
218
|
set modelFields(value: ConversationalUIModelFields);
|
|
169
219
|
get modelFields(): ConversationalUIModelFields;
|
|
170
220
|
/**
|
|
171
|
-
*
|
|
221
|
+
* Fires when the user sends a message by clicking the **Send** button or pressing **Enter**.
|
|
172
222
|
*
|
|
173
223
|
* The message is not automatically added to the `messages` array.
|
|
174
224
|
*/
|
|
175
225
|
sendMessage: EventEmitter<SendMessageEvent>;
|
|
176
226
|
/**
|
|
177
|
-
*
|
|
227
|
+
* Fires when the user clicks a quick action button in the message toolbar.
|
|
178
228
|
*/
|
|
179
229
|
toolbarActionClick: EventEmitter<MessageActionEvent>;
|
|
180
230
|
/**
|
|
181
|
-
*
|
|
231
|
+
* Fires when the user clicks an action in the message context menu.
|
|
182
232
|
*/
|
|
183
233
|
contextMenuActionClick: EventEmitter<MessageActionEvent>;
|
|
184
234
|
/**
|
|
185
|
-
*
|
|
235
|
+
* Fires when the user clicks an action in the file context menu.
|
|
186
236
|
*/
|
|
187
237
|
fileActionClick: EventEmitter<FileActionEvent>;
|
|
188
238
|
/**
|
|
189
|
-
*
|
|
239
|
+
* Fires when the user clicks an action in the file context menu.
|
|
190
240
|
*/
|
|
191
241
|
download: EventEmitter<FileDownloadEvent>;
|
|
192
242
|
/**
|
|
193
|
-
*
|
|
243
|
+
* Fires when the user clicks a quick action button.
|
|
194
244
|
* The Chat internally handles [known actions](slug:api_conversational-ui_actiontype) such as `reply`, `openUrl`, and `call`.
|
|
195
245
|
*
|
|
196
246
|
* The event is preventable. Calling [`preventDefault`](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) suppresses the built-in action.
|
|
197
247
|
*/
|
|
198
248
|
executeAction: EventEmitter<ExecuteActionEvent>;
|
|
199
249
|
/**
|
|
200
|
-
*
|
|
250
|
+
* Fires when the user clicks a suggestion in the message input box.
|
|
201
251
|
*/
|
|
202
252
|
suggestionExecute: EventEmitter<ChatSuggestion>;
|
|
203
253
|
/**
|
|
204
|
-
*
|
|
254
|
+
* Fires when the user selects a file in the message input box.
|
|
205
255
|
*/
|
|
206
256
|
fileSelect: EventEmitter<SelectEvent>;
|
|
207
257
|
/**
|
|
208
|
-
*
|
|
258
|
+
* Fires when the user removes a file from the message input box.
|
|
209
259
|
*/
|
|
210
260
|
fileRemove: EventEmitter<ChatFile>;
|
|
211
261
|
/**
|
|
212
|
-
*
|
|
262
|
+
* Fires when the user unpins the pinned message.
|
|
213
263
|
* This event triggers when the user clicks the delete button on the pinned message.
|
|
214
264
|
*/
|
|
215
265
|
unpin: EventEmitter<Message>;
|
|
216
266
|
/**
|
|
217
|
-
*
|
|
267
|
+
* Fires when the user types in the message input box.
|
|
218
268
|
*/
|
|
219
269
|
inputValueChange: EventEmitter<string>;
|
|
220
270
|
get className(): string;
|
|
221
271
|
get dirAttr(): string;
|
|
272
|
+
set messagesContextMenu(contextMenu: ContextMenuComponent);
|
|
222
273
|
attachmentTemplate: AttachmentTemplateDirective;
|
|
223
274
|
chatHeaderTemplate: ChatHeaderTemplateDirective;
|
|
275
|
+
chatNoDataTemplate: NoDataTemplateDirective;
|
|
276
|
+
authorMessageContentTemplate: AuthorMessageContentTemplateDirective;
|
|
277
|
+
receiverMessageContentTemplate: ReceiverMessageContentTemplateDirective;
|
|
278
|
+
messageContentTemplate: MessageContentTemplateDirective;
|
|
279
|
+
authorMessageTemplate: AuthorMessageTemplateDirective;
|
|
280
|
+
receiverMessageTemplate: ReceiverMessageTemplateDirective;
|
|
224
281
|
messageTemplate: MessageTemplateDirective;
|
|
225
282
|
timestampTemplate: ChatTimestampTemplateDirective;
|
|
226
283
|
suggestionTemplate: ChatSuggestionTemplateDirective;
|
|
227
284
|
statusTemplate: ChatStatusTemplateDirective;
|
|
228
285
|
messageBoxTemplate: ChatMessageBoxTemplateDirective;
|
|
286
|
+
userStatusTemplate: ChatUserStatusTemplateDirective;
|
|
229
287
|
messageBox: MessageBoxComponent;
|
|
230
288
|
/**
|
|
231
289
|
* @hidden
|
|
@@ -233,9 +291,15 @@ export declare class ChatComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
233
291
|
messageList: ViewContainerRef;
|
|
234
292
|
/**
|
|
235
293
|
* @hidden
|
|
236
|
-
* Returns processed messages when model fields are used, otherwise returns original messages
|
|
294
|
+
* Returns processed messages when model fields are used, otherwise returns original messages.
|
|
237
295
|
*/
|
|
238
296
|
get processedMessages(): Message[];
|
|
297
|
+
/**
|
|
298
|
+
* Gets the actions available in the message context menu.
|
|
299
|
+
*
|
|
300
|
+
* @hidden
|
|
301
|
+
*/
|
|
302
|
+
get contextMenuActions(): any[];
|
|
239
303
|
/**
|
|
240
304
|
* @hidden
|
|
241
305
|
*/
|
|
@@ -261,6 +325,9 @@ export declare class ChatComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
261
325
|
private _modelFields;
|
|
262
326
|
private _messageContextMenuActions;
|
|
263
327
|
private _fileActions;
|
|
328
|
+
private _cachedProcessedMessages;
|
|
329
|
+
private _lastMessagesReference;
|
|
330
|
+
private _lastModelFields;
|
|
264
331
|
constructor(localization: LocalizationService, zone: NgZone, renderer: Renderer2, element: ElementRef, chatService: ChatService);
|
|
265
332
|
/**
|
|
266
333
|
* @hidden
|
|
@@ -290,9 +357,21 @@ export declare class ChatComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
290
357
|
* @hidden
|
|
291
358
|
*/
|
|
292
359
|
scrollToPinnedMessage(): void;
|
|
360
|
+
/**
|
|
361
|
+
* @hidden
|
|
362
|
+
*/
|
|
363
|
+
onContextMenuAction(action: MessageAction): void;
|
|
364
|
+
/**
|
|
365
|
+
* @hidden
|
|
366
|
+
*/
|
|
367
|
+
handleMenuClose(event: ContextMenuPopupEvent): void;
|
|
368
|
+
/**
|
|
369
|
+
* @hidden
|
|
370
|
+
*/
|
|
371
|
+
onActionButtonClick(event: MouseEvent): void;
|
|
293
372
|
private findLastPinnedMessage;
|
|
294
373
|
private updateChatServiceProperties;
|
|
295
374
|
private mergeWithDefaultActions;
|
|
296
375
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatComponent, never>;
|
|
297
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ChatComponent, "kendo-chat", never, { "messages": { "alias": "messages"; "required": false; }; "authorId": { "alias": "authorId"; "required": false; }; "messageBoxType": { "alias": "messageBoxType"; "required": false; }; "height": { "alias": "height"; "required": false; }; "width": { "alias": "width"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "messageWidthMode": { "alias": "messageWidthMode"; "required": false; }; "allowMessageCollapse": { "alias": "allowMessageCollapse"; "required": false; }; "enableSpeechToText": { "alias": "enableSpeechToText"; "required": false; }; "enableFileSelect": { "alias": "enableFileSelect"; "required": false; }; "messageToolbarActions": { "alias": "messageToolbarActions"; "required": false; }; "inputValue": { "alias": "inputValue"; "required": false; }; "messageContextMenuActions": { "alias": "messageContextMenuActions"; "required": false; }; "fileActions": { "alias": "fileActions"; "required": false; }; "
|
|
376
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChatComponent, "kendo-chat", never, { "messages": { "alias": "messages"; "required": false; }; "authorId": { "alias": "authorId"; "required": false; }; "messageBoxType": { "alias": "messageBoxType"; "required": false; }; "height": { "alias": "height"; "required": false; }; "width": { "alias": "width"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "messageWidthMode": { "alias": "messageWidthMode"; "required": false; }; "timestampVisibility": { "alias": "timestampVisibility"; "required": false; }; "showUsername": { "alias": "showUsername"; "required": false; }; "showAvatar": { "alias": "showAvatar"; "required": false; }; "allowMessageCollapse": { "alias": "allowMessageCollapse"; "required": false; }; "enableSpeechToText": { "alias": "enableSpeechToText"; "required": false; }; "enableFileSelect": { "alias": "enableFileSelect"; "required": false; }; "messageToolbarActions": { "alias": "messageToolbarActions"; "required": false; }; "inputValue": { "alias": "inputValue"; "required": false; }; "authorMessageSettings": { "alias": "authorMessageSettings"; "required": false; }; "receiverMessageSettings": { "alias": "receiverMessageSettings"; "required": false; }; "messageContextMenuActions": { "alias": "messageContextMenuActions"; "required": false; }; "fileActions": { "alias": "fileActions"; "required": false; }; "messageFilesLayout": { "alias": "messageFilesLayout"; "required": false; }; "suggestionsLayout": { "alias": "suggestionsLayout"; "required": false; }; "quickActionsLayout": { "alias": "quickActionsLayout"; "required": false; }; "suggestions": { "alias": "suggestions"; "required": false; }; "sendButtonSettings": { "alias": "sendButtonSettings"; "required": false; }; "modelFields": { "alias": "modelFields"; "required": false; }; }, { "sendMessage": "sendMessage"; "toolbarActionClick": "toolbarActionClick"; "contextMenuActionClick": "contextMenuActionClick"; "fileActionClick": "fileActionClick"; "download": "download"; "executeAction": "executeAction"; "suggestionExecute": "suggestionExecute"; "fileSelect": "fileSelect"; "fileRemove": "fileRemove"; "unpin": "unpin"; "inputValueChange": "inputValueChange"; }, ["attachmentTemplate", "chatHeaderTemplate", "chatNoDataTemplate", "authorMessageContentTemplate", "receiverMessageContentTemplate", "messageContentTemplate", "authorMessageTemplate", "receiverMessageTemplate", "messageTemplate", "timestampTemplate", "suggestionTemplate", "statusTemplate", "messageBoxTemplate", "userStatusTemplate"], never, true, never>;
|
|
298
377
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
export { ChatComponent } from './chat.component';
|
|
6
|
+
export { AttachmentTemplateDirective } from './templates/attachment-template.directive';
|
|
7
|
+
export { MessageContentTemplateDirective } from './templates/message-content-template.directive';
|
|
8
|
+
export { MessageTemplateDirective } from './templates/message-template.directive';
|
|
9
|
+
export { ChatUserStatusTemplateDirective } from './templates/user-status-template.directive';
|
|
10
|
+
export { ChatMessageBoxTemplateDirective } from './templates/message-box.directive';
|
|
11
|
+
export { ChatHeaderTemplateDirective } from './templates/header-template.directive';
|
|
12
|
+
export { NoDataTemplateDirective } from './templates/no-data-template.directive';
|
|
13
|
+
export { ChatTimestampTemplateDirective } from './templates/timestamp-template.directive';
|
|
14
|
+
export { ChatStatusTemplateDirective } from './templates/status-template.directive';
|
|
15
|
+
export { AuthorMessageContentTemplateDirective } from './templates/author-message-content-template.directive';
|
|
16
|
+
export { ReceiverMessageContentTemplateDirective } from './templates/receiver-message-content-template.directive';
|
|
17
|
+
export { ReceiverMessageTemplateDirective } from './templates/receiver-message-template.directive';
|
|
18
|
+
export { AuthorMessageTemplateDirective } from './templates/author-message-template.directive';
|
package/chat/chat.module.d.ts
CHANGED
|
@@ -6,13 +6,20 @@ import * as i0 from "@angular/core";
|
|
|
6
6
|
import * as i1 from "./chat.component";
|
|
7
7
|
import * as i2 from "./l10n/custom-messages.component";
|
|
8
8
|
import * as i3 from "./templates/attachment-template.directive";
|
|
9
|
-
import * as i4 from "./templates/message-template.directive";
|
|
10
|
-
import * as i5 from "./
|
|
11
|
-
import * as i6 from "./templates/message-
|
|
12
|
-
import * as i7 from "./templates/
|
|
13
|
-
import * as i8 from "./templates/
|
|
14
|
-
import * as i9 from "./templates/
|
|
15
|
-
import * as i10 from "./
|
|
9
|
+
import * as i4 from "./templates/author-message-content-template.directive";
|
|
10
|
+
import * as i5 from "./templates/receiver-message-content-template.directive";
|
|
11
|
+
import * as i6 from "./templates/message-content-template.directive";
|
|
12
|
+
import * as i7 from "./templates/author-message-template.directive";
|
|
13
|
+
import * as i8 from "./templates/receiver-message-template.directive";
|
|
14
|
+
import * as i9 from "./templates/message-template.directive";
|
|
15
|
+
import * as i10 from "./cards/hero-card.component";
|
|
16
|
+
import * as i11 from "./templates/message-box.directive";
|
|
17
|
+
import * as i12 from "./templates/header-template.directive";
|
|
18
|
+
import * as i13 from "./templates/no-data-template.directive";
|
|
19
|
+
import * as i14 from "./templates/timestamp-template.directive";
|
|
20
|
+
import * as i15 from "./templates/status-template.directive";
|
|
21
|
+
import * as i16 from "./templates/suggestion-template.directive";
|
|
22
|
+
import * as i17 from "./templates/user-status-template.directive";
|
|
16
23
|
/**
|
|
17
24
|
* Represents the [`NgModule`](link:site.data.urls.angular['ngmodules']) for the Chat component.
|
|
18
25
|
*
|
|
@@ -36,6 +43,6 @@ import * as i10 from "./templates/suggestion-template.directive";
|
|
|
36
43
|
*/
|
|
37
44
|
export declare class ChatModule {
|
|
38
45
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatModule, never>;
|
|
39
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ChatModule, never, [typeof i1.ChatComponent, typeof i2.CustomMessagesComponent, typeof i3.AttachmentTemplateDirective, typeof i4.
|
|
46
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ChatModule, never, [typeof i1.ChatComponent, typeof i2.CustomMessagesComponent, typeof i3.AttachmentTemplateDirective, typeof i4.AuthorMessageContentTemplateDirective, typeof i5.ReceiverMessageContentTemplateDirective, typeof i6.MessageContentTemplateDirective, typeof i7.AuthorMessageTemplateDirective, typeof i8.ReceiverMessageTemplateDirective, typeof i9.MessageTemplateDirective, typeof i10.HeroCardComponent, typeof i11.ChatMessageBoxTemplateDirective, typeof i12.ChatHeaderTemplateDirective, typeof i13.NoDataTemplateDirective, typeof i14.ChatTimestampTemplateDirective, typeof i15.ChatStatusTemplateDirective, typeof i16.ChatSuggestionTemplateDirective, typeof i17.ChatUserStatusTemplateDirective], [typeof i1.ChatComponent, typeof i2.CustomMessagesComponent, typeof i3.AttachmentTemplateDirective, typeof i4.AuthorMessageContentTemplateDirective, typeof i5.ReceiverMessageContentTemplateDirective, typeof i6.MessageContentTemplateDirective, typeof i7.AuthorMessageTemplateDirective, typeof i8.ReceiverMessageTemplateDirective, typeof i9.MessageTemplateDirective, typeof i10.HeroCardComponent, typeof i11.ChatMessageBoxTemplateDirective, typeof i12.ChatHeaderTemplateDirective, typeof i13.NoDataTemplateDirective, typeof i14.ChatTimestampTemplateDirective, typeof i15.ChatStatusTemplateDirective, typeof i16.ChatSuggestionTemplateDirective, typeof i17.ChatUserStatusTemplateDirective]>;
|
|
40
47
|
static ɵinj: i0.ɵɵInjectorDeclaration<ChatModule>;
|
|
41
48
|
}
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
import { ViewContainerRef, ElementRef } from '@angular/core';
|
|
6
6
|
import { SpeechToTextButtonSettings } from '@progress/kendo-angular-buttons';
|
|
7
7
|
import { MessageWidthMode } from '../api/message-width-mode';
|
|
8
|
-
import { FileAction, FileActionEvent, FileDownloadEvent, Message, MessageAction, MessageActionEvent,
|
|
8
|
+
import { FileAction, FileActionEvent, FileDownloadEvent, FilesLayoutMode, Message, MessageAction, MessageActionEvent, MessageSettings, QuickActionsLayoutMode, SendButtonSettings, SuggestionsLayoutMode } from '../api';
|
|
9
9
|
import { FileSelectSettings } from '@progress/kendo-angular-upload';
|
|
10
|
+
import { ContextMenuComponent } from '@progress/kendo-angular-menu';
|
|
11
|
+
import { TimestampVisibilityMode } from '../api/timestamp-visibility';
|
|
10
12
|
import * as i0 from "@angular/core";
|
|
11
13
|
/**
|
|
12
14
|
* @hidden
|
|
@@ -14,19 +16,32 @@ import * as i0 from "@angular/core";
|
|
|
14
16
|
export declare class ChatService {
|
|
15
17
|
authorId: string | number;
|
|
16
18
|
messageWidthMode: MessageWidthMode;
|
|
17
|
-
allowMessageCollapse: boolean;
|
|
18
19
|
messageToolbarActions: MessageAction[];
|
|
19
20
|
messageContextMenuActions: MessageAction[];
|
|
21
|
+
calculatedContextMenuActions: MessageAction[];
|
|
20
22
|
fileActions: FileAction[];
|
|
21
|
-
messageToolbarVisibility: MessageToolbarVisibility;
|
|
22
23
|
toggleMessageState: boolean;
|
|
23
24
|
reply: Message;
|
|
24
25
|
messages: Message[];
|
|
25
26
|
chatElement: ViewContainerRef;
|
|
26
27
|
messageElementsMap: Map<string | number, ElementRef>;
|
|
28
|
+
messagesContextMenu: ContextMenuComponent;
|
|
29
|
+
activeMessage: Message;
|
|
30
|
+
activeMessageElement: any;
|
|
31
|
+
selectOnMenuClose: boolean;
|
|
32
|
+
active: boolean;
|
|
33
|
+
messageFilesLayout: FilesLayoutMode;
|
|
34
|
+
timestampVisibility: TimestampVisibilityMode;
|
|
35
|
+
showUsername: boolean;
|
|
36
|
+
showAvatar: boolean;
|
|
27
37
|
private _enableSpeechToText;
|
|
28
38
|
private _enableFileSelect;
|
|
29
39
|
private _sendButtonSettings;
|
|
40
|
+
private _suggestionsLayout;
|
|
41
|
+
private _quickActionsLayout;
|
|
42
|
+
_authorMessageSettings: MessageSettings;
|
|
43
|
+
_receiverMessageSettings: MessageSettings;
|
|
44
|
+
private _allowMessageCollapse;
|
|
30
45
|
private subjects;
|
|
31
46
|
toolbarAction$: import("rxjs").Observable<MessageActionEvent>;
|
|
32
47
|
contextMenuAction$: import("rxjs").Observable<MessageActionEvent>;
|
|
@@ -34,17 +49,35 @@ export declare class ChatService {
|
|
|
34
49
|
fileDownload$: import("rxjs").Observable<FileDownloadEvent>;
|
|
35
50
|
replyReferenceClick$: import("rxjs").Observable<string | number>;
|
|
36
51
|
inputValueChange$: import("rxjs").Observable<string>;
|
|
52
|
+
contextMenuVisibilityChange$: import("rxjs").Observable<boolean>;
|
|
53
|
+
suggestionsLayoutChange$: import("rxjs").Observable<SuggestionsLayoutMode>;
|
|
54
|
+
quickActionsLayoutChange$: import("rxjs").Observable<SuggestionsLayoutMode>;
|
|
55
|
+
authorMessageSettingsChange$: import("rxjs").Observable<MessageSettings>;
|
|
56
|
+
receiverMessageSettingsChange$: import("rxjs").Observable<MessageSettings>;
|
|
57
|
+
allowMessageCollapseChange$: import("rxjs").Observable<boolean>;
|
|
58
|
+
set authorMessageSettings(settings: MessageSettings);
|
|
59
|
+
get authorMessageSettings(): MessageSettings;
|
|
60
|
+
set receiverMessageSettings(settings: MessageSettings);
|
|
61
|
+
get receiverMessageSettings(): MessageSettings;
|
|
37
62
|
set enableSpeechToText(settings: boolean | SpeechToTextButtonSettings);
|
|
38
63
|
get enableSpeechToText(): SpeechToTextButtonSettings;
|
|
39
64
|
set enableFileSelect(settings: boolean | FileSelectSettings);
|
|
40
65
|
get enableFileSelect(): FileSelectSettings;
|
|
41
66
|
set sendButtonSettings(settings: boolean | SendButtonSettings);
|
|
42
67
|
get sendButtonSettings(): SendButtonSettings;
|
|
68
|
+
set suggestionsLayout(layoutMode: SuggestionsLayoutMode);
|
|
69
|
+
get suggestionsLayout(): SuggestionsLayoutMode;
|
|
70
|
+
set quickActionsLayout(layoutMode: QuickActionsLayoutMode);
|
|
71
|
+
get quickActionsLayout(): QuickActionsLayoutMode;
|
|
72
|
+
set allowMessageCollapse(value: boolean);
|
|
73
|
+
get allowMessageCollapse(): boolean;
|
|
74
|
+
calculateContextMenuActions(isOwn: boolean): void;
|
|
43
75
|
emit(subjectKey: string, value?: any): void;
|
|
44
76
|
getMessageById(id: string | number): Message | undefined;
|
|
45
77
|
registerMessageElement(messageId: string | number, elementRef: ElementRef): void;
|
|
46
78
|
unregisterMessageElement(messageId: string | number): void;
|
|
47
79
|
scrollToMessage(messageId: string | number): void;
|
|
80
|
+
focusActiveMessageElement(): void;
|
|
48
81
|
private updateComponentSettings;
|
|
49
82
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatService, never>;
|
|
50
83
|
static ɵprov: i0.ɵɵInjectableDeclaration<ChatService>;
|
|
@@ -84,12 +84,6 @@ export interface ConversationalUIModelFields {
|
|
|
84
84
|
* @default "isPinned"
|
|
85
85
|
*/
|
|
86
86
|
isPinnedField?: string;
|
|
87
|
-
/**
|
|
88
|
-
* Field name for the user who pinned the message.
|
|
89
|
-
*
|
|
90
|
-
* @default "pinnedBy"
|
|
91
|
-
*/
|
|
92
|
-
pinnedByField?: string;
|
|
93
87
|
/**
|
|
94
88
|
* Field name for reply-to message ID.
|
|
95
89
|
*
|