@progress/kendo-angular-conversational-ui 19.3.0-develop.15 → 19.3.0-develop.17
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/aiprompt.component.d.ts +70 -12
- package/ai-prompt/aiprompt.module.d.ts +3 -1
- package/ai-prompt/common/aiprompt.service.d.ts +10 -0
- package/ai-prompt/common/output-card.component.d.ts +4 -0
- package/ai-prompt/templates/aiprompt-output-body-template.directive.d.ts +24 -0
- package/ai-prompt/templates/aiprompt-output-template.directive.d.ts +24 -0
- package/ai-prompt/views/output-view.component.d.ts +4 -0
- package/ai-prompt/views/prompt-view.component.d.ts +19 -1
- package/conversational-ui.module.d.ts +9 -7
- package/directives.d.ts +4 -2
- package/esm2022/ai-prompt/aiprompt.component.mjs +135 -19
- package/esm2022/ai-prompt/aiprompt.module.mjs +3 -1
- package/esm2022/ai-prompt/common/aiprompt.service.mjs +35 -0
- package/esm2022/ai-prompt/common/output-card.component.mjs +23 -5
- package/esm2022/ai-prompt/templates/aiprompt-output-body-template.directive.mjs +33 -0
- package/esm2022/ai-prompt/templates/aiprompt-output-template.directive.mjs +33 -0
- package/esm2022/ai-prompt/views/output-view.component.mjs +27 -11
- package/esm2022/ai-prompt/views/prompt-view.component.mjs +115 -21
- package/esm2022/conversational-ui.module.mjs +10 -8
- package/esm2022/directives.mjs +5 -1
- package/esm2022/index.mjs +2 -0
- package/esm2022/package-metadata.mjs +2 -2
- package/fesm2022/progress-kendo-angular-conversational-ui.mjs +392 -57
- package/index.d.ts +2 -0
- package/package.json +11 -11
@@ -5,10 +5,10 @@
|
|
5
5
|
import { Component, ContentChild, ContentChildren, EventEmitter, HostBinding, Input, NgZone, Output, QueryList } from "@angular/core";
|
6
6
|
import { NgFor, NgIf, NgTemplateOutlet } from "@angular/common";
|
7
7
|
import { Subscription } from "rxjs";
|
8
|
-
import { sparklesIcon, commentIcon } from "@progress/kendo-svg-icons";
|
8
|
+
import { sparklesIcon, commentIcon, stopSmIcon } from "@progress/kendo-svg-icons";
|
9
9
|
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
10
10
|
import { validatePackage } from "@progress/kendo-licensing";
|
11
|
-
import { ButtonComponent } from "@progress/kendo-angular-buttons";
|
11
|
+
import { ButtonComponent, FloatingActionButtonComponent } from "@progress/kendo-angular-buttons";
|
12
12
|
import { BaseView } from "./views/base-view";
|
13
13
|
import { packageMetadata } from "../package-metadata";
|
14
14
|
import { AIPromptService } from "./common/aiprompt.service";
|
@@ -16,6 +16,8 @@ import { AIPromptToolbarActionsDirective } from "./templates/toolbar-actions.tem
|
|
16
16
|
import { ToolbarNavigationService } from "./common/toolbar-navigation.service";
|
17
17
|
import { AIPromptToolbarFocusableDirective } from "./common/toolbar-focusable.directive";
|
18
18
|
import { LocalizedMessagesDirective } from "./localization/localized-messages.directive";
|
19
|
+
import { AIPromptOutputTemplateDirective } from "./templates/aiprompt-output-template.directive";
|
20
|
+
import { AIPromptOutputBodyTemplateDirective } from "./templates/aiprompt-output-body-template.directive";
|
19
21
|
import * as i0 from "@angular/core";
|
20
22
|
import * as i1 from "@progress/kendo-angular-l10n";
|
21
23
|
import * as i2 from "./common/aiprompt.service";
|
@@ -65,6 +67,14 @@ export class AIPromptComponent {
|
|
65
67
|
* @hidden
|
66
68
|
*/
|
67
69
|
toolbarActionsTemplate;
|
70
|
+
/**
|
71
|
+
* @hidden
|
72
|
+
*/
|
73
|
+
outputTemplate;
|
74
|
+
/**
|
75
|
+
* @hidden
|
76
|
+
*/
|
77
|
+
outputBodyTemplate;
|
68
78
|
/**
|
69
79
|
* The active view index of the AIPrompt component.
|
70
80
|
*/
|
@@ -78,54 +88,104 @@ export class AIPromptComponent {
|
|
78
88
|
return this._activeView;
|
79
89
|
}
|
80
90
|
/**
|
81
|
-
* Sets the collection of commands to render in the
|
91
|
+
* Sets the collection of commands to render in the Command view.
|
82
92
|
*/
|
83
93
|
set promptCommands(value) {
|
84
94
|
this.service.promptCommands = value;
|
85
95
|
}
|
86
96
|
/**
|
87
|
-
* Sets the collection of suggestions to render in the
|
97
|
+
* Sets the collection of suggestions to render in the Prompt view.
|
88
98
|
*/
|
89
99
|
set promptSuggestions(value) {
|
90
100
|
this.service.promptSuggestions = value;
|
91
101
|
}
|
92
102
|
/**
|
93
|
-
* Sets the collection of generated prompt outputs to render in the
|
103
|
+
* Sets the collection of generated prompt outputs to render in the Output view.
|
94
104
|
*/
|
95
105
|
set promptOutputs(value) {
|
96
106
|
this.service.promptOutputs = value;
|
97
107
|
}
|
98
108
|
/**
|
99
|
-
* Specifies
|
100
|
-
*
|
109
|
+
* Specifies whether the rating buttons appear in each Output view card.
|
110
|
+
* The rating buttons do not appear by default.
|
101
111
|
* @default false
|
102
112
|
*/
|
103
113
|
set showOutputRating(value) {
|
104
114
|
this.service.showOutputRating = value;
|
105
115
|
}
|
116
|
+
/**
|
117
|
+
* Specifies whether the Stop generation button appears in the Output view.
|
118
|
+
* The Stop generation button does not appear by default.
|
119
|
+
* @default false
|
120
|
+
*/
|
121
|
+
streaming = false;
|
122
|
+
/**
|
123
|
+
* Sets the settings for the Speech to Text button in the Prompt view.
|
124
|
+
*/
|
125
|
+
set speechToTextButton(settings) {
|
126
|
+
if (settings) {
|
127
|
+
this.service.speechToTextButton = settings;
|
128
|
+
}
|
129
|
+
else {
|
130
|
+
this.service.speechToTextButton = false;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
/**
|
134
|
+
* Sets the settings for the TextArea in the Prompt view.
|
135
|
+
* Use this property to customize the TextArea appearance.
|
136
|
+
*/
|
137
|
+
set textAreaSettings(settings) {
|
138
|
+
this.service.textAreaSettings = settings;
|
139
|
+
}
|
140
|
+
/**
|
141
|
+
* Sets the SVG icon for the Generate button in the Prompt view.
|
142
|
+
*/
|
143
|
+
generateButtonSVGIcon = sparklesIcon;
|
144
|
+
/**
|
145
|
+
* Sets the icon for the Generate button in the Prompt view.
|
146
|
+
* @default 'sparkles'
|
147
|
+
*/
|
148
|
+
generateButtonIcon = 'sparkles';
|
149
|
+
/**
|
150
|
+
* Sets the disabled state for the Generate button in the Prompt view.
|
151
|
+
* @default false
|
152
|
+
*/
|
153
|
+
disabledGenerateButton = false;
|
106
154
|
/**
|
107
155
|
* Fires when the `activeView` property is updated.
|
108
156
|
* Use this event for two-way binding of the `activeView` property.
|
109
157
|
*/
|
110
158
|
activeViewChange = new EventEmitter();
|
111
159
|
/**
|
112
|
-
* Fires when
|
160
|
+
* Fires when you click the Generate button in the Prompt view or the Retry button in the Output view.
|
113
161
|
* Use the event's `isRetry` field to determine the source element.
|
114
162
|
*/
|
115
163
|
promptRequest = new EventEmitter();
|
116
164
|
/**
|
117
|
-
* Fires when
|
165
|
+
* Fires when you click a Command view command.
|
118
166
|
* The event data contains the selected command.
|
119
167
|
*/
|
120
168
|
commandExecute = new EventEmitter();
|
121
169
|
/**
|
122
|
-
* Fires when
|
170
|
+
* Fires when you click a Copy button in any Output view card.
|
123
171
|
*/
|
124
172
|
outputCopy = new EventEmitter();
|
125
173
|
/**
|
126
|
-
* Fires when
|
174
|
+
* Fires when you click a rating button in any Output view card.
|
127
175
|
*/
|
128
176
|
outputRatingChange = new EventEmitter();
|
177
|
+
/**
|
178
|
+
* Fires when you click the Stop Generation button in the Output view.
|
179
|
+
*/
|
180
|
+
promptRequestCancel = new EventEmitter();
|
181
|
+
ngAfterContentChecked() {
|
182
|
+
if (this.outputTemplate !== this.service.outputTemplate) {
|
183
|
+
this.service.outputTemplate = this.outputTemplate;
|
184
|
+
}
|
185
|
+
if (this.outputBodyTemplate !== this.service.outputBodyTemplate) {
|
186
|
+
this.service.outputBodyTemplate = this.outputBodyTemplate;
|
187
|
+
}
|
188
|
+
}
|
129
189
|
ngAfterViewInit() {
|
130
190
|
this.ngZone.runOutsideAngular(() => {
|
131
191
|
this.service.aiPrompt = this;
|
@@ -159,12 +219,24 @@ export class AIPromptComponent {
|
|
159
219
|
* @hidden
|
160
220
|
*/
|
161
221
|
outputIcon = commentIcon;
|
222
|
+
/**
|
223
|
+
* @hidden
|
224
|
+
*/
|
225
|
+
fabStopGenerationSVGIcon = stopSmIcon;
|
162
226
|
/**
|
163
227
|
* @hidden
|
164
228
|
*/
|
165
229
|
get viewsArray() {
|
166
230
|
return this.views?.toArray();
|
167
231
|
}
|
232
|
+
/**
|
233
|
+
* @hidden
|
234
|
+
*/
|
235
|
+
fabPositionMode = 'absolute';
|
236
|
+
/**
|
237
|
+
* @hidden
|
238
|
+
*/
|
239
|
+
fabAlignment = { vertical: 'bottom', horizontal: 'end' };
|
168
240
|
direction;
|
169
241
|
_activeView = 0;
|
170
242
|
/**
|
@@ -201,7 +273,7 @@ export class AIPromptComponent {
|
|
201
273
|
this.promptRequest.emit(eventArgs);
|
202
274
|
}
|
203
275
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptComponent, deps: [{ token: i1.LocalizationService }, { token: i2.AIPromptService }, { token: i3.ToolbarNavigationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
204
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AIPromptComponent, isStandalone: true, selector: "kendo-aiprompt", inputs: { activeView: "activeView", promptCommands: "promptCommands", promptSuggestions: "promptSuggestions", promptOutputs: "promptOutputs", showOutputRating: "showOutputRating" }, outputs: { activeViewChange: "activeViewChange", promptRequest: "promptRequest", commandExecute: "commandExecute", outputCopy: "outputCopy", outputRatingChange: "outputRatingChange" }, host: { properties: { "class.k-prompt": "this.hostClasses", "attr.dir": "this.dirAttr" } }, providers: [
|
276
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AIPromptComponent, isStandalone: true, selector: "kendo-aiprompt", inputs: { activeView: "activeView", promptCommands: "promptCommands", promptSuggestions: "promptSuggestions", promptOutputs: "promptOutputs", showOutputRating: "showOutputRating", streaming: "streaming", speechToTextButton: "speechToTextButton", textAreaSettings: "textAreaSettings", generateButtonSVGIcon: "generateButtonSVGIcon", generateButtonIcon: "generateButtonIcon", disabledGenerateButton: "disabledGenerateButton" }, outputs: { activeViewChange: "activeViewChange", promptRequest: "promptRequest", commandExecute: "commandExecute", outputCopy: "outputCopy", outputRatingChange: "outputRatingChange", promptRequestCancel: "promptRequestCancel" }, host: { properties: { "class.k-prompt": "this.hostClasses", "attr.dir": "this.dirAttr" } }, providers: [
|
205
277
|
LocalizationService,
|
206
278
|
AIPromptService,
|
207
279
|
ToolbarNavigationService,
|
@@ -209,7 +281,7 @@ export class AIPromptComponent {
|
|
209
281
|
provide: L10N_PREFIX,
|
210
282
|
useValue: 'kendo.aiprompt'
|
211
283
|
}
|
212
|
-
], queries: [{ propertyName: "toolbarActionsTemplate", first: true, predicate: AIPromptToolbarActionsDirective, descendants: true }, { propertyName: "views", predicate: BaseView }], exportAs: ["kendoAIPrompt"], ngImport: i0, template: `
|
284
|
+
], queries: [{ propertyName: "toolbarActionsTemplate", first: true, predicate: AIPromptToolbarActionsDirective, descendants: true }, { propertyName: "outputTemplate", first: true, predicate: AIPromptOutputTemplateDirective, descendants: true }, { propertyName: "outputBodyTemplate", first: true, predicate: AIPromptOutputBodyTemplateDirective, descendants: true }, { propertyName: "views", predicate: BaseView }], exportAs: ["kendoAIPrompt"], ngImport: i0, template: `
|
213
285
|
<ng-container kendoAIPromptLocalizedMessages
|
214
286
|
i18n-promptView="kendo.aiprompt.promptView|The Toolbar button text for the Prompt view."
|
215
287
|
promptView="Ask AI"
|
@@ -253,6 +325,16 @@ export class AIPromptComponent {
|
|
253
325
|
</div>
|
254
326
|
</div>
|
255
327
|
<div class="k-prompt-content">
|
328
|
+
<kendo-floatingactionbutton *ngIf="streaming && selectedView?.viewType === 'output'"
|
329
|
+
class="k-prompt-stop-fab"
|
330
|
+
buttonClass="k-generating k-active"
|
331
|
+
[positionMode]="fabPositionMode"
|
332
|
+
[align]="fabAlignment"
|
333
|
+
[svgIcon]="fabStopGenerationSVGIcon"
|
334
|
+
icon="stop"
|
335
|
+
(click)="promptRequestCancel.emit()"
|
336
|
+
>
|
337
|
+
</kendo-floatingactionbutton>
|
256
338
|
<div class="k-prompt-view">
|
257
339
|
<ng-container *ngTemplateOutlet="viewTemplate">
|
258
340
|
</ng-container>
|
@@ -265,12 +347,14 @@ export class AIPromptComponent {
|
|
265
347
|
type="button"
|
266
348
|
themeColor="primary"
|
267
349
|
rounded="full"
|
268
|
-
[
|
269
|
-
|
350
|
+
[attr.title]="messageFor('generateOutput')"
|
351
|
+
[svgIcon]="generateButtonSVGIcon"
|
352
|
+
[icon]="generateButtonIcon"
|
353
|
+
[disabled]="disabledGenerateButton"
|
270
354
|
(click)="handleGenerateOutput()">{{messageFor('generateOutput')}}</button>
|
271
355
|
</div>
|
272
356
|
</div>
|
273
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoAIPromptLocalizedMessages]" }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: AIPromptToolbarFocusableDirective, selector: "[kendoAIPromptToolbarFocusable]" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
357
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoAIPromptLocalizedMessages]" }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: AIPromptToolbarFocusableDirective, selector: "[kendoAIPromptToolbarFocusable]" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FloatingActionButtonComponent, selector: "kendo-floatingactionbutton", inputs: ["themeColor", "size", "rounded", "disabled", "align", "offset", "positionMode", "icon", "svgIcon", "iconClass", "buttonClass", "dialClass", "text", "dialItemAnimation", "tabIndex", "dialItems"], outputs: ["blur", "focus", "dialItemClick", "open", "close"] }] });
|
274
358
|
}
|
275
359
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptComponent, decorators: [{
|
276
360
|
type: Component,
|
@@ -330,6 +414,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
330
414
|
</div>
|
331
415
|
</div>
|
332
416
|
<div class="k-prompt-content">
|
417
|
+
<kendo-floatingactionbutton *ngIf="streaming && selectedView?.viewType === 'output'"
|
418
|
+
class="k-prompt-stop-fab"
|
419
|
+
buttonClass="k-generating k-active"
|
420
|
+
[positionMode]="fabPositionMode"
|
421
|
+
[align]="fabAlignment"
|
422
|
+
[svgIcon]="fabStopGenerationSVGIcon"
|
423
|
+
icon="stop"
|
424
|
+
(click)="promptRequestCancel.emit()"
|
425
|
+
>
|
426
|
+
</kendo-floatingactionbutton>
|
333
427
|
<div class="k-prompt-view">
|
334
428
|
<ng-container *ngTemplateOutlet="viewTemplate">
|
335
429
|
</ng-container>
|
@@ -342,14 +436,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
342
436
|
type="button"
|
343
437
|
themeColor="primary"
|
344
438
|
rounded="full"
|
345
|
-
[
|
346
|
-
|
439
|
+
[attr.title]="messageFor('generateOutput')"
|
440
|
+
[svgIcon]="generateButtonSVGIcon"
|
441
|
+
[icon]="generateButtonIcon"
|
442
|
+
[disabled]="disabledGenerateButton"
|
347
443
|
(click)="handleGenerateOutput()">{{messageFor('generateOutput')}}</button>
|
348
444
|
</div>
|
349
445
|
</div>
|
350
446
|
`,
|
351
447
|
standalone: true,
|
352
|
-
imports: [LocalizedMessagesDirective, NgFor, ButtonComponent, AIPromptToolbarFocusableDirective, NgIf, NgTemplateOutlet]
|
448
|
+
imports: [LocalizedMessagesDirective, NgFor, ButtonComponent, AIPromptToolbarFocusableDirective, NgIf, NgTemplateOutlet, FloatingActionButtonComponent]
|
353
449
|
}]
|
354
450
|
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.AIPromptService }, { type: i3.ToolbarNavigationService }, { type: i0.NgZone }]; }, propDecorators: { hostClasses: [{
|
355
451
|
type: HostBinding,
|
@@ -363,6 +459,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
363
459
|
}], toolbarActionsTemplate: [{
|
364
460
|
type: ContentChild,
|
365
461
|
args: [AIPromptToolbarActionsDirective]
|
462
|
+
}], outputTemplate: [{
|
463
|
+
type: ContentChild,
|
464
|
+
args: [AIPromptOutputTemplateDirective]
|
465
|
+
}], outputBodyTemplate: [{
|
466
|
+
type: ContentChild,
|
467
|
+
args: [AIPromptOutputBodyTemplateDirective]
|
366
468
|
}], activeView: [{
|
367
469
|
type: Input
|
368
470
|
}], promptCommands: [{
|
@@ -373,6 +475,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
373
475
|
type: Input
|
374
476
|
}], showOutputRating: [{
|
375
477
|
type: Input
|
478
|
+
}], streaming: [{
|
479
|
+
type: Input
|
480
|
+
}], speechToTextButton: [{
|
481
|
+
type: Input
|
482
|
+
}], textAreaSettings: [{
|
483
|
+
type: Input
|
484
|
+
}], generateButtonSVGIcon: [{
|
485
|
+
type: Input
|
486
|
+
}], generateButtonIcon: [{
|
487
|
+
type: Input
|
488
|
+
}], disabledGenerateButton: [{
|
489
|
+
type: Input
|
376
490
|
}], activeViewChange: [{
|
377
491
|
type: Output
|
378
492
|
}], promptRequest: [{
|
@@ -383,4 +497,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
383
497
|
type: Output
|
384
498
|
}], outputRatingChange: [{
|
385
499
|
type: Output
|
500
|
+
}], promptRequestCancel: [{
|
501
|
+
type: Output
|
386
502
|
}] } });
|
@@ -17,6 +17,8 @@ import * as i5 from "./views/custom-view.component";
|
|
17
17
|
import * as i6 from "./localization/custom-messages.component";
|
18
18
|
import * as i7 from "./templates/toolbar-actions.template";
|
19
19
|
import * as i8 from "./common/toolbar-focusable.directive";
|
20
|
+
import * as i9 from "./templates/aiprompt-output-template.directive";
|
21
|
+
import * as i10 from "./templates/aiprompt-output-body-template.directive";
|
20
22
|
// IMPORTANT: NgModule export kept for backwards compatibility
|
21
23
|
/**
|
22
24
|
* Represents the [`NgModule`](link:site.data.urls.angular['ngmodules']) for the AIPrompt component.
|
@@ -38,7 +40,7 @@ import * as i8 from "./common/toolbar-focusable.directive";
|
|
38
40
|
*/
|
39
41
|
export class AIPromptModule {
|
40
42
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
41
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: AIPromptModule, imports: [i1.AIPromptComponent, i2.PromptViewComponent, i3.OutputViewComponent, i4.CommandViewComponent, i5.CustomViewComponent, i6.AIPromptCustomMessagesComponent, i7.AIPromptToolbarActionsDirective, i8.AIPromptToolbarFocusableDirective], exports: [i1.AIPromptComponent, i2.PromptViewComponent, i3.OutputViewComponent, i4.CommandViewComponent, i5.CustomViewComponent, i6.AIPromptCustomMessagesComponent, i7.AIPromptToolbarActionsDirective, i8.AIPromptToolbarFocusableDirective] });
|
43
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: AIPromptModule, imports: [i1.AIPromptComponent, i2.PromptViewComponent, i3.OutputViewComponent, i4.CommandViewComponent, i5.CustomViewComponent, i6.AIPromptCustomMessagesComponent, i7.AIPromptToolbarActionsDirective, i8.AIPromptToolbarFocusableDirective, i9.AIPromptOutputTemplateDirective, i10.AIPromptOutputBodyTemplateDirective], exports: [i1.AIPromptComponent, i2.PromptViewComponent, i3.OutputViewComponent, i4.CommandViewComponent, i5.CustomViewComponent, i6.AIPromptCustomMessagesComponent, i7.AIPromptToolbarActionsDirective, i8.AIPromptToolbarFocusableDirective, i9.AIPromptOutputTemplateDirective, i10.AIPromptOutputBodyTemplateDirective] });
|
42
44
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptModule, providers: [IconsService, PopupService, ResizeBatchService, DialogContainerService, DialogService, WindowService, WindowContainerService], imports: [i1.AIPromptComponent, i2.PromptViewComponent, i3.OutputViewComponent, i4.CommandViewComponent] });
|
43
45
|
}
|
44
46
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptModule, decorators: [{
|
@@ -5,6 +5,23 @@
|
|
5
5
|
import { Injectable } from '@angular/core';
|
6
6
|
import { Subject } from 'rxjs';
|
7
7
|
import * as i0 from "@angular/core";
|
8
|
+
/**
|
9
|
+
* @hidden
|
10
|
+
* Default settings for the Speech to Text button.
|
11
|
+
* These settings can be overridden by the user.
|
12
|
+
*/
|
13
|
+
const STB_DEFAULT_SETTINGS = {
|
14
|
+
continuous: false,
|
15
|
+
disabled: false,
|
16
|
+
fillMode: 'flat',
|
17
|
+
integrationMode: 'webSpeech',
|
18
|
+
interimResults: false,
|
19
|
+
lang: 'en-US',
|
20
|
+
maxAlternatives: 1,
|
21
|
+
rounded: 'medium',
|
22
|
+
size: 'medium',
|
23
|
+
themeColor: 'base'
|
24
|
+
};
|
8
25
|
/**
|
9
26
|
* @hidden
|
10
27
|
*/
|
@@ -19,6 +36,24 @@ export class AIPromptService {
|
|
19
36
|
promptCommands;
|
20
37
|
promptOutputs;
|
21
38
|
promptSuggestions;
|
39
|
+
textAreaSettings;
|
40
|
+
outputTemplate;
|
41
|
+
outputBodyTemplate;
|
42
|
+
_speechToTextButton;
|
43
|
+
get speechToTextButton() {
|
44
|
+
return this._speechToTextButton;
|
45
|
+
}
|
46
|
+
set speechToTextButton(settings) {
|
47
|
+
if (settings === true) {
|
48
|
+
this._speechToTextButton = STB_DEFAULT_SETTINGS;
|
49
|
+
}
|
50
|
+
else if (settings === false) {
|
51
|
+
this._speechToTextButton = null;
|
52
|
+
}
|
53
|
+
else {
|
54
|
+
this._speechToTextButton = { ...settings };
|
55
|
+
}
|
56
|
+
}
|
22
57
|
getFlattenPromptCommands(commands = this.promptCommands) {
|
23
58
|
let newArr = [];
|
24
59
|
commands.forEach(c => {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
5
5
|
import { Component, HostBinding, Input } from '@angular/core';
|
6
|
-
import { NgIf } from '@angular/common';
|
6
|
+
import { NgIf, NgTemplateOutlet } from '@angular/common';
|
7
7
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
8
8
|
import { guid, isPresent } from '@progress/kendo-angular-common';
|
9
9
|
import { ButtonComponent } from "@progress/kendo-angular-buttons";
|
@@ -97,6 +97,12 @@ export class AIPromptOutputCardComponent {
|
|
97
97
|
this.positiveRatingIcon = thumbUpOutlineIcon;
|
98
98
|
}
|
99
99
|
}
|
100
|
+
/**
|
101
|
+
* @hidden
|
102
|
+
*/
|
103
|
+
get customBodyTemplate() {
|
104
|
+
return this.service.outputBodyTemplate?.templateRef;
|
105
|
+
}
|
100
106
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptOutputCardComponent, deps: [{ token: i1.LocalizationService }, { token: i2.AIPromptService }], target: i0.ɵɵFactoryTarget.Component });
|
101
107
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AIPromptOutputCardComponent, isStandalone: true, selector: "[kendoAIPromptOutputCard]", inputs: { promptOutput: "promptOutput" }, host: { properties: { "class.k-card": "this.hostClass", "attr.role": "this.listItemRole", "attr.tabindex": "this.tabIndex", "attr.aria-describedby": "this.ariaDescribedBy", "attr.aria-keyshortcuts": "this.ariaKeyShortcuts" } }, ngImport: i0, template: `
|
102
108
|
<div class="k-card-header">
|
@@ -107,7 +113,13 @@ export class AIPromptOutputCardComponent {
|
|
107
113
|
<div class="k-card-subtitle">{{promptOutput.prompt}}</div>
|
108
114
|
</div>
|
109
115
|
<div class="k-card-body">
|
110
|
-
<
|
116
|
+
<ng-container *ngIf="customBodyTemplate; else defaultTemplate">
|
117
|
+
<ng-container *ngTemplateOutlet="customBodyTemplate; context: { $implicit: promptOutput }">
|
118
|
+
</ng-container>
|
119
|
+
</ng-container>
|
120
|
+
<ng-template #defaultTemplate>
|
121
|
+
<p>{{promptOutput.output}}</p>
|
122
|
+
</ng-template>
|
111
123
|
</div>
|
112
124
|
<div class="k-actions k-actions-start k-actions-horizontal k-card-actions">
|
113
125
|
<button kendoButton
|
@@ -141,7 +153,7 @@ export class AIPromptOutputCardComponent {
|
|
141
153
|
</button>
|
142
154
|
</ng-container>
|
143
155
|
</div>
|
144
|
-
`, 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: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
156
|
+
`, 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: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
145
157
|
}
|
146
158
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptOutputCardComponent, decorators: [{
|
147
159
|
type: Component,
|
@@ -156,7 +168,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
156
168
|
<div class="k-card-subtitle">{{promptOutput.prompt}}</div>
|
157
169
|
</div>
|
158
170
|
<div class="k-card-body">
|
159
|
-
<
|
171
|
+
<ng-container *ngIf="customBodyTemplate; else defaultTemplate">
|
172
|
+
<ng-container *ngTemplateOutlet="customBodyTemplate; context: { $implicit: promptOutput }">
|
173
|
+
</ng-container>
|
174
|
+
</ng-container>
|
175
|
+
<ng-template #defaultTemplate>
|
176
|
+
<p>{{promptOutput.output}}</p>
|
177
|
+
</ng-template>
|
160
178
|
</div>
|
161
179
|
<div class="k-actions k-actions-start k-actions-horizontal k-card-actions">
|
162
180
|
<button kendoButton
|
@@ -192,7 +210,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
192
210
|
</div>
|
193
211
|
`,
|
194
212
|
standalone: true,
|
195
|
-
imports: [ButtonComponent, NgIf]
|
213
|
+
imports: [ButtonComponent, NgIf, NgTemplateOutlet]
|
196
214
|
}]
|
197
215
|
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.AIPromptService }]; }, propDecorators: { hostClass: [{
|
198
216
|
type: HostBinding,
|
@@ -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 body of 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 kendoAIPromptOutputBodyTemplate let-output>
|
14
|
+
* <div>{{output.prompt}}</div>
|
15
|
+
* </ng-template>
|
16
|
+
* </kendo-aiprompt>
|
17
|
+
* ```
|
18
|
+
*/
|
19
|
+
export class AIPromptOutputBodyTemplateDirective {
|
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: AIPromptOutputBodyTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
25
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: AIPromptOutputBodyTemplateDirective, isStandalone: true, selector: "[kendoAIPromptOutputBodyTemplate]", ngImport: i0 });
|
26
|
+
}
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptOutputBodyTemplateDirective, decorators: [{
|
28
|
+
type: Directive,
|
29
|
+
args: [{
|
30
|
+
selector: '[kendoAIPromptOutputBodyTemplate]',
|
31
|
+
standalone: true
|
32
|
+
}]
|
33
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
@@ -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
|
-
<
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
-
<
|
67
|
-
|
68
|
-
|
69
|
-
|
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 }]; } });
|