@epam/ai-dial-conversation-messages 1.2.0-dev.15 → 1.2.0-dev.152
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/AssistantMessageBubble.d.ts.map +1 -1
- package/components/MessageBubble/MessageBubble.d.ts.map +1 -1
- package/components/MessageBubble/UserMessageBubble.d.ts.map +1 -1
- package/constants/public-class-names.d.ts +7 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/index.css +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +201 -207
- package/models/message-bubble.d.ts +33 -19
- package/models/message-bubble.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/AssistantMessageBubble.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssistantMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/AssistantMessageBubble.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAGpC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAY/E,gHAAgH;AAChH,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAkNlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/MessageBubble.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAKtE,wGAAwG;AACxG,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"MessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/MessageBubble.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAKtE,wGAAwG;AACxG,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAyChD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/UserMessageBubble.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,EAAE,EAAS,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UserMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/UserMessageBubble.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,EAAE,EAAS,MAAM,OAAO,CAAC;AAElC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAO1E,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CA6JxD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const CONVERSATION_MESSAGES_CLASS: {
|
|
2
|
+
/** The user message's bubble element. */
|
|
3
|
+
readonly userBubble: "dial-cm-user-bubble";
|
|
4
|
+
/** The assistant message's streamed content region. */
|
|
5
|
+
readonly assistantContent: "dial-cm-assistant-content";
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=public-class-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,2BAA2B;IACtC,yCAAyC;;IAEzC,uDAAuD;;CAE/C,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
._activeRating_ygoee_1{color:var(--ma-active-rating-text,var(--text-accent,#1d4ed8))}._userBubble_cq829_1{border-color:var(--cm-bubble-user-border,var(--stroke-secondary,#d1dbea));background:var(--cm-bubble-user-bg,var(--bg-layer-sunken,#eef1f7))}._collapsibleText_cq829_6{max-height:var(--cm-bubble-collapsed-height);transition:max-height .2s ease-out}._expandedText_cq829_11{max-height:var(--cm-bubble-expanded-height)}._collapsedText_cq829_15:after{content:"";pointer-events:none;background:linear-gradient(to bottom, var(--cm-bubble-fade-start,var(--shadow-xs-2,#161b2d08)), var(--cm-bubble-user-bg,var(--bg-layer-sunken,#eef1f7)));height:3rem;position:absolute;bottom:0;left:0;right:0}@media (prefers-reduced-motion:reduce){._collapsibleText_cq829_6{transition:none}}._startersDivider_cq829_26{border-color:var(--cm-starters-divider,var(--stroke-secondary,#d1dbea))}._text_cq829_30{color:var(--cm-bubble-text,var(--text-primary,#161b2d))}
|
|
2
|
-
/*$vite$:1
|
|
2
|
+
/*$vite$:1*/.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.collapse{visibility:collapse}.static{position:static}.absolute{position:absolute}.relative{position:relative}.start-0{inset-inline-start:0}.top-0{top:0}.-me-1{margin-inline-end:-.25rem}.-ms-1{margin-inline-start:-.25rem}.ms-auto{margin-inline-start:auto}.mt-3{margin-top:.75rem}.block{display:block}.inline{display:inline}.flex{display:flex}.table{display:table}.w-\[calc\(100\%\+8px\)\]{width:calc(100% + 8px)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\[40px\]{min-width:40px}.max-w-\[640px\]{max-width:640px}.max-w-full{max-width:100%}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.overflow-hidden{overflow:hidden}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-ee-2xl{border-end-end-radius:1rem}.rounded-ee-md{border-end-end-radius:.375rem}.rounded-es-2xl{border-end-start-radius:1rem}.rounded-se-2xl{border-start-end-radius:1rem}.rounded-se-md{border-start-end-radius:.375rem}.rounded-ss-2xl{border-start-start-radius:1rem}.border{border-width:1px}.border-t{border-top-width:1px}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-4{padding-bottom:1rem;padding-top:1rem}.pe-1{padding-inline-end:.25rem}.ps-1{padding-inline-start:.25rem}.pt-5{padding-top:1.25rem}.text-start{text-align:start}.opacity-0{opacity:0}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}.group:hover .group-hover\:opacity-100{opacity:1}.\[\&\>\.cm-bubble-markdown\>div\>\*\:first-child\]\:indent-\[var\(--cm-bubble-first-line-indent\2c 0px\)\]>.cm-bubble-markdown>div>:first-child{text-indent:var(--cm-bubble-first-line-indent,0)}
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { CONVERSATION_MESSAGES_CLASS } from './constants/public-class-names';
|
|
1
2
|
export { MessageBubble } from './components/MessageBubble/MessageBubble';
|
|
2
3
|
export { UserMessageBubble } from './components/MessageBubble/UserMessageBubble';
|
|
3
4
|
export { AssistantMessageBubble } from './components/MessageBubble/AssistantMessageBubble';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAA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AAC;AACjC,YAAY,EACV,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,gDAAgD,CAAC;AACxD,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { AttachmentType as e, CopyIconButton as t, DeploymentIcon as n, MDMessageViewer as r, MessageRating as i, MessageRole as a,
|
|
2
|
-
import { AttachmentGroup as
|
|
3
|
-
import { DIAL_ICON_SIZE as
|
|
4
|
-
import { useCallback as
|
|
5
|
-
import { IconChevronDown as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
//#region src/
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { AttachmentType as e, CopyIconButton as t, DeploymentIcon as n, MDMessageViewer as r, MessageRating as i, MessageRole as a, ResponseFormat as o, buildCssVars as s, mergeClasses as c, useCollapsedText as l } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { AttachmentGroup as u } from "@epam/ai-dial-attachment-input";
|
|
3
|
+
import { DIAL_ICON_SIZE as d, DIAL_KIT_ICON_STROKE as f, ElementSize as p, InfoMessageNotification as m, LinkButton as h, NeutralButton as g, ToggleIconButton as _ } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { useCallback as v, useEffect as y, useId as b, useMemo as x, useRef as S, useState as C } from "react";
|
|
5
|
+
import { IconChevronDown as w, IconChevronUp as T, IconMarkdown as E, IconPencilMinus as D, IconRefresh as O, IconThumbDown as k, IconThumbDownFilled as A, IconThumbUp as j, IconThumbUpFilled as M, IconTrashX as N } from "@tabler/icons-react";
|
|
6
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
7
|
+
//#region src/constants/public-class-names.ts
|
|
8
|
+
var L = {
|
|
9
|
+
userBubble: "dial-cm-user-bubble",
|
|
10
|
+
assistantContent: "dial-cm-assistant-content"
|
|
11
|
+
}, R = 4, z = (e) => {
|
|
12
|
+
let t = S(null), [n, r] = C(0);
|
|
13
|
+
return y(() => {
|
|
11
14
|
if (!e) return;
|
|
12
15
|
let n = t.current;
|
|
13
16
|
if (n == null) return;
|
|
@@ -18,308 +21,298 @@ var I = 4, L = (e) => {
|
|
|
18
21
|
return i.observe(n), () => i.disconnect();
|
|
19
22
|
}, [e]), {
|
|
20
23
|
slotRef: t,
|
|
21
|
-
firstLineIndent: e ? `calc(${n}px + ${
|
|
24
|
+
firstLineIndent: e ? `calc(${n}px + ${R}px)` : void 0
|
|
22
25
|
};
|
|
23
|
-
},
|
|
24
|
-
let { tooltips: L, ariaLabels:
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
m?.(), H("markdown"), W(
|
|
28
|
-
}, [m,
|
|
29
|
-
return G ? /* @__PURE__ */
|
|
26
|
+
}, B = { activeRating: "_activeRating_ygoee_1" }, V = 2e3, H = ({ role: e = a.User, onEdit: n, onEditHover: r, onDelete: o, onRegenerate: l, onCopy: u, onCopyMarkdown: m, onLike: h, onDislike: g, activeRating: y, isAlwaysVisible: b, isDisabled: x = !1, className: S, labels: w, colors: T }) => {
|
|
27
|
+
let { tooltips: L, ariaLabels: R } = w ?? {}, [z, H] = C(null), [U, W] = C(""), G = n != null || o != null || l != null || u != null || m != null || h != null || g != null, K = s({ "--ma-active-rating-text": T?.activeRatingText }), q = v(() => {
|
|
28
|
+
u?.(), H("copy"), W(R?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => H(null), V);
|
|
29
|
+
}, [u, R?.copiedStatus]), J = v(() => {
|
|
30
|
+
m?.(), H("markdown"), W(R?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => H(null), V);
|
|
31
|
+
}, [m, R?.copiedMarkdownStatus]);
|
|
32
|
+
return G ? /* @__PURE__ */ I("div", {
|
|
30
33
|
role: "toolbar",
|
|
31
|
-
"aria-label":
|
|
34
|
+
"aria-label": R?.actionsGroup ?? "Message actions",
|
|
32
35
|
style: K,
|
|
33
|
-
className:
|
|
34
|
-
children: [/* @__PURE__ */
|
|
36
|
+
className: c("flex gap-1", !b && "opacity-0 group-hover:opacity-100", S),
|
|
37
|
+
children: [/* @__PURE__ */ F("span", {
|
|
35
38
|
role: "status",
|
|
36
39
|
"aria-live": "polite",
|
|
37
40
|
className: "sr-only",
|
|
38
41
|
children: U
|
|
39
|
-
}), e === a.User ? /* @__PURE__ */
|
|
40
|
-
icon: /* @__PURE__ */
|
|
41
|
-
size:
|
|
42
|
+
}), e === a.User ? /* @__PURE__ */ I(P, { children: [n && /* @__PURE__ */ F(_, {
|
|
43
|
+
icon: /* @__PURE__ */ F(D, {
|
|
44
|
+
size: d.SM,
|
|
42
45
|
"aria-hidden": !0,
|
|
43
|
-
stroke:
|
|
46
|
+
stroke: f
|
|
44
47
|
}),
|
|
45
|
-
size:
|
|
46
|
-
"aria-label":
|
|
48
|
+
size: p.Small,
|
|
49
|
+
"aria-label": R?.editMessage ?? "Edit message",
|
|
47
50
|
tooltipProps: { tooltip: L?.edit ?? "Edit" },
|
|
48
51
|
onClick: n,
|
|
49
52
|
onMouseEnter: r,
|
|
50
53
|
onFocus: r,
|
|
51
54
|
disabled: x
|
|
52
|
-
}),
|
|
53
|
-
icon: /* @__PURE__ */
|
|
54
|
-
size:
|
|
55
|
+
}), o && /* @__PURE__ */ F(_, {
|
|
56
|
+
icon: /* @__PURE__ */ F(N, {
|
|
57
|
+
size: d.SM,
|
|
55
58
|
"aria-hidden": !0,
|
|
56
|
-
stroke:
|
|
59
|
+
stroke: f
|
|
57
60
|
}),
|
|
58
|
-
size:
|
|
59
|
-
"aria-label":
|
|
61
|
+
size: p.Small,
|
|
62
|
+
"aria-label": R?.deleteMessage ?? "Delete message",
|
|
60
63
|
tooltipProps: { tooltip: L?.delete ?? "Delete" },
|
|
61
|
-
onClick:
|
|
64
|
+
onClick: o,
|
|
62
65
|
disabled: x
|
|
63
|
-
})] }) : /* @__PURE__ */
|
|
64
|
-
l && /* @__PURE__ */
|
|
65
|
-
icon: /* @__PURE__ */
|
|
66
|
-
size:
|
|
66
|
+
})] }) : /* @__PURE__ */ I(P, { children: [
|
|
67
|
+
l && /* @__PURE__ */ F(_, {
|
|
68
|
+
icon: /* @__PURE__ */ F(O, {
|
|
69
|
+
size: d.SM,
|
|
67
70
|
"aria-hidden": !0,
|
|
68
|
-
stroke:
|
|
71
|
+
stroke: f
|
|
69
72
|
}),
|
|
70
|
-
size:
|
|
71
|
-
"aria-label":
|
|
73
|
+
size: p.Small,
|
|
74
|
+
"aria-label": R?.regenerateResponse ?? "Regenerate response",
|
|
72
75
|
tooltipProps: { tooltip: L?.regenerate ?? "Regenerate" },
|
|
73
76
|
onClick: l,
|
|
74
77
|
disabled: x
|
|
75
78
|
}),
|
|
76
|
-
|
|
77
|
-
iconSize:
|
|
79
|
+
u && /* @__PURE__ */ F(t, {
|
|
80
|
+
iconSize: d.SM,
|
|
78
81
|
onClick: q,
|
|
79
|
-
size:
|
|
80
|
-
isCopied:
|
|
82
|
+
size: p.Small,
|
|
83
|
+
isCopied: z === "copy",
|
|
81
84
|
copyLabel: L?.copy ?? "Copy",
|
|
82
85
|
copiedLabel: L?.copied ?? "Copied!",
|
|
83
|
-
ariaLabel:
|
|
86
|
+
ariaLabel: R?.copyResponse ?? "Copy response",
|
|
84
87
|
isDisabled: x
|
|
85
88
|
}),
|
|
86
|
-
m && /* @__PURE__ */
|
|
87
|
-
iconSize:
|
|
89
|
+
m && /* @__PURE__ */ F(t, {
|
|
90
|
+
iconSize: d.SM,
|
|
88
91
|
onClick: J,
|
|
89
|
-
size:
|
|
90
|
-
isCopied:
|
|
91
|
-
iconCopy: /* @__PURE__ */
|
|
92
|
-
size:
|
|
92
|
+
size: p.Small,
|
|
93
|
+
isCopied: z === "markdown",
|
|
94
|
+
iconCopy: /* @__PURE__ */ F(E, {
|
|
95
|
+
size: d.SM,
|
|
93
96
|
"aria-hidden": !0,
|
|
94
|
-
stroke:
|
|
97
|
+
stroke: f
|
|
95
98
|
}),
|
|
96
99
|
copyLabel: L?.copyMarkdown ?? "Copy as Markdown",
|
|
97
100
|
copiedLabel: L?.copiedMarkdown ?? "Copied!",
|
|
98
|
-
ariaLabel:
|
|
101
|
+
ariaLabel: R?.copyAsMarkdown ?? "Copy as markdown",
|
|
99
102
|
isDisabled: x
|
|
100
103
|
}),
|
|
101
|
-
h && /* @__PURE__ */
|
|
102
|
-
icon: y === i.Like ? /* @__PURE__ */
|
|
103
|
-
className:
|
|
104
|
-
size:
|
|
104
|
+
h && /* @__PURE__ */ F(_, {
|
|
105
|
+
icon: y === i.Like ? /* @__PURE__ */ F(M, {
|
|
106
|
+
className: B.activeRating,
|
|
107
|
+
size: d.SM,
|
|
105
108
|
"aria-hidden": !0
|
|
106
|
-
}) : /* @__PURE__ */
|
|
107
|
-
size:
|
|
109
|
+
}) : /* @__PURE__ */ F(j, {
|
|
110
|
+
size: d.SM,
|
|
108
111
|
"aria-hidden": !0,
|
|
109
|
-
stroke:
|
|
112
|
+
stroke: f
|
|
110
113
|
}),
|
|
111
|
-
size:
|
|
112
|
-
"aria-label":
|
|
114
|
+
size: p.Small,
|
|
115
|
+
"aria-label": R?.likeResponse ?? "Like response",
|
|
113
116
|
"aria-pressed": y === i.Like,
|
|
114
117
|
tooltipProps: { tooltip: L?.like ?? "Like" },
|
|
115
118
|
onClick: h,
|
|
116
119
|
disabled: x
|
|
117
120
|
}),
|
|
118
|
-
|
|
119
|
-
icon: y === i.Dislike ? /* @__PURE__ */
|
|
120
|
-
className:
|
|
121
|
-
size:
|
|
121
|
+
g && /* @__PURE__ */ F(_, {
|
|
122
|
+
icon: y === i.Dislike ? /* @__PURE__ */ F(A, {
|
|
123
|
+
className: B.activeRating,
|
|
124
|
+
size: d.SM,
|
|
122
125
|
"aria-hidden": !0
|
|
123
|
-
}) : /* @__PURE__ */
|
|
124
|
-
size:
|
|
126
|
+
}) : /* @__PURE__ */ F(k, {
|
|
127
|
+
size: d.SM,
|
|
125
128
|
"aria-hidden": !0,
|
|
126
|
-
stroke:
|
|
129
|
+
stroke: f
|
|
127
130
|
}),
|
|
128
|
-
size:
|
|
129
|
-
"aria-label":
|
|
131
|
+
size: p.Small,
|
|
132
|
+
"aria-label": R?.dislikeResponse ?? "Dislike response",
|
|
130
133
|
"aria-pressed": y === i.Dislike,
|
|
131
134
|
tooltipProps: { tooltip: L?.dislike ?? "Dislike" },
|
|
132
|
-
onClick:
|
|
135
|
+
onClick: g,
|
|
133
136
|
disabled: x
|
|
134
137
|
})
|
|
135
138
|
] })]
|
|
136
139
|
}) : null;
|
|
137
|
-
},
|
|
140
|
+
}, U = {
|
|
138
141
|
userBubble: "_userBubble_cq829_1",
|
|
139
142
|
collapsibleText: "_collapsibleText_cq829_6",
|
|
140
143
|
expandedText: "_expandedText_cq829_11",
|
|
141
144
|
collapsedText: "_collapsedText_cq829_15",
|
|
142
145
|
startersDivider: "_startersDivider_cq829_26",
|
|
143
146
|
text: "_text_cq829_30"
|
|
144
|
-
},
|
|
145
|
-
let { colors:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
downloadCsvLabel: Q,
|
|
151
|
-
openInCanvasLabel: $
|
|
147
|
+
}, W = "[&>.cm-bubble-markdown>div>*:first-child]:indent-[var(--cm-bubble-first-line-indent,0px)]", G = ({ text: t, styles: i, actions: l, hasAlwaysVisibleActions: d, isStreaming: f, attachments: p, beforeContent: m, responseFormat: h, afterContent: _, starters: v, onSelectStarter: y, deploymentIconUrl: b, deploymentDisplayName: S, markdownComponents: C, markdownClassNames: w, markdownUrlTransform: T, onAttachmentClick: E, onDownloadAll: D, onAttachmentRetry: O, codeBlockTheme: k, tableOnOpenInCanvas: A, labels: j, selectedAttachmentId: M }) => {
|
|
148
|
+
let { colors: N, typography: P, className: R, bubbleClassName: B } = i ?? {}, { attachmentClickLabel: V, attachmentRetryLabel: G, attachmentOpenInNewTabLabel: K, startersAriaLabel: q = "Quick reply buttons", thinkingLabel: J, codeBlockCopyLabel: Y, codeBlockCopiedLabel: X, tableCopyLabel: Z, tableCopiedLabel: Q, tableDownloadCsvLabel: $, tableOpenInCanvasLabel: ee, tableDownloadFilename: te, tableScrollRegionAriaLabel: ne, assistantMessageAriaLabel: re = "Assistant message", deploymentIconFallbackLabel: ie = "AI" } = j ?? {}, ae = x(() => ({
|
|
149
|
+
copyLabel: Z,
|
|
150
|
+
copiedLabel: Q,
|
|
151
|
+
downloadCsvLabel: $,
|
|
152
|
+
openInCanvasLabel: ee
|
|
152
153
|
}), [
|
|
153
|
-
J,
|
|
154
|
-
Y,
|
|
155
|
-
X,
|
|
156
154
|
Z,
|
|
157
155
|
Q,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
"--cm-
|
|
162
|
-
"--cm-
|
|
163
|
-
|
|
164
|
-
|
|
156
|
+
$,
|
|
157
|
+
ee
|
|
158
|
+
]), oe = f ? (p ?? []).filter((t) => t.type !== e.Audio) : p ?? [], { slotRef: se, firstLineIndent: ce } = z(m != null && !!t), le = s({
|
|
159
|
+
"--cm-bubble-text": N?.text,
|
|
160
|
+
"--cm-starters-divider": N?.startersDivider,
|
|
161
|
+
"--cm-bubble-first-line-indent": ce
|
|
162
|
+
}), ue = c(U.text, P?.fontClassName), de = !!(b || S);
|
|
163
|
+
return /* @__PURE__ */ I("div", {
|
|
165
164
|
role: "group",
|
|
166
|
-
"aria-label":
|
|
167
|
-
style:
|
|
168
|
-
className:
|
|
169
|
-
children: [
|
|
170
|
-
src:
|
|
165
|
+
"aria-label": re,
|
|
166
|
+
style: le,
|
|
167
|
+
className: c("flex w-full items-start gap-3", R),
|
|
168
|
+
children: [de && /* @__PURE__ */ F(n, {
|
|
169
|
+
src: b,
|
|
171
170
|
size: 28,
|
|
172
|
-
initialsName:
|
|
173
|
-
labels: { tooltip:
|
|
174
|
-
}), /* @__PURE__ */
|
|
171
|
+
initialsName: S || ie,
|
|
172
|
+
labels: { tooltip: S ?? ie }
|
|
173
|
+
}), /* @__PURE__ */ I("div", {
|
|
175
174
|
className: "flex w-full min-w-0 max-w-full flex-col items-start gap-5",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
177
|
-
className:
|
|
175
|
+
children: [/* @__PURE__ */ I("div", {
|
|
176
|
+
className: c("flex w-full min-w-0 max-w-full flex-col items-start gap-4", B),
|
|
178
177
|
children: [
|
|
179
|
-
|
|
178
|
+
m != null && !t && /* @__PURE__ */ F("div", {
|
|
180
179
|
className: "min-w-0",
|
|
181
|
-
children:
|
|
180
|
+
children: m
|
|
182
181
|
}),
|
|
183
|
-
(t ||
|
|
182
|
+
(t || f) && /* @__PURE__ */ I("div", {
|
|
184
183
|
"aria-live": "polite",
|
|
185
184
|
"aria-atomic": "false",
|
|
186
|
-
className:
|
|
187
|
-
children: [
|
|
188
|
-
ref:
|
|
185
|
+
className: c(ue, "relative min-w-0 max-w-full text-start", m != null && t && W, L.assistantContent),
|
|
186
|
+
children: [m != null && t && /* @__PURE__ */ F("div", {
|
|
187
|
+
ref: se,
|
|
189
188
|
className: "absolute start-0 top-0",
|
|
190
|
-
children:
|
|
191
|
-
}), /* @__PURE__ */
|
|
189
|
+
children: m
|
|
190
|
+
}), /* @__PURE__ */ F("div", {
|
|
192
191
|
className: "cm-bubble-markdown min-w-0 max-w-full",
|
|
193
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ F(r, {
|
|
194
193
|
content: t ?? "",
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
194
|
+
isPlainText: h === o.PlainText,
|
|
195
|
+
isStreaming: f,
|
|
196
|
+
thinkingLabel: J,
|
|
197
|
+
components: C,
|
|
198
|
+
classNames: w,
|
|
199
|
+
urlTransform: T,
|
|
200
|
+
codeBlockCopyLabel: Y,
|
|
201
|
+
codeBlockCopiedLabel: X,
|
|
202
|
+
codeBlockTheme: k,
|
|
203
|
+
tableActionLabels: ae,
|
|
204
|
+
tableDownloadFilename: te,
|
|
205
|
+
tableOnOpenInCanvas: A,
|
|
206
|
+
tableScrollRegionAriaLabel: ne
|
|
207
207
|
})
|
|
208
208
|
})]
|
|
209
209
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
attachments:
|
|
212
|
-
onAttachmentClick: (e) =>
|
|
213
|
-
onDownloadAll:
|
|
214
|
-
onRetry:
|
|
210
|
+
/* @__PURE__ */ F(u, {
|
|
211
|
+
attachments: oe,
|
|
212
|
+
onAttachmentClick: (e) => E?.(p?.find((t) => t.id === e)),
|
|
213
|
+
onDownloadAll: D,
|
|
214
|
+
onRetry: O,
|
|
215
215
|
labels: {
|
|
216
|
-
clickLabel:
|
|
217
|
-
retryLabel:
|
|
218
|
-
openInNewTabLabel:
|
|
216
|
+
clickLabel: V,
|
|
217
|
+
retryLabel: G,
|
|
218
|
+
openInNewTabLabel: K
|
|
219
219
|
},
|
|
220
|
-
selectedAttachmentId:
|
|
220
|
+
selectedAttachmentId: M
|
|
221
221
|
}),
|
|
222
|
-
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
...
|
|
225
|
-
isAlwaysVisible:
|
|
222
|
+
_,
|
|
223
|
+
/* @__PURE__ */ F(H, {
|
|
224
|
+
...l,
|
|
225
|
+
isAlwaysVisible: d,
|
|
226
226
|
role: a.Assistant
|
|
227
227
|
})
|
|
228
228
|
]
|
|
229
|
-
}),
|
|
229
|
+
}), v && v.length > 0 && y && /* @__PURE__ */ F("div", {
|
|
230
230
|
role: "list",
|
|
231
|
-
"aria-label":
|
|
232
|
-
className:
|
|
233
|
-
children:
|
|
231
|
+
"aria-label": q,
|
|
232
|
+
className: c("flex w-full flex-wrap gap-2 border-t pt-5", U.startersDivider),
|
|
233
|
+
children: v.map((e, t) => /* @__PURE__ */ F("div", {
|
|
234
234
|
role: "listitem",
|
|
235
235
|
className: "min-w-[40px]",
|
|
236
|
-
children: /* @__PURE__ */
|
|
236
|
+
children: /* @__PURE__ */ F(g, {
|
|
237
237
|
label: e.title,
|
|
238
238
|
className: "min-w-[40px]",
|
|
239
|
-
onClick: () =>
|
|
239
|
+
onClick: () => y(e)
|
|
240
240
|
})
|
|
241
241
|
}, t))
|
|
242
242
|
})]
|
|
243
243
|
})]
|
|
244
244
|
});
|
|
245
|
-
},
|
|
245
|
+
}, K = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ F("div", {
|
|
246
246
|
role: "status",
|
|
247
247
|
"aria-live": "polite",
|
|
248
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ F(m, {
|
|
249
249
|
title: e,
|
|
250
250
|
message: t,
|
|
251
251
|
textClassName: "flex-row flex-wrap gap-1"
|
|
252
252
|
})
|
|
253
|
-
}),
|
|
253
|
+
}), q = /* @__PURE__ */ function(e) {
|
|
254
254
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
255
|
-
}({}),
|
|
256
|
-
let { colors: S, typography:
|
|
255
|
+
}({}), J = 10, Y = ({ text: e, position: t = q.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: o, collapsedLineCount: f = J, labels: m, textSegments: g, onAttachmentClick: _, onDownloadAll: v, onAttachmentRetry: y, selectedAttachmentId: x }) => {
|
|
256
|
+
let { colors: S, typography: C, className: E, bubbleClassName: D } = n ?? {}, { showMoreLabel: O = "Show more", showLessLabel: k = "Show less", showMoreAriaLabel: A, showLessAriaLabel: j, attachmentClickLabel: M, attachmentRetryLabel: N, attachmentOpenInNewTabLabel: R, userMessageAriaLabel: z = "User message" } = m ?? {}, { textRef: B, isTextCollapsed: V, isOverflowing: W, collapsedMaxHeight: G, expandedMaxHeight: K, isCollapsed: Y, toggleCollapsed: X } = l({
|
|
257
257
|
text: e ?? "",
|
|
258
|
-
collapsedLineCount:
|
|
259
|
-
}),
|
|
258
|
+
collapsedLineCount: f
|
|
259
|
+
}), Z = s({
|
|
260
260
|
"--cm-bubble-user-bg": S?.userBackground,
|
|
261
261
|
"--cm-bubble-user-border": S?.userBorder,
|
|
262
262
|
"--cm-bubble-fade-start": S?.fadeStart,
|
|
263
263
|
"--cm-bubble-text": S?.text,
|
|
264
|
-
"--cm-bubble-collapsed-height":
|
|
265
|
-
"--cm-bubble-expanded-height":
|
|
266
|
-
}),
|
|
267
|
-
return /* @__PURE__ */
|
|
264
|
+
"--cm-bubble-collapsed-height": W ? `${G}px` : void 0,
|
|
265
|
+
"--cm-bubble-expanded-height": W ? `${K}px` : void 0
|
|
266
|
+
}), Q = t === q.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", $ = c(U.text, C?.fontClassName), ee = A ?? O, te = j ?? k, ne = Y ? O : k, re = Y ? ee : te, ie = Y ? w : T, ae = b();
|
|
267
|
+
return /* @__PURE__ */ F("div", {
|
|
268
268
|
role: "group",
|
|
269
|
-
"aria-label":
|
|
270
|
-
style:
|
|
271
|
-
className:
|
|
272
|
-
children: /* @__PURE__ */
|
|
269
|
+
"aria-label": z,
|
|
270
|
+
style: Z,
|
|
271
|
+
className: c("flex w-full", E),
|
|
272
|
+
children: /* @__PURE__ */ I("div", {
|
|
273
273
|
className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
|
|
274
274
|
children: [
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
attachments:
|
|
277
|
-
onAttachmentClick: (e) => _?.(
|
|
275
|
+
/* @__PURE__ */ F(u, {
|
|
276
|
+
attachments: o ?? [],
|
|
277
|
+
onAttachmentClick: (e) => _?.(o?.find((t) => t.id === e)),
|
|
278
278
|
onDownloadAll: v,
|
|
279
|
-
onRetry:
|
|
279
|
+
onRetry: y,
|
|
280
280
|
labels: {
|
|
281
281
|
clickLabel: M,
|
|
282
|
-
retryLabel:
|
|
283
|
-
openInNewTabLabel:
|
|
282
|
+
retryLabel: N,
|
|
283
|
+
openInNewTabLabel: R
|
|
284
284
|
},
|
|
285
285
|
styles: { className: "max-w-[640px]" },
|
|
286
286
|
selectedAttachmentId: x
|
|
287
287
|
}),
|
|
288
|
-
|
|
289
|
-
className:
|
|
290
|
-
children: /* @__PURE__ */
|
|
288
|
+
e && /* @__PURE__ */ F("div", {
|
|
289
|
+
className: c(U.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", Q, D, L.userBubble),
|
|
290
|
+
children: /* @__PURE__ */ I("div", {
|
|
291
291
|
className: "flex min-w-0 flex-col items-start",
|
|
292
|
-
children: [
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
children: [g != null && /* @__PURE__ */ P("span", {
|
|
300
|
-
className: "me-1",
|
|
301
|
-
children: g
|
|
302
|
-
}), e]
|
|
303
|
-
})
|
|
304
|
-
}),
|
|
305
|
-
g != null && !e && /* @__PURE__ */ P("div", { children: g }),
|
|
306
|
-
U && /* @__PURE__ */ P(m, {
|
|
307
|
-
label: /* @__PURE__ */ P(N, { children: te }),
|
|
308
|
-
iconBefore: /* @__PURE__ */ P(re, {
|
|
309
|
-
size: u.SM,
|
|
310
|
-
"aria-hidden": "true"
|
|
311
|
-
}),
|
|
312
|
-
"aria-label": ne,
|
|
313
|
-
"aria-expanded": !J,
|
|
314
|
-
"aria-controls": ie,
|
|
315
|
-
className: "mt-3",
|
|
316
|
-
onClick: Y,
|
|
317
|
-
size: f.Small
|
|
292
|
+
children: [/* @__PURE__ */ F("div", {
|
|
293
|
+
id: ae,
|
|
294
|
+
className: c("relative -me-1 -ms-1 w-[calc(100%+8px)] overflow-hidden pe-1 ps-1", W && U.collapsibleText, W && !Y && U.expandedText, V && U.collapsedText),
|
|
295
|
+
children: /* @__PURE__ */ F("p", {
|
|
296
|
+
ref: B,
|
|
297
|
+
className: c($, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
|
|
298
|
+
children: g ?? e
|
|
318
299
|
})
|
|
319
|
-
|
|
300
|
+
}), W && /* @__PURE__ */ F(h, {
|
|
301
|
+
label: /* @__PURE__ */ F(P, { children: ne }),
|
|
302
|
+
iconBefore: /* @__PURE__ */ F(ie, {
|
|
303
|
+
size: d.SM,
|
|
304
|
+
"aria-hidden": "true"
|
|
305
|
+
}),
|
|
306
|
+
"aria-label": re,
|
|
307
|
+
"aria-expanded": !Y,
|
|
308
|
+
"aria-controls": ae,
|
|
309
|
+
className: "mt-3",
|
|
310
|
+
onClick: X,
|
|
311
|
+
size: p.Small
|
|
312
|
+
})]
|
|
320
313
|
})
|
|
321
314
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ F(H, {
|
|
323
316
|
...r,
|
|
324
317
|
isAlwaysVisible: i,
|
|
325
318
|
role: a.User
|
|
@@ -327,19 +320,20 @@ var I = 4, L = (e) => {
|
|
|
327
320
|
]
|
|
328
321
|
})
|
|
329
322
|
});
|
|
330
|
-
},
|
|
331
|
-
titleText:
|
|
332
|
-
bodyText:
|
|
333
|
-
} }) : e === a.User ? /* @__PURE__ */
|
|
334
|
-
...
|
|
335
|
-
|
|
336
|
-
onAttachmentClick:
|
|
337
|
-
}) : /* @__PURE__ */
|
|
338
|
-
...
|
|
323
|
+
}, X = ({ role: e, beforeContent: t, textSegments: n, onAttachmentClick: r, responseFormat: i, markdownComponents: o, markdownUrlTransform: s, ...c }) => e === a.Status ? /* @__PURE__ */ F(K, { labels: {
|
|
324
|
+
titleText: c.labels?.statusTitleText,
|
|
325
|
+
bodyText: c.labels?.statusBodyText ?? ""
|
|
326
|
+
} }) : e === a.User ? /* @__PURE__ */ F(Y, {
|
|
327
|
+
...c,
|
|
328
|
+
textSegments: n,
|
|
329
|
+
onAttachmentClick: r
|
|
330
|
+
}) : /* @__PURE__ */ F(G, {
|
|
331
|
+
...c,
|
|
339
332
|
beforeContent: t,
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
333
|
+
responseFormat: i,
|
|
334
|
+
markdownComponents: o,
|
|
335
|
+
markdownUrlTransform: s,
|
|
336
|
+
onAttachmentClick: r
|
|
343
337
|
});
|
|
344
338
|
//#endregion
|
|
345
|
-
export {
|
|
339
|
+
export { G as AssistantMessageBubble, q as BubblePosition, L as CONVERSATION_MESSAGES_CLASS, H as MessageActions, X as MessageBubble, K as StatusMessageBubble, Y as UserMessageBubble };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CodeBlockTheme, DisplayAttachment, MarkdownRendererClassNames, MessageRole, StarterOption } from '@epam/ai-dial-chat-shared';
|
|
1
|
+
import { CodeBlockTheme, DisplayAttachment, MarkdownRendererClassNames, MessageRole, ResponseFormat, StarterOption } from '@epam/ai-dial-chat-shared';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { Components } from 'react-markdown';
|
|
4
4
|
import { BubblePosition } from '../types/bubble-position';
|
|
@@ -67,12 +67,8 @@ export interface AssistantMessageBubbleLabels extends MessageBubbleLabels {
|
|
|
67
67
|
codeBlockCopyLabel?: string;
|
|
68
68
|
/** aria-label for the code block copy button after copying. */
|
|
69
69
|
codeBlockCopiedLabel?: string;
|
|
70
|
-
/** Label for
|
|
71
|
-
|
|
72
|
-
/** Label for copying a Markdown table as text. */
|
|
73
|
-
tableCopyTxtLabel?: string;
|
|
74
|
-
/** Label for copying a Markdown table as Markdown. */
|
|
75
|
-
tableCopyMarkdownLabel?: string;
|
|
70
|
+
/** Label for the copy action on a Markdown table (copies as Markdown format). */
|
|
71
|
+
tableCopyLabel?: string;
|
|
76
72
|
/** Status announced after a Markdown table has been copied. */
|
|
77
73
|
tableCopiedLabel?: string;
|
|
78
74
|
/** Label for downloading a Markdown table as CSV. */
|
|
@@ -110,17 +106,6 @@ interface BaseMessageBubbleProps {
|
|
|
110
106
|
onAttachmentRetry?: (id: string) => void;
|
|
111
107
|
/** ID of the attachment currently open in the canvas panel, if any. Renders that tile's selected visual state. */
|
|
112
108
|
selectedAttachmentId?: string;
|
|
113
|
-
/**
|
|
114
|
-
* Content rendered at the inline-start of the message's first text line,
|
|
115
|
-
* which word-flows after it (e.g. a used-skill chip — inline-level content
|
|
116
|
-
* no taller than a text line). The user bubble renders it inline within
|
|
117
|
-
* the text; the assistant bubble overlays it on the first markdown block's
|
|
118
|
-
* first line, which indents past it. The user bubble renders for the slot
|
|
119
|
-
* alone even when `text` is empty; an assistant message with no text
|
|
120
|
-
* renders the slot on its own line — above the streaming placeholder while
|
|
121
|
-
* the first token has not arrived yet.
|
|
122
|
-
*/
|
|
123
|
-
beforeContent?: ReactNode;
|
|
124
109
|
}
|
|
125
110
|
/** Props for `UserMessageBubble`. */
|
|
126
111
|
export interface UserMessageBubbleProps extends BaseMessageBubbleProps {
|
|
@@ -128,9 +113,38 @@ export interface UserMessageBubbleProps extends BaseMessageBubbleProps {
|
|
|
128
113
|
position?: BubblePosition;
|
|
129
114
|
/** Maximum number of text lines shown while a long user message is collapsed. Defaults to `10`. */
|
|
130
115
|
collapsedLineCount?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Ordered content replacing the plain-text render when present —
|
|
118
|
+
* interleaved plain-text runs and inline elements (e.g. skill-mention
|
|
119
|
+
* chips at their text position), rendered in place of `text` inside the
|
|
120
|
+
* same paragraph. `text` is still required alongside this: it remains the
|
|
121
|
+
* identity/measurement input for the collapse-height calculation
|
|
122
|
+
* (`useCollapsedText`), even though `textSegments` is what's visually
|
|
123
|
+
* rendered. Absent renders `text` directly, byte-identical to today.
|
|
124
|
+
*/
|
|
125
|
+
textSegments?: ReactNode[];
|
|
131
126
|
}
|
|
132
127
|
/** Props for `AssistantMessageBubble`. */
|
|
133
128
|
export interface AssistantMessageBubbleProps extends BaseMessageBubbleProps {
|
|
129
|
+
/**
|
|
130
|
+
* Conversation response format. `ResponseFormat.PlainText` renders the
|
|
131
|
+
* message body verbatim — no Markdown pipeline, so a table, a heading, or
|
|
132
|
+
* `**bold**` reaches the reader exactly as the model wrote it — and the
|
|
133
|
+
* markdown-only props below stop applying. Defaults to
|
|
134
|
+
* `ResponseFormat.Markdown`.
|
|
135
|
+
*/
|
|
136
|
+
responseFormat?: ResponseFormat;
|
|
137
|
+
/**
|
|
138
|
+
* Content rendered at the inline-start of the message's first markdown
|
|
139
|
+
* block's first line, which word-flows after it (e.g. used-skill chips —
|
|
140
|
+
* inline-level content no taller than a text line). Overlaid on the first
|
|
141
|
+
* line, which indents past it; an assistant message with no text renders
|
|
142
|
+
* the slot on its own line — above the streaming placeholder while the
|
|
143
|
+
* first token has not arrived yet. May itself be an array of elements
|
|
144
|
+
* (e.g. one `ChatSkill` per mention) — React renders `ReactNode[]` as a
|
|
145
|
+
* sibling sequence with no extra wrapper needed.
|
|
146
|
+
*/
|
|
147
|
+
beforeContent?: ReactNode;
|
|
134
148
|
/** react-markdown component overrides. Use to inject custom renderers (e.g. citation markers) into markdown elements. */
|
|
135
149
|
markdownComponents?: Components;
|
|
136
150
|
/** Per-element markdown typography classes. Defaults to the renderer's full-size scale; pass `COMPACT_MARKDOWN_CLASS_NAMES` for the smaller body scale. */
|
|
@@ -159,7 +173,7 @@ export interface AssistantMessageBubbleProps extends BaseMessageBubbleProps {
|
|
|
159
173
|
labels?: AssistantMessageBubbleLabels;
|
|
160
174
|
}
|
|
161
175
|
/** Props for `MessageBubble` — `AssistantMessageBubbleProps` plus user-only fields and `role`. */
|
|
162
|
-
export type MessageBubbleProps = AssistantMessageBubbleProps & Pick<UserMessageBubbleProps, 'position' | 'collapsedLineCount'> & {
|
|
176
|
+
export type MessageBubbleProps = AssistantMessageBubbleProps & Pick<UserMessageBubbleProps, 'position' | 'collapsedLineCount' | 'textSegments'> & {
|
|
163
177
|
/** Message author/type: user, assistant, or status banner. */
|
|
164
178
|
role: MessageRole;
|
|
165
179
|
};
|
|
@@ -1 +1 @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AA4B,CAAC;CACvC;AAED,kGAAkG;AAClG,MAAM,MAAM,kBAAkB,GAAG,2BAA2B,GAC1D,IAAI,CACF,sBAAsB,EACtB,UAAU,GAAG,oBAAoB,GAAG,cAAc,CACnD,GAAG;IACF,8DAA8D;IAC9D,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC"}
|
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.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.152",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
21
|
"react-markdown": "^10.1.0",
|
|
22
|
-
"@epam/ai-dial-attachment-input": "1.2.0-dev.
|
|
22
|
+
"@epam/ai-dial-attachment-input": "1.2.0-dev.152"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^19.2.8",
|
|
26
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
27
|
-
"@epam/ai-dial-ui-kit": "^0.
|
|
26
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.152",
|
|
27
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.19"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|