@progress/kendo-react-conversational-ui 11.4.0 → 12.0.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 (76) hide show
  1. package/ai-prompt/views/AIPromptView.js +2 -2
  2. package/ai-prompt/views/AIPromptView.mjs +26 -26
  3. package/chat/components/Action.js +8 -0
  4. package/chat/components/Action.mjs +37 -0
  5. package/chat/components/ActionGroup.js +8 -0
  6. package/chat/components/ActionGroup.mjs +56 -0
  7. package/chat/components/Attachment.js +8 -0
  8. package/chat/components/Attachment.mjs +23 -0
  9. package/chat/components/AttachmentGroup.js +8 -0
  10. package/chat/components/AttachmentGroup.mjs +66 -0
  11. package/chat/components/Chat.js +8 -0
  12. package/chat/components/Chat.mjs +388 -0
  13. package/chat/components/ChatContext.js +8 -0
  14. package/{components/base/FocusableUponSelection.mjs → chat/components/ChatContext.mjs} +10 -10
  15. package/chat/components/ChatMessage.js +8 -0
  16. package/chat/components/ChatMessage.mjs +274 -0
  17. package/chat/components/DateMarker.js +8 -0
  18. package/chat/components/DateMarker.mjs +22 -0
  19. package/chat/components/Header.js +8 -0
  20. package/{utils.mjs → chat/components/Header.mjs} +4 -2
  21. package/chat/components/MessageGroup.js +8 -0
  22. package/chat/components/MessageGroup.mjs +88 -0
  23. package/chat/components/NewMessage.js +8 -0
  24. package/chat/components/NewMessage.mjs +264 -0
  25. package/chat/components/Notification.js +8 -0
  26. package/chat/components/Notification.mjs +24 -0
  27. package/chat/components/SuggestionsGroup.js +1 -1
  28. package/chat/components/SuggestionsGroup.mjs +40 -23
  29. package/chat/components/elements/FileBox.js +8 -0
  30. package/chat/components/elements/FileBox.mjs +72 -0
  31. package/chat/components/elements/PinnedMessage.js +8 -0
  32. package/chat/components/elements/PinnedMessage.mjs +46 -0
  33. package/chat/components/templates/HeroCard.js +8 -0
  34. package/chat/components/templates/HeroCard.mjs +26 -0
  35. package/chat/utils/fieldMapping.js +8 -0
  36. package/chat/utils/fieldMapping.mjs +79 -0
  37. package/chat/utils.js +8 -0
  38. package/chat/utils.mjs +65 -0
  39. package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
  40. package/index.d.mts +427 -169
  41. package/index.d.ts +427 -169
  42. package/index.js +1 -1
  43. package/index.mjs +34 -27
  44. package/messages/index.js +1 -1
  45. package/messages/index.mjs +38 -16
  46. package/package-metadata.js +1 -1
  47. package/package-metadata.mjs +2 -2
  48. package/package.json +11 -7
  49. package/components/Action.js +0 -8
  50. package/components/Action.mjs +0 -45
  51. package/components/ActionGroup.js +0 -8
  52. package/components/ActionGroup.mjs +0 -36
  53. package/components/Attachment.js +0 -8
  54. package/components/Attachment.mjs +0 -50
  55. package/components/AttachmentGroup.js +0 -8
  56. package/components/AttachmentGroup.mjs +0 -64
  57. package/components/Chat.js +0 -8
  58. package/components/Chat.mjs +0 -214
  59. package/components/ChatMessage.js +0 -8
  60. package/components/ChatMessage.mjs +0 -63
  61. package/components/ChatToolbar.js +0 -8
  62. package/components/ChatToolbar.mjs +0 -33
  63. package/components/DateMarker.js +0 -8
  64. package/components/DateMarker.mjs +0 -19
  65. package/components/MessageGroup.js +0 -8
  66. package/components/MessageGroup.mjs +0 -67
  67. package/components/NewMessage.js +0 -8
  68. package/components/NewMessage.mjs +0 -106
  69. package/components/base/FocusableUponSelection.js +0 -8
  70. package/components/base/SelectableItemsContainer.js +0 -8
  71. package/components/base/SelectableItemsContainer.mjs +0 -42
  72. package/components/templates/HeroCard.js +0 -8
  73. package/components/templates/HeroCard.mjs +0 -44
  74. package/utils.js +0 -8
  75. /package/{ViewItem.js → chat/ViewItem.js} +0 -0
  76. /package/{ViewItem.mjs → chat/ViewItem.mjs} +0 -0
package/index.d.ts CHANGED
@@ -8,16 +8,16 @@
8
8
  import { BaseEvent } from '@progress/kendo-react-common';
9
9
  import { ButtonProps } from '@progress/kendo-react-buttons';
10
10
  import { CustomComponent } from '@progress/kendo-react-common';
11
- import { default as default_2 } from 'prop-types';
12
- import { default as default_3 } from 'react';
11
+ import { default as default_2 } from 'react';
13
12
  import { JSX } from 'react/jsx-runtime';
14
13
  import { PopupAnimation } from '@progress/kendo-react-popup';
15
14
  import { PopupProps } from '@progress/kendo-react-popup';
16
15
  import * as React_2 from 'react';
17
16
  import { SpeechToTextButtonProps } from '@progress/kendo-react-buttons';
18
- import { SVGIcon } from '@progress/kendo-svg-icons';
19
- import { SVGIcon as SVGIcon_2 } from '@progress/kendo-react-common';
17
+ import { SVGIcon } from '@progress/kendo-react-common';
18
+ import { SVGIcon as SVGIcon_2 } from '@progress/kendo-svg-icons';
20
19
  import { TextAreaProps } from '@progress/kendo-react-inputs';
20
+ import { UploadProps } from '@progress/kendo-react-upload';
21
21
 
22
22
  /**
23
23
  * Defines a quick action for a message.
@@ -41,7 +41,7 @@ export declare interface Action {
41
41
 
42
42
  /**
43
43
  * The button type of the quick action
44
- * ([see examples]({% slug suggested_actions_chat %})).
44
+ * ([see examples]({% slug quick_actions_suggested_actions_chat %})).
45
45
  *
46
46
  * * `openUrl`—Opens a new browser window with the specified URL.
47
47
  * * `reply`—Sends the action value as a reply in the Chat.
@@ -64,26 +64,26 @@ export declare interface AIPromptCardInterface {
64
64
  /**
65
65
  * Custom template for AIPromptCard header.
66
66
  */
67
- header?: (props: AIPromptOutputInterface) => default_3.ReactNode;
67
+ header?: (props: AIPromptOutputInterface) => default_2.ReactNode;
68
68
  /**
69
69
  * Custom template for AIPromptCard body.
70
70
  */
71
- body?: (props: AIPromptOutputInterface) => default_3.ReactNode;
71
+ body?: (props: AIPromptOutputInterface) => default_2.ReactNode;
72
72
  /**
73
73
  * Custom template for AIPromptCard actions.
74
74
  */
75
- actions?: (props: AIPromptOutputInterface) => default_3.ReactNode;
75
+ actions?: (props: AIPromptOutputInterface) => default_2.ReactNode;
76
76
  }
77
77
 
78
78
  declare interface AIPromptCardInterface_2 {
79
79
  /**
80
80
  * Custom template for AIPromptCard body.
81
81
  */
82
- body?: (props: InlineAIPromptOutputInterface) => default_3.ReactNode;
82
+ body?: (props: InlineAIPromptOutputInterface) => default_2.ReactNode;
83
83
  /**
84
84
  * Custom template for AIPromptCard actions.
85
85
  */
86
- actions?: (props: InlineAIPromptOutputInterface) => default_3.ReactNode;
86
+ actions?: (props: InlineAIPromptOutputInterface) => default_2.ReactNode;
87
87
  }
88
88
 
89
89
  /**
@@ -108,7 +108,7 @@ declare interface AIPromptCommandsViewProps {
108
108
  /**
109
109
  * Represents the KendoReact AIPromptContent component.
110
110
  */
111
- export declare const AIPromptContent: default_3.ForwardRefExoticComponent<AIPromptContentProps & default_3.RefAttributes<HTMLDivElement>>;
111
+ export declare const AIPromptContent: default_2.ForwardRefExoticComponent<AIPromptContentProps & default_2.RefAttributes<HTMLDivElement>>;
112
112
 
113
113
  /**
114
114
  * The props of the AIPromptContent component.
@@ -117,7 +117,7 @@ declare interface AIPromptContentProps {
117
117
  /**
118
118
  * Specifies the AIPromptContent children elements.
119
119
  */
120
- children?: default_3.ReactNode;
120
+ children?: default_2.ReactNode;
121
121
  /**
122
122
  * Specifies the callback for cancel action.
123
123
  */
@@ -140,7 +140,7 @@ declare interface AIPromptFooterProps {
140
140
  /**
141
141
  * Specifies the AIPromptFooter children elements.
142
142
  */
143
- children?: default_3.ReactNode;
143
+ children?: default_2.ReactNode;
144
144
  }
145
145
 
146
146
  /**
@@ -148,7 +148,7 @@ declare interface AIPromptFooterProps {
148
148
  */
149
149
  declare interface AIPromptHeaderProps {
150
150
  activeView: string;
151
- toolbarItems: (AIPromptToolbarItemInterface | default_3.ReactNode)[];
151
+ toolbarItems: (AIPromptToolbarItemInterface | default_2.ReactNode)[];
152
152
  activeViewChange?: (viewName: string) => void;
153
153
  }
154
154
 
@@ -166,14 +166,14 @@ export declare interface AIPromptOutputInterface {
166
166
  * const output = { title: 'Generated Title', responseContent: 'Generated content' };
167
167
  * ```
168
168
  */
169
- title?: default_3.ReactNode;
169
+ title?: default_2.ReactNode;
170
170
  /**
171
171
  * Example usage of the `subTitle` property:
172
172
  * ```jsx
173
173
  * const output = { subTitle: 'Generated Subtitle', responseContent: 'Generated content' };
174
174
  * ```
175
175
  */
176
- subTitle?: default_3.ReactNode;
176
+ subTitle?: default_2.ReactNode;
177
177
  /**
178
178
  * Example usage of the `prompt` property:
179
179
  * ```jsx
@@ -252,14 +252,14 @@ declare interface AIPromptOutputViewProps {
252
252
  /**
253
253
  * The props of the AIPrompt component.
254
254
  */
255
- export declare interface AIPromptProps extends default_3.HTMLAttributes<HTMLElement> {
255
+ export declare interface AIPromptProps extends default_2.HTMLAttributes<HTMLElement> {
256
256
  /**
257
257
  * Example usage of the `style` property:
258
258
  * ```jsx
259
259
  * <AIPrompt style={{ backgroundColor: 'lightblue' }} />
260
260
  * ```
261
261
  */
262
- style?: default_3.CSSProperties;
262
+ style?: default_2.CSSProperties;
263
263
  /**
264
264
  * Example usage of the `activeView` property:
265
265
  * ```jsx
@@ -273,7 +273,7 @@ export declare interface AIPromptProps extends default_3.HTMLAttributes<HTMLElem
273
273
  * <AIPrompt toolbarItems={[<CustomToolbarItem />]} />
274
274
  * ```
275
275
  */
276
- toolbarItems?: (AIPromptToolbarItemInterface | default_3.ReactNode)[];
276
+ toolbarItems?: (AIPromptToolbarItemInterface | default_2.ReactNode)[];
277
277
  /**
278
278
  * Example usage of the `outputs` property:
279
279
  * ```jsx
@@ -289,7 +289,7 @@ export declare interface AIPromptProps extends default_3.HTMLAttributes<HTMLElem
289
289
  * </AIPrompt>
290
290
  * ```
291
291
  */
292
- children?: default_3.ReactNode;
292
+ children?: default_2.ReactNode;
293
293
  /**
294
294
  * Example usage of the `promptPlaceholder` property:
295
295
  * ```jsx
@@ -363,7 +363,7 @@ export declare interface AIPromptToolbarItemInterface {
363
363
  /**
364
364
  * Defines the svgIcon used in the Toolbar button.
365
365
  */
366
- buttonIcon?: SVGIcon;
366
+ buttonIcon?: SVGIcon_2;
367
367
  /**
368
368
  * Defines the text used in the Toolbar button.
369
369
  */
@@ -407,7 +407,7 @@ export declare interface AIPromptViewProps {
407
407
  /**
408
408
  * Represents the KendoReact AIPromptViewRender component.
409
409
  */
410
- export declare const AIPromptViewRender: (props: AIPromptViewRenderProps) => default_3.ReactNode;
410
+ export declare const AIPromptViewRender: (props: AIPromptViewRenderProps) => default_2.ReactNode;
411
411
 
412
412
  /**
413
413
  * The props of the AIPromptViewRender component.
@@ -420,7 +420,7 @@ declare interface AIPromptViewRenderProps {
420
420
  /**
421
421
  * Specifies the AIPromptViewRender children elements.
422
422
  */
423
- children: default_3.ReactNode;
423
+ children: default_2.ReactNode;
424
424
  }
425
425
 
426
426
  /**
@@ -460,103 +460,56 @@ export declare type AttachmentLayout = 'list' | 'carousel';
460
460
  /**
461
461
  * Represents the [KendoReact Chat component]({% slug overview_convui %}).
462
462
  */
463
- export declare class Chat extends React_2.Component<ChatProps, ChatState> {
463
+ export declare const Chat: React_2.ForwardRefExoticComponent<ChatProps & React_2.RefAttributes<HTMLDivElement>>;
464
+
465
+ /**
466
+ * The arguments for the `actionexecute` event of the Chat.
467
+ */
468
+ export declare interface ChatActionExecuteEvent extends Omit<BaseEvent<React_2.Component>, 'target'> {
464
469
  /**
465
- * @hidden
470
+ * The executed action.
466
471
  */
467
- static propTypes: {
468
- messages: default_2.Requireable<(object | null | undefined)[]>;
469
- user: default_2.Requireable<object>;
470
- messageTemplate: default_2.Requireable<any>;
471
- attachmentTemplate: default_2.Requireable<any>;
472
- width: default_2.Requireable<NonNullable<string | number | null | undefined>>;
473
- onMessageSend: default_2.Requireable<(...args: any[]) => any>;
474
- onActionExecute: default_2.Requireable<(...args: any[]) => any>;
475
- dir: default_2.Requireable<string>;
476
- messageBox: default_2.Requireable<any>;
477
- };
472
+ action: Action;
478
473
  /**
479
- * @hidden
474
+ * The target message.
480
475
  */
481
- static defaultProps: {
482
- messages: never[];
483
- dateFormat: string;
484
- message: typeof ChatMessage;
485
- };
476
+ target?: Message;
477
+ }
478
+
479
+ /**
480
+ * Represents a file attachment in a Chat message.
481
+ */
482
+ export declare interface ChatFile {
486
483
  /**
487
- * @hidden
484
+ * Unique identifier for the file.
488
485
  */
489
- readonly state: ChatState;
490
- private chatWrapperEl;
491
- private viewItemsWrapperEl;
492
- private newMsgComp;
493
- private timeoutIdForChatLosingFocus;
494
- private nextTickId;
495
- private viewItems;
496
- private isDirectionRightToLeft;
497
- private scrollToBottomOnLoadingData;
498
- private readonly showLicenseWatermark;
499
- private readonly licenseMessage?;
500
- constructor(props: ChatProps);
486
+ id: string;
501
487
  /**
502
- * @hidden
488
+ * The name of the file.
503
489
  */
504
- render(): JSX.Element;
490
+ name: string;
505
491
  /**
506
- * @hidden
492
+ * The size of the file in bytes.
507
493
  */
508
- componentDidMount(): void;
494
+ size: number;
509
495
  /**
510
- * @hidden
496
+ * MIME type of the file (e.g., 'application/pdf', 'image/jpeg').
511
497
  */
512
- componentWillUnmount(): void;
498
+ type: string;
513
499
  /**
514
- * @hidden
500
+ * Optional URL to download/view the file.
515
501
  */
516
- componentDidUpdate(prevProps: ChatProps): void;
517
- private getClassNames;
518
- private checkIsDirectionRightToLeft;
519
- private onFocus;
520
- private onBlur;
521
- private onSelectionRequested;
522
- private onKeyDown;
523
- private renderViewItems;
524
- private onMessageSend;
525
- private onActionExecute;
526
- private scrollViewItemsToBottom;
527
- private getViewItemsFromMsgs;
528
- }
529
-
530
- /**
531
- * The arguments for the `actionexecute` event of the Chat.
532
- */
533
- export declare interface ChatActionExecuteEvent extends BaseEvent<Chat> {
502
+ url?: string;
534
503
  /**
535
- * The executed action.
504
+ * Optional preview image URL for the file.
536
505
  */
537
- action: Action;
506
+ thumbnailUrl?: string;
538
507
  }
539
508
 
540
509
  /**
541
510
  * Represents the ChatMessage component.
542
511
  */
543
- export declare class ChatMessage extends FocusableUponSelection<ChatMessageProps, {}> {
544
- /**
545
- * @hidden
546
- */
547
- static defaultProps: {
548
- dateFormat: string;
549
- tabIndex: number;
550
- };
551
- /**
552
- * @hidden
553
- */
554
- render(): JSX.Element;
555
- private getMainView;
556
- private getTimestampView;
557
- private getStatusView;
558
- private getClassNames;
559
- }
512
+ export declare const ChatMessage: React_2.FC<ChatMessageProps>;
560
513
 
561
514
  /**
562
515
  * Represents a Chat message box.
@@ -566,10 +519,6 @@ export declare interface ChatMessageBoxProps {
566
519
  * Sets the input message of the Chat component.
567
520
  */
568
521
  messageInput: React.ReactElement;
569
- /**
570
- * Sets the toolbar button of the Chat component.
571
- */
572
- toolbarButton: React.ReactElement;
573
522
  /**
574
523
  * Sets the send button of the Chat component.
575
524
  */
@@ -579,7 +528,7 @@ export declare interface ChatMessageBoxProps {
579
528
  /**
580
529
  * Represents the properties of [ChatMessage] (% slug api_conversational-ui_chatmessage %) component.
581
530
  */
582
- export declare interface ChatMessageProps extends FocusableUponSelectionProps {
531
+ export declare interface ChatMessageProps {
583
532
  /**
584
533
  * Represents the data item of the `Message`.
585
534
  */
@@ -597,55 +546,56 @@ export declare interface ChatMessageProps extends FocusableUponSelectionProps {
597
546
  */
598
547
  tabIndex?: number;
599
548
  /**
600
- * @hidden
549
+ * Represents the date format of the message date.
601
550
  */
602
- isFirstItemInGroup: boolean;
551
+ dateFormat?: string;
603
552
  /**
604
- * @hidden
553
+ * Sets the `selected` state of the component.
605
554
  */
606
- isLastItemInGroup: boolean;
555
+ selected: boolean;
607
556
  /**
608
- * @hidden
557
+ *
609
558
  */
610
- isOnlyItemInGroup: boolean;
559
+ allowMessageCollapse?: boolean;
611
560
  /**
612
- * Represents the date format of the message date.
561
+ * Defines the actions that will be displayed in the message toolbar.
562
+ * This can include buttons for actions like reply, edit, delete, etc.
613
563
  */
614
- dateFormat?: string;
615
- }
616
-
617
- /**
618
- * The arguments for the `messagesend` event of the Chat.
619
- */
620
- export declare interface ChatMessageSendEvent extends BaseEvent<Chat> {
564
+ messageToolbarActions?: MessageAction[];
621
565
  /**
622
- * The new message.
566
+ * Defines the actions that will be displayed in the message context menu.
567
+ * This can include buttons for actions like reply, edit, delete, etc.
623
568
  */
624
- message: Message;
569
+ messageContextMenuActions?: MessageAction[];
570
+ /**
571
+ * @hidden
572
+ */
573
+ isSender?: boolean;
625
574
  }
626
575
 
627
576
  /**
628
577
  * Represents the properties available to the `messageTemplate` custom component.
629
578
  *
630
- * For more information, refer to the [Message Template]({% slug message_templates_chat %}) article.
579
+ * For more information, refer to the [Message Template]({% slug customization_message_templates_chat %}) article.
631
580
  */
632
581
  export declare interface ChatMessageTemplateProps {
633
582
  item: MessageModel;
634
583
  }
635
584
 
636
- export declare interface ChatProps {
585
+ export declare interface ChatProps extends FieldMappingConfig {
637
586
  /**
638
587
  * Sets a class of the Chat DOM element.
639
588
  */
640
589
  className?: string;
641
590
  /**
642
- * Sets the messages of the Chat.
591
+ * Sets the messages of the Chat. Can be an array of Message objects or raw data objects
592
+ * that will be mapped using the field mapping configuration.
643
593
  */
644
- messages: Message[];
594
+ messages: Message[] | any[];
645
595
  /**
646
- * Sets the [`User`]({% slug api_conversational-ui %}) instance for the local user. The User ID identifies messages that are authored by the local user.
596
+ * Sets the ID of the local user. The ID identifies messages that are authored by the local user.
647
597
  */
648
- user: User;
598
+ authorId: number | string;
649
599
  /**
650
600
  * A React functional or class component which is used as a message template. The corresponding [`message`]({% slug api_conversational-ui_message %}) is passed to the component as a property by the name `item`.
651
601
  */
@@ -659,27 +609,19 @@ export declare interface ChatProps {
659
609
  */
660
610
  width?: string | number;
661
611
  /**
662
- * Determines if the toolbar will be rendered.
663
- */
664
- showToolbar?: any;
665
- /**
666
- * Renders a toolbar inside the Chat.
612
+ * Sets the height of the Chat.
667
613
  */
668
- toolbar?: any;
614
+ height?: string | number;
669
615
  /**
670
- * Fires when the user types a message and clicks the **Send** button or presses **Enter**. Emits the [`MessageSendEvent`]({% slug api_conversational-ui_chatmessagesendevent %}).
616
+ * Fires when the user types a message and clicks the **Send** button or presses **Enter**. Emits the [`SendMessageEvent`]({% slug api_conversational-ui_ChatSendMessageEvent %}).
671
617
  *
672
618
  * > The Chat is not automatically updated with the new message.
673
619
  */
674
- onMessageSend?: (event: ChatMessageSendEvent) => void;
620
+ onSendMessage?: (event: ChatSendMessageEvent) => void;
675
621
  /**
676
622
  * Fires when the user clicks a quick action button. The Chat internally handles the `reply`, `openUrl`, and `call` [known actions]({% slug api_conversational-ui_actiontype %}). Emits the [`ExecuteActionEvent`]({% slug api_conversational-ui_chatactionexecuteevent %}). The event is preventable. If `preventDefault` is called, the built-in action will be suppressed.
677
623
  */
678
624
  onActionExecute?: (event: ChatActionExecuteEvent) => void;
679
- /**
680
- * Fires when the user clicks the button to show or hide the toolbar.
681
- */
682
- onToolbarActionExecute?: (event: ChatToolbarActionExecuteEvent) => void;
683
625
  /**
684
626
  * Sets the direction of the Chat component.
685
627
  */
@@ -690,13 +632,118 @@ export declare interface ChatProps {
690
632
  placeholder?: string;
691
633
  /**
692
634
  * Enables the customization or the override of the default message box item in the Conversational UI
693
- * ([see example]({% slug custom-rendering_chat %})).
635
+ * ([see example]({% slug customization_messagebox_templates_chat %})).
694
636
  */
695
637
  messageBox?: React.ComponentType<ChatMessageBoxProps>;
696
638
  /**
697
639
  * Represents the ChatMessage component.
698
640
  */
699
641
  message?: React.ComponentType<ChatMessageProps>;
642
+ /**
643
+ * Defines the list of message suggestions that will be displayed above the message input.
644
+ */
645
+ suggestions?: ChatSuggestion[];
646
+ /**
647
+ * Defines the template for the suggestions items that will be displayed above the message input.
648
+ */
649
+ suggestionTemplate?: React.ComponentType<SuggestionTemplateProps>;
650
+ /**
651
+ * Fires when a suggestion is clicked. The event contains the clicked suggestion.
652
+ */
653
+ onSuggestionClick?: (suggestion: ChatSuggestion) => void;
654
+ /**
655
+ * Defines the template for the header of the Chat component.
656
+ */
657
+ headerTemplate?: React.ReactElement | (() => React.ReactElement);
658
+ /**
659
+ * Defines the template for the timestamp of the message.
660
+ */
661
+ timestampTemplate?: React.ComponentType<{
662
+ item: DateMarker;
663
+ }>;
664
+ /**
665
+ * Defines the template for the status items below each message.
666
+ */
667
+ statusTemplate?: React.ComponentType<StatusTemplateProps>;
668
+ /**
669
+ * Enables the expand/collapse functionality for the messages in the Chat.
670
+ * This allows users to collapse or expand messages to save space in the chat window.
671
+ */
672
+ allowMessageCollapse?: boolean;
673
+ /**
674
+ * Defines the actions that will be displayed in the message toolbar.
675
+ * This can include buttons for actions like reply, edit, delete, etc.
676
+ */
677
+ messageToolbarActions?: MessageAction[];
678
+ /**
679
+ * Defines the actions that will be displayed in the message context menu.
680
+ */
681
+ messageContextMenuActions?: MessageAction[];
682
+ fileActions?: MessageAction[];
683
+ /**
684
+ * Fires when a message in unpinned.
685
+ * The event contains the message that was unpinned.
686
+ */
687
+ onUnpin?: (message: Message) => void;
688
+ /**
689
+ * Sets the message width mode. The default value is `standard`.
690
+ * - `full`&mdash;The message occupies the full width of the chat.
691
+ * - `standard`&mdash;The message occupies a standard width, allowing for more compact display.
692
+ */
693
+ messageWidthMode?: 'full' | 'standard';
694
+ /**
695
+ * Enables the speech-to-text functionality in the Chat.
696
+ * This allows users to dictate messages instead of typing them.
697
+ */
698
+ speechToTextConfig?: boolean | SpeechToTextButtonProps;
699
+ /**
700
+ * Sets the upload configuration for the Chat component.
701
+ * This can be used to customize the file upload behavior, such as accepted file types and maximum file size.
702
+ */
703
+ uploadConfig?: boolean | UploadProps;
704
+ /**
705
+ * Configures the appearance and behavior of the send button in the Chat component.
706
+ */
707
+ sendButtonConfig?: ButtonProps;
708
+ /**
709
+ * Fires when a toolbar action is executed on a message.
710
+ * The event contains the action that was executed and the target message.
711
+ */
712
+ onToolbarAction?: (action: MessageAction, event: React.SyntheticEvent<any>, target: Message) => void;
713
+ /**
714
+ * Fires when a context menu action is executed on a message.
715
+ * The event contains the action that was executed and the target message.
716
+ */
717
+ onContextMenuAction?: (action: MessageAction, event: React.SyntheticEvent<any>, target: Message) => void;
718
+ /**
719
+ * Fires when a file action is executed on a message.
720
+ * The event contains the action that was executed and the target file.
721
+ */
722
+ onFileAction?: (action: FileAction, event: React.SyntheticEvent<any>, target: ChatFile) => void;
723
+ /**
724
+ * Fires when a download action is executed on a message.
725
+ * The event contains the action that was executed and the target file.
726
+ */
727
+ onDownload?: (files: ChatFile[], message: Message) => void;
728
+ /**
729
+ * Fires when the input value changes.
730
+ * The event contains the new input value.
731
+ */
732
+ onInputValueChange?: (value: string) => void;
733
+ /**
734
+ * Sets the input value of the Chat component.
735
+ */
736
+ inputValue?: string;
737
+ }
738
+
739
+ /**
740
+ * The arguments for the `messagesend` event of the Chat.
741
+ */
742
+ export declare interface ChatSendMessageEvent extends BaseEvent<React_2.Component> {
743
+ /**
744
+ * The new message.
745
+ */
746
+ message: Message;
700
747
  }
701
748
 
702
749
  /**
@@ -704,7 +751,6 @@ export declare interface ChatProps {
704
751
  */
705
752
  export declare interface ChatState {
706
753
  selectedItemIndex: number | null;
707
- isFirstRender: boolean;
708
754
  }
709
755
 
710
756
  /**
@@ -723,7 +769,7 @@ export declare interface ChatSuggestion {
723
769
  /**
724
770
  * The arguments for the `toolbaractionexecute` event of the Chat.
725
771
  */
726
- export declare interface ChatToolbarActionExecuteEvent extends BaseEvent<Chat> {
772
+ export declare interface ChatToolbarActionExecuteEvent extends BaseEvent<React_2.Component> {
727
773
  /**
728
774
  * The new toolbarShow value.
729
775
  */
@@ -755,7 +801,7 @@ export declare interface CommandItemInterface {
755
801
  /**
756
802
  * Specifies the name of the SVG icon that will be rendered for the command.
757
803
  */
758
- svgIcon?: SVGIcon_2;
804
+ svgIcon?: SVGIcon;
759
805
  /**
760
806
  * Optional prompt function that takes selected text and returns a formatted prompt.
761
807
  * This is used by default commands and can be used by custom commands.
@@ -771,42 +817,141 @@ export declare const commandsViewDefaults: AIPromptToolbarItemInterface;
771
817
  /**
772
818
  * @hidden
773
819
  */
774
- declare abstract class FocusableUponSelection<P extends FocusableUponSelectionProps, S = {}> extends React_2.Component<P, S> {
775
- protected elementToFocus: any;
776
- /**
777
- * @hidden
778
- */
779
- componentDidUpdate(prevProps: any): void;
820
+ declare interface DateMarker {
821
+ type: 'date-marker';
822
+ timestamp: Date;
823
+ trackBy: any;
780
824
  }
781
825
 
782
826
  /**
827
+ * Default field mapping configuration.
828
+ * These are the standard field names expected by the Chat component.
829
+ *
783
830
  * @hidden
784
831
  */
785
- declare interface FocusableUponSelectionProps {
832
+ export declare const DEFAULT_FIELD_MAPPING: Required<FieldMappingConfig>;
833
+
834
+ /**
835
+ * Extracts field mapping configuration from ChatProps
836
+ *
837
+ * @param props - ChatProps containing field mapping properties
838
+ * @returns FieldMappingConfig object
839
+ */
840
+ export declare const extractFieldMappingFromProps: (props: any) => FieldMappingConfig;
841
+
842
+ /**
843
+ * Configuration interface for mapping custom data fields to Chat component properties.
844
+ * This allows the Chat component to work with various data source formats by mapping
845
+ * custom field names to the expected Chat interface properties.
846
+ */
847
+ export declare interface FieldMappingConfig {
786
848
  /**
787
- * Sets the `selected` state of the component.
849
+ * Field name for message text content.
850
+ *
851
+ * @default 'text'
788
852
  */
789
- selected: boolean;
853
+ textField?: string;
854
+ /**
855
+ * Field name for message status.
856
+ *
857
+ * @default 'status'
858
+ */
859
+ statusField?: string;
860
+ /**
861
+ * Field name for message author ID.
862
+ *
863
+ * @default 'authorId'
864
+ */
865
+ authorIdField?: string;
866
+ /**
867
+ * Field name for message author name (when flattened in data source).
868
+ *
869
+ * @default 'authorName'
870
+ */
871
+ authorNameField?: string;
872
+ /**
873
+ * Field name for message author avatar URL (when flattened in data source).
874
+ *
875
+ * @default 'authorImageUrl'
876
+ */
877
+ authorImageUrlField?: string;
878
+ /**
879
+ * Field name for alt text of the author's avatar (when flattened in data source).
880
+ *
881
+ * @default 'authorImageAltText'
882
+ */
883
+ authorImageAltTextField?: string;
884
+ /**
885
+ * Field name for message ID.
886
+ *
887
+ * @default 'id'
888
+ */
889
+ idField?: string;
890
+ /**
891
+ * Field name for message timestamp.
892
+ *
893
+ * @default 'timestamp'
894
+ */
895
+ timestampField?: string;
896
+ /**
897
+ * Field name for file attachments.
898
+ *
899
+ * @default 'files'
900
+ */
901
+ filesField?: string;
902
+ /**
903
+ * Field name for message attachments.
904
+ *
905
+ * @default 'attachments'
906
+ */
907
+ attachmentsField?: string;
908
+ /**
909
+ * Field name for reply-to message ID.
910
+ *
911
+ * @default 'replyToId'
912
+ */
913
+ replyToIdField?: string;
914
+ /**
915
+ * Field name for message deletion status.
916
+ *
917
+ * @default 'isDeleted'
918
+ */
919
+ isDeletedField?: string;
920
+ /**
921
+ * Field name for message pinned status.
922
+ *
923
+ * @default 'isPinned'
924
+ */
925
+ isPinnedField?: string;
926
+ /**
927
+ * Field name for the typing prop of a message.
928
+ *
929
+ * @default 'typing'
930
+ */
931
+ typingField?: string;
932
+ /**
933
+ * Field name for the suggestedActions prop of a message.
934
+ *
935
+ * @default 'suggestedActions'
936
+ */
937
+ suggestedActionsField?: string;
790
938
  }
791
939
 
792
940
  /**
793
- * Represents a Hero Card component. Hero cards host a single large image and action buttons with text content.
941
+ * Represents a file action that can be performed on a file in the chat.
794
942
  */
795
- export declare class HeroCard extends React_2.Component<HeroCardProps, {}> {
796
- /**
797
- * @hidden
798
- */
799
- render(): JSX.Element;
800
- private onBtnClick;
801
- private getActionsView;
802
- private getTitleView;
803
- private getSubtitleView;
943
+ export declare interface FileAction extends MessageAction {
804
944
  }
805
945
 
946
+ /**
947
+ * Represents a Hero Card component. Hero cards host a single large image and action buttons with text content.
948
+ */
949
+ export declare const HeroCard: React_2.FC<HeroCardProps>;
950
+
806
951
  /**
807
952
  * The arguments for the `actionexecute` event of the hero card.
808
953
  */
809
- export declare interface HeroCardActionExecuteEvent extends BaseEvent<HeroCard> {
954
+ export declare interface HeroCardActionExecuteEvent extends BaseEvent<React_2.Component> {
810
955
  /**
811
956
  * The executed action.
812
957
  */
@@ -818,6 +963,10 @@ export declare interface HeroCardProps {
818
963
  * The URL of the hero card image.
819
964
  */
820
965
  imageUrl: string;
966
+ /**
967
+ * The alt text for the hero card image.
968
+ */
969
+ altText?: string;
821
970
  /**
822
971
  * The title of the hero card.
823
972
  */
@@ -907,21 +1056,21 @@ declare interface InlineAIPromptPopupProps {
907
1056
  /**
908
1057
  * The content to render inside the popup.
909
1058
  */
910
- children?: default_3.ReactNode;
1059
+ children?: default_2.ReactNode;
911
1060
  /**
912
1061
  * Additional CSS styles for the popup content.
913
1062
  */
914
- style?: default_3.CSSProperties;
1063
+ style?: default_2.CSSProperties;
915
1064
  }
916
1065
 
917
- export declare interface InlineAIPromptProps extends Omit<default_3.HTMLAttributes<HTMLElement>, 'onCopy'>, InlineAIPromptPopupProps {
1066
+ export declare interface InlineAIPromptProps extends Omit<default_2.HTMLAttributes<HTMLElement>, 'onCopy'>, InlineAIPromptPopupProps {
918
1067
  /**
919
1068
  * Example usage of the `style` property:
920
1069
  * ```jsx
921
1070
  * <InlineAIPrompt style={{ backgroundColor: 'lightblue' }} />
922
1071
  * ```
923
1072
  */
924
- style?: default_3.CSSProperties;
1073
+ style?: default_2.CSSProperties;
925
1074
  /**
926
1075
  * The collection of outputs to display as cards
927
1076
  */
@@ -1007,6 +1156,43 @@ export declare interface InlineAIPromptProps extends Omit<default_3.HTMLAttribut
1007
1156
  onCommandExecute?: (command: CommandItemInterface) => void;
1008
1157
  }
1009
1158
 
1159
+ /**
1160
+ * Checks if the provided message data is already in the standard Message format
1161
+ *
1162
+ * @param message - Message data to check
1163
+ * @returns True if the message is in standard format, false otherwise
1164
+ */
1165
+ export declare const isStandardMessageFormat: (message: any) => message is Message;
1166
+
1167
+ /**
1168
+ * Maps an array of raw data objects to Message array
1169
+ *
1170
+ * @param dataArray - Array of raw data objects
1171
+ * @param fieldMapping - Field mapping configuration (optional)
1172
+ * @returns Array of mapped Message objects
1173
+ */
1174
+ export declare const mapDataArrayToMessages: (dataArray: any[], fieldMapping?: FieldMappingConfig) => Message[];
1175
+
1176
+ /**
1177
+ * Maps raw data object to standardized Message interface using field mapping configuration
1178
+ *
1179
+ * @param data - Raw data object from external source
1180
+ * @param fieldMapping - Field mapping configuration (optional)
1181
+ * @returns Mapped Message object
1182
+ */
1183
+ export declare const mapDataToMessage: (data: any, fieldMapping?: FieldMappingConfig) => Message;
1184
+
1185
+ /**
1186
+ * Maps a standard Message object back to custom field format
1187
+ * This is useful when you receive a new message in standard format but need to convert it
1188
+ * to your custom field mapping for data storage or API calls
1189
+ *
1190
+ * @param message - Standard Message object
1191
+ * @param fieldMapping - Field mapping configuration (optional)
1192
+ * @returns Object with custom field names
1193
+ */
1194
+ export declare const mapMessageToCustomFormat: (message: Message, fieldMapping?: FieldMappingConfig) => any;
1195
+
1010
1196
  /**
1011
1197
  * Represents a Chat message.
1012
1198
  *
@@ -1016,6 +1202,10 @@ export declare interface InlineAIPromptProps extends Omit<default_3.HTMLAttribut
1016
1202
  * > * If `typing` is set to `true`, the Chat displays a typing indicator instead of text.
1017
1203
  */
1018
1204
  export declare interface Message {
1205
+ /**
1206
+ * The unique identifier of the message.
1207
+ */
1208
+ id: number | string;
1019
1209
  /**
1020
1210
  * The author of the message.
1021
1211
  */
@@ -1032,7 +1222,7 @@ export declare interface Message {
1032
1222
  attachments?: Attachment[];
1033
1223
  /**
1034
1224
  * The suggested quick actions that will be displayed below this message
1035
- * ([see example]({% slug suggested_actions_chat %}#toc-defining-quick-actions)).
1225
+ * ([see example]({% slug quick_actions_suggested_actions_chat %}#toc-defining-quick-actions)).
1036
1226
  *
1037
1227
  * > Suggested actions are displayed only for the last message in the conversation.
1038
1228
  */
@@ -1059,6 +1249,58 @@ export declare interface Message {
1059
1249
  * If set to `true`, the Chat displays a typing indicator instead of the actual message.
1060
1250
  */
1061
1251
  typing?: boolean;
1252
+ /**
1253
+ * A Boolean value which indicates if the message is in a loading state.
1254
+ * If set to `true`, the Chat displays a skeleton placeholder instead of the actual message content.
1255
+ */
1256
+ isLoading?: boolean;
1257
+ /**
1258
+ * A message property that sets the message as pinned.
1259
+ */
1260
+ isPinned?: boolean;
1261
+ /**
1262
+ * The date and time when the message was pinned.
1263
+ */
1264
+ pinnedAt?: Date;
1265
+ /**
1266
+ * The user who pinned the message.
1267
+ */
1268
+ pinnedBy?: User;
1269
+ /**
1270
+ * The ID of the message this message is replying to.
1271
+ */
1272
+ replyToId?: number | string;
1273
+ /**
1274
+ * Indicates whether the message has been deleted.
1275
+ */
1276
+ isDeleted?: boolean;
1277
+ /**
1278
+ * Files attached to the message.
1279
+ */
1280
+ files?: any[];
1281
+ selectionIndex?: number;
1282
+ }
1283
+
1284
+ /**
1285
+ * Represents a message action that can be displayed in the message toolbar.
1286
+ */
1287
+ declare interface MessageAction {
1288
+ /**
1289
+ * The unique identifier for the action.
1290
+ */
1291
+ id: string;
1292
+ /**
1293
+ * The label to display for the action.
1294
+ */
1295
+ label: string;
1296
+ /**
1297
+ * The SVG icon to display for the action.
1298
+ */
1299
+ svgIcon?: SVGIcon;
1300
+ /**
1301
+ * The icon to display for the action.
1302
+ */
1303
+ icon?: string;
1062
1304
  }
1063
1305
 
1064
1306
  /**
@@ -1114,14 +1356,25 @@ export declare const promptViewDefaults: AIPromptToolbarItemInterface;
1114
1356
  * @hidden
1115
1357
  */
1116
1358
  declare interface Selectable {
1117
- selectionIndex: number;
1359
+ selectionIndex?: number;
1360
+ }
1361
+
1362
+ /**
1363
+ * Represents the properties available to the `statusTemplate` custom component.
1364
+ */
1365
+ export declare interface StatusTemplateProps {
1366
+ /**
1367
+ * The message item containing the status information.
1368
+ */
1369
+ item: Message;
1118
1370
  }
1119
1371
 
1120
1372
  export declare const SuggestionGroup: React_2.FC<SuggestionGroupProps>;
1121
1373
 
1122
1374
  declare interface SuggestionGroupProps {
1123
1375
  suggestions: ChatSuggestion[];
1124
- onSuggestionClick: (event: React_2.MouseEvent<HTMLSpanElement>, suggestion: ChatSuggestion) => void;
1376
+ onSuggestionClick?: (suggestion: ChatSuggestion) => void;
1377
+ suggestionTemplate?: React_2.ComponentType<SuggestionTemplateProps>;
1125
1378
  suggestionsView?: SuggestionsView;
1126
1379
  }
1127
1380
 
@@ -1133,6 +1386,11 @@ declare interface SuggestionGroupProps {
1133
1386
  */
1134
1387
  export declare type SuggestionsView = 'classic' | 'modern';
1135
1388
 
1389
+ export declare interface SuggestionTemplateProps {
1390
+ suggestion: ChatSuggestion;
1391
+ onClick?: (event: React_2.MouseEvent<HTMLElement>) => void;
1392
+ }
1393
+
1136
1394
  /**
1137
1395
  * Represents a participant in a Chat conversation.
1138
1396
  */