@epam/ai-dial-conversation-messages 1.1.0-dev.116 → 1.1.0-dev.121
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/MessageActions/MessageActions.d.ts.map +1 -1
- package/index.js +249 -290
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageActions.d.ts","sourceRoot":"","sources":["../../../src/components/MessageActions/MessageActions.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MessageActions.d.ts","sourceRoot":"","sources":["../../../src/components/MessageActions/MessageActions.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,EAAE,EAAyB,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAKxE,kIAAkI;AAClI,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAoJlD,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, CopyIconButton as n, DeploymentIcon as r, MDMessageViewer as i, MIME_TYPE_EXT_MAP as a, MessageRating as o, MessageRole as s, RequestStatus as c, ResponseFormat as l, buildCssVars as u, mergeClasses as d, useCollapsedText as f } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { DIAL_ICON_SIZE as p, DialInput as m, DialPopup as h, DialRadioGroup as g, DialSkeleton as _, DialSkeletonVariant as v, DialSlider as y, DialSpinner as b, DialTooltip as x, ElementSize as S, GhostIconButton as C, Highlight as w, InfoMessageNotification as T, LinkButton as E, NeutralButton as D, PopupSize as O, PrimaryButton as k, RadioGroupOrientation as A } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
import { IconChevronDown as
|
|
2
|
+
import { DIAL_ICON_SIZE as p, DialInput as m, DialPopup as h, DialRadioGroup as g, DialSkeleton as _, DialSkeletonVariant as v, DialSlider as y, DialSpinner as b, DialTooltip as x, ElementSize as S, GhostIconButton as C, Highlight as w, InfoMessageNotification as T, LinkButton as E, NeutralButton as D, PopupSize as O, PrimaryButton as k, RadioGroupOrientation as A, StaticIconButton as j } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconChevronDown as M, IconChevronUp as N, IconClipboard as P, IconDownload as F, IconExternalLink as I, IconFile as L, IconFileTypeBmp as R, IconFileTypeCss as z, IconFileTypeCsv as B, IconFileTypeDoc as V, IconFileTypeDocx as H, IconFileTypeHtml as U, IconFileTypeJpg as W, IconFileTypeJs as ee, IconFileTypeJsx as te, IconFileTypePdf as ne, IconFileTypePhp as re, IconFileTypePng as ie, IconFileTypePpt as ae, IconFileTypeRs as oe, IconFileTypeSql as se, IconFileTypeSvg as ce, IconFileTypeTs as le, IconFileTypeTsx as ue, IconFileTypeTxt as de, IconFileTypeVue as fe, IconFileTypeXls as pe, IconFileTypeXml as me, IconFileTypeZip as he, IconMarkdown as ge, IconMusic as _e, IconPaperclip as ve, IconPencilMinus as ye, IconPhoto as G, IconRefresh as be, IconReload as xe, IconTerminal2 as Se, IconThumbDown as Ce, IconThumbUp as we, IconTrashX as Te, IconVideo as Ee, IconX as De } from "@tabler/icons-react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
import { memo as
|
|
6
|
-
import { Fragment as
|
|
5
|
+
import { memo as Oe, useCallback as K, useEffect as ke, useId as Ae, useMemo as je, useRef as Me, useState as q } from "react";
|
|
6
|
+
import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
7
7
|
//#region ../attachment-input/dist/index.js
|
|
8
|
-
var
|
|
8
|
+
var Ne = (e) => {
|
|
9
9
|
if (e == null) return "";
|
|
10
10
|
let t = e.lastIndexOf(".");
|
|
11
11
|
return t > 0 ? e.slice(0, t) : e;
|
|
12
|
-
},
|
|
13
|
-
if (!e) return
|
|
12
|
+
}, Pe = (e) => {
|
|
13
|
+
if (!e) return L;
|
|
14
14
|
if (e.startsWith("image/")) switch (e) {
|
|
15
15
|
case "image/jpeg":
|
|
16
|
-
case "image/jpg": return
|
|
16
|
+
case "image/jpg": return W;
|
|
17
17
|
case "image/png": return ie;
|
|
18
18
|
case "image/svg+xml": return ce;
|
|
19
|
-
case "image/bmp": return
|
|
20
|
-
default: return
|
|
19
|
+
case "image/bmp": return R;
|
|
20
|
+
default: return G;
|
|
21
21
|
}
|
|
22
|
-
if (e.startsWith("video/")) return
|
|
23
|
-
if (e.startsWith("audio/")) return
|
|
22
|
+
if (e.startsWith("video/")) return Ee;
|
|
23
|
+
if (e.startsWith("audio/")) return _e;
|
|
24
24
|
switch (e) {
|
|
25
25
|
case "application/pdf": return ne;
|
|
26
26
|
case "application/msword":
|
|
27
|
-
case "application/vnd.ms-word": return
|
|
28
|
-
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return
|
|
27
|
+
case "application/vnd.ms-word": return V;
|
|
28
|
+
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return H;
|
|
29
29
|
case "application/vnd.ms-powerpoint": return ae;
|
|
30
30
|
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return ae;
|
|
31
31
|
case "application/vnd.ms-excel": return pe;
|
|
@@ -36,237 +36,199 @@ var Me = (e) => {
|
|
|
36
36
|
case "application/x-7z-compressed":
|
|
37
37
|
case "application/gzip":
|
|
38
38
|
case "application/x-tar": return he;
|
|
39
|
-
case "text/csv": return
|
|
39
|
+
case "text/csv": return B;
|
|
40
40
|
case "text/plain": return de;
|
|
41
41
|
case "text/html":
|
|
42
|
-
case "application/xhtml+xml": return
|
|
42
|
+
case "application/xhtml+xml": return U;
|
|
43
43
|
case "text/xml":
|
|
44
44
|
case "application/xml": return me;
|
|
45
45
|
case "application/sql":
|
|
46
46
|
case "text/x-sql": return se;
|
|
47
47
|
case "text/javascript":
|
|
48
|
-
case "application/javascript": return
|
|
48
|
+
case "application/javascript": return ee;
|
|
49
49
|
case "text/jsx": return te;
|
|
50
50
|
case "application/typescript":
|
|
51
51
|
case "text/typescript": return le;
|
|
52
52
|
case "text/tsx": return ue;
|
|
53
|
-
case "text/css": return
|
|
53
|
+
case "text/css": return z;
|
|
54
54
|
case "text/x-php":
|
|
55
55
|
case "application/x-php": return re;
|
|
56
56
|
case "text/x-rustsrc":
|
|
57
57
|
case "application/x-rust": return oe;
|
|
58
58
|
case "text/x-vue": return fe;
|
|
59
|
-
default: return
|
|
59
|
+
default: return L;
|
|
60
60
|
}
|
|
61
|
-
}, Pe = (e) => {
|
|
62
|
-
let { type: n, contentType: r } = e;
|
|
63
|
-
return n === t.Prompt ? xe : n === t.Pasted ? N : n === t.Image ? W : Ne(r ?? "");
|
|
64
61
|
}, Fe = (e) => {
|
|
62
|
+
let { type: n, contentType: r } = e;
|
|
63
|
+
return n === t.Prompt ? Se : n === t.Pasted ? P : n === t.Image ? G : Pe(r ?? "");
|
|
64
|
+
}, Ie = (e) => {
|
|
65
65
|
let t = e.toLowerCase().split(";")[0].trim(), n = a[t];
|
|
66
66
|
if (n) return n;
|
|
67
67
|
let r = t.split("/")[1];
|
|
68
68
|
if (r && !r.startsWith("vnd.") && !r.includes("+")) return r;
|
|
69
|
-
},
|
|
69
|
+
}, Le = (e, n) => {
|
|
70
70
|
let { type: r, name: i, contentType: a } = e;
|
|
71
71
|
if (r === t.Prompt) return n.promptLabel ?? "Prompt";
|
|
72
72
|
if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
|
|
73
73
|
if (r === t.Image) return n.imageLabel ?? "Image";
|
|
74
74
|
if (a) {
|
|
75
|
-
let e =
|
|
75
|
+
let e = Ie(a);
|
|
76
76
|
if (e) return `.${e}`;
|
|
77
77
|
}
|
|
78
78
|
let o = i.lastIndexOf(".");
|
|
79
79
|
return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
|
|
80
|
-
},
|
|
81
|
-
let { type: r, status: i, previewUrl: a, url: o } = e, s = i === c.Loading, l = i === c.Error, u = r === t.Image && !!(a ?? o) && !l, d = r === t.
|
|
80
|
+
}, Re = (e, n = {}) => {
|
|
81
|
+
let { type: r, status: i, previewUrl: a, url: o } = e, s = i === c.Loading, l = i === c.Error, u = r === t.Image && !!(a ?? o) && !l, d = r === t.Link && !l;
|
|
82
82
|
return {
|
|
83
83
|
isLoading: s,
|
|
84
84
|
isError: l,
|
|
85
85
|
isImage: u,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
typeLabel: f ? null : Ie(e, n)
|
|
86
|
+
isLink: d,
|
|
87
|
+
BottomIcon: d ? null : Fe(e),
|
|
88
|
+
typeLabel: d ? null : Le(e, n)
|
|
90
89
|
};
|
|
91
|
-
},
|
|
92
|
-
tile: "
|
|
93
|
-
hovered: "
|
|
94
|
-
selected: "
|
|
95
|
-
tileError: "
|
|
96
|
-
nameText: "
|
|
97
|
-
typeText: "
|
|
98
|
-
retryIcon: "
|
|
99
|
-
track: "
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
}, ze = "flex size-[84px] items-center justify-center rounded-xl border", Z = {
|
|
91
|
+
tile: "_tile_3jao2_1",
|
|
92
|
+
hovered: "_hovered_3jao2_5",
|
|
93
|
+
selected: "_selected_3jao2_15",
|
|
94
|
+
tileError: "_tileError_3jao2_20",
|
|
95
|
+
nameText: "_nameText_3jao2_25",
|
|
96
|
+
typeText: "_typeText_3jao2_29",
|
|
97
|
+
retryIcon: "_retryIcon_3jao2_33",
|
|
98
|
+
track: "_track_3jao2_37",
|
|
99
|
+
actionButton: "_actionButton_3jao2_43",
|
|
100
|
+
imageActionButton: "_imageActionButton_3jao2_47"
|
|
101
|
+
}, Q = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ Y(j, {
|
|
102
102
|
icon: a,
|
|
103
103
|
size: S.Small,
|
|
104
|
-
className: d("absolute end-1 top-1 opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", o),
|
|
104
|
+
className: d("absolute end-1 top-1 opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", Z.actionButton, o),
|
|
105
105
|
"aria-label": e,
|
|
106
106
|
"aria-describedby": t ? n : void 0,
|
|
107
107
|
onClick: (e) => {
|
|
108
108
|
e.stopPropagation(), r(i);
|
|
109
109
|
}
|
|
110
|
-
}),
|
|
111
|
-
icon: /* @__PURE__ */
|
|
110
|
+
}), Be = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
111
|
+
icon: /* @__PURE__ */ Y(xe, {
|
|
112
112
|
size: p.SM,
|
|
113
113
|
"aria-hidden": !0
|
|
114
114
|
}),
|
|
115
|
-
className:
|
|
115
|
+
className: Z.retryIcon,
|
|
116
116
|
...e
|
|
117
|
-
}),
|
|
118
|
-
icon: /* @__PURE__ */
|
|
117
|
+
}), Ve = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
118
|
+
icon: /* @__PURE__ */ Y(F, {
|
|
119
119
|
size: p.SM,
|
|
120
120
|
"aria-hidden": !0
|
|
121
121
|
}),
|
|
122
122
|
...e
|
|
123
|
-
}),
|
|
124
|
-
icon: /* @__PURE__ */
|
|
123
|
+
}), He = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
124
|
+
icon: /* @__PURE__ */ Y(I, {
|
|
125
125
|
size: p.SM,
|
|
126
126
|
"aria-hidden": !0
|
|
127
127
|
}),
|
|
128
128
|
...e
|
|
129
|
-
}),
|
|
130
|
-
icon: /* @__PURE__ */
|
|
129
|
+
}), Ue = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
130
|
+
icon: /* @__PURE__ */ Y(De, {
|
|
131
131
|
size: p.SM,
|
|
132
132
|
"aria-hidden": !0
|
|
133
133
|
}),
|
|
134
|
-
className: X.hoverIcon,
|
|
135
134
|
...e
|
|
136
|
-
}),
|
|
137
|
-
let { clickLabel: l = "Open attachment", downloadLabel: u = "Download attachment", removeLabel: f = "Remove attachment" } = a ?? {}, { typography: p, className: m } = o ?? {}, h = () => {
|
|
138
|
-
n?.(e.id);
|
|
139
|
-
};
|
|
140
|
-
return /* @__PURE__ */ Y("div", {
|
|
141
|
-
style: s,
|
|
142
|
-
...n == null ? {} : {
|
|
143
|
-
role: "button",
|
|
144
|
-
tabIndex: 0,
|
|
145
|
-
"aria-label": l,
|
|
146
|
-
onClick: h,
|
|
147
|
-
onKeyDown: (e) => {
|
|
148
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), h());
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
className: d("group/attachment-tile 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", c && X.selected, m),
|
|
152
|
-
children: [
|
|
153
|
-
/* @__PURE__ */ J("span", {
|
|
154
|
-
title: e.name,
|
|
155
|
-
className: d(p?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.nameText),
|
|
156
|
-
children: t ? /* @__PURE__ */ J(w, {
|
|
157
|
-
text: e.name,
|
|
158
|
-
query: t,
|
|
159
|
-
maxLines: 1
|
|
160
|
-
}) : e.name
|
|
161
|
-
}),
|
|
162
|
-
e.playUrl && /* @__PURE__ */ J("audio", {
|
|
163
|
-
controls: !0,
|
|
164
|
-
src: e.playUrl,
|
|
165
|
-
"aria-label": e.name,
|
|
166
|
-
className: "w-full",
|
|
167
|
-
preload: "metadata",
|
|
168
|
-
onClick: (e) => e.stopPropagation()
|
|
169
|
-
}),
|
|
170
|
-
r && /* @__PURE__ */ J(ze, {
|
|
171
|
-
ariaLabel: u,
|
|
172
|
-
onClick: r,
|
|
173
|
-
id: e.id
|
|
174
|
-
}),
|
|
175
|
-
i && /* @__PURE__ */ J(Ve, {
|
|
176
|
-
ariaLabel: f,
|
|
177
|
-
onClick: i,
|
|
178
|
-
id: e.id
|
|
179
|
-
})
|
|
180
|
-
]
|
|
181
|
-
});
|
|
182
|
-
}, Ue = "flex size-[84px] items-center justify-center rounded-xl border", We = {
|
|
135
|
+
}), We = {
|
|
183
136
|
[e.Network]: "Upload failed · network error",
|
|
184
137
|
[e.UnsupportedType]: "Upload failed · unsupported file type"
|
|
185
|
-
}, Ge = ({ attachment: n, onClick: r, onRetry: i, labels: a, styles: o, onDownload: s, isPasted: l, isLink: u, cssVars: f, onExpand: p, isExpandable: m, onRemove: h, isSelected: g }) => {
|
|
186
|
-
let { clickLabel: _ = "Download attachment", retryLabel: v = "Retry upload", sizeLabel: y, uploadingLabel: x = "Uploading", errorReasonLabels: S, genericErrorLabel: C = "Upload failed" } = a ?? {}, { typography:
|
|
187
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(
|
|
188
|
-
},
|
|
189
|
-
window.open(
|
|
190
|
-
}, [
|
|
191
|
-
title:
|
|
192
|
-
className: d(
|
|
193
|
-
children:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
138
|
+
}, Ge = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: a, styles: o, onDownload: s, isPasted: l, isLink: u, cssVars: f, onExpand: p, isExpandable: m, onRemove: h, isSelected: g }) => {
|
|
139
|
+
let { clickLabel: _ = "Download attachment", retryLabel: v = "Retry upload", sizeLabel: y, uploadingLabel: x = "Uploading", errorReasonLabels: S, genericErrorLabel: C = "Upload failed" } = a ?? {}, { typography: T, className: E } = o ?? {}, { id: D, name: O, status: k, errorReason: A } = t, j = k === c.Loading, M = k === c.Error, N = Ae(), P = M ? A && (S?.[A] ?? We[A]) || C : "", { BottomIcon: F, typeLabel: I } = Re(t), L = !M && !j && s && !u, R = M && !!i && A !== e.UnsupportedType, z = L || R ? "pe-5" : void 0, B = (e) => {
|
|
140
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(t.id));
|
|
141
|
+
}, V = je(() => l ? O : Ne(O), [l, O]), H = K(() => {
|
|
142
|
+
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
143
|
+
}, [t]), U = d(ze, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", Z.tile, !M && Z.hovered, g && Z.selected, M && Z.tileError), W = /* @__PURE__ */ Y("div", {
|
|
144
|
+
title: V,
|
|
145
|
+
className: d(T?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all", Z.nameText, !M && z),
|
|
146
|
+
children: n ? /* @__PURE__ */ Y(w, {
|
|
147
|
+
text: V,
|
|
148
|
+
query: n,
|
|
149
|
+
maxLines: 2
|
|
150
|
+
}) : V
|
|
151
|
+
}), ee = F && /* @__PURE__ */ X("div", {
|
|
152
|
+
className: d("flex w-full items-center gap-1", M && z),
|
|
153
|
+
children: [/* @__PURE__ */ Y(F, {
|
|
197
154
|
size: 16,
|
|
198
|
-
className:
|
|
155
|
+
className: Z.typeText,
|
|
199
156
|
"aria-hidden": !0
|
|
200
|
-
}), /* @__PURE__ */
|
|
201
|
-
className: d(
|
|
202
|
-
children: y ? `${
|
|
157
|
+
}), /* @__PURE__ */ Y("span", {
|
|
158
|
+
className: d(T?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Z.typeText),
|
|
159
|
+
children: y ? `${I} · ${y}` : I
|
|
203
160
|
})]
|
|
204
161
|
}), te = () => {
|
|
205
|
-
m && p ? p(
|
|
206
|
-
}, ne = /* @__PURE__ */
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
162
|
+
m && p ? p(D) : r && r(D);
|
|
163
|
+
}, ne = /* @__PURE__ */ X(J, { children: [
|
|
164
|
+
W,
|
|
165
|
+
ee,
|
|
166
|
+
j && /* @__PURE__ */ Y("div", {
|
|
210
167
|
"aria-label": x,
|
|
211
|
-
className: d("absolute
|
|
212
|
-
children: /* @__PURE__ */
|
|
213
|
-
}),
|
|
214
|
-
I && /* @__PURE__ */ J(ze, {
|
|
215
|
-
ariaLabel: _,
|
|
216
|
-
errorTitle: N,
|
|
217
|
-
errorDescId: M,
|
|
218
|
-
onClick: s,
|
|
219
|
-
id: E
|
|
168
|
+
className: d("absolute left-[-1px] top-[-1px] flex size-full items-center justify-center rounded", Z.track),
|
|
169
|
+
children: /* @__PURE__ */ Y(b, { size: 32 })
|
|
220
170
|
}),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
171
|
+
/* @__PURE__ */ X("div", {
|
|
172
|
+
className: d("absolute right-0 top-0 flex gap-1"),
|
|
173
|
+
children: [
|
|
174
|
+
L && /* @__PURE__ */ Y(Ve, {
|
|
175
|
+
ariaLabel: _,
|
|
176
|
+
errorTitle: P,
|
|
177
|
+
errorDescId: N,
|
|
178
|
+
onClick: s,
|
|
179
|
+
id: D
|
|
180
|
+
}),
|
|
181
|
+
R && /* @__PURE__ */ Y(Be, {
|
|
182
|
+
ariaLabel: v,
|
|
183
|
+
errorTitle: P,
|
|
184
|
+
errorDescId: N,
|
|
185
|
+
onClick: i,
|
|
186
|
+
id: D
|
|
187
|
+
}),
|
|
188
|
+
u && /* @__PURE__ */ Y(He, {
|
|
189
|
+
ariaLabel: v,
|
|
190
|
+
errorTitle: P,
|
|
191
|
+
errorDescId: N,
|
|
192
|
+
onClick: H
|
|
193
|
+
}),
|
|
194
|
+
h && /* @__PURE__ */ Y(Ue, {
|
|
195
|
+
ariaLabel: v,
|
|
196
|
+
errorTitle: P,
|
|
197
|
+
errorDescId: N,
|
|
198
|
+
onClick: h,
|
|
199
|
+
id: D
|
|
200
|
+
})
|
|
201
|
+
]
|
|
240
202
|
}),
|
|
241
|
-
|
|
242
|
-
id:
|
|
203
|
+
M && /* @__PURE__ */ Y("span", {
|
|
204
|
+
id: N,
|
|
243
205
|
role: "status",
|
|
244
206
|
"aria-live": "polite",
|
|
245
207
|
className: "sr-only",
|
|
246
|
-
children:
|
|
208
|
+
children: P
|
|
247
209
|
})
|
|
248
210
|
] });
|
|
249
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ Y("div", {
|
|
250
212
|
style: f,
|
|
251
|
-
className: d("inline-flex",
|
|
252
|
-
children: /* @__PURE__ */
|
|
213
|
+
className: d("inline-flex", E),
|
|
214
|
+
children: /* @__PURE__ */ Y("div", {
|
|
253
215
|
role: "button",
|
|
254
216
|
tabIndex: 0,
|
|
255
217
|
"aria-label": _,
|
|
256
218
|
onClick: te,
|
|
257
|
-
onKeyDown:
|
|
219
|
+
onKeyDown: B,
|
|
258
220
|
style: f,
|
|
259
|
-
className: d(
|
|
221
|
+
className: d(U, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
260
222
|
children: ne
|
|
261
223
|
})
|
|
262
224
|
});
|
|
263
|
-
},
|
|
225
|
+
}, Ke = /* @__PURE__ */ function(e) {
|
|
264
226
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
265
|
-
}({}),
|
|
266
|
-
let n =
|
|
267
|
-
return
|
|
227
|
+
}({}), qe = ({ enabled: e, src: t }) => {
|
|
228
|
+
let n = Me(null), [r, i] = q("idle");
|
|
229
|
+
return ke(() => {
|
|
268
230
|
i(e && t ? "loading" : "idle");
|
|
269
|
-
}, [e, t]),
|
|
231
|
+
}, [e, t]), ke(() => {
|
|
270
232
|
let r = n.current;
|
|
271
233
|
if (!r || !e || !t) return;
|
|
272
234
|
let a = () => i("loaded"), o = () => i("error");
|
|
@@ -277,15 +239,15 @@ var Me = (e) => {
|
|
|
277
239
|
imageRef: n,
|
|
278
240
|
imageLoadStatus: r
|
|
279
241
|
};
|
|
280
|
-
},
|
|
281
|
-
let { clickLabel: u = "Open attachment", expandLabel: f = "Expand pasted text" } = i ?? {}, { className: m } = c ?? {}, { id: h, name: g } = e, y = e.previewUrl ?? e.url, b = e.type === t.Pasted && n !== void 0, { isLoading: x, isError: S, isImage: C } =
|
|
242
|
+
}, Je = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c, isSelected: l }) => {
|
|
243
|
+
let { clickLabel: u = "Open attachment", expandLabel: f = "Expand pasted text" } = i ?? {}, { className: m } = c ?? {}, { id: h, name: g } = e, y = e.previewUrl ?? e.url, b = e.type === t.Pasted && n !== void 0, { isLoading: x, isError: S, isImage: C } = je(() => Re(e), [e]), w = r !== void 0 && !b && !x && !S, { imageRef: T, imageLoadStatus: E } = qe({
|
|
282
244
|
enabled: C,
|
|
283
245
|
src: y
|
|
284
246
|
}), D = () => {
|
|
285
247
|
b && n ? n(h) : w && r && r(h);
|
|
286
248
|
};
|
|
287
|
-
return /* @__PURE__ */
|
|
288
|
-
className: d(
|
|
249
|
+
return /* @__PURE__ */ Y("div", {
|
|
250
|
+
className: d(ze, "group/attachment-tile", w && "cursor-pointer", Z.tile, l && Z.selected, m),
|
|
289
251
|
onClick: D,
|
|
290
252
|
onKeyDown: (e) => {
|
|
291
253
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), D());
|
|
@@ -294,43 +256,43 @@ var Me = (e) => {
|
|
|
294
256
|
role: "button",
|
|
295
257
|
style: o,
|
|
296
258
|
"aria-label": w ? u : b ? f : void 0,
|
|
297
|
-
children: /* @__PURE__ */
|
|
259
|
+
children: /* @__PURE__ */ X("div", {
|
|
298
260
|
className: "relative h-full w-full overflow-hidden",
|
|
299
261
|
children: [
|
|
300
|
-
a && /* @__PURE__ */
|
|
262
|
+
a && /* @__PURE__ */ Y(Ue, {
|
|
301
263
|
onClick: a,
|
|
302
264
|
id: h,
|
|
303
|
-
className:
|
|
265
|
+
className: Z.imageActionButton
|
|
304
266
|
}),
|
|
305
|
-
s && /* @__PURE__ */
|
|
267
|
+
s && /* @__PURE__ */ Y(Ve, {
|
|
306
268
|
onClick: s,
|
|
307
269
|
id: h,
|
|
308
|
-
className:
|
|
270
|
+
className: Z.imageActionButton
|
|
309
271
|
}),
|
|
310
|
-
E !==
|
|
272
|
+
E !== Ke.Loaded && /* @__PURE__ */ Y(_, {
|
|
311
273
|
variant: v.Rectangular,
|
|
312
274
|
width: "100%",
|
|
313
275
|
height: "100%",
|
|
314
|
-
active: E ===
|
|
315
|
-
overlay: /* @__PURE__ */
|
|
276
|
+
active: E === Ke.Loading,
|
|
277
|
+
overlay: /* @__PURE__ */ Y(G, {
|
|
316
278
|
size: p.LG,
|
|
317
|
-
className:
|
|
279
|
+
className: Z.typeText,
|
|
318
280
|
"aria-hidden": !0
|
|
319
281
|
}),
|
|
320
282
|
className: "absolute inset-0 rounded-xl"
|
|
321
283
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ Y("img", {
|
|
323
285
|
ref: T,
|
|
324
286
|
src: y,
|
|
325
287
|
alt: g,
|
|
326
288
|
loading: "lazy",
|
|
327
289
|
decoding: "async",
|
|
328
|
-
className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200", E ===
|
|
290
|
+
className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200", E === Ke.Loaded ? "opacity-100" : "opacity-0")
|
|
329
291
|
})
|
|
330
292
|
]
|
|
331
293
|
})
|
|
332
294
|
});
|
|
333
|
-
},
|
|
295
|
+
}, Ye = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: c, styles: l, isSelected: d }) => {
|
|
334
296
|
let { colors: f } = l ?? {}, p = e.type === t.Pasted, m = p && a !== void 0, h = u({
|
|
335
297
|
"--ai-tile-bg": f?.background,
|
|
336
298
|
"--ai-tile-border": f?.border,
|
|
@@ -347,18 +309,8 @@ var Me = (e) => {
|
|
|
347
309
|
"--ai-tile-hover-icon-bg": f?.hoverIconBackground,
|
|
348
310
|
"--ai-tile-hover-icon-color": f?.hoverIconColor,
|
|
349
311
|
"--ai-tile-progress-track": f?.trackBackground
|
|
350
|
-
}), { isImage: g,
|
|
351
|
-
return
|
|
352
|
-
attachment: e,
|
|
353
|
-
labels: c,
|
|
354
|
-
onClick: o,
|
|
355
|
-
onDownload: s,
|
|
356
|
-
onRemove: r,
|
|
357
|
-
searchQuery: n,
|
|
358
|
-
styles: l,
|
|
359
|
-
cssVars: h,
|
|
360
|
-
isSelected: d
|
|
361
|
-
}) : g ? /* @__PURE__ */ J(qe, {
|
|
312
|
+
}), { isImage: g, isLink: _ } = je(() => Re(e), [e]);
|
|
313
|
+
return g ? /* @__PURE__ */ Y(Je, {
|
|
362
314
|
attachment: e,
|
|
363
315
|
labels: c,
|
|
364
316
|
onClick: o,
|
|
@@ -368,13 +320,14 @@ var Me = (e) => {
|
|
|
368
320
|
cssVars: h,
|
|
369
321
|
onDownload: s,
|
|
370
322
|
isSelected: d
|
|
371
|
-
}) : /* @__PURE__ */
|
|
323
|
+
}) : /* @__PURE__ */ Y(Ge, {
|
|
372
324
|
attachment: e,
|
|
325
|
+
searchQuery: n,
|
|
373
326
|
onClick: o,
|
|
374
327
|
onRetry: i,
|
|
375
328
|
onRemove: r,
|
|
376
329
|
onDownload: s,
|
|
377
|
-
isLink:
|
|
330
|
+
isLink: _,
|
|
378
331
|
isPasted: p,
|
|
379
332
|
styles: l,
|
|
380
333
|
labels: c,
|
|
@@ -383,38 +336,38 @@ var Me = (e) => {
|
|
|
383
336
|
isExpandable: m,
|
|
384
337
|
isSelected: d
|
|
385
338
|
});
|
|
386
|
-
},
|
|
387
|
-
headerIcon: "
|
|
388
|
-
headerLabel: "
|
|
389
|
-
},
|
|
390
|
-
let { ariaLabel: l = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: h = "Download all", openInNewTabLabel: g, getHeaderLabel: _ = (e) =>
|
|
339
|
+
}, Xe = {
|
|
340
|
+
headerIcon: "_headerIcon_1dmgi_1",
|
|
341
|
+
headerLabel: "_headerLabel_1dmgi_2"
|
|
342
|
+
}, Ze = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Qe = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o, selectedAttachmentId: s }) => {
|
|
343
|
+
let { ariaLabel: l = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: h = "Download all", openInNewTabLabel: g, getHeaderLabel: _ = (e) => Ze(e, "attachment"), promptLabel: v, pastedLabel: y, imageLabel: b } = a ?? {}, { typography: x, colors: w, className: T } = o ?? {}, E = u({ "--ai-group-text": w?.text });
|
|
391
344
|
if (e.length === 0) return null;
|
|
392
|
-
let D = e.some((e) => e.type === t.Image), O = e.some((e) => e.type !== t.Image), k = D && O, A = e.length >= 5, j = k ?
|
|
345
|
+
let D = e.some((e) => e.type === t.Image), O = e.some((e) => e.type !== t.Image), k = D && O, A = e.length >= 5, j = k ? ve : D ? G : L, M = _(e.length), N = () => {
|
|
393
346
|
let t = e.filter((e) => e.status === c.Idle);
|
|
394
347
|
r ? r(t) : t.forEach((e) => n?.(e.id));
|
|
395
|
-
},
|
|
348
|
+
}, P = (t) => {
|
|
396
349
|
let n = e.find((e) => e.id === t);
|
|
397
350
|
n && r?.([n]);
|
|
398
351
|
};
|
|
399
|
-
return /* @__PURE__ */
|
|
352
|
+
return /* @__PURE__ */ X("div", {
|
|
400
353
|
role: "group",
|
|
401
354
|
"aria-label": l,
|
|
402
355
|
style: E,
|
|
403
|
-
className: d("flex flex-col gap-1", A ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]",
|
|
404
|
-
children: [/* @__PURE__ */
|
|
356
|
+
className: d("flex flex-col gap-1", A ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Xe.container, T),
|
|
357
|
+
children: [/* @__PURE__ */ X("div", {
|
|
405
358
|
className: "flex items-center justify-between",
|
|
406
|
-
children: [/* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ X("div", {
|
|
407
360
|
className: "flex items-center gap-1",
|
|
408
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ Y(j, {
|
|
409
362
|
size: p.SM,
|
|
410
|
-
className: d("shrink-0",
|
|
363
|
+
className: d("shrink-0", Xe.headerIcon),
|
|
411
364
|
"aria-hidden": !0
|
|
412
|
-
}), /* @__PURE__ */
|
|
413
|
-
className: d(x?.headerLabelClassName ?? "dial-tiny-semi-text",
|
|
365
|
+
}), /* @__PURE__ */ Y("span", {
|
|
366
|
+
className: d(x?.headerLabelClassName ?? "dial-tiny-semi-text", Xe.headerLabel),
|
|
414
367
|
children: M
|
|
415
368
|
})]
|
|
416
|
-
}), e.length >= 2 && (r || n) && /* @__PURE__ */
|
|
417
|
-
icon: /* @__PURE__ */
|
|
369
|
+
}), e.length >= 2 && (r || n) && /* @__PURE__ */ Y(C, {
|
|
370
|
+
icon: /* @__PURE__ */ Y(F, {
|
|
418
371
|
size: p.SM,
|
|
419
372
|
"aria-hidden": !0
|
|
420
373
|
}),
|
|
@@ -422,16 +375,16 @@ var Me = (e) => {
|
|
|
422
375
|
"aria-label": h,
|
|
423
376
|
onClick: N
|
|
424
377
|
})]
|
|
425
|
-
}), /* @__PURE__ */
|
|
378
|
+
}), /* @__PURE__ */ Y("div", {
|
|
426
379
|
role: "list",
|
|
427
380
|
"aria-label": M,
|
|
428
381
|
className: d("gap-3", A ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
|
|
429
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
382
|
+
children: e.map((e, t) => /* @__PURE__ */ Y("div", {
|
|
430
383
|
role: "listitem",
|
|
431
|
-
children: /* @__PURE__ */
|
|
384
|
+
children: /* @__PURE__ */ Y(Ye, {
|
|
432
385
|
attachment: e,
|
|
433
386
|
onClick: n,
|
|
434
|
-
onDownload:
|
|
387
|
+
onDownload: P,
|
|
435
388
|
onRetry: i,
|
|
436
389
|
labels: {
|
|
437
390
|
clickLabel: f,
|
|
@@ -446,9 +399,9 @@ var Me = (e) => {
|
|
|
446
399
|
}, `${e.id}-${t}`))
|
|
447
400
|
})]
|
|
448
401
|
});
|
|
449
|
-
},
|
|
450
|
-
let [s, c] =
|
|
451
|
-
|
|
402
|
+
}, $e = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
403
|
+
let [s, c] = q(t), [l, u] = q(n), [d, f] = q(r), p = Me(o);
|
|
404
|
+
ke(() => {
|
|
452
405
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
453
406
|
}, [
|
|
454
407
|
o,
|
|
@@ -465,7 +418,7 @@ var Me = (e) => {
|
|
|
465
418
|
setResponseFormat: c,
|
|
466
419
|
setSystemPrompt: u,
|
|
467
420
|
setTemperature: f,
|
|
468
|
-
handleSubmit:
|
|
421
|
+
handleSubmit: K(() => {
|
|
469
422
|
if (!m) return;
|
|
470
423
|
let t = {};
|
|
471
424
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -479,17 +432,17 @@ var Me = (e) => {
|
|
|
479
432
|
a
|
|
480
433
|
])
|
|
481
434
|
};
|
|
482
|
-
},
|
|
435
|
+
}, et = { label: "_label_14i7c_1" }, tt = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: a, onTemperatureChange: o, responseFormatLabel: s = "Response format", responseFormatHint: c = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: p = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: _ = "Enter a prompt", temperatureLabel: v = "Temperature", temperatureLabels: b = [
|
|
483
436
|
"Precise",
|
|
484
437
|
"Neutral",
|
|
485
438
|
"Creative"
|
|
486
439
|
], temperatureHint: x, labelClassName: S = "!dial-small-semi-text", colors: C }) => {
|
|
487
|
-
let w = u({ "--csf-label-text": C?.labelText }), T = d(S,
|
|
488
|
-
return /* @__PURE__ */
|
|
440
|
+
let w = u({ "--csf-label-text": C?.labelText }), T = d(S, et.label, "gap-1");
|
|
441
|
+
return /* @__PURE__ */ X("div", {
|
|
489
442
|
className: "flex flex-col gap-4 px-6 py-3",
|
|
490
443
|
style: w,
|
|
491
444
|
children: [
|
|
492
|
-
e.responseFormat && /* @__PURE__ */
|
|
445
|
+
e.responseFormat && /* @__PURE__ */ Y(g, {
|
|
493
446
|
fieldTitle: s,
|
|
494
447
|
labelClassName: T,
|
|
495
448
|
elementId: "response-format",
|
|
@@ -505,7 +458,7 @@ var Me = (e) => {
|
|
|
505
458
|
}],
|
|
506
459
|
onChange: (e) => i(e)
|
|
507
460
|
}),
|
|
508
|
-
e.systemPrompt && /* @__PURE__ */
|
|
461
|
+
e.systemPrompt && /* @__PURE__ */ Y(m, {
|
|
509
462
|
value: n,
|
|
510
463
|
placeholder: _,
|
|
511
464
|
labelProps: {
|
|
@@ -514,7 +467,7 @@ var Me = (e) => {
|
|
|
514
467
|
},
|
|
515
468
|
onChange: (e) => a(e ?? "")
|
|
516
469
|
}),
|
|
517
|
-
e.temperature && /* @__PURE__ */
|
|
470
|
+
e.temperature && /* @__PURE__ */ Y(y, {
|
|
518
471
|
labelProps: {
|
|
519
472
|
label: v,
|
|
520
473
|
className: T,
|
|
@@ -529,9 +482,9 @@ var Me = (e) => {
|
|
|
529
482
|
})
|
|
530
483
|
]
|
|
531
484
|
});
|
|
532
|
-
},
|
|
533
|
-
|
|
534
|
-
let { responseFormat: b, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: T, setSystemPrompt: E, setTemperature: D, handleSubmit: A } =
|
|
485
|
+
}, nt = { modal: "_modal_od073_1" };
|
|
486
|
+
Oe(({ 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: g, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = nt.modal }) => {
|
|
487
|
+
let { responseFormat: b, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: T, setSystemPrompt: E, setTemperature: D, handleSubmit: A } = $e({
|
|
535
488
|
features: e,
|
|
536
489
|
initialResponseFormat: t,
|
|
537
490
|
initialSystemPrompt: n,
|
|
@@ -539,25 +492,25 @@ De(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
539
492
|
onSave: i,
|
|
540
493
|
onClose: a
|
|
541
494
|
});
|
|
542
|
-
return /* @__PURE__ */
|
|
495
|
+
return /* @__PURE__ */ Y(h, {
|
|
543
496
|
open: !0,
|
|
544
497
|
header: o,
|
|
545
498
|
size: O.Sm,
|
|
546
499
|
onClose: a,
|
|
547
500
|
className: y,
|
|
548
|
-
footer: /* @__PURE__ */
|
|
501
|
+
footer: /* @__PURE__ */ Y("div", {
|
|
549
502
|
className: "flex justify-end px-6 py-4",
|
|
550
|
-
children: /* @__PURE__ */
|
|
503
|
+
children: /* @__PURE__ */ Y(x, {
|
|
551
504
|
tooltip: v,
|
|
552
505
|
hideTooltip: w || !v,
|
|
553
|
-
children: /* @__PURE__ */
|
|
506
|
+
children: /* @__PURE__ */ Y(k, {
|
|
554
507
|
label: _,
|
|
555
508
|
onClick: A,
|
|
556
509
|
disabled: !w
|
|
557
510
|
})
|
|
558
511
|
})
|
|
559
512
|
}),
|
|
560
|
-
children: /* @__PURE__ */
|
|
513
|
+
children: /* @__PURE__ */ Y(tt, {
|
|
561
514
|
features: e,
|
|
562
515
|
responseFormat: b,
|
|
563
516
|
systemPrompt: S,
|
|
@@ -577,24 +530,24 @@ De(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
577
530
|
})
|
|
578
531
|
});
|
|
579
532
|
});
|
|
580
|
-
var
|
|
581
|
-
let { tooltips: b, ariaLabels: x } = v ?? {}, [w, T] =
|
|
582
|
-
c?.(), T("copy"), D(x?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => T(null),
|
|
583
|
-
}, [c, x?.copiedStatus]), A =
|
|
584
|
-
l?.(), T("markdown"), D(x?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => T(null),
|
|
533
|
+
var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e = s.User, onEdit: t, onEditHover: r, onDelete: i, onRegenerate: a, onCopy: c, onCopyMarkdown: l, onLike: f, onDislike: m, activeRating: h, isAlwaysVisible: g, className: _, labels: v, colors: y }) => {
|
|
534
|
+
let { tooltips: b, ariaLabels: x } = v ?? {}, [w, T] = q(null), [E, D] = q(""), O = u({ "--ma-active-rating-text": y?.activeRatingText }), k = K(() => {
|
|
535
|
+
c?.(), T("copy"), D(x?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => T(null), it);
|
|
536
|
+
}, [c, x?.copiedStatus]), A = K(() => {
|
|
537
|
+
l?.(), T("markdown"), D(x?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => T(null), it);
|
|
585
538
|
}, [l, x?.copiedMarkdownStatus]);
|
|
586
|
-
return /* @__PURE__ */
|
|
539
|
+
return /* @__PURE__ */ X("div", {
|
|
587
540
|
role: "toolbar",
|
|
588
541
|
"aria-label": x?.actionsGroup ?? "Message actions",
|
|
589
542
|
style: O,
|
|
590
543
|
className: d("flex gap-1", !g && "opacity-0 group-hover:opacity-100", _),
|
|
591
|
-
children: [/* @__PURE__ */
|
|
544
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
592
545
|
role: "status",
|
|
593
546
|
"aria-live": "polite",
|
|
594
547
|
className: "sr-only",
|
|
595
548
|
children: E
|
|
596
|
-
}), e === s.User ? /* @__PURE__ */
|
|
597
|
-
icon: /* @__PURE__ */
|
|
549
|
+
}), e === s.User ? /* @__PURE__ */ X(J, { children: [t && /* @__PURE__ */ Y(C, {
|
|
550
|
+
icon: /* @__PURE__ */ Y(ye, {
|
|
598
551
|
size: p.SM,
|
|
599
552
|
"aria-hidden": !0
|
|
600
553
|
}),
|
|
@@ -604,8 +557,8 @@ var nt = { activeRating: "_activeRating_7jito_1" }, rt = 2e3, it = ({ role: e =
|
|
|
604
557
|
onClick: t,
|
|
605
558
|
onMouseEnter: r,
|
|
606
559
|
onFocus: r
|
|
607
|
-
}), i && /* @__PURE__ */
|
|
608
|
-
icon: /* @__PURE__ */
|
|
560
|
+
}), i && /* @__PURE__ */ Y(C, {
|
|
561
|
+
icon: /* @__PURE__ */ Y(Te, {
|
|
609
562
|
size: p.SM,
|
|
610
563
|
"aria-hidden": !0
|
|
611
564
|
}),
|
|
@@ -613,9 +566,9 @@ var nt = { activeRating: "_activeRating_7jito_1" }, rt = 2e3, it = ({ role: e =
|
|
|
613
566
|
"aria-label": x?.deleteMessage ?? "Delete message",
|
|
614
567
|
tooltipProps: { tooltip: b?.delete ?? "Delete" },
|
|
615
568
|
onClick: i
|
|
616
|
-
})] }) : /* @__PURE__ */
|
|
617
|
-
a && /* @__PURE__ */
|
|
618
|
-
icon: /* @__PURE__ */
|
|
569
|
+
})] }) : /* @__PURE__ */ X(J, { children: [
|
|
570
|
+
a && /* @__PURE__ */ Y(C, {
|
|
571
|
+
icon: /* @__PURE__ */ Y(be, {
|
|
619
572
|
size: p.SM,
|
|
620
573
|
"aria-hidden": !0
|
|
621
574
|
}),
|
|
@@ -624,7 +577,8 @@ var nt = { activeRating: "_activeRating_7jito_1" }, rt = 2e3, it = ({ role: e =
|
|
|
624
577
|
tooltipProps: { tooltip: b?.regenerate ?? "Regenerate" },
|
|
625
578
|
onClick: a
|
|
626
579
|
}),
|
|
627
|
-
c && /* @__PURE__ */
|
|
580
|
+
c && /* @__PURE__ */ Y(n, {
|
|
581
|
+
iconSize: p.SM,
|
|
628
582
|
onClick: k,
|
|
629
583
|
size: S.Small,
|
|
630
584
|
isCopied: w === "copy",
|
|
@@ -632,35 +586,40 @@ var nt = { activeRating: "_activeRating_7jito_1" }, rt = 2e3, it = ({ role: e =
|
|
|
632
586
|
copiedLabel: b?.copied ?? "Copied!",
|
|
633
587
|
ariaLabel: x?.copyResponse ?? "Copy response"
|
|
634
588
|
}),
|
|
635
|
-
l && /* @__PURE__ */
|
|
589
|
+
l && /* @__PURE__ */ Y(n, {
|
|
590
|
+
iconSize: p.SM,
|
|
636
591
|
onClick: A,
|
|
637
592
|
size: S.Small,
|
|
638
593
|
isCopied: w === "markdown",
|
|
594
|
+
iconCopy: /* @__PURE__ */ Y(ge, {
|
|
595
|
+
size: p.SM,
|
|
596
|
+
"aria-hidden": !0
|
|
597
|
+
}),
|
|
639
598
|
copyLabel: b?.copyMarkdown ?? "Copy as Markdown",
|
|
640
599
|
copiedLabel: b?.copiedMarkdown ?? "Copied!",
|
|
641
600
|
ariaLabel: x?.copyAsMarkdown ?? "Copy as markdown"
|
|
642
601
|
}),
|
|
643
|
-
f && /* @__PURE__ */
|
|
644
|
-
icon: /* @__PURE__ */
|
|
602
|
+
f && /* @__PURE__ */ Y(C, {
|
|
603
|
+
icon: /* @__PURE__ */ Y(we, {
|
|
645
604
|
size: p.SM,
|
|
646
605
|
"aria-hidden": !0
|
|
647
606
|
}),
|
|
648
607
|
size: S.Small,
|
|
649
608
|
"aria-label": x?.likeResponse ?? "Like response",
|
|
650
609
|
"aria-pressed": h === o.Like,
|
|
651
|
-
className: h === o.Like ?
|
|
610
|
+
className: h === o.Like ? rt.activeRating : void 0,
|
|
652
611
|
tooltipProps: { tooltip: b?.like ?? "Like" },
|
|
653
612
|
onClick: f
|
|
654
613
|
}),
|
|
655
|
-
m && /* @__PURE__ */
|
|
656
|
-
icon: /* @__PURE__ */
|
|
614
|
+
m && /* @__PURE__ */ Y(C, {
|
|
615
|
+
icon: /* @__PURE__ */ Y(Ce, {
|
|
657
616
|
size: p.SM,
|
|
658
617
|
"aria-hidden": !0
|
|
659
618
|
}),
|
|
660
619
|
size: S.Small,
|
|
661
620
|
"aria-label": x?.dislikeResponse ?? "Dislike response",
|
|
662
621
|
"aria-pressed": h === o.Dislike,
|
|
663
|
-
className: h === o.Dislike ?
|
|
622
|
+
className: h === o.Dislike ? rt.activeRating : void 0,
|
|
664
623
|
tooltipProps: { tooltip: b?.dislike ?? "Dislike" },
|
|
665
624
|
onClick: m
|
|
666
625
|
})
|
|
@@ -673,31 +632,31 @@ var nt = { activeRating: "_activeRating_7jito_1" }, rt = 2e3, it = ({ role: e =
|
|
|
673
632
|
collapsedText: "_collapsedText_ovjc1_15",
|
|
674
633
|
startersDivider: "_startersDivider_ovjc1_26",
|
|
675
634
|
text: "_text_ovjc1_30"
|
|
676
|
-
},
|
|
635
|
+
}, ot = ({ text: e, styles: n, actions: a, hasAlwaysVisibleActions: o, isStreaming: c, attachments: l, afterContent: f, starters: p, onSelectStarter: m, deploymentIconUrl: h, deploymentDisplayName: g, markdownComponents: _, onAttachmentClick: v, onDownloadAll: y, onAttachmentRetry: b, codeBlockTheme: x, labels: S, selectedAttachmentId: C }) => {
|
|
677
636
|
let { colors: w, typography: T, className: E, bubbleClassName: O } = n ?? {}, { attachmentClickLabel: k, attachmentRetryLabel: A, attachmentOpenInNewTabLabel: j, startersAriaLabel: M = "Quick reply buttons", thinkingLabel: N, codeBlockCopyLabel: P, codeBlockCopiedLabel: F, assistantMessageAriaLabel: I = "Assistant message", deploymentIconFallbackLabel: L = "AI" } = S ?? {}, R = c ? (l ?? []).filter((e) => e.type !== t.Audio) : l ?? [], z = u({
|
|
678
637
|
"--cm-bubble-text": w?.text,
|
|
679
638
|
"--cm-starters-divider": w?.startersDivider
|
|
680
639
|
}), B = d($.text, T?.fontClassName), V = !!(h || g);
|
|
681
|
-
return /* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ X("div", {
|
|
682
641
|
role: "group",
|
|
683
642
|
"aria-label": I,
|
|
684
643
|
style: z,
|
|
685
644
|
className: d("flex w-full items-start gap-3", E),
|
|
686
|
-
children: [V && /* @__PURE__ */
|
|
645
|
+
children: [V && /* @__PURE__ */ Y(r, {
|
|
687
646
|
src: h,
|
|
688
647
|
size: 28,
|
|
689
648
|
initialsName: g || L,
|
|
690
649
|
labels: { tooltip: g ?? L }
|
|
691
|
-
}), /* @__PURE__ */
|
|
650
|
+
}), /* @__PURE__ */ X("div", {
|
|
692
651
|
className: "flex w-full min-w-0 max-w-full flex-col items-start gap-5",
|
|
693
|
-
children: [/* @__PURE__ */
|
|
652
|
+
children: [/* @__PURE__ */ X("div", {
|
|
694
653
|
className: d("flex w-full min-w-0 max-w-full flex-col items-start gap-4", O),
|
|
695
654
|
children: [
|
|
696
|
-
(e || c) && /* @__PURE__ */
|
|
655
|
+
(e || c) && /* @__PURE__ */ Y("div", {
|
|
697
656
|
"aria-live": "polite",
|
|
698
657
|
"aria-atomic": "false",
|
|
699
658
|
className: d(B, "min-w-0 max-w-full text-start"),
|
|
700
|
-
children: /* @__PURE__ */
|
|
659
|
+
children: /* @__PURE__ */ Y(i, {
|
|
701
660
|
content: e,
|
|
702
661
|
isStreaming: c,
|
|
703
662
|
thinkingLabel: N,
|
|
@@ -707,7 +666,7 @@ var nt = { activeRating: "_activeRating_7jito_1" }, rt = 2e3, it = ({ role: e =
|
|
|
707
666
|
codeBlockTheme: x
|
|
708
667
|
})
|
|
709
668
|
}),
|
|
710
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ Y(Qe, {
|
|
711
670
|
attachments: R,
|
|
712
671
|
onAttachmentClick: (e) => v?.(l?.find((t) => t.id === e)),
|
|
713
672
|
onDownloadAll: y,
|
|
@@ -720,20 +679,20 @@ var nt = { activeRating: "_activeRating_7jito_1" }, rt = 2e3, it = ({ role: e =
|
|
|
720
679
|
selectedAttachmentId: C
|
|
721
680
|
}),
|
|
722
681
|
f,
|
|
723
|
-
/* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ Y(at, {
|
|
724
683
|
...a,
|
|
725
684
|
isAlwaysVisible: o,
|
|
726
685
|
role: s.Assistant
|
|
727
686
|
})
|
|
728
687
|
]
|
|
729
|
-
}), p && p.length > 0 && m && /* @__PURE__ */
|
|
688
|
+
}), p && p.length > 0 && m && /* @__PURE__ */ Y("div", {
|
|
730
689
|
role: "list",
|
|
731
690
|
"aria-label": M,
|
|
732
691
|
className: d("flex w-full flex-wrap gap-2 border-t pt-5", $.startersDivider),
|
|
733
|
-
children: p.map((e, t) => /* @__PURE__ */
|
|
692
|
+
children: p.map((e, t) => /* @__PURE__ */ Y("div", {
|
|
734
693
|
role: "listitem",
|
|
735
694
|
className: "min-w-[40px]",
|
|
736
|
-
children: /* @__PURE__ */
|
|
695
|
+
children: /* @__PURE__ */ Y(D, {
|
|
737
696
|
label: e.title,
|
|
738
697
|
className: "min-w-[40px]",
|
|
739
698
|
onClick: () => m(e)
|
|
@@ -742,18 +701,18 @@ var nt = { activeRating: "_activeRating_7jito_1" }, rt = 2e3, it = ({ role: e =
|
|
|
742
701
|
})]
|
|
743
702
|
})]
|
|
744
703
|
});
|
|
745
|
-
},
|
|
704
|
+
}, st = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ Y("div", {
|
|
746
705
|
role: "status",
|
|
747
706
|
"aria-live": "polite",
|
|
748
|
-
children: /* @__PURE__ */
|
|
707
|
+
children: /* @__PURE__ */ Y(T, {
|
|
749
708
|
title: e,
|
|
750
709
|
message: t,
|
|
751
710
|
textClassName: "flex-row flex-wrap gap-1"
|
|
752
711
|
})
|
|
753
|
-
}),
|
|
712
|
+
}), ct = /* @__PURE__ */ function(e) {
|
|
754
713
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
755
|
-
}({}),
|
|
756
|
-
let { colors: _, typography: v, className: y, bubbleClassName: b } = n ?? {}, { showMoreLabel: x = "Show more", showLessLabel: C = "Show less", showMoreAriaLabel: w, showLessAriaLabel: T, attachmentClickLabel: D, attachmentRetryLabel: O, attachmentOpenInNewTabLabel: k, userMessageAriaLabel: A = "User message" } = c ?? {}, { textRef:
|
|
714
|
+
}({}), lt = 10, ut = ({ text: e, position: t = ct.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount: o = lt, labels: c, onAttachmentClick: l, onDownloadAll: m, onAttachmentRetry: h, selectedAttachmentId: g }) => {
|
|
715
|
+
let { colors: _, typography: v, className: y, bubbleClassName: b } = n ?? {}, { showMoreLabel: x = "Show more", showLessLabel: C = "Show less", showMoreAriaLabel: w, showLessAriaLabel: T, attachmentClickLabel: D, attachmentRetryLabel: O, attachmentOpenInNewTabLabel: k, userMessageAriaLabel: A = "User message" } = c ?? {}, { textRef: j, isTextCollapsed: P, isOverflowing: F, collapsedMaxHeight: I, expandedMaxHeight: L, isCollapsed: R, toggleCollapsed: z } = f({
|
|
757
716
|
text: e,
|
|
758
717
|
collapsedLineCount: o
|
|
759
718
|
}), B = u({
|
|
@@ -763,16 +722,16 @@ var nt = { activeRating: "_activeRating_7jito_1" }, rt = 2e3, it = ({ role: e =
|
|
|
763
722
|
"--cm-bubble-text": _?.text,
|
|
764
723
|
"--cm-bubble-collapsed-height": F ? `${I}px` : void 0,
|
|
765
724
|
"--cm-bubble-expanded-height": F ? `${L}px` : void 0
|
|
766
|
-
}), V = t ===
|
|
767
|
-
return /* @__PURE__ */
|
|
725
|
+
}), V = t === ct.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", H = d($.text, v?.fontClassName), U = w ?? x, W = T ?? C, ee = R ? x : C, te = R ? U : W, ne = R ? M : N, re = Ae();
|
|
726
|
+
return /* @__PURE__ */ Y("div", {
|
|
768
727
|
role: "group",
|
|
769
728
|
"aria-label": A,
|
|
770
729
|
style: B,
|
|
771
730
|
className: d("flex w-full", y),
|
|
772
|
-
children: /* @__PURE__ */
|
|
731
|
+
children: /* @__PURE__ */ X("div", {
|
|
773
732
|
className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
|
|
774
733
|
children: [
|
|
775
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ Y(Qe, {
|
|
776
735
|
attachments: a ?? [],
|
|
777
736
|
onAttachmentClick: (e) => l?.(a?.find((t) => t.id === e)),
|
|
778
737
|
onDownloadAll: m,
|
|
@@ -785,34 +744,34 @@ var nt = { activeRating: "_activeRating_7jito_1" }, rt = 2e3, it = ({ role: e =
|
|
|
785
744
|
styles: { className: "max-w-[640px]" },
|
|
786
745
|
selectedAttachmentId: g
|
|
787
746
|
}),
|
|
788
|
-
e && /* @__PURE__ */
|
|
747
|
+
e && /* @__PURE__ */ Y("div", {
|
|
789
748
|
className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", V, b),
|
|
790
|
-
children: /* @__PURE__ */
|
|
749
|
+
children: /* @__PURE__ */ X("div", {
|
|
791
750
|
className: "flex min-w-0 flex-col items-start",
|
|
792
|
-
children: [/* @__PURE__ */
|
|
793
|
-
id:
|
|
751
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
752
|
+
id: re,
|
|
794
753
|
className: d("relative overflow-hidden", F && $.collapsibleText, F && !R && $.expandedText, P && $.collapsedText),
|
|
795
|
-
children: /* @__PURE__ */
|
|
796
|
-
ref:
|
|
797
|
-
className: d(
|
|
754
|
+
children: /* @__PURE__ */ Y("p", {
|
|
755
|
+
ref: j,
|
|
756
|
+
className: d(H, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
|
|
798
757
|
children: e
|
|
799
758
|
})
|
|
800
|
-
}), F && /* @__PURE__ */
|
|
801
|
-
label: /* @__PURE__ */ J
|
|
802
|
-
iconBefore: /* @__PURE__ */
|
|
759
|
+
}), F && /* @__PURE__ */ Y(E, {
|
|
760
|
+
label: /* @__PURE__ */ Y(J, { children: ee }),
|
|
761
|
+
iconBefore: /* @__PURE__ */ Y(ne, {
|
|
803
762
|
size: p.SM,
|
|
804
763
|
"aria-hidden": "true"
|
|
805
764
|
}),
|
|
806
|
-
"aria-label":
|
|
765
|
+
"aria-label": te,
|
|
807
766
|
"aria-expanded": !R,
|
|
808
|
-
"aria-controls":
|
|
767
|
+
"aria-controls": re,
|
|
809
768
|
className: "mt-3",
|
|
810
769
|
onClick: z,
|
|
811
770
|
size: S.Small
|
|
812
771
|
})]
|
|
813
772
|
})
|
|
814
773
|
}),
|
|
815
|
-
/* @__PURE__ */
|
|
774
|
+
/* @__PURE__ */ Y(at, {
|
|
816
775
|
...r,
|
|
817
776
|
isAlwaysVisible: i,
|
|
818
777
|
role: s.User
|
|
@@ -820,16 +779,16 @@ var nt = { activeRating: "_activeRating_7jito_1" }, rt = 2e3, it = ({ role: e =
|
|
|
820
779
|
]
|
|
821
780
|
})
|
|
822
781
|
});
|
|
823
|
-
},
|
|
782
|
+
}, dt = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e === s.Status ? /* @__PURE__ */ Y(st, { labels: {
|
|
824
783
|
titleText: r.labels?.statusTitleText,
|
|
825
784
|
bodyText: r.labels?.statusBodyText ?? ""
|
|
826
|
-
} }) : e === s.User ? /* @__PURE__ */
|
|
785
|
+
} }) : e === s.User ? /* @__PURE__ */ Y(ut, {
|
|
827
786
|
...r,
|
|
828
787
|
onAttachmentClick: t
|
|
829
|
-
}) : /* @__PURE__ */
|
|
788
|
+
}) : /* @__PURE__ */ Y(ot, {
|
|
830
789
|
...r,
|
|
831
790
|
markdownComponents: n,
|
|
832
791
|
onAttachmentClick: t
|
|
833
792
|
});
|
|
834
793
|
//#endregion
|
|
835
|
-
export {
|
|
794
|
+
export { ot as AssistantMessageBubble, ct as BubblePosition, at as MessageActions, dt as MessageBubble, st as StatusMessageBubble, ut 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.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.121",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"react": "^19.0.0",
|
|
21
21
|
"@tabler/icons-react": "^3.0.0",
|
|
22
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
23
|
-
"@epam/ai-dial-conversation-input": "1.1.0-dev.
|
|
22
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.121",
|
|
23
|
+
"@epam/ai-dial-conversation-input": "1.1.0-dev.121",
|
|
24
24
|
"react-markdown": "^10.1.0",
|
|
25
25
|
"@epam/ai-dial-ui-kit": "^0.13.0-dev.26"
|
|
26
26
|
},
|