@progress/kendo-react-conversational-ui 12.3.0-develop.2 → 12.3.0-develop.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chat/components/ActionGroup.js +1 -1
- package/chat/components/ActionGroup.mjs +55 -34
- package/chat/components/Attachment.js +1 -1
- package/chat/components/Attachment.mjs +16 -9
- package/chat/components/Chat.js +1 -1
- package/chat/components/Chat.mjs +359 -278
- package/chat/components/ChatMessage.js +1 -1
- package/chat/components/ChatMessage.mjs +159 -147
- package/chat/components/Header.js +1 -1
- package/chat/components/Header.mjs +1 -1
- package/chat/components/MessageGroup.js +1 -1
- package/chat/components/MessageGroup.mjs +82 -61
- package/chat/components/NewMessage.js +1 -1
- package/chat/components/NewMessage.mjs +63 -59
- package/chat/components/ScrollButtonsWrapper.js +8 -0
- package/chat/components/ScrollButtonsWrapper.mjs +58 -0
- package/chat/components/SuggestionsGroup.js +1 -1
- package/chat/components/SuggestionsGroup.mjs +58 -18
- package/chat/components/elements/FileBox.js +1 -1
- package/chat/components/elements/FileBox.mjs +31 -37
- package/chat/components/elements/PinnedMessage.js +1 -1
- package/chat/components/elements/PinnedMessage.mjs +5 -4
- package/chat/hooks/useScrollWithButtons.js +8 -0
- package/chat/hooks/useScrollWithButtons.mjs +46 -0
- package/chat/utils/fieldMapping.js +1 -1
- package/chat/utils/fieldMapping.mjs +1 -1
- package/chat/utils/messageSettings.js +8 -0
- package/chat/utils/messageSettings.mjs +31 -0
- package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
- package/index.d.mts +199 -5
- package/index.d.ts +199 -5
- package/messages/index.js +1 -1
- package/messages/index.mjs +26 -22
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +11 -11
package/chat/components/Chat.mjs
CHANGED
|
@@ -5,365 +5,446 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { validatePackage as
|
|
8
|
+
import { validatePackage as nt, getLicenseMessage as at, Keys as M, classNames as we, WatermarkOverlay as rt } from "@progress/kendo-react-common";
|
|
9
9
|
import o from "prop-types";
|
|
10
10
|
import * as e from "react";
|
|
11
|
-
import { convertMsgsToViewItems as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { ChatMessage as
|
|
22
|
-
import { packageMetadata as
|
|
23
|
-
import { ariaLabelMessageList as
|
|
24
|
-
import { useLocalization as
|
|
25
|
-
import { isStandardMessageFormat as
|
|
26
|
-
import { useChatScroll as
|
|
27
|
-
|
|
11
|
+
import { convertMsgsToViewItems as lt } from "../ViewItem.mjs";
|
|
12
|
+
import it from "./ActionGroup.mjs";
|
|
13
|
+
import ct from "./AttachmentGroup.mjs";
|
|
14
|
+
import ut from "./DateMarker.mjs";
|
|
15
|
+
import mt from "./MessageGroup.mjs";
|
|
16
|
+
import gt from "./NewMessage.mjs";
|
|
17
|
+
import pt from "./Header.mjs";
|
|
18
|
+
import ft from "./elements/PinnedMessage.mjs";
|
|
19
|
+
import dt from "./Notification.mjs";
|
|
20
|
+
import ht from "./ChatContext.mjs";
|
|
21
|
+
import { ChatMessage as yt } from "./ChatMessage.mjs";
|
|
22
|
+
import { packageMetadata as Fe } from "../../package-metadata.mjs";
|
|
23
|
+
import { ariaLabelMessageList as ve, messages as Le, chatCopyNotification as Ie } from "../../messages/index.mjs";
|
|
24
|
+
import { useLocalization as Ct } from "@progress/kendo-react-intl";
|
|
25
|
+
import { isStandardMessageFormat as Tt, mapDataArrayToMessages as Mt } from "../utils/fieldMapping.mjs";
|
|
26
|
+
import { useChatScroll as St } from "../utils/scroll.mjs";
|
|
27
|
+
import { resolveMessageSettings as kt } from "../utils/messageSettings.mjs";
|
|
28
|
+
const Ne = e.forwardRef((De, y) => {
|
|
28
29
|
const {
|
|
29
|
-
messages:
|
|
30
|
-
messageTemplate:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
messages: m = [],
|
|
31
|
+
messageTemplate: v,
|
|
32
|
+
messageContentTemplate: L,
|
|
33
|
+
attachmentTemplate: S,
|
|
34
|
+
width: Ue,
|
|
35
|
+
height: Oe,
|
|
36
|
+
onSendMessage: d,
|
|
35
37
|
onSuggestionClick: I,
|
|
36
|
-
onInputValueChange:
|
|
37
|
-
onActionExecute:
|
|
38
|
-
dir:
|
|
39
|
-
messageBox:
|
|
40
|
-
placeholder:
|
|
41
|
-
className:
|
|
42
|
-
message:
|
|
38
|
+
onInputValueChange: N,
|
|
39
|
+
onActionExecute: k,
|
|
40
|
+
dir: g,
|
|
41
|
+
messageBox: Pe,
|
|
42
|
+
placeholder: Ve,
|
|
43
|
+
className: D,
|
|
44
|
+
message: U = yt,
|
|
43
45
|
authorId: r,
|
|
44
|
-
suggestions:
|
|
45
|
-
suggestionTemplate:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
46
|
+
suggestions: O,
|
|
47
|
+
suggestionTemplate: Be,
|
|
48
|
+
suggestionsLayout: qe = "scroll",
|
|
49
|
+
quickActionsLayout: P = "scroll",
|
|
50
|
+
inputValue: We,
|
|
51
|
+
headerTemplate: p,
|
|
52
|
+
noDataTemplate: f,
|
|
53
|
+
timestampTemplate: V,
|
|
54
|
+
statusTemplate: B,
|
|
55
|
+
userStatusTemplate: q,
|
|
56
|
+
allowMessageCollapse: W,
|
|
57
|
+
messageToolbarActions: j,
|
|
58
|
+
messageContextMenuActions: G,
|
|
59
|
+
fileActions: C,
|
|
60
|
+
onUnpin: je,
|
|
61
|
+
messageWidthMode: z,
|
|
62
|
+
showAvatar: K,
|
|
63
|
+
showUsername: H,
|
|
64
|
+
timestampVisibility: $,
|
|
65
|
+
authorMessageSettings: J,
|
|
66
|
+
receiverMessageSettings: Q,
|
|
67
|
+
onToolbarAction: X,
|
|
68
|
+
onContextMenuAction: Y,
|
|
69
|
+
onFileAction: Z,
|
|
70
|
+
onDownload: _,
|
|
71
|
+
speechToTextConfig: ee,
|
|
72
|
+
uploadConfig: te,
|
|
73
|
+
sendButtonConfig: Ge,
|
|
74
|
+
messageFilesLayout: se,
|
|
75
|
+
textField: oe,
|
|
76
|
+
statusField: ne,
|
|
77
|
+
authorIdField: ae,
|
|
78
|
+
authorNameField: re,
|
|
79
|
+
authorImageUrlField: le,
|
|
80
|
+
authorImageAltTextField: ie,
|
|
81
|
+
idField: ce,
|
|
82
|
+
timestampField: ue,
|
|
83
|
+
filesField: me,
|
|
84
|
+
attachmentsField: ge,
|
|
85
|
+
replyToIdField: pe,
|
|
86
|
+
isDeletedField: fe,
|
|
87
|
+
isPinnedField: de,
|
|
88
|
+
typingField: he,
|
|
89
|
+
suggestedActionsField: ye,
|
|
90
|
+
...ze
|
|
91
|
+
} = De, [i, b] = e.useState(null), [x, Ke] = e.useState(!1), [He, Ce] = e.useState(!1), [Te, Me] = e.useState(null), [c, Se] = e.useState(null), E = e.useRef(null), ke = e.useRef(null), A = e.useRef(null), be = e.useRef(null), R = e.useRef(void 0), w = e.useRef(!1), F = e.useRef(null), xe = e.useRef(""), a = e.useMemo(() => {
|
|
92
|
+
if (!m || m.length === 0)
|
|
81
93
|
return [];
|
|
82
|
-
const
|
|
83
|
-
textField:
|
|
84
|
-
statusField:
|
|
85
|
-
authorIdField:
|
|
86
|
-
authorNameField:
|
|
87
|
-
authorImageUrlField:
|
|
88
|
-
authorImageAltTextField:
|
|
89
|
-
idField:
|
|
90
|
-
timestampField:
|
|
91
|
-
filesField:
|
|
92
|
-
attachmentsField:
|
|
93
|
-
replyToIdField:
|
|
94
|
-
isDeletedField:
|
|
95
|
-
isPinnedField:
|
|
96
|
-
typingField:
|
|
97
|
-
suggestedActionsField:
|
|
94
|
+
const s = {
|
|
95
|
+
textField: oe,
|
|
96
|
+
statusField: ne,
|
|
97
|
+
authorIdField: ae,
|
|
98
|
+
authorNameField: re,
|
|
99
|
+
authorImageUrlField: le,
|
|
100
|
+
authorImageAltTextField: ie,
|
|
101
|
+
idField: ce,
|
|
102
|
+
timestampField: ue,
|
|
103
|
+
filesField: me,
|
|
104
|
+
attachmentsField: ge,
|
|
105
|
+
replyToIdField: pe,
|
|
106
|
+
isDeletedField: fe,
|
|
107
|
+
isPinnedField: de,
|
|
108
|
+
typingField: he,
|
|
109
|
+
suggestedActionsField: ye
|
|
98
110
|
};
|
|
99
|
-
return !Object.values(
|
|
111
|
+
return !Object.values(s).some((n) => n !== void 0) && Tt(m[0]) ? m.map((n) => ({
|
|
100
112
|
...n,
|
|
101
113
|
timestamp: n.timestamp ? new Date(n.timestamp) : n.timestamp
|
|
102
|
-
})) :
|
|
114
|
+
})) : Mt(m, s);
|
|
103
115
|
}, [
|
|
104
|
-
|
|
105
|
-
z,
|
|
106
|
-
H,
|
|
107
|
-
$,
|
|
108
|
-
J,
|
|
109
|
-
Q,
|
|
110
|
-
X,
|
|
111
|
-
Y,
|
|
112
|
-
Z,
|
|
113
|
-
_,
|
|
114
|
-
ee,
|
|
115
|
-
te,
|
|
116
|
-
se,
|
|
117
|
-
ne,
|
|
116
|
+
m,
|
|
118
117
|
oe,
|
|
119
|
-
|
|
118
|
+
ne,
|
|
119
|
+
ae,
|
|
120
|
+
re,
|
|
121
|
+
le,
|
|
122
|
+
ie,
|
|
123
|
+
ce,
|
|
124
|
+
ue,
|
|
125
|
+
me,
|
|
126
|
+
ge,
|
|
127
|
+
pe,
|
|
128
|
+
fe,
|
|
129
|
+
de,
|
|
130
|
+
he,
|
|
131
|
+
ye
|
|
120
132
|
]);
|
|
121
133
|
e.useEffect(() => {
|
|
122
|
-
if (r ===
|
|
123
|
-
|
|
134
|
+
if (r === xe.current && F.current) {
|
|
135
|
+
Se(F.current);
|
|
124
136
|
return;
|
|
125
137
|
}
|
|
126
138
|
if (r && a.length > 0) {
|
|
127
|
-
const
|
|
139
|
+
const s = a.find(
|
|
128
140
|
(n) => n.author && (n.author.id === r || n.author.id === String(r))
|
|
129
|
-
),
|
|
130
|
-
|
|
141
|
+
), t = (s == null ? void 0 : s.author) || { id: r };
|
|
142
|
+
F.current = t, xe.current = r, Se(t);
|
|
131
143
|
}
|
|
132
144
|
}, [r, a]);
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
viewItemsWrapperRef:
|
|
136
|
-
isKeyboardNavigationActiveRef:
|
|
145
|
+
const u = e.useMemo(() => a.length > 0 ? lt(a) : [], [a]), $e = e.useMemo(() => !nt(Fe, { component: "Chat" }), []), Je = at(Fe), Ee = e.useMemo(() => a.find((s) => s.isPinned), [a]), Ae = Ct();
|
|
146
|
+
St({
|
|
147
|
+
viewItemsWrapperRef: A,
|
|
148
|
+
isKeyboardNavigationActiveRef: w,
|
|
137
149
|
processedMessages: a,
|
|
138
|
-
suggestions:
|
|
150
|
+
suggestions: O
|
|
139
151
|
});
|
|
140
|
-
const
|
|
141
|
-
clearTimeout(
|
|
142
|
-
}, []),
|
|
143
|
-
|
|
144
|
-
|
|
152
|
+
const Qe = e.useCallback(() => {
|
|
153
|
+
clearTimeout(R.current);
|
|
154
|
+
}, []), Xe = e.useCallback(() => {
|
|
155
|
+
R.current = window.setTimeout(() => {
|
|
156
|
+
b(null);
|
|
145
157
|
}, 0);
|
|
146
|
-
}, []),
|
|
147
|
-
|
|
148
|
-
}, []),
|
|
149
|
-
(
|
|
150
|
-
let
|
|
151
|
-
const n = i !== null ? i :
|
|
152
|
-
|
|
158
|
+
}, []), T = e.useCallback((s) => {
|
|
159
|
+
b(s);
|
|
160
|
+
}, []), Ye = e.useCallback(
|
|
161
|
+
(s) => {
|
|
162
|
+
let t = null;
|
|
163
|
+
const n = i !== null ? i : u.lastSelectionIndex;
|
|
164
|
+
s.keyCode === M.up ? n === null ? t = 0 : n > 0 && (t = n - 1) : s.keyCode === M.down ? n === null ? t = 0 : n < u.lastSelectionIndex && (t = n + 1) : s.keyCode === M.home ? t = 0 : s.keyCode === M.end && (t = u.lastSelectionIndex), t !== null && (b(t), w.current = !0, s.preventDefault());
|
|
153
165
|
},
|
|
154
|
-
[i,
|
|
155
|
-
),
|
|
156
|
-
(
|
|
157
|
-
var
|
|
158
|
-
if (
|
|
159
|
-
action: { value:
|
|
160
|
-
syntheticEvent:
|
|
161
|
-
nativeEvent:
|
|
162
|
-
target:
|
|
163
|
-
}), !
|
|
164
|
-
switch (
|
|
166
|
+
[i, u]
|
|
167
|
+
), Re = e.useCallback(
|
|
168
|
+
(s, t, n) => {
|
|
169
|
+
var h;
|
|
170
|
+
if (k && k({
|
|
171
|
+
action: { value: s.value, title: s.title, type: s.type },
|
|
172
|
+
syntheticEvent: t,
|
|
173
|
+
nativeEvent: t.nativeEvent,
|
|
174
|
+
target: t.currentTarget
|
|
175
|
+
}), !t.isDefaultPrevented()) {
|
|
176
|
+
switch (s.type) {
|
|
165
177
|
case "reply":
|
|
166
|
-
|
|
178
|
+
d && d({
|
|
167
179
|
message: {
|
|
168
180
|
id: "",
|
|
169
|
-
author:
|
|
170
|
-
text:
|
|
181
|
+
author: c,
|
|
182
|
+
text: s.value,
|
|
171
183
|
timestamp: /* @__PURE__ */ new Date()
|
|
172
184
|
},
|
|
173
|
-
syntheticEvent:
|
|
174
|
-
nativeEvent:
|
|
175
|
-
target:
|
|
185
|
+
syntheticEvent: t,
|
|
186
|
+
nativeEvent: t.nativeEvent,
|
|
187
|
+
target: t.currentTarget
|
|
176
188
|
});
|
|
177
189
|
break;
|
|
178
190
|
case "call":
|
|
179
|
-
window.open("tel:" +
|
|
191
|
+
window.open("tel:" + s.value);
|
|
180
192
|
break;
|
|
181
193
|
case "openUrl":
|
|
182
|
-
window.open(
|
|
194
|
+
window.open(s.value);
|
|
183
195
|
break;
|
|
184
196
|
}
|
|
185
|
-
(
|
|
197
|
+
(h = be.current) == null || h.focusInput();
|
|
186
198
|
}
|
|
187
199
|
},
|
|
188
|
-
[
|
|
189
|
-
),
|
|
190
|
-
const
|
|
191
|
-
return
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
200
|
+
[k, d, c]
|
|
201
|
+
), Ze = e.useCallback(() => we("k-chat", D, { "k-rtl": x }), [D, x]), _e = e.useCallback(() => {
|
|
202
|
+
const s = u.length - 1;
|
|
203
|
+
return u.map((t, n) => {
|
|
204
|
+
var h;
|
|
205
|
+
if (t.type === "date-marker")
|
|
206
|
+
return /* @__PURE__ */ e.createElement(ut, { item: t, key: t.trackBy, timestampTemplate: V });
|
|
207
|
+
if (t.type === "message-group") {
|
|
208
|
+
const ot = {
|
|
209
|
+
allowMessageCollapse: W,
|
|
210
|
+
messageWidthMode: z,
|
|
211
|
+
showAvatar: K,
|
|
212
|
+
showUsername: H,
|
|
213
|
+
messageTemplate: v,
|
|
214
|
+
messageContentTemplate: L,
|
|
215
|
+
messageToolbarActions: j,
|
|
216
|
+
messageContextMenuActions: G,
|
|
217
|
+
fileActions: C
|
|
218
|
+
}, l = kt(
|
|
219
|
+
(h = t == null ? void 0 : t.messages) == null ? void 0 : h[0],
|
|
220
|
+
r,
|
|
221
|
+
ot,
|
|
222
|
+
J,
|
|
223
|
+
Q
|
|
224
|
+
);
|
|
225
|
+
return /* @__PURE__ */ e.createElement(
|
|
226
|
+
mt,
|
|
227
|
+
{
|
|
228
|
+
group: t,
|
|
229
|
+
itemTemplate: l.messageTemplate,
|
|
230
|
+
contentTemplate: l.messageContentTemplate,
|
|
231
|
+
attachmentTemplate: S,
|
|
232
|
+
user: c,
|
|
233
|
+
selectedItemIndex: i,
|
|
234
|
+
onRequestSelection: T,
|
|
235
|
+
isLastGroup: n === s,
|
|
236
|
+
key: t.messages[0].selectionIndex,
|
|
237
|
+
message: U,
|
|
238
|
+
allowMessageCollapse: l.allowMessageCollapse,
|
|
239
|
+
messageToolbarActions: l.messageToolbarActions,
|
|
240
|
+
messageContextMenuActions: l.messageContextMenuActions,
|
|
241
|
+
fileActions: l.fileActions,
|
|
242
|
+
messageWidthMode: l.messageWidthMode,
|
|
243
|
+
showAvatar: l.showAvatar,
|
|
244
|
+
showUsername: l.showUsername
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
} else {
|
|
248
|
+
if (t.type === "attachment-group")
|
|
249
|
+
return /* @__PURE__ */ e.createElement(
|
|
250
|
+
ct,
|
|
251
|
+
{
|
|
252
|
+
group: t,
|
|
253
|
+
itemTemplate: S,
|
|
254
|
+
onRequestSelection: T,
|
|
255
|
+
selected: t.selectionIndex === i,
|
|
256
|
+
isLastGroup: n === s,
|
|
257
|
+
key: t.selectionIndex
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
if (t.type === "action-group")
|
|
261
|
+
return /* @__PURE__ */ e.createElement(
|
|
262
|
+
it,
|
|
263
|
+
{
|
|
264
|
+
group: t,
|
|
265
|
+
onActionExecute: Re,
|
|
266
|
+
onRequestSelection: T,
|
|
267
|
+
selected: t.selectionIndex === i,
|
|
268
|
+
key: t.selectionIndex,
|
|
269
|
+
quickActionsLayout: P,
|
|
270
|
+
dir: g
|
|
271
|
+
}
|
|
272
|
+
);
|
|
226
273
|
}
|
|
227
|
-
|
|
274
|
+
return null;
|
|
275
|
+
});
|
|
228
276
|
}, [
|
|
277
|
+
u,
|
|
278
|
+
V,
|
|
279
|
+
v,
|
|
280
|
+
L,
|
|
281
|
+
S,
|
|
229
282
|
c,
|
|
230
|
-
N,
|
|
231
|
-
F,
|
|
232
|
-
h,
|
|
233
|
-
l,
|
|
234
283
|
i,
|
|
235
|
-
|
|
236
|
-
w,
|
|
237
|
-
D,
|
|
238
|
-
P,
|
|
239
|
-
B,
|
|
284
|
+
T,
|
|
240
285
|
U,
|
|
241
|
-
|
|
242
|
-
|
|
286
|
+
W,
|
|
287
|
+
j,
|
|
288
|
+
G,
|
|
289
|
+
C,
|
|
290
|
+
z,
|
|
291
|
+
K,
|
|
292
|
+
H,
|
|
293
|
+
r,
|
|
294
|
+
J,
|
|
295
|
+
Q,
|
|
296
|
+
Re,
|
|
297
|
+
P,
|
|
298
|
+
g
|
|
299
|
+
]), et = e.useCallback(() => p ? typeof p == "function" ? p() : p : null, [p]), tt = e.useCallback(() => f ? typeof f == "function" ? f() : f : null, [f]);
|
|
243
300
|
e.useEffect(() => {
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
}, [
|
|
247
|
-
clearTimeout(
|
|
301
|
+
const s = g !== void 0 ? g === "rtl" : E.current && getComputedStyle(E.current).direction === "rtl";
|
|
302
|
+
Ke(!!s);
|
|
303
|
+
}, [g]), e.useEffect(() => () => {
|
|
304
|
+
clearTimeout(R.current);
|
|
248
305
|
}, []);
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
306
|
+
const st = e.useMemo(() => ({
|
|
307
|
+
replyToMessage: Te,
|
|
308
|
+
setReplyToMessage: Me,
|
|
309
|
+
messages: a,
|
|
310
|
+
user: c,
|
|
311
|
+
internalScrollContainerRef: ke,
|
|
312
|
+
messageListScrollContainerRef: A,
|
|
313
|
+
onToolbarAction: X,
|
|
314
|
+
onContextMenuAction: Y,
|
|
315
|
+
onFileAction: Z,
|
|
316
|
+
setShowCopyNotification: Ce,
|
|
317
|
+
onDownload: _,
|
|
318
|
+
fileActions: C,
|
|
319
|
+
speechToTextConfig: ee,
|
|
320
|
+
uploadConfig: te,
|
|
321
|
+
statusTemplate: B,
|
|
322
|
+
userStatusTemplate: q,
|
|
323
|
+
messageFilesLayout: se,
|
|
324
|
+
timestampVisibility: $
|
|
325
|
+
}), [
|
|
326
|
+
Te,
|
|
327
|
+
Me,
|
|
328
|
+
a,
|
|
329
|
+
c,
|
|
330
|
+
X,
|
|
331
|
+
Y,
|
|
332
|
+
Z,
|
|
333
|
+
Ce,
|
|
334
|
+
_,
|
|
335
|
+
C,
|
|
336
|
+
ee,
|
|
337
|
+
te,
|
|
338
|
+
B,
|
|
339
|
+
q,
|
|
340
|
+
se,
|
|
341
|
+
$
|
|
342
|
+
]);
|
|
343
|
+
return /* @__PURE__ */ e.createElement(ht.Provider, { value: st }, /* @__PURE__ */ e.createElement(
|
|
284
344
|
"div",
|
|
285
345
|
{
|
|
286
|
-
style: { width:
|
|
287
|
-
onKeyDown:
|
|
288
|
-
className:
|
|
289
|
-
ref: (
|
|
290
|
-
|
|
346
|
+
style: { width: Ue, height: Oe, position: "relative", overflow: "hidden" },
|
|
347
|
+
onKeyDown: Ye,
|
|
348
|
+
className: Ze(),
|
|
349
|
+
ref: (s) => {
|
|
350
|
+
E.current = s, ke.current = s, typeof y == "function" ? y(s) : y && (y.current = s);
|
|
291
351
|
},
|
|
292
|
-
...
|
|
352
|
+
...ze
|
|
293
353
|
},
|
|
294
|
-
|
|
295
|
-
|
|
354
|
+
p !== void 0 && /* @__PURE__ */ e.createElement(pt, null, et()),
|
|
355
|
+
Ee && /* @__PURE__ */ e.createElement(ft, { message: Ee, onUnpin: je, user: c }),
|
|
296
356
|
/* @__PURE__ */ e.createElement(
|
|
297
357
|
"div",
|
|
298
358
|
{
|
|
299
|
-
className: "k-message-list
|
|
300
|
-
onBlur:
|
|
301
|
-
onFocus:
|
|
359
|
+
className: "k-message-list",
|
|
360
|
+
onBlur: Xe,
|
|
361
|
+
onFocus: Qe,
|
|
302
362
|
role: "log",
|
|
303
|
-
"aria-label":
|
|
304
|
-
|
|
305
|
-
|
|
363
|
+
"aria-label": Ae.toLanguageString(
|
|
364
|
+
ve,
|
|
365
|
+
Le[ve]
|
|
306
366
|
),
|
|
307
367
|
"aria-live": "polite",
|
|
308
|
-
ref:
|
|
368
|
+
ref: A
|
|
309
369
|
},
|
|
310
|
-
/* @__PURE__ */ e.createElement(
|
|
370
|
+
/* @__PURE__ */ e.createElement(
|
|
371
|
+
"div",
|
|
372
|
+
{
|
|
373
|
+
className: we("k-message-list-content", {
|
|
374
|
+
"k-message-list-content-empty": a.length === 0
|
|
375
|
+
})
|
|
376
|
+
},
|
|
377
|
+
a.length === 0 && f !== void 0 && tt(),
|
|
378
|
+
a.length > 0 && _e()
|
|
379
|
+
)
|
|
311
380
|
),
|
|
312
381
|
/* @__PURE__ */ e.createElement(
|
|
313
|
-
|
|
382
|
+
gt,
|
|
314
383
|
{
|
|
315
|
-
onSendMessage: (
|
|
316
|
-
|
|
317
|
-
message:
|
|
318
|
-
syntheticEvent:
|
|
319
|
-
nativeEvent:
|
|
320
|
-
target:
|
|
384
|
+
onSendMessage: (s, t) => {
|
|
385
|
+
d && d({
|
|
386
|
+
message: s,
|
|
387
|
+
syntheticEvent: t,
|
|
388
|
+
nativeEvent: t.nativeEvent,
|
|
389
|
+
target: t.currentTarget
|
|
321
390
|
});
|
|
322
391
|
},
|
|
323
|
-
onSuggestionClick: (
|
|
324
|
-
I && I(
|
|
392
|
+
onSuggestionClick: (s) => {
|
|
393
|
+
I && I(s);
|
|
325
394
|
},
|
|
326
|
-
isDirectionRightToLeft:
|
|
327
|
-
ref:
|
|
328
|
-
placeholder:
|
|
329
|
-
MessageBox:
|
|
330
|
-
suggestions:
|
|
331
|
-
suggestionTemplate:
|
|
332
|
-
inputValue:
|
|
333
|
-
onInputValueChange: (
|
|
334
|
-
|
|
395
|
+
isDirectionRightToLeft: x,
|
|
396
|
+
ref: be,
|
|
397
|
+
placeholder: Ve,
|
|
398
|
+
MessageBox: Pe,
|
|
399
|
+
suggestions: O,
|
|
400
|
+
suggestionTemplate: Be,
|
|
401
|
+
inputValue: We,
|
|
402
|
+
onInputValueChange: (s) => {
|
|
403
|
+
N && N(s);
|
|
335
404
|
},
|
|
336
405
|
onInputClick: () => {
|
|
337
|
-
|
|
406
|
+
w.current = !1;
|
|
338
407
|
},
|
|
339
|
-
sendButtonConfig:
|
|
408
|
+
sendButtonConfig: Ge,
|
|
409
|
+
suggestionsLayout: qe,
|
|
410
|
+
dir: g
|
|
340
411
|
}
|
|
341
412
|
),
|
|
342
413
|
/* @__PURE__ */ e.createElement(
|
|
343
|
-
|
|
414
|
+
dt,
|
|
344
415
|
{
|
|
345
|
-
show:
|
|
346
|
-
text:
|
|
347
|
-
|
|
348
|
-
|
|
416
|
+
show: He,
|
|
417
|
+
text: Ae.toLanguageString(
|
|
418
|
+
Ie,
|
|
419
|
+
Le[Ie]
|
|
349
420
|
)
|
|
350
421
|
}
|
|
351
422
|
),
|
|
352
|
-
|
|
423
|
+
$e && /* @__PURE__ */ e.createElement(rt, { message: Je })
|
|
353
424
|
));
|
|
354
425
|
});
|
|
355
|
-
|
|
356
|
-
|
|
426
|
+
Ne.displayName = "Chat";
|
|
427
|
+
Ne.propTypes = {
|
|
357
428
|
messages: o.arrayOf(o.object),
|
|
358
429
|
user: o.object,
|
|
359
430
|
messageTemplate: o.any,
|
|
431
|
+
messageContentTemplate: o.any,
|
|
360
432
|
attachmentTemplate: o.any,
|
|
361
433
|
width: o.oneOfType([o.string, o.number]),
|
|
362
434
|
onSendMessage: o.func,
|
|
363
435
|
onActionExecute: o.func,
|
|
364
436
|
dir: o.string,
|
|
365
|
-
messageBox: o.any
|
|
437
|
+
messageBox: o.any,
|
|
438
|
+
noDataTemplate: o.oneOfType([o.element, o.func]),
|
|
439
|
+
suggestionsLayout: o.oneOf(["scroll", "wrap", "scrollbuttons"]),
|
|
440
|
+
quickActionsLayout: o.oneOf(["scroll", "wrap", "scrollbuttons"]),
|
|
441
|
+
userStatusTemplate: o.elementType,
|
|
442
|
+
messageFilesLayout: o.oneOf(["vertical", "wrap", "horizontal"]),
|
|
443
|
+
showAvatar: o.bool,
|
|
444
|
+
showUsername: o.bool,
|
|
445
|
+
authorMessageSettings: o.object,
|
|
446
|
+
receiverMessageSettings: o.object
|
|
366
447
|
};
|
|
367
448
|
export {
|
|
368
|
-
|
|
449
|
+
Ne as Chat
|
|
369
450
|
};
|