@progress/kendo-angular-conversational-ui 19.3.0-develop.2 → 19.3.0-develop.21

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 (28) hide show
  1. package/ai-prompt/aiprompt.component.d.ts +71 -12
  2. package/ai-prompt/aiprompt.module.d.ts +3 -1
  3. package/ai-prompt/common/aiprompt.service.d.ts +10 -0
  4. package/ai-prompt/common/output-card.component.d.ts +4 -0
  5. package/ai-prompt/models/ai-prompt-settings.d.ts +60 -0
  6. package/ai-prompt/models/index.d.ts +1 -0
  7. package/ai-prompt/templates/aiprompt-output-body-template.directive.d.ts +24 -0
  8. package/ai-prompt/templates/aiprompt-output-template.directive.d.ts +24 -0
  9. package/ai-prompt/views/output-view.component.d.ts +4 -0
  10. package/ai-prompt/views/prompt-view.component.d.ts +19 -1
  11. package/conversational-ui.module.d.ts +9 -7
  12. package/directives.d.ts +4 -2
  13. package/esm2022/ai-prompt/aiprompt.component.mjs +136 -19
  14. package/esm2022/ai-prompt/aiprompt.module.mjs +3 -1
  15. package/esm2022/ai-prompt/common/aiprompt.service.mjs +35 -0
  16. package/esm2022/ai-prompt/common/output-card.component.mjs +23 -5
  17. package/esm2022/ai-prompt/models/ai-prompt-settings.mjs +5 -0
  18. package/esm2022/ai-prompt/templates/aiprompt-output-body-template.directive.mjs +33 -0
  19. package/esm2022/ai-prompt/templates/aiprompt-output-template.directive.mjs +33 -0
  20. package/esm2022/ai-prompt/views/output-view.component.mjs +27 -11
  21. package/esm2022/ai-prompt/views/prompt-view.component.mjs +115 -21
  22. package/esm2022/conversational-ui.module.mjs +10 -8
  23. package/esm2022/directives.mjs +5 -1
  24. package/esm2022/index.mjs +2 -0
  25. package/esm2022/package-metadata.mjs +2 -2
  26. package/fesm2022/progress-kendo-angular-conversational-ui.mjs +393 -57
  27. package/index.d.ts +2 -0
  28. package/package.json +12 -12
@@ -2,13 +2,13 @@
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 { Component, forwardRef } from '@angular/core';
5
+ import { Component, forwardRef, isDevMode } from '@angular/core';
6
6
  import { NgIf, NgFor } from '@angular/common';
7
7
  import { LocalizationService } from '@progress/kendo-angular-l10n';
8
8
  import { guid } from '@progress/kendo-angular-common';
9
9
  import { chevronDownIcon, chevronUpIcon } from '@progress/kendo-svg-icons';
10
- import { ButtonComponent } from '@progress/kendo-angular-buttons';
11
- import { TextAreaComponent } from '@progress/kendo-angular-inputs';
10
+ import { ButtonComponent, SpeechToTextButtonComponent } from '@progress/kendo-angular-buttons';
11
+ import { TextAreaComponent, TextAreaSuffixComponent } from '@progress/kendo-angular-inputs';
12
12
  import { BaseView } from './base-view';
13
13
  import { AIPromptService } from '../common/aiprompt.service';
14
14
  import * as i0 from "@angular/core";
@@ -68,6 +68,34 @@ export class PromptViewComponent extends BaseView {
68
68
  suggestionClick(suggestion) {
69
69
  this.textAreaValue = this.service.promptValue = suggestion;
70
70
  }
71
+ /**
72
+ * @hidden
73
+ */
74
+ get speechToTextButtonSettings() {
75
+ return this.service.speechToTextButton;
76
+ }
77
+ /**
78
+ * @hidden
79
+ */
80
+ get textareaSettings() {
81
+ return this.service.textAreaSettings;
82
+ }
83
+ /**
84
+ * @hidden
85
+ */
86
+ onSpeechToTextResult(event) {
87
+ if (event.alternatives && event.alternatives.length > 0) {
88
+ this.textAreaValue += event.alternatives[0].transcript + ' ';
89
+ }
90
+ }
91
+ /**
92
+ * @hidden
93
+ */
94
+ onSpeechToTextError(event) {
95
+ if (isDevMode()) {
96
+ console.error('Speech to Text error:', event.errorMessage);
97
+ }
98
+ }
71
99
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PromptViewComponent, deps: [{ token: i1.LocalizationService }, { token: i2.AIPromptService }], target: i0.ɵɵFactoryTarget.Component });
72
100
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PromptViewComponent, isStandalone: true, selector: "kendo-aiprompt-prompt-view", providers: [
73
101
  {
@@ -77,9 +105,40 @@ export class PromptViewComponent extends BaseView {
77
105
  ], usesInheritance: true, ngImport: i0, template: `
78
106
  <ng-template #content>
79
107
  <kendo-textarea
80
- [placeholder]="messageFor('promptPlaceholder')"
81
- [rows]="1"
82
- [(value)]="textAreaValue">
108
+ [cols]="textareaSettings?.cols"
109
+ [disabled]="textareaSettings?.disabled"
110
+ [fillMode]="textareaSettings?.fillMode"
111
+ [flow]="textareaSettings?.flow ?? 'vertical'"
112
+ [inputAttributes]="textareaSettings?.inputAttributes"
113
+ [maxlength]="textareaSettings?.maxlength"
114
+ [placeholder]="textareaSettings?.placeholder ?? messageFor('promptPlaceholder')"
115
+ [readonly]="textareaSettings?.readonly"
116
+ [resizable]="textareaSettings?.resizable ?? 'vertical'"
117
+ [rounded]="textareaSettings?.rounded"
118
+ [rows]="textareaSettings?.rows ?? 1"
119
+ [selectOnFocus]="textareaSettings?.selectOnFocus"
120
+ [showSuffixSeparator]="textareaSettings?.showSuffixSeparator ?? true"
121
+ [size]="textareaSettings?.size"
122
+ [tabIndex]="textareaSettings?.tabindex"
123
+ [title]="textareaSettings?.title"
124
+ [(value)]="textAreaValue"
125
+ >
126
+ <kendo-textarea-suffix *ngIf="speechToTextButtonSettings">
127
+ <button kendoSpeechToTextButton
128
+ [continuous]="speechToTextButtonSettings?.continuous"
129
+ [disabled]="speechToTextButtonSettings?.disabled"
130
+ [fillMode]="speechToTextButtonSettings?.fillMode ?? 'flat'"
131
+ [integrationMode]="speechToTextButtonSettings?.integrationMode ?? 'webSpeech'"
132
+ [interimResults]="speechToTextButtonSettings?.interimResults"
133
+ [lang]="speechToTextButtonSettings?.lang"
134
+ [maxAlternatives]="speechToTextButtonSettings?.maxAlternatives"
135
+ [rounded]="speechToTextButtonSettings?.rounded"
136
+ [size]="speechToTextButtonSettings?.size"
137
+ [themeColor]="speechToTextButtonSettings?.themeColor"
138
+ (error)="onSpeechToTextError($event)"
139
+ (result)="onSpeechToTextResult($event)"
140
+ ></button>
141
+ </kendo-textarea-suffix>
83
142
  </kendo-textarea>
84
143
  <div *ngIf="promptSuggestions"
85
144
  class="k-prompt-expander">
@@ -97,16 +156,18 @@ export class PromptViewComponent extends BaseView {
97
156
  class="k-prompt-expander-content"
98
157
  role="list"
99
158
  [attr.id]="contentId">
100
- <div *ngFor="let suggestion of promptSuggestions"
101
- class="k-prompt-suggestion"
102
- role="listitem"
103
- (click)="suggestionClick(suggestion)">
104
- {{suggestion}}
159
+ <div class="k-suggestion-group">
160
+ <div *ngFor="let suggestion of promptSuggestions"
161
+ class="k-suggestion"
162
+ role="listitem"
163
+ (click)="suggestionClick(suggestion)">
164
+ {{suggestion}}
165
+ </div>
105
166
  </div>
106
167
  </div>
107
168
  </div>
108
169
  </ng-template>
109
- `, isInline: true, dependencies: [{ kind: "component", type: TextAreaComponent, selector: "kendo-textarea", inputs: ["focusableId", "flow", "inputAttributes", "adornmentsOrientation", "rows", "cols", "maxlength", "tabindex", "tabIndex", "resizable", "size", "rounded", "fillMode", "showPrefixSeparator", "showSuffixSeparator"], outputs: ["focus", "blur", "valueChange"], exportAs: ["kendoTextArea"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
170
+ `, isInline: true, dependencies: [{ kind: "component", type: TextAreaComponent, selector: "kendo-textarea", inputs: ["focusableId", "flow", "inputAttributes", "adornmentsOrientation", "rows", "cols", "maxlength", "tabindex", "tabIndex", "resizable", "size", "rounded", "fillMode", "showPrefixSeparator", "showSuffixSeparator"], outputs: ["focus", "blur", "valueChange"], exportAs: ["kendoTextArea"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: TextAreaSuffixComponent, selector: "kendo-textarea-suffix", inputs: ["flow", "orientation"], exportAs: ["kendoTextAreaSuffix"] }, { 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"] }] });
110
171
  }
111
172
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PromptViewComponent, decorators: [{
112
173
  type: Component,
@@ -121,9 +182,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
121
182
  template: `
122
183
  <ng-template #content>
123
184
  <kendo-textarea
124
- [placeholder]="messageFor('promptPlaceholder')"
125
- [rows]="1"
126
- [(value)]="textAreaValue">
185
+ [cols]="textareaSettings?.cols"
186
+ [disabled]="textareaSettings?.disabled"
187
+ [fillMode]="textareaSettings?.fillMode"
188
+ [flow]="textareaSettings?.flow ?? 'vertical'"
189
+ [inputAttributes]="textareaSettings?.inputAttributes"
190
+ [maxlength]="textareaSettings?.maxlength"
191
+ [placeholder]="textareaSettings?.placeholder ?? messageFor('promptPlaceholder')"
192
+ [readonly]="textareaSettings?.readonly"
193
+ [resizable]="textareaSettings?.resizable ?? 'vertical'"
194
+ [rounded]="textareaSettings?.rounded"
195
+ [rows]="textareaSettings?.rows ?? 1"
196
+ [selectOnFocus]="textareaSettings?.selectOnFocus"
197
+ [showSuffixSeparator]="textareaSettings?.showSuffixSeparator ?? true"
198
+ [size]="textareaSettings?.size"
199
+ [tabIndex]="textareaSettings?.tabindex"
200
+ [title]="textareaSettings?.title"
201
+ [(value)]="textAreaValue"
202
+ >
203
+ <kendo-textarea-suffix *ngIf="speechToTextButtonSettings">
204
+ <button kendoSpeechToTextButton
205
+ [continuous]="speechToTextButtonSettings?.continuous"
206
+ [disabled]="speechToTextButtonSettings?.disabled"
207
+ [fillMode]="speechToTextButtonSettings?.fillMode ?? 'flat'"
208
+ [integrationMode]="speechToTextButtonSettings?.integrationMode ?? 'webSpeech'"
209
+ [interimResults]="speechToTextButtonSettings?.interimResults"
210
+ [lang]="speechToTextButtonSettings?.lang"
211
+ [maxAlternatives]="speechToTextButtonSettings?.maxAlternatives"
212
+ [rounded]="speechToTextButtonSettings?.rounded"
213
+ [size]="speechToTextButtonSettings?.size"
214
+ [themeColor]="speechToTextButtonSettings?.themeColor"
215
+ (error)="onSpeechToTextError($event)"
216
+ (result)="onSpeechToTextResult($event)"
217
+ ></button>
218
+ </kendo-textarea-suffix>
127
219
  </kendo-textarea>
128
220
  <div *ngIf="promptSuggestions"
129
221
  class="k-prompt-expander">
@@ -141,17 +233,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
141
233
  class="k-prompt-expander-content"
142
234
  role="list"
143
235
  [attr.id]="contentId">
144
- <div *ngFor="let suggestion of promptSuggestions"
145
- class="k-prompt-suggestion"
146
- role="listitem"
147
- (click)="suggestionClick(suggestion)">
148
- {{suggestion}}
236
+ <div class="k-suggestion-group">
237
+ <div *ngFor="let suggestion of promptSuggestions"
238
+ class="k-suggestion"
239
+ role="listitem"
240
+ (click)="suggestionClick(suggestion)">
241
+ {{suggestion}}
242
+ </div>
149
243
  </div>
150
244
  </div>
151
245
  </div>
152
246
  </ng-template>
153
247
  `,
154
248
  standalone: true,
155
- imports: [TextAreaComponent, NgIf, ButtonComponent, NgFor]
249
+ imports: [TextAreaComponent, NgIf, ButtonComponent, NgFor, TextAreaSuffixComponent, SpeechToTextButtonComponent]
156
250
  }]
157
251
  }], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.AIPromptService }]; } });
@@ -17,12 +17,14 @@ import * as i5 from "./ai-prompt/views/custom-view.component";
17
17
  import * as i6 from "./ai-prompt/localization/custom-messages.component";
18
18
  import * as i7 from "./ai-prompt/templates/toolbar-actions.template";
19
19
  import * as i8 from "./ai-prompt/common/toolbar-focusable.directive";
20
- import * as i9 from "./chat/chat.component";
21
- import * as i10 from "./chat/l10n/custom-messages.component";
22
- import * as i11 from "./chat/attachment-template.directive";
23
- import * as i12 from "./chat/message-template.directive";
24
- import * as i13 from "./chat/cards/hero-card.component";
25
- import * as i14 from "./chat/message-box.directive";
20
+ import * as i9 from "./ai-prompt/templates/aiprompt-output-template.directive";
21
+ import * as i10 from "./ai-prompt/templates/aiprompt-output-body-template.directive";
22
+ import * as i11 from "./chat/chat.component";
23
+ import * as i12 from "./chat/l10n/custom-messages.component";
24
+ import * as i13 from "./chat/attachment-template.directive";
25
+ import * as i14 from "./chat/message-template.directive";
26
+ import * as i15 from "./chat/cards/hero-card.component";
27
+ import * as i16 from "./chat/message-box.directive";
26
28
  // IMPORTANT: NgModule export kept for backwards compatibility
27
29
  /**
28
30
  * Represents the [`NgModule`](link:site.data.urls.angular['ngmodules']) for the Conversational UI components.
@@ -44,8 +46,8 @@ import * as i14 from "./chat/message-box.directive";
44
46
  */
45
47
  export class ConversationalUIModule {
46
48
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConversationalUIModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
47
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: ConversationalUIModule, imports: [i1.AIPromptComponent, i2.PromptViewComponent, i3.OutputViewComponent, i4.CommandViewComponent, i5.CustomViewComponent, i6.AIPromptCustomMessagesComponent, i7.AIPromptToolbarActionsDirective, i8.AIPromptToolbarFocusableDirective, i9.ChatComponent, i10.CustomMessagesComponent, i11.AttachmentTemplateDirective, i12.MessageTemplateDirective, i13.HeroCardComponent, i14.ChatMessageBoxTemplateDirective], exports: [i1.AIPromptComponent, i2.PromptViewComponent, i3.OutputViewComponent, i4.CommandViewComponent, i5.CustomViewComponent, i6.AIPromptCustomMessagesComponent, i7.AIPromptToolbarActionsDirective, i8.AIPromptToolbarFocusableDirective, i9.ChatComponent, i10.CustomMessagesComponent, i11.AttachmentTemplateDirective, i12.MessageTemplateDirective, i13.HeroCardComponent, i14.ChatMessageBoxTemplateDirective] });
48
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConversationalUIModule, providers: [IconsService, PopupService, ResizeBatchService, DialogContainerService, DialogService, WindowService, WindowContainerService], imports: [i1.AIPromptComponent, i2.PromptViewComponent, i3.OutputViewComponent, i4.CommandViewComponent, i9.ChatComponent, i13.HeroCardComponent] });
49
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: ConversationalUIModule, imports: [i1.AIPromptComponent, i2.PromptViewComponent, i3.OutputViewComponent, i4.CommandViewComponent, i5.CustomViewComponent, i6.AIPromptCustomMessagesComponent, i7.AIPromptToolbarActionsDirective, i8.AIPromptToolbarFocusableDirective, i9.AIPromptOutputTemplateDirective, i10.AIPromptOutputBodyTemplateDirective, i11.ChatComponent, i12.CustomMessagesComponent, i13.AttachmentTemplateDirective, i14.MessageTemplateDirective, i15.HeroCardComponent, i16.ChatMessageBoxTemplateDirective], exports: [i1.AIPromptComponent, i2.PromptViewComponent, i3.OutputViewComponent, i4.CommandViewComponent, i5.CustomViewComponent, i6.AIPromptCustomMessagesComponent, i7.AIPromptToolbarActionsDirective, i8.AIPromptToolbarFocusableDirective, i9.AIPromptOutputTemplateDirective, i10.AIPromptOutputBodyTemplateDirective, i11.ChatComponent, i12.CustomMessagesComponent, i13.AttachmentTemplateDirective, i14.MessageTemplateDirective, i15.HeroCardComponent, i16.ChatMessageBoxTemplateDirective] });
50
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConversationalUIModule, providers: [IconsService, PopupService, ResizeBatchService, DialogContainerService, DialogService, WindowService, WindowContainerService], imports: [i1.AIPromptComponent, i2.PromptViewComponent, i3.OutputViewComponent, i4.CommandViewComponent, i11.ChatComponent, i15.HeroCardComponent] });
49
51
  }
50
52
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConversationalUIModule, decorators: [{
51
53
  type: NgModule,
@@ -15,6 +15,8 @@ import { AttachmentTemplateDirective } from "./chat/attachment-template.directiv
15
15
  import { MessageTemplateDirective } from "./chat/message-template.directive";
16
16
  import { HeroCardComponent } from "./chat/cards/hero-card.component";
17
17
  import { ChatMessageBoxTemplateDirective } from "./chat/message-box.directive";
18
+ import { AIPromptOutputBodyTemplateDirective } from "./ai-prompt/templates/aiprompt-output-body-template.directive";
19
+ import { AIPromptOutputTemplateDirective } from "./ai-prompt/templates/aiprompt-output-template.directive";
18
20
  /**
19
21
  * Utility array that contains all AIPrompt related components and directives.
20
22
  *
@@ -40,7 +42,9 @@ export const KENDO_AIPROMPT = [
40
42
  CustomViewComponent,
41
43
  AIPromptCustomMessagesComponent,
42
44
  AIPromptToolbarActionsDirective,
43
- AIPromptToolbarFocusableDirective
45
+ AIPromptToolbarFocusableDirective,
46
+ AIPromptOutputTemplateDirective,
47
+ AIPromptOutputBodyTemplateDirective,
44
48
  ];
45
49
  /**
46
50
  * Utility array that contains all Chat related components and directives.
package/esm2022/index.mjs CHANGED
@@ -14,6 +14,8 @@ export { AIPromptComponent } from './ai-prompt/aiprompt.component';
14
14
  export { AIPromptCustomMessagesComponent } from './ai-prompt/localization/custom-messages.component';
15
15
  export { AIPromptToolbarActionsDirective } from './ai-prompt/templates/toolbar-actions.template';
16
16
  export { AIPromptToolbarFocusableDirective } from './ai-prompt/common/toolbar-focusable.directive';
17
+ export { AIPromptOutputTemplateDirective } from './ai-prompt/templates/aiprompt-output-template.directive';
18
+ export { AIPromptOutputBodyTemplateDirective } from './ai-prompt/templates/aiprompt-output-body-template.directive';
17
19
  export * from './ai-prompt/views';
18
20
  export * from './ai-prompt/models';
19
21
  export * from './directives';
@@ -10,7 +10,7 @@ export const packageMetadata = {
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCode: 'KENDOUIANGULAR',
12
12
  productCodes: ['KENDOUIANGULAR'],
13
- publishDate: 1751964915,
14
- version: '19.3.0-develop.2',
13
+ publishDate: 1754395802,
14
+ version: '19.3.0-develop.21',
15
15
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
16
16
  };