@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,48 +5,68 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- const e = "newMessage.sendButton", s = "newMessage.optionsButton", t = "newMessage.messageInput", a = "avatar.alt", o = "messageList.ariaLabel", l = "aIPrompt.noOutputs", c = "aIPrompt.cancel", n = "chat.senderDeletedMessage", i = "chat.receiverDeletedMessage", r = "chat.copyNotification", g = "chat.downloadAllFiles", d = "chat.closeReply", p = "chat.collapseMessage", h = "chat.expandMessage", M = "chat.removeFile", m = "chat.fileActions", u = "chat.attachFile", w = "chat.downloadAll", f = "chat.scrollLeft", v = "chat.scrollRight", A = {
8
+ const e = "newMessage.sendButton", t = "newMessage.optionsButton", o = "newMessage.messageInput", s = "avatar.alt", a = "messageList.ariaLabel", n = "aIPrompt.noOutputs", l = "aIPrompt.cancel", c = "chat.senderDeletedMessage", r = "chat.receiverDeletedMessage", p = "chat.copyNotification", i = "chat.downloadAllFiles", g = "chat.closeReply", m = "chat.collapseMessage", d = "chat.expandMessage", h = "chat.removeFile", B = "chat.fileActions", M = "chat.attachFile", x = "chat.downloadAll", u = "chat.scrollLeft", f = "chat.scrollRight", v = "chat.scrollToBottom", F = "chat.messageFailed", w = "chat.retryMessage", A = "chat.stopGenerating", S = "promptBox.input", b = "promptBox.sendButton", y = "promptBox.attachFile", R = "promptBox.removeFile", I = "promptBox.stopGenerating", L = "promptBox.ariaLabel", D = {
9
9
  [e]: "Send",
10
- [s]: "Options",
11
- [t]: "Message",
12
- [a]: "Avatar",
13
- [o]: "Message list",
14
- [c]: "Cancel",
15
- [l]: "No output from AI available",
16
- [n]: "You removed this message",
17
- [i]: "The message was removed by its sender",
18
- [r]: "Text copied to clipboard",
19
- [g]: "Download all files",
20
- [d]: "Close reply",
21
- [p]: "Collapse message",
22
- [h]: "Expand message",
23
- [M]: "Remove file",
24
- [m]: "File actions for",
25
- [u]: "Attach file",
26
- [w]: "Download all",
27
- [f]: "Scroll left",
28
- [v]: "Scroll right"
10
+ [t]: "Options",
11
+ [o]: "Message",
12
+ [s]: "Avatar",
13
+ [a]: "Message list",
14
+ [l]: "Cancel",
15
+ [n]: "No output from AI available",
16
+ [c]: "You removed this message",
17
+ [r]: "The message was removed by its sender",
18
+ [p]: "Text copied to clipboard",
19
+ [i]: "Download all files",
20
+ [g]: "Close reply",
21
+ [m]: "Collapse message",
22
+ [d]: "Expand message",
23
+ [h]: "Remove file",
24
+ [B]: "File actions for",
25
+ [F]: "Failed to send",
26
+ [w]: "Retry",
27
+ [A]: "Stop generating",
28
+ [M]: "Attach file",
29
+ [x]: "Download all",
30
+ [u]: "Scroll left",
31
+ [f]: "Scroll right",
32
+ [v]: "Scroll to bottom",
33
+ [S]: "Prompt",
34
+ [b]: "Send",
35
+ [y]: "Attach file",
36
+ [R]: "Remove file",
37
+ [I]: "Stop generating",
38
+ [L]: "Prompt box"
29
39
  };
30
40
  export {
31
- c as aIPromptCancel,
32
- l as aIPromptNoOutputs,
33
- o as ariaLabelMessageList,
34
- u as attachFile,
35
- a as avatarAlt,
36
- r as chatCopyNotification,
37
- i as chatReceiverDeletedMessage,
38
- n as chatSenderDeletedMessage,
39
- d as closeReply,
40
- p as collapseMessage,
41
- w as downloadAll,
42
- g as downloadAllFiles,
43
- h as expandMessage,
44
- m as fileActions,
45
- A as messages,
46
- t as newMessageMessageInput,
47
- s as newMessageOptionsButton,
41
+ l as aIPromptCancel,
42
+ n as aIPromptNoOutputs,
43
+ a as ariaLabelMessageList,
44
+ M as attachFile,
45
+ s as avatarAlt,
46
+ p as chatCopyNotification,
47
+ r as chatReceiverDeletedMessage,
48
+ c as chatSenderDeletedMessage,
49
+ A as chatStopGenerating,
50
+ g as closeReply,
51
+ m as collapseMessage,
52
+ x as downloadAll,
53
+ i as downloadAllFiles,
54
+ d as expandMessage,
55
+ B as fileActions,
56
+ F as messageFailed,
57
+ D as messages,
58
+ o as newMessageMessageInput,
59
+ t as newMessageOptionsButton,
48
60
  e as newMessageSendButton,
49
- M as removeFile,
50
- f as scrollLeft,
51
- v as scrollRight
61
+ L as promptBoxAriaLabel,
62
+ y as promptBoxAttachFile,
63
+ S as promptBoxInput,
64
+ R as promptBoxRemoveFile,
65
+ b as promptBoxSendButton,
66
+ I as promptBoxStopGenerating,
67
+ h as removeFile,
68
+ w as retryMessage,
69
+ u as scrollLeft,
70
+ f as scrollRight,
71
+ v as scrollToBottom
52
72
  };
@@ -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 e=Object.freeze({name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1770288029,version:"13.4.0-develop.2",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"});exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1770312198,version:"13.4.0-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"});exports.packageMetadata=e;
@@ -8,7 +8,7 @@ export const packageMetadata = Object.freeze({
8
8
  productCode: 'KENDOUIREACT',
9
9
  productCodes: ['KENDOUIREACT'],
10
10
  publishDate: 0,
11
- version: '13.4.0-develop.2',
11
+ version: '13.4.0-develop.3',
12
12
  licensingDocsUrl:
13
13
  'https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
14
14
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-conversational-ui",
3
- "version": "13.4.0-develop.2",
3
+ "version": "13.4.0-develop.3",
4
4
  "description": "React Chat component allows the user to participate in chat sessions with users or chat bots. KendoReact Conversational UI components",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -26,15 +26,15 @@
26
26
  "sideEffects": false,
27
27
  "peerDependencies": {
28
28
  "@progress/kendo-licensing": "^1.7.2",
29
- "@progress/kendo-react-animation": "13.4.0-develop.2",
30
- "@progress/kendo-react-buttons": "13.4.0-develop.2",
31
- "@progress/kendo-react-common": "13.4.0-develop.2",
32
- "@progress/kendo-react-intl": "13.4.0-develop.2",
33
- "@progress/kendo-react-inputs": "13.4.0-develop.2",
34
- "@progress/kendo-react-layout": "13.4.0-develop.2",
35
- "@progress/kendo-react-notification": "13.4.0-develop.2",
36
- "@progress/kendo-react-popup": "13.4.0-develop.2",
37
- "@progress/kendo-react-upload": "13.4.0-develop.2",
29
+ "@progress/kendo-react-animation": "13.4.0-develop.3",
30
+ "@progress/kendo-react-buttons": "13.4.0-develop.3",
31
+ "@progress/kendo-react-common": "13.4.0-develop.3",
32
+ "@progress/kendo-react-intl": "13.4.0-develop.3",
33
+ "@progress/kendo-react-inputs": "13.4.0-develop.3",
34
+ "@progress/kendo-react-layout": "13.4.0-develop.3",
35
+ "@progress/kendo-react-notification": "13.4.0-develop.3",
36
+ "@progress/kendo-react-popup": "13.4.0-develop.3",
37
+ "@progress/kendo-react-upload": "13.4.0-develop.3",
38
38
  "@progress/kendo-svg-icons": "^4.0.0",
39
39
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
40
40
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
@@ -108,7 +108,7 @@
108
108
  "package": {
109
109
  "productName": "KendoReact",
110
110
  "productCode": "KENDOUIREACT",
111
- "publishDate": 1770288029,
111
+ "publishDate": 1770312198,
112
112
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
113
113
  }
114
114
  },
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { PromptBoxHandle } from './PromptBox.js';
9
+ import { BaseEvent } from '@progress/kendo-react-common';
10
+ import { UploadFileInfo } from '@progress/kendo-react-upload';
11
+ /**
12
+ * The arguments for the `onBlur` PromptBox event.
13
+ */
14
+ export interface PromptBoxBlurEvent extends BaseEvent<PromptBoxHandle> {
15
+ }
16
+ /**
17
+ * The arguments for the `onChange` PromptBox event.
18
+ */
19
+ export interface PromptBoxChangeEvent extends BaseEvent<PromptBoxHandle> {
20
+ /**
21
+ * The new value of the PromptBox.
22
+ */
23
+ value: string;
24
+ }
25
+ /**
26
+ * The arguments for the `onFocus` PromptBox event.
27
+ */
28
+ export interface PromptBoxFocusEvent extends BaseEvent<PromptBoxHandle> {
29
+ }
30
+ /**
31
+ * Event argument for the PromptBox `onPromptAction` event.
32
+ */
33
+ export interface PromptBoxPromptActionEvent extends BaseEvent<PromptBoxHandle> {
34
+ /**
35
+ * The current value of the PromptBox when the action button is clicked.
36
+ * Allows accessing the message content without requiring controlled mode.
37
+ */
38
+ value: string;
39
+ /**
40
+ * The currently attached files when the action button is clicked.
41
+ * Allows accessing attachments without requiring controlled mode.
42
+ */
43
+ attachments: UploadFileInfo[];
44
+ }
45
+ /**
46
+ * Event argument for the PromptBox `onSelectAttachments` event.
47
+ * Fires when files are selected via the upload button.
48
+ *
49
+ * Provides both the newly selected files and the complete state for different use cases:
50
+ * - Use `selectedFiles` for validation, logging, or processing only the newly selected files
51
+ * - Use `allFiles` for state synchronization, displaying total file count, or updating UI with all files
52
+ */
53
+ export interface PromptBoxSelectAttachmentsEvent {
54
+ /**
55
+ * The newly selected files from this selection event.
56
+ * Use this when you need to process, validate, or log only the files that were just selected.
57
+ * Contains Upload component's UploadFileInfo objects with metadata like size, validation errors, and status.
58
+ * To access the native File object, use fileInfo.getRawFile().
59
+ */
60
+ selectedFiles: UploadFileInfo[];
61
+ /**
62
+ * All files currently in the PromptBox, including both previously selected and newly selected files.
63
+ * Use this when you need the complete file state for UI updates, total count, or state management.
64
+ */
65
+ allFiles: UploadFileInfo[];
66
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { UploadFileInfo } from '@progress/kendo-react-upload';
9
+ import * as React from 'react';
10
+ /**
11
+ * @hidden
12
+ */
13
+ export interface FileBoxProps {
14
+ files: UploadFileInfo[];
15
+ onRemoveFile: (fileName: string) => void;
16
+ header?: React.ReactNode | (() => React.ReactNode);
17
+ }
18
+ /**
19
+ * @hidden
20
+ * Displays the list of selected files with remove functionality.
21
+ */
22
+ export declare const FileBox: React.FC<FileBoxProps>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),b=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-react-common"),B=require("@progress/kendo-svg-icons"),L=require("@progress/kendo-react-intl"),c=require("../messages/index.js");function O(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,a.get?a:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const n=O(R),F="k-prompt-box",M=1,N=e=>"."+e.split(".").pop()||"",z=e=>{if(e==null)return"";if(e===0)return"0 B";const r=1024,o=["B","KB","MB","GB","TB"],a=Math.floor(Math.log(e)/Math.log(r));return`${parseFloat((e/Math.pow(r,a)).toFixed(2))} ${o[a]}`},h=e=>e?typeof e=="function"?e():e:null,C=({files:e,onRemoveFile:r,header:o})=>{const a=L.useLocalization(),u=n.useRef(null),[p,f]=n.useState(!1),[d,g]=n.useState(!1),s=n.useCallback(()=>{const t=u.current;if(!t)return;const{scrollLeft:l,scrollWidth:i,clientWidth:k}=t,E=l===0,x=l+k>=i-M;g(!E),f(!x)},[]);if(n.useLayoutEffect(()=>{s()},[e,s]),n.useEffect(()=>{const t=u.current;if(!t)return;const l=()=>s(),i=new ResizeObserver(s);return i.observe(t),t.addEventListener("scroll",l,{passive:!0}),()=>{t.removeEventListener("scroll",l),i.disconnect()}},[s,e.length]),e.length===0&&!o)return null;const S=h(o),v=e.length>0&&n.createElement("ul",{className:m.classNames("k-file-box-wrapper",{"k-file-box-wrapper-scrollable-start":p,"k-file-box-wrapper-scrollable-end":d})},n.createElement("div",{className:"k-files-scroll",ref:u},e.map(t=>n.createElement("li",{key:t.name,className:"k-file-box"},n.createElement(m.IconWrap,{size:"xlarge",...m.getFileExtensionIcon(N(t.name))}),n.createElement("div",{className:"k-file-info"},n.createElement("span",{className:"k-file-name"},t.name),n.createElement("span",{className:"k-file-size"},z(t.size))),n.createElement(b.Button,{fillMode:"flat",svgIcon:B.xMarkSmOutlineIcon,onClick:l=>{l.stopPropagation(),r(t.name)},"aria-label":`${a.toLanguageString(c.promptBoxRemoveFile,c.messages[c.promptBoxRemoveFile])} ${t.name}`,title:`${a.toLanguageString(c.promptBoxRemoveFile,c.messages[c.promptBoxRemoveFile])} ${t.name}`})))));return n.createElement("div",{className:`${F}-header`},S,v)};exports.FileBox=C;
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import * as n from "react";
9
+ import { Button as L } from "@progress/kendo-react-buttons";
10
+ import { classNames as B, IconWrap as N, getFileExtensionIcon as R } from "@progress/kendo-react-common";
11
+ import { xMarkSmOutlineIcon as h } from "@progress/kendo-svg-icons";
12
+ import { useLocalization as z } from "@progress/kendo-react-intl";
13
+ import { promptBoxRemoveFile as i, messages as u } from "../messages/index.mjs";
14
+ const M = "k-prompt-box", b = 1, C = (e) => "." + e.split(".").pop() || "", F = (e) => {
15
+ if (e == null)
16
+ return "";
17
+ if (e === 0)
18
+ return "0 B";
19
+ const l = 1024, s = ["B", "KB", "MB", "GB", "TB"], o = Math.floor(Math.log(e) / Math.log(l));
20
+ return `${parseFloat((e / Math.pow(l, o)).toFixed(2))} ${s[o]}`;
21
+ }, O = (e) => e ? typeof e == "function" ? e() : e : null, T = ({ files: e, onRemoveFile: l, header: s }) => {
22
+ const o = z(), m = n.useRef(null), [p, f] = n.useState(!1), [d, g] = n.useState(!1), a = n.useCallback(() => {
23
+ const t = m.current;
24
+ if (!t)
25
+ return;
26
+ const { scrollLeft: r, scrollWidth: c, clientWidth: k } = t, v = r === 0, x = r + k >= c - b;
27
+ g(!v), f(!x);
28
+ }, []);
29
+ if (n.useLayoutEffect(() => {
30
+ a();
31
+ }, [e, a]), n.useEffect(() => {
32
+ const t = m.current;
33
+ if (!t)
34
+ return;
35
+ const r = () => a(), c = new ResizeObserver(a);
36
+ return c.observe(t), t.addEventListener("scroll", r, { passive: !0 }), () => {
37
+ t.removeEventListener("scroll", r), c.disconnect();
38
+ };
39
+ }, [a, e.length]), e.length === 0 && !s)
40
+ return null;
41
+ const E = O(s), S = e.length > 0 && /* @__PURE__ */ n.createElement(
42
+ "ul",
43
+ {
44
+ className: B("k-file-box-wrapper", {
45
+ "k-file-box-wrapper-scrollable-start": p,
46
+ "k-file-box-wrapper-scrollable-end": d
47
+ })
48
+ },
49
+ /* @__PURE__ */ n.createElement("div", { className: "k-files-scroll", ref: m }, e.map((t) => /* @__PURE__ */ n.createElement("li", { key: t.name, className: "k-file-box" }, /* @__PURE__ */ n.createElement(N, { size: "xlarge", ...R(C(t.name)) }), /* @__PURE__ */ n.createElement("div", { className: "k-file-info" }, /* @__PURE__ */ n.createElement("span", { className: "k-file-name" }, t.name), /* @__PURE__ */ n.createElement("span", { className: "k-file-size" }, F(t.size))), /* @__PURE__ */ n.createElement(
50
+ L,
51
+ {
52
+ fillMode: "flat",
53
+ svgIcon: h,
54
+ onClick: (r) => {
55
+ r.stopPropagation(), l(t.name);
56
+ },
57
+ "aria-label": `${o.toLanguageString(
58
+ i,
59
+ u[i]
60
+ )} ${t.name}`,
61
+ title: `${o.toLanguageString(
62
+ i,
63
+ u[i]
64
+ )} ${t.name}`
65
+ }
66
+ ))))
67
+ );
68
+ return /* @__PURE__ */ n.createElement("div", { className: `${M}-header` }, E, S);
69
+ };
70
+ export {
71
+ T as FileBox
72
+ };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { PromptBoxProps } from './interfaces/PromptBoxProps.js';
9
+ import * as React from 'react';
10
+ /**
11
+ * Represents the ref handle for the PromptBox component.
12
+ * Provides methods to programmatically control the input element.
13
+ */
14
+ export interface PromptBoxHandle {
15
+ /**
16
+ * Programmatically focus the input element.
17
+ */
18
+ focus: () => void;
19
+ /**
20
+ * Programmatically blur the input element.
21
+ */
22
+ blur: () => void;
23
+ /**
24
+ * Reference to the underlying input or textarea element.
25
+ */
26
+ element: HTMLInputElement | HTMLTextAreaElement | null;
27
+ /**
28
+ * The current value of the input element.
29
+ */
30
+ value?: string;
31
+ }
32
+ /**
33
+ * Represents the PromptBox component.
34
+ */
35
+ export declare const PromptBox: React.ForwardRefExoticComponent<PromptBoxProps & React.RefAttributes<PromptBoxHandle | null>>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ge=require("react"),o=require("prop-types"),d=require("@progress/kendo-react-common"),se=require("@progress/kendo-svg-icons"),Ke=require("./PromptBoxActionButton.js"),Xe=require("./PromptBoxSpeechToTextButton.js"),Ze=require("./PromptBoxUploadButton.js"),Je=require("./FileBox.js"),Ee=require("../package-metadata.js"),Qe=require("@progress/kendo-react-intl"),a=require("../messages/index.js");function Ye(E){const N=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(E){for(const F in E)if(F!=="default"){const j=Object.getOwnPropertyDescriptor(E,F);Object.defineProperty(N,F,j.get?j:{enumerable:!0,get:()=>E[F]})}}return N.default=E,Object.freeze(N)}const t=Ye(Ge),g="k-prompt-box",et=20,tt=50,y={mode:"auto",rows:1,defaultValue:"",disabled:!1,readOnly:!1,loading:!1,uploadButtonConfig:!1,speechToTextButtonConfig:!0,actionButtonConfig:!0},re=t.forwardRef((E,N)=>{const F=!d.validatePackage(Ee.packageMetadata,{component:"PromptBox"}),j=d.getLicenseMessage(Ee.packageMetadata),v=Qe.useLocalization(),Se={...y,...E},{mode:s=y.mode,fillMode:le,rows:M=y.rows,maxTextAreaHeight:u,value:ae,defaultValue:Te=y.defaultValue,disabled:p=y.disabled,readOnly:Ae=y.readOnly,placeholder:Re,title:Fe,maxLength:we,inputAttributes:Pe,topAffix:ie,startAffix:k,endAffix:x,header:Oe,onChange:w,onFocus:Z,onBlur:J,onPromptAction:Q,attachments:ce,loading:C=y.loading,uploadButtonConfig:h=y.uploadButtonConfig,speechToTextButtonConfig:z=y.speechToTextButtonConfig,actionButtonConfig:q=y.actionButtonConfig,className:Ne,style:Me,...He}=Se,r=t.useRef(null),[Le,_]=t.useState(Te),[Ie,Y]=t.useState([]),[c,ue]=t.useState(!1),fe=t.useRef(null),D=t.useRef(null),H=t.useRef(0),pe=t.useRef(0),L=t.useRef(!1),me=t.useRef(0),U=t.useRef(0),S=t.useCallback((e,n)=>e?typeof e=="function"?e(n):e:null,[]),T=ae!==void 0,f=T?ae:Le,A=ce!==void 0,R=A?ce:Ie,I=t.useMemo(()=>!!(f!=null&&f.trim()||R.length>0),[f,R.length]),P=t.useCallback(()=>{if(!r.current||s==="single")return;const e=r.current,n=globalThis.getComputedStyle(e),l=Number.parseFloat(n.lineHeight)||et,i=Number.parseFloat(n.paddingTop)||0,B=Number.parseFloat(n.paddingBottom)||0;H.current=e.offsetHeight||l+i+B,pe.current=l*M+i+B,s==="auto"&&!c&&(U.current=e.offsetWidth)},[s,M,c]),$e=t.useCallback(()=>s==="auto"?1:M,[s,M]),de=t.useCallback(e=>{if(u){const n=Number.parseInt(u,10);if(e>n)return n}return Math.max(pe.current,e)},[u]),W=t.useCallback(e=>{e.style.overflow="hidden",e.style.height=`${H.current}px`;const n=e.scrollHeight,l=de(n);e.style.height=`${l}px`,u&&n>Number.parseInt(u,10)&&(e.style.overflow="")},[de,u]),V=t.useCallback(e=>{e.style.overflow="hidden",e.style.height=`${H.current}px`;const n=e.scrollHeight,l=u?Math.min(n,Number.parseInt(u,10)):n;e.style.height=`${l}px`,u&&n>Number.parseInt(u,10)&&(e.style.overflow="")},[u]),ge=t.useCallback(e=>{if(U.current<=0)return!1;const n=e.style.height,l=e.style.width;e.style.overflow="hidden",e.style.width=`${U.current}px`,e.style.height=`${H.current}px`;const i=e.scrollWidth<=U.current&&e.scrollHeight<=H.current;return e.style.overflow="",l?e.style.width=l:e.style.width="",n?e.style.height=n:e.style.height="",i},[]),G=t.useCallback((e,n)=>{if(L.current)return;if((e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&!c){L.current=!0,ue(!0);return}if(c){V(e);const i=me.current;n<i&&ge(e)&&(e.style.height="",L.current=!0,ue(!1))}},[c,V,ge]),O=t.useCallback(()=>{var l;if(s==="single"||!r.current)return;const e=r.current,n=((l=e.value)==null?void 0:l.length)||0;s==="multi"?W(e):s==="auto"&&G(e,n)},[s,W,G]);t.useEffect(()=>{s!=="single"&&r.current&&P()},[s,P]),t.useEffect(()=>{s!=="single"&&r.current&&(P(),O())},[M,s,P,O]),t.useEffect(()=>{if(s!=="single"&&r.current){const e=(f==null?void 0:f.length)||0;requestAnimationFrame(()=>{if(r.current){const n=r.current;s==="multi"?W(n):s==="auto"&&G(n,e),me.current=e}})}},[f,s,W,G]),t.useEffect(()=>{s==="auto"&&c&&r.current&&requestAnimationFrame(()=>{if(r.current){const e=r.current;V(e),L.current=!1}})},[c,s,V]),t.useEffect(()=>{if(s==="auto"&&r.current){const e=r.current;c||(e.style.height="",e.style.overflow="",L.current=!1)}},[s,c]),t.useEffect(()=>{if(s==="single"||!r.current)return;const e=r.current;let n;const l=()=>{clearTimeout(n),n=setTimeout(()=>{r.current&&(s==="auto"&&!c&&P(),O())},tt)},i=new ResizeObserver(l);return i.observe(e),()=>{i.disconnect(),clearTimeout(n)}},[s,c,P,O]);const m=t.useCallback(()=>({focus:()=>{var e;return(e=r.current)==null?void 0:e.focus()},blur:()=>{var e;return(e=r.current)==null?void 0:e.blur()},element:r.current,get value(){return f}}),[f]);t.useImperativeHandle(N,m);const je=t.useCallback(e=>{const n=e.target.value;!T&&!p&&_(n),w&&!p&&d.dispatchEvent(w,e,{...m(),value:n},{value:n}),s!=="single"&&O()},[_,w,p,T,m,s,O]),ze=t.useCallback(e=>{Z&&!p&&d.dispatchEvent(Z,e,m(),void 0)},[Z,p,m]),qe=t.useCallback(e=>{J&&!p&&d.dispatchEvent(J,e,m(),void 0)},[J,p,m]),he=t.useCallback(e=>{e.preventDefault()},[]),K=t.useCallback(e=>{Q&&d.dispatchEvent(Q,e,m(),{value:f,attachments:R}),T||_(""),A||Y([])},[Q,m,f,R,T,A]),_e=t.useCallback(e=>{if(!(e.key==="Enter"&&e.shiftKey)){if(e.key==="ArrowUp"||e.key==="ArrowDown"){e.stopPropagation();return}if(e.key==="Enter"){if(e.preventDefault(),C)return;I&&K(e)}}},[K,C,I]),be={disabled:p,readOnly:Ae,placeholder:Re,title:Fe,maxLength:we,"aria-label":v.toLanguageString(a.promptBoxInput,a.messages[a.promptBoxInput]),value:f,onKeyDown:_e,...Pe,onChange:je,onFocus:ze,onBlur:qe,ref:r},Be=t.useCallback(e=>{var i,B;const{isFinal:n,alternatives:l}=e;if(l.length>0){const ne=l[0];if(n){const X=((i=r.current)==null?void 0:i.value)||"",$=(X?`${X} `:"")+ne.transcript;if(T||_($),w&&!p){const ke={target:r.current,currentTarget:r.current};d.dispatchEvent(w,ke,{...m(),value:$},{value:$})}}}(B=r.current)==null||B.focus()},[T,w,p,m]),ye=t.useCallback(()=>{var e,n;(n=(e=fe.current)==null?void 0:e.actionElement)==null||n.click()},[]),ve=t.useCallback(e=>{var i;const n=Array.from(e.affectedFiles),l=typeof h=="object"&&h.onSelectAttachments;A||Y(B=>[...B,...n]),l&&l({selectedFiles:e.affectedFiles,allFiles:e.newState}),(i=r.current)==null||i.focus()},[h,A]),b=t.useMemo(()=>({uploadButtonProps:{fillMode:"flat",svgIcon:se.paperclipOutlineAltRightIcon,size:"small",onClick:ye,onFilesAdd:ve,files:R,uploadRef:fe,"aria-label":v.toLanguageString(a.promptBoxAttachFile,a.messages[a.promptBoxAttachFile]),title:v.toLanguageString(a.promptBoxAttachFile,a.messages[a.promptBoxAttachFile]),_registerRemoveCallback:e=>{D.current=e}},speechToTextButtonProps:{fillMode:"flat",size:"small",onResult:Be},actionButtonProps:{rounded:"full",size:"small",svgIcon:C?se.stopSmIcon:se.arrowUpOutlineIcon,className:C?"k-generating":"",onClick:K,onMouseDown:he,disabled:!C&&!I,"aria-disabled":!C&&!I,"aria-label":C?v.toLanguageString(a.promptBoxStopGenerating,a.messages[a.promptBoxStopGenerating]):v.toLanguageString(a.promptBoxSendButton,a.messages[a.promptBoxSendButton]),title:C?v.toLanguageString(a.promptBoxStopGenerating,a.messages[a.promptBoxStopGenerating]):v.toLanguageString(a.promptBoxSendButton,a.messages[a.promptBoxSendButton]),"aria-live":"polite"}}),[Be,ve,R,K,he,C,ye,v,I]),De=t.useCallback(e=>{A||Y(l=>l.filter(i=>i.name!==e));const n=typeof h=="object"&&h.onRemoveAttachment;n&&(D.current=n),D.current&&D.current(e)},[h,A]),ee=()=>{const e=z!==!1,n=q!==!1,l=h!==!1,i=typeof z=="object"?z:void 0,B=typeof h=="object"?h:{},{restrictions:ne,multiple:X=!0,accept:$,onSelectAttachments:ke,onRemoveAttachment:nt,...We}=B,oe={restrictions:ne,multiple:X,accept:$},Ve=typeof q=="object"?q:void 0;return t.createElement(t.Fragment,null,l&&t.createElement(Ze.PromptBoxUploadButton,{...b.uploadButtonProps,restrictions:oe.restrictions,multiple:oe.multiple,accept:oe.accept,...We}),e&&t.createElement(Xe.PromptBoxSpeechToTextButton,{...b.speechToTextButtonProps,...i}),n&&t.createElement(Ke.PromptBoxActionButton,{...b.actionButtonProps,...Ve}))},te=s==="multi"||s==="auto"&&c,xe=h!==!1||z!==!1||q!==!1,Ce=x||xe,Ue=k||x||xe;return t.createElement("div",{"aria-label":v.toLanguageString(a.promptBoxAriaLabel,a.messages[a.promptBoxAriaLabel]),...He,className:d.classNames(Ne,"k-input",g,{[`k-input-${le}`]:le,"k-disabled":p,"k-prompt-box-singleline":s==="single","k-prompt-box-multiline":te}),style:Me},t.createElement(Je.FileBox,{files:R,onRemoveFile:De,header:Oe}),s==="single"?t.createElement("div",{className:`${g}-content`},k&&t.createElement("div",{className:`${g}-affix`},S(k,b)),t.createElement("input",{...be,className:d.classNames("k-input-inner",`${g}-input`)}),Ce?t.createElement("div",{className:`${g}-affix`},x&&S(x,b),ee()):null):t.createElement("div",{className:`${g}-content`},s==="multi"&&ie&&t.createElement("div",{className:`${g}-affix`},S(ie,b)),s==="auto"&&!c&&k&&t.createElement("div",{className:`${g}-affix`},S(k,b)),t.createElement("textarea",{...be,className:d.classNames("k-input-inner",`${g}-textarea`),rows:$e(),style:u?{maxHeight:u}:{},...te&&{"aria-multiline":"true"}}),s==="auto"&&!c&&Ce?t.createElement("div",{className:`${g}-affix`},x&&S(x,b),ee()):null,te&&Ue?t.createElement("div",{className:`${g}-affix`},k&&S(k,b),(k||x)&&t.createElement("div",{className:"k-spacer"}),x&&S(x,b),ee()):null),F&&t.createElement(d.WatermarkOverlay,{message:j}))});re.propTypes={value:o.string,defaultValue:o.string,mode:o.oneOf(["single","multi","auto"]),rows:o.number,maxTextAreaHeight:o.string,title:o.string,disabled:o.bool,readOnly:o.bool,placeholder:o.string,maxLength:o.number,inputAttributes:o.object,fillMode:o.oneOf(["solid","flat","outline"]),topAffix:o.oneOfType([o.func,o.element,o.string]),startAffix:o.oneOfType([o.func,o.element,o.string]),endAffix:o.oneOfType([o.func,o.element,o.string]),header:o.oneOfType([o.func,o.element,o.string]),onChange:o.func,onFocus:o.func,onBlur:o.func,loading:o.bool,uploadButtonConfig:o.oneOfType([o.bool,o.object]),speechToTextButtonConfig:o.oneOfType([o.bool,o.object]),actionButtonConfig:o.oneOfType([o.bool,o.object]),attachments:o.array,onPromptAction:o.func,className:o.string,style:o.object};re.displayName="KendoPromptBox";exports.PromptBox=re;