@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
@@ -18,7 +18,7 @@ import { isChanged, isPresent, processCssValue } from '@progress/kendo-angular-c
18
18
  import { ChatService } from './common/chat.service';
19
19
  import { AppBarComponent } from "@progress/kendo-angular-navigation";
20
20
  import { ChatHeaderTemplateDirective } from './templates/header-template.directive';
21
- import { NgIf, NgTemplateOutlet } from '@angular/common';
21
+ import { NgTemplateOutlet } from '@angular/common';
22
22
  import { KENDO_BUTTON } from '@progress/kendo-angular-buttons';
23
23
  import { pinIcon, xIcon } from '@progress/kendo-svg-icons';
24
24
  import { IconWrapperComponent } from '@progress/kendo-angular-icons';
@@ -350,7 +350,12 @@ export class ChatComponent {
350
350
  * @hidden
351
351
  */
352
352
  get contextMenuActions() {
353
- return transformActions(this.chatService.calculatedContextMenuActions);
353
+ const currentActions = this.chatService.calculatedContextMenuActions;
354
+ if (currentActions !== this._lastContextMenuActionsReference) {
355
+ this._cachedContextMenuActions = transformActions(currentActions);
356
+ this._lastContextMenuActionsReference = currentActions;
357
+ }
358
+ return this._cachedContextMenuActions;
354
359
  }
355
360
  /**
356
361
  * @hidden
@@ -382,6 +387,8 @@ export class ChatComponent {
382
387
  _cachedProcessedMessages = [];
383
388
  _lastMessagesReference = null;
384
389
  _lastModelFields = null;
390
+ _cachedContextMenuActions = [];
391
+ _lastContextMenuActionsReference = null;
385
392
  constructor(localization, zone, renderer, element, chatService) {
386
393
  this.localization = localization;
387
394
  this.zone = zone;
@@ -571,7 +578,7 @@ export class ChatComponent {
571
578
  });
572
579
  }
573
580
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChatComponent, deps: [{ token: i1.LocalizationService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i2.ChatService }], target: i0.ɵɵFactoryTarget.Component });
574
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ChatComponent, isStandalone: true, selector: "kendo-chat", inputs: { messages: "messages", authorId: "authorId", messageBoxType: "messageBoxType", height: "height", width: "width", placeholder: "placeholder", messageWidthMode: "messageWidthMode", timestampVisibility: "timestampVisibility", showUsername: "showUsername", showAvatar: "showAvatar", allowMessageCollapse: "allowMessageCollapse", enableSpeechToText: "enableSpeechToText", enableFileSelect: "enableFileSelect", messageToolbarActions: "messageToolbarActions", inputValue: "inputValue", authorMessageSettings: "authorMessageSettings", receiverMessageSettings: "receiverMessageSettings", messageContextMenuActions: "messageContextMenuActions", fileActions: "fileActions", messageFilesLayout: "messageFilesLayout", suggestionsLayout: "suggestionsLayout", quickActionsLayout: "quickActionsLayout", suggestions: "suggestions", sendButtonSettings: "sendButtonSettings", modelFields: "modelFields" }, outputs: { sendMessage: "sendMessage", toolbarActionClick: "toolbarActionClick", contextMenuActionClick: "contextMenuActionClick", fileActionClick: "fileActionClick", download: "download", executeAction: "executeAction", suggestionExecute: "suggestionExecute", fileSelect: "fileSelect", fileRemove: "fileRemove", unpin: "unpin", inputValueChange: "inputValueChange" }, host: { properties: { "class": "this.className", "attr.dir": "this.dirAttr" } }, providers: [
581
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ChatComponent, isStandalone: true, selector: "kendo-chat", inputs: { messages: "messages", authorId: "authorId", messageBoxType: "messageBoxType", height: "height", width: "width", placeholder: "placeholder", messageWidthMode: "messageWidthMode", timestampVisibility: "timestampVisibility", showUsername: "showUsername", showAvatar: "showAvatar", allowMessageCollapse: "allowMessageCollapse", enableSpeechToText: "enableSpeechToText", enableFileSelect: "enableFileSelect", messageToolbarActions: "messageToolbarActions", inputValue: "inputValue", authorMessageSettings: "authorMessageSettings", receiverMessageSettings: "receiverMessageSettings", messageContextMenuActions: "messageContextMenuActions", fileActions: "fileActions", messageFilesLayout: "messageFilesLayout", suggestionsLayout: "suggestionsLayout", quickActionsLayout: "quickActionsLayout", suggestions: "suggestions", sendButtonSettings: "sendButtonSettings", modelFields: "modelFields" }, outputs: { sendMessage: "sendMessage", toolbarActionClick: "toolbarActionClick", contextMenuActionClick: "contextMenuActionClick", fileActionClick: "fileActionClick", download: "download", executeAction: "executeAction", suggestionExecute: "suggestionExecute", fileSelect: "fileSelect", fileRemove: "fileRemove", unpin: "unpin", inputValueChange: "inputValueChange" }, host: { properties: { "class": "this.className", "attr.dir": "this.dirAttr" } }, providers: [
575
582
  LocalizationService,
576
583
  ChatService,
577
584
  SuggestionsScrollService,
@@ -581,139 +588,144 @@ export class ChatComponent {
581
588
  }
582
589
  ], queries: [{ propertyName: "attachmentTemplate", first: true, predicate: AttachmentTemplateDirective, descendants: true }, { propertyName: "chatHeaderTemplate", first: true, predicate: ChatHeaderTemplateDirective, descendants: true }, { propertyName: "chatNoDataTemplate", first: true, predicate: NoDataTemplateDirective, descendants: true }, { propertyName: "authorMessageContentTemplate", first: true, predicate: AuthorMessageContentTemplateDirective, descendants: true }, { propertyName: "receiverMessageContentTemplate", first: true, predicate: ReceiverMessageContentTemplateDirective, descendants: true }, { propertyName: "messageContentTemplate", first: true, predicate: MessageContentTemplateDirective, descendants: true }, { propertyName: "authorMessageTemplate", first: true, predicate: AuthorMessageTemplateDirective, descendants: true }, { propertyName: "receiverMessageTemplate", first: true, predicate: ReceiverMessageTemplateDirective, descendants: true }, { propertyName: "messageTemplate", first: true, predicate: MessageTemplateDirective, descendants: true }, { propertyName: "timestampTemplate", first: true, predicate: ChatTimestampTemplateDirective, descendants: true }, { propertyName: "suggestionTemplate", first: true, predicate: ChatSuggestionTemplateDirective, descendants: true }, { propertyName: "statusTemplate", first: true, predicate: ChatStatusTemplateDirective, descendants: true }, { propertyName: "messageBoxTemplate", first: true, predicate: ChatMessageBoxTemplateDirective, descendants: true }, { propertyName: "userStatusTemplate", first: true, predicate: ChatUserStatusTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "messagesContextMenu", first: true, predicate: ["messagesContextMenu"], descendants: true }, { propertyName: "messageBox", first: true, predicate: ["messageBox"], descendants: true }, { propertyName: "messageList", first: true, predicate: ["messageList"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: `
583
590
  <ng-container kendoChatLocalizedMessages
584
- i18n-deletedMessageSenderText="kendo.chat.deletedMessageSenderText|The text that is displayed when the sender deletes a message"
585
- deletedMessageSenderText="You removed this message."
586
-
587
- i18n-deletedMessageReceiverText="kendo.chat.deletedMessageReceiverText|The text that is displayed when the receiver deletes a message"
588
- deletedMessageReceiverText="This message was removed by its sender."
589
-
590
- i18n-messagePlaceholder="kendo.chat.messagePlaceholder|The placholder text of the message text input"
591
- messagePlaceholder="Type a message..."
592
-
593
- i18n-send="kendo.chat.send|The text for the Send button"
594
- send="Send..."
595
-
596
- i18n-messageListLabel="kendo.chat.messageListLabel|The label text for the Message list"
597
- messageListLabel="Message list"
598
-
599
- i18n-messageBoxInputLabel="kendo.chat.messageBoxInputLabel|The label text for the Message input box"
600
- messageBoxInputLabel="Message"
601
-
602
- i18n-messageAttachmentLeftArrow="kendo.chat.messageAttachmentLeftArrow|The text for the left arrow of the message attachments"
603
- messageAttachmentLeftArrow="Previous item"
604
-
605
- i18n-messageAttachmentRightArrow="kendo.chat.messageAttachmentRightArrow|The text for the right arrow of the message attachments"
606
- messageAttachmentRightArrow="Next item"
607
-
608
- i18n-speechToTextButtonTitle="kendo.chat.speechToTextButtonTitle|Sets the Speech to Text button title."
609
- speechToTextButtonTitle="Speech to Text"
610
-
611
- i18n-fileSelectButtonTitle="kendo.chat.fileSelectButtonTitle|Sets the File Select button title."
612
- fileSelectButtonTitle="Select files"
613
-
614
- i18n-removeReplyTitle="kendo.chat.removeReplyTitle|Sets the title of the icon which removes the reply reference in the Message Box."
615
- removeReplyTitle="Remove reply"
616
-
617
- i18n-removeFileTitle="kendo.chat.removeFileTitle|Sets the title of the icon which removes a selected file in the Message Box."
618
- removeFileTitle="Remove file"
619
-
620
- i18n-expandTitle="kendo.chat.expandTitle|Sets the title of the icon which demonstrates that the message can be expanded."
621
- expandTitle="Expand message"
622
-
623
- i18n-collapseTitle="kendo.chat.collapseTitle|Sets the title of the icon which demonstrates that the message can be collapsed."
624
- collapseTitle="Collapse message"
625
-
626
- i18n-fileActionsTitle="kendo.chat.fileActionsTitle|Sets the title of the DropDownButton which opens the File actions."
627
- fileActionsTitle="File actions"
628
-
629
- i18n-downloadAllFilesText="kendo.chat.downloadAllFilesText|Sets the text that is displayed in the download section of the message."
630
- downloadAllFilesText="Download all"
631
-
632
- i18n-previousSuggestionsButtonTitle="kendo.chat.previousSuggestionsButtonTitle|The title of the button that scrolls to the previous suggestions"
633
- previousSuggestionsButtonTitle="Scroll left"
634
-
635
- i18n-nextSuggestionsButtonTitle="kendo.chat.nextSuggestionsButtonTitle|The title of the button that scrolls to the next suggestions"
636
- nextSuggestionsButtonTitle="Scroll right"
637
- >
591
+ i18n-deletedMessageSenderText="kendo.chat.deletedMessageSenderText|The text that is displayed when the sender deletes a message"
592
+ deletedMessageSenderText="You removed this message."
593
+
594
+ i18n-deletedMessageReceiverText="kendo.chat.deletedMessageReceiverText|The text that is displayed when the receiver deletes a message"
595
+ deletedMessageReceiverText="This message was removed by its sender."
596
+
597
+ i18n-messagePlaceholder="kendo.chat.messagePlaceholder|The placholder text of the message text input"
598
+ messagePlaceholder="Type a message..."
599
+
600
+ i18n-send="kendo.chat.send|The text for the Send button"
601
+ send="Send..."
602
+
603
+ i18n-messageListLabel="kendo.chat.messageListLabel|The label text for the Message list"
604
+ messageListLabel="Message list"
605
+
606
+ i18n-messageBoxInputLabel="kendo.chat.messageBoxInputLabel|The label text for the Message input box"
607
+ messageBoxInputLabel="Message"
608
+
609
+ i18n-messageAttachmentLeftArrow="kendo.chat.messageAttachmentLeftArrow|The text for the left arrow of the message attachments"
610
+ messageAttachmentLeftArrow="Previous item"
611
+
612
+ i18n-messageAttachmentRightArrow="kendo.chat.messageAttachmentRightArrow|The text for the right arrow of the message attachments"
613
+ messageAttachmentRightArrow="Next item"
614
+
615
+ i18n-speechToTextButtonTitle="kendo.chat.speechToTextButtonTitle|Sets the Speech to Text button title."
616
+ speechToTextButtonTitle="Speech to Text"
617
+
618
+ i18n-fileSelectButtonTitle="kendo.chat.fileSelectButtonTitle|Sets the File Select button title."
619
+ fileSelectButtonTitle="Select files"
620
+
621
+ i18n-removeReplyTitle="kendo.chat.removeReplyTitle|Sets the title of the icon which removes the reply reference in the Message Box."
622
+ removeReplyTitle="Remove reply"
623
+
624
+ i18n-removeFileTitle="kendo.chat.removeFileTitle|Sets the title of the icon which removes a selected file in the Message Box."
625
+ removeFileTitle="Remove file"
626
+
627
+ i18n-expandTitle="kendo.chat.expandTitle|Sets the title of the icon which demonstrates that the message can be expanded."
628
+ expandTitle="Expand message"
629
+
630
+ i18n-collapseTitle="kendo.chat.collapseTitle|Sets the title of the icon which demonstrates that the message can be collapsed."
631
+ collapseTitle="Collapse message"
632
+
633
+ i18n-fileActionsTitle="kendo.chat.fileActionsTitle|Sets the title of the DropDownButton which opens the File actions."
634
+ fileActionsTitle="File actions"
635
+
636
+ i18n-downloadAllFilesText="kendo.chat.downloadAllFilesText|Sets the text that is displayed in the download section of the message."
637
+ downloadAllFilesText="Download all"
638
+
639
+ i18n-previousSuggestionsButtonTitle="kendo.chat.previousSuggestionsButtonTitle|The title of the button that scrolls to the previous suggestions"
640
+ previousSuggestionsButtonTitle="Scroll left"
641
+
642
+ i18n-nextSuggestionsButtonTitle="kendo.chat.nextSuggestionsButtonTitle|The title of the button that scrolls to the next suggestions"
643
+ nextSuggestionsButtonTitle="Scroll right"
644
+ >
638
645
  </ng-container>
639
-
640
- <kendo-appbar *ngIf="chatHeaderTemplate" class="k-chat-header" positionMode="sticky" themeColor="inherit">
646
+
647
+ @if (chatHeaderTemplate) {
648
+ <kendo-appbar class="k-chat-header" positionMode="sticky" themeColor="inherit">
641
649
  <ng-container *ngTemplateOutlet="chatHeaderTemplate.templateRef"></ng-container>
642
- </kendo-appbar>
643
- <div class="k-message-reference k-message-reference-receiver k-message-pinned" *ngIf="pinnedMessage" (click)="scrollToPinnedMessage()">
650
+ </kendo-appbar>
651
+ }
652
+ @if (pinnedMessage) {
653
+ <div class="k-message-reference k-message-reference-receiver k-message-pinned" (click)="scrollToPinnedMessage()">
644
654
  <kendo-icon-wrapper
645
- size="xlarge"
646
- name="pin"
647
- [svgIcon]="pinIcon"
648
- >
655
+ size="xlarge"
656
+ name="pin"
657
+ [svgIcon]="pinIcon"
658
+ >
649
659
  </kendo-icon-wrapper>
650
660
  <chat-message-reference-content [message]="pinnedMessage"></chat-message-reference-content>
651
661
  <span class="k-spacer"></span>
652
662
  <button kendoButton [svgIcon]="deleteIcon" (click)="unpin.emit(pinnedMessage)" fillMode="flat"></button>
653
- </div>
663
+ </div>
664
+ }
654
665
  <div
655
- #messageList
656
- class="k-message-list"
657
- aria-live="polite"
658
- role="log"
659
- kendoChatScrollAnchor
660
- [attr.aria-label]="textFor('messageListLabel')"
661
- #anchor="scrollAnchor"
662
- [(autoScroll)]="autoScroll"
663
- >
664
- <div *ngIf="processedMessages && processedMessages.length === 0; else chatMessageList" class="k-message-list-content k-message-list-content-empty">
665
- <ng-template
666
- [ngTemplateOutlet]="chatNoDataTemplate?.templateRef">
667
- </ng-template>
666
+ #messageList
667
+ class="k-message-list"
668
+ aria-live="polite"
669
+ role="log"
670
+ kendoChatScrollAnchor
671
+ [attr.aria-label]="textFor('messageListLabel')"
672
+ #anchor="scrollAnchor"
673
+ [(autoScroll)]="autoScroll"
674
+ >
675
+ @if (processedMessages && processedMessages.length === 0) {
676
+ <div class="k-message-list-content k-message-list-content-empty">
677
+ <ng-template
678
+ [ngTemplateOutlet]="chatNoDataTemplate?.templateRef">
679
+ </ng-template>
668
680
  </div>
669
- <ng-template #chatMessageList>
670
- <kendo-chat-message-list
671
- [messages]="processedMessages"
672
- [authorMessageContentTemplate]="authorMessageContentTemplate"
673
- [receiverMessageContentTemplate]="receiverMessageContentTemplate"
674
- [messageContentTemplate]="messageContentTemplate"
675
- [authorMessageTemplate]="authorMessageTemplate"
676
- [receiverMessageTemplate]="receiverMessageTemplate"
677
- [messageTemplate]="messageTemplate"
678
- [timestampTemplate]="timestampTemplate"
679
- [statusTemplate]="statusTemplate"
680
- [userStatusTemplate]="userStatusTemplate"
681
- [localization]="localizationText"
682
- [attachmentTemplate]="attachmentTemplate"
683
- [authorId]="authorId"
684
- (executeAction)="dispatchAction($event)"
685
- (resize)="anchor.scrollToBottom()"
686
- (navigate)="this.autoScroll = false"
687
- >
688
- </kendo-chat-message-list>
689
- </ng-template>
681
+ } @else {
682
+ <kendo-chat-message-list
683
+ [messages]="processedMessages"
684
+ [authorMessageContentTemplate]="authorMessageContentTemplate"
685
+ [receiverMessageContentTemplate]="receiverMessageContentTemplate"
686
+ [messageContentTemplate]="messageContentTemplate"
687
+ [authorMessageTemplate]="authorMessageTemplate"
688
+ [receiverMessageTemplate]="receiverMessageTemplate"
689
+ [messageTemplate]="messageTemplate"
690
+ [timestampTemplate]="timestampTemplate"
691
+ [statusTemplate]="statusTemplate"
692
+ [userStatusTemplate]="userStatusTemplate"
693
+ [localization]="localizationText"
694
+ [attachmentTemplate]="attachmentTemplate"
695
+ [authorId]="authorId"
696
+ (executeAction)="dispatchAction($event)"
697
+ (resize)="anchor.scrollToBottom()"
698
+ (navigate)="this.autoScroll = false"
699
+ >
700
+ </kendo-chat-message-list>
701
+ }
690
702
  </div>
691
703
  <kendo-message-box
692
- #messageBox
693
- [messageBoxTemplate]="messageBoxTemplate"
694
- [suggestionTemplate]="suggestionTemplate"
695
- [suggestions]="suggestions"
696
- [placeholder]="placeholder"
697
- [authorId]="authorId"
698
- [autoScroll]="autoScroll"
699
- [inputValue]="inputValue"
700
- [localization]="localizationText"
701
- (sendMessage)="sendMessage.emit($event)"
702
- (executeSuggestion)="suggestionExecute.emit($event)"
703
- (fileSelect)="fileSelect.emit($event)"
704
- (fileRemove)="fileRemove.emit($event)"
705
- >
704
+ #messageBox
705
+ [messageBoxTemplate]="messageBoxTemplate"
706
+ [suggestionTemplate]="suggestionTemplate"
707
+ [suggestions]="suggestions"
708
+ [placeholder]="placeholder"
709
+ [authorId]="authorId"
710
+ [autoScroll]="autoScroll"
711
+ [inputValue]="inputValue"
712
+ [localization]="localizationText"
713
+ (sendMessage)="sendMessage.emit($event)"
714
+ (executeSuggestion)="suggestionExecute.emit($event)"
715
+ (fileSelect)="fileSelect.emit($event)"
716
+ (fileRemove)="fileRemove.emit($event)"
717
+ >
706
718
  </kendo-message-box>
707
-
719
+
708
720
  <kendo-contextmenu
709
- #messagesContextMenu
710
- [items]="contextMenuActions"
711
- [popupAlign]="{ horizontal: 'right', vertical: 'top' }"
712
- [collision]="{ horizontal: 'flip', vertical: 'flip'}"
713
- (popupClose)="handleMenuClose($event)"
714
- (select)="onContextMenuAction($event.item.originalAction)"
721
+ #messagesContextMenu
722
+ [items]="contextMenuActions"
723
+ [popupAlign]="{ horizontal: 'right', vertical: 'top' }"
724
+ [collision]="{ horizontal: 'flip', vertical: 'flip'}"
725
+ (popupClose)="handleMenuClose($event)"
726
+ (select)="onContextMenuAction($event.item.originalAction)"
715
727
  ></kendo-contextmenu>
716
- `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoChatLocalizedMessages]" }, { kind: "directive", type: ScrollAnchorDirective, selector: "[kendoChatScrollAnchor]", inputs: ["autoScroll"], outputs: ["autoScrollChange"], exportAs: ["scrollAnchor"] }, { kind: "component", type: MessageListComponent, selector: "kendo-chat-message-list", inputs: ["messages", "attachmentTemplate", "authorMessageContentTemplate", "receiverMessageContentTemplate", "messageContentTemplate", "authorMessageTemplate", "receiverMessageTemplate", "messageTemplate", "timestampTemplate", "statusTemplate", "userStatusTemplate", "localization", "authorId"], outputs: ["executeAction", "navigate", "resize"] }, { kind: "component", type: MessageBoxComponent, selector: "kendo-message-box", inputs: ["authorId", "autoScroll", "suggestions", "placeholder", "inputValue", "localization", "messageBoxTemplate", "suggestionTemplate"], outputs: ["sendMessage", "executeSuggestion", "fileSelect", "fileRemove"] }, { kind: "component", type: MessageReferenceComponent, selector: "chat-message-reference-content", inputs: ["message"] }, { kind: "component", type: AppBarComponent, selector: "kendo-appbar", inputs: ["position", "positionMode", "themeColor"], exportAs: ["kendoAppBar"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: i3.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: "component", type: ContextMenuComponent, selector: "kendo-contextmenu", inputs: ["showOn", "target", "filter", "alignToAnchor", "vertical", "popupAnimate", "popupAlign", "anchorAlign", "collision", "appendTo", "ariaLabel"], outputs: ["popupOpen", "popupClose", "select", "open", "close"], exportAs: ["kendoContextMenu"] }] });
728
+ `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoChatLocalizedMessages]" }, { kind: "directive", type: ScrollAnchorDirective, selector: "[kendoChatScrollAnchor]", inputs: ["autoScroll"], outputs: ["autoScrollChange"], exportAs: ["scrollAnchor"] }, { kind: "component", type: MessageListComponent, selector: "kendo-chat-message-list", inputs: ["messages", "attachmentTemplate", "authorMessageContentTemplate", "receiverMessageContentTemplate", "messageContentTemplate", "authorMessageTemplate", "receiverMessageTemplate", "messageTemplate", "timestampTemplate", "statusTemplate", "userStatusTemplate", "localization", "authorId"], outputs: ["executeAction", "navigate", "resize"] }, { kind: "component", type: MessageBoxComponent, selector: "kendo-message-box", inputs: ["authorId", "autoScroll", "suggestions", "placeholder", "inputValue", "localization", "messageBoxTemplate", "suggestionTemplate"], outputs: ["sendMessage", "executeSuggestion", "fileSelect", "fileRemove"] }, { kind: "component", type: MessageReferenceComponent, selector: "chat-message-reference-content", inputs: ["message"] }, { kind: "component", type: AppBarComponent, selector: "kendo-appbar", inputs: ["position", "positionMode", "themeColor"], exportAs: ["kendoAppBar"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: i3.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: "component", type: ContextMenuComponent, selector: "kendo-contextmenu", inputs: ["showOn", "target", "filter", "alignToAnchor", "vertical", "popupAnimate", "popupAlign", "anchorAlign", "collision", "appendTo", "ariaLabel"], outputs: ["popupOpen", "popupClose", "select", "open", "close"], exportAs: ["kendoContextMenu"] }] });
717
729
  }
718
730
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChatComponent, decorators: [{
719
731
  type: Component,
@@ -730,141 +742,146 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
730
742
  selector: 'kendo-chat',
731
743
  template: `
732
744
  <ng-container kendoChatLocalizedMessages
733
- i18n-deletedMessageSenderText="kendo.chat.deletedMessageSenderText|The text that is displayed when the sender deletes a message"
734
- deletedMessageSenderText="You removed this message."
735
-
736
- i18n-deletedMessageReceiverText="kendo.chat.deletedMessageReceiverText|The text that is displayed when the receiver deletes a message"
737
- deletedMessageReceiverText="This message was removed by its sender."
738
-
739
- i18n-messagePlaceholder="kendo.chat.messagePlaceholder|The placholder text of the message text input"
740
- messagePlaceholder="Type a message..."
741
-
742
- i18n-send="kendo.chat.send|The text for the Send button"
743
- send="Send..."
744
-
745
- i18n-messageListLabel="kendo.chat.messageListLabel|The label text for the Message list"
746
- messageListLabel="Message list"
747
-
748
- i18n-messageBoxInputLabel="kendo.chat.messageBoxInputLabel|The label text for the Message input box"
749
- messageBoxInputLabel="Message"
750
-
751
- i18n-messageAttachmentLeftArrow="kendo.chat.messageAttachmentLeftArrow|The text for the left arrow of the message attachments"
752
- messageAttachmentLeftArrow="Previous item"
753
-
754
- i18n-messageAttachmentRightArrow="kendo.chat.messageAttachmentRightArrow|The text for the right arrow of the message attachments"
755
- messageAttachmentRightArrow="Next item"
756
-
757
- i18n-speechToTextButtonTitle="kendo.chat.speechToTextButtonTitle|Sets the Speech to Text button title."
758
- speechToTextButtonTitle="Speech to Text"
759
-
760
- i18n-fileSelectButtonTitle="kendo.chat.fileSelectButtonTitle|Sets the File Select button title."
761
- fileSelectButtonTitle="Select files"
762
-
763
- i18n-removeReplyTitle="kendo.chat.removeReplyTitle|Sets the title of the icon which removes the reply reference in the Message Box."
764
- removeReplyTitle="Remove reply"
765
-
766
- i18n-removeFileTitle="kendo.chat.removeFileTitle|Sets the title of the icon which removes a selected file in the Message Box."
767
- removeFileTitle="Remove file"
768
-
769
- i18n-expandTitle="kendo.chat.expandTitle|Sets the title of the icon which demonstrates that the message can be expanded."
770
- expandTitle="Expand message"
771
-
772
- i18n-collapseTitle="kendo.chat.collapseTitle|Sets the title of the icon which demonstrates that the message can be collapsed."
773
- collapseTitle="Collapse message"
774
-
775
- i18n-fileActionsTitle="kendo.chat.fileActionsTitle|Sets the title of the DropDownButton which opens the File actions."
776
- fileActionsTitle="File actions"
777
-
778
- i18n-downloadAllFilesText="kendo.chat.downloadAllFilesText|Sets the text that is displayed in the download section of the message."
779
- downloadAllFilesText="Download all"
780
-
781
- i18n-previousSuggestionsButtonTitle="kendo.chat.previousSuggestionsButtonTitle|The title of the button that scrolls to the previous suggestions"
782
- previousSuggestionsButtonTitle="Scroll left"
783
-
784
- i18n-nextSuggestionsButtonTitle="kendo.chat.nextSuggestionsButtonTitle|The title of the button that scrolls to the next suggestions"
785
- nextSuggestionsButtonTitle="Scroll right"
786
- >
745
+ i18n-deletedMessageSenderText="kendo.chat.deletedMessageSenderText|The text that is displayed when the sender deletes a message"
746
+ deletedMessageSenderText="You removed this message."
747
+
748
+ i18n-deletedMessageReceiverText="kendo.chat.deletedMessageReceiverText|The text that is displayed when the receiver deletes a message"
749
+ deletedMessageReceiverText="This message was removed by its sender."
750
+
751
+ i18n-messagePlaceholder="kendo.chat.messagePlaceholder|The placholder text of the message text input"
752
+ messagePlaceholder="Type a message..."
753
+
754
+ i18n-send="kendo.chat.send|The text for the Send button"
755
+ send="Send..."
756
+
757
+ i18n-messageListLabel="kendo.chat.messageListLabel|The label text for the Message list"
758
+ messageListLabel="Message list"
759
+
760
+ i18n-messageBoxInputLabel="kendo.chat.messageBoxInputLabel|The label text for the Message input box"
761
+ messageBoxInputLabel="Message"
762
+
763
+ i18n-messageAttachmentLeftArrow="kendo.chat.messageAttachmentLeftArrow|The text for the left arrow of the message attachments"
764
+ messageAttachmentLeftArrow="Previous item"
765
+
766
+ i18n-messageAttachmentRightArrow="kendo.chat.messageAttachmentRightArrow|The text for the right arrow of the message attachments"
767
+ messageAttachmentRightArrow="Next item"
768
+
769
+ i18n-speechToTextButtonTitle="kendo.chat.speechToTextButtonTitle|Sets the Speech to Text button title."
770
+ speechToTextButtonTitle="Speech to Text"
771
+
772
+ i18n-fileSelectButtonTitle="kendo.chat.fileSelectButtonTitle|Sets the File Select button title."
773
+ fileSelectButtonTitle="Select files"
774
+
775
+ i18n-removeReplyTitle="kendo.chat.removeReplyTitle|Sets the title of the icon which removes the reply reference in the Message Box."
776
+ removeReplyTitle="Remove reply"
777
+
778
+ i18n-removeFileTitle="kendo.chat.removeFileTitle|Sets the title of the icon which removes a selected file in the Message Box."
779
+ removeFileTitle="Remove file"
780
+
781
+ i18n-expandTitle="kendo.chat.expandTitle|Sets the title of the icon which demonstrates that the message can be expanded."
782
+ expandTitle="Expand message"
783
+
784
+ i18n-collapseTitle="kendo.chat.collapseTitle|Sets the title of the icon which demonstrates that the message can be collapsed."
785
+ collapseTitle="Collapse message"
786
+
787
+ i18n-fileActionsTitle="kendo.chat.fileActionsTitle|Sets the title of the DropDownButton which opens the File actions."
788
+ fileActionsTitle="File actions"
789
+
790
+ i18n-downloadAllFilesText="kendo.chat.downloadAllFilesText|Sets the text that is displayed in the download section of the message."
791
+ downloadAllFilesText="Download all"
792
+
793
+ i18n-previousSuggestionsButtonTitle="kendo.chat.previousSuggestionsButtonTitle|The title of the button that scrolls to the previous suggestions"
794
+ previousSuggestionsButtonTitle="Scroll left"
795
+
796
+ i18n-nextSuggestionsButtonTitle="kendo.chat.nextSuggestionsButtonTitle|The title of the button that scrolls to the next suggestions"
797
+ nextSuggestionsButtonTitle="Scroll right"
798
+ >
787
799
  </ng-container>
788
-
789
- <kendo-appbar *ngIf="chatHeaderTemplate" class="k-chat-header" positionMode="sticky" themeColor="inherit">
800
+
801
+ @if (chatHeaderTemplate) {
802
+ <kendo-appbar class="k-chat-header" positionMode="sticky" themeColor="inherit">
790
803
  <ng-container *ngTemplateOutlet="chatHeaderTemplate.templateRef"></ng-container>
791
- </kendo-appbar>
792
- <div class="k-message-reference k-message-reference-receiver k-message-pinned" *ngIf="pinnedMessage" (click)="scrollToPinnedMessage()">
804
+ </kendo-appbar>
805
+ }
806
+ @if (pinnedMessage) {
807
+ <div class="k-message-reference k-message-reference-receiver k-message-pinned" (click)="scrollToPinnedMessage()">
793
808
  <kendo-icon-wrapper
794
- size="xlarge"
795
- name="pin"
796
- [svgIcon]="pinIcon"
797
- >
809
+ size="xlarge"
810
+ name="pin"
811
+ [svgIcon]="pinIcon"
812
+ >
798
813
  </kendo-icon-wrapper>
799
814
  <chat-message-reference-content [message]="pinnedMessage"></chat-message-reference-content>
800
815
  <span class="k-spacer"></span>
801
816
  <button kendoButton [svgIcon]="deleteIcon" (click)="unpin.emit(pinnedMessage)" fillMode="flat"></button>
802
- </div>
817
+ </div>
818
+ }
803
819
  <div
804
- #messageList
805
- class="k-message-list"
806
- aria-live="polite"
807
- role="log"
808
- kendoChatScrollAnchor
809
- [attr.aria-label]="textFor('messageListLabel')"
810
- #anchor="scrollAnchor"
811
- [(autoScroll)]="autoScroll"
812
- >
813
- <div *ngIf="processedMessages && processedMessages.length === 0; else chatMessageList" class="k-message-list-content k-message-list-content-empty">
814
- <ng-template
815
- [ngTemplateOutlet]="chatNoDataTemplate?.templateRef">
816
- </ng-template>
820
+ #messageList
821
+ class="k-message-list"
822
+ aria-live="polite"
823
+ role="log"
824
+ kendoChatScrollAnchor
825
+ [attr.aria-label]="textFor('messageListLabel')"
826
+ #anchor="scrollAnchor"
827
+ [(autoScroll)]="autoScroll"
828
+ >
829
+ @if (processedMessages && processedMessages.length === 0) {
830
+ <div class="k-message-list-content k-message-list-content-empty">
831
+ <ng-template
832
+ [ngTemplateOutlet]="chatNoDataTemplate?.templateRef">
833
+ </ng-template>
817
834
  </div>
818
- <ng-template #chatMessageList>
819
- <kendo-chat-message-list
820
- [messages]="processedMessages"
821
- [authorMessageContentTemplate]="authorMessageContentTemplate"
822
- [receiverMessageContentTemplate]="receiverMessageContentTemplate"
823
- [messageContentTemplate]="messageContentTemplate"
824
- [authorMessageTemplate]="authorMessageTemplate"
825
- [receiverMessageTemplate]="receiverMessageTemplate"
826
- [messageTemplate]="messageTemplate"
827
- [timestampTemplate]="timestampTemplate"
828
- [statusTemplate]="statusTemplate"
829
- [userStatusTemplate]="userStatusTemplate"
830
- [localization]="localizationText"
831
- [attachmentTemplate]="attachmentTemplate"
832
- [authorId]="authorId"
833
- (executeAction)="dispatchAction($event)"
834
- (resize)="anchor.scrollToBottom()"
835
- (navigate)="this.autoScroll = false"
836
- >
837
- </kendo-chat-message-list>
838
- </ng-template>
835
+ } @else {
836
+ <kendo-chat-message-list
837
+ [messages]="processedMessages"
838
+ [authorMessageContentTemplate]="authorMessageContentTemplate"
839
+ [receiverMessageContentTemplate]="receiverMessageContentTemplate"
840
+ [messageContentTemplate]="messageContentTemplate"
841
+ [authorMessageTemplate]="authorMessageTemplate"
842
+ [receiverMessageTemplate]="receiverMessageTemplate"
843
+ [messageTemplate]="messageTemplate"
844
+ [timestampTemplate]="timestampTemplate"
845
+ [statusTemplate]="statusTemplate"
846
+ [userStatusTemplate]="userStatusTemplate"
847
+ [localization]="localizationText"
848
+ [attachmentTemplate]="attachmentTemplate"
849
+ [authorId]="authorId"
850
+ (executeAction)="dispatchAction($event)"
851
+ (resize)="anchor.scrollToBottom()"
852
+ (navigate)="this.autoScroll = false"
853
+ >
854
+ </kendo-chat-message-list>
855
+ }
839
856
  </div>
840
857
  <kendo-message-box
841
- #messageBox
842
- [messageBoxTemplate]="messageBoxTemplate"
843
- [suggestionTemplate]="suggestionTemplate"
844
- [suggestions]="suggestions"
845
- [placeholder]="placeholder"
846
- [authorId]="authorId"
847
- [autoScroll]="autoScroll"
848
- [inputValue]="inputValue"
849
- [localization]="localizationText"
850
- (sendMessage)="sendMessage.emit($event)"
851
- (executeSuggestion)="suggestionExecute.emit($event)"
852
- (fileSelect)="fileSelect.emit($event)"
853
- (fileRemove)="fileRemove.emit($event)"
854
- >
858
+ #messageBox
859
+ [messageBoxTemplate]="messageBoxTemplate"
860
+ [suggestionTemplate]="suggestionTemplate"
861
+ [suggestions]="suggestions"
862
+ [placeholder]="placeholder"
863
+ [authorId]="authorId"
864
+ [autoScroll]="autoScroll"
865
+ [inputValue]="inputValue"
866
+ [localization]="localizationText"
867
+ (sendMessage)="sendMessage.emit($event)"
868
+ (executeSuggestion)="suggestionExecute.emit($event)"
869
+ (fileSelect)="fileSelect.emit($event)"
870
+ (fileRemove)="fileRemove.emit($event)"
871
+ >
855
872
  </kendo-message-box>
856
-
873
+
857
874
  <kendo-contextmenu
858
- #messagesContextMenu
859
- [items]="contextMenuActions"
860
- [popupAlign]="{ horizontal: 'right', vertical: 'top' }"
861
- [collision]="{ horizontal: 'flip', vertical: 'flip'}"
862
- (popupClose)="handleMenuClose($event)"
863
- (select)="onContextMenuAction($event.item.originalAction)"
875
+ #messagesContextMenu
876
+ [items]="contextMenuActions"
877
+ [popupAlign]="{ horizontal: 'right', vertical: 'top' }"
878
+ [collision]="{ horizontal: 'flip', vertical: 'flip'}"
879
+ (popupClose)="handleMenuClose($event)"
880
+ (select)="onContextMenuAction($event.item.originalAction)"
864
881
  ></kendo-contextmenu>
865
- `,
882
+ `,
866
883
  standalone: true,
867
- imports: [LocalizedMessagesDirective, ScrollAnchorDirective, MessageListComponent, MessageBoxComponent, MessageReferenceComponent, AppBarComponent, NgTemplateOutlet, NgIf, IconWrapperComponent, KENDO_BUTTON, ContextMenuComponent]
884
+ imports: [LocalizedMessagesDirective, ScrollAnchorDirective, MessageListComponent, MessageBoxComponent, MessageReferenceComponent, AppBarComponent, NgTemplateOutlet, IconWrapperComponent, KENDO_BUTTON, ContextMenuComponent]
868
885
  }]
869
886
  }], ctorParameters: () => [{ type: i1.LocalizationService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i2.ChatService }], propDecorators: { messages: [{
870
887
  type: Input