@progress/kendo-react-conversational-ui 12.3.0-develop.2 → 12.3.0-develop.4

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 (36) hide show
  1. package/chat/components/ActionGroup.js +1 -1
  2. package/chat/components/ActionGroup.mjs +55 -34
  3. package/chat/components/Attachment.js +1 -1
  4. package/chat/components/Attachment.mjs +16 -9
  5. package/chat/components/Chat.js +1 -1
  6. package/chat/components/Chat.mjs +359 -278
  7. package/chat/components/ChatMessage.js +1 -1
  8. package/chat/components/ChatMessage.mjs +159 -147
  9. package/chat/components/Header.js +1 -1
  10. package/chat/components/Header.mjs +1 -1
  11. package/chat/components/MessageGroup.js +1 -1
  12. package/chat/components/MessageGroup.mjs +82 -61
  13. package/chat/components/NewMessage.js +1 -1
  14. package/chat/components/NewMessage.mjs +63 -59
  15. package/chat/components/ScrollButtonsWrapper.js +8 -0
  16. package/chat/components/ScrollButtonsWrapper.mjs +58 -0
  17. package/chat/components/SuggestionsGroup.js +1 -1
  18. package/chat/components/SuggestionsGroup.mjs +58 -18
  19. package/chat/components/elements/FileBox.js +1 -1
  20. package/chat/components/elements/FileBox.mjs +31 -37
  21. package/chat/components/elements/PinnedMessage.js +1 -1
  22. package/chat/components/elements/PinnedMessage.mjs +5 -4
  23. package/chat/hooks/useScrollWithButtons.js +8 -0
  24. package/chat/hooks/useScrollWithButtons.mjs +46 -0
  25. package/chat/utils/fieldMapping.js +1 -1
  26. package/chat/utils/fieldMapping.mjs +1 -1
  27. package/chat/utils/messageSettings.js +8 -0
  28. package/chat/utils/messageSettings.mjs +31 -0
  29. package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
  30. package/index.d.mts +199 -5
  31. package/index.d.ts +199 -5
  32. package/messages/index.js +1 -1
  33. package/messages/index.mjs +26 -22
  34. package/package-metadata.js +1 -1
  35. package/package-metadata.mjs +2 -2
  36. package/package.json +11 -11
@@ -5,47 +5,87 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as l from "react";
9
- import { classNames as b } from "@progress/kendo-react-common";
10
- const n = (m) => {
11
- const { suggestions: r, onSuggestionClick: a, suggestionsView: d, suggestionTemplate: t } = m, c = l.useCallback(
12
- (e, s) => {
13
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a == null || a(s));
8
+ import * as t from "react";
9
+ import { classNames as m } from "@progress/kendo-react-common";
10
+ import { ScrollButtonsWrapper as R } from "./ScrollButtonsWrapper.mjs";
11
+ import { useScrollWithButtons as E } from "../hooks/useScrollWithButtons.mjs";
12
+ const w = (b) => {
13
+ const {
14
+ suggestions: r,
15
+ onSuggestionClick: l,
16
+ suggestionsView: o,
17
+ suggestionTemplate: s,
18
+ suggestionsLayout: a,
19
+ dir: n
20
+ } = b, i = t.useRef(null), { canScrollLeft: u, canScrollRight: f, scrollLeft: k, scrollRight: y } = E(i, {
21
+ enabled: a === "scrollbuttons",
22
+ dir: n,
23
+ itemsDependency: r
24
+ }), d = t.useCallback(
25
+ (e, c) => {
26
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), l == null || l(c));
14
27
  },
15
- [a]
16
- ), p = l.useCallback(
28
+ [l]
29
+ ), p = t.useCallback(
17
30
  () => r.map(
18
- (e) => t ? /* @__PURE__ */ l.createElement(
19
- t,
31
+ (e) => s ? /* @__PURE__ */ t.createElement(
32
+ s,
20
33
  {
21
34
  key: e.id,
22
35
  suggestion: e,
23
36
  onClick: () => {
24
- a == null || a(e);
37
+ l == null || l(e);
25
38
  }
26
39
  }
27
- ) : /* @__PURE__ */ l.createElement(
40
+ ) : /* @__PURE__ */ t.createElement(
28
41
  "span",
29
42
  {
30
43
  role: "button",
31
44
  tabIndex: e.disabled ? -1 : 0,
32
45
  "aria-label": e.description,
33
46
  "aria-disabled": e.disabled,
34
- onClick: () => !e.disabled && (a == null ? void 0 : a(e)),
35
- onKeyDown: (s) => !e.disabled && c(s, e),
47
+ onClick: () => !e.disabled && (l == null ? void 0 : l(e)),
48
+ onKeyDown: (c) => !e.disabled && d(c, e),
36
49
  key: e.id,
37
50
  title: e.description,
38
- className: b(d === "classic" ? "k-prompt-suggestion" : "k-suggestion", {
51
+ className: m(o === "classic" ? "k-prompt-suggestion" : "k-suggestion", {
39
52
  "k-disabled": e.disabled
40
53
  })
41
54
  },
42
55
  e.text
43
56
  )
44
57
  ),
45
- [r, t, a, d, c]
58
+ [r, s, l, o, d]
59
+ );
60
+ if (!r || r.length === 0)
61
+ return null;
62
+ if (o === "classic")
63
+ return p();
64
+ const h = /* @__PURE__ */ t.createElement(
65
+ "div",
66
+ {
67
+ role: "group",
68
+ className: m("k-suggestion-group", {
69
+ // Apply scrollable class when layout is 'scroll' (default for Chat component)
70
+ "k-suggestion-group-scrollable": a === "scroll"
71
+ }),
72
+ ref: a === "scrollbuttons" ? i : void 0
73
+ },
74
+ p()
75
+ );
76
+ return /* @__PURE__ */ t.createElement(
77
+ R,
78
+ {
79
+ visible: a === "scrollbuttons",
80
+ dir: n,
81
+ canScrollLeft: u,
82
+ canScrollRight: f,
83
+ onScrollLeft: k,
84
+ onScrollRight: y
85
+ },
86
+ h
46
87
  );
47
- return !r || r.length === 0 ? null : d === "classic" ? p() : /* @__PURE__ */ l.createElement("div", { role: "group", className: "k-suggestion-group" }, p());
48
88
  };
49
89
  export {
50
- n as SuggestionGroup
90
+ w as SuggestionGroup
51
91
  };
@@ -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 C=require("react"),f=require("@progress/kendo-react-common"),g=require("@progress/kendo-react-buttons"),l=require("@progress/kendo-svg-icons"),b=require("@progress/kendo-react-intl"),o=require("../../../messages/index.js");function F(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(i,n,c.get?c:{enumerable:!0,get:()=>r[n]})}}return i.default=r,Object.freeze(i)}const a=F(C),M=r=>{const{files:i,onFileRemove:n,onFileAction:c,onDownload:m,fileActions:k,renderInTextarea:I=!1}=r,u=b.useLocalization(),h=[{id:"download",label:"Download",svgIcon:l.downloadIcon}],d=k||h,x=e=>{if(e==null)return"";if(e===0)return"0 B";const s=1024,t=["B","KB","MB","GB","TB"],p=Math.floor(Math.log(e)/Math.log(s));return`${parseFloat((e/Math.pow(s,p)).toFixed(2))} ${t[p]}`},B=e=>"."+e.split(".").pop()||"",E=(e,s)=>{e.item.id==="download"&&(m==null||m([s])),c==null||c(e.item,e,s)},v=e=>I?a.createElement(g.Button,{fillMode:"flat",themeColor:"base",svgIcon:l.xIcon,onClick:t=>{t.stopPropagation(),n==null||n(e.name)},"aria-label":`${u.toLanguageString(o.removeFile,o.messages[o.removeFile])} ${e.name}`}):"uid"in e||!("rawFile"in e)?d.length>0&&a.createElement(g.DropDownButton,{fillMode:"flat",themeColor:"base",svgIcon:l.moreVerticalIcon,onClick:t=>{t.syntheticEvent.stopPropagation()},onItemClick:t=>E(t,e),items:d.map(t=>({id:t.id,icon:t.icon,text:t.label,svgIcon:t.svgIcon})),"aria-label":`${u.toLanguageString(o.fileActions,o.messages[o.fileActions])} ${e.name}`}):a.createElement(g.Button,{fillMode:"flat",themeColor:"base",svgIcon:l.xIcon,onClick:t=>{t.stopPropagation(),n==null||n(e.name)},"aria-label":`${u.toLanguageString(o.removeFile,o.messages[o.removeFile])} ${e.name}`});return a.createElement("ul",{className:"k-chat-file-wrapper"},i.map(e=>a.createElement("li",{key:e.name,className:"k-chat-file"},a.createElement(f.IconWrap,{size:"xxlarge",...f.getFileExtensionIcon(B(e.name))}),a.createElement("div",{className:"k-chat-file-info"},a.createElement("span",{className:"k-chat-file-name"},e.name),a.createElement("span",{className:"k-chat-file-size"},x(e.size))),v(e))))};module.exports=M;
8
+ "use strict";const b=require("react"),g=require("@progress/kendo-react-common"),h=require("@progress/kendo-react-buttons"),d=require("@progress/kendo-svg-icons"),w=require("@progress/kendo-react-intl"),r=require("../../../messages/index.js"),F=require("../ChatContext.js");function M(a){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const o in a)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(a,o);Object.defineProperty(i,o,s.get?s:{enumerable:!0,get:()=>a[o]})}}return i.default=a,Object.freeze(i)}const n=M(b),N=a=>{const{files:i,onFileRemove:o,onFileAction:s,onDownload:m,fileActions:k,renderInTextarea:I=!1}=a,{messageFilesLayout:u="vertical"}=F.useChatContext(),p=w.useLocalization(),C=[{id:"download",label:"Download",svgIcon:d.downloadIcon}],f=k||C,x=e=>{if(e==null)return"";if(e===0)return"0 B";const t=1024,c=["B","KB","MB","GB","TB"],l=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,l)).toFixed(2))} ${c[l]}`},E=e=>"."+e.split(".").pop()||"",v=(e,t)=>{var c,l;(l=(c=e.syntheticEvent)==null?void 0:c.stopPropagation)==null||l.call(c),e.item.id==="download"&&(m==null||m([t])),s==null||s(e.item,e,t)},B=e=>I?n.createElement(h.Button,{fillMode:"flat",themeColor:"base",svgIcon:d.xIcon,onClick:t=>{t.stopPropagation(),o==null||o(e.name)},"aria-label":`${p.toLanguageString(r.removeFile,r.messages[r.removeFile])} ${e.name}`}):f.length>0&&n.createElement(h.DropDownButton,{fillMode:"flat",themeColor:"base",svgIcon:d.moreVerticalIcon,onClick:t=>{t.syntheticEvent.stopPropagation()},onItemClick:t=>v(t,e),items:f.map(t=>({id:t.id,icon:t.icon,text:t.label,svgIcon:t.svgIcon})),"aria-label":`${p.toLanguageString(r.fileActions,r.messages[r.fileActions])} ${e.name}`}),z=n.useCallback(()=>g.classNames("k-chat-file-wrapper",{"k-chat-files-wrap":u==="wrap","k-chat-files-horizontal":u==="horizontal"}),[u]);return n.createElement("ul",{className:z()},i.map(e=>n.createElement("li",{key:e.name,className:"k-chat-file"},n.createElement(g.IconWrap,{size:"xlarge",...g.getFileExtensionIcon(E(e.name))}),n.createElement("div",{className:"k-chat-file-info"},n.createElement("span",{className:"k-chat-file-name"},e.name),n.createElement("span",{className:"k-chat-file-size"},x(e.size))),B(e))))};module.exports=N;
@@ -5,68 +5,62 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as a from "react";
9
- import { IconWrap as $, getFileExtensionIcon as F } from "@progress/kendo-react-common";
10
- import { Button as g, DropDownButton as M } from "@progress/kendo-react-buttons";
11
- import { xIcon as d, moreVerticalIcon as w, downloadIcon as z } from "@progress/kendo-svg-icons";
12
- import { useLocalization as v } from "@progress/kendo-react-intl";
13
- import { removeFile as i, messages as c, fileActions as f } from "../../../messages/index.mjs";
14
- const T = (u) => {
15
- const { files: h, onFileRemove: o, onFileAction: r, onDownload: l, fileActions: I, renderInTextarea: k = !1 } = u, s = v(), m = I || [{ id: "download", label: "Download", svgIcon: z }], E = (e) => {
8
+ import * as o from "react";
9
+ import { classNames as z, IconWrap as v, getFileExtensionIcon as w } from "@progress/kendo-react-common";
10
+ import { Button as F, DropDownButton as M } from "@progress/kendo-react-buttons";
11
+ import { xIcon as N, moreVerticalIcon as $, downloadIcon as A } from "@progress/kendo-svg-icons";
12
+ import { useLocalization as L } from "@progress/kendo-react-intl";
13
+ import { removeFile as p, messages as f, fileActions as g } from "../../../messages/index.mjs";
14
+ import { useChatContext as S } from "../ChatContext.mjs";
15
+ const V = (u) => {
16
+ const { files: d, onFileRemove: s, onFileAction: l, onDownload: i, fileActions: h, renderInTextarea: k = !1 } = u, { messageFilesLayout: r = "vertical" } = S(), c = L(), m = h || [{ id: "download", label: "Download", svgIcon: A }], I = (e) => {
16
17
  if (e == null)
17
18
  return "";
18
19
  if (e === 0)
19
20
  return "0 B";
20
- const n = 1024, t = ["B", "KB", "MB", "GB", "TB"], p = Math.floor(Math.log(e) / Math.log(n));
21
- return `${parseFloat((e / Math.pow(n, p)).toFixed(2))} ${t[p]}`;
22
- }, x = (e) => "." + e.split(".").pop() || "", B = (e, n) => {
23
- e.item.id === "download" && (l == null || l([n])), r == null || r(e.item, e, n);
24
- }, C = (e) => k ? /* @__PURE__ */ a.createElement(
25
- g,
21
+ const t = 1024, a = ["B", "KB", "MB", "GB", "TB"], n = Math.floor(Math.log(e) / Math.log(t));
22
+ return `${parseFloat((e / Math.pow(t, n)).toFixed(2))} ${a[n]}`;
23
+ }, E = (e) => "." + e.split(".").pop() || "", x = (e, t) => {
24
+ var a, n;
25
+ (n = (a = e.syntheticEvent) == null ? void 0 : a.stopPropagation) == null || n.call(a), e.item.id === "download" && (i == null || i([t])), l == null || l(e.item, e, t);
26
+ }, B = (e) => k ? /* @__PURE__ */ o.createElement(
27
+ F,
26
28
  {
27
29
  fillMode: "flat",
28
30
  themeColor: "base",
29
- svgIcon: d,
31
+ svgIcon: N,
30
32
  onClick: (t) => {
31
- t.stopPropagation(), o == null || o(e.name);
33
+ t.stopPropagation(), s == null || s(e.name);
32
34
  },
33
- "aria-label": `${s.toLanguageString(i, c[i])} ${e.name}`
35
+ "aria-label": `${c.toLanguageString(p, f[p])} ${e.name}`
34
36
  }
35
- ) : "uid" in e || !("rawFile" in e) ? m.length > 0 && /* @__PURE__ */ a.createElement(
37
+ ) : m.length > 0 && /* @__PURE__ */ o.createElement(
36
38
  M,
37
39
  {
38
40
  fillMode: "flat",
39
41
  themeColor: "base",
40
- svgIcon: w,
42
+ svgIcon: $,
41
43
  onClick: (t) => {
42
44
  t.syntheticEvent.stopPropagation();
43
45
  },
44
- onItemClick: (t) => B(t, e),
46
+ onItemClick: (t) => x(t, e),
45
47
  items: m.map((t) => ({
46
48
  id: t.id,
47
49
  icon: t.icon,
48
50
  text: t.label,
49
51
  svgIcon: t.svgIcon
50
52
  })),
51
- "aria-label": `${s.toLanguageString(
52
- f,
53
- c[f]
53
+ "aria-label": `${c.toLanguageString(
54
+ g,
55
+ f[g]
54
56
  )} ${e.name}`
55
57
  }
56
- ) : /* @__PURE__ */ a.createElement(
57
- g,
58
- {
59
- fillMode: "flat",
60
- themeColor: "base",
61
- svgIcon: d,
62
- onClick: (t) => {
63
- t.stopPropagation(), o == null || o(e.name);
64
- },
65
- "aria-label": `${s.toLanguageString(i, c[i])} ${e.name}`
66
- }
67
- );
68
- return /* @__PURE__ */ a.createElement("ul", { className: "k-chat-file-wrapper" }, h.map((e) => /* @__PURE__ */ a.createElement("li", { key: e.name, className: "k-chat-file" }, /* @__PURE__ */ a.createElement($, { size: "xxlarge", ...F(x(e.name)) }), /* @__PURE__ */ a.createElement("div", { className: "k-chat-file-info" }, /* @__PURE__ */ a.createElement("span", { className: "k-chat-file-name" }, e.name), /* @__PURE__ */ a.createElement("span", { className: "k-chat-file-size" }, E(e.size))), C(e))));
58
+ ), C = o.useCallback(() => z("k-chat-file-wrapper", {
59
+ "k-chat-files-wrap": r === "wrap",
60
+ "k-chat-files-horizontal": r === "horizontal"
61
+ }), [r]);
62
+ return /* @__PURE__ */ o.createElement("ul", { className: C() }, d.map((e) => /* @__PURE__ */ o.createElement("li", { key: e.name, className: "k-chat-file" }, /* @__PURE__ */ o.createElement(v, { size: "xlarge", ...w(E(e.name)) }), /* @__PURE__ */ o.createElement("div", { className: "k-chat-file-info" }, /* @__PURE__ */ o.createElement("span", { className: "k-chat-file-name" }, e.name), /* @__PURE__ */ o.createElement("span", { className: "k-chat-file-size" }, I(e.size))), B(e))));
69
63
  };
70
64
  export {
71
- T as default
65
+ V as default
72
66
  };
@@ -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 g=require("react"),p=require("@progress/kendo-react-common"),m=require("@progress/kendo-react-buttons"),i=require("@progress/kendo-svg-icons"),k=require("@progress/kendo-react-intl"),a=require("../../utils.js"),f=require("../ChatContext.js");function C(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const c=C(g),v=n=>{const{message:e,onUnpin:t,user:o}=n,l=k.useLocalization(),{internalScrollContainerRef:r}=f.useChatContext(),u=c.useCallback(s=>{s.preventDefault(),s.stopPropagation();const d=r==null?void 0:r.current;a.scrollToMessageById(e.id,d)},[e.id,r]);return c.createElement("div",{className:"k-message-reference k-message-reference-receiver k-message-pinned",onClick:u},c.createElement(p.IconWrap,{size:"xlarge",icon:i.pinIcon}),c.createElement("div",{className:"k-message-reference-content"},e!=null&&e.isDeleted?o&&a.getDeletedMessageText(a.isAuthor(o,e),l):e==null?void 0:e.text),c.createElement("span",{className:"k-spacer"}),c.createElement(m.Button,{svgIcon:i.xIcon,onClick:s=>{s.stopPropagation(),t==null||t(e)}}))};module.exports=v;
8
+ "use strict";const g=require("react"),p=require("@progress/kendo-react-common"),m=require("@progress/kendo-react-buttons"),i=require("@progress/kendo-svg-icons"),f=require("@progress/kendo-react-intl"),a=require("../../utils.js"),k=require("../ChatContext.js");function C(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const c=C(g),v=n=>{const{message:e,onUnpin:t,user:o}=n,l=f.useLocalization(),{internalScrollContainerRef:r}=k.useChatContext(),u=c.useCallback(s=>{s.preventDefault(),s.stopPropagation();const d=r==null?void 0:r.current;a.scrollToMessageById(e.id,d)},[e.id,r]);return c.createElement("div",{className:"k-message-reference k-message-reference-receiver k-message-pinned",onClick:u},c.createElement(p.IconWrap,{size:"xlarge",icon:i.pinIcon}),c.createElement("div",{className:"k-message-reference-content"},e!=null&&e.isDeleted?o&&a.getDeletedMessageText(a.isAuthor(o,e),l):e==null?void 0:e.text),c.createElement("span",{className:"k-spacer"}),c.createElement(m.Button,{fillMode:"flat",svgIcon:i.xIcon,onClick:s=>{s.stopPropagation(),t==null||t(e)}}))};module.exports=v;
@@ -6,7 +6,7 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as t from "react";
9
- import { IconWrap as l } from "@progress/kendo-react-common";
9
+ import { IconWrap as m } from "@progress/kendo-react-common";
10
10
  import { Button as p } from "@progress/kendo-react-buttons";
11
11
  import { pinIcon as d, xIcon as f } from "@progress/kendo-svg-icons";
12
12
  import { useLocalization as g } from "@progress/kendo-react-intl";
@@ -16,8 +16,8 @@ const z = (n) => {
16
16
  const { message: e, onUnpin: a, user: s } = n, c = g(), { internalScrollContainerRef: o } = x(), i = t.useCallback(
17
17
  (r) => {
18
18
  r.preventDefault(), r.stopPropagation();
19
- const m = o == null ? void 0 : o.current;
20
- u(e.id, m);
19
+ const l = o == null ? void 0 : o.current;
20
+ u(e.id, l);
21
21
  },
22
22
  [e.id, o]
23
23
  );
@@ -27,12 +27,13 @@ const z = (n) => {
27
27
  className: "k-message-reference k-message-reference-receiver k-message-pinned",
28
28
  onClick: i
29
29
  },
30
- /* @__PURE__ */ t.createElement(l, { size: "xlarge", icon: d }),
30
+ /* @__PURE__ */ t.createElement(m, { size: "xlarge", icon: d }),
31
31
  /* @__PURE__ */ t.createElement("div", { className: "k-message-reference-content" }, e != null && e.isDeleted ? s && k(v(s, e), c) : e == null ? void 0 : e.text),
32
32
  /* @__PURE__ */ t.createElement("span", { className: "k-spacer" }),
33
33
  /* @__PURE__ */ t.createElement(
34
34
  p,
35
35
  {
36
+ fillMode: "flat",
36
37
  svgIcon: f,
37
38
  onClick: (r) => {
38
39
  r.stopPropagation(), a == null || a(e);
@@ -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 m=require("react");function p(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const c=p(m),y=100,a=1,E=(e,o)=>{const{enabled:t,dir:r,itemsDependency:f=[],scrollSpeed:s=y}=o,[S,b]=c.useState(!1),[d,L]=c.useState(!1),n=c.useCallback(()=>{if(e.current&&t){const{scrollLeft:l,scrollWidth:u,clientWidth:i}=e.current,O=l===0,g=r!=="rtl"?l+i>=u-a:i-l>=u-a;b(!O),L(!g)}},[t,r]),h=c.useCallback(()=>{e.current&&t&&e.current.scrollBy({left:r!=="rtl"?-s:s,behavior:"smooth"})},[t,r,s]),v=c.useCallback(()=>{e.current&&t&&e.current.scrollBy({left:r!=="rtl"?s:-s,behavior:"smooth"})},[t,r,s]);return c.useEffect(()=>{const l=e.current;if(l&&t){n(),l.addEventListener("scroll",n);const u=new ResizeObserver(n);return u.observe(l),()=>{l.removeEventListener("scroll",n),u.disconnect()}}},[t,r]),c.useLayoutEffect(()=>{t&&n()},[t,r,f]),{canScrollLeft:S,canScrollRight:d,scrollLeft:h,scrollRight:v}};exports.useScrollWithButtons=E;
@@ -0,0 +1,46 @@
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 r from "react";
9
+ const m = 100, i = 1, p = (l, a) => {
10
+ const { enabled: t, dir: e, itemsDependency: S = [], scrollSpeed: c = m } = a, [f, L] = r.useState(!1), [d, b] = r.useState(!1), o = r.useCallback(() => {
11
+ if (l.current && t) {
12
+ const { scrollLeft: s, scrollWidth: n, clientWidth: u } = l.current, E = s === 0, C = e !== "rtl" ? s + u >= n - i : u - s >= n - i;
13
+ L(!E), b(!C);
14
+ }
15
+ }, [t, e]), h = r.useCallback(() => {
16
+ l.current && t && l.current.scrollBy({
17
+ left: e !== "rtl" ? -c : c,
18
+ behavior: "smooth"
19
+ });
20
+ }, [t, e, c]), v = r.useCallback(() => {
21
+ l.current && t && l.current.scrollBy({
22
+ left: e !== "rtl" ? c : -c,
23
+ behavior: "smooth"
24
+ });
25
+ }, [t, e, c]);
26
+ return r.useEffect(() => {
27
+ const s = l.current;
28
+ if (s && t) {
29
+ o(), s.addEventListener("scroll", o);
30
+ const n = new ResizeObserver(o);
31
+ return n.observe(s), () => {
32
+ s.removeEventListener("scroll", o), n.disconnect();
33
+ };
34
+ }
35
+ }, [t, e]), r.useLayoutEffect(() => {
36
+ t && o();
37
+ }, [t, e, S]), {
38
+ canScrollLeft: f,
39
+ canScrollRight: d,
40
+ scrollLeft: h,
41
+ scrollRight: v
42
+ };
43
+ };
44
+ export {
45
+ p as useScrollWithButtons
46
+ };
@@ -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 n={textField:"text",statusField:"status",authorIdField:"authorId",authorNameField:"authorName",authorImageUrlField:"authorImageUrl",authorImageAltTextField:"authorImageAltText",idField:"id",timestampField:"timestamp",filesField:"files",attachmentsField:"attachments",replyToIdField:"replyToId",isDeletedField:"isDeleted",isPinnedField:"isPinned",typingField:"typing",suggestedActionsField:"suggestedActions"},r=(i,d={})=>{const t={...n,...d};let e;i.author&&typeof i.author=="object"?e={id:i.author.id||i.author[t.authorIdField]||i[t.authorIdField]||"",name:i.author.name||i.author[t.authorNameField]||i[t.authorNameField],avatarUrl:i.author.avatarUrl||i.author[t.authorImageUrlField]||i[t.authorImageUrlField],avatarAltText:i.author.avatarAltText||i.author[t.authorImageAltTextField]||i[t.authorImageAltTextField]}:e={id:i[t.authorIdField]||i.authorId||"",name:i[t.authorNameField]||i.authorName,avatarUrl:i[t.authorImageUrlField]||i.authorImageUrl,avatarAltText:i[t.authorImageAltTextField]||i.authorImageAltText};let o;i.timestamp?o=new Date(i.timestamp):i[t.timestampField]?o=new Date(i[t.timestampField]):o=new Date;const l={id:i.id!==void 0?i.id:i[t.idField],text:i.text!==void 0?i.text:i[t.textField]||"",author:e,timestamp:o,status:i.status!==void 0?i.status:i[t.statusField],attachments:i.attachments!==void 0?i.attachments:i[t.attachmentsField],attachmentLayout:i.attachmentLayout||"list",suggestedActions:i.suggestedActions!==void 0?i.suggestedActions:i[t.suggestedActionsField],isPinned:i.isPinned!==void 0?i.isPinned:i[t.isPinnedField]||!1,typing:i.typing!==void 0?i.typing:i[t.typingField],files:i.files!==void 0?i.files:i[t.filesField]||[]};return i.pinnedAt&&(l.pinnedAt=new Date(i.pinnedAt)),i.pinnedBy&&(l.pinnedBy=i.pinnedBy),i.replyToId!==void 0?l.replyToId=i.replyToId:i[t.replyToIdField]!==void 0&&(l.replyToId=i[t.replyToIdField]),i.isDeleted!==void 0?l.isDeleted=i.isDeleted:i[t.isDeletedField]!==void 0&&(l.isDeleted=i[t.isDeletedField]),l},u=(i,d={})=>Array.isArray(i)?i.map(t=>r(t,d)):[],F=i=>i&&typeof i.id!="undefined"&&typeof i.text=="string"&&i.author&&typeof i.author=="object"&&typeof i.author.id!="undefined"&&(i.timestamp instanceof Date||typeof i.timestamp=="string"||typeof i.timestamp=="number"),h=i=>({textField:i.textField,statusField:i.statusField,authorIdField:i.authorIdField,authorNameField:i.authorNameField,authorImageUrlField:i.authorImageUrlField,authorImageAltTextField:i.authorImageAltTextField,idField:i.idField,timestampField:i.timestampField,filesField:i.filesField,attachmentsField:i.attachmentsField,replyToIdField:i.replyToIdField,isDeletedField:i.isDeletedField,isPinnedField:i.isPinnedField,typingField:i.typingField,suggestedActionsField:i.suggestedActionsField}),a=(i,d={})=>{const t={...n,...d},e={};return i.id!==void 0&&(e[t.idField]=i.id),i.text!==void 0&&(e[t.textField]=i.text),i.status!==void 0&&(e[t.statusField]=i.status),i.timestamp!==void 0&&(e[t.timestampField]=i.timestamp),i.attachments!==void 0&&(e[t.attachmentsField]=i.attachments),i.files!==void 0&&(e[t.filesField]=i.files),i.suggestedActions!==void 0&&(e[t.suggestedActionsField]=i.suggestedActions),i.replyToId!==void 0&&(e[t.replyToIdField]=i.replyToId),i.isDeleted!==void 0&&(e[t.isDeletedField]=i.isDeleted),i.isPinned!==void 0&&(e[t.isPinnedField]=i.isPinned),i.typing!==void 0&&(e[t.typingField]=i.typing),i.author&&(i.author.id!==void 0&&(e[t.authorIdField]=i.author.id),i.author.name!==void 0&&(e[t.authorNameField]=i.author.name),i.author.avatarUrl!==void 0&&(e[t.authorImageUrlField]=i.author.avatarUrl),i.author.avatarAltText!==void 0&&(e[t.authorImageAltTextField]=i.author.avatarAltText)),i.pinnedAt!==void 0&&(e.pinnedAt=i.pinnedAt),i.pinnedBy!==void 0&&(e.pinnedBy=i.pinnedBy),i.attachmentLayout!==void 0&&(e.attachmentLayout=i.attachmentLayout),e};exports.DEFAULT_FIELD_MAPPING=n;exports.extractFieldMappingFromProps=h;exports.isStandardMessageFormat=F;exports.mapDataArrayToMessages=u;exports.mapDataToMessage=r;exports.mapMessageToCustomFormat=a;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n={textField:"text",statusField:"status",authorIdField:"authorId",authorNameField:"authorName",authorImageUrlField:"authorImageUrl",authorImageAltTextField:"authorImageAltText",idField:"id",timestampField:"timestamp",filesField:"files",attachmentsField:"attachments",replyToIdField:"replyToId",isDeletedField:"isDeleted",isPinnedField:"isPinned",typingField:"typing",suggestedActionsField:"suggestedActions"},r=(i,d={})=>{const t={...n,...d};let e;i.author&&typeof i.author=="object"?e={id:i.author.id||i.author[t.authorIdField]||i[t.authorIdField]||"",name:i.author.name||i.author[t.authorNameField]||i[t.authorNameField],avatarUrl:i.author.avatarUrl||i.author[t.authorImageUrlField]||i[t.authorImageUrlField],avatarAltText:i.author.avatarAltText||i.author[t.authorImageAltTextField]||i[t.authorImageAltTextField]}:e={id:i[t.authorIdField]||i.authorId||"",name:i[t.authorNameField]||i.authorName,avatarUrl:i[t.authorImageUrlField]||i.authorImageUrl,avatarAltText:i[t.authorImageAltTextField]||i.authorImageAltText};let o;i.timestamp?o=new Date(i.timestamp):i[t.timestampField]?o=new Date(i[t.timestampField]):o=new Date;const l={id:i.id!==void 0?i.id:i[t.idField],text:i.text!==void 0?i.text:i[t.textField]||"",author:e,timestamp:o,status:i.status!==void 0?i.status:i[t.statusField],attachments:i.attachments!==void 0?i.attachments:i[t.attachmentsField],attachmentLayout:i.attachmentLayout||"list",suggestedActions:i.suggestedActions!==void 0?i.suggestedActions:i[t.suggestedActionsField],isPinned:i.isPinned!==void 0?i.isPinned:i[t.isPinnedField]||!1,typing:i.typing!==void 0?i.typing:i[t.typingField],files:i.files!==void 0?i.files:i[t.filesField]||[]};return i.pinnedAt&&(l.pinnedAt=new Date(i.pinnedAt)),i.pinnedBy&&(l.pinnedBy=i.pinnedBy),i.replyToId!==void 0?l.replyToId=i.replyToId:i[t.replyToIdField]!==void 0&&(l.replyToId=i[t.replyToIdField]),i.isDeleted!==void 0?l.isDeleted=i.isDeleted:i[t.isDeletedField]!==void 0&&(l.isDeleted=i[t.isDeletedField]),{...l,dataItem:i}},u=(i,d={})=>Array.isArray(i)?i.map(t=>r(t,d)):[],F=i=>i&&typeof i.id!="undefined"&&typeof i.text=="string"&&i.author&&typeof i.author=="object"&&typeof i.author.id!="undefined"&&(i.timestamp instanceof Date||typeof i.timestamp=="string"||typeof i.timestamp=="number"),h=i=>({textField:i.textField,statusField:i.statusField,authorIdField:i.authorIdField,authorNameField:i.authorNameField,authorImageUrlField:i.authorImageUrlField,authorImageAltTextField:i.authorImageAltTextField,idField:i.idField,timestampField:i.timestampField,filesField:i.filesField,attachmentsField:i.attachmentsField,replyToIdField:i.replyToIdField,isDeletedField:i.isDeletedField,isPinnedField:i.isPinnedField,typingField:i.typingField,suggestedActionsField:i.suggestedActionsField}),a=(i,d={})=>{const t={...n,...d},e={};return i.id!==void 0&&(e[t.idField]=i.id),i.text!==void 0&&(e[t.textField]=i.text),i.status!==void 0&&(e[t.statusField]=i.status),i.timestamp!==void 0&&(e[t.timestampField]=i.timestamp),i.attachments!==void 0&&(e[t.attachmentsField]=i.attachments),i.files!==void 0&&(e[t.filesField]=i.files),i.suggestedActions!==void 0&&(e[t.suggestedActionsField]=i.suggestedActions),i.replyToId!==void 0&&(e[t.replyToIdField]=i.replyToId),i.isDeleted!==void 0&&(e[t.isDeletedField]=i.isDeleted),i.isPinned!==void 0&&(e[t.isPinnedField]=i.isPinned),i.typing!==void 0&&(e[t.typingField]=i.typing),i.author&&(i.author.id!==void 0&&(e[t.authorIdField]=i.author.id),i.author.name!==void 0&&(e[t.authorNameField]=i.author.name),i.author.avatarUrl!==void 0&&(e[t.authorImageUrlField]=i.author.avatarUrl),i.author.avatarAltText!==void 0&&(e[t.authorImageAltTextField]=i.author.avatarAltText)),i.pinnedAt!==void 0&&(e.pinnedAt=i.pinnedAt),i.pinnedBy!==void 0&&(e.pinnedBy=i.pinnedBy),i.attachmentLayout!==void 0&&(e.attachmentLayout=i.attachmentLayout),e};exports.DEFAULT_FIELD_MAPPING=n;exports.extractFieldMappingFromProps=h;exports.isStandardMessageFormat=F;exports.mapDataArrayToMessages=u;exports.mapDataToMessage=r;exports.mapMessageToCustomFormat=a;
@@ -50,7 +50,7 @@ const n = {
50
50
  typing: i.typing !== void 0 ? i.typing : i[t.typingField],
51
51
  files: i.files !== void 0 ? i.files : i[t.filesField] || []
52
52
  };
53
- return i.pinnedAt && (l.pinnedAt = new Date(i.pinnedAt)), i.pinnedBy && (l.pinnedBy = i.pinnedBy), i.replyToId !== void 0 ? l.replyToId = i.replyToId : i[t.replyToIdField] !== void 0 && (l.replyToId = i[t.replyToIdField]), i.isDeleted !== void 0 ? l.isDeleted = i.isDeleted : i[t.isDeletedField] !== void 0 && (l.isDeleted = i[t.isDeletedField]), l;
53
+ return i.pinnedAt && (l.pinnedAt = new Date(i.pinnedAt)), i.pinnedBy && (l.pinnedBy = i.pinnedBy), i.replyToId !== void 0 ? l.replyToId = i.replyToId : i[t.replyToIdField] !== void 0 && (l.replyToId = i[t.replyToIdField]), i.isDeleted !== void 0 ? l.isDeleted = i.isDeleted : i[t.isDeletedField] !== void 0 && (l.isDeleted = i[t.isDeletedField]), { ...l, dataItem: i };
54
54
  }, u = (i, d = {}) => Array.isArray(i) ? i.map((t) => r(t, d)) : [], F = (i) => i && typeof i.id != "undefined" && typeof i.text == "string" && i.author && typeof i.author == "object" && typeof i.author.id != "undefined" && (i.timestamp instanceof Date || typeof i.timestamp == "string" || typeof i.timestamp == "number"), h = (i) => ({
55
55
  textField: i.textField,
56
56
  statusField: i.statusField,
@@ -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 h=["allowMessageCollapse","messageWidthMode","showAvatar","showUsername","messageTemplate","messageContentTemplate","messageToolbarActions","messageContextMenuActions","fileActions"],v=(e,t)=>{var o,m;return((o=e==null?void 0:e.author)==null?void 0:o.id)===t||((m=e==null?void 0:e.author)==null?void 0:m.id)===String(t)};function T(e,t,o,m,l){const c=v(e,t)?m:l,n={};return h.forEach(a=>{var d;n[a]=(d=c==null?void 0:c[a])!=null?d:o==null?void 0:o[a]}),n}exports.resolveMessageSettings=T;
@@ -0,0 +1,31 @@
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
+ const C = [
9
+ "allowMessageCollapse",
10
+ "messageWidthMode",
11
+ "showAvatar",
12
+ "showUsername",
13
+ "messageTemplate",
14
+ "messageContentTemplate",
15
+ "messageToolbarActions",
16
+ "messageContextMenuActions",
17
+ "fileActions"
18
+ ], T = (e, o) => {
19
+ var m, c;
20
+ return ((m = e == null ? void 0 : e.author) == null ? void 0 : m.id) === o || ((c = e == null ? void 0 : e.author) == null ? void 0 : c.id) === String(o);
21
+ };
22
+ function t(e, o, m, c, A) {
23
+ const h = T(e, o) ? c : A, d = {};
24
+ return C.forEach((a) => {
25
+ var n;
26
+ d[a] = (n = h == null ? void 0 : h[a]) != null ? n : m == null ? void 0 : m[a];
27
+ }), d;
28
+ }
29
+ export {
30
+ t as resolveMessageSettings
31
+ };