@epam/ai-dial-conversation-messages 1.1.0-dev.75 → 1.1.0-dev.78
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,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAI/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,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAI/E,gHAAgH;AAChH,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAsIlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/UserMessageBubble.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,EAAE,EAAS,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAO1E,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":"AAUA,OAAO,EAAE,EAAE,EAAS,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAO1E,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CA4IxD,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
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, DialPopup as h, DialRadioGroup as g, DialSkeleton as _, DialSkeletonVariant as v, DialSlider as y,
|
|
3
|
-
import { IconCheck as
|
|
2
|
+
import { DIAL_ICON_SIZE as f, DialGhostIconButton as p, DialInput as m, DialPopup as h, DialRadioGroup as g, DialSkeleton as _, DialSkeletonVariant as v, DialSlider as y, DialSpinner as b, DialTag as x, DialTooltip as S, ElementSize 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 { IconCheck as M, IconChevronDown as N, IconChevronUp as P, IconClipboard as F, IconCopy as I, IconDownload as L, IconExternalLink as R, IconFile as z, IconFileTypeBmp as B, IconFileTypeCss as V, IconFileTypeCsv as ee, IconFileTypeDoc as H, IconFileTypeDocx as U, 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 W, 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
|
-
import { memo as je, useCallback as
|
|
6
|
-
import { Fragment as
|
|
5
|
+
import { memo as je, useCallback as G, useEffect as Me, useId as Ne, useMemo as K, useRef as Pe, 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 Fe = "flex size-[84px] items-center justify-center rounded-xl border",
|
|
8
|
+
var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Z = /* @__PURE__ */ function(e) {
|
|
9
9
|
return e.None = "none", e.AllVisible = "all-visible", e.Collapsed = "collapsed", e;
|
|
10
10
|
}({}), Ie = (e) => {
|
|
11
11
|
if (e == null) return "";
|
|
12
12
|
let t = e.lastIndexOf(".");
|
|
13
13
|
return t > 0 ? e.slice(0, t) : e;
|
|
14
14
|
}, Le = (e) => {
|
|
15
|
-
if (!e) return
|
|
15
|
+
if (!e) return z;
|
|
16
16
|
if (e.startsWith("image/")) switch (e) {
|
|
17
17
|
case "image/jpeg":
|
|
18
18
|
case "image/jpg": return ne;
|
|
19
19
|
case "image/png": return se;
|
|
20
20
|
case "image/svg+xml": return de;
|
|
21
|
-
case "image/bmp": return
|
|
22
|
-
default: return
|
|
21
|
+
case "image/bmp": return B;
|
|
22
|
+
default: return W;
|
|
23
23
|
}
|
|
24
24
|
if (e.startsWith("video/")) return ke;
|
|
25
25
|
if (e.startsWith("audio/")) return be;
|
|
26
26
|
switch (e) {
|
|
27
27
|
case "application/pdf": return ae;
|
|
28
28
|
case "application/msword":
|
|
29
|
-
case "application/vnd.ms-word": return
|
|
30
|
-
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return
|
|
29
|
+
case "application/vnd.ms-word": return H;
|
|
30
|
+
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return U;
|
|
31
31
|
case "application/vnd.ms-powerpoint": return ce;
|
|
32
32
|
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return ce;
|
|
33
33
|
case "application/vnd.ms-excel": return ge;
|
|
@@ -38,7 +38,7 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
38
38
|
case "application/x-7z-compressed":
|
|
39
39
|
case "application/gzip":
|
|
40
40
|
case "application/x-tar": return ve;
|
|
41
|
-
case "text/csv": return
|
|
41
|
+
case "text/csv": return ee;
|
|
42
42
|
case "text/plain": return me;
|
|
43
43
|
case "text/html":
|
|
44
44
|
case "application/xhtml+xml": return te;
|
|
@@ -52,17 +52,17 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
52
52
|
case "application/typescript":
|
|
53
53
|
case "text/typescript": return fe;
|
|
54
54
|
case "text/tsx": return pe;
|
|
55
|
-
case "text/css": return
|
|
55
|
+
case "text/css": return V;
|
|
56
56
|
case "text/x-php":
|
|
57
57
|
case "application/x-php": return oe;
|
|
58
58
|
case "text/x-rustsrc":
|
|
59
59
|
case "application/x-rust": return le;
|
|
60
60
|
case "text/x-vue": return he;
|
|
61
|
-
default: return
|
|
61
|
+
default: return z;
|
|
62
62
|
}
|
|
63
63
|
}, Re = (e) => {
|
|
64
64
|
let { type: n, contentType: r } = e;
|
|
65
|
-
return n === t.Prompt ? Te : n === t.Pasted ?
|
|
65
|
+
return n === t.Prompt ? Te : n === t.Pasted ? F : n === t.Image ? W : Le(r ?? "");
|
|
66
66
|
}, ze = (e) => {
|
|
67
67
|
let t = e.toLowerCase().split(";")[0].trim(), n = i[t];
|
|
68
68
|
if (n) return n;
|
|
@@ -91,90 +91,89 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
91
91
|
typeLabel: f ? null : Be(e, n)
|
|
92
92
|
};
|
|
93
93
|
}, He = (e, t) => e <= 0 ? {
|
|
94
|
-
layout:
|
|
94
|
+
layout: Z.None,
|
|
95
95
|
visibleCount: 0,
|
|
96
96
|
hiddenCount: 0
|
|
97
97
|
} : e < 5 || t ? {
|
|
98
|
-
layout:
|
|
98
|
+
layout: Z.AllVisible,
|
|
99
99
|
visibleCount: e,
|
|
100
100
|
hiddenCount: 0
|
|
101
101
|
} : {
|
|
102
|
-
layout:
|
|
102
|
+
layout: Z.Collapsed,
|
|
103
103
|
visibleCount: 4,
|
|
104
104
|
hiddenCount: e - 4
|
|
105
|
-
},
|
|
106
|
-
tile: "
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
track: "
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ q(p, {
|
|
105
|
+
}, Q = {
|
|
106
|
+
tile: "_tile_yap03_1",
|
|
107
|
+
hovered: "_hovered_yap03_5",
|
|
108
|
+
selected: "_selected_yap03_12",
|
|
109
|
+
tileError: "_tileError_yap03_17",
|
|
110
|
+
nameText: "_nameText_yap03_22",
|
|
111
|
+
typeText: "_typeText_yap03_26",
|
|
112
|
+
retryIcon: "_retryIcon_yap03_30",
|
|
113
|
+
track: "_track_yap03_34",
|
|
114
|
+
imageActionButton: "_imageActionButton_yap03_38"
|
|
115
|
+
}, Ue = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ Y(j, {
|
|
117
116
|
icon: a,
|
|
118
|
-
size:
|
|
119
|
-
className: u("absolute end-1 top-1
|
|
117
|
+
size: C.Small,
|
|
118
|
+
className: u("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),
|
|
120
119
|
"aria-label": e,
|
|
121
120
|
"aria-describedby": t ? n : void 0,
|
|
122
121
|
onClick: (e) => {
|
|
123
122
|
e.stopPropagation(), r(i);
|
|
124
123
|
}
|
|
125
|
-
}),
|
|
126
|
-
icon: /* @__PURE__ */
|
|
124
|
+
}), We = ({ ...e }) => /* @__PURE__ */ Y(Ue, {
|
|
125
|
+
icon: /* @__PURE__ */ Y(we, {
|
|
127
126
|
size: f.SM,
|
|
128
127
|
"aria-hidden": !0
|
|
129
128
|
}),
|
|
130
|
-
className:
|
|
129
|
+
className: Q.retryIcon,
|
|
131
130
|
...e
|
|
132
|
-
}),
|
|
133
|
-
icon: /* @__PURE__ */
|
|
131
|
+
}), Ge = ({ ...e }) => /* @__PURE__ */ Y(Ue, {
|
|
132
|
+
icon: /* @__PURE__ */ Y(L, {
|
|
134
133
|
size: f.SM,
|
|
135
134
|
"aria-hidden": !0
|
|
136
135
|
}),
|
|
137
136
|
...e
|
|
138
|
-
}),
|
|
139
|
-
icon: /* @__PURE__ */
|
|
137
|
+
}), Ke = ({ ...e }) => /* @__PURE__ */ Y(Ue, {
|
|
138
|
+
icon: /* @__PURE__ */ Y(R, {
|
|
140
139
|
size: f.SM,
|
|
141
140
|
"aria-hidden": !0
|
|
142
141
|
}),
|
|
143
142
|
...e
|
|
144
|
-
}),
|
|
145
|
-
icon: /* @__PURE__ */
|
|
143
|
+
}), qe = ({ ...e }) => /* @__PURE__ */ Y(Ue, {
|
|
144
|
+
icon: /* @__PURE__ */ Y(Ae, {
|
|
146
145
|
size: f.SM,
|
|
147
146
|
"aria-hidden": !0
|
|
148
147
|
}),
|
|
149
|
-
className:
|
|
148
|
+
className: Q.hoverIcon,
|
|
150
149
|
...e
|
|
151
|
-
}),
|
|
152
|
-
let { clickLabel:
|
|
150
|
+
}), Je = ({ attachment: e, searchQuery: t = "", onClick: n, onDownload: r, onRemove: i, labels: a, styles: o, cssVars: s, isSelected: c }) => {
|
|
151
|
+
let { clickLabel: l = "Open attachment", downloadLabel: d = "Download attachment", removeLabel: f = "Remove attachment" } = a ?? {}, { typography: p, className: m } = o ?? {}, h = () => {
|
|
153
152
|
n?.(e.id);
|
|
154
153
|
};
|
|
155
|
-
return /* @__PURE__ */
|
|
154
|
+
return /* @__PURE__ */ X("div", {
|
|
156
155
|
style: s,
|
|
157
156
|
...n == null ? {} : {
|
|
158
157
|
role: "button",
|
|
159
158
|
tabIndex: 0,
|
|
160
|
-
"aria-label":
|
|
161
|
-
onClick:
|
|
159
|
+
"aria-label": l,
|
|
160
|
+
onClick: h,
|
|
162
161
|
onKeyDown: (e) => {
|
|
163
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
162
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), h());
|
|
164
163
|
}
|
|
165
164
|
},
|
|
166
|
-
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",
|
|
165
|
+
className: u("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 && Q.selected, m),
|
|
167
166
|
children: [
|
|
168
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ Y("span", {
|
|
169
168
|
title: e.name,
|
|
170
|
-
className: u(
|
|
171
|
-
children: t ? /* @__PURE__ */
|
|
169
|
+
className: u(p?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", Q.nameText),
|
|
170
|
+
children: t ? /* @__PURE__ */ Y(w, {
|
|
172
171
|
text: e.name,
|
|
173
172
|
query: t,
|
|
174
173
|
maxLines: 1
|
|
175
174
|
}) : e.name
|
|
176
175
|
}),
|
|
177
|
-
e.playUrl && /* @__PURE__ */
|
|
176
|
+
e.playUrl && /* @__PURE__ */ Y("audio", {
|
|
178
177
|
controls: !0,
|
|
179
178
|
src: e.playUrl,
|
|
180
179
|
"aria-label": e.name,
|
|
@@ -182,103 +181,103 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
182
181
|
preload: "metadata",
|
|
183
182
|
onClick: (e) => e.stopPropagation()
|
|
184
183
|
}),
|
|
185
|
-
r && /* @__PURE__ */
|
|
186
|
-
ariaLabel:
|
|
184
|
+
r && /* @__PURE__ */ Y(Ge, {
|
|
185
|
+
ariaLabel: d,
|
|
187
186
|
onClick: r,
|
|
188
187
|
id: e.id
|
|
189
188
|
}),
|
|
190
|
-
i && /* @__PURE__ */
|
|
191
|
-
ariaLabel:
|
|
189
|
+
i && /* @__PURE__ */ Y(qe, {
|
|
190
|
+
ariaLabel: f,
|
|
192
191
|
onClick: i,
|
|
193
192
|
id: e.id
|
|
194
193
|
})
|
|
195
194
|
]
|
|
196
195
|
});
|
|
197
|
-
},
|
|
196
|
+
}, Ye = {
|
|
198
197
|
[e.Network]: "Upload failed · network error",
|
|
199
198
|
[e.UnsupportedType]: "Upload failed · unsupported file type"
|
|
200
|
-
},
|
|
201
|
-
let { clickLabel:
|
|
202
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
203
|
-
},
|
|
204
|
-
window.open(
|
|
205
|
-
}, [
|
|
206
|
-
title:
|
|
207
|
-
className: u(
|
|
208
|
-
children:
|
|
209
|
-
}),
|
|
210
|
-
className: u("flex w-full items-center gap-1",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
199
|
+
}, Xe = ({ attachment: n, onClick: r, onRetry: i, labels: a, styles: o, onDownload: c, isPasted: l, isLink: d, cssVars: f, onExpand: p, isExpandable: m, onRemove: h, isSelected: g }) => {
|
|
200
|
+
let { clickLabel: _ = "Download attachment", retryLabel: v = "Retry upload", sizeLabel: y, uploadingLabel: x = "Uploading", errorReasonLabels: S, genericErrorLabel: C = "Upload failed" } = a ?? {}, { typography: w, className: T } = o ?? {}, { id: E, name: D, status: O, errorReason: k } = n, A = O === s.Loading, j = O === s.Error, M = Ne(), N = j ? k && (S?.[k] ?? Ye[k]) || C : "", { BottomIcon: P, typeLabel: F } = Ve(n), I = !j && !A && c && !d, L = j && !!i && k !== e.UnsupportedType, R = I || L ? "pe-5" : void 0, z = (e) => {
|
|
201
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(n.id));
|
|
202
|
+
}, B = K(() => l ? D : Ie(D), [l, D]), V = G(() => {
|
|
203
|
+
window.open(n.referenceUrl, "_blank", "noopener,noreferrer");
|
|
204
|
+
}, [n]), ee = u(Fe, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", Q.tile, (n.type === t.Prompt || n.type === t.Pasted) && "hovered", g && Q.selected, j && Q.tileError), H = /* @__PURE__ */ Y("div", {
|
|
205
|
+
title: B,
|
|
206
|
+
className: u(w?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all", Q.nameText, !j && R),
|
|
207
|
+
children: B
|
|
208
|
+
}), U = P && /* @__PURE__ */ X("div", {
|
|
209
|
+
className: u("flex w-full items-center gap-1", j && R),
|
|
210
|
+
children: [/* @__PURE__ */ Y(P, {
|
|
212
211
|
size: 16,
|
|
213
|
-
className:
|
|
212
|
+
className: Q.typeText,
|
|
214
213
|
"aria-hidden": !0
|
|
215
|
-
}), /* @__PURE__ */
|
|
216
|
-
className: u(
|
|
217
|
-
children:
|
|
214
|
+
}), /* @__PURE__ */ Y("span", {
|
|
215
|
+
className: u(w?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Q.typeText),
|
|
216
|
+
children: y ? `${F} · ${y}` : F
|
|
218
217
|
})]
|
|
219
218
|
}), te = () => {
|
|
220
|
-
|
|
221
|
-
}, ne = /* @__PURE__ */ J
|
|
222
|
-
|
|
223
|
-
|
|
219
|
+
m && p ? p(E) : r && r(E);
|
|
220
|
+
}, ne = /* @__PURE__ */ X(J, { children: [
|
|
221
|
+
j ? /* @__PURE__ */ X(J, { children: [U, H] }) : /* @__PURE__ */ X(J, { children: [H, U] }),
|
|
222
|
+
A && /* @__PURE__ */ Y("div", {
|
|
224
223
|
role: "progressbar",
|
|
225
|
-
"aria-label":
|
|
226
|
-
className: u("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full",
|
|
227
|
-
children: /* @__PURE__ */
|
|
224
|
+
"aria-label": x,
|
|
225
|
+
className: u("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full", Q.track),
|
|
226
|
+
children: /* @__PURE__ */ Y(b, { size: 32 })
|
|
228
227
|
}),
|
|
229
|
-
|
|
230
|
-
ariaLabel:
|
|
231
|
-
errorTitle:
|
|
232
|
-
errorDescId:
|
|
233
|
-
onClick:
|
|
234
|
-
id:
|
|
228
|
+
I && /* @__PURE__ */ Y(Ge, {
|
|
229
|
+
ariaLabel: _,
|
|
230
|
+
errorTitle: N,
|
|
231
|
+
errorDescId: M,
|
|
232
|
+
onClick: c,
|
|
233
|
+
id: E
|
|
235
234
|
}),
|
|
236
|
-
|
|
237
|
-
ariaLabel:
|
|
238
|
-
errorTitle:
|
|
239
|
-
errorDescId:
|
|
240
|
-
onClick:
|
|
241
|
-
id:
|
|
235
|
+
L && /* @__PURE__ */ Y(We, {
|
|
236
|
+
ariaLabel: v,
|
|
237
|
+
errorTitle: N,
|
|
238
|
+
errorDescId: M,
|
|
239
|
+
onClick: i,
|
|
240
|
+
id: E
|
|
242
241
|
}),
|
|
243
|
-
|
|
244
|
-
ariaLabel:
|
|
245
|
-
errorTitle:
|
|
246
|
-
errorDescId:
|
|
247
|
-
onClick:
|
|
242
|
+
d && /* @__PURE__ */ Y(Ke, {
|
|
243
|
+
ariaLabel: v,
|
|
244
|
+
errorTitle: N,
|
|
245
|
+
errorDescId: M,
|
|
246
|
+
onClick: V
|
|
248
247
|
}),
|
|
249
|
-
|
|
250
|
-
ariaLabel:
|
|
251
|
-
errorTitle:
|
|
252
|
-
errorDescId:
|
|
253
|
-
onClick:
|
|
254
|
-
id:
|
|
248
|
+
h && /* @__PURE__ */ Y(qe, {
|
|
249
|
+
ariaLabel: v,
|
|
250
|
+
errorTitle: N,
|
|
251
|
+
errorDescId: M,
|
|
252
|
+
onClick: h,
|
|
253
|
+
id: E
|
|
255
254
|
}),
|
|
256
|
-
|
|
257
|
-
id:
|
|
255
|
+
j && /* @__PURE__ */ Y("span", {
|
|
256
|
+
id: M,
|
|
258
257
|
role: "status",
|
|
259
258
|
"aria-live": "polite",
|
|
260
259
|
className: "sr-only",
|
|
261
|
-
children:
|
|
260
|
+
children: N
|
|
262
261
|
})
|
|
263
262
|
] });
|
|
264
|
-
return /* @__PURE__ */
|
|
265
|
-
style:
|
|
266
|
-
className: u("inline-flex",
|
|
267
|
-
children: /* @__PURE__ */
|
|
263
|
+
return /* @__PURE__ */ Y("div", {
|
|
264
|
+
style: f,
|
|
265
|
+
className: u("inline-flex", T),
|
|
266
|
+
children: /* @__PURE__ */ Y("div", {
|
|
268
267
|
role: "button",
|
|
269
268
|
tabIndex: 0,
|
|
270
|
-
"aria-label":
|
|
269
|
+
"aria-label": _,
|
|
271
270
|
onClick: te,
|
|
272
|
-
onKeyDown:
|
|
273
|
-
style:
|
|
274
|
-
className: u(
|
|
271
|
+
onKeyDown: z,
|
|
272
|
+
style: f,
|
|
273
|
+
className: u(ee, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
275
274
|
children: ne
|
|
276
275
|
})
|
|
277
276
|
});
|
|
278
|
-
},
|
|
277
|
+
}, Ze = /* @__PURE__ */ function(e) {
|
|
279
278
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
280
|
-
}({}),
|
|
281
|
-
let n = Pe(null), [r, i] =
|
|
279
|
+
}({}), Qe = ({ enabled: e, src: t }) => {
|
|
280
|
+
let n = Pe(null), [r, i] = q("idle");
|
|
282
281
|
return Me(() => {
|
|
283
282
|
i(e && t ? "loading" : "idle");
|
|
284
283
|
}, [e, t]), Me(() => {
|
|
@@ -292,15 +291,15 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
292
291
|
imageRef: n,
|
|
293
292
|
imageLoadStatus: r
|
|
294
293
|
};
|
|
295
|
-
},
|
|
296
|
-
let { clickLabel:
|
|
294
|
+
}, $e = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c, isSelected: l }) => {
|
|
295
|
+
let { clickLabel: d = "Open attachment", expandLabel: p = "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 } = K(() => Ve(e), [e]), w = r !== void 0 && !b && !x && !S, { imageRef: T, imageLoadStatus: E } = Qe({
|
|
297
296
|
enabled: C,
|
|
298
297
|
src: y
|
|
299
298
|
}), D = () => {
|
|
300
299
|
b && n ? n(h) : w && r && r(h);
|
|
301
300
|
};
|
|
302
|
-
return /* @__PURE__ */
|
|
303
|
-
className: u(Fe, w && "cursor-pointer",
|
|
301
|
+
return /* @__PURE__ */ Y("div", {
|
|
302
|
+
className: u(Fe, "group/attachment-tile", w && "cursor-pointer", Q.tile, l && Q.selected, m),
|
|
304
303
|
onClick: D,
|
|
305
304
|
onKeyDown: (e) => {
|
|
306
305
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), D());
|
|
@@ -308,58 +307,63 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
308
307
|
tabIndex: 0,
|
|
309
308
|
role: "button",
|
|
310
309
|
style: o,
|
|
311
|
-
"aria-label": w ?
|
|
312
|
-
children: /* @__PURE__ */
|
|
310
|
+
"aria-label": w ? d : b ? p : void 0,
|
|
311
|
+
children: /* @__PURE__ */ X("div", {
|
|
313
312
|
className: "relative h-full w-full overflow-hidden",
|
|
314
313
|
children: [
|
|
315
|
-
a && /* @__PURE__ */
|
|
314
|
+
a && /* @__PURE__ */ Y(qe, {
|
|
316
315
|
onClick: a,
|
|
317
|
-
id: h
|
|
316
|
+
id: h,
|
|
317
|
+
className: Q.imageActionButton
|
|
318
318
|
}),
|
|
319
|
-
s && /* @__PURE__ */
|
|
319
|
+
s && /* @__PURE__ */ Y(Ge, {
|
|
320
320
|
onClick: s,
|
|
321
|
-
id: h
|
|
321
|
+
id: h,
|
|
322
|
+
className: Q.imageActionButton
|
|
322
323
|
}),
|
|
323
|
-
E !==
|
|
324
|
+
E !== Ze.Loaded && /* @__PURE__ */ Y(_, {
|
|
324
325
|
variant: v.Rectangular,
|
|
325
326
|
width: "100%",
|
|
326
327
|
height: "100%",
|
|
327
|
-
active: E ===
|
|
328
|
-
overlay: /* @__PURE__ */
|
|
328
|
+
active: E === Ze.Loading,
|
|
329
|
+
overlay: /* @__PURE__ */ Y(W, {
|
|
329
330
|
size: f.LG,
|
|
330
|
-
className:
|
|
331
|
+
className: Q.typeText,
|
|
331
332
|
"aria-hidden": !0
|
|
332
333
|
}),
|
|
333
334
|
className: "absolute inset-0 rounded-xl"
|
|
334
335
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ Y("img", {
|
|
336
337
|
ref: T,
|
|
337
338
|
src: y,
|
|
338
339
|
alt: g,
|
|
339
340
|
loading: "lazy",
|
|
340
341
|
decoding: "async",
|
|
341
|
-
className: u("h-full w-full rounded-xl object-cover transition-opacity duration-200", E ===
|
|
342
|
+
className: u("h-full w-full rounded-xl object-cover transition-opacity duration-200", E === Ze.Loaded ? "opacity-100" : "opacity-0")
|
|
342
343
|
})
|
|
343
344
|
]
|
|
344
345
|
})
|
|
345
346
|
});
|
|
346
|
-
},
|
|
347
|
-
let { colors:
|
|
348
|
-
"--
|
|
349
|
-
"--
|
|
350
|
-
"--
|
|
351
|
-
"--
|
|
352
|
-
"--
|
|
353
|
-
"--
|
|
354
|
-
"--
|
|
355
|
-
"--
|
|
356
|
-
"--
|
|
357
|
-
"--
|
|
358
|
-
"--
|
|
359
|
-
"--
|
|
360
|
-
"--
|
|
361
|
-
|
|
362
|
-
|
|
347
|
+
}, et = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: c, styles: u, isSelected: d }) => {
|
|
348
|
+
let { colors: f } = u ?? {}, p = e.type === t.Pasted, m = p && a !== void 0, h = l({
|
|
349
|
+
"--ai-tile-bg": f?.background,
|
|
350
|
+
"--ai-tile-border": f?.border,
|
|
351
|
+
"--ai-tile-bg-hover": f?.backgroundHover,
|
|
352
|
+
"--ai-tile-border-hover": f?.borderHover,
|
|
353
|
+
"--ai-tile-bg-selected": f?.backgroundSelected,
|
|
354
|
+
"--ai-tile-border-selected": f?.borderSelected,
|
|
355
|
+
"--ai-tile-focus-outline": f?.focusOutline,
|
|
356
|
+
"--ai-tile-bg-error": f?.backgroundError,
|
|
357
|
+
"--ai-tile-border-error": f?.borderError,
|
|
358
|
+
"--ai-tile-error-text": f?.errorText,
|
|
359
|
+
"--ai-tile-name-text": f?.nameText,
|
|
360
|
+
"--ai-tile-type-text": f?.typeText,
|
|
361
|
+
"--ai-tile-hover-icon-bg": f?.hoverIconBackground,
|
|
362
|
+
"--ai-tile-hover-icon-color": f?.hoverIconColor,
|
|
363
|
+
"--ai-tile-progress-track": f?.trackBackground,
|
|
364
|
+
"--ai-tile-fill-bg": f?.fillBackground
|
|
365
|
+
}), { isImage: g, isAudio: _, isLink: v } = K(() => Ve(e), [e]);
|
|
366
|
+
return _ ? /* @__PURE__ */ Y(Je, {
|
|
363
367
|
attachment: e,
|
|
364
368
|
labels: c,
|
|
365
369
|
onClick: o,
|
|
@@ -367,134 +371,137 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
367
371
|
onRemove: r,
|
|
368
372
|
searchQuery: n,
|
|
369
373
|
styles: u,
|
|
370
|
-
cssVars:
|
|
371
|
-
|
|
374
|
+
cssVars: h,
|
|
375
|
+
isSelected: d
|
|
376
|
+
}) : g ? /* @__PURE__ */ Y($e, {
|
|
372
377
|
attachment: e,
|
|
373
378
|
labels: c,
|
|
374
379
|
onClick: o,
|
|
375
380
|
onExpand: a,
|
|
376
381
|
styles: u,
|
|
377
382
|
onRemove: r,
|
|
378
|
-
cssVars:
|
|
379
|
-
onDownload: s
|
|
380
|
-
|
|
383
|
+
cssVars: h,
|
|
384
|
+
onDownload: s,
|
|
385
|
+
isSelected: d
|
|
386
|
+
}) : /* @__PURE__ */ Y(Xe, {
|
|
381
387
|
attachment: e,
|
|
382
388
|
onClick: o,
|
|
383
389
|
onRetry: i,
|
|
384
390
|
onRemove: r,
|
|
385
391
|
onDownload: s,
|
|
386
|
-
isLink:
|
|
387
|
-
isPasted:
|
|
392
|
+
isLink: v,
|
|
393
|
+
isPasted: p,
|
|
388
394
|
styles: u,
|
|
389
395
|
labels: c,
|
|
390
396
|
onExpand: a,
|
|
391
|
-
cssVars:
|
|
392
|
-
isExpandable:
|
|
397
|
+
cssVars: h,
|
|
398
|
+
isExpandable: m,
|
|
399
|
+
isSelected: d
|
|
393
400
|
});
|
|
394
|
-
},
|
|
401
|
+
}, tt = { tile: "_tile_1qzn0_1" }, nt = ({ count: e, onClick: t, labels: n, children: r, styles: i }) => {
|
|
395
402
|
let { ariaLabel: a } = n ?? {}, { typography: { fontClassName: o = "dial-small-semi-text" } = {}, className: s, colors: c } = i ?? {}, d = l({
|
|
396
|
-
"--
|
|
397
|
-
"--
|
|
398
|
-
"--
|
|
399
|
-
"--
|
|
400
|
-
"--
|
|
401
|
-
"--
|
|
402
|
-
"--
|
|
403
|
+
"--ai-more-tile-bg": c?.background,
|
|
404
|
+
"--ai-more-tile-border": c?.border,
|
|
405
|
+
"--ai-more-tile-color": c?.color,
|
|
406
|
+
"--ai-more-tile-bg-hover": c?.backgroundHover,
|
|
407
|
+
"--ai-more-tile-color-hover": c?.colorHover,
|
|
408
|
+
"--ai-more-tile-border-hover": c?.borderHover,
|
|
409
|
+
"--ai-more-tile-focus-outline": c?.focusOutline
|
|
403
410
|
});
|
|
404
|
-
return /* @__PURE__ */
|
|
411
|
+
return /* @__PURE__ */ Y("button", {
|
|
405
412
|
type: "button",
|
|
406
413
|
onClick: t,
|
|
407
414
|
"aria-label": a ?? `Show ${e} more attachments`,
|
|
408
415
|
style: d,
|
|
409
|
-
className: u(Fe, o,
|
|
410
|
-
children: r ?? /* @__PURE__ */
|
|
416
|
+
className: u(Fe, o, tt.tile, s),
|
|
417
|
+
children: r ?? /* @__PURE__ */ Y("bdi", {
|
|
411
418
|
dir: "ltr",
|
|
412
419
|
children: `+${e}`
|
|
413
420
|
})
|
|
414
421
|
});
|
|
415
|
-
},
|
|
416
|
-
container: "
|
|
417
|
-
headerIcon: "
|
|
418
|
-
headerLabel: "
|
|
419
|
-
downloadAllButton: "
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
"--
|
|
424
|
-
"--
|
|
425
|
-
|
|
426
|
-
}), [E, D] = G(!1), O = W(() => He(e.length, E), [e.length, E]);
|
|
422
|
+
}, rt = {
|
|
423
|
+
container: "_container_jvs4c_1",
|
|
424
|
+
headerIcon: "_headerIcon_jvs4c_6",
|
|
425
|
+
headerLabel: "_headerLabel_jvs4c_7",
|
|
426
|
+
downloadAllButton: "_downloadAllButton_jvs4c_8"
|
|
427
|
+
}, it = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, at = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o, selectedAttachmentId: c }) => {
|
|
428
|
+
let { ariaLabel: d = "Attachments", clickLabel: m = "Download attachment", retryLabel: h = "Retry upload", showLessLabel: g = "Show less", downloadAllLabel: _ = "Download all", openInNewTabLabel: v, getHeaderLabel: y = (e) => it(e, "attachment"), promptLabel: b, pastedLabel: x, imageLabel: S } = a ?? {}, { typography: { headerLabelClassName: C = "dial-tiny-semi-text" } = {}, colors: w, className: T } = o ?? {}, E = l({
|
|
429
|
+
"--ai-group-bg": w?.background,
|
|
430
|
+
"--ai-group-border": w?.border,
|
|
431
|
+
"--ai-group-text": w?.text
|
|
432
|
+
}), [D, O] = q(!1), k = K(() => He(e.length, D), [e.length, D]);
|
|
427
433
|
if (e.length === 0) return null;
|
|
428
|
-
let
|
|
434
|
+
let A = e.some((e) => e.type === t.Image), j = e.some((e) => e.type !== t.Image), M = A && j, N = e.length >= 5, F = M ? xe : A ? W : z, I = y(e.length), R = e.slice(0, k.visibleCount), B = () => {
|
|
429
435
|
let t = e.filter((e) => e.status === s.Idle);
|
|
430
436
|
r ? r(t) : t.forEach((e) => n?.(e.id));
|
|
431
|
-
},
|
|
437
|
+
}, V = (t) => {
|
|
432
438
|
let n = e.find((e) => e.id === t);
|
|
433
439
|
n && r?.([n]);
|
|
434
440
|
};
|
|
435
|
-
return /* @__PURE__ */
|
|
441
|
+
return /* @__PURE__ */ X("div", {
|
|
436
442
|
role: "group",
|
|
437
|
-
"aria-label":
|
|
438
|
-
style:
|
|
439
|
-
className: u("rounded-2xl border p-3", N ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]",
|
|
440
|
-
children: [/* @__PURE__ */
|
|
443
|
+
"aria-label": d,
|
|
444
|
+
style: E,
|
|
445
|
+
className: u("rounded-2xl border p-3", N ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", rt.container, T),
|
|
446
|
+
children: [/* @__PURE__ */ X("div", {
|
|
441
447
|
className: "mb-3 flex min-h-6 items-center gap-2",
|
|
442
448
|
children: [
|
|
443
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ Y(F, {
|
|
444
450
|
size: f.SM,
|
|
445
|
-
className: u("shrink-0",
|
|
451
|
+
className: u("shrink-0", rt.headerIcon),
|
|
446
452
|
"aria-hidden": !0
|
|
447
453
|
}),
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
className: u(
|
|
454
|
+
/* @__PURE__ */ Y("span", {
|
|
455
|
+
className: u(C, rt.headerLabel),
|
|
450
456
|
children: I
|
|
451
457
|
}),
|
|
452
|
-
e.length >= 2 && (r || n) && /* @__PURE__ */
|
|
453
|
-
icon: /* @__PURE__ */
|
|
458
|
+
e.length >= 2 && (r || n) && /* @__PURE__ */ Y(p, {
|
|
459
|
+
icon: /* @__PURE__ */ Y(L, {
|
|
454
460
|
size: f.SM,
|
|
455
461
|
"aria-hidden": !0
|
|
456
462
|
}),
|
|
457
|
-
className: u("ms-auto h-6 w-6 rounded-lg",
|
|
458
|
-
"aria-label":
|
|
459
|
-
onClick:
|
|
463
|
+
className: u("ms-auto h-6 w-6 rounded-lg", rt.downloadAllButton),
|
|
464
|
+
"aria-label": _,
|
|
465
|
+
onClick: B
|
|
460
466
|
})
|
|
461
467
|
]
|
|
462
|
-
}), /* @__PURE__ */
|
|
468
|
+
}), /* @__PURE__ */ X("div", {
|
|
463
469
|
role: "list",
|
|
464
470
|
"aria-label": I,
|
|
465
471
|
className: u("gap-3", N ? "grid grid-cols-[repeat(5,83px)] overflow-x-auto" : "flex flex-wrap"),
|
|
466
472
|
children: [
|
|
467
|
-
R.map((e, t) => /* @__PURE__ */
|
|
473
|
+
R.map((e, t) => /* @__PURE__ */ Y("div", {
|
|
468
474
|
role: "listitem",
|
|
469
|
-
children: /* @__PURE__ */
|
|
475
|
+
children: /* @__PURE__ */ Y(et, {
|
|
470
476
|
attachment: e,
|
|
471
477
|
onClick: n,
|
|
472
|
-
onDownload:
|
|
478
|
+
onDownload: V,
|
|
473
479
|
onRetry: i,
|
|
474
480
|
labels: {
|
|
475
|
-
clickLabel:
|
|
476
|
-
retryLabel:
|
|
477
|
-
promptLabel:
|
|
478
|
-
pastedLabel:
|
|
479
|
-
imageLabel:
|
|
480
|
-
openInNewTabLabel:
|
|
481
|
-
}
|
|
481
|
+
clickLabel: m,
|
|
482
|
+
retryLabel: h,
|
|
483
|
+
promptLabel: b,
|
|
484
|
+
pastedLabel: x,
|
|
485
|
+
imageLabel: S,
|
|
486
|
+
openInNewTabLabel: v
|
|
487
|
+
},
|
|
488
|
+
isSelected: e.id === c
|
|
482
489
|
})
|
|
483
490
|
}, `${e.id}-${t}`)),
|
|
484
|
-
|
|
491
|
+
k.layout === Z.Collapsed && /* @__PURE__ */ Y("div", {
|
|
485
492
|
role: "listitem",
|
|
486
|
-
children: /* @__PURE__ */
|
|
487
|
-
count:
|
|
488
|
-
onClick: () =>
|
|
493
|
+
children: /* @__PURE__ */ Y(nt, {
|
|
494
|
+
count: k.hiddenCount,
|
|
495
|
+
onClick: () => O(!0)
|
|
489
496
|
})
|
|
490
497
|
}),
|
|
491
|
-
N &&
|
|
498
|
+
N && D && /* @__PURE__ */ Y("div", {
|
|
492
499
|
role: "listitem",
|
|
493
|
-
children: /* @__PURE__ */
|
|
500
|
+
children: /* @__PURE__ */ Y(nt, {
|
|
494
501
|
count: 0,
|
|
495
|
-
onClick: () =>
|
|
496
|
-
labels: { ariaLabel:
|
|
497
|
-
children: /* @__PURE__ */
|
|
502
|
+
onClick: () => O(!1),
|
|
503
|
+
labels: { ariaLabel: g },
|
|
504
|
+
children: /* @__PURE__ */ Y(P, {
|
|
498
505
|
size: f.MD,
|
|
499
506
|
"aria-hidden": !0
|
|
500
507
|
})
|
|
@@ -503,8 +510,8 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
503
510
|
]
|
|
504
511
|
})]
|
|
505
512
|
});
|
|
506
|
-
},
|
|
507
|
-
let [s, c] =
|
|
513
|
+
}, ot = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
514
|
+
let [s, c] = q(t), [l, u] = q(n), [d, f] = q(r), p = Pe(o);
|
|
508
515
|
Me(() => {
|
|
509
516
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
510
517
|
}, [
|
|
@@ -522,7 +529,7 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
522
529
|
setResponseFormat: c,
|
|
523
530
|
setSystemPrompt: u,
|
|
524
531
|
setTemperature: f,
|
|
525
|
-
handleSubmit:
|
|
532
|
+
handleSubmit: G(() => {
|
|
526
533
|
if (!m) return;
|
|
527
534
|
let t = {};
|
|
528
535
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -536,18 +543,18 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
536
543
|
a
|
|
537
544
|
])
|
|
538
545
|
};
|
|
539
|
-
},
|
|
546
|
+
}, 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: _ = [
|
|
540
547
|
"Precise",
|
|
541
548
|
"Neutral",
|
|
542
549
|
"Creative"
|
|
543
|
-
], temperatureHint: v }) => /* @__PURE__ */
|
|
550
|
+
], temperatureHint: v }) => /* @__PURE__ */ X("div", {
|
|
544
551
|
className: "flex flex-col gap-4 px-6 py-3",
|
|
545
552
|
children: [
|
|
546
|
-
e.responseFormat && /* @__PURE__ */
|
|
553
|
+
e.responseFormat && /* @__PURE__ */ Y(g, {
|
|
547
554
|
fieldTitle: s,
|
|
548
|
-
labelClassName:
|
|
555
|
+
labelClassName: st,
|
|
549
556
|
elementId: "response-format",
|
|
550
|
-
orientation:
|
|
557
|
+
orientation: A.Column,
|
|
551
558
|
activeRadioButton: t ?? c.Markdown,
|
|
552
559
|
labelDescription: l,
|
|
553
560
|
radioButtons: [{
|
|
@@ -559,19 +566,19 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
559
566
|
}],
|
|
560
567
|
onChange: (e) => i(e)
|
|
561
568
|
}),
|
|
562
|
-
e.systemPrompt && /* @__PURE__ */
|
|
569
|
+
e.systemPrompt && /* @__PURE__ */ Y(m, {
|
|
563
570
|
value: n,
|
|
564
571
|
placeholder: p,
|
|
565
572
|
labelProps: {
|
|
566
|
-
className:
|
|
573
|
+
className: st,
|
|
567
574
|
label: f
|
|
568
575
|
},
|
|
569
576
|
onChange: (e) => a(e ?? "")
|
|
570
577
|
}),
|
|
571
|
-
e.temperature && /* @__PURE__ */
|
|
578
|
+
e.temperature && /* @__PURE__ */ Y(y, {
|
|
572
579
|
labelProps: {
|
|
573
580
|
label: h,
|
|
574
|
-
className:
|
|
581
|
+
className: st,
|
|
575
582
|
caption: v
|
|
576
583
|
},
|
|
577
584
|
value: r,
|
|
@@ -584,7 +591,7 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
584
591
|
]
|
|
585
592
|
});
|
|
586
593
|
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: g, saveLabel: _ = "Apply changes", saveDisabledTooltip: v }) => {
|
|
587
|
-
let { responseFormat: y, systemPrompt: b, temperature:
|
|
594
|
+
let { responseFormat: y, systemPrompt: b, temperature: x, canSubmit: C, setResponseFormat: w, setSystemPrompt: T, setTemperature: E, handleSubmit: D } = ot({
|
|
588
595
|
features: e,
|
|
589
596
|
initialResponseFormat: t,
|
|
590
597
|
initialSystemPrompt: n,
|
|
@@ -592,29 +599,29 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
592
599
|
onSave: i,
|
|
593
600
|
onClose: a
|
|
594
601
|
});
|
|
595
|
-
return /* @__PURE__ */
|
|
602
|
+
return /* @__PURE__ */ Y(h, {
|
|
596
603
|
open: !0,
|
|
597
604
|
header: o,
|
|
598
|
-
size:
|
|
605
|
+
size: O.Sm,
|
|
599
606
|
onClose: a,
|
|
600
607
|
className: "!bg-layer-2",
|
|
601
|
-
footer: /* @__PURE__ */
|
|
608
|
+
footer: /* @__PURE__ */ Y("div", {
|
|
602
609
|
className: "flex justify-end px-6 py-4",
|
|
603
|
-
children: /* @__PURE__ */
|
|
610
|
+
children: /* @__PURE__ */ Y(S, {
|
|
604
611
|
tooltip: v,
|
|
605
612
|
hideTooltip: C || !v,
|
|
606
|
-
children: /* @__PURE__ */
|
|
613
|
+
children: /* @__PURE__ */ Y(k, {
|
|
607
614
|
label: _,
|
|
608
|
-
onClick:
|
|
615
|
+
onClick: D,
|
|
609
616
|
disabled: !C
|
|
610
617
|
})
|
|
611
618
|
})
|
|
612
619
|
}),
|
|
613
|
-
children: /* @__PURE__ */
|
|
620
|
+
children: /* @__PURE__ */ Y(ct, {
|
|
614
621
|
features: e,
|
|
615
622
|
responseFormat: y,
|
|
616
623
|
systemPrompt: b,
|
|
617
|
-
temperature:
|
|
624
|
+
temperature: x,
|
|
618
625
|
onResponseFormatChange: w,
|
|
619
626
|
onSystemPromptChange: T,
|
|
620
627
|
onTemperatureChange: E,
|
|
@@ -630,26 +637,26 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
630
637
|
})
|
|
631
638
|
});
|
|
632
639
|
});
|
|
633
|
-
var
|
|
640
|
+
var lt = {
|
|
634
641
|
tabContainer: "_tabContainer_153ct_1",
|
|
635
642
|
tabActive: "_tabActive_153ct_13"
|
|
636
643
|
};
|
|
637
644
|
je(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
638
645
|
let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
|
|
639
|
-
return /* @__PURE__ */
|
|
646
|
+
return /* @__PURE__ */ Y("div", {
|
|
640
647
|
className: "flex flex-nowrap gap-1",
|
|
641
648
|
role: "tablist",
|
|
642
649
|
children: e.map((e) => {
|
|
643
650
|
let r = t === e.id;
|
|
644
|
-
return /* @__PURE__ */
|
|
651
|
+
return /* @__PURE__ */ Y("div", {
|
|
645
652
|
role: "tab",
|
|
646
653
|
"aria-selected": r,
|
|
647
654
|
className: "contents",
|
|
648
|
-
children: /* @__PURE__ */
|
|
655
|
+
children: /* @__PURE__ */ Y(x, {
|
|
649
656
|
label: e.label,
|
|
650
657
|
selected: r,
|
|
651
658
|
onClick: () => n(e.id),
|
|
652
|
-
className: u("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i,
|
|
659
|
+
className: u("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, lt.tabContainer, r && lt.tabActive)
|
|
653
660
|
})
|
|
654
661
|
}, e.id);
|
|
655
662
|
})
|
|
@@ -657,90 +664,90 @@ je(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
|
657
664
|
});
|
|
658
665
|
//#endregion
|
|
659
666
|
//#region src/components/MessageActions/MessageActions.tsx
|
|
660
|
-
var
|
|
661
|
-
let { tooltips: v, ariaLabels: y } = _ ?? {}, [b, x] =
|
|
662
|
-
s?.(), x("copy"), w(y?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => x(null),
|
|
663
|
-
}, [s, y?.copiedStatus]), E =
|
|
664
|
-
c?.(), x("markdown"), w(y?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => x(null),
|
|
667
|
+
var ut = 2e3, dt = ({ 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: _ }) => {
|
|
668
|
+
let { tooltips: v, ariaLabels: y } = _ ?? {}, [b, x] = q(null), [S, w] = q(""), T = G(() => {
|
|
669
|
+
s?.(), x("copy"), w(y?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => x(null), ut);
|
|
670
|
+
}, [s, y?.copiedStatus]), E = G(() => {
|
|
671
|
+
c?.(), x("markdown"), w(y?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => x(null), ut);
|
|
665
672
|
}, [c, y?.copiedMarkdownStatus]);
|
|
666
|
-
return /* @__PURE__ */
|
|
673
|
+
return /* @__PURE__ */ X("div", {
|
|
667
674
|
role: "toolbar",
|
|
668
675
|
"aria-label": y?.actionsGroup ?? "Message actions",
|
|
669
676
|
className: u("flex gap-1", !h && "opacity-0 group-hover:opacity-100", g),
|
|
670
|
-
children: [/* @__PURE__ */
|
|
677
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
671
678
|
role: "status",
|
|
672
679
|
"aria-live": "polite",
|
|
673
680
|
className: "sr-only",
|
|
674
|
-
children:
|
|
675
|
-
}), e === o.User ? /* @__PURE__ */ J
|
|
676
|
-
icon: /* @__PURE__ */
|
|
681
|
+
children: S
|
|
682
|
+
}), e === o.User ? /* @__PURE__ */ X(J, { children: [t && /* @__PURE__ */ Y(p, {
|
|
683
|
+
icon: /* @__PURE__ */ Y(Se, {
|
|
677
684
|
size: f.SM,
|
|
678
685
|
"aria-hidden": !0
|
|
679
686
|
}),
|
|
680
|
-
size:
|
|
687
|
+
size: C.Small,
|
|
681
688
|
"aria-label": y?.editMessage ?? "Edit message",
|
|
682
689
|
tooltipProps: { tooltip: v?.edit ?? "Edit" },
|
|
683
690
|
onClick: t,
|
|
684
691
|
onMouseEnter: n,
|
|
685
692
|
onFocus: n
|
|
686
|
-
}), r && /* @__PURE__ */
|
|
687
|
-
icon: /* @__PURE__ */
|
|
693
|
+
}), r && /* @__PURE__ */ Y(p, {
|
|
694
|
+
icon: /* @__PURE__ */ Y(Oe, {
|
|
688
695
|
size: f.SM,
|
|
689
696
|
"aria-hidden": !0
|
|
690
697
|
}),
|
|
691
|
-
size:
|
|
698
|
+
size: C.Small,
|
|
692
699
|
"aria-label": y?.deleteMessage ?? "Delete message",
|
|
693
700
|
tooltipProps: { tooltip: v?.delete ?? "Delete" },
|
|
694
701
|
onClick: r
|
|
695
|
-
})] }) : /* @__PURE__ */ J
|
|
696
|
-
i && /* @__PURE__ */
|
|
697
|
-
icon: /* @__PURE__ */
|
|
702
|
+
})] }) : /* @__PURE__ */ X(J, { children: [
|
|
703
|
+
i && /* @__PURE__ */ Y(p, {
|
|
704
|
+
icon: /* @__PURE__ */ Y(Ce, {
|
|
698
705
|
size: f.SM,
|
|
699
706
|
"aria-hidden": !0
|
|
700
707
|
}),
|
|
701
|
-
size:
|
|
708
|
+
size: C.Small,
|
|
702
709
|
"aria-label": y?.regenerateResponse ?? "Regenerate response",
|
|
703
710
|
tooltipProps: { tooltip: v?.regenerate ?? "Regenerate" },
|
|
704
711
|
onClick: i
|
|
705
712
|
}),
|
|
706
|
-
s && /* @__PURE__ */
|
|
707
|
-
icon:
|
|
713
|
+
s && /* @__PURE__ */ Y(p, {
|
|
714
|
+
icon: Y(b === "copy" ? M : I, {
|
|
708
715
|
size: f.SM,
|
|
709
716
|
"aria-hidden": !0
|
|
710
717
|
}),
|
|
711
|
-
size:
|
|
718
|
+
size: C.Small,
|
|
712
719
|
"aria-label": y?.copyResponse ?? "Copy response",
|
|
713
720
|
tooltipProps: { tooltip: b === "copy" ? v?.copied ?? "Copied!" : v?.copy ?? "Copy" },
|
|
714
721
|
onClick: T
|
|
715
722
|
}),
|
|
716
|
-
c && /* @__PURE__ */
|
|
717
|
-
icon:
|
|
723
|
+
c && /* @__PURE__ */ Y(p, {
|
|
724
|
+
icon: Y(b === "markdown" ? M : ye, {
|
|
718
725
|
size: f.SM,
|
|
719
726
|
"aria-hidden": !0
|
|
720
727
|
}),
|
|
721
|
-
size:
|
|
728
|
+
size: C.Small,
|
|
722
729
|
"aria-label": y?.copyAsMarkdown ?? "Copy as markdown",
|
|
723
730
|
tooltipProps: { tooltip: b === "markdown" ? v?.copiedMarkdown ?? "Copied!" : v?.copyMarkdown ?? "Copy as Markdown" },
|
|
724
731
|
onClick: E
|
|
725
732
|
}),
|
|
726
|
-
l && /* @__PURE__ */
|
|
727
|
-
icon: /* @__PURE__ */
|
|
733
|
+
l && /* @__PURE__ */ Y(p, {
|
|
734
|
+
icon: /* @__PURE__ */ Y(De, {
|
|
728
735
|
size: f.SM,
|
|
729
736
|
"aria-hidden": !0
|
|
730
737
|
}),
|
|
731
|
-
size:
|
|
738
|
+
size: C.Small,
|
|
732
739
|
"aria-label": y?.likeResponse ?? "Like response",
|
|
733
740
|
"aria-pressed": m === a.Like,
|
|
734
741
|
className: m === a.Like ? "!text-accent-primary" : void 0,
|
|
735
742
|
tooltipProps: { tooltip: v?.like ?? "Like" },
|
|
736
743
|
onClick: l
|
|
737
744
|
}),
|
|
738
|
-
d && /* @__PURE__ */
|
|
739
|
-
icon: /* @__PURE__ */
|
|
745
|
+
d && /* @__PURE__ */ Y(p, {
|
|
746
|
+
icon: /* @__PURE__ */ Y(Ee, {
|
|
740
747
|
size: f.SM,
|
|
741
748
|
"aria-hidden": !0
|
|
742
749
|
}),
|
|
743
|
-
size:
|
|
750
|
+
size: C.Small,
|
|
744
751
|
"aria-label": y?.dislikeResponse ?? "Dislike response",
|
|
745
752
|
"aria-pressed": m === a.Dislike,
|
|
746
753
|
className: m === a.Dislike ? "!text-accent-primary" : void 0,
|
|
@@ -756,66 +763,67 @@ var ct = 2e3, lt = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
756
763
|
collapsedText: "_collapsedText_1tjh8_15",
|
|
757
764
|
startersDivider: "_startersDivider_1tjh8_26",
|
|
758
765
|
text: "_text_1tjh8_30"
|
|
759
|
-
},
|
|
760
|
-
let { colors:
|
|
761
|
-
"--cm-bubble-text":
|
|
762
|
-
"--cm-starters-divider":
|
|
763
|
-
}),
|
|
764
|
-
return /* @__PURE__ */
|
|
766
|
+
}, ft = ({ 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: y, onAttachmentRetry: b, codeBlockTheme: x, labels: S, selectedAttachmentId: C }) => {
|
|
767
|
+
let { colors: w, typography: T, className: E, bubbleClassName: O } = i ?? {}, { 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 ? (d ?? []).filter((e) => e.type !== t.Audio) : d ?? [], z = l({
|
|
768
|
+
"--cm-bubble-text": w?.text,
|
|
769
|
+
"--cm-starters-divider": w?.startersDivider
|
|
770
|
+
}), B = u($.text, T?.fontClassName), V = !!(h || g);
|
|
771
|
+
return /* @__PURE__ */ X("div", {
|
|
765
772
|
role: "group",
|
|
766
|
-
"aria-label":
|
|
767
|
-
style:
|
|
768
|
-
className: u("flex w-full items-start gap-3",
|
|
769
|
-
children: [
|
|
773
|
+
"aria-label": I,
|
|
774
|
+
style: z,
|
|
775
|
+
className: u("flex w-full items-start gap-3", E),
|
|
776
|
+
children: [V && /* @__PURE__ */ Y(n, {
|
|
770
777
|
src: h,
|
|
771
778
|
size: 28,
|
|
772
|
-
initialsName: g ||
|
|
773
|
-
labels: { tooltip: g ??
|
|
774
|
-
}), /* @__PURE__ */
|
|
779
|
+
initialsName: g || L,
|
|
780
|
+
labels: { tooltip: g ?? L }
|
|
781
|
+
}), /* @__PURE__ */ X("div", {
|
|
775
782
|
className: "flex w-full min-w-0 max-w-full flex-col items-start gap-5",
|
|
776
|
-
children: [/* @__PURE__ */
|
|
777
|
-
className: u("flex w-full min-w-0 max-w-full flex-col items-start gap-4",
|
|
783
|
+
children: [/* @__PURE__ */ X("div", {
|
|
784
|
+
className: u("flex w-full min-w-0 max-w-full flex-col items-start gap-4", O),
|
|
778
785
|
children: [
|
|
779
|
-
(e || c) && /* @__PURE__ */
|
|
786
|
+
(e || c) && /* @__PURE__ */ Y("div", {
|
|
780
787
|
"aria-live": "polite",
|
|
781
788
|
"aria-atomic": "false",
|
|
782
|
-
className: u(
|
|
783
|
-
children: /* @__PURE__ */
|
|
789
|
+
className: u(B, "min-w-0 max-w-full text-start"),
|
|
790
|
+
children: /* @__PURE__ */ Y(r, {
|
|
784
791
|
content: e,
|
|
785
792
|
isStreaming: c,
|
|
786
|
-
thinkingLabel:
|
|
793
|
+
thinkingLabel: N,
|
|
787
794
|
components: _,
|
|
788
|
-
codeBlockCopyLabel:
|
|
789
|
-
codeBlockCopiedLabel:
|
|
795
|
+
codeBlockCopyLabel: P,
|
|
796
|
+
codeBlockCopiedLabel: F,
|
|
790
797
|
codeBlockTheme: x
|
|
791
798
|
})
|
|
792
799
|
}),
|
|
793
|
-
/* @__PURE__ */
|
|
794
|
-
attachments:
|
|
800
|
+
/* @__PURE__ */ Y(at, {
|
|
801
|
+
attachments: R,
|
|
795
802
|
onAttachmentClick: (e) => v?.(d?.find((t) => t.id === e)),
|
|
796
803
|
onDownloadAll: y,
|
|
797
804
|
onRetry: b,
|
|
798
805
|
labels: {
|
|
799
|
-
clickLabel:
|
|
800
|
-
retryLabel:
|
|
801
|
-
openInNewTabLabel:
|
|
802
|
-
}
|
|
806
|
+
clickLabel: k,
|
|
807
|
+
retryLabel: A,
|
|
808
|
+
openInNewTabLabel: j
|
|
809
|
+
},
|
|
810
|
+
selectedAttachmentId: C
|
|
803
811
|
}),
|
|
804
812
|
f,
|
|
805
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ Y(dt, {
|
|
806
814
|
...a,
|
|
807
815
|
isAlwaysVisible: s,
|
|
808
816
|
role: o.Assistant
|
|
809
817
|
})
|
|
810
818
|
]
|
|
811
|
-
}), p && p.length > 0 && m && /* @__PURE__ */
|
|
819
|
+
}), p && p.length > 0 && m && /* @__PURE__ */ Y("div", {
|
|
812
820
|
role: "list",
|
|
813
|
-
"aria-label":
|
|
821
|
+
"aria-label": M,
|
|
814
822
|
className: u("flex w-full flex-wrap gap-2 border-t pt-5", $.startersDivider),
|
|
815
|
-
children: p.map((e, t) => /* @__PURE__ */
|
|
823
|
+
children: p.map((e, t) => /* @__PURE__ */ Y("div", {
|
|
816
824
|
role: "listitem",
|
|
817
825
|
className: "min-w-[40px]",
|
|
818
|
-
children: /* @__PURE__ */
|
|
826
|
+
children: /* @__PURE__ */ Y(D, {
|
|
819
827
|
label: e.title,
|
|
820
828
|
className: "min-w-[40px]",
|
|
821
829
|
onClick: () => m(e)
|
|
@@ -824,76 +832,77 @@ var ct = 2e3, lt = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
824
832
|
})]
|
|
825
833
|
})]
|
|
826
834
|
});
|
|
827
|
-
},
|
|
835
|
+
}, pt = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ Y("div", {
|
|
828
836
|
role: "status",
|
|
829
837
|
"aria-live": "polite",
|
|
830
|
-
children: /* @__PURE__ */
|
|
838
|
+
children: /* @__PURE__ */ Y(T, {
|
|
831
839
|
title: e,
|
|
832
840
|
message: t,
|
|
833
841
|
textClassName: "flex-row flex-wrap gap-1"
|
|
834
842
|
})
|
|
835
|
-
}),
|
|
843
|
+
}), mt = /* @__PURE__ */ function(e) {
|
|
836
844
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
837
|
-
}({}),
|
|
838
|
-
let { colors:
|
|
845
|
+
}({}), ht = 10, gt = ({ text: e, position: t = mt.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount: s = ht, labels: c, onAttachmentClick: p, onDownloadAll: m, onAttachmentRetry: h, selectedAttachmentId: g }) => {
|
|
846
|
+
let { colors: _, typography: v, className: y, bubbleClassName: b } = n ?? {}, { showMoreLabel: x = "Show more", showLessLabel: S = "Show less", showMoreAriaLabel: w, showLessAriaLabel: T, attachmentClickLabel: D, attachmentRetryLabel: O, attachmentOpenInNewTabLabel: k, userMessageAriaLabel: A = "User message" } = c ?? {}, { textRef: j, isTextCollapsed: M, isOverflowing: F, collapsedMaxHeight: I, expandedMaxHeight: L, isCollapsed: R, toggleCollapsed: z } = d({
|
|
839
847
|
text: e,
|
|
840
848
|
collapsedLineCount: s
|
|
841
|
-
}),
|
|
842
|
-
"--cm-bubble-user-bg":
|
|
843
|
-
"--cm-bubble-user-border":
|
|
844
|
-
"--cm-bubble-fade-start":
|
|
845
|
-
"--cm-bubble-text":
|
|
846
|
-
"--cm-bubble-collapsed-height":
|
|
847
|
-
"--cm-bubble-expanded-height":
|
|
848
|
-
}),
|
|
849
|
-
return /* @__PURE__ */
|
|
849
|
+
}), B = l({
|
|
850
|
+
"--cm-bubble-user-bg": _?.userBackground,
|
|
851
|
+
"--cm-bubble-user-border": _?.userBorder,
|
|
852
|
+
"--cm-bubble-fade-start": _?.fadeStart,
|
|
853
|
+
"--cm-bubble-text": _?.text,
|
|
854
|
+
"--cm-bubble-collapsed-height": F ? `${I}px` : void 0,
|
|
855
|
+
"--cm-bubble-expanded-height": F ? `${L}px` : void 0
|
|
856
|
+
}), V = t === mt.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", ee = u($.text, v?.fontClassName), H = w ?? x, U = T ?? S, te = R ? x : S, ne = R ? H : U, re = R ? N : P, ie = Ne();
|
|
857
|
+
return /* @__PURE__ */ Y("div", {
|
|
850
858
|
role: "group",
|
|
851
|
-
"aria-label":
|
|
852
|
-
style:
|
|
853
|
-
className: u("flex w-full",
|
|
854
|
-
children: /* @__PURE__ */
|
|
859
|
+
"aria-label": A,
|
|
860
|
+
style: B,
|
|
861
|
+
className: u("flex w-full", y),
|
|
862
|
+
children: /* @__PURE__ */ X("div", {
|
|
855
863
|
className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
|
|
856
864
|
children: [
|
|
857
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ Y(at, {
|
|
858
866
|
attachments: a ?? [],
|
|
859
867
|
onAttachmentClick: (e) => p?.(a?.find((t) => t.id === e)),
|
|
860
868
|
onDownloadAll: m,
|
|
861
869
|
onRetry: h,
|
|
862
870
|
labels: {
|
|
863
|
-
clickLabel:
|
|
864
|
-
retryLabel:
|
|
865
|
-
openInNewTabLabel:
|
|
871
|
+
clickLabel: D,
|
|
872
|
+
retryLabel: O,
|
|
873
|
+
openInNewTabLabel: k
|
|
866
874
|
},
|
|
867
|
-
styles: { className: "max-w-[640px]" }
|
|
875
|
+
styles: { className: "max-w-[640px]" },
|
|
876
|
+
selectedAttachmentId: g
|
|
868
877
|
}),
|
|
869
|
-
e && /* @__PURE__ */
|
|
870
|
-
className: u($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4",
|
|
871
|
-
children: /* @__PURE__ */
|
|
878
|
+
e && /* @__PURE__ */ Y("div", {
|
|
879
|
+
className: u($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", V, b),
|
|
880
|
+
children: /* @__PURE__ */ X("div", {
|
|
872
881
|
className: "flex min-w-0 flex-col items-start",
|
|
873
|
-
children: [/* @__PURE__ */
|
|
874
|
-
id:
|
|
875
|
-
className: u("relative overflow-hidden",
|
|
876
|
-
children: /* @__PURE__ */
|
|
877
|
-
ref:
|
|
878
|
-
className: u(
|
|
882
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
883
|
+
id: ie,
|
|
884
|
+
className: u("relative overflow-hidden", F && $.collapsibleText, F && !R && $.expandedText, M && $.collapsedText),
|
|
885
|
+
children: /* @__PURE__ */ Y("p", {
|
|
886
|
+
ref: j,
|
|
887
|
+
className: u(ee, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
|
|
879
888
|
children: e
|
|
880
889
|
})
|
|
881
|
-
}),
|
|
882
|
-
label: /* @__PURE__ */
|
|
883
|
-
iconBefore: /* @__PURE__ */
|
|
890
|
+
}), F && /* @__PURE__ */ Y(E, {
|
|
891
|
+
label: /* @__PURE__ */ Y(J, { children: te }),
|
|
892
|
+
iconBefore: /* @__PURE__ */ Y(re, {
|
|
884
893
|
size: f.SM,
|
|
885
894
|
"aria-hidden": "true"
|
|
886
895
|
}),
|
|
887
|
-
"aria-label":
|
|
888
|
-
"aria-expanded": !
|
|
889
|
-
"aria-controls":
|
|
896
|
+
"aria-label": ne,
|
|
897
|
+
"aria-expanded": !R,
|
|
898
|
+
"aria-controls": ie,
|
|
890
899
|
className: "mt-3",
|
|
891
|
-
onClick:
|
|
892
|
-
size:
|
|
900
|
+
onClick: z,
|
|
901
|
+
size: C.Small
|
|
893
902
|
})]
|
|
894
903
|
})
|
|
895
904
|
}),
|
|
896
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ Y(dt, {
|
|
897
906
|
...r,
|
|
898
907
|
isAlwaysVisible: i,
|
|
899
908
|
role: o.User
|
|
@@ -901,16 +910,16 @@ var ct = 2e3, lt = ({ role: e = o.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
901
910
|
]
|
|
902
911
|
})
|
|
903
912
|
});
|
|
904
|
-
},
|
|
913
|
+
}, _t = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e === o.Status ? /* @__PURE__ */ Y(pt, { labels: {
|
|
905
914
|
titleText: r.labels?.statusTitleText,
|
|
906
915
|
bodyText: r.labels?.statusBodyText ?? ""
|
|
907
|
-
} }) : e === o.User ? /* @__PURE__ */
|
|
916
|
+
} }) : e === o.User ? /* @__PURE__ */ Y(gt, {
|
|
908
917
|
...r,
|
|
909
918
|
onAttachmentClick: t
|
|
910
|
-
}) : /* @__PURE__ */
|
|
919
|
+
}) : /* @__PURE__ */ Y(ft, {
|
|
911
920
|
...r,
|
|
912
921
|
markdownComponents: n,
|
|
913
922
|
onAttachmentClick: t
|
|
914
923
|
});
|
|
915
924
|
//#endregion
|
|
916
|
-
export {
|
|
925
|
+
export { ft as AssistantMessageBubble, mt as BubblePosition, dt as MessageActions, _t as MessageBubble, pt as StatusMessageBubble, gt as UserMessageBubble };
|
|
@@ -92,6 +92,8 @@ interface BaseMessageBubbleProps {
|
|
|
92
92
|
onDownloadAll?: (attachments: DisplayAttachment[]) => void;
|
|
93
93
|
/** Fires when a failed attachment upload is retried. */
|
|
94
94
|
onAttachmentRetry?: (id: string) => void;
|
|
95
|
+
/** ID of the attachment currently open in the canvas panel, if any. Renders that tile's selected visual state. */
|
|
96
|
+
selectedAttachmentId?: string;
|
|
95
97
|
}
|
|
96
98
|
/** Props for `UserMessageBubble`. */
|
|
97
99
|
export interface UserMessageBubbleProps extends BaseMessageBubbleProps {
|
|
@@ -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,iBAAiB,EACjB,WAAW,EACX,aAAa,EACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,mEAAmE;AACnE,MAAM,WAAW,mBAAmB;IAClC,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,0DAA0D;AAC1D,MAAM,WAAW,uBAAuB;IACtC,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,oEAAoE;AACpE,MAAM,WAAW,mBAAmB;IAClC,wDAAwD;IACxD,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,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AC7D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2DAA2D;IAC3D,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oEAAoE;IACpE,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,+FAA+F;IAC/F,MAAM,CAAC,EAAE,4BAA4B,CAAC;CACvC;AAED,kGAAkG;AAClG,MAAM,MAAM,kBAAkB,GAAG,2BAA2B,GAC1D,IAAI,CAAC,sBAAsB,EAAE,UAAU,GAAG,oBAAoB,CAAC,GAAG;IAChE,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.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.78",
|
|
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.78",
|
|
23
|
+
"@epam/ai-dial-conversation-input": "1.1.0-dev.78",
|
|
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.25"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|