@epam/ai-dial-conversation-messages 1.2.0-dev.46 → 1.2.0-dev.50
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/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.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +76 -73
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/AssistantMessageBubble.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/AssistantMessageBubble.tsx"],"names":[],"mappings":"AAWA,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,CAgNlE,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,CAmKxD,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.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,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;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"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;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
|
@@ -4,8 +4,11 @@ import { DIAL_ICON_SIZE as u, DIAL_KIT_ICON_STROKE as d, ElementSize as f, InfoM
|
|
|
4
4
|
import { useCallback as _, useEffect as v, useId as y, useMemo as b, useRef as x, useState as S } from "react";
|
|
5
5
|
import { IconChevronDown as C, IconChevronUp as w, IconMarkdown as T, IconPencilMinus as E, IconRefresh as D, IconThumbDown as O, IconThumbDownFilled as k, IconThumbUp as A, IconThumbUpFilled as j, IconTrashX as M } from "@tabler/icons-react";
|
|
6
6
|
import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
7
|
-
//#region src/
|
|
8
|
-
var I =
|
|
7
|
+
//#region src/constants/public-class-names.ts
|
|
8
|
+
var I = {
|
|
9
|
+
userBubble: "dial-cm-user-bubble",
|
|
10
|
+
assistantContent: "dial-cm-assistant-content"
|
|
11
|
+
}, L = 4, R = (e) => {
|
|
9
12
|
let t = x(null), [n, r] = S(0);
|
|
10
13
|
return v(() => {
|
|
11
14
|
if (!e) return;
|
|
@@ -18,17 +21,17 @@ 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 + ${L}px)` : void 0
|
|
22
25
|
};
|
|
23
|
-
},
|
|
24
|
-
let { tooltips: L, ariaLabels:
|
|
25
|
-
p?.(), H("copy"), W(
|
|
26
|
-
}, [p,
|
|
27
|
-
m?.(), H("markdown"), W(
|
|
28
|
-
}, [m,
|
|
26
|
+
}, z = { activeRating: "_activeRating_ygoee_1" }, B = 2e3, V = ({ role: e = a.User, onEdit: n, onEditHover: r, onDelete: c, onRegenerate: l, onCopy: p, onCopyMarkdown: m, onLike: h, onDislike: v, activeRating: y, isAlwaysVisible: b, isDisabled: x = !1, className: C, labels: w, colors: I }) => {
|
|
27
|
+
let { tooltips: L, ariaLabels: R } = w ?? {}, [V, H] = S(null), [U, W] = S(""), G = n != null || c != null || l != null || p != null || m != null || h != null || v != null, K = o({ "--ma-active-rating-text": I?.activeRatingText }), q = _(() => {
|
|
28
|
+
p?.(), H("copy"), W(R?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => H(null), B);
|
|
29
|
+
}, [p, R?.copiedStatus]), J = _(() => {
|
|
30
|
+
m?.(), H("markdown"), W(R?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => H(null), B);
|
|
31
|
+
}, [m, R?.copiedMarkdownStatus]);
|
|
29
32
|
return G ? /* @__PURE__ */ F("div", {
|
|
30
33
|
role: "toolbar",
|
|
31
|
-
"aria-label":
|
|
34
|
+
"aria-label": R?.actionsGroup ?? "Message actions",
|
|
32
35
|
style: K,
|
|
33
36
|
className: s("flex gap-1", !b && "opacity-0 group-hover:opacity-100", C),
|
|
34
37
|
children: [/* @__PURE__ */ P("span", {
|
|
@@ -43,7 +46,7 @@ var I = 4, L = (e) => {
|
|
|
43
46
|
stroke: d
|
|
44
47
|
}),
|
|
45
48
|
size: f.Small,
|
|
46
|
-
"aria-label":
|
|
49
|
+
"aria-label": R?.editMessage ?? "Edit message",
|
|
47
50
|
tooltipProps: { tooltip: L?.edit ?? "Edit" },
|
|
48
51
|
onClick: n,
|
|
49
52
|
onMouseEnter: r,
|
|
@@ -56,7 +59,7 @@ var I = 4, L = (e) => {
|
|
|
56
59
|
stroke: d
|
|
57
60
|
}),
|
|
58
61
|
size: f.Small,
|
|
59
|
-
"aria-label":
|
|
62
|
+
"aria-label": R?.deleteMessage ?? "Delete message",
|
|
60
63
|
tooltipProps: { tooltip: L?.delete ?? "Delete" },
|
|
61
64
|
onClick: c,
|
|
62
65
|
disabled: x
|
|
@@ -68,7 +71,7 @@ var I = 4, L = (e) => {
|
|
|
68
71
|
stroke: d
|
|
69
72
|
}),
|
|
70
73
|
size: f.Small,
|
|
71
|
-
"aria-label":
|
|
74
|
+
"aria-label": R?.regenerateResponse ?? "Regenerate response",
|
|
72
75
|
tooltipProps: { tooltip: L?.regenerate ?? "Regenerate" },
|
|
73
76
|
onClick: l,
|
|
74
77
|
disabled: x
|
|
@@ -80,7 +83,7 @@ var I = 4, L = (e) => {
|
|
|
80
83
|
isCopied: V === "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
89
|
m && /* @__PURE__ */ P(t, {
|
|
@@ -95,12 +98,12 @@ var I = 4, L = (e) => {
|
|
|
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
104
|
h && /* @__PURE__ */ P(g, {
|
|
102
105
|
icon: y === i.Like ? /* @__PURE__ */ P(j, {
|
|
103
|
-
className:
|
|
106
|
+
className: z.activeRating,
|
|
104
107
|
size: u.SM,
|
|
105
108
|
"aria-hidden": !0
|
|
106
109
|
}) : /* @__PURE__ */ P(A, {
|
|
@@ -109,7 +112,7 @@ var I = 4, L = (e) => {
|
|
|
109
112
|
stroke: d
|
|
110
113
|
}),
|
|
111
114
|
size: f.Small,
|
|
112
|
-
"aria-label":
|
|
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,
|
|
@@ -117,7 +120,7 @@ var I = 4, L = (e) => {
|
|
|
117
120
|
}),
|
|
118
121
|
v && /* @__PURE__ */ P(g, {
|
|
119
122
|
icon: y === i.Dislike ? /* @__PURE__ */ P(k, {
|
|
120
|
-
className:
|
|
123
|
+
className: z.activeRating,
|
|
121
124
|
size: u.SM,
|
|
122
125
|
"aria-hidden": !0
|
|
123
126
|
}) : /* @__PURE__ */ P(O, {
|
|
@@ -126,7 +129,7 @@ var I = 4, L = (e) => {
|
|
|
126
129
|
stroke: d
|
|
127
130
|
}),
|
|
128
131
|
size: f.Small,
|
|
129
|
-
"aria-label":
|
|
132
|
+
"aria-label": R?.dislikeResponse ?? "Dislike response",
|
|
130
133
|
"aria-pressed": y === i.Dislike,
|
|
131
134
|
tooltipProps: { tooltip: L?.dislike ?? "Dislike" },
|
|
132
135
|
onClick: v,
|
|
@@ -134,43 +137,43 @@ var I = 4, L = (e) => {
|
|
|
134
137
|
})
|
|
135
138
|
] })]
|
|
136
139
|
}) : null;
|
|
137
|
-
},
|
|
140
|
+
}, H = {
|
|
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: j, typography: M, className: N, bubbleClassName:
|
|
146
|
-
copyLabel:
|
|
147
|
-
copiedLabel:
|
|
148
|
-
downloadCsvLabel:
|
|
149
|
-
openInCanvasLabel:
|
|
147
|
+
}, U = "[&>.cm-bubble-markdown>div>*:first-child]:indent-[var(--cm-bubble-first-line-indent,0px)]", W = ({ text: t, styles: i, actions: c, hasAlwaysVisibleActions: u, isStreaming: d, attachments: f, beforeContent: p, afterContent: m, starters: g, onSelectStarter: _, deploymentIconUrl: v, deploymentDisplayName: y, markdownComponents: x, markdownClassNames: S, markdownUrlTransform: C, onAttachmentClick: w, onDownloadAll: T, onAttachmentRetry: E, codeBlockTheme: D, tableOnOpenInCanvas: O, labels: k, selectedAttachmentId: A }) => {
|
|
148
|
+
let { colors: j, typography: M, className: N, bubbleClassName: L } = i ?? {}, { attachmentClickLabel: z, attachmentRetryLabel: B, attachmentOpenInNewTabLabel: W, startersAriaLabel: G = "Quick reply buttons", thinkingLabel: K, codeBlockCopyLabel: q, codeBlockCopiedLabel: J, tableCopyLabel: Y, tableCopiedLabel: X, tableDownloadCsvLabel: Z, tableOpenInCanvasLabel: Q, tableDownloadFilename: ee, tableScrollRegionAriaLabel: te, assistantMessageAriaLabel: ne = "Assistant message", deploymentIconFallbackLabel: $ = "AI" } = k ?? {}, re = b(() => ({
|
|
149
|
+
copyLabel: Y,
|
|
150
|
+
copiedLabel: X,
|
|
151
|
+
downloadCsvLabel: Z,
|
|
152
|
+
openInCanvasLabel: Q
|
|
150
153
|
}), [
|
|
151
|
-
J,
|
|
152
154
|
Y,
|
|
153
155
|
X,
|
|
154
|
-
Z
|
|
155
|
-
|
|
156
|
+
Z,
|
|
157
|
+
Q
|
|
158
|
+
]), ie = d ? (f ?? []).filter((t) => t.type !== e.Audio) : f ?? [], { slotRef: ae, firstLineIndent: oe } = R(p != null && !!t), se = o({
|
|
156
159
|
"--cm-bubble-text": j?.text,
|
|
157
160
|
"--cm-starters-divider": j?.startersDivider,
|
|
158
|
-
"--cm-bubble-first-line-indent":
|
|
159
|
-
}),
|
|
161
|
+
"--cm-bubble-first-line-indent": oe
|
|
162
|
+
}), ce = s(H.text, M?.fontClassName), le = !!(v || y);
|
|
160
163
|
return /* @__PURE__ */ F("div", {
|
|
161
164
|
role: "group",
|
|
162
165
|
"aria-label": ne,
|
|
163
|
-
style:
|
|
166
|
+
style: se,
|
|
164
167
|
className: s("flex w-full items-start gap-3", N),
|
|
165
|
-
children: [
|
|
168
|
+
children: [le && /* @__PURE__ */ P(n, {
|
|
166
169
|
src: v,
|
|
167
170
|
size: 28,
|
|
168
|
-
initialsName: y ||
|
|
169
|
-
labels: { tooltip: y ??
|
|
171
|
+
initialsName: y || $,
|
|
172
|
+
labels: { tooltip: y ?? $ }
|
|
170
173
|
}), /* @__PURE__ */ F("div", {
|
|
171
174
|
className: "flex w-full min-w-0 max-w-full flex-col items-start gap-5",
|
|
172
175
|
children: [/* @__PURE__ */ F("div", {
|
|
173
|
-
className: s("flex w-full min-w-0 max-w-full flex-col items-start gap-4",
|
|
176
|
+
className: s("flex w-full min-w-0 max-w-full flex-col items-start gap-4", L),
|
|
174
177
|
children: [
|
|
175
178
|
p != null && !t && /* @__PURE__ */ P("div", {
|
|
176
179
|
className: "min-w-0",
|
|
@@ -179,9 +182,9 @@ var I = 4, L = (e) => {
|
|
|
179
182
|
(t || d) && /* @__PURE__ */ F("div", {
|
|
180
183
|
"aria-live": "polite",
|
|
181
184
|
"aria-atomic": "false",
|
|
182
|
-
className: s(
|
|
185
|
+
className: s(ce, "relative min-w-0 max-w-full text-start", p != null && t && U, I.assistantContent),
|
|
183
186
|
children: [p != null && t && /* @__PURE__ */ P("div", {
|
|
184
|
-
ref:
|
|
187
|
+
ref: ae,
|
|
185
188
|
className: "absolute start-0 top-0",
|
|
186
189
|
children: p
|
|
187
190
|
}), /* @__PURE__ */ P("div", {
|
|
@@ -189,12 +192,12 @@ var I = 4, L = (e) => {
|
|
|
189
192
|
children: /* @__PURE__ */ P(r, {
|
|
190
193
|
content: t ?? "",
|
|
191
194
|
isStreaming: d,
|
|
192
|
-
thinkingLabel:
|
|
195
|
+
thinkingLabel: K,
|
|
193
196
|
components: x,
|
|
194
197
|
classNames: S,
|
|
195
198
|
urlTransform: C,
|
|
196
|
-
codeBlockCopyLabel:
|
|
197
|
-
codeBlockCopiedLabel:
|
|
199
|
+
codeBlockCopyLabel: q,
|
|
200
|
+
codeBlockCopiedLabel: J,
|
|
198
201
|
codeBlockTheme: D,
|
|
199
202
|
tableActionLabels: re,
|
|
200
203
|
tableDownloadFilename: ee,
|
|
@@ -209,14 +212,14 @@ var I = 4, L = (e) => {
|
|
|
209
212
|
onDownloadAll: T,
|
|
210
213
|
onRetry: E,
|
|
211
214
|
labels: {
|
|
212
|
-
clickLabel:
|
|
213
|
-
retryLabel:
|
|
214
|
-
openInNewTabLabel:
|
|
215
|
+
clickLabel: z,
|
|
216
|
+
retryLabel: B,
|
|
217
|
+
openInNewTabLabel: W
|
|
215
218
|
},
|
|
216
219
|
selectedAttachmentId: A
|
|
217
220
|
}),
|
|
218
221
|
m,
|
|
219
|
-
/* @__PURE__ */ P(
|
|
222
|
+
/* @__PURE__ */ P(V, {
|
|
220
223
|
...c,
|
|
221
224
|
isAlwaysVisible: u,
|
|
222
225
|
role: a.Assistant
|
|
@@ -224,8 +227,8 @@ var I = 4, L = (e) => {
|
|
|
224
227
|
]
|
|
225
228
|
}), g && g.length > 0 && _ && /* @__PURE__ */ P("div", {
|
|
226
229
|
role: "list",
|
|
227
|
-
"aria-label":
|
|
228
|
-
className: s("flex w-full flex-wrap gap-2 border-t pt-5",
|
|
230
|
+
"aria-label": G,
|
|
231
|
+
className: s("flex w-full flex-wrap gap-2 border-t pt-5", H.startersDivider),
|
|
229
232
|
children: g.map((e, t) => /* @__PURE__ */ P("div", {
|
|
230
233
|
role: "listitem",
|
|
231
234
|
className: "min-w-[40px]",
|
|
@@ -238,7 +241,7 @@ var I = 4, L = (e) => {
|
|
|
238
241
|
})]
|
|
239
242
|
})]
|
|
240
243
|
});
|
|
241
|
-
},
|
|
244
|
+
}, G = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ P("div", {
|
|
242
245
|
role: "status",
|
|
243
246
|
"aria-live": "polite",
|
|
244
247
|
children: /* @__PURE__ */ P(p, {
|
|
@@ -246,24 +249,24 @@ var I = 4, L = (e) => {
|
|
|
246
249
|
message: t,
|
|
247
250
|
textClassName: "flex-row flex-wrap gap-1"
|
|
248
251
|
})
|
|
249
|
-
}),
|
|
252
|
+
}), K = /* @__PURE__ */ function(e) {
|
|
250
253
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
251
|
-
}({}),
|
|
252
|
-
let { colors: S, typography: T, className: E, bubbleClassName: D } = n ?? {}, { showMoreLabel: O = "Show more", showLessLabel: k = "Show less", showMoreAriaLabel: A, showLessAriaLabel: j, attachmentClickLabel: M, attachmentRetryLabel:
|
|
254
|
+
}({}), q = 10, J = ({ text: e, position: t = K.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: d, collapsedLineCount: p = q, labels: h, beforeContent: g, onAttachmentClick: _, onDownloadAll: v, onAttachmentRetry: b, selectedAttachmentId: x }) => {
|
|
255
|
+
let { colors: S, typography: T, className: E, bubbleClassName: D } = n ?? {}, { showMoreLabel: O = "Show more", showLessLabel: k = "Show less", showMoreAriaLabel: A, showLessAriaLabel: j, attachmentClickLabel: M, attachmentRetryLabel: L, attachmentOpenInNewTabLabel: R, userMessageAriaLabel: z = "User message" } = h ?? {}, { textRef: B, isTextCollapsed: U, isOverflowing: W, collapsedMaxHeight: G, expandedMaxHeight: J, isCollapsed: Y, toggleCollapsed: X } = c({
|
|
253
256
|
text: e ?? "",
|
|
254
257
|
collapsedLineCount: p
|
|
255
|
-
}),
|
|
258
|
+
}), Z = o({
|
|
256
259
|
"--cm-bubble-user-bg": S?.userBackground,
|
|
257
260
|
"--cm-bubble-user-border": S?.userBorder,
|
|
258
261
|
"--cm-bubble-fade-start": S?.fadeStart,
|
|
259
262
|
"--cm-bubble-text": S?.text,
|
|
260
|
-
"--cm-bubble-collapsed-height":
|
|
261
|
-
"--cm-bubble-expanded-height":
|
|
262
|
-
}),
|
|
263
|
+
"--cm-bubble-collapsed-height": W ? `${G}px` : void 0,
|
|
264
|
+
"--cm-bubble-expanded-height": W ? `${J}px` : void 0
|
|
265
|
+
}), Q = t === K.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", ee = s(H.text, T?.fontClassName), te = A ?? O, ne = j ?? k, $ = Y ? O : k, re = Y ? te : ne, ie = Y ? C : w, ae = y();
|
|
263
266
|
return /* @__PURE__ */ P("div", {
|
|
264
267
|
role: "group",
|
|
265
|
-
"aria-label":
|
|
266
|
-
style:
|
|
268
|
+
"aria-label": z,
|
|
269
|
+
style: Z,
|
|
267
270
|
className: s("flex w-full", E),
|
|
268
271
|
children: /* @__PURE__ */ F("div", {
|
|
269
272
|
className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
|
|
@@ -275,22 +278,22 @@ var I = 4, L = (e) => {
|
|
|
275
278
|
onRetry: b,
|
|
276
279
|
labels: {
|
|
277
280
|
clickLabel: M,
|
|
278
|
-
retryLabel:
|
|
279
|
-
openInNewTabLabel:
|
|
281
|
+
retryLabel: L,
|
|
282
|
+
openInNewTabLabel: R
|
|
280
283
|
},
|
|
281
284
|
styles: { className: "max-w-[640px]" },
|
|
282
285
|
selectedAttachmentId: x
|
|
283
286
|
}),
|
|
284
287
|
(e || g != null) && /* @__PURE__ */ P("div", {
|
|
285
|
-
className: s(
|
|
288
|
+
className: s(H.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", Q, D, I.userBubble),
|
|
286
289
|
children: /* @__PURE__ */ F("div", {
|
|
287
290
|
className: "flex min-w-0 flex-col items-start",
|
|
288
291
|
children: [
|
|
289
292
|
e && /* @__PURE__ */ P("div", {
|
|
290
|
-
id:
|
|
291
|
-
className: s("relative overflow-hidden",
|
|
293
|
+
id: ae,
|
|
294
|
+
className: s("relative overflow-hidden", W && H.collapsibleText, W && !Y && H.expandedText, U && H.collapsedText),
|
|
292
295
|
children: /* @__PURE__ */ F("p", {
|
|
293
|
-
ref:
|
|
296
|
+
ref: B,
|
|
294
297
|
className: s(ee, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
|
|
295
298
|
children: [g != null && /* @__PURE__ */ P("span", {
|
|
296
299
|
className: "me-1",
|
|
@@ -299,23 +302,23 @@ var I = 4, L = (e) => {
|
|
|
299
302
|
})
|
|
300
303
|
}),
|
|
301
304
|
g != null && !e && /* @__PURE__ */ P("div", { children: g }),
|
|
302
|
-
|
|
303
|
-
label: /* @__PURE__ */ P(N, { children:
|
|
305
|
+
W && /* @__PURE__ */ P(m, {
|
|
306
|
+
label: /* @__PURE__ */ P(N, { children: $ }),
|
|
304
307
|
iconBefore: /* @__PURE__ */ P(ie, {
|
|
305
308
|
size: u.SM,
|
|
306
309
|
"aria-hidden": "true"
|
|
307
310
|
}),
|
|
308
311
|
"aria-label": re,
|
|
309
|
-
"aria-expanded": !
|
|
310
|
-
"aria-controls":
|
|
312
|
+
"aria-expanded": !Y,
|
|
313
|
+
"aria-controls": ae,
|
|
311
314
|
className: "mt-3",
|
|
312
|
-
onClick:
|
|
315
|
+
onClick: X,
|
|
313
316
|
size: f.Small
|
|
314
317
|
})
|
|
315
318
|
]
|
|
316
319
|
})
|
|
317
320
|
}),
|
|
318
|
-
/* @__PURE__ */ P(
|
|
321
|
+
/* @__PURE__ */ P(V, {
|
|
319
322
|
...r,
|
|
320
323
|
isAlwaysVisible: i,
|
|
321
324
|
role: a.User
|
|
@@ -323,14 +326,14 @@ var I = 4, L = (e) => {
|
|
|
323
326
|
]
|
|
324
327
|
})
|
|
325
328
|
});
|
|
326
|
-
},
|
|
329
|
+
}, Y = ({ role: e, beforeContent: t, onAttachmentClick: n, markdownComponents: r, markdownUrlTransform: i, ...o }) => e === a.Status ? /* @__PURE__ */ P(G, { labels: {
|
|
327
330
|
titleText: o.labels?.statusTitleText,
|
|
328
331
|
bodyText: o.labels?.statusBodyText ?? ""
|
|
329
|
-
} }) : e === a.User ? /* @__PURE__ */ P(
|
|
332
|
+
} }) : e === a.User ? /* @__PURE__ */ P(J, {
|
|
330
333
|
...o,
|
|
331
334
|
beforeContent: t,
|
|
332
335
|
onAttachmentClick: n
|
|
333
|
-
}) : /* @__PURE__ */ P(
|
|
336
|
+
}) : /* @__PURE__ */ P(W, {
|
|
334
337
|
...o,
|
|
335
338
|
beforeContent: t,
|
|
336
339
|
markdownComponents: r,
|
|
@@ -338,4 +341,4 @@ var I = 4, L = (e) => {
|
|
|
338
341
|
onAttachmentClick: n
|
|
339
342
|
});
|
|
340
343
|
//#endregion
|
|
341
|
-
export {
|
|
344
|
+
export { W as AssistantMessageBubble, K as BubblePosition, I as CONVERSATION_MESSAGES_CLASS, V as MessageActions, Y as MessageBubble, G as StatusMessageBubble, J 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.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.50",
|
|
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.50"
|
|
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.50",
|
|
27
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.7"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|