@progress/kendo-angular-conversational-ui 21.4.1-develop.1 → 22.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.
Files changed (116) hide show
  1. package/ai-prompt/localization/messages.d.ts +1 -1
  2. package/ai-prompt/views/base-view.d.ts +1 -1
  3. package/chat/l10n/messages.d.ts +1 -1
  4. package/fesm2022/progress-kendo-angular-conversational-ui.mjs +182 -182
  5. package/inline-ai-prompt/localization/messages.d.ts +1 -1
  6. package/package.json +17 -25
  7. package/esm2022/ai-prompt/aiprompt.component.mjs +0 -556
  8. package/esm2022/ai-prompt/aiprompt.module.mjs +0 -53
  9. package/esm2022/ai-prompt/common/aiprompt.service.mjs +0 -75
  10. package/esm2022/ai-prompt/common/output-card.component.mjs +0 -230
  11. package/esm2022/ai-prompt/common/toolbar-focusable.directive.mjs +0 -72
  12. package/esm2022/ai-prompt/common/toolbar-navigation.service.mjs +0 -56
  13. package/esm2022/ai-prompt/localization/custom-messages.component.mjs +0 -54
  14. package/esm2022/ai-prompt/localization/localized-messages.directive.mjs +0 -39
  15. package/esm2022/ai-prompt/localization/messages.mjs +0 -77
  16. package/esm2022/ai-prompt/models/ai-prompt-settings.mjs +0 -5
  17. package/esm2022/ai-prompt/models/command-execute-event.mjs +0 -5
  18. package/esm2022/ai-prompt/models/command.interface.mjs +0 -5
  19. package/esm2022/ai-prompt/models/index.mjs +0 -5
  20. package/esm2022/ai-prompt/models/output-rating-change-event.mjs +0 -5
  21. package/esm2022/ai-prompt/models/prompt-output.interface.mjs +0 -5
  22. package/esm2022/ai-prompt/models/prompt-request-event.mjs +0 -5
  23. package/esm2022/ai-prompt/models/view-type.mjs +0 -5
  24. package/esm2022/ai-prompt/templates/aiprompt-output-body-template.directive.mjs +0 -33
  25. package/esm2022/ai-prompt/templates/aiprompt-output-template.directive.mjs +0 -33
  26. package/esm2022/ai-prompt/templates/toolbar-actions.template.mjs +0 -39
  27. package/esm2022/ai-prompt/utils.mjs +0 -26
  28. package/esm2022/ai-prompt/views/base-view.mjs +0 -98
  29. package/esm2022/ai-prompt/views/command-view.component.mjs +0 -100
  30. package/esm2022/ai-prompt/views/custom-view.component.mjs +0 -50
  31. package/esm2022/ai-prompt/views/index.mjs +0 -8
  32. package/esm2022/ai-prompt/views/output-view.component.mjs +0 -90
  33. package/esm2022/ai-prompt/views/prompt-view.component.mjs +0 -288
  34. package/esm2022/chat/api/action.interface.mjs +0 -5
  35. package/esm2022/chat/api/attachment.interface.mjs +0 -5
  36. package/esm2022/chat/api/chat-file-interface.mjs +0 -5
  37. package/esm2022/chat/api/chat-suggestion.interface.mjs +0 -5
  38. package/esm2022/chat/api/execute-action-event.mjs +0 -29
  39. package/esm2022/chat/api/file-action.mjs +0 -5
  40. package/esm2022/chat/api/file-download-event.interface.mjs +0 -5
  41. package/esm2022/chat/api/files-layout.mjs +0 -5
  42. package/esm2022/chat/api/index.mjs +0 -21
  43. package/esm2022/chat/api/message-action.mjs +0 -5
  44. package/esm2022/chat/api/message-settings.interface.mjs +0 -5
  45. package/esm2022/chat/api/message-width-mode.mjs +0 -5
  46. package/esm2022/chat/api/message.interface.mjs +0 -5
  47. package/esm2022/chat/api/post-message-event.mjs +0 -21
  48. package/esm2022/chat/api/preventable-event.mjs +0 -28
  49. package/esm2022/chat/api/send-button-settings.mjs +0 -5
  50. package/esm2022/chat/api/suggestions-layout.mjs +0 -5
  51. package/esm2022/chat/api/timestamp-visibility.mjs +0 -5
  52. package/esm2022/chat/api/user.interface.mjs +0 -5
  53. package/esm2022/chat/attachment.component.mjs +0 -105
  54. package/esm2022/chat/builtin-actions.mjs +0 -27
  55. package/esm2022/chat/cards/hero-card.component.mjs +0 -131
  56. package/esm2022/chat/chat-file.component.mjs +0 -144
  57. package/esm2022/chat/chat-item.mjs +0 -10
  58. package/esm2022/chat/chat-view.mjs +0 -80
  59. package/esm2022/chat/chat.component.mjs +0 -1015
  60. package/esm2022/chat/chat.directives.mjs +0 -18
  61. package/esm2022/chat/chat.module.mjs +0 -61
  62. package/esm2022/chat/common/chat.service.mjs +0 -179
  63. package/esm2022/chat/common/models/default-model-fields.mjs +0 -25
  64. package/esm2022/chat/common/models/formatted-text-parts.mjs +0 -5
  65. package/esm2022/chat/common/models/message-box-options.mjs +0 -5
  66. package/esm2022/chat/common/models/model-fields.mjs +0 -5
  67. package/esm2022/chat/common/scroll-anchor.directive.mjs +0 -80
  68. package/esm2022/chat/common/scroll-button.component.mjs +0 -81
  69. package/esm2022/chat/common/scroll.service.mjs +0 -110
  70. package/esm2022/chat/common/utils.mjs +0 -159
  71. package/esm2022/chat/l10n/custom-messages.component.mjs +0 -55
  72. package/esm2022/chat/l10n/localized-messages.directive.mjs +0 -40
  73. package/esm2022/chat/l10n/messages.mjs +0 -130
  74. package/esm2022/chat/message-attachments.component.mjs +0 -258
  75. package/esm2022/chat/message-box.component.mjs +0 -501
  76. package/esm2022/chat/message-list.component.mjs +0 -617
  77. package/esm2022/chat/message-reference-content.component.mjs +0 -86
  78. package/esm2022/chat/message.component.mjs +0 -740
  79. package/esm2022/chat/suggested-actions.component.mjs +0 -443
  80. package/esm2022/chat/templates/attachment-template.directive.mjs +0 -43
  81. package/esm2022/chat/templates/author-message-content-template.directive.mjs +0 -39
  82. package/esm2022/chat/templates/author-message-template.directive.mjs +0 -39
  83. package/esm2022/chat/templates/header-template.directive.mjs +0 -33
  84. package/esm2022/chat/templates/message-box.directive.mjs +0 -36
  85. package/esm2022/chat/templates/message-content-template.directive.mjs +0 -39
  86. package/esm2022/chat/templates/message-template.directive.mjs +0 -39
  87. package/esm2022/chat/templates/no-data-template.directive.mjs +0 -38
  88. package/esm2022/chat/templates/receiver-message-content-template.directive.mjs +0 -39
  89. package/esm2022/chat/templates/receiver-message-template.directive.mjs +0 -39
  90. package/esm2022/chat/templates/status-template.directive.mjs +0 -33
  91. package/esm2022/chat/templates/suggestion-template.directive.mjs +0 -36
  92. package/esm2022/chat/templates/timestamp-template.directive.mjs +0 -42
  93. package/esm2022/chat/templates/user-status-template.directive.mjs +0 -38
  94. package/esm2022/conversational-ui.module.mjs +0 -73
  95. package/esm2022/directives.mjs +0 -145
  96. package/esm2022/index.mjs +0 -40
  97. package/esm2022/inline-ai-prompt/inlineaiprompt-content.component.mjs +0 -548
  98. package/esm2022/inline-ai-prompt/inlineaiprompt.component.mjs +0 -351
  99. package/esm2022/inline-ai-prompt/inlineaiprompt.module.mjs +0 -46
  100. package/esm2022/inline-ai-prompt/inlineaiprompt.service.mjs +0 -92
  101. package/esm2022/inline-ai-prompt/localization/custom-messages.component.mjs +0 -51
  102. package/esm2022/inline-ai-prompt/localization/localized-messages.directive.mjs +0 -39
  103. package/esm2022/inline-ai-prompt/localization/messages.mjs +0 -35
  104. package/esm2022/inline-ai-prompt/models/command.interface.mjs +0 -5
  105. package/esm2022/inline-ai-prompt/models/index.mjs +0 -5
  106. package/esm2022/inline-ai-prompt/models/inlineaiprompt-popupsettings.mjs +0 -5
  107. package/esm2022/inline-ai-prompt/models/inlineaiprompt-settings.mjs +0 -59
  108. package/esm2022/inline-ai-prompt/models/messages.mjs +0 -8
  109. package/esm2022/inline-ai-prompt/models/output-action-click-event.mjs +0 -5
  110. package/esm2022/inline-ai-prompt/models/output-action.interface.mjs +0 -5
  111. package/esm2022/inline-ai-prompt/models/prompt-output.interface.mjs +0 -5
  112. package/esm2022/inline-ai-prompt/models/prompt-request-event.mjs +0 -5
  113. package/esm2022/inline-ai-prompt/output-template.directive.mjs +0 -38
  114. package/esm2022/inline-ai-prompt/utils.mjs +0 -57
  115. package/esm2022/package-metadata.mjs +0 -16
  116. package/esm2022/progress-kendo-angular-conversational-ui.mjs +0 -8
@@ -21,5 +21,5 @@ export declare class Messages extends ComponentMessages {
21
21
  */
22
22
  speechToTextButtonTitle: string;
23
23
  static ɵfac: i0.ɵɵFactoryDeclaration<Messages, never>;
24
- static ɵdir: i0.ɵɵDirectiveDeclaration<Messages, never, never, { "commandsButtonTitle": { "alias": "commandsButtonTitle"; "required": false; }; "generateButtonTitle": { "alias": "generateButtonTitle"; "required": false; }; "speechToTextButtonTitle": { "alias": "speechToTextButtonTitle"; "required": false; }; }, {}, never, never, false, never>;
24
+ static ɵdir: i0.ɵɵDirectiveDeclaration<Messages, never, never, { "commandsButtonTitle": { "alias": "commandsButtonTitle"; "required": false; }; "generateButtonTitle": { "alias": "generateButtonTitle"; "required": false; }; "speechToTextButtonTitle": { "alias": "speechToTextButtonTitle"; "required": false; }; }, {}, never, never, true, never>;
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-conversational-ui",
3
- "version": "21.4.1-develop.1",
3
+ "version": "22.0.0-develop.1",
4
4
  "description": "Kendo UI for Angular Conversational UI components",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -43,36 +43,30 @@
43
43
  }
44
44
  ]
45
45
  }
46
- },
47
- "package": {
48
- "productName": "Kendo UI for Angular",
49
- "productCode": "KENDOUIANGULAR",
50
- "publishDate": 1768386491,
51
- "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
52
46
  }
53
47
  },
54
48
  "peerDependencies": {
55
- "@angular/animations": "18 - 21",
56
- "@angular/common": "18 - 21",
57
- "@angular/core": "18 - 21",
58
- "@angular/platform-browser": "18 - 21",
49
+ "@angular/animations": "19 - 21",
50
+ "@angular/common": "19 - 21",
51
+ "@angular/core": "19 - 21",
52
+ "@angular/platform-browser": "19 - 21",
59
53
  "@progress/kendo-licensing": "^1.7.0",
60
- "@progress/kendo-angular-buttons": "21.4.1-develop.1",
61
- "@progress/kendo-angular-inputs": "21.4.1-develop.1",
62
- "@progress/kendo-angular-layout": "21.4.1-develop.1",
63
- "@progress/kendo-angular-icons": "21.4.1-develop.1",
64
- "@progress/kendo-angular-common": "21.4.1-develop.1",
65
- "@progress/kendo-angular-intl": "21.4.1-develop.1",
66
- "@progress/kendo-angular-l10n": "21.4.1-develop.1",
67
- "@progress/kendo-angular-menu": "21.4.1-develop.1",
68
- "@progress/kendo-angular-popup": "21.4.1-develop.1",
69
- "@progress/kendo-angular-toolbar": "21.4.1-develop.1",
70
- "@progress/kendo-angular-upload": "21.4.1-develop.1",
54
+ "@progress/kendo-angular-buttons": "22.0.0-develop.1",
55
+ "@progress/kendo-angular-inputs": "22.0.0-develop.1",
56
+ "@progress/kendo-angular-layout": "22.0.0-develop.1",
57
+ "@progress/kendo-angular-icons": "22.0.0-develop.1",
58
+ "@progress/kendo-angular-common": "22.0.0-develop.1",
59
+ "@progress/kendo-angular-intl": "22.0.0-develop.1",
60
+ "@progress/kendo-angular-l10n": "22.0.0-develop.1",
61
+ "@progress/kendo-angular-menu": "22.0.0-develop.1",
62
+ "@progress/kendo-angular-popup": "22.0.0-develop.1",
63
+ "@progress/kendo-angular-toolbar": "22.0.0-develop.1",
64
+ "@progress/kendo-angular-upload": "22.0.0-develop.1",
71
65
  "rxjs": "^6.5.3 || ^7.0.0"
72
66
  },
73
67
  "dependencies": {
74
68
  "tslib": "^2.3.1",
75
- "@progress/kendo-angular-schematics": "21.4.1-develop.1"
69
+ "@progress/kendo-angular-schematics": "22.0.0-develop.1"
76
70
  },
77
71
  "schematics": "./schematics/collection.json",
78
72
  "module": "fesm2022/progress-kendo-angular-conversational-ui.mjs",
@@ -83,8 +77,6 @@
83
77
  },
84
78
  ".": {
85
79
  "types": "./index.d.ts",
86
- "esm2022": "./esm2022/progress-kendo-angular-conversational-ui.mjs",
87
- "esm": "./esm2022/progress-kendo-angular-conversational-ui.mjs",
88
80
  "default": "./fesm2022/progress-kendo-angular-conversational-ui.mjs"
89
81
  }
90
82
  },
@@ -1,556 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 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, ElementRef, EventEmitter, HostBinding, Input, NgZone, Output, QueryList, Renderer2, ViewChild } from "@angular/core";
6
- import { NgTemplateOutlet } from "@angular/common";
7
- import { Subscription } from "rxjs";
8
- import { sparklesIcon, commentIcon, stopSmIcon } from "@progress/kendo-svg-icons";
9
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
10
- import { validatePackage } from "@progress/kendo-licensing";
11
- import { ButtonComponent, FloatingActionButtonComponent } from "@progress/kendo-angular-buttons";
12
- import { BaseView } from "./views/base-view";
13
- import { packageMetadata } from "../package-metadata";
14
- import { AIPromptService } from "./common/aiprompt.service";
15
- import { AIPromptToolbarActionsDirective } from "./templates/toolbar-actions.template";
16
- import { ToolbarNavigationService } from "./common/toolbar-navigation.service";
17
- import { AIPromptToolbarFocusableDirective } from "./common/toolbar-focusable.directive";
18
- import { LocalizedMessagesDirective } from "./localization/localized-messages.directive";
19
- import { AIPromptOutputTemplateDirective } from "./templates/aiprompt-output-template.directive";
20
- import { AIPromptOutputBodyTemplateDirective } from "./templates/aiprompt-output-body-template.directive";
21
- import { take } from "rxjs/operators";
22
- import * as i0 from "@angular/core";
23
- import * as i1 from "@progress/kendo-angular-l10n";
24
- import * as i2 from "./common/aiprompt.service";
25
- import * as i3 from "./common/toolbar-navigation.service";
26
- /**
27
- * Represents the [Kendo UI AIPrompt component for Angular](slug:overview_aiprompt).
28
- *
29
- * @example
30
- * ```html
31
- * <kendo-aiprompt
32
- * [promptCommands]="commands"
33
- * [promptSuggestions]="suggestions"
34
- * [promptOutputs]="outputs"
35
- * [showOutputRating]="true"
36
- * (promptRequest)="onPromptRequest($event)">
37
- * </kendo-aiprompt>
38
- * ```
39
- *
40
- * @remarks
41
- * Supported children components are: {@link AIPromptCustomMessagesComponent}, {@link CustomViewComponent}, {@link CommandViewComponent}, {@link PromptViewComponent}, {@link OutputViewComponent}.
42
- */
43
- export class AIPromptComponent {
44
- localization;
45
- service;
46
- navigationService;
47
- ngZone;
48
- element;
49
- renderer;
50
- hostClasses = true;
51
- get dirAttr() {
52
- return this.direction;
53
- }
54
- constructor(localization, service, navigationService, ngZone, element, renderer) {
55
- this.localization = localization;
56
- this.service = service;
57
- this.navigationService = navigationService;
58
- this.ngZone = ngZone;
59
- this.element = element;
60
- this.renderer = renderer;
61
- validatePackage(packageMetadata);
62
- this.direction = localization.rtl ? 'rtl' : 'ltr';
63
- this.subs.add(localization.changes.subscribe(({ rtl }) => {
64
- this.direction = rtl ? 'rtl' : 'ltr';
65
- }));
66
- }
67
- /**
68
- * @hidden
69
- */
70
- fabButton;
71
- /**
72
- * @hidden
73
- */
74
- views;
75
- /**
76
- * @hidden
77
- */
78
- toolbarActionsTemplate;
79
- /**
80
- * @hidden
81
- */
82
- outputTemplate;
83
- /**
84
- * @hidden
85
- */
86
- outputBodyTemplate;
87
- /**
88
- * The active view index of the AIPrompt component.
89
- */
90
- set activeView(idx) {
91
- if (this._activeView !== idx) {
92
- this._activeView = idx;
93
- if (this.service.promptValue) {
94
- this.service.promptValue = '';
95
- }
96
- }
97
- }
98
- get activeView() {
99
- return this._activeView;
100
- }
101
- /**
102
- * Sets the collection of commands to render in the Command view.
103
- */
104
- set promptCommands(value) {
105
- this.service.promptCommands = value;
106
- }
107
- /**
108
- * Sets the collection of suggestions to render in the Prompt view.
109
- */
110
- set promptSuggestions(value) {
111
- this.service.promptSuggestions = value;
112
- }
113
- /**
114
- * Sets the collection of generated prompt outputs to render in the Output view.
115
- */
116
- set promptOutputs(value) {
117
- this.service.promptOutputs = value;
118
- }
119
- /**
120
- * Specifies whether the rating buttons appear in each Output view card.
121
- * The rating buttons do not appear by default.
122
- * @default false
123
- */
124
- set showOutputRating(value) {
125
- this.service.showOutputRating = value;
126
- }
127
- /**
128
- * Specifies whether the Stop generation button appears in the Output view.
129
- * The Stop generation button does not appear by default.
130
- * @default false
131
- */
132
- streaming = false;
133
- /**
134
- * Sets the settings for the Speech to Text button in the Prompt view
135
- * ([see example](slug:configuration_aiprompt#enabling-speech-to-text)).
136
- */
137
- set speechToTextButton(settings) {
138
- if (settings) {
139
- this.service.speechToTextButton = settings;
140
- }
141
- else {
142
- this.service.speechToTextButton = false;
143
- }
144
- }
145
- /**
146
- * Sets the settings for the TextArea in the Prompt view
147
- * ([see example](slug:configuration_aiprompt#configuring-the-prompt-text-area)).
148
- */
149
- set textAreaSettings(settings) {
150
- this.service.textAreaSettings = settings;
151
- }
152
- /**
153
- * Sets the SVG icon for the Generate button in the Prompt view.
154
- */
155
- generateButtonSVGIcon = sparklesIcon;
156
- /**
157
- * Sets the icon for the Generate button in the Prompt view.
158
- * @default 'sparkles'
159
- */
160
- generateButtonIcon = 'sparkles';
161
- /**
162
- * Sets the disabled state for the Generate button in the Prompt view.
163
- * @default false
164
- */
165
- disabledGenerateButton = false;
166
- /**
167
- * Fires when the `activeView` property is updated.
168
- * Use this event for two-way binding of the `activeView` property.
169
- */
170
- activeViewChange = new EventEmitter();
171
- /**
172
- * Fires when you click the Generate button in the Prompt view or the Retry button in the Output view.
173
- * Use the event's `isRetry` field to determine the source element.
174
- */
175
- promptRequest = new EventEmitter();
176
- /**
177
- * Fires when you click a Command view command.
178
- * The event data contains the selected command.
179
- */
180
- commandExecute = new EventEmitter();
181
- /**
182
- * Fires when you click a Copy button in any Output view card.
183
- */
184
- outputCopy = new EventEmitter();
185
- /**
186
- * Fires when you click a rating button in any Output view card.
187
- */
188
- outputRatingChange = new EventEmitter();
189
- /**
190
- * Fires when you click the Stop Generation button in the Output view.
191
- */
192
- promptRequestCancel = new EventEmitter();
193
- ngOnInit() {
194
- const aiPromptElement = this.element.nativeElement;
195
- this.subs.add(this.renderer.listen(aiPromptElement, 'keydown', (event) => {
196
- if (event.key === 'Escape') {
197
- this.promptRequestCancel.emit();
198
- }
199
- }));
200
- }
201
- ngOnChanges(changes) {
202
- if (changes['streaming'] && changes['streaming'].currentValue === true) {
203
- this.ngZone.onStable.pipe(take(1)).subscribe(() => {
204
- this.fabButton?.focus();
205
- });
206
- }
207
- }
208
- ngAfterContentChecked() {
209
- if (this.outputTemplate !== this.service.outputTemplate) {
210
- this.service.outputTemplate = this.outputTemplate;
211
- }
212
- if (this.outputBodyTemplate !== this.service.outputBodyTemplate) {
213
- this.service.outputBodyTemplate = this.outputBodyTemplate;
214
- }
215
- }
216
- ngAfterViewInit() {
217
- this.ngZone.runOutsideAngular(() => {
218
- this.service.aiPrompt = this;
219
- this.subs.add(this.service.requestEvent.subscribe(ev => this.promptRequest.emit(ev)));
220
- this.subs.add(this.service.executeEvent.subscribe(ev => this.commandExecute.emit(ev)));
221
- this.subs.add(this.service.outputCopyEvent.subscribe(ev => this.outputCopy.emit(ev)));
222
- this.subs.add(this.service.outputRatingChangeEvent.subscribe(ev => this.outputRatingChange.emit(ev)));
223
- });
224
- }
225
- ngOnDestroy() {
226
- this.subs.unsubscribe();
227
- }
228
- /**
229
- * Focuses the first focusable element in the AIPrompt component.
230
- */
231
- focus() {
232
- this.navigationService.focusFirst();
233
- }
234
- subs = new Subscription();
235
- /**
236
- * @hidden
237
- */
238
- get selectedView() {
239
- return this.viewsArray[this.activeView];
240
- }
241
- /**
242
- * @hidden
243
- */
244
- sparklesIcon = sparklesIcon;
245
- /**
246
- * @hidden
247
- */
248
- outputIcon = commentIcon;
249
- /**
250
- * @hidden
251
- */
252
- fabStopGenerationSVGIcon = stopSmIcon;
253
- /**
254
- * @hidden
255
- */
256
- get viewsArray() {
257
- return this.views?.toArray();
258
- }
259
- /**
260
- * @hidden
261
- */
262
- fabPositionMode = 'absolute';
263
- /**
264
- * @hidden
265
- */
266
- fabAlignment = { vertical: 'bottom', horizontal: 'end' };
267
- direction;
268
- _activeView = 0;
269
- /**
270
- * @hidden
271
- */
272
- viewChange(idx) {
273
- if (idx !== this.activeView) {
274
- this.activeView = idx;
275
- this.activeViewChange.emit(idx);
276
- }
277
- }
278
- /**
279
- * @hidden
280
- */
281
- messageFor(text) {
282
- return this.localization.get(text);
283
- }
284
- /**
285
- * @hidden
286
- */
287
- get viewTemplate() {
288
- return this.selectedView?.viewType === 'custom' ? this.selectedView?.viewTemplate : this.selectedView?.template;
289
- }
290
- /**
291
- * @hidden
292
- */
293
- handleGenerateOutput() {
294
- const value = this.service.promptValue;
295
- const eventArgs = {
296
- prompt: value,
297
- sender: this,
298
- isRetry: false
299
- };
300
- this.promptRequest.emit(eventArgs);
301
- }
302
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AIPromptComponent, deps: [{ token: i1.LocalizationService }, { token: i2.AIPromptService }, { token: i3.ToolbarNavigationService }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
303
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: AIPromptComponent, isStandalone: true, selector: "kendo-aiprompt", inputs: { activeView: "activeView", promptCommands: "promptCommands", promptSuggestions: "promptSuggestions", promptOutputs: "promptOutputs", showOutputRating: "showOutputRating", streaming: "streaming", speechToTextButton: "speechToTextButton", textAreaSettings: "textAreaSettings", generateButtonSVGIcon: "generateButtonSVGIcon", generateButtonIcon: "generateButtonIcon", disabledGenerateButton: "disabledGenerateButton" }, outputs: { activeViewChange: "activeViewChange", promptRequest: "promptRequest", commandExecute: "commandExecute", outputCopy: "outputCopy", outputRatingChange: "outputRatingChange", promptRequestCancel: "promptRequestCancel" }, host: { properties: { "class.k-prompt": "this.hostClasses", "attr.dir": "this.dirAttr" } }, providers: [
304
- LocalizationService,
305
- AIPromptService,
306
- ToolbarNavigationService,
307
- {
308
- provide: L10N_PREFIX,
309
- useValue: 'kendo.aiprompt'
310
- }
311
- ], queries: [{ propertyName: "toolbarActionsTemplate", first: true, predicate: AIPromptToolbarActionsDirective, descendants: true }, { propertyName: "outputTemplate", first: true, predicate: AIPromptOutputTemplateDirective, descendants: true }, { propertyName: "outputBodyTemplate", first: true, predicate: AIPromptOutputBodyTemplateDirective, descendants: true }, { propertyName: "views", predicate: BaseView }], viewQueries: [{ propertyName: "fabButton", first: true, predicate: ["fabButton"], descendants: true }], exportAs: ["kendoAIPrompt"], usesOnChanges: true, ngImport: i0, template: `
312
- <ng-container kendoAIPromptLocalizedMessages
313
- i18n-promptView="kendo.aiprompt.promptView|The Toolbar button text for the Prompt view."
314
- promptView="Ask AI"
315
- i18n-outputView="kendo.aiprompt.outputView|The Toolbar button text for the Output view."
316
- outputView="Output"
317
- i18n-generateOutput="kendo.aiprompt.generateOutput|The text for the Generate button in the Prompt view."
318
- generateOutput="Generate"
319
- i18n-promptPlaceholder="kendo.aiprompt.promptPlaceholder|The placeholder text for the Prompt View text area."
320
- promptPlaceholder="Ask or generate content with AI"
321
- i18n-copyOutput="kendo.aiprompt.copyOutput|The Copy button text in each Output view card."
322
- copyOutput="Copy"
323
- i18n-retryGeneration="kendo.aiprompt.retryGeneration|The Retry button text in each Output view card."
324
- retryGeneration="Retry"
325
- i18n-outputTitle="kendo.aiprompt.outputTitle|The title of each Output view card."
326
- outputTitle="Generated with AI"
327
- i18n-outputRetryTitle="kendo.aiprompt.outputRetryTitle|The title of each Output view retry card."
328
- outputRetryTitle="Generated with AI"
329
- i18n-promptSuggestions="kendo.aiprompt.promptSuggestions|The title of the Prompt suggestions button."
330
- promptSuggestions="Prompt suggestions"
331
- i18n-speechToTextButton="kendo.aiprompt.speechToTextButton|The aria-label for the Speech to Text button."
332
- speechToTextButton="Voice input">
333
- </ng-container>
334
- <div class="k-prompt-header">
335
- <div class="k-toolbar-flat k-toolbar k-toolbar-md"
336
- role="toolbar">
337
- @for (view of viewsArray; track view; let idx = $index) {
338
- <button
339
- kendoButton
340
- kendoAIPromptToolbarFocusable
341
- type="button"
342
- fillMode="flat"
343
- rounded="full"
344
- themeColor="primary"
345
- [svgIcon]="view.svgIcon"
346
- [icon]="view.icon"
347
- [selected]="idx === activeView"
348
- (click)="viewChange(idx)">
349
- {{view.buttonText}}
350
- </button>
351
- }
352
-
353
- @if (toolbarActionsTemplate) {
354
- <ng-template
355
- [ngTemplateOutlet]="toolbarActionsTemplate?.templateRef">
356
- </ng-template>
357
- }
358
- </div>
359
- </div>
360
- <div class="k-prompt-content">
361
- @if (streaming && selectedView?.viewType === 'output') {
362
- <kendo-floatingactionbutton #fabButton
363
- class="k-prompt-stop-fab"
364
- buttonClass="k-generating k-active"
365
- [positionMode]="fabPositionMode"
366
- [align]="fabAlignment"
367
- [svgIcon]="fabStopGenerationSVGIcon"
368
- icon="stop"
369
- (click)="promptRequestCancel.emit()"
370
- >
371
- </kendo-floatingactionbutton>
372
- }
373
- <div class="k-prompt-view">
374
- <ng-container *ngTemplateOutlet="viewTemplate">
375
- </ng-container>
376
- </div>
377
- </div>
378
- @if (selectedView?.viewType === 'prompt') {
379
- <div class="k-prompt-footer">
380
- <div class="k-actions k-actions-start k-actions-horizontal k-prompt-actions">
381
- <button
382
- kendoButton
383
- type="button"
384
- themeColor="primary"
385
- rounded="full"
386
- [attr.title]="messageFor('generateOutput')"
387
- [attr.aria-label]="messageFor('generateOutput')"
388
- [attr.aria-disabled]="disabledGenerateButton"
389
- [svgIcon]="generateButtonSVGIcon"
390
- [icon]="generateButtonIcon"
391
- [disabled]="disabledGenerateButton"
392
- (click)="handleGenerateOutput()">{{messageFor('generateOutput')}}</button>
393
- </div>
394
- </div>
395
- }
396
- `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoAIPromptLocalizedMessages]" }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: AIPromptToolbarFocusableDirective, selector: "[kendoAIPromptToolbarFocusable]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FloatingActionButtonComponent, selector: "kendo-floatingactionbutton", inputs: ["themeColor", "size", "rounded", "disabled", "align", "offset", "positionMode", "icon", "svgIcon", "iconClass", "buttonClass", "dialClass", "text", "dialItemAnimation", "tabIndex", "dialItems"], outputs: ["blur", "focus", "dialItemClick", "open", "close"] }] });
397
- }
398
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AIPromptComponent, decorators: [{
399
- type: Component,
400
- args: [{
401
- exportAs: 'kendoAIPrompt',
402
- selector: 'kendo-aiprompt',
403
- providers: [
404
- LocalizationService,
405
- AIPromptService,
406
- ToolbarNavigationService,
407
- {
408
- provide: L10N_PREFIX,
409
- useValue: 'kendo.aiprompt'
410
- }
411
- ],
412
- template: `
413
- <ng-container kendoAIPromptLocalizedMessages
414
- i18n-promptView="kendo.aiprompt.promptView|The Toolbar button text for the Prompt view."
415
- promptView="Ask AI"
416
- i18n-outputView="kendo.aiprompt.outputView|The Toolbar button text for the Output view."
417
- outputView="Output"
418
- i18n-generateOutput="kendo.aiprompt.generateOutput|The text for the Generate button in the Prompt view."
419
- generateOutput="Generate"
420
- i18n-promptPlaceholder="kendo.aiprompt.promptPlaceholder|The placeholder text for the Prompt View text area."
421
- promptPlaceholder="Ask or generate content with AI"
422
- i18n-copyOutput="kendo.aiprompt.copyOutput|The Copy button text in each Output view card."
423
- copyOutput="Copy"
424
- i18n-retryGeneration="kendo.aiprompt.retryGeneration|The Retry button text in each Output view card."
425
- retryGeneration="Retry"
426
- i18n-outputTitle="kendo.aiprompt.outputTitle|The title of each Output view card."
427
- outputTitle="Generated with AI"
428
- i18n-outputRetryTitle="kendo.aiprompt.outputRetryTitle|The title of each Output view retry card."
429
- outputRetryTitle="Generated with AI"
430
- i18n-promptSuggestions="kendo.aiprompt.promptSuggestions|The title of the Prompt suggestions button."
431
- promptSuggestions="Prompt suggestions"
432
- i18n-speechToTextButton="kendo.aiprompt.speechToTextButton|The aria-label for the Speech to Text button."
433
- speechToTextButton="Voice input">
434
- </ng-container>
435
- <div class="k-prompt-header">
436
- <div class="k-toolbar-flat k-toolbar k-toolbar-md"
437
- role="toolbar">
438
- @for (view of viewsArray; track view; let idx = $index) {
439
- <button
440
- kendoButton
441
- kendoAIPromptToolbarFocusable
442
- type="button"
443
- fillMode="flat"
444
- rounded="full"
445
- themeColor="primary"
446
- [svgIcon]="view.svgIcon"
447
- [icon]="view.icon"
448
- [selected]="idx === activeView"
449
- (click)="viewChange(idx)">
450
- {{view.buttonText}}
451
- </button>
452
- }
453
-
454
- @if (toolbarActionsTemplate) {
455
- <ng-template
456
- [ngTemplateOutlet]="toolbarActionsTemplate?.templateRef">
457
- </ng-template>
458
- }
459
- </div>
460
- </div>
461
- <div class="k-prompt-content">
462
- @if (streaming && selectedView?.viewType === 'output') {
463
- <kendo-floatingactionbutton #fabButton
464
- class="k-prompt-stop-fab"
465
- buttonClass="k-generating k-active"
466
- [positionMode]="fabPositionMode"
467
- [align]="fabAlignment"
468
- [svgIcon]="fabStopGenerationSVGIcon"
469
- icon="stop"
470
- (click)="promptRequestCancel.emit()"
471
- >
472
- </kendo-floatingactionbutton>
473
- }
474
- <div class="k-prompt-view">
475
- <ng-container *ngTemplateOutlet="viewTemplate">
476
- </ng-container>
477
- </div>
478
- </div>
479
- @if (selectedView?.viewType === 'prompt') {
480
- <div class="k-prompt-footer">
481
- <div class="k-actions k-actions-start k-actions-horizontal k-prompt-actions">
482
- <button
483
- kendoButton
484
- type="button"
485
- themeColor="primary"
486
- rounded="full"
487
- [attr.title]="messageFor('generateOutput')"
488
- [attr.aria-label]="messageFor('generateOutput')"
489
- [attr.aria-disabled]="disabledGenerateButton"
490
- [svgIcon]="generateButtonSVGIcon"
491
- [icon]="generateButtonIcon"
492
- [disabled]="disabledGenerateButton"
493
- (click)="handleGenerateOutput()">{{messageFor('generateOutput')}}</button>
494
- </div>
495
- </div>
496
- }
497
- `,
498
- standalone: true,
499
- imports: [LocalizedMessagesDirective, ButtonComponent, AIPromptToolbarFocusableDirective, NgTemplateOutlet, FloatingActionButtonComponent]
500
- }]
501
- }], ctorParameters: () => [{ type: i1.LocalizationService }, { type: i2.AIPromptService }, { type: i3.ToolbarNavigationService }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { hostClasses: [{
502
- type: HostBinding,
503
- args: ['class.k-prompt']
504
- }], dirAttr: [{
505
- type: HostBinding,
506
- args: ['attr.dir']
507
- }], fabButton: [{
508
- type: ViewChild,
509
- args: ['fabButton']
510
- }], views: [{
511
- type: ContentChildren,
512
- args: [BaseView]
513
- }], toolbarActionsTemplate: [{
514
- type: ContentChild,
515
- args: [AIPromptToolbarActionsDirective]
516
- }], outputTemplate: [{
517
- type: ContentChild,
518
- args: [AIPromptOutputTemplateDirective]
519
- }], outputBodyTemplate: [{
520
- type: ContentChild,
521
- args: [AIPromptOutputBodyTemplateDirective]
522
- }], activeView: [{
523
- type: Input
524
- }], promptCommands: [{
525
- type: Input
526
- }], promptSuggestions: [{
527
- type: Input
528
- }], promptOutputs: [{
529
- type: Input
530
- }], showOutputRating: [{
531
- type: Input
532
- }], streaming: [{
533
- type: Input
534
- }], speechToTextButton: [{
535
- type: Input
536
- }], textAreaSettings: [{
537
- type: Input
538
- }], generateButtonSVGIcon: [{
539
- type: Input
540
- }], generateButtonIcon: [{
541
- type: Input
542
- }], disabledGenerateButton: [{
543
- type: Input
544
- }], activeViewChange: [{
545
- type: Output
546
- }], promptRequest: [{
547
- type: Output
548
- }], commandExecute: [{
549
- type: Output
550
- }], outputCopy: [{
551
- type: Output
552
- }], outputRatingChange: [{
553
- type: Output
554
- }], promptRequestCancel: [{
555
- type: Output
556
- }] } });