@epam/ai-dial-conversation-messages 1.3.0-dev.221 → 1.3.0-dev.223
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.
|
@@ -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;AAGpC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAc/E,gHAAgH;AAChH,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,
|
|
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;AAc/E,gHAAgH;AAChH,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAmQlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/UserMessageBubble.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,EAAE,EAAkB,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAoB1E,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"UserMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/UserMessageBubble.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,EAAE,EAAkB,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAoB1E,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAiQxD,CAAC"}
|
package/index.js
CHANGED
|
@@ -2,14 +2,14 @@ import { AttachmentType as e, CopyIconButton as t, DeploymentIcon as n, MDMessag
|
|
|
2
2
|
import { AttachmentGroup as p } from "@epam/ai-dial-attachment-input";
|
|
3
3
|
import { Button as m, ButtonVariant as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, ElementSize as v, GhostIconButton as y, InfoMessageNotification as b, LinkButton as x, NeutralButton as S, Tooltip as C } from "@epam/ai-dial-ui-kit";
|
|
4
4
|
import { useCallback as w, useEffect as T, useId as ee, useLayoutEffect as E, useMemo as D, useRef as O, useState as k } from "react";
|
|
5
|
-
import { IconArrowBackUp as A, IconChevronDown as te, IconChevronUp as ne, IconMarkdown as re, IconPencilMinus as ie, IconRefresh as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { createPortal as
|
|
5
|
+
import { IconArrowBackUp as A, IconChevronDown as te, IconChevronUp as ne, IconMarkdown as re, IconPencilMinus as ie, IconRefresh as ae, IconThumbDown as j, IconThumbDownFilled as M, IconThumbUp as oe, IconThumbUpFilled as se, IconTrashX as ce } from "@tabler/icons-react";
|
|
6
|
+
import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
7
|
+
import { createPortal as I } from "react-dom";
|
|
8
8
|
//#region src/constants/public-class-names.ts
|
|
9
|
-
var
|
|
9
|
+
var le = {
|
|
10
10
|
userBubble: "dial-cm-user-bubble",
|
|
11
11
|
assistantContent: "dial-cm-assistant-content"
|
|
12
|
-
},
|
|
12
|
+
}, L = 4, R = (e) => {
|
|
13
13
|
let t = O(null), [n, r] = k(0);
|
|
14
14
|
return T(() => {
|
|
15
15
|
if (!e) return;
|
|
@@ -22,91 +22,91 @@ var R = {
|
|
|
22
22
|
return i.observe(n), () => i.disconnect();
|
|
23
23
|
}, [e]), {
|
|
24
24
|
slotRef: t,
|
|
25
|
-
firstLineIndent: e ? `calc(${n}px + ${
|
|
25
|
+
firstLineIndent: e ? `calc(${n}px + ${L}px)` : void 0
|
|
26
26
|
};
|
|
27
|
-
},
|
|
27
|
+
}, ue = [
|
|
28
28
|
"href",
|
|
29
29
|
"src",
|
|
30
30
|
"alt",
|
|
31
31
|
"colspan",
|
|
32
32
|
"rowspan",
|
|
33
33
|
"start"
|
|
34
|
-
],
|
|
34
|
+
], de = /* @__PURE__ */ new Set([
|
|
35
35
|
"pre",
|
|
36
36
|
"pre-wrap",
|
|
37
37
|
"pre-line",
|
|
38
38
|
"break-spaces"
|
|
39
|
-
]),
|
|
39
|
+
]), z = (e) => {
|
|
40
40
|
let t = document.createElement(e.tagName.toLowerCase());
|
|
41
|
-
|
|
41
|
+
ue.forEach((n) => {
|
|
42
42
|
let r = e.getAttribute(n);
|
|
43
43
|
r !== null && t.setAttribute(n, r);
|
|
44
44
|
});
|
|
45
45
|
let { whiteSpace: n } = window.getComputedStyle(e);
|
|
46
|
-
return
|
|
47
|
-
},
|
|
46
|
+
return de.has(n) && (t.style.whiteSpace = "pre-wrap"), t;
|
|
47
|
+
}, fe = (e) => e instanceof SVGElement || window.getComputedStyle(e).display === "none", B = (e, t) => {
|
|
48
48
|
if (!t.intersectsNode(e)) return null;
|
|
49
49
|
if (e.nodeType === Node.TEXT_NODE) {
|
|
50
50
|
let n = e.data, r = e === t.startContainer ? t.startOffset : 0, i = e === t.endContainer ? t.endOffset : n.length;
|
|
51
51
|
return document.createTextNode(n.slice(r, i));
|
|
52
52
|
}
|
|
53
|
-
if (!(e instanceof Element) ||
|
|
54
|
-
let n =
|
|
53
|
+
if (!(e instanceof Element) || fe(e)) return null;
|
|
54
|
+
let n = z(e);
|
|
55
55
|
return e.childNodes.forEach((e) => {
|
|
56
|
-
let r =
|
|
56
|
+
let r = B(e, t);
|
|
57
57
|
r && n.appendChild(r);
|
|
58
58
|
}), n;
|
|
59
|
-
},
|
|
59
|
+
}, pe = (e, t, n) => {
|
|
60
60
|
let r = e, i = t;
|
|
61
61
|
for (; i && i !== n && n.contains(i);) {
|
|
62
|
-
let e =
|
|
62
|
+
let e = z(i);
|
|
63
63
|
e.appendChild(r), r = e, i = i.parentElement;
|
|
64
64
|
}
|
|
65
65
|
return r;
|
|
66
|
-
},
|
|
66
|
+
}, me = (e, t) => {
|
|
67
67
|
let n = e.commonAncestorContainer, r = n instanceof Element ? n : n.parentElement;
|
|
68
68
|
if (!r) return null;
|
|
69
|
-
let i =
|
|
70
|
-
return i ?
|
|
71
|
-
},
|
|
69
|
+
let i = B(r, e);
|
|
70
|
+
return i ? pe(i, r.parentElement, t) : null;
|
|
71
|
+
}, he = (e) => {
|
|
72
72
|
let t = window.getSelection();
|
|
73
73
|
if (!t || t.isCollapsed || t.rangeCount === 0 || !e.clipboardData) return;
|
|
74
74
|
let n = t.toString();
|
|
75
75
|
if (!n) return;
|
|
76
76
|
let r = document.createElement("div");
|
|
77
77
|
for (let n = 0; n < t.rangeCount; n++) {
|
|
78
|
-
let i =
|
|
78
|
+
let i = me(t.getRangeAt(n), e.currentTarget);
|
|
79
79
|
i && r.appendChild(i);
|
|
80
80
|
}
|
|
81
81
|
e.clipboardData.setData("text/html", r.innerHTML), e.clipboardData.setData("text/plain", n), e.preventDefault();
|
|
82
|
-
},
|
|
83
|
-
let { tooltips: E, ariaLabels: D } = T ?? {}, [O, A] = k(null), [te, ne] = k(""),
|
|
84
|
-
l?.(), A("copy"), ne(e === a.User ? D?.copiedMessageStatus ?? "Message copied to clipboard" : D?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => A(null),
|
|
82
|
+
}, V = { activeRating: "_activeRating_ygoee_1" }, H = 2e3, ge = ({ role: e = a.User, onEdit: n, onEditHover: r, onDelete: o, onRegenerate: c, onCopy: l, onCopyMarkdown: u, onLike: f, onDislike: p, activeRating: m, isAlwaysVisible: h, leadingContent: b, trailingContent: x, isDisabled: S = !1, className: C, labels: T, colors: ee }) => {
|
|
83
|
+
let { tooltips: E, ariaLabels: D } = T ?? {}, [O, A] = k(null), [te, ne] = k(""), I = n != null || o != null || c != null || l != null || u != null || f != null || p != null || b != null || x != null, le = s({ "--ma-active-rating-text": ee?.activeRatingText }), L = w(() => {
|
|
84
|
+
l?.(), A("copy"), ne(e === a.User ? D?.copiedMessageStatus ?? "Message copied to clipboard" : D?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => A(null), H);
|
|
85
85
|
}, [
|
|
86
86
|
l,
|
|
87
87
|
e,
|
|
88
88
|
D?.copiedStatus,
|
|
89
89
|
D?.copiedMessageStatus
|
|
90
|
-
]),
|
|
91
|
-
u?.(), A("markdown"), ne(D?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => A(null),
|
|
90
|
+
]), R = w(() => {
|
|
91
|
+
u?.(), A("markdown"), ne(D?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => A(null), H);
|
|
92
92
|
}, [u, D?.copiedMarkdownStatus]);
|
|
93
|
-
return
|
|
93
|
+
return I ? /* @__PURE__ */ F("div", {
|
|
94
94
|
role: "toolbar",
|
|
95
95
|
"aria-label": D?.actionsGroup ?? "Message actions",
|
|
96
|
-
style:
|
|
96
|
+
style: le,
|
|
97
97
|
className: d("flex items-center gap-1", !h && "opacity-0 group-hover:opacity-100", C),
|
|
98
98
|
children: [
|
|
99
99
|
b,
|
|
100
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ P("span", {
|
|
101
101
|
role: "status",
|
|
102
102
|
"aria-live": "polite",
|
|
103
103
|
className: "sr-only",
|
|
104
104
|
children: te
|
|
105
105
|
}),
|
|
106
|
-
e === a.User ? /* @__PURE__ */
|
|
107
|
-
l && /* @__PURE__ */
|
|
106
|
+
e === a.User ? /* @__PURE__ */ F(N, { children: [
|
|
107
|
+
l && /* @__PURE__ */ P(t, {
|
|
108
108
|
iconSize: g.SM,
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: L,
|
|
110
110
|
size: v.Small,
|
|
111
111
|
isCopied: O === "copy",
|
|
112
112
|
copyLabel: E?.copyMessage ?? "Copy message",
|
|
@@ -114,8 +114,8 @@ var R = {
|
|
|
114
114
|
ariaLabel: D?.copyMessage ?? "Copy message",
|
|
115
115
|
isDisabled: S
|
|
116
116
|
}),
|
|
117
|
-
n && /* @__PURE__ */
|
|
118
|
-
icon: /* @__PURE__ */
|
|
117
|
+
n && /* @__PURE__ */ P(y, {
|
|
118
|
+
icon: /* @__PURE__ */ P(ie, {
|
|
119
119
|
size: g.SM,
|
|
120
120
|
"aria-hidden": !0,
|
|
121
121
|
stroke: _
|
|
@@ -128,8 +128,8 @@ var R = {
|
|
|
128
128
|
onFocus: r,
|
|
129
129
|
disabled: S
|
|
130
130
|
}),
|
|
131
|
-
o && /* @__PURE__ */
|
|
132
|
-
icon: /* @__PURE__ */
|
|
131
|
+
o && /* @__PURE__ */ P(y, {
|
|
132
|
+
icon: /* @__PURE__ */ P(ce, {
|
|
133
133
|
size: g.SM,
|
|
134
134
|
"aria-hidden": !0,
|
|
135
135
|
stroke: _
|
|
@@ -140,9 +140,9 @@ var R = {
|
|
|
140
140
|
onClick: o,
|
|
141
141
|
disabled: S
|
|
142
142
|
})
|
|
143
|
-
] }) : /* @__PURE__ */
|
|
144
|
-
c && /* @__PURE__ */
|
|
145
|
-
icon: /* @__PURE__ */
|
|
143
|
+
] }) : /* @__PURE__ */ F(N, { children: [
|
|
144
|
+
c && /* @__PURE__ */ P(y, {
|
|
145
|
+
icon: /* @__PURE__ */ P(ae, {
|
|
146
146
|
size: g.SM,
|
|
147
147
|
"aria-hidden": !0,
|
|
148
148
|
stroke: _
|
|
@@ -153,9 +153,9 @@ var R = {
|
|
|
153
153
|
onClick: c,
|
|
154
154
|
disabled: S
|
|
155
155
|
}),
|
|
156
|
-
l && /* @__PURE__ */
|
|
156
|
+
l && /* @__PURE__ */ P(t, {
|
|
157
157
|
iconSize: g.SM,
|
|
158
|
-
onClick:
|
|
158
|
+
onClick: L,
|
|
159
159
|
size: v.Small,
|
|
160
160
|
isCopied: O === "copy",
|
|
161
161
|
copyLabel: E?.copy ?? "Copy",
|
|
@@ -163,12 +163,12 @@ var R = {
|
|
|
163
163
|
ariaLabel: D?.copyResponse ?? "Copy response",
|
|
164
164
|
isDisabled: S
|
|
165
165
|
}),
|
|
166
|
-
u && /* @__PURE__ */
|
|
166
|
+
u && /* @__PURE__ */ P(t, {
|
|
167
167
|
iconSize: g.SM,
|
|
168
|
-
onClick:
|
|
168
|
+
onClick: R,
|
|
169
169
|
size: v.Small,
|
|
170
170
|
isCopied: O === "markdown",
|
|
171
|
-
iconCopy: /* @__PURE__ */
|
|
171
|
+
iconCopy: /* @__PURE__ */ P(re, {
|
|
172
172
|
size: g.SM,
|
|
173
173
|
"aria-hidden": !0,
|
|
174
174
|
stroke: _
|
|
@@ -178,12 +178,12 @@ var R = {
|
|
|
178
178
|
ariaLabel: D?.copyAsMarkdown ?? "Copy as markdown",
|
|
179
179
|
isDisabled: S
|
|
180
180
|
}),
|
|
181
|
-
f && /* @__PURE__ */
|
|
182
|
-
icon: m === i.Like ? /* @__PURE__ */
|
|
183
|
-
className:
|
|
181
|
+
f && /* @__PURE__ */ P(y, {
|
|
182
|
+
icon: m === i.Like ? /* @__PURE__ */ P(se, {
|
|
183
|
+
className: V.activeRating,
|
|
184
184
|
size: g.SM,
|
|
185
185
|
"aria-hidden": !0
|
|
186
|
-
}) : /* @__PURE__ */
|
|
186
|
+
}) : /* @__PURE__ */ P(oe, {
|
|
187
187
|
size: g.SM,
|
|
188
188
|
"aria-hidden": !0,
|
|
189
189
|
stroke: _
|
|
@@ -195,12 +195,12 @@ var R = {
|
|
|
195
195
|
onClick: f,
|
|
196
196
|
disabled: S
|
|
197
197
|
}),
|
|
198
|
-
p && /* @__PURE__ */
|
|
199
|
-
icon: m === i.Dislike ? /* @__PURE__ */
|
|
200
|
-
className:
|
|
198
|
+
p && /* @__PURE__ */ P(y, {
|
|
199
|
+
icon: m === i.Dislike ? /* @__PURE__ */ P(M, {
|
|
200
|
+
className: V.activeRating,
|
|
201
201
|
size: g.SM,
|
|
202
202
|
"aria-hidden": !0
|
|
203
|
-
}) : /* @__PURE__ */
|
|
203
|
+
}) : /* @__PURE__ */ P(j, {
|
|
204
204
|
size: g.SM,
|
|
205
205
|
"aria-hidden": !0,
|
|
206
206
|
stroke: _
|
|
@@ -216,61 +216,61 @@ var R = {
|
|
|
216
216
|
x
|
|
217
217
|
]
|
|
218
218
|
}) : null;
|
|
219
|
-
},
|
|
219
|
+
}, U = (e) => {
|
|
220
220
|
let [t, n] = k(() => /* @__PURE__ */ new Date());
|
|
221
221
|
return T(() => {
|
|
222
222
|
let t = setInterval(() => n(/* @__PURE__ */ new Date()), e);
|
|
223
223
|
return () => clearInterval(t);
|
|
224
224
|
}, [e]), t;
|
|
225
|
-
},
|
|
225
|
+
}, W = /* @__PURE__ */ function(e) {
|
|
226
226
|
return e.Today = "today", e.Yesterday = "yesterday", e.Absolute = "absolute", e;
|
|
227
|
-
}({}),
|
|
227
|
+
}({}), G = {
|
|
228
228
|
hour: "numeric",
|
|
229
229
|
minute: "2-digit"
|
|
230
|
-
},
|
|
230
|
+
}, K = {
|
|
231
231
|
year: "numeric",
|
|
232
232
|
month: "short",
|
|
233
233
|
day: "numeric",
|
|
234
|
-
...
|
|
235
|
-
},
|
|
236
|
-
["year", 365 *
|
|
237
|
-
["month", 30 *
|
|
238
|
-
["week", 7 *
|
|
239
|
-
["day",
|
|
240
|
-
["hour",
|
|
241
|
-
["minute",
|
|
242
|
-
],
|
|
234
|
+
...G
|
|
235
|
+
}, q = 60, _e = 3600, J = 24 * _e, ve = [
|
|
236
|
+
["year", 365 * J],
|
|
237
|
+
["month", 30 * J],
|
|
238
|
+
["week", 7 * J],
|
|
239
|
+
["day", J],
|
|
240
|
+
["hour", _e],
|
|
241
|
+
["minute", q]
|
|
242
|
+
], Y = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), ye = (e) => {
|
|
243
243
|
if (!e) return null;
|
|
244
244
|
let t = new Date(e);
|
|
245
245
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
246
|
-
},
|
|
246
|
+
}, be = (e, t) => new Intl.DateTimeFormat(t, K).format(e), X = (e, t, n) => {
|
|
247
247
|
let r = new Date(t.getFullYear(), t.getMonth(), t.getDate() - 1);
|
|
248
|
-
return
|
|
249
|
-
kind:
|
|
250
|
-
text: new Intl.DateTimeFormat(n,
|
|
251
|
-
} :
|
|
252
|
-
kind:
|
|
253
|
-
text: new Intl.DateTimeFormat(n,
|
|
248
|
+
return Y(e, t) ? {
|
|
249
|
+
kind: W.Today,
|
|
250
|
+
text: new Intl.DateTimeFormat(n, G).format(e)
|
|
251
|
+
} : Y(e, r) ? {
|
|
252
|
+
kind: W.Yesterday,
|
|
253
|
+
text: new Intl.DateTimeFormat(n, G).format(e)
|
|
254
254
|
} : {
|
|
255
|
-
kind:
|
|
256
|
-
text:
|
|
255
|
+
kind: W.Absolute,
|
|
256
|
+
text: be(e, n)
|
|
257
257
|
};
|
|
258
258
|
}, xe = (e, t, n) => {
|
|
259
259
|
let r = new Intl.RelativeTimeFormat(n, { numeric: "auto" }), i = (t.getTime() - e.getTime()) / 1e3;
|
|
260
|
-
for (let [e, t] of
|
|
260
|
+
for (let [e, t] of ve) {
|
|
261
261
|
let n = Math.floor(i / t);
|
|
262
262
|
if (n >= 1) return r.format(-n, e);
|
|
263
263
|
}
|
|
264
264
|
return r.format(0, "second");
|
|
265
|
-
},
|
|
266
|
-
let r =
|
|
267
|
-
return i == null ? null : /* @__PURE__ */
|
|
268
|
-
tooltip:
|
|
265
|
+
}, Se = 6e4, Z = "opacity-0 transition-opacity group-hover/message:opacity-100 group-focus-within/message:opacity-100 [@media(hover:none)]:opacity-100", Ce = ({ timestamp: e, locale: t, className: n = "dial-small-text text-secondary" }) => {
|
|
266
|
+
let r = U(Se), i = ye(e);
|
|
267
|
+
return i == null ? null : /* @__PURE__ */ P(C, {
|
|
268
|
+
tooltip: be(i, t),
|
|
269
269
|
asChild: !0,
|
|
270
|
-
children: /* @__PURE__ */
|
|
270
|
+
children: /* @__PURE__ */ P("time", {
|
|
271
271
|
dateTime: e,
|
|
272
272
|
tabIndex: 0,
|
|
273
|
-
className: d("px-1 whitespace-nowrap", n,
|
|
273
|
+
className: d("px-1 whitespace-nowrap", n, Z),
|
|
274
274
|
children: xe(i, r, t)
|
|
275
275
|
})
|
|
276
276
|
});
|
|
@@ -281,12 +281,12 @@ var R = {
|
|
|
281
281
|
collapsedText: "_collapsedText_17fln_15",
|
|
282
282
|
startersDivider: "_startersDivider_17fln_31",
|
|
283
283
|
text: "_text_17fln_35"
|
|
284
|
-
}, we = "[&>.cm-bubble-markdown>div>*:first-child]:indent-[var(--cm-bubble-first-line-indent,0px)]",
|
|
285
|
-
let { colors: M, typography:
|
|
284
|
+
}, we = "[&>.cm-bubble-markdown>div>*:first-child]:indent-[var(--cm-bubble-first-line-indent,0px)]", Te = ({ text: t, contentRef: i, styles: c, actions: l, hasAlwaysVisibleActions: u, timestamp: f, locale: m, isStreaming: h, attachments: g, beforeContent: _, responseFormat: v, afterContent: y, hasThinkingPlaceholder: b = !0, starters: x, onSelectStarter: C, deploymentIconUrl: w, deploymentDisplayName: T, markdownComponents: ee, markdownClassNames: E, markdownUrlTransform: O, onAttachmentClick: k, onDownloadAll: A, isAttachmentDownloadable: te, onAttachmentRetry: ne, codeBlockTheme: re, tableOnOpenInCanvas: ie, labels: ae, selectedAttachmentId: j }) => {
|
|
285
|
+
let { colors: M, typography: oe, className: se, bubbleClassName: ce, timestampClassName: I } = c ?? {}, L = f == null ? void 0 : /* @__PURE__ */ P(Ce, {
|
|
286
286
|
timestamp: f,
|
|
287
287
|
locale: m,
|
|
288
|
-
className:
|
|
289
|
-
}), { attachmentClickLabel:
|
|
288
|
+
className: I
|
|
289
|
+
}), { attachmentClickLabel: ue, attachmentDownloadLabel: de, attachmentRetryLabel: z, attachmentOpenInNewTabLabel: fe, startersAriaLabel: B = "Quick reply buttons", thinkingLabel: pe, codeBlockCopyLabel: me, codeBlockCopiedLabel: V, codeBlockDownloadLabel: H, tableCopyLabel: U, tableCopiedLabel: W, tableDownloadCsvLabel: G, tableOpenInCanvasLabel: K, tableDownloadFilename: q, tableScrollRegionAriaLabel: _e, mathScrollRegionAriaLabel: J, assistantMessageAriaLabel: ve = "Assistant message", deploymentIconFallbackLabel: Y = "AI" } = ae ?? {}, ye = D(() => ({
|
|
290
290
|
copyLabel: U,
|
|
291
291
|
copiedLabel: W,
|
|
292
292
|
downloadCsvLabel: G,
|
|
@@ -296,94 +296,95 @@ var R = {
|
|
|
296
296
|
W,
|
|
297
297
|
G,
|
|
298
298
|
K
|
|
299
|
-
]),
|
|
299
|
+
]), be = h ? (g ?? []).filter((t) => t.type !== e.Audio) : g ?? [], X = !!t?.trim(), { slotRef: xe, firstLineIndent: Se } = R(_ != null && X), Z = s({
|
|
300
300
|
"--cm-bubble-text": M?.text,
|
|
301
301
|
"--cm-starters-divider": M?.startersDivider,
|
|
302
|
-
"--cm-bubble-first-line-indent":
|
|
303
|
-
}),
|
|
304
|
-
return /* @__PURE__ */
|
|
302
|
+
"--cm-bubble-first-line-indent": Se
|
|
303
|
+
}), Te = d(Q.text, oe?.fontClassName), $ = !!(w || T);
|
|
304
|
+
return /* @__PURE__ */ F("div", {
|
|
305
305
|
role: "group",
|
|
306
|
-
"aria-label":
|
|
306
|
+
"aria-label": ve,
|
|
307
307
|
style: Z,
|
|
308
|
-
onCopy:
|
|
309
|
-
className: d("group/message flex w-full items-start gap-3",
|
|
310
|
-
children: [$ && /* @__PURE__ */
|
|
308
|
+
onCopy: he,
|
|
309
|
+
className: d("group/message flex w-full items-start gap-3", se),
|
|
310
|
+
children: [$ && /* @__PURE__ */ P(n, {
|
|
311
311
|
src: w,
|
|
312
312
|
size: 28,
|
|
313
|
-
initialsName: T ||
|
|
314
|
-
labels: { tooltip: T ??
|
|
315
|
-
}), /* @__PURE__ */
|
|
313
|
+
initialsName: T || Y,
|
|
314
|
+
labels: { tooltip: T ?? Y }
|
|
315
|
+
}), /* @__PURE__ */ F("div", {
|
|
316
316
|
className: "flex w-full max-w-full min-w-0 flex-col items-start gap-5",
|
|
317
|
-
children: [/* @__PURE__ */
|
|
318
|
-
className: d("flex w-full max-w-full min-w-0 flex-col items-start gap-4",
|
|
317
|
+
children: [/* @__PURE__ */ F("div", {
|
|
318
|
+
className: d("flex w-full max-w-full min-w-0 flex-col items-start gap-4", ce),
|
|
319
319
|
children: [
|
|
320
|
-
_ != null && !X && /* @__PURE__ */
|
|
320
|
+
_ != null && !X && /* @__PURE__ */ P("div", {
|
|
321
321
|
className: "min-w-0",
|
|
322
322
|
children: _
|
|
323
323
|
}),
|
|
324
|
-
(X || h && b) && /* @__PURE__ */
|
|
324
|
+
(X || h && b) && /* @__PURE__ */ F("div", {
|
|
325
325
|
"aria-live": "polite",
|
|
326
326
|
"aria-atomic": "false",
|
|
327
|
-
className: d(
|
|
328
|
-
children: [_ != null && X && /* @__PURE__ */
|
|
329
|
-
ref:
|
|
327
|
+
className: d(Te, "relative max-w-full min-w-0 text-start", _ != null && X && we, le.assistantContent),
|
|
328
|
+
children: [_ != null && X && /* @__PURE__ */ P("div", {
|
|
329
|
+
ref: xe,
|
|
330
330
|
className: "absolute inset-s-0 top-0",
|
|
331
331
|
children: _
|
|
332
|
-
}), /* @__PURE__ */
|
|
332
|
+
}), /* @__PURE__ */ P("div", {
|
|
333
333
|
ref: i,
|
|
334
334
|
className: "cm-bubble-markdown max-w-full min-w-0",
|
|
335
|
-
children: /* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ P(r, {
|
|
336
336
|
content: t ?? "",
|
|
337
337
|
isPlainText: v === o.PlainText,
|
|
338
338
|
isStreaming: h,
|
|
339
|
-
thinkingLabel:
|
|
339
|
+
thinkingLabel: pe,
|
|
340
340
|
components: ee,
|
|
341
341
|
classNames: E,
|
|
342
342
|
urlTransform: O,
|
|
343
|
-
codeBlockCopyLabel:
|
|
344
|
-
codeBlockCopiedLabel:
|
|
343
|
+
codeBlockCopyLabel: me,
|
|
344
|
+
codeBlockCopiedLabel: V,
|
|
345
345
|
codeBlockDownloadLabel: H,
|
|
346
|
-
codeBlockTheme:
|
|
347
|
-
tableActionLabels:
|
|
346
|
+
codeBlockTheme: re,
|
|
347
|
+
tableActionLabels: ye,
|
|
348
348
|
tableDownloadFilename: q,
|
|
349
|
-
tableOnOpenInCanvas:
|
|
350
|
-
tableScrollRegionAriaLabel:
|
|
349
|
+
tableOnOpenInCanvas: ie,
|
|
350
|
+
tableScrollRegionAriaLabel: _e,
|
|
351
351
|
mathScrollRegionAriaLabel: J
|
|
352
352
|
})
|
|
353
353
|
})]
|
|
354
354
|
}),
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
attachments:
|
|
355
|
+
/* @__PURE__ */ P(p, {
|
|
356
|
+
attachments: be,
|
|
357
357
|
onAttachmentClick: k ? (e) => {
|
|
358
358
|
let t = g?.find((t) => t.id === e);
|
|
359
359
|
t && k(t);
|
|
360
360
|
} : void 0,
|
|
361
361
|
onDownloadAll: A,
|
|
362
|
-
|
|
362
|
+
isAttachmentDownloadable: te,
|
|
363
|
+
onRetry: ne,
|
|
363
364
|
labels: {
|
|
364
|
-
clickLabel:
|
|
365
|
-
downloadLabel:
|
|
366
|
-
retryLabel:
|
|
367
|
-
openInNewTabLabel:
|
|
365
|
+
clickLabel: ue,
|
|
366
|
+
downloadLabel: de,
|
|
367
|
+
retryLabel: z,
|
|
368
|
+
openInNewTabLabel: fe
|
|
368
369
|
},
|
|
369
370
|
selectedAttachmentId: j
|
|
370
371
|
}),
|
|
371
372
|
y,
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ P(ge, {
|
|
373
374
|
...l,
|
|
374
375
|
isAlwaysVisible: u,
|
|
375
|
-
trailingContent: L == null ? l?.trailingContent : /* @__PURE__ */
|
|
376
|
+
trailingContent: L == null ? l?.trailingContent : /* @__PURE__ */ F(N, { children: [l?.trailingContent, L] }),
|
|
376
377
|
role: a.Assistant
|
|
377
378
|
})
|
|
378
379
|
]
|
|
379
|
-
}), x && x.length > 0 && C && /* @__PURE__ */
|
|
380
|
+
}), x && x.length > 0 && C && /* @__PURE__ */ P("div", {
|
|
380
381
|
role: "list",
|
|
381
|
-
"aria-label":
|
|
382
|
+
"aria-label": B,
|
|
382
383
|
className: d("flex w-full flex-wrap gap-2 border-t pt-5", Q.startersDivider),
|
|
383
|
-
children: x.map((e, t) => /* @__PURE__ */
|
|
384
|
+
children: x.map((e, t) => /* @__PURE__ */ P("div", {
|
|
384
385
|
role: "listitem",
|
|
385
386
|
className: "min-w-[40px]",
|
|
386
|
-
children: /* @__PURE__ */
|
|
387
|
+
children: /* @__PURE__ */ P(S, {
|
|
387
388
|
label: e.title,
|
|
388
389
|
className: "min-w-[40px]",
|
|
389
390
|
onClick: () => C(e)
|
|
@@ -392,22 +393,22 @@ var R = {
|
|
|
392
393
|
})]
|
|
393
394
|
})]
|
|
394
395
|
});
|
|
395
|
-
},
|
|
396
|
+
}, $ = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ P("div", {
|
|
396
397
|
role: "status",
|
|
397
398
|
"aria-live": "polite",
|
|
398
|
-
children: /* @__PURE__ */
|
|
399
|
+
children: /* @__PURE__ */ P(b, {
|
|
399
400
|
title: e,
|
|
400
401
|
message: t,
|
|
401
402
|
textClassName: "flex-row flex-wrap gap-1"
|
|
402
403
|
})
|
|
403
404
|
}), Ee = /* @__PURE__ */ function(e) {
|
|
404
405
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
405
|
-
}({}), De = 10, Oe = "[&>div>*:first-child]:mt-0 [&>div>*:last-child]:mb-0", ke = [], Ae = ({ text: e, contentRef: t, position: n = Ee.Bottom, styles: i, actions: o, hasAlwaysVisibleActions: m, timestamp: h, locale: _, attachments: y, collapsedLineCount: b = De, labels: S, textSegments: C, onAttachmentClick: w, onDownloadAll: T,
|
|
406
|
-
let { colors: j, typography: M, className:
|
|
406
|
+
}({}), De = 10, Oe = "[&>div>*:first-child]:mt-0 [&>div>*:last-child]:mb-0", ke = [], Ae = ({ text: e, contentRef: t, position: n = Ee.Bottom, styles: i, actions: o, hasAlwaysVisibleActions: m, timestamp: h, locale: _, attachments: y, collapsedLineCount: b = De, labels: S, textSegments: C, onAttachmentClick: w, onDownloadAll: T, isAttachmentDownloadable: E, onAttachmentRetry: O, selectedAttachmentId: k, markdownClassNames: A, markdownUrlTransform: re, codeBlockTheme: ie, tableOnOpenInCanvas: ae }) => {
|
|
407
|
+
let { colors: j, typography: M, className: oe, bubbleClassName: se, timestampClassName: ce } = i ?? {}, I = h == null ? void 0 : /* @__PURE__ */ P(Ce, {
|
|
407
408
|
timestamp: h,
|
|
408
409
|
locale: _,
|
|
409
|
-
className:
|
|
410
|
-
}), { showMoreLabel: L = "Show more", showLessLabel:
|
|
410
|
+
className: ce
|
|
411
|
+
}), { showMoreLabel: L = "Show more", showLessLabel: R = "Show less", showMoreAriaLabel: ue, showLessAriaLabel: de, attachmentClickLabel: z, attachmentDownloadLabel: fe, attachmentRetryLabel: B, attachmentOpenInNewTabLabel: pe, userMessageAriaLabel: me = "User message", codeBlockCopyLabel: V, codeBlockCopiedLabel: H, codeBlockDownloadLabel: U, tableCopyLabel: W, tableCopiedLabel: G, tableDownloadCsvLabel: K, tableOpenInCanvasLabel: q, tableDownloadFilename: _e, tableScrollRegionAriaLabel: J, mathScrollRegionAriaLabel: ve } = S ?? {}, Y = D(() => ({
|
|
411
412
|
copyLabel: W,
|
|
412
413
|
copiedLabel: G,
|
|
413
414
|
downloadCsvLabel: K,
|
|
@@ -417,17 +418,17 @@ var R = {
|
|
|
417
418
|
G,
|
|
418
419
|
K,
|
|
419
420
|
q
|
|
420
|
-
]), { textRef:
|
|
421
|
+
]), { textRef: ye, isTextCollapsed: be, isOverflowing: X, collapsedMaxHeight: xe, expandedMaxHeight: Se, isCollapsed: Z, toggleCollapsed: we } = f({
|
|
421
422
|
text: e ?? "",
|
|
422
423
|
collapsedLineCount: b
|
|
423
|
-
}),
|
|
424
|
+
}), Te = s({
|
|
424
425
|
"--cm-bubble-user-bg": j?.userBackground,
|
|
425
426
|
"--cm-bubble-user-border": j?.userBorder,
|
|
426
427
|
"--cm-bubble-fade-start": j?.fadeStart,
|
|
427
428
|
"--cm-bubble-text": j?.text,
|
|
428
|
-
"--cm-bubble-collapsed-height": X ? `${
|
|
429
|
-
"--cm-bubble-expanded-height": X ? `${
|
|
430
|
-
}), $ = n === Ee.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl",
|
|
429
|
+
"--cm-bubble-collapsed-height": X ? `${xe}px` : void 0,
|
|
430
|
+
"--cm-bubble-expanded-height": X ? `${Se}px` : void 0
|
|
431
|
+
}), $ = n === Ee.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", Ae = d(Q.text, M?.fontClassName), { markdownSource: je, segmentRehypePlugins: Me, segmentComponents: Ne } = D(() => {
|
|
431
432
|
if (C == null) return {
|
|
432
433
|
markdownSource: e ?? "",
|
|
433
434
|
segmentRehypePlugins: ke,
|
|
@@ -439,95 +440,96 @@ var R = {
|
|
|
439
440
|
segmentRehypePlugins: [u(n)],
|
|
440
441
|
segmentComponents: l(n)
|
|
441
442
|
};
|
|
442
|
-
}, [e, C]),
|
|
443
|
-
return /* @__PURE__ */
|
|
443
|
+
}, [e, C]), Pe = ue ?? L, Fe = de ?? R, Ie = Z ? L : R, Le = Z ? Pe : Fe, Re = Z ? te : ne, ze = ee();
|
|
444
|
+
return /* @__PURE__ */ P("div", {
|
|
444
445
|
role: "group",
|
|
445
|
-
"aria-label":
|
|
446
|
-
style:
|
|
447
|
-
onCopy:
|
|
448
|
-
className: d("group/message flex w-full",
|
|
449
|
-
children: /* @__PURE__ */
|
|
446
|
+
"aria-label": me,
|
|
447
|
+
style: Te,
|
|
448
|
+
onCopy: he,
|
|
449
|
+
className: d("group/message flex w-full", oe),
|
|
450
|
+
children: /* @__PURE__ */ F("div", {
|
|
450
451
|
className: "ms-auto flex w-fit max-w-full min-w-0 flex-col items-end gap-4",
|
|
451
452
|
children: [
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ P(p, {
|
|
453
454
|
attachments: y ?? [],
|
|
454
455
|
onAttachmentClick: w ? (e) => {
|
|
455
456
|
let t = y?.find((t) => t.id === e);
|
|
456
457
|
t && w(t);
|
|
457
458
|
} : void 0,
|
|
458
459
|
onDownloadAll: T,
|
|
459
|
-
|
|
460
|
+
isAttachmentDownloadable: E,
|
|
461
|
+
onRetry: O,
|
|
460
462
|
labels: {
|
|
461
|
-
clickLabel:
|
|
462
|
-
downloadLabel:
|
|
463
|
-
retryLabel:
|
|
464
|
-
openInNewTabLabel:
|
|
463
|
+
clickLabel: z,
|
|
464
|
+
downloadLabel: fe,
|
|
465
|
+
retryLabel: B,
|
|
466
|
+
openInNewTabLabel: pe
|
|
465
467
|
},
|
|
466
468
|
styles: { className: "max-w-[640px]" },
|
|
467
|
-
selectedAttachmentId:
|
|
469
|
+
selectedAttachmentId: k
|
|
468
470
|
}),
|
|
469
|
-
e && /* @__PURE__ */
|
|
470
|
-
className: d(Q.userBubble, "flex w-fit max-w-full min-w-0 items-center justify-end rounded-ss-2xl rounded-es-2xl border px-6 py-4 wrap-anywhere", $,
|
|
471
|
-
children: /* @__PURE__ */
|
|
471
|
+
e && /* @__PURE__ */ P("div", {
|
|
472
|
+
className: d(Q.userBubble, "flex w-fit max-w-full min-w-0 items-center justify-end rounded-ss-2xl rounded-es-2xl border px-6 py-4 wrap-anywhere", $, se, le.userBubble),
|
|
473
|
+
children: /* @__PURE__ */ F("div", {
|
|
472
474
|
className: "flex min-w-0 flex-col items-start",
|
|
473
|
-
children: [/* @__PURE__ */
|
|
474
|
-
id:
|
|
475
|
+
children: [/* @__PURE__ */ P("div", {
|
|
476
|
+
id: ze,
|
|
475
477
|
ref: t,
|
|
476
|
-
className: d("relative -ms-1 -me-1 w-[calc(100%+8px)] overflow-hidden ps-1 pe-1", X && Q.collapsibleText, X && !Z && Q.expandedText,
|
|
477
|
-
children: /* @__PURE__ */
|
|
478
|
-
ref:
|
|
479
|
-
className: d(
|
|
480
|
-
children: /* @__PURE__ */
|
|
481
|
-
content:
|
|
478
|
+
className: d("relative -ms-1 -me-1 w-[calc(100%+8px)] overflow-hidden ps-1 pe-1", X && Q.collapsibleText, X && !Z && Q.expandedText, be && Q.collapsedText),
|
|
479
|
+
children: /* @__PURE__ */ P("div", {
|
|
480
|
+
ref: ye,
|
|
481
|
+
className: d(Ae, "max-w-full min-w-0 text-start", Oe),
|
|
482
|
+
children: /* @__PURE__ */ P(r, {
|
|
483
|
+
content: je,
|
|
482
484
|
isRawHtmlEnabled: !1,
|
|
483
|
-
rehypePlugins:
|
|
484
|
-
components:
|
|
485
|
-
classNames:
|
|
486
|
-
urlTransform:
|
|
487
|
-
codeBlockCopyLabel:
|
|
485
|
+
rehypePlugins: Me,
|
|
486
|
+
components: Ne,
|
|
487
|
+
classNames: A,
|
|
488
|
+
urlTransform: re,
|
|
489
|
+
codeBlockCopyLabel: V,
|
|
488
490
|
codeBlockCopiedLabel: H,
|
|
489
491
|
codeBlockDownloadLabel: U,
|
|
490
|
-
codeBlockTheme:
|
|
491
|
-
tableActionLabels:
|
|
492
|
-
tableDownloadFilename:
|
|
493
|
-
tableOnOpenInCanvas:
|
|
492
|
+
codeBlockTheme: ie,
|
|
493
|
+
tableActionLabels: Y,
|
|
494
|
+
tableDownloadFilename: _e,
|
|
495
|
+
tableOnOpenInCanvas: ae,
|
|
494
496
|
tableScrollRegionAriaLabel: J,
|
|
495
|
-
mathScrollRegionAriaLabel:
|
|
497
|
+
mathScrollRegionAriaLabel: ve
|
|
496
498
|
})
|
|
497
499
|
})
|
|
498
|
-
}), X && /* @__PURE__ */
|
|
499
|
-
label: /* @__PURE__ */
|
|
500
|
-
iconBefore: /* @__PURE__ */
|
|
500
|
+
}), X && /* @__PURE__ */ P(x, {
|
|
501
|
+
label: /* @__PURE__ */ P(N, { children: Ie }),
|
|
502
|
+
iconBefore: /* @__PURE__ */ P(Re, {
|
|
501
503
|
size: g.SM,
|
|
502
504
|
"aria-hidden": "true"
|
|
503
505
|
}),
|
|
504
|
-
"aria-label":
|
|
506
|
+
"aria-label": Le,
|
|
505
507
|
"aria-expanded": !Z,
|
|
506
|
-
"aria-controls":
|
|
508
|
+
"aria-controls": ze,
|
|
507
509
|
className: "mt-3",
|
|
508
|
-
onClick:
|
|
510
|
+
onClick: we,
|
|
509
511
|
size: v.Small
|
|
510
512
|
})]
|
|
511
513
|
})
|
|
512
514
|
}),
|
|
513
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ P(ge, {
|
|
514
516
|
...o,
|
|
515
517
|
isAlwaysVisible: m,
|
|
516
|
-
leadingContent:
|
|
518
|
+
leadingContent: I == null ? o?.leadingContent : /* @__PURE__ */ F(N, { children: [I, o?.leadingContent] }),
|
|
517
519
|
role: a.User
|
|
518
520
|
})
|
|
519
521
|
]
|
|
520
522
|
})
|
|
521
523
|
});
|
|
522
|
-
}, je = ({ role: e, beforeContent: t, textSegments: n, onAttachmentClick: r, responseFormat: i, markdownComponents: o, markdownUrlTransform: s, ...c }) => e === a.Status ? /* @__PURE__ */
|
|
524
|
+
}, je = ({ role: e, beforeContent: t, textSegments: n, onAttachmentClick: r, responseFormat: i, markdownComponents: o, markdownUrlTransform: s, ...c }) => e === a.Status ? /* @__PURE__ */ P($, { labels: {
|
|
523
525
|
titleText: c.labels?.statusTitleText,
|
|
524
526
|
bodyText: c.labels?.statusBodyText ?? ""
|
|
525
|
-
} }) : e === a.User ? /* @__PURE__ */
|
|
527
|
+
} }) : e === a.User ? /* @__PURE__ */ P(Ae, {
|
|
526
528
|
...c,
|
|
527
529
|
textSegments: n,
|
|
528
530
|
markdownUrlTransform: s,
|
|
529
531
|
onAttachmentClick: r
|
|
530
|
-
}) : /* @__PURE__ */
|
|
532
|
+
}) : /* @__PURE__ */ P(Te, {
|
|
531
533
|
...c,
|
|
532
534
|
beforeContent: t,
|
|
533
535
|
responseFormat: i,
|
|
@@ -558,42 +560,42 @@ var R = {
|
|
|
558
560
|
f,
|
|
559
561
|
p,
|
|
560
562
|
i.reply
|
|
561
|
-
]), g ?
|
|
563
|
+
]), g ? I(/* @__PURE__ */ F(N, { children: [e && /* @__PURE__ */ P("div", {
|
|
562
564
|
ref: t,
|
|
563
565
|
className: d("fixed top-0 left-0 z-50 max-w-[calc(100vw-16px)]", u),
|
|
564
566
|
style: {
|
|
565
567
|
...y,
|
|
566
568
|
transform: `translate(${b.x}px, ${b.y}px)`
|
|
567
569
|
},
|
|
568
|
-
children: /* @__PURE__ */
|
|
570
|
+
children: /* @__PURE__ */ P(m, {
|
|
569
571
|
variant: h.Neutral,
|
|
570
572
|
size: v.Small,
|
|
571
573
|
label: i.reply,
|
|
572
574
|
onClick: n,
|
|
573
575
|
textClassName: p,
|
|
574
576
|
className: d(Me.button, "h-8 min-h-8 min-w-11 px-2 shadow-lg mobile:h-11 mobile:min-h-11", f),
|
|
575
|
-
iconAfter: /* @__PURE__ */
|
|
577
|
+
iconAfter: /* @__PURE__ */ P(A, {
|
|
576
578
|
size: 16,
|
|
577
579
|
stroke: _,
|
|
578
580
|
"aria-hidden": "true",
|
|
579
581
|
className: "rtl:scale-x-[-1]"
|
|
580
582
|
})
|
|
581
583
|
})
|
|
582
|
-
}), /* @__PURE__ */
|
|
584
|
+
}), /* @__PURE__ */ P("div", {
|
|
583
585
|
role: "status",
|
|
584
586
|
"aria-live": "polite",
|
|
585
587
|
className: "sr-only",
|
|
586
|
-
children: e ? i.selectionAvailable : r > 0 ? /* @__PURE__ */
|
|
588
|
+
children: e ? i.selectionAvailable : r > 0 ? /* @__PURE__ */ P("span", { children: i.attachmentAdded }, r) : null
|
|
587
589
|
})] }), g) : null;
|
|
588
590
|
}, Pe = (e) => `Today ${e}`, Fe = (e) => `Yesterday ${e}`, Ie = ({ timestamp: e, locale: t, labels: n, className: r = "dial-small-text text-secondary" }) => {
|
|
589
591
|
let i = ye(e);
|
|
590
592
|
if (i == null) return null;
|
|
591
|
-
let { kind: a, text: o } =
|
|
592
|
-
return a ===
|
|
593
|
+
let { kind: a, text: o } = X(i, /* @__PURE__ */ new Date(), t), s = o;
|
|
594
|
+
return a === W.Today ? s = (n?.today ?? Pe)(o) : a === W.Yesterday && (s = (n?.yesterday ?? Fe)(o)), /* @__PURE__ */ P("time", {
|
|
593
595
|
dateTime: e,
|
|
594
596
|
className: d("self-center text-center", r),
|
|
595
597
|
children: s
|
|
596
598
|
});
|
|
597
599
|
};
|
|
598
600
|
//#endregion
|
|
599
|
-
export {
|
|
601
|
+
export { Te as AssistantMessageBubble, Ee as BubblePosition, le as CONVERSATION_MESSAGES_CLASS, Ie as ConversationStartTimestamp, ge as MessageActions, je as MessageBubble, Ne as MessageSelectionReply, $ as StatusMessageBubble, Ae as UserMessageBubble };
|
|
@@ -122,6 +122,8 @@ interface BaseMessageBubbleProps {
|
|
|
122
122
|
onAttachmentClick?: (attachment: DisplayAttachment) => void;
|
|
123
123
|
/** Fires with all downloadable attachments when "download all" is triggered. */
|
|
124
124
|
onDownloadAll?: (attachments: DisplayAttachment[]) => void;
|
|
125
|
+
/** Whether an attachment can be downloaded; `false` hides its tile's download button and leaves it out of "download all". Defaults to every attachment being downloadable. */
|
|
126
|
+
isAttachmentDownloadable?: (attachment: DisplayAttachment) => boolean;
|
|
125
127
|
/** Fires when a failed attachment upload is retried. */
|
|
126
128
|
onAttachmentRetry?: (id: string) => void;
|
|
127
129
|
/** ID of the attachment currently open in the canvas panel, if any. Renders that tile's selected visual state. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-bubble.d.ts","sourceRoot":"","sources":["../../src/models/message-bubble.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAA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AM,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.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.223",
|
|
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.3.0-dev.
|
|
22
|
+
"@epam/ai-dial-attachment-input": "1.3.0-dev.223"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^19.2.8",
|
|
26
26
|
"react-dom": "^19.2.8",
|
|
27
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
27
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.223",
|
|
28
28
|
"@epam/ai-dial-ui-kit": "^0.16.0-dev.45"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|