@progress/kendo-react-conversational-ui 14.5.0-develop.8 → 15.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/ai-prompt/AIPrompt.d.ts +6 -0
- package/ai-prompt/AIPrompt.js +1 -1
- package/ai-prompt/AIPrompt.mjs +40 -38
- package/ai-prompt/AIPromptContent.js +1 -1
- package/ai-prompt/AIPromptContent.mjs +5 -5
- package/ai-prompt/views/AIPromptOutputView.js +1 -1
- package/ai-prompt/views/AIPromptOutputView.mjs +6 -6
- package/chat/ChatPropsAndState.d.ts +17 -0
- package/chat/components/Chat.js +1 -1
- package/chat/components/Chat.mjs +222 -220
- package/chat/components/ChatMessage.js +1 -1
- package/chat/components/ChatMessage.mjs +133 -117
- package/chat/components/Header.js +1 -1
- package/chat/components/Header.mjs +1 -1
- package/chat/components/NewMessage.js +1 -1
- package/chat/components/NewMessage.mjs +49 -48
- package/chat/components/Notification.js +1 -1
- package/chat/components/Notification.mjs +1 -1
- package/chat/components/elements/FileBox.js +1 -1
- package/chat/components/elements/FileBox.mjs +10 -9
- package/chat/components/elements/PinnedMessage.js +1 -1
- package/chat/components/elements/PinnedMessage.mjs +14 -13
- package/chat/hooks/useEndlessScroll.js +1 -1
- package/chat/hooks/useEndlessScroll.mjs +103 -101
- package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
- package/inline-ai-prompt/InlineAIPrompt.js +1 -1
- package/inline-ai-prompt/InlineAIPrompt.mjs +10 -10
- package/inline-ai-prompt/InlineAIPromptInput.js +1 -1
- package/inline-ai-prompt/InlineAIPromptInput.mjs +1 -1
- package/messages/index.d.ts +5 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +12 -10
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -12
- package/prompt-box/FileBox.js +1 -1
- package/prompt-box/FileBox.mjs +21 -20
- package/prompt-box/PromptBox.js +1 -1
- package/prompt-box/PromptBox.mjs +148 -150
package/prompt-box/PromptBox.mjs
CHANGED
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import o from "prop-types";
|
|
10
|
-
import { validatePackage as
|
|
11
|
-
import {
|
|
12
|
-
import { PromptBoxActionButton as
|
|
13
|
-
import { PromptBoxSpeechToTextButton as
|
|
14
|
-
import { PromptBoxUploadButton as
|
|
15
|
-
import { FileBox as
|
|
10
|
+
import { validatePackage as Je, getLicenseMessage as Qe, dispatchEvent as O, classNames as ne, WatermarkOverlay as Ye } from "@progress/kendo-react-common";
|
|
11
|
+
import { stopIcon as et, arrowUpIcon as tt, paperclipIcon as nt } from "@progress/kendo-svg-icons";
|
|
12
|
+
import { PromptBoxActionButton as ot } from "./PromptBoxActionButton.mjs";
|
|
13
|
+
import { PromptBoxSpeechToTextButton as st } from "./PromptBoxSpeechToTextButton.mjs";
|
|
14
|
+
import { PromptBoxUploadButton as lt } from "./PromptBoxUploadButton.mjs";
|
|
15
|
+
import { FileBox as rt } from "./FileBox.mjs";
|
|
16
16
|
import { packageMetadata as ke } from "../package-metadata.mjs";
|
|
17
|
-
import { useLocalization as
|
|
18
|
-
import { promptBoxInput as Ee, messages as
|
|
19
|
-
const p = "k-prompt-box",
|
|
17
|
+
import { useLocalization as it } from "@progress/kendo-react-intl";
|
|
18
|
+
import { promptBoxInput as Ee, messages as A, promptBoxStopGenerating as K, promptBoxSendButton as q, promptBoxAttachFile as G } from "../messages/index.mjs";
|
|
19
|
+
const p = "k-prompt-box", at = 20, ct = 50, b = {
|
|
20
20
|
mode: "auto",
|
|
21
21
|
rows: 1,
|
|
22
22
|
defaultValue: "",
|
|
@@ -26,64 +26,64 @@ const p = "k-prompt-box", ct = 20, ut = 50, b = {
|
|
|
26
26
|
uploadButtonConfig: !1,
|
|
27
27
|
speechToTextButtonConfig: !0,
|
|
28
28
|
actionButtonConfig: !0
|
|
29
|
-
}, Te = t.forwardRef((
|
|
30
|
-
const
|
|
29
|
+
}, Te = t.forwardRef((xe, Ae) => {
|
|
30
|
+
const Re = !Je(ke, { component: "PromptBox" }), we = Qe(ke), v = it(), Fe = { ...b, ...xe }, {
|
|
31
31
|
mode: s = b.mode,
|
|
32
|
-
fillMode:
|
|
33
|
-
rows:
|
|
32
|
+
fillMode: oe,
|
|
33
|
+
rows: S = b.rows,
|
|
34
34
|
maxTextAreaHeight: c,
|
|
35
|
-
value:
|
|
36
|
-
defaultValue:
|
|
35
|
+
value: se,
|
|
36
|
+
defaultValue: Se = b.defaultValue,
|
|
37
37
|
disabled: f = b.disabled,
|
|
38
|
-
readOnly:
|
|
39
|
-
placeholder:
|
|
40
|
-
title:
|
|
41
|
-
maxLength:
|
|
42
|
-
inputAttributes:
|
|
43
|
-
topAffix:
|
|
44
|
-
startAffix:
|
|
45
|
-
endAffix:
|
|
46
|
-
header:
|
|
38
|
+
readOnly: Pe = b.readOnly,
|
|
39
|
+
placeholder: Ne,
|
|
40
|
+
title: He,
|
|
41
|
+
maxLength: Oe,
|
|
42
|
+
inputAttributes: Le,
|
|
43
|
+
topAffix: le,
|
|
44
|
+
startAffix: B,
|
|
45
|
+
endAffix: y,
|
|
46
|
+
header: Me,
|
|
47
47
|
onChange: R,
|
|
48
48
|
onFocus: X,
|
|
49
49
|
onBlur: Z,
|
|
50
50
|
onPromptAction: J,
|
|
51
|
-
attachments:
|
|
52
|
-
loading:
|
|
51
|
+
attachments: re,
|
|
52
|
+
loading: C = b.loading,
|
|
53
53
|
uploadButtonConfig: d = b.uploadButtonConfig,
|
|
54
|
-
speechToTextButtonConfig:
|
|
55
|
-
actionButtonConfig:
|
|
56
|
-
className:
|
|
57
|
-
style:
|
|
58
|
-
...
|
|
59
|
-
} = Fe, l = t.useRef(null), [
|
|
54
|
+
speechToTextButtonConfig: L = b.speechToTextButtonConfig,
|
|
55
|
+
actionButtonConfig: M = b.actionButtonConfig,
|
|
56
|
+
className: Ie,
|
|
57
|
+
style: $e,
|
|
58
|
+
...ze
|
|
59
|
+
} = Fe, l = t.useRef(null), [je, I] = t.useState(Se), [De, Q] = t.useState([]), [a, ie] = t.useState(!1), ae = t.useRef(null), $ = t.useRef(null), P = t.useRef(0), ce = t.useRef(0), N = t.useRef(!1), ue = t.useRef(0), z = t.useRef(0), k = t.useCallback(
|
|
60
60
|
(e, n) => e ? typeof e == "function" ? e(n) : e : null,
|
|
61
61
|
[]
|
|
62
|
-
),
|
|
63
|
-
() => !!(u != null && u.trim() ||
|
|
64
|
-
[u,
|
|
62
|
+
), E = se !== void 0, u = E ? se : je, T = re !== void 0, x = T ? re : De, j = t.useMemo(
|
|
63
|
+
() => !!(u != null && u.trim() || x.length > 0),
|
|
64
|
+
[u, x.length]
|
|
65
65
|
), w = t.useCallback(() => {
|
|
66
66
|
if (!l.current || s === "single")
|
|
67
67
|
return;
|
|
68
|
-
const e = l.current, n = globalThis.getComputedStyle(e), r = Number.parseFloat(n.lineHeight) ||
|
|
69
|
-
P.current = e.offsetHeight || r + i + h,
|
|
70
|
-
}, [s,
|
|
68
|
+
const e = l.current, n = globalThis.getComputedStyle(e), r = Number.parseFloat(n.lineHeight) || at, i = Number.parseFloat(n.paddingTop) || 0, h = Number.parseFloat(n.paddingBottom) || 0;
|
|
69
|
+
P.current = e.offsetHeight || r + i + h, ce.current = r * S + i + h, s === "auto" && !a && (z.current = e.offsetWidth);
|
|
70
|
+
}, [s, S, a]), _e = t.useCallback(() => s === "auto" ? 1 : S, [s, S]), fe = t.useCallback(
|
|
71
71
|
(e) => {
|
|
72
72
|
if (c) {
|
|
73
73
|
const n = Number.parseInt(c, 10);
|
|
74
74
|
if (e > n)
|
|
75
75
|
return n;
|
|
76
76
|
}
|
|
77
|
-
return Math.max(
|
|
77
|
+
return Math.max(ce.current, e);
|
|
78
78
|
},
|
|
79
79
|
[c]
|
|
80
80
|
), D = t.useCallback(
|
|
81
81
|
(e) => {
|
|
82
82
|
e.style.overflow = "hidden", e.style.height = `${P.current}px`;
|
|
83
|
-
const n = e.scrollHeight, r =
|
|
83
|
+
const n = e.scrollHeight, r = fe(n);
|
|
84
84
|
e.style.height = `${r}px`, c && n > Number.parseInt(c, 10) && (e.style.overflow = "");
|
|
85
85
|
},
|
|
86
|
-
[
|
|
86
|
+
[fe, c]
|
|
87
87
|
), _ = t.useCallback(
|
|
88
88
|
(e) => {
|
|
89
89
|
e.style.overflow = "hidden", e.style.height = `${P.current}px`;
|
|
@@ -91,29 +91,29 @@ const p = "k-prompt-box", ct = 20, ut = 50, b = {
|
|
|
91
91
|
e.style.height = `${r}px`, c && n > Number.parseInt(c, 10) && (e.style.overflow = "");
|
|
92
92
|
},
|
|
93
93
|
[c]
|
|
94
|
-
),
|
|
95
|
-
if (
|
|
94
|
+
), me = t.useCallback((e) => {
|
|
95
|
+
if (z.current <= 0)
|
|
96
96
|
return !1;
|
|
97
97
|
const n = e.style.height, r = e.style.width;
|
|
98
|
-
e.style.overflow = "hidden", e.style.width = `${
|
|
99
|
-
const i = e.scrollWidth <=
|
|
98
|
+
e.style.overflow = "hidden", e.style.width = `${z.current}px`, e.style.height = `${P.current}px`;
|
|
99
|
+
const i = e.scrollWidth <= z.current && e.scrollHeight <= P.current;
|
|
100
100
|
return e.style.overflow = "", r ? e.style.width = r : e.style.width = "", n ? e.style.height = n : e.style.height = "", i;
|
|
101
101
|
}, []), W = t.useCallback(
|
|
102
102
|
(e, n) => {
|
|
103
103
|
if (N.current)
|
|
104
104
|
return;
|
|
105
105
|
if ((e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight) && !a) {
|
|
106
|
-
N.current = !0,
|
|
106
|
+
N.current = !0, ie(!0);
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
109
|
if (a) {
|
|
110
110
|
_(e);
|
|
111
|
-
const i =
|
|
112
|
-
n < i &&
|
|
111
|
+
const i = ue.current;
|
|
112
|
+
n < i && me(e) && (e.style.height = "", N.current = !0, ie(!1));
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
|
-
[a, _,
|
|
116
|
-
),
|
|
115
|
+
[a, _, me]
|
|
116
|
+
), F = t.useCallback(() => {
|
|
117
117
|
var r;
|
|
118
118
|
if (s === "single" || !l.current)
|
|
119
119
|
return;
|
|
@@ -123,14 +123,14 @@ const p = "k-prompt-box", ct = 20, ut = 50, b = {
|
|
|
123
123
|
t.useEffect(() => {
|
|
124
124
|
s !== "single" && l.current && w();
|
|
125
125
|
}, [s, w]), t.useEffect(() => {
|
|
126
|
-
s !== "single" && l.current && (w(),
|
|
127
|
-
}, [
|
|
126
|
+
s !== "single" && l.current && (w(), F());
|
|
127
|
+
}, [S, s, w, F]), t.useEffect(() => {
|
|
128
128
|
if (s !== "single" && l.current) {
|
|
129
129
|
const e = (u == null ? void 0 : u.length) || 0;
|
|
130
130
|
requestAnimationFrame(() => {
|
|
131
131
|
if (l.current) {
|
|
132
132
|
const n = l.current;
|
|
133
|
-
s === "multi" ? D(n) : s === "auto" && W(n, e),
|
|
133
|
+
s === "multi" ? D(n) : s === "auto" && W(n, e), ue.current = e;
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
}
|
|
@@ -153,13 +153,13 @@ const p = "k-prompt-box", ct = 20, ut = 50, b = {
|
|
|
153
153
|
let n;
|
|
154
154
|
const r = () => {
|
|
155
155
|
clearTimeout(n), n = setTimeout(() => {
|
|
156
|
-
l.current && (s === "auto" && !a && w(),
|
|
157
|
-
},
|
|
156
|
+
l.current && (s === "auto" && !a && w(), F());
|
|
157
|
+
}, ct);
|
|
158
158
|
}, i = new ResizeObserver(r);
|
|
159
159
|
return i.observe(e), () => {
|
|
160
160
|
i.disconnect(), clearTimeout(n);
|
|
161
161
|
};
|
|
162
|
-
}, [s, a, w,
|
|
162
|
+
}, [s, a, w, F]);
|
|
163
163
|
const m = t.useCallback(() => ({
|
|
164
164
|
focus: () => {
|
|
165
165
|
var e;
|
|
@@ -174,11 +174,11 @@ const p = "k-prompt-box", ct = 20, ut = 50, b = {
|
|
|
174
174
|
return u;
|
|
175
175
|
}
|
|
176
176
|
}), [u]);
|
|
177
|
-
t.useImperativeHandle(
|
|
178
|
-
const
|
|
177
|
+
t.useImperativeHandle(Ae, m);
|
|
178
|
+
const We = t.useCallback(
|
|
179
179
|
(e) => {
|
|
180
180
|
const n = e.target.value;
|
|
181
|
-
!
|
|
181
|
+
!E && !f && I(n), R && !f && O(
|
|
182
182
|
R,
|
|
183
183
|
e,
|
|
184
184
|
{
|
|
@@ -186,35 +186,35 @@ const p = "k-prompt-box", ct = 20, ut = 50, b = {
|
|
|
186
186
|
value: n
|
|
187
187
|
},
|
|
188
188
|
{ value: n }
|
|
189
|
-
), s !== "single" &&
|
|
189
|
+
), s !== "single" && F();
|
|
190
190
|
},
|
|
191
|
-
[
|
|
192
|
-
),
|
|
191
|
+
[I, R, f, E, m, s, F]
|
|
192
|
+
), Ue = t.useCallback(
|
|
193
193
|
(e) => {
|
|
194
|
-
X && !f &&
|
|
194
|
+
X && !f && O(X, e, m(), void 0);
|
|
195
195
|
},
|
|
196
196
|
[X, f, m]
|
|
197
|
-
),
|
|
197
|
+
), Ve = t.useCallback(
|
|
198
198
|
(e) => {
|
|
199
|
-
Z && !f &&
|
|
199
|
+
Z && !f && O(Z, e, m(), void 0);
|
|
200
200
|
},
|
|
201
201
|
[Z, f, m]
|
|
202
|
-
),
|
|
202
|
+
), pe = t.useCallback((e) => {
|
|
203
203
|
e.preventDefault();
|
|
204
204
|
}, []), U = t.useCallback(
|
|
205
205
|
(e) => {
|
|
206
|
-
J &&
|
|
206
|
+
J && O(
|
|
207
207
|
J,
|
|
208
208
|
e,
|
|
209
209
|
m(),
|
|
210
210
|
{
|
|
211
211
|
value: u,
|
|
212
|
-
attachments:
|
|
212
|
+
attachments: x
|
|
213
213
|
}
|
|
214
|
-
),
|
|
214
|
+
), E || I(""), T || Q([]);
|
|
215
215
|
},
|
|
216
|
-
[J, m, u,
|
|
217
|
-
),
|
|
216
|
+
[J, m, u, x, E, T]
|
|
217
|
+
), Ke = t.useCallback(
|
|
218
218
|
(e) => {
|
|
219
219
|
if (!(e.key === "Enter" && e.shiftKey)) {
|
|
220
220
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
@@ -222,60 +222,60 @@ const p = "k-prompt-box", ct = 20, ut = 50, b = {
|
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
224
|
if (e.key === "Enter") {
|
|
225
|
-
if (e.preventDefault(),
|
|
225
|
+
if (e.preventDefault(), C)
|
|
226
226
|
return;
|
|
227
|
-
|
|
227
|
+
j && U(e);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
},
|
|
231
|
-
[U,
|
|
232
|
-
),
|
|
231
|
+
[U, C, j]
|
|
232
|
+
), de = {
|
|
233
233
|
disabled: f,
|
|
234
|
-
readOnly:
|
|
235
|
-
placeholder:
|
|
236
|
-
title:
|
|
237
|
-
maxLength:
|
|
238
|
-
"aria-label":
|
|
234
|
+
readOnly: Pe,
|
|
235
|
+
placeholder: Ne,
|
|
236
|
+
title: He,
|
|
237
|
+
maxLength: Oe,
|
|
238
|
+
"aria-label": v.toLanguageString(Ee, A[Ee]),
|
|
239
239
|
value: u,
|
|
240
240
|
// let them rewrite kb navigation if needed
|
|
241
|
-
onKeyDown:
|
|
242
|
-
...
|
|
243
|
-
onChange:
|
|
244
|
-
onFocus:
|
|
245
|
-
onBlur:
|
|
241
|
+
onKeyDown: Ke,
|
|
242
|
+
...Le,
|
|
243
|
+
onChange: We,
|
|
244
|
+
onFocus: Ue,
|
|
245
|
+
onBlur: Ve,
|
|
246
246
|
ref: l
|
|
247
|
-
},
|
|
247
|
+
}, ge = t.useCallback(
|
|
248
248
|
(e) => {
|
|
249
249
|
var i, h;
|
|
250
250
|
const { isFinal: n, alternatives: r } = e;
|
|
251
251
|
if (r.length > 0) {
|
|
252
|
-
const
|
|
252
|
+
const ee = r[0];
|
|
253
253
|
if (n) {
|
|
254
|
-
const V = ((i = l.current) == null ? void 0 : i.value) || "",
|
|
255
|
-
if (
|
|
254
|
+
const V = ((i = l.current) == null ? void 0 : i.value) || "", H = (V ? `${V} ` : "") + ee.transcript;
|
|
255
|
+
if (E || I(H), R && !f) {
|
|
256
256
|
const Ce = {
|
|
257
257
|
target: l.current,
|
|
258
258
|
currentTarget: l.current
|
|
259
259
|
};
|
|
260
|
-
|
|
260
|
+
O(
|
|
261
261
|
R,
|
|
262
262
|
Ce,
|
|
263
263
|
{
|
|
264
264
|
...m(),
|
|
265
|
-
value:
|
|
265
|
+
value: H
|
|
266
266
|
},
|
|
267
|
-
{ value:
|
|
267
|
+
{ value: H }
|
|
268
268
|
);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
(h = l.current) == null || h.focus();
|
|
273
273
|
},
|
|
274
|
-
[
|
|
275
|
-
),
|
|
274
|
+
[E, R, f, m]
|
|
275
|
+
), he = t.useCallback(() => {
|
|
276
276
|
var e, n;
|
|
277
|
-
(n = (e =
|
|
278
|
-
}, []),
|
|
277
|
+
(n = (e = ae.current) == null ? void 0 : e.actionElement) == null || n.click();
|
|
278
|
+
}, []), be = t.useCallback(
|
|
279
279
|
(e) => {
|
|
280
280
|
var i;
|
|
281
281
|
const n = Array.from(e.affectedFiles), r = typeof d == "object" && d.onSelectAttachments;
|
|
@@ -288,107 +288,105 @@ const p = "k-prompt-box", ct = 20, ut = 50, b = {
|
|
|
288
288
|
), g = t.useMemo(() => ({
|
|
289
289
|
uploadButtonProps: {
|
|
290
290
|
fillMode: "flat",
|
|
291
|
-
svgIcon:
|
|
291
|
+
svgIcon: nt,
|
|
292
292
|
size: "small",
|
|
293
293
|
rounded: "full",
|
|
294
|
-
onClick:
|
|
295
|
-
onFilesAdd:
|
|
296
|
-
files:
|
|
297
|
-
uploadRef:
|
|
298
|
-
"aria-label":
|
|
299
|
-
title:
|
|
294
|
+
onClick: he,
|
|
295
|
+
onFilesAdd: be,
|
|
296
|
+
files: x,
|
|
297
|
+
uploadRef: ae,
|
|
298
|
+
"aria-label": v.toLanguageString(G, A[G]),
|
|
299
|
+
title: v.toLanguageString(G, A[G]),
|
|
300
300
|
// Hidden prop to register callback overrides
|
|
301
301
|
_registerRemoveCallback: (e) => {
|
|
302
|
-
|
|
302
|
+
$.current = e;
|
|
303
303
|
}
|
|
304
304
|
},
|
|
305
305
|
speechToTextButtonProps: {
|
|
306
306
|
fillMode: "flat",
|
|
307
307
|
size: "small",
|
|
308
308
|
rounded: "full",
|
|
309
|
-
onResult:
|
|
309
|
+
onResult: ge
|
|
310
310
|
},
|
|
311
311
|
actionButtonProps: {
|
|
312
312
|
rounded: "full",
|
|
313
313
|
size: "small",
|
|
314
|
-
svgIcon:
|
|
315
|
-
className:
|
|
314
|
+
svgIcon: C ? et : tt,
|
|
315
|
+
className: C ? "k-generating" : "",
|
|
316
316
|
onClick: U,
|
|
317
|
-
onMouseDown:
|
|
318
|
-
disabled: !
|
|
319
|
-
"aria-
|
|
320
|
-
|
|
321
|
-
title: B ? y.toLanguageString(K, k[K]) : y.toLanguageString(q, k[q]),
|
|
317
|
+
onMouseDown: pe,
|
|
318
|
+
disabled: !C && !j,
|
|
319
|
+
"aria-label": C ? v.toLanguageString(K, A[K]) : v.toLanguageString(q, A[q]),
|
|
320
|
+
title: C ? v.toLanguageString(K, A[K]) : v.toLanguageString(q, A[q]),
|
|
322
321
|
"aria-live": "polite"
|
|
323
322
|
}
|
|
324
323
|
}), [
|
|
325
|
-
|
|
326
|
-
ye,
|
|
327
|
-
A,
|
|
328
|
-
U,
|
|
329
|
-
de,
|
|
330
|
-
B,
|
|
324
|
+
ge,
|
|
331
325
|
be,
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
326
|
+
x,
|
|
327
|
+
U,
|
|
328
|
+
pe,
|
|
329
|
+
C,
|
|
330
|
+
he,
|
|
331
|
+
v,
|
|
332
|
+
j
|
|
333
|
+
]), qe = t.useCallback(
|
|
335
334
|
(e) => {
|
|
336
335
|
T || Q((r) => r.filter((i) => i.name !== e));
|
|
337
336
|
const n = typeof d == "object" && d.onRemoveAttachment;
|
|
338
|
-
n && (
|
|
337
|
+
n && ($.current = n), $.current && $.current(e);
|
|
339
338
|
},
|
|
340
339
|
[d, T]
|
|
341
340
|
), Y = () => {
|
|
342
|
-
const e =
|
|
343
|
-
restrictions:
|
|
341
|
+
const e = L !== !1, n = M !== !1, r = d !== !1, i = typeof L == "object" ? L : void 0, h = typeof d == "object" ? d : {}, {
|
|
342
|
+
restrictions: ee,
|
|
344
343
|
multiple: V = !0,
|
|
345
|
-
accept:
|
|
344
|
+
accept: H,
|
|
346
345
|
onSelectAttachments: Ce,
|
|
347
|
-
onRemoveAttachment:
|
|
348
|
-
...
|
|
349
|
-
} = h,
|
|
346
|
+
onRemoveAttachment: ut,
|
|
347
|
+
...Xe
|
|
348
|
+
} = h, te = { restrictions: ee, multiple: V, accept: H }, Ze = typeof M == "object" ? M : void 0;
|
|
350
349
|
return /* @__PURE__ */ t.createElement(t.Fragment, null, r && /* @__PURE__ */ t.createElement(
|
|
351
|
-
|
|
350
|
+
lt,
|
|
352
351
|
{
|
|
353
352
|
...g.uploadButtonProps,
|
|
354
|
-
restrictions:
|
|
355
|
-
multiple:
|
|
356
|
-
accept:
|
|
357
|
-
...
|
|
353
|
+
restrictions: te.restrictions,
|
|
354
|
+
multiple: te.multiple,
|
|
355
|
+
accept: te.accept,
|
|
356
|
+
...Xe
|
|
358
357
|
}
|
|
359
358
|
), e && /* @__PURE__ */ t.createElement(
|
|
360
|
-
|
|
359
|
+
st,
|
|
361
360
|
{
|
|
362
361
|
...g.speechToTextButtonProps,
|
|
363
362
|
...i
|
|
364
363
|
}
|
|
365
|
-
), n && /* @__PURE__ */ t.createElement(
|
|
366
|
-
},
|
|
364
|
+
), n && /* @__PURE__ */ t.createElement(ot, { ...g.actionButtonProps, ...Ze }));
|
|
365
|
+
}, ye = s === "multi" || s === "auto" && a, ve = d !== !1 || L !== !1 || M !== !1, Be = y || ve, Ge = B || y || ve;
|
|
367
366
|
return /* @__PURE__ */ t.createElement(
|
|
368
367
|
"div",
|
|
369
368
|
{
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
[`k-input-${se}`]: se,
|
|
369
|
+
...ze,
|
|
370
|
+
className: ne(Ie, "k-input", p, {
|
|
371
|
+
[`k-input-${oe}`]: oe,
|
|
374
372
|
"k-disabled": f,
|
|
375
373
|
"k-prompt-box-singleline": s === "single",
|
|
376
|
-
"k-prompt-box-multiline":
|
|
374
|
+
"k-prompt-box-multiline": ye
|
|
377
375
|
}),
|
|
378
|
-
style:
|
|
376
|
+
style: $e
|
|
379
377
|
},
|
|
380
|
-
/* @__PURE__ */ t.createElement(
|
|
381
|
-
s === "single" ? /* @__PURE__ */ t.createElement("div", { className: `${p}-content` },
|
|
378
|
+
/* @__PURE__ */ t.createElement(rt, { files: x, onRemoveFile: qe, header: Me }),
|
|
379
|
+
s === "single" ? /* @__PURE__ */ t.createElement("div", { className: `${p}-content` }, B && /* @__PURE__ */ t.createElement("div", { className: `${p}-affix` }, k(B, g)), /* @__PURE__ */ t.createElement("input", { ...de, className: ne("k-input-inner", `${p}-input`) }), Be ? /* @__PURE__ */ t.createElement("div", { className: `${p}-affix` }, y && k(y, g), Y()) : null) : /* @__PURE__ */ t.createElement("div", { className: `${p}-content` }, s === "multi" && le && /* @__PURE__ */ t.createElement("div", { className: `${p}-affix` }, k(le, g)), s === "auto" && !a && B && /* @__PURE__ */ t.createElement("div", { className: `${p}-affix` }, k(B, g)), /* @__PURE__ */ t.createElement(
|
|
382
380
|
"textarea",
|
|
383
381
|
{
|
|
384
|
-
...
|
|
385
|
-
className:
|
|
386
|
-
rows:
|
|
382
|
+
...de,
|
|
383
|
+
className: ne("k-input-inner", `${p}-textarea`),
|
|
384
|
+
rows: _e(),
|
|
387
385
|
style: c ? { maxHeight: c } : {},
|
|
388
|
-
|
|
386
|
+
"aria-multiline": "true"
|
|
389
387
|
}
|
|
390
|
-
), s === "auto" && !a && Be ? /* @__PURE__ */ t.createElement("div", { className: `${p}-affix` },
|
|
391
|
-
|
|
388
|
+
), s === "auto" && !a && Be ? /* @__PURE__ */ t.createElement("div", { className: `${p}-affix` }, y && k(y, g), Y()) : null, ye && Ge ? /* @__PURE__ */ t.createElement("div", { className: `${p}-affix` }, B && k(B, g), (B || y) && /* @__PURE__ */ t.createElement("div", { className: "k-spacer" }), y && k(y, g), Y()) : null),
|
|
389
|
+
Re && /* @__PURE__ */ t.createElement(Ye, { message: we })
|
|
392
390
|
);
|
|
393
391
|
});
|
|
394
392
|
Te.propTypes = {
|