@progress/kendo-angular-conversational-ui 20.0.0-develop.4 → 20.0.0-develop.5
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/action.interface.d.ts +1 -1
- package/chat/api/attachment.interface.d.ts +1 -1
- package/chat/api/chat-file-interface.d.ts +41 -0
- package/chat/api/chat-suggestion.interface.d.ts +25 -0
- package/chat/api/file-action.d.ts +42 -0
- package/chat/api/file-download-event.interface.d.ts +21 -0
- package/chat/api/index.d.ts +8 -0
- package/chat/api/message-action.d.ts +42 -0
- package/{esm2022/chat/chat.directives.mjs → chat/api/message-toolbar-visibility.d.ts} +4 -4
- package/chat/api/message-width-mode.d.ts +10 -0
- package/chat/api/message.interface.d.ts +30 -12
- package/chat/api/send-button-settings.d.ts +15 -0
- package/chat/api/user.interface.d.ts +4 -0
- package/chat/attachment.component.d.ts +1 -1
- package/chat/cards/hero-card.component.d.ts +1 -1
- package/chat/chat-file.component.d.ts +34 -0
- package/chat/chat-item.d.ts +1 -0
- package/chat/chat-view.d.ts +1 -1
- package/chat/chat.component.d.ts +218 -19
- package/chat/chat.module.d.ts +8 -4
- package/chat/common/chat.service.d.ts +51 -0
- package/chat/{chat.directives.d.ts → common/models/default-model-fields.d.ts} +5 -4
- package/chat/common/models/message-box-options.d.ts +1 -1
- package/chat/common/models/model-fields.d.ts +111 -0
- package/chat/common/utils.d.ts +50 -0
- package/chat/l10n/messages.d.ts +40 -3
- package/chat/message-attachments.component.d.ts +1 -4
- package/chat/message-box.component.d.ts +54 -25
- package/chat/message-list.component.d.ts +18 -11
- package/chat/message-reference-content.component.d.ts +24 -0
- package/chat/message.component.d.ts +54 -6
- package/chat/suggested-actions.component.d.ts +17 -4
- package/chat/templates/header-template.directive.d.ts +24 -0
- package/chat/{message-box.directive.d.ts → templates/message-box.directive.d.ts} +1 -1
- package/chat/templates/status-template.directive.d.ts +24 -0
- package/chat/templates/suggestion-template.directive.d.ts +24 -0
- package/chat/templates/timestamp-template.directive.d.ts +28 -0
- package/codemods/template-transformer/index.js +94 -0
- package/codemods/utils.js +609 -0
- package/codemods/v20/chat-user.js +50 -0
- package/conversational-ui.module.d.ts +11 -7
- package/directives.d.ts +9 -5
- package/esm2022/chat/api/chat-file-interface.mjs +5 -0
- package/esm2022/chat/api/chat-suggestion.interface.mjs +5 -0
- package/esm2022/chat/api/file-action.mjs +5 -0
- package/esm2022/chat/api/file-download-event.interface.mjs +5 -0
- package/esm2022/chat/api/index.mjs +8 -0
- package/esm2022/chat/api/message-action.mjs +5 -0
- package/esm2022/chat/api/message-toolbar-visibility.mjs +5 -0
- package/esm2022/chat/api/message-width-mode.mjs +5 -0
- package/esm2022/chat/api/send-button-settings.mjs +5 -0
- package/esm2022/chat/attachment.component.mjs +1 -1
- package/esm2022/chat/builtin-actions.mjs +1 -1
- package/esm2022/chat/cards/hero-card.component.mjs +1 -1
- package/esm2022/chat/chat-file.component.mjs +141 -0
- package/esm2022/chat/chat-item.mjs +1 -0
- package/esm2022/chat/chat-view.mjs +2 -2
- package/esm2022/chat/chat.component.mjs +518 -57
- package/esm2022/chat/chat.module.mjs +8 -4
- package/esm2022/chat/common/chat.service.mjs +97 -0
- package/esm2022/chat/common/models/default-model-fields.mjs +26 -0
- package/esm2022/chat/common/models/model-fields.mjs +5 -0
- package/esm2022/chat/common/utils.mjs +127 -0
- package/esm2022/chat/l10n/messages.mjs +60 -5
- package/esm2022/chat/message-attachments.component.mjs +1 -4
- package/esm2022/chat/message-box.component.mjs +360 -111
- package/esm2022/chat/message-list.component.mjs +166 -96
- package/esm2022/chat/message-reference-content.component.mjs +75 -0
- package/esm2022/chat/message.component.mjs +448 -35
- package/esm2022/chat/suggested-actions.component.mjs +151 -41
- package/esm2022/chat/templates/header-template.directive.mjs +33 -0
- package/esm2022/chat/{message-box.directive.mjs → templates/message-box.directive.mjs} +1 -1
- package/esm2022/chat/templates/status-template.directive.mjs +33 -0
- package/esm2022/chat/templates/suggestion-template.directive.mjs +33 -0
- package/esm2022/chat/templates/timestamp-template.directive.mjs +39 -0
- package/esm2022/conversational-ui.module.mjs +12 -8
- package/esm2022/directives.mjs +12 -4
- package/esm2022/index.mjs +9 -3
- package/esm2022/package-metadata.mjs +2 -2
- package/fesm2022/progress-kendo-angular-conversational-ui.mjs +4986 -3125
- package/index.d.ts +10 -3
- package/package.json +29 -12
- /package/chat/{attachment-template.directive.d.ts → templates/attachment-template.directive.d.ts} +0 -0
- /package/chat/{message-template.directive.d.ts → templates/message-template.directive.d.ts} +0 -0
- /package/esm2022/chat/{attachment-template.directive.mjs → templates/attachment-template.directive.mjs} +0 -0
- /package/esm2022/chat/{message-template.directive.mjs → templates/message-template.directive.mjs} +0 -0
package/chat/chat.component.d.ts
CHANGED
@@ -2,14 +2,26 @@
|
|
2
2
|
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
5
|
-
import { AfterViewInit, ElementRef, EventEmitter, OnDestroy, NgZone } from '@angular/core';
|
6
|
-
import { AttachmentTemplateDirective } from './attachment-template.directive';
|
5
|
+
import { AfterViewInit, ElementRef, EventEmitter, OnDestroy, NgZone, Renderer2, SimpleChanges, OnInit, ViewContainerRef } from '@angular/core';
|
6
|
+
import { AttachmentTemplateDirective } from './templates/attachment-template.directive';
|
7
7
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
8
|
-
import { MessageTemplateDirective } from './message-template.directive';
|
9
|
-
import { ExecuteActionEvent, Message, SendMessageEvent,
|
8
|
+
import { MessageTemplateDirective } from './templates/message-template.directive';
|
9
|
+
import { ExecuteActionEvent, FileAction, Message, SendMessageEvent, FileActionEvent, FileDownloadEvent, SendButtonSettings, MessageToolbarVisibility } from './api';
|
10
10
|
import { MessageBoxType } from './common/models/message-box-options';
|
11
|
-
import { ChatMessageBoxTemplateDirective } from './message-box.directive';
|
11
|
+
import { ChatMessageBoxTemplateDirective } from './templates/message-box.directive';
|
12
12
|
import { MessageBoxComponent } from './message-box.component';
|
13
|
+
import { MessageWidthMode } from './api/message-width-mode';
|
14
|
+
import { ChatService } from './common/chat.service';
|
15
|
+
import { ChatHeaderTemplateDirective } from './templates/header-template.directive';
|
16
|
+
import { SpeechToTextButtonSettings } from '@progress/kendo-angular-buttons';
|
17
|
+
import { MessageAction, MessageActionEvent } from './api/message-action';
|
18
|
+
import { ChatSuggestion } from './api/chat-suggestion.interface';
|
19
|
+
import { SelectEvent, FileSelectSettings } from '@progress/kendo-angular-upload';
|
20
|
+
import { ChatFile } from './api/chat-file-interface';
|
21
|
+
import { ConversationalUIModelFields } from './common/models/model-fields';
|
22
|
+
import { ChatTimestampTemplateDirective } from './templates/timestamp-template.directive';
|
23
|
+
import { ChatStatusTemplateDirective } from './templates/status-template.directive';
|
24
|
+
import { ChatSuggestionTemplateDirective } from './templates/suggestion-template.directive';
|
13
25
|
import * as i0 from "@angular/core";
|
14
26
|
/**
|
15
27
|
* Represents the [Kendo UI Chat component for Angular](slug:overview_convui).
|
@@ -21,18 +33,21 @@ import * as i0 from "@angular/core";
|
|
21
33
|
* ```html
|
22
34
|
* <kendo-chat
|
23
35
|
* [messages]="messages"
|
24
|
-
* [
|
36
|
+
* [authorId]="authorId"
|
25
37
|
* (sendMessage)="onSendMessage($event)"
|
26
38
|
* (executeAction)="onExecuteAction($event)">
|
27
39
|
* </kendo-chat>
|
28
40
|
* ```
|
29
41
|
*
|
30
42
|
* @remarks
|
31
|
-
* Supported children components are: {@link CustomMessagesComponent}, {@link HeroCardComponent}.
|
43
|
+
* Supported children components are: {@link CustomMessagesComponent}, {@link HeroCardComponent}, {@link AttachmentTemplateDirective}, {@link ChatHeaderTemplateDirective}, {@link ChatMessageBoxTemplateDirective}, {@link MessageTemplateDirective}, {@link ChatStatusTemplateDirective}, {@link ChatSuggestionTemplateDirective}, {@link ChatTimestampTemplateDirective}.
|
32
44
|
*/
|
33
|
-
export declare class ChatComponent implements AfterViewInit, OnDestroy {
|
45
|
+
export declare class ChatComponent implements OnInit, AfterViewInit, OnDestroy {
|
34
46
|
private localization;
|
35
47
|
private zone;
|
48
|
+
private renderer;
|
49
|
+
private element;
|
50
|
+
private chatService;
|
36
51
|
/**
|
37
52
|
* Defines the array of messages displayed in the Chat.
|
38
53
|
* Each message can include a timestamp for unique identification.
|
@@ -40,23 +55,142 @@ export declare class ChatComponent implements AfterViewInit, OnDestroy {
|
|
40
55
|
*/
|
41
56
|
messages: Message[];
|
42
57
|
/**
|
43
|
-
* Specifies the
|
44
|
-
* The User ID is used to distinguish messages authored by the local user.
|
58
|
+
* Specifies the id representing the local user.
|
45
59
|
*/
|
46
|
-
|
60
|
+
authorId: string | number;
|
47
61
|
/**
|
48
62
|
* Determines the type of input used in the message box.
|
49
|
-
*
|
50
|
-
*
|
51
|
-
*
|
63
|
+
* ([see example](slug:message_chat)).
|
64
|
+
* @default 'textarea'
|
65
|
+
*
|
66
|
+
* @hidden
|
52
67
|
*/
|
53
68
|
messageBoxType: MessageBoxType;
|
69
|
+
/**
|
70
|
+
* Sets the height of the Chat component.
|
71
|
+
* Accepts a string with CSS units (e.g., '400px', '50%') or a number (interpreted as pixels).
|
72
|
+
* The minimum height is `600px`.
|
73
|
+
*/
|
74
|
+
height: string | number;
|
75
|
+
/**
|
76
|
+
* Sets the width of the Chat component.
|
77
|
+
* Accepts a string with CSS units (e.g., '400px', '50%') or a number (interpreted as pixels).
|
78
|
+
* The minimum width is `320px`.
|
79
|
+
*/
|
80
|
+
width: string | number;
|
81
|
+
/**
|
82
|
+
* Sets the placeholder text for the message input box.
|
83
|
+
*/
|
84
|
+
placeholder: string;
|
85
|
+
/**
|
86
|
+
* Switches the width of the message between the predefined options.
|
87
|
+
*
|
88
|
+
* @default 'standard'
|
89
|
+
*/
|
90
|
+
messageWidthMode: MessageWidthMode;
|
91
|
+
/**
|
92
|
+
* Enables the expand/collapse functionality of the messages.
|
93
|
+
*
|
94
|
+
* @default `false`
|
95
|
+
*/
|
96
|
+
allowMessageCollapse: boolean;
|
97
|
+
/**
|
98
|
+
* Sets the Speech to Text button settings.
|
99
|
+
*
|
100
|
+
* @default true
|
101
|
+
*/
|
102
|
+
enableSpeechToText: boolean | SpeechToTextButtonSettings;
|
103
|
+
/**
|
104
|
+
* Sets the File Select settings.
|
105
|
+
*
|
106
|
+
* @default true
|
107
|
+
*/
|
108
|
+
enableFileSelect: boolean | FileSelectSettings;
|
109
|
+
/**
|
110
|
+
* Specifies the actions available in the message toolbar.
|
111
|
+
* These actions are displayed in the message toolbar and can be used to perform specific operations on the message.
|
112
|
+
*
|
113
|
+
* @default []
|
114
|
+
*/
|
115
|
+
messageToolbarActions: MessageAction[];
|
116
|
+
/**
|
117
|
+
* Sets the value of the Message Box.
|
118
|
+
*/
|
119
|
+
inputValue: string;
|
120
|
+
/**
|
121
|
+
* Specifies the default actions available in the message context menu.
|
122
|
+
*
|
123
|
+
* @default [{ id: 'copy', label: 'Copy', icon: 'copy', svgIcon: copyIcon, disabled: false }, { id: 'reply', label: 'Reply', icon: 'undo', svgIcon: undoIcon, disabled: false }]
|
124
|
+
*/
|
125
|
+
defaultContextMenuActions: MessageAction[];
|
126
|
+
/**
|
127
|
+
* Specifies the actions available in the message as a context menu.
|
128
|
+
* These actions are displayed as menu items and can be used to perform specific operations on the message.
|
129
|
+
* The default actions are `copy` and `reply` and are defined by their `id`.
|
130
|
+
*/
|
131
|
+
set messageContextMenuActions(actions: MessageAction[] | null);
|
132
|
+
get messageContextMenuActions(): MessageAction[];
|
133
|
+
/**
|
134
|
+
* Specifies the default actions available in the file actions DropDownButton.
|
135
|
+
*/
|
136
|
+
defaultFileActions: FileAction[];
|
137
|
+
/**
|
138
|
+
* Specifies the actions available in the file as items of a DropDownButton.
|
139
|
+
* These actions are displayed when clicking on the file DropDownButton and can be used to perform specific operations on the file.
|
140
|
+
* The default action is `download` and is defined by its `id`.
|
141
|
+
*
|
142
|
+
* @default [{ id: 'download', label: 'Download', icon: 'download', svgIcon: downloadIcon, disabled: false }]
|
143
|
+
*/
|
144
|
+
set fileActions(actions: FileAction[] | null);
|
145
|
+
get fileActions(): FileAction[];
|
146
|
+
/**
|
147
|
+
* Sets the suggestions to display in the message input box.
|
148
|
+
* Suggestions are displayed as a list of clickable items that can be used to quickly insert predefined text into the message input.
|
149
|
+
*
|
150
|
+
* @default []
|
151
|
+
*/
|
152
|
+
suggestions: ChatSuggestion[];
|
153
|
+
/**
|
154
|
+
* Sets the visibility of the message toolbar.
|
155
|
+
*
|
156
|
+
* @default 'hidden'
|
157
|
+
*/
|
158
|
+
messageToolbarVisibility: MessageToolbarVisibility;
|
159
|
+
/**
|
160
|
+
* Sets the send button settings for the Chat component.
|
161
|
+
* Allows customization of the send button appearance, icons and disabled state.
|
162
|
+
*
|
163
|
+
* @default defaultButtonSettings
|
164
|
+
*/
|
165
|
+
sendButtonSettings: SendButtonSettings;
|
166
|
+
/**
|
167
|
+
* Sets the names of the model fields from which the Chat reads its data.
|
168
|
+
* Allows mapping of custom data structures to the expected Message format.
|
169
|
+
*/
|
170
|
+
set modelFields(value: ConversationalUIModelFields);
|
171
|
+
get modelFields(): ConversationalUIModelFields;
|
54
172
|
/**
|
55
173
|
* Emits when the user sends a message by clicking the **Send** button or pressing **Enter**.
|
56
174
|
*
|
57
175
|
* > The message is not automatically added to the `messages` array.
|
58
176
|
*/
|
59
177
|
sendMessage: EventEmitter<SendMessageEvent>;
|
178
|
+
/**
|
179
|
+
* Emits when the user clicks a quick action button in the message toolbar.
|
180
|
+
*/
|
181
|
+
toolbarActionClick: EventEmitter<MessageActionEvent>;
|
182
|
+
/**
|
183
|
+
* Emits when the user clicks an action in the message context menu.
|
184
|
+
*/
|
185
|
+
contextMenuActionClick: EventEmitter<MessageActionEvent>;
|
186
|
+
/**
|
187
|
+
* Emits when the user clicks an action in the file context menu.
|
188
|
+
*/
|
189
|
+
fileActionClick: EventEmitter<FileActionEvent>;
|
190
|
+
/**
|
191
|
+
* Emits when the user clicks an action in the file context menu.
|
192
|
+
*/
|
193
|
+
download: EventEmitter<FileDownloadEvent>;
|
60
194
|
/**
|
61
195
|
* Emits when the user clicks a quick action button.
|
62
196
|
* The Chat internally handles [known actions](slug:api_conversational-ui_actiontype) such as `reply`, `openUrl`, and `call`.
|
@@ -64,16 +198,46 @@ export declare class ChatComponent implements AfterViewInit, OnDestroy {
|
|
64
198
|
* The event is preventable—calling `preventDefault` suppresses the built-in action.
|
65
199
|
*/
|
66
200
|
executeAction: EventEmitter<ExecuteActionEvent>;
|
201
|
+
/**
|
202
|
+
* Emits when the user clicks a suggestion in the message input box.
|
203
|
+
*/
|
204
|
+
suggestionExecute: EventEmitter<ChatSuggestion>;
|
205
|
+
/**
|
206
|
+
* Emits when the user selects a file in the message input box.
|
207
|
+
*/
|
208
|
+
fileSelect: EventEmitter<SelectEvent>;
|
209
|
+
/**
|
210
|
+
* Emits when the user removes a file from the message input box.
|
211
|
+
*/
|
212
|
+
fileRemove: EventEmitter<ChatFile>;
|
213
|
+
/**
|
214
|
+
* Emits when the user unpins the pinned message.
|
215
|
+
* This event is triggered when the user clicks the delete button on the pinned message.
|
216
|
+
*/
|
217
|
+
unpin: EventEmitter<Message>;
|
218
|
+
/**
|
219
|
+
* Emits when the user types in the message input box.
|
220
|
+
*/
|
221
|
+
inputValueChange: EventEmitter<string>;
|
67
222
|
get className(): string;
|
68
223
|
get dirAttr(): string;
|
69
224
|
attachmentTemplate: AttachmentTemplateDirective;
|
225
|
+
chatHeaderTemplate: ChatHeaderTemplateDirective;
|
70
226
|
messageTemplate: MessageTemplateDirective;
|
227
|
+
timestampTemplate: ChatTimestampTemplateDirective;
|
228
|
+
suggestionTemplate: ChatSuggestionTemplateDirective;
|
229
|
+
statusTemplate: ChatStatusTemplateDirective;
|
71
230
|
messageBoxTemplate: ChatMessageBoxTemplateDirective;
|
72
231
|
messageBox: MessageBoxComponent;
|
73
232
|
/**
|
74
233
|
* @hidden
|
75
234
|
*/
|
76
|
-
messageList:
|
235
|
+
messageList: ViewContainerRef;
|
236
|
+
/**
|
237
|
+
* @hidden
|
238
|
+
* Returns processed messages when model fields are used, otherwise returns original messages
|
239
|
+
*/
|
240
|
+
get processedMessages(): Message[];
|
77
241
|
/**
|
78
242
|
* @hidden
|
79
243
|
*/
|
@@ -82,11 +246,39 @@ export declare class ChatComponent implements AfterViewInit, OnDestroy {
|
|
82
246
|
* @hidden
|
83
247
|
*/
|
84
248
|
autoScroll: boolean;
|
249
|
+
/**
|
250
|
+
* @hidden
|
251
|
+
*/
|
252
|
+
pinIcon: import("@progress/kendo-svg-icons").SVGIcon;
|
253
|
+
/**
|
254
|
+
* @hidden
|
255
|
+
*/
|
256
|
+
deleteIcon: import("@progress/kendo-svg-icons").SVGIcon;
|
257
|
+
/**
|
258
|
+
* @hidden
|
259
|
+
*/
|
260
|
+
pinnedMessage: Message;
|
85
261
|
private direction;
|
86
|
-
private
|
87
|
-
|
88
|
-
|
262
|
+
private subs;
|
263
|
+
private _modelFields;
|
264
|
+
private _messageContextMenuActions;
|
265
|
+
private _fileActions;
|
266
|
+
constructor(localization: LocalizationService, zone: NgZone, renderer: Renderer2, element: ElementRef, chatService: ChatService);
|
267
|
+
/**
|
268
|
+
* @hidden
|
269
|
+
*/
|
270
|
+
ngOnInit(): void;
|
271
|
+
/**
|
272
|
+
* @hidden
|
273
|
+
*/
|
274
|
+
ngOnChanges(changes: SimpleChanges): void;
|
275
|
+
/**
|
276
|
+
* @hidden
|
277
|
+
*/
|
89
278
|
ngAfterViewInit(): void;
|
279
|
+
/**
|
280
|
+
* @hidden
|
281
|
+
*/
|
90
282
|
ngOnDestroy(): void;
|
91
283
|
/**
|
92
284
|
* @hidden
|
@@ -96,6 +288,13 @@ export declare class ChatComponent implements AfterViewInit, OnDestroy {
|
|
96
288
|
* @hidden
|
97
289
|
*/
|
98
290
|
textFor(key: string): string;
|
291
|
+
/**
|
292
|
+
* @hidden
|
293
|
+
*/
|
294
|
+
scrollToPinnedMessage(): void;
|
295
|
+
private findLastPinnedMessage;
|
296
|
+
private updateChatServiceProperties;
|
297
|
+
private mergeWithDefaultActions;
|
99
298
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatComponent, never>;
|
100
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ChatComponent, "kendo-chat", never, { "messages": { "alias": "messages"; "required": false; }; "
|
299
|
+
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; }; "suggestions": { "alias": "suggestions"; "required": false; }; "messageToolbarVisibility": { "alias": "messageToolbarVisibility"; "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", "messageTemplate", "timestampTemplate", "suggestionTemplate", "statusTemplate", "messageBoxTemplate"], never, true, never>;
|
101
300
|
}
|
package/chat/chat.module.d.ts
CHANGED
@@ -5,10 +5,14 @@
|
|
5
5
|
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
|
-
import * as i3 from "./attachment-template.directive";
|
9
|
-
import * as i4 from "./message-template.directive";
|
8
|
+
import * as i3 from "./templates/attachment-template.directive";
|
9
|
+
import * as i4 from "./templates/message-template.directive";
|
10
10
|
import * as i5 from "./cards/hero-card.component";
|
11
|
-
import * as i6 from "./message-box.directive";
|
11
|
+
import * as i6 from "./templates/message-box.directive";
|
12
|
+
import * as i7 from "./templates/header-template.directive";
|
13
|
+
import * as i8 from "./templates/timestamp-template.directive";
|
14
|
+
import * as i9 from "./templates/status-template.directive";
|
15
|
+
import * as i10 from "./templates/suggestion-template.directive";
|
12
16
|
/**
|
13
17
|
* Represents the [`NgModule`](link:site.data.urls.angular['ngmodules']) for the Chat component.
|
14
18
|
*
|
@@ -32,6 +36,6 @@ import * as i6 from "./message-box.directive";
|
|
32
36
|
*/
|
33
37
|
export declare class ChatModule {
|
34
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatModule, never>;
|
35
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ChatModule, never, [typeof i1.ChatComponent, typeof i2.CustomMessagesComponent, typeof i3.AttachmentTemplateDirective, typeof i4.MessageTemplateDirective, typeof i5.HeroCardComponent, typeof i6.ChatMessageBoxTemplateDirective], [typeof i1.ChatComponent, typeof i2.CustomMessagesComponent, typeof i3.AttachmentTemplateDirective, typeof i4.MessageTemplateDirective, typeof i5.HeroCardComponent, typeof i6.ChatMessageBoxTemplateDirective]>;
|
39
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ChatModule, never, [typeof i1.ChatComponent, typeof i2.CustomMessagesComponent, typeof i3.AttachmentTemplateDirective, typeof i4.MessageTemplateDirective, typeof i5.HeroCardComponent, typeof i6.ChatMessageBoxTemplateDirective, typeof i7.ChatHeaderTemplateDirective, typeof i8.ChatTimestampTemplateDirective, typeof i9.ChatStatusTemplateDirective, typeof i10.ChatSuggestionTemplateDirective], [typeof i1.ChatComponent, typeof i2.CustomMessagesComponent, typeof i3.AttachmentTemplateDirective, typeof i4.MessageTemplateDirective, typeof i5.HeroCardComponent, typeof i6.ChatMessageBoxTemplateDirective, typeof i7.ChatHeaderTemplateDirective, typeof i8.ChatTimestampTemplateDirective, typeof i9.ChatStatusTemplateDirective, typeof i10.ChatSuggestionTemplateDirective]>;
|
36
40
|
static ɵinj: i0.ɵɵInjectorDeclaration<ChatModule>;
|
37
41
|
}
|
@@ -0,0 +1,51 @@
|
|
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 { ViewContainerRef, ElementRef } from '@angular/core';
|
6
|
+
import { SpeechToTextButtonSettings } from '@progress/kendo-angular-buttons';
|
7
|
+
import { MessageWidthMode } from '../api/message-width-mode';
|
8
|
+
import { FileAction, FileActionEvent, FileDownloadEvent, Message, MessageAction, MessageActionEvent, SendButtonSettings } from '../api';
|
9
|
+
import { FileSelectSettings } from '@progress/kendo-angular-upload';
|
10
|
+
import * as i0 from "@angular/core";
|
11
|
+
/**
|
12
|
+
* @hidden
|
13
|
+
*/
|
14
|
+
export declare class ChatService {
|
15
|
+
authorId: string | number;
|
16
|
+
messageWidthMode: MessageWidthMode;
|
17
|
+
allowMessageCollapse: boolean;
|
18
|
+
messageToolbarActions: MessageAction[];
|
19
|
+
messageContextMenuActions: MessageAction[];
|
20
|
+
fileActions: FileAction[];
|
21
|
+
messageToolbarVisibility: 'hidden' | 'hover' | 'always';
|
22
|
+
toggleMessageState: boolean;
|
23
|
+
reply: Message;
|
24
|
+
messages: Message[];
|
25
|
+
chatElement: ViewContainerRef;
|
26
|
+
messageElementsMap: Map<string | number, ElementRef>;
|
27
|
+
private _enableSpeechToText;
|
28
|
+
private _enableFileSelect;
|
29
|
+
private _sendButtonSettings;
|
30
|
+
private subjects;
|
31
|
+
toolbarAction$: import("rxjs").Observable<MessageActionEvent>;
|
32
|
+
contextMenuAction$: import("rxjs").Observable<MessageActionEvent>;
|
33
|
+
fileAction$: import("rxjs").Observable<FileActionEvent>;
|
34
|
+
fileDownload$: import("rxjs").Observable<FileDownloadEvent>;
|
35
|
+
replyReferenceClick$: import("rxjs").Observable<string | number>;
|
36
|
+
inputValueChange$: import("rxjs").Observable<string>;
|
37
|
+
set enableSpeechToText(settings: boolean | SpeechToTextButtonSettings);
|
38
|
+
get enableSpeechToText(): SpeechToTextButtonSettings;
|
39
|
+
set enableFileSelect(settings: boolean | FileSelectSettings);
|
40
|
+
get enableFileSelect(): FileSelectSettings;
|
41
|
+
set sendButtonSettings(settings: boolean | SendButtonSettings);
|
42
|
+
get sendButtonSettings(): SendButtonSettings;
|
43
|
+
emit(subjectKey: string, value?: any): void;
|
44
|
+
getMessageById(id: string | number): Message | undefined;
|
45
|
+
registerMessageElement(messageId: string | number, elementRef: ElementRef): void;
|
46
|
+
unregisterMessageElement(messageId: string | number): void;
|
47
|
+
scrollToMessage(messageId: string | number): void;
|
48
|
+
private updateComponentSettings;
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatService, never>;
|
50
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatService>;
|
51
|
+
}
|
@@ -2,7 +2,8 @@
|
|
2
2
|
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
import { ConversationalUIModelFields } from "./model-fields";
|
6
|
+
/**
|
7
|
+
* @hidden
|
8
|
+
*/
|
9
|
+
export declare const defaultModelFields: ConversationalUIModelFields;
|
@@ -0,0 +1,111 @@
|
|
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 model fields that will be used for creating `Message` instances.
|
7
|
+
*/
|
8
|
+
export interface ConversationalUIModelFields {
|
9
|
+
/**
|
10
|
+
* Field name for message ID.
|
11
|
+
*
|
12
|
+
* @default "id"
|
13
|
+
*/
|
14
|
+
idField?: string;
|
15
|
+
/**
|
16
|
+
* Field name for message text content.
|
17
|
+
*
|
18
|
+
* @default "text"
|
19
|
+
*/
|
20
|
+
textField?: string;
|
21
|
+
/**
|
22
|
+
* Field name for message author ID.
|
23
|
+
*
|
24
|
+
* @default "authorId"
|
25
|
+
*/
|
26
|
+
authorIdField?: string;
|
27
|
+
/**
|
28
|
+
* Field name for message author name (when flattened in data source).
|
29
|
+
*
|
30
|
+
* @default "authorName"
|
31
|
+
*/
|
32
|
+
authorNameField?: string;
|
33
|
+
/**
|
34
|
+
* Field name for message author avatar URL (when flattened in data source).
|
35
|
+
*
|
36
|
+
* @default "authorImageUrl"
|
37
|
+
*/
|
38
|
+
authorImageUrlField?: string;
|
39
|
+
/**
|
40
|
+
* Field name for alt text of the author's avatar (when flattened in data source).
|
41
|
+
*
|
42
|
+
* @default "authorImageAltText"
|
43
|
+
*/
|
44
|
+
authorImageAltTextField?: string;
|
45
|
+
/**
|
46
|
+
* Field name for message timestamp.
|
47
|
+
*
|
48
|
+
* @default "timestamp"
|
49
|
+
*/
|
50
|
+
timestampField?: string;
|
51
|
+
/**
|
52
|
+
* Field name for message status.
|
53
|
+
*
|
54
|
+
* @default "status"
|
55
|
+
*/
|
56
|
+
statusField?: string;
|
57
|
+
/**
|
58
|
+
* Field name for file attachments.
|
59
|
+
*
|
60
|
+
* @default "files"
|
61
|
+
*/
|
62
|
+
filesField?: string;
|
63
|
+
/**
|
64
|
+
* Field name for message attachments.
|
65
|
+
*
|
66
|
+
* @default "attachments"
|
67
|
+
*/
|
68
|
+
attachmentsField?: string;
|
69
|
+
/**
|
70
|
+
* Field name for message attachment layout.
|
71
|
+
*
|
72
|
+
* @default "attachmentLayout"
|
73
|
+
*/
|
74
|
+
attachmentLayoutField?: string;
|
75
|
+
/**
|
76
|
+
* Field name for suggested actions.
|
77
|
+
*
|
78
|
+
* @default "suggestedActions"
|
79
|
+
*/
|
80
|
+
suggestedActionsField?: string;
|
81
|
+
/**
|
82
|
+
* Field name for message pinned status.
|
83
|
+
*
|
84
|
+
* @default "isPinned"
|
85
|
+
*/
|
86
|
+
isPinnedField?: string;
|
87
|
+
/**
|
88
|
+
* Field name for the user who pinned the message.
|
89
|
+
*
|
90
|
+
* @default "pinnedBy"
|
91
|
+
*/
|
92
|
+
pinnedByField?: string;
|
93
|
+
/**
|
94
|
+
* Field name for reply-to message ID.
|
95
|
+
*
|
96
|
+
* @default "replyToId"
|
97
|
+
*/
|
98
|
+
replyToIdField?: string;
|
99
|
+
/**
|
100
|
+
* Field name for message deletion status.
|
101
|
+
*
|
102
|
+
* @default "isDeleted"
|
103
|
+
*/
|
104
|
+
isDeletedField?: string;
|
105
|
+
/**
|
106
|
+
* Field name for the typing indicator.
|
107
|
+
*
|
108
|
+
* @default "typing"
|
109
|
+
*/
|
110
|
+
typingField?: string;
|
111
|
+
}
|
package/chat/common/utils.d.ts
CHANGED
@@ -2,7 +2,57 @@
|
|
2
2
|
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
5
|
+
import { Message, SendButtonSettings, MessageAction, FileAction } from "../api";
|
6
|
+
import { ConversationalUIModelFields } from "./models/model-fields";
|
7
|
+
import { FileSelectSettings } from '@progress/kendo-angular-upload';
|
8
|
+
import { SpeechToTextButtonSettings } from "@progress/kendo-angular-buttons";
|
5
9
|
/**
|
6
10
|
* @hidden
|
7
11
|
*/
|
8
12
|
export declare const closest: (node: any, predicate: any) => any;
|
13
|
+
/**
|
14
|
+
* @hidden
|
15
|
+
*/
|
16
|
+
export declare const URL_REGEX: RegExp;
|
17
|
+
/**
|
18
|
+
* @hidden
|
19
|
+
*/
|
20
|
+
export declare const DOWNLOAD_ALL_SELECTOR = ".k-chat-download-button";
|
21
|
+
/**
|
22
|
+
* @hidden
|
23
|
+
*/
|
24
|
+
export declare const FILE_ACTION_BTN_SELECTOR = ".k-menu-button";
|
25
|
+
/**
|
26
|
+
* @hidden
|
27
|
+
*/
|
28
|
+
export declare const MENU_ITEM_SELECTOR = ".k-menu-link";
|
29
|
+
/**
|
30
|
+
* @hidden
|
31
|
+
* Default settings for the Speech to Text button.
|
32
|
+
* These settings can be overridden by the user.
|
33
|
+
*/
|
34
|
+
export declare const STB_DEFAULT_SETTINGS: SpeechToTextButtonSettings;
|
35
|
+
/**
|
36
|
+
* @hidden
|
37
|
+
*/
|
38
|
+
export declare const SEND_BTN_DEFAULT_SETTINGS: SendButtonSettings;
|
39
|
+
/**
|
40
|
+
* @hidden
|
41
|
+
*/
|
42
|
+
export declare const FILESELECT_DEFAULT_SETTINGS: FileSelectSettings;
|
43
|
+
/**
|
44
|
+
* @hidden
|
45
|
+
*/
|
46
|
+
export declare const CONTEXT_MENU_ACTIONS: MessageAction[];
|
47
|
+
/**
|
48
|
+
* @hidden
|
49
|
+
*/
|
50
|
+
export declare const FILE_ACTIONS: FileAction[];
|
51
|
+
/**
|
52
|
+
* @hidden
|
53
|
+
*/
|
54
|
+
export declare const processMessages: (messages: any[], fields?: ConversationalUIModelFields) => Message[];
|
55
|
+
/**
|
56
|
+
* @hidden
|
57
|
+
*/
|
58
|
+
export declare const parseMessage: (message: any, fields?: ConversationalUIModelFields) => Message;
|
package/chat/l10n/messages.d.ts
CHANGED
@@ -8,6 +8,19 @@ import * as i0 from "@angular/core";
|
|
8
8
|
* @hidden
|
9
9
|
*/
|
10
10
|
export declare class Messages extends ComponentMessages {
|
11
|
+
/**
|
12
|
+
* Sets the text that is displayed when the sender deletes a message.
|
13
|
+
*/
|
14
|
+
deletedMessageSenderText: string;
|
15
|
+
/**
|
16
|
+
* Sets the text that is displayed when the receiver deletes a message.
|
17
|
+
*/
|
18
|
+
deletedMessageReceiverText: string;
|
19
|
+
/**
|
20
|
+
* Sets the text that is displayed in the download section of the message.
|
21
|
+
* This message is displayed below all files in the message.
|
22
|
+
*/
|
23
|
+
downloadAllFilesText: string;
|
11
24
|
/**
|
12
25
|
* Sets the placeholder text for the message text input.
|
13
26
|
*/
|
@@ -33,9 +46,33 @@ export declare class Messages extends ComponentMessages {
|
|
33
46
|
*/
|
34
47
|
messageAttachmentRightArrow: string;
|
35
48
|
/**
|
36
|
-
* Sets the
|
49
|
+
* Sets the Speech to Text button title.
|
50
|
+
*/
|
51
|
+
speechToTextButtonTitle: string;
|
52
|
+
/**
|
53
|
+
* Sets the File Select button title.
|
54
|
+
*/
|
55
|
+
fileSelectButtonTitle: string;
|
56
|
+
/**
|
57
|
+
* Sets the title of the icon which removes the reply reference in the Message Box.
|
58
|
+
*/
|
59
|
+
removeReplyTitle: string;
|
60
|
+
/**
|
61
|
+
* Sets the title of the icon which removes a selected file in the Message Box.
|
62
|
+
*/
|
63
|
+
removeFileTitle: string;
|
64
|
+
/**
|
65
|
+
* Sets the title of the icon which demonstrates that the message can be expanded.
|
66
|
+
*/
|
67
|
+
expandTitle: string;
|
68
|
+
/**
|
69
|
+
* Sets the title of the icon which demonstrates that the message can be collapsed.
|
70
|
+
*/
|
71
|
+
collapseTitle: string;
|
72
|
+
/**
|
73
|
+
* Sets the title of the DropDownButton which opens the File actions.
|
37
74
|
*/
|
38
|
-
|
75
|
+
fileActionsTitle: string;
|
39
76
|
static ɵfac: i0.ɵɵFactoryDeclaration<Messages, never>;
|
40
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<Messages, "kendoConversationalUIMessages", never, { "messagePlaceholder": { "alias": "messagePlaceholder"; "required": false; }; "send": { "alias": "send"; "required": false; }; "messageListLabel": { "alias": "messageListLabel"; "required": false; }; "messageBoxInputLabel": { "alias": "messageBoxInputLabel"; "required": false; }; "messageAttachmentLeftArrow": { "alias": "messageAttachmentLeftArrow"; "required": false; }; "messageAttachmentRightArrow": { "alias": "messageAttachmentRightArrow"; "required": false; }; "
|
77
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<Messages, "kendoConversationalUIMessages", never, { "deletedMessageSenderText": { "alias": "deletedMessageSenderText"; "required": false; }; "deletedMessageReceiverText": { "alias": "deletedMessageReceiverText"; "required": false; }; "downloadAllFilesText": { "alias": "downloadAllFilesText"; "required": false; }; "messagePlaceholder": { "alias": "messagePlaceholder"; "required": false; }; "send": { "alias": "send"; "required": false; }; "messageListLabel": { "alias": "messageListLabel"; "required": false; }; "messageBoxInputLabel": { "alias": "messageBoxInputLabel"; "required": false; }; "messageAttachmentLeftArrow": { "alias": "messageAttachmentLeftArrow"; "required": false; }; "messageAttachmentRightArrow": { "alias": "messageAttachmentRightArrow"; "required": false; }; "speechToTextButtonTitle": { "alias": "speechToTextButtonTitle"; "required": false; }; "fileSelectButtonTitle": { "alias": "fileSelectButtonTitle"; "required": false; }; "removeReplyTitle": { "alias": "removeReplyTitle"; "required": false; }; "removeFileTitle": { "alias": "removeFileTitle"; "required": false; }; "expandTitle": { "alias": "expandTitle"; "required": false; }; "collapseTitle": { "alias": "collapseTitle"; "required": false; }; "fileActionsTitle": { "alias": "fileActionsTitle"; "required": false; }; }, {}, never, never, false, never>;
|
41
78
|
}
|
@@ -7,7 +7,7 @@ import { SVGIcon } from '@progress/kendo-svg-icons';
|
|
7
7
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
8
8
|
import { Attachment, AttachmentLayout } from './api/attachment.interface';
|
9
9
|
import { ChatItem } from './chat-item';
|
10
|
-
import { AttachmentTemplateDirective } from './attachment-template.directive';
|
10
|
+
import { AttachmentTemplateDirective } from './templates/attachment-template.directive';
|
11
11
|
import * as i0 from "@angular/core";
|
12
12
|
/**
|
13
13
|
* @hidden
|
@@ -50,9 +50,6 @@ export declare class MessageAttachmentsComponent extends ChatItem implements Aft
|
|
50
50
|
private select;
|
51
51
|
private navigateTo;
|
52
52
|
private onScroll;
|
53
|
-
/**
|
54
|
-
* @hidden
|
55
|
-
*/
|
56
53
|
textFor(key: string): string;
|
57
54
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageAttachmentsComponent, never>;
|
58
55
|
static ɵcmp: i0.ɵɵComponentDeclaration<MessageAttachmentsComponent, "kendo-chat-message-attachments", never, { "attachments": { "alias": "attachments"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "tabbable": { "alias": "tabbable"; "required": false; }; "template": { "alias": "template"; "required": false; }; "localization": { "alias": "localization"; "required": false; }; }, {}, never, never, true, never>;
|