@progress/kendo-react-conversational-ui 11.4.0 → 12.0.0-develop.1

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 +284 -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 +69 -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 +423 -165
  41. package/index.d.ts +423 -165
  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 +7 -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
@@ -5,5 +5,5 @@
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=require("react"),y=require("../AIPromptContent.js"),j=require("../AIPromptFooter.js"),h=require("@progress/kendo-react-buttons"),i=require("@progress/kendo-react-inputs"),F=require("@progress/kendo-svg-icons"),I=require("@progress/kendo-react-common"),G=require("./AIPromptViewRender.js"),O=require("../AIPromptExpander.js"),z=require("../AIPromptContext.js"),M=require("../../chat/components/SuggestionsGroup.js"),W=require("./constants.js"),D=x=>{const{promptInput:A=i.TextArea,generateButton:f=h.Button,enableSpeechToText:n=!1,promptValue:S,promptSuggestions:l}=x,[s,c]=e.useState(S||""),[o]=z.useAIPromptContext(),[C,p]=I.useCustomComponent(f),[q,m]=I.useCustomComponent(A),E=()=>{o.onPromptRequest&&o.onPromptRequest.call(null,s),c("")},T=t=>{c(t)},R=t=>{c(t.target.value)},k={title:"Generate",children:"Generate",svgIcon:F.sparklesIcon},V={placeholder:"Ask or generate content with AI ...",rows:2},g=Object.keys(p).length>0?p:k,w=Object.keys(m).length>0?m:V,d=t=>{const{isFinal:r,alternatives:P}=t;if(r&&P.length>0){const b=P[0].transcript,v=(()=>{const a=s,B=a&&!a.endsWith(" ")&&!a.endsWith(`
9
- `);return a+(B?" ":"")+b})();c(v)}};let u;return n&&(typeof n=="object"?u={...n,onResult:n.onResult||d}:u={onResult:d}),e.createElement(G.AIPromptViewRender,{name:W.promptViewDefaults.name},e.createElement(y.AIPromptContent,{streaming:o.streaming,onCancel:o.onCancel},e.createElement(q,{value:s,className:"!k-flex-col",suffix:n?e.createElement(e.Fragment,null,e.createElement(i.InputSeparator,{orientation:"horizontal"}),e.createElement(i.InputSuffix,{orientation:"horizontal"},e.createElement(h.SpeechToTextButton,{fillMode:"flat",...u}))):void 0,onChange:R,...w}),l&&l.length>0&&e.createElement(O.AIPromptExpander,{title:"Prompt Suggestions"},e.createElement(M.SuggestionGroup,{suggestionsView:o.suggestionsView,suggestions:l.map((t,r)=>({id:r,text:t,description:t})),onSuggestionClick:(t,r)=>{T(r.text)}}))),e.createElement(j.AIPromptFooter,null,e.createElement(C,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:E,disabled:!s.trim(),...g},g.children)))};exports.AIPromptView=D;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),y=require("../AIPromptContent.js"),j=require("../AIPromptFooter.js"),h=require("@progress/kendo-react-buttons"),i=require("@progress/kendo-react-inputs"),F=require("@progress/kendo-svg-icons"),I=require("@progress/kendo-react-common"),G=require("./AIPromptViewRender.js"),O=require("../AIPromptExpander.js"),z=require("../AIPromptContext.js"),M=require("../../chat/components/SuggestionsGroup.js"),W=require("./constants.js"),D=x=>{const{promptInput:A=i.TextArea,generateButton:f=h.Button,enableSpeechToText:n=!1,promptValue:S,promptSuggestions:a}=x,[r,s]=e.useState(S||""),[o]=z.useAIPromptContext(),[C,p]=I.useCustomComponent(f),[q,m]=I.useCustomComponent(A),E=()=>{o.onPromptRequest&&o.onPromptRequest.call(null,r),s("")},T=t=>{s(t)},R=t=>{s(t.target.value)},k={title:"Generate",children:"Generate",svgIcon:F.sparklesIcon},V={placeholder:"Ask or generate content with AI ...",rows:2},g=Object.keys(p).length>0?p:k,w=Object.keys(m).length>0?m:V,d=t=>{const{isFinal:u,alternatives:P}=t;if(u&&P.length>0){const b=P[0].transcript,v=(()=>{const c=r,B=c&&!c.endsWith(" ")&&!c.endsWith(`
9
+ `);return c+(B?" ":"")+b})();s(v)}};let l;return n&&(typeof n=="object"?l={...n,onResult:n.onResult||d}:l={onResult:d}),e.createElement(G.AIPromptViewRender,{name:W.promptViewDefaults.name},e.createElement(y.AIPromptContent,{streaming:o.streaming,onCancel:o.onCancel},e.createElement(q,{value:r,className:"!k-flex-col",suffix:n?e.createElement(e.Fragment,null,e.createElement(i.InputSeparator,{orientation:"horizontal"}),e.createElement(i.InputSuffix,{orientation:"horizontal"},e.createElement(h.SpeechToTextButton,{fillMode:"flat",...l}))):void 0,onChange:R,...w}),a&&a.length>0&&e.createElement(O.AIPromptExpander,{title:"Prompt Suggestions"},e.createElement(M.SuggestionGroup,{suggestionsView:o.suggestionsView,suggestions:a.map((t,u)=>({id:u,text:t,description:t})),onSuggestionClick:t=>{T(t.text)}}))),e.createElement(j.AIPromptFooter,null,e.createElement(C,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:E,disabled:!r.trim(),...g},g.children)))};exports.AIPromptView=D;
@@ -6,15 +6,15 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import e from "react";
9
- import { AIPromptContent as B } from "../AIPromptContent.mjs";
9
+ import { AIPromptContent as v } from "../AIPromptContent.mjs";
10
10
  import { AIPromptFooter as y } from "../AIPromptFooter.mjs";
11
11
  import { SpeechToTextButton as j, Button as q } from "@progress/kendo-react-buttons";
12
12
  import { InputSeparator as z, InputSuffix as F, TextArea as G } from "@progress/kendo-react-inputs";
13
13
  import { sparklesIcon as O } from "@progress/kendo-svg-icons";
14
14
  import { useCustomComponent as d } from "@progress/kendo-react-common";
15
- import { AIPromptViewRender as _ } from "./AIPromptViewRender.mjs";
16
- import { AIPromptExpander as M } from "../AIPromptExpander.mjs";
17
- import { useAIPromptContext as W } from "../AIPromptContext.mjs";
15
+ import { AIPromptViewRender as M } from "./AIPromptViewRender.mjs";
16
+ import { AIPromptExpander as W } from "../AIPromptExpander.mjs";
17
+ import { useAIPromptContext as _ } from "../AIPromptContext.mjs";
18
18
  import { SuggestionGroup as $ } from "../../chat/components/SuggestionsGroup.mjs";
19
19
  import { promptViewDefaults as D } from "./constants.mjs";
20
20
  const oe = (h) => {
@@ -23,13 +23,13 @@ const oe = (h) => {
23
23
  generateButton: P = q,
24
24
  enableSpeechToText: o = !1,
25
25
  promptValue: S,
26
- promptSuggestions: i
27
- } = h, [s, l] = e.useState(S || ""), [n] = W(), [A, c] = d(P), [E, p] = d(x), I = () => {
28
- n.onPromptRequest && n.onPromptRequest.call(null, s), l("");
26
+ promptSuggestions: a
27
+ } = h, [r, s] = e.useState(S || ""), [n] = _(), [A, c] = d(P), [E, p] = d(x), I = () => {
28
+ n.onPromptRequest && n.onPromptRequest.call(null, r), s("");
29
29
  }, T = (t) => {
30
- l(t);
30
+ s(t);
31
31
  }, C = (t) => {
32
- l(t.target.value);
32
+ s(t.target.value);
33
33
  }, V = {
34
34
  title: "Generate",
35
35
  children: "Generate",
@@ -38,42 +38,42 @@ const oe = (h) => {
38
38
  placeholder: "Ask or generate content with AI ...",
39
39
  rows: 2
40
40
  }, u = Object.keys(c).length > 0 ? c : V, R = Object.keys(p).length > 0 ? p : w, f = (t) => {
41
- const { isFinal: r, alternatives: g } = t;
42
- if (r && g.length > 0) {
41
+ const { isFinal: m, alternatives: g } = t;
42
+ if (m && g.length > 0) {
43
43
  const b = g[0].transcript, k = (() => {
44
- const a = s, v = a && !a.endsWith(" ") && !a.endsWith(`
44
+ const l = r, B = l && !l.endsWith(" ") && !l.endsWith(`
45
45
  `);
46
- return a + (v ? " " : "") + b;
46
+ return l + (B ? " " : "") + b;
47
47
  })();
48
- l(k);
48
+ s(k);
49
49
  }
50
50
  };
51
- let m;
52
- return o && (typeof o == "object" ? m = {
51
+ let i;
52
+ return o && (typeof o == "object" ? i = {
53
53
  ...o,
54
54
  onResult: o.onResult || f
55
- } : m = {
55
+ } : i = {
56
56
  onResult: f
57
- }), /* @__PURE__ */ e.createElement(_, { name: D.name }, /* @__PURE__ */ e.createElement(B, { streaming: n.streaming, onCancel: n.onCancel }, /* @__PURE__ */ e.createElement(
57
+ }), /* @__PURE__ */ e.createElement(M, { name: D.name }, /* @__PURE__ */ e.createElement(v, { streaming: n.streaming, onCancel: n.onCancel }, /* @__PURE__ */ e.createElement(
58
58
  E,
59
59
  {
60
- value: s,
60
+ value: r,
61
61
  className: "!k-flex-col",
62
- suffix: o ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(z, { orientation: "horizontal" }), /* @__PURE__ */ e.createElement(F, { orientation: "horizontal" }, /* @__PURE__ */ e.createElement(j, { fillMode: "flat", ...m }))) : void 0,
62
+ suffix: o ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(z, { orientation: "horizontal" }), /* @__PURE__ */ e.createElement(F, { orientation: "horizontal" }, /* @__PURE__ */ e.createElement(j, { fillMode: "flat", ...i }))) : void 0,
63
63
  onChange: C,
64
64
  ...R
65
65
  }
66
- ), i && i.length > 0 && /* @__PURE__ */ e.createElement(M, { title: "Prompt Suggestions" }, /* @__PURE__ */ e.createElement(
66
+ ), a && a.length > 0 && /* @__PURE__ */ e.createElement(W, { title: "Prompt Suggestions" }, /* @__PURE__ */ e.createElement(
67
67
  $,
68
68
  {
69
69
  suggestionsView: n.suggestionsView,
70
- suggestions: i.map((t, r) => ({
71
- id: r,
70
+ suggestions: a.map((t, m) => ({
71
+ id: m,
72
72
  text: t,
73
73
  description: t
74
74
  })),
75
- onSuggestionClick: (t, r) => {
76
- T(r.text);
75
+ onSuggestionClick: (t) => {
76
+ T(t.text);
77
77
  }
78
78
  }
79
79
  ))), /* @__PURE__ */ e.createElement(y, null, /* @__PURE__ */ e.createElement(
@@ -84,7 +84,7 @@ const oe = (h) => {
84
84
  rounded: "full",
85
85
  size: "medium",
86
86
  onClick: I,
87
- disabled: !s.trim(),
87
+ disabled: !r.trim(),
88
88
  ...u
89
89
  },
90
90
  u.children
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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";const i=require("react"),a=require("@progress/kendo-react-common");function f(c){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>c[t]})}}return e.default=c,Object.freeze(e)}const o=f(i),m=c=>{const{item:e,onActionExecute:t,selected:n}=c,r=o.useRef(null);o.useEffect(()=>{n&&r.current&&r.current.focus()},[n]);const l=o.useCallback(s=>{(s.keyCode===a.Keys.enter||s.key===" ")&&(s.preventDefault(),t(e,s))},[t,e]),u=o.useCallback(()=>a.classNames("k-suggestion k-suggestion-primary",{"k-selected":n},{"k-focus":n}),[n]);return o.createElement("span",{role:"button",className:u(),onClick:s=>t(e,s),ref:r,onKeyDown:l,tabIndex:0,"aria-label":e.title||e.value},e.title||e.value)};module.exports=m;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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 a from "react";
9
+ import { Keys as u, classNames as i } from "@progress/kendo-react-common";
10
+ const m = (c) => {
11
+ const { item: e, onActionExecute: l, selected: s } = c, o = a.useRef(null);
12
+ a.useEffect(() => {
13
+ s && o.current && o.current.focus();
14
+ }, [s]);
15
+ const n = a.useCallback(
16
+ (t) => {
17
+ (t.keyCode === u.enter || t.key === " ") && (t.preventDefault(), l(e, t));
18
+ },
19
+ [l, e]
20
+ ), r = a.useCallback(() => i("k-suggestion k-suggestion-primary", { "k-selected": s }, { "k-focus": s }), [s]);
21
+ return /* @__PURE__ */ a.createElement(
22
+ "span",
23
+ {
24
+ role: "button",
25
+ className: r(),
26
+ onClick: (t) => l(e, t),
27
+ ref: o,
28
+ onKeyDown: n,
29
+ tabIndex: 0,
30
+ "aria-label": e.title || e.value
31
+ },
32
+ e.title || e.value
33
+ );
34
+ };
35
+ export {
36
+ m as default
37
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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";const y=require("react"),f=require("@progress/kendo-react-common"),I=require("./Action.js");function x(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const a in s)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>s[a]})}}return t.default=s,Object.freeze(t)}const o=x(y),S=s=>{var m;const{group:t,onActionExecute:a,selected:r,onRequestSelection:d}=s,[e,u]=o.useState(null);o.useEffect(()=>{!r&&e!==null?u(null):r&&e===null&&u(0)},[r,e]);const g=o.useCallback(()=>t.actions?t.actions.length-1:-1,[t.actions]),i=o.useCallback((n,c=0)=>{let l=null;return n?e===null?l=c:e<g()&&(l=e+1):e===null?l=0:e>0&&(l=e-1),l!==null&&u(l),l},[e,g]),p=o.useCallback(()=>{d(t.selectionIndex)},[d,t.selectionIndex]),b=o.useCallback(n=>{let c=null;const l=f.Keys.left,k=f.Keys.right;n.keyCode===l?c=i(!1):n.keyCode===k&&(c=i(!0)),c!==null&&(n.preventDefault(),n.stopPropagation())},[i]),C=o.useCallback(()=>f.classNames("k-suggestion-group"),[]);return o.createElement("div",{className:C(),onClick:p,onKeyDown:b,role:"toolbar",tabIndex:0,"aria-label":"Action group"},(m=t.actions)==null?void 0:m.map((n,c)=>o.createElement(I,{item:n,onActionExecute:a,selected:c===e,key:n.value})))};module.exports=S;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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 { Keys as d, classNames as x } from "@progress/kendo-react-common";
10
+ import b from "./Action.mjs";
11
+ const A = (m) => {
12
+ var f;
13
+ const { group: s, onActionExecute: p, selected: c, onRequestSelection: u } = m, [e, a] = n.useState(null);
14
+ n.useEffect(() => {
15
+ !c && e !== null ? a(null) : c && e === null && a(0);
16
+ }, [c, e]);
17
+ const r = n.useCallback(() => s.actions ? s.actions.length - 1 : -1, [s.actions]), i = n.useCallback(
18
+ (t, o = 0) => {
19
+ let l = null;
20
+ return t ? e === null ? l = o : e < r() && (l = e + 1) : e === null ? l = 0 : e > 0 && (l = e - 1), l !== null && a(l), l;
21
+ },
22
+ [e, r]
23
+ ), C = n.useCallback(() => {
24
+ u(s.selectionIndex);
25
+ }, [u, s.selectionIndex]), g = n.useCallback(
26
+ (t) => {
27
+ let o = null;
28
+ const l = d.left, I = d.right;
29
+ t.keyCode === l ? o = i(!1) : t.keyCode === I && (o = i(!0)), o !== null && (t.preventDefault(), t.stopPropagation());
30
+ },
31
+ [i]
32
+ ), k = n.useCallback(() => x("k-suggestion-group"), []);
33
+ return /* @__PURE__ */ n.createElement(
34
+ "div",
35
+ {
36
+ className: k(),
37
+ onClick: C,
38
+ onKeyDown: g,
39
+ role: "toolbar",
40
+ tabIndex: 0,
41
+ "aria-label": "Action group"
42
+ },
43
+ (f = s.actions) == null ? void 0 : f.map((t, o) => /* @__PURE__ */ n.createElement(
44
+ b,
45
+ {
46
+ item: t,
47
+ onActionExecute: p,
48
+ selected: o === e,
49
+ key: t.value
50
+ }
51
+ ))
52
+ );
53
+ };
54
+ export {
55
+ A as default
56
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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";const f=require("react"),k=require("@progress/kendo-react-common");function g(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const c in n)if(c!=="default"){const l=Object.getOwnPropertyDescriptor(n,c);Object.defineProperty(e,c,l.get?l:{enumerable:!0,get:()=>n[c]})}}return e.default=n,Object.freeze(e)}const t=g(f),p=n=>{const{item:e,template:c,tabbable:l,onClick:s,selected:a}=n,r=t.useRef(null);t.useEffect(()=>{a&&r.current&&r.current.focus()},[a]);const o=t.useCallback(()=>{if(l!==void 0)return l?0:-1},[l]),u=t.useCallback(()=>k.classNames({"k-selected":a},{"k-focus":a}),[a]),i=t.useCallback(()=>e.title?t.createElement("h5",{className:"k-card-title"},e.title):null,[e.title]),m=t.useCallback(()=>e.subtitle?t.createElement("h6",{className:"k-card-subtitle"},e.subtitle):null,[e.subtitle]),b=t.useCallback(()=>e.contentType.indexOf("image/")===0?t.createElement("img",{src:e.content,alt:e.title||"Attachment"}):e.content,[e.contentType,e.content,e.title]),d=c;return t.createElement("div",{className:u(),tabIndex:o(),onClick:s,ref:r},c?t.createElement(d,{item:e}):t.createElement("div",{className:"k-card"},t.createElement("div",{className:"k-card-body"},i(),m(),b())))};module.exports=p;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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 t from "react";
9
+ import { classNames as f } from "@progress/kendo-react-common";
10
+ const C = (s) => {
11
+ const { item: e, template: c, tabbable: a, onClick: r, selected: l } = s, n = t.useRef(null);
12
+ t.useEffect(() => {
13
+ l && n.current && n.current.focus();
14
+ }, [l]);
15
+ const i = t.useCallback(() => {
16
+ if (a !== void 0)
17
+ return a ? 0 : -1;
18
+ }, [a]), u = t.useCallback(() => f({ "k-selected": l }, { "k-focus": l }), [l]), o = t.useCallback(() => e.title ? /* @__PURE__ */ t.createElement("h5", { className: "k-card-title" }, e.title) : null, [e.title]), m = t.useCallback(() => e.subtitle ? /* @__PURE__ */ t.createElement("h6", { className: "k-card-subtitle" }, e.subtitle) : null, [e.subtitle]), b = t.useCallback(() => e.contentType.indexOf("image/") === 0 ? /* @__PURE__ */ t.createElement("img", { src: e.content, alt: e.title || "Attachment" }) : e.content, [e.contentType, e.content, e.title]), d = c;
19
+ return /* @__PURE__ */ t.createElement("div", { className: u(), tabIndex: i(), onClick: r, ref: n }, c ? /* @__PURE__ */ t.createElement(d, { item: e }) : /* @__PURE__ */ t.createElement("div", { className: "k-card" }, /* @__PURE__ */ t.createElement("div", { className: "k-card-body" }, o(), m(), b())));
20
+ };
21
+ export {
22
+ C as default
23
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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";const B=require("react"),m=require("@progress/kendo-react-common"),v=require("@progress/kendo-svg-icons"),D=require("./Attachment.js"),S=require("@progress/kendo-react-buttons");function x(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const u=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(e,r,u.get?u:{enumerable:!0,get:()=>o[r]})}}return e.default=o,Object.freeze(e)}const n=x(B),E=o=>{const{group:e,itemTemplate:r,selected:u,isLastGroup:L,onRequestSelection:g}=o,[l,d]=n.useState(null);n.useEffect(()=>{!u&&l!==null?d(null):u&&l===null&&d(0)},[u,l]);const a=n.useCallback(t=>t.attachmentLayout!=="list",[]),h=n.useCallback(()=>e.attachments?e.attachments.length-1:-1,[e.attachments]),b=n.useCallback(()=>e.attachments.length-1,[e.attachments]),i=n.useCallback((t,s=0)=>{let c=null;return t?l===null?c=s:l<h()&&(c=l+1):l===null?c=0:l>0&&(c=l-1),c!==null&&d(c),c},[l,h]),f=n.useCallback(()=>{g(e.selectionIndex)},[g,e.selectionIndex]),p=n.useCallback(t=>{let s=null,c,C;a(e)?(c=m.Keys.left,C=m.Keys.right):(c=m.Keys.up,C=m.Keys.down),t.keyCode===c?s=i(!1):t.keyCode===C&&(s=i(!0)),s!==null&&(t.preventDefault(),t.stopPropagation())},[i,a,e]),K=n.useCallback(t=>{f(),d(t)},[f]),k=n.useCallback(t=>{f(),i(t,1)},[f,i]),R=n.useCallback(()=>{let t=null;return a(e)&&l&&(t=n.createElement(S.Button,{icon:"chevron-left",onClick:()=>k(!1),svgIcon:v.chevronLeftIcon})),t},[a,e,l,k]),q=n.useCallback(()=>{let t=null;return a(e)&&l!==b()&&(t=n.createElement(S.Button,{icon:"chevron-right",onClick:()=>k(!0),svgIcon:v.chevronRightIcon})),t},[a,e,l,b,k]),w=n.useCallback(()=>m.classNames({"k-card-list":e.attachmentLayout,"k-card-deck":a(e)}),[e.attachmentLayout,e,a]),y=a(e),I=n.createElement("div",{className:w(),onKeyDown:y?void 0:p},e.attachments.map((t,s)=>n.createElement(D,{item:t,template:r,selected:s===l,tabbable:L&&s===l,onClick:()=>K(s),key:t.content})));return y?n.createElement("div",{className:"k-card-deck-scrollwrap",onKeyDown:p},R(),I,q()):I};module.exports=E;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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 l from "react";
9
+ import { Keys as m, classNames as B } from "@progress/kendo-react-common";
10
+ import { chevronLeftIcon as D, chevronRightIcon as K } from "@progress/kendo-svg-icons";
11
+ import N from "./Attachment.mjs";
12
+ import { Button as b } from "@progress/kendo-react-buttons";
13
+ const P = (y) => {
14
+ const { group: t, itemTemplate: v, selected: f, isLastGroup: L, onRequestSelection: k } = y, [n, r] = l.useState(null);
15
+ l.useEffect(() => {
16
+ !f && n !== null ? r(null) : f && n === null && r(0);
17
+ }, [f, n]);
18
+ const c = l.useCallback((e) => e.attachmentLayout !== "list", []), C = l.useCallback(() => t.attachments ? t.attachments.length - 1 : -1, [t.attachments]), h = l.useCallback(() => t.attachments.length - 1, [t.attachments]), o = l.useCallback(
19
+ (e, s = 0) => {
20
+ let a = null;
21
+ return e ? n === null ? a = s : n < C() && (a = n + 1) : n === null ? a = 0 : n > 0 && (a = n - 1), a !== null && r(a), a;
22
+ },
23
+ [n, C]
24
+ ), u = l.useCallback(() => {
25
+ k(t.selectionIndex);
26
+ }, [k, t.selectionIndex]), g = l.useCallback(
27
+ (e) => {
28
+ let s = null, a, d;
29
+ c(t) ? (a = m.left, d = m.right) : (a = m.up, d = m.down), e.keyCode === a ? s = o(!1) : e.keyCode === d && (s = o(!0)), s !== null && (e.preventDefault(), e.stopPropagation());
30
+ },
31
+ [o, c, t]
32
+ ), S = l.useCallback(
33
+ (e) => {
34
+ u(), r(e);
35
+ },
36
+ [u]
37
+ ), i = l.useCallback(
38
+ (e) => {
39
+ u(), o(e, 1);
40
+ },
41
+ [u, o]
42
+ ), w = l.useCallback(() => {
43
+ let e = null;
44
+ return c(t) && n && (e = /* @__PURE__ */ l.createElement(b, { icon: "chevron-left", onClick: () => i(!1), svgIcon: D })), e;
45
+ }, [c, t, n, i]), x = l.useCallback(() => {
46
+ let e = null;
47
+ return c(t) && n !== h() && (e = /* @__PURE__ */ l.createElement(b, { icon: "chevron-right", onClick: () => i(!0), svgIcon: K })), e;
48
+ }, [c, t, n, h, i]), E = l.useCallback(() => B({
49
+ "k-card-list": t.attachmentLayout,
50
+ "k-card-deck": c(t)
51
+ }), [t.attachmentLayout, t, c]), p = c(t), I = /* @__PURE__ */ l.createElement("div", { className: E(), onKeyDown: p ? void 0 : g }, t.attachments.map((e, s) => /* @__PURE__ */ l.createElement(
52
+ N,
53
+ {
54
+ item: e,
55
+ template: v,
56
+ selected: s === n,
57
+ tabbable: L && s === n,
58
+ onClick: () => S(s),
59
+ key: e.content
60
+ }
61
+ )));
62
+ return p ? /* @__PURE__ */ l.createElement("div", { className: "k-card-deck-scrollwrap", onKeyDown: g }, w(), I, x()) : I;
63
+ };
64
+ export {
65
+ P as default
66
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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 g=require("@progress/kendo-react-common"),r=require("prop-types"),Ge=require("react"),Ke=require("../ViewItem.js"),We=require("./ActionGroup.js"),ze=require("./AttachmentGroup.js"),Ye=require("./DateMarker.js"),$e=require("./MessageGroup.js"),Je=require("./NewMessage.js"),Qe=require("./Header.js"),Xe=require("./elements/PinnedMessage.js"),Ze=require("./Notification.js"),et=require("./ChatContext.js"),tt=require("./ChatMessage.js"),nt=require("../../package-metadata.js"),T=require("../../messages/index.js"),st=require("@progress/kendo-react-intl"),Re=require("../utils/fieldMapping.js");function ot(c){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const a in c)if(a!=="default"){const y=Object.getOwnPropertyDescriptor(c,a);Object.defineProperty(l,a,y.get?y:{enumerable:!0,get:()=>c[a]})}}return l.default=c,Object.freeze(l)}const e=ot(Ge),rt=50,at=250,lt=50,it=100,F=e.forwardRef((c,l)=>{const{messages:a=[],messageTemplate:y,attachmentTemplate:M,width:be,height:xe,onSendMessage:C,onSuggestionClick:N,onInputValueChange:v,onActionExecute:R,dir:b,messageBox:Ie,placeholder:Le,className:D,message:O=tt.ChatMessage,authorId:u,suggestions:S,suggestionTemplate:we,inputValue:qe,headerTemplate:p,timestampTemplate:B,statusTemplate:P,allowMessageCollapse:_,messageToolbarActions:V,messageContextMenuActions:H,fileActions:U,onUnpin:Ae,messageWidthMode:j,onToolbarAction:G,onContextMenuAction:K,onFileAction:W,onDownload:z,speechToTextConfig:Y,uploadConfig:$,sendButtonConfig:Fe,textField:J,statusField:Q,authorIdField:X,authorNameField:Z,authorImageUrlField:ee,authorImageAltTextField:te,idField:ne,timestampField:se,filesField:oe,attachmentsField:re,replyToIdField:ae,isDeletedField:le,isPinnedField:ie,typingField:ce,suggestedActionsField:ue,...Ne}=c,[d,x]=e.useState(null),[I,ve]=e.useState(!1),[De,de]=e.useState(!1),[me,fe]=e.useState(null),[m,ge]=e.useState(null),L=e.useRef(null),pe=e.useRef(null),i=e.useRef(null),he=e.useRef(null),w=e.useRef(void 0),q=e.useRef(void 0),A=e.useRef(null),Te=e.useRef(""),o=e.useMemo(()=>{if(!a||a.length===0)return[];if(Re.isStandardMessageFormat(a[0]))return a.map(n=>({...n,timestamp:n.timestamp?new Date(n.timestamp):n.timestamp}));const t={textField:J,statusField:Q,authorIdField:X,authorNameField:Z,authorImageUrlField:ee,authorImageAltTextField:te,idField:ne,timestampField:se,filesField:oe,attachmentsField:re,replyToIdField:ae,isDeletedField:le,isPinnedField:ie,typingField:ce,suggestedActionsField:ue};return Re.mapDataArrayToMessages(a,t)},[a,J,Q,X,Z,ee,te,ne,se,oe,re,ae,le,ie,ce,ue]);e.useEffect(()=>{if(u===Te.current&&A.current){ge(A.current);return}if(u&&o.length>0){const t=o.find(s=>s.author&&(s.author.id===u||s.author.id===String(u))),n=(t==null?void 0:t.author)||{id:u};A.current=n,Te.current=u,ge(n)}},[u,o]);const f=e.useMemo(()=>o.length>0?Ke.convertMsgsToViewItems(o):[],[o]),Oe=e.useMemo(()=>!g.validatePackage(nt.packageMetadata,{component:"Chat"}),[]),ye=e.useMemo(()=>o.find(t=>t.isPinned),[o]),Ce=st.useLocalization(),Be=e.useCallback(()=>{clearTimeout(w.current)},[]),Pe=e.useCallback(()=>{w.current=window.setTimeout(()=>{x(null)},0)},[]),k=e.useCallback(t=>{x(t)},[]),_e=e.useCallback(t=>{let n=null;const s=d!==null?d:f.lastSelectionIndex;t.keyCode===g.Keys.up?s===null?n=0:s>0&&(n=s-1):t.keyCode===g.Keys.down?s===null?n=0:s<f.lastSelectionIndex&&(n=s+1):t.keyCode===g.Keys.home?n=0:t.keyCode===g.Keys.end&&(n=f.lastSelectionIndex),n!==null&&(x(n),t.preventDefault())},[d,f]),h=e.useCallback(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight-i.current.clientHeight)},[]),Se=e.useCallback(()=>{if(!i.current)return!0;const{scrollTop:t,scrollHeight:n,clientHeight:s}=i.current;return n-t-s<rt},[]),E=e.useCallback(()=>{Se()&&requestAnimationFrame(()=>{h()})},[Se,h]),ke=e.useCallback(()=>{requestAnimationFrame(()=>{h()})},[h]),Ee=e.useCallback((t,n,s)=>{var Me;if(R&&R({action:{value:t.value,title:t.title,type:t.type},syntheticEvent:n,nativeEvent:n.nativeEvent,target:n.currentTarget}),!n.isDefaultPrevented()){switch(t.type){case"reply":C&&C({message:{id:"",author:m,text:t.value,timestamp:new Date},syntheticEvent:n,nativeEvent:n.nativeEvent,target:n.currentTarget});break;case"call":window.open("tel:"+t.value);break;case"openUrl":window.open(t.value);break}(Me=he.current)==null||Me.focusInput()}},[R,C,m]),Ve=e.useCallback(()=>g.classNames("k-chat",D,{"k-rtl":I}),[D,I]),He=e.useCallback(()=>{const t=f.length-1;return f.map((n,s)=>n.type==="date-marker"?e.createElement(Ye,{item:n,key:n.trackBy,timestampTemplate:B}):n.type==="message-group"?e.createElement($e,{group:n,itemTemplate:y,attachmentTemplate:M,user:m,selectedItemIndex:d,onRequestSelection:k,isLastGroup:s===t,key:n.messages[0].selectionIndex,message:O,allowMessageCollapse:_,messageToolbarActions:V,messageContextMenuActions:H,messageWidthMode:j}):n.type==="attachment-group"?e.createElement(ze,{group:n,itemTemplate:M,onRequestSelection:k,selected:n.selectionIndex===d,isLastGroup:s===t,key:n.selectionIndex}):n.type==="action-group"?e.createElement(We,{group:n,onActionExecute:Ee,onRequestSelection:k,selected:n.selectionIndex===d,key:n.selectionIndex}):null)},[f,B,y,M,m,d,k,O,_,V,H,j,Ee]),Ue=e.useCallback(()=>p?typeof p=="function"?p():p:null,[p]);e.useEffect(()=>{const t=b!==void 0?b==="rtl":L.current&&getComputedStyle(L.current).direction==="rtl";ve(!!t)},[b]),e.useEffect(()=>(q.current=window.setTimeout(()=>h(),at),()=>{clearTimeout(q.current)}),[h]),e.useEffect(()=>()=>{clearTimeout(w.current),clearTimeout(q.current)},[]),e.useEffect(()=>{ke()},[o.length,ke]),e.useEffect(()=>{const t=window.setTimeout(()=>{E()},lt);return()=>{clearTimeout(t)}},[o,E]),e.useEffect(()=>{if(S&&S.length>0){const t=window.setTimeout(()=>{E()},it);return()=>{clearTimeout(t)}}},[S,E]);const je=e.useMemo(()=>({replyToMessage:me,setReplyToMessage:fe,messages:o,user:m,internalScrollContainerRef:pe,messageListScrollContainerRef:i,onToolbarAction:G,onContextMenuAction:K,onFileAction:W,setShowCopyNotification:de,onDownload:z,fileActions:U,speechToTextConfig:Y,uploadConfig:$,statusTemplate:P}),[me,fe,o,m,G,K,W,de,z,U,Y,$,P]);return e.createElement(et.default.Provider,{value:je},e.createElement("div",{style:{width:be,height:xe,position:"relative",overflow:"hidden"},onKeyDown:_e,className:Ve(),ref:t=>{L.current=t,pe.current=t,typeof l=="function"?l(t):l&&(l.current=t)},...Ne},p!==void 0&&e.createElement(Qe,null,Ue()),ye&&e.createElement(Xe,{message:ye,onUnpin:Ae,user:m}),e.createElement("div",{className:"k-message-list k-avatars",onBlur:Pe,onFocus:Be,role:"log","aria-label":Ce.toLanguageString(T.ariaLabelMessageList,T.messages[T.ariaLabelMessageList]),"aria-live":"polite",ref:i},e.createElement("div",{className:"k-message-list-content"},He())),e.createElement(Je,{onSendMessage:(t,n)=>{C&&C({message:t,syntheticEvent:n,nativeEvent:n.nativeEvent,target:n.currentTarget})},onSuggestionClick:t=>{N&&N(t)},isDirectionRightToLeft:I,ref:he,placeholder:Le,MessageBox:Ie,suggestions:S,suggestionTemplate:we,inputValue:qe,onInputValueChange:t=>{v&&v(t)},sendButtonConfig:Fe}),Oe&&e.createElement(g.WatermarkOverlay,null),e.createElement(Ze,{show:De,text:Ce.toLanguageString(T.chatCopyNotification,T.messages[T.chatCopyNotification])})))});F.displayName="Chat";F.propTypes={messages:r.arrayOf(r.object),user:r.object,messageTemplate:r.any,attachmentTemplate:r.any,width:r.oneOfType([r.string,r.number]),onSendMessage:r.func,onActionExecute:r.func,dir:r.string,messageBox:r.any};exports.Chat=F;