@epam/ai-dial-conversation-messages 1.1.0-dev.124 → 1.1.0-dev.125
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/index.js +89 -89
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, CopyIconButton as n, DeploymentIcon as r, MDMessageViewer as i, MIME_TYPE_EXT_MAP as a, MessageRating as o, MessageRole as s, RequestStatus as c, ResponseFormat as l, buildCssVars as u, mergeClasses as d, useCollapsedText as f } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { DIAL_ICON_SIZE as p,
|
|
2
|
+
import { DIAL_ICON_SIZE as p, DialPopup as m, DialRadioGroup as h, DialSkeleton as g, DialSkeletonVariant as _, DialSlider as v, DialTooltip as y, ElementSize as b, GhostIconButton as x, Highlight as S, InfoMessageNotification as C, Input as w, LinkButton as T, NeutralButton as E, PopupSize as D, PrimaryButton as O, RadioGroupOrientation as k, Spinner as A, StaticIconButton as j } from "@epam/ai-dial-ui-kit";
|
|
3
3
|
import { IconChevronDown as M, IconChevronUp as N, IconClipboard as P, IconDownload as F, IconExternalLink as I, IconFile as L, IconFileTypeBmp as R, IconFileTypeCss as z, IconFileTypeCsv as B, IconFileTypeDoc as V, IconFileTypeDocx as H, IconFileTypeHtml as U, IconFileTypeJpg as W, IconFileTypeJs as ee, IconFileTypeJsx as te, IconFileTypePdf as ne, IconFileTypePhp as re, IconFileTypePng as ie, IconFileTypePpt as ae, IconFileTypeRs as oe, IconFileTypeSql as se, IconFileTypeSvg as ce, IconFileTypeTs as le, IconFileTypeTsx as ue, IconFileTypeTxt as de, IconFileTypeVue as fe, IconFileTypeXls as pe, IconFileTypeXml as me, IconFileTypeZip as he, IconMarkdown as ge, IconMusic as _e, IconPaperclip as ve, IconPencilMinus as ye, IconPhoto as G, IconRefresh as be, IconReload as xe, IconTerminal2 as Se, IconThumbDown as Ce, IconThumbUp as we, IconTrashX as Te, IconVideo as Ee, IconX as De } from "@tabler/icons-react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
import { memo as Oe, useCallback as K, useEffect as ke, useId as Ae, useMemo as je, useRef as Me, useState as q } from "react";
|
|
@@ -100,7 +100,7 @@ var Ne = (e) => {
|
|
|
100
100
|
imageActionButton: "_imageActionButton_3jao2_47"
|
|
101
101
|
}, Q = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ Y(j, {
|
|
102
102
|
icon: a,
|
|
103
|
-
size:
|
|
103
|
+
size: b.Small,
|
|
104
104
|
className: d("absolute end-1 top-1 opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", Z.actionButton, o),
|
|
105
105
|
"aria-label": e,
|
|
106
106
|
"aria-describedby": t ? n : void 0,
|
|
@@ -136,14 +136,14 @@ var Ne = (e) => {
|
|
|
136
136
|
[e.Network]: "Upload failed · network error",
|
|
137
137
|
[e.UnsupportedType]: "Upload failed · unsupported file type"
|
|
138
138
|
}, Ge = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: a, styles: o, onDownload: s, isPasted: l, isLink: u, cssVars: f, onExpand: p, isExpandable: m, onRemove: h, isSelected: g }) => {
|
|
139
|
-
let { clickLabel: _ = "Download attachment", retryLabel: v = "Retry upload", sizeLabel: y, uploadingLabel:
|
|
139
|
+
let { clickLabel: _ = "Download attachment", retryLabel: v = "Retry upload", sizeLabel: y, uploadingLabel: b = "Uploading", errorReasonLabels: x, genericErrorLabel: C = "Upload failed" } = a ?? {}, { typography: w, className: T } = o ?? {}, { id: E, name: D, status: O, errorReason: k } = t, j = O === c.Loading, M = O === c.Error, N = Ae(), P = M ? k && (x?.[k] ?? We[k]) || C : "", { BottomIcon: F, typeLabel: I } = Re(t), L = !M && !j && s && !u, R = M && !!i && k !== e.UnsupportedType, z = L || R ? "pe-5" : void 0, B = (e) => {
|
|
140
140
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(t.id));
|
|
141
|
-
}, V = je(() => l ?
|
|
141
|
+
}, V = je(() => l ? D : Ne(D), [l, D]), H = K(() => {
|
|
142
142
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
143
143
|
}, [t]), U = d(ze, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", Z.tile, !M && Z.hovered, g && Z.selected, M && Z.tileError), W = /* @__PURE__ */ Y("div", {
|
|
144
144
|
title: V,
|
|
145
|
-
className: d(
|
|
146
|
-
children: n ? /* @__PURE__ */ Y(
|
|
145
|
+
className: d(w?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all", Z.nameText, !M && z),
|
|
146
|
+
children: n ? /* @__PURE__ */ Y(S, {
|
|
147
147
|
text: V,
|
|
148
148
|
query: n,
|
|
149
149
|
maxLines: 2
|
|
@@ -155,18 +155,18 @@ var Ne = (e) => {
|
|
|
155
155
|
className: Z.typeText,
|
|
156
156
|
"aria-hidden": !0
|
|
157
157
|
}), /* @__PURE__ */ Y("span", {
|
|
158
|
-
className: d(
|
|
158
|
+
className: d(w?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Z.typeText),
|
|
159
159
|
children: y ? `${I} · ${y}` : I
|
|
160
160
|
})]
|
|
161
161
|
}), te = () => {
|
|
162
|
-
m && p ? p(
|
|
162
|
+
m && p ? p(E) : r && r(E);
|
|
163
163
|
}, ne = /* @__PURE__ */ X(J, { children: [
|
|
164
164
|
W,
|
|
165
165
|
ee,
|
|
166
166
|
j && /* @__PURE__ */ Y("div", {
|
|
167
|
-
"aria-label":
|
|
167
|
+
"aria-label": b,
|
|
168
168
|
className: d("absolute left-[-1px] top-[-1px] flex size-full items-center justify-center rounded", Z.track),
|
|
169
|
-
children: /* @__PURE__ */ Y(
|
|
169
|
+
children: /* @__PURE__ */ Y(A, { size: 32 })
|
|
170
170
|
}),
|
|
171
171
|
/* @__PURE__ */ X("div", {
|
|
172
172
|
className: d("absolute right-0 top-0 flex gap-1"),
|
|
@@ -176,14 +176,14 @@ var Ne = (e) => {
|
|
|
176
176
|
errorTitle: P,
|
|
177
177
|
errorDescId: N,
|
|
178
178
|
onClick: s,
|
|
179
|
-
id:
|
|
179
|
+
id: E
|
|
180
180
|
}),
|
|
181
181
|
R && /* @__PURE__ */ Y(Be, {
|
|
182
182
|
ariaLabel: v,
|
|
183
183
|
errorTitle: P,
|
|
184
184
|
errorDescId: N,
|
|
185
185
|
onClick: i,
|
|
186
|
-
id:
|
|
186
|
+
id: E
|
|
187
187
|
}),
|
|
188
188
|
u && /* @__PURE__ */ Y(He, {
|
|
189
189
|
ariaLabel: v,
|
|
@@ -196,7 +196,7 @@ var Ne = (e) => {
|
|
|
196
196
|
errorTitle: P,
|
|
197
197
|
errorDescId: N,
|
|
198
198
|
onClick: h,
|
|
199
|
-
id:
|
|
199
|
+
id: E
|
|
200
200
|
})
|
|
201
201
|
]
|
|
202
202
|
}),
|
|
@@ -210,7 +210,7 @@ var Ne = (e) => {
|
|
|
210
210
|
] });
|
|
211
211
|
return /* @__PURE__ */ Y("div", {
|
|
212
212
|
style: f,
|
|
213
|
-
className: d("inline-flex",
|
|
213
|
+
className: d("inline-flex", T),
|
|
214
214
|
children: /* @__PURE__ */ Y("div", {
|
|
215
215
|
role: "button",
|
|
216
216
|
tabIndex: 0,
|
|
@@ -240,7 +240,7 @@ var Ne = (e) => {
|
|
|
240
240
|
imageLoadStatus: r
|
|
241
241
|
};
|
|
242
242
|
}, Je = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c, isSelected: l }) => {
|
|
243
|
-
let { clickLabel: u = "Open attachment", expandLabel: f = "Expand pasted text" } = i ?? {}, { className: m } = c ?? {}, { id: h, name:
|
|
243
|
+
let { clickLabel: u = "Open attachment", expandLabel: f = "Expand pasted text" } = i ?? {}, { className: m } = c ?? {}, { id: h, name: v } = e, y = e.previewUrl ?? e.url, b = e.type === t.Pasted && n !== void 0, { isLoading: x, isError: S, isImage: C } = je(() => Re(e), [e]), w = r !== void 0 && !b && !x && !S, { imageRef: T, imageLoadStatus: E } = qe({
|
|
244
244
|
enabled: C,
|
|
245
245
|
src: y
|
|
246
246
|
}), D = () => {
|
|
@@ -269,8 +269,8 @@ var Ne = (e) => {
|
|
|
269
269
|
id: h,
|
|
270
270
|
className: Z.imageActionButton
|
|
271
271
|
}),
|
|
272
|
-
E !== Ke.Loaded && /* @__PURE__ */ Y(
|
|
273
|
-
variant:
|
|
272
|
+
E !== Ke.Loaded && /* @__PURE__ */ Y(g, {
|
|
273
|
+
variant: _.Rectangular,
|
|
274
274
|
width: "100%",
|
|
275
275
|
height: "100%",
|
|
276
276
|
active: E === Ke.Loading,
|
|
@@ -284,7 +284,7 @@ var Ne = (e) => {
|
|
|
284
284
|
/* @__PURE__ */ Y("img", {
|
|
285
285
|
ref: T,
|
|
286
286
|
src: y,
|
|
287
|
-
alt:
|
|
287
|
+
alt: v,
|
|
288
288
|
loading: "lazy",
|
|
289
289
|
decoding: "async",
|
|
290
290
|
className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200", E === Ke.Loaded ? "opacity-100" : "opacity-0")
|
|
@@ -340,7 +340,7 @@ var Ne = (e) => {
|
|
|
340
340
|
headerIcon: "_headerIcon_1dmgi_1",
|
|
341
341
|
headerLabel: "_headerLabel_1dmgi_2"
|
|
342
342
|
}, Ze = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Qe = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o, selectedAttachmentId: s }) => {
|
|
343
|
-
let { ariaLabel: l = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: h = "Download all", openInNewTabLabel: g, getHeaderLabel: _ = (e) => Ze(e, "attachment"), promptLabel: v, pastedLabel: y, imageLabel:
|
|
343
|
+
let { ariaLabel: l = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: h = "Download all", openInNewTabLabel: g, getHeaderLabel: _ = (e) => Ze(e, "attachment"), promptLabel: v, pastedLabel: y, imageLabel: S } = a ?? {}, { typography: C, colors: w, className: T } = o ?? {}, E = u({ "--ai-group-text": w?.text });
|
|
344
344
|
if (e.length === 0) return null;
|
|
345
345
|
let D = e.some((e) => e.type === t.Image), O = e.some((e) => e.type !== t.Image), k = D && O, A = e.length >= 5, j = k ? ve : D ? G : L, M = _(e.length), N = () => {
|
|
346
346
|
let t = e.filter((e) => e.status === c.Idle);
|
|
@@ -363,15 +363,15 @@ var Ne = (e) => {
|
|
|
363
363
|
className: d("shrink-0", Xe.headerIcon),
|
|
364
364
|
"aria-hidden": !0
|
|
365
365
|
}), /* @__PURE__ */ Y("span", {
|
|
366
|
-
className: d(
|
|
366
|
+
className: d(C?.headerLabelClassName ?? "dial-tiny-semi-text", Xe.headerLabel),
|
|
367
367
|
children: M
|
|
368
368
|
})]
|
|
369
|
-
}), e.length >= 2 && (r || n) && /* @__PURE__ */ Y(
|
|
369
|
+
}), e.length >= 2 && (r || n) && /* @__PURE__ */ Y(x, {
|
|
370
370
|
icon: /* @__PURE__ */ Y(F, {
|
|
371
371
|
size: p.SM,
|
|
372
372
|
"aria-hidden": !0
|
|
373
373
|
}),
|
|
374
|
-
size:
|
|
374
|
+
size: b.Small,
|
|
375
375
|
"aria-label": h,
|
|
376
376
|
onClick: N
|
|
377
377
|
})]
|
|
@@ -391,7 +391,7 @@ var Ne = (e) => {
|
|
|
391
391
|
retryLabel: m,
|
|
392
392
|
promptLabel: v,
|
|
393
393
|
pastedLabel: y,
|
|
394
|
-
imageLabel:
|
|
394
|
+
imageLabel: S,
|
|
395
395
|
openInNewTabLabel: g
|
|
396
396
|
},
|
|
397
397
|
isSelected: e.id === s
|
|
@@ -432,21 +432,21 @@ var Ne = (e) => {
|
|
|
432
432
|
a
|
|
433
433
|
])
|
|
434
434
|
};
|
|
435
|
-
}, et = { label: "_label_14i7c_1" }, tt = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: a, onTemperatureChange: o, responseFormatLabel: s = "Response format", responseFormatHint: c = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: p = "Plain text", systemPromptLabel:
|
|
435
|
+
}, et = { label: "_label_14i7c_1" }, tt = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: a, onTemperatureChange: o, responseFormatLabel: s = "Response format", responseFormatHint: c = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: p = "Plain text", systemPromptLabel: m = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: y = [
|
|
436
436
|
"Precise",
|
|
437
437
|
"Neutral",
|
|
438
438
|
"Creative"
|
|
439
|
-
], temperatureHint:
|
|
440
|
-
let
|
|
439
|
+
], temperatureHint: b, labelClassName: x = "!dial-small-semi-text", colors: S }) => {
|
|
440
|
+
let C = u({ "--csf-label-text": S?.labelText }), T = d(x, et.label, "gap-1");
|
|
441
441
|
return /* @__PURE__ */ X("div", {
|
|
442
442
|
className: "flex flex-col gap-4 px-6 py-3",
|
|
443
|
-
style:
|
|
443
|
+
style: C,
|
|
444
444
|
children: [
|
|
445
|
-
e.responseFormat && /* @__PURE__ */ Y(
|
|
445
|
+
e.responseFormat && /* @__PURE__ */ Y(h, {
|
|
446
446
|
fieldTitle: s,
|
|
447
447
|
labelClassName: T,
|
|
448
448
|
elementId: "response-format",
|
|
449
|
-
orientation:
|
|
449
|
+
orientation: k.Column,
|
|
450
450
|
activeRadioButton: t ?? l.Markdown,
|
|
451
451
|
labelDescription: c,
|
|
452
452
|
radioButtons: [{
|
|
@@ -458,33 +458,33 @@ var Ne = (e) => {
|
|
|
458
458
|
}],
|
|
459
459
|
onChange: (e) => i(e)
|
|
460
460
|
}),
|
|
461
|
-
e.systemPrompt && /* @__PURE__ */ Y(
|
|
461
|
+
e.systemPrompt && /* @__PURE__ */ Y(w, {
|
|
462
462
|
value: n,
|
|
463
|
-
placeholder:
|
|
463
|
+
placeholder: g,
|
|
464
464
|
labelProps: {
|
|
465
465
|
className: T,
|
|
466
|
-
label:
|
|
466
|
+
label: m
|
|
467
467
|
},
|
|
468
468
|
onChange: (e) => a(e ?? "")
|
|
469
469
|
}),
|
|
470
|
-
e.temperature && /* @__PURE__ */ Y(
|
|
470
|
+
e.temperature && /* @__PURE__ */ Y(v, {
|
|
471
471
|
labelProps: {
|
|
472
|
-
label:
|
|
472
|
+
label: _,
|
|
473
473
|
className: T,
|
|
474
|
-
caption:
|
|
474
|
+
caption: b
|
|
475
475
|
},
|
|
476
476
|
value: r,
|
|
477
477
|
min: 0,
|
|
478
478
|
max: 1,
|
|
479
479
|
step: .1,
|
|
480
|
-
labels:
|
|
480
|
+
labels: y,
|
|
481
481
|
onChange: o
|
|
482
482
|
})
|
|
483
483
|
]
|
|
484
484
|
});
|
|
485
485
|
}, nt = { modal: "_modal_od073_1" };
|
|
486
|
-
Oe(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels:
|
|
487
|
-
let { responseFormat:
|
|
486
|
+
Oe(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: h, temperatureHint: g, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: b = nt.modal }) => {
|
|
487
|
+
let { responseFormat: x, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: T, setSystemPrompt: E, setTemperature: k, handleSubmit: A } = $e({
|
|
488
488
|
features: e,
|
|
489
489
|
initialResponseFormat: t,
|
|
490
490
|
initialSystemPrompt: n,
|
|
@@ -492,18 +492,18 @@ Oe(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
492
492
|
onSave: i,
|
|
493
493
|
onClose: a
|
|
494
494
|
});
|
|
495
|
-
return /* @__PURE__ */ Y(
|
|
495
|
+
return /* @__PURE__ */ Y(m, {
|
|
496
496
|
open: !0,
|
|
497
497
|
header: o,
|
|
498
|
-
size:
|
|
498
|
+
size: D.Sm,
|
|
499
499
|
onClose: a,
|
|
500
|
-
className:
|
|
500
|
+
className: b,
|
|
501
501
|
footer: /* @__PURE__ */ Y("div", {
|
|
502
502
|
className: "flex justify-end px-6 py-4",
|
|
503
|
-
children: /* @__PURE__ */ Y(
|
|
503
|
+
children: /* @__PURE__ */ Y(y, {
|
|
504
504
|
tooltip: v,
|
|
505
505
|
hideTooltip: w || !v,
|
|
506
|
-
children: /* @__PURE__ */ Y(
|
|
506
|
+
children: /* @__PURE__ */ Y(O, {
|
|
507
507
|
label: _,
|
|
508
508
|
onClick: A,
|
|
509
509
|
disabled: !w
|
|
@@ -512,12 +512,12 @@ Oe(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
512
512
|
}),
|
|
513
513
|
children: /* @__PURE__ */ Y(tt, {
|
|
514
514
|
features: e,
|
|
515
|
-
responseFormat:
|
|
515
|
+
responseFormat: x,
|
|
516
516
|
systemPrompt: S,
|
|
517
517
|
temperature: C,
|
|
518
518
|
onResponseFormatChange: T,
|
|
519
519
|
onSystemPromptChange: E,
|
|
520
|
-
onTemperatureChange:
|
|
520
|
+
onTemperatureChange: k,
|
|
521
521
|
responseFormatLabel: s,
|
|
522
522
|
responseFormatHint: c,
|
|
523
523
|
responseFormatMarkdownLabel: l,
|
|
@@ -525,20 +525,20 @@ Oe(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
525
525
|
systemPromptLabel: d,
|
|
526
526
|
systemPromptTooltip: f,
|
|
527
527
|
temperatureLabel: p,
|
|
528
|
-
temperatureLabels:
|
|
528
|
+
temperatureLabels: h,
|
|
529
529
|
temperatureHint: g
|
|
530
530
|
})
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e = s.User, onEdit: t, onEditHover: r, onDelete: i, onRegenerate: a, onCopy: c, onCopyMarkdown: l, onLike: f, onDislike: m, activeRating: h, isAlwaysVisible: g, className: _, labels: v, colors: y }) => {
|
|
534
|
-
let { tooltips:
|
|
535
|
-
c?.(), T("copy"), D(
|
|
536
|
-
}, [c,
|
|
537
|
-
l?.(), T("markdown"), D(
|
|
538
|
-
}, [l,
|
|
534
|
+
let { tooltips: S, ariaLabels: C } = v ?? {}, [w, T] = q(null), [E, D] = q(""), O = u({ "--ma-active-rating-text": y?.activeRatingText }), k = K(() => {
|
|
535
|
+
c?.(), T("copy"), D(C?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => T(null), it);
|
|
536
|
+
}, [c, C?.copiedStatus]), A = K(() => {
|
|
537
|
+
l?.(), T("markdown"), D(C?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => T(null), it);
|
|
538
|
+
}, [l, C?.copiedMarkdownStatus]);
|
|
539
539
|
return /* @__PURE__ */ X("div", {
|
|
540
540
|
role: "toolbar",
|
|
541
|
-
"aria-label":
|
|
541
|
+
"aria-label": C?.actionsGroup ?? "Message actions",
|
|
542
542
|
style: O,
|
|
543
543
|
className: d("flex gap-1", !g && "opacity-0 group-hover:opacity-100", _),
|
|
544
544
|
children: [/* @__PURE__ */ Y("span", {
|
|
@@ -546,81 +546,81 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
546
546
|
"aria-live": "polite",
|
|
547
547
|
className: "sr-only",
|
|
548
548
|
children: E
|
|
549
|
-
}), e === s.User ? /* @__PURE__ */ X(J, { children: [t && /* @__PURE__ */ Y(
|
|
549
|
+
}), e === s.User ? /* @__PURE__ */ X(J, { children: [t && /* @__PURE__ */ Y(x, {
|
|
550
550
|
icon: /* @__PURE__ */ Y(ye, {
|
|
551
551
|
size: p.SM,
|
|
552
552
|
"aria-hidden": !0
|
|
553
553
|
}),
|
|
554
|
-
size:
|
|
555
|
-
"aria-label":
|
|
556
|
-
tooltipProps: { tooltip:
|
|
554
|
+
size: b.Small,
|
|
555
|
+
"aria-label": C?.editMessage ?? "Edit message",
|
|
556
|
+
tooltipProps: { tooltip: S?.edit ?? "Edit" },
|
|
557
557
|
onClick: t,
|
|
558
558
|
onMouseEnter: r,
|
|
559
559
|
onFocus: r
|
|
560
|
-
}), i && /* @__PURE__ */ Y(
|
|
560
|
+
}), i && /* @__PURE__ */ Y(x, {
|
|
561
561
|
icon: /* @__PURE__ */ Y(Te, {
|
|
562
562
|
size: p.SM,
|
|
563
563
|
"aria-hidden": !0
|
|
564
564
|
}),
|
|
565
|
-
size:
|
|
566
|
-
"aria-label":
|
|
567
|
-
tooltipProps: { tooltip:
|
|
565
|
+
size: b.Small,
|
|
566
|
+
"aria-label": C?.deleteMessage ?? "Delete message",
|
|
567
|
+
tooltipProps: { tooltip: S?.delete ?? "Delete" },
|
|
568
568
|
onClick: i
|
|
569
569
|
})] }) : /* @__PURE__ */ X(J, { children: [
|
|
570
|
-
a && /* @__PURE__ */ Y(
|
|
570
|
+
a && /* @__PURE__ */ Y(x, {
|
|
571
571
|
icon: /* @__PURE__ */ Y(be, {
|
|
572
572
|
size: p.SM,
|
|
573
573
|
"aria-hidden": !0
|
|
574
574
|
}),
|
|
575
|
-
size:
|
|
576
|
-
"aria-label":
|
|
577
|
-
tooltipProps: { tooltip:
|
|
575
|
+
size: b.Small,
|
|
576
|
+
"aria-label": C?.regenerateResponse ?? "Regenerate response",
|
|
577
|
+
tooltipProps: { tooltip: S?.regenerate ?? "Regenerate" },
|
|
578
578
|
onClick: a
|
|
579
579
|
}),
|
|
580
580
|
c && /* @__PURE__ */ Y(n, {
|
|
581
581
|
iconSize: p.SM,
|
|
582
582
|
onClick: k,
|
|
583
|
-
size:
|
|
583
|
+
size: b.Small,
|
|
584
584
|
isCopied: w === "copy",
|
|
585
|
-
copyLabel:
|
|
586
|
-
copiedLabel:
|
|
587
|
-
ariaLabel:
|
|
585
|
+
copyLabel: S?.copy ?? "Copy",
|
|
586
|
+
copiedLabel: S?.copied ?? "Copied!",
|
|
587
|
+
ariaLabel: C?.copyResponse ?? "Copy response"
|
|
588
588
|
}),
|
|
589
589
|
l && /* @__PURE__ */ Y(n, {
|
|
590
590
|
iconSize: p.SM,
|
|
591
591
|
onClick: A,
|
|
592
|
-
size:
|
|
592
|
+
size: b.Small,
|
|
593
593
|
isCopied: w === "markdown",
|
|
594
594
|
iconCopy: /* @__PURE__ */ Y(ge, {
|
|
595
595
|
size: p.SM,
|
|
596
596
|
"aria-hidden": !0
|
|
597
597
|
}),
|
|
598
|
-
copyLabel:
|
|
599
|
-
copiedLabel:
|
|
600
|
-
ariaLabel:
|
|
598
|
+
copyLabel: S?.copyMarkdown ?? "Copy as Markdown",
|
|
599
|
+
copiedLabel: S?.copiedMarkdown ?? "Copied!",
|
|
600
|
+
ariaLabel: C?.copyAsMarkdown ?? "Copy as markdown"
|
|
601
601
|
}),
|
|
602
|
-
f && /* @__PURE__ */ Y(
|
|
602
|
+
f && /* @__PURE__ */ Y(x, {
|
|
603
603
|
icon: /* @__PURE__ */ Y(we, {
|
|
604
604
|
size: p.SM,
|
|
605
605
|
"aria-hidden": !0
|
|
606
606
|
}),
|
|
607
|
-
size:
|
|
608
|
-
"aria-label":
|
|
607
|
+
size: b.Small,
|
|
608
|
+
"aria-label": C?.likeResponse ?? "Like response",
|
|
609
609
|
"aria-pressed": h === o.Like,
|
|
610
610
|
className: h === o.Like ? rt.activeRating : void 0,
|
|
611
|
-
tooltipProps: { tooltip:
|
|
611
|
+
tooltipProps: { tooltip: S?.like ?? "Like" },
|
|
612
612
|
onClick: f
|
|
613
613
|
}),
|
|
614
|
-
m && /* @__PURE__ */ Y(
|
|
614
|
+
m && /* @__PURE__ */ Y(x, {
|
|
615
615
|
icon: /* @__PURE__ */ Y(Ce, {
|
|
616
616
|
size: p.SM,
|
|
617
617
|
"aria-hidden": !0
|
|
618
618
|
}),
|
|
619
|
-
size:
|
|
620
|
-
"aria-label":
|
|
619
|
+
size: b.Small,
|
|
620
|
+
"aria-label": C?.dislikeResponse ?? "Dislike response",
|
|
621
621
|
"aria-pressed": h === o.Dislike,
|
|
622
622
|
className: h === o.Dislike ? rt.activeRating : void 0,
|
|
623
|
-
tooltipProps: { tooltip:
|
|
623
|
+
tooltipProps: { tooltip: S?.dislike ?? "Dislike" },
|
|
624
624
|
onClick: m
|
|
625
625
|
})
|
|
626
626
|
] })]
|
|
@@ -633,7 +633,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
633
633
|
startersDivider: "_startersDivider_ovjc1_26",
|
|
634
634
|
text: "_text_ovjc1_30"
|
|
635
635
|
}, ot = ({ text: e, styles: n, actions: a, hasAlwaysVisibleActions: o, isStreaming: c, attachments: l, afterContent: f, starters: p, onSelectStarter: m, deploymentIconUrl: h, deploymentDisplayName: g, markdownComponents: _, onAttachmentClick: v, onDownloadAll: y, onAttachmentRetry: b, codeBlockTheme: x, labels: S, selectedAttachmentId: C }) => {
|
|
636
|
-
let { colors: w, typography: T, className:
|
|
636
|
+
let { colors: w, typography: T, className: D, bubbleClassName: O } = n ?? {}, { attachmentClickLabel: k, attachmentRetryLabel: A, attachmentOpenInNewTabLabel: j, startersAriaLabel: M = "Quick reply buttons", thinkingLabel: N, codeBlockCopyLabel: P, codeBlockCopiedLabel: F, assistantMessageAriaLabel: I = "Assistant message", deploymentIconFallbackLabel: L = "AI" } = S ?? {}, R = c ? (l ?? []).filter((e) => e.type !== t.Audio) : l ?? [], z = u({
|
|
637
637
|
"--cm-bubble-text": w?.text,
|
|
638
638
|
"--cm-starters-divider": w?.startersDivider
|
|
639
639
|
}), B = d($.text, T?.fontClassName), V = !!(h || g);
|
|
@@ -641,7 +641,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
641
641
|
role: "group",
|
|
642
642
|
"aria-label": I,
|
|
643
643
|
style: z,
|
|
644
|
-
className: d("flex w-full items-start gap-3",
|
|
644
|
+
className: d("flex w-full items-start gap-3", D),
|
|
645
645
|
children: [V && /* @__PURE__ */ Y(r, {
|
|
646
646
|
src: h,
|
|
647
647
|
size: 28,
|
|
@@ -692,7 +692,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
692
692
|
children: p.map((e, t) => /* @__PURE__ */ Y("div", {
|
|
693
693
|
role: "listitem",
|
|
694
694
|
className: "min-w-[40px]",
|
|
695
|
-
children: /* @__PURE__ */ Y(
|
|
695
|
+
children: /* @__PURE__ */ Y(E, {
|
|
696
696
|
label: e.title,
|
|
697
697
|
className: "min-w-[40px]",
|
|
698
698
|
onClick: () => m(e)
|
|
@@ -704,7 +704,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
704
704
|
}, st = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ Y("div", {
|
|
705
705
|
role: "status",
|
|
706
706
|
"aria-live": "polite",
|
|
707
|
-
children: /* @__PURE__ */ Y(
|
|
707
|
+
children: /* @__PURE__ */ Y(C, {
|
|
708
708
|
title: e,
|
|
709
709
|
message: t,
|
|
710
710
|
textClassName: "flex-row flex-wrap gap-1"
|
|
@@ -712,7 +712,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
712
712
|
}), ct = /* @__PURE__ */ function(e) {
|
|
713
713
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
714
714
|
}({}), lt = 10, ut = ({ text: e, position: t = ct.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount: o = lt, labels: c, onAttachmentClick: l, onDownloadAll: m, onAttachmentRetry: h, selectedAttachmentId: g }) => {
|
|
715
|
-
let { colors: _, typography: v, className: y, bubbleClassName:
|
|
715
|
+
let { colors: _, typography: v, className: y, bubbleClassName: x } = n ?? {}, { showMoreLabel: S = "Show more", showLessLabel: C = "Show less", showMoreAriaLabel: w, showLessAriaLabel: E, attachmentClickLabel: D, attachmentRetryLabel: O, attachmentOpenInNewTabLabel: k, userMessageAriaLabel: A = "User message" } = c ?? {}, { textRef: j, isTextCollapsed: P, isOverflowing: F, collapsedMaxHeight: I, expandedMaxHeight: L, isCollapsed: R, toggleCollapsed: z } = f({
|
|
716
716
|
text: e,
|
|
717
717
|
collapsedLineCount: o
|
|
718
718
|
}), B = u({
|
|
@@ -722,7 +722,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
722
722
|
"--cm-bubble-text": _?.text,
|
|
723
723
|
"--cm-bubble-collapsed-height": F ? `${I}px` : void 0,
|
|
724
724
|
"--cm-bubble-expanded-height": F ? `${L}px` : void 0
|
|
725
|
-
}), V = t === ct.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", H = d($.text, v?.fontClassName), U = w ??
|
|
725
|
+
}), V = t === ct.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", H = d($.text, v?.fontClassName), U = w ?? S, W = E ?? C, ee = R ? S : C, te = R ? U : W, ne = R ? M : N, re = Ae();
|
|
726
726
|
return /* @__PURE__ */ Y("div", {
|
|
727
727
|
role: "group",
|
|
728
728
|
"aria-label": A,
|
|
@@ -745,7 +745,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
745
745
|
selectedAttachmentId: g
|
|
746
746
|
}),
|
|
747
747
|
e && /* @__PURE__ */ Y("div", {
|
|
748
|
-
className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", V,
|
|
748
|
+
className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", V, x),
|
|
749
749
|
children: /* @__PURE__ */ X("div", {
|
|
750
750
|
className: "flex min-w-0 flex-col items-start",
|
|
751
751
|
children: [/* @__PURE__ */ Y("div", {
|
|
@@ -756,7 +756,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
756
756
|
className: d(H, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
|
|
757
757
|
children: e
|
|
758
758
|
})
|
|
759
|
-
}), F && /* @__PURE__ */ Y(
|
|
759
|
+
}), F && /* @__PURE__ */ Y(T, {
|
|
760
760
|
label: /* @__PURE__ */ Y(J, { children: ee }),
|
|
761
761
|
iconBefore: /* @__PURE__ */ Y(ne, {
|
|
762
762
|
size: p.SM,
|
|
@@ -767,7 +767,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
767
767
|
"aria-controls": re,
|
|
768
768
|
className: "mt-3",
|
|
769
769
|
onClick: z,
|
|
770
|
-
size:
|
|
770
|
+
size: b.Small
|
|
771
771
|
})]
|
|
772
772
|
})
|
|
773
773
|
}),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-conversation-messages",
|
|
3
3
|
"description": "Message bubble components for rendering conversation history with actions and source citations",
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.125",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"react": "^19.0.0",
|
|
21
21
|
"@tabler/icons-react": "^3.0.0",
|
|
22
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
23
|
-
"@epam/ai-dial-conversation-input": "1.1.0-dev.
|
|
22
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.125",
|
|
23
|
+
"@epam/ai-dial-conversation-input": "1.1.0-dev.125",
|
|
24
24
|
"react-markdown": "^10.1.0",
|
|
25
25
|
"@epam/ai-dial-ui-kit": "^0.13.0-dev.26"
|
|
26
26
|
},
|