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

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.
@@ -6,75 +6,75 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as t from "react";
9
- import { classNames as A, IconWrap as $ } from "@progress/kendo-react-common";
10
- import { Button as j } from "@progress/kendo-react-buttons";
11
- import { downloadIcon as me, chevronUpIcon as de, chevronDownIcon as pe, checkCircleIcon as fe, undoIcon as ge, copyIcon as be } from "@progress/kendo-svg-icons";
12
- import { useLocalization as ke, provideIntlService as Ce, registerForIntl as ye } from "@progress/kendo-react-intl";
13
- import { ContextMenu as xe, MenuItem as Ee } from "@progress/kendo-react-layout";
14
- import { copyToClipboard as he, getDeletedMessageText as Ie, getMessageById as we, isAuthor as R, convertTextToLinkedContent as G, scrollToMessageById as Me } from "../utils.mjs";
15
- import { useChatContext as ve } from "./ChatContext.mjs";
16
- import De from "./elements/FileBox.mjs";
17
- import { downloadAllFiles as H, messages as h, downloadAll as J, collapseMessage as Q, expandMessage as Z } from "../../messages/index.mjs";
18
- const _ = t.forwardRef(
9
+ import { classNames as A, IconWrap as j } from "@progress/kendo-react-common";
10
+ import { Button as G } from "@progress/kendo-react-buttons";
11
+ import { downloadIcon as fe, chevronUpIcon as pe, chevronDownIcon as be, checkCircleIcon as ge, undoIcon as ke, copyIcon as Ce } from "@progress/kendo-svg-icons";
12
+ import { useLocalization as ye, provideIntlService as xe, registerForIntl as Ee } from "@progress/kendo-react-intl";
13
+ import { ContextMenu as he, MenuItem as Ie } from "@progress/kendo-react-layout";
14
+ import { copyToClipboard as we, getDeletedMessageText as Me, getMessageById as ve, isAuthor as R, convertTextToLinkedContent as H, scrollToMessageById as Te } from "../utils.mjs";
15
+ import { useChatContext as De } from "./ChatContext.mjs";
16
+ import Ne from "./elements/FileBox.mjs";
17
+ import { downloadAllFiles as J, messages as h, downloadAll as Q, collapseMessage as Z, expandMessage as _ } from "../../messages/index.mjs";
18
+ const ee = t.forwardRef(
19
19
  (i, u) => {
20
20
  const {
21
21
  item: a,
22
22
  template: I,
23
23
  onRequestSelection: w,
24
- tabIndex: ee = -1,
24
+ tabIndex: te = -1,
25
25
  dateFormat: F = "g",
26
26
  selected: l,
27
27
  allowMessageCollapse: m,
28
28
  messageToolbarActions: d,
29
- messageContextMenuActions: p,
30
- isSender: f
29
+ messageContextMenuActions: f,
30
+ isSender: p
31
31
  } = i, {
32
- setReplyToMessage: g,
32
+ setReplyToMessage: b,
33
33
  messages: L,
34
34
  user: c,
35
- internalScrollContainerRef: b,
35
+ internalScrollContainerRef: g,
36
36
  onToolbarAction: M,
37
37
  onContextMenuAction: v,
38
38
  onFileAction: V,
39
39
  onDownload: r,
40
40
  fileActions: K,
41
41
  setShowCopyNotification: k,
42
- statusTemplate: D
43
- } = ve(), [P, T] = t.useState(!1), [C, te] = t.useState(!0), [ae, z] = t.useState(!1), o = ke(), B = t.useRef({ left: 0, top: 0 }), y = t.useCallback(() => {
44
- a != null && a.text && he(a.text), k && (k(!0), setTimeout(() => {
42
+ statusTemplate: T
43
+ } = De(), [z, D] = t.useState(!1), [ae, B] = t.useState(!1), [C, se] = t.useState(!0), [ne, P] = t.useState(!1), o = ye(), W = t.useRef({ left: 0, top: 0 }), y = t.useCallback(() => {
44
+ a != null && a.text && we(a.text), k && (k(!0), setTimeout(() => {
45
45
  k(!1);
46
46
  }, 3e3));
47
47
  }, [a, k]), N = t.useCallback((e) => {
48
- e.stopPropagation(), te((s) => !s);
49
- }, []), se = t.useCallback(() => {
50
- z(!1);
51
- }, []), ne = t.useCallback((e) => {
52
- (e.key === "Tab" || e.key === "Enter" || e.key === " " || e.key === "ArrowUp" || e.key === "ArrowDown") && z(!0);
48
+ e.stopPropagation(), se((s) => !s);
49
+ }, []), le = t.useCallback(() => {
50
+ P(!1);
51
+ }, []), oe = t.useCallback((e) => {
52
+ (e.key === "Tab" || e.key === "Enter" || e.key === " " || e.key === "ArrowUp" || e.key === "ArrowDown") && P(!0);
53
53
  }, []), S = t.useRef(null);
54
54
  t.useEffect(() => {
55
55
  l && S.current && S.current.focus();
56
56
  }, [l]);
57
- const W = t.useCallback((e) => {
58
- B.current = { left: e.pageX, top: e.pageY }, e.preventDefault(), T(!0);
59
- }, []), O = t.useCallback(() => {
60
- T(!1);
57
+ const O = t.useCallback((e) => {
58
+ W.current = { left: e.pageX, top: e.pageY }, e.preventDefault(), B(!0), D(!0);
59
+ }, []), U = t.useCallback(() => {
60
+ B(!1), D(!1);
61
61
  }, []), x = t.useCallback(
62
- (e, s) => !e.isDeleted && e.text ? e.text : Ie(s, o),
62
+ (e, s) => !e.isDeleted && e.text ? e.text : Me(s, o),
63
63
  [o]
64
- ), U = t.useCallback(
64
+ ), q = t.useCallback(
65
65
  (e) => {
66
66
  var s;
67
- (s = e.item) != null && s.text && (e.item.data.id === "copy" && !a.isDeleted ? y() : e.item.data.id === "reply" && g(a), v && v(e.item.data, e, a)), T(!1);
67
+ (s = e.item) != null && s.text && (e.item.data.id === "copy" && !a.isDeleted ? y() : e.item.data.id === "reply" && b(a), v && v(e.item.data, e, a)), D(!1);
68
68
  },
69
- [a, v, g, y]
70
- ), q = t.useCallback(() => {
69
+ [a, v, b, y]
70
+ ), X = t.useCallback(() => {
71
71
  if (a.replyToId) {
72
- const e = we(L, a.replyToId);
72
+ const e = ve(L, a.replyToId);
73
73
  if (e) {
74
74
  const s = (n) => {
75
75
  n.preventDefault(), n.stopPropagation();
76
- const E = b == null ? void 0 : b.current;
77
- Me(e.id, E);
76
+ const E = g == null ? void 0 : g.current;
77
+ Te(e.id, E);
78
78
  };
79
79
  return /* @__PURE__ */ t.createElement(
80
80
  "div",
@@ -85,45 +85,45 @@ const _ = t.forwardRef(
85
85
  ),
86
86
  onClick: s
87
87
  },
88
- /* @__PURE__ */ t.createElement("div", { className: "k-message-reference-content" }, G(
88
+ /* @__PURE__ */ t.createElement("div", { className: "k-message-reference-content" }, H(
89
89
  x(e, R(c, e))
90
90
  ))
91
91
  );
92
92
  }
93
93
  }
94
94
  return null;
95
- }, [a.replyToId, L, c, x, b]), X = t.useCallback(() => {
95
+ }, [a.replyToId, L, c, x, g]), Y = t.useCallback(() => {
96
96
  const e = [
97
97
  {
98
98
  id: "reply",
99
99
  label: "Reply",
100
- svgIcon: ge
100
+ svgIcon: ke
101
101
  },
102
102
  {
103
103
  id: "copy",
104
104
  label: "Copy",
105
- svgIcon: be
105
+ svgIcon: Ce
106
106
  }
107
- ], s = p ? [
108
- ...e.map((n) => p.find(
109
- (ue) => ue.id === n.id
107
+ ], s = f ? [
108
+ ...e.map((n) => f.find(
109
+ (de) => de.id === n.id
110
110
  ) || n),
111
- ...p.filter(
111
+ ...f.filter(
112
112
  (n) => !e.some((E) => E.id === n.id)
113
113
  )
114
114
  ] : e;
115
115
  return /* @__PURE__ */ t.createElement(
116
- xe,
116
+ he,
117
117
  {
118
- onSelect: U,
119
- onClose: O,
118
+ onSelect: q,
119
+ onClose: U,
120
120
  vertical: !0,
121
- show: P,
122
- offset: B.current
121
+ show: z,
122
+ offset: W.current
123
123
  },
124
124
  s.map(
125
- (n) => n.id === "delete" && !f ? null : /* @__PURE__ */ t.createElement(
126
- Ee,
125
+ (n) => n.id === "delete" && !p ? null : /* @__PURE__ */ t.createElement(
126
+ Ie,
127
127
  {
128
128
  key: n.id,
129
129
  text: n.label,
@@ -134,25 +134,25 @@ const _ = t.forwardRef(
134
134
  )
135
135
  )
136
136
  );
137
- }, [p, U, O, P, f]), Y = t.useCallback(() => a.files && a.files.length > 1 ? /* @__PURE__ */ t.createElement("div", { className: "k-chat-download-button-wrapper" }, /* @__PURE__ */ t.createElement(
138
- j,
137
+ }, [f, q, U, z, p]), $ = t.useCallback(() => a.files && a.files.length > 1 ? /* @__PURE__ */ t.createElement("div", { className: "k-chat-download-button-wrapper" }, /* @__PURE__ */ t.createElement(
138
+ G,
139
139
  {
140
140
  className: "k-chat-download-button",
141
141
  fillMode: "flat",
142
142
  themeColor: "base",
143
- svgIcon: me,
143
+ svgIcon: fe,
144
144
  onClick: (e) => {
145
145
  e.stopPropagation(), r && r(a.files, a);
146
146
  },
147
147
  "aria-label": o.toLanguageString(
148
- H,
149
- h[H]
148
+ J,
149
+ h[J]
150
150
  )
151
151
  },
152
- /* @__PURE__ */ t.createElement("span", { className: "k-button-text" }, o.toLanguageString(J, h[J]))
153
- )) : null, [a, r, o]), le = t.useCallback(() => {
152
+ /* @__PURE__ */ t.createElement("span", { className: "k-button-text" }, o.toLanguageString(Q, h[Q]))
153
+ )) : null, [a, r, o]), re = t.useCallback(() => {
154
154
  if (a.typing)
155
- return /* @__PURE__ */ t.createElement("div", { className: "k-chat-bubble" }, /* @__PURE__ */ t.createElement("div", { className: "k-typing-indicator" }, /* @__PURE__ */ t.createElement("span", null), /* @__PURE__ */ t.createElement("span", null), /* @__PURE__ */ t.createElement("span", null)));
155
+ return /* @__PURE__ */ t.createElement("div", { className: "k-bubble k-chat-bubble" }, /* @__PURE__ */ t.createElement("div", { className: "k-typing-indicator" }, /* @__PURE__ */ t.createElement("span", null), /* @__PURE__ */ t.createElement("span", null), /* @__PURE__ */ t.createElement("span", null)));
156
156
  if (I) {
157
157
  const e = I;
158
158
  return /* @__PURE__ */ t.createElement(e, { item: a });
@@ -163,32 +163,23 @@ const _ = t.forwardRef(
163
163
  className: A("k-chat-bubble", "k-bubble", {
164
164
  "k-bubble-expandable": m,
165
165
  "k-expanded": m && C,
166
- "k-selected": l
166
+ "k-selected": l,
167
+ "k-active": ae
167
168
  }),
168
- onContextMenu: W
169
+ onClick: () => w(l ? void 0 : a.selectionIndex),
170
+ onContextMenu: O
169
171
  },
170
- /* @__PURE__ */ t.createElement(
171
- "div",
172
+ /* @__PURE__ */ t.createElement("div", { className: "k-bubble-content" }, /* @__PURE__ */ t.createElement("span", { className: "k-chat-bubble-text" }, !a.isDeleted && X(), H(x(a, R(c, a)))), a.files && /* @__PURE__ */ t.createElement(
173
+ Ne,
172
174
  {
173
- className: "k-bubble-content",
174
- onClick: (e) => {
175
- e.stopPropagation(), e.preventDefault();
176
- }
177
- },
178
- /* @__PURE__ */ t.createElement("span", { className: "k-chat-bubble-text" }, !a.isDeleted && q(), G(x(a, R(c, a)))),
179
- a.files && /* @__PURE__ */ t.createElement(
180
- De,
181
- {
182
- files: a.files,
183
- message: a,
184
- onFileAction: V,
185
- onDownload: (e) => r == null ? void 0 : r(e, a),
186
- renderInTextarea: !1,
187
- fileActions: K
188
- }
189
- ),
190
- Y()
191
- ),
175
+ files: a.files,
176
+ message: a,
177
+ onFileAction: V,
178
+ onDownload: (e) => r == null ? void 0 : r(e, a),
179
+ renderInTextarea: !1,
180
+ fileActions: K
181
+ }
182
+ ), $()),
192
183
  m && /* @__PURE__ */ t.createElement(
193
184
  "span",
194
185
  {
@@ -196,20 +187,20 @@ const _ = t.forwardRef(
196
187
  onClick: N,
197
188
  role: "button",
198
189
  "aria-label": C ? o.toLanguageString(
199
- Q,
200
- h[Q]
201
- ) : o.toLanguageString(
202
190
  Z,
203
191
  h[Z]
192
+ ) : o.toLanguageString(
193
+ _,
194
+ h[_]
204
195
  ),
205
196
  tabIndex: 0,
206
197
  onKeyDown: (e) => {
207
198
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), N(e));
208
199
  }
209
200
  },
210
- /* @__PURE__ */ t.createElement($, { icon: C ? de : pe, size: "medium" })
201
+ /* @__PURE__ */ t.createElement(j, { icon: C ? pe : be, size: "medium" })
211
202
  )
212
- ), X());
203
+ ), Y());
213
204
  return null;
214
205
  }, [
215
206
  a,
@@ -217,25 +208,25 @@ const _ = t.forwardRef(
217
208
  m,
218
209
  C,
219
210
  l,
220
- W,
221
- q,
211
+ O,
212
+ X,
222
213
  x,
223
214
  c,
224
215
  V,
225
216
  K,
226
- Y,
217
+ $,
227
218
  N,
228
219
  o,
229
- X,
220
+ Y,
230
221
  r
231
- ]), oe = t.useCallback(() => {
222
+ ]), ce = t.useCallback(() => {
232
223
  let e = null;
233
- return a.timestamp && (e = /* @__PURE__ */ t.createElement("time", { className: "k-message-time", "aria-hidden": !l }, Ce({ props: i }).formatDate(a.timestamp, F))), e;
234
- }, [a.timestamp, l, F, i]), re = t.useCallback(() => {
224
+ return a.timestamp && (e = /* @__PURE__ */ t.createElement("time", { className: "k-message-time", "aria-hidden": !l }, xe({ props: i }).formatDate(a.timestamp, F))), e;
225
+ }, [a.timestamp, l, F, i]), ie = t.useCallback(() => {
235
226
  let e = null;
236
- return a.status && l && (D ? e = t.createElement(D, { item: a }) : e = /* @__PURE__ */ t.createElement("span", { className: "k-message-status" }, /* @__PURE__ */ t.createElement($, { icon: fe, size: "xsmall" }), a.status)), e;
237
- }, [a, l, D]), ce = t.useCallback(() => A({ "k-focus": l, "k-message-removed": a.isDeleted }, "k-message"), [l, a.isDeleted]), ie = t.useCallback(() => d && d.length > 0 && /* @__PURE__ */ t.createElement("div", { className: "k-chat-message-toolbar k-toolbar k-toolbar-md k-toolbar-flat" }, d.map((e) => e.id === "delete" && !f ? null : /* @__PURE__ */ t.createElement(
238
- j,
227
+ return a.status && l && (T ? e = t.createElement(T, { item: a }) : e = /* @__PURE__ */ t.createElement("span", { className: "k-message-status" }, /* @__PURE__ */ t.createElement(j, { icon: ge, size: "xsmall" }), a.status)), e;
228
+ }, [a, l, T]), ue = t.useCallback(() => A({ "k-focus": l, "k-message-removed": a.isDeleted }, "k-message"), [l, a.isDeleted]), me = t.useCallback(() => d && d.length > 0 && /* @__PURE__ */ t.createElement("div", { className: "k-chat-message-toolbar k-toolbar k-toolbar-md k-toolbar-flat" }, d.map((e) => e.id === "delete" && !p ? null : /* @__PURE__ */ t.createElement(
229
+ G,
239
230
  {
240
231
  key: e.id,
241
232
  fillMode: "flat",
@@ -244,41 +235,40 @@ const _ = t.forwardRef(
244
235
  icon: e.icon,
245
236
  svgIcon: e.svgIcon,
246
237
  onClick: (s) => {
247
- s.stopPropagation(), e.id === "copy" && !a.isDeleted ? y() : e.id === "reply" && g(a), M && M(e, s, a);
238
+ s.stopPropagation(), e.id === "copy" && !a.isDeleted ? y() : e.id === "reply" && b(a), M && M(e, s, a);
248
239
  },
249
240
  onMouseDown: (s) => s.preventDefault()
250
241
  }
251
- ))), [y, f, a, d, M, g]);
242
+ ))), [y, p, a, d, M, b]);
252
243
  return /* @__PURE__ */ t.createElement(
253
244
  "div",
254
245
  {
255
246
  "data-message-id": a.id,
256
- className: ce(),
257
- tabIndex: ee,
258
- onClick: () => w(l ? void 0 : a.selectionIndex),
259
- onMouseDown: se,
260
- onKeyDown: ne,
247
+ className: ue(),
248
+ tabIndex: te,
249
+ onMouseDown: le,
250
+ onKeyDown: oe,
261
251
  onFocus: (e) => {
262
- ae && w(a.selectionIndex);
252
+ ne && w(a.selectionIndex);
263
253
  },
264
254
  ref: (e) => {
265
255
  S.current = e, typeof u == "function" ? u(e) : u && (u.current = e);
266
256
  }
267
257
  },
268
- oe(),
269
- le(),
258
+ ce(),
270
259
  re(),
271
- ie()
260
+ ie(),
261
+ me()
272
262
  );
273
263
  }
274
264
  );
275
- _.displayName = "ChatMessage";
276
- class Te extends t.Component {
265
+ ee.displayName = "ChatMessage";
266
+ class Se extends t.Component {
277
267
  render() {
278
- return /* @__PURE__ */ t.createElement(_, { ...this.props });
268
+ return /* @__PURE__ */ t.createElement(ee, { ...this.props });
279
269
  }
280
270
  }
281
- ye(Te);
271
+ Ee(Se);
282
272
  export {
283
- _ as ChatMessage
273
+ ee as ChatMessage
284
274
  };
@@ -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 v=require("react"),f=require("@progress/kendo-react-common"),g=require("@progress/kendo-react-buttons"),l=require("@progress/kendo-svg-icons"),C=require("@progress/kendo-react-intl"),a=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 o=F(v),M=r=>{const{files:i,onFileRemove:n,onFileAction:c,onDownload:m,fileActions:I,renderInTextarea:k=!1}=r,u=C.useLocalization(),h=[{id:"download",label:"Download",svgIcon:l.downloadIcon}],d=I||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)},b=e=>k?o.createElement(g.Button,{fillMode:"flat",themeColor:"base",svgIcon:l.xIcon,onClick:t=>{t.stopPropagation(),n==null||n(e.name)},"aria-label":`${u.toLanguageString(a.removeFile,a.messages[a.removeFile])} ${e.name}`}):"uid"in e||!("rawFile"in e)?d.length>0&&o.createElement(g.DropDownButton,{fillMode:"flat",themeColor:"base",svgIcon:l.moreVerticalIcon,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(a.fileActions,a.messages[a.fileActions])} ${e.name}`}):o.createElement(g.Button,{fillMode:"flat",themeColor:"base",svgIcon:l.xIcon,onClick:t=>{t.stopPropagation(),n==null||n(e.name)},"aria-label":`${u.toLanguageString(a.removeFile,a.messages[a.removeFile])} ${e.name}`});return o.createElement("ul",{className:"k-chat-file-wrapper"},i.map(e=>o.createElement("li",{key:e.name,className:"k-chat-file"},o.createElement(f.IconWrap,{size:"xxlarge",...f.getFileExtensionIcon(B(e.name))}),o.createElement("div",{className:"k-chat-file-info"},o.createElement("span",{className:"k-chat-file-name"},e.name),o.createElement("span",{className:"k-chat-file-size"},x(e.size))),b(e))))};module.exports=M;
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;
@@ -7,22 +7,22 @@
7
7
  */
8
8
  import * as a from "react";
9
9
  import { IconWrap as $, getFileExtensionIcon as F } from "@progress/kendo-react-common";
10
- import { Button as p, DropDownButton as M } from "@progress/kendo-react-buttons";
10
+ import { Button as g, DropDownButton as M } from "@progress/kendo-react-buttons";
11
11
  import { xIcon as d, moreVerticalIcon as w, downloadIcon as z } from "@progress/kendo-svg-icons";
12
12
  import { useLocalization as v } from "@progress/kendo-react-intl";
13
- import { removeFile as r, messages as c, fileActions as f } from "../../../messages/index.mjs";
14
- const D = (u) => {
15
- const { files: h, onFileRemove: o, onFileAction: i, onDownload: l, fileActions: I, renderInTextarea: k = !1 } = u, s = v(), m = I || [{ id: "download", label: "Download", svgIcon: z }], E = (e) => {
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) => {
16
16
  if (e == null)
17
17
  return "";
18
18
  if (e === 0)
19
19
  return "0 B";
20
- const n = 1024, t = ["B", "KB", "MB", "GB", "TB"], g = Math.floor(Math.log(e) / Math.log(n));
21
- return `${parseFloat((e / Math.pow(n, g)).toFixed(2))} ${t[g]}`;
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
22
  }, x = (e) => "." + e.split(".").pop() || "", B = (e, n) => {
23
- e.item.id === "download" && (l == null || l([n])), i == null || i(e.item, e, n);
23
+ e.item.id === "download" && (l == null || l([n])), r == null || r(e.item, e, n);
24
24
  }, C = (e) => k ? /* @__PURE__ */ a.createElement(
25
- p,
25
+ g,
26
26
  {
27
27
  fillMode: "flat",
28
28
  themeColor: "base",
@@ -30,7 +30,7 @@ const D = (u) => {
30
30
  onClick: (t) => {
31
31
  t.stopPropagation(), o == null || o(e.name);
32
32
  },
33
- "aria-label": `${s.toLanguageString(r, c[r])} ${e.name}`
33
+ "aria-label": `${s.toLanguageString(i, c[i])} ${e.name}`
34
34
  }
35
35
  ) : "uid" in e || !("rawFile" in e) ? m.length > 0 && /* @__PURE__ */ a.createElement(
36
36
  M,
@@ -38,6 +38,9 @@ const D = (u) => {
38
38
  fillMode: "flat",
39
39
  themeColor: "base",
40
40
  svgIcon: w,
41
+ onClick: (t) => {
42
+ t.syntheticEvent.stopPropagation();
43
+ },
41
44
  onItemClick: (t) => B(t, e),
42
45
  items: m.map((t) => ({
43
46
  id: t.id,
@@ -51,7 +54,7 @@ const D = (u) => {
51
54
  )} ${e.name}`
52
55
  }
53
56
  ) : /* @__PURE__ */ a.createElement(
54
- p,
57
+ g,
55
58
  {
56
59
  fillMode: "flat",
57
60
  themeColor: "base",
@@ -59,11 +62,11 @@ const D = (u) => {
59
62
  onClick: (t) => {
60
63
  t.stopPropagation(), o == null || o(e.name);
61
64
  },
62
- "aria-label": `${s.toLanguageString(r, c[r])} ${e.name}`
65
+ "aria-label": `${s.toLanguageString(i, c[i])} ${e.name}`
63
66
  }
64
67
  );
65
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))));
66
69
  };
67
70
  export {
68
- D as default
71
+ T as default
69
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 o={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"},n=(t,d={})=>{const i={...o,...d};let e;t.author&&typeof t.author=="object"?e={id:t.author.id||t.author[i.authorIdField]||"",name:t.author.name||t.author[i.authorNameField],avatarUrl:t.author.avatarUrl||t.author[i.authorImageUrlField],avatarAltText:t.author.avatarAltText||t.author[i.authorImageAltTextField]}:e={id:t[i.authorIdField]||"",name:t[i.authorNameField],avatarUrl:t[i.authorImageUrlField],avatarAltText:t[i.authorImageAltTextField]};const l={id:t[i.idField],text:t[i.textField]||"",author:e,timestamp:t[i.timestampField]?new Date(t[i.timestampField]):new Date,status:t[i.statusField],attachments:t[i.attachmentsField],attachmentLayout:t.attachmentLayout||"list",suggestedActions:t[i.suggestedActionsField],isPinned:t[i.isPinnedField]||!1,typing:t[i.typingField],files:t[i.filesField]||[]};return t.pinnedAt&&(l.pinnedAt=new Date(t.pinnedAt)),t.pinnedBy&&(l.pinnedBy=t.pinnedBy),t[i.replyToIdField]&&(l.replyToId=t[i.replyToIdField]),t[i.isDeletedField]&&(l.isDeleted=t[i.isDeletedField]),l},r=(t,d={})=>Array.isArray(t)?t.map(i=>n(i,d)):[],a=t=>t&&typeof t.id!="undefined"&&typeof t.text=="string"&&t.author&&typeof t.author=="object"&&typeof t.author.id!="undefined"&&(t.timestamp instanceof Date||typeof t.timestamp=="string"||typeof t.timestamp=="number"),F=t=>({textField:t.textField,statusField:t.statusField,authorIdField:t.authorIdField,authorNameField:t.authorNameField,authorImageUrlField:t.authorImageUrlField,authorImageAltTextField:t.authorImageAltTextField,idField:t.idField,timestampField:t.timestampField,filesField:t.filesField,attachmentsField:t.attachmentsField,replyToIdField:t.replyToIdField,isDeletedField:t.isDeletedField,isPinnedField:t.isPinnedField,typingField:t.typingField,suggestedActionsField:t.suggestedActionsField}),u=(t,d={})=>{const i={...o,...d},e={};return t.id!==void 0&&(e[i.idField]=t.id),t.text!==void 0&&(e[i.textField]=t.text),t.status!==void 0&&(e[i.statusField]=t.status),t.timestamp!==void 0&&(e[i.timestampField]=t.timestamp),t.attachments!==void 0&&(e[i.attachmentsField]=t.attachments),t.files!==void 0&&(e[i.filesField]=t.files),t.suggestedActions!==void 0&&(e[i.suggestedActionsField]=t.suggestedActions),t.replyToId!==void 0&&(e[i.replyToIdField]=t.replyToId),t.isDeleted!==void 0&&(e[i.isDeletedField]=t.isDeleted),t.isPinned!==void 0&&(e[i.isPinnedField]=t.isPinned),t.typing!==void 0&&(e[i.typingField]=t.typing),t.author&&(t.author.id!==void 0&&(e[i.authorIdField]=t.author.id),t.author.name!==void 0&&(e[i.authorNameField]=t.author.name),t.author.avatarUrl!==void 0&&(e[i.authorImageUrlField]=t.author.avatarUrl),t.author.avatarAltText!==void 0&&(e[i.authorImageAltTextField]=t.author.avatarAltText)),t.pinnedAt!==void 0&&(e.pinnedAt=t.pinnedAt),t.pinnedBy!==void 0&&(e.pinnedBy=t.pinnedBy),t.attachmentLayout!==void 0&&(e.attachmentLayout=t.attachmentLayout),e};exports.DEFAULT_FIELD_MAPPING=o;exports.extractFieldMappingFromProps=F;exports.isStandardMessageFormat=a;exports.mapDataArrayToMessages=r;exports.mapDataToMessage=n;exports.mapMessageToCustomFormat=u;
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;
@@ -21,59 +21,61 @@ const n = {
21
21
  isPinnedField: "isPinned",
22
22
  typingField: "typing",
23
23
  suggestedActionsField: "suggestedActions"
24
- }, o = (t, d = {}) => {
25
- const i = { ...n, ...d };
24
+ }, r = (i, d = {}) => {
25
+ const t = { ...n, ...d };
26
26
  let e;
27
- t.author && typeof t.author == "object" ? e = {
28
- id: t.author.id || t.author[i.authorIdField] || "",
29
- name: t.author.name || t.author[i.authorNameField],
30
- avatarUrl: t.author.avatarUrl || t.author[i.authorImageUrlField],
31
- avatarAltText: t.author.avatarAltText || t.author[i.authorImageAltTextField]
27
+ i.author && typeof i.author == "object" ? e = {
28
+ id: i.author.id || i.author[t.authorIdField] || i[t.authorIdField] || "",
29
+ name: i.author.name || i.author[t.authorNameField] || i[t.authorNameField],
30
+ avatarUrl: i.author.avatarUrl || i.author[t.authorImageUrlField] || i[t.authorImageUrlField],
31
+ avatarAltText: i.author.avatarAltText || i.author[t.authorImageAltTextField] || i[t.authorImageAltTextField]
32
32
  } : e = {
33
- id: t[i.authorIdField] || "",
34
- name: t[i.authorNameField],
35
- avatarUrl: t[i.authorImageUrlField],
36
- avatarAltText: t[i.authorImageAltTextField]
33
+ id: i[t.authorIdField] || i.authorId || "",
34
+ name: i[t.authorNameField] || i.authorName,
35
+ avatarUrl: i[t.authorImageUrlField] || i.authorImageUrl,
36
+ avatarAltText: i[t.authorImageAltTextField] || i.authorImageAltText
37
37
  };
38
+ let o;
39
+ i.timestamp ? o = new Date(i.timestamp) : i[t.timestampField] ? o = new Date(i[t.timestampField]) : o = /* @__PURE__ */ new Date();
38
40
  const l = {
39
- id: t[i.idField],
40
- text: t[i.textField] || "",
41
+ id: i.id !== void 0 ? i.id : i[t.idField],
42
+ text: i.text !== void 0 ? i.text : i[t.textField] || "",
41
43
  author: e,
42
- timestamp: t[i.timestampField] ? new Date(t[i.timestampField]) : /* @__PURE__ */ new Date(),
43
- status: t[i.statusField],
44
- attachments: t[i.attachmentsField],
45
- attachmentLayout: t.attachmentLayout || "list",
46
- suggestedActions: t[i.suggestedActionsField],
47
- isPinned: t[i.isPinnedField] || !1,
48
- typing: t[i.typingField],
49
- files: t[i.filesField] || []
44
+ timestamp: o,
45
+ status: i.status !== void 0 ? i.status : i[t.statusField],
46
+ attachments: i.attachments !== void 0 ? i.attachments : i[t.attachmentsField],
47
+ attachmentLayout: i.attachmentLayout || "list",
48
+ suggestedActions: i.suggestedActions !== void 0 ? i.suggestedActions : i[t.suggestedActionsField],
49
+ isPinned: i.isPinned !== void 0 ? i.isPinned : i[t.isPinnedField] || !1,
50
+ typing: i.typing !== void 0 ? i.typing : i[t.typingField],
51
+ files: i.files !== void 0 ? i.files : i[t.filesField] || []
50
52
  };
51
- return t.pinnedAt && (l.pinnedAt = new Date(t.pinnedAt)), t.pinnedBy && (l.pinnedBy = t.pinnedBy), t[i.replyToIdField] && (l.replyToId = t[i.replyToIdField]), t[i.isDeletedField] && (l.isDeleted = t[i.isDeletedField]), l;
52
- }, r = (t, d = {}) => Array.isArray(t) ? t.map((i) => o(i, d)) : [], F = (t) => t && typeof t.id != "undefined" && typeof t.text == "string" && t.author && typeof t.author == "object" && typeof t.author.id != "undefined" && (t.timestamp instanceof Date || typeof t.timestamp == "string" || typeof t.timestamp == "number"), a = (t) => ({
53
- textField: t.textField,
54
- statusField: t.statusField,
55
- authorIdField: t.authorIdField,
56
- authorNameField: t.authorNameField,
57
- authorImageUrlField: t.authorImageUrlField,
58
- authorImageAltTextField: t.authorImageAltTextField,
59
- idField: t.idField,
60
- timestampField: t.timestampField,
61
- filesField: t.filesField,
62
- attachmentsField: t.attachmentsField,
63
- replyToIdField: t.replyToIdField,
64
- isDeletedField: t.isDeletedField,
65
- isPinnedField: t.isPinnedField,
66
- typingField: t.typingField,
67
- suggestedActionsField: t.suggestedActionsField
68
- }), u = (t, d = {}) => {
69
- const i = { ...n, ...d }, e = {};
70
- return t.id !== void 0 && (e[i.idField] = t.id), t.text !== void 0 && (e[i.textField] = t.text), t.status !== void 0 && (e[i.statusField] = t.status), t.timestamp !== void 0 && (e[i.timestampField] = t.timestamp), t.attachments !== void 0 && (e[i.attachmentsField] = t.attachments), t.files !== void 0 && (e[i.filesField] = t.files), t.suggestedActions !== void 0 && (e[i.suggestedActionsField] = t.suggestedActions), t.replyToId !== void 0 && (e[i.replyToIdField] = t.replyToId), t.isDeleted !== void 0 && (e[i.isDeletedField] = t.isDeleted), t.isPinned !== void 0 && (e[i.isPinnedField] = t.isPinned), t.typing !== void 0 && (e[i.typingField] = t.typing), t.author && (t.author.id !== void 0 && (e[i.authorIdField] = t.author.id), t.author.name !== void 0 && (e[i.authorNameField] = t.author.name), t.author.avatarUrl !== void 0 && (e[i.authorImageUrlField] = t.author.avatarUrl), t.author.avatarAltText !== void 0 && (e[i.authorImageAltTextField] = t.author.avatarAltText)), t.pinnedAt !== void 0 && (e.pinnedAt = t.pinnedAt), t.pinnedBy !== void 0 && (e.pinnedBy = t.pinnedBy), t.attachmentLayout !== void 0 && (e.attachmentLayout = t.attachmentLayout), e;
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;
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
+ textField: i.textField,
56
+ statusField: i.statusField,
57
+ authorIdField: i.authorIdField,
58
+ authorNameField: i.authorNameField,
59
+ authorImageUrlField: i.authorImageUrlField,
60
+ authorImageAltTextField: i.authorImageAltTextField,
61
+ idField: i.idField,
62
+ timestampField: i.timestampField,
63
+ filesField: i.filesField,
64
+ attachmentsField: i.attachmentsField,
65
+ replyToIdField: i.replyToIdField,
66
+ isDeletedField: i.isDeletedField,
67
+ isPinnedField: i.isPinnedField,
68
+ typingField: i.typingField,
69
+ suggestedActionsField: i.suggestedActionsField
70
+ }), f = (i, d = {}) => {
71
+ const t = { ...n, ...d }, e = {};
72
+ 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;
71
73
  };
72
74
  export {
73
75
  n as DEFAULT_FIELD_MAPPING,
74
- a as extractFieldMappingFromProps,
76
+ h as extractFieldMappingFromProps,
75
77
  F as isStandardMessageFormat,
76
- r as mapDataArrayToMessages,
77
- o as mapDataToMessage,
78
- u as mapMessageToCustomFormat
78
+ u as mapDataArrayToMessages,
79
+ r as mapDataToMessage,
80
+ f as mapMessageToCustomFormat
79
81
  };
package/chat/utils.js CHANGED
@@ -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 i=require("react"),n=require("../messages/index.js"),g=(t,e)=>t&&e.author&&t.id===e.author.id,l=(t,e)=>{const o=e.toLanguageString("chatSender.deletedMessage",n.messages[n.chatSenderDeletedMessage]),s=e.toLanguageString("chatReceiver.deletedMessage",n.messages[n.chatReceiverDeletedMessage]);return t?o:s},u=t=>{navigator.clipboard.writeText(t)},h=(t,e)=>t.find(o=>o.id===e),T=(t,e)=>{const o=e?e.querySelector(`[data-message-id="${t}"]`):document.querySelector(`[data-message-id="${t}"]`);if(!o)return;const s=e==null?void 0:e.querySelector(".k-message-list");if(s){const c=s.getBoundingClientRect().top,a=o.getBoundingClientRect().top,d=s.scrollTop+(a-c);s.scrollTo({top:d,behavior:"smooth"})}else o.scrollIntoView({behavior:"smooth",block:"start"})},r=/(https?:\/\/[^\s]+)/g,p=t=>{if(!t)return[""];const e=t.split(r),o=[];return e.forEach(s=>{s&&r.test(s)?(r.lastIndex=0,o.push(i.createElement("a",{key:s,href:s,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"}},s))):s&&o.push(s)}),o};exports.URL_REGEX=r;exports.convertTextToLinkedContent=p;exports.copyToClipboard=u;exports.getDeletedMessageText=l;exports.getMessageById=h;exports.isAuthor=g;exports.scrollToMessageById=T;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),n=require("../messages/index.js"),d=(t,s)=>t&&s.author&&t.id===s.author.id,g=(t,s)=>{const o=s.toLanguageString("chatSender.deletedMessage",n.messages[n.chatSenderDeletedMessage]),e=s.toLanguageString("chatReceiver.deletedMessage",n.messages[n.chatReceiverDeletedMessage]);return t?o:e},u=t=>{navigator.clipboard.writeText(t)},h=(t,s)=>t.find(o=>o.id===s),T=(t,s)=>{if(!s)return;const o=s.querySelector(`[data-message-id="${t}"]`);if(!o)return;const e=s.querySelector(".k-message-list");if(e){const c=e.getBoundingClientRect().top,a=o.getBoundingClientRect().top,l=e.scrollTop+(a-c);e.scrollTo({top:l,behavior:"smooth"})}else o.scrollIntoView({behavior:"smooth",block:"start"})},r=/(https?:\/\/[^\s]+)/g,p=t=>{if(!t)return[""];const s=t.split(r),o=[];return s.forEach(e=>{e&&r.test(e)?(r.lastIndex=0,o.push(i.createElement("a",{key:e,href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"}},e))):e&&o.push(e)}),o};exports.URL_REGEX=r;exports.convertTextToLinkedContent=p;exports.copyToClipboard=u;exports.getDeletedMessageText=g;exports.getMessageById=h;exports.isAuthor=d;exports.scrollToMessageById=T;