@epam/ai-dial-conversation-messages 1.1.0-dev.53 → 1.1.0-dev.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +150 -150
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n,
|
|
2
|
-
import { DIAL_ICON_SIZE as
|
|
1
|
+
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, MDMessageViewer as r, MIME_TYPE_EXT_MAP as i, MessageRating as a, MessageRole as o, RequestStatus as s, ResponseFormat as c, buildCssVars as l, mergeClasses as u, useCollapsedText as d } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { DIAL_ICON_SIZE as f, DialGhostIconButton as p, DialInput as m, DialLinkButton as h, DialPopup as g, DialPrimaryButton as _, DialRadioGroup as v, DialRoundedButton as y, DialSkeleton as b, DialSkeletonVariant as x, DialSlider as S, DialTag as C, DialTooltip as w, ElementSize as T, Highlight as E, InfoMessageNotification as D, PopupSize as O, RadioGroupOrientation as k } from "@epam/ai-dial-ui-kit";
|
|
3
3
|
import { IconCheck as A, IconChevronDown as j, IconChevronUp as M, IconClipboard as N, IconCopy as P, IconDownload as F, IconExternalLink as I, IconFile as L, IconFileTypeBmp as R, IconFileTypeCss as z, IconFileTypeCsv as B, IconFileTypeDoc as V, IconFileTypeDocx as ee, IconFileTypeHtml as te, IconFileTypeJpg as ne, IconFileTypeJs as re, IconFileTypeJsx as ie, IconFileTypePdf as ae, IconFileTypePhp as oe, IconFileTypePng as se, IconFileTypePpt as ce, IconFileTypeRs as le, IconFileTypeSql as ue, IconFileTypeSvg as de, IconFileTypeTs as fe, IconFileTypeTsx as pe, IconFileTypeTxt as me, IconFileTypeVue as he, IconFileTypeXls as ge, IconFileTypeXml as _e, IconFileTypeZip as ve, IconMarkdown as ye, IconMusic as be, IconPaperclip as xe, IconPencilMinus as Se, IconPhoto as H, IconRefresh as Ce, IconReload as we, IconTerminal2 as Te, IconThumbDown as Ee, IconThumbUp as De, IconTrashX as Oe, IconVideo as ke, IconX as Ae } from "@tabler/icons-react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
import { memo as je, useCallback as U, useEffect as Me, useId as Ne, useMemo as W, useRef as Pe, useState as G } from "react";
|
|
@@ -63,7 +63,7 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
63
63
|
let { type: n, contentType: r } = e;
|
|
64
64
|
return n === t.Prompt ? Te : n === t.Pasted ? N : n === t.Image ? H : Le(r ?? "");
|
|
65
65
|
}, ze = (e) => {
|
|
66
|
-
let t = e.toLowerCase().split(";")[0].trim(), n =
|
|
66
|
+
let t = e.toLowerCase().split(";")[0].trim(), n = i[t];
|
|
67
67
|
if (n) return n;
|
|
68
68
|
let r = t.split("/")[1];
|
|
69
69
|
if (r && !r.startsWith("vnd.") && !r.includes("+")) return r;
|
|
@@ -79,9 +79,9 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
79
79
|
let o = i.lastIndexOf(".");
|
|
80
80
|
return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
|
|
81
81
|
}, Ve = (e, n = {}) => {
|
|
82
|
-
let { type: r, status: i, previewUrl: a, url: o } = e,
|
|
82
|
+
let { type: r, status: i, previewUrl: a, url: o } = e, c = i === s.Loading, l = i === s.Error, u = r === t.Image && !!(a ?? o) && !l, d = r === t.Audio && !l, f = r === t.Link && !l;
|
|
83
83
|
return {
|
|
84
|
-
isLoading:
|
|
84
|
+
isLoading: c,
|
|
85
85
|
isError: l,
|
|
86
86
|
isImage: u,
|
|
87
87
|
isAudio: d,
|
|
@@ -112,10 +112,10 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
112
112
|
track: "_track_3x6ks_48",
|
|
113
113
|
indeterminateFill: "_indeterminateFill_3x6ks_52",
|
|
114
114
|
"attachment-tile-indeterminate": "_attachment-tile-indeterminate_3x6ks_1"
|
|
115
|
-
}, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ q(
|
|
115
|
+
}, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ q(p, {
|
|
116
116
|
icon: a,
|
|
117
|
-
size:
|
|
118
|
-
className:
|
|
117
|
+
size: T.Small,
|
|
118
|
+
className: u("absolute end-1 top-1 h-6 w-6 rounded-lg", o ?? X.hoverIcon),
|
|
119
119
|
"aria-label": e,
|
|
120
120
|
"aria-describedby": t ? n : void 0,
|
|
121
121
|
onClick: (e) => {
|
|
@@ -123,51 +123,51 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
123
123
|
}
|
|
124
124
|
}), Ue = ({ ...e }) => /* @__PURE__ */ q(Z, {
|
|
125
125
|
icon: /* @__PURE__ */ q(we, {
|
|
126
|
-
size:
|
|
126
|
+
size: f.SM,
|
|
127
127
|
"aria-hidden": !0
|
|
128
128
|
}),
|
|
129
129
|
className: X.retryIcon,
|
|
130
130
|
...e
|
|
131
131
|
}), We = ({ ...e }) => /* @__PURE__ */ q(Z, {
|
|
132
132
|
icon: /* @__PURE__ */ q(F, {
|
|
133
|
-
size:
|
|
133
|
+
size: f.SM,
|
|
134
134
|
"aria-hidden": !0
|
|
135
135
|
}),
|
|
136
136
|
...e
|
|
137
137
|
}), Ge = ({ ...e }) => /* @__PURE__ */ q(Z, {
|
|
138
138
|
icon: /* @__PURE__ */ q(I, {
|
|
139
|
-
size:
|
|
139
|
+
size: f.SM,
|
|
140
140
|
"aria-hidden": !0
|
|
141
141
|
}),
|
|
142
142
|
...e
|
|
143
143
|
}), Ke = ({ ...e }) => /* @__PURE__ */ q(Z, {
|
|
144
144
|
icon: /* @__PURE__ */ q(Ae, {
|
|
145
|
-
size:
|
|
145
|
+
size: f.SM,
|
|
146
146
|
"aria-hidden": !0
|
|
147
147
|
}),
|
|
148
148
|
className: X.hoverIcon,
|
|
149
149
|
...e
|
|
150
|
-
}), qe = ({ attachment: e, searchQuery: t = "", onClick: n, onDownload:
|
|
151
|
-
let { clickLabel:
|
|
150
|
+
}), qe = ({ attachment: e, searchQuery: t = "", onClick: n, onDownload: r, onRemove: i, labels: a, styles: o, cssVars: s }) => {
|
|
151
|
+
let { clickLabel: c = "Open attachment", downloadLabel: l = "Download attachment", removeLabel: d = "Remove attachment" } = a ?? {}, { typography: f, className: p } = o ?? {}, m = () => {
|
|
152
152
|
n?.(e.id);
|
|
153
153
|
};
|
|
154
154
|
return /* @__PURE__ */ J("div", {
|
|
155
|
-
style:
|
|
155
|
+
style: s,
|
|
156
156
|
...n == null ? {} : {
|
|
157
157
|
role: "button",
|
|
158
158
|
tabIndex: 0,
|
|
159
|
-
"aria-label":
|
|
160
|
-
onClick:
|
|
159
|
+
"aria-label": c,
|
|
160
|
+
onClick: m,
|
|
161
161
|
onKeyDown: (e) => {
|
|
162
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
162
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), m());
|
|
163
163
|
}
|
|
164
164
|
},
|
|
165
|
-
className:
|
|
165
|
+
className: u("group relative flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 rounded-xl border p-3", n && "cursor-pointer", (r || i) && "pe-8", p),
|
|
166
166
|
children: [
|
|
167
167
|
/* @__PURE__ */ q("span", {
|
|
168
168
|
title: e.name,
|
|
169
|
-
className:
|
|
170
|
-
children: t ? /* @__PURE__ */ q(
|
|
169
|
+
className: u(f?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.nameText),
|
|
170
|
+
children: t ? /* @__PURE__ */ q(E, {
|
|
171
171
|
text: e.name,
|
|
172
172
|
query: t,
|
|
173
173
|
maxLines: 1
|
|
@@ -181,14 +181,14 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
181
181
|
preload: "metadata",
|
|
182
182
|
onClick: (e) => e.stopPropagation()
|
|
183
183
|
}),
|
|
184
|
-
|
|
185
|
-
ariaLabel:
|
|
186
|
-
onClick:
|
|
184
|
+
r && /* @__PURE__ */ q(We, {
|
|
185
|
+
ariaLabel: l,
|
|
186
|
+
onClick: r,
|
|
187
187
|
id: e.id
|
|
188
188
|
}),
|
|
189
|
-
|
|
190
|
-
ariaLabel:
|
|
191
|
-
onClick:
|
|
189
|
+
i && /* @__PURE__ */ q(Ke, {
|
|
190
|
+
ariaLabel: d,
|
|
191
|
+
onClick: i,
|
|
192
192
|
id: e.id
|
|
193
193
|
})
|
|
194
194
|
]
|
|
@@ -196,23 +196,23 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
196
196
|
}, Je = {
|
|
197
197
|
[e.Network]: "Upload failed · network error",
|
|
198
198
|
[e.UnsupportedType]: "Upload failed · unsupported file type"
|
|
199
|
-
}, Ye = ({ attachment: t, onClick: n, onRetry: r, labels: i, styles: a, onDownload: o, isPasted:
|
|
200
|
-
let { clickLabel: h = "Download attachment", retryLabel: g = "Retry upload", sizeLabel: _, uploadingLabel: v = "Uploading", errorReasonLabels: y, genericErrorLabel: b = "Upload failed" } = i ?? {}, { typography: { nameClassName: x = "dial-caption-text", metaClassName: S = "dial-caption-text" } = {}, className: C } = a ?? {}, { id: w, name: T, status: E, errorReason: D } = t, O = E ===
|
|
199
|
+
}, Ye = ({ attachment: t, onClick: n, onRetry: r, labels: i, styles: a, onDownload: o, isPasted: c, isLink: l, cssVars: d, onExpand: f, isExpandable: p, onRemove: m }) => {
|
|
200
|
+
let { clickLabel: h = "Download attachment", retryLabel: g = "Retry upload", sizeLabel: _, uploadingLabel: v = "Uploading", errorReasonLabels: y, genericErrorLabel: b = "Upload failed" } = i ?? {}, { typography: { nameClassName: x = "dial-caption-text", metaClassName: S = "dial-caption-text" } = {}, className: C } = a ?? {}, { id: w, name: T, status: E, errorReason: D } = t, O = E === s.Loading, k = E === s.Error, A = Ne(), j = k ? D && (y?.[D] ?? Je[D]) || b : "", { BottomIcon: M, typeLabel: N } = Ve(t), P = !k && !O && o && !l, F = k && !!r && D !== e.UnsupportedType, I = P || F ? "pe-5" : void 0, L = (e) => {
|
|
201
201
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), n?.(t.id));
|
|
202
|
-
}, R = W(() =>
|
|
202
|
+
}, R = W(() => c ? T : Ie(T), [c, T]), z = U(() => {
|
|
203
203
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
204
|
-
}, [t]), B =
|
|
204
|
+
}, [t]), B = u(Fe, "group relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", X.tile, !k && X.tileLight, k && X.tileError), V = /* @__PURE__ */ q("div", {
|
|
205
205
|
title: R,
|
|
206
|
-
className:
|
|
206
|
+
className: u(x, "line-clamp-2 min-w-0 break-all", X.nameText, !k && I),
|
|
207
207
|
children: R
|
|
208
208
|
}), ee = M && /* @__PURE__ */ J("div", {
|
|
209
|
-
className:
|
|
209
|
+
className: u("flex w-full items-center gap-1", k && I),
|
|
210
210
|
children: [/* @__PURE__ */ q(M, {
|
|
211
211
|
size: 16,
|
|
212
212
|
className: X.typeText,
|
|
213
213
|
"aria-hidden": !0
|
|
214
214
|
}), /* @__PURE__ */ q("span", {
|
|
215
|
-
className:
|
|
215
|
+
className: u(S, "min-w-0 flex-1 truncate", X.typeText),
|
|
216
216
|
children: _ ? `${N} · ${_}` : N
|
|
217
217
|
})]
|
|
218
218
|
}), te = () => {
|
|
@@ -222,8 +222,8 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
222
222
|
O && /* @__PURE__ */ q("div", {
|
|
223
223
|
role: "progressbar",
|
|
224
224
|
"aria-label": v,
|
|
225
|
-
className:
|
|
226
|
-
children: /* @__PURE__ */ q("div", { className:
|
|
225
|
+
className: u("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full", X.track),
|
|
226
|
+
children: /* @__PURE__ */ q("div", { className: u("h-full w-1/3 rounded-full", X.indeterminateFill) })
|
|
227
227
|
}),
|
|
228
228
|
P && /* @__PURE__ */ q(We, {
|
|
229
229
|
ariaLabel: h,
|
|
@@ -261,16 +261,16 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
261
261
|
})
|
|
262
262
|
] });
|
|
263
263
|
return /* @__PURE__ */ q("div", {
|
|
264
|
-
style:
|
|
265
|
-
className:
|
|
264
|
+
style: d,
|
|
265
|
+
className: u("inline-flex", C),
|
|
266
266
|
children: /* @__PURE__ */ q("div", {
|
|
267
267
|
role: "button",
|
|
268
268
|
tabIndex: 0,
|
|
269
269
|
"aria-label": h,
|
|
270
270
|
onClick: te,
|
|
271
271
|
onKeyDown: L,
|
|
272
|
-
style:
|
|
273
|
-
className:
|
|
272
|
+
style: d,
|
|
273
|
+
className: u(B, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
274
274
|
children: ne
|
|
275
275
|
})
|
|
276
276
|
});
|
|
@@ -292,14 +292,14 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
292
292
|
imageLoadStatus: r
|
|
293
293
|
};
|
|
294
294
|
}, Qe = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c }) => {
|
|
295
|
-
let { clickLabel: l = "Open attachment", expandLabel:
|
|
295
|
+
let { clickLabel: l = "Open attachment", expandLabel: d = "Expand pasted text" } = i ?? {}, { typography: p, className: m } = c ?? {}, { id: h, name: g } = e, _ = e.previewUrl ?? e.url, v = e.type === t.Pasted && n !== void 0, { isLoading: y, isError: S, isImage: C } = W(() => Ve(e), [e]), w = r !== void 0 && !v && !y && !S, { imageRef: T, imageLoadStatus: E } = Ze({
|
|
296
296
|
enabled: C,
|
|
297
297
|
src: _
|
|
298
298
|
}), D = () => {
|
|
299
299
|
v && n ? n(h) : w && r && r(h);
|
|
300
300
|
};
|
|
301
301
|
return /* @__PURE__ */ q("div", {
|
|
302
|
-
className:
|
|
302
|
+
className: u(Fe, w && "cursor-pointer", X.tile, m),
|
|
303
303
|
onClick: D,
|
|
304
304
|
onKeyDown: (e) => {
|
|
305
305
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), D());
|
|
@@ -307,7 +307,7 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
307
307
|
tabIndex: 0,
|
|
308
308
|
role: "button",
|
|
309
309
|
style: o,
|
|
310
|
-
"aria-label": w ? l : v ?
|
|
310
|
+
"aria-label": w ? l : v ? d : void 0,
|
|
311
311
|
children: /* @__PURE__ */ J("div", {
|
|
312
312
|
className: "relative h-full w-full overflow-hidden",
|
|
313
313
|
children: [
|
|
@@ -319,14 +319,14 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
319
319
|
onClick: s,
|
|
320
320
|
id: h
|
|
321
321
|
}),
|
|
322
|
-
E !== Xe.Loaded && /* @__PURE__ */ q(
|
|
323
|
-
variant:
|
|
322
|
+
E !== Xe.Loaded && /* @__PURE__ */ q(b, {
|
|
323
|
+
variant: x.Rectangular,
|
|
324
324
|
width: "100%",
|
|
325
325
|
height: "100%",
|
|
326
326
|
active: E === Xe.Loading,
|
|
327
327
|
overlay: /* @__PURE__ */ q(H, {
|
|
328
|
-
size:
|
|
329
|
-
className:
|
|
328
|
+
size: f.LG,
|
|
329
|
+
className: p?.placeholderIconClassName ?? "text-secondary",
|
|
330
330
|
"aria-hidden": !0
|
|
331
331
|
}),
|
|
332
332
|
className: "absolute inset-0 rounded-xl"
|
|
@@ -337,13 +337,13 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
337
337
|
alt: g,
|
|
338
338
|
loading: "lazy",
|
|
339
339
|
decoding: "async",
|
|
340
|
-
className:
|
|
340
|
+
className: u("h-full w-full rounded-xl object-cover transition-opacity duration-200", E === Xe.Loaded ? "opacity-100" : "opacity-0")
|
|
341
341
|
})
|
|
342
342
|
]
|
|
343
343
|
})
|
|
344
344
|
});
|
|
345
|
-
}, $e = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: c, styles:
|
|
346
|
-
let { colors: d } =
|
|
345
|
+
}, $e = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: c, styles: u }) => {
|
|
346
|
+
let { colors: d } = u ?? {}, f = e.type === t.Pasted, p = f && a !== void 0, m = l({
|
|
347
347
|
"--ci-tile-bg": d?.background,
|
|
348
348
|
"--ci-tile-border": d?.border,
|
|
349
349
|
"--ci-tile-border-hover": d?.borderHover,
|
|
@@ -365,14 +365,14 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
365
365
|
onDownload: s,
|
|
366
366
|
onRemove: r,
|
|
367
367
|
searchQuery: n,
|
|
368
|
-
styles:
|
|
368
|
+
styles: u,
|
|
369
369
|
cssVars: m
|
|
370
370
|
}) : h ? /* @__PURE__ */ q(Qe, {
|
|
371
371
|
attachment: e,
|
|
372
372
|
labels: c,
|
|
373
373
|
onClick: o,
|
|
374
374
|
onExpand: a,
|
|
375
|
-
styles:
|
|
375
|
+
styles: u,
|
|
376
376
|
onRemove: r,
|
|
377
377
|
cssVars: m,
|
|
378
378
|
onDownload: s
|
|
@@ -384,14 +384,14 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
384
384
|
onDownload: s,
|
|
385
385
|
isLink: _,
|
|
386
386
|
isPasted: f,
|
|
387
|
-
styles:
|
|
387
|
+
styles: u,
|
|
388
388
|
labels: c,
|
|
389
389
|
onExpand: a,
|
|
390
390
|
cssVars: m,
|
|
391
391
|
isExpandable: p
|
|
392
392
|
});
|
|
393
393
|
}, et = { tile: "_tile_nzsrz_1" }, tt = ({ count: e, onClick: t, labels: n, children: r, styles: i }) => {
|
|
394
|
-
let { ariaLabel: a } = n ?? {}, { typography: { fontClassName: o = "dial-small-semi-text" } = {}, className: s, colors: c } = i ?? {},
|
|
394
|
+
let { ariaLabel: a } = n ?? {}, { typography: { fontClassName: o = "dial-small-semi-text" } = {}, className: s, colors: c } = i ?? {}, d = l({
|
|
395
395
|
"--ci-more-tile-bg": c?.background,
|
|
396
396
|
"--ci-more-tile-border": c?.border,
|
|
397
397
|
"--ci-more-tile-color": c?.color,
|
|
@@ -404,8 +404,8 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
404
404
|
type: "button",
|
|
405
405
|
onClick: t,
|
|
406
406
|
"aria-label": a ?? `Show ${e} more attachments`,
|
|
407
|
-
style:
|
|
408
|
-
className:
|
|
407
|
+
style: d,
|
|
408
|
+
className: u(Fe, o, et.tile, s),
|
|
409
409
|
children: r ?? /* @__PURE__ */ q("bdi", {
|
|
410
410
|
dir: "ltr",
|
|
411
411
|
children: `+${e}`
|
|
@@ -418,14 +418,14 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
418
418
|
downloadAllButton: "_downloadAllButton_7fktb_8",
|
|
419
419
|
imageTile: "_imageTile_7fktb_12"
|
|
420
420
|
}, nt = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, rt = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o }) => {
|
|
421
|
-
let { ariaLabel:
|
|
421
|
+
let { ariaLabel: c = "Attachments", clickLabel: d = "Download attachment", retryLabel: m = "Retry upload", showLessLabel: h = "Show less", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) => nt(e, "attachment"), promptLabel: y, pastedLabel: b, imageLabel: x } = a ?? {}, { typography: { headerLabelClassName: S = "dial-tiny-semi-text" } = {}, colors: C, className: w } = o ?? {}, T = l({
|
|
422
422
|
"--ci-group-bg": C?.background,
|
|
423
423
|
"--ci-group-border": C?.border,
|
|
424
424
|
"--ci-group-text": C?.text
|
|
425
425
|
}), [E, D] = G(!1), O = W(() => He(e.length, E), [e.length, E]);
|
|
426
426
|
if (e.length === 0) return null;
|
|
427
427
|
let k = e.some((e) => e.type === t.Image), A = e.some((e) => e.type !== t.Image), j = k && A, N = e.length >= 5, P = j ? xe : k ? H : L, I = v(e.length), R = e.slice(0, O.visibleCount), z = () => {
|
|
428
|
-
let t = e.filter((e) => e.status ===
|
|
428
|
+
let t = e.filter((e) => e.status === s.Idle);
|
|
429
429
|
r ? r(t) : t.forEach((e) => n?.(e.id));
|
|
430
430
|
}, B = (t) => {
|
|
431
431
|
let n = e.find((e) => e.id === t);
|
|
@@ -433,27 +433,27 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
433
433
|
};
|
|
434
434
|
return /* @__PURE__ */ J("div", {
|
|
435
435
|
role: "group",
|
|
436
|
-
"aria-label":
|
|
436
|
+
"aria-label": c,
|
|
437
437
|
style: T,
|
|
438
|
-
className:
|
|
438
|
+
className: u("rounded-2xl border p-3", N ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Q.container, w),
|
|
439
439
|
children: [/* @__PURE__ */ J("div", {
|
|
440
440
|
className: "mb-3 flex min-h-6 items-center gap-2",
|
|
441
441
|
children: [
|
|
442
442
|
/* @__PURE__ */ q(P, {
|
|
443
|
-
size:
|
|
444
|
-
className:
|
|
443
|
+
size: f.SM,
|
|
444
|
+
className: u("shrink-0", Q.headerIcon),
|
|
445
445
|
"aria-hidden": !0
|
|
446
446
|
}),
|
|
447
447
|
/* @__PURE__ */ q("span", {
|
|
448
|
-
className:
|
|
448
|
+
className: u(S, Q.headerLabel),
|
|
449
449
|
children: I
|
|
450
450
|
}),
|
|
451
|
-
e.length >= 2 && (r || n) && /* @__PURE__ */ q(
|
|
451
|
+
e.length >= 2 && (r || n) && /* @__PURE__ */ q(p, {
|
|
452
452
|
icon: /* @__PURE__ */ q(F, {
|
|
453
|
-
size:
|
|
453
|
+
size: f.SM,
|
|
454
454
|
"aria-hidden": !0
|
|
455
455
|
}),
|
|
456
|
-
className:
|
|
456
|
+
className: u("ms-auto h-6 w-6 rounded-lg", Q.downloadAllButton),
|
|
457
457
|
"aria-label": g,
|
|
458
458
|
onClick: z
|
|
459
459
|
})
|
|
@@ -461,7 +461,7 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
461
461
|
}), /* @__PURE__ */ J("div", {
|
|
462
462
|
role: "list",
|
|
463
463
|
"aria-label": I,
|
|
464
|
-
className:
|
|
464
|
+
className: u("gap-3", N ? "grid grid-cols-[repeat(5,83px)] overflow-x-auto" : "flex flex-wrap"),
|
|
465
465
|
children: [
|
|
466
466
|
R.map((e) => /* @__PURE__ */ q("div", {
|
|
467
467
|
role: "listitem",
|
|
@@ -471,8 +471,8 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
471
471
|
onDownload: B,
|
|
472
472
|
onRetry: i,
|
|
473
473
|
labels: {
|
|
474
|
-
clickLabel:
|
|
475
|
-
retryLabel:
|
|
474
|
+
clickLabel: d,
|
|
475
|
+
retryLabel: m,
|
|
476
476
|
promptLabel: y,
|
|
477
477
|
pastedLabel: b,
|
|
478
478
|
imageLabel: x,
|
|
@@ -494,7 +494,7 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
494
494
|
onClick: () => D(!1),
|
|
495
495
|
labels: { ariaLabel: h },
|
|
496
496
|
children: /* @__PURE__ */ q(M, {
|
|
497
|
-
size:
|
|
497
|
+
size: f.MD,
|
|
498
498
|
"aria-hidden": !0
|
|
499
499
|
})
|
|
500
500
|
})
|
|
@@ -517,17 +517,17 @@ je(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
|
517
517
|
role: "tab",
|
|
518
518
|
"aria-selected": r,
|
|
519
519
|
className: "contents",
|
|
520
|
-
children: /* @__PURE__ */ q(
|
|
520
|
+
children: /* @__PURE__ */ q(C, {
|
|
521
521
|
label: e.label,
|
|
522
522
|
selected: r,
|
|
523
523
|
onClick: () => n(e.id),
|
|
524
|
-
className:
|
|
524
|
+
className: u("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, it.tabContainer, r && it.tabActive)
|
|
525
525
|
})
|
|
526
526
|
}, e.id);
|
|
527
527
|
})
|
|
528
528
|
});
|
|
529
529
|
});
|
|
530
|
-
var at = (e) => /* @__PURE__ */ q(
|
|
530
|
+
var at = (e) => /* @__PURE__ */ q(_, { ...e }), ot = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
531
531
|
let [s, c] = G(t), [l, u] = G(n), [d, f] = G(r), p = Pe(o);
|
|
532
532
|
Me(() => {
|
|
533
533
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
@@ -560,30 +560,30 @@ var at = (e) => /* @__PURE__ */ q(v, { ...e }), ot = ({ features: e, initialResp
|
|
|
560
560
|
a
|
|
561
561
|
])
|
|
562
562
|
};
|
|
563
|
-
}, st = "!dial-small-semi-text !text-primary gap-1", ct = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: a, onTemperatureChange: o, responseFormatLabel: s = "Response format", responseFormatHint:
|
|
563
|
+
}, st = "!dial-small-semi-text !text-primary gap-1", ct = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: a, onTemperatureChange: o, responseFormatLabel: s = "Response format", responseFormatHint: l = "Applies to new and existing messages", responseFormatMarkdownLabel: u = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: h = "Temperature", temperatureLabels: g = [
|
|
564
564
|
"Precise",
|
|
565
565
|
"Neutral",
|
|
566
566
|
"Creative"
|
|
567
567
|
], temperatureHint: _ }) => /* @__PURE__ */ J("div", {
|
|
568
568
|
className: "flex flex-col gap-4 px-6 py-3",
|
|
569
569
|
children: [
|
|
570
|
-
e.responseFormat && /* @__PURE__ */ q(
|
|
570
|
+
e.responseFormat && /* @__PURE__ */ q(v, {
|
|
571
571
|
fieldTitle: s,
|
|
572
572
|
labelClassName: st,
|
|
573
573
|
elementId: "response-format",
|
|
574
574
|
orientation: k.Column,
|
|
575
|
-
activeRadioButton: t ??
|
|
576
|
-
labelDescription:
|
|
575
|
+
activeRadioButton: t ?? c.Markdown,
|
|
576
|
+
labelDescription: l,
|
|
577
577
|
radioButtons: [{
|
|
578
|
-
id:
|
|
578
|
+
id: c.Markdown,
|
|
579
579
|
name: u
|
|
580
580
|
}, {
|
|
581
|
-
id:
|
|
581
|
+
id: c.PlainText,
|
|
582
582
|
name: d
|
|
583
583
|
}],
|
|
584
584
|
onChange: (e) => i(e)
|
|
585
585
|
}),
|
|
586
|
-
e.systemPrompt && /* @__PURE__ */ q(
|
|
586
|
+
e.systemPrompt && /* @__PURE__ */ q(m, {
|
|
587
587
|
value: n,
|
|
588
588
|
placeholder: p,
|
|
589
589
|
labelProps: {
|
|
@@ -592,9 +592,9 @@ var at = (e) => /* @__PURE__ */ q(v, { ...e }), ot = ({ features: e, initialResp
|
|
|
592
592
|
},
|
|
593
593
|
onChange: (e) => a(e ?? "")
|
|
594
594
|
}),
|
|
595
|
-
e.temperature && /* @__PURE__ */ q(
|
|
595
|
+
e.temperature && /* @__PURE__ */ q(S, {
|
|
596
596
|
labelProps: {
|
|
597
|
-
label:
|
|
597
|
+
label: h,
|
|
598
598
|
className: st,
|
|
599
599
|
caption: _
|
|
600
600
|
},
|
|
@@ -607,8 +607,8 @@ var at = (e) => /* @__PURE__ */ q(v, { ...e }), ot = ({ features: e, initialResp
|
|
|
607
607
|
})
|
|
608
608
|
]
|
|
609
609
|
});
|
|
610
|
-
je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel:
|
|
611
|
-
let { responseFormat: y, systemPrompt: b, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt:
|
|
610
|
+
je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: _ = "Apply changes", saveDisabledTooltip: v }) => {
|
|
611
|
+
let { responseFormat: y, systemPrompt: b, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: T, setTemperature: E, handleSubmit: D } = ot({
|
|
612
612
|
features: e,
|
|
613
613
|
initialResponseFormat: t,
|
|
614
614
|
initialSystemPrompt: n,
|
|
@@ -616,7 +616,7 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
616
616
|
onSave: i,
|
|
617
617
|
onClose: a
|
|
618
618
|
});
|
|
619
|
-
return /* @__PURE__ */ q(
|
|
619
|
+
return /* @__PURE__ */ q(g, {
|
|
620
620
|
open: !0,
|
|
621
621
|
header: o,
|
|
622
622
|
size: O.Sm,
|
|
@@ -624,11 +624,11 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
624
624
|
className: "!bg-layer-2",
|
|
625
625
|
footer: /* @__PURE__ */ q("div", {
|
|
626
626
|
className: "flex justify-end px-6 py-4",
|
|
627
|
-
children: /* @__PURE__ */ q(
|
|
627
|
+
children: /* @__PURE__ */ q(w, {
|
|
628
628
|
tooltip: v,
|
|
629
629
|
hideTooltip: S || !v,
|
|
630
630
|
children: /* @__PURE__ */ q(at, {
|
|
631
|
-
label:
|
|
631
|
+
label: _,
|
|
632
632
|
onClick: D,
|
|
633
633
|
disabled: !S
|
|
634
634
|
})
|
|
@@ -640,7 +640,7 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
640
640
|
systemPrompt: b,
|
|
641
641
|
temperature: x,
|
|
642
642
|
onResponseFormatChange: C,
|
|
643
|
-
onSystemPromptChange:
|
|
643
|
+
onSystemPromptChange: T,
|
|
644
644
|
onTemperatureChange: E,
|
|
645
645
|
responseFormatLabel: s,
|
|
646
646
|
responseFormatHint: c,
|
|
@@ -656,95 +656,95 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
656
656
|
});
|
|
657
657
|
//#endregion
|
|
658
658
|
//#region src/components/MessageActions/MessageActions.tsx
|
|
659
|
-
var lt = 2e3, ut = ({ role: e =
|
|
659
|
+
var lt = 2e3, ut = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r, onRegenerate: i, onCopy: s, onCopyMarkdown: c, onLike: l, onDislike: d, activeRating: m, isAlwaysVisible: h, className: g, labels: _ }) => {
|
|
660
660
|
let { tooltips: v, ariaLabels: y } = _ ?? {}, [b, x] = G(null), [S, C] = G(""), w = U(() => {
|
|
661
|
-
|
|
662
|
-
}, [
|
|
661
|
+
s?.(), x("copy"), C(y?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => x(null), lt);
|
|
662
|
+
}, [s, y?.copiedStatus]), E = U(() => {
|
|
663
663
|
c?.(), x("markdown"), C(y?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => x(null), lt);
|
|
664
664
|
}, [c, y?.copiedMarkdownStatus]);
|
|
665
665
|
return /* @__PURE__ */ J("div", {
|
|
666
666
|
role: "toolbar",
|
|
667
667
|
"aria-label": y?.actionsGroup ?? "Message actions",
|
|
668
|
-
className:
|
|
668
|
+
className: u("flex gap-1", !h && "opacity-0 group-hover:opacity-100", g),
|
|
669
669
|
children: [/* @__PURE__ */ q("span", {
|
|
670
670
|
role: "status",
|
|
671
671
|
"aria-live": "polite",
|
|
672
672
|
className: "sr-only",
|
|
673
673
|
children: S
|
|
674
|
-
}), e ===
|
|
674
|
+
}), e === o.User ? /* @__PURE__ */ J(K, { children: [t && /* @__PURE__ */ q(p, {
|
|
675
675
|
icon: /* @__PURE__ */ q(Se, {
|
|
676
|
-
size:
|
|
676
|
+
size: f.SM,
|
|
677
677
|
"aria-hidden": !0
|
|
678
678
|
}),
|
|
679
|
-
size:
|
|
679
|
+
size: T.Small,
|
|
680
680
|
"aria-label": y?.editMessage ?? "Edit message",
|
|
681
681
|
tooltipProps: { tooltip: v?.edit ?? "Edit" },
|
|
682
682
|
onClick: t,
|
|
683
683
|
onMouseEnter: n,
|
|
684
684
|
onFocus: n
|
|
685
|
-
}), r && /* @__PURE__ */ q(
|
|
685
|
+
}), r && /* @__PURE__ */ q(p, {
|
|
686
686
|
icon: /* @__PURE__ */ q(Oe, {
|
|
687
|
-
size:
|
|
687
|
+
size: f.SM,
|
|
688
688
|
"aria-hidden": !0
|
|
689
689
|
}),
|
|
690
|
-
size:
|
|
690
|
+
size: T.Small,
|
|
691
691
|
"aria-label": y?.deleteMessage ?? "Delete message",
|
|
692
692
|
tooltipProps: { tooltip: v?.delete ?? "Delete" },
|
|
693
693
|
onClick: r
|
|
694
694
|
})] }) : /* @__PURE__ */ J(K, { children: [
|
|
695
|
-
i && /* @__PURE__ */ q(
|
|
695
|
+
i && /* @__PURE__ */ q(p, {
|
|
696
696
|
icon: /* @__PURE__ */ q(Ce, {
|
|
697
|
-
size:
|
|
697
|
+
size: f.SM,
|
|
698
698
|
"aria-hidden": !0
|
|
699
699
|
}),
|
|
700
|
-
size:
|
|
700
|
+
size: T.Small,
|
|
701
701
|
"aria-label": y?.regenerateResponse ?? "Regenerate response",
|
|
702
702
|
tooltipProps: { tooltip: v?.regenerate ?? "Regenerate" },
|
|
703
703
|
onClick: i
|
|
704
704
|
}),
|
|
705
|
-
|
|
705
|
+
s && /* @__PURE__ */ q(p, {
|
|
706
706
|
icon: q(b === "copy" ? A : P, {
|
|
707
|
-
size:
|
|
707
|
+
size: f.SM,
|
|
708
708
|
"aria-hidden": !0
|
|
709
709
|
}),
|
|
710
|
-
size:
|
|
710
|
+
size: T.Small,
|
|
711
711
|
"aria-label": y?.copyResponse ?? "Copy response",
|
|
712
712
|
tooltipProps: { tooltip: b === "copy" ? v?.copied ?? "Copied!" : v?.copy ?? "Copy" },
|
|
713
713
|
onClick: w
|
|
714
714
|
}),
|
|
715
|
-
c && /* @__PURE__ */ q(
|
|
715
|
+
c && /* @__PURE__ */ q(p, {
|
|
716
716
|
icon: q(b === "markdown" ? A : ye, {
|
|
717
|
-
size:
|
|
717
|
+
size: f.SM,
|
|
718
718
|
"aria-hidden": !0
|
|
719
719
|
}),
|
|
720
|
-
size:
|
|
720
|
+
size: T.Small,
|
|
721
721
|
"aria-label": y?.copyAsMarkdown ?? "Copy as markdown",
|
|
722
722
|
tooltipProps: { tooltip: b === "markdown" ? v?.copiedMarkdown ?? "Copied!" : v?.copyMarkdown ?? "Copy as Markdown" },
|
|
723
|
-
onClick:
|
|
723
|
+
onClick: E
|
|
724
724
|
}),
|
|
725
|
-
l && /* @__PURE__ */ q(
|
|
725
|
+
l && /* @__PURE__ */ q(p, {
|
|
726
726
|
icon: /* @__PURE__ */ q(De, {
|
|
727
|
-
size:
|
|
727
|
+
size: f.SM,
|
|
728
728
|
"aria-hidden": !0
|
|
729
729
|
}),
|
|
730
|
-
size:
|
|
730
|
+
size: T.Small,
|
|
731
731
|
"aria-label": y?.likeResponse ?? "Like response",
|
|
732
|
-
"aria-pressed":
|
|
733
|
-
className:
|
|
732
|
+
"aria-pressed": m === a.Like,
|
|
733
|
+
className: m === a.Like ? "!text-accent-primary" : void 0,
|
|
734
734
|
tooltipProps: { tooltip: v?.like ?? "Like" },
|
|
735
735
|
onClick: l
|
|
736
736
|
}),
|
|
737
|
-
|
|
737
|
+
d && /* @__PURE__ */ q(p, {
|
|
738
738
|
icon: /* @__PURE__ */ q(Ee, {
|
|
739
|
-
size:
|
|
739
|
+
size: f.SM,
|
|
740
740
|
"aria-hidden": !0
|
|
741
741
|
}),
|
|
742
|
-
size:
|
|
742
|
+
size: T.Small,
|
|
743
743
|
"aria-label": y?.dislikeResponse ?? "Dislike response",
|
|
744
|
-
"aria-pressed":
|
|
745
|
-
className:
|
|
744
|
+
"aria-pressed": m === a.Dislike,
|
|
745
|
+
className: m === a.Dislike ? "!text-accent-primary" : void 0,
|
|
746
746
|
tooltipProps: { tooltip: v?.dislike ?? "Dislike" },
|
|
747
|
-
onClick:
|
|
747
|
+
onClick: d
|
|
748
748
|
})
|
|
749
749
|
] })]
|
|
750
750
|
});
|
|
@@ -755,16 +755,16 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
755
755
|
collapsedText: "_collapsedText_1exhl_15",
|
|
756
756
|
startersDivider: "_startersDivider_1exhl_26",
|
|
757
757
|
text: "_text_1exhl_30"
|
|
758
|
-
}, dt = ({ text: e, styles:
|
|
759
|
-
let { colors: w, typography: T, className: E, bubbleClassName: D } =
|
|
758
|
+
}, dt = ({ text: e, styles: i, actions: a, hasAlwaysVisibleActions: s, isStreaming: c, attachments: d, afterContent: f, starters: p, onSelectStarter: m, deploymentIconUrl: h, deploymentDisplayName: g, markdownComponents: _, onAttachmentClick: v, onDownloadAll: b, onAttachmentRetry: x, codeBlockTheme: S, labels: C }) => {
|
|
759
|
+
let { colors: w, typography: T, className: E, bubbleClassName: D } = i ?? {}, { attachmentClickLabel: O, attachmentRetryLabel: k, attachmentOpenInNewTabLabel: A, startersAriaLabel: j = "Quick reply buttons", thinkingLabel: M, codeBlockCopyLabel: N, codeBlockCopiedLabel: P, assistantMessageAriaLabel: F = "Assistant message", deploymentIconFallbackLabel: I = "AI" } = C ?? {}, L = c ? (d ?? []).filter((e) => e.type !== t.Audio) : d ?? [], R = l({
|
|
760
760
|
"--cm-bubble-text": w?.text,
|
|
761
761
|
"--cm-starters-divider": w?.startersDivider
|
|
762
|
-
}), z =
|
|
762
|
+
}), z = u($.text, T?.fontClassName), B = !!(h || g);
|
|
763
763
|
return /* @__PURE__ */ J("div", {
|
|
764
764
|
role: "group",
|
|
765
765
|
"aria-label": F,
|
|
766
766
|
style: R,
|
|
767
|
-
className:
|
|
767
|
+
className: u("flex w-full items-start gap-3", E),
|
|
768
768
|
children: [B && /* @__PURE__ */ q(n, {
|
|
769
769
|
src: h,
|
|
770
770
|
size: 28,
|
|
@@ -773,13 +773,13 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
773
773
|
}), /* @__PURE__ */ J("div", {
|
|
774
774
|
className: "flex w-full min-w-0 max-w-full flex-col items-start gap-5",
|
|
775
775
|
children: [/* @__PURE__ */ J("div", {
|
|
776
|
-
className:
|
|
776
|
+
className: u("flex w-full min-w-0 max-w-full flex-col items-start gap-4", D),
|
|
777
777
|
children: [
|
|
778
778
|
(e || c) && /* @__PURE__ */ q("div", {
|
|
779
779
|
"aria-live": "polite",
|
|
780
780
|
"aria-atomic": "false",
|
|
781
|
-
className:
|
|
782
|
-
children: /* @__PURE__ */ q(
|
|
781
|
+
className: u(z, "min-w-0 max-w-full text-start"),
|
|
782
|
+
children: /* @__PURE__ */ q(r, {
|
|
783
783
|
content: e,
|
|
784
784
|
isStreaming: c,
|
|
785
785
|
thinkingLabel: M,
|
|
@@ -791,8 +791,8 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
791
791
|
}),
|
|
792
792
|
/* @__PURE__ */ q(rt, {
|
|
793
793
|
attachments: L,
|
|
794
|
-
onAttachmentClick: (e) => v?.(
|
|
795
|
-
onDownloadAll:
|
|
794
|
+
onAttachmentClick: (e) => v?.(d?.find((t) => t.id === e)),
|
|
795
|
+
onDownloadAll: b,
|
|
796
796
|
onRetry: x,
|
|
797
797
|
labels: {
|
|
798
798
|
clickLabel: O,
|
|
@@ -803,18 +803,18 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
803
803
|
f,
|
|
804
804
|
/* @__PURE__ */ q(ut, {
|
|
805
805
|
...a,
|
|
806
|
-
isAlwaysVisible:
|
|
807
|
-
role:
|
|
806
|
+
isAlwaysVisible: s,
|
|
807
|
+
role: o.Assistant
|
|
808
808
|
})
|
|
809
809
|
]
|
|
810
810
|
}), p && p.length > 0 && m && /* @__PURE__ */ q("div", {
|
|
811
811
|
role: "list",
|
|
812
812
|
"aria-label": j,
|
|
813
|
-
className:
|
|
813
|
+
className: u("flex w-full flex-wrap gap-2 border-t pt-5", $.startersDivider),
|
|
814
814
|
children: p.map((e, t) => /* @__PURE__ */ q("div", {
|
|
815
815
|
role: "listitem",
|
|
816
816
|
className: "min-w-[40px]",
|
|
817
|
-
children: /* @__PURE__ */ q(
|
|
817
|
+
children: /* @__PURE__ */ q(y, {
|
|
818
818
|
label: e.title,
|
|
819
819
|
className: "min-w-[40px]",
|
|
820
820
|
onClick: () => m(e)
|
|
@@ -833,54 +833,54 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
833
833
|
})
|
|
834
834
|
}), pt = /* @__PURE__ */ function(e) {
|
|
835
835
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
836
|
-
}({}), mt = 10, ht = ({ text: e, position: t = pt.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount:
|
|
837
|
-
let { colors: _, typography: v, className: y, bubbleClassName: b } = n ?? {}, { showMoreLabel: x = "Show more", showLessLabel: S = "Show less", showMoreAriaLabel: C, showLessAriaLabel: w, attachmentClickLabel:
|
|
836
|
+
}({}), mt = 10, ht = ({ text: e, position: t = pt.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount: s = mt, labels: c, onAttachmentClick: p, onDownloadAll: m, onAttachmentRetry: g }) => {
|
|
837
|
+
let { colors: _, typography: v, className: y, bubbleClassName: b } = n ?? {}, { showMoreLabel: x = "Show more", showLessLabel: S = "Show less", showMoreAriaLabel: C, showLessAriaLabel: w, attachmentClickLabel: E, attachmentRetryLabel: D, attachmentOpenInNewTabLabel: O, userMessageAriaLabel: k = "User message" } = c ?? {}, { textRef: A, isTextCollapsed: N, isOverflowing: P, collapsedMaxHeight: F, expandedMaxHeight: I, isCollapsed: L, toggleCollapsed: R } = d({
|
|
838
838
|
text: e,
|
|
839
|
-
collapsedLineCount:
|
|
840
|
-
}), z =
|
|
839
|
+
collapsedLineCount: s
|
|
840
|
+
}), z = l({
|
|
841
841
|
"--cm-bubble-user-bg": _?.userBackground,
|
|
842
842
|
"--cm-bubble-user-border": _?.userBorder,
|
|
843
843
|
"--cm-bubble-fade-start": _?.fadeStart,
|
|
844
844
|
"--cm-bubble-text": _?.text,
|
|
845
845
|
"--cm-bubble-collapsed-height": P ? `${F}px` : void 0,
|
|
846
846
|
"--cm-bubble-expanded-height": P ? `${I}px` : void 0
|
|
847
|
-
}), B = t === pt.Top ? "rounded-ee-[6px] rounded-se-[16px]" : "rounded-se-[6px] rounded-ee-[16px]", V =
|
|
847
|
+
}), B = t === pt.Top ? "rounded-ee-[6px] rounded-se-[16px]" : "rounded-se-[6px] rounded-ee-[16px]", V = u($.text, v?.fontClassName), ee = C ?? x, te = w ?? S, ne = L ? x : S, re = L ? ee : te, ie = L ? j : M, ae = Ne();
|
|
848
848
|
return /* @__PURE__ */ q("div", {
|
|
849
849
|
role: "group",
|
|
850
850
|
"aria-label": k,
|
|
851
851
|
style: z,
|
|
852
|
-
className:
|
|
852
|
+
className: u("flex w-full", y),
|
|
853
853
|
children: /* @__PURE__ */ J("div", {
|
|
854
854
|
className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
|
|
855
855
|
children: [
|
|
856
856
|
/* @__PURE__ */ q(rt, {
|
|
857
857
|
attachments: a ?? [],
|
|
858
|
-
onAttachmentClick: (e) =>
|
|
858
|
+
onAttachmentClick: (e) => p?.(a?.find((t) => t.id === e)),
|
|
859
859
|
onDownloadAll: m,
|
|
860
|
-
onRetry:
|
|
860
|
+
onRetry: g,
|
|
861
861
|
labels: {
|
|
862
|
-
clickLabel:
|
|
862
|
+
clickLabel: E,
|
|
863
863
|
retryLabel: D,
|
|
864
864
|
openInNewTabLabel: O
|
|
865
865
|
},
|
|
866
866
|
styles: { className: "max-w-[640px]" }
|
|
867
867
|
}),
|
|
868
868
|
e && /* @__PURE__ */ q("div", {
|
|
869
|
-
className:
|
|
869
|
+
className: u($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", B, b),
|
|
870
870
|
children: /* @__PURE__ */ J("div", {
|
|
871
871
|
className: "flex min-w-0 flex-col items-start",
|
|
872
872
|
children: [/* @__PURE__ */ q("div", {
|
|
873
873
|
id: ae,
|
|
874
|
-
className:
|
|
874
|
+
className: u("relative overflow-hidden", P && $.collapsibleText, P && !L && $.expandedText, N && $.collapsedText),
|
|
875
875
|
children: /* @__PURE__ */ q("p", {
|
|
876
876
|
ref: A,
|
|
877
|
-
className:
|
|
877
|
+
className: u(V, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
|
|
878
878
|
children: e
|
|
879
879
|
})
|
|
880
|
-
}), P && /* @__PURE__ */ q(
|
|
880
|
+
}), P && /* @__PURE__ */ q(h, {
|
|
881
881
|
label: /* @__PURE__ */ q(K, { children: ne }),
|
|
882
882
|
iconBefore: /* @__PURE__ */ q(ie, {
|
|
883
|
-
size:
|
|
883
|
+
size: f.SM,
|
|
884
884
|
"aria-hidden": "true"
|
|
885
885
|
}),
|
|
886
886
|
"aria-label": re,
|
|
@@ -888,22 +888,22 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
888
888
|
"aria-controls": ae,
|
|
889
889
|
className: "mt-3",
|
|
890
890
|
onClick: R,
|
|
891
|
-
size:
|
|
891
|
+
size: T.Small
|
|
892
892
|
})]
|
|
893
893
|
})
|
|
894
894
|
}),
|
|
895
895
|
/* @__PURE__ */ q(ut, {
|
|
896
896
|
...r,
|
|
897
897
|
isAlwaysVisible: i,
|
|
898
|
-
role:
|
|
898
|
+
role: o.User
|
|
899
899
|
})
|
|
900
900
|
]
|
|
901
901
|
})
|
|
902
902
|
});
|
|
903
|
-
}, gt = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e ===
|
|
903
|
+
}, gt = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e === o.Status ? /* @__PURE__ */ q(ft, { labels: {
|
|
904
904
|
titleText: r.labels?.statusTitleText,
|
|
905
905
|
bodyText: r.labels?.statusBodyText ?? ""
|
|
906
|
-
} }) : e ===
|
|
906
|
+
} }) : e === o.User ? /* @__PURE__ */ q(ht, {
|
|
907
907
|
...r,
|
|
908
908
|
onAttachmentClick: t
|
|
909
909
|
}) : /* @__PURE__ */ q(dt, {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-conversation-messages",
|
|
3
3
|
"description": "Message bubble components for rendering conversation history with actions and source citations",
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.55",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"react": "^19.0.0",
|
|
21
21
|
"@tabler/icons-react": "^3.0.0",
|
|
22
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
23
|
-
"@epam/ai-dial-conversation-input": "1.1.0-dev.
|
|
22
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.55",
|
|
23
|
+
"@epam/ai-dial-conversation-input": "1.1.0-dev.55",
|
|
24
24
|
"react-markdown": "^10.1.0",
|
|
25
|
-
"@epam/ai-dial-ui-kit": "^0.13.0-dev.
|
|
25
|
+
"@epam/ai-dial-ui-kit": "^0.13.0-dev.17"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|