@epam/ai-dial-conversation-messages 1.1.0-dev.209 → 1.1.0-dev.211
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 +52 -48
- 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, DialRadioGroup as m, DialSlider as h, DialTooltip as g, ElementSize as _, GhostIconButton as v, Highlight as y, InfoMessageNotification as b,
|
|
2
|
+
import { DIAL_ICON_SIZE as p, DialRadioGroup as m, DialSlider as h, DialTooltip as g, ElementSize as _, GhostIconButton as v, Highlight as y, InfoMessageNotification as b, LinkButton as x, NeutralButton as S, Popup as C, PopupSize as w, PrimaryButton as T, RadioGroupOrientation as E, Skeleton as D, SkeletonVariant as O, Spinner as k, StaticIconButton as A, Textarea 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";
|
|
@@ -99,7 +99,7 @@ var Ne = (e) => {
|
|
|
99
99
|
track: "_track_3jao2_37",
|
|
100
100
|
actionButton: "_actionButton_3jao2_43",
|
|
101
101
|
imageActionButton: "_imageActionButton_3jao2_47"
|
|
102
|
-
}, Q = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ Y(
|
|
102
|
+
}, Q = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ Y(A, {
|
|
103
103
|
icon: a,
|
|
104
104
|
size: _.Small,
|
|
105
105
|
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),
|
|
@@ -137,7 +137,7 @@ var Ne = (e) => {
|
|
|
137
137
|
[e.Network]: "Upload failed · network error",
|
|
138
138
|
[e.UnsupportedType]: "Upload failed · unsupported file type"
|
|
139
139
|
}, 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 }) => {
|
|
140
|
-
let { clickLabel: _ = "Download attachment", retryLabel: v = "Retry upload", sizeLabel: b, uploadingLabel: x = "Uploading", errorReasonLabels: S, genericErrorLabel: C = "Upload failed" } = a ?? {}, { typography: w, className: T } = o ?? {}, { id: E, name: D, status: O, errorReason:
|
|
140
|
+
let { clickLabel: _ = "Download attachment", retryLabel: v = "Retry upload", sizeLabel: b, uploadingLabel: x = "Uploading", errorReasonLabels: S, genericErrorLabel: C = "Upload failed" } = a ?? {}, { typography: w, className: T } = o ?? {}, { id: E, name: D, status: O, errorReason: A } = t, j = O === c.Loading, M = O === c.Error, N = Ae(), P = M ? A && (S?.[A] ?? We[A]) || C : "", { BottomIcon: F, typeLabel: I } = Re(t), L = !M && !j && s && !u, R = M && !!i && A !== e.UnsupportedType, z = L || R ? "pe-5" : void 0, B = (e) => {
|
|
141
141
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(t.id));
|
|
142
142
|
}, V = je(() => l ? D : Ne(D), [l, D]), H = K(() => {
|
|
143
143
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
@@ -167,7 +167,7 @@ var Ne = (e) => {
|
|
|
167
167
|
j && /* @__PURE__ */ Y("div", {
|
|
168
168
|
"aria-label": x,
|
|
169
169
|
className: d("absolute left-[-1px] top-[-1px] flex size-full items-center justify-center rounded", Z.track),
|
|
170
|
-
children: /* @__PURE__ */ Y(
|
|
170
|
+
children: /* @__PURE__ */ Y(k, { size: 32 })
|
|
171
171
|
}),
|
|
172
172
|
/* @__PURE__ */ X("div", {
|
|
173
173
|
className: d("absolute right-0 top-0 flex gap-1"),
|
|
@@ -270,8 +270,8 @@ var Ne = (e) => {
|
|
|
270
270
|
id: h,
|
|
271
271
|
className: Z.imageActionButton
|
|
272
272
|
}),
|
|
273
|
-
w !== Ke.Loaded && /* @__PURE__ */ Y(
|
|
274
|
-
variant:
|
|
273
|
+
w !== Ke.Loaded && /* @__PURE__ */ Y(D, {
|
|
274
|
+
variant: O.Rectangular,
|
|
275
275
|
width: "100%",
|
|
276
276
|
height: "100%",
|
|
277
277
|
active: w === Ke.Loading,
|
|
@@ -437,17 +437,19 @@ var Ne = (e) => {
|
|
|
437
437
|
"Precise",
|
|
438
438
|
"Neutral",
|
|
439
439
|
"Creative"
|
|
440
|
-
], temperatureHint: b, labelClassName:
|
|
441
|
-
let
|
|
440
|
+
], temperatureHint: b, labelClassName: x = "!dial-small-semi-text", colors: S }) => {
|
|
441
|
+
let C = u({ "--csf-label-text": S?.labelText }), w = d(x, et.label, "gap-1");
|
|
442
442
|
return /* @__PURE__ */ X("div", {
|
|
443
|
-
className: "flex flex-col gap-4 px-6
|
|
444
|
-
style:
|
|
443
|
+
className: "flex flex-col gap-4 px-6 pb-3",
|
|
444
|
+
style: C,
|
|
445
445
|
children: [
|
|
446
446
|
e.responseFormat && /* @__PURE__ */ Y(m, {
|
|
447
447
|
fieldTitle: s,
|
|
448
|
-
|
|
448
|
+
groupLabelClassName: w,
|
|
449
|
+
containerClassName: "!gap-2",
|
|
450
|
+
formItemChildrenClassName: "mb-2",
|
|
449
451
|
elementId: "response-format",
|
|
450
|
-
orientation:
|
|
452
|
+
orientation: E.Column,
|
|
451
453
|
activeRadioButton: t ?? l.Markdown,
|
|
452
454
|
labelDescription: c,
|
|
453
455
|
radioButtons: [{
|
|
@@ -459,11 +461,12 @@ var Ne = (e) => {
|
|
|
459
461
|
}],
|
|
460
462
|
onChange: (e) => i(e)
|
|
461
463
|
}),
|
|
462
|
-
e.systemPrompt && /* @__PURE__ */ Y(
|
|
464
|
+
e.systemPrompt && /* @__PURE__ */ Y(j, {
|
|
463
465
|
value: n,
|
|
464
466
|
placeholder: _,
|
|
467
|
+
resize: !0,
|
|
465
468
|
labelProps: {
|
|
466
|
-
className:
|
|
469
|
+
className: w,
|
|
467
470
|
label: g
|
|
468
471
|
},
|
|
469
472
|
onChange: (e) => a(e ?? "")
|
|
@@ -471,7 +474,7 @@ var Ne = (e) => {
|
|
|
471
474
|
e.temperature && /* @__PURE__ */ Y(h, {
|
|
472
475
|
labelProps: {
|
|
473
476
|
label: v,
|
|
474
|
-
className:
|
|
477
|
+
className: w,
|
|
475
478
|
caption: b
|
|
476
479
|
},
|
|
477
480
|
value: r,
|
|
@@ -483,9 +486,9 @@ var Ne = (e) => {
|
|
|
483
486
|
})
|
|
484
487
|
]
|
|
485
488
|
});
|
|
486
|
-
}, nt = { modal: "
|
|
487
|
-
Oe(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings",
|
|
488
|
-
let { responseFormat:
|
|
489
|
+
}, nt = { modal: "_modal_kl0h0_1" };
|
|
490
|
+
Oe(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: h, temperatureHint: _, saveLabel: v = "Apply changes", saveDisabledTooltip: y, backgroundClassName: b = nt.modal }) => {
|
|
491
|
+
let { responseFormat: x, systemPrompt: S, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: A, handleSubmit: j } = $e({
|
|
489
492
|
features: e,
|
|
490
493
|
initialResponseFormat: t,
|
|
491
494
|
initialSystemPrompt: n,
|
|
@@ -493,41 +496,42 @@ Oe(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
493
496
|
onSave: i,
|
|
494
497
|
onClose: a
|
|
495
498
|
});
|
|
496
|
-
return /* @__PURE__ */ Y(
|
|
499
|
+
return /* @__PURE__ */ Y(C, {
|
|
497
500
|
open: !0,
|
|
498
501
|
header: o,
|
|
499
|
-
|
|
502
|
+
titleClassName: s,
|
|
503
|
+
size: w.Sm,
|
|
500
504
|
onClose: a,
|
|
501
|
-
className:
|
|
505
|
+
className: b,
|
|
502
506
|
footer: /* @__PURE__ */ Y("div", {
|
|
503
507
|
className: "flex justify-end px-6 py-4",
|
|
504
508
|
children: /* @__PURE__ */ Y(g, {
|
|
505
|
-
tooltip:
|
|
506
|
-
hideTooltip:
|
|
507
|
-
children: /* @__PURE__ */ Y(
|
|
508
|
-
label:
|
|
509
|
-
onClick:
|
|
510
|
-
disabled: !
|
|
509
|
+
tooltip: y,
|
|
510
|
+
hideTooltip: D || !y,
|
|
511
|
+
children: /* @__PURE__ */ Y(T, {
|
|
512
|
+
label: v,
|
|
513
|
+
onClick: j,
|
|
514
|
+
disabled: !D
|
|
511
515
|
})
|
|
512
516
|
})
|
|
513
517
|
}),
|
|
514
518
|
children: /* @__PURE__ */ Y(tt, {
|
|
515
519
|
features: e,
|
|
516
|
-
responseFormat:
|
|
517
|
-
systemPrompt:
|
|
518
|
-
temperature:
|
|
519
|
-
onResponseFormatChange:
|
|
520
|
-
onSystemPromptChange:
|
|
521
|
-
onTemperatureChange:
|
|
522
|
-
responseFormatLabel:
|
|
523
|
-
responseFormatHint:
|
|
524
|
-
responseFormatMarkdownLabel:
|
|
525
|
-
responseFormatPlainTextLabel:
|
|
526
|
-
systemPromptLabel:
|
|
527
|
-
systemPromptTooltip:
|
|
528
|
-
temperatureLabel:
|
|
529
|
-
temperatureLabels:
|
|
530
|
-
temperatureHint:
|
|
520
|
+
responseFormat: x,
|
|
521
|
+
systemPrompt: S,
|
|
522
|
+
temperature: E,
|
|
523
|
+
onResponseFormatChange: O,
|
|
524
|
+
onSystemPromptChange: k,
|
|
525
|
+
onTemperatureChange: A,
|
|
526
|
+
responseFormatLabel: c,
|
|
527
|
+
responseFormatHint: l,
|
|
528
|
+
responseFormatMarkdownLabel: u,
|
|
529
|
+
responseFormatPlainTextLabel: d,
|
|
530
|
+
systemPromptLabel: f,
|
|
531
|
+
systemPromptTooltip: p,
|
|
532
|
+
temperatureLabel: m,
|
|
533
|
+
temperatureLabels: h,
|
|
534
|
+
temperatureHint: _
|
|
531
535
|
})
|
|
532
536
|
});
|
|
533
537
|
});
|
|
@@ -633,8 +637,8 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
633
637
|
collapsedText: "_collapsedText_ovjc1_15",
|
|
634
638
|
startersDivider: "_startersDivider_ovjc1_26",
|
|
635
639
|
text: "_text_ovjc1_30"
|
|
636
|
-
}, 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:
|
|
637
|
-
let { colors: T, typography: E, 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" } =
|
|
640
|
+
}, 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: C, selectedAttachmentId: w }) => {
|
|
641
|
+
let { colors: T, typography: E, 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" } = C ?? {}, R = c ? (l ?? []).filter((e) => e.type !== t.Audio) : l ?? [], z = u({
|
|
638
642
|
"--cm-bubble-text": T?.text,
|
|
639
643
|
"--cm-starters-divider": T?.startersDivider
|
|
640
644
|
}), B = d($.text, E?.fontClassName), V = !!(h || g);
|
|
@@ -693,7 +697,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
693
697
|
children: p.map((e, t) => /* @__PURE__ */ Y("div", {
|
|
694
698
|
role: "listitem",
|
|
695
699
|
className: "min-w-[40px]",
|
|
696
|
-
children: /* @__PURE__ */ Y(
|
|
700
|
+
children: /* @__PURE__ */ Y(S, {
|
|
697
701
|
label: e.title,
|
|
698
702
|
className: "min-w-[40px]",
|
|
699
703
|
onClick: () => m(e)
|
|
@@ -713,7 +717,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
713
717
|
}), ct = /* @__PURE__ */ function(e) {
|
|
714
718
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
715
719
|
}({}), 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 }) => {
|
|
716
|
-
let { colors: v, typography: y, className: b, bubbleClassName:
|
|
720
|
+
let { colors: v, typography: y, className: b, bubbleClassName: S } = n ?? {}, { showMoreLabel: C = "Show more", showLessLabel: w = "Show less", showMoreAriaLabel: T, 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({
|
|
717
721
|
text: e,
|
|
718
722
|
collapsedLineCount: o
|
|
719
723
|
}), B = u({
|
|
@@ -746,7 +750,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
746
750
|
selectedAttachmentId: g
|
|
747
751
|
}),
|
|
748
752
|
e && /* @__PURE__ */ Y("div", {
|
|
749
|
-
className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", V,
|
|
753
|
+
className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", V, S),
|
|
750
754
|
children: /* @__PURE__ */ X("div", {
|
|
751
755
|
className: "flex min-w-0 flex-col items-start",
|
|
752
756
|
children: [/* @__PURE__ */ Y("div", {
|
|
@@ -757,7 +761,7 @@ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e =
|
|
|
757
761
|
className: d(H, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
|
|
758
762
|
children: e
|
|
759
763
|
})
|
|
760
|
-
}), F && /* @__PURE__ */ Y(
|
|
764
|
+
}), F && /* @__PURE__ */ Y(x, {
|
|
761
765
|
label: /* @__PURE__ */ Y(J, { children: ee }),
|
|
762
766
|
iconBefore: /* @__PURE__ */ Y(ne, {
|
|
763
767
|
size: p.SM,
|
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.211",
|
|
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.211",
|
|
23
|
+
"@epam/ai-dial-conversation-input": "1.1.0-dev.211",
|
|
24
24
|
"react-markdown": "^10.1.0",
|
|
25
25
|
"@epam/ai-dial-ui-kit": "^0.13.0-dev.26"
|
|
26
26
|
},
|