@progress/kendo-angular-conversational-ui 14.4.0-develop.8 → 15.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.txt +146 -593
- 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 → chat/api}/execute-action-event.d.ts +1 -1
- package/chat/attachment.component.d.ts +1 -1
- package/chat/builtin-actions.d.ts +1 -1
- package/chat/chat-view.d.ts +1 -1
- package/chat/chat.component.d.ts +2 -2
- package/chat/chat.module.d.ts +3 -3
- package/chat/message-attachments.component.d.ts +1 -1
- package/chat/message-box.component.d.ts +2 -2
- package/chat/message-list.component.d.ts +1 -1
- package/chat/message.component.d.ts +1 -1
- package/chat/suggested-actions.component.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/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/chat/api/attachment.interface.mjs +5 -0
- package/esm2020/chat/api/message.interface.mjs +5 -0
- package/esm2020/chat/api/user.interface.mjs +5 -0
- package/esm2020/chat/builtin-actions.mjs +1 -1
- package/esm2020/chat/chat.component.mjs +1 -1
- package/esm2020/chat/chat.module.mjs +3 -3
- package/esm2020/chat/common/models/message-box-options.mjs +5 -0
- package/esm2020/chat/message-box.component.mjs +2 -2
- package/esm2020/chat/message-list.component.mjs +2 -2
- package/esm2020/conversational-ui.module.mjs +50 -0
- package/esm2020/index.mjs +10 -2
- package/esm2020/package-metadata.mjs +2 -2
- package/fesm2015/progress-kendo-angular-conversational-ui.mjs +1411 -149
- package/fesm2020/progress-kendo-angular-conversational-ui.mjs +1299 -43
- package/index.d.ts +11 -3
- package/package.json +10 -7
- package/schematics/ngAdd/index.js +4 -2
- /package/{api → chat/api}/action.interface.d.ts +0 -0
- /package/{api → chat/api}/attachment.interface.d.ts +0 -0
- /package/{api → chat/api}/index.d.ts +0 -0
- /package/{api → chat/api}/message.interface.d.ts +0 -0
- /package/{api → chat/api}/post-message-event.d.ts +0 -0
- /package/{api → chat/api}/preventable-event.d.ts +0 -0
- /package/{api → chat/api}/user.interface.d.ts +0 -0
- /package/{cards → chat/cards}/hero-card.component.d.ts +0 -0
- /package/{common → chat/common}/focused-state.directive.d.ts +0 -0
- /package/{common → chat/common}/models/message-box-options.d.ts +0 -0
- /package/{common → chat/common}/scroll-anchor.directive.d.ts +0 -0
- /package/{common → chat/common}/utils.d.ts +0 -0
- /package/esm2020/{api/attachment.interface.mjs → ai-prompt/models/command-execute-event.mjs} +0 -0
- /package/esm2020/{api/message.interface.mjs → ai-prompt/models/command.interface.mjs} +0 -0
- /package/esm2020/{api/user.interface.mjs → ai-prompt/models/index.mjs} +0 -0
- /package/esm2020/{common/models/message-box-options.mjs → ai-prompt/models/output-rating-change-event.mjs} +0 -0
- /package/esm2020/{api → chat/api}/action.interface.mjs +0 -0
- /package/esm2020/{api → chat/api}/execute-action-event.mjs +0 -0
- /package/esm2020/{api → chat/api}/index.mjs +0 -0
- /package/esm2020/{api → chat/api}/post-message-event.mjs +0 -0
- /package/esm2020/{api → chat/api}/preventable-event.mjs +0 -0
- /package/esm2020/{cards → chat/cards}/hero-card.component.mjs +0 -0
- /package/esm2020/{common → chat/common}/focused-state.directive.mjs +0 -0
- /package/esm2020/{common → chat/common}/scroll-anchor.directive.mjs +0 -0
- /package/esm2020/{common → chat/common}/utils.mjs +0 -0
@@ -3,20 +3,25 @@
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
5
5
|
import * as i0 from '@angular/core';
|
6
|
-
import { Directive, Optional, HostBinding, HostListener, EventEmitter, Component, ViewChild, Input, Output, isDevMode, forwardRef, ViewChildren, ElementRef, ContentChild, NgModule } from '@angular/core';
|
7
|
-
import * as i1$
|
6
|
+
import { Directive, Optional, HostBinding, HostListener, EventEmitter, Component, ViewChild, Input, Output, isDevMode, forwardRef, ViewChildren, ElementRef, ContentChild, InjectionToken, Inject, Injectable, ContentChildren, NgModule } from '@angular/core';
|
7
|
+
import * as i1$1 from '@progress/kendo-angular-l10n';
|
8
8
|
import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
9
9
|
import { validatePackage } from '@progress/kendo-licensing';
|
10
10
|
import * as i6 from '@progress/kendo-angular-common';
|
11
|
-
import { Keys, ResizeSensorModule } from '@progress/kendo-angular-common';
|
12
|
-
import { paperPlaneIcon, chevronLeftIcon, chevronRightIcon } from '@progress/kendo-svg-icons';
|
13
|
-
import * as
|
14
|
-
import { ButtonModule } from '@progress/kendo-angular-buttons';
|
11
|
+
import { Keys, isPresent, guid, focusableSelector, ResizeSensorModule } from '@progress/kendo-angular-common';
|
12
|
+
import { paperPlaneIcon, chevronLeftIcon, chevronRightIcon, sparklesIcon, commentIcon, moreHorizontalIcon, chevronUpIcon, chevronDownIcon, copyIcon, arrowRotateCwIcon, thumbUpOutlineIcon, thumbDownOutlineIcon, thumbUpIcon, thumbDownIcon } from '@progress/kendo-svg-icons';
|
13
|
+
import * as i4 from '@progress/kendo-angular-buttons';
|
14
|
+
import { ButtonsModule, ButtonModule } from '@progress/kendo-angular-buttons';
|
15
15
|
import * as i2 from '@angular/common';
|
16
16
|
import { CommonModule } from '@angular/common';
|
17
|
-
import * as i1
|
18
|
-
import { fromEvent, Subscription } from 'rxjs';
|
17
|
+
import * as i1 from '@progress/kendo-angular-intl';
|
18
|
+
import { fromEvent, Subscription, Subject } from 'rxjs';
|
19
19
|
import { debounceTime } from 'rxjs/operators';
|
20
|
+
import { IconsModule } from '@progress/kendo-angular-icons';
|
21
|
+
import * as i3 from '@progress/kendo-angular-inputs';
|
22
|
+
import { InputsModule } from '@progress/kendo-angular-inputs';
|
23
|
+
import * as i3$1 from '@progress/kendo-angular-layout';
|
24
|
+
import { LayoutModule } from '@progress/kendo-angular-layout';
|
20
25
|
|
21
26
|
/**
|
22
27
|
* Defines a template that will be used for displaying message attachments. To define an attachment
|
@@ -115,8 +120,8 @@ const packageMetadata = {
|
|
115
120
|
name: '@progress/kendo-angular-conversational-ui',
|
116
121
|
productName: 'Kendo UI for Angular',
|
117
122
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
118
|
-
publishDate:
|
119
|
-
version: '
|
123
|
+
publishDate: 1706543943,
|
124
|
+
version: '15.0.0-develop.1',
|
120
125
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
121
126
|
};
|
122
127
|
|
@@ -279,7 +284,7 @@ MessageBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
279
284
|
</ng-container>
|
280
285
|
|
281
286
|
<ng-template *ngIf="messageBoxTemplate" [ngTemplateOutlet]="messageBoxTemplate?.templateRef"></ng-template>
|
282
|
-
`, isInline: true, components: [{ type:
|
287
|
+
`, 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: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: FocusedStateDirective, selector: "[kendoChatFocusedState]" }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
283
288
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageBoxComponent, decorators: [{
|
284
289
|
type: Component,
|
285
290
|
args: [{
|
@@ -602,7 +607,7 @@ class MessageComponent extends ChatItem {
|
|
602
607
|
this.element.nativeElement.focus();
|
603
608
|
}
|
604
609
|
}
|
605
|
-
MessageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageComponent, deps: [{ token: i0.ElementRef }, { token: i1
|
610
|
+
MessageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageComponent, deps: [{ token: i0.ElementRef }, { token: i1.IntlService }], target: i0.ɵɵFactoryTarget.Component });
|
606
611
|
MessageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: MessageComponent, selector: "kendo-chat-message", inputs: { message: "message", tabbable: "tabbable", template: "template" }, host: { properties: { "class.k-message": "this.cssClass", "class.k-selected": "this.selected", "class.k-focus": "this.selected", "attr.tabIndex": "this.tabIndex" } }, providers: [{
|
607
612
|
provide: ChatItem,
|
608
613
|
useExisting: forwardRef(() => MessageComponent)
|
@@ -693,7 +698,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
693
698
|
</ng-template>
|
694
699
|
`
|
695
700
|
}]
|
696
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1
|
701
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.IntlService }]; }, propDecorators: { message: [{
|
697
702
|
type: Input
|
698
703
|
}], tabbable: [{
|
699
704
|
type: Input
|
@@ -898,7 +903,7 @@ class MessageAttachmentsComponent extends ChatItem {
|
|
898
903
|
return this.localization.get(key);
|
899
904
|
}
|
900
905
|
}
|
901
|
-
MessageAttachmentsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageAttachmentsComponent, deps: [{ token: i0.NgZone }, { token: i1$
|
906
|
+
MessageAttachmentsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageAttachmentsComponent, deps: [{ token: i0.NgZone }, { token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
902
907
|
MessageAttachmentsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: MessageAttachmentsComponent, selector: "kendo-chat-message-attachments", inputs: { attachments: "attachments", layout: "layout", tabbable: "tabbable", template: "template", localization: "localization" }, host: { properties: { "class.k-card-deck-scrollwrap": "this.carousel" } }, providers: [{
|
903
908
|
provide: ChatItem,
|
904
909
|
useExisting: forwardRef(() => MessageAttachmentsComponent)
|
@@ -943,7 +948,7 @@ MessageAttachmentsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
|
|
943
948
|
icon="chevron-right"
|
944
949
|
>
|
945
950
|
</button>
|
946
|
-
`, isInline: true, components: [{ type:
|
951
|
+
`, 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"] }, { type: AttachmentComponent, selector: "kendo-chat-attachment", inputs: ["attachment", "template"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
947
952
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageAttachmentsComponent, decorators: [{
|
948
953
|
type: Component,
|
949
954
|
args: [{
|
@@ -995,7 +1000,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
995
1000
|
</button>
|
996
1001
|
`
|
997
1002
|
}]
|
998
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1$
|
1003
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1$1.LocalizationService }]; }, propDecorators: { attachments: [{
|
999
1004
|
type: Input
|
1000
1005
|
}], layout: [{
|
1001
1006
|
type: Input
|
@@ -1147,7 +1152,7 @@ class MessageListComponent {
|
|
1147
1152
|
return this.localization.get(key);
|
1148
1153
|
}
|
1149
1154
|
}
|
1150
|
-
MessageListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageListComponent, deps: [{ token: i0.ElementRef }, { token: i1
|
1155
|
+
MessageListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageListComponent, deps: [{ token: i0.ElementRef }, { token: i1.IntlService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
1151
1156
|
MessageListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: MessageListComponent, selector: "kendo-chat-message-list", inputs: { messages: "messages", attachmentTemplate: "attachmentTemplate", messageTemplate: "messageTemplate", localization: "localization", user: "user" }, outputs: { executeAction: "executeAction", navigate: "navigate", resize: "resize" }, host: { properties: { "class.k-message-list-content": "this.cssClass" } }, viewQueries: [{ propertyName: "items", predicate: ChatItem, descendants: true }], ngImport: i0, template: `
|
1152
1157
|
<ng-container *ngFor="let group of view; last as lastGroup; trackBy: trackGroup">
|
1153
1158
|
<ng-container [ngSwitch]="group.type">
|
@@ -1321,7 +1326,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
1321
1326
|
</kendo-resize-sensor>
|
1322
1327
|
`
|
1323
1328
|
}]
|
1324
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1
|
1329
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.IntlService }, { type: i0.Renderer2 }]; }, propDecorators: { messages: [{
|
1325
1330
|
type: Input
|
1326
1331
|
}], attachmentTemplate: [{
|
1327
1332
|
type: Input
|
@@ -1348,11 +1353,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
1348
1353
|
/**
|
1349
1354
|
* @hidden
|
1350
1355
|
*/
|
1351
|
-
class Messages extends ComponentMessages {
|
1356
|
+
class Messages$1 extends ComponentMessages {
|
1352
1357
|
}
|
1353
|
-
Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
1354
|
-
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: Messages, selector: "kendoConversationalUIMessages", inputs: { messagePlaceholder: "messagePlaceholder", send: "send", messageListLabel: "messageListLabel", messageBoxInputLabel: "messageBoxInputLabel", messageAttachmentLeftArrow: "messageAttachmentLeftArrow", messageAttachmentRightArrow: "messageAttachmentRightArrow", messageAvatarAlt: "messageAvatarAlt" }, usesInheritance: true, ngImport: i0 });
|
1355
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages, decorators: [{
|
1358
|
+
Messages$1.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages$1, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
1359
|
+
Messages$1.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: Messages$1, selector: "kendoConversationalUIMessages", inputs: { messagePlaceholder: "messagePlaceholder", send: "send", messageListLabel: "messageListLabel", messageBoxInputLabel: "messageBoxInputLabel", messageAttachmentLeftArrow: "messageAttachmentLeftArrow", messageAttachmentRightArrow: "messageAttachmentRightArrow", messageAvatarAlt: "messageAvatarAlt" }, usesInheritance: true, ngImport: i0 });
|
1360
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages$1, decorators: [{
|
1356
1361
|
type: Directive,
|
1357
1362
|
args: [{
|
1358
1363
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
@@ -1378,31 +1383,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
1378
1383
|
/**
|
1379
1384
|
* @hidden
|
1380
1385
|
*/
|
1381
|
-
class LocalizedMessagesDirective extends Messages {
|
1386
|
+
class LocalizedMessagesDirective$1 extends Messages$1 {
|
1382
1387
|
constructor(service) {
|
1383
1388
|
super();
|
1384
1389
|
this.service = service;
|
1385
1390
|
}
|
1386
1391
|
}
|
1387
|
-
LocalizedMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1$
|
1388
|
-
LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: LocalizedMessagesDirective, selector: "[kendoChatLocalizedMessages]", providers: [
|
1392
|
+
LocalizedMessagesDirective$1.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LocalizedMessagesDirective$1, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
1393
|
+
LocalizedMessagesDirective$1.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: LocalizedMessagesDirective$1, selector: "[kendoChatLocalizedMessages]", providers: [
|
1389
1394
|
{
|
1390
|
-
provide: Messages,
|
1391
|
-
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
1395
|
+
provide: Messages$1,
|
1396
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective$1)
|
1392
1397
|
}
|
1393
1398
|
], usesInheritance: true, ngImport: i0 });
|
1394
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
1399
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LocalizedMessagesDirective$1, decorators: [{
|
1395
1400
|
type: Directive,
|
1396
1401
|
args: [{
|
1397
1402
|
providers: [
|
1398
1403
|
{
|
1399
|
-
provide: Messages,
|
1400
|
-
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
1404
|
+
provide: Messages$1,
|
1405
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective$1)
|
1401
1406
|
}
|
1402
1407
|
],
|
1403
1408
|
selector: '[kendoChatLocalizedMessages]'
|
1404
1409
|
}]
|
1405
|
-
}], ctorParameters: function () { return [{ type: i1$
|
1410
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
1406
1411
|
|
1407
1412
|
// Consider scroll to be at the bottom when within this number of pixels from the container height.
|
1408
1413
|
const maxDelta = 2;
|
@@ -1569,7 +1574,7 @@ class ChatComponent {
|
|
1569
1574
|
return this.localization.get(key);
|
1570
1575
|
}
|
1571
1576
|
}
|
1572
|
-
ChatComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ChatComponent, deps: [{ token: i1$
|
1577
|
+
ChatComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ChatComponent, deps: [{ token: i1$1.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
1573
1578
|
ChatComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ChatComponent, selector: "kendo-chat", inputs: { messages: "messages", user: "user", messageBoxType: "messageBoxType" }, outputs: { sendMessage: "sendMessage", executeAction: "executeAction" }, host: { properties: { "class": "this.className", "attr.dir": "this.dirAttr" } }, providers: [
|
1574
1579
|
LocalizationService,
|
1575
1580
|
{
|
@@ -1633,7 +1638,7 @@ ChatComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version:
|
|
1633
1638
|
(sendMessage)="sendMessage.emit($event)"
|
1634
1639
|
>
|
1635
1640
|
</kendo-message-box>
|
1636
|
-
`, isInline: true, components: [{ type: MessageListComponent, selector: "kendo-chat-message-list", inputs: ["messages", "attachmentTemplate", "messageTemplate", "localization", "user"], outputs: ["executeAction", "navigate", "resize"] }, { type: MessageBoxComponent, selector: "kendo-message-box", inputs: ["user", "autoScroll", "type", "localization", "messageBoxTemplate"], outputs: ["sendMessage"] }], directives: [{ type: LocalizedMessagesDirective, selector: "[kendoChatLocalizedMessages]" }, { type: ScrollAnchorDirective, selector: "[kendoChatScrollAnchor]", inputs: ["autoScroll"], outputs: ["autoScrollChange"], exportAs: ["scrollAnchor"] }] });
|
1641
|
+
`, isInline: true, components: [{ type: MessageListComponent, selector: "kendo-chat-message-list", inputs: ["messages", "attachmentTemplate", "messageTemplate", "localization", "user"], outputs: ["executeAction", "navigate", "resize"] }, { type: MessageBoxComponent, selector: "kendo-message-box", inputs: ["user", "autoScroll", "type", "localization", "messageBoxTemplate"], outputs: ["sendMessage"] }], directives: [{ type: LocalizedMessagesDirective$1, selector: "[kendoChatLocalizedMessages]" }, { type: ScrollAnchorDirective, selector: "[kendoChatScrollAnchor]", inputs: ["autoScroll"], outputs: ["autoScrollChange"], exportAs: ["scrollAnchor"] }] });
|
1637
1642
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ChatComponent, decorators: [{
|
1638
1643
|
type: Component,
|
1639
1644
|
args: [{
|
@@ -1704,7 +1709,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
1704
1709
|
</kendo-message-box>
|
1705
1710
|
`
|
1706
1711
|
}]
|
1707
|
-
}], ctorParameters: function () { return [{ type: i1$
|
1712
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }, { type: i0.NgZone }]; }, propDecorators: { messages: [{
|
1708
1713
|
type: Input
|
1709
1714
|
}], user: [{
|
1710
1715
|
type: Input
|
@@ -1737,12 +1742,1220 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
1737
1742
|
args: ['messageList', { static: true }]
|
1738
1743
|
}] } });
|
1739
1744
|
|
1745
|
+
/**
|
1746
|
+
* @hidden
|
1747
|
+
*/
|
1748
|
+
const MY_TOKEN = new InjectionToken('COMMAND_TOKEN');
|
1749
|
+
/**
|
1750
|
+
* @hidden
|
1751
|
+
*/
|
1752
|
+
const DEFAULT_SVG_ICONS = {
|
1753
|
+
prompt: sparklesIcon,
|
1754
|
+
output: commentIcon,
|
1755
|
+
command: moreHorizontalIcon
|
1756
|
+
};
|
1757
|
+
/**
|
1758
|
+
* @hidden
|
1759
|
+
*/
|
1760
|
+
const DEFAULT_ICONS = {
|
1761
|
+
prompt: 'sparkles',
|
1762
|
+
output: 'comment',
|
1763
|
+
command: 'more-horizontal'
|
1764
|
+
};
|
1765
|
+
|
1766
|
+
/**
|
1767
|
+
* @hidden
|
1768
|
+
*/
|
1769
|
+
class BaseView {
|
1770
|
+
constructor(viewType, localization) {
|
1771
|
+
this.viewType = viewType;
|
1772
|
+
this.localization = localization;
|
1773
|
+
this.hostClasses = true;
|
1774
|
+
if (this.viewType !== 'custom') {
|
1775
|
+
this.icon = DEFAULT_ICONS[this.viewType];
|
1776
|
+
this.svgIcon = DEFAULT_SVG_ICONS[this.viewType];
|
1777
|
+
}
|
1778
|
+
}
|
1779
|
+
/**
|
1780
|
+
* The text of the ToolBar button corresponding to the view.
|
1781
|
+
*/
|
1782
|
+
set buttonText(value) {
|
1783
|
+
this._buttonText = value;
|
1784
|
+
}
|
1785
|
+
get buttonText() {
|
1786
|
+
return isPresent(this._buttonText) ?
|
1787
|
+
this._buttonText :
|
1788
|
+
this.messageFor(`${this.viewType}View`);
|
1789
|
+
}
|
1790
|
+
/**
|
1791
|
+
* The font icon of the ToolBar button corresponding to the view.
|
1792
|
+
*/
|
1793
|
+
set icon(value) {
|
1794
|
+
if (isPresent(value)) {
|
1795
|
+
this._icon = value;
|
1796
|
+
}
|
1797
|
+
else {
|
1798
|
+
this.icon = DEFAULT_ICONS[this.viewType];
|
1799
|
+
}
|
1800
|
+
}
|
1801
|
+
get icon() {
|
1802
|
+
return this._icon;
|
1803
|
+
}
|
1804
|
+
/**
|
1805
|
+
* The SVG icon of the ToolBar button corresponding to the view.
|
1806
|
+
*/
|
1807
|
+
set svgIcon(value) {
|
1808
|
+
if (isPresent(value)) {
|
1809
|
+
this._svgIcon = value;
|
1810
|
+
}
|
1811
|
+
else {
|
1812
|
+
this.svgIcon = DEFAULT_SVG_ICONS[this.viewType];
|
1813
|
+
}
|
1814
|
+
}
|
1815
|
+
get svgIcon() {
|
1816
|
+
return this._svgIcon;
|
1817
|
+
}
|
1818
|
+
/**
|
1819
|
+
* @hidden
|
1820
|
+
*/
|
1821
|
+
messageFor(text) {
|
1822
|
+
return this.localization.get(text);
|
1823
|
+
}
|
1824
|
+
}
|
1825
|
+
BaseView.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseView, deps: [{ token: MY_TOKEN }, { token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
1826
|
+
BaseView.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaseView, inputs: { buttonText: "buttonText", icon: "icon", svgIcon: "svgIcon" }, host: { properties: { "class.k-prompt-view": "this.hostClasses" } }, viewQueries: [{ propertyName: "template", first: true, predicate: ["content"], descendants: true, static: true }], ngImport: i0 });
|
1827
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseView, decorators: [{
|
1828
|
+
type: Directive
|
1829
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
1830
|
+
type: Inject,
|
1831
|
+
args: [MY_TOKEN]
|
1832
|
+
}] }, { type: i1$1.LocalizationService }]; }, propDecorators: { hostClasses: [{
|
1833
|
+
type: HostBinding,
|
1834
|
+
args: ['class.k-prompt-view']
|
1835
|
+
}], template: [{
|
1836
|
+
type: ViewChild,
|
1837
|
+
args: ['content', { static: true }]
|
1838
|
+
}], buttonText: [{
|
1839
|
+
type: Input
|
1840
|
+
}], icon: [{
|
1841
|
+
type: Input
|
1842
|
+
}], svgIcon: [{
|
1843
|
+
type: Input
|
1844
|
+
}] } });
|
1845
|
+
|
1846
|
+
/**
|
1847
|
+
* @hidden
|
1848
|
+
*/
|
1849
|
+
class AIPromptService {
|
1850
|
+
constructor() {
|
1851
|
+
this.promptValue = '';
|
1852
|
+
this.showOutputRating = false;
|
1853
|
+
this.requestEvent = new Subject();
|
1854
|
+
this.executeEvent = new Subject();
|
1855
|
+
this.outputCopyEvent = new Subject();
|
1856
|
+
this.outputRatingChangeEvent = new Subject();
|
1857
|
+
}
|
1858
|
+
getFlattenPromptCommands(commands = this.promptCommands) {
|
1859
|
+
let newArr = [];
|
1860
|
+
commands.forEach(c => {
|
1861
|
+
if (c.hasOwnProperty('children')) {
|
1862
|
+
const childrenArr = c.children;
|
1863
|
+
newArr = newArr.concat(childrenArr);
|
1864
|
+
if (childrenArr.length > 0) {
|
1865
|
+
this.getFlattenPromptCommands(childrenArr);
|
1866
|
+
}
|
1867
|
+
}
|
1868
|
+
});
|
1869
|
+
return newArr.concat(this.promptCommands);
|
1870
|
+
}
|
1871
|
+
}
|
1872
|
+
AIPromptService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
1873
|
+
AIPromptService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptService });
|
1874
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptService, decorators: [{
|
1875
|
+
type: Injectable
|
1876
|
+
}] });
|
1877
|
+
|
1878
|
+
/**
|
1879
|
+
* The component for rendering the **Prompt** view.
|
1880
|
+
*/
|
1881
|
+
class PromptViewComponent extends BaseView {
|
1882
|
+
constructor(localization, service) {
|
1883
|
+
super('prompt', localization);
|
1884
|
+
this.service = service;
|
1885
|
+
/**
|
1886
|
+
* @hidden
|
1887
|
+
*/
|
1888
|
+
this.showSuggestions = true;
|
1889
|
+
/**
|
1890
|
+
* @hidden
|
1891
|
+
*/
|
1892
|
+
this.contentId = `k-prompt-suggestions-${guid()}`;
|
1893
|
+
}
|
1894
|
+
/**
|
1895
|
+
* @hidden
|
1896
|
+
*/
|
1897
|
+
get suggestionsIcons() {
|
1898
|
+
return this.showSuggestions ?
|
1899
|
+
{ font: 'chevron-up', svg: chevronUpIcon } :
|
1900
|
+
{ font: 'chevron-down', svg: chevronDownIcon };
|
1901
|
+
}
|
1902
|
+
/**
|
1903
|
+
* @hidden
|
1904
|
+
*/
|
1905
|
+
get promptSuggestions() {
|
1906
|
+
return this.service.promptSuggestions;
|
1907
|
+
}
|
1908
|
+
/**
|
1909
|
+
*
|
1910
|
+
* @hidden
|
1911
|
+
*/
|
1912
|
+
set textAreaValue(value) {
|
1913
|
+
this.service.promptValue = value;
|
1914
|
+
}
|
1915
|
+
;
|
1916
|
+
get textAreaValue() {
|
1917
|
+
return this.service.promptValue;
|
1918
|
+
}
|
1919
|
+
/**
|
1920
|
+
* @hidden
|
1921
|
+
*/
|
1922
|
+
suggestionClick(suggestion) {
|
1923
|
+
this.textAreaValue = this.service.promptValue = suggestion;
|
1924
|
+
}
|
1925
|
+
}
|
1926
|
+
PromptViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PromptViewComponent, deps: [{ token: i1$1.LocalizationService }, { token: AIPromptService }], target: i0.ɵɵFactoryTarget.Component });
|
1927
|
+
PromptViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: PromptViewComponent, selector: "kendo-aiprompt-prompt-view", providers: [
|
1928
|
+
{
|
1929
|
+
provide: BaseView,
|
1930
|
+
useExisting: forwardRef(() => PromptViewComponent)
|
1931
|
+
}
|
1932
|
+
], usesInheritance: true, ngImport: i0, template: `
|
1933
|
+
<ng-template #content>
|
1934
|
+
<kendo-textarea
|
1935
|
+
[placeholder]="messageFor('promptPlaceholder')"
|
1936
|
+
[rows]="1"
|
1937
|
+
[(value)]="textAreaValue">
|
1938
|
+
</kendo-textarea>
|
1939
|
+
<div class="k-prompt-expander">
|
1940
|
+
<button kendoButton
|
1941
|
+
[attr.aria-controls]="contentId"
|
1942
|
+
[attr.aria-expanded]="showSuggestions"
|
1943
|
+
fillMode="flat"
|
1944
|
+
[icon]="suggestionsIcons.font"
|
1945
|
+
[svgIcon]="suggestionsIcons.svg"
|
1946
|
+
type="button"
|
1947
|
+
(click)="showSuggestions = !showSuggestions">
|
1948
|
+
{{messageFor('promptSuggestions')}}
|
1949
|
+
</button>
|
1950
|
+
<div *ngIf="showSuggestions"
|
1951
|
+
class="k-prompt-expander-content"
|
1952
|
+
role="list"
|
1953
|
+
[attr.id]="contentId">
|
1954
|
+
<div *ngFor="let suggestion of promptSuggestions"
|
1955
|
+
class="k-prompt-suggestion"
|
1956
|
+
role="listitem"
|
1957
|
+
(click)="suggestionClick(suggestion)">
|
1958
|
+
{{suggestion}}
|
1959
|
+
</div>
|
1960
|
+
</div>
|
1961
|
+
</div>
|
1962
|
+
</ng-template>
|
1963
|
+
`, isInline: true, components: [{ type: i3.TextAreaComponent, selector: "kendo-textarea", inputs: ["focusableId", "flow", "adornmentsOrientation", "rows", "cols", "maxlength", "tabindex", "tabIndex", "resizable", "size", "rounded", "fillMode", "showPrefixSeparator", "showSuffixSeparator"], outputs: ["focus", "blur", "valueChange"], exportAs: ["kendoTextArea"] }, { 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: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
1964
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PromptViewComponent, decorators: [{
|
1965
|
+
type: Component,
|
1966
|
+
args: [{
|
1967
|
+
selector: 'kendo-aiprompt-prompt-view',
|
1968
|
+
providers: [
|
1969
|
+
{
|
1970
|
+
provide: BaseView,
|
1971
|
+
useExisting: forwardRef(() => PromptViewComponent)
|
1972
|
+
}
|
1973
|
+
],
|
1974
|
+
template: `
|
1975
|
+
<ng-template #content>
|
1976
|
+
<kendo-textarea
|
1977
|
+
[placeholder]="messageFor('promptPlaceholder')"
|
1978
|
+
[rows]="1"
|
1979
|
+
[(value)]="textAreaValue">
|
1980
|
+
</kendo-textarea>
|
1981
|
+
<div class="k-prompt-expander">
|
1982
|
+
<button kendoButton
|
1983
|
+
[attr.aria-controls]="contentId"
|
1984
|
+
[attr.aria-expanded]="showSuggestions"
|
1985
|
+
fillMode="flat"
|
1986
|
+
[icon]="suggestionsIcons.font"
|
1987
|
+
[svgIcon]="suggestionsIcons.svg"
|
1988
|
+
type="button"
|
1989
|
+
(click)="showSuggestions = !showSuggestions">
|
1990
|
+
{{messageFor('promptSuggestions')}}
|
1991
|
+
</button>
|
1992
|
+
<div *ngIf="showSuggestions"
|
1993
|
+
class="k-prompt-expander-content"
|
1994
|
+
role="list"
|
1995
|
+
[attr.id]="contentId">
|
1996
|
+
<div *ngFor="let suggestion of promptSuggestions"
|
1997
|
+
class="k-prompt-suggestion"
|
1998
|
+
role="listitem"
|
1999
|
+
(click)="suggestionClick(suggestion)">
|
2000
|
+
{{suggestion}}
|
2001
|
+
</div>
|
2002
|
+
</div>
|
2003
|
+
</div>
|
2004
|
+
</ng-template>
|
2005
|
+
`
|
2006
|
+
}]
|
2007
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }, { type: AIPromptService }]; } });
|
2008
|
+
|
2009
|
+
/**
|
2010
|
+
* @hidden
|
2011
|
+
*/
|
2012
|
+
class AIPromptOutputCardComponent {
|
2013
|
+
constructor(localization, service) {
|
2014
|
+
this.localization = localization;
|
2015
|
+
this.service = service;
|
2016
|
+
this.hostClass = true;
|
2017
|
+
this.listItemRole = 'listitem';
|
2018
|
+
this.tabIndex = 0;
|
2019
|
+
this.ariaKeyShortcuts = 'Enter';
|
2020
|
+
this.copyIcon = copyIcon;
|
2021
|
+
this.retryIcon = arrowRotateCwIcon;
|
2022
|
+
this.positiveRatingIcon = thumbUpOutlineIcon;
|
2023
|
+
this.negativeRatingIcon = thumbDownOutlineIcon;
|
2024
|
+
this.titleId = `k-output-card-${guid()}`;
|
2025
|
+
}
|
2026
|
+
get ariaDescribedBy() {
|
2027
|
+
return this.titleId;
|
2028
|
+
}
|
2029
|
+
messageFor(text) {
|
2030
|
+
return this.localization.get(text);
|
2031
|
+
}
|
2032
|
+
get showRating() {
|
2033
|
+
return this.service.showOutputRating;
|
2034
|
+
}
|
2035
|
+
get outputTitle() {
|
2036
|
+
if (isPresent(this.promptOutput.title)) {
|
2037
|
+
return this.promptOutput.title;
|
2038
|
+
}
|
2039
|
+
else {
|
2040
|
+
const titleMessage = this.promptOutput.isRetry ? 'outputRetryTitle' : 'outputTitle';
|
2041
|
+
return this.messageFor(titleMessage);
|
2042
|
+
}
|
2043
|
+
}
|
2044
|
+
handleRetry() {
|
2045
|
+
if (this.promptOutput.commandId) {
|
2046
|
+
const eventArgs = {
|
2047
|
+
command: this.service.getFlattenPromptCommands().find(c => c.id === this.promptOutput.commandId),
|
2048
|
+
sender: this.service.aiPrompt,
|
2049
|
+
isRetry: true
|
2050
|
+
};
|
2051
|
+
this.service.executeEvent.next(eventArgs);
|
2052
|
+
}
|
2053
|
+
else {
|
2054
|
+
const eventArgs = {
|
2055
|
+
prompt: this.promptOutput.prompt,
|
2056
|
+
sender: this.service.aiPrompt,
|
2057
|
+
isRetry: true
|
2058
|
+
};
|
2059
|
+
this.service.requestEvent.next(eventArgs);
|
2060
|
+
}
|
2061
|
+
}
|
2062
|
+
handleCopy() {
|
2063
|
+
navigator.clipboard.writeText(this.promptOutput.output);
|
2064
|
+
this.service.outputCopyEvent.next(this.promptOutput);
|
2065
|
+
}
|
2066
|
+
handleRating(ratingType) {
|
2067
|
+
const eventArgs = {
|
2068
|
+
promptOutput: this.promptOutput,
|
2069
|
+
rating: ratingType
|
2070
|
+
};
|
2071
|
+
this.service.outputRatingChangeEvent.next(eventArgs);
|
2072
|
+
if (ratingType === 'positive') {
|
2073
|
+
this.positiveRatingIcon = thumbUpIcon;
|
2074
|
+
this.negativeRatingIcon = thumbDownOutlineIcon;
|
2075
|
+
}
|
2076
|
+
else {
|
2077
|
+
this.negativeRatingIcon = thumbDownIcon;
|
2078
|
+
this.positiveRatingIcon = thumbUpOutlineIcon;
|
2079
|
+
}
|
2080
|
+
}
|
2081
|
+
}
|
2082
|
+
AIPromptOutputCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptOutputCardComponent, deps: [{ token: i1$1.LocalizationService }, { token: AIPromptService }], target: i0.ɵɵFactoryTarget.Component });
|
2083
|
+
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: `
|
2084
|
+
<div class="k-card-header">
|
2085
|
+
<div
|
2086
|
+
class="k-card-title"
|
2087
|
+
[attr.id]="titleId">{{outputTitle}}
|
2088
|
+
</div>
|
2089
|
+
<div class="k-card-subtitle">{{promptOutput.prompt}}</div>
|
2090
|
+
</div>
|
2091
|
+
<div class="k-card-body">
|
2092
|
+
<p>{{promptOutput.output}}</p>
|
2093
|
+
</div>
|
2094
|
+
<div class="k-actions k-actions-start k-actions-horizontal k-card-actions">
|
2095
|
+
<button kendoButton
|
2096
|
+
fillMode="flat"
|
2097
|
+
themeColor="primary"
|
2098
|
+
rounded="full"
|
2099
|
+
icon="copy"
|
2100
|
+
[svgIcon]="copyIcon"
|
2101
|
+
(click)="handleCopy()"
|
2102
|
+
>{{messageFor('copyOutput')}}</button>
|
2103
|
+
<button kendoButton
|
2104
|
+
fillMode="flat"
|
2105
|
+
rounded="full"
|
2106
|
+
icon="arrow-rotate-cw"
|
2107
|
+
[svgIcon]="retryIcon"
|
2108
|
+
(click)="handleRetry()"
|
2109
|
+
>{{messageFor('retryGeneration')}}</button>
|
2110
|
+
<ng-container *ngIf="showRating">
|
2111
|
+
<span class="k-spacer"></span>
|
2112
|
+
<button kendoButton
|
2113
|
+
fillMode="flat"
|
2114
|
+
icon="thumb-up-outline"
|
2115
|
+
[svgIcon]="positiveRatingIcon"
|
2116
|
+
(click)="handleRating('positive')">
|
2117
|
+
</button>
|
2118
|
+
<button kendoButton
|
2119
|
+
fillMode="flat"
|
2120
|
+
icon="thumb-down-outline"
|
2121
|
+
[svgIcon]="negativeRatingIcon"
|
2122
|
+
(click)="handleRating('negative')">
|
2123
|
+
</button>
|
2124
|
+
</ng-container>
|
2125
|
+
</div>
|
2126
|
+
`, 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: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
2127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptOutputCardComponent, decorators: [{
|
2128
|
+
type: Component,
|
2129
|
+
args: [{
|
2130
|
+
selector: '[kendoAIPromptOutputCard]',
|
2131
|
+
template: `
|
2132
|
+
<div class="k-card-header">
|
2133
|
+
<div
|
2134
|
+
class="k-card-title"
|
2135
|
+
[attr.id]="titleId">{{outputTitle}}
|
2136
|
+
</div>
|
2137
|
+
<div class="k-card-subtitle">{{promptOutput.prompt}}</div>
|
2138
|
+
</div>
|
2139
|
+
<div class="k-card-body">
|
2140
|
+
<p>{{promptOutput.output}}</p>
|
2141
|
+
</div>
|
2142
|
+
<div class="k-actions k-actions-start k-actions-horizontal k-card-actions">
|
2143
|
+
<button kendoButton
|
2144
|
+
fillMode="flat"
|
2145
|
+
themeColor="primary"
|
2146
|
+
rounded="full"
|
2147
|
+
icon="copy"
|
2148
|
+
[svgIcon]="copyIcon"
|
2149
|
+
(click)="handleCopy()"
|
2150
|
+
>{{messageFor('copyOutput')}}</button>
|
2151
|
+
<button kendoButton
|
2152
|
+
fillMode="flat"
|
2153
|
+
rounded="full"
|
2154
|
+
icon="arrow-rotate-cw"
|
2155
|
+
[svgIcon]="retryIcon"
|
2156
|
+
(click)="handleRetry()"
|
2157
|
+
>{{messageFor('retryGeneration')}}</button>
|
2158
|
+
<ng-container *ngIf="showRating">
|
2159
|
+
<span class="k-spacer"></span>
|
2160
|
+
<button kendoButton
|
2161
|
+
fillMode="flat"
|
2162
|
+
icon="thumb-up-outline"
|
2163
|
+
[svgIcon]="positiveRatingIcon"
|
2164
|
+
(click)="handleRating('positive')">
|
2165
|
+
</button>
|
2166
|
+
<button kendoButton
|
2167
|
+
fillMode="flat"
|
2168
|
+
icon="thumb-down-outline"
|
2169
|
+
[svgIcon]="negativeRatingIcon"
|
2170
|
+
(click)="handleRating('negative')">
|
2171
|
+
</button>
|
2172
|
+
</ng-container>
|
2173
|
+
</div>
|
2174
|
+
`
|
2175
|
+
}]
|
2176
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }, { type: AIPromptService }]; }, propDecorators: { hostClass: [{
|
2177
|
+
type: HostBinding,
|
2178
|
+
args: ['class.k-card']
|
2179
|
+
}], listItemRole: [{
|
2180
|
+
type: HostBinding,
|
2181
|
+
args: ['attr.role']
|
2182
|
+
}], tabIndex: [{
|
2183
|
+
type: HostBinding,
|
2184
|
+
args: ['attr.tabindex']
|
2185
|
+
}], ariaDescribedBy: [{
|
2186
|
+
type: HostBinding,
|
2187
|
+
args: ['attr.aria-describedby']
|
2188
|
+
}], ariaKeyShortcuts: [{
|
2189
|
+
type: HostBinding,
|
2190
|
+
args: ['attr.aria-keyshortcuts']
|
2191
|
+
}], promptOutput: [{
|
2192
|
+
type: Input
|
2193
|
+
}] } });
|
2194
|
+
|
2195
|
+
/**
|
2196
|
+
* The component for rendering the **Output** view.
|
2197
|
+
*/
|
2198
|
+
class OutputViewComponent extends BaseView {
|
2199
|
+
constructor(localization, service) {
|
2200
|
+
super('output', localization);
|
2201
|
+
this.service = service;
|
2202
|
+
}
|
2203
|
+
/**
|
2204
|
+
* @hidden
|
2205
|
+
*/
|
2206
|
+
get promptOutputs() {
|
2207
|
+
return this.service.promptOutputs;
|
2208
|
+
}
|
2209
|
+
}
|
2210
|
+
OutputViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: OutputViewComponent, deps: [{ token: i1$1.LocalizationService }, { token: AIPromptService }], target: i0.ɵɵFactoryTarget.Component });
|
2211
|
+
OutputViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: OutputViewComponent, selector: "kendo-aiprompt-output-view", providers: [{
|
2212
|
+
provide: BaseView,
|
2213
|
+
useExisting: forwardRef(() => OutputViewComponent)
|
2214
|
+
}], usesInheritance: true, ngImport: i0, template: `
|
2215
|
+
<ng-template #content>
|
2216
|
+
<div
|
2217
|
+
class="k-card-list"
|
2218
|
+
role="list">
|
2219
|
+
<div *ngFor="let output of promptOutputs"
|
2220
|
+
kendoAIPromptOutputCard
|
2221
|
+
[promptOutput]="output">
|
2222
|
+
</div>
|
2223
|
+
</div>
|
2224
|
+
</ng-template>
|
2225
|
+
`, isInline: true, components: [{ type: AIPromptOutputCardComponent, selector: "[kendoAIPromptOutputCard]", inputs: ["promptOutput"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
2226
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: OutputViewComponent, decorators: [{
|
2227
|
+
type: Component,
|
2228
|
+
args: [{
|
2229
|
+
selector: 'kendo-aiprompt-output-view',
|
2230
|
+
providers: [{
|
2231
|
+
provide: BaseView,
|
2232
|
+
useExisting: forwardRef(() => OutputViewComponent)
|
2233
|
+
}],
|
2234
|
+
template: `
|
2235
|
+
<ng-template #content>
|
2236
|
+
<div
|
2237
|
+
class="k-card-list"
|
2238
|
+
role="list">
|
2239
|
+
<div *ngFor="let output of promptOutputs"
|
2240
|
+
kendoAIPromptOutputCard
|
2241
|
+
[promptOutput]="output">
|
2242
|
+
</div>
|
2243
|
+
</div>
|
2244
|
+
</ng-template>
|
2245
|
+
`
|
2246
|
+
}]
|
2247
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }, { type: AIPromptService }]; } });
|
2248
|
+
|
2249
|
+
/**
|
2250
|
+
* Represents a template that allows you to define additional ToolBar actions.
|
2251
|
+
* The actions will be rendered right after all views' ToolBar buttons.
|
2252
|
+
* To define the template, nest an `<ng-template>` tag
|
2253
|
+
* with the `kendoAIPromptToolbarActionsTemplate` directive inside the `<kendo-aiprompt>` tag.
|
2254
|
+
*/
|
2255
|
+
class AIPromptToolbarActionsDirective {
|
2256
|
+
constructor(templateRef) {
|
2257
|
+
this.templateRef = templateRef;
|
2258
|
+
}
|
2259
|
+
}
|
2260
|
+
AIPromptToolbarActionsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptToolbarActionsDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
2261
|
+
AIPromptToolbarActionsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: AIPromptToolbarActionsDirective, selector: "[kendoAIPromptToolbarActionsTemplate]", ngImport: i0 });
|
2262
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptToolbarActionsDirective, decorators: [{
|
2263
|
+
type: Directive,
|
2264
|
+
args: [{
|
2265
|
+
selector: '[kendoAIPromptToolbarActionsTemplate]'
|
2266
|
+
}]
|
2267
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
2268
|
+
type: Optional
|
2269
|
+
}] }]; } });
|
2270
|
+
|
2271
|
+
/**
|
2272
|
+
* @hidden
|
2273
|
+
*/
|
2274
|
+
class ToolbarNavigationService {
|
2275
|
+
constructor(localizationService) {
|
2276
|
+
this.localizationService = localizationService;
|
2277
|
+
this.focusableElements = [];
|
2278
|
+
this.currentFocusedIndex = 0;
|
2279
|
+
}
|
2280
|
+
register(tool) {
|
2281
|
+
if (!this.focusableElements.some(el => el === tool)) {
|
2282
|
+
this.focusableElements.push(tool);
|
2283
|
+
}
|
2284
|
+
}
|
2285
|
+
unregister(tool) {
|
2286
|
+
this.currentFocusedIndex = 0;
|
2287
|
+
this.focusableElements = this.focusableElements.filter(el => el !== tool);
|
2288
|
+
}
|
2289
|
+
isActive(focusable) {
|
2290
|
+
return this.focusableElements[this.currentFocusedIndex] === focusable;
|
2291
|
+
}
|
2292
|
+
setActiveIndex(tool) {
|
2293
|
+
this.currentFocusedIndex = Math.max(this.focusableElements.indexOf(tool), 0);
|
2294
|
+
}
|
2295
|
+
move(direction) {
|
2296
|
+
let delta = direction === 'right' ? 1 : -1;
|
2297
|
+
if (this.localizationService.rtl) {
|
2298
|
+
delta = -delta;
|
2299
|
+
}
|
2300
|
+
this.currentFocusedIndex += delta;
|
2301
|
+
if (this.currentFocusedIndex < 0) {
|
2302
|
+
this.currentFocusedIndex = this.focusableElements.length - 1;
|
2303
|
+
}
|
2304
|
+
else if (this.currentFocusedIndex >= this.focusableElements.length) {
|
2305
|
+
this.currentFocusedIndex = 0;
|
2306
|
+
}
|
2307
|
+
this.focusableElements[this.currentFocusedIndex].activate();
|
2308
|
+
}
|
2309
|
+
focusFirst() {
|
2310
|
+
this.focusableElements[this.currentFocusedIndex].activate();
|
2311
|
+
}
|
2312
|
+
}
|
2313
|
+
ToolbarNavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarNavigationService, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
2314
|
+
ToolbarNavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarNavigationService });
|
2315
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarNavigationService, decorators: [{
|
2316
|
+
type: Injectable
|
2317
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
2318
|
+
|
2319
|
+
/**
|
2320
|
+
* @hidden
|
2321
|
+
*/
|
2322
|
+
class Messages extends ComponentMessages {
|
2323
|
+
}
|
2324
|
+
Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
2325
|
+
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: Messages, inputs: { promptView: "promptView", outputView: "outputView", generateOutput: "generateOutput", promptPlaceholder: "promptPlaceholder", copyOutput: "copyOutput", retryGeneration: "retryGeneration", outputTitle: "outputTitle", outputRetryTitle: "outputRetryTitle", promptSuggestions: "promptSuggestions" }, usesInheritance: true, ngImport: i0 });
|
2326
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages, decorators: [{
|
2327
|
+
type: Directive
|
2328
|
+
}], propDecorators: { promptView: [{
|
2329
|
+
type: Input
|
2330
|
+
}], outputView: [{
|
2331
|
+
type: Input
|
2332
|
+
}], generateOutput: [{
|
2333
|
+
type: Input
|
2334
|
+
}], promptPlaceholder: [{
|
2335
|
+
type: Input
|
2336
|
+
}], copyOutput: [{
|
2337
|
+
type: Input
|
2338
|
+
}], retryGeneration: [{
|
2339
|
+
type: Input
|
2340
|
+
}], outputTitle: [{
|
2341
|
+
type: Input
|
2342
|
+
}], outputRetryTitle: [{
|
2343
|
+
type: Input
|
2344
|
+
}], promptSuggestions: [{
|
2345
|
+
type: Input
|
2346
|
+
}] } });
|
2347
|
+
|
2348
|
+
/**
|
2349
|
+
* @hidden
|
2350
|
+
*/
|
2351
|
+
class LocalizedMessagesDirective extends Messages {
|
2352
|
+
constructor(service) {
|
2353
|
+
super();
|
2354
|
+
this.service = service;
|
2355
|
+
}
|
2356
|
+
}
|
2357
|
+
LocalizedMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
2358
|
+
LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: LocalizedMessagesDirective, selector: "[kendoAIPromptLocalizedMessages]", providers: [
|
2359
|
+
{
|
2360
|
+
provide: Messages,
|
2361
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
2362
|
+
}
|
2363
|
+
], usesInheritance: true, ngImport: i0 });
|
2364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
2365
|
+
type: Directive,
|
2366
|
+
args: [{
|
2367
|
+
providers: [
|
2368
|
+
{
|
2369
|
+
provide: Messages,
|
2370
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
2371
|
+
}
|
2372
|
+
],
|
2373
|
+
selector: '[kendoAIPromptLocalizedMessages]'
|
2374
|
+
}]
|
2375
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
2376
|
+
|
2377
|
+
/**
|
2378
|
+
* @hidden
|
2379
|
+
*/
|
2380
|
+
class AIPromptToolbarFocusableDirective {
|
2381
|
+
constructor(host, navigationService, renderer) {
|
2382
|
+
this.host = host;
|
2383
|
+
this.navigationService = navigationService;
|
2384
|
+
this.renderer = renderer;
|
2385
|
+
this.keyDownHandler = (e) => {
|
2386
|
+
const targetsSelf = e.target === this.element;
|
2387
|
+
const isLeftArrow = e.keyCode === Keys.ArrowLeft;
|
2388
|
+
const isRightArrow = e.keyCode === Keys.ArrowRight;
|
2389
|
+
const isArrow = isLeftArrow || isRightArrow;
|
2390
|
+
if (!targetsSelf || !isArrow) {
|
2391
|
+
return;
|
2392
|
+
}
|
2393
|
+
this.renderer.setAttribute(this.element, 'tabindex', '-1');
|
2394
|
+
this.element.querySelectorAll(focusableSelector).forEach(el => {
|
2395
|
+
this.renderer.setAttribute(el, 'tabindex', '-1');
|
2396
|
+
});
|
2397
|
+
if (isRightArrow) {
|
2398
|
+
this.navigationService.move('right');
|
2399
|
+
}
|
2400
|
+
else if (isLeftArrow) {
|
2401
|
+
this.navigationService.move('left');
|
2402
|
+
}
|
2403
|
+
};
|
2404
|
+
this.clickHandler = () => {
|
2405
|
+
this.navigationService.setActiveIndex(this);
|
2406
|
+
};
|
2407
|
+
navigationService.register(this);
|
2408
|
+
}
|
2409
|
+
get element() {
|
2410
|
+
return this.host.nativeElement;
|
2411
|
+
}
|
2412
|
+
ngAfterViewInit() {
|
2413
|
+
this.renderer.setAttribute(this.element, 'tabindex', this.navigationService.isActive(this) ? '0' : '-1');
|
2414
|
+
this.element.addEventListener('keydown', this.keyDownHandler, { capture: true });
|
2415
|
+
this.element.addEventListener('click', this.clickHandler, { capture: true });
|
2416
|
+
}
|
2417
|
+
ngOnDestroy() {
|
2418
|
+
this.navigationService.unregister(this);
|
2419
|
+
this.element.removeEventListener('keydown', this.keyDownHandler, { capture: true });
|
2420
|
+
this.element.removeEventListener('click', this.clickHandler, { capture: true });
|
2421
|
+
}
|
2422
|
+
activate() {
|
2423
|
+
this.renderer.setAttribute(this.element, 'tabindex', '0');
|
2424
|
+
this.element.focus();
|
2425
|
+
}
|
2426
|
+
}
|
2427
|
+
AIPromptToolbarFocusableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptToolbarFocusableDirective, deps: [{ token: i0.ElementRef }, { token: ToolbarNavigationService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
2428
|
+
AIPromptToolbarFocusableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: AIPromptToolbarFocusableDirective, selector: "[kendoAIPromptToolbarFocusable]", ngImport: i0 });
|
2429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptToolbarFocusableDirective, decorators: [{
|
2430
|
+
type: Directive,
|
2431
|
+
args: [{
|
2432
|
+
selector: '[kendoAIPromptToolbarFocusable]'
|
2433
|
+
}]
|
2434
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ToolbarNavigationService }, { type: i0.Renderer2 }]; } });
|
2435
|
+
|
2436
|
+
/**
|
2437
|
+
* Represents the Kendo UI AIPrompt component for Angular
|
2438
|
+
*/
|
2439
|
+
class AIPromptComponent {
|
2440
|
+
constructor(localization, service, navigationService, ngZone) {
|
2441
|
+
this.localization = localization;
|
2442
|
+
this.service = service;
|
2443
|
+
this.navigationService = navigationService;
|
2444
|
+
this.ngZone = ngZone;
|
2445
|
+
this.hostClasses = true;
|
2446
|
+
/**
|
2447
|
+
* The active view index of the AIPrompt component.
|
2448
|
+
*/
|
2449
|
+
this.activeView = 0;
|
2450
|
+
/**
|
2451
|
+
* Fires when the `activeView` property of the component is updated.
|
2452
|
+
* Used to provide a two-way binding for the `activeView` property.
|
2453
|
+
*/
|
2454
|
+
this.activeViewChange = new EventEmitter();
|
2455
|
+
/**
|
2456
|
+
* Fires each time the user clicks the Prompt view Generate button or the Output view Retry button.
|
2457
|
+
* To distinguish the source element, use the event's `isRetry` field.
|
2458
|
+
*/
|
2459
|
+
this.promptRequest = new EventEmitter();
|
2460
|
+
/**
|
2461
|
+
* Fires each time the user clicks a Command view command. Exposes the selected command as event data.
|
2462
|
+
*/
|
2463
|
+
this.commandExecute = new EventEmitter();
|
2464
|
+
/**
|
2465
|
+
* Fires each time the user clicks any Output view Copy button.
|
2466
|
+
*/
|
2467
|
+
this.outputCopy = new EventEmitter();
|
2468
|
+
/**
|
2469
|
+
* Fires each time the user clicks a rating button in any Output view card.
|
2470
|
+
*/
|
2471
|
+
this.outputRatingChange = new EventEmitter();
|
2472
|
+
this.subs = new Subscription();
|
2473
|
+
/**
|
2474
|
+
* @hidden
|
2475
|
+
*/
|
2476
|
+
this.sparklesIcon = sparklesIcon;
|
2477
|
+
/**
|
2478
|
+
* @hidden
|
2479
|
+
*/
|
2480
|
+
this.outputIcon = commentIcon;
|
2481
|
+
validatePackage(packageMetadata);
|
2482
|
+
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
2483
|
+
this.subs.add(localization.changes.subscribe(({ rtl }) => {
|
2484
|
+
this.direction = rtl ? 'rtl' : 'ltr';
|
2485
|
+
}));
|
2486
|
+
}
|
2487
|
+
get dirAttr() {
|
2488
|
+
return this.direction;
|
2489
|
+
}
|
2490
|
+
/**
|
2491
|
+
* The collection of commands that will be rendered in the Command view.
|
2492
|
+
*/
|
2493
|
+
set promptCommands(value) {
|
2494
|
+
this.service.promptCommands = value;
|
2495
|
+
}
|
2496
|
+
/**
|
2497
|
+
* The collection of suggestions that will be rendered in the Prompt view.
|
2498
|
+
*/
|
2499
|
+
set promptSuggestions(value) {
|
2500
|
+
this.service.promptSuggestions = value;
|
2501
|
+
}
|
2502
|
+
/**
|
2503
|
+
* The collection of generated prompt outputs that will be rendered in the Output view.
|
2504
|
+
*/
|
2505
|
+
set promptOutputs(value) {
|
2506
|
+
this.service.promptOutputs = value;
|
2507
|
+
}
|
2508
|
+
/**
|
2509
|
+
* Specifies if the rating buttons in each Output view card will be rendered.
|
2510
|
+
* By default, rating buttons are not rendered.
|
2511
|
+
*
|
2512
|
+
* @default false
|
2513
|
+
*/
|
2514
|
+
set showOutputRating(value) {
|
2515
|
+
this.service.showOutputRating = value;
|
2516
|
+
}
|
2517
|
+
ngAfterViewInit() {
|
2518
|
+
this.ngZone.runOutsideAngular(() => {
|
2519
|
+
this.service.aiPrompt = this;
|
2520
|
+
this.subs.add(this.service.requestEvent.subscribe(ev => this.promptRequest.emit(ev)));
|
2521
|
+
this.subs.add(this.service.executeEvent.subscribe(ev => this.commandExecute.emit(ev)));
|
2522
|
+
this.subs.add(this.service.outputCopyEvent.subscribe(ev => this.outputCopy.emit(ev)));
|
2523
|
+
this.subs.add(this.service.outputRatingChangeEvent.subscribe(ev => this.outputRatingChange.emit(ev)));
|
2524
|
+
});
|
2525
|
+
}
|
2526
|
+
ngOnDestroy() {
|
2527
|
+
this.subs.unsubscribe();
|
2528
|
+
}
|
2529
|
+
/**
|
2530
|
+
* Focuses the first focusable element in the AI Prompt.
|
2531
|
+
*/
|
2532
|
+
focus() {
|
2533
|
+
this.navigationService.focusFirst();
|
2534
|
+
}
|
2535
|
+
/**
|
2536
|
+
* @hidden
|
2537
|
+
*/
|
2538
|
+
get selectedView() {
|
2539
|
+
return this.viewsArray[this.activeView];
|
2540
|
+
}
|
2541
|
+
/**
|
2542
|
+
* @hidden
|
2543
|
+
*/
|
2544
|
+
get viewsArray() {
|
2545
|
+
return this.views?.toArray();
|
2546
|
+
}
|
2547
|
+
/**
|
2548
|
+
* @hidden
|
2549
|
+
*/
|
2550
|
+
viewChange(idx) {
|
2551
|
+
if (idx !== this.activeView) {
|
2552
|
+
this.activeView = idx;
|
2553
|
+
this.activeViewChange.emit(idx);
|
2554
|
+
}
|
2555
|
+
}
|
2556
|
+
/**
|
2557
|
+
* @hidden
|
2558
|
+
*/
|
2559
|
+
messageFor(text) {
|
2560
|
+
return this.localization.get(text);
|
2561
|
+
}
|
2562
|
+
/**
|
2563
|
+
* @hidden
|
2564
|
+
*/
|
2565
|
+
get viewTemplate() {
|
2566
|
+
return this.selectedView.viewType === 'custom' ? this.selectedView?.viewTemplate : this.selectedView?.template;
|
2567
|
+
}
|
2568
|
+
/**
|
2569
|
+
* @hidden
|
2570
|
+
*/
|
2571
|
+
handleGenerateOutput() {
|
2572
|
+
const value = this.service.promptValue;
|
2573
|
+
const eventArgs = {
|
2574
|
+
prompt: value,
|
2575
|
+
sender: this,
|
2576
|
+
isRetry: false
|
2577
|
+
};
|
2578
|
+
this.promptRequest.emit(eventArgs);
|
2579
|
+
}
|
2580
|
+
}
|
2581
|
+
AIPromptComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptComponent, deps: [{ token: i1$1.LocalizationService }, { token: AIPromptService }, { token: ToolbarNavigationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
2582
|
+
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: [
|
2583
|
+
LocalizationService,
|
2584
|
+
AIPromptService,
|
2585
|
+
ToolbarNavigationService,
|
2586
|
+
{
|
2587
|
+
provide: L10N_PREFIX,
|
2588
|
+
useValue: 'kendo.aiprompt'
|
2589
|
+
}
|
2590
|
+
], queries: [{ propertyName: "toolbarActionsTemplate", first: true, predicate: AIPromptToolbarActionsDirective, descendants: true }, { propertyName: "views", predicate: BaseView }], exportAs: ["kendoAIPrompt"], ngImport: i0, template: `
|
2591
|
+
<ng-container kendoAIPromptLocalizedMessages
|
2592
|
+
i18n-promptView="kendo.aiprompt.promptView|The Toolbar button text for the Prompt view."
|
2593
|
+
promptView="Ask AI"
|
2594
|
+
i18n-outputView="kendo.aiprompt.outputView|The Toolbar button text for the Output view."
|
2595
|
+
outputView="Output"
|
2596
|
+
i18n-generateOutput="kendo.aiprompt.generateOutput|The text for the Generate button in the Prompt view."
|
2597
|
+
generateOutput="Generate"
|
2598
|
+
i18n-promptPlaceholder="kendo.aiprompt.promptPlaceholder|The placeholder text for the Prompt view textarea."
|
2599
|
+
promptPlaceholder="Ask or generate content with AI"
|
2600
|
+
i18n-copyOutput="kendo.aiprompt.copyOutput|The Copy button text in each Output view card."
|
2601
|
+
copyOutput="Copy"
|
2602
|
+
i18n-retryGeneration="kendo.aiprompt.retryGeneration|The Retry button text in each Output view card."
|
2603
|
+
retryGeneration="Retry"
|
2604
|
+
i18n-outputTitle="kendo.aiprompt.outputTitle|The title of each Output view card."
|
2605
|
+
outputTitle="Generated with AI"
|
2606
|
+
i18n-outputRetryTitle="kendo.aiprompt.outputRetryTitle|The title of each Output view retry card."
|
2607
|
+
outputRetryTitle="Generated with AI"
|
2608
|
+
i18n-promptSuggestions="kendo.aiprompt.promptSuggestions|The title of the Prompt suggestions button."
|
2609
|
+
promptSuggestions="Prompt suggestions">
|
2610
|
+
</ng-container>
|
2611
|
+
<div class="k-prompt-header">
|
2612
|
+
<div class="k-toolbar-flat k-toolbar k-toolbar-md"
|
2613
|
+
role="toolbar">
|
2614
|
+
<button *ngFor="let view of viewsArray; let idx = index"
|
2615
|
+
kendoButton
|
2616
|
+
kendoAIPromptToolbarFocusable
|
2617
|
+
type="button"
|
2618
|
+
fillMode="flat"
|
2619
|
+
rounded="full"
|
2620
|
+
themeColor="primary"
|
2621
|
+
[svgIcon]="view.svgIcon"
|
2622
|
+
[icon]="view.icon"
|
2623
|
+
[selected]="idx === activeView"
|
2624
|
+
(click)="viewChange(idx)">
|
2625
|
+
{{view.buttonText}}
|
2626
|
+
</button>
|
2627
|
+
|
2628
|
+
<ng-template *ngIf="toolbarActionsTemplate"
|
2629
|
+
[ngTemplateOutlet]="toolbarActionsTemplate?.templateRef">
|
2630
|
+
</ng-template>
|
2631
|
+
</div>
|
2632
|
+
</div>
|
2633
|
+
<div class="k-prompt-content">
|
2634
|
+
<div class="k-prompt-view">
|
2635
|
+
<ng-container *ngTemplateOutlet="viewTemplate">
|
2636
|
+
</ng-container>
|
2637
|
+
</div>
|
2638
|
+
</div>
|
2639
|
+
<div class="k-prompt-footer" *ngIf="selectedView.viewType === 'prompt'">
|
2640
|
+
<div class="k-actions k-actions-start k-actions-horizontal k-prompt-actions">
|
2641
|
+
<button
|
2642
|
+
kendoButton
|
2643
|
+
type="button"
|
2644
|
+
themeColor="primary"
|
2645
|
+
rounded="full"
|
2646
|
+
[svgIcon]="sparklesIcon"
|
2647
|
+
icon="sparkles"
|
2648
|
+
(click)="handleGenerateOutput()">{{messageFor('generateOutput')}}</button>
|
2649
|
+
</div>
|
2650
|
+
</div>
|
2651
|
+
`, 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: LocalizedMessagesDirective, selector: "[kendoAIPromptLocalizedMessages]" }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: AIPromptToolbarFocusableDirective, selector: "[kendoAIPromptToolbarFocusable]" }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
2652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptComponent, decorators: [{
|
2653
|
+
type: Component,
|
2654
|
+
args: [{
|
2655
|
+
exportAs: 'kendoAIPrompt',
|
2656
|
+
selector: 'kendo-aiprompt',
|
2657
|
+
providers: [
|
2658
|
+
LocalizationService,
|
2659
|
+
AIPromptService,
|
2660
|
+
ToolbarNavigationService,
|
2661
|
+
{
|
2662
|
+
provide: L10N_PREFIX,
|
2663
|
+
useValue: 'kendo.aiprompt'
|
2664
|
+
}
|
2665
|
+
],
|
2666
|
+
template: `
|
2667
|
+
<ng-container kendoAIPromptLocalizedMessages
|
2668
|
+
i18n-promptView="kendo.aiprompt.promptView|The Toolbar button text for the Prompt view."
|
2669
|
+
promptView="Ask AI"
|
2670
|
+
i18n-outputView="kendo.aiprompt.outputView|The Toolbar button text for the Output view."
|
2671
|
+
outputView="Output"
|
2672
|
+
i18n-generateOutput="kendo.aiprompt.generateOutput|The text for the Generate button in the Prompt view."
|
2673
|
+
generateOutput="Generate"
|
2674
|
+
i18n-promptPlaceholder="kendo.aiprompt.promptPlaceholder|The placeholder text for the Prompt view textarea."
|
2675
|
+
promptPlaceholder="Ask or generate content with AI"
|
2676
|
+
i18n-copyOutput="kendo.aiprompt.copyOutput|The Copy button text in each Output view card."
|
2677
|
+
copyOutput="Copy"
|
2678
|
+
i18n-retryGeneration="kendo.aiprompt.retryGeneration|The Retry button text in each Output view card."
|
2679
|
+
retryGeneration="Retry"
|
2680
|
+
i18n-outputTitle="kendo.aiprompt.outputTitle|The title of each Output view card."
|
2681
|
+
outputTitle="Generated with AI"
|
2682
|
+
i18n-outputRetryTitle="kendo.aiprompt.outputRetryTitle|The title of each Output view retry card."
|
2683
|
+
outputRetryTitle="Generated with AI"
|
2684
|
+
i18n-promptSuggestions="kendo.aiprompt.promptSuggestions|The title of the Prompt suggestions button."
|
2685
|
+
promptSuggestions="Prompt suggestions">
|
2686
|
+
</ng-container>
|
2687
|
+
<div class="k-prompt-header">
|
2688
|
+
<div class="k-toolbar-flat k-toolbar k-toolbar-md"
|
2689
|
+
role="toolbar">
|
2690
|
+
<button *ngFor="let view of viewsArray; let idx = index"
|
2691
|
+
kendoButton
|
2692
|
+
kendoAIPromptToolbarFocusable
|
2693
|
+
type="button"
|
2694
|
+
fillMode="flat"
|
2695
|
+
rounded="full"
|
2696
|
+
themeColor="primary"
|
2697
|
+
[svgIcon]="view.svgIcon"
|
2698
|
+
[icon]="view.icon"
|
2699
|
+
[selected]="idx === activeView"
|
2700
|
+
(click)="viewChange(idx)">
|
2701
|
+
{{view.buttonText}}
|
2702
|
+
</button>
|
2703
|
+
|
2704
|
+
<ng-template *ngIf="toolbarActionsTemplate"
|
2705
|
+
[ngTemplateOutlet]="toolbarActionsTemplate?.templateRef">
|
2706
|
+
</ng-template>
|
2707
|
+
</div>
|
2708
|
+
</div>
|
2709
|
+
<div class="k-prompt-content">
|
2710
|
+
<div class="k-prompt-view">
|
2711
|
+
<ng-container *ngTemplateOutlet="viewTemplate">
|
2712
|
+
</ng-container>
|
2713
|
+
</div>
|
2714
|
+
</div>
|
2715
|
+
<div class="k-prompt-footer" *ngIf="selectedView.viewType === 'prompt'">
|
2716
|
+
<div class="k-actions k-actions-start k-actions-horizontal k-prompt-actions">
|
2717
|
+
<button
|
2718
|
+
kendoButton
|
2719
|
+
type="button"
|
2720
|
+
themeColor="primary"
|
2721
|
+
rounded="full"
|
2722
|
+
[svgIcon]="sparklesIcon"
|
2723
|
+
icon="sparkles"
|
2724
|
+
(click)="handleGenerateOutput()">{{messageFor('generateOutput')}}</button>
|
2725
|
+
</div>
|
2726
|
+
</div>
|
2727
|
+
`
|
2728
|
+
}]
|
2729
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }, { type: AIPromptService }, { type: ToolbarNavigationService }, { type: i0.NgZone }]; }, propDecorators: { hostClasses: [{
|
2730
|
+
type: HostBinding,
|
2731
|
+
args: ['class.k-prompt']
|
2732
|
+
}], dirAttr: [{
|
2733
|
+
type: HostBinding,
|
2734
|
+
args: ['attr.dir']
|
2735
|
+
}], views: [{
|
2736
|
+
type: ContentChildren,
|
2737
|
+
args: [BaseView]
|
2738
|
+
}], toolbarActionsTemplate: [{
|
2739
|
+
type: ContentChild,
|
2740
|
+
args: [AIPromptToolbarActionsDirective]
|
2741
|
+
}], activeView: [{
|
2742
|
+
type: Input
|
2743
|
+
}], promptCommands: [{
|
2744
|
+
type: Input
|
2745
|
+
}], promptSuggestions: [{
|
2746
|
+
type: Input
|
2747
|
+
}], promptOutputs: [{
|
2748
|
+
type: Input
|
2749
|
+
}], showOutputRating: [{
|
2750
|
+
type: Input
|
2751
|
+
}], activeViewChange: [{
|
2752
|
+
type: Output
|
2753
|
+
}], promptRequest: [{
|
2754
|
+
type: Output
|
2755
|
+
}], commandExecute: [{
|
2756
|
+
type: Output
|
2757
|
+
}], outputCopy: [{
|
2758
|
+
type: Output
|
2759
|
+
}], outputRatingChange: [{
|
2760
|
+
type: Output
|
2761
|
+
}] } });
|
2762
|
+
|
2763
|
+
/**
|
2764
|
+
* The component for rendering the **Command** view.
|
2765
|
+
*/
|
2766
|
+
class CommandViewComponent extends BaseView {
|
2767
|
+
constructor(localization, service) {
|
2768
|
+
super('command', localization);
|
2769
|
+
this.service = service;
|
2770
|
+
this.panelBarItems = [];
|
2771
|
+
}
|
2772
|
+
ngOnInit() {
|
2773
|
+
this.panelBarItems = this.getPanelBarItems(this.service.promptCommands);
|
2774
|
+
}
|
2775
|
+
itemClickHandler(ev) {
|
2776
|
+
if (ev.item.children) {
|
2777
|
+
return;
|
2778
|
+
}
|
2779
|
+
const selectedCommand = this.service.getFlattenPromptCommands().find(c => c.id == ev.item.id);
|
2780
|
+
if (selectedCommand) {
|
2781
|
+
const eventArgs = {
|
2782
|
+
command: selectedCommand,
|
2783
|
+
sender: this.service.aiPrompt,
|
2784
|
+
isRetry: false
|
2785
|
+
};
|
2786
|
+
this.service.executeEvent.next(eventArgs);
|
2787
|
+
}
|
2788
|
+
}
|
2789
|
+
getPanelBarItems(commands) {
|
2790
|
+
return commands.map(c => ({
|
2791
|
+
title: c.text,
|
2792
|
+
id: c.id,
|
2793
|
+
icon: c.icon,
|
2794
|
+
svgIcon: c.svgIcon,
|
2795
|
+
children: c.children ? this.getPanelBarItems(c.children) : null
|
2796
|
+
}));
|
2797
|
+
}
|
2798
|
+
}
|
2799
|
+
CommandViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CommandViewComponent, deps: [{ token: i1$1.LocalizationService }, { token: AIPromptService }], target: i0.ɵɵFactoryTarget.Component });
|
2800
|
+
CommandViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: CommandViewComponent, selector: "kendo-aiprompt-command-view", providers: [{
|
2801
|
+
provide: BaseView,
|
2802
|
+
useExisting: forwardRef(() => CommandViewComponent)
|
2803
|
+
}], usesInheritance: true, ngImport: i0, template: `
|
2804
|
+
<ng-template #content>
|
2805
|
+
<kendo-panelbar
|
2806
|
+
[items]="panelBarItems"
|
2807
|
+
[animate]="false"
|
2808
|
+
[selectable]="false"
|
2809
|
+
(itemClick)="itemClickHandler($event)"
|
2810
|
+
></kendo-panelbar>
|
2811
|
+
</ng-template>
|
2812
|
+
`, isInline: true, components: [{ type: i3$1.PanelBarComponent, selector: "kendo-panelbar", inputs: ["expandMode", "selectable", "animate", "height", "keepItemContent", "items"], outputs: ["stateChange", "select", "expand", "collapse", "itemClick"], exportAs: ["kendoPanelbar"] }] });
|
2813
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CommandViewComponent, decorators: [{
|
2814
|
+
type: Component,
|
2815
|
+
args: [{
|
2816
|
+
selector: 'kendo-aiprompt-command-view',
|
2817
|
+
providers: [{
|
2818
|
+
provide: BaseView,
|
2819
|
+
useExisting: forwardRef(() => CommandViewComponent)
|
2820
|
+
}],
|
2821
|
+
template: `
|
2822
|
+
<ng-template #content>
|
2823
|
+
<kendo-panelbar
|
2824
|
+
[items]="panelBarItems"
|
2825
|
+
[animate]="false"
|
2826
|
+
[selectable]="false"
|
2827
|
+
(itemClick)="itemClickHandler($event)"
|
2828
|
+
></kendo-panelbar>
|
2829
|
+
</ng-template>
|
2830
|
+
`
|
2831
|
+
}]
|
2832
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }, { type: AIPromptService }]; } });
|
2833
|
+
|
2834
|
+
/**
|
2835
|
+
* Custom component messages override default component messages.
|
2836
|
+
*/
|
2837
|
+
class AIPromptCustomMessagesComponent extends Messages {
|
2838
|
+
constructor(service) {
|
2839
|
+
super();
|
2840
|
+
this.service = service;
|
2841
|
+
}
|
2842
|
+
get override() {
|
2843
|
+
return true;
|
2844
|
+
}
|
2845
|
+
}
|
2846
|
+
AIPromptCustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptCustomMessagesComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
2847
|
+
AIPromptCustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: AIPromptCustomMessagesComponent, selector: "kendo-aiprompt-messages", providers: [
|
2848
|
+
{
|
2849
|
+
provide: Messages,
|
2850
|
+
useExisting: forwardRef(() => AIPromptCustomMessagesComponent)
|
2851
|
+
}
|
2852
|
+
], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
2853
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptCustomMessagesComponent, decorators: [{
|
2854
|
+
type: Component,
|
2855
|
+
args: [{
|
2856
|
+
providers: [
|
2857
|
+
{
|
2858
|
+
provide: Messages,
|
2859
|
+
useExisting: forwardRef(() => AIPromptCustomMessagesComponent)
|
2860
|
+
}
|
2861
|
+
],
|
2862
|
+
selector: 'kendo-aiprompt-messages',
|
2863
|
+
template: ``
|
2864
|
+
}]
|
2865
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
2866
|
+
|
2867
|
+
/**
|
2868
|
+
* The component for rendering a **Custom** view.
|
2869
|
+
*/
|
2870
|
+
class CustomViewComponent extends BaseView {
|
2871
|
+
constructor(localization) {
|
2872
|
+
super('custom', localization);
|
2873
|
+
}
|
2874
|
+
}
|
2875
|
+
CustomViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CustomViewComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
2876
|
+
CustomViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: CustomViewComponent, selector: "kendo-aiprompt-custom-view", inputs: { viewTemplate: "viewTemplate" }, providers: [{
|
2877
|
+
provide: BaseView,
|
2878
|
+
useExisting: forwardRef(() => CustomViewComponent)
|
2879
|
+
}], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
2880
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CustomViewComponent, decorators: [{
|
2881
|
+
type: Component,
|
2882
|
+
args: [{
|
2883
|
+
selector: 'kendo-aiprompt-custom-view',
|
2884
|
+
providers: [{
|
2885
|
+
provide: BaseView,
|
2886
|
+
useExisting: forwardRef(() => CustomViewComponent)
|
2887
|
+
}],
|
2888
|
+
template: ``
|
2889
|
+
}]
|
2890
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; }, propDecorators: { viewTemplate: [{
|
2891
|
+
type: Input
|
2892
|
+
}] } });
|
2893
|
+
|
2894
|
+
const PUBLIC_DIRECTIVES$1 = [
|
2895
|
+
AIPromptComponent,
|
2896
|
+
PromptViewComponent,
|
2897
|
+
OutputViewComponent,
|
2898
|
+
CommandViewComponent,
|
2899
|
+
CustomViewComponent,
|
2900
|
+
AIPromptCustomMessagesComponent,
|
2901
|
+
AIPromptToolbarActionsDirective,
|
2902
|
+
AIPromptToolbarFocusableDirective
|
2903
|
+
];
|
2904
|
+
const PRIVATE_DIRECTIVES$1 = [
|
2905
|
+
LocalizedMessagesDirective,
|
2906
|
+
AIPromptOutputCardComponent
|
2907
|
+
];
|
2908
|
+
class AIPromptModule {
|
2909
|
+
}
|
2910
|
+
AIPromptModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
2911
|
+
AIPromptModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptModule, declarations: [AIPromptComponent,
|
2912
|
+
PromptViewComponent,
|
2913
|
+
OutputViewComponent,
|
2914
|
+
CommandViewComponent,
|
2915
|
+
CustomViewComponent,
|
2916
|
+
AIPromptCustomMessagesComponent,
|
2917
|
+
AIPromptToolbarActionsDirective,
|
2918
|
+
AIPromptToolbarFocusableDirective, LocalizedMessagesDirective,
|
2919
|
+
AIPromptOutputCardComponent], imports: [CommonModule,
|
2920
|
+
ButtonsModule,
|
2921
|
+
IconsModule,
|
2922
|
+
InputsModule,
|
2923
|
+
LayoutModule], exports: [AIPromptComponent,
|
2924
|
+
PromptViewComponent,
|
2925
|
+
OutputViewComponent,
|
2926
|
+
CommandViewComponent,
|
2927
|
+
CustomViewComponent,
|
2928
|
+
AIPromptCustomMessagesComponent,
|
2929
|
+
AIPromptToolbarActionsDirective,
|
2930
|
+
AIPromptToolbarFocusableDirective] });
|
2931
|
+
AIPromptModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptModule, imports: [[
|
2932
|
+
CommonModule,
|
2933
|
+
ButtonsModule,
|
2934
|
+
IconsModule,
|
2935
|
+
InputsModule,
|
2936
|
+
LayoutModule
|
2937
|
+
]] });
|
2938
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AIPromptModule, decorators: [{
|
2939
|
+
type: NgModule,
|
2940
|
+
args: [{
|
2941
|
+
declarations: [...PUBLIC_DIRECTIVES$1, ...PRIVATE_DIRECTIVES$1],
|
2942
|
+
exports: [...PUBLIC_DIRECTIVES$1],
|
2943
|
+
imports: [
|
2944
|
+
CommonModule,
|
2945
|
+
ButtonsModule,
|
2946
|
+
IconsModule,
|
2947
|
+
InputsModule,
|
2948
|
+
LayoutModule
|
2949
|
+
]
|
2950
|
+
}]
|
2951
|
+
}] });
|
2952
|
+
|
1740
2953
|
// eslint-disable no-forward-ref
|
1741
2954
|
/**
|
1742
2955
|
* Custom component messages override default component messages
|
1743
2956
|
* ([see example]({% slug globalization_chat %}#toc-custom-messages)).
|
1744
2957
|
*/
|
1745
|
-
class CustomMessagesComponent extends Messages {
|
2958
|
+
class CustomMessagesComponent extends Messages$1 {
|
1746
2959
|
constructor(service) {
|
1747
2960
|
super();
|
1748
2961
|
this.service = service;
|
@@ -1751,10 +2964,10 @@ class CustomMessagesComponent extends Messages {
|
|
1751
2964
|
return true;
|
1752
2965
|
}
|
1753
2966
|
}
|
1754
|
-
CustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1$
|
2967
|
+
CustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
1755
2968
|
CustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: CustomMessagesComponent, selector: "kendo-chat-messages", providers: [
|
1756
2969
|
{
|
1757
|
-
provide: Messages,
|
2970
|
+
provide: Messages$1,
|
1758
2971
|
useExisting: forwardRef(() => CustomMessagesComponent)
|
1759
2972
|
}
|
1760
2973
|
], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
@@ -1763,14 +2976,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
1763
2976
|
args: [{
|
1764
2977
|
providers: [
|
1765
2978
|
{
|
1766
|
-
provide: Messages,
|
2979
|
+
provide: Messages$1,
|
1767
2980
|
useExisting: forwardRef(() => CustomMessagesComponent)
|
1768
2981
|
}
|
1769
2982
|
],
|
1770
2983
|
selector: 'kendo-chat-messages',
|
1771
2984
|
template: ``
|
1772
2985
|
}]
|
1773
|
-
}], ctorParameters: function () { return [{ type: i1$
|
2986
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
1774
2987
|
|
1775
2988
|
/**
|
1776
2989
|
* Represents a Hero Card component ([see example]({% slug dialogflow_chat %})).
|
@@ -1811,7 +3024,7 @@ HeroCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
|
|
1811
3024
|
</button>
|
1812
3025
|
</span>
|
1813
3026
|
</div>
|
1814
|
-
`, isInline: true, components: [{ type:
|
3027
|
+
`, 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: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
1815
3028
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: HeroCardComponent, decorators: [{
|
1816
3029
|
type: Component,
|
1817
3030
|
args: [{
|
@@ -1866,7 +3079,7 @@ const PUBLIC_DIRECTIVES = [
|
|
1866
3079
|
const PRIVATE_DIRECTIVES = [
|
1867
3080
|
AttachmentComponent,
|
1868
3081
|
FocusedStateDirective,
|
1869
|
-
LocalizedMessagesDirective,
|
3082
|
+
LocalizedMessagesDirective$1,
|
1870
3083
|
MessageAttachmentsComponent,
|
1871
3084
|
MessageComponent,
|
1872
3085
|
MessageListComponent,
|
@@ -1906,7 +3119,7 @@ ChatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13
|
|
1906
3119
|
HeroCardComponent,
|
1907
3120
|
ChatMessageBoxTemplateDirective, AttachmentComponent,
|
1908
3121
|
FocusedStateDirective,
|
1909
|
-
LocalizedMessagesDirective,
|
3122
|
+
LocalizedMessagesDirective$1,
|
1910
3123
|
MessageAttachmentsComponent,
|
1911
3124
|
MessageComponent,
|
1912
3125
|
MessageListComponent,
|
@@ -1942,9 +3155,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
1942
3155
|
}]
|
1943
3156
|
}] });
|
1944
3157
|
|
3158
|
+
/**
|
3159
|
+
* Represents the [NgModule](link:site.data.urls.angular['ngmodules'])
|
3160
|
+
* definition for the Conversational UI components.
|
3161
|
+
*
|
3162
|
+
* @example
|
3163
|
+
*
|
3164
|
+
* ```ts-no-run
|
3165
|
+
* // Import the Conversational UI module
|
3166
|
+
* import { ConversationalUIModule } from '@progress/kendo-angular-conversational-ui';
|
3167
|
+
*
|
3168
|
+
* // The browser platform with a compiler
|
3169
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
3170
|
+
*
|
3171
|
+
* import { NgModule } from '@angular/core';
|
3172
|
+
*
|
3173
|
+
* // Import the app component
|
3174
|
+
* import { AppComponent } from './app.component';
|
3175
|
+
*
|
3176
|
+
* // Define the app module
|
3177
|
+
* _@NgModule({
|
3178
|
+
* declarations: [AppComponent], // declare app component
|
3179
|
+
* imports: [BrowserModule, ConversationalUIModule], // import Conversational UI module
|
3180
|
+
* bootstrap: [AppComponent]
|
3181
|
+
* })
|
3182
|
+
* export class AppModule {}
|
3183
|
+
*
|
3184
|
+
* // Compile and launch the module
|
3185
|
+
* platformBrowserDynamic().bootstrapModule(AppModule);
|
3186
|
+
*
|
3187
|
+
* ```
|
3188
|
+
*/
|
3189
|
+
class ConversationalUIModule {
|
3190
|
+
}
|
3191
|
+
ConversationalUIModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ConversationalUIModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
3192
|
+
ConversationalUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ConversationalUIModule, exports: [AIPromptModule, ChatModule] });
|
3193
|
+
ConversationalUIModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ConversationalUIModule, imports: [AIPromptModule, ChatModule] });
|
3194
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ConversationalUIModule, decorators: [{
|
3195
|
+
type: NgModule,
|
3196
|
+
args: [{
|
3197
|
+
exports: [AIPromptModule, ChatModule]
|
3198
|
+
}]
|
3199
|
+
}] });
|
3200
|
+
|
1945
3201
|
/**
|
1946
3202
|
* Generated bundle index. Do not edit.
|
1947
3203
|
*/
|
1948
3204
|
|
1949
|
-
export { AttachmentTemplateDirective, ChatComponent, ChatMessageBoxTemplateDirective, ChatModule, CustomMessagesComponent, ExecuteActionEvent, HeroCardComponent, MessageTemplateDirective, SendMessageEvent };
|
3205
|
+
export { AIPromptComponent, AIPromptCustomMessagesComponent, AIPromptModule, AIPromptToolbarActionsDirective, AIPromptToolbarFocusableDirective, AttachmentTemplateDirective, ChatComponent, ChatMessageBoxTemplateDirective, ChatModule, CommandViewComponent, ConversationalUIModule, CustomMessagesComponent, CustomViewComponent, ExecuteActionEvent, HeroCardComponent, MessageTemplateDirective, OutputViewComponent, PromptViewComponent, SendMessageEvent };
|
1950
3206
|
|