@progress/kendo-react-conversational-ui 16.2.0-develop.9 → 16.2.1-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/EULA.pdf +0 -0
- package/EULA.rtf +2730 -0
- package/EULA.txt +292 -0
- package/chat/components/Chat.js +1 -1
- package/chat/components/Chat.mjs +134 -132
- package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
- package/llm-kit/defaults/DefaultCitationBody.js +1 -1
- package/llm-kit/defaults/DefaultCitationBody.mjs +19 -16
- package/messages/index.d.ts +5 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +56 -54
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -18
- package/prompt-box/PromptBox.js +1 -1
- package/prompt-box/PromptBox.mjs +106 -91
- package/prompt-box/PromptBoxActionButton.d.ts +21 -0
- package/prompt-box/PromptBoxActionButton.js +1 -1
- package/prompt-box/PromptBoxActionButton.mjs +8 -5
- package/prompt-box/interfaces/PromptBoxProps.d.ts +2 -1
- package/prompt-box/utils.d.ts +24 -0
- package/prompt-box/utils.js +8 -0
- package/prompt-box/utils.mjs +22 -0
package/prompt-box/PromptBox.mjs
CHANGED
|
@@ -7,16 +7,17 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import o from "prop-types";
|
|
10
|
-
import { validatePackage as
|
|
11
|
-
import { stopIcon as
|
|
12
|
-
import { PromptBoxActionButton as
|
|
13
|
-
import { PromptBoxSpeechToTextButton as
|
|
14
|
-
import { PromptBoxUploadButton as
|
|
15
|
-
import { FileBox as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
10
|
+
import { validatePackage as Ye, getLicenseMessage as et, dispatchEvent as L, classNames as ne, WatermarkOverlay as tt } from "@progress/kendo-react-common";
|
|
11
|
+
import { stopIcon as nt, arrowUpIcon as ot, paperclipIcon as st } from "@progress/kendo-svg-icons";
|
|
12
|
+
import { PromptBoxActionButton as lt } from "./PromptBoxActionButton.mjs";
|
|
13
|
+
import { PromptBoxSpeechToTextButton as rt } from "./PromptBoxSpeechToTextButton.mjs";
|
|
14
|
+
import { PromptBoxUploadButton as it } from "./PromptBoxUploadButton.mjs";
|
|
15
|
+
import { FileBox as at } from "./FileBox.mjs";
|
|
16
|
+
import { resolveActionButtonLabels as ct } from "./utils.mjs";
|
|
17
|
+
import { packageMetadata as Ee } from "../package-metadata.mjs";
|
|
18
|
+
import { useLocalization as ut } from "@progress/kendo-react-intl";
|
|
19
|
+
import { promptBoxInput as Te, messages as A, promptBoxStopGenerating as K, promptBoxSendButton as q, promptBoxAttachFile as G } from "../messages/index.mjs";
|
|
20
|
+
const d = "k-prompt-box", ft = 20, mt = 50, b = {
|
|
20
21
|
mode: "auto",
|
|
21
22
|
rows: 1,
|
|
22
23
|
defaultValue: "",
|
|
@@ -26,48 +27,48 @@ const p = "k-prompt-box", at = 20, ct = 50, b = {
|
|
|
26
27
|
uploadButtonConfig: !1,
|
|
27
28
|
speechToTextButtonConfig: !0,
|
|
28
29
|
actionButtonConfig: !0
|
|
29
|
-
},
|
|
30
|
-
const
|
|
30
|
+
}, xe = t.forwardRef((Ae, Re) => {
|
|
31
|
+
const we = !Ye(Ee, { component: "PromptBox" }), Fe = et(Ee), y = ut(), Se = { ...b, ...Ae }, {
|
|
31
32
|
mode: s = b.mode,
|
|
32
33
|
fillMode: oe,
|
|
33
34
|
rows: S = b.rows,
|
|
34
35
|
maxTextAreaHeight: c,
|
|
35
36
|
value: se,
|
|
36
|
-
defaultValue:
|
|
37
|
+
defaultValue: Pe = b.defaultValue,
|
|
37
38
|
disabled: f = b.disabled,
|
|
38
|
-
readOnly:
|
|
39
|
-
placeholder:
|
|
40
|
-
title:
|
|
39
|
+
readOnly: Ne = b.readOnly,
|
|
40
|
+
placeholder: He,
|
|
41
|
+
title: Le,
|
|
41
42
|
maxLength: Oe,
|
|
42
|
-
inputAttributes:
|
|
43
|
+
inputAttributes: Me,
|
|
43
44
|
topAffix: le,
|
|
44
|
-
startAffix:
|
|
45
|
-
endAffix:
|
|
46
|
-
header:
|
|
45
|
+
startAffix: C,
|
|
46
|
+
endAffix: B,
|
|
47
|
+
header: Ie,
|
|
47
48
|
onChange: R,
|
|
48
49
|
onFocus: X,
|
|
49
50
|
onBlur: Z,
|
|
50
51
|
onPromptAction: J,
|
|
51
52
|
attachments: re,
|
|
52
|
-
loading:
|
|
53
|
-
uploadButtonConfig:
|
|
54
|
-
speechToTextButtonConfig:
|
|
53
|
+
loading: v = b.loading,
|
|
54
|
+
uploadButtonConfig: g = b.uploadButtonConfig,
|
|
55
|
+
speechToTextButtonConfig: O = b.speechToTextButtonConfig,
|
|
55
56
|
actionButtonConfig: M = b.actionButtonConfig,
|
|
56
|
-
className:
|
|
57
|
-
style:
|
|
58
|
-
...
|
|
59
|
-
} =
|
|
57
|
+
className: $e,
|
|
58
|
+
style: ze,
|
|
59
|
+
...je
|
|
60
|
+
} = Se, l = t.useRef(null), [De, I] = t.useState(Pe), [_e, 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
61
|
(e, n) => e ? typeof e == "function" ? e(n) : e : null,
|
|
61
62
|
[]
|
|
62
|
-
), E = se !== void 0, u = E ? se :
|
|
63
|
+
), E = se !== void 0, u = E ? se : De, T = re !== void 0, x = T ? re : _e, j = t.useMemo(
|
|
63
64
|
() => !!(u != null && u.trim() || x.length > 0),
|
|
64
65
|
[u, x.length]
|
|
65
66
|
), w = t.useCallback(() => {
|
|
66
67
|
if (!l.current || s === "single")
|
|
67
68
|
return;
|
|
68
|
-
const e = l.current, n = globalThis.getComputedStyle(e), r = Number.parseFloat(n.lineHeight) ||
|
|
69
|
+
const e = l.current, n = globalThis.getComputedStyle(e), r = Number.parseFloat(n.lineHeight) || ft, i = Number.parseFloat(n.paddingTop) || 0, h = Number.parseFloat(n.paddingBottom) || 0;
|
|
69
70
|
P.current = e.offsetHeight || r + i + h, ce.current = r * S + i + h, s === "auto" && !a && (z.current = e.offsetWidth);
|
|
70
|
-
}, [s, S, a]),
|
|
71
|
+
}, [s, S, a]), We = t.useCallback(() => s === "auto" ? 1 : S, [s, S]), fe = t.useCallback(
|
|
71
72
|
(e) => {
|
|
72
73
|
if (c) {
|
|
73
74
|
const n = Number.parseInt(c, 10);
|
|
@@ -154,7 +155,7 @@ const p = "k-prompt-box", at = 20, ct = 50, b = {
|
|
|
154
155
|
const r = () => {
|
|
155
156
|
clearTimeout(n), n = setTimeout(() => {
|
|
156
157
|
l.current && (s === "auto" && !a && w(), F());
|
|
157
|
-
},
|
|
158
|
+
}, mt);
|
|
158
159
|
}, i = new ResizeObserver(r);
|
|
159
160
|
return i.observe(e), () => {
|
|
160
161
|
i.disconnect(), clearTimeout(n);
|
|
@@ -174,11 +175,11 @@ const p = "k-prompt-box", at = 20, ct = 50, b = {
|
|
|
174
175
|
return u;
|
|
175
176
|
}
|
|
176
177
|
}), [u]);
|
|
177
|
-
t.useImperativeHandle(
|
|
178
|
-
const
|
|
178
|
+
t.useImperativeHandle(Re, m);
|
|
179
|
+
const Ue = t.useCallback(
|
|
179
180
|
(e) => {
|
|
180
181
|
const n = e.target.value;
|
|
181
|
-
!E && !f && I(n), R && !f &&
|
|
182
|
+
!E && !f && I(n), R && !f && L(
|
|
182
183
|
R,
|
|
183
184
|
e,
|
|
184
185
|
{
|
|
@@ -189,21 +190,21 @@ const p = "k-prompt-box", at = 20, ct = 50, b = {
|
|
|
189
190
|
), s !== "single" && F();
|
|
190
191
|
},
|
|
191
192
|
[I, R, f, E, m, s, F]
|
|
192
|
-
),
|
|
193
|
+
), Ve = t.useCallback(
|
|
193
194
|
(e) => {
|
|
194
|
-
X && !f &&
|
|
195
|
+
X && !f && L(X, e, m(), void 0);
|
|
195
196
|
},
|
|
196
197
|
[X, f, m]
|
|
197
|
-
),
|
|
198
|
+
), Ke = t.useCallback(
|
|
198
199
|
(e) => {
|
|
199
|
-
Z && !f &&
|
|
200
|
+
Z && !f && L(Z, e, m(), void 0);
|
|
200
201
|
},
|
|
201
202
|
[Z, f, m]
|
|
202
203
|
), pe = t.useCallback((e) => {
|
|
203
204
|
e.preventDefault();
|
|
204
205
|
}, []), U = t.useCallback(
|
|
205
206
|
(e) => {
|
|
206
|
-
J &&
|
|
207
|
+
J && L(
|
|
207
208
|
J,
|
|
208
209
|
e,
|
|
209
210
|
m(),
|
|
@@ -214,7 +215,7 @@ const p = "k-prompt-box", at = 20, ct = 50, b = {
|
|
|
214
215
|
), E || I(""), T || Q([]);
|
|
215
216
|
},
|
|
216
217
|
[J, m, u, x, E, T]
|
|
217
|
-
),
|
|
218
|
+
), qe = t.useCallback(
|
|
218
219
|
(e) => {
|
|
219
220
|
if (!(e.key === "Enter" && e.shiftKey)) {
|
|
220
221
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
@@ -222,27 +223,27 @@ const p = "k-prompt-box", at = 20, ct = 50, b = {
|
|
|
222
223
|
return;
|
|
223
224
|
}
|
|
224
225
|
if (e.key === "Enter") {
|
|
225
|
-
if (e.preventDefault(),
|
|
226
|
+
if (e.preventDefault(), v)
|
|
226
227
|
return;
|
|
227
228
|
j && U(e);
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
},
|
|
231
|
-
[U,
|
|
232
|
+
[U, v, j]
|
|
232
233
|
), de = {
|
|
233
234
|
disabled: f,
|
|
234
|
-
readOnly:
|
|
235
|
-
placeholder:
|
|
236
|
-
title:
|
|
235
|
+
readOnly: Ne,
|
|
236
|
+
placeholder: He,
|
|
237
|
+
title: Le,
|
|
237
238
|
maxLength: Oe,
|
|
238
|
-
"aria-label":
|
|
239
|
+
"aria-label": y.toLanguageString(Te, A[Te]),
|
|
239
240
|
value: u,
|
|
240
241
|
// let them rewrite kb navigation if needed
|
|
241
|
-
onKeyDown:
|
|
242
|
-
...
|
|
243
|
-
onChange:
|
|
244
|
-
onFocus:
|
|
245
|
-
onBlur:
|
|
242
|
+
onKeyDown: qe,
|
|
243
|
+
...Me,
|
|
244
|
+
onChange: Ue,
|
|
245
|
+
onFocus: Ve,
|
|
246
|
+
onBlur: Ke,
|
|
246
247
|
ref: l
|
|
247
248
|
}, ge = t.useCallback(
|
|
248
249
|
(e) => {
|
|
@@ -257,7 +258,7 @@ const p = "k-prompt-box", at = 20, ct = 50, b = {
|
|
|
257
258
|
target: l.current,
|
|
258
259
|
currentTarget: l.current
|
|
259
260
|
};
|
|
260
|
-
|
|
261
|
+
L(
|
|
261
262
|
R,
|
|
262
263
|
Ce,
|
|
263
264
|
{
|
|
@@ -278,25 +279,25 @@ const p = "k-prompt-box", at = 20, ct = 50, b = {
|
|
|
278
279
|
}, []), be = t.useCallback(
|
|
279
280
|
(e) => {
|
|
280
281
|
var i;
|
|
281
|
-
const n = Array.from(e.affectedFiles), r = typeof
|
|
282
|
+
const n = Array.from(e.affectedFiles), r = typeof g == "object" && g.onSelectAttachments;
|
|
282
283
|
T || Q((h) => [...h, ...n]), r && r({
|
|
283
284
|
selectedFiles: e.affectedFiles,
|
|
284
285
|
allFiles: e.newState
|
|
285
286
|
}), (i = l.current) == null || i.focus();
|
|
286
287
|
},
|
|
287
|
-
[
|
|
288
|
-
),
|
|
288
|
+
[g, T]
|
|
289
|
+
), p = t.useMemo(() => ({
|
|
289
290
|
uploadButtonProps: {
|
|
290
291
|
fillMode: "flat",
|
|
291
|
-
svgIcon:
|
|
292
|
+
svgIcon: st,
|
|
292
293
|
size: "small",
|
|
293
294
|
rounded: "full",
|
|
294
295
|
onClick: he,
|
|
295
296
|
onFilesAdd: be,
|
|
296
297
|
files: x,
|
|
297
298
|
uploadRef: ae,
|
|
298
|
-
"aria-label":
|
|
299
|
-
title:
|
|
299
|
+
"aria-label": y.toLanguageString(G, A[G]),
|
|
300
|
+
title: y.toLanguageString(G, A[G]),
|
|
300
301
|
// Hidden prop to register callback overrides
|
|
301
302
|
_registerRemoveCallback: (e) => {
|
|
302
303
|
$.current = e;
|
|
@@ -311,13 +312,13 @@ const p = "k-prompt-box", at = 20, ct = 50, b = {
|
|
|
311
312
|
actionButtonProps: {
|
|
312
313
|
rounded: "full",
|
|
313
314
|
size: "small",
|
|
314
|
-
svgIcon:
|
|
315
|
-
className:
|
|
315
|
+
svgIcon: v ? nt : ot,
|
|
316
|
+
className: v ? "k-generating k-active" : "",
|
|
316
317
|
onClick: U,
|
|
317
318
|
onMouseDown: pe,
|
|
318
|
-
disabled: !
|
|
319
|
-
"aria-label":
|
|
320
|
-
title:
|
|
319
|
+
disabled: !v && !j,
|
|
320
|
+
"aria-label": v ? y.toLanguageString(K, A[K]) : y.toLanguageString(q, A[q]),
|
|
321
|
+
title: v ? y.toLanguageString(K, A[K]) : y.toLanguageString(q, A[q]),
|
|
321
322
|
"aria-live": "polite"
|
|
322
323
|
}
|
|
323
324
|
}), [
|
|
@@ -326,70 +327,84 @@ const p = "k-prompt-box", at = 20, ct = 50, b = {
|
|
|
326
327
|
x,
|
|
327
328
|
U,
|
|
328
329
|
pe,
|
|
329
|
-
C,
|
|
330
|
-
he,
|
|
331
330
|
v,
|
|
331
|
+
he,
|
|
332
|
+
y,
|
|
332
333
|
j
|
|
333
|
-
]),
|
|
334
|
+
]), Ge = t.useCallback(
|
|
334
335
|
(e) => {
|
|
335
336
|
T || Q((r) => r.filter((i) => i.name !== e));
|
|
336
|
-
const n = typeof
|
|
337
|
+
const n = typeof g == "object" && g.onRemoveAttachment;
|
|
337
338
|
n && ($.current = n), $.current && $.current(e);
|
|
338
339
|
},
|
|
339
|
-
[
|
|
340
|
+
[g, T]
|
|
340
341
|
), Y = () => {
|
|
341
|
-
const e =
|
|
342
|
+
const e = O !== !1, n = M !== !1, r = g !== !1, i = typeof O == "object" ? O : void 0, h = typeof g == "object" ? g : {}, {
|
|
342
343
|
restrictions: ee,
|
|
343
344
|
multiple: V = !0,
|
|
344
345
|
accept: H,
|
|
345
346
|
onSelectAttachments: Ce,
|
|
346
|
-
onRemoveAttachment:
|
|
347
|
-
...
|
|
348
|
-
} = h, te = { restrictions: ee, multiple: V, accept: H },
|
|
347
|
+
onRemoveAttachment: pt,
|
|
348
|
+
...Ze
|
|
349
|
+
} = h, te = { restrictions: ee, multiple: V, accept: H }, ke = typeof M == "object" ? M : void 0, Je = ct(
|
|
350
|
+
ke,
|
|
351
|
+
v,
|
|
352
|
+
p.actionButtonProps["aria-label"],
|
|
353
|
+
y
|
|
354
|
+
), Qe = {
|
|
355
|
+
...ke,
|
|
356
|
+
...Je
|
|
357
|
+
};
|
|
349
358
|
return /* @__PURE__ */ t.createElement(t.Fragment, null, r && /* @__PURE__ */ t.createElement(
|
|
350
|
-
|
|
359
|
+
it,
|
|
351
360
|
{
|
|
352
|
-
...
|
|
361
|
+
...p.uploadButtonProps,
|
|
353
362
|
restrictions: te.restrictions,
|
|
354
363
|
multiple: te.multiple,
|
|
355
364
|
accept: te.accept,
|
|
356
|
-
...
|
|
365
|
+
...Ze
|
|
357
366
|
}
|
|
358
367
|
), e && /* @__PURE__ */ t.createElement(
|
|
359
|
-
|
|
368
|
+
rt,
|
|
360
369
|
{
|
|
361
|
-
...
|
|
370
|
+
...p.speechToTextButtonProps,
|
|
362
371
|
...i
|
|
363
372
|
}
|
|
364
|
-
), n && /* @__PURE__ */ t.createElement(
|
|
365
|
-
|
|
373
|
+
), n && /* @__PURE__ */ t.createElement(
|
|
374
|
+
lt,
|
|
375
|
+
{
|
|
376
|
+
...p.actionButtonProps,
|
|
377
|
+
...Qe
|
|
378
|
+
}
|
|
379
|
+
));
|
|
380
|
+
}, ye = s === "multi" || s === "auto" && a, Be = g !== !1 || O !== !1 || M !== !1, ve = B || Be, Xe = C || B || Be;
|
|
366
381
|
return /* @__PURE__ */ t.createElement(
|
|
367
382
|
"div",
|
|
368
383
|
{
|
|
369
|
-
...
|
|
370
|
-
className: ne(
|
|
384
|
+
...je,
|
|
385
|
+
className: ne($e, "k-input", d, {
|
|
371
386
|
[`k-input-${oe}`]: oe,
|
|
372
387
|
"k-disabled": f,
|
|
373
388
|
"k-prompt-box-singleline": s === "single",
|
|
374
389
|
"k-prompt-box-multiline": ye
|
|
375
390
|
}),
|
|
376
|
-
style:
|
|
391
|
+
style: ze
|
|
377
392
|
},
|
|
378
|
-
/* @__PURE__ */ t.createElement(
|
|
379
|
-
s === "single" ? /* @__PURE__ */ t.createElement("div", { className: `${
|
|
393
|
+
/* @__PURE__ */ t.createElement(at, { files: x, onRemoveFile: Ge, header: Ie }),
|
|
394
|
+
s === "single" ? /* @__PURE__ */ t.createElement("div", { className: `${d}-content` }, C && /* @__PURE__ */ t.createElement("div", { className: `${d}-affix` }, k(C, p)), /* @__PURE__ */ t.createElement("input", { ...de, className: ne("k-input-inner", `${d}-input`) }), ve ? /* @__PURE__ */ t.createElement("div", { className: `${d}-affix` }, B && k(B, p), Y()) : null) : /* @__PURE__ */ t.createElement("div", { className: `${d}-content` }, s === "multi" && le && /* @__PURE__ */ t.createElement("div", { className: `${d}-affix` }, k(le, p)), s === "auto" && !a && C && /* @__PURE__ */ t.createElement("div", { className: `${d}-affix` }, k(C, p)), /* @__PURE__ */ t.createElement(
|
|
380
395
|
"textarea",
|
|
381
396
|
{
|
|
382
397
|
...de,
|
|
383
|
-
className: ne("k-input-inner", `${
|
|
384
|
-
rows:
|
|
398
|
+
className: ne("k-input-inner", `${d}-textarea`),
|
|
399
|
+
rows: We(),
|
|
385
400
|
style: c ? { maxHeight: c } : {},
|
|
386
401
|
"aria-multiline": "true"
|
|
387
402
|
}
|
|
388
|
-
), s === "auto" && !a &&
|
|
389
|
-
|
|
403
|
+
), s === "auto" && !a && ve ? /* @__PURE__ */ t.createElement("div", { className: `${d}-affix` }, B && k(B, p), Y()) : null, ye && Xe ? /* @__PURE__ */ t.createElement("div", { className: `${d}-affix` }, C && k(C, p), (C || B) && /* @__PURE__ */ t.createElement("div", { className: "k-spacer" }), B && k(B, p), Y()) : null),
|
|
404
|
+
we && /* @__PURE__ */ t.createElement(tt, { message: Fe })
|
|
390
405
|
);
|
|
391
406
|
});
|
|
392
|
-
|
|
407
|
+
xe.propTypes = {
|
|
393
408
|
value: o.string,
|
|
394
409
|
defaultValue: o.string,
|
|
395
410
|
mode: o.oneOf(["single", "multi", "auto"]),
|
|
@@ -418,7 +433,7 @@ Te.propTypes = {
|
|
|
418
433
|
className: o.string,
|
|
419
434
|
style: o.object
|
|
420
435
|
};
|
|
421
|
-
|
|
436
|
+
xe.displayName = "KendoPromptBox";
|
|
422
437
|
export {
|
|
423
|
-
|
|
438
|
+
xe as PromptBox
|
|
424
439
|
};
|
|
@@ -11,6 +11,27 @@ import * as React from 'react';
|
|
|
11
11
|
* Represents the props of the PromptBoxActionButton component.
|
|
12
12
|
*/
|
|
13
13
|
export interface PromptBoxActionButtonProps extends ButtonProps {
|
|
14
|
+
/**
|
|
15
|
+
* Specifies the text content of the Action button.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <PromptBox actionButtonConfig={{ text: 'Send' }} />
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* When omitted, PromptBox uses the `promptBox.sendButtonText` localization
|
|
23
|
+
* message, which can be configured with `loadMessages`.
|
|
24
|
+
* An explicit `text` value takes precedence over the localized message.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* loadMessages({ promptBox: { sendButtonText: 'Enviar' } }, 'es');
|
|
29
|
+
* <LocalizationProvider language="es">
|
|
30
|
+
* <PromptBox />
|
|
31
|
+
* </LocalizationProvider>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
text?: string;
|
|
14
35
|
}
|
|
15
36
|
/**
|
|
16
37
|
* Represents the PromptBox Action Button component.
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),s=require("@progress/kendo-react-buttons");function d(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const c=d(l),u=c.forwardRef((t,o)=>{const{text:e,children:n,...a}=t,r=e!==void 0?e:n,i=r===""||r===null||typeof r=="boolean"?void 0:r;return c.createElement(s.Button,{ref:o,...a},i)});u.displayName="PromptBoxActionButton";exports.PromptBoxActionButton=u;
|
|
@@ -5,10 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { Button as
|
|
10
|
-
const
|
|
11
|
-
m
|
|
8
|
+
import * as n from "react";
|
|
9
|
+
import { Button as p } from "@progress/kendo-react-buttons";
|
|
10
|
+
const a = n.forwardRef((e, r) => {
|
|
11
|
+
const { text: o, children: c, ...i } = e, t = o !== void 0 ? o : c, m = t === "" || t === null || typeof t == "boolean" ? void 0 : t;
|
|
12
|
+
return /* @__PURE__ */ n.createElement(p, { ref: r, ...i }, m);
|
|
13
|
+
});
|
|
14
|
+
a.displayName = "PromptBoxActionButton";
|
|
12
15
|
export {
|
|
13
|
-
|
|
16
|
+
a as PromptBoxActionButton
|
|
14
17
|
};
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { ButtonProps, SpeechToTextButtonProps } from '@progress/kendo-react-buttons';
|
|
9
9
|
import { UploadProps, UploadFileInfo } from '@progress/kendo-react-upload';
|
|
10
10
|
import { PromptBoxBlurEvent, PromptBoxChangeEvent, PromptBoxFocusEvent, PromptBoxPromptActionEvent, PromptBoxSelectAttachmentsEvent } from '../Events';
|
|
11
|
+
import { PromptBoxActionButtonProps } from '../PromptBoxActionButton.js';
|
|
11
12
|
import * as React from 'react';
|
|
12
13
|
/**
|
|
13
14
|
* Props passed to affix render functions.
|
|
@@ -342,7 +343,7 @@ export interface PromptBoxProps extends Omit<React.HTMLAttributes<HTMLDivElement
|
|
|
342
343
|
* />
|
|
343
344
|
* ```
|
|
344
345
|
*/
|
|
345
|
-
actionButtonConfig?: boolean |
|
|
346
|
+
actionButtonConfig?: boolean | PromptBoxActionButtonProps;
|
|
346
347
|
/**
|
|
347
348
|
* Fires when the user clicks the Action button.
|
|
348
349
|
* The event provides the current value and attachments, allowing simple uncontrolled usage.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 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 { LocalizationService } from '@progress/kendo-react-intl';
|
|
9
|
+
import { PromptBoxActionButtonProps } from './PromptBoxActionButton.js';
|
|
10
|
+
interface ResolvedActionButtonLabels {
|
|
11
|
+
text?: string;
|
|
12
|
+
'aria-label'?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*
|
|
17
|
+
* Resolves the action button's visible text and accessible name.
|
|
18
|
+
*
|
|
19
|
+
* While loading, the button stays icon-only and keeps the default (stop action) aria-label.
|
|
20
|
+
* Otherwise, explicit `text`/`aria-label` from config win; text falls back to the localized
|
|
21
|
+
* send message, and aria-label falls back to the resolved text, then to the default label.
|
|
22
|
+
*/
|
|
23
|
+
export declare const resolveActionButtonLabels: (actionButtonPropsFromConfig: PromptBoxActionButtonProps | undefined, loading: boolean, defaultAriaLabel: string | undefined, localizationService: LocalizationService) => ResolvedActionButtonLabels;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 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 s=require("../messages/index.js"),o=(e,v,x,n)=>{var r;const{text:t,"aria-label":l}=e!=null?e:{text:void 0,"aria-label":void 0},d=v?void 0:t!=null?t:n.toLanguageString(s.promptBoxSendButtonText,s.messages[s.promptBoxSendButtonText]),a=d!==""?d:void 0;return{text:a,"aria-label":(r=l!=null?l:a)!=null?r:x}};exports.resolveActionButtonLabels=o;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 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 { promptBoxSendButtonText as x, messages as A } from "../messages/index.mjs";
|
|
9
|
+
const c = (e, a, b, r) => {
|
|
10
|
+
var v;
|
|
11
|
+
const { text: t, "aria-label": l } = e != null ? e : {
|
|
12
|
+
text: void 0,
|
|
13
|
+
"aria-label": void 0
|
|
14
|
+
}, d = a ? void 0 : t != null ? t : r.toLanguageString(x, A[x]), s = d !== "" ? d : void 0;
|
|
15
|
+
return {
|
|
16
|
+
text: s,
|
|
17
|
+
"aria-label": (v = l != null ? l : s) != null ? v : b
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
c as resolveActionButtonLabels
|
|
22
|
+
};
|