@progress/kendo-react-conversational-ui 13.4.0-develop.2 → 13.4.0-develop.3

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 (64) hide show
  1. package/api/message.interface.d.ts +87 -9
  2. package/chat/ChatPropsAndState.d.ts +108 -9
  3. package/chat/Events.d.ts +9 -0
  4. package/chat/components/ActionGroup.js +1 -1
  5. package/chat/components/ActionGroup.mjs +58 -48
  6. package/chat/components/Chat.d.ts +1 -1
  7. package/chat/components/Chat.js +1 -1
  8. package/chat/components/Chat.mjs +318 -269
  9. package/chat/components/ChatContext.d.ts +6 -3
  10. package/chat/components/ChatMessage.js +1 -1
  11. package/chat/components/ChatMessage.mjs +237 -177
  12. package/chat/components/Header.js +1 -1
  13. package/chat/components/Header.mjs +3 -3
  14. package/chat/components/NewMessage.d.ts +5 -3
  15. package/chat/components/NewMessage.js +1 -1
  16. package/chat/components/NewMessage.mjs +174 -226
  17. package/chat/components/ScrollButtonsWrapper.js +1 -1
  18. package/chat/components/ScrollButtonsWrapper.mjs +34 -40
  19. package/chat/components/SuggestionsGroup.js +1 -1
  20. package/chat/components/SuggestionsGroup.mjs +40 -39
  21. package/chat/components/elements/FileBox.js +1 -1
  22. package/chat/components/elements/FileBox.mjs +33 -41
  23. package/chat/components/elements/PinnedMessage.js +1 -1
  24. package/chat/components/elements/PinnedMessage.mjs +24 -22
  25. package/chat/hooks/useScrollWithButtons.d.ts +4 -0
  26. package/chat/hooks/useScrollWithButtons.js +1 -1
  27. package/chat/hooks/useScrollWithButtons.mjs +25 -23
  28. package/chat/utils/fieldMapping.d.ts +1 -1
  29. package/chat/utils/fieldMapping.js +1 -1
  30. package/chat/utils/fieldMapping.mjs +37 -34
  31. package/chat/utils/scroll.d.ts +15 -1
  32. package/chat/utils/scroll.js +3 -3
  33. package/chat/utils/scroll.mjs +92 -65
  34. package/chat/utils.d.ts +4 -1
  35. package/chat/utils.js +1 -1
  36. package/chat/utils.mjs +37 -37
  37. package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
  38. package/index.d.mts +6 -0
  39. package/index.d.ts +6 -0
  40. package/index.js +1 -1
  41. package/index.mjs +39 -31
  42. package/messages/index.d.ts +50 -0
  43. package/messages/index.js +1 -1
  44. package/messages/index.mjs +60 -40
  45. package/package-metadata.js +1 -1
  46. package/package-metadata.mjs +1 -1
  47. package/package.json +11 -11
  48. package/prompt-box/Events.d.ts +66 -0
  49. package/prompt-box/FileBox.d.ts +22 -0
  50. package/prompt-box/FileBox.js +8 -0
  51. package/prompt-box/FileBox.mjs +72 -0
  52. package/prompt-box/PromptBox.d.ts +35 -0
  53. package/prompt-box/PromptBox.js +8 -0
  54. package/prompt-box/PromptBox.mjs +424 -0
  55. package/prompt-box/PromptBoxActionButton.d.ts +32 -0
  56. package/prompt-box/PromptBoxActionButton.js +8 -0
  57. package/prompt-box/PromptBoxActionButton.mjs +14 -0
  58. package/prompt-box/PromptBoxSpeechToTextButton.d.ts +32 -0
  59. package/prompt-box/PromptBoxSpeechToTextButton.js +8 -0
  60. package/prompt-box/PromptBoxSpeechToTextButton.mjs +14 -0
  61. package/prompt-box/PromptBoxUploadButton.d.ts +108 -0
  62. package/prompt-box/PromptBoxUploadButton.js +8 -0
  63. package/prompt-box/PromptBoxUploadButton.mjs +54 -0
  64. package/prompt-box/interfaces/PromptBoxProps.d.ts +390 -0
@@ -5,9 +5,50 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
+ import { SVGIcon } from '@progress/kendo-react-common';
8
9
  import { Action } from './action.interface.js';
9
10
  import { Attachment, AttachmentLayout } from './attachment.interface.js';
10
11
  import { User } from './user.interface.js';
12
+ /**
13
+ * Configuration for message status display with optional icon.
14
+ */
15
+ export interface MessageStatus {
16
+ /**
17
+ * Sets the text for the message status.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * const message: Message = {
22
+ * status: { text: 'Seen' }
23
+ * };
24
+ * ```
25
+ */
26
+ text?: string;
27
+ /**
28
+ * Sets the name of a font icon from the Kendo UI theme for the message status.
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * const message: Message = {
33
+ * status: { text: 'Seen', icon: 'k-icon k-font-icon k-i-loading' }
34
+ * };
35
+ * ```
36
+ */
37
+ icon?: string;
38
+ /**
39
+ * Sets an SVG icon to display inside the message status.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * import { eyeIcon } from '@progress/kendo-svg-icons';
44
+ *
45
+ * const message: Message = {
46
+ * status: { text: 'Seen', svgIcon: eyeIcon }
47
+ * };
48
+ * ```
49
+ */
50
+ svgIcon?: SVGIcon;
51
+ }
11
52
  /**
12
53
  * Represents a Chat message.
13
54
  *
@@ -39,10 +80,35 @@ export interface Message {
39
80
  */
40
81
  suggestedActions?: Action[];
41
82
  /**
42
- * Optional status string for the message.
43
- * Displays when you select the message by mouse or keyboard.
44
- */
45
- status?: string;
83
+ * Sets the current status of the message.
84
+ * The status appears when the message is selected by clicking or through keyboard navigation.
85
+ *
86
+ * @example
87
+ * ```tsx
88
+ * const message: Message = {
89
+ * id: 1,
90
+ * author: user,
91
+ * text: 'Hello',
92
+ * status: 'Seen'
93
+ * };
94
+ * ```
95
+ *
96
+ * @example
97
+ * ```tsx
98
+ * import { eyeIcon } from '@progress/kendo-svg-icons';
99
+ *
100
+ * const message: Message = {
101
+ * id: 1,
102
+ * author: user,
103
+ * text: 'Hello',
104
+ * status: {
105
+ * text: 'Seen',
106
+ * svgIcon: eyeIcon
107
+ * }
108
+ * };
109
+ * ```
110
+ */
111
+ status?: string | MessageStatus;
46
112
  /**
47
113
  * Optional text for the message.
48
114
  * Some messages contain only attachments or quick actions.
@@ -57,11 +123,6 @@ export interface Message {
57
123
  * If `true`, the Chat displays a typing indicator instead of the message.
58
124
  */
59
125
  typing?: boolean;
60
- /**
61
- * Indicates if the message is loading.
62
- * If `true`, the Chat displays a skeleton placeholder instead of the content.
63
- */
64
- isLoading?: boolean;
65
126
  /**
66
127
  * Indicates if the message is pinned.
67
128
  */
@@ -90,6 +151,23 @@ export interface Message {
90
151
  * Index used for keyboard selection navigation.
91
152
  */
92
153
  selectionIndex?: number;
154
+ /**
155
+ * Indicates whether the message has failed to send.
156
+ * When `true`, renders a retry button that fires the `onResendMessage` event.
157
+ *
158
+ * @default false
159
+ *
160
+ * @example
161
+ * ```tsx
162
+ * const message: Message = {
163
+ * id: 1,
164
+ * author: user,
165
+ * text: 'Hello',
166
+ * isFailed: true
167
+ * };
168
+ * ```
169
+ */
170
+ isFailed?: boolean;
93
171
  /**
94
172
  * @hidden
95
173
  * Original data item containing all the raw fields from the source message.
@@ -5,11 +5,11 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { Message, ChatActionExecuteEvent, ChatSendMessageEvent } from '../index.js';
8
+ import { Message, ChatActionExecuteEvent, ChatSendMessageEvent, ChatResendMessageEvent, PromptBoxMode } from '../index.js';
9
9
  import { ChatMessageProps, ChatMessageTemplateProps, FileAction, MessageAction } from './components/ChatMessage.js';
10
10
  import { ChatSuggestion, SuggestionTemplateProps } from './components/SuggestionsGroup.js';
11
11
  import { ButtonProps, SpeechToTextButtonProps } from '@progress/kendo-react-buttons';
12
- import { UploadProps } from '@progress/kendo-react-upload';
12
+ import { UploadButtonProps } from '../prompt-box/interfaces/PromptBoxProps.js';
13
13
  import { DateMarker } from './ViewItem.js';
14
14
  /**
15
15
  * Represents the properties available to the `statusTemplate` custom component.
@@ -127,6 +127,13 @@ export interface FieldMappingConfig {
127
127
  * @default 'suggestedActions'
128
128
  */
129
129
  suggestedActionsField?: string;
130
+ /**
131
+ * Field name for message failed status.
132
+ * Indicates whether the message has failed to send.
133
+ *
134
+ * @default 'isFailed'
135
+ */
136
+ isFailedField?: string;
130
137
  }
131
138
  /**
132
139
  * Represents a file attachment in a Chat message.
@@ -161,10 +168,6 @@ export interface ChatMessageBoxProps {
161
168
  * Input message element of the Chat.
162
169
  */
163
170
  messageInput: React.ReactElement;
164
- /**
165
- * Send button element of the Chat.
166
- */
167
- sendButton: React.ReactElement;
168
171
  }
169
172
  /**
170
173
  * Controls how suggestions behave when they exceed available space.
@@ -199,6 +202,49 @@ export type MessageWidthMode = 'full' | 'standard';
199
202
  * - `hidden`—Timestamps are never visible for any messages.
200
203
  */
201
204
  export type TimestampVisibilityMode = 'onFocus' | 'hidden';
205
+ /**
206
+ * Configuration for the Message Box (PromptBox component).
207
+ */
208
+ export interface MessageBoxSettings {
209
+ /**
210
+ * Defines the line mode for the Message Box.
211
+ * - `single`—Single-line input field.
212
+ * - `multi`—Multi-line textarea that expands/collapses based on content.
213
+ * - `auto`—Starts as single-line and automatically expands to multi-line when needed.
214
+ *
215
+ * @default 'multi'
216
+ *
217
+ * @example
218
+ * ```tsx
219
+ * <Chat messageBoxSettings={{ mode: 'auto' }} />
220
+ * ```
221
+ */
222
+ mode?: PromptBoxMode;
223
+ /**
224
+ * Sets the number of visible rows for the Message Box textarea.
225
+ *
226
+ * @default 2
227
+ *
228
+ * @example
229
+ * ```tsx
230
+ * <Chat messageBoxSettings={{ rows: 5 }} />
231
+ * ```
232
+ */
233
+ rows?: number;
234
+ /**
235
+ * Sets the maximum height of the Message Box textarea in px.
236
+ * When the height exceeds this value, the Message Box height is fixed and a scrollbar appears.
237
+ * Applicable for `multi` and `auto` modes.
238
+ *
239
+ * @default '110'
240
+ *
241
+ * @example
242
+ * ```tsx
243
+ * <Chat messageBoxSettings={{ maxTextAreaHeight: '300' }} />
244
+ * ```
245
+ */
246
+ maxTextAreaHeight?: string;
247
+ }
202
248
  /**
203
249
  * Configuration settings for message display and behavior.
204
250
  */
@@ -365,6 +411,18 @@ export interface ChatProps extends FieldMappingConfig {
365
411
  * Only renders when there are no messages and this template is provided.
366
412
  */
367
413
  noDataTemplate?: React.ReactElement | (() => React.ReactElement);
414
+ /**
415
+ * Enables or disables the scroll-to-bottom button that appears when the user scrolls up.
416
+ * When enabled, a floating action button appears to allow quick navigation to the latest messages.
417
+ *
418
+ * @default true
419
+ *
420
+ * @example
421
+ * ```tsx
422
+ * <Chat scrollToBottomButton={false} />
423
+ * ```
424
+ */
425
+ scrollToBottomButton?: boolean;
368
426
  /**
369
427
  * Template for the timestamp of the message.
370
428
  */
@@ -460,11 +518,11 @@ export interface ChatProps extends FieldMappingConfig {
460
518
  * Sets the upload configuration for the Chat component.
461
519
  * This can be used to customize the file upload behavior, such as accepted file types and maximum file size.
462
520
  */
463
- uploadConfig?: boolean | UploadProps;
521
+ uploadConfig?: boolean | UploadButtonProps;
464
522
  /**
465
523
  * Configures the appearance and behavior of the send button in the Chat component.
466
524
  */
467
- sendButtonConfig?: ButtonProps;
525
+ sendButtonConfig?: boolean | ButtonProps;
468
526
  /**
469
527
  * Fires when a toolbar action is executed on a message. Provides the action and target message.
470
528
  */
@@ -486,9 +544,50 @@ export interface ChatProps extends FieldMappingConfig {
486
544
  */
487
545
  onInputValueChange?: (value: string) => void;
488
546
  /**
489
- * Input value of the Chat component.
547
+ * Sets the controlled input value of the Chat component.
548
+ * When provided, the Chat operates in controlled mode and you must handle `onInputValueChange` to update the value.
549
+ *
550
+ * @example
551
+ * ```tsx
552
+ * const [inputValue, setInputValue] = useState('');
553
+ * <Chat inputValue={inputValue} onInputValueChange={setInputValue} />
554
+ * ```
490
555
  */
491
556
  inputValue?: string;
557
+ /**
558
+ * Fires when the user clicks the Retry button on a failed message.
559
+ * Emits [`ChatResendMessageEvent`](https://www.telerik.com/kendo-react-ui/components/conversational-ui/api/chatresendmessageevent).
560
+ *
561
+ * @example
562
+ * ```tsx
563
+ * const handleResend = (event: ChatResendMessageEvent) => {
564
+ * console.log('Resending message:', event.message);
565
+ * // Implement retry logic
566
+ * };
567
+ * <Chat onResendMessage={handleResend} />
568
+ * ```
569
+ */
570
+ onResendMessage?: (event: ChatResendMessageEvent) => void;
571
+ /**
572
+ * Configuration for the Message Box (PromptBox component).
573
+ *
574
+ * @example
575
+ * ```tsx
576
+ * <Chat messageBoxSettings={{ rows: 5, maxTextAreaHeight: '300' }} />
577
+ * ```
578
+ */
579
+ messageBoxSettings?: MessageBoxSettings;
580
+ /**
581
+ * Specifies whether the Send button is transformed to a stop button.
582
+ *
583
+ * @default false
584
+ *
585
+ * @example
586
+ * ```tsx
587
+ * <Chat loading={true} />
588
+ * ```
589
+ */
590
+ loading?: boolean;
492
591
  }
493
592
  /**
494
593
  * @hidden
package/chat/Events.d.ts CHANGED
@@ -39,6 +39,15 @@ export interface ChatSendMessageEvent extends BaseEvent<React.Component> {
39
39
  */
40
40
  message: Message;
41
41
  }
42
+ /**
43
+ * Arguments for the `onResendMessage` event of the Chat.
44
+ */
45
+ export interface ChatResendMessageEvent extends BaseEvent<React.Component> {
46
+ /**
47
+ * The message that will be resent.
48
+ */
49
+ message: Message;
50
+ }
42
51
  /**
43
52
  * Arguments for the `toolbaractionexecute` event of the Chat.
44
53
  */
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";const D=require("react"),d=require("@progress/kendo-react-common"),E=require("./Action.js"),K=require("./ScrollButtonsWrapper.js"),L=require("../hooks/useScrollWithButtons.js");function O(c){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const r in c)if(r!=="default"){const u=Object.getOwnPropertyDescriptor(c,r);Object.defineProperty(e,r,u.get?u:{enumerable:!0,get:()=>c[r]})}}return e.default=c,Object.freeze(e)}const l=O(D),j=c=>{var S;const{group:e,onActionExecute:r,selected:u,onRequestSelection:g,quickActionsLayout:a="scroll",dir:p}=c,[t,i]=l.useState(null),b=l.useRef(null),{canScrollLeft:k,canScrollRight:C,scrollLeft:y,scrollRight:I}=L.useScrollWithButtons(b,{enabled:a==="scrollbuttons",dir:p,itemsDependency:e.actions});l.useEffect(()=>{!u&&t!==null?i(null):u&&t===null&&i(0)},[u,t]);const m=l.useCallback(()=>e.actions?e.actions.length-1:-1,[e.actions]),f=l.useCallback((n,s=0)=>{let o=null;return n?t===null?o=s:t<m()&&(o=t+1):t===null?o=0:t>0&&(o=t-1),o!==null&&i(o),o},[t,m]),R=l.useCallback(()=>{g(e.selectionIndex)},[g,e.selectionIndex]),x=l.useCallback(n=>{let s=null;const o=d.Keys.left,A=d.Keys.right;n.keyCode===o?s=f(!1):n.keyCode===A&&(s=f(!0)),s!==null&&(n.preventDefault(),n.stopPropagation())},[f]),q=l.useCallback(()=>d.classNames("k-suggestion-group",{"k-suggestion-group-scrollable":a==="scroll"}),[a]),h=l.createElement("div",{className:q(),onClick:R,onKeyDown:x,role:"toolbar",tabIndex:0,"aria-label":"Action group",ref:a==="scrollbuttons"?b:void 0},(S=e.actions)==null?void 0:S.map((n,s)=>l.createElement(E,{item:n,onActionExecute:r,selected:s===t,key:n.value})));return l.createElement(K.ScrollButtonsWrapper,{visible:a==="scrollbuttons",dir:p,canScrollLeft:k,canScrollRight:C,onScrollLeft:y,onScrollRight:I},h)};module.exports=j;
8
+ "use strict";const K=require("react"),p=require("@progress/kendo-react-common"),I=require("./Action.js"),L=require("./ScrollButtonsWrapper.js"),N=require("../hooks/useScrollWithButtons.js");function O(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const a in r)if(a!=="default"){const u=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(t,a,u.get?u:{enumerable:!0,get:()=>r[a]})}}return t.default=r,Object.freeze(t)}const e=O(K),W=r=>{var y,C;const{group:t,onActionExecute:a,selected:u,onRequestSelection:b,quickActionsLayout:l="scroll",dir:m}=r,[o,i]=e.useState(null),k=e.useRef(null),{canScrollLeft:d,canScrollRight:f,scrollLeft:R,scrollRight:x}=N.useScrollWithButtons(k,{enabled:l==="scrollbuttons"||l==="scroll",dir:m,mode:l,itemsDependency:t.actions});e.useEffect(()=>{!u&&o!==null?i(null):u&&o===null&&i(0)},[u,o]);const S=e.useCallback(()=>t.actions?t.actions.length-1:-1,[t.actions]),g=e.useCallback((n,s=0)=>{let c=null;return n?o===null?c=s:o<S()&&(c=o+1):o===null?c=0:o>0&&(c=o-1),c!==null&&i(c),c},[o,S]),q=e.useCallback(()=>{b(t.selectionIndex)},[b,t.selectionIndex]),h=e.useCallback(n=>{let s=null;const c=p.Keys.left,D=p.Keys.right;n.keyCode===c?s=g(!1):n.keyCode===D&&(s=g(!0)),s!==null&&(n.preventDefault(),n.stopPropagation())},[g]),E=e.useCallback(()=>p.classNames("k-suggestion-group",{"k-suggestion-group-scrollable":l==="scroll","k-suggestion-group-scrollable-start":f&&(l==="scroll"||l==="scrollbuttons"),"k-suggestion-group-scrollable-end":d&&(l==="scroll"||l==="scrollbuttons")}),[l,f,d]),v=l==="scroll"||l==="scrollbuttons",A=e.createElement("div",{className:E(),onClick:q,onKeyDown:h,role:"toolbar",tabIndex:0,"aria-label":"Action group"},v?e.createElement("div",{className:"k-suggestions-scroll",ref:k},(y=t.actions)==null?void 0:y.map((n,s)=>e.createElement(I,{item:n,onActionExecute:a,selected:s===o,key:n.value}))):(C=t.actions)==null?void 0:C.map((n,s)=>e.createElement(I,{item:n,onActionExecute:a,selected:s===o,key:n.value})));return e.createElement(L.ScrollButtonsWrapper,{visible:l==="scrollbuttons",dir:m,canScrollLeft:d,canScrollRight:f,onScrollLeft:R,onScrollRight:x},A)};module.exports=W;
@@ -5,73 +5,83 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as t from "react";
9
- import { Keys as g, classNames as L } from "@progress/kendo-react-common";
10
- import K from "./Action.mjs";
8
+ import * as e from "react";
9
+ import { Keys as S, classNames as N } from "@progress/kendo-react-common";
10
+ import y from "./Action.mjs";
11
11
  import { ScrollButtonsWrapper as q } from "./ScrollButtonsWrapper.mjs";
12
- import { useScrollWithButtons as v } from "../hooks/useScrollWithButtons.mjs";
13
- const W = (b) => {
14
- var p;
15
- const { group: n, onActionExecute: C, selected: r, onRequestSelection: u, quickActionsLayout: c = "scroll", dir: f } = b, [e, a] = t.useState(null), d = t.useRef(null), { canScrollLeft: k, canScrollRight: S, scrollLeft: I, scrollRight: x } = v(d, {
16
- enabled: c === "scrollbuttons",
17
- dir: f,
18
- itemsDependency: n.actions
12
+ import { useScrollWithButtons as D } from "../hooks/useScrollWithButtons.mjs";
13
+ const P = (I) => {
14
+ var k, C;
15
+ const { group: c, onActionExecute: d, selected: r, onRequestSelection: m, quickActionsLayout: l = "scroll", dir: g } = I, [t, a] = e.useState(null), p = e.useRef(null), { canScrollLeft: i, canScrollRight: u, scrollLeft: x, scrollRight: R } = D(p, {
16
+ enabled: l === "scrollbuttons" || l === "scroll",
17
+ dir: g,
18
+ mode: l,
19
+ itemsDependency: c.actions
19
20
  });
20
- t.useEffect(() => {
21
- !r && e !== null ? a(null) : r && e === null && a(0);
22
- }, [r, e]);
23
- const m = t.useCallback(() => n.actions ? n.actions.length - 1 : -1, [n.actions]), i = t.useCallback(
24
- (l, s = 0) => {
25
- let o = null;
26
- return l ? e === null ? o = s : e < m() && (o = e + 1) : e === null ? o = 0 : e > 0 && (o = e - 1), o !== null && a(o), o;
21
+ e.useEffect(() => {
22
+ !r && t !== null ? a(null) : r && t === null && a(0);
23
+ }, [r, t]);
24
+ const b = e.useCallback(() => c.actions ? c.actions.length - 1 : -1, [c.actions]), f = e.useCallback(
25
+ (o, s = 0) => {
26
+ let n = null;
27
+ return o ? t === null ? n = s : t < b() && (n = t + 1) : t === null ? n = 0 : t > 0 && (n = t - 1), n !== null && a(n), n;
27
28
  },
28
- [e, m]
29
- ), y = t.useCallback(() => {
30
- u(n.selectionIndex);
31
- }, [u, n.selectionIndex]), R = t.useCallback(
32
- (l) => {
29
+ [t, b]
30
+ ), E = e.useCallback(() => {
31
+ m(c.selectionIndex);
32
+ }, [m, c.selectionIndex]), h = e.useCallback(
33
+ (o) => {
33
34
  let s = null;
34
- const o = g.left, E = g.right;
35
- l.keyCode === o ? s = i(!1) : l.keyCode === E && (s = i(!0)), s !== null && (l.preventDefault(), l.stopPropagation());
35
+ const n = S.left, K = S.right;
36
+ o.keyCode === n ? s = f(!1) : o.keyCode === K && (s = f(!0)), s !== null && (o.preventDefault(), o.stopPropagation());
36
37
  },
37
- [i]
38
- ), h = t.useCallback(() => L("k-suggestion-group", {
38
+ [f]
39
+ ), A = e.useCallback(() => N("k-suggestion-group", {
39
40
  // Apply scrollable class only when layout is 'scroll' (no scroll buttons)
40
- "k-suggestion-group-scrollable": c === "scroll"
41
- }), [c]), A = /* @__PURE__ */ t.createElement(
41
+ "k-suggestion-group-scrollable": l === "scroll",
42
+ "k-suggestion-group-scrollable-start": u && (l === "scroll" || l === "scrollbuttons"),
43
+ "k-suggestion-group-scrollable-end": i && (l === "scroll" || l === "scrollbuttons")
44
+ }), [l, u, i]), L = l === "scroll" || l === "scrollbuttons", v = /* @__PURE__ */ e.createElement(
42
45
  "div",
43
46
  {
44
- className: h(),
45
- onClick: y,
46
- onKeyDown: R,
47
+ className: A(),
48
+ onClick: E,
49
+ onKeyDown: h,
47
50
  role: "toolbar",
48
51
  tabIndex: 0,
49
- "aria-label": "Action group",
50
- ref: c === "scrollbuttons" ? d : void 0
52
+ "aria-label": "Action group"
51
53
  },
52
- (p = n.actions) == null ? void 0 : p.map((l, s) => /* @__PURE__ */ t.createElement(
53
- K,
54
+ L ? /* @__PURE__ */ e.createElement("div", { className: "k-suggestions-scroll", ref: p }, (k = c.actions) == null ? void 0 : k.map((o, s) => /* @__PURE__ */ e.createElement(
55
+ y,
54
56
  {
55
- item: l,
56
- onActionExecute: C,
57
- selected: s === e,
58
- key: l.value
57
+ item: o,
58
+ onActionExecute: d,
59
+ selected: s === t,
60
+ key: o.value
61
+ }
62
+ ))) : (C = c.actions) == null ? void 0 : C.map((o, s) => /* @__PURE__ */ e.createElement(
63
+ y,
64
+ {
65
+ item: o,
66
+ onActionExecute: d,
67
+ selected: s === t,
68
+ key: o.value
59
69
  }
60
70
  ))
61
71
  );
62
- return /* @__PURE__ */ t.createElement(
72
+ return /* @__PURE__ */ e.createElement(
63
73
  q,
64
74
  {
65
- visible: c === "scrollbuttons",
66
- dir: f,
67
- canScrollLeft: k,
68
- canScrollRight: S,
69
- onScrollLeft: I,
70
- onScrollRight: x
75
+ visible: l === "scrollbuttons",
76
+ dir: g,
77
+ canScrollLeft: i,
78
+ canScrollRight: u,
79
+ onScrollLeft: x,
80
+ onScrollRight: R
71
81
  },
72
- A
82
+ v
73
83
  );
74
84
  };
75
85
  export {
76
- W as default
86
+ P as default
77
87
  };
@@ -5,7 +5,7 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { ChatProps } from '../../index.js';
8
+ import { ChatProps } from '../ChatPropsAndState.js';
9
9
  import * as React from 'react';
10
10
  /**
11
11
  * Represents the [KendoReact Chat component](https://www.telerik.com/kendo-react-ui/components/conversational-ui).
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@progress/kendo-react-common"),n=require("prop-types"),nt=require("react"),at=require("../ViewItem.js"),ot=require("./ActionGroup.js"),rt=require("./AttachmentGroup.js"),lt=require("./DateMarker.js"),it=require("./MessageGroup.js"),ct=require("./NewMessage.js"),ut=require("./Header.js"),gt=require("./elements/PinnedMessage.js"),mt=require("./Notification.js"),dt=require("./ChatContext.js"),pt=require("./ChatMessage.js"),Fe=require("../../package-metadata.js"),C=require("../../messages/index.js"),ft=require("@progress/kendo-react-intl"),Le=require("../utils/fieldMapping.js"),ht=require("../utils/scroll.js"),yt=require("../utils/messageSettings.js");function Ct(g){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(g){for(const r in g)if(r!=="default"){const M=Object.getOwnPropertyDescriptor(g,r);Object.defineProperty(u,r,M.get?M:{enumerable:!0,get:()=>g[r]})}}return u.default=g,Object.freeze(u)}const e=Ct(nt),I=e.forwardRef((g,u)=>{const{messages:r=[],messageTemplate:M,messageContentTemplate:N,attachmentTemplate:x,width:Ie,height:Ne,onSendMessage:T,onSuggestionClick:D,onInputValueChange:O,onActionExecute:E,dir:f,messageBox:De,placeholder:Oe,className:j,style:je,message:P=pt.ChatMessage,authorId:l,suggestions:U,suggestionTemplate:Pe,suggestionsLayout:Ue="scroll",quickActionsLayout:V="scroll",inputValue:Ve,headerTemplate:h,noDataTemplate:y,timestampTemplate:B,statusTemplate:K,userStatusTemplate:W,allowMessageCollapse:G,messageToolbarActions:z,messageContextMenuActions:_,fileActions:k,onUnpin:Be,messageWidthMode:H,showAvatar:$,showUsername:J,timestampVisibility:Q,authorMessageSettings:X,receiverMessageSettings:Y,onToolbarAction:Z,onContextMenuAction:ee,onFileAction:te,onDownload:se,speechToTextConfig:ne,uploadConfig:ae,sendButtonConfig:Ke,messageFilesLayout:oe,textField:re,statusField:le,authorIdField:ie,authorNameField:ce,authorImageUrlField:ue,authorImageAltTextField:ge,idField:me,timestampField:de,filesField:pe,attachmentsField:fe,replyToIdField:he,isDeletedField:ye,isPinnedField:Ce,typingField:Me,suggestedActionsField:Te,...We}=g,[m,R]=e.useState(null),[A,Ge]=e.useState(!1),[ze,Se]=e.useState(!1),[ke,be]=e.useState(null),[d,xe]=e.useState(null),w=e.useRef(null),Ee=e.useRef(null),q=e.useRef(null),Re=e.useRef(null),v=e.useRef(void 0),F=e.useRef(!1),L=e.useRef(null),Ae=e.useRef(""),o=e.useMemo(()=>{if(!r||r.length===0)return[];const s={textField:re,statusField:le,authorIdField:ie,authorNameField:ce,authorImageUrlField:ue,authorImageAltTextField:ge,idField:me,timestampField:de,filesField:pe,attachmentsField:fe,replyToIdField:he,isDeletedField:ye,isPinnedField:Ce,typingField:Me,suggestedActionsField:Te};return!Object.values(s).some(a=>a!==void 0)&&Le.isStandardMessageFormat(r[0])?r.map(a=>({...a,timestamp:a.timestamp?new Date(a.timestamp):a.timestamp})):Le.mapDataArrayToMessages(r,s)},[r,re,le,ie,ce,ue,ge,me,de,pe,fe,he,ye,Ce,Me,Te]);e.useEffect(()=>{if(l===Ae.current&&L.current){xe(L.current);return}if(l&&o.length>0){const s=o.find(a=>a.author&&(a.author.id===l||a.author.id===String(l))),t=(s==null?void 0:s.author)||{id:l};L.current=t,Ae.current=l,xe(t)}},[l,o]);const p=e.useMemo(()=>o.length>0?at.convertMsgsToViewItems(o):[],[o]),_e=e.useMemo(()=>!c.validatePackage(Fe.packageMetadata,{component:"Chat"}),[]),He=c.getLicenseMessage(Fe.packageMetadata),we=e.useMemo(()=>o.find(s=>s.isPinned),[o]),qe=ft.useLocalization();ht.useChatScroll({viewItemsWrapperRef:q,isKeyboardNavigationActiveRef:F,processedMessages:o,suggestions:U});const $e=e.useCallback(()=>{clearTimeout(v.current)},[]),Je=e.useCallback(()=>{v.current=window.setTimeout(()=>{R(null)},0)},[]),b=e.useCallback(s=>{R(s)},[]),Qe=e.useCallback(s=>{let t=null;const a=m!==null?m:p.lastSelectionIndex;s.keyCode===c.Keys.up?a===null?t=0:a>0&&(t=a-1):s.keyCode===c.Keys.down?a===null?t=0:a<p.lastSelectionIndex&&(t=a+1):s.keyCode===c.Keys.home?t=0:s.keyCode===c.Keys.end&&(t=p.lastSelectionIndex),t!==null&&(R(t),F.current=!0,s.preventDefault())},[m,p]),ve=e.useCallback((s,t,a)=>{var S;if(E&&E({action:{value:s.value,title:s.title,type:s.type},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget}),!t.isDefaultPrevented()){switch(s.type){case"reply":T&&T({message:{id:"",author:d,text:s.value,timestamp:new Date},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget});break;case"call":window.open("tel:"+s.value);break;case"openUrl":window.open(s.value);break}(S=Re.current)==null||S.focusInput()}},[E,T,d]),Xe=e.useCallback(()=>c.classNames("k-chat",j,{"k-rtl":A}),[j,A]),Ye=e.useCallback(()=>{const s=p.length-1;return p.map((t,a)=>{var S;if(t.type==="date-marker")return e.createElement(lt,{item:t,key:t.trackBy,timestampTemplate:B});if(t.type==="message-group"){const st={allowMessageCollapse:G,messageWidthMode:H,showAvatar:$,showUsername:J,messageTemplate:M,messageContentTemplate:N,messageToolbarActions:z,messageContextMenuActions:_,fileActions:k},i=yt.resolveMessageSettings((S=t==null?void 0:t.messages)==null?void 0:S[0],l,st,X,Y);return e.createElement(it,{group:t,itemTemplate:i.messageTemplate,contentTemplate:i.messageContentTemplate,attachmentTemplate:x,user:d,selectedItemIndex:m,onRequestSelection:b,isLastGroup:a===s,key:t.messages[0].selectionIndex,message:P,allowMessageCollapse:i.allowMessageCollapse,messageToolbarActions:i.messageToolbarActions,messageContextMenuActions:i.messageContextMenuActions,fileActions:i.fileActions,messageWidthMode:i.messageWidthMode,showAvatar:i.showAvatar,showUsername:i.showUsername})}else{if(t.type==="attachment-group")return e.createElement(rt,{group:t,itemTemplate:x,onRequestSelection:b,selected:t.selectionIndex===m,isLastGroup:a===s,key:t.selectionIndex});if(t.type==="action-group")return e.createElement(ot,{group:t,onActionExecute:ve,onRequestSelection:b,selected:t.selectionIndex===m,key:t.selectionIndex,quickActionsLayout:V,dir:f})}return null})},[p,B,M,N,x,d,m,b,P,G,z,_,k,H,$,J,l,X,Y,ve,V,f]),Ze=e.useCallback(()=>h?typeof h=="function"?h():h:null,[h]),et=e.useCallback(()=>y?typeof y=="function"?y():y:null,[y]);e.useEffect(()=>{const s=f!==void 0?f==="rtl":w.current&&getComputedStyle(w.current).direction==="rtl";Ge(!!s)},[f]),e.useEffect(()=>()=>{clearTimeout(v.current)},[]);const tt=e.useMemo(()=>({replyToMessage:ke,setReplyToMessage:be,messages:o,user:d,internalScrollContainerRef:Ee,messageListScrollContainerRef:q,onToolbarAction:Z,onContextMenuAction:ee,onFileAction:te,setShowCopyNotification:Se,onDownload:se,fileActions:k,speechToTextConfig:ne,uploadConfig:ae,statusTemplate:K,userStatusTemplate:W,messageFilesLayout:oe,timestampVisibility:Q}),[ke,be,o,d,Z,ee,te,Se,se,k,ne,ae,K,W,oe,Q]);return e.createElement(dt.default.Provider,{value:tt},e.createElement("div",{style:{width:Ie,height:Ne,position:"relative",overflow:"hidden",...je},onKeyDown:Qe,className:Xe(),ref:s=>{w.current=s,Ee.current=s,typeof u=="function"?u(s):u&&(u.current=s)},...We},h!==void 0&&e.createElement(ut,null,Ze()),we&&e.createElement(gt,{message:we,onUnpin:Be,user:d}),e.createElement("div",{className:"k-message-list",onBlur:Je,onFocus:$e,role:"log","aria-label":qe.toLanguageString(C.ariaLabelMessageList,C.messages[C.ariaLabelMessageList]),"aria-live":"polite",ref:q},e.createElement("div",{className:c.classNames("k-message-list-content",{"k-message-list-content-empty":o.length===0})},o.length===0&&y!==void 0&&et(),o.length>0&&Ye())),e.createElement(ct,{onSendMessage:(s,t)=>{T&&T({message:s,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})},onSuggestionClick:s=>{D&&D(s)},isDirectionRightToLeft:A,ref:Re,placeholder:Oe,MessageBox:De,suggestions:U,suggestionTemplate:Pe,inputValue:Ve,onInputValueChange:s=>{O&&O(s)},onInputClick:()=>{F.current=!1},sendButtonConfig:Ke,suggestionsLayout:Ue,dir:f}),e.createElement(mt,{show:ze,text:qe.toLanguageString(C.chatCopyNotification,C.messages[C.chatCopyNotification])}),_e&&e.createElement(c.WatermarkOverlay,{message:He})))});I.displayName="Chat";I.propTypes={messages:n.arrayOf(n.object),user:n.object,messageTemplate:n.any,messageContentTemplate:n.any,attachmentTemplate:n.any,width:n.oneOfType([n.string,n.number]),style:n.object,onSendMessage:n.func,onActionExecute:n.func,dir:n.string,messageBox:n.any,noDataTemplate:n.oneOfType([n.element,n.func]),suggestionsLayout:n.oneOf(["scroll","wrap","scrollbuttons"]),quickActionsLayout:n.oneOf(["scroll","wrap","scrollbuttons"]),userStatusTemplate:n.elementType,messageFilesLayout:n.oneOf(["vertical","wrap","horizontal"]),showAvatar:n.bool,showUsername:n.bool,authorMessageSettings:n.object,receiverMessageSettings:n.object};exports.Chat=I;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@progress/kendo-react-common"),n=require("prop-types"),pt=require("react"),ft=require("@progress/kendo-react-buttons"),ht=require("@progress/kendo-svg-icons"),yt=require("../ViewItem.js"),Tt=require("./ActionGroup.js"),Ct=require("./AttachmentGroup.js"),St=require("./DateMarker.js"),Mt=require("./MessageGroup.js"),kt=require("./NewMessage.js"),bt=require("./Header.js"),Et=require("./elements/PinnedMessage.js"),wt=require("./Notification.js"),vt=require("./ChatContext.js"),xt=require("./ChatMessage.js"),De=require("../../package-metadata.js"),l=require("../../messages/index.js"),Rt=require("@progress/kendo-react-intl"),Oe=require("../utils/fieldMapping.js"),je=require("../utils/scroll.js"),At=require("../utils/messageSettings.js");function qt(d){const m=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const i in d)if(i!=="default"){const M=Object.getOwnPropertyDescriptor(d,i);Object.defineProperty(m,i,M.get?M:{enumerable:!0,get:()=>d[i]})}}return m.default=d,Object.freeze(m)}const e=qt(pt),D=e.forwardRef((d,m)=>{const{messages:i=[],messageTemplate:M,messageContentTemplate:O,attachmentTemplate:v,width:Pe,height:Ue,onSendMessage:k,onSuggestionClick:j,onInputValueChange:P,onActionExecute:x,dir:T,messageBox:Ve,placeholder:He,className:U,style:Ke,message:V=xt.ChatMessage,authorId:u,suggestions:H,suggestionTemplate:We,suggestionsLayout:ze="scroll",quickActionsLayout:K="scroll",inputValue:Ge,headerTemplate:C,noDataTemplate:S,timestampTemplate:W,statusTemplate:z,userStatusTemplate:G,allowMessageCollapse:_,messageToolbarActions:$,messageContextMenuActions:J,fileActions:b,onUnpin:_e,messageWidthMode:Q,showAvatar:X,showUsername:Y,timestampVisibility:Z,authorMessageSettings:ee,receiverMessageSettings:te,onToolbarAction:se,onContextMenuAction:ne,onFileAction:oe,onDownload:ae,speechToTextConfig:re,uploadConfig:le,sendButtonConfig:$e,messageFilesLayout:ie,scrollToBottomButton:R=!0,textField:ce,statusField:ue,authorIdField:ge,authorNameField:me,authorImageUrlField:de,authorImageAltTextField:pe,idField:fe,timestampField:he,filesField:ye,attachmentsField:Te,replyToIdField:Ce,isDeletedField:Se,isPinnedField:Me,typingField:ke,suggestedActionsField:be,isFailedField:Ee,onResendMessage:we,messageBoxSettings:Je,loading:Qe,...Xe}=d,[p,A]=e.useState(null),[q,Ye]=e.useState(!1),[Ze,ve]=e.useState(!1),[xe,Re]=e.useState(null),[f,Ae]=e.useState(null),[et,qe]=e.useState(!1),F=e.useRef(null),Fe=e.useRef(null),r=e.useRef(null),Le=e.useRef(null),L=e.useRef(void 0),I=e.useRef(!1),N=e.useRef(null),Ie=e.useRef(""),a=e.useMemo(()=>{if(!i||i.length===0)return[];const s={textField:ce,statusField:ue,authorIdField:ge,authorNameField:me,authorImageUrlField:de,authorImageAltTextField:pe,idField:fe,timestampField:he,filesField:ye,attachmentsField:Te,replyToIdField:Ce,isDeletedField:Se,isPinnedField:Me,typingField:ke,suggestedActionsField:be,isFailedField:Ee};return!Object.values(s).some(o=>o!==void 0)&&Oe.isStandardMessageFormat(i[0])?i.map(o=>({...o,timestamp:o.timestamp?new Date(o.timestamp):o.timestamp})):Oe.mapDataArrayToMessages(i,s)},[i,ce,ue,ge,me,de,pe,fe,he,ye,Te,Ce,Se,Me,ke,be,Ee]);e.useEffect(()=>{if(u===Ie.current&&N.current){Ae(N.current);return}if(u&&a.length>0){const s=a.find(o=>o.author&&(o.author.id===u||o.author.id===String(u))),t=(s==null?void 0:s.author)||{id:u};N.current=t,Ie.current=u,Ae(t)}},[u,a]);const h=e.useMemo(()=>a.length>0?yt.convertMsgsToViewItems(a):[],[a]),tt=e.useMemo(()=>!g.validatePackage(De.packageMetadata,{component:"Chat"}),[]),st=g.getLicenseMessage(De.packageMetadata),Ne=e.useMemo(()=>a.find(s=>s.isPinned),[a]),E=Rt.useLocalization();je.useChatScroll({viewItemsWrapperRef:r,isKeyboardNavigationActiveRef:I,processedMessages:a,suggestions:H});const nt=je.useHasScrollbar({elementRef:r}),ot=e.useCallback(()=>{clearTimeout(L.current)},[]),at=e.useCallback(()=>{L.current=window.setTimeout(()=>{A(null)},0)},[]),w=e.useCallback(s=>{A(s)},[]),rt=e.useCallback(s=>{let t=null;const o=p!==null?p:h.lastSelectionIndex;s.keyCode===g.Keys.up?o===null?t=0:o>0&&(t=o-1):s.keyCode===g.Keys.down?o===null?t=0:o<h.lastSelectionIndex&&(t=o+1):s.keyCode===g.Keys.home?t=0:s.keyCode===g.Keys.end&&(t=h.lastSelectionIndex),t!==null&&(A(t),I.current=!0,s.preventDefault())},[p,h]),Be=e.useCallback((s,t,o)=>{var y;if(x&&x({action:{value:s.value,title:s.title,type:s.type},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget}),!t.isDefaultPrevented()){switch(s.type){case"reply":k&&k({message:{id:"",author:f,text:s.value,timestamp:new Date},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget});break;case"call":window.open("tel:"+s.value);break;case"openUrl":window.open(s.value);break}(y=Le.current)==null||y.focusInput()}},[x,k,f]),lt=e.useCallback(()=>{r.current&&(r.current.scrollTop=r.current.scrollHeight-r.current.clientHeight,qe(!1))},[]),it=e.useCallback(()=>g.classNames("k-chat",U,{"k-rtl":q}),[U,q]),ct=e.useCallback(()=>{const s=h.length-1;return h.map((t,o)=>{var y;if(t.type==="date-marker")return e.createElement(St,{item:t,key:t.trackBy,timestampTemplate:W});if(t.type==="message-group"){const B={allowMessageCollapse:_,messageWidthMode:Q,showAvatar:X,showUsername:Y,messageTemplate:M,messageContentTemplate:O,messageToolbarActions:$,messageContextMenuActions:J,fileActions:b},c=At.resolveMessageSettings((y=t==null?void 0:t.messages)==null?void 0:y[0],u,B,ee,te);return e.createElement(Mt,{group:t,itemTemplate:c.messageTemplate,contentTemplate:c.messageContentTemplate,attachmentTemplate:v,user:f,selectedItemIndex:p,onRequestSelection:w,isLastGroup:o===s,key:t.messages[0].selectionIndex,message:V,allowMessageCollapse:c.allowMessageCollapse,messageToolbarActions:c.messageToolbarActions,messageContextMenuActions:c.messageContextMenuActions,fileActions:c.fileActions,messageWidthMode:c.messageWidthMode,showAvatar:c.showAvatar,showUsername:c.showUsername})}else{if(t.type==="attachment-group")return e.createElement(Ct,{group:t,itemTemplate:v,onRequestSelection:w,selected:t.selectionIndex===p,isLastGroup:o===s,key:t.selectionIndex});if(t.type==="action-group")return e.createElement(Tt,{group:t,onActionExecute:Be,onRequestSelection:w,selected:t.selectionIndex===p,key:t.selectionIndex,quickActionsLayout:K,dir:T})}return null})},[h,W,M,O,v,f,p,w,V,_,$,J,b,Q,X,Y,u,ee,te,Be,K,T]),ut=e.useCallback(()=>C?typeof C=="function"?C():C:null,[C]),gt=e.useCallback(()=>S?typeof S=="function"?S():S:null,[S]);e.useEffect(()=>{const s=T!==void 0?T==="rtl":F.current&&getComputedStyle(F.current).direction==="rtl";Ye(!!s)},[T]),e.useEffect(()=>()=>{clearTimeout(L.current)},[]),e.useEffect(()=>{if(!R||!r.current)return;let s;const t=()=>{clearTimeout(s),s=window.setTimeout(()=>{if(r.current){const{scrollTop:y,scrollHeight:B,clientHeight:c}=r.current,dt=B-y-c<100;qe(!dt)}},150)},o=r.current;return o.addEventListener("scroll",t),()=>{o.removeEventListener("scroll",t),clearTimeout(s)}},[R]);const mt=e.useMemo(()=>({replyToMessage:xe,setReplyToMessage:Re,messages:a,user:f,internalScrollContainerRef:Fe,messageListScrollContainerRef:r,onToolbarAction:se,onContextMenuAction:ne,onFileAction:oe,setShowCopyNotification:ve,onDownload:ae,onResendMessage:we,fileActions:b,speechToTextConfig:re,uploadConfig:le,statusTemplate:z,userStatusTemplate:G,messageFilesLayout:ie,timestampVisibility:Z}),[xe,Re,a,f,se,ne,oe,ve,ae,we,b,re,le,z,G,ie,Z]);return e.createElement(vt.default.Provider,{value:mt},e.createElement("div",{style:{width:Pe,height:Ue,position:"relative",overflow:"hidden",...Ke},onKeyDown:rt,className:it(),ref:s=>{F.current=s,Fe.current=s,typeof m=="function"?m(s):m&&(m.current=s)},...Xe},C!==void 0&&e.createElement(bt,null,ut()),e.createElement("div",{className:"k-message-list",onBlur:at,onFocus:ot,role:"log","aria-label":E.toLanguageString(l.ariaLabelMessageList,l.messages[l.ariaLabelMessageList]),"aria-live":"polite",ref:r},Ne&&e.createElement(Et,{message:Ne,onUnpin:_e,user:f}),e.createElement("div",{className:g.classNames("k-message-list-content",{"k-message-list-content-empty":a.length===0})},a.length===0&&S!==void 0&&gt(),a.length>0&&ct()),R&&et&&e.createElement("div",{className:"k-chat-scroll-to-bottom-container"},e.createElement(ft.FloatingActionButton,{svgIcon:ht.arrowDownOutlineIcon,size:"small",themeColor:"light",rounded:"full",onClick:lt,"aria-label":E.toLanguageString(l.scrollToBottom,l.messages[l.scrollToBottom]),title:E.toLanguageString(l.scrollToBottom,l.messages[l.scrollToBottom])}))),nt&&e.createElement("div",{className:"k-separator"}),e.createElement(kt,{onSendMessage:(s,t)=>{k&&k({message:s,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})},onSuggestionClick:s=>{j&&j(s)},isDirectionRightToLeft:q,ref:Le,placeholder:He,MessageBox:Ve,suggestions:H,suggestionTemplate:We,inputValue:Ge,onInputValueChange:s=>{P&&P(s)},onInputClick:()=>{I.current=!1},sendButtonConfig:$e,suggestionsLayout:ze,dir:T,messageBoxSettings:Je,loading:Qe}),e.createElement(wt,{show:Ze,text:E.toLanguageString(l.chatCopyNotification,l.messages[l.chatCopyNotification])}),tt&&e.createElement(g.WatermarkOverlay,{message:st})))});D.displayName="Chat";D.propTypes={messages:n.arrayOf(n.object),user:n.object,messageTemplate:n.any,messageContentTemplate:n.any,attachmentTemplate:n.any,width:n.oneOfType([n.string,n.number]),style:n.object,onSendMessage:n.func,onActionExecute:n.func,dir:n.string,messageBox:n.any,noDataTemplate:n.oneOfType([n.element,n.func]),suggestionsLayout:n.oneOf(["scroll","wrap","scrollbuttons"]),quickActionsLayout:n.oneOf(["scroll","wrap","scrollbuttons"]),userStatusTemplate:n.elementType,messageFilesLayout:n.oneOf(["vertical","wrap","horizontal"]),showAvatar:n.bool,showUsername:n.bool,authorMessageSettings:n.object,receiverMessageSettings:n.object};exports.Chat=D;