@progress/kendo-angular-conversational-ui 14.4.0-develop.2 → 14.4.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.
- package/LICENSE.md +1 -1
- package/NOTICE.txt +147 -594
- package/README.md +1 -1
- package/ai-prompt/aiprompt.component.d.ts +120 -0
- package/ai-prompt/aiprompt.module.d.ts +25 -0
- package/ai-prompt/common/aiprompt.service.d.ts +26 -0
- package/ai-prompt/common/output-card.component.d.ts +36 -0
- package/ai-prompt/common/toolbar-focusable.directive.d.ts +24 -0
- package/ai-prompt/common/toolbar-navigation.service.d.ts +24 -0
- package/ai-prompt/localization/custom-messages.component.d.ts +17 -0
- package/ai-prompt/localization/localized-messages.directive.d.ts +16 -0
- package/ai-prompt/localization/messages.d.ts +49 -0
- package/ai-prompt/models/command-execute-event.d.ts +23 -0
- package/ai-prompt/models/command.interface.d.ts +30 -0
- package/ai-prompt/models/index.d.ts +10 -0
- package/ai-prompt/models/output-rating-change-event.d.ts +18 -0
- package/ai-prompt/models/prompt-output.interface.d.ts +41 -0
- package/ai-prompt/models/prompt-request-event.d.ts +22 -0
- package/ai-prompt/models/view-type.d.ts +8 -0
- package/ai-prompt/templates/toolbar-actions.template.d.ts +18 -0
- package/ai-prompt/utils.d.ts +19 -0
- package/ai-prompt/views/base-view.d.ts +46 -0
- package/ai-prompt/views/command-view.component.d.ts +23 -0
- package/ai-prompt/views/custom-view.component.d.ts +20 -0
- package/ai-prompt/views/index.d.ts +8 -0
- package/ai-prompt/views/output-view.component.d.ts +22 -0
- package/ai-prompt/views/prompt-view.component.d.ts +47 -0
- package/api/action.interface.d.ts +1 -1
- package/api/attachment.interface.d.ts +1 -1
- package/api/execute-action-event.d.ts +1 -1
- package/api/index.d.ts +1 -1
- package/api/message.interface.d.ts +1 -1
- package/api/post-message-event.d.ts +1 -1
- package/api/preventable-event.d.ts +1 -1
- package/api/user.interface.d.ts +1 -1
- package/cards/hero-card.component.d.ts +1 -1
- package/chat/attachment-template.directive.d.ts +1 -1
- package/chat/attachment.component.d.ts +1 -1
- package/chat/builtin-actions.d.ts +1 -1
- package/chat/chat-item.d.ts +1 -1
- package/chat/chat-view.d.ts +1 -1
- package/chat/chat.component.d.ts +1 -1
- package/chat/chat.directives.d.ts +1 -1
- package/chat/chat.module.d.ts +1 -1
- package/chat/l10n/custom-messages.component.d.ts +1 -1
- package/chat/l10n/localized-messages.directive.d.ts +1 -1
- package/chat/l10n/messages.d.ts +1 -1
- package/chat/message-attachments.component.d.ts +1 -1
- package/chat/message-box.component.d.ts +1 -1
- package/chat/message-box.directive.d.ts +1 -1
- package/chat/message-list.component.d.ts +1 -1
- package/chat/message-template.directive.d.ts +1 -1
- package/chat/message.component.d.ts +1 -1
- package/chat/suggested-actions.component.d.ts +1 -1
- package/common/focused-state.directive.d.ts +1 -1
- package/common/models/message-box-options.d.ts +1 -1
- package/common/scroll-anchor.directive.d.ts +1 -1
- package/common/utils.d.ts +1 -1
- package/conversational-ui.module.d.ts +43 -0
- package/esm2020/ai-prompt/aiprompt.component.mjs +348 -0
- package/esm2020/ai-prompt/aiprompt.module.mjs +79 -0
- package/esm2020/ai-prompt/common/aiprompt.service.mjs +38 -0
- package/esm2020/ai-prompt/common/output-card.component.mjs +199 -0
- package/esm2020/ai-prompt/common/toolbar-focusable.directive.mjs +67 -0
- package/esm2020/ai-prompt/common/toolbar-navigation.service.mjs +55 -0
- package/esm2020/ai-prompt/localization/custom-messages.component.mjs +41 -0
- package/esm2020/ai-prompt/localization/localized-messages.directive.mjs +37 -0
- package/esm2020/ai-prompt/localization/messages.mjs +35 -0
- package/esm2020/ai-prompt/models/command-execute-event.mjs +5 -0
- package/esm2020/ai-prompt/models/command.interface.mjs +5 -0
- package/esm2020/ai-prompt/models/index.mjs +5 -0
- package/esm2020/ai-prompt/models/output-rating-change-event.mjs +5 -0
- package/esm2020/ai-prompt/models/prompt-output.interface.mjs +5 -0
- package/esm2020/ai-prompt/models/prompt-request-event.mjs +5 -0
- package/esm2020/ai-prompt/models/view-type.mjs +5 -0
- package/esm2020/ai-prompt/templates/toolbar-actions.template.mjs +27 -0
- package/esm2020/ai-prompt/utils.mjs +26 -0
- package/esm2020/ai-prompt/views/base-view.mjs +89 -0
- package/esm2020/ai-prompt/views/command-view.component.mjs +82 -0
- package/esm2020/ai-prompt/views/custom-view.component.mjs +35 -0
- package/esm2020/ai-prompt/views/index.mjs +8 -0
- package/esm2020/ai-prompt/views/output-view.component.mjs +66 -0
- package/esm2020/ai-prompt/views/prompt-view.component.mjs +146 -0
- package/esm2020/api/action.interface.mjs +1 -1
- package/esm2020/api/attachment.interface.mjs +1 -1
- package/esm2020/api/execute-action-event.mjs +1 -1
- package/esm2020/api/index.mjs +1 -1
- package/esm2020/api/message.interface.mjs +1 -1
- package/esm2020/api/post-message-event.mjs +1 -1
- package/esm2020/api/preventable-event.mjs +1 -1
- package/esm2020/api/user.interface.mjs +1 -1
- package/esm2020/cards/hero-card.component.mjs +1 -1
- package/esm2020/chat/attachment-template.directive.mjs +1 -1
- package/esm2020/chat/attachment.component.mjs +1 -1
- package/esm2020/chat/builtin-actions.mjs +1 -1
- package/esm2020/chat/chat-item.mjs +1 -1
- package/esm2020/chat/chat-view.mjs +1 -1
- package/esm2020/chat/chat.component.mjs +1 -1
- package/esm2020/chat/chat.directives.mjs +1 -1
- package/esm2020/chat/chat.module.mjs +1 -1
- package/esm2020/chat/l10n/custom-messages.component.mjs +1 -1
- package/esm2020/chat/l10n/localized-messages.directive.mjs +1 -1
- package/esm2020/chat/l10n/messages.mjs +1 -1
- package/esm2020/chat/message-attachments.component.mjs +1 -1
- package/esm2020/chat/message-box.component.mjs +1 -1
- package/esm2020/chat/message-box.directive.mjs +1 -1
- package/esm2020/chat/message-list.component.mjs +1 -1
- package/esm2020/chat/message-template.directive.mjs +1 -1
- package/esm2020/chat/message.component.mjs +1 -1
- package/esm2020/chat/suggested-actions.component.mjs +1 -1
- package/esm2020/common/focused-state.directive.mjs +1 -1
- package/esm2020/common/models/message-box-options.mjs +1 -1
- package/esm2020/common/scroll-anchor.directive.mjs +1 -1
- package/esm2020/common/utils.mjs +1 -1
- package/esm2020/conversational-ui.module.mjs +50 -0
- package/esm2020/index.mjs +9 -1
- package/esm2020/package-metadata.mjs +3 -3
- package/esm2020/progress-kendo-angular-conversational-ui.mjs +1 -1
- package/fesm2015/progress-kendo-angular-conversational-ui.mjs +1412 -150
- package/fesm2020/progress-kendo-angular-conversational-ui.mjs +1300 -44
- package/index.d.ts +9 -1
- package/package-metadata.d.ts +1 -1
- package/package.json +9 -7
- package/progress-kendo-angular-conversational-ui.d.ts +1 -1
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, ContentChild, ContentChildren, EventEmitter, HostBinding, Input, NgZone, Output, QueryList } from "@angular/core";
|
|
6
|
+
import { sparklesIcon, commentIcon } from "@progress/kendo-svg-icons";
|
|
7
|
+
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { validatePackage } from "@progress/kendo-licensing";
|
|
9
|
+
import { BaseView } from "./views/base-view";
|
|
10
|
+
import { packageMetadata } from "../package-metadata";
|
|
11
|
+
import { Subscription } from "rxjs";
|
|
12
|
+
import { AIPromptService } from "./common/aiprompt.service";
|
|
13
|
+
import { AIPromptToolbarActionsDirective } from "./templates/toolbar-actions.template";
|
|
14
|
+
import { ToolbarNavigationService } from "./common/toolbar-navigation.service";
|
|
15
|
+
import * as i0 from "@angular/core";
|
|
16
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
17
|
+
import * as i2 from "./common/aiprompt.service";
|
|
18
|
+
import * as i3 from "./common/toolbar-navigation.service";
|
|
19
|
+
import * as i4 from "@progress/kendo-angular-buttons";
|
|
20
|
+
import * as i5 from "./localization/localized-messages.directive";
|
|
21
|
+
import * as i6 from "@angular/common";
|
|
22
|
+
import * as i7 from "./common/toolbar-focusable.directive";
|
|
23
|
+
/**
|
|
24
|
+
* Represents the Kendo UI AIPrompt component for Angular
|
|
25
|
+
*/
|
|
26
|
+
export class AIPromptComponent {
|
|
27
|
+
constructor(localization, service, navigationService, ngZone) {
|
|
28
|
+
this.localization = localization;
|
|
29
|
+
this.service = service;
|
|
30
|
+
this.navigationService = navigationService;
|
|
31
|
+
this.ngZone = ngZone;
|
|
32
|
+
this.hostClasses = true;
|
|
33
|
+
/**
|
|
34
|
+
* The active view index of the AIPrompt component.
|
|
35
|
+
*/
|
|
36
|
+
this.activeView = 0;
|
|
37
|
+
/**
|
|
38
|
+
* Fires when the `activeView` property of the component is updated.
|
|
39
|
+
* Used to provide a two-way binding for the `activeView` property.
|
|
40
|
+
*/
|
|
41
|
+
this.activeViewChange = new EventEmitter();
|
|
42
|
+
/**
|
|
43
|
+
* Fires each time the user clicks the Prompt view Generate button or the Output view Retry button.
|
|
44
|
+
* To distinguish the source element, use the event's `isRetry` field.
|
|
45
|
+
*/
|
|
46
|
+
this.promptRequest = new EventEmitter();
|
|
47
|
+
/**
|
|
48
|
+
* Fires each time the user clicks a Command view command. Exposes the selected command as event data.
|
|
49
|
+
*/
|
|
50
|
+
this.commandExecute = new EventEmitter();
|
|
51
|
+
/**
|
|
52
|
+
* Fires each time the user clicks any Output view Copy button.
|
|
53
|
+
*/
|
|
54
|
+
this.outputCopy = new EventEmitter();
|
|
55
|
+
/**
|
|
56
|
+
* Fires each time the user clicks a rating button in any Output view card.
|
|
57
|
+
*/
|
|
58
|
+
this.outputRatingChange = new EventEmitter();
|
|
59
|
+
this.subs = new Subscription();
|
|
60
|
+
/**
|
|
61
|
+
* @hidden
|
|
62
|
+
*/
|
|
63
|
+
this.sparklesIcon = sparklesIcon;
|
|
64
|
+
/**
|
|
65
|
+
* @hidden
|
|
66
|
+
*/
|
|
67
|
+
this.outputIcon = commentIcon;
|
|
68
|
+
validatePackage(packageMetadata);
|
|
69
|
+
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
70
|
+
this.subs.add(localization.changes.subscribe(({ rtl }) => {
|
|
71
|
+
this.direction = rtl ? 'rtl' : 'ltr';
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
get dirAttr() {
|
|
75
|
+
return this.direction;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The collection of commands that will be rendered in the Command view.
|
|
79
|
+
*/
|
|
80
|
+
set promptCommands(value) {
|
|
81
|
+
this.service.promptCommands = value;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The collection of suggestions that will be rendered in the Prompt view.
|
|
85
|
+
*/
|
|
86
|
+
set promptSuggestions(value) {
|
|
87
|
+
this.service.promptSuggestions = value;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The collection of generated prompt outputs that will be rendered in the Output view.
|
|
91
|
+
*/
|
|
92
|
+
set promptOutputs(value) {
|
|
93
|
+
this.service.promptOutputs = value;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Specifies if the rating buttons in each Output view card will be rendered.
|
|
97
|
+
* By default, rating buttons are not rendered.
|
|
98
|
+
*
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
set showOutputRating(value) {
|
|
102
|
+
this.service.showOutputRating = value;
|
|
103
|
+
}
|
|
104
|
+
ngAfterViewInit() {
|
|
105
|
+
this.ngZone.runOutsideAngular(() => {
|
|
106
|
+
this.service.aiPrompt = this;
|
|
107
|
+
this.subs.add(this.service.requestEvent.subscribe(ev => this.promptRequest.emit(ev)));
|
|
108
|
+
this.subs.add(this.service.executeEvent.subscribe(ev => this.commandExecute.emit(ev)));
|
|
109
|
+
this.subs.add(this.service.outputCopyEvent.subscribe(ev => this.outputCopy.emit(ev)));
|
|
110
|
+
this.subs.add(this.service.outputRatingChangeEvent.subscribe(ev => this.outputRatingChange.emit(ev)));
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
ngOnDestroy() {
|
|
114
|
+
this.subs.unsubscribe();
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Focuses the first focusable element in the AI Prompt.
|
|
118
|
+
*/
|
|
119
|
+
focus() {
|
|
120
|
+
this.navigationService.focusFirst();
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @hidden
|
|
124
|
+
*/
|
|
125
|
+
get selectedView() {
|
|
126
|
+
return this.viewsArray[this.activeView];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* @hidden
|
|
130
|
+
*/
|
|
131
|
+
get viewsArray() {
|
|
132
|
+
return this.views?.toArray();
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @hidden
|
|
136
|
+
*/
|
|
137
|
+
viewChange(idx) {
|
|
138
|
+
if (idx !== this.activeView) {
|
|
139
|
+
this.activeView = idx;
|
|
140
|
+
this.activeViewChange.emit(idx);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* @hidden
|
|
145
|
+
*/
|
|
146
|
+
messageFor(text) {
|
|
147
|
+
return this.localization.get(text);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* @hidden
|
|
151
|
+
*/
|
|
152
|
+
get viewTemplate() {
|
|
153
|
+
return this.selectedView.viewType === 'custom' ? this.selectedView?.viewTemplate : this.selectedView?.template;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* @hidden
|
|
157
|
+
*/
|
|
158
|
+
handleGenerateOutput() {
|
|
159
|
+
const value = this.service.promptValue;
|
|
160
|
+
const eventArgs = {
|
|
161
|
+
prompt: value,
|
|
162
|
+
sender: this,
|
|
163
|
+
isRetry: false
|
|
164
|
+
};
|
|
165
|
+
this.promptRequest.emit(eventArgs);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
AIPromptComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptComponent, deps: [{ token: i1.LocalizationService }, { token: i2.AIPromptService }, { token: i3.ToolbarNavigationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
169
|
+
AIPromptComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: AIPromptComponent, 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: [
|
|
170
|
+
LocalizationService,
|
|
171
|
+
AIPromptService,
|
|
172
|
+
ToolbarNavigationService,
|
|
173
|
+
{
|
|
174
|
+
provide: L10N_PREFIX,
|
|
175
|
+
useValue: 'kendo.aiprompt'
|
|
176
|
+
}
|
|
177
|
+
], queries: [{ propertyName: "toolbarActionsTemplate", first: true, predicate: AIPromptToolbarActionsDirective, descendants: true }, { propertyName: "views", predicate: BaseView }], exportAs: ["kendoAIPrompt"], ngImport: i0, template: `
|
|
178
|
+
<ng-container kendoAIPromptLocalizedMessages
|
|
179
|
+
i18n-promptView="kendo.aiprompt.promptView|The Toolbar button text for the Prompt view."
|
|
180
|
+
promptView="Ask AI"
|
|
181
|
+
i18n-outputView="kendo.aiprompt.outputView|The Toolbar button text for the Output view."
|
|
182
|
+
outputView="Output"
|
|
183
|
+
i18n-generateOutput="kendo.aiprompt.generateOutput|The text for the Generate button in the Prompt view."
|
|
184
|
+
generateOutput="Generate"
|
|
185
|
+
i18n-promptPlaceholder="kendo.aiprompt.promptPlaceholder|The placeholder text for the Prompt view textarea."
|
|
186
|
+
promptPlaceholder="Ask or generate content with AI"
|
|
187
|
+
i18n-copyOutput="kendo.aiprompt.copyOutput|The Copy button text in each Output view card."
|
|
188
|
+
copyOutput="Copy"
|
|
189
|
+
i18n-retryGeneration="kendo.aiprompt.retryGeneration|The Retry button text in each Output view card."
|
|
190
|
+
retryGeneration="Retry"
|
|
191
|
+
i18n-outputTitle="kendo.aiprompt.outputTitle|The title of each Output view card."
|
|
192
|
+
outputTitle="Generated with AI"
|
|
193
|
+
i18n-outputRetryTitle="kendo.aiprompt.outputRetryTitle|The title of each Output view retry card."
|
|
194
|
+
outputRetryTitle="Generated with AI"
|
|
195
|
+
i18n-promptSuggestions="kendo.aiprompt.promptSuggestions|The title of the Prompt suggestions button."
|
|
196
|
+
promptSuggestions="Prompt suggestions">
|
|
197
|
+
</ng-container>
|
|
198
|
+
<div class="k-prompt-header">
|
|
199
|
+
<div class="k-toolbar-flat k-toolbar k-toolbar-md"
|
|
200
|
+
role="toolbar">
|
|
201
|
+
<button *ngFor="let view of viewsArray; let idx = index"
|
|
202
|
+
kendoButton
|
|
203
|
+
kendoAIPromptToolbarFocusable
|
|
204
|
+
type="button"
|
|
205
|
+
fillMode="flat"
|
|
206
|
+
rounded="full"
|
|
207
|
+
themeColor="primary"
|
|
208
|
+
[svgIcon]="view.svgIcon"
|
|
209
|
+
[icon]="view.icon"
|
|
210
|
+
[selected]="idx === activeView"
|
|
211
|
+
(click)="viewChange(idx)">
|
|
212
|
+
{{view.buttonText}}
|
|
213
|
+
</button>
|
|
214
|
+
|
|
215
|
+
<ng-template *ngIf="toolbarActionsTemplate"
|
|
216
|
+
[ngTemplateOutlet]="toolbarActionsTemplate?.templateRef">
|
|
217
|
+
</ng-template>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
<div class="k-prompt-content">
|
|
221
|
+
<div class="k-prompt-view">
|
|
222
|
+
<ng-container *ngTemplateOutlet="viewTemplate">
|
|
223
|
+
</ng-container>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
<div class="k-prompt-footer" *ngIf="selectedView.viewType === 'prompt'">
|
|
227
|
+
<div class="k-actions k-actions-start k-actions-horizontal k-prompt-actions">
|
|
228
|
+
<button
|
|
229
|
+
kendoButton
|
|
230
|
+
type="button"
|
|
231
|
+
themeColor="primary"
|
|
232
|
+
rounded="full"
|
|
233
|
+
[svgIcon]="sparklesIcon"
|
|
234
|
+
icon="sparkles"
|
|
235
|
+
(click)="handleGenerateOutput()">{{messageFor('generateOutput')}}</button>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
`, isInline: true, components: [{ type: i4.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }], directives: [{ type: i5.LocalizedMessagesDirective, selector: "[kendoAIPromptLocalizedMessages]" }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.AIPromptToolbarFocusableDirective, selector: "[kendoAIPromptToolbarFocusable]" }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptComponent, decorators: [{
|
|
240
|
+
type: Component,
|
|
241
|
+
args: [{
|
|
242
|
+
exportAs: 'kendoAIPrompt',
|
|
243
|
+
selector: 'kendo-aiprompt',
|
|
244
|
+
providers: [
|
|
245
|
+
LocalizationService,
|
|
246
|
+
AIPromptService,
|
|
247
|
+
ToolbarNavigationService,
|
|
248
|
+
{
|
|
249
|
+
provide: L10N_PREFIX,
|
|
250
|
+
useValue: 'kendo.aiprompt'
|
|
251
|
+
}
|
|
252
|
+
],
|
|
253
|
+
template: `
|
|
254
|
+
<ng-container kendoAIPromptLocalizedMessages
|
|
255
|
+
i18n-promptView="kendo.aiprompt.promptView|The Toolbar button text for the Prompt view."
|
|
256
|
+
promptView="Ask AI"
|
|
257
|
+
i18n-outputView="kendo.aiprompt.outputView|The Toolbar button text for the Output view."
|
|
258
|
+
outputView="Output"
|
|
259
|
+
i18n-generateOutput="kendo.aiprompt.generateOutput|The text for the Generate button in the Prompt view."
|
|
260
|
+
generateOutput="Generate"
|
|
261
|
+
i18n-promptPlaceholder="kendo.aiprompt.promptPlaceholder|The placeholder text for the Prompt view textarea."
|
|
262
|
+
promptPlaceholder="Ask or generate content with AI"
|
|
263
|
+
i18n-copyOutput="kendo.aiprompt.copyOutput|The Copy button text in each Output view card."
|
|
264
|
+
copyOutput="Copy"
|
|
265
|
+
i18n-retryGeneration="kendo.aiprompt.retryGeneration|The Retry button text in each Output view card."
|
|
266
|
+
retryGeneration="Retry"
|
|
267
|
+
i18n-outputTitle="kendo.aiprompt.outputTitle|The title of each Output view card."
|
|
268
|
+
outputTitle="Generated with AI"
|
|
269
|
+
i18n-outputRetryTitle="kendo.aiprompt.outputRetryTitle|The title of each Output view retry card."
|
|
270
|
+
outputRetryTitle="Generated with AI"
|
|
271
|
+
i18n-promptSuggestions="kendo.aiprompt.promptSuggestions|The title of the Prompt suggestions button."
|
|
272
|
+
promptSuggestions="Prompt suggestions">
|
|
273
|
+
</ng-container>
|
|
274
|
+
<div class="k-prompt-header">
|
|
275
|
+
<div class="k-toolbar-flat k-toolbar k-toolbar-md"
|
|
276
|
+
role="toolbar">
|
|
277
|
+
<button *ngFor="let view of viewsArray; let idx = index"
|
|
278
|
+
kendoButton
|
|
279
|
+
kendoAIPromptToolbarFocusable
|
|
280
|
+
type="button"
|
|
281
|
+
fillMode="flat"
|
|
282
|
+
rounded="full"
|
|
283
|
+
themeColor="primary"
|
|
284
|
+
[svgIcon]="view.svgIcon"
|
|
285
|
+
[icon]="view.icon"
|
|
286
|
+
[selected]="idx === activeView"
|
|
287
|
+
(click)="viewChange(idx)">
|
|
288
|
+
{{view.buttonText}}
|
|
289
|
+
</button>
|
|
290
|
+
|
|
291
|
+
<ng-template *ngIf="toolbarActionsTemplate"
|
|
292
|
+
[ngTemplateOutlet]="toolbarActionsTemplate?.templateRef">
|
|
293
|
+
</ng-template>
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
<div class="k-prompt-content">
|
|
297
|
+
<div class="k-prompt-view">
|
|
298
|
+
<ng-container *ngTemplateOutlet="viewTemplate">
|
|
299
|
+
</ng-container>
|
|
300
|
+
</div>
|
|
301
|
+
</div>
|
|
302
|
+
<div class="k-prompt-footer" *ngIf="selectedView.viewType === 'prompt'">
|
|
303
|
+
<div class="k-actions k-actions-start k-actions-horizontal k-prompt-actions">
|
|
304
|
+
<button
|
|
305
|
+
kendoButton
|
|
306
|
+
type="button"
|
|
307
|
+
themeColor="primary"
|
|
308
|
+
rounded="full"
|
|
309
|
+
[svgIcon]="sparklesIcon"
|
|
310
|
+
icon="sparkles"
|
|
311
|
+
(click)="handleGenerateOutput()">{{messageFor('generateOutput')}}</button>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
`
|
|
315
|
+
}]
|
|
316
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.AIPromptService }, { type: i3.ToolbarNavigationService }, { type: i0.NgZone }]; }, propDecorators: { hostClasses: [{
|
|
317
|
+
type: HostBinding,
|
|
318
|
+
args: ['class.k-prompt']
|
|
319
|
+
}], dirAttr: [{
|
|
320
|
+
type: HostBinding,
|
|
321
|
+
args: ['attr.dir']
|
|
322
|
+
}], views: [{
|
|
323
|
+
type: ContentChildren,
|
|
324
|
+
args: [BaseView]
|
|
325
|
+
}], toolbarActionsTemplate: [{
|
|
326
|
+
type: ContentChild,
|
|
327
|
+
args: [AIPromptToolbarActionsDirective]
|
|
328
|
+
}], activeView: [{
|
|
329
|
+
type: Input
|
|
330
|
+
}], promptCommands: [{
|
|
331
|
+
type: Input
|
|
332
|
+
}], promptSuggestions: [{
|
|
333
|
+
type: Input
|
|
334
|
+
}], promptOutputs: [{
|
|
335
|
+
type: Input
|
|
336
|
+
}], showOutputRating: [{
|
|
337
|
+
type: Input
|
|
338
|
+
}], activeViewChange: [{
|
|
339
|
+
type: Output
|
|
340
|
+
}], promptRequest: [{
|
|
341
|
+
type: Output
|
|
342
|
+
}], commandExecute: [{
|
|
343
|
+
type: Output
|
|
344
|
+
}], outputCopy: [{
|
|
345
|
+
type: Output
|
|
346
|
+
}], outputRatingChange: [{
|
|
347
|
+
type: Output
|
|
348
|
+
}] } });
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { NgModule } from "@angular/core";
|
|
6
|
+
import { CommonModule } from "@angular/common";
|
|
7
|
+
import { IconsModule } from '@progress/kendo-angular-icons';
|
|
8
|
+
import { ButtonsModule } from "@progress/kendo-angular-buttons";
|
|
9
|
+
import { InputsModule } from '@progress/kendo-angular-inputs';
|
|
10
|
+
import { LayoutModule } from '@progress/kendo-angular-layout';
|
|
11
|
+
import { PromptViewComponent } from "./views/prompt-view.component";
|
|
12
|
+
import { OutputViewComponent } from "./views/output-view.component";
|
|
13
|
+
import { AIPromptComponent } from "./aiprompt.component";
|
|
14
|
+
import { CommandViewComponent } from "./views/command-view.component";
|
|
15
|
+
import { LocalizedMessagesDirective } from "./localization/localized-messages.directive";
|
|
16
|
+
import { AIPromptCustomMessagesComponent } from "./localization/custom-messages.component";
|
|
17
|
+
import { AIPromptOutputCardComponent } from './common/output-card.component';
|
|
18
|
+
import { CustomViewComponent } from './views/custom-view.component';
|
|
19
|
+
import { AIPromptToolbarActionsDirective } from './templates/toolbar-actions.template';
|
|
20
|
+
import { AIPromptToolbarFocusableDirective } from './common/toolbar-focusable.directive';
|
|
21
|
+
import * as i0 from "@angular/core";
|
|
22
|
+
const PUBLIC_DIRECTIVES = [
|
|
23
|
+
AIPromptComponent,
|
|
24
|
+
PromptViewComponent,
|
|
25
|
+
OutputViewComponent,
|
|
26
|
+
CommandViewComponent,
|
|
27
|
+
CustomViewComponent,
|
|
28
|
+
AIPromptCustomMessagesComponent,
|
|
29
|
+
AIPromptToolbarActionsDirective,
|
|
30
|
+
AIPromptToolbarFocusableDirective
|
|
31
|
+
];
|
|
32
|
+
const PRIVATE_DIRECTIVES = [
|
|
33
|
+
LocalizedMessagesDirective,
|
|
34
|
+
AIPromptOutputCardComponent
|
|
35
|
+
];
|
|
36
|
+
export class AIPromptModule {
|
|
37
|
+
}
|
|
38
|
+
AIPromptModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
39
|
+
AIPromptModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptModule, declarations: [AIPromptComponent,
|
|
40
|
+
PromptViewComponent,
|
|
41
|
+
OutputViewComponent,
|
|
42
|
+
CommandViewComponent,
|
|
43
|
+
CustomViewComponent,
|
|
44
|
+
AIPromptCustomMessagesComponent,
|
|
45
|
+
AIPromptToolbarActionsDirective,
|
|
46
|
+
AIPromptToolbarFocusableDirective, LocalizedMessagesDirective,
|
|
47
|
+
AIPromptOutputCardComponent], imports: [CommonModule,
|
|
48
|
+
ButtonsModule,
|
|
49
|
+
IconsModule,
|
|
50
|
+
InputsModule,
|
|
51
|
+
LayoutModule], exports: [AIPromptComponent,
|
|
52
|
+
PromptViewComponent,
|
|
53
|
+
OutputViewComponent,
|
|
54
|
+
CommandViewComponent,
|
|
55
|
+
CustomViewComponent,
|
|
56
|
+
AIPromptCustomMessagesComponent,
|
|
57
|
+
AIPromptToolbarActionsDirective,
|
|
58
|
+
AIPromptToolbarFocusableDirective] });
|
|
59
|
+
AIPromptModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptModule, imports: [[
|
|
60
|
+
CommonModule,
|
|
61
|
+
ButtonsModule,
|
|
62
|
+
IconsModule,
|
|
63
|
+
InputsModule,
|
|
64
|
+
LayoutModule
|
|
65
|
+
]] });
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptModule, decorators: [{
|
|
67
|
+
type: NgModule,
|
|
68
|
+
args: [{
|
|
69
|
+
declarations: [...PUBLIC_DIRECTIVES, ...PRIVATE_DIRECTIVES],
|
|
70
|
+
exports: [...PUBLIC_DIRECTIVES],
|
|
71
|
+
imports: [
|
|
72
|
+
CommonModule,
|
|
73
|
+
ButtonsModule,
|
|
74
|
+
IconsModule,
|
|
75
|
+
InputsModule,
|
|
76
|
+
LayoutModule
|
|
77
|
+
]
|
|
78
|
+
}]
|
|
79
|
+
}] });
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Injectable } from '@angular/core';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export class AIPromptService {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.promptValue = '';
|
|
14
|
+
this.showOutputRating = false;
|
|
15
|
+
this.requestEvent = new Subject();
|
|
16
|
+
this.executeEvent = new Subject();
|
|
17
|
+
this.outputCopyEvent = new Subject();
|
|
18
|
+
this.outputRatingChangeEvent = new Subject();
|
|
19
|
+
}
|
|
20
|
+
getFlattenPromptCommands(commands = this.promptCommands) {
|
|
21
|
+
let newArr = [];
|
|
22
|
+
commands.forEach(c => {
|
|
23
|
+
if (c.hasOwnProperty('children')) {
|
|
24
|
+
const childrenArr = c.children;
|
|
25
|
+
newArr = newArr.concat(childrenArr);
|
|
26
|
+
if (childrenArr.length > 0) {
|
|
27
|
+
this.getFlattenPromptCommands(childrenArr);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return newArr.concat(this.promptCommands);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
AIPromptService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
35
|
+
AIPromptService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptService });
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptService, decorators: [{
|
|
37
|
+
type: Injectable
|
|
38
|
+
}] });
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, HostBinding, Input } from '@angular/core';
|
|
6
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
+
import { guid, isPresent } from '@progress/kendo-angular-common';
|
|
8
|
+
import { arrowRotateCwIcon, copyIcon, thumbDownIcon, thumbDownOutlineIcon, thumbUpIcon, thumbUpOutlineIcon } from '@progress/kendo-svg-icons';
|
|
9
|
+
import { AIPromptService } from './aiprompt.service';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
12
|
+
import * as i2 from "./aiprompt.service";
|
|
13
|
+
import * as i3 from "@progress/kendo-angular-buttons";
|
|
14
|
+
import * as i4 from "@angular/common";
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export class AIPromptOutputCardComponent {
|
|
19
|
+
constructor(localization, service) {
|
|
20
|
+
this.localization = localization;
|
|
21
|
+
this.service = service;
|
|
22
|
+
this.hostClass = true;
|
|
23
|
+
this.listItemRole = 'listitem';
|
|
24
|
+
this.tabIndex = 0;
|
|
25
|
+
this.ariaKeyShortcuts = 'Enter';
|
|
26
|
+
this.copyIcon = copyIcon;
|
|
27
|
+
this.retryIcon = arrowRotateCwIcon;
|
|
28
|
+
this.positiveRatingIcon = thumbUpOutlineIcon;
|
|
29
|
+
this.negativeRatingIcon = thumbDownOutlineIcon;
|
|
30
|
+
this.titleId = `k-output-card-${guid()}`;
|
|
31
|
+
}
|
|
32
|
+
get ariaDescribedBy() {
|
|
33
|
+
return this.titleId;
|
|
34
|
+
}
|
|
35
|
+
messageFor(text) {
|
|
36
|
+
return this.localization.get(text);
|
|
37
|
+
}
|
|
38
|
+
get showRating() {
|
|
39
|
+
return this.service.showOutputRating;
|
|
40
|
+
}
|
|
41
|
+
get outputTitle() {
|
|
42
|
+
if (isPresent(this.promptOutput.title)) {
|
|
43
|
+
return this.promptOutput.title;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const titleMessage = this.promptOutput.isRetry ? 'outputRetryTitle' : 'outputTitle';
|
|
47
|
+
return this.messageFor(titleMessage);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
handleRetry() {
|
|
51
|
+
if (this.promptOutput.commandId) {
|
|
52
|
+
const eventArgs = {
|
|
53
|
+
command: this.service.getFlattenPromptCommands().find(c => c.id === this.promptOutput.commandId),
|
|
54
|
+
sender: this.service.aiPrompt,
|
|
55
|
+
isRetry: true
|
|
56
|
+
};
|
|
57
|
+
this.service.executeEvent.next(eventArgs);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const eventArgs = {
|
|
61
|
+
prompt: this.promptOutput.prompt,
|
|
62
|
+
sender: this.service.aiPrompt,
|
|
63
|
+
isRetry: true
|
|
64
|
+
};
|
|
65
|
+
this.service.requestEvent.next(eventArgs);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
handleCopy() {
|
|
69
|
+
navigator.clipboard.writeText(this.promptOutput.output);
|
|
70
|
+
this.service.outputCopyEvent.next(this.promptOutput);
|
|
71
|
+
}
|
|
72
|
+
handleRating(ratingType) {
|
|
73
|
+
const eventArgs = {
|
|
74
|
+
promptOutput: this.promptOutput,
|
|
75
|
+
rating: ratingType
|
|
76
|
+
};
|
|
77
|
+
this.service.outputRatingChangeEvent.next(eventArgs);
|
|
78
|
+
if (ratingType === 'positive') {
|
|
79
|
+
this.positiveRatingIcon = thumbUpIcon;
|
|
80
|
+
this.negativeRatingIcon = thumbDownOutlineIcon;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
this.negativeRatingIcon = thumbDownIcon;
|
|
84
|
+
this.positiveRatingIcon = thumbUpOutlineIcon;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
AIPromptOutputCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptOutputCardComponent, deps: [{ token: i1.LocalizationService }, { token: i2.AIPromptService }], target: i0.ɵɵFactoryTarget.Component });
|
|
89
|
+
AIPromptOutputCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: AIPromptOutputCardComponent, 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: `
|
|
90
|
+
<div class="k-card-header">
|
|
91
|
+
<div
|
|
92
|
+
class="k-card-title"
|
|
93
|
+
[attr.id]="titleId">{{outputTitle}}
|
|
94
|
+
</div>
|
|
95
|
+
<div class="k-card-subtitle">{{promptOutput.prompt}}</div>
|
|
96
|
+
</div>
|
|
97
|
+
<div class="k-card-body">
|
|
98
|
+
<p>{{promptOutput.output}}</p>
|
|
99
|
+
</div>
|
|
100
|
+
<div class="k-actions k-actions-start k-actions-horizontal k-card-actions">
|
|
101
|
+
<button kendoButton
|
|
102
|
+
fillMode="flat"
|
|
103
|
+
themeColor="primary"
|
|
104
|
+
rounded="full"
|
|
105
|
+
icon="copy"
|
|
106
|
+
[svgIcon]="copyIcon"
|
|
107
|
+
(click)="handleCopy()"
|
|
108
|
+
>{{messageFor('copyOutput')}}</button>
|
|
109
|
+
<button kendoButton
|
|
110
|
+
fillMode="flat"
|
|
111
|
+
rounded="full"
|
|
112
|
+
icon="arrow-rotate-cw"
|
|
113
|
+
[svgIcon]="retryIcon"
|
|
114
|
+
(click)="handleRetry()"
|
|
115
|
+
>{{messageFor('retryGeneration')}}</button>
|
|
116
|
+
<ng-container *ngIf="showRating">
|
|
117
|
+
<span class="k-spacer"></span>
|
|
118
|
+
<button kendoButton
|
|
119
|
+
fillMode="flat"
|
|
120
|
+
icon="thumb-up-outline"
|
|
121
|
+
[svgIcon]="positiveRatingIcon"
|
|
122
|
+
(click)="handleRating('positive')">
|
|
123
|
+
</button>
|
|
124
|
+
<button kendoButton
|
|
125
|
+
fillMode="flat"
|
|
126
|
+
icon="thumb-down-outline"
|
|
127
|
+
[svgIcon]="negativeRatingIcon"
|
|
128
|
+
(click)="handleRating('negative')">
|
|
129
|
+
</button>
|
|
130
|
+
</ng-container>
|
|
131
|
+
</div>
|
|
132
|
+
`, isInline: true, components: [{ type: i3.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptOutputCardComponent, decorators: [{
|
|
134
|
+
type: Component,
|
|
135
|
+
args: [{
|
|
136
|
+
selector: '[kendoAIPromptOutputCard]',
|
|
137
|
+
template: `
|
|
138
|
+
<div class="k-card-header">
|
|
139
|
+
<div
|
|
140
|
+
class="k-card-title"
|
|
141
|
+
[attr.id]="titleId">{{outputTitle}}
|
|
142
|
+
</div>
|
|
143
|
+
<div class="k-card-subtitle">{{promptOutput.prompt}}</div>
|
|
144
|
+
</div>
|
|
145
|
+
<div class="k-card-body">
|
|
146
|
+
<p>{{promptOutput.output}}</p>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="k-actions k-actions-start k-actions-horizontal k-card-actions">
|
|
149
|
+
<button kendoButton
|
|
150
|
+
fillMode="flat"
|
|
151
|
+
themeColor="primary"
|
|
152
|
+
rounded="full"
|
|
153
|
+
icon="copy"
|
|
154
|
+
[svgIcon]="copyIcon"
|
|
155
|
+
(click)="handleCopy()"
|
|
156
|
+
>{{messageFor('copyOutput')}}</button>
|
|
157
|
+
<button kendoButton
|
|
158
|
+
fillMode="flat"
|
|
159
|
+
rounded="full"
|
|
160
|
+
icon="arrow-rotate-cw"
|
|
161
|
+
[svgIcon]="retryIcon"
|
|
162
|
+
(click)="handleRetry()"
|
|
163
|
+
>{{messageFor('retryGeneration')}}</button>
|
|
164
|
+
<ng-container *ngIf="showRating">
|
|
165
|
+
<span class="k-spacer"></span>
|
|
166
|
+
<button kendoButton
|
|
167
|
+
fillMode="flat"
|
|
168
|
+
icon="thumb-up-outline"
|
|
169
|
+
[svgIcon]="positiveRatingIcon"
|
|
170
|
+
(click)="handleRating('positive')">
|
|
171
|
+
</button>
|
|
172
|
+
<button kendoButton
|
|
173
|
+
fillMode="flat"
|
|
174
|
+
icon="thumb-down-outline"
|
|
175
|
+
[svgIcon]="negativeRatingIcon"
|
|
176
|
+
(click)="handleRating('negative')">
|
|
177
|
+
</button>
|
|
178
|
+
</ng-container>
|
|
179
|
+
</div>
|
|
180
|
+
`
|
|
181
|
+
}]
|
|
182
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.AIPromptService }]; }, propDecorators: { hostClass: [{
|
|
183
|
+
type: HostBinding,
|
|
184
|
+
args: ['class.k-card']
|
|
185
|
+
}], listItemRole: [{
|
|
186
|
+
type: HostBinding,
|
|
187
|
+
args: ['attr.role']
|
|
188
|
+
}], tabIndex: [{
|
|
189
|
+
type: HostBinding,
|
|
190
|
+
args: ['attr.tabindex']
|
|
191
|
+
}], ariaDescribedBy: [{
|
|
192
|
+
type: HostBinding,
|
|
193
|
+
args: ['attr.aria-describedby']
|
|
194
|
+
}], ariaKeyShortcuts: [{
|
|
195
|
+
type: HostBinding,
|
|
196
|
+
args: ['attr.aria-keyshortcuts']
|
|
197
|
+
}], promptOutput: [{
|
|
198
|
+
type: Input
|
|
199
|
+
}] } });
|