@progress/kendo-angular-conversational-ui 21.1.1-develop.2 → 21.2.0-develop.10

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 (27) hide show
  1. package/chat/chat.component.d.ts +2 -0
  2. package/chat/message-list.component.d.ts +2 -2
  3. package/codemods/utils.js +805 -394
  4. package/codemods/v20/chat-user.js +9 -12
  5. package/codemods/v21/chat-messagetoolbarvisibility.js +9 -13
  6. package/codemods/v21/chat-pinnedbyfield.js +1 -2
  7. package/esm2022/ai-prompt/aiprompt.component.mjs +155 -139
  8. package/esm2022/ai-prompt/common/output-card.component.mjs +81 -83
  9. package/esm2022/ai-prompt/common/toolbar-focusable.directive.mjs +2 -2
  10. package/esm2022/ai-prompt/views/output-view.component.mjs +27 -29
  11. package/esm2022/ai-prompt/views/prompt-view.component.mjs +150 -135
  12. package/esm2022/chat/attachment.component.mjs +53 -37
  13. package/esm2022/chat/cards/hero-card.component.mjs +48 -35
  14. package/esm2022/chat/chat-file.component.mjs +32 -29
  15. package/esm2022/chat/chat-view.mjs +2 -2
  16. package/esm2022/chat/chat.component.mjs +259 -242
  17. package/esm2022/chat/message-attachments.component.mjs +60 -55
  18. package/esm2022/chat/message-box.component.mjs +203 -183
  19. package/esm2022/chat/message-list.component.mjs +249 -209
  20. package/esm2022/chat/message-reference-content.component.mjs +30 -19
  21. package/esm2022/chat/message.component.mjs +301 -281
  22. package/esm2022/chat/suggested-actions.component.mjs +142 -134
  23. package/esm2022/inline-ai-prompt/inlineaiprompt-content.component.mjs +205 -179
  24. package/esm2022/package-metadata.mjs +2 -2
  25. package/fesm2022/progress-kendo-angular-conversational-ui.mjs +1988 -1777
  26. package/package.json +14 -14
  27. package/codemods/template-transformer/index.js +0 -93
@@ -29,24 +29,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.default = default_1;
31
31
  const fs = __importStar(require("fs"));
32
- const index_1 = require("../template-transformer/index");
33
32
  const utils_1 = require("../utils");
34
33
  function default_1(fileInfo, api) {
35
34
  const filePath = fileInfo.path;
35
+ // Handle HTML files and inline templates
36
+ const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeNameValueUpdate)(templateContent, 'kendo-chat', 'user', 'authorId', 'id'));
36
37
  if (filePath.endsWith('.html')) {
37
- if ((0, utils_1.hasKendoInTemplate)(fileInfo.source)) {
38
- let updatedContent = fileInfo.source;
39
- updatedContent = (0, utils_1.htmlBoundAttributeTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-chat', 'user', 'authorId', 'id');
40
- // Only write to file once after all transformations
41
- fs.writeFileSync(filePath, updatedContent, 'utf-8');
38
+ if (htmlResult && htmlResult !== fileInfo.source) {
39
+ fs.writeFileSync(filePath, htmlResult, 'utf-8');
40
+ return htmlResult;
42
41
  }
43
- return;
42
+ return fileInfo.source; // Return original source if no changes
44
43
  }
44
+ // Handle TypeScript property transformations
45
45
  const j = api.jscodeshift;
46
- const rootSource = j(fileInfo.source);
47
- (0, index_1.templateTransformer)(rootSource, j, (root) => {
48
- (0, utils_1.templateBoundAttributeTransformer)(root, 'kendo-chat', 'user', 'authorId', 'id');
49
- });
50
- (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, 'ChatComponent', 'user', 'authorId', 'id');
46
+ const rootSource = j(htmlResult || fileInfo.source);
47
+ (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-conversational-ui', 'ChatComponent', 'user', 'authorId', 'id');
51
48
  return rootSource.toSource();
52
49
  }
@@ -29,25 +29,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.default = default_1;
31
31
  const fs = __importStar(require("fs"));
32
- const index_1 = require("../template-transformer/index");
33
32
  const utils_1 = require("../utils");
34
33
  function default_1(fileInfo, api) {
35
34
  const filePath = fileInfo.path;
35
+ // Handle HTML files and inline templates
36
+ const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeRemoval)(templateContent, 'kendo-chat', 'messageToolbarVisibility'));
36
37
  if (filePath.endsWith('.html')) {
37
- if ((0, utils_1.hasKendoInTemplate)(fileInfo.source)) {
38
- let updatedContent = fileInfo.source;
39
- updatedContent = (0, utils_1.htmlAttributeRemoval)({ ...fileInfo, source: updatedContent }, 'kendo-chat', 'messageToolbarVisibility');
40
- // Only write to file once after all transformations
41
- fs.writeFileSync(filePath, updatedContent, 'utf-8');
38
+ if (htmlResult && htmlResult !== fileInfo.source) {
39
+ fs.writeFileSync(filePath, htmlResult, 'utf-8');
40
+ return htmlResult;
42
41
  }
43
- return;
42
+ return fileInfo.source; // Return original source if no changes
44
43
  }
44
+ // Handle TypeScript property transformations
45
45
  const j = api.jscodeshift;
46
- const rootSource = j(fileInfo.source);
47
- (0, index_1.templateTransformer)(rootSource, j, (root) => {
48
- (0, utils_1.templateAttributeRemoval)(root, 'kendo-chat', 'messageToolbarVisibility');
49
- });
50
- (0, utils_1.tsPropertyRemoval)(fileInfo.source, rootSource, j, 'ChatComponent', 'messageToolbarVisibility');
51
- (0, utils_1.tsComponentPropertyRemoval)(fileInfo.source, rootSource, j, 'ChatComponent', 'messageToolbarVisibility');
46
+ const rootSource = j(htmlResult || fileInfo.source);
47
+ (0, utils_1.tsComponentPropertyRemoval)(fileInfo.source, rootSource, j, '@progress/kendo-angular-conversational-ui', 'ChatComponent', 'messageToolbarVisibility');
52
48
  return rootSource.toSource();
53
49
  }
@@ -13,7 +13,6 @@ function default_1(fileInfo, api) {
13
13
  }
14
14
  const j = api.jscodeshift;
15
15
  const rootSource = j(fileInfo.source);
16
- (0, utils_1.tsPropertyRemoval)(fileInfo.source, rootSource, j, 'ConversationalUIModelFields', 'pinnedByField');
17
- (0, utils_1.tsComponentPropertyRemoval)(fileInfo.source, rootSource, j, 'ConversationalUIModelFields', 'pinnedByField');
16
+ (0, utils_1.tsPropertyRemoval)(fileInfo.source, rootSource, j, '@progress/kendo-angular-conversational-ui', 'ConversationalUIModelFields', 'pinnedByField');
18
17
  return rootSource.toSource();
19
18
  }
@@ -3,7 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { Component, ContentChild, ContentChildren, ElementRef, EventEmitter, HostBinding, Input, NgZone, Output, QueryList, Renderer2, ViewChild } from "@angular/core";
6
- import { NgFor, NgIf, NgTemplateOutlet } from "@angular/common";
6
+ import { NgTemplateOutlet } from "@angular/common";
7
7
  import { Subscription } from "rxjs";
8
8
  import { sparklesIcon, commentIcon, stopSmIcon } from "@progress/kendo-svg-icons";
9
9
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
@@ -300,7 +300,7 @@ export class AIPromptComponent {
300
300
  this.promptRequest.emit(eventArgs);
301
301
  }
302
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: "14.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: [
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
304
  LocalizationService,
305
305
  AIPromptService,
306
306
  ToolbarNavigationService,
@@ -310,82 +310,90 @@ export class AIPromptComponent {
310
310
  }
311
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
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">
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
333
  </ng-container>
334
334
  <div class="k-prompt-header">
335
- <div class="k-toolbar-flat k-toolbar k-toolbar-md"
336
- role="toolbar">
337
- <button *ngFor="let view of viewsArray; let idx = index"
338
- kendoButton
339
- kendoAIPromptToolbarFocusable
340
- type="button"
341
- fillMode="flat"
342
- rounded="full"
343
- themeColor="primary"
344
- [svgIcon]="view.svgIcon"
345
- [icon]="view.icon"
346
- [selected]="idx === activeView"
347
- (click)="viewChange(idx)">
348
- {{view.buttonText}}
349
- </button>
350
-
351
- <ng-template *ngIf="toolbarActionsTemplate"
352
- [ngTemplateOutlet]="toolbarActionsTemplate?.templateRef">
353
- </ng-template>
354
- </div>
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>
355
359
  </div>
356
360
  <div class="k-prompt-content">
357
- <kendo-floatingactionbutton #fabButton *ngIf="streaming && selectedView?.viewType === 'output'"
358
- class="k-prompt-stop-fab"
359
- buttonClass="k-generating k-active"
360
- [positionMode]="fabPositionMode"
361
- [align]="fabAlignment"
362
- [svgIcon]="fabStopGenerationSVGIcon"
363
- icon="stop"
364
- (click)="promptRequestCancel.emit()"
365
- >
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
+ >
366
371
  </kendo-floatingactionbutton>
367
- <div class="k-prompt-view">
368
- <ng-container *ngTemplateOutlet="viewTemplate">
369
- </ng-container>
370
- </div>
372
+ }
373
+ <div class="k-prompt-view">
374
+ <ng-container *ngTemplateOutlet="viewTemplate">
375
+ </ng-container>
376
+ </div>
371
377
  </div>
372
- <div class="k-prompt-footer" *ngIf="selectedView?.viewType === 'prompt'">
378
+ @if (selectedView?.viewType === 'prompt') {
379
+ <div class="k-prompt-footer">
373
380
  <div class="k-actions k-actions-start k-actions-horizontal k-prompt-actions">
374
- <button
375
- kendoButton
376
- type="button"
377
- themeColor="primary"
378
- rounded="full"
379
- [attr.title]="messageFor('generateOutput')"
380
- [attr.aria-label]="messageFor('generateOutput')"
381
- [attr.aria-disabled]="disabledGenerateButton"
382
- [svgIcon]="generateButtonSVGIcon"
383
- [icon]="generateButtonIcon"
384
- [disabled]="disabledGenerateButton"
385
- (click)="handleGenerateOutput()">{{messageFor('generateOutput')}}</button>
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>
386
393
  </div>
387
- </div>
388
- `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoAIPromptLocalizedMessages]" }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: AIPromptToolbarFocusableDirective, selector: "[kendoAIPromptToolbarFocusable]" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FloatingActionButtonComponent, selector: "kendo-floatingactionbutton", inputs: ["themeColor", "size", "rounded", "disabled", "align", "offset", "positionMode", "icon", "svgIcon", "iconClass", "buttonClass", "dialClass", "text", "dialItemAnimation", "tabIndex", "dialItems"], outputs: ["blur", "focus", "dialItemClick", "open", "close"] }] });
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"] }] });
389
397
  }
390
398
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AIPromptComponent, decorators: [{
391
399
  type: Component,
@@ -403,84 +411,92 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
403
411
  ],
404
412
  template: `
405
413
  <ng-container kendoAIPromptLocalizedMessages
406
- i18n-promptView="kendo.aiprompt.promptView|The Toolbar button text for the Prompt view."
407
- promptView="Ask AI"
408
- i18n-outputView="kendo.aiprompt.outputView|The Toolbar button text for the Output view."
409
- outputView="Output"
410
- i18n-generateOutput="kendo.aiprompt.generateOutput|The text for the Generate button in the Prompt view."
411
- generateOutput="Generate"
412
- i18n-promptPlaceholder="kendo.aiprompt.promptPlaceholder|The placeholder text for the Prompt View text area."
413
- promptPlaceholder="Ask or generate content with AI"
414
- i18n-copyOutput="kendo.aiprompt.copyOutput|The Copy button text in each Output view card."
415
- copyOutput="Copy"
416
- i18n-retryGeneration="kendo.aiprompt.retryGeneration|The Retry button text in each Output view card."
417
- retryGeneration="Retry"
418
- i18n-outputTitle="kendo.aiprompt.outputTitle|The title of each Output view card."
419
- outputTitle="Generated with AI"
420
- i18n-outputRetryTitle="kendo.aiprompt.outputRetryTitle|The title of each Output view retry card."
421
- outputRetryTitle="Generated with AI"
422
- i18n-promptSuggestions="kendo.aiprompt.promptSuggestions|The title of the Prompt suggestions button."
423
- promptSuggestions="Prompt suggestions"
424
- i18n-speechToTextButton="kendo.aiprompt.speechToTextButton|The aria-label for the Speech to Text button."
425
- speechToTextButton="Voice input">
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">
426
434
  </ng-container>
427
435
  <div class="k-prompt-header">
428
- <div class="k-toolbar-flat k-toolbar k-toolbar-md"
429
- role="toolbar">
430
- <button *ngFor="let view of viewsArray; let idx = index"
431
- kendoButton
432
- kendoAIPromptToolbarFocusable
433
- type="button"
434
- fillMode="flat"
435
- rounded="full"
436
- themeColor="primary"
437
- [svgIcon]="view.svgIcon"
438
- [icon]="view.icon"
439
- [selected]="idx === activeView"
440
- (click)="viewChange(idx)">
441
- {{view.buttonText}}
442
- </button>
443
-
444
- <ng-template *ngIf="toolbarActionsTemplate"
445
- [ngTemplateOutlet]="toolbarActionsTemplate?.templateRef">
446
- </ng-template>
447
- </div>
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>
448
460
  </div>
449
461
  <div class="k-prompt-content">
450
- <kendo-floatingactionbutton #fabButton *ngIf="streaming && selectedView?.viewType === 'output'"
451
- class="k-prompt-stop-fab"
452
- buttonClass="k-generating k-active"
453
- [positionMode]="fabPositionMode"
454
- [align]="fabAlignment"
455
- [svgIcon]="fabStopGenerationSVGIcon"
456
- icon="stop"
457
- (click)="promptRequestCancel.emit()"
458
- >
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
+ >
459
472
  </kendo-floatingactionbutton>
460
- <div class="k-prompt-view">
461
- <ng-container *ngTemplateOutlet="viewTemplate">
462
- </ng-container>
463
- </div>
473
+ }
474
+ <div class="k-prompt-view">
475
+ <ng-container *ngTemplateOutlet="viewTemplate">
476
+ </ng-container>
477
+ </div>
464
478
  </div>
465
- <div class="k-prompt-footer" *ngIf="selectedView?.viewType === 'prompt'">
479
+ @if (selectedView?.viewType === 'prompt') {
480
+ <div class="k-prompt-footer">
466
481
  <div class="k-actions k-actions-start k-actions-horizontal k-prompt-actions">
467
- <button
468
- kendoButton
469
- type="button"
470
- themeColor="primary"
471
- rounded="full"
472
- [attr.title]="messageFor('generateOutput')"
473
- [attr.aria-label]="messageFor('generateOutput')"
474
- [attr.aria-disabled]="disabledGenerateButton"
475
- [svgIcon]="generateButtonSVGIcon"
476
- [icon]="generateButtonIcon"
477
- [disabled]="disabledGenerateButton"
478
- (click)="handleGenerateOutput()">{{messageFor('generateOutput')}}</button>
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>
479
494
  </div>
480
- </div>
481
- `,
495
+ </div>
496
+ }
497
+ `,
482
498
  standalone: true,
483
- imports: [LocalizedMessagesDirective, NgFor, ButtonComponent, AIPromptToolbarFocusableDirective, NgIf, NgTemplateOutlet, FloatingActionButtonComponent]
499
+ imports: [LocalizedMessagesDirective, ButtonComponent, AIPromptToolbarFocusableDirective, NgTemplateOutlet, FloatingActionButtonComponent]
484
500
  }]
485
501
  }], ctorParameters: () => [{ type: i1.LocalizationService }, { type: i2.AIPromptService }, { type: i3.ToolbarNavigationService }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { hostClasses: [{
486
502
  type: HostBinding,