@progress/kendo-angular-conversational-ui 21.4.1-develop.1 → 22.0.0-develop.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/ai-prompt/localization/messages.d.ts +1 -1
- package/ai-prompt/views/base-view.d.ts +1 -1
- package/chat/l10n/messages.d.ts +1 -1
- package/fesm2022/progress-kendo-angular-conversational-ui.mjs +182 -182
- package/inline-ai-prompt/localization/messages.d.ts +1 -1
- package/package.json +17 -25
- package/esm2022/ai-prompt/aiprompt.component.mjs +0 -556
- package/esm2022/ai-prompt/aiprompt.module.mjs +0 -53
- package/esm2022/ai-prompt/common/aiprompt.service.mjs +0 -75
- package/esm2022/ai-prompt/common/output-card.component.mjs +0 -230
- package/esm2022/ai-prompt/common/toolbar-focusable.directive.mjs +0 -72
- package/esm2022/ai-prompt/common/toolbar-navigation.service.mjs +0 -56
- package/esm2022/ai-prompt/localization/custom-messages.component.mjs +0 -54
- package/esm2022/ai-prompt/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/ai-prompt/localization/messages.mjs +0 -77
- package/esm2022/ai-prompt/models/ai-prompt-settings.mjs +0 -5
- package/esm2022/ai-prompt/models/command-execute-event.mjs +0 -5
- package/esm2022/ai-prompt/models/command.interface.mjs +0 -5
- package/esm2022/ai-prompt/models/index.mjs +0 -5
- package/esm2022/ai-prompt/models/output-rating-change-event.mjs +0 -5
- package/esm2022/ai-prompt/models/prompt-output.interface.mjs +0 -5
- package/esm2022/ai-prompt/models/prompt-request-event.mjs +0 -5
- package/esm2022/ai-prompt/models/view-type.mjs +0 -5
- package/esm2022/ai-prompt/templates/aiprompt-output-body-template.directive.mjs +0 -33
- package/esm2022/ai-prompt/templates/aiprompt-output-template.directive.mjs +0 -33
- package/esm2022/ai-prompt/templates/toolbar-actions.template.mjs +0 -39
- package/esm2022/ai-prompt/utils.mjs +0 -26
- package/esm2022/ai-prompt/views/base-view.mjs +0 -98
- package/esm2022/ai-prompt/views/command-view.component.mjs +0 -100
- package/esm2022/ai-prompt/views/custom-view.component.mjs +0 -50
- package/esm2022/ai-prompt/views/index.mjs +0 -8
- package/esm2022/ai-prompt/views/output-view.component.mjs +0 -90
- package/esm2022/ai-prompt/views/prompt-view.component.mjs +0 -288
- package/esm2022/chat/api/action.interface.mjs +0 -5
- package/esm2022/chat/api/attachment.interface.mjs +0 -5
- package/esm2022/chat/api/chat-file-interface.mjs +0 -5
- package/esm2022/chat/api/chat-suggestion.interface.mjs +0 -5
- package/esm2022/chat/api/execute-action-event.mjs +0 -29
- package/esm2022/chat/api/file-action.mjs +0 -5
- package/esm2022/chat/api/file-download-event.interface.mjs +0 -5
- package/esm2022/chat/api/files-layout.mjs +0 -5
- package/esm2022/chat/api/index.mjs +0 -21
- package/esm2022/chat/api/message-action.mjs +0 -5
- package/esm2022/chat/api/message-settings.interface.mjs +0 -5
- package/esm2022/chat/api/message-width-mode.mjs +0 -5
- package/esm2022/chat/api/message.interface.mjs +0 -5
- package/esm2022/chat/api/post-message-event.mjs +0 -21
- package/esm2022/chat/api/preventable-event.mjs +0 -28
- package/esm2022/chat/api/send-button-settings.mjs +0 -5
- package/esm2022/chat/api/suggestions-layout.mjs +0 -5
- package/esm2022/chat/api/timestamp-visibility.mjs +0 -5
- package/esm2022/chat/api/user.interface.mjs +0 -5
- package/esm2022/chat/attachment.component.mjs +0 -105
- package/esm2022/chat/builtin-actions.mjs +0 -27
- package/esm2022/chat/cards/hero-card.component.mjs +0 -131
- package/esm2022/chat/chat-file.component.mjs +0 -144
- package/esm2022/chat/chat-item.mjs +0 -10
- package/esm2022/chat/chat-view.mjs +0 -80
- package/esm2022/chat/chat.component.mjs +0 -1015
- package/esm2022/chat/chat.directives.mjs +0 -18
- package/esm2022/chat/chat.module.mjs +0 -61
- package/esm2022/chat/common/chat.service.mjs +0 -179
- package/esm2022/chat/common/models/default-model-fields.mjs +0 -25
- package/esm2022/chat/common/models/formatted-text-parts.mjs +0 -5
- package/esm2022/chat/common/models/message-box-options.mjs +0 -5
- package/esm2022/chat/common/models/model-fields.mjs +0 -5
- package/esm2022/chat/common/scroll-anchor.directive.mjs +0 -80
- package/esm2022/chat/common/scroll-button.component.mjs +0 -81
- package/esm2022/chat/common/scroll.service.mjs +0 -110
- package/esm2022/chat/common/utils.mjs +0 -159
- package/esm2022/chat/l10n/custom-messages.component.mjs +0 -55
- package/esm2022/chat/l10n/localized-messages.directive.mjs +0 -40
- package/esm2022/chat/l10n/messages.mjs +0 -130
- package/esm2022/chat/message-attachments.component.mjs +0 -258
- package/esm2022/chat/message-box.component.mjs +0 -501
- package/esm2022/chat/message-list.component.mjs +0 -617
- package/esm2022/chat/message-reference-content.component.mjs +0 -86
- package/esm2022/chat/message.component.mjs +0 -740
- package/esm2022/chat/suggested-actions.component.mjs +0 -443
- package/esm2022/chat/templates/attachment-template.directive.mjs +0 -43
- package/esm2022/chat/templates/author-message-content-template.directive.mjs +0 -39
- package/esm2022/chat/templates/author-message-template.directive.mjs +0 -39
- package/esm2022/chat/templates/header-template.directive.mjs +0 -33
- package/esm2022/chat/templates/message-box.directive.mjs +0 -36
- package/esm2022/chat/templates/message-content-template.directive.mjs +0 -39
- package/esm2022/chat/templates/message-template.directive.mjs +0 -39
- package/esm2022/chat/templates/no-data-template.directive.mjs +0 -38
- package/esm2022/chat/templates/receiver-message-content-template.directive.mjs +0 -39
- package/esm2022/chat/templates/receiver-message-template.directive.mjs +0 -39
- package/esm2022/chat/templates/status-template.directive.mjs +0 -33
- package/esm2022/chat/templates/suggestion-template.directive.mjs +0 -36
- package/esm2022/chat/templates/timestamp-template.directive.mjs +0 -42
- package/esm2022/chat/templates/user-status-template.directive.mjs +0 -38
- package/esm2022/conversational-ui.module.mjs +0 -73
- package/esm2022/directives.mjs +0 -145
- package/esm2022/index.mjs +0 -40
- package/esm2022/inline-ai-prompt/inlineaiprompt-content.component.mjs +0 -548
- package/esm2022/inline-ai-prompt/inlineaiprompt.component.mjs +0 -351
- package/esm2022/inline-ai-prompt/inlineaiprompt.module.mjs +0 -46
- package/esm2022/inline-ai-prompt/inlineaiprompt.service.mjs +0 -92
- package/esm2022/inline-ai-prompt/localization/custom-messages.component.mjs +0 -51
- package/esm2022/inline-ai-prompt/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/inline-ai-prompt/localization/messages.mjs +0 -35
- package/esm2022/inline-ai-prompt/models/command.interface.mjs +0 -5
- package/esm2022/inline-ai-prompt/models/index.mjs +0 -5
- package/esm2022/inline-ai-prompt/models/inlineaiprompt-popupsettings.mjs +0 -5
- package/esm2022/inline-ai-prompt/models/inlineaiprompt-settings.mjs +0 -59
- package/esm2022/inline-ai-prompt/models/messages.mjs +0 -8
- package/esm2022/inline-ai-prompt/models/output-action-click-event.mjs +0 -5
- package/esm2022/inline-ai-prompt/models/output-action.interface.mjs +0 -5
- package/esm2022/inline-ai-prompt/models/prompt-output.interface.mjs +0 -5
- package/esm2022/inline-ai-prompt/models/prompt-request-event.mjs +0 -5
- package/esm2022/inline-ai-prompt/output-template.directive.mjs +0 -38
- package/esm2022/inline-ai-prompt/utils.mjs +0 -57
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/progress-kendo-angular-conversational-ui.mjs +0 -8
|
@@ -1,501 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostBinding, Input, Output, Renderer2, ViewChild } from '@angular/core';
|
|
6
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
7
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
-
import { closest, guid, isPresent, Keys } from '@progress/kendo-angular-common';
|
|
9
|
-
import { paperPlaneIcon, paperclipIcon, fileIcon, xIcon } from '@progress/kendo-svg-icons';
|
|
10
|
-
import { ButtonComponent, SpeechToTextButtonComponent } from '@progress/kendo-angular-buttons';
|
|
11
|
-
import { SendMessageEvent } from './api/post-message-event';
|
|
12
|
-
import { ChatMessageBoxTemplateDirective } from './templates/message-box.directive';
|
|
13
|
-
import { InputSpacerComponent, TextAreaComponent, TextAreaPrefixComponent, TextAreaSuffixComponent } from '@progress/kendo-angular-inputs';
|
|
14
|
-
import { FileSelectComponent } from '@progress/kendo-angular-upload';
|
|
15
|
-
import { FormsModule } from '@angular/forms';
|
|
16
|
-
import { ChatService } from './common/chat.service';
|
|
17
|
-
import { SuggestedActionsComponent } from "./suggested-actions.component";
|
|
18
|
-
import { Subscription } from 'rxjs';
|
|
19
|
-
import { ChatFileComponent } from './chat-file.component';
|
|
20
|
-
import { MessageReferenceComponent } from './message-reference-content.component';
|
|
21
|
-
import { ChatSuggestionTemplateDirective } from './templates/suggestion-template.directive';
|
|
22
|
-
import * as i0 from "@angular/core";
|
|
23
|
-
import * as i1 from "./common/chat.service";
|
|
24
|
-
/**
|
|
25
|
-
* @hidden
|
|
26
|
-
*/
|
|
27
|
-
export class MessageBoxComponent {
|
|
28
|
-
chatService;
|
|
29
|
-
cdr;
|
|
30
|
-
element;
|
|
31
|
-
renderer;
|
|
32
|
-
borderColor = 'inherit';
|
|
33
|
-
messageBoxWrapperClass = true;
|
|
34
|
-
messageBoxInput;
|
|
35
|
-
fileSelectComponent;
|
|
36
|
-
suggestedActionsComponent;
|
|
37
|
-
authorId;
|
|
38
|
-
autoScroll;
|
|
39
|
-
suggestions;
|
|
40
|
-
placeholder;
|
|
41
|
-
inputValue = '';
|
|
42
|
-
localization;
|
|
43
|
-
messageBoxTemplate;
|
|
44
|
-
suggestionTemplate;
|
|
45
|
-
sendMessage = new EventEmitter();
|
|
46
|
-
executeSuggestion = new EventEmitter();
|
|
47
|
-
fileSelect = new EventEmitter();
|
|
48
|
-
fileRemove = new EventEmitter();
|
|
49
|
-
files = [];
|
|
50
|
-
sendIcon = paperPlaneIcon;
|
|
51
|
-
attachmentIcon = paperclipIcon;
|
|
52
|
-
deleteIcon = xIcon;
|
|
53
|
-
fileIcon = fileIcon;
|
|
54
|
-
isListening = false;
|
|
55
|
-
get reply() {
|
|
56
|
-
return this.chatService.reply;
|
|
57
|
-
}
|
|
58
|
-
selectedItem;
|
|
59
|
-
subs = new Subscription();
|
|
60
|
-
constructor(chatService, cdr, element, renderer) {
|
|
61
|
-
this.chatService = chatService;
|
|
62
|
-
this.cdr = cdr;
|
|
63
|
-
this.element = element;
|
|
64
|
-
this.renderer = renderer;
|
|
65
|
-
}
|
|
66
|
-
ngOnInit() {
|
|
67
|
-
const elRef = this.element.nativeElement;
|
|
68
|
-
this.subs.add(this.renderer.listen(elRef, 'focusout', event => this.onBlur(event)));
|
|
69
|
-
this.subs.add(this.chatService.contextMenuAction$.subscribe((action) => {
|
|
70
|
-
if (action.action.id === 'reply') {
|
|
71
|
-
this.messageBoxInput.focus();
|
|
72
|
-
}
|
|
73
|
-
}));
|
|
74
|
-
}
|
|
75
|
-
ngOnDestroy() {
|
|
76
|
-
if (this.subs) {
|
|
77
|
-
this.subs.unsubscribe();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
sendClick() {
|
|
81
|
-
const hasMessage = this.inputValue?.trim() || this.files?.length;
|
|
82
|
-
const isCustomDisabled = isPresent(this.sendButtonSettings?.disabled);
|
|
83
|
-
if (!hasMessage && !isCustomDisabled) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
const message = {
|
|
87
|
-
id: guid(),
|
|
88
|
-
text: this.inputValue,
|
|
89
|
-
timestamp: new Date(),
|
|
90
|
-
author: { id: this.authorId },
|
|
91
|
-
...(this.files && this.files.length > 0 && { files: this.files }),
|
|
92
|
-
...(this.reply && { replyToId: this.reply.id })
|
|
93
|
-
};
|
|
94
|
-
this.sendMessage.emit(new SendMessageEvent(message));
|
|
95
|
-
this.inputValue = '';
|
|
96
|
-
this.files = [];
|
|
97
|
-
this.chatService.reply = null;
|
|
98
|
-
this.messageBoxInput.focus();
|
|
99
|
-
this.autoScroll = true;
|
|
100
|
-
}
|
|
101
|
-
inputKeydown(e) {
|
|
102
|
-
if (e.code === Keys.Enter || e.code === Keys.NumpadEnter) {
|
|
103
|
-
this.sendClick();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
textAreaKeydown(e) {
|
|
107
|
-
const isEnter = e.code === Keys.Enter || e.code === Keys.NumpadEnter;
|
|
108
|
-
if (!isEnter) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
const newLine = (e.metaKey || e.ctrlKey);
|
|
112
|
-
const enterOnly = !(e.shiftKey || e.metaKey || e.ctrlKey);
|
|
113
|
-
if (enterOnly) {
|
|
114
|
-
e.preventDefault();
|
|
115
|
-
this.sendClick();
|
|
116
|
-
}
|
|
117
|
-
if (newLine) {
|
|
118
|
-
this.inputValue += `\r\n`;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
handleSpeechResult(event) {
|
|
122
|
-
if (event.alternatives && event.alternatives.length > 0) {
|
|
123
|
-
if (!isPresent(this.inputValue)) {
|
|
124
|
-
this.inputValue = '';
|
|
125
|
-
}
|
|
126
|
-
const appendedValue = event.alternatives[0].transcript + ' ';
|
|
127
|
-
if (!appendedValue.trim()) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
this.inputValue += appendedValue;
|
|
131
|
-
this.chatService.emit('inputValueChange', this.inputValue);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
textFor(key) {
|
|
135
|
-
return this.localization.get(key);
|
|
136
|
-
}
|
|
137
|
-
removeReply() {
|
|
138
|
-
this.chatService.reply = null;
|
|
139
|
-
}
|
|
140
|
-
onReplyReferenceClick(event) {
|
|
141
|
-
event.stopPropagation();
|
|
142
|
-
this.chatService.emit('replyReferenceClick', this.chatService.reply?.id);
|
|
143
|
-
}
|
|
144
|
-
handleFileSelect(event) {
|
|
145
|
-
const processedFiles = event.files.map(currentFile => {
|
|
146
|
-
return {
|
|
147
|
-
id: currentFile.uid,
|
|
148
|
-
name: currentFile.name,
|
|
149
|
-
extension: currentFile.extension,
|
|
150
|
-
size: currentFile.size,
|
|
151
|
-
type: currentFile.rawFile.type,
|
|
152
|
-
rawFile: currentFile.rawFile
|
|
153
|
-
};
|
|
154
|
-
});
|
|
155
|
-
this.files = [...this.files, ...processedFiles];
|
|
156
|
-
this.fileSelect.emit(event);
|
|
157
|
-
}
|
|
158
|
-
selectFiles() {
|
|
159
|
-
if (this.fileSelectComponent?.fileSelectInput) {
|
|
160
|
-
this.fileSelectComponent.fileSelectInput.nativeElement.click();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
removeFile(index) {
|
|
164
|
-
this.files = this.files.filter((_, i) => i !== index);
|
|
165
|
-
const removedFile = this.files[index];
|
|
166
|
-
this.fileRemove.emit(removedFile);
|
|
167
|
-
}
|
|
168
|
-
get speechToTextButtonSettings() {
|
|
169
|
-
return this.chatService.enableSpeechToText;
|
|
170
|
-
}
|
|
171
|
-
get sendButtonSettings() {
|
|
172
|
-
return this.chatService.sendButtonSettings;
|
|
173
|
-
}
|
|
174
|
-
get enableFileSelect() {
|
|
175
|
-
return this.chatService.enableFileSelect;
|
|
176
|
-
}
|
|
177
|
-
get isDisabledSendButton() {
|
|
178
|
-
if (isPresent(this.sendButtonSettings?.disabled)) {
|
|
179
|
-
return this.sendButtonSettings.disabled;
|
|
180
|
-
}
|
|
181
|
-
const isEmptyInput = !this.inputValue?.length || !this.inputValue?.trim();
|
|
182
|
-
const hasFiles = this.files?.length > 0;
|
|
183
|
-
return (isEmptyInput && !hasFiles) || this.isListening;
|
|
184
|
-
}
|
|
185
|
-
select(item, event) {
|
|
186
|
-
if (event) {
|
|
187
|
-
const target = event.target;
|
|
188
|
-
if (!target.classList.contains('k-suggestion')) {
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
if (!this.chatService.toggleMessageState) {
|
|
193
|
-
const prevItem = this.selectedItem;
|
|
194
|
-
if (prevItem) {
|
|
195
|
-
prevItem.selected = false;
|
|
196
|
-
}
|
|
197
|
-
if (item) {
|
|
198
|
-
item.selected = true;
|
|
199
|
-
this.selectedItem = item;
|
|
200
|
-
}
|
|
201
|
-
this.cdr.detectChanges();
|
|
202
|
-
}
|
|
203
|
-
this.chatService.toggleMessageState = false;
|
|
204
|
-
}
|
|
205
|
-
onBlur(args) {
|
|
206
|
-
const next = args.relatedTarget || document.activeElement;
|
|
207
|
-
const outside = !closest(next, (node) => node === this.element.nativeElement);
|
|
208
|
-
if (outside) {
|
|
209
|
-
this.select(null);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
onInputValueChange(value) {
|
|
213
|
-
this.inputValue = value;
|
|
214
|
-
this.chatService.emit('inputValueChange', value);
|
|
215
|
-
}
|
|
216
|
-
dispatchSuggestion(suggestion) {
|
|
217
|
-
this.executeSuggestion.emit(suggestion);
|
|
218
|
-
}
|
|
219
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MessageBoxComponent, deps: [{ token: i1.ChatService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
220
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: MessageBoxComponent, isStandalone: true, selector: "kendo-message-box", inputs: { authorId: "authorId", autoScroll: "autoScroll", suggestions: "suggestions", placeholder: "placeholder", inputValue: "inputValue", localization: "localization", messageBoxTemplate: "messageBoxTemplate", suggestionTemplate: "suggestionTemplate" }, outputs: { sendMessage: "sendMessage", executeSuggestion: "executeSuggestion", fileSelect: "fileSelect", fileRemove: "fileRemove" }, host: { properties: { "style.border-color": "this.borderColor", "class.k-message-box-wrapper": "this.messageBoxWrapperClass" } }, viewQueries: [{ propertyName: "messageBoxInput", first: true, predicate: ["messageBoxInput"], descendants: true }, { propertyName: "fileSelectComponent", first: true, predicate: ["fileSelect"], descendants: true }, { propertyName: "suggestedActionsComponent", first: true, predicate: SuggestedActionsComponent, descendants: true }], ngImport: i0, template: `
|
|
221
|
-
@if (suggestions?.length > 0) {
|
|
222
|
-
<kendo-chat-suggested-actions
|
|
223
|
-
#suggestedActions
|
|
224
|
-
[suggestions]="suggestions"
|
|
225
|
-
type="suggestion"
|
|
226
|
-
[suggestionTemplate]="suggestionTemplate"
|
|
227
|
-
[tabbable]="true"
|
|
228
|
-
(dispatchSuggestion)="dispatchSuggestion($event)"
|
|
229
|
-
(click)="select(suggestedActions, $event)"
|
|
230
|
-
(focus)="select(suggestedActions, $event)"
|
|
231
|
-
></kendo-chat-suggested-actions>
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
@if (!messageBoxTemplate?.templateRef) {
|
|
235
|
-
<kendo-textarea
|
|
236
|
-
#messageBoxInput
|
|
237
|
-
class="k-message-box"
|
|
238
|
-
resizable="none"
|
|
239
|
-
[rows]="3"
|
|
240
|
-
[inputAttributes]="{
|
|
241
|
-
'aria-label': textFor('messageBoxInputLabel')
|
|
242
|
-
}"
|
|
243
|
-
[placeholder]="placeholder || textFor('messagePlaceholder')"
|
|
244
|
-
[showSuffixSeparator]="false"
|
|
245
|
-
(keydown)="textAreaKeydown($event)"
|
|
246
|
-
[value]="inputValue"
|
|
247
|
-
(valueChange)="onInputValueChange($event)"
|
|
248
|
-
>
|
|
249
|
-
@if (reply || (files && files.length > 0)) {
|
|
250
|
-
<kendo-textarea-prefix>
|
|
251
|
-
@if (reply) {
|
|
252
|
-
<div class="k-message-reference k-message-reference-sender" (click)="onReplyReferenceClick($event)">
|
|
253
|
-
<chat-message-reference-content [message]="reply"></chat-message-reference-content>
|
|
254
|
-
<span class="k-spacer"></span>
|
|
255
|
-
<button
|
|
256
|
-
kendoButton
|
|
257
|
-
[attr.title]="textFor('removeReplyTitle')"
|
|
258
|
-
[svgIcon]="deleteIcon"
|
|
259
|
-
(click)="removeReply()"
|
|
260
|
-
fillMode="flat"
|
|
261
|
-
></button>
|
|
262
|
-
</div>
|
|
263
|
-
}
|
|
264
|
-
<ul class="k-chat-file-wrapper">
|
|
265
|
-
@for (file of files; track file; let i = $index) {
|
|
266
|
-
<li class="k-chat-file"
|
|
267
|
-
[chatFile]="file"
|
|
268
|
-
[removable]="true"
|
|
269
|
-
(remove)="removeFile(i)"
|
|
270
|
-
></li>
|
|
271
|
-
}
|
|
272
|
-
</ul>
|
|
273
|
-
</kendo-textarea-prefix>
|
|
274
|
-
}
|
|
275
|
-
<kendo-textarea-suffix>
|
|
276
|
-
@if (speechToTextButtonSettings) {
|
|
277
|
-
<button
|
|
278
|
-
kendoSpeechToTextButton
|
|
279
|
-
[attr.title]="textFor('speechToTextButtonTitle')"
|
|
280
|
-
[continuous]="speechToTextButtonSettings?.continuous"
|
|
281
|
-
[disabled]="speechToTextButtonSettings?.disabled"
|
|
282
|
-
[fillMode]="speechToTextButtonSettings?.fillMode ?? 'clear'"
|
|
283
|
-
[integrationMode]="speechToTextButtonSettings?.integrationMode ?? 'webSpeech'"
|
|
284
|
-
[interimResults]="speechToTextButtonSettings?.interimResults"
|
|
285
|
-
[lang]="speechToTextButtonSettings?.lang"
|
|
286
|
-
[maxAlternatives]="speechToTextButtonSettings?.maxAlternatives"
|
|
287
|
-
[rounded]="speechToTextButtonSettings?.rounded"
|
|
288
|
-
[size]="speechToTextButtonSettings?.size"
|
|
289
|
-
[themeColor]="speechToTextButtonSettings?.themeColor"
|
|
290
|
-
(result)="handleSpeechResult($event)"
|
|
291
|
-
(start)="isListening = true"
|
|
292
|
-
(end)="isListening = false"
|
|
293
|
-
></button>
|
|
294
|
-
}
|
|
295
|
-
@if (enableFileSelect) {
|
|
296
|
-
<button
|
|
297
|
-
kendoButton
|
|
298
|
-
[attr.title]="textFor('fileSelectButtonTitle')"
|
|
299
|
-
[svgIcon]="attachmentIcon"
|
|
300
|
-
icon="attachment"
|
|
301
|
-
fillMode="clear"
|
|
302
|
-
(click)="selectFiles()"
|
|
303
|
-
></button>
|
|
304
|
-
}
|
|
305
|
-
<kendo-input-spacer></kendo-input-spacer>
|
|
306
|
-
<button
|
|
307
|
-
kendoButton
|
|
308
|
-
[fillMode]="sendButtonSettings?.fillMode"
|
|
309
|
-
[themeColor]="sendButtonSettings?.themeColor"
|
|
310
|
-
[rounded]="sendButtonSettings?.rounded"
|
|
311
|
-
[class]="sendButtonSettings?.buttonClass || 'k-chat-send'"
|
|
312
|
-
[icon]="sendButtonSettings?.icon"
|
|
313
|
-
[svgIcon]="sendButtonSettings?.svgIcon"
|
|
314
|
-
[tabindex]="0"
|
|
315
|
-
[attr.title]="textFor('send')"
|
|
316
|
-
[class.k-disabled]="isDisabledSendButton"
|
|
317
|
-
[attr.aria-disabled]="isDisabledSendButton"
|
|
318
|
-
(click)="sendClick()"
|
|
319
|
-
>
|
|
320
|
-
</button>
|
|
321
|
-
</kendo-textarea-suffix>
|
|
322
|
-
</kendo-textarea>
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
@if (messageBoxTemplate?.templateRef) {
|
|
326
|
-
<ng-template [ngTemplateOutlet]="messageBoxTemplate?.templateRef"></ng-template>
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
<kendo-fileselect
|
|
330
|
-
#fileSelect
|
|
331
|
-
class="k-hidden"
|
|
332
|
-
[multiple]="true"
|
|
333
|
-
[showFileList]="false"
|
|
334
|
-
(select)="handleFileSelect($event)"
|
|
335
|
-
></kendo-fileselect>
|
|
336
|
-
`, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TextAreaComponent, selector: "kendo-textarea", inputs: ["focusableId", "flow", "inputAttributes", "adornmentsOrientation", "rows", "cols", "maxlength", "maxResizableRows", "tabindex", "tabIndex", "resizable", "size", "rounded", "fillMode", "showPrefixSeparator", "showSuffixSeparator"], outputs: ["focus", "blur", "valueChange"], exportAs: ["kendoTextArea"] }, { kind: "component", type: MessageReferenceComponent, selector: "chat-message-reference-content", inputs: ["message"] }, { kind: "component", type: TextAreaSuffixComponent, selector: "kendo-textarea-suffix", inputs: ["flow", "orientation"], exportAs: ["kendoTextAreaSuffix"] }, { kind: "component", type: TextAreaPrefixComponent, selector: "kendo-textarea-prefix", inputs: ["flow", "orientation"], exportAs: ["kendoTextAreaPrefix"] }, { kind: "component", type: SpeechToTextButtonComponent, selector: "button[kendoSpeechToTextButton]", inputs: ["disabled", "size", "rounded", "fillMode", "themeColor", "integrationMode", "lang", "continuous", "interimResults", "maxAlternatives"], outputs: ["start", "end", "result", "error", "click"], exportAs: ["kendoSpeechToTextButton"] }, { kind: "component", type: InputSpacerComponent, selector: "kendo-input-spacer, kendo-textbox-spacer", inputs: ["width"] }, { kind: "component", type: FileSelectComponent, selector: "kendo-fileselect", inputs: ["name"], outputs: ["valueChange"], exportAs: ["kendoFileSelect"] }, { kind: "component", type: SuggestedActionsComponent, selector: "kendo-chat-suggested-actions", inputs: ["actions", "suggestions", "tabbable", "type", "suggestionTemplate"], outputs: ["dispatchAction", "dispatchSuggestion"] }, { kind: "component", type: ChatFileComponent, selector: "li[chatFile]", inputs: ["chatFile", "removable", "fileActions"], outputs: ["remove", "actionClick", "actionsToggle", "actionButtonClick"] }] });
|
|
337
|
-
}
|
|
338
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MessageBoxComponent, decorators: [{
|
|
339
|
-
type: Component,
|
|
340
|
-
args: [{
|
|
341
|
-
selector: 'kendo-message-box',
|
|
342
|
-
template: `
|
|
343
|
-
@if (suggestions?.length > 0) {
|
|
344
|
-
<kendo-chat-suggested-actions
|
|
345
|
-
#suggestedActions
|
|
346
|
-
[suggestions]="suggestions"
|
|
347
|
-
type="suggestion"
|
|
348
|
-
[suggestionTemplate]="suggestionTemplate"
|
|
349
|
-
[tabbable]="true"
|
|
350
|
-
(dispatchSuggestion)="dispatchSuggestion($event)"
|
|
351
|
-
(click)="select(suggestedActions, $event)"
|
|
352
|
-
(focus)="select(suggestedActions, $event)"
|
|
353
|
-
></kendo-chat-suggested-actions>
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
@if (!messageBoxTemplate?.templateRef) {
|
|
357
|
-
<kendo-textarea
|
|
358
|
-
#messageBoxInput
|
|
359
|
-
class="k-message-box"
|
|
360
|
-
resizable="none"
|
|
361
|
-
[rows]="3"
|
|
362
|
-
[inputAttributes]="{
|
|
363
|
-
'aria-label': textFor('messageBoxInputLabel')
|
|
364
|
-
}"
|
|
365
|
-
[placeholder]="placeholder || textFor('messagePlaceholder')"
|
|
366
|
-
[showSuffixSeparator]="false"
|
|
367
|
-
(keydown)="textAreaKeydown($event)"
|
|
368
|
-
[value]="inputValue"
|
|
369
|
-
(valueChange)="onInputValueChange($event)"
|
|
370
|
-
>
|
|
371
|
-
@if (reply || (files && files.length > 0)) {
|
|
372
|
-
<kendo-textarea-prefix>
|
|
373
|
-
@if (reply) {
|
|
374
|
-
<div class="k-message-reference k-message-reference-sender" (click)="onReplyReferenceClick($event)">
|
|
375
|
-
<chat-message-reference-content [message]="reply"></chat-message-reference-content>
|
|
376
|
-
<span class="k-spacer"></span>
|
|
377
|
-
<button
|
|
378
|
-
kendoButton
|
|
379
|
-
[attr.title]="textFor('removeReplyTitle')"
|
|
380
|
-
[svgIcon]="deleteIcon"
|
|
381
|
-
(click)="removeReply()"
|
|
382
|
-
fillMode="flat"
|
|
383
|
-
></button>
|
|
384
|
-
</div>
|
|
385
|
-
}
|
|
386
|
-
<ul class="k-chat-file-wrapper">
|
|
387
|
-
@for (file of files; track file; let i = $index) {
|
|
388
|
-
<li class="k-chat-file"
|
|
389
|
-
[chatFile]="file"
|
|
390
|
-
[removable]="true"
|
|
391
|
-
(remove)="removeFile(i)"
|
|
392
|
-
></li>
|
|
393
|
-
}
|
|
394
|
-
</ul>
|
|
395
|
-
</kendo-textarea-prefix>
|
|
396
|
-
}
|
|
397
|
-
<kendo-textarea-suffix>
|
|
398
|
-
@if (speechToTextButtonSettings) {
|
|
399
|
-
<button
|
|
400
|
-
kendoSpeechToTextButton
|
|
401
|
-
[attr.title]="textFor('speechToTextButtonTitle')"
|
|
402
|
-
[continuous]="speechToTextButtonSettings?.continuous"
|
|
403
|
-
[disabled]="speechToTextButtonSettings?.disabled"
|
|
404
|
-
[fillMode]="speechToTextButtonSettings?.fillMode ?? 'clear'"
|
|
405
|
-
[integrationMode]="speechToTextButtonSettings?.integrationMode ?? 'webSpeech'"
|
|
406
|
-
[interimResults]="speechToTextButtonSettings?.interimResults"
|
|
407
|
-
[lang]="speechToTextButtonSettings?.lang"
|
|
408
|
-
[maxAlternatives]="speechToTextButtonSettings?.maxAlternatives"
|
|
409
|
-
[rounded]="speechToTextButtonSettings?.rounded"
|
|
410
|
-
[size]="speechToTextButtonSettings?.size"
|
|
411
|
-
[themeColor]="speechToTextButtonSettings?.themeColor"
|
|
412
|
-
(result)="handleSpeechResult($event)"
|
|
413
|
-
(start)="isListening = true"
|
|
414
|
-
(end)="isListening = false"
|
|
415
|
-
></button>
|
|
416
|
-
}
|
|
417
|
-
@if (enableFileSelect) {
|
|
418
|
-
<button
|
|
419
|
-
kendoButton
|
|
420
|
-
[attr.title]="textFor('fileSelectButtonTitle')"
|
|
421
|
-
[svgIcon]="attachmentIcon"
|
|
422
|
-
icon="attachment"
|
|
423
|
-
fillMode="clear"
|
|
424
|
-
(click)="selectFiles()"
|
|
425
|
-
></button>
|
|
426
|
-
}
|
|
427
|
-
<kendo-input-spacer></kendo-input-spacer>
|
|
428
|
-
<button
|
|
429
|
-
kendoButton
|
|
430
|
-
[fillMode]="sendButtonSettings?.fillMode"
|
|
431
|
-
[themeColor]="sendButtonSettings?.themeColor"
|
|
432
|
-
[rounded]="sendButtonSettings?.rounded"
|
|
433
|
-
[class]="sendButtonSettings?.buttonClass || 'k-chat-send'"
|
|
434
|
-
[icon]="sendButtonSettings?.icon"
|
|
435
|
-
[svgIcon]="sendButtonSettings?.svgIcon"
|
|
436
|
-
[tabindex]="0"
|
|
437
|
-
[attr.title]="textFor('send')"
|
|
438
|
-
[class.k-disabled]="isDisabledSendButton"
|
|
439
|
-
[attr.aria-disabled]="isDisabledSendButton"
|
|
440
|
-
(click)="sendClick()"
|
|
441
|
-
>
|
|
442
|
-
</button>
|
|
443
|
-
</kendo-textarea-suffix>
|
|
444
|
-
</kendo-textarea>
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
@if (messageBoxTemplate?.templateRef) {
|
|
448
|
-
<ng-template [ngTemplateOutlet]="messageBoxTemplate?.templateRef"></ng-template>
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
<kendo-fileselect
|
|
452
|
-
#fileSelect
|
|
453
|
-
class="k-hidden"
|
|
454
|
-
[multiple]="true"
|
|
455
|
-
[showFileList]="false"
|
|
456
|
-
(select)="handleFileSelect($event)"
|
|
457
|
-
></kendo-fileselect>
|
|
458
|
-
`,
|
|
459
|
-
standalone: true,
|
|
460
|
-
imports: [ButtonComponent, FormsModule, NgTemplateOutlet, TextAreaComponent, MessageReferenceComponent, TextAreaSuffixComponent, TextAreaPrefixComponent, SpeechToTextButtonComponent, InputSpacerComponent, FileSelectComponent, SuggestedActionsComponent, ChatFileComponent]
|
|
461
|
-
}]
|
|
462
|
-
}], ctorParameters: () => [{ type: i1.ChatService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { borderColor: [{
|
|
463
|
-
type: HostBinding,
|
|
464
|
-
args: ['style.border-color']
|
|
465
|
-
}], messageBoxWrapperClass: [{
|
|
466
|
-
type: HostBinding,
|
|
467
|
-
args: ['class.k-message-box-wrapper']
|
|
468
|
-
}], messageBoxInput: [{
|
|
469
|
-
type: ViewChild,
|
|
470
|
-
args: ['messageBoxInput']
|
|
471
|
-
}], fileSelectComponent: [{
|
|
472
|
-
type: ViewChild,
|
|
473
|
-
args: ['fileSelect']
|
|
474
|
-
}], suggestedActionsComponent: [{
|
|
475
|
-
type: ViewChild,
|
|
476
|
-
args: [SuggestedActionsComponent]
|
|
477
|
-
}], authorId: [{
|
|
478
|
-
type: Input
|
|
479
|
-
}], autoScroll: [{
|
|
480
|
-
type: Input
|
|
481
|
-
}], suggestions: [{
|
|
482
|
-
type: Input
|
|
483
|
-
}], placeholder: [{
|
|
484
|
-
type: Input
|
|
485
|
-
}], inputValue: [{
|
|
486
|
-
type: Input
|
|
487
|
-
}], localization: [{
|
|
488
|
-
type: Input
|
|
489
|
-
}], messageBoxTemplate: [{
|
|
490
|
-
type: Input
|
|
491
|
-
}], suggestionTemplate: [{
|
|
492
|
-
type: Input
|
|
493
|
-
}], sendMessage: [{
|
|
494
|
-
type: Output
|
|
495
|
-
}], executeSuggestion: [{
|
|
496
|
-
type: Output
|
|
497
|
-
}], fileSelect: [{
|
|
498
|
-
type: Output
|
|
499
|
-
}], fileRemove: [{
|
|
500
|
-
type: Output
|
|
501
|
-
}] } });
|