@epam/ai-dial-conversation-messages 1.3.0-dev.246 → 1.3.0-dev.249
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":"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":"AAyBA,OAAO,EAAE,EAAE,EAA4C,MAAM,OAAO,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAKxE,uIAAuI;AACvI,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAoQlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/StatusMessageBubble.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,4DAA4D;AAC5D,MAAM,WAAW,yBAAyB;IACxC,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wDAAwD;AACxD,MAAM,WAAW,wBAAwB;IACvC,4BAA4B;IAC5B,MAAM,EAAE,yBAAyB,CAAC;CACnC;AAED,oGAAoG;AACpG,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,
|
|
1
|
+
{"version":3,"file":"StatusMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/StatusMessageBubble.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,4DAA4D;AAC5D,MAAM,WAAW,yBAAyB;IACxC,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wDAAwD;AACxD,MAAM,WAAW,wBAAwB;IACvC,4BAA4B;IAC5B,MAAM,EAAE,yBAAyB,CAAC;CACnC;AAED,oGAAoG;AACpG,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAW5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageSelectionReply.d.ts","sourceRoot":"","sources":["../../../src/components/MessageSelectionReply/MessageSelectionReply.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MessageSelectionReply.d.ts","sourceRoot":"","sources":["../../../src/components/MessageSelectionReply/MessageSelectionReply.tsx"],"names":[],"mappings":"AASA,OAAO,EAA6B,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3E,4CAA4C;AAC5C,MAAM,WAAW,2BAA2B;IAC1C,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,iDAAiD;AACjD,MAAM,WAAW,+BAA+B;IAC9C,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,iDAAiD;AACjD,MAAM,WAAW,2BAA2B;IAC1C,uDAAuD;IACvD,MAAM,CAAC,EAAE,2BAA2B,CAAC;IACrC,+BAA+B;IAC/B,UAAU,CAAC,EAAE,+BAA+B,CAAC;IAC7C,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,mEAAmE;AACnE,MAAM,WAAW,2BAA2B;IAC1C,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,yEAAyE;IACzE,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,uDAAuD;AACvD,MAAM,WAAW,0BAA0B;IACzC,+DAA+D;IAC/D,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,yCAAyC;IACzC,SAAS,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC5C,yDAAyD;IACzD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gEAAgE;IAChE,aAAa,EAAE,MAAM,CAAC;IACtB,iDAAiD;IACjD,MAAM,EAAE,2BAA2B,CAAC;IACpC,oDAAoD;IACpD,MAAM,CAAC,EAAE,2BAA2B,CAAC;IACrC,4FAA4F;IAC5F,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACtC;AAED,8FAA8F;AAC9F,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAmGhE,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
._activeRating_ygoee_1{color:var(--ma-active-rating-text,var(--text-accent,#1d4ed8))}._userBubble_17fln_1{border-color:var(--cm-bubble-user-border,var(--stroke-secondary,#d1dbea));background:var(--cm-bubble-user-bg,var(--bg-layer-sunken,#eef1f7))}._collapsibleText_17fln_6{max-height:var(--cm-bubble-collapsed-height);transition:max-height .2s ease-out}._expandedText_17fln_11{max-height:var(--cm-bubble-expanded-height)}._collapsedText_17fln_15:after{content:"";pointer-events:none;inset-inline:0;background:linear-gradient(to bottom, var(--cm-bubble-fade-start,var(--shadow-xs-2,#161b2d08)), var(--cm-bubble-user-bg,var(--bg-layer-sunken,#eef1f7)));height:3rem;position:absolute;bottom:0}@media (prefers-reduced-motion:reduce){._collapsibleText_17fln_6{transition:none}}._startersDivider_17fln_31{border-color:var(--cm-starters-divider,var(--stroke-secondary,#d1dbea))}._text_17fln_35{color:var(--cm-bubble-text,var(--text-primary,#161b2d))}._button_tqo4d_3._button_tqo4d_3{color:var(--cm-reply-text,var(--text-primary,#161b2d));background:var(--cm-reply-background,var(--bg-layer-raised,#fcfcfc))!important}._button_tqo4d_3._button_tqo4d_3:hover{color:var(--cm-reply-text,var(--text-primary,#161b2d));background:var(--cm-reply-hover-background,var(--bg-layer-base,#f5f7fa))!important}
|
|
2
2
|
/*$vite$:1*//*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
3
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}.collapse{visibility:collapse}.
|
|
3
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}.collapse{visibility:collapse}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-s-0{inset-inline-start:0}.top-0{top:0}.left-0{left:0}.z-50{z-index:50}.-ms-1{margin-inline-start:-.25rem}.ms-auto{margin-inline-start:auto}.-me-1{margin-inline-end:-.25rem}.mt-3{margin-top:.75rem}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.table{display:table}.h-8{height:2rem}.min-h-8{min-height:2rem}.w-\[calc\(100\%\+8px\)\]{width:calc(100% + 8px)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\[640px\]{max-width:640px}.max-w-\[calc\(100vw-16px\)\]{max-width:calc(100vw - 16px)}.max-w-full{max-width:100%}.min-w-0{min-width:0}.min-w-11{min-width:2.75rem}.min-w-\[40px\]{min-width:40px}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-end{justify-content:flex-end}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.rounded-ss-2xl{border-start-start-radius:1rem}.rounded-se-2xl{border-start-end-radius:1rem}.rounded-se-md{border-start-end-radius:.375rem}.rounded-ee-2xl{border-end-end-radius:1rem}.rounded-ee-md{border-end-end-radius:.375rem}.rounded-es-2xl{border-end-start-radius:1rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.px-1{padding-inline:.25rem}.px-2{padding-inline:.5rem}.px-6{padding-inline:1.5rem}.py-4{padding-block:1rem}.ps-1{padding-inline-start:.25rem}.pe-1{padding-inline-end:.25rem}.pt-5{padding-top:1.25rem}.text-center{text-align:center}.text-start{text-align:start}.wrap-anywhere{overflow-wrap:anywhere}.whitespace-nowrap{white-space:nowrap}.text-secondary{color:var(--text-secondary,#57647a)}.opacity-0{opacity:0}.shadow-lg{--tw-shadow:1px 10px 25px 12px var(--tw-shadow-color,var(--shadow-lg,#2764d914));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,cubic-bezier(.4, 0, .2, 1));transition-duration:var(--tw-duration,.15s)}.group-focus-within\/message\:opacity-100:is(:where(.group\/message):focus-within *){opacity:1}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *),.group-hover\/message\:opacity-100:is(:where(.group\/message):hover *){opacity:1}}.rtl\:scale-x-\[-1\]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-scale-x:-1;scale:var(--tw-scale-x) var(--tw-scale-y)}@media (max-width:1279px){.mobile\:h-11{height:2.75rem}.mobile\:min-h-11{min-height:2.75rem}}.\[\&\>\.cm-bubble-markdown\>div\>\*\:first-child\]\:indent-\[var\(--cm-bubble-first-line-indent\,0px\)\]>.cm-bubble-markdown>div>:first-child{text-indent:var(--cm-bubble-first-line-indent,0px)}.\[\&\>div\>\*\:first-child\]\:mt-0>div>:first-child{margin-top:0}.\[\&\>div\>\*\:last-child\]\:mb-0>div>:last-child{margin-bottom:0}@media (hover:none){.\[\@media\(hover\:none\)\]\:opacity-100{opacity:1}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}
|
package/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { AttachmentType as e, CopyIconButton as t, DeploymentIcon as n, MDMessageViewer as r, MessageRating as i, MessageRole as a, ResponseFormat as o, buildCssVars as s, buildInlineSegmentSource as c, createInlineSegmentComponents as l, createRehypeInlineSegments as u, mergeClasses as d, useCollapsedText as f } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { AttachmentGroup as p } from "@epam/ai-dial-attachment-input";
|
|
3
|
-
import { Button as m, ButtonVariant as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, ElementSize as v, GhostIconButton as y, InfoMessageNotification as b, LinkButton as x,
|
|
4
|
-
import { useCallback as
|
|
5
|
-
import { IconArrowBackUp as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { createPortal as
|
|
3
|
+
import { Button as m, ButtonVariant as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, ElementSize as v, GhostIconButton as y, InfoMessageNotification as b, LinkButton as x, LiveRegion as S, LiveRegionElement as C, NeutralButton as w, Tooltip as T } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { useCallback as E, useEffect as D, useId as ee, useLayoutEffect as O, useMemo as k, useRef as A, useState as j } from "react";
|
|
5
|
+
import { IconArrowBackUp as M, IconChevronDown as N, IconChevronUp as P, IconMarkdown as te, IconPencilMinus as F, IconRefresh as ne, IconThumbDown as re, IconThumbDownFilled as ie, IconThumbUp as ae, IconThumbUpFilled as oe, IconTrashX as I } from "@tabler/icons-react";
|
|
6
|
+
import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
|
|
7
|
+
import { createPortal as B } from "react-dom";
|
|
8
8
|
//#region src/constants/public-class-names.ts
|
|
9
|
-
var
|
|
9
|
+
var V = {
|
|
10
10
|
userBubble: "dial-cm-user-bubble",
|
|
11
11
|
assistantContent: "dial-cm-assistant-content"
|
|
12
|
-
},
|
|
13
|
-
let t =
|
|
14
|
-
return
|
|
12
|
+
}, H = 4, U = (e) => {
|
|
13
|
+
let t = A(null), [n, r] = j(0);
|
|
14
|
+
return D(() => {
|
|
15
15
|
if (!e) return;
|
|
16
16
|
let n = t.current;
|
|
17
17
|
if (n == null) return;
|
|
@@ -22,265 +22,264 @@ var L = {
|
|
|
22
22
|
return i.observe(n), () => i.disconnect();
|
|
23
23
|
}, [e]), {
|
|
24
24
|
slotRef: t,
|
|
25
|
-
firstLineIndent: e ? `calc(${n}px + ${
|
|
25
|
+
firstLineIndent: e ? `calc(${n}px + ${H}px)` : void 0
|
|
26
26
|
};
|
|
27
|
-
},
|
|
27
|
+
}, se = [
|
|
28
28
|
"href",
|
|
29
29
|
"src",
|
|
30
30
|
"alt",
|
|
31
31
|
"colspan",
|
|
32
32
|
"rowspan",
|
|
33
33
|
"start"
|
|
34
|
-
],
|
|
34
|
+
], ce = /* @__PURE__ */ new Set([
|
|
35
35
|
"pre",
|
|
36
36
|
"pre-wrap",
|
|
37
37
|
"pre-line",
|
|
38
38
|
"break-spaces"
|
|
39
|
-
]),
|
|
39
|
+
]), W = (e) => {
|
|
40
40
|
let t = document.createElement(e.tagName.toLowerCase());
|
|
41
|
-
|
|
41
|
+
se.forEach((n) => {
|
|
42
42
|
let r = e.getAttribute(n);
|
|
43
43
|
r !== null && t.setAttribute(n, r);
|
|
44
44
|
});
|
|
45
45
|
let { whiteSpace: n } = window.getComputedStyle(e);
|
|
46
|
-
return
|
|
47
|
-
},
|
|
46
|
+
return ce.has(n) && (t.style.whiteSpace = "pre-wrap"), t;
|
|
47
|
+
}, le = (e) => e instanceof SVGElement || window.getComputedStyle(e).display === "none", ue = (e, t) => {
|
|
48
48
|
if (!t.intersectsNode(e)) return null;
|
|
49
49
|
if (e.nodeType === Node.TEXT_NODE) {
|
|
50
50
|
let n = e.data, r = e === t.startContainer ? t.startOffset : 0, i = e === t.endContainer ? t.endOffset : n.length;
|
|
51
51
|
return document.createTextNode(n.slice(r, i));
|
|
52
52
|
}
|
|
53
|
-
if (!(e instanceof Element) ||
|
|
54
|
-
let n =
|
|
53
|
+
if (!(e instanceof Element) || le(e)) return null;
|
|
54
|
+
let n = W(e);
|
|
55
55
|
return e.childNodes.forEach((e) => {
|
|
56
|
-
let r =
|
|
56
|
+
let r = ue(e, t);
|
|
57
57
|
r && n.appendChild(r);
|
|
58
58
|
}), n;
|
|
59
|
-
},
|
|
59
|
+
}, de = (e, t, n) => {
|
|
60
60
|
let r = e, i = t;
|
|
61
61
|
for (; i && i !== n && n.contains(i);) {
|
|
62
|
-
let e =
|
|
62
|
+
let e = W(i);
|
|
63
63
|
e.appendChild(r), r = e, i = i.parentElement;
|
|
64
64
|
}
|
|
65
65
|
return r;
|
|
66
|
-
},
|
|
66
|
+
}, fe = (e, t) => {
|
|
67
67
|
let n = e.commonAncestorContainer, r = n instanceof Element ? n : n.parentElement;
|
|
68
68
|
if (!r) return null;
|
|
69
|
-
let i =
|
|
70
|
-
return i ?
|
|
71
|
-
},
|
|
69
|
+
let i = ue(r, e);
|
|
70
|
+
return i ? de(i, r.parentElement, t) : null;
|
|
71
|
+
}, pe = (e) => {
|
|
72
72
|
let t = window.getSelection();
|
|
73
73
|
if (!t || t.isCollapsed || t.rangeCount === 0 || !e.clipboardData) return;
|
|
74
74
|
let n = t.toString();
|
|
75
75
|
if (!n) return;
|
|
76
76
|
let r = document.createElement("div");
|
|
77
77
|
for (let n = 0; n < t.rangeCount; n++) {
|
|
78
|
-
let i =
|
|
78
|
+
let i = fe(t.getRangeAt(n), e.currentTarget);
|
|
79
79
|
i && r.appendChild(i);
|
|
80
80
|
}
|
|
81
81
|
e.clipboardData.setData("text/html", r.innerHTML), e.clipboardData.setData("text/plain", n), e.preventDefault();
|
|
82
|
-
},
|
|
83
|
-
let { tooltips:
|
|
84
|
-
|
|
85
|
-
let
|
|
86
|
-
clearTimeout(
|
|
87
|
-
}, []),
|
|
88
|
-
l?.(),
|
|
82
|
+
}, G = { activeRating: "_activeRating_ygoee_1" }, K = 2e3, me = ({ role: e = a.User, onEdit: n, onEditHover: r, onDelete: o, onRegenerate: c, onCopy: l, onCopyMarkdown: u, onLike: f, onDislike: p, activeRating: m, isAlwaysVisible: h, leadingContent: b, trailingContent: x, isDisabled: w = !1, className: T, labels: ee, colors: O }) => {
|
|
83
|
+
let { tooltips: k, ariaLabels: M } = ee ?? {}, [N, P] = j(null), [B, V] = j(""), H = A(void 0);
|
|
84
|
+
D(() => () => clearTimeout(H.current), []);
|
|
85
|
+
let U = E(() => {
|
|
86
|
+
clearTimeout(H.current), H.current = setTimeout(() => P(null), K);
|
|
87
|
+
}, []), se = n != null || o != null || c != null || l != null || u != null || f != null || p != null || b != null || x != null, ce = s({ "--ma-active-rating-text": O?.activeRatingText }), W = E(() => {
|
|
88
|
+
l?.(), P("copy"), V(e === a.User ? M?.copiedMessageStatus ?? "Message copied to clipboard" : M?.copiedStatus ?? "Copied to clipboard"), U();
|
|
89
89
|
}, [
|
|
90
90
|
l,
|
|
91
91
|
e,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
]),
|
|
96
|
-
u?.(),
|
|
92
|
+
M?.copiedStatus,
|
|
93
|
+
M?.copiedMessageStatus,
|
|
94
|
+
U
|
|
95
|
+
]), le = E(() => {
|
|
96
|
+
u?.(), P("markdown"), V(M?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), U();
|
|
97
97
|
}, [
|
|
98
98
|
u,
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
M?.copiedMarkdownStatus,
|
|
100
|
+
U
|
|
101
101
|
]);
|
|
102
|
-
return
|
|
102
|
+
return se ? /* @__PURE__ */ z("div", {
|
|
103
103
|
role: "toolbar",
|
|
104
|
-
"aria-label":
|
|
105
|
-
style:
|
|
106
|
-
className: d("flex items-center gap-1", !h && "opacity-0 group-hover:opacity-100",
|
|
104
|
+
"aria-label": M?.actionsGroup ?? "Message actions",
|
|
105
|
+
style: ce,
|
|
106
|
+
className: d("flex items-center gap-1", !h && "opacity-0 group-hover:opacity-100", T),
|
|
107
107
|
children: [
|
|
108
108
|
b,
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
children: I
|
|
109
|
+
/* @__PURE__ */ R(S, {
|
|
110
|
+
visuallyHidden: !0,
|
|
111
|
+
as: C.Span,
|
|
112
|
+
children: B
|
|
114
113
|
}),
|
|
115
|
-
e === a.User ? /* @__PURE__ */
|
|
116
|
-
l && /* @__PURE__ */
|
|
114
|
+
e === a.User ? /* @__PURE__ */ z(L, { children: [
|
|
115
|
+
l && /* @__PURE__ */ R(t, {
|
|
117
116
|
iconSize: g.SM,
|
|
118
|
-
onClick:
|
|
117
|
+
onClick: W,
|
|
119
118
|
size: v.Small,
|
|
120
|
-
isCopied:
|
|
121
|
-
copyLabel:
|
|
122
|
-
copiedLabel:
|
|
123
|
-
ariaLabel:
|
|
124
|
-
isDisabled:
|
|
119
|
+
isCopied: N === "copy",
|
|
120
|
+
copyLabel: k?.copyMessage ?? "Copy message",
|
|
121
|
+
copiedLabel: k?.copied ?? "Copied!",
|
|
122
|
+
ariaLabel: M?.copyMessage ?? "Copy message",
|
|
123
|
+
isDisabled: w
|
|
125
124
|
}),
|
|
126
|
-
n && /* @__PURE__ */
|
|
127
|
-
icon: /* @__PURE__ */
|
|
125
|
+
n && /* @__PURE__ */ R(y, {
|
|
126
|
+
icon: /* @__PURE__ */ R(F, {
|
|
128
127
|
size: g.SM,
|
|
129
128
|
"aria-hidden": !0,
|
|
130
129
|
stroke: _
|
|
131
130
|
}),
|
|
132
131
|
size: v.Small,
|
|
133
|
-
"aria-label":
|
|
134
|
-
tooltipProps: { tooltip:
|
|
132
|
+
"aria-label": M?.editMessage ?? "Edit message",
|
|
133
|
+
tooltipProps: { tooltip: k?.edit ?? "Edit" },
|
|
135
134
|
onClick: n,
|
|
136
135
|
onMouseEnter: r,
|
|
137
136
|
onFocus: r,
|
|
138
|
-
disabled:
|
|
137
|
+
disabled: w
|
|
139
138
|
}),
|
|
140
|
-
o && /* @__PURE__ */
|
|
141
|
-
icon: /* @__PURE__ */
|
|
139
|
+
o && /* @__PURE__ */ R(y, {
|
|
140
|
+
icon: /* @__PURE__ */ R(I, {
|
|
142
141
|
size: g.SM,
|
|
143
142
|
"aria-hidden": !0,
|
|
144
143
|
stroke: _
|
|
145
144
|
}),
|
|
146
145
|
size: v.Small,
|
|
147
|
-
"aria-label":
|
|
148
|
-
tooltipProps: { tooltip:
|
|
146
|
+
"aria-label": M?.deleteMessage ?? "Delete message",
|
|
147
|
+
tooltipProps: { tooltip: k?.delete ?? "Delete" },
|
|
149
148
|
onClick: o,
|
|
150
|
-
disabled:
|
|
149
|
+
disabled: w
|
|
151
150
|
})
|
|
152
|
-
] }) : /* @__PURE__ */
|
|
153
|
-
c && /* @__PURE__ */
|
|
154
|
-
icon: /* @__PURE__ */
|
|
151
|
+
] }) : /* @__PURE__ */ z(L, { children: [
|
|
152
|
+
c && /* @__PURE__ */ R(y, {
|
|
153
|
+
icon: /* @__PURE__ */ R(ne, {
|
|
155
154
|
size: g.SM,
|
|
156
155
|
"aria-hidden": !0,
|
|
157
156
|
stroke: _
|
|
158
157
|
}),
|
|
159
158
|
size: v.Small,
|
|
160
|
-
"aria-label":
|
|
161
|
-
tooltipProps: { tooltip:
|
|
159
|
+
"aria-label": M?.regenerateResponse ?? "Regenerate response",
|
|
160
|
+
tooltipProps: { tooltip: k?.regenerate ?? "Regenerate" },
|
|
162
161
|
onClick: c,
|
|
163
|
-
disabled:
|
|
162
|
+
disabled: w
|
|
164
163
|
}),
|
|
165
|
-
l && /* @__PURE__ */
|
|
164
|
+
l && /* @__PURE__ */ R(t, {
|
|
166
165
|
iconSize: g.SM,
|
|
167
|
-
onClick:
|
|
166
|
+
onClick: W,
|
|
168
167
|
size: v.Small,
|
|
169
|
-
isCopied:
|
|
170
|
-
copyLabel:
|
|
171
|
-
copiedLabel:
|
|
172
|
-
ariaLabel:
|
|
173
|
-
isDisabled:
|
|
168
|
+
isCopied: N === "copy",
|
|
169
|
+
copyLabel: k?.copy ?? "Copy",
|
|
170
|
+
copiedLabel: k?.copied ?? "Copied!",
|
|
171
|
+
ariaLabel: M?.copyResponse ?? "Copy response",
|
|
172
|
+
isDisabled: w
|
|
174
173
|
}),
|
|
175
|
-
u && /* @__PURE__ */
|
|
174
|
+
u && /* @__PURE__ */ R(t, {
|
|
176
175
|
iconSize: g.SM,
|
|
177
|
-
onClick:
|
|
176
|
+
onClick: le,
|
|
178
177
|
size: v.Small,
|
|
179
|
-
isCopied:
|
|
180
|
-
iconCopy: /* @__PURE__ */
|
|
178
|
+
isCopied: N === "markdown",
|
|
179
|
+
iconCopy: /* @__PURE__ */ R(te, {
|
|
181
180
|
size: g.SM,
|
|
182
181
|
"aria-hidden": !0,
|
|
183
182
|
stroke: _
|
|
184
183
|
}),
|
|
185
|
-
copyLabel:
|
|
186
|
-
copiedLabel:
|
|
187
|
-
ariaLabel:
|
|
188
|
-
isDisabled:
|
|
184
|
+
copyLabel: k?.copyMarkdown ?? "Copy as Markdown",
|
|
185
|
+
copiedLabel: k?.copiedMarkdown ?? "Copied!",
|
|
186
|
+
ariaLabel: M?.copyAsMarkdown ?? "Copy as markdown",
|
|
187
|
+
isDisabled: w
|
|
189
188
|
}),
|
|
190
|
-
f && /* @__PURE__ */
|
|
191
|
-
icon: m === i.Like ? /* @__PURE__ */
|
|
192
|
-
className:
|
|
189
|
+
f && /* @__PURE__ */ R(y, {
|
|
190
|
+
icon: m === i.Like ? /* @__PURE__ */ R(oe, {
|
|
191
|
+
className: G.activeRating,
|
|
193
192
|
size: g.SM,
|
|
194
193
|
"aria-hidden": !0
|
|
195
|
-
}) : /* @__PURE__ */
|
|
194
|
+
}) : /* @__PURE__ */ R(ae, {
|
|
196
195
|
size: g.SM,
|
|
197
196
|
"aria-hidden": !0,
|
|
198
197
|
stroke: _
|
|
199
198
|
}),
|
|
200
199
|
size: v.Small,
|
|
201
|
-
"aria-label":
|
|
200
|
+
"aria-label": M?.likeResponse ?? "Like response",
|
|
202
201
|
"aria-pressed": m === i.Like,
|
|
203
|
-
tooltipProps: { tooltip:
|
|
202
|
+
tooltipProps: { tooltip: k?.like ?? "Like" },
|
|
204
203
|
onClick: f,
|
|
205
|
-
disabled:
|
|
204
|
+
disabled: w
|
|
206
205
|
}),
|
|
207
|
-
p && /* @__PURE__ */
|
|
208
|
-
icon: m === i.Dislike ? /* @__PURE__ */
|
|
209
|
-
className:
|
|
206
|
+
p && /* @__PURE__ */ R(y, {
|
|
207
|
+
icon: m === i.Dislike ? /* @__PURE__ */ R(ie, {
|
|
208
|
+
className: G.activeRating,
|
|
210
209
|
size: g.SM,
|
|
211
210
|
"aria-hidden": !0
|
|
212
|
-
}) : /* @__PURE__ */
|
|
211
|
+
}) : /* @__PURE__ */ R(re, {
|
|
213
212
|
size: g.SM,
|
|
214
213
|
"aria-hidden": !0,
|
|
215
214
|
stroke: _
|
|
216
215
|
}),
|
|
217
216
|
size: v.Small,
|
|
218
|
-
"aria-label":
|
|
217
|
+
"aria-label": M?.dislikeResponse ?? "Dislike response",
|
|
219
218
|
"aria-pressed": m === i.Dislike,
|
|
220
|
-
tooltipProps: { tooltip:
|
|
219
|
+
tooltipProps: { tooltip: k?.dislike ?? "Dislike" },
|
|
221
220
|
onClick: p,
|
|
222
|
-
disabled:
|
|
221
|
+
disabled: w
|
|
223
222
|
})
|
|
224
223
|
] }),
|
|
225
224
|
x
|
|
226
225
|
]
|
|
227
226
|
}) : null;
|
|
228
|
-
},
|
|
229
|
-
let [t, n] =
|
|
230
|
-
return
|
|
227
|
+
}, q = (e) => {
|
|
228
|
+
let [t, n] = j(() => /* @__PURE__ */ new Date());
|
|
229
|
+
return D(() => {
|
|
231
230
|
let t = setInterval(() => n(/* @__PURE__ */ new Date()), e);
|
|
232
231
|
return () => clearInterval(t);
|
|
233
232
|
}, [e]), t;
|
|
234
|
-
},
|
|
233
|
+
}, J = /* @__PURE__ */ function(e) {
|
|
235
234
|
return e.Today = "today", e.Yesterday = "yesterday", e.Absolute = "absolute", e;
|
|
236
|
-
}({}),
|
|
235
|
+
}({}), Y = {
|
|
237
236
|
hour: "numeric",
|
|
238
237
|
minute: "2-digit"
|
|
239
|
-
},
|
|
238
|
+
}, he = {
|
|
240
239
|
year: "numeric",
|
|
241
240
|
month: "short",
|
|
242
241
|
day: "numeric",
|
|
243
|
-
...
|
|
244
|
-
},
|
|
245
|
-
["year", 365 *
|
|
246
|
-
["month", 30 *
|
|
247
|
-
["week", 7 *
|
|
248
|
-
["day",
|
|
249
|
-
["hour",
|
|
250
|
-
["minute",
|
|
251
|
-
],
|
|
242
|
+
...Y
|
|
243
|
+
}, ge = 60, _e = 3600, X = 24 * _e, ve = [
|
|
244
|
+
["year", 365 * X],
|
|
245
|
+
["month", 30 * X],
|
|
246
|
+
["week", 7 * X],
|
|
247
|
+
["day", X],
|
|
248
|
+
["hour", _e],
|
|
249
|
+
["minute", ge]
|
|
250
|
+
], ye = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), Z = (e) => {
|
|
252
251
|
if (!e) return null;
|
|
253
252
|
let t = new Date(e);
|
|
254
253
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
255
|
-
},
|
|
254
|
+
}, be = (e, t) => new Intl.DateTimeFormat(t, he).format(e), xe = (e, t, n) => {
|
|
256
255
|
let r = new Date(t.getFullYear(), t.getMonth(), t.getDate() - 1);
|
|
257
|
-
return
|
|
258
|
-
kind:
|
|
259
|
-
text: new Intl.DateTimeFormat(n,
|
|
260
|
-
} :
|
|
261
|
-
kind:
|
|
262
|
-
text: new Intl.DateTimeFormat(n,
|
|
256
|
+
return ye(e, t) ? {
|
|
257
|
+
kind: J.Today,
|
|
258
|
+
text: new Intl.DateTimeFormat(n, Y).format(e)
|
|
259
|
+
} : ye(e, r) ? {
|
|
260
|
+
kind: J.Yesterday,
|
|
261
|
+
text: new Intl.DateTimeFormat(n, Y).format(e)
|
|
263
262
|
} : {
|
|
264
|
-
kind:
|
|
265
|
-
text:
|
|
263
|
+
kind: J.Absolute,
|
|
264
|
+
text: be(e, n)
|
|
266
265
|
};
|
|
267
|
-
},
|
|
266
|
+
}, Q = (e, t, n) => {
|
|
268
267
|
let r = new Intl.RelativeTimeFormat(n, { numeric: "auto" }), i = (t.getTime() - e.getTime()) / 1e3;
|
|
269
|
-
for (let [e, t] of
|
|
268
|
+
for (let [e, t] of ve) {
|
|
270
269
|
let n = Math.floor(i / t);
|
|
271
270
|
if (n >= 1) return r.format(-n, e);
|
|
272
271
|
}
|
|
273
272
|
return r.format(0, "second");
|
|
274
|
-
},
|
|
275
|
-
let r =
|
|
276
|
-
return i == null ? null : /* @__PURE__ */
|
|
277
|
-
tooltip:
|
|
273
|
+
}, Se = 6e4, Ce = "opacity-0 transition-opacity group-hover/message:opacity-100 group-focus-within/message:opacity-100 [@media(hover:none)]:opacity-100", we = ({ timestamp: e, locale: t, className: n = "dial-small-text text-secondary" }) => {
|
|
274
|
+
let r = q(Se), i = Z(e);
|
|
275
|
+
return i == null ? null : /* @__PURE__ */ R(T, {
|
|
276
|
+
tooltip: be(i, t),
|
|
278
277
|
asChild: !0,
|
|
279
|
-
children: /* @__PURE__ */
|
|
278
|
+
children: /* @__PURE__ */ R("time", {
|
|
280
279
|
dateTime: e,
|
|
281
280
|
tabIndex: 0,
|
|
282
|
-
className: d("px-1 whitespace-nowrap", n,
|
|
283
|
-
children:
|
|
281
|
+
className: d("px-1 whitespace-nowrap", n, Ce),
|
|
282
|
+
children: Q(i, r, t)
|
|
284
283
|
})
|
|
285
284
|
});
|
|
286
285
|
}, $ = {
|
|
@@ -290,12 +289,12 @@ var L = {
|
|
|
290
289
|
collapsedText: "_collapsedText_17fln_15",
|
|
291
290
|
startersDivider: "_startersDivider_17fln_31",
|
|
292
291
|
text: "_text_17fln_35"
|
|
293
|
-
},
|
|
294
|
-
let { colors:
|
|
292
|
+
}, Te = "[&>.cm-bubble-markdown>div>*:first-child]:indent-[var(--cm-bubble-first-line-indent,0px)]", Ee = ({ text: t, contentRef: i, styles: c, actions: l, hasAlwaysVisibleActions: u, timestamp: f, locale: m, isStreaming: h, attachments: g, beforeContent: _, responseFormat: v, afterContent: y, hasThinkingPlaceholder: b = !0, starters: x, onSelectStarter: S, deploymentIconUrl: C, deploymentDisplayName: T, markdownComponents: E, markdownClassNames: D, markdownUrlTransform: ee, onAttachmentClick: O, onDownloadAll: A, isAttachmentDownloadable: j, onAttachmentRetry: M, codeBlockTheme: N, tableOnOpenInCanvas: P, labels: te, selectedAttachmentId: F }) => {
|
|
293
|
+
let { colors: ne, typography: re, className: ie, bubbleClassName: ae, timestampClassName: oe } = c ?? {}, I = f == null ? void 0 : /* @__PURE__ */ R(we, {
|
|
295
294
|
timestamp: f,
|
|
296
295
|
locale: m,
|
|
297
|
-
className:
|
|
298
|
-
}), { attachmentClickLabel:
|
|
296
|
+
className: oe
|
|
297
|
+
}), { attachmentClickLabel: B, attachmentDownloadLabel: H, attachmentRetryLabel: se, attachmentOpenInNewTabLabel: ce, startersAriaLabel: W = "Quick reply buttons", thinkingLabel: le, codeBlockCopyLabel: ue, codeBlockCopiedLabel: de, codeBlockDownloadLabel: fe, tableCopyLabel: G, tableCopiedLabel: K, tableDownloadCsvLabel: q, tableOpenInCanvasLabel: J, tableDownloadFilename: Y, tableScrollRegionAriaLabel: he, mathScrollRegionAriaLabel: ge, assistantMessageAriaLabel: _e = "Assistant message", deploymentIconFallbackLabel: X = "AI" } = te ?? {}, ve = k(() => ({
|
|
299
298
|
copyLabel: G,
|
|
300
299
|
copiedLabel: K,
|
|
301
300
|
downloadCsvLabel: q,
|
|
@@ -305,142 +304,138 @@ var L = {
|
|
|
305
304
|
K,
|
|
306
305
|
q,
|
|
307
306
|
J
|
|
308
|
-
]), ye = h ? (g ?? []).filter((t) => t.type !== e.Audio) : g ?? [], Z = !!t?.trim(), { slotRef: be, firstLineIndent: xe } =
|
|
309
|
-
"--cm-bubble-text":
|
|
310
|
-
"--cm-starters-divider":
|
|
307
|
+
]), ye = h ? (g ?? []).filter((t) => t.type !== e.Audio) : g ?? [], Z = !!t?.trim(), { slotRef: be, firstLineIndent: xe } = U(_ != null && Z), Q = s({
|
|
308
|
+
"--cm-bubble-text": ne?.text,
|
|
309
|
+
"--cm-starters-divider": ne?.startersDivider,
|
|
311
310
|
"--cm-bubble-first-line-indent": xe
|
|
312
|
-
}),
|
|
313
|
-
return /* @__PURE__ */
|
|
311
|
+
}), Se = d($.text, re?.fontClassName), Ce = !!(C || T);
|
|
312
|
+
return /* @__PURE__ */ z("div", {
|
|
314
313
|
role: "group",
|
|
315
314
|
"aria-label": _e,
|
|
316
315
|
style: Q,
|
|
317
|
-
onCopy:
|
|
318
|
-
className: d("group/message flex w-full items-start gap-3",
|
|
319
|
-
children: [
|
|
320
|
-
src:
|
|
316
|
+
onCopy: pe,
|
|
317
|
+
className: d("group/message flex w-full items-start gap-3", ie),
|
|
318
|
+
children: [Ce && /* @__PURE__ */ R(n, {
|
|
319
|
+
src: C,
|
|
321
320
|
size: 28,
|
|
322
321
|
initialsName: T || X,
|
|
323
322
|
labels: { tooltip: T ?? X }
|
|
324
|
-
}), /* @__PURE__ */
|
|
323
|
+
}), /* @__PURE__ */ z("div", {
|
|
325
324
|
className: "flex w-full max-w-full min-w-0 flex-col items-start gap-5",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
327
|
-
className: d("flex w-full max-w-full min-w-0 flex-col items-start gap-4",
|
|
325
|
+
children: [/* @__PURE__ */ z("div", {
|
|
326
|
+
className: d("flex w-full max-w-full min-w-0 flex-col items-start gap-4", ae),
|
|
328
327
|
children: [
|
|
329
|
-
_ != null && !Z && /* @__PURE__ */
|
|
328
|
+
_ != null && !Z && /* @__PURE__ */ R("div", {
|
|
330
329
|
className: "min-w-0",
|
|
331
330
|
children: _
|
|
332
331
|
}),
|
|
333
|
-
(Z || h && b) && /* @__PURE__ */
|
|
332
|
+
(Z || h && b) && /* @__PURE__ */ z("div", {
|
|
334
333
|
"aria-live": "polite",
|
|
335
334
|
"aria-atomic": "false",
|
|
336
|
-
className: d(
|
|
337
|
-
children: [_ != null && Z && /* @__PURE__ */
|
|
335
|
+
className: d(Se, "relative max-w-full min-w-0 text-start", _ != null && Z && Te, V.assistantContent),
|
|
336
|
+
children: [_ != null && Z && /* @__PURE__ */ R("div", {
|
|
338
337
|
ref: be,
|
|
339
338
|
className: "absolute inset-s-0 top-0",
|
|
340
339
|
children: _
|
|
341
|
-
}), /* @__PURE__ */
|
|
340
|
+
}), /* @__PURE__ */ R("div", {
|
|
342
341
|
ref: i,
|
|
343
342
|
className: "cm-bubble-markdown max-w-full min-w-0",
|
|
344
|
-
children: /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ R(r, {
|
|
345
344
|
content: t ?? "",
|
|
346
345
|
isPlainText: v === o.PlainText,
|
|
347
346
|
isStreaming: h,
|
|
348
|
-
thinkingLabel:
|
|
349
|
-
components:
|
|
350
|
-
classNames:
|
|
351
|
-
urlTransform:
|
|
352
|
-
codeBlockCopyLabel:
|
|
353
|
-
codeBlockCopiedLabel:
|
|
354
|
-
codeBlockDownloadLabel:
|
|
355
|
-
codeBlockTheme:
|
|
347
|
+
thinkingLabel: le,
|
|
348
|
+
components: E,
|
|
349
|
+
classNames: D,
|
|
350
|
+
urlTransform: ee,
|
|
351
|
+
codeBlockCopyLabel: ue,
|
|
352
|
+
codeBlockCopiedLabel: de,
|
|
353
|
+
codeBlockDownloadLabel: fe,
|
|
354
|
+
codeBlockTheme: N,
|
|
356
355
|
tableActionLabels: ve,
|
|
357
|
-
tableDownloadFilename:
|
|
358
|
-
tableOnOpenInCanvas:
|
|
359
|
-
tableScrollRegionAriaLabel:
|
|
360
|
-
mathScrollRegionAriaLabel:
|
|
356
|
+
tableDownloadFilename: Y,
|
|
357
|
+
tableOnOpenInCanvas: P,
|
|
358
|
+
tableScrollRegionAriaLabel: he,
|
|
359
|
+
mathScrollRegionAriaLabel: ge
|
|
361
360
|
})
|
|
362
361
|
})]
|
|
363
362
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ R(p, {
|
|
365
364
|
attachments: ye,
|
|
366
365
|
onAttachmentClick: O ? (e) => {
|
|
367
366
|
let t = g?.find((t) => t.id === e);
|
|
368
367
|
t && O(t);
|
|
369
368
|
} : void 0,
|
|
370
|
-
onDownloadAll:
|
|
371
|
-
isAttachmentDownloadable:
|
|
372
|
-
onRetry:
|
|
369
|
+
onDownloadAll: A,
|
|
370
|
+
isAttachmentDownloadable: j,
|
|
371
|
+
onRetry: M,
|
|
373
372
|
labels: {
|
|
374
|
-
clickLabel:
|
|
375
|
-
downloadLabel:
|
|
376
|
-
retryLabel:
|
|
377
|
-
openInNewTabLabel:
|
|
373
|
+
clickLabel: B,
|
|
374
|
+
downloadLabel: H,
|
|
375
|
+
retryLabel: se,
|
|
376
|
+
openInNewTabLabel: ce
|
|
378
377
|
},
|
|
379
|
-
selectedAttachmentId:
|
|
378
|
+
selectedAttachmentId: F
|
|
380
379
|
}),
|
|
381
380
|
y,
|
|
382
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ R(me, {
|
|
383
382
|
...l,
|
|
384
383
|
isAlwaysVisible: u,
|
|
385
|
-
trailingContent:
|
|
384
|
+
trailingContent: I == null ? l?.trailingContent : /* @__PURE__ */ z(L, { children: [l?.trailingContent, I] }),
|
|
386
385
|
role: a.Assistant
|
|
387
386
|
})
|
|
388
387
|
]
|
|
389
|
-
}), x && x.length > 0 &&
|
|
388
|
+
}), x && x.length > 0 && S && /* @__PURE__ */ R("div", {
|
|
390
389
|
role: "list",
|
|
391
|
-
"aria-label":
|
|
390
|
+
"aria-label": W,
|
|
392
391
|
className: d("flex w-full flex-wrap gap-2 border-t pt-5", $.startersDivider),
|
|
393
|
-
children: x.map((e, t) => /* @__PURE__ */
|
|
392
|
+
children: x.map((e, t) => /* @__PURE__ */ R("div", {
|
|
394
393
|
role: "listitem",
|
|
395
394
|
className: "min-w-[40px]",
|
|
396
|
-
children: /* @__PURE__ */
|
|
395
|
+
children: /* @__PURE__ */ R(w, {
|
|
397
396
|
label: e.title,
|
|
398
397
|
className: "min-w-[40px]",
|
|
399
|
-
onClick: () =>
|
|
398
|
+
onClick: () => S(e)
|
|
400
399
|
})
|
|
401
400
|
}, t))
|
|
402
401
|
})]
|
|
403
402
|
})]
|
|
404
403
|
});
|
|
405
|
-
},
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
message: t,
|
|
411
|
-
textClassName: "flex-row flex-wrap gap-1"
|
|
412
|
-
})
|
|
413
|
-
}), Ee = /* @__PURE__ */ function(e) {
|
|
404
|
+
}, De = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ R(b, {
|
|
405
|
+
title: e,
|
|
406
|
+
message: t,
|
|
407
|
+
textClassName: "flex-row flex-wrap gap-1"
|
|
408
|
+
}), Oe = /* @__PURE__ */ function(e) {
|
|
414
409
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
415
|
-
}({}),
|
|
416
|
-
let { colors:
|
|
410
|
+
}({}), ke = 10, Ae = "[&>div>*:first-child]:mt-0 [&>div>*:last-child]:mb-0", je = [], Me = ({ text: e, contentRef: t, position: n = Oe.Bottom, styles: i, actions: o, hasAlwaysVisibleActions: m, timestamp: h, locale: _, attachments: y, collapsedLineCount: b = ke, labels: S, textSegments: C, onAttachmentClick: w, onDownloadAll: T, isAttachmentDownloadable: E, onAttachmentRetry: D, selectedAttachmentId: O, markdownClassNames: A, markdownUrlTransform: j, codeBlockTheme: M, tableOnOpenInCanvas: te }) => {
|
|
411
|
+
let { colors: F, typography: ne, className: re, bubbleClassName: ie, timestampClassName: ae } = i ?? {}, oe = h == null ? void 0 : /* @__PURE__ */ R(we, {
|
|
417
412
|
timestamp: h,
|
|
418
413
|
locale: _,
|
|
419
|
-
className:
|
|
420
|
-
}), { showMoreLabel:
|
|
414
|
+
className: ae
|
|
415
|
+
}), { showMoreLabel: I = "Show more", showLessLabel: B = "Show less", showMoreAriaLabel: H, showLessAriaLabel: U, attachmentClickLabel: se, attachmentDownloadLabel: ce, attachmentRetryLabel: W, attachmentOpenInNewTabLabel: le, userMessageAriaLabel: ue = "User message", codeBlockCopyLabel: de, codeBlockCopiedLabel: fe, codeBlockDownloadLabel: G, tableCopyLabel: K, tableCopiedLabel: q, tableDownloadCsvLabel: J, tableOpenInCanvasLabel: Y, tableDownloadFilename: he, tableScrollRegionAriaLabel: ge, mathScrollRegionAriaLabel: _e } = S ?? {}, X = k(() => ({
|
|
421
416
|
copyLabel: K,
|
|
422
417
|
copiedLabel: q,
|
|
423
418
|
downloadCsvLabel: J,
|
|
424
|
-
openInCanvasLabel:
|
|
419
|
+
openInCanvasLabel: Y
|
|
425
420
|
}), [
|
|
426
421
|
K,
|
|
427
422
|
q,
|
|
428
423
|
J,
|
|
429
|
-
|
|
430
|
-
]), { textRef: ve, isTextCollapsed: ye, isOverflowing: Z, collapsedMaxHeight: be, expandedMaxHeight: xe, isCollapsed: Q, toggleCollapsed:
|
|
424
|
+
Y
|
|
425
|
+
]), { textRef: ve, isTextCollapsed: ye, isOverflowing: Z, collapsedMaxHeight: be, expandedMaxHeight: xe, isCollapsed: Q, toggleCollapsed: Se } = f({
|
|
431
426
|
text: e ?? "",
|
|
432
427
|
collapsedLineCount: b
|
|
433
|
-
}),
|
|
434
|
-
"--cm-bubble-user-bg":
|
|
435
|
-
"--cm-bubble-user-border":
|
|
436
|
-
"--cm-bubble-fade-start":
|
|
437
|
-
"--cm-bubble-text":
|
|
428
|
+
}), Ce = s({
|
|
429
|
+
"--cm-bubble-user-bg": F?.userBackground,
|
|
430
|
+
"--cm-bubble-user-border": F?.userBorder,
|
|
431
|
+
"--cm-bubble-fade-start": F?.fadeStart,
|
|
432
|
+
"--cm-bubble-text": F?.text,
|
|
438
433
|
"--cm-bubble-collapsed-height": Z ? `${be}px` : void 0,
|
|
439
434
|
"--cm-bubble-expanded-height": Z ? `${xe}px` : void 0
|
|
440
|
-
}), Te = n ===
|
|
435
|
+
}), Te = n === Oe.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", Ee = d($.text, ne?.fontClassName), { markdownSource: De, segmentRehypePlugins: Me, segmentComponents: Ne } = k(() => {
|
|
441
436
|
if (C == null) return {
|
|
442
437
|
markdownSource: e ?? "",
|
|
443
|
-
segmentRehypePlugins:
|
|
438
|
+
segmentRehypePlugins: je,
|
|
444
439
|
segmentComponents: void 0
|
|
445
440
|
};
|
|
446
441
|
let { source: t, inlineSegments: n } = c(C);
|
|
@@ -449,17 +444,17 @@ var L = {
|
|
|
449
444
|
segmentRehypePlugins: [u(n)],
|
|
450
445
|
segmentComponents: l(n)
|
|
451
446
|
};
|
|
452
|
-
}, [e, C]), Pe =
|
|
453
|
-
return /* @__PURE__ */
|
|
447
|
+
}, [e, C]), Pe = H ?? I, Fe = U ?? B, Ie = Q ? I : B, Le = Q ? Pe : Fe, Re = Q ? N : P, ze = ee();
|
|
448
|
+
return /* @__PURE__ */ R("div", {
|
|
454
449
|
role: "group",
|
|
455
|
-
"aria-label":
|
|
456
|
-
style:
|
|
457
|
-
onCopy:
|
|
458
|
-
className: d("group/message flex w-full",
|
|
459
|
-
children: /* @__PURE__ */
|
|
450
|
+
"aria-label": ue,
|
|
451
|
+
style: Ce,
|
|
452
|
+
onCopy: pe,
|
|
453
|
+
className: d("group/message flex w-full", re),
|
|
454
|
+
children: /* @__PURE__ */ z("div", {
|
|
460
455
|
className: "ms-auto flex w-fit max-w-full min-w-0 flex-col items-end gap-4",
|
|
461
456
|
children: [
|
|
462
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ R(p, {
|
|
463
458
|
attachments: y ?? [],
|
|
464
459
|
onAttachmentClick: w ? (e) => {
|
|
465
460
|
let t = y?.find((t) => t.id === e);
|
|
@@ -467,48 +462,48 @@ var L = {
|
|
|
467
462
|
} : void 0,
|
|
468
463
|
onDownloadAll: T,
|
|
469
464
|
isAttachmentDownloadable: E,
|
|
470
|
-
onRetry:
|
|
465
|
+
onRetry: D,
|
|
471
466
|
labels: {
|
|
472
|
-
clickLabel:
|
|
473
|
-
downloadLabel:
|
|
474
|
-
retryLabel:
|
|
475
|
-
openInNewTabLabel:
|
|
467
|
+
clickLabel: se,
|
|
468
|
+
downloadLabel: ce,
|
|
469
|
+
retryLabel: W,
|
|
470
|
+
openInNewTabLabel: le
|
|
476
471
|
},
|
|
477
472
|
styles: { className: "max-w-[640px]" },
|
|
478
473
|
selectedAttachmentId: O
|
|
479
474
|
}),
|
|
480
|
-
e && /* @__PURE__ */
|
|
481
|
-
className: d($.userBubble, "flex w-fit max-w-full min-w-0 items-center justify-end rounded-ss-2xl rounded-es-2xl border px-6 py-4 wrap-anywhere", Te,
|
|
482
|
-
children: /* @__PURE__ */
|
|
475
|
+
e && /* @__PURE__ */ R("div", {
|
|
476
|
+
className: d($.userBubble, "flex w-fit max-w-full min-w-0 items-center justify-end rounded-ss-2xl rounded-es-2xl border px-6 py-4 wrap-anywhere", Te, ie, V.userBubble),
|
|
477
|
+
children: /* @__PURE__ */ z("div", {
|
|
483
478
|
className: "flex min-w-0 flex-col items-start",
|
|
484
|
-
children: [/* @__PURE__ */
|
|
479
|
+
children: [/* @__PURE__ */ R("div", {
|
|
485
480
|
id: ze,
|
|
486
481
|
ref: t,
|
|
487
482
|
className: d("relative -ms-1 -me-1 w-[calc(100%+8px)] overflow-hidden ps-1 pe-1", Z && $.collapsibleText, Z && !Q && $.expandedText, ye && $.collapsedText),
|
|
488
|
-
children: /* @__PURE__ */
|
|
483
|
+
children: /* @__PURE__ */ R("div", {
|
|
489
484
|
ref: ve,
|
|
490
|
-
className: d(
|
|
491
|
-
children: /* @__PURE__ */
|
|
492
|
-
content:
|
|
485
|
+
className: d(Ee, "max-w-full min-w-0 text-start", Ae),
|
|
486
|
+
children: /* @__PURE__ */ R(r, {
|
|
487
|
+
content: De,
|
|
493
488
|
isRawHtmlEnabled: !1,
|
|
494
489
|
rehypePlugins: Me,
|
|
495
490
|
components: Ne,
|
|
496
|
-
classNames:
|
|
497
|
-
urlTransform:
|
|
498
|
-
codeBlockCopyLabel:
|
|
499
|
-
codeBlockCopiedLabel:
|
|
491
|
+
classNames: A,
|
|
492
|
+
urlTransform: j,
|
|
493
|
+
codeBlockCopyLabel: de,
|
|
494
|
+
codeBlockCopiedLabel: fe,
|
|
500
495
|
codeBlockDownloadLabel: G,
|
|
501
|
-
codeBlockTheme:
|
|
496
|
+
codeBlockTheme: M,
|
|
502
497
|
tableActionLabels: X,
|
|
503
|
-
tableDownloadFilename:
|
|
504
|
-
tableOnOpenInCanvas:
|
|
505
|
-
tableScrollRegionAriaLabel:
|
|
498
|
+
tableDownloadFilename: he,
|
|
499
|
+
tableOnOpenInCanvas: te,
|
|
500
|
+
tableScrollRegionAriaLabel: ge,
|
|
506
501
|
mathScrollRegionAriaLabel: _e
|
|
507
502
|
})
|
|
508
503
|
})
|
|
509
|
-
}), Z && /* @__PURE__ */
|
|
510
|
-
label: /* @__PURE__ */
|
|
511
|
-
iconBefore: /* @__PURE__ */
|
|
504
|
+
}), Z && /* @__PURE__ */ R(x, {
|
|
505
|
+
label: /* @__PURE__ */ R(L, { children: Ie }),
|
|
506
|
+
iconBefore: /* @__PURE__ */ R(Re, {
|
|
512
507
|
size: g.SM,
|
|
513
508
|
"aria-hidden": "true"
|
|
514
509
|
}),
|
|
@@ -516,45 +511,45 @@ var L = {
|
|
|
516
511
|
"aria-expanded": !Q,
|
|
517
512
|
"aria-controls": ze,
|
|
518
513
|
className: "mt-3",
|
|
519
|
-
onClick:
|
|
514
|
+
onClick: Se,
|
|
520
515
|
size: v.Small
|
|
521
516
|
})]
|
|
522
517
|
})
|
|
523
518
|
}),
|
|
524
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ R(me, {
|
|
525
520
|
...o,
|
|
526
521
|
isAlwaysVisible: m,
|
|
527
|
-
leadingContent:
|
|
522
|
+
leadingContent: oe == null ? o?.leadingContent : /* @__PURE__ */ z(L, { children: [oe, o?.leadingContent] }),
|
|
528
523
|
role: a.User
|
|
529
524
|
})
|
|
530
525
|
]
|
|
531
526
|
})
|
|
532
527
|
});
|
|
533
|
-
},
|
|
528
|
+
}, Ne = ({ role: e, beforeContent: t, textSegments: n, onAttachmentClick: r, responseFormat: i, markdownComponents: o, markdownUrlTransform: s, ...c }) => e === a.Status ? /* @__PURE__ */ R(De, { labels: {
|
|
534
529
|
titleText: c.labels?.statusTitleText,
|
|
535
530
|
bodyText: c.labels?.statusBodyText ?? ""
|
|
536
|
-
} }) : e === a.User ? /* @__PURE__ */
|
|
531
|
+
} }) : e === a.User ? /* @__PURE__ */ R(Me, {
|
|
537
532
|
...c,
|
|
538
533
|
textSegments: n,
|
|
539
534
|
markdownUrlTransform: s,
|
|
540
535
|
onAttachmentClick: r
|
|
541
|
-
}) : /* @__PURE__ */
|
|
536
|
+
}) : /* @__PURE__ */ R(Ee, {
|
|
542
537
|
...c,
|
|
543
538
|
beforeContent: t,
|
|
544
539
|
responseFormat: i,
|
|
545
540
|
markdownComponents: o,
|
|
546
541
|
markdownUrlTransform: s,
|
|
547
542
|
onAttachmentClick: r
|
|
548
|
-
}),
|
|
543
|
+
}), Pe = { button: "_button_tqo4d_3" }, Fe = ({ rect: e, actionRef: t, onReply: n, addedRevision: r, labels: i, styles: a, portalContainer: o }) => {
|
|
549
544
|
let { colors: c, typography: l, className: u, buttonClassName: f } = a ?? {}, p = l?.fontClassName ?? "dial-small-text", g = o === void 0 ? typeof document > "u" ? null : document.body : o, y = s({
|
|
550
545
|
"--cm-reply-background": c?.background,
|
|
551
546
|
"--cm-reply-hover-background": c?.hoverBackground,
|
|
552
547
|
"--cm-reply-text": c?.text
|
|
553
|
-
}), [b, x] =
|
|
548
|
+
}), [b, x] = j({
|
|
554
549
|
x: 0,
|
|
555
550
|
y: 0
|
|
556
551
|
});
|
|
557
|
-
return
|
|
552
|
+
return O(() => {
|
|
558
553
|
if (!e || !t.current) return;
|
|
559
554
|
let n = t.current.getBoundingClientRect(), r = window.visualViewport, i = r?.offsetLeft ?? 0, a = r?.offsetTop ?? 0, o = r?.width ?? document.documentElement.clientWidth, s = r?.height ?? document.documentElement.clientHeight, c = e.top - n.height - 8 >= a + 8 ? e.top - n.height - 8 : e.bottom + 8;
|
|
560
555
|
x({
|
|
@@ -569,42 +564,40 @@ var L = {
|
|
|
569
564
|
f,
|
|
570
565
|
p,
|
|
571
566
|
i.reply
|
|
572
|
-
]), g ?
|
|
567
|
+
]), g ? B(/* @__PURE__ */ z(L, { children: [e && /* @__PURE__ */ R("div", {
|
|
573
568
|
ref: t,
|
|
574
569
|
className: d("fixed top-0 left-0 z-50 max-w-[calc(100vw-16px)]", u),
|
|
575
570
|
style: {
|
|
576
571
|
...y,
|
|
577
572
|
transform: `translate(${b.x}px, ${b.y}px)`
|
|
578
573
|
},
|
|
579
|
-
children: /* @__PURE__ */
|
|
574
|
+
children: /* @__PURE__ */ R(m, {
|
|
580
575
|
variant: h.Neutral,
|
|
581
576
|
size: v.Small,
|
|
582
577
|
label: i.reply,
|
|
583
578
|
onClick: n,
|
|
584
579
|
textClassName: p,
|
|
585
|
-
className: d(
|
|
586
|
-
iconAfter: /* @__PURE__ */
|
|
580
|
+
className: d(Pe.button, "h-8 min-h-8 min-w-11 px-2 shadow-lg mobile:h-11 mobile:min-h-11", f),
|
|
581
|
+
iconAfter: /* @__PURE__ */ R(M, {
|
|
587
582
|
size: 16,
|
|
588
583
|
stroke: _,
|
|
589
584
|
"aria-hidden": "true",
|
|
590
585
|
className: "rtl:scale-x-[-1]"
|
|
591
586
|
})
|
|
592
587
|
})
|
|
593
|
-
}), /* @__PURE__ */
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
className: "sr-only",
|
|
597
|
-
children: e ? i.selectionAvailable : r > 0 ? /* @__PURE__ */ P("span", { children: i.attachmentAdded }, r) : null
|
|
588
|
+
}), /* @__PURE__ */ R(S, {
|
|
589
|
+
visuallyHidden: !0,
|
|
590
|
+
children: e ? i.selectionAvailable : r > 0 ? /* @__PURE__ */ R("span", { children: i.attachmentAdded }, r) : null
|
|
598
591
|
})] }), g) : null;
|
|
599
|
-
},
|
|
600
|
-
let i =
|
|
592
|
+
}, Ie = (e) => `Today ${e}`, Le = (e) => `Yesterday ${e}`, Re = ({ timestamp: e, locale: t, labels: n, className: r = "dial-small-text text-secondary" }) => {
|
|
593
|
+
let i = Z(e);
|
|
601
594
|
if (i == null) return null;
|
|
602
|
-
let { kind: a, text: o } =
|
|
603
|
-
return a ===
|
|
595
|
+
let { kind: a, text: o } = xe(i, /* @__PURE__ */ new Date(), t), s = o;
|
|
596
|
+
return a === J.Today ? s = (n?.today ?? Ie)(o) : a === J.Yesterday && (s = (n?.yesterday ?? Le)(o)), /* @__PURE__ */ R("time", {
|
|
604
597
|
dateTime: e,
|
|
605
598
|
className: d("self-center text-center", r),
|
|
606
599
|
children: s
|
|
607
600
|
});
|
|
608
601
|
};
|
|
609
602
|
//#endregion
|
|
610
|
-
export {
|
|
603
|
+
export { Ee as AssistantMessageBubble, Oe as BubblePosition, V as CONVERSATION_MESSAGES_CLASS, Re as ConversationStartTimestamp, me as MessageActions, Ne as MessageBubble, Fe as MessageSelectionReply, De as StatusMessageBubble, Me 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.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.249",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
21
|
"react-markdown": "^10.1.0",
|
|
22
|
-
"@epam/ai-dial-attachment-input": "1.3.0-dev.
|
|
22
|
+
"@epam/ai-dial-attachment-input": "1.3.0-dev.249"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^19.2.8",
|
|
26
26
|
"react-dom": "^19.2.8",
|
|
27
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
28
|
-
"@epam/ai-dial-ui-kit": "^0.16.0-dev.
|
|
27
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.249",
|
|
28
|
+
"@epam/ai-dial-ui-kit": "^0.16.0-dev.56"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|