@epam/ai-dial-conversation-messages 1.2.0-dev.268 → 1.2.0-dev.270

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,5 +1,5 @@
1
1
  import { FC } from 'react';
2
2
  import { MessageActionsProps } from '../../models/message-actions';
3
- /** Context-sensitive action bar — shows edit/delete for user messages and regenerate/copy/like/dislike for assistant messages. */
3
+ /** Context-sensitive action bar — shows copy/edit/delete for user messages and regenerate/copy/like/dislike for assistant messages. */
4
4
  export declare const MessageActions: FC<MessageActionsProps>;
5
5
  //# sourceMappingURL=MessageActions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageActions.d.ts","sourceRoot":"","sources":["../../../src/components/MessageActions/MessageActions.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAE,EAAE,EAAyB,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAKxE,kIAAkI;AAClI,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAuNlD,CAAC"}
1
+ {"version":3,"file":"MessageActions.d.ts","sourceRoot":"","sources":["../../../src/components/MessageActions/MessageActions.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAE,EAAE,EAAyB,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAKxE,uIAAuI;AACvI,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAuOlD,CAAC"}
package/index.js CHANGED
@@ -1,8 +1,8 @@
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, mergeClasses as c, useCollapsedText as l } from "@epam/ai-dial-chat-shared";
2
2
  import { AttachmentGroup as u } from "@epam/ai-dial-attachment-input";
3
3
  import { Button as d, ButtonVariant as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, ElementSize as h, GhostIconButton as g, InfoMessageNotification as _, LinkButton as v, NeutralButton as y } from "@epam/ai-dial-ui-kit";
4
- import { useCallback as b, useEffect as x, useId as S, useLayoutEffect as C, useMemo as w, useRef as T, useState as E } from "react";
5
- import { IconArrowBackUp as D, IconChevronDown as O, IconChevronUp as k, IconMarkdown as A, IconPencilMinus as j, IconRefresh as ee, IconThumbDown as te, IconThumbDownFilled as ne, IconThumbUp as M, IconThumbUpFilled as re, IconTrashX as N } from "@tabler/icons-react";
4
+ import { useCallback as b, useEffect as x, useId as S, useLayoutEffect as C, useMemo as ee, useRef as w, useState as T } from "react";
5
+ import { IconArrowBackUp as E, IconChevronDown as D, IconChevronUp as O, IconMarkdown as k, IconPencilMinus as A, IconRefresh as j, IconThumbDown as M, IconThumbDownFilled as te, IconThumbUp as N, IconThumbUpFilled as ne, IconTrashX as re } from "@tabler/icons-react";
6
6
  import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
7
7
  import { createPortal as L } from "react-dom";
8
8
  //#region src/constants/public-class-names.ts
@@ -10,7 +10,7 @@ var R = {
10
10
  userBubble: "dial-cm-user-bubble",
11
11
  assistantContent: "dial-cm-assistant-content"
12
12
  }, z = 4, B = (e) => {
13
- let t = T(null), [n, r] = E(0);
13
+ let t = w(null), [n, r] = T(0);
14
14
  return x(() => {
15
15
  if (!e) return;
16
16
  let n = t.current;
@@ -79,15 +79,20 @@ var R = {
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
- }, J = { activeRating: "_activeRating_ygoee_1" }, Y = 2e3, ae = ({ role: e = a.User, onEdit: n, onEditHover: r, onDelete: o, onRegenerate: l, onCopy: u, onCopyMarkdown: d, onLike: f, onDislike: _, activeRating: v, isAlwaysVisible: y, isDisabled: x = !1, className: S, labels: C, colors: w }) => {
83
- let { tooltips: T, ariaLabels: D } = C ?? {}, [O, k] = E(null), [L, R] = E(""), z = n != null || o != null || l != null || u != null || d != null || f != null || _ != null, B = s({ "--ma-active-rating-text": w?.activeRatingText }), V = b(() => {
84
- u?.(), k("copy"), R(D?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => k(null), Y);
85
- }, [u, D?.copiedStatus]), H = b(() => {
86
- d?.(), k("markdown"), R(D?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => k(null), Y);
87
- }, [d, D?.copiedMarkdownStatus]);
82
+ }, J = { activeRating: "_activeRating_ygoee_1" }, Y = 2e3, ae = ({ role: e = a.User, onEdit: n, onEditHover: r, onDelete: o, onRegenerate: l, onCopy: u, onCopyMarkdown: d, onLike: f, onDislike: _, activeRating: v, isAlwaysVisible: y, isDisabled: x = !1, className: S, labels: C, colors: ee }) => {
83
+ let { tooltips: w, ariaLabels: E } = C ?? {}, [D, O] = T(null), [L, R] = T(""), z = n != null || o != null || l != null || u != null || d != null || f != null || _ != null, B = s({ "--ma-active-rating-text": ee?.activeRatingText }), V = b(() => {
84
+ u?.(), O("copy"), R(e === a.User ? E?.copiedMessageStatus ?? "Message copied to clipboard" : E?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => O(null), Y);
85
+ }, [
86
+ u,
87
+ e,
88
+ E?.copiedStatus,
89
+ E?.copiedMessageStatus
90
+ ]), H = b(() => {
91
+ d?.(), O("markdown"), R(E?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => O(null), Y);
92
+ }, [d, E?.copiedMarkdownStatus]);
88
93
  return z ? /* @__PURE__ */ I("div", {
89
94
  role: "toolbar",
90
- "aria-label": D?.actionsGroup ?? "Message actions",
95
+ "aria-label": E?.actionsGroup ?? "Message actions",
91
96
  style: B,
92
97
  className: c("flex gap-1", !y && "opacity-0 group-hover:opacity-100", S),
93
98
  children: [/* @__PURE__ */ F("span", {
@@ -95,40 +100,53 @@ var R = {
95
100
  "aria-live": "polite",
96
101
  className: "sr-only",
97
102
  children: L
98
- }), e === a.User ? /* @__PURE__ */ I(P, { children: [n && /* @__PURE__ */ F(g, {
99
- icon: /* @__PURE__ */ F(j, {
100
- size: p.SM,
101
- "aria-hidden": !0,
102
- stroke: m
103
+ }), e === a.User ? /* @__PURE__ */ I(P, { children: [
104
+ u && /* @__PURE__ */ F(t, {
105
+ iconSize: p.SM,
106
+ onClick: V,
107
+ size: h.Small,
108
+ isCopied: D === "copy",
109
+ copyLabel: w?.copyMessage ?? "Copy message",
110
+ copiedLabel: w?.copied ?? "Copied!",
111
+ ariaLabel: E?.copyMessage ?? "Copy message",
112
+ isDisabled: x
103
113
  }),
104
- size: h.Small,
105
- "aria-label": D?.editMessage ?? "Edit message",
106
- tooltipProps: { tooltip: T?.edit ?? "Edit" },
107
- onClick: n,
108
- onMouseEnter: r,
109
- onFocus: r,
110
- disabled: x
111
- }), o && /* @__PURE__ */ F(g, {
112
- icon: /* @__PURE__ */ F(N, {
113
- size: p.SM,
114
- "aria-hidden": !0,
115
- stroke: m
114
+ n && /* @__PURE__ */ F(g, {
115
+ icon: /* @__PURE__ */ F(A, {
116
+ size: p.SM,
117
+ "aria-hidden": !0,
118
+ stroke: m
119
+ }),
120
+ size: h.Small,
121
+ "aria-label": E?.editMessage ?? "Edit message",
122
+ tooltipProps: { tooltip: w?.edit ?? "Edit" },
123
+ onClick: n,
124
+ onMouseEnter: r,
125
+ onFocus: r,
126
+ disabled: x
116
127
  }),
117
- size: h.Small,
118
- "aria-label": D?.deleteMessage ?? "Delete message",
119
- tooltipProps: { tooltip: T?.delete ?? "Delete" },
120
- onClick: o,
121
- disabled: x
122
- })] }) : /* @__PURE__ */ I(P, { children: [
128
+ o && /* @__PURE__ */ F(g, {
129
+ icon: /* @__PURE__ */ F(re, {
130
+ size: p.SM,
131
+ "aria-hidden": !0,
132
+ stroke: m
133
+ }),
134
+ size: h.Small,
135
+ "aria-label": E?.deleteMessage ?? "Delete message",
136
+ tooltipProps: { tooltip: w?.delete ?? "Delete" },
137
+ onClick: o,
138
+ disabled: x
139
+ })
140
+ ] }) : /* @__PURE__ */ I(P, { children: [
123
141
  l && /* @__PURE__ */ F(g, {
124
- icon: /* @__PURE__ */ F(ee, {
142
+ icon: /* @__PURE__ */ F(j, {
125
143
  size: p.SM,
126
144
  "aria-hidden": !0,
127
145
  stroke: m
128
146
  }),
129
147
  size: h.Small,
130
- "aria-label": D?.regenerateResponse ?? "Regenerate response",
131
- tooltipProps: { tooltip: T?.regenerate ?? "Regenerate" },
148
+ "aria-label": E?.regenerateResponse ?? "Regenerate response",
149
+ tooltipProps: { tooltip: w?.regenerate ?? "Regenerate" },
132
150
  onClick: l,
133
151
  disabled: x
134
152
  }),
@@ -136,58 +154,58 @@ var R = {
136
154
  iconSize: p.SM,
137
155
  onClick: V,
138
156
  size: h.Small,
139
- isCopied: O === "copy",
140
- copyLabel: T?.copy ?? "Copy",
141
- copiedLabel: T?.copied ?? "Copied!",
142
- ariaLabel: D?.copyResponse ?? "Copy response",
157
+ isCopied: D === "copy",
158
+ copyLabel: w?.copy ?? "Copy",
159
+ copiedLabel: w?.copied ?? "Copied!",
160
+ ariaLabel: E?.copyResponse ?? "Copy response",
143
161
  isDisabled: x
144
162
  }),
145
163
  d && /* @__PURE__ */ F(t, {
146
164
  iconSize: p.SM,
147
165
  onClick: H,
148
166
  size: h.Small,
149
- isCopied: O === "markdown",
150
- iconCopy: /* @__PURE__ */ F(A, {
167
+ isCopied: D === "markdown",
168
+ iconCopy: /* @__PURE__ */ F(k, {
151
169
  size: p.SM,
152
170
  "aria-hidden": !0,
153
171
  stroke: m
154
172
  }),
155
- copyLabel: T?.copyMarkdown ?? "Copy as Markdown",
156
- copiedLabel: T?.copiedMarkdown ?? "Copied!",
157
- ariaLabel: D?.copyAsMarkdown ?? "Copy as markdown",
173
+ copyLabel: w?.copyMarkdown ?? "Copy as Markdown",
174
+ copiedLabel: w?.copiedMarkdown ?? "Copied!",
175
+ ariaLabel: E?.copyAsMarkdown ?? "Copy as markdown",
158
176
  isDisabled: x
159
177
  }),
160
178
  f && /* @__PURE__ */ F(g, {
161
- icon: v === i.Like ? /* @__PURE__ */ F(re, {
179
+ icon: v === i.Like ? /* @__PURE__ */ F(ne, {
162
180
  className: J.activeRating,
163
181
  size: p.SM,
164
182
  "aria-hidden": !0
165
- }) : /* @__PURE__ */ F(M, {
183
+ }) : /* @__PURE__ */ F(N, {
166
184
  size: p.SM,
167
185
  "aria-hidden": !0,
168
186
  stroke: m
169
187
  }),
170
188
  size: h.Small,
171
- "aria-label": D?.likeResponse ?? "Like response",
189
+ "aria-label": E?.likeResponse ?? "Like response",
172
190
  "aria-pressed": v === i.Like,
173
- tooltipProps: { tooltip: T?.like ?? "Like" },
191
+ tooltipProps: { tooltip: w?.like ?? "Like" },
174
192
  onClick: f,
175
193
  disabled: x
176
194
  }),
177
195
  _ && /* @__PURE__ */ F(g, {
178
- icon: v === i.Dislike ? /* @__PURE__ */ F(ne, {
196
+ icon: v === i.Dislike ? /* @__PURE__ */ F(te, {
179
197
  className: J.activeRating,
180
198
  size: p.SM,
181
199
  "aria-hidden": !0
182
- }) : /* @__PURE__ */ F(te, {
200
+ }) : /* @__PURE__ */ F(M, {
183
201
  size: p.SM,
184
202
  "aria-hidden": !0,
185
203
  stroke: m
186
204
  }),
187
205
  size: h.Small,
188
- "aria-label": D?.dislikeResponse ?? "Dislike response",
206
+ "aria-label": E?.dislikeResponse ?? "Dislike response",
189
207
  "aria-pressed": v === i.Dislike,
190
- tooltipProps: { tooltip: T?.dislike ?? "Dislike" },
208
+ tooltipProps: { tooltip: w?.dislike ?? "Dislike" },
191
209
  onClick: _,
192
210
  disabled: x
193
211
  })
@@ -200,8 +218,8 @@ var R = {
200
218
  collapsedText: "_collapsedText_cq829_15",
201
219
  startersDivider: "_startersDivider_cq829_26",
202
220
  text: "_text_cq829_30"
203
- }, oe = "[&>.cm-bubble-markdown>div>*:first-child]:indent-[var(--cm-bubble-first-line-indent,0px)]", Z = ({ text: t, contentRef: i, styles: l, actions: d, hasAlwaysVisibleActions: f, isStreaming: p, attachments: m, beforeContent: h, responseFormat: g, afterContent: _, hasThinkingPlaceholder: v = !0, starters: b, onSelectStarter: x, deploymentIconUrl: S, deploymentDisplayName: C, markdownComponents: T, markdownClassNames: E, markdownUrlTransform: D, onAttachmentClick: O, onDownloadAll: k, onAttachmentRetry: A, codeBlockTheme: j, tableOnOpenInCanvas: ee, labels: te, selectedAttachmentId: ne }) => {
204
- let { colors: M, typography: re, className: N, bubbleClassName: P } = l ?? {}, { attachmentClickLabel: L, attachmentRetryLabel: z, attachmentOpenInNewTabLabel: V, startersAriaLabel: H = "Quick reply buttons", thinkingLabel: U, codeBlockCopyLabel: W, codeBlockCopiedLabel: G, tableCopyLabel: K, tableCopiedLabel: q, tableDownloadCsvLabel: J, tableOpenInCanvasLabel: Y, tableDownloadFilename: Z, tableScrollRegionAriaLabel: Q, assistantMessageAriaLabel: $ = "Assistant message", deploymentIconFallbackLabel: se = "AI" } = te ?? {}, ce = w(() => ({
221
+ }, oe = "[&>.cm-bubble-markdown>div>*:first-child]:indent-[var(--cm-bubble-first-line-indent,0px)]", Z = ({ text: t, contentRef: i, styles: l, actions: d, hasAlwaysVisibleActions: f, isStreaming: p, attachments: m, beforeContent: h, responseFormat: g, afterContent: _, hasThinkingPlaceholder: v = !0, starters: b, onSelectStarter: x, deploymentIconUrl: S, deploymentDisplayName: C, markdownComponents: w, markdownClassNames: T, markdownUrlTransform: E, onAttachmentClick: D, onDownloadAll: O, onAttachmentRetry: k, codeBlockTheme: A, tableOnOpenInCanvas: j, labels: M, selectedAttachmentId: te }) => {
222
+ let { colors: N, typography: ne, className: re, bubbleClassName: P } = l ?? {}, { attachmentClickLabel: L, attachmentRetryLabel: z, attachmentOpenInNewTabLabel: V, startersAriaLabel: H = "Quick reply buttons", thinkingLabel: U, codeBlockCopyLabel: W, codeBlockCopiedLabel: G, tableCopyLabel: K, tableCopiedLabel: q, tableDownloadCsvLabel: J, tableOpenInCanvasLabel: Y, tableDownloadFilename: Z, tableScrollRegionAriaLabel: Q, assistantMessageAriaLabel: $ = "Assistant message", deploymentIconFallbackLabel: se = "AI" } = M ?? {}, ce = ee(() => ({
205
223
  copyLabel: K,
206
224
  copiedLabel: q,
207
225
  downloadCsvLabel: J,
@@ -212,16 +230,16 @@ var R = {
212
230
  J,
213
231
  Y
214
232
  ]), le = p ? (m ?? []).filter((t) => t.type !== e.Audio) : m ?? [], { slotRef: ue, firstLineIndent: de } = B(h != null && !!t), fe = s({
215
- "--cm-bubble-text": M?.text,
216
- "--cm-starters-divider": M?.startersDivider,
233
+ "--cm-bubble-text": N?.text,
234
+ "--cm-starters-divider": N?.startersDivider,
217
235
  "--cm-bubble-first-line-indent": de
218
- }), pe = c(X.text, re?.fontClassName), me = !!(S || C);
236
+ }), pe = c(X.text, ne?.fontClassName), me = !!(S || C);
219
237
  return /* @__PURE__ */ I("div", {
220
238
  role: "group",
221
239
  "aria-label": $,
222
240
  style: fe,
223
241
  onCopy: ie,
224
- className: c("flex w-full items-start gap-3", N),
242
+ className: c("flex w-full items-start gap-3", re),
225
243
  children: [me && /* @__PURE__ */ F(n, {
226
244
  src: S,
227
245
  size: 28,
@@ -252,30 +270,30 @@ var R = {
252
270
  isPlainText: g === o.PlainText,
253
271
  isStreaming: p,
254
272
  thinkingLabel: U,
255
- components: T,
256
- classNames: E,
257
- urlTransform: D,
273
+ components: w,
274
+ classNames: T,
275
+ urlTransform: E,
258
276
  codeBlockCopyLabel: W,
259
277
  codeBlockCopiedLabel: G,
260
- codeBlockTheme: j,
278
+ codeBlockTheme: A,
261
279
  tableActionLabels: ce,
262
280
  tableDownloadFilename: Z,
263
- tableOnOpenInCanvas: ee,
281
+ tableOnOpenInCanvas: j,
264
282
  tableScrollRegionAriaLabel: Q
265
283
  })
266
284
  })]
267
285
  }),
268
286
  /* @__PURE__ */ F(u, {
269
287
  attachments: le,
270
- onAttachmentClick: (e) => O?.(m?.find((t) => t.id === e)),
271
- onDownloadAll: k,
272
- onRetry: A,
288
+ onAttachmentClick: (e) => D?.(m?.find((t) => t.id === e)),
289
+ onDownloadAll: O,
290
+ onRetry: k,
273
291
  labels: {
274
292
  clickLabel: L,
275
293
  retryLabel: z,
276
294
  openInNewTabLabel: V
277
295
  },
278
- selectedAttachmentId: ne
296
+ selectedAttachmentId: te
279
297
  }),
280
298
  _,
281
299
  /* @__PURE__ */ F(ae, {
@@ -311,7 +329,7 @@ var R = {
311
329
  }), $ = /* @__PURE__ */ function(e) {
312
330
  return e.Bottom = "Bottom", e.Top = "Top", e;
313
331
  }({}), se = 10, ce = ({ text: e, contentRef: t, position: n = $.Bottom, styles: r, actions: i, hasAlwaysVisibleActions: o, attachments: d, collapsedLineCount: f = se, labels: m, textSegments: g, onAttachmentClick: _, onDownloadAll: y, onAttachmentRetry: b, selectedAttachmentId: x }) => {
314
- let { colors: C, typography: w, className: T, bubbleClassName: E } = r ?? {}, { showMoreLabel: D = "Show more", showLessLabel: A = "Show less", showMoreAriaLabel: j, showLessAriaLabel: ee, attachmentClickLabel: te, attachmentRetryLabel: ne, attachmentOpenInNewTabLabel: M, userMessageAriaLabel: re = "User message" } = m ?? {}, { textRef: N, isTextCollapsed: L, isOverflowing: z, collapsedMaxHeight: B, expandedMaxHeight: V, isCollapsed: H, toggleCollapsed: U } = l({
332
+ let { colors: C, typography: ee, className: w, bubbleClassName: T } = r ?? {}, { showMoreLabel: E = "Show more", showLessLabel: k = "Show less", showMoreAriaLabel: A, showLessAriaLabel: j, attachmentClickLabel: M, attachmentRetryLabel: te, attachmentOpenInNewTabLabel: N, userMessageAriaLabel: ne = "User message" } = m ?? {}, { textRef: re, isTextCollapsed: L, isOverflowing: z, collapsedMaxHeight: B, expandedMaxHeight: V, isCollapsed: H, toggleCollapsed: U } = l({
315
333
  text: e ?? "",
316
334
  collapsedLineCount: f
317
335
  }), W = s({
@@ -321,13 +339,13 @@ var R = {
321
339
  "--cm-bubble-text": C?.text,
322
340
  "--cm-bubble-collapsed-height": z ? `${B}px` : void 0,
323
341
  "--cm-bubble-expanded-height": z ? `${V}px` : void 0
324
- }), G = n === $.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", K = c(X.text, w?.fontClassName), q = j ?? D, J = ee ?? A, Y = H ? D : A, oe = H ? q : J, Z = H ? O : k, Q = S();
342
+ }), G = n === $.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", K = c(X.text, ee?.fontClassName), q = A ?? E, J = j ?? k, Y = H ? E : k, oe = H ? q : J, Z = H ? D : O, Q = S();
325
343
  return /* @__PURE__ */ F("div", {
326
344
  role: "group",
327
- "aria-label": re,
345
+ "aria-label": ne,
328
346
  style: W,
329
347
  onCopy: ie,
330
- className: c("flex w-full", T),
348
+ className: c("flex w-full", w),
331
349
  children: /* @__PURE__ */ I("div", {
332
350
  className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
333
351
  children: [
@@ -337,15 +355,15 @@ var R = {
337
355
  onDownloadAll: y,
338
356
  onRetry: b,
339
357
  labels: {
340
- clickLabel: te,
341
- retryLabel: ne,
342
- openInNewTabLabel: M
358
+ clickLabel: M,
359
+ retryLabel: te,
360
+ openInNewTabLabel: N
343
361
  },
344
362
  styles: { className: "max-w-[640px]" },
345
363
  selectedAttachmentId: x
346
364
  }),
347
365
  e && /* @__PURE__ */ F("div", {
348
- className: c(X.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", G, E, R.userBubble),
366
+ className: c(X.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", G, T, R.userBubble),
349
367
  children: /* @__PURE__ */ I("div", {
350
368
  className: "flex min-w-0 flex-col items-start",
351
369
  children: [/* @__PURE__ */ F("div", {
@@ -353,7 +371,7 @@ var R = {
353
371
  ref: t,
354
372
  className: c("relative -me-1 -ms-1 w-[calc(100%+8px)] overflow-hidden pe-1 ps-1", z && X.collapsibleText, z && !H && X.expandedText, L && X.collapsedText),
355
373
  children: /* @__PURE__ */ F("p", {
356
- ref: N,
374
+ ref: re,
357
375
  className: c(K, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
358
376
  children: g ?? e
359
377
  })
@@ -399,7 +417,7 @@ var R = {
399
417
  "--cm-reply-background": l?.background,
400
418
  "--cm-reply-hover-background": l?.hoverBackground,
401
419
  "--cm-reply-text": l?.text
402
- }), [b, x] = E({
420
+ }), [b, x] = T({
403
421
  x: 0,
404
422
  y: 0
405
423
  });
@@ -432,7 +450,7 @@ var R = {
432
450
  onClick: n,
433
451
  textClassName: _,
434
452
  className: c(ue.button, "h-8 min-h-8 min-w-11 px-2 shadow-lg mobile:h-11 mobile:min-h-11", g),
435
- iconAfter: /* @__PURE__ */ F(D, {
453
+ iconAfter: /* @__PURE__ */ F(E, {
436
454
  size: 16,
437
455
  stroke: m,
438
456
  "aria-hidden": "true",
@@ -7,8 +7,10 @@ export interface MessageActionTooltips {
7
7
  delete?: string;
8
8
  /** Tooltip for the Regenerate button. */
9
9
  regenerate?: string;
10
- /** Tooltip for the Copy button in its default state. */
10
+ /** Tooltip for the assistant Copy button in its default state. */
11
11
  copy?: string;
12
+ /** Tooltip for the user-message Copy button in its default state. */
13
+ copyMessage?: string;
12
14
  /** Tooltip shown on the Copy button immediately after copying. */
13
15
  copied?: string;
14
16
  /** Tooltip for the Copy as Markdown button in its default state. */
@@ -28,8 +30,10 @@ export interface MessageActionAriaLabels {
28
30
  deleteMessage?: string;
29
31
  /** aria-label for the Regenerate button. */
30
32
  regenerateResponse?: string;
31
- /** aria-label for the Copy button. */
33
+ /** aria-label for the assistant Copy button. */
32
34
  copyResponse?: string;
35
+ /** aria-label for the user-message Copy button. */
36
+ copyMessage?: string;
33
37
  /** aria-label for the Copy as Markdown button. */
34
38
  copyAsMarkdown?: string;
35
39
  /** aria-label for the Like button. */
@@ -40,6 +44,8 @@ export interface MessageActionAriaLabels {
40
44
  actionsGroup?: string;
41
45
  /** Announced after copying the response text. */
42
46
  copiedStatus?: string;
47
+ /** Announced after copying a user message. */
48
+ copiedMessageStatus?: string;
43
49
  /** Announced after copying the response as Markdown. */
44
50
  copiedMarkdownStatus?: string;
45
51
  }
@@ -57,7 +63,7 @@ export interface MessageActionColors {
57
63
  }
58
64
  /** Props for the `MessageActions` component. */
59
65
  export interface MessageActionsProps {
60
- /** Which actions are shown. `'User'` = Edit/Delete; `'Agent'` = Regenerate/Copy/Like/Dislike. Defaults to `'User'`. */
66
+ /** Which actions are shown. `'User'` = Copy/Edit/Delete; `'Agent'` = Regenerate/Copy/Like/Dislike. Defaults to `'User'`. */
61
67
  role?: MessageRole;
62
68
  /** Extra class(es) on the root element. */
63
69
  className?: string;
@@ -75,7 +81,7 @@ export interface MessageActionsProps {
75
81
  onDelete?: () => void;
76
82
  /** Fires on Regenerate click. Agent role only. */
77
83
  onRegenerate?: () => void;
78
- /** Fires on Copy click. Agent role only. */
84
+ /** Fires on Copy click. Both roles; the label set depends on `role`. */
79
85
  onCopy?: () => void;
80
86
  /** Fires on Copy Markdown click. Agent role only. */
81
87
  onCopyMarkdown?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"message-actions.d.ts","sourceRoot":"","sources":["../../src/models/message-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAEvE,+FAA+F;AAC/F,MAAM,WAAW,qBAAqB;IACpC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,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,EAAE,mBAAmB,CAAC;IAC7B,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,uBAAuB;IACvB,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B"}
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.2.0-dev.268",
4
+ "version": "1.2.0-dev.270",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -19,12 +19,12 @@
19
19
  "dependencies": {
20
20
  "@tabler/icons-react": "^3.44.0",
21
21
  "react-markdown": "^10.1.0",
22
- "@epam/ai-dial-attachment-input": "1.2.0-dev.268"
22
+ "@epam/ai-dial-attachment-input": "1.2.0-dev.270"
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.2.0-dev.268",
27
+ "@epam/ai-dial-chat-shared": "1.2.0-dev.270",
28
28
  "@epam/ai-dial-ui-kit": "^0.15.0-dev.36"
29
29
  },
30
30
  "repository": {