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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/ai-prompt/aiprompt.component.d.ts +80 -13
  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/localization/messages.d.ts +5 -1
  6. package/ai-prompt/models/ai-prompt-settings.d.ts +60 -0
  7. package/ai-prompt/models/index.d.ts +1 -0
  8. package/ai-prompt/templates/aiprompt-output-body-template.directive.d.ts +24 -0
  9. package/ai-prompt/templates/aiprompt-output-template.directive.d.ts +24 -0
  10. package/ai-prompt/views/output-view.component.d.ts +4 -0
  11. package/ai-prompt/views/prompt-view.component.d.ts +23 -1
  12. package/chat/message-attachments.component.d.ts +1 -1
  13. package/conversational-ui.module.d.ts +12 -7
  14. package/directives.d.ts +25 -2
  15. package/esm2022/ai-prompt/aiprompt.component.mjs +177 -25
  16. package/esm2022/ai-prompt/aiprompt.module.mjs +3 -1
  17. package/esm2022/ai-prompt/common/aiprompt.service.mjs +35 -0
  18. package/esm2022/ai-prompt/common/output-card.component.mjs +23 -5
  19. package/esm2022/ai-prompt/common/toolbar-focusable.directive.mjs +4 -3
  20. package/esm2022/ai-prompt/localization/messages.mjs +7 -1
  21. package/esm2022/ai-prompt/models/ai-prompt-settings.mjs +5 -0
  22. package/esm2022/ai-prompt/templates/aiprompt-output-body-template.directive.mjs +33 -0
  23. package/esm2022/ai-prompt/templates/aiprompt-output-template.directive.mjs +33 -0
  24. package/esm2022/ai-prompt/views/output-view.component.mjs +27 -11
  25. package/esm2022/ai-prompt/views/prompt-view.component.mjs +139 -21
  26. package/esm2022/chat/message-attachments.component.mjs +3 -2
  27. package/esm2022/chat/message-box.component.mjs +3 -3
  28. package/esm2022/chat/message-list.component.mjs +4 -2
  29. package/esm2022/chat/suggested-actions.component.mjs +2 -2
  30. package/esm2022/conversational-ui.module.mjs +13 -8
  31. package/esm2022/directives.mjs +32 -2
  32. package/esm2022/index.mjs +8 -0
  33. package/esm2022/inline-ai-prompt/inlineaiprompt-content.component.mjs +522 -0
  34. package/esm2022/inline-ai-prompt/inlineaiprompt.component.mjs +349 -0
  35. package/esm2022/inline-ai-prompt/inlineaiprompt.module.mjs +46 -0
  36. package/esm2022/inline-ai-prompt/inlineaiprompt.service.mjs +85 -0
  37. package/esm2022/inline-ai-prompt/localization/custom-messages.component.mjs +53 -0
  38. package/esm2022/inline-ai-prompt/localization/localized-messages.directive.mjs +39 -0
  39. package/esm2022/inline-ai-prompt/localization/messages.mjs +35 -0
  40. package/esm2022/inline-ai-prompt/models/command.interface.mjs +5 -0
  41. package/esm2022/inline-ai-prompt/models/index.mjs +5 -0
  42. package/esm2022/inline-ai-prompt/models/inlineaiprompt-popupsettings.mjs +5 -0
  43. package/esm2022/inline-ai-prompt/models/inlineaiprompt-settings.mjs +59 -0
  44. package/esm2022/inline-ai-prompt/models/messages.mjs +8 -0
  45. package/esm2022/inline-ai-prompt/models/output-action-click-event.mjs +5 -0
  46. package/esm2022/inline-ai-prompt/models/output-action.interface.mjs +5 -0
  47. package/esm2022/inline-ai-prompt/models/prompt-output.interface.mjs +5 -0
  48. package/esm2022/inline-ai-prompt/models/prompt-request-event.mjs +5 -0
  49. package/esm2022/inline-ai-prompt/output-template.directive.mjs +38 -0
  50. package/esm2022/inline-ai-prompt/utils.mjs +57 -0
  51. package/esm2022/package-metadata.mjs +2 -2
  52. package/fesm2022/progress-kendo-angular-conversational-ui.mjs +1768 -147
  53. package/index.d.ts +8 -0
  54. package/inline-ai-prompt/inlineaiprompt-content.component.d.ts +82 -0
  55. package/inline-ai-prompt/inlineaiprompt.component.d.ts +157 -0
  56. package/inline-ai-prompt/inlineaiprompt.module.d.ts +31 -0
  57. package/inline-ai-prompt/inlineaiprompt.service.d.ts +41 -0
  58. package/inline-ai-prompt/localization/custom-messages.component.d.ts +27 -0
  59. package/inline-ai-prompt/localization/localized-messages.directive.d.ts +16 -0
  60. package/inline-ai-prompt/localization/messages.d.ts +25 -0
  61. package/inline-ai-prompt/models/command.interface.d.ts +38 -0
  62. package/inline-ai-prompt/models/index.d.ts +12 -0
  63. package/inline-ai-prompt/models/inlineaiprompt-popupsettings.d.ts +10 -0
  64. package/inline-ai-prompt/models/inlineaiprompt-settings.d.ts +66 -0
  65. package/inline-ai-prompt/models/messages.d.ts +21 -0
  66. package/inline-ai-prompt/models/output-action-click-event.d.ts +19 -0
  67. package/inline-ai-prompt/models/output-action.interface.d.ts +52 -0
  68. package/inline-ai-prompt/models/prompt-output.interface.d.ts +25 -0
  69. package/inline-ai-prompt/models/prompt-request-event.d.ts +17 -0
  70. package/inline-ai-prompt/output-template.directive.d.ts +27 -0
  71. package/inline-ai-prompt/utils.d.ts +17 -0
  72. package/package.json +13 -12
@@ -0,0 +1,33 @@
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 { Directive, TemplateRef } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Represents the template for the response in the AIPrompt component. The template context is set to the current output object.
9
+ *
10
+ * @example
11
+ * ```html
12
+ * <kendo-aiprompt>
13
+ * <ng-template kendoAIPromptOutputTemplate let-output>
14
+ * <div>{{output.prompt}}</div>
15
+ * </ng-template>
16
+ * </kendo-aiprompt>
17
+ * ```
18
+ */
19
+ export class AIPromptOutputTemplateDirective {
20
+ templateRef;
21
+ constructor(templateRef) {
22
+ this.templateRef = templateRef;
23
+ }
24
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptOutputTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
25
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: AIPromptOutputTemplateDirective, isStandalone: true, selector: "[kendoAIPromptOutputTemplate]", ngImport: i0 });
26
+ }
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptOutputTemplateDirective, decorators: [{
28
+ type: Directive,
29
+ args: [{
30
+ selector: '[kendoAIPromptOutputTemplate]',
31
+ standalone: true
32
+ }]
33
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
@@ -7,7 +7,7 @@ import { LocalizationService } from '@progress/kendo-angular-l10n';
7
7
  import { BaseView } from './base-view';
8
8
  import { AIPromptService } from '../common/aiprompt.service';
9
9
  import { AIPromptOutputCardComponent } from '../common/output-card.component';
10
- import { NgFor } from '@angular/common';
10
+ import { NgFor, NgIf, NgTemplateOutlet } from '@angular/common';
11
11
  import * as i0 from "@angular/core";
12
12
  import * as i1 from "@progress/kendo-angular-l10n";
13
13
  import * as i2 from "../common/aiprompt.service";
@@ -33,6 +33,12 @@ export class OutputViewComponent extends BaseView {
33
33
  get promptOutputs() {
34
34
  return this.service.promptOutputs;
35
35
  }
36
+ /**
37
+ * @hidden
38
+ */
39
+ get customTemplate() {
40
+ return this.service.outputTemplate?.templateRef;
41
+ }
36
42
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OutputViewComponent, deps: [{ token: i1.LocalizationService }, { token: i2.AIPromptService }], target: i0.ɵɵFactoryTarget.Component });
37
43
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: OutputViewComponent, isStandalone: true, selector: "kendo-aiprompt-output-view", providers: [{
38
44
  provide: BaseView,
@@ -42,13 +48,18 @@ export class OutputViewComponent extends BaseView {
42
48
  <div
43
49
  class="k-card-list"
44
50
  role="list">
45
- <div *ngFor="let output of promptOutputs"
46
- kendoAIPromptOutputCard
47
- [promptOutput]="output">
48
- </div>
51
+ <ng-container *ngFor="let output of promptOutputs">
52
+ <ng-container *ngIf="customTemplate; else defaultTemplate">
53
+ <ng-container *ngTemplateOutlet="customTemplate; context: { $implicit: output }">
54
+ </ng-container>
55
+ </ng-container>
56
+ <ng-template #defaultTemplate>
57
+ <div kendoAIPromptOutputCard [promptOutput]="output"></div>
58
+ </ng-template>
59
+ </ng-container>
49
60
  </div>
50
61
  </ng-template>
51
- `, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: AIPromptOutputCardComponent, selector: "[kendoAIPromptOutputCard]", inputs: ["promptOutput"] }] });
62
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: AIPromptOutputCardComponent, selector: "[kendoAIPromptOutputCard]", inputs: ["promptOutput"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
52
63
  }
53
64
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OutputViewComponent, decorators: [{
54
65
  type: Component,
@@ -63,14 +74,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
63
74
  <div
64
75
  class="k-card-list"
65
76
  role="list">
66
- <div *ngFor="let output of promptOutputs"
67
- kendoAIPromptOutputCard
68
- [promptOutput]="output">
69
- </div>
77
+ <ng-container *ngFor="let output of promptOutputs">
78
+ <ng-container *ngIf="customTemplate; else defaultTemplate">
79
+ <ng-container *ngTemplateOutlet="customTemplate; context: { $implicit: output }">
80
+ </ng-container>
81
+ </ng-container>
82
+ <ng-template #defaultTemplate>
83
+ <div kendoAIPromptOutputCard [promptOutput]="output"></div>
84
+ </ng-template>
85
+ </ng-container>
70
86
  </div>
71
87
  </ng-template>
72
88
  `,
73
89
  standalone: true,
74
- imports: [NgFor, AIPromptOutputCardComponent]
90
+ imports: [NgFor, AIPromptOutputCardComponent, NgIf, NgTemplateOutlet]
75
91
  }]
76
92
  }], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.AIPromptService }]; } });
@@ -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,42 @@ export class PromptViewComponent extends BaseView {
68
68
  suggestionClick(suggestion) {
69
69
  this.textAreaValue = this.service.promptValue = suggestion;
70
70
  }
71
+ /**
72
+ * @hidden
73
+ */
74
+ suggestionKeydown(event, suggestion) {
75
+ if (event.key === 'Enter' || event.key === ' ') {
76
+ this.suggestionClick(suggestion);
77
+ }
78
+ }
79
+ /**
80
+ * @hidden
81
+ */
82
+ get speechToTextButtonSettings() {
83
+ return this.service.speechToTextButton;
84
+ }
85
+ /**
86
+ * @hidden
87
+ */
88
+ get textareaSettings() {
89
+ return this.service.textAreaSettings;
90
+ }
91
+ /**
92
+ * @hidden
93
+ */
94
+ onSpeechToTextResult(event) {
95
+ if (event.alternatives && event.alternatives.length > 0) {
96
+ this.textAreaValue += event.alternatives[0].transcript + ' ';
97
+ }
98
+ }
99
+ /**
100
+ * @hidden
101
+ */
102
+ onSpeechToTextError(event) {
103
+ if (isDevMode()) {
104
+ console.error('Speech to Text error:', event.errorMessage);
105
+ }
106
+ }
71
107
  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
108
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PromptViewComponent, isStandalone: true, selector: "kendo-aiprompt-prompt-view", providers: [
73
109
  {
@@ -77,9 +113,44 @@ export class PromptViewComponent extends BaseView {
77
113
  ], usesInheritance: true, ngImport: i0, template: `
78
114
  <ng-template #content>
79
115
  <kendo-textarea
80
- [placeholder]="messageFor('promptPlaceholder')"
81
- [rows]="1"
82
- [(value)]="textAreaValue">
116
+ [cols]="textareaSettings?.cols"
117
+ [disabled]="textareaSettings?.disabled"
118
+ [fillMode]="textareaSettings?.fillMode"
119
+ [flow]="textareaSettings?.flow ?? 'vertical'"
120
+ [inputAttributes]="textareaSettings?.inputAttributes"
121
+ [maxlength]="textareaSettings?.maxlength"
122
+ [placeholder]="textareaSettings?.placeholder ?? messageFor('promptPlaceholder')"
123
+ [readonly]="textareaSettings?.readonly"
124
+ [resizable]="textareaSettings?.resizable ?? 'vertical'"
125
+ [rounded]="textareaSettings?.rounded"
126
+ [rows]="textareaSettings?.rows ?? 1"
127
+ [selectOnFocus]="textareaSettings?.selectOnFocus"
128
+ [showSuffixSeparator]="textareaSettings?.showSuffixSeparator ?? true"
129
+ [size]="textareaSettings?.size"
130
+ [tabIndex]="textareaSettings?.tabindex"
131
+ [title]="textareaSettings?.title"
132
+ [(value)]="textAreaValue"
133
+ >
134
+ <kendo-textarea-suffix *ngIf="speechToTextButtonSettings">
135
+ <button kendoSpeechToTextButton
136
+ role="button"
137
+ [continuous]="speechToTextButtonSettings?.continuous"
138
+ [disabled]="speechToTextButtonSettings?.disabled"
139
+ [fillMode]="speechToTextButtonSettings?.fillMode ?? 'flat'"
140
+ [integrationMode]="speechToTextButtonSettings?.integrationMode ?? 'webSpeech'"
141
+ [interimResults]="speechToTextButtonSettings?.interimResults"
142
+ [lang]="speechToTextButtonSettings?.lang"
143
+ [maxAlternatives]="speechToTextButtonSettings?.maxAlternatives"
144
+ [rounded]="speechToTextButtonSettings?.rounded"
145
+ [size]="speechToTextButtonSettings?.size"
146
+ [themeColor]="speechToTextButtonSettings?.themeColor"
147
+ [attr.aria-label]="messageFor('speechToTextButton')"
148
+ [attr.title]="messageFor('speechToTextButton')"
149
+ [attr.aria-disabled]="speechToTextButtonSettings?.disabled"
150
+ (error)="onSpeechToTextError($event)"
151
+ (result)="onSpeechToTextResult($event)"
152
+ ></button>
153
+ </kendo-textarea-suffix>
83
154
  </kendo-textarea>
84
155
  <div *ngIf="promptSuggestions"
85
156
  class="k-prompt-expander">
@@ -97,16 +168,22 @@ export class PromptViewComponent extends BaseView {
97
168
  class="k-prompt-expander-content"
98
169
  role="list"
99
170
  [attr.id]="contentId">
100
- <div *ngFor="let suggestion of promptSuggestions"
101
- class="k-prompt-suggestion"
102
- role="listitem"
103
- (click)="suggestionClick(suggestion)">
104
- {{suggestion}}
171
+ <div class="k-suggestion-group" role="group">
172
+ <div *ngFor="let suggestion of promptSuggestions"
173
+ class="k-suggestion"
174
+ role="button"
175
+ [attr.tabindex]="0"
176
+ [attr.aria-label]="suggestion"
177
+ [attr.title]="suggestion"
178
+ (click)="suggestionClick(suggestion)"
179
+ (keydown)="suggestionKeydown($event, suggestion)">
180
+ {{suggestion}}
181
+ </div>
105
182
  </div>
106
183
  </div>
107
184
  </div>
108
185
  </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"] }] });
186
+ `, isInline: true, dependencies: [{ 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: "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
187
  }
111
188
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PromptViewComponent, decorators: [{
112
189
  type: Component,
@@ -121,9 +198,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
121
198
  template: `
122
199
  <ng-template #content>
123
200
  <kendo-textarea
124
- [placeholder]="messageFor('promptPlaceholder')"
125
- [rows]="1"
126
- [(value)]="textAreaValue">
201
+ [cols]="textareaSettings?.cols"
202
+ [disabled]="textareaSettings?.disabled"
203
+ [fillMode]="textareaSettings?.fillMode"
204
+ [flow]="textareaSettings?.flow ?? 'vertical'"
205
+ [inputAttributes]="textareaSettings?.inputAttributes"
206
+ [maxlength]="textareaSettings?.maxlength"
207
+ [placeholder]="textareaSettings?.placeholder ?? messageFor('promptPlaceholder')"
208
+ [readonly]="textareaSettings?.readonly"
209
+ [resizable]="textareaSettings?.resizable ?? 'vertical'"
210
+ [rounded]="textareaSettings?.rounded"
211
+ [rows]="textareaSettings?.rows ?? 1"
212
+ [selectOnFocus]="textareaSettings?.selectOnFocus"
213
+ [showSuffixSeparator]="textareaSettings?.showSuffixSeparator ?? true"
214
+ [size]="textareaSettings?.size"
215
+ [tabIndex]="textareaSettings?.tabindex"
216
+ [title]="textareaSettings?.title"
217
+ [(value)]="textAreaValue"
218
+ >
219
+ <kendo-textarea-suffix *ngIf="speechToTextButtonSettings">
220
+ <button kendoSpeechToTextButton
221
+ role="button"
222
+ [continuous]="speechToTextButtonSettings?.continuous"
223
+ [disabled]="speechToTextButtonSettings?.disabled"
224
+ [fillMode]="speechToTextButtonSettings?.fillMode ?? 'flat'"
225
+ [integrationMode]="speechToTextButtonSettings?.integrationMode ?? 'webSpeech'"
226
+ [interimResults]="speechToTextButtonSettings?.interimResults"
227
+ [lang]="speechToTextButtonSettings?.lang"
228
+ [maxAlternatives]="speechToTextButtonSettings?.maxAlternatives"
229
+ [rounded]="speechToTextButtonSettings?.rounded"
230
+ [size]="speechToTextButtonSettings?.size"
231
+ [themeColor]="speechToTextButtonSettings?.themeColor"
232
+ [attr.aria-label]="messageFor('speechToTextButton')"
233
+ [attr.title]="messageFor('speechToTextButton')"
234
+ [attr.aria-disabled]="speechToTextButtonSettings?.disabled"
235
+ (error)="onSpeechToTextError($event)"
236
+ (result)="onSpeechToTextResult($event)"
237
+ ></button>
238
+ </kendo-textarea-suffix>
127
239
  </kendo-textarea>
128
240
  <div *ngIf="promptSuggestions"
129
241
  class="k-prompt-expander">
@@ -141,17 +253,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
141
253
  class="k-prompt-expander-content"
142
254
  role="list"
143
255
  [attr.id]="contentId">
144
- <div *ngFor="let suggestion of promptSuggestions"
145
- class="k-prompt-suggestion"
146
- role="listitem"
147
- (click)="suggestionClick(suggestion)">
148
- {{suggestion}}
256
+ <div class="k-suggestion-group" role="group">
257
+ <div *ngFor="let suggestion of promptSuggestions"
258
+ class="k-suggestion"
259
+ role="button"
260
+ [attr.tabindex]="0"
261
+ [attr.aria-label]="suggestion"
262
+ [attr.title]="suggestion"
263
+ (click)="suggestionClick(suggestion)"
264
+ (keydown)="suggestionKeydown($event, suggestion)">
265
+ {{suggestion}}
266
+ </div>
149
267
  </div>
150
268
  </div>
151
269
  </div>
152
270
  </ng-template>
153
271
  `,
154
272
  standalone: true,
155
- imports: [TextAreaComponent, NgIf, ButtonComponent, NgFor]
273
+ imports: [TextAreaComponent, NgIf, ButtonComponent, NgFor, TextAreaSuffixComponent, SpeechToTextButtonComponent]
156
274
  }]
157
275
  }], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.AIPromptService }]; } });
@@ -7,7 +7,7 @@ import { Component, ElementRef, forwardRef, HostBinding, Input, NgZone, QueryLis
7
7
  import { NgIf, NgFor } from '@angular/common';
8
8
  import { fromEvent } from 'rxjs';
9
9
  import { debounceTime } from 'rxjs/operators';
10
- import { Keys } from '@progress/kendo-angular-common';
10
+ import { Keys, normalizeNumpadKeys } from '@progress/kendo-angular-common';
11
11
  import { chevronLeftIcon, chevronRightIcon } from '@progress/kendo-svg-icons';
12
12
  import { LocalizationService } from '@progress/kendo-angular-l10n';
13
13
  import { ButtonComponent } from '@progress/kendo-angular-buttons';
@@ -82,7 +82,8 @@ export class MessageAttachmentsComponent extends ChatItem {
82
82
  itemKeydown(e, attachment) {
83
83
  const keyHandlers = this.layout === 'list' ?
84
84
  this.listKeyHandlers : this.carouselKeyHandlers;
85
- const handler = keyHandlers[e.keyCode];
85
+ const code = normalizeNumpadKeys(e);
86
+ const handler = keyHandlers[code];
86
87
  if (handler) {
87
88
  handler(e, attachment);
88
89
  }
@@ -51,7 +51,7 @@ export class MessageBoxComponent {
51
51
  * @hidden
52
52
  */
53
53
  inputKeydown(e) {
54
- if (e.keyCode === Keys.Enter) {
54
+ if (e.code === Keys.Enter || e.code === Keys.NumpadEnter) {
55
55
  this.sendClick();
56
56
  }
57
57
  }
@@ -59,7 +59,7 @@ export class MessageBoxComponent {
59
59
  * @hidden
60
60
  */
61
61
  textAreaKeydown(e) {
62
- const isEnter = e.keyCode === Keys.Enter;
62
+ const isEnter = e.code === Keys.Enter || e.code === Keys.NumpadEnter;
63
63
  if (!isEnter) {
64
64
  return;
65
65
  }
@@ -138,7 +138,7 @@ export class MessageBoxComponent {
138
138
  </ng-container>
139
139
 
140
140
  <ng-template *ngIf="messageBoxTemplate" [ngTemplateOutlet]="messageBoxTemplate?.templateRef"></ng-template>
141
- `, isInline: true, dependencies: [{ 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: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "type", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "successSvgIcon", "errorIcon", "errorSvgIcon", "clearButtonIcon", "clearButtonSvgIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength", "inputAttributes"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }, { 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: "component", type: InputSeparatorComponent, selector: "kendo-input-separator, kendo-textbox-separator", inputs: ["orientation"] }, { kind: "directive", type: TextBoxSuffixTemplateDirective, selector: "[kendoTextBoxSuffixTemplate]", inputs: ["showSeparator"] }, { kind: "component", type: TextAreaSuffixComponent, selector: "kendo-textarea-suffix", inputs: ["flow", "orientation"], exportAs: ["kendoTextAreaSuffix"] }] });
141
+ `, isInline: true, dependencies: [{ 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: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "type", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "successSvgIcon", "errorIcon", "errorSvgIcon", "clearButtonIcon", "clearButtonSvgIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength", "inputAttributes"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }, { 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: InputSeparatorComponent, selector: "kendo-input-separator, kendo-textbox-separator", inputs: ["orientation"] }, { kind: "directive", type: TextBoxSuffixTemplateDirective, selector: "[kendoTextBoxSuffixTemplate]", inputs: ["showSeparator"] }, { kind: "component", type: TextAreaSuffixComponent, selector: "kendo-textarea-suffix", inputs: ["flow", "orientation"], exportAs: ["kendoTextAreaSuffix"] }] });
142
142
  }
143
143
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MessageBoxComponent, decorators: [{
144
144
  type: Component,
@@ -7,7 +7,7 @@
7
7
  import { Component, ElementRef, EventEmitter, HostBinding, Input, Output, QueryList, Renderer2, ViewChildren } from '@angular/core';
8
8
  import { NgFor, NgSwitch, NgSwitchCase, NgIf } from '@angular/common';
9
9
  import { ExecuteActionEvent } from './api';
10
- import { Keys, ResizeSensorComponent } from '@progress/kendo-angular-common';
10
+ import { Keys, normalizeNumpadKeys, ResizeSensorComponent } from '@progress/kendo-angular-common';
11
11
  import { IntlService } from '@progress/kendo-angular-intl';
12
12
  import { LocalizationService } from '@progress/kendo-angular-l10n';
13
13
  import { closest } from './common/utils';
@@ -80,7 +80,9 @@ export class MessageListComponent {
80
80
  return this.intl.formatDate(date, { date: 'full' });
81
81
  }
82
82
  onKeydown(e) {
83
- const action = this.keyActions[e.keyCode];
83
+ // On some keyboards Numpad keys are used for Home/End/PageUp/PageDown.
84
+ const code = normalizeNumpadKeys(e);
85
+ const action = this.keyActions[code];
84
86
  if (action) {
85
87
  action(e);
86
88
  }
@@ -6,7 +6,7 @@
6
6
  /* eslint-disable @typescript-eslint/no-empty-function */
7
7
  import { Component, EventEmitter, forwardRef, HostBinding, Input, Output, QueryList, ViewChildren } from '@angular/core';
8
8
  import { NgFor } from '@angular/common';
9
- import { Keys } from '@progress/kendo-angular-common';
9
+ import { Keys, normalizeNumpadKeys } from '@progress/kendo-angular-common';
10
10
  import { ChatItem } from './chat-item';
11
11
  import * as i0 from "@angular/core";
12
12
  /**
@@ -31,7 +31,7 @@ export class SuggestedActionsComponent extends ChatItem {
31
31
  this.dispatch.next(action);
32
32
  }
33
33
  actionKeydown(e, action) {
34
- const handler = this.keyHandlers[e.keyCode];
34
+ const handler = this.keyHandlers[normalizeNumpadKeys(e)];
35
35
  if (handler) {
36
36
  handler(e, action);
37
37
  }
@@ -17,12 +17,17 @@ 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";
28
+ import * as i17 from "./inline-ai-prompt/inlineaiprompt.component";
29
+ import * as i18 from "./inline-ai-prompt/output-template.directive";
30
+ import * as i19 from "./inline-ai-prompt/localization/custom-messages.component";
26
31
  // IMPORTANT: NgModule export kept for backwards compatibility
27
32
  /**
28
33
  * Represents the [`NgModule`](link:site.data.urls.angular['ngmodules']) for the Conversational UI components.
@@ -44,8 +49,8 @@ import * as i14 from "./chat/message-box.directive";
44
49
  */
45
50
  export class ConversationalUIModule {
46
51
  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] });
52
+ 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, i17.InlineAIPromptComponent, i18.InlineAIPromptOutputTemplateDirective, i19.InlineAIPromptCustomMessagesComponent], 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, i17.InlineAIPromptComponent, i18.InlineAIPromptOutputTemplateDirective, i19.InlineAIPromptCustomMessagesComponent] });
53
+ 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, i17.InlineAIPromptComponent] });
49
54
  }
50
55
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConversationalUIModule, decorators: [{
51
56
  type: NgModule,
@@ -15,6 +15,11 @@ 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";
20
+ import { InlineAIPromptComponent } from "./inline-ai-prompt/inlineaiprompt.component";
21
+ import { InlineAIPromptOutputTemplateDirective } from "./inline-ai-prompt/output-template.directive";
22
+ import { InlineAIPromptCustomMessagesComponent } from "./inline-ai-prompt/localization/custom-messages.component";
18
23
  /**
19
24
  * Utility array that contains all AIPrompt related components and directives.
20
25
  *
@@ -40,7 +45,9 @@ export const KENDO_AIPROMPT = [
40
45
  CustomViewComponent,
41
46
  AIPromptCustomMessagesComponent,
42
47
  AIPromptToolbarActionsDirective,
43
- AIPromptToolbarFocusableDirective
48
+ AIPromptToolbarFocusableDirective,
49
+ AIPromptOutputTemplateDirective,
50
+ AIPromptOutputBodyTemplateDirective,
44
51
  ];
45
52
  /**
46
53
  * Utility array that contains all Chat related components and directives.
@@ -67,6 +74,28 @@ export const KENDO_CHAT = [
67
74
  HeroCardComponent,
68
75
  ChatMessageBoxTemplateDirective
69
76
  ];
77
+ /**
78
+ * Utility array that contains all InlineAIPrompt related components and directives.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * import { Component } from '@angular/core';
83
+ * import { KENDO_INLINEAIPROMPT } from '@progress/kendo-angular-conversational-ui';
84
+ *
85
+ * @Component({
86
+ * standalone: true,
87
+ * imports: [KENDO_INLINEAIPROMPT],
88
+ * selector: 'my-app',
89
+ * template: `<kendo-inlineaiprompt></kendo-inlineaiprompt>`
90
+ * })
91
+ * export class AppComponent {}
92
+ * ```
93
+ */
94
+ export const KENDO_INLINEAIPROMPT = [
95
+ InlineAIPromptComponent,
96
+ InlineAIPromptOutputTemplateDirective,
97
+ InlineAIPromptCustomMessagesComponent
98
+ ];
70
99
  /**
71
100
  * Utility array that contains all `@progress/kendo-angular-conversational-ui` related components and directives.
72
101
  *
@@ -89,5 +118,6 @@ export const KENDO_CHAT = [
89
118
  */
90
119
  export const KENDO_CONVERSATIONALUI = [
91
120
  ...KENDO_AIPROMPT,
92
- ...KENDO_CHAT
121
+ ...KENDO_CHAT,
122
+ ...KENDO_INLINEAIPROMPT
93
123
  ];
package/esm2022/index.mjs CHANGED
@@ -7,6 +7,7 @@ export { ExecuteActionEvent, SendMessageEvent } from './chat/api';
7
7
  export { AIPromptModule } from './ai-prompt/aiprompt.module';
8
8
  export { ChatModule } from './chat/chat.module';
9
9
  export { ConversationalUIModule } from './conversational-ui.module';
10
+ export { InlineAIPromptModule } from './inline-ai-prompt/inlineaiprompt.module';
10
11
  export { HeroCardComponent } from './chat/cards/hero-card.component';
11
12
  export { CustomMessagesComponent } from './chat/l10n/custom-messages.component';
12
13
  export { ChatMessageBoxTemplateDirective } from './chat/message-box.directive';
@@ -14,6 +15,13 @@ export { AIPromptComponent } from './ai-prompt/aiprompt.component';
14
15
  export { AIPromptCustomMessagesComponent } from './ai-prompt/localization/custom-messages.component';
15
16
  export { AIPromptToolbarActionsDirective } from './ai-prompt/templates/toolbar-actions.template';
16
17
  export { AIPromptToolbarFocusableDirective } from './ai-prompt/common/toolbar-focusable.directive';
18
+ export { AIPromptOutputTemplateDirective } from './ai-prompt/templates/aiprompt-output-template.directive';
19
+ export { AIPromptOutputBodyTemplateDirective } from './ai-prompt/templates/aiprompt-output-body-template.directive';
17
20
  export * from './ai-prompt/views';
18
21
  export * from './ai-prompt/models';
22
+ export { InlineAIPromptComponent } from './inline-ai-prompt/inlineaiprompt.component';
23
+ export { InlineAIPromptOutputTemplateDirective } from './inline-ai-prompt/output-template.directive';
24
+ export { InlineAIPromptService } from './inline-ai-prompt/inlineaiprompt.service';
25
+ export { InlineAIPromptCustomMessagesComponent } from './inline-ai-prompt/localization/custom-messages.component';
26
+ export * from './inline-ai-prompt/models';
19
27
  export * from './directives';