@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.
Files changed (116) hide show
  1. package/ai-prompt/localization/messages.d.ts +1 -1
  2. package/ai-prompt/views/base-view.d.ts +1 -1
  3. package/chat/l10n/messages.d.ts +1 -1
  4. package/fesm2022/progress-kendo-angular-conversational-ui.mjs +182 -182
  5. package/inline-ai-prompt/localization/messages.d.ts +1 -1
  6. package/package.json +17 -25
  7. package/esm2022/ai-prompt/aiprompt.component.mjs +0 -556
  8. package/esm2022/ai-prompt/aiprompt.module.mjs +0 -53
  9. package/esm2022/ai-prompt/common/aiprompt.service.mjs +0 -75
  10. package/esm2022/ai-prompt/common/output-card.component.mjs +0 -230
  11. package/esm2022/ai-prompt/common/toolbar-focusable.directive.mjs +0 -72
  12. package/esm2022/ai-prompt/common/toolbar-navigation.service.mjs +0 -56
  13. package/esm2022/ai-prompt/localization/custom-messages.component.mjs +0 -54
  14. package/esm2022/ai-prompt/localization/localized-messages.directive.mjs +0 -39
  15. package/esm2022/ai-prompt/localization/messages.mjs +0 -77
  16. package/esm2022/ai-prompt/models/ai-prompt-settings.mjs +0 -5
  17. package/esm2022/ai-prompt/models/command-execute-event.mjs +0 -5
  18. package/esm2022/ai-prompt/models/command.interface.mjs +0 -5
  19. package/esm2022/ai-prompt/models/index.mjs +0 -5
  20. package/esm2022/ai-prompt/models/output-rating-change-event.mjs +0 -5
  21. package/esm2022/ai-prompt/models/prompt-output.interface.mjs +0 -5
  22. package/esm2022/ai-prompt/models/prompt-request-event.mjs +0 -5
  23. package/esm2022/ai-prompt/models/view-type.mjs +0 -5
  24. package/esm2022/ai-prompt/templates/aiprompt-output-body-template.directive.mjs +0 -33
  25. package/esm2022/ai-prompt/templates/aiprompt-output-template.directive.mjs +0 -33
  26. package/esm2022/ai-prompt/templates/toolbar-actions.template.mjs +0 -39
  27. package/esm2022/ai-prompt/utils.mjs +0 -26
  28. package/esm2022/ai-prompt/views/base-view.mjs +0 -98
  29. package/esm2022/ai-prompt/views/command-view.component.mjs +0 -100
  30. package/esm2022/ai-prompt/views/custom-view.component.mjs +0 -50
  31. package/esm2022/ai-prompt/views/index.mjs +0 -8
  32. package/esm2022/ai-prompt/views/output-view.component.mjs +0 -90
  33. package/esm2022/ai-prompt/views/prompt-view.component.mjs +0 -288
  34. package/esm2022/chat/api/action.interface.mjs +0 -5
  35. package/esm2022/chat/api/attachment.interface.mjs +0 -5
  36. package/esm2022/chat/api/chat-file-interface.mjs +0 -5
  37. package/esm2022/chat/api/chat-suggestion.interface.mjs +0 -5
  38. package/esm2022/chat/api/execute-action-event.mjs +0 -29
  39. package/esm2022/chat/api/file-action.mjs +0 -5
  40. package/esm2022/chat/api/file-download-event.interface.mjs +0 -5
  41. package/esm2022/chat/api/files-layout.mjs +0 -5
  42. package/esm2022/chat/api/index.mjs +0 -21
  43. package/esm2022/chat/api/message-action.mjs +0 -5
  44. package/esm2022/chat/api/message-settings.interface.mjs +0 -5
  45. package/esm2022/chat/api/message-width-mode.mjs +0 -5
  46. package/esm2022/chat/api/message.interface.mjs +0 -5
  47. package/esm2022/chat/api/post-message-event.mjs +0 -21
  48. package/esm2022/chat/api/preventable-event.mjs +0 -28
  49. package/esm2022/chat/api/send-button-settings.mjs +0 -5
  50. package/esm2022/chat/api/suggestions-layout.mjs +0 -5
  51. package/esm2022/chat/api/timestamp-visibility.mjs +0 -5
  52. package/esm2022/chat/api/user.interface.mjs +0 -5
  53. package/esm2022/chat/attachment.component.mjs +0 -105
  54. package/esm2022/chat/builtin-actions.mjs +0 -27
  55. package/esm2022/chat/cards/hero-card.component.mjs +0 -131
  56. package/esm2022/chat/chat-file.component.mjs +0 -144
  57. package/esm2022/chat/chat-item.mjs +0 -10
  58. package/esm2022/chat/chat-view.mjs +0 -80
  59. package/esm2022/chat/chat.component.mjs +0 -1015
  60. package/esm2022/chat/chat.directives.mjs +0 -18
  61. package/esm2022/chat/chat.module.mjs +0 -61
  62. package/esm2022/chat/common/chat.service.mjs +0 -179
  63. package/esm2022/chat/common/models/default-model-fields.mjs +0 -25
  64. package/esm2022/chat/common/models/formatted-text-parts.mjs +0 -5
  65. package/esm2022/chat/common/models/message-box-options.mjs +0 -5
  66. package/esm2022/chat/common/models/model-fields.mjs +0 -5
  67. package/esm2022/chat/common/scroll-anchor.directive.mjs +0 -80
  68. package/esm2022/chat/common/scroll-button.component.mjs +0 -81
  69. package/esm2022/chat/common/scroll.service.mjs +0 -110
  70. package/esm2022/chat/common/utils.mjs +0 -159
  71. package/esm2022/chat/l10n/custom-messages.component.mjs +0 -55
  72. package/esm2022/chat/l10n/localized-messages.directive.mjs +0 -40
  73. package/esm2022/chat/l10n/messages.mjs +0 -130
  74. package/esm2022/chat/message-attachments.component.mjs +0 -258
  75. package/esm2022/chat/message-box.component.mjs +0 -501
  76. package/esm2022/chat/message-list.component.mjs +0 -617
  77. package/esm2022/chat/message-reference-content.component.mjs +0 -86
  78. package/esm2022/chat/message.component.mjs +0 -740
  79. package/esm2022/chat/suggested-actions.component.mjs +0 -443
  80. package/esm2022/chat/templates/attachment-template.directive.mjs +0 -43
  81. package/esm2022/chat/templates/author-message-content-template.directive.mjs +0 -39
  82. package/esm2022/chat/templates/author-message-template.directive.mjs +0 -39
  83. package/esm2022/chat/templates/header-template.directive.mjs +0 -33
  84. package/esm2022/chat/templates/message-box.directive.mjs +0 -36
  85. package/esm2022/chat/templates/message-content-template.directive.mjs +0 -39
  86. package/esm2022/chat/templates/message-template.directive.mjs +0 -39
  87. package/esm2022/chat/templates/no-data-template.directive.mjs +0 -38
  88. package/esm2022/chat/templates/receiver-message-content-template.directive.mjs +0 -39
  89. package/esm2022/chat/templates/receiver-message-template.directive.mjs +0 -39
  90. package/esm2022/chat/templates/status-template.directive.mjs +0 -33
  91. package/esm2022/chat/templates/suggestion-template.directive.mjs +0 -36
  92. package/esm2022/chat/templates/timestamp-template.directive.mjs +0 -42
  93. package/esm2022/chat/templates/user-status-template.directive.mjs +0 -38
  94. package/esm2022/conversational-ui.module.mjs +0 -73
  95. package/esm2022/directives.mjs +0 -145
  96. package/esm2022/index.mjs +0 -40
  97. package/esm2022/inline-ai-prompt/inlineaiprompt-content.component.mjs +0 -548
  98. package/esm2022/inline-ai-prompt/inlineaiprompt.component.mjs +0 -351
  99. package/esm2022/inline-ai-prompt/inlineaiprompt.module.mjs +0 -46
  100. package/esm2022/inline-ai-prompt/inlineaiprompt.service.mjs +0 -92
  101. package/esm2022/inline-ai-prompt/localization/custom-messages.component.mjs +0 -51
  102. package/esm2022/inline-ai-prompt/localization/localized-messages.directive.mjs +0 -39
  103. package/esm2022/inline-ai-prompt/localization/messages.mjs +0 -35
  104. package/esm2022/inline-ai-prompt/models/command.interface.mjs +0 -5
  105. package/esm2022/inline-ai-prompt/models/index.mjs +0 -5
  106. package/esm2022/inline-ai-prompt/models/inlineaiprompt-popupsettings.mjs +0 -5
  107. package/esm2022/inline-ai-prompt/models/inlineaiprompt-settings.mjs +0 -59
  108. package/esm2022/inline-ai-prompt/models/messages.mjs +0 -8
  109. package/esm2022/inline-ai-prompt/models/output-action-click-event.mjs +0 -5
  110. package/esm2022/inline-ai-prompt/models/output-action.interface.mjs +0 -5
  111. package/esm2022/inline-ai-prompt/models/prompt-output.interface.mjs +0 -5
  112. package/esm2022/inline-ai-prompt/models/prompt-request-event.mjs +0 -5
  113. package/esm2022/inline-ai-prompt/output-template.directive.mjs +0 -38
  114. package/esm2022/inline-ai-prompt/utils.mjs +0 -57
  115. package/esm2022/package-metadata.mjs +0 -16
  116. package/esm2022/progress-kendo-angular-conversational-ui.mjs +0 -8
@@ -1,548 +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 { Component, ElementRef, EventEmitter, HostBinding, HostListener, Input, NgZone, Output, Renderer2, ViewChild, ViewContainerRef, Optional, SkipSelf, inject, TemplateRef } from '@angular/core';
6
- import { NgClass, NgTemplateOutlet } from '@angular/common';
7
- import { Subscription } from 'rxjs';
8
- import { menuIcon, paperPlaneIcon, stopSmIcon } from '@progress/kendo-svg-icons';
9
- import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
10
- import { validatePackage } from '@progress/kendo-licensing';
11
- import { KENDO_BUTTONS } from '@progress/kendo-angular-buttons';
12
- import { packageMetadata } from '../package-metadata';
13
- import { TextAreaComponent, KENDO_TEXTAREA } from '@progress/kendo-angular-inputs';
14
- import { ContextMenuComponent, KENDO_CONTEXTMENU } from '@progress/kendo-angular-menu';
15
- import { LocalizedMessagesDirective } from './localization/localized-messages.directive';
16
- import { isDocumentAvailable, isPresent } from '@progress/kendo-angular-common';
17
- import { calculateMeasurement, defaultOutputActions } from './utils';
18
- import { KENDO_CARD } from '@progress/kendo-angular-layout';
19
- import * as i0 from "@angular/core";
20
- import * as i1 from "@progress/kendo-angular-l10n";
21
- import * as i2 from "@progress/kendo-angular-buttons";
22
- import * as i3 from "@progress/kendo-angular-inputs";
23
- import * as i4 from "@progress/kendo-angular-menu";
24
- import * as i5 from "@progress/kendo-angular-layout";
25
- const TEXTAREA_MAX_ROWS = 5;
26
- const TEXTAREA_INITIAL_ROWS = 1;
27
- /**
28
- * @hidden
29
- */
30
- export class InlineAIPromptContentComponent {
31
- ngZone;
32
- renderer;
33
- element;
34
- localization;
35
- className = true;
36
- get dirAttr() {
37
- return this.direction;
38
- }
39
- get maxHeightStyle() {
40
- return this.calculateMeasurement(this.maxHeight);
41
- }
42
- get widthStyle() {
43
- return this.calculateMeasurement(this.width);
44
- }
45
- popupElement;
46
- promptValue = "";
47
- placeholder;
48
- promptOutput;
49
- enableSpeechToText = true;
50
- streaming = false;
51
- width = 550;
52
- maxHeight;
53
- appendTo;
54
- defaultOutputActions = defaultOutputActions;
55
- set outputActions(actions) {
56
- this._outputActions = this.mergeWithDefaultActions(actions);
57
- }
58
- get outputActions() {
59
- return this._outputActions;
60
- }
61
- set promptCommands(commands) {
62
- this._promptCommands = commands || [];
63
- this.commandMenuItems = this.transformCommands(commands || []);
64
- }
65
- get promptCommands() {
66
- return this._promptCommands;
67
- }
68
- outputTemplate;
69
- promptRequest = new EventEmitter();
70
- commandExecute = new EventEmitter();
71
- outputActionClick = new EventEmitter();
72
- promptRequestCancel = new EventEmitter();
73
- close = new EventEmitter();
74
- promptValueChange = new EventEmitter();
75
- onEscapeKey(event) {
76
- if (event.key === 'Escape') {
77
- if (this.streaming) {
78
- event.stopPropagation();
79
- this.promptRequestCancel.emit();
80
- }
81
- else {
82
- this.close.emit();
83
- }
84
- }
85
- }
86
- textArea;
87
- contextMenu;
88
- calculateMeasurement = calculateMeasurement;
89
- commandMenuIcon = menuIcon;
90
- sendIcon = paperPlaneIcon;
91
- stopGenerationIcon = stopSmIcon;
92
- isListening = false;
93
- commandMenuItems = [];
94
- messages = {};
95
- maxRows = TEXTAREA_MAX_ROWS;
96
- initialRows = TEXTAREA_INITIAL_ROWS;
97
- _outputActions = this.defaultOutputActions;
98
- _promptCommands = [];
99
- direction;
100
- localizationSubs = new Subscription();
101
- subs = new Subscription();
102
- constructor(ngZone, renderer, element, localization) {
103
- this.ngZone = ngZone;
104
- this.renderer = renderer;
105
- this.element = element;
106
- this.localization = localization;
107
- validatePackage(packageMetadata);
108
- if (!this.localization) {
109
- this.localization = inject(LocalizationService);
110
- }
111
- this.direction = this.localization?.rtl ? 'rtl' : 'ltr';
112
- this.localizationSubs.add(this.localization.changes.subscribe(({ rtl }) => {
113
- this.direction = rtl ? 'rtl' : 'ltr';
114
- }));
115
- }
116
- ngAfterViewInit() {
117
- this.ngZone.runOutsideAngular(() => {
118
- if (!isDocumentAvailable()) {
119
- return;
120
- }
121
- // add a delay to avoid catching the same click event that triggered the component opening
122
- setTimeout(() => {
123
- this.subs.add(this.renderer.listen('document', 'click', (e) => {
124
- this.outsideClickClose(e);
125
- }));
126
- });
127
- });
128
- }
129
- ngOnDestroy() {
130
- this.subs.unsubscribe();
131
- this.localizationSubs.unsubscribe();
132
- this.contextMenu?.hide();
133
- }
134
- focus() {
135
- if (this.textArea) {
136
- this.textArea.focus();
137
- }
138
- }
139
- onActionClick(event) {
140
- const eventArgs = {
141
- action: event,
142
- output: this.promptOutput,
143
- };
144
- this.outputActionClick.emit(eventArgs);
145
- this.handleDefaultActions(event);
146
- }
147
- handleDefaultActions(event) {
148
- switch (event.name) {
149
- case 'copy':
150
- navigator.clipboard.writeText(this.promptOutput.output);
151
- break;
152
- case 'retry':
153
- this.promptRequest.emit({
154
- prompt: this.promptOutput?.prompt,
155
- isRetry: true
156
- });
157
- break;
158
- case 'discard':
159
- this.close.emit();
160
- break;
161
- }
162
- }
163
- handleSpeechResult(event) {
164
- if (event.alternatives && event.alternatives.length > 0) {
165
- if (!isPresent(this.promptValue)) {
166
- this.promptValue = '';
167
- }
168
- this.promptValue += event.alternatives[0].transcript + ' ';
169
- }
170
- }
171
- onClick(action) {
172
- this.commandExecute.next(action);
173
- }
174
- handlePromptValueChange(value) {
175
- this.promptValue = value;
176
- this.promptValueChange.emit(value);
177
- }
178
- handleTextAreaKeydown(event) {
179
- if (event.key === 'Enter' && !event.shiftKey && !this.streaming) {
180
- event.preventDefault();
181
- this.handlePromptRequest();
182
- }
183
- }
184
- onCommandButtonClick(event) {
185
- event.preventDefault();
186
- event.stopPropagation();
187
- if (this.contextMenu) {
188
- this.contextMenu.show(this.popupElement);
189
- }
190
- }
191
- onCommandClick(event) {
192
- // avoid triggering the document click listener to keep the popup open
193
- if (event.originalEvent) {
194
- event.originalEvent.stopPropagation();
195
- event.originalEvent.preventDefault();
196
- }
197
- const eventArgs = {
198
- ...event.item.originalCommand
199
- };
200
- this.commandExecute.emit(eventArgs);
201
- }
202
- messageFor(text) {
203
- if (this.messages?.[text]) {
204
- return this.messages[text];
205
- }
206
- return this.localization?.get(text);
207
- }
208
- handlePromptRequest() {
209
- if (this.streaming) {
210
- this.promptRequestCancel.emit();
211
- return;
212
- }
213
- if (!this.promptValue) {
214
- return;
215
- }
216
- const eventArgs = {
217
- prompt: this.promptValue
218
- };
219
- this.promptRequest.emit(eventArgs);
220
- }
221
- mergeWithDefaultActions(userActions) {
222
- if (!userActions || userActions.length === 0) {
223
- return [];
224
- }
225
- return userActions.map(userAction => {
226
- const defaultAction = defaultOutputActions.find(action => action.name === userAction?.name);
227
- if (defaultAction) {
228
- return { ...defaultAction, ...userAction };
229
- }
230
- return userAction;
231
- });
232
- }
233
- transformCommands = (commands) => commands.map(command => ({
234
- text: command.text,
235
- icon: command.icon,
236
- svgIcon: command.svgIcon,
237
- disabled: command.disabled,
238
- originalCommand: command,
239
- items: command.children ? this.transformCommands(command.children) : undefined
240
- }));
241
- outsideClickClose(e) {
242
- if (!this.element.nativeElement.contains(e.target)) {
243
- this.ngZone.run(() => {
244
- this.close.emit();
245
- });
246
- }
247
- }
248
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: InlineAIPromptContentComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.LocalizationService, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component });
249
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: InlineAIPromptContentComponent, isStandalone: true, selector: "kendo-inlineaiprompt-content", inputs: { popupElement: "popupElement", promptValue: "promptValue", placeholder: "placeholder", promptOutput: "promptOutput", enableSpeechToText: "enableSpeechToText", streaming: "streaming", width: "width", maxHeight: "maxHeight", appendTo: "appendTo", outputActions: "outputActions", promptCommands: "promptCommands", outputTemplate: "outputTemplate" }, outputs: { promptRequest: "promptRequest", commandExecute: "commandExecute", outputActionClick: "outputActionClick", promptRequestCancel: "promptRequestCancel", close: "close", promptValueChange: "promptValueChange" }, host: { listeners: { "keydown": "onEscapeKey($event)" }, properties: { "class.k-prompt": "this.className", "attr.dir": "this.dirAttr", "style.max-height": "this.maxHeightStyle", "style.width": "this.widthStyle" } }, providers: [
250
- LocalizationService,
251
- {
252
- provide: L10N_PREFIX,
253
- useValue: 'kendo.inlineaiprompt',
254
- },
255
- ], viewQueries: [{ propertyName: "textArea", first: true, predicate: TextAreaComponent, descendants: true }, { propertyName: "contextMenu", first: true, predicate: ["kendoContextMenu"], descendants: true }], exportAs: ["kendoInlineAIPromptContent"], ngImport: i0, template: `
256
- <ng-container kendoInlineAIPromptLocalizedMessages
257
- i18n-commandsButtonTitle="kendo.inlineaiprompt.commandsButtonTitle|Sets the Commands button title."
258
- commandsButtonTitle="Command Menu"
259
- i18n-generateButtonTitle="kendo.inlineaiprompt.generateButtonTitle|Sets the Generate button title."
260
- generateButtonTitle="Generate"
261
- i18n-speechToTextButtonTitle="kendo.inlineaiprompt.speechToTextButtonTitle|Sets the Speech to Text button title."
262
- speechToTextButtonTitle="Speech to Text"
263
- >
264
- </ng-container>
265
- <div class="k-prompt-content">
266
- <div class="k-prompt-view">
267
- @if (promptOutput) {
268
- <kendo-card width="100%">
269
- <kendo-card-body>
270
- @if (outputTemplate) {
271
- <ng-container
272
- [ngTemplateOutlet]="outputTemplate"
273
- [ngTemplateOutletContext]="{ $implicit: promptOutput }"
274
- >
275
- </ng-container>
276
- }
277
- @if (!outputTemplate) {
278
- {{promptOutput.output}}
279
- }
280
- </kendo-card-body>
281
- @if (outputActions && outputActions.length > 0) {
282
- <kendo-card-actions>
283
- @for (action of outputActions; track action) {
284
- @if (action.type === 'button') {
285
- <button kendoButton
286
- [attr.title]="action?.title"
287
- [fillMode]="action?.fillMode"
288
- [themeColor]="action?.themeColor"
289
- [rounded]="action?.rounded"
290
- [icon]="action?.icon"
291
- [svgIcon]="action?.svgIcon"
292
- (click)="onActionClick(action)"
293
- >{{action?.text}}</button>
294
- }
295
- @if (action.type === 'spacer') {
296
- <div class="k-spacer"></div>
297
- }
298
- }
299
- </kendo-card-actions>
300
- }
301
- </kendo-card>
302
- }
303
- <kendo-textarea
304
- [value]="promptValue ? promptValue : null"
305
- (valueChange)="handlePromptValueChange($event)"
306
- [rows]="initialRows"
307
- resizable="auto"
308
- flow="horizontal"
309
- [placeholder]="placeholder"
310
- [showPrefixSeparator]="true"
311
- [selectOnFocus]="true"
312
- [maxResizableRows]="maxRows"
313
- (keydown)="handleTextAreaKeydown($event)"
314
- >
315
- <kendo-textarea-prefix>
316
- @if (promptCommands && promptCommands.length > 0) {
317
- <button
318
- kendoButton
319
- #commandMenuButton
320
- [attr.title]="messageFor('commandsButtonTitle')"
321
- fillMode="flat"
322
- icon="menu"
323
- [svgIcon]="commandMenuIcon"
324
- (click)="onCommandButtonClick($event)"
325
- ></button>
326
- }
327
- @if (enableSpeechToText) {
328
- <button
329
- kendoSpeechToTextButton
330
- [attr.title]="messageFor('speechToTextButtonTitle')"
331
- fillMode="flat"
332
- (result)="handleSpeechResult($event)"
333
- (start)="isListening = true"
334
- (end)="isListening = false"
335
- ></button>
336
- }
337
- </kendo-textarea-prefix>
338
- <kendo-textarea-suffix>
339
- <button
340
- kendoButton
341
- [attr.title]="messageFor('generateButtonTitle')"
342
- fillMode="flat"
343
- class="k-prompt-send"
344
- [ngClass]="{ 'k-generating': streaming, 'k-active': streaming }"
345
- (click)="handlePromptRequest()"
346
- [disabled]="!streaming && (!promptValue?.trim() || isListening)"
347
- [svgIcon]="streaming ? stopGenerationIcon : sendIcon"
348
- [icon]="streaming ? 'stop-sm' : 'paper-plane'"
349
- ></button>
350
- </kendo-textarea-suffix>
351
- </kendo-textarea>
352
- </div>
353
- </div>
354
- <kendo-contextmenu
355
- #kendoContextMenu
356
- [alignToAnchor]="true"
357
- [items]="commandMenuItems"
358
- [appendTo]="appendTo"
359
- class="k-hidden"
360
- (select)="onCommandClick($event)">
361
- </kendo-contextmenu>
362
- `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoInlineAIPromptLocalizedMessages]" }, { kind: "component", type: i2.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: "component", type: i2.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: i3.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: i3.TextAreaPrefixComponent, selector: "kendo-textarea-prefix", inputs: ["flow", "orientation"], exportAs: ["kendoTextAreaPrefix"] }, { kind: "component", type: i3.TextAreaSuffixComponent, selector: "kendo-textarea-suffix", inputs: ["flow", "orientation"], exportAs: ["kendoTextAreaSuffix"] }, { kind: "component", type: i4.ContextMenuComponent, selector: "kendo-contextmenu", inputs: ["showOn", "target", "filter", "alignToAnchor", "vertical", "popupAnimate", "popupAlign", "anchorAlign", "collision", "appendTo", "ariaLabel"], outputs: ["popupOpen", "popupClose", "select", "open", "close"], exportAs: ["kendoContextMenu"] }, { kind: "component", type: i5.CardComponent, selector: "kendo-card", inputs: ["orientation", "width"] }, { kind: "component", type: i5.CardActionsComponent, selector: "kendo-card-actions", inputs: ["orientation", "layout", "actions"], outputs: ["action"] }, { kind: "component", type: i5.CardBodyComponent, selector: "kendo-card-body" }] });
363
- }
364
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: InlineAIPromptContentComponent, decorators: [{
365
- type: Component,
366
- args: [{
367
- exportAs: 'kendoInlineAIPromptContent',
368
- selector: 'kendo-inlineaiprompt-content',
369
- providers: [
370
- LocalizationService,
371
- {
372
- provide: L10N_PREFIX,
373
- useValue: 'kendo.inlineaiprompt',
374
- },
375
- ],
376
- template: `
377
- <ng-container kendoInlineAIPromptLocalizedMessages
378
- i18n-commandsButtonTitle="kendo.inlineaiprompt.commandsButtonTitle|Sets the Commands button title."
379
- commandsButtonTitle="Command Menu"
380
- i18n-generateButtonTitle="kendo.inlineaiprompt.generateButtonTitle|Sets the Generate button title."
381
- generateButtonTitle="Generate"
382
- i18n-speechToTextButtonTitle="kendo.inlineaiprompt.speechToTextButtonTitle|Sets the Speech to Text button title."
383
- speechToTextButtonTitle="Speech to Text"
384
- >
385
- </ng-container>
386
- <div class="k-prompt-content">
387
- <div class="k-prompt-view">
388
- @if (promptOutput) {
389
- <kendo-card width="100%">
390
- <kendo-card-body>
391
- @if (outputTemplate) {
392
- <ng-container
393
- [ngTemplateOutlet]="outputTemplate"
394
- [ngTemplateOutletContext]="{ $implicit: promptOutput }"
395
- >
396
- </ng-container>
397
- }
398
- @if (!outputTemplate) {
399
- {{promptOutput.output}}
400
- }
401
- </kendo-card-body>
402
- @if (outputActions && outputActions.length > 0) {
403
- <kendo-card-actions>
404
- @for (action of outputActions; track action) {
405
- @if (action.type === 'button') {
406
- <button kendoButton
407
- [attr.title]="action?.title"
408
- [fillMode]="action?.fillMode"
409
- [themeColor]="action?.themeColor"
410
- [rounded]="action?.rounded"
411
- [icon]="action?.icon"
412
- [svgIcon]="action?.svgIcon"
413
- (click)="onActionClick(action)"
414
- >{{action?.text}}</button>
415
- }
416
- @if (action.type === 'spacer') {
417
- <div class="k-spacer"></div>
418
- }
419
- }
420
- </kendo-card-actions>
421
- }
422
- </kendo-card>
423
- }
424
- <kendo-textarea
425
- [value]="promptValue ? promptValue : null"
426
- (valueChange)="handlePromptValueChange($event)"
427
- [rows]="initialRows"
428
- resizable="auto"
429
- flow="horizontal"
430
- [placeholder]="placeholder"
431
- [showPrefixSeparator]="true"
432
- [selectOnFocus]="true"
433
- [maxResizableRows]="maxRows"
434
- (keydown)="handleTextAreaKeydown($event)"
435
- >
436
- <kendo-textarea-prefix>
437
- @if (promptCommands && promptCommands.length > 0) {
438
- <button
439
- kendoButton
440
- #commandMenuButton
441
- [attr.title]="messageFor('commandsButtonTitle')"
442
- fillMode="flat"
443
- icon="menu"
444
- [svgIcon]="commandMenuIcon"
445
- (click)="onCommandButtonClick($event)"
446
- ></button>
447
- }
448
- @if (enableSpeechToText) {
449
- <button
450
- kendoSpeechToTextButton
451
- [attr.title]="messageFor('speechToTextButtonTitle')"
452
- fillMode="flat"
453
- (result)="handleSpeechResult($event)"
454
- (start)="isListening = true"
455
- (end)="isListening = false"
456
- ></button>
457
- }
458
- </kendo-textarea-prefix>
459
- <kendo-textarea-suffix>
460
- <button
461
- kendoButton
462
- [attr.title]="messageFor('generateButtonTitle')"
463
- fillMode="flat"
464
- class="k-prompt-send"
465
- [ngClass]="{ 'k-generating': streaming, 'k-active': streaming }"
466
- (click)="handlePromptRequest()"
467
- [disabled]="!streaming && (!promptValue?.trim() || isListening)"
468
- [svgIcon]="streaming ? stopGenerationIcon : sendIcon"
469
- [icon]="streaming ? 'stop-sm' : 'paper-plane'"
470
- ></button>
471
- </kendo-textarea-suffix>
472
- </kendo-textarea>
473
- </div>
474
- </div>
475
- <kendo-contextmenu
476
- #kendoContextMenu
477
- [alignToAnchor]="true"
478
- [items]="commandMenuItems"
479
- [appendTo]="appendTo"
480
- class="k-hidden"
481
- (select)="onCommandClick($event)">
482
- </kendo-contextmenu>
483
- `,
484
- standalone: true,
485
- imports: [NgClass, NgTemplateOutlet, LocalizedMessagesDirective, KENDO_BUTTONS, KENDO_TEXTAREA, KENDO_CONTEXTMENU, KENDO_CARD],
486
- }]
487
- }], ctorParameters: () => [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.LocalizationService, decorators: [{
488
- type: Optional
489
- }, {
490
- type: SkipSelf
491
- }] }], propDecorators: { className: [{
492
- type: HostBinding,
493
- args: ['class.k-prompt']
494
- }], dirAttr: [{
495
- type: HostBinding,
496
- args: ['attr.dir']
497
- }], maxHeightStyle: [{
498
- type: HostBinding,
499
- args: ['style.max-height']
500
- }], widthStyle: [{
501
- type: HostBinding,
502
- args: ['style.width']
503
- }], popupElement: [{
504
- type: Input
505
- }], promptValue: [{
506
- type: Input
507
- }], placeholder: [{
508
- type: Input
509
- }], promptOutput: [{
510
- type: Input
511
- }], enableSpeechToText: [{
512
- type: Input
513
- }], streaming: [{
514
- type: Input
515
- }], width: [{
516
- type: Input
517
- }], maxHeight: [{
518
- type: Input
519
- }], appendTo: [{
520
- type: Input
521
- }], outputActions: [{
522
- type: Input
523
- }], promptCommands: [{
524
- type: Input
525
- }], outputTemplate: [{
526
- type: Input
527
- }], promptRequest: [{
528
- type: Output
529
- }], commandExecute: [{
530
- type: Output
531
- }], outputActionClick: [{
532
- type: Output
533
- }], promptRequestCancel: [{
534
- type: Output
535
- }], close: [{
536
- type: Output
537
- }], promptValueChange: [{
538
- type: Output
539
- }], onEscapeKey: [{
540
- type: HostListener,
541
- args: ['keydown', ['$event']]
542
- }], textArea: [{
543
- type: ViewChild,
544
- args: [TextAreaComponent]
545
- }], contextMenu: [{
546
- type: ViewChild,
547
- args: ['kendoContextMenu']
548
- }] } });