@epam/ai-dial-conversation-messages 1.1.0-dev.62 → 1.1.0-dev.66
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/components/MessageBubble/UserMessageBubble.d.ts.map +1 -1
- package/index.js +118 -118
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/UserMessageBubble.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UserMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/UserMessageBubble.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,EAAE,EAAS,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAO1E,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CA0IxD,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, MDMessageViewer as r, MIME_TYPE_EXT_MAP as i, MessageRating as a, MessageRole as o, RequestStatus as s, ResponseFormat as c, buildCssVars as l, mergeClasses as u, useCollapsedText as d } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { DIAL_ICON_SIZE as f, DialGhostIconButton as p, DialInput as m,
|
|
2
|
+
import { DIAL_ICON_SIZE as f, DialGhostIconButton as p, DialInput as m, DialPopup as h, DialRadioGroup as g, DialSkeleton as _, DialSkeletonVariant as v, DialSlider as y, DialTag as b, DialTooltip as x, ElementSize as S, Highlight as C, InfoMessageNotification as w, LinkButton as T, NeutralButton as E, PopupSize as D, PrimaryButton as O, RadioGroupOrientation as k } from "@epam/ai-dial-ui-kit";
|
|
3
3
|
import { IconCheck as A, IconChevronDown as j, IconChevronUp as M, IconClipboard as N, IconCopy 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 ee, IconFileTypeHtml as te, IconFileTypeJpg as ne, IconFileTypeJs as re, IconFileTypeJsx as ie, IconFileTypePdf as ae, IconFileTypePhp as oe, IconFileTypePng as se, IconFileTypePpt as ce, IconFileTypeRs as le, IconFileTypeSql as ue, IconFileTypeSvg as de, IconFileTypeTs as fe, IconFileTypeTsx as pe, IconFileTypeTxt as me, IconFileTypeVue as he, IconFileTypeXls as ge, IconFileTypeXml as _e, IconFileTypeZip as ve, IconMarkdown as ye, IconMusic as be, IconPaperclip as xe, IconPencilMinus as Se, IconPhoto as H, IconRefresh as Ce, IconReload as we, IconTerminal2 as Te, IconThumbDown as Ee, IconThumbUp as De, IconTrashX as Oe, IconVideo as ke, IconX as Ae } from "@tabler/icons-react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
import { memo as je, useCallback as U, useEffect as Me, useId as Ne, useMemo as W, useRef as Pe, useState as G } from "react";
|
|
@@ -103,19 +103,19 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
103
103
|
visibleCount: 4,
|
|
104
104
|
hiddenCount: e - 4
|
|
105
105
|
}, X = {
|
|
106
|
-
tile: "
|
|
107
|
-
tileLight: "
|
|
108
|
-
tileError: "
|
|
109
|
-
nameText: "
|
|
110
|
-
typeText: "
|
|
111
|
-
retryIcon: "
|
|
112
|
-
hoverIcon: "
|
|
113
|
-
track: "
|
|
114
|
-
indeterminateFill: "
|
|
115
|
-
"attachment-tile-indeterminate": "_attachment-tile-
|
|
106
|
+
tile: "_tile_1khux_1",
|
|
107
|
+
tileLight: "_tileLight_1khux_12",
|
|
108
|
+
tileError: "_tileError_1khux_16",
|
|
109
|
+
nameText: "_nameText_1khux_23",
|
|
110
|
+
typeText: "_typeText_1khux_24",
|
|
111
|
+
retryIcon: "_retryIcon_1khux_36",
|
|
112
|
+
hoverIcon: "_hoverIcon_1khux_40",
|
|
113
|
+
track: "_track_1khux_48",
|
|
114
|
+
indeterminateFill: "_indeterminateFill_1khux_52",
|
|
115
|
+
"attachment-tile-indeterminate": "_attachment-tile-indeterminate_1khux_1"
|
|
116
116
|
}, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ q(p, {
|
|
117
117
|
icon: a,
|
|
118
|
-
size:
|
|
118
|
+
size: S.Small,
|
|
119
119
|
className: u("absolute end-1 top-1 h-6 w-6 rounded-lg", o ?? X.hoverIcon),
|
|
120
120
|
"aria-label": e,
|
|
121
121
|
"aria-describedby": t ? n : void 0,
|
|
@@ -168,7 +168,7 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
168
168
|
/* @__PURE__ */ q("span", {
|
|
169
169
|
title: e.name,
|
|
170
170
|
className: u(f?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.nameText),
|
|
171
|
-
children: t ? /* @__PURE__ */ q(
|
|
171
|
+
children: t ? /* @__PURE__ */ q(C, {
|
|
172
172
|
text: e.name,
|
|
173
173
|
query: t,
|
|
174
174
|
maxLines: 1
|
|
@@ -293,11 +293,11 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
293
293
|
imageLoadStatus: r
|
|
294
294
|
};
|
|
295
295
|
}, Qe = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c }) => {
|
|
296
|
-
let { clickLabel: l = "Open attachment", expandLabel: d = "Expand pasted text" } = i ?? {}, { typography: p, className: m } = c ?? {}, { id: h, name: g } = e,
|
|
296
|
+
let { clickLabel: l = "Open attachment", expandLabel: d = "Expand pasted text" } = i ?? {}, { typography: p, className: m } = c ?? {}, { id: h, name: g } = e, y = e.previewUrl ?? e.url, b = e.type === t.Pasted && n !== void 0, { isLoading: x, isError: S, isImage: C } = W(() => Ve(e), [e]), w = r !== void 0 && !b && !x && !S, { imageRef: T, imageLoadStatus: E } = Ze({
|
|
297
297
|
enabled: C,
|
|
298
|
-
src:
|
|
298
|
+
src: y
|
|
299
299
|
}), D = () => {
|
|
300
|
-
|
|
300
|
+
b && n ? n(h) : w && r && r(h);
|
|
301
301
|
};
|
|
302
302
|
return /* @__PURE__ */ q("div", {
|
|
303
303
|
className: u(Fe, w && "cursor-pointer", X.tile, m),
|
|
@@ -308,7 +308,7 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
308
308
|
tabIndex: 0,
|
|
309
309
|
role: "button",
|
|
310
310
|
style: o,
|
|
311
|
-
"aria-label": w ? l :
|
|
311
|
+
"aria-label": w ? l : b ? d : void 0,
|
|
312
312
|
children: /* @__PURE__ */ J("div", {
|
|
313
313
|
className: "relative h-full w-full overflow-hidden",
|
|
314
314
|
children: [
|
|
@@ -320,8 +320,8 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
320
320
|
onClick: s,
|
|
321
321
|
id: h
|
|
322
322
|
}),
|
|
323
|
-
E !== Xe.Loaded && /* @__PURE__ */ q(
|
|
324
|
-
variant:
|
|
323
|
+
E !== Xe.Loaded && /* @__PURE__ */ q(_, {
|
|
324
|
+
variant: v.Rectangular,
|
|
325
325
|
width: "100%",
|
|
326
326
|
height: "100%",
|
|
327
327
|
active: E === Xe.Loading,
|
|
@@ -334,7 +334,7 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
334
334
|
}),
|
|
335
335
|
/* @__PURE__ */ q("img", {
|
|
336
336
|
ref: T,
|
|
337
|
-
src:
|
|
337
|
+
src: y,
|
|
338
338
|
alt: g,
|
|
339
339
|
loading: "lazy",
|
|
340
340
|
decoding: "async",
|
|
@@ -391,7 +391,7 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
391
391
|
cssVars: m,
|
|
392
392
|
isExpandable: p
|
|
393
393
|
});
|
|
394
|
-
}, et = { tile: "
|
|
394
|
+
}, et = { tile: "_tile_1m13z_1" }, tt = ({ count: e, onClick: t, labels: n, children: r, styles: i }) => {
|
|
395
395
|
let { ariaLabel: a } = n ?? {}, { typography: { fontClassName: o = "dial-small-semi-text" } = {}, className: s, colors: c } = i ?? {}, d = l({
|
|
396
396
|
"--ci-more-tile-bg": c?.background,
|
|
397
397
|
"--ci-more-tile-border": c?.border,
|
|
@@ -413,11 +413,11 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
413
413
|
})
|
|
414
414
|
});
|
|
415
415
|
}, Q = {
|
|
416
|
-
container: "
|
|
417
|
-
headerIcon: "
|
|
418
|
-
headerLabel: "
|
|
419
|
-
downloadAllButton: "
|
|
420
|
-
imageTile: "
|
|
416
|
+
container: "_container_109up_1",
|
|
417
|
+
headerIcon: "_headerIcon_109up_6",
|
|
418
|
+
headerLabel: "_headerLabel_109up_7",
|
|
419
|
+
downloadAllButton: "_downloadAllButton_109up_8",
|
|
420
|
+
imageTile: "_imageTile_109up_12"
|
|
421
421
|
}, nt = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, rt = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o }) => {
|
|
422
422
|
let { ariaLabel: c = "Attachments", clickLabel: d = "Download attachment", retryLabel: m = "Retry upload", showLessLabel: h = "Show less", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) => nt(e, "attachment"), promptLabel: y, pastedLabel: b, imageLabel: x } = a ?? {}, { typography: { headerLabelClassName: S = "dial-tiny-semi-text" } = {}, colors: C, className: w } = o ?? {}, T = l({
|
|
423
423
|
"--ci-group-bg": C?.background,
|
|
@@ -503,32 +503,7 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
503
503
|
]
|
|
504
504
|
})]
|
|
505
505
|
});
|
|
506
|
-
}, it = {
|
|
507
|
-
tabContainer: "_tabContainer_rzv03_1",
|
|
508
|
-
tabActive: "_tabActive_rzv03_13"
|
|
509
|
-
};
|
|
510
|
-
je(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
511
|
-
let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
|
|
512
|
-
return /* @__PURE__ */ q("div", {
|
|
513
|
-
className: "flex flex-nowrap gap-1",
|
|
514
|
-
role: "tablist",
|
|
515
|
-
children: e.map((e) => {
|
|
516
|
-
let r = t === e.id;
|
|
517
|
-
return /* @__PURE__ */ q("div", {
|
|
518
|
-
role: "tab",
|
|
519
|
-
"aria-selected": r,
|
|
520
|
-
className: "contents",
|
|
521
|
-
children: /* @__PURE__ */ q(C, {
|
|
522
|
-
label: e.label,
|
|
523
|
-
selected: r,
|
|
524
|
-
onClick: () => n(e.id),
|
|
525
|
-
className: u("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, it.tabContainer, r && it.tabActive)
|
|
526
|
-
})
|
|
527
|
-
}, e.id);
|
|
528
|
-
})
|
|
529
|
-
});
|
|
530
|
-
});
|
|
531
|
-
var at = (e) => /* @__PURE__ */ q(_, { ...e }), ot = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
506
|
+
}, it = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
532
507
|
let [s, c] = G(t), [l, u] = G(n), [d, f] = G(r), p = Pe(o);
|
|
533
508
|
Me(() => {
|
|
534
509
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
@@ -561,16 +536,16 @@ var at = (e) => /* @__PURE__ */ q(_, { ...e }), ot = ({ features: e, initialResp
|
|
|
561
536
|
a
|
|
562
537
|
])
|
|
563
538
|
};
|
|
564
|
-
},
|
|
539
|
+
}, at = "!dial-small-semi-text !text-primary gap-1", ot = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: a, onTemperatureChange: o, responseFormatLabel: s = "Response format", responseFormatHint: l = "Applies to new and existing messages", responseFormatMarkdownLabel: u = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: h = "Temperature", temperatureLabels: _ = [
|
|
565
540
|
"Precise",
|
|
566
541
|
"Neutral",
|
|
567
542
|
"Creative"
|
|
568
|
-
], temperatureHint:
|
|
543
|
+
], temperatureHint: v }) => /* @__PURE__ */ J("div", {
|
|
569
544
|
className: "flex flex-col gap-4 px-6 py-3",
|
|
570
545
|
children: [
|
|
571
|
-
e.responseFormat && /* @__PURE__ */ q(
|
|
546
|
+
e.responseFormat && /* @__PURE__ */ q(g, {
|
|
572
547
|
fieldTitle: s,
|
|
573
|
-
labelClassName:
|
|
548
|
+
labelClassName: at,
|
|
574
549
|
elementId: "response-format",
|
|
575
550
|
orientation: k.Column,
|
|
576
551
|
activeRadioButton: t ?? c.Markdown,
|
|
@@ -588,28 +563,28 @@ var at = (e) => /* @__PURE__ */ q(_, { ...e }), ot = ({ features: e, initialResp
|
|
|
588
563
|
value: n,
|
|
589
564
|
placeholder: p,
|
|
590
565
|
labelProps: {
|
|
591
|
-
className:
|
|
566
|
+
className: at,
|
|
592
567
|
label: f
|
|
593
568
|
},
|
|
594
569
|
onChange: (e) => a(e ?? "")
|
|
595
570
|
}),
|
|
596
|
-
e.temperature && /* @__PURE__ */ q(
|
|
571
|
+
e.temperature && /* @__PURE__ */ q(y, {
|
|
597
572
|
labelProps: {
|
|
598
573
|
label: h,
|
|
599
|
-
className:
|
|
600
|
-
caption:
|
|
574
|
+
className: at,
|
|
575
|
+
caption: v
|
|
601
576
|
},
|
|
602
577
|
value: r,
|
|
603
578
|
min: 0,
|
|
604
579
|
max: 1,
|
|
605
580
|
step: .1,
|
|
606
|
-
labels:
|
|
581
|
+
labels: _,
|
|
607
582
|
onChange: o
|
|
608
583
|
})
|
|
609
584
|
]
|
|
610
585
|
});
|
|
611
|
-
je(({ 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: m, temperatureHint:
|
|
612
|
-
let { responseFormat: y, systemPrompt: b, temperature:
|
|
586
|
+
je(({ 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: m, temperatureHint: g, saveLabel: _ = "Apply changes", saveDisabledTooltip: v }) => {
|
|
587
|
+
let { responseFormat: y, systemPrompt: b, temperature: S, canSubmit: C, setResponseFormat: w, setSystemPrompt: T, setTemperature: E, handleSubmit: k } = it({
|
|
613
588
|
features: e,
|
|
614
589
|
initialResponseFormat: t,
|
|
615
590
|
initialSystemPrompt: n,
|
|
@@ -617,30 +592,30 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
617
592
|
onSave: i,
|
|
618
593
|
onClose: a
|
|
619
594
|
});
|
|
620
|
-
return /* @__PURE__ */ q(
|
|
595
|
+
return /* @__PURE__ */ q(h, {
|
|
621
596
|
open: !0,
|
|
622
597
|
header: o,
|
|
623
|
-
size:
|
|
598
|
+
size: D.Sm,
|
|
624
599
|
onClose: a,
|
|
625
600
|
className: "!bg-layer-2",
|
|
626
601
|
footer: /* @__PURE__ */ q("div", {
|
|
627
602
|
className: "flex justify-end px-6 py-4",
|
|
628
|
-
children: /* @__PURE__ */ q(
|
|
603
|
+
children: /* @__PURE__ */ q(x, {
|
|
629
604
|
tooltip: v,
|
|
630
|
-
hideTooltip:
|
|
631
|
-
children: /* @__PURE__ */ q(
|
|
605
|
+
hideTooltip: C || !v,
|
|
606
|
+
children: /* @__PURE__ */ q(O, {
|
|
632
607
|
label: _,
|
|
633
|
-
onClick:
|
|
634
|
-
disabled: !
|
|
608
|
+
onClick: k,
|
|
609
|
+
disabled: !C
|
|
635
610
|
})
|
|
636
611
|
})
|
|
637
612
|
}),
|
|
638
|
-
children: /* @__PURE__ */ q(
|
|
613
|
+
children: /* @__PURE__ */ q(ot, {
|
|
639
614
|
features: e,
|
|
640
615
|
responseFormat: y,
|
|
641
616
|
systemPrompt: b,
|
|
642
|
-
temperature:
|
|
643
|
-
onResponseFormatChange:
|
|
617
|
+
temperature: S,
|
|
618
|
+
onResponseFormatChange: w,
|
|
644
619
|
onSystemPromptChange: T,
|
|
645
620
|
onTemperatureChange: E,
|
|
646
621
|
responseFormatLabel: s,
|
|
@@ -651,17 +626,42 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
651
626
|
systemPromptTooltip: f,
|
|
652
627
|
temperatureLabel: p,
|
|
653
628
|
temperatureLabels: m,
|
|
654
|
-
temperatureHint:
|
|
629
|
+
temperatureHint: g
|
|
630
|
+
})
|
|
631
|
+
});
|
|
632
|
+
});
|
|
633
|
+
var st = {
|
|
634
|
+
tabContainer: "_tabContainer_153ct_1",
|
|
635
|
+
tabActive: "_tabActive_153ct_13"
|
|
636
|
+
};
|
|
637
|
+
je(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
638
|
+
let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
|
|
639
|
+
return /* @__PURE__ */ q("div", {
|
|
640
|
+
className: "flex flex-nowrap gap-1",
|
|
641
|
+
role: "tablist",
|
|
642
|
+
children: e.map((e) => {
|
|
643
|
+
let r = t === e.id;
|
|
644
|
+
return /* @__PURE__ */ q("div", {
|
|
645
|
+
role: "tab",
|
|
646
|
+
"aria-selected": r,
|
|
647
|
+
className: "contents",
|
|
648
|
+
children: /* @__PURE__ */ q(b, {
|
|
649
|
+
label: e.label,
|
|
650
|
+
selected: r,
|
|
651
|
+
onClick: () => n(e.id),
|
|
652
|
+
className: u("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, st.tabContainer, r && st.tabActive)
|
|
653
|
+
})
|
|
654
|
+
}, e.id);
|
|
655
655
|
})
|
|
656
656
|
});
|
|
657
657
|
});
|
|
658
658
|
//#endregion
|
|
659
659
|
//#region src/components/MessageActions/MessageActions.tsx
|
|
660
|
-
var
|
|
661
|
-
let { tooltips: v, ariaLabels: y } = _ ?? {}, [b, x] = G(null), [
|
|
662
|
-
s?.(), x("copy"),
|
|
660
|
+
var ct = 2e3, lt = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r, onRegenerate: i, onCopy: s, onCopyMarkdown: c, onLike: l, onDislike: d, activeRating: m, isAlwaysVisible: h, className: g, labels: _ }) => {
|
|
661
|
+
let { tooltips: v, ariaLabels: y } = _ ?? {}, [b, x] = G(null), [C, w] = G(""), T = U(() => {
|
|
662
|
+
s?.(), x("copy"), w(y?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => x(null), ct);
|
|
663
663
|
}, [s, y?.copiedStatus]), E = U(() => {
|
|
664
|
-
c?.(), x("markdown"),
|
|
664
|
+
c?.(), x("markdown"), w(y?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => x(null), ct);
|
|
665
665
|
}, [c, y?.copiedMarkdownStatus]);
|
|
666
666
|
return /* @__PURE__ */ J("div", {
|
|
667
667
|
role: "toolbar",
|
|
@@ -671,13 +671,13 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
671
671
|
role: "status",
|
|
672
672
|
"aria-live": "polite",
|
|
673
673
|
className: "sr-only",
|
|
674
|
-
children:
|
|
674
|
+
children: C
|
|
675
675
|
}), e === o.User ? /* @__PURE__ */ J(K, { children: [t && /* @__PURE__ */ q(p, {
|
|
676
676
|
icon: /* @__PURE__ */ q(Se, {
|
|
677
677
|
size: f.SM,
|
|
678
678
|
"aria-hidden": !0
|
|
679
679
|
}),
|
|
680
|
-
size:
|
|
680
|
+
size: S.Small,
|
|
681
681
|
"aria-label": y?.editMessage ?? "Edit message",
|
|
682
682
|
tooltipProps: { tooltip: v?.edit ?? "Edit" },
|
|
683
683
|
onClick: t,
|
|
@@ -688,7 +688,7 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
688
688
|
size: f.SM,
|
|
689
689
|
"aria-hidden": !0
|
|
690
690
|
}),
|
|
691
|
-
size:
|
|
691
|
+
size: S.Small,
|
|
692
692
|
"aria-label": y?.deleteMessage ?? "Delete message",
|
|
693
693
|
tooltipProps: { tooltip: v?.delete ?? "Delete" },
|
|
694
694
|
onClick: r
|
|
@@ -698,7 +698,7 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
698
698
|
size: f.SM,
|
|
699
699
|
"aria-hidden": !0
|
|
700
700
|
}),
|
|
701
|
-
size:
|
|
701
|
+
size: S.Small,
|
|
702
702
|
"aria-label": y?.regenerateResponse ?? "Regenerate response",
|
|
703
703
|
tooltipProps: { tooltip: v?.regenerate ?? "Regenerate" },
|
|
704
704
|
onClick: i
|
|
@@ -708,17 +708,17 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
708
708
|
size: f.SM,
|
|
709
709
|
"aria-hidden": !0
|
|
710
710
|
}),
|
|
711
|
-
size:
|
|
711
|
+
size: S.Small,
|
|
712
712
|
"aria-label": y?.copyResponse ?? "Copy response",
|
|
713
713
|
tooltipProps: { tooltip: b === "copy" ? v?.copied ?? "Copied!" : v?.copy ?? "Copy" },
|
|
714
|
-
onClick:
|
|
714
|
+
onClick: T
|
|
715
715
|
}),
|
|
716
716
|
c && /* @__PURE__ */ q(p, {
|
|
717
717
|
icon: q(b === "markdown" ? A : ye, {
|
|
718
718
|
size: f.SM,
|
|
719
719
|
"aria-hidden": !0
|
|
720
720
|
}),
|
|
721
|
-
size:
|
|
721
|
+
size: S.Small,
|
|
722
722
|
"aria-label": y?.copyAsMarkdown ?? "Copy as markdown",
|
|
723
723
|
tooltipProps: { tooltip: b === "markdown" ? v?.copiedMarkdown ?? "Copied!" : v?.copyMarkdown ?? "Copy as Markdown" },
|
|
724
724
|
onClick: E
|
|
@@ -728,7 +728,7 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
728
728
|
size: f.SM,
|
|
729
729
|
"aria-hidden": !0
|
|
730
730
|
}),
|
|
731
|
-
size:
|
|
731
|
+
size: S.Small,
|
|
732
732
|
"aria-label": y?.likeResponse ?? "Like response",
|
|
733
733
|
"aria-pressed": m === a.Like,
|
|
734
734
|
className: m === a.Like ? "!text-accent-primary" : void 0,
|
|
@@ -740,7 +740,7 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
740
740
|
size: f.SM,
|
|
741
741
|
"aria-hidden": !0
|
|
742
742
|
}),
|
|
743
|
-
size:
|
|
743
|
+
size: S.Small,
|
|
744
744
|
"aria-label": y?.dislikeResponse ?? "Dislike response",
|
|
745
745
|
"aria-pressed": m === a.Dislike,
|
|
746
746
|
className: m === a.Dislike ? "!text-accent-primary" : void 0,
|
|
@@ -756,16 +756,16 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
756
756
|
collapsedText: "_collapsedText_1tjh8_15",
|
|
757
757
|
startersDivider: "_startersDivider_1tjh8_26",
|
|
758
758
|
text: "_text_1tjh8_30"
|
|
759
|
-
},
|
|
760
|
-
let { colors:
|
|
761
|
-
"--cm-bubble-text":
|
|
762
|
-
"--cm-starters-divider":
|
|
763
|
-
}), z = u($.text,
|
|
759
|
+
}, ut = ({ text: e, styles: i, actions: a, hasAlwaysVisibleActions: s, isStreaming: c, attachments: d, afterContent: f, starters: p, onSelectStarter: m, deploymentIconUrl: h, deploymentDisplayName: g, markdownComponents: _, onAttachmentClick: v, onDownloadAll: y, onAttachmentRetry: b, codeBlockTheme: x, labels: S }) => {
|
|
760
|
+
let { colors: C, typography: w, className: T, bubbleClassName: D } = i ?? {}, { attachmentClickLabel: O, attachmentRetryLabel: k, attachmentOpenInNewTabLabel: A, startersAriaLabel: j = "Quick reply buttons", thinkingLabel: M, codeBlockCopyLabel: N, codeBlockCopiedLabel: P, assistantMessageAriaLabel: F = "Assistant message", deploymentIconFallbackLabel: I = "AI" } = S ?? {}, L = c ? (d ?? []).filter((e) => e.type !== t.Audio) : d ?? [], R = l({
|
|
761
|
+
"--cm-bubble-text": C?.text,
|
|
762
|
+
"--cm-starters-divider": C?.startersDivider
|
|
763
|
+
}), z = u($.text, w?.fontClassName), B = !!(h || g);
|
|
764
764
|
return /* @__PURE__ */ J("div", {
|
|
765
765
|
role: "group",
|
|
766
766
|
"aria-label": F,
|
|
767
767
|
style: R,
|
|
768
|
-
className: u("flex w-full items-start gap-3",
|
|
768
|
+
className: u("flex w-full items-start gap-3", T),
|
|
769
769
|
children: [B && /* @__PURE__ */ q(n, {
|
|
770
770
|
src: h,
|
|
771
771
|
size: 28,
|
|
@@ -787,14 +787,14 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
787
787
|
components: _,
|
|
788
788
|
codeBlockCopyLabel: N,
|
|
789
789
|
codeBlockCopiedLabel: P,
|
|
790
|
-
codeBlockTheme:
|
|
790
|
+
codeBlockTheme: x
|
|
791
791
|
})
|
|
792
792
|
}),
|
|
793
793
|
/* @__PURE__ */ q(rt, {
|
|
794
794
|
attachments: L,
|
|
795
795
|
onAttachmentClick: (e) => v?.(d?.find((t) => t.id === e)),
|
|
796
|
-
onDownloadAll:
|
|
797
|
-
onRetry:
|
|
796
|
+
onDownloadAll: y,
|
|
797
|
+
onRetry: b,
|
|
798
798
|
labels: {
|
|
799
799
|
clickLabel: O,
|
|
800
800
|
retryLabel: k,
|
|
@@ -802,7 +802,7 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
802
802
|
}
|
|
803
803
|
}),
|
|
804
804
|
f,
|
|
805
|
-
/* @__PURE__ */ q(
|
|
805
|
+
/* @__PURE__ */ q(lt, {
|
|
806
806
|
...a,
|
|
807
807
|
isAlwaysVisible: s,
|
|
808
808
|
role: o.Assistant
|
|
@@ -815,7 +815,7 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
815
815
|
children: p.map((e, t) => /* @__PURE__ */ q("div", {
|
|
816
816
|
role: "listitem",
|
|
817
817
|
className: "min-w-[40px]",
|
|
818
|
-
children: /* @__PURE__ */ q(
|
|
818
|
+
children: /* @__PURE__ */ q(E, {
|
|
819
819
|
label: e.title,
|
|
820
820
|
className: "min-w-[40px]",
|
|
821
821
|
onClick: () => m(e)
|
|
@@ -824,33 +824,33 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
824
824
|
})]
|
|
825
825
|
})]
|
|
826
826
|
});
|
|
827
|
-
},
|
|
827
|
+
}, dt = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ q("div", {
|
|
828
828
|
role: "status",
|
|
829
829
|
"aria-live": "polite",
|
|
830
|
-
children: /* @__PURE__ */ q(
|
|
830
|
+
children: /* @__PURE__ */ q(w, {
|
|
831
831
|
title: e,
|
|
832
832
|
message: t,
|
|
833
833
|
textClassName: "flex-row flex-wrap gap-1"
|
|
834
834
|
})
|
|
835
|
-
}),
|
|
835
|
+
}), ft = /* @__PURE__ */ function(e) {
|
|
836
836
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
837
|
-
}({}),
|
|
838
|
-
let { colors:
|
|
837
|
+
}({}), pt = 10, mt = ({ text: e, position: t = ft.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount: s = pt, labels: c, onAttachmentClick: p, onDownloadAll: m, onAttachmentRetry: h }) => {
|
|
838
|
+
let { colors: g, typography: _, className: v, bubbleClassName: y } = n ?? {}, { showMoreLabel: b = "Show more", showLessLabel: x = "Show less", showMoreAriaLabel: C, showLessAriaLabel: w, attachmentClickLabel: E, attachmentRetryLabel: D, attachmentOpenInNewTabLabel: O, userMessageAriaLabel: k = "User message" } = c ?? {}, { textRef: A, isTextCollapsed: N, isOverflowing: P, collapsedMaxHeight: F, expandedMaxHeight: I, isCollapsed: L, toggleCollapsed: R } = d({
|
|
839
839
|
text: e,
|
|
840
840
|
collapsedLineCount: s
|
|
841
841
|
}), z = l({
|
|
842
|
-
"--cm-bubble-user-bg":
|
|
843
|
-
"--cm-bubble-user-border":
|
|
844
|
-
"--cm-bubble-fade-start":
|
|
845
|
-
"--cm-bubble-text":
|
|
842
|
+
"--cm-bubble-user-bg": g?.userBackground,
|
|
843
|
+
"--cm-bubble-user-border": g?.userBorder,
|
|
844
|
+
"--cm-bubble-fade-start": g?.fadeStart,
|
|
845
|
+
"--cm-bubble-text": g?.text,
|
|
846
846
|
"--cm-bubble-collapsed-height": P ? `${F}px` : void 0,
|
|
847
847
|
"--cm-bubble-expanded-height": P ? `${I}px` : void 0
|
|
848
|
-
}), B = t ===
|
|
848
|
+
}), B = t === ft.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", V = u($.text, _?.fontClassName), ee = C ?? b, te = w ?? x, ne = L ? b : x, re = L ? ee : te, ie = L ? j : M, ae = Ne();
|
|
849
849
|
return /* @__PURE__ */ q("div", {
|
|
850
850
|
role: "group",
|
|
851
851
|
"aria-label": k,
|
|
852
852
|
style: z,
|
|
853
|
-
className: u("flex w-full",
|
|
853
|
+
className: u("flex w-full", v),
|
|
854
854
|
children: /* @__PURE__ */ J("div", {
|
|
855
855
|
className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
|
|
856
856
|
children: [
|
|
@@ -858,7 +858,7 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
858
858
|
attachments: a ?? [],
|
|
859
859
|
onAttachmentClick: (e) => p?.(a?.find((t) => t.id === e)),
|
|
860
860
|
onDownloadAll: m,
|
|
861
|
-
onRetry:
|
|
861
|
+
onRetry: h,
|
|
862
862
|
labels: {
|
|
863
863
|
clickLabel: E,
|
|
864
864
|
retryLabel: D,
|
|
@@ -867,7 +867,7 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
867
867
|
styles: { className: "max-w-[640px]" }
|
|
868
868
|
}),
|
|
869
869
|
e && /* @__PURE__ */ q("div", {
|
|
870
|
-
className: u($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", B,
|
|
870
|
+
className: u($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", B, y),
|
|
871
871
|
children: /* @__PURE__ */ J("div", {
|
|
872
872
|
className: "flex min-w-0 flex-col items-start",
|
|
873
873
|
children: [/* @__PURE__ */ q("div", {
|
|
@@ -878,7 +878,7 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
878
878
|
className: u(V, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
|
|
879
879
|
children: e
|
|
880
880
|
})
|
|
881
|
-
}), P && /* @__PURE__ */ q(
|
|
881
|
+
}), P && /* @__PURE__ */ q(T, {
|
|
882
882
|
label: /* @__PURE__ */ q(K, { children: ne }),
|
|
883
883
|
iconBefore: /* @__PURE__ */ q(ie, {
|
|
884
884
|
size: f.SM,
|
|
@@ -889,11 +889,11 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
889
889
|
"aria-controls": ae,
|
|
890
890
|
className: "mt-3",
|
|
891
891
|
onClick: R,
|
|
892
|
-
size:
|
|
892
|
+
size: S.Small
|
|
893
893
|
})]
|
|
894
894
|
})
|
|
895
895
|
}),
|
|
896
|
-
/* @__PURE__ */ q(
|
|
896
|
+
/* @__PURE__ */ q(lt, {
|
|
897
897
|
...r,
|
|
898
898
|
isAlwaysVisible: i,
|
|
899
899
|
role: o.User
|
|
@@ -901,16 +901,16 @@ var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
901
901
|
]
|
|
902
902
|
})
|
|
903
903
|
});
|
|
904
|
-
},
|
|
904
|
+
}, ht = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e === o.Status ? /* @__PURE__ */ q(dt, { labels: {
|
|
905
905
|
titleText: r.labels?.statusTitleText,
|
|
906
906
|
bodyText: r.labels?.statusBodyText ?? ""
|
|
907
|
-
} }) : e === o.User ? /* @__PURE__ */ q(
|
|
907
|
+
} }) : e === o.User ? /* @__PURE__ */ q(mt, {
|
|
908
908
|
...r,
|
|
909
909
|
onAttachmentClick: t
|
|
910
|
-
}) : /* @__PURE__ */ q(
|
|
910
|
+
}) : /* @__PURE__ */ q(ut, {
|
|
911
911
|
...r,
|
|
912
912
|
markdownComponents: n,
|
|
913
913
|
onAttachmentClick: t
|
|
914
914
|
});
|
|
915
915
|
//#endregion
|
|
916
|
-
export {
|
|
916
|
+
export { ut as AssistantMessageBubble, ft as BubblePosition, lt as MessageActions, ht as MessageBubble, dt as StatusMessageBubble, mt as UserMessageBubble };
|
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.66",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -19,10 +19,10 @@
|
|
|
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.66",
|
|
23
|
+
"@epam/ai-dial-conversation-input": "1.1.0-dev.66",
|
|
24
24
|
"react-markdown": "^10.1.0",
|
|
25
|
-
"@epam/ai-dial-ui-kit": "^0.13.0-dev.
|
|
25
|
+
"@epam/ai-dial-ui-kit": "^0.13.0-dev.23"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|