@epam/ai-dial-conversation-messages 1.2.0-dev.21 → 1.2.0-dev.213
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/MessageBubble/AssistantMessageBubble.d.ts.map +1 -1
- package/components/MessageBubble/MessageBubble.d.ts.map +1 -1
- package/components/MessageBubble/UserMessageBubble.d.ts.map +1 -1
- package/components/MessageSelectionReply/MessageSelectionReply.d.ts +55 -0
- package/components/MessageSelectionReply/MessageSelectionReply.d.ts.map +1 -0
- package/constants/public-class-names.d.ts +7 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/index.css +2 -2
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -1
- package/index.js +334 -229
- package/models/message-bubble.d.ts +36 -20
- package/models/message-bubble.d.ts.map +1 -1
- package/package.json +5 -4
- package/utils/clipboard.d.ts +11 -0
- package/utils/clipboard.d.ts.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/AssistantMessageBubble.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssistantMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/AssistantMessageBubble.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAGpC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAa/E,gHAAgH;AAChH,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAuNlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/MessageBubble.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAKtE,wGAAwG;AACxG,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"MessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/MessageBubble.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAKtE,wGAAwG;AACxG,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAyChD,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;
|
|
1
|
+
{"version":3,"file":"UserMessageBubble.d.ts","sourceRoot":"","sources":["../../../src/components/MessageBubble/UserMessageBubble.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,EAAE,EAAS,MAAM,OAAO,CAAC;AAElC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAQ1E,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAgKxD,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { FC, RefObject } from 'react';
|
|
2
|
+
/** Color overrides for the Reply action. */
|
|
3
|
+
export interface MessageSelectionReplyColors {
|
|
4
|
+
/** Button background. Falls back to `--bg-layer-raised`. */
|
|
5
|
+
background?: string;
|
|
6
|
+
/** Hover background. Falls back to `--bg-layer-base`. */
|
|
7
|
+
hoverBackground?: string;
|
|
8
|
+
/** Label and icon color. Falls back to `--text-primary`. */
|
|
9
|
+
text?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Typography overrides for the Reply action. */
|
|
12
|
+
export interface MessageSelectionReplyTypography {
|
|
13
|
+
/** Button label class. Defaults to `'dial-small-text'`. */
|
|
14
|
+
fontClassName?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Appearance overrides for the Reply action. */
|
|
17
|
+
export interface MessageSelectionReplyStyles {
|
|
18
|
+
/** Button colors, applied as CSS custom properties. */
|
|
19
|
+
colors?: MessageSelectionReplyColors;
|
|
20
|
+
/** Button label typography. */
|
|
21
|
+
typography?: MessageSelectionReplyTypography;
|
|
22
|
+
/** Extra classes on the floating root, for example a host stacking level. */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Extra classes on the button. */
|
|
25
|
+
buttonClassName?: string;
|
|
26
|
+
}
|
|
27
|
+
/** Localized strings rendered by {@link MessageSelectionReply}. */
|
|
28
|
+
export interface MessageSelectionReplyLabels {
|
|
29
|
+
/** Visible and accessible Reply action label. */
|
|
30
|
+
reply: string;
|
|
31
|
+
/** Polite announcement when a selection becomes actionable. */
|
|
32
|
+
selectionAvailable: string;
|
|
33
|
+
/** Polite announcement after the composer accepts a Reply attachment. */
|
|
34
|
+
attachmentAdded: string;
|
|
35
|
+
}
|
|
36
|
+
/** Props accepted by {@link MessageSelectionReply}. */
|
|
37
|
+
export interface MessageSelectionReplyProps {
|
|
38
|
+
/** Visible selection rectangle. Omit to unmount the action. */
|
|
39
|
+
rect: DOMRect | undefined;
|
|
40
|
+
/** Receives the floating action root. */
|
|
41
|
+
actionRef: RefObject<HTMLDivElement | null>;
|
|
42
|
+
/** Creates an attachment from the captured selection. */
|
|
43
|
+
onReply: () => void;
|
|
44
|
+
/** Increments after the composer accepts a Reply attachment. */
|
|
45
|
+
addedRevision: number;
|
|
46
|
+
/** Localized button and announcement strings. */
|
|
47
|
+
labels: MessageSelectionReplyLabels;
|
|
48
|
+
/** Appearance overrides for the floating action. */
|
|
49
|
+
styles?: MessageSelectionReplyStyles;
|
|
50
|
+
/** Same-document portal destination. Defaults to `document.body`; null defers rendering. */
|
|
51
|
+
portalContainer?: HTMLElement | null;
|
|
52
|
+
}
|
|
53
|
+
/** Offers Reply beside a native selection while leaving browser selection controls intact. */
|
|
54
|
+
export declare const MessageSelectionReply: FC<MessageSelectionReplyProps>;
|
|
55
|
+
//# sourceMappingURL=MessageSelectionReply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageSelectionReply.d.ts","sourceRoot":"","sources":["../../../src/components/MessageSelectionReply/MessageSelectionReply.tsx"],"names":[],"mappings":"AAQA,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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const CONVERSATION_MESSAGES_CLASS: {
|
|
2
|
+
/** The user message's bubble element. */
|
|
3
|
+
readonly userBubble: "dial-cm-user-bubble";
|
|
4
|
+
/** The assistant message's streamed content region. */
|
|
5
|
+
readonly assistantContent: "dial-cm-assistant-content";
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=public-class-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,2BAA2B;IACtC,yCAAyC;;IAEzC,uDAAuD;;CAE/C,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
._activeRating_ygoee_1{color:var(--ma-active-rating-text,var(--text-accent,#1d4ed8))}._userBubble_cq829_1{border-color:var(--cm-bubble-user-border,var(--stroke-secondary,#d1dbea));background:var(--cm-bubble-user-bg,var(--bg-layer-sunken,#eef1f7))}._collapsibleText_cq829_6{max-height:var(--cm-bubble-collapsed-height);transition:max-height .2s ease-out}._expandedText_cq829_11{max-height:var(--cm-bubble-expanded-height)}._collapsedText_cq829_15:after{content:"";pointer-events:none;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;left:0;right:0}@media (prefers-reduced-motion:reduce){._collapsibleText_cq829_6{transition:none}}._startersDivider_cq829_26{border-color:var(--cm-starters-divider,var(--stroke-secondary,#d1dbea))}._text_cq829_30{color:var(--cm-bubble-text,var(--text-primary,#161b2d))}
|
|
2
|
-
/*$vite$:1
|
|
1
|
+
._activeRating_ygoee_1{color:var(--ma-active-rating-text,var(--text-accent,#1d4ed8))}._userBubble_cq829_1{border-color:var(--cm-bubble-user-border,var(--stroke-secondary,#d1dbea));background:var(--cm-bubble-user-bg,var(--bg-layer-sunken,#eef1f7))}._collapsibleText_cq829_6{max-height:var(--cm-bubble-collapsed-height);transition:max-height .2s ease-out}._expandedText_cq829_11{max-height:var(--cm-bubble-expanded-height)}._collapsedText_cq829_15:after{content:"";pointer-events:none;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;left:0;right:0}@media (prefers-reduced-motion:reduce){._collapsibleText_cq829_6{transition:none}}._startersDivider_cq829_26{border-color:var(--cm-starters-divider,var(--stroke-secondary,#d1dbea))}._text_cq829_30{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
|
+
/*$vite$:1*/.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.start-0{inset-inline-start:0}.top-0{top:0}.z-50{z-index:50}.-me-1{margin-inline-end:-.25rem}.-ms-1{margin-inline-start:-.25rem}.ms-auto{margin-inline-start:auto}.mt-3{margin-top:.75rem}.block{display:block}.inline{display:inline}.flex{display:flex}.table{display:table}.h-8{height:2rem}.min-h-8{min-height:2rem}.w-\[calc\(100\%\+8px\)\]{width:calc(100% + 8px)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-0{min-width:0}.min-w-11{min-width:2.75rem}.min-w-\[40px\]{min-width:40px}.max-w-\[640px\]{max-width:640px}.max-w-\[calc\(100vw-16px\)\]{max-width:calc(100vw - 16px)}.max-w-full{max-width:100%}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.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}.overflow-hidden{overflow:hidden}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-ee-2xl{border-end-end-radius:1rem}.rounded-ee-md{border-end-end-radius:.375rem}.rounded-es-2xl{border-end-start-radius:1rem}.rounded-se-2xl{border-start-end-radius:1rem}.rounded-se-md{border-start-end-radius:.375rem}.rounded-ss-2xl{border-start-start-radius:1rem}.border{border-width:1px}.border-t{border-top-width:1px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-4{padding-bottom:1rem;padding-top:1rem}.pe-1{padding-inline-end:.25rem}.ps-1{padding-inline-start:.25rem}.pt-5{padding-top:1.25rem}.text-start{text-align:start}.opacity-0{opacity:0}.shadow-lg{--tw-shadow:0 8px 44px 0 var(--shadow-lg,#2764d914);--tw-shadow-colored:0 8px 44px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}.group:hover .group-hover\:opacity-100{opacity:1}@media (max-width:1279px){.mobile\:h-11{height:2.75rem}.mobile\:min-h-11{min-height:2.75rem}}.rtl\:scale-x-\[-1\]:where([dir=rtl],[dir=rtl] *){--tw-scale-x:-1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>\.cm-bubble-markdown\>div\>\*\:first-child\]\:indent-\[var\(--cm-bubble-first-line-indent\2c 0px\)\]>.cm-bubble-markdown>div>:first-child{text-indent:var(--cm-bubble-first-line-indent,0)}
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
export { CONVERSATION_MESSAGES_CLASS } from './constants/public-class-names';
|
|
1
2
|
export { MessageBubble } from './components/MessageBubble/MessageBubble';
|
|
2
3
|
export { UserMessageBubble } from './components/MessageBubble/UserMessageBubble';
|
|
3
4
|
export { AssistantMessageBubble } from './components/MessageBubble/AssistantMessageBubble';
|
|
4
5
|
export { StatusMessageBubble } from './components/MessageBubble/StatusMessageBubble';
|
|
5
6
|
export { MessageActions } from './components/MessageActions/MessageActions';
|
|
7
|
+
export { MessageSelectionReply } from './components/MessageSelectionReply/MessageSelectionReply';
|
|
6
8
|
export { BubblePosition } from './types/bubble-position';
|
|
7
9
|
export type { MessageBubbleProps, UserMessageBubbleProps, AssistantMessageBubbleProps, MessageBubbleStyles, MessageBubbleColors, MessageBubbleTypography, MessageBubbleLabels, AssistantMessageBubbleLabels, } from './models/message-bubble';
|
|
10
|
+
export type { MessageSelectionReplyColors, MessageSelectionReplyLabels, MessageSelectionReplyProps, MessageSelectionReplyStyles, MessageSelectionReplyTypography, } from './components/MessageSelectionReply/MessageSelectionReply';
|
|
8
11
|
export type { StatusMessageBubbleLabels, StatusMessageBubbleProps, } from './components/MessageBubble/StatusMessageBubble';
|
|
9
12
|
export type { MessageActionsProps, MessageActionColors, MessageActionLabels, MessageActionTooltips, MessageActionAriaLabels, } from './models/message-actions';
|
|
10
13
|
export type { MessageSourceProps, MessageSourceLabels, MessageSourceStyles, MessageSourceColors, MessageSourceTypography, } from './models/message-source';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,gDAAgD,CAAC;AACxD,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,0DAA0D,CAAC;AAClE,YAAY,EACV,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,gDAAgD,CAAC;AACxD,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { AttachmentType as e, CopyIconButton as t, DeploymentIcon as n, MDMessageViewer as r, MessageRating as i, MessageRole as a,
|
|
2
|
-
import { AttachmentGroup as
|
|
3
|
-
import { DIAL_ICON_SIZE as
|
|
4
|
-
import { useCallback as
|
|
5
|
-
import { IconChevronDown as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
import { AttachmentGroup as u } from "@epam/ai-dial-attachment-input";
|
|
3
|
+
import { Button as d, ButtonVariant as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, ElementSize as h, InfoMessageNotification as g, LinkButton as _, NeutralButton as v, ToggleIconButton as y } from "@epam/ai-dial-ui-kit";
|
|
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 te, IconRefresh as ne, IconThumbDown as A, IconThumbDownFilled as j, IconThumbUp as M, IconThumbUpFilled as N, IconTrashX as P } from "@tabler/icons-react";
|
|
6
|
+
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
7
|
+
import { createPortal as R } from "react-dom";
|
|
8
|
+
//#region src/constants/public-class-names.ts
|
|
9
|
+
var z = {
|
|
10
|
+
userBubble: "dial-cm-user-bubble",
|
|
11
|
+
assistantContent: "dial-cm-assistant-content"
|
|
12
|
+
}, B = 4, V = (e) => {
|
|
13
|
+
let t = w(null), [n, r] = T(0);
|
|
14
|
+
return x(() => {
|
|
11
15
|
if (!e) return;
|
|
12
16
|
let n = t.current;
|
|
13
17
|
if (n == null) return;
|
|
@@ -18,328 +22,429 @@ var I = 4, L = (e) => {
|
|
|
18
22
|
return i.observe(n), () => i.disconnect();
|
|
19
23
|
}, [e]), {
|
|
20
24
|
slotRef: t,
|
|
21
|
-
firstLineIndent: e ? `calc(${n}px + ${
|
|
25
|
+
firstLineIndent: e ? `calc(${n}px + ${B}px)` : void 0
|
|
22
26
|
};
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
}, H = [
|
|
28
|
+
"href",
|
|
29
|
+
"src",
|
|
30
|
+
"alt",
|
|
31
|
+
"colspan",
|
|
32
|
+
"rowspan",
|
|
33
|
+
"start"
|
|
34
|
+
], U = new Set([
|
|
35
|
+
"pre",
|
|
36
|
+
"pre-wrap",
|
|
37
|
+
"pre-line",
|
|
38
|
+
"break-spaces"
|
|
39
|
+
]), W = (e) => {
|
|
40
|
+
let t = document.createElement(e.tagName.toLowerCase());
|
|
41
|
+
H.forEach((n) => {
|
|
42
|
+
let r = e.getAttribute(n);
|
|
43
|
+
r !== null && t.setAttribute(n, r);
|
|
44
|
+
});
|
|
45
|
+
let { whiteSpace: n } = window.getComputedStyle(e);
|
|
46
|
+
return U.has(n) && (t.style.whiteSpace = "pre-wrap"), t;
|
|
47
|
+
}, re = (e) => e instanceof SVGElement || window.getComputedStyle(e).display === "none", G = (e, t) => {
|
|
48
|
+
if (!t.intersectsNode(e)) return null;
|
|
49
|
+
if (e.nodeType === Node.TEXT_NODE) {
|
|
50
|
+
let n = e.data, r = e === t.startContainer ? t.startOffset : 0, i = e === t.endContainer ? t.endOffset : n.length;
|
|
51
|
+
return document.createTextNode(n.slice(r, i));
|
|
52
|
+
}
|
|
53
|
+
if (!(e instanceof Element) || re(e)) return null;
|
|
54
|
+
let n = W(e);
|
|
55
|
+
return e.childNodes.forEach((e) => {
|
|
56
|
+
let r = G(e, t);
|
|
57
|
+
r && n.appendChild(r);
|
|
58
|
+
}), n;
|
|
59
|
+
}, K = (e, t, n) => {
|
|
60
|
+
let r = e, i = t;
|
|
61
|
+
for (; i && i !== n && n.contains(i);) {
|
|
62
|
+
let e = W(i);
|
|
63
|
+
e.appendChild(r), r = e, i = i.parentElement;
|
|
64
|
+
}
|
|
65
|
+
return r;
|
|
66
|
+
}, q = (e, t) => {
|
|
67
|
+
let n = e.commonAncestorContainer, r = n instanceof Element ? n : n.parentElement;
|
|
68
|
+
if (!r) return null;
|
|
69
|
+
let i = G(r, e);
|
|
70
|
+
return i ? K(i, r.parentElement, t) : null;
|
|
71
|
+
}, ie = (e) => {
|
|
72
|
+
let t = window.getSelection();
|
|
73
|
+
if (!t || t.isCollapsed || t.rangeCount === 0 || !e.clipboardData) return;
|
|
74
|
+
let n = t.toString();
|
|
75
|
+
if (!n) return;
|
|
76
|
+
let r = document.createElement("div");
|
|
77
|
+
for (let n = 0; n < t.rangeCount; n++) {
|
|
78
|
+
let i = q(t.getRangeAt(n), e.currentTarget);
|
|
79
|
+
i && r.appendChild(i);
|
|
80
|
+
}
|
|
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: g, activeRating: _, isAlwaysVisible: v, isDisabled: x = !1, className: S, labels: C, colors: ee }) => {
|
|
83
|
+
let { tooltips: w, ariaLabels: E } = C ?? {}, [D, O] = T(null), [R, z] = T(""), B = n != null || o != null || l != null || u != null || d != null || f != null || g != null, V = s({ "--ma-active-rating-text": ee?.activeRatingText }), H = b(() => {
|
|
84
|
+
u?.(), O("copy"), z(E?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => O(null), Y);
|
|
85
|
+
}, [u, E?.copiedStatus]), U = b(() => {
|
|
86
|
+
d?.(), O("markdown"), z(E?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => O(null), Y);
|
|
87
|
+
}, [d, E?.copiedMarkdownStatus]);
|
|
88
|
+
return B ? /* @__PURE__ */ L("div", {
|
|
30
89
|
role: "toolbar",
|
|
31
|
-
"aria-label":
|
|
32
|
-
style:
|
|
33
|
-
className:
|
|
34
|
-
children: [/* @__PURE__ */
|
|
90
|
+
"aria-label": E?.actionsGroup ?? "Message actions",
|
|
91
|
+
style: V,
|
|
92
|
+
className: c("flex gap-1", !v && "opacity-0 group-hover:opacity-100", S),
|
|
93
|
+
children: [/* @__PURE__ */ I("span", {
|
|
35
94
|
role: "status",
|
|
36
95
|
"aria-live": "polite",
|
|
37
96
|
className: "sr-only",
|
|
38
|
-
children:
|
|
39
|
-
}), e === a.User ? /* @__PURE__ */ F
|
|
40
|
-
icon: /* @__PURE__ */
|
|
41
|
-
size:
|
|
97
|
+
children: R
|
|
98
|
+
}), e === a.User ? /* @__PURE__ */ L(F, { children: [n && /* @__PURE__ */ I(y, {
|
|
99
|
+
icon: /* @__PURE__ */ I(te, {
|
|
100
|
+
size: p.SM,
|
|
42
101
|
"aria-hidden": !0,
|
|
43
|
-
stroke:
|
|
102
|
+
stroke: m
|
|
44
103
|
}),
|
|
45
|
-
size:
|
|
46
|
-
"aria-label":
|
|
47
|
-
tooltipProps: { tooltip:
|
|
104
|
+
size: h.Small,
|
|
105
|
+
"aria-label": E?.editMessage ?? "Edit message",
|
|
106
|
+
tooltipProps: { tooltip: w?.edit ?? "Edit" },
|
|
48
107
|
onClick: n,
|
|
49
108
|
onMouseEnter: r,
|
|
50
109
|
onFocus: r,
|
|
51
110
|
disabled: x
|
|
52
|
-
}),
|
|
53
|
-
icon: /* @__PURE__ */ P
|
|
54
|
-
size:
|
|
111
|
+
}), o && /* @__PURE__ */ I(y, {
|
|
112
|
+
icon: /* @__PURE__ */ I(P, {
|
|
113
|
+
size: p.SM,
|
|
55
114
|
"aria-hidden": !0,
|
|
56
|
-
stroke:
|
|
115
|
+
stroke: m
|
|
57
116
|
}),
|
|
58
|
-
size:
|
|
59
|
-
"aria-label":
|
|
60
|
-
tooltipProps: { tooltip:
|
|
61
|
-
onClick:
|
|
117
|
+
size: h.Small,
|
|
118
|
+
"aria-label": E?.deleteMessage ?? "Delete message",
|
|
119
|
+
tooltipProps: { tooltip: w?.delete ?? "Delete" },
|
|
120
|
+
onClick: o,
|
|
62
121
|
disabled: x
|
|
63
|
-
})] }) : /* @__PURE__ */ F
|
|
64
|
-
l && /* @__PURE__ */
|
|
65
|
-
icon: /* @__PURE__ */
|
|
66
|
-
size:
|
|
122
|
+
})] }) : /* @__PURE__ */ L(F, { children: [
|
|
123
|
+
l && /* @__PURE__ */ I(y, {
|
|
124
|
+
icon: /* @__PURE__ */ I(ne, {
|
|
125
|
+
size: p.SM,
|
|
67
126
|
"aria-hidden": !0,
|
|
68
|
-
stroke:
|
|
127
|
+
stroke: m
|
|
69
128
|
}),
|
|
70
|
-
size:
|
|
71
|
-
"aria-label":
|
|
72
|
-
tooltipProps: { tooltip:
|
|
129
|
+
size: h.Small,
|
|
130
|
+
"aria-label": E?.regenerateResponse ?? "Regenerate response",
|
|
131
|
+
tooltipProps: { tooltip: w?.regenerate ?? "Regenerate" },
|
|
73
132
|
onClick: l,
|
|
74
133
|
disabled: x
|
|
75
134
|
}),
|
|
76
|
-
|
|
77
|
-
iconSize:
|
|
78
|
-
onClick:
|
|
79
|
-
size:
|
|
80
|
-
isCopied:
|
|
81
|
-
copyLabel:
|
|
82
|
-
copiedLabel:
|
|
83
|
-
ariaLabel:
|
|
135
|
+
u && /* @__PURE__ */ I(t, {
|
|
136
|
+
iconSize: p.SM,
|
|
137
|
+
onClick: H,
|
|
138
|
+
size: h.Small,
|
|
139
|
+
isCopied: D === "copy",
|
|
140
|
+
copyLabel: w?.copy ?? "Copy",
|
|
141
|
+
copiedLabel: w?.copied ?? "Copied!",
|
|
142
|
+
ariaLabel: E?.copyResponse ?? "Copy response",
|
|
84
143
|
isDisabled: x
|
|
85
144
|
}),
|
|
86
|
-
|
|
87
|
-
iconSize:
|
|
88
|
-
onClick:
|
|
89
|
-
size:
|
|
90
|
-
isCopied:
|
|
91
|
-
iconCopy: /* @__PURE__ */
|
|
92
|
-
size:
|
|
145
|
+
d && /* @__PURE__ */ I(t, {
|
|
146
|
+
iconSize: p.SM,
|
|
147
|
+
onClick: U,
|
|
148
|
+
size: h.Small,
|
|
149
|
+
isCopied: D === "markdown",
|
|
150
|
+
iconCopy: /* @__PURE__ */ I(k, {
|
|
151
|
+
size: p.SM,
|
|
93
152
|
"aria-hidden": !0,
|
|
94
|
-
stroke:
|
|
153
|
+
stroke: m
|
|
95
154
|
}),
|
|
96
|
-
copyLabel:
|
|
97
|
-
copiedLabel:
|
|
98
|
-
ariaLabel:
|
|
155
|
+
copyLabel: w?.copyMarkdown ?? "Copy as Markdown",
|
|
156
|
+
copiedLabel: w?.copiedMarkdown ?? "Copied!",
|
|
157
|
+
ariaLabel: E?.copyAsMarkdown ?? "Copy as markdown",
|
|
99
158
|
isDisabled: x
|
|
100
159
|
}),
|
|
101
|
-
|
|
102
|
-
icon:
|
|
103
|
-
className:
|
|
104
|
-
size:
|
|
160
|
+
f && /* @__PURE__ */ I(y, {
|
|
161
|
+
icon: _ === i.Like ? /* @__PURE__ */ I(N, {
|
|
162
|
+
className: J.activeRating,
|
|
163
|
+
size: p.SM,
|
|
105
164
|
"aria-hidden": !0
|
|
106
|
-
}) : /* @__PURE__ */
|
|
107
|
-
size:
|
|
165
|
+
}) : /* @__PURE__ */ I(M, {
|
|
166
|
+
size: p.SM,
|
|
108
167
|
"aria-hidden": !0,
|
|
109
|
-
stroke:
|
|
168
|
+
stroke: m
|
|
110
169
|
}),
|
|
111
|
-
size:
|
|
112
|
-
"aria-label":
|
|
113
|
-
"aria-pressed":
|
|
114
|
-
tooltipProps: { tooltip:
|
|
115
|
-
onClick:
|
|
170
|
+
size: h.Small,
|
|
171
|
+
"aria-label": E?.likeResponse ?? "Like response",
|
|
172
|
+
"aria-pressed": _ === i.Like,
|
|
173
|
+
tooltipProps: { tooltip: w?.like ?? "Like" },
|
|
174
|
+
onClick: f,
|
|
116
175
|
disabled: x
|
|
117
176
|
}),
|
|
118
|
-
|
|
119
|
-
icon:
|
|
120
|
-
className:
|
|
121
|
-
size:
|
|
177
|
+
g && /* @__PURE__ */ I(y, {
|
|
178
|
+
icon: _ === i.Dislike ? /* @__PURE__ */ I(j, {
|
|
179
|
+
className: J.activeRating,
|
|
180
|
+
size: p.SM,
|
|
122
181
|
"aria-hidden": !0
|
|
123
|
-
}) : /* @__PURE__ */
|
|
124
|
-
size:
|
|
182
|
+
}) : /* @__PURE__ */ I(A, {
|
|
183
|
+
size: p.SM,
|
|
125
184
|
"aria-hidden": !0,
|
|
126
|
-
stroke:
|
|
185
|
+
stroke: m
|
|
127
186
|
}),
|
|
128
|
-
size:
|
|
129
|
-
"aria-label":
|
|
130
|
-
"aria-pressed":
|
|
131
|
-
tooltipProps: { tooltip:
|
|
132
|
-
onClick:
|
|
187
|
+
size: h.Small,
|
|
188
|
+
"aria-label": E?.dislikeResponse ?? "Dislike response",
|
|
189
|
+
"aria-pressed": _ === i.Dislike,
|
|
190
|
+
tooltipProps: { tooltip: w?.dislike ?? "Dislike" },
|
|
191
|
+
onClick: g,
|
|
133
192
|
disabled: x
|
|
134
193
|
})
|
|
135
194
|
] })]
|
|
136
195
|
}) : null;
|
|
137
|
-
},
|
|
196
|
+
}, X = {
|
|
138
197
|
userBubble: "_userBubble_cq829_1",
|
|
139
198
|
collapsibleText: "_collapsibleText_cq829_6",
|
|
140
199
|
expandedText: "_expandedText_cq829_11",
|
|
141
200
|
collapsedText: "_collapsedText_cq829_15",
|
|
142
201
|
startersDivider: "_startersDivider_cq829_26",
|
|
143
202
|
text: "_text_cq829_30"
|
|
144
|
-
},
|
|
145
|
-
let { colors: j, typography: M, className: N, bubbleClassName:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
downloadCsvLabel: Q,
|
|
151
|
-
openInCanvasLabel: $
|
|
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: _, starters: y, onSelectStarter: b, deploymentIconUrl: x, deploymentDisplayName: S, markdownComponents: C, markdownClassNames: w, markdownUrlTransform: T, onAttachmentClick: E, onDownloadAll: D, onAttachmentRetry: O, codeBlockTheme: k, tableOnOpenInCanvas: te, labels: ne, selectedAttachmentId: A }) => {
|
|
204
|
+
let { colors: j, typography: M, className: N, bubbleClassName: P } = l ?? {}, { attachmentClickLabel: F, attachmentRetryLabel: R, attachmentOpenInNewTabLabel: B, startersAriaLabel: H = "Quick reply buttons", thinkingLabel: U, codeBlockCopyLabel: W, codeBlockCopiedLabel: re, tableCopyLabel: G, tableCopiedLabel: K, tableDownloadCsvLabel: q, tableOpenInCanvasLabel: J, tableDownloadFilename: Y, tableScrollRegionAriaLabel: Z, assistantMessageAriaLabel: Q = "Assistant message", deploymentIconFallbackLabel: $ = "AI" } = ne ?? {}, se = ee(() => ({
|
|
205
|
+
copyLabel: G,
|
|
206
|
+
copiedLabel: K,
|
|
207
|
+
downloadCsvLabel: q,
|
|
208
|
+
openInCanvasLabel: J
|
|
152
209
|
}), [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
$
|
|
159
|
-
]), ae = d ? (f ?? []).filter((t) => t.type !== e.Audio) : f ?? [], { slotRef: oe, firstLineIndent: se } = L(p != null && !!t), ce = o({
|
|
210
|
+
G,
|
|
211
|
+
K,
|
|
212
|
+
q,
|
|
213
|
+
J
|
|
214
|
+
]), ce = p ? (m ?? []).filter((t) => t.type !== e.Audio) : m ?? [], { slotRef: le, firstLineIndent: ue } = V(h != null && !!t), de = s({
|
|
160
215
|
"--cm-bubble-text": j?.text,
|
|
161
216
|
"--cm-starters-divider": j?.startersDivider,
|
|
162
|
-
"--cm-bubble-first-line-indent":
|
|
163
|
-
}),
|
|
164
|
-
return /* @__PURE__ */
|
|
217
|
+
"--cm-bubble-first-line-indent": ue
|
|
218
|
+
}), fe = c(X.text, M?.fontClassName), pe = !!(x || S);
|
|
219
|
+
return /* @__PURE__ */ L("div", {
|
|
165
220
|
role: "group",
|
|
166
|
-
"aria-label":
|
|
167
|
-
style:
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
221
|
+
"aria-label": Q,
|
|
222
|
+
style: de,
|
|
223
|
+
onCopy: ie,
|
|
224
|
+
className: c("flex w-full items-start gap-3", N),
|
|
225
|
+
children: [pe && /* @__PURE__ */ I(n, {
|
|
226
|
+
src: x,
|
|
171
227
|
size: 28,
|
|
172
|
-
initialsName:
|
|
173
|
-
labels: { tooltip:
|
|
174
|
-
}), /* @__PURE__ */
|
|
228
|
+
initialsName: S || $,
|
|
229
|
+
labels: { tooltip: S ?? $ }
|
|
230
|
+
}), /* @__PURE__ */ L("div", {
|
|
175
231
|
className: "flex w-full min-w-0 max-w-full flex-col items-start gap-5",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
177
|
-
className:
|
|
232
|
+
children: [/* @__PURE__ */ L("div", {
|
|
233
|
+
className: c("flex w-full min-w-0 max-w-full flex-col items-start gap-4", P),
|
|
178
234
|
children: [
|
|
179
|
-
|
|
235
|
+
h != null && !t && /* @__PURE__ */ I("div", {
|
|
180
236
|
className: "min-w-0",
|
|
181
|
-
children:
|
|
237
|
+
children: h
|
|
182
238
|
}),
|
|
183
|
-
(t ||
|
|
239
|
+
(t || p) && /* @__PURE__ */ L("div", {
|
|
184
240
|
"aria-live": "polite",
|
|
185
241
|
"aria-atomic": "false",
|
|
186
|
-
className:
|
|
187
|
-
children: [
|
|
188
|
-
ref:
|
|
242
|
+
className: c(fe, "relative min-w-0 max-w-full text-start", h != null && t && oe, z.assistantContent),
|
|
243
|
+
children: [h != null && t && /* @__PURE__ */ I("div", {
|
|
244
|
+
ref: le,
|
|
189
245
|
className: "absolute start-0 top-0",
|
|
190
|
-
children:
|
|
191
|
-
}), /* @__PURE__ */
|
|
246
|
+
children: h
|
|
247
|
+
}), /* @__PURE__ */ I("div", {
|
|
248
|
+
ref: i,
|
|
192
249
|
className: "cm-bubble-markdown min-w-0 max-w-full",
|
|
193
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ I(r, {
|
|
194
251
|
content: t ?? "",
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
252
|
+
isPlainText: g === o.PlainText,
|
|
253
|
+
isStreaming: p,
|
|
254
|
+
thinkingLabel: U,
|
|
255
|
+
components: C,
|
|
256
|
+
classNames: w,
|
|
257
|
+
urlTransform: T,
|
|
258
|
+
codeBlockCopyLabel: W,
|
|
259
|
+
codeBlockCopiedLabel: re,
|
|
260
|
+
codeBlockTheme: k,
|
|
261
|
+
tableActionLabels: se,
|
|
262
|
+
tableDownloadFilename: Y,
|
|
263
|
+
tableOnOpenInCanvas: te,
|
|
264
|
+
tableScrollRegionAriaLabel: Z
|
|
207
265
|
})
|
|
208
266
|
})]
|
|
209
267
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
attachments:
|
|
212
|
-
onAttachmentClick: (e) =>
|
|
213
|
-
onDownloadAll:
|
|
214
|
-
onRetry:
|
|
268
|
+
/* @__PURE__ */ I(u, {
|
|
269
|
+
attachments: ce,
|
|
270
|
+
onAttachmentClick: (e) => E?.(m?.find((t) => t.id === e)),
|
|
271
|
+
onDownloadAll: D,
|
|
272
|
+
onRetry: O,
|
|
215
273
|
labels: {
|
|
216
|
-
clickLabel:
|
|
217
|
-
retryLabel:
|
|
218
|
-
openInNewTabLabel:
|
|
274
|
+
clickLabel: F,
|
|
275
|
+
retryLabel: R,
|
|
276
|
+
openInNewTabLabel: B
|
|
219
277
|
},
|
|
220
278
|
selectedAttachmentId: A
|
|
221
279
|
}),
|
|
222
|
-
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
...
|
|
225
|
-
isAlwaysVisible:
|
|
280
|
+
_,
|
|
281
|
+
/* @__PURE__ */ I(ae, {
|
|
282
|
+
...d,
|
|
283
|
+
isAlwaysVisible: f,
|
|
226
284
|
role: a.Assistant
|
|
227
285
|
})
|
|
228
286
|
]
|
|
229
|
-
}),
|
|
287
|
+
}), y && y.length > 0 && b && /* @__PURE__ */ I("div", {
|
|
230
288
|
role: "list",
|
|
231
|
-
"aria-label":
|
|
232
|
-
className:
|
|
233
|
-
children:
|
|
289
|
+
"aria-label": H,
|
|
290
|
+
className: c("flex w-full flex-wrap gap-2 border-t pt-5", X.startersDivider),
|
|
291
|
+
children: y.map((e, t) => /* @__PURE__ */ I("div", {
|
|
234
292
|
role: "listitem",
|
|
235
293
|
className: "min-w-[40px]",
|
|
236
|
-
children: /* @__PURE__ */
|
|
294
|
+
children: /* @__PURE__ */ I(v, {
|
|
237
295
|
label: e.title,
|
|
238
296
|
className: "min-w-[40px]",
|
|
239
|
-
onClick: () =>
|
|
297
|
+
onClick: () => b(e)
|
|
240
298
|
})
|
|
241
299
|
}, t))
|
|
242
300
|
})]
|
|
243
301
|
})]
|
|
244
302
|
});
|
|
245
|
-
},
|
|
303
|
+
}, Q = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ I("div", {
|
|
246
304
|
role: "status",
|
|
247
305
|
"aria-live": "polite",
|
|
248
|
-
children: /* @__PURE__ */
|
|
306
|
+
children: /* @__PURE__ */ I(g, {
|
|
249
307
|
title: e,
|
|
250
308
|
message: t,
|
|
251
309
|
textClassName: "flex-row flex-wrap gap-1"
|
|
252
310
|
})
|
|
253
|
-
}),
|
|
311
|
+
}), $ = /* @__PURE__ */ function(e) {
|
|
254
312
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
255
|
-
}({}),
|
|
256
|
-
let { colors:
|
|
313
|
+
}({}), 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: v, onDownloadAll: y, onAttachmentRetry: b, selectedAttachmentId: x }) => {
|
|
314
|
+
let { colors: C, typography: ee, className: w, bubbleClassName: T } = r ?? {}, { showMoreLabel: E = "Show more", showLessLabel: k = "Show less", showMoreAriaLabel: te, showLessAriaLabel: ne, attachmentClickLabel: A, attachmentRetryLabel: j, attachmentOpenInNewTabLabel: M, userMessageAriaLabel: N = "User message" } = m ?? {}, { textRef: P, isTextCollapsed: R, isOverflowing: B, collapsedMaxHeight: V, expandedMaxHeight: H, isCollapsed: U, toggleCollapsed: W } = l({
|
|
257
315
|
text: e ?? "",
|
|
258
|
-
collapsedLineCount:
|
|
259
|
-
}),
|
|
260
|
-
"--cm-bubble-user-bg":
|
|
261
|
-
"--cm-bubble-user-border":
|
|
262
|
-
"--cm-bubble-fade-start":
|
|
263
|
-
"--cm-bubble-text":
|
|
264
|
-
"--cm-bubble-collapsed-height":
|
|
265
|
-
"--cm-bubble-expanded-height":
|
|
266
|
-
}),
|
|
267
|
-
return /* @__PURE__ */
|
|
316
|
+
collapsedLineCount: f
|
|
317
|
+
}), re = s({
|
|
318
|
+
"--cm-bubble-user-bg": C?.userBackground,
|
|
319
|
+
"--cm-bubble-user-border": C?.userBorder,
|
|
320
|
+
"--cm-bubble-fade-start": C?.fadeStart,
|
|
321
|
+
"--cm-bubble-text": C?.text,
|
|
322
|
+
"--cm-bubble-collapsed-height": B ? `${V}px` : void 0,
|
|
323
|
+
"--cm-bubble-expanded-height": B ? `${H}px` : void 0
|
|
324
|
+
}), G = n === $.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", K = c(X.text, ee?.fontClassName), q = te ?? E, J = ne ?? k, Y = U ? E : k, oe = U ? q : J, Z = U ? D : O, Q = S();
|
|
325
|
+
return /* @__PURE__ */ I("div", {
|
|
268
326
|
role: "group",
|
|
269
|
-
"aria-label":
|
|
270
|
-
style:
|
|
271
|
-
|
|
272
|
-
|
|
327
|
+
"aria-label": N,
|
|
328
|
+
style: re,
|
|
329
|
+
onCopy: ie,
|
|
330
|
+
className: c("flex w-full", w),
|
|
331
|
+
children: /* @__PURE__ */ L("div", {
|
|
273
332
|
className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
|
|
274
333
|
children: [
|
|
275
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ I(u, {
|
|
276
335
|
attachments: d ?? [],
|
|
277
|
-
onAttachmentClick: (e) =>
|
|
278
|
-
onDownloadAll:
|
|
336
|
+
onAttachmentClick: (e) => v?.(d?.find((t) => t.id === e)),
|
|
337
|
+
onDownloadAll: y,
|
|
279
338
|
onRetry: b,
|
|
280
339
|
labels: {
|
|
281
|
-
clickLabel:
|
|
282
|
-
retryLabel:
|
|
283
|
-
openInNewTabLabel:
|
|
340
|
+
clickLabel: A,
|
|
341
|
+
retryLabel: j,
|
|
342
|
+
openInNewTabLabel: M
|
|
284
343
|
},
|
|
285
344
|
styles: { className: "max-w-[640px]" },
|
|
286
345
|
selectedAttachmentId: x
|
|
287
346
|
}),
|
|
288
|
-
|
|
289
|
-
className:
|
|
290
|
-
children: /* @__PURE__ */
|
|
347
|
+
e && /* @__PURE__ */ I("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, T, z.userBubble),
|
|
349
|
+
children: /* @__PURE__ */ L("div", {
|
|
291
350
|
className: "flex min-w-0 flex-col items-start",
|
|
292
|
-
children: [
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
className: "me-1",
|
|
301
|
-
children: g
|
|
302
|
-
}), e]
|
|
303
|
-
})
|
|
304
|
-
}),
|
|
305
|
-
g != null && !e && /* @__PURE__ */ P("div", { children: g }),
|
|
306
|
-
U && /* @__PURE__ */ P(m, {
|
|
307
|
-
label: /* @__PURE__ */ P(N, { children: te }),
|
|
308
|
-
iconBefore: /* @__PURE__ */ P(re, {
|
|
309
|
-
size: u.SM,
|
|
310
|
-
"aria-hidden": "true"
|
|
311
|
-
}),
|
|
312
|
-
"aria-label": ne,
|
|
313
|
-
"aria-expanded": !J,
|
|
314
|
-
"aria-controls": ie,
|
|
315
|
-
className: "mt-3",
|
|
316
|
-
onClick: Y,
|
|
317
|
-
size: f.Small
|
|
351
|
+
children: [/* @__PURE__ */ I("div", {
|
|
352
|
+
id: Q,
|
|
353
|
+
ref: t,
|
|
354
|
+
className: c("relative -me-1 -ms-1 w-[calc(100%+8px)] overflow-hidden pe-1 ps-1", B && X.collapsibleText, B && !U && X.expandedText, R && X.collapsedText),
|
|
355
|
+
children: /* @__PURE__ */ I("p", {
|
|
356
|
+
ref: P,
|
|
357
|
+
className: c(K, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
|
|
358
|
+
children: g ?? e
|
|
318
359
|
})
|
|
319
|
-
|
|
360
|
+
}), B && /* @__PURE__ */ I(_, {
|
|
361
|
+
label: /* @__PURE__ */ I(F, { children: Y }),
|
|
362
|
+
iconBefore: /* @__PURE__ */ I(Z, {
|
|
363
|
+
size: p.SM,
|
|
364
|
+
"aria-hidden": "true"
|
|
365
|
+
}),
|
|
366
|
+
"aria-label": oe,
|
|
367
|
+
"aria-expanded": !U,
|
|
368
|
+
"aria-controls": Q,
|
|
369
|
+
className: "mt-3",
|
|
370
|
+
onClick: W,
|
|
371
|
+
size: h.Small
|
|
372
|
+
})]
|
|
320
373
|
})
|
|
321
374
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
...
|
|
324
|
-
isAlwaysVisible:
|
|
375
|
+
/* @__PURE__ */ I(ae, {
|
|
376
|
+
...i,
|
|
377
|
+
isAlwaysVisible: o,
|
|
325
378
|
role: a.User
|
|
326
379
|
})
|
|
327
380
|
]
|
|
328
381
|
})
|
|
329
382
|
});
|
|
330
|
-
},
|
|
331
|
-
titleText:
|
|
332
|
-
bodyText:
|
|
333
|
-
} }) : e === a.User ? /* @__PURE__ */
|
|
334
|
-
...
|
|
335
|
-
|
|
336
|
-
onAttachmentClick:
|
|
337
|
-
}) : /* @__PURE__ */
|
|
338
|
-
...
|
|
383
|
+
}, le = ({ role: e, beforeContent: t, textSegments: n, onAttachmentClick: r, responseFormat: i, markdownComponents: o, markdownUrlTransform: s, ...c }) => e === a.Status ? /* @__PURE__ */ I(Q, { labels: {
|
|
384
|
+
titleText: c.labels?.statusTitleText,
|
|
385
|
+
bodyText: c.labels?.statusBodyText ?? ""
|
|
386
|
+
} }) : e === a.User ? /* @__PURE__ */ I(ce, {
|
|
387
|
+
...c,
|
|
388
|
+
textSegments: n,
|
|
389
|
+
onAttachmentClick: r
|
|
390
|
+
}) : /* @__PURE__ */ I(Z, {
|
|
391
|
+
...c,
|
|
339
392
|
beforeContent: t,
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
393
|
+
responseFormat: i,
|
|
394
|
+
markdownComponents: o,
|
|
395
|
+
markdownUrlTransform: s,
|
|
396
|
+
onAttachmentClick: r
|
|
397
|
+
}), ue = { button: "_button_tqo4d_3" }, de = ({ rect: e, actionRef: t, onReply: n, addedRevision: r, labels: i, styles: a, portalContainer: o }) => {
|
|
398
|
+
let { colors: l, typography: u, className: p, buttonClassName: g } = a ?? {}, _ = u?.fontClassName ?? "dial-small-text", v = o === void 0 ? typeof document > "u" ? null : document.body : o, y = s({
|
|
399
|
+
"--cm-reply-background": l?.background,
|
|
400
|
+
"--cm-reply-hover-background": l?.hoverBackground,
|
|
401
|
+
"--cm-reply-text": l?.text
|
|
402
|
+
}), [b, x] = T({
|
|
403
|
+
x: 0,
|
|
404
|
+
y: 0
|
|
405
|
+
});
|
|
406
|
+
return C(() => {
|
|
407
|
+
if (!e || !t.current) return;
|
|
408
|
+
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;
|
|
409
|
+
x({
|
|
410
|
+
x: Math.max(i + 8, Math.min(e.left, i + o - n.width - 8)),
|
|
411
|
+
y: Math.max(a + 8, Math.min(c, a + s - n.height - 8))
|
|
412
|
+
});
|
|
413
|
+
}, [
|
|
414
|
+
e,
|
|
415
|
+
t,
|
|
416
|
+
v,
|
|
417
|
+
p,
|
|
418
|
+
g,
|
|
419
|
+
_,
|
|
420
|
+
i.reply
|
|
421
|
+
]), v ? R(/* @__PURE__ */ L(F, { children: [e && /* @__PURE__ */ I("div", {
|
|
422
|
+
ref: t,
|
|
423
|
+
className: c("fixed left-0 top-0 z-50 max-w-[calc(100vw-16px)]", p),
|
|
424
|
+
style: {
|
|
425
|
+
...y,
|
|
426
|
+
transform: `translate(${b.x}px, ${b.y}px)`
|
|
427
|
+
},
|
|
428
|
+
children: /* @__PURE__ */ I(d, {
|
|
429
|
+
variant: f.Neutral,
|
|
430
|
+
size: h.Small,
|
|
431
|
+
label: i.reply,
|
|
432
|
+
onClick: n,
|
|
433
|
+
textClassName: _,
|
|
434
|
+
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__ */ I(E, {
|
|
436
|
+
size: 16,
|
|
437
|
+
stroke: m,
|
|
438
|
+
"aria-hidden": "true",
|
|
439
|
+
className: "rtl:scale-x-[-1]"
|
|
440
|
+
})
|
|
441
|
+
})
|
|
442
|
+
}), /* @__PURE__ */ I("div", {
|
|
443
|
+
role: "status",
|
|
444
|
+
"aria-live": "polite",
|
|
445
|
+
className: "sr-only",
|
|
446
|
+
children: e ? i.selectionAvailable : r > 0 ? /* @__PURE__ */ I("span", { children: i.attachmentAdded }, r) : null
|
|
447
|
+
})] }), v) : null;
|
|
448
|
+
};
|
|
344
449
|
//#endregion
|
|
345
|
-
export {
|
|
450
|
+
export { Z as AssistantMessageBubble, $ as BubblePosition, z as CONVERSATION_MESSAGES_CLASS, ae as MessageActions, le as MessageBubble, de as MessageSelectionReply, Q as StatusMessageBubble, ce as UserMessageBubble };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CodeBlockTheme, DisplayAttachment, MarkdownRendererClassNames, MessageRole, StarterOption } from '@epam/ai-dial-chat-shared';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { CodeBlockTheme, DisplayAttachment, MarkdownRendererClassNames, MessageRole, ResponseFormat, StarterOption } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { ReactNode, Ref } from 'react';
|
|
3
3
|
import { Components } from 'react-markdown';
|
|
4
4
|
import { BubblePosition } from '../types/bubble-position';
|
|
5
5
|
import { MessageActionsProps } from './message-actions';
|
|
@@ -67,12 +67,8 @@ export interface AssistantMessageBubbleLabels extends MessageBubbleLabels {
|
|
|
67
67
|
codeBlockCopyLabel?: string;
|
|
68
68
|
/** aria-label for the code block copy button after copying. */
|
|
69
69
|
codeBlockCopiedLabel?: string;
|
|
70
|
-
/** Label for
|
|
71
|
-
|
|
72
|
-
/** Label for copying a Markdown table as text. */
|
|
73
|
-
tableCopyTxtLabel?: string;
|
|
74
|
-
/** Label for copying a Markdown table as Markdown. */
|
|
75
|
-
tableCopyMarkdownLabel?: string;
|
|
70
|
+
/** Label for the copy action on a Markdown table (copies as Markdown format). */
|
|
71
|
+
tableCopyLabel?: string;
|
|
76
72
|
/** Status announced after a Markdown table has been copied. */
|
|
77
73
|
tableCopiedLabel?: string;
|
|
78
74
|
/** Label for downloading a Markdown table as CSV. */
|
|
@@ -88,6 +84,8 @@ export interface AssistantMessageBubbleLabels extends MessageBubbleLabels {
|
|
|
88
84
|
}
|
|
89
85
|
/** Shared props for user and assistant message bubble components. */
|
|
90
86
|
interface BaseMessageBubbleProps {
|
|
87
|
+
/** Ref to the text body, excluding attachment trays, actions and host slots. */
|
|
88
|
+
contentRef?: Ref<HTMLDivElement>;
|
|
91
89
|
/** Plain-text (or Markdown) content of the message. When absent, the bubble renders for `beforeContent` alone. */
|
|
92
90
|
text?: string;
|
|
93
91
|
/** Color and typography overrides applied as CSS custom properties. */
|
|
@@ -110,17 +108,6 @@ interface BaseMessageBubbleProps {
|
|
|
110
108
|
onAttachmentRetry?: (id: string) => void;
|
|
111
109
|
/** ID of the attachment currently open in the canvas panel, if any. Renders that tile's selected visual state. */
|
|
112
110
|
selectedAttachmentId?: string;
|
|
113
|
-
/**
|
|
114
|
-
* Content rendered at the inline-start of the message's first text line,
|
|
115
|
-
* which word-flows after it (e.g. a used-skill chip — inline-level content
|
|
116
|
-
* no taller than a text line). The user bubble renders it inline within
|
|
117
|
-
* the text; the assistant bubble overlays it on the first markdown block's
|
|
118
|
-
* first line, which indents past it. The user bubble renders for the slot
|
|
119
|
-
* alone even when `text` is empty; an assistant message with no text
|
|
120
|
-
* renders the slot on its own line — above the streaming placeholder while
|
|
121
|
-
* the first token has not arrived yet.
|
|
122
|
-
*/
|
|
123
|
-
beforeContent?: ReactNode;
|
|
124
111
|
}
|
|
125
112
|
/** Props for `UserMessageBubble`. */
|
|
126
113
|
export interface UserMessageBubbleProps extends BaseMessageBubbleProps {
|
|
@@ -128,9 +115,38 @@ export interface UserMessageBubbleProps extends BaseMessageBubbleProps {
|
|
|
128
115
|
position?: BubblePosition;
|
|
129
116
|
/** Maximum number of text lines shown while a long user message is collapsed. Defaults to `10`. */
|
|
130
117
|
collapsedLineCount?: number;
|
|
118
|
+
/**
|
|
119
|
+
* Ordered content replacing the plain-text render when present —
|
|
120
|
+
* interleaved plain-text runs and inline elements (e.g. skill-mention
|
|
121
|
+
* chips at their text position), rendered in place of `text` inside the
|
|
122
|
+
* same paragraph. `text` is still required alongside this: it remains the
|
|
123
|
+
* identity/measurement input for the collapse-height calculation
|
|
124
|
+
* (`useCollapsedText`), even though `textSegments` is what's visually
|
|
125
|
+
* rendered. Absent renders `text` directly, byte-identical to today.
|
|
126
|
+
*/
|
|
127
|
+
textSegments?: ReactNode[];
|
|
131
128
|
}
|
|
132
129
|
/** Props for `AssistantMessageBubble`. */
|
|
133
130
|
export interface AssistantMessageBubbleProps extends BaseMessageBubbleProps {
|
|
131
|
+
/**
|
|
132
|
+
* Conversation response format. `ResponseFormat.PlainText` renders the
|
|
133
|
+
* message body verbatim — no Markdown pipeline, so a table, a heading, or
|
|
134
|
+
* `**bold**` reaches the reader exactly as the model wrote it — and the
|
|
135
|
+
* markdown-only props below stop applying. Defaults to
|
|
136
|
+
* `ResponseFormat.Markdown`.
|
|
137
|
+
*/
|
|
138
|
+
responseFormat?: ResponseFormat;
|
|
139
|
+
/**
|
|
140
|
+
* Content rendered at the inline-start of the message's first markdown
|
|
141
|
+
* block's first line, which word-flows after it (e.g. used-skill chips —
|
|
142
|
+
* inline-level content no taller than a text line). Overlaid on the first
|
|
143
|
+
* line, which indents past it; an assistant message with no text renders
|
|
144
|
+
* the slot on its own line — above the streaming placeholder while the
|
|
145
|
+
* first token has not arrived yet. May itself be an array of elements
|
|
146
|
+
* (e.g. one `ChatSkill` per mention) — React renders `ReactNode[]` as a
|
|
147
|
+
* sibling sequence with no extra wrapper needed.
|
|
148
|
+
*/
|
|
149
|
+
beforeContent?: ReactNode;
|
|
134
150
|
/** react-markdown component overrides. Use to inject custom renderers (e.g. citation markers) into markdown elements. */
|
|
135
151
|
markdownComponents?: Components;
|
|
136
152
|
/** Per-element markdown typography classes. Defaults to the renderer's full-size scale; pass `COMPACT_MARKDOWN_CLASS_NAMES` for the smaller body scale. */
|
|
@@ -159,7 +175,7 @@ export interface AssistantMessageBubbleProps extends BaseMessageBubbleProps {
|
|
|
159
175
|
labels?: AssistantMessageBubbleLabels;
|
|
160
176
|
}
|
|
161
177
|
/** Props for `MessageBubble` — `AssistantMessageBubbleProps` plus user-only fields and `role`. */
|
|
162
|
-
export type MessageBubbleProps = AssistantMessageBubbleProps & Pick<UserMessageBubbleProps, 'position' | 'collapsedLineCount'> & {
|
|
178
|
+
export type MessageBubbleProps = AssistantMessageBubbleProps & Pick<UserMessageBubbleProps, 'position' | 'collapsedLineCount' | 'textSegments'> & {
|
|
163
179
|
/** Message author/type: user, assistant, or status banner. */
|
|
164
180
|
role: MessageRole;
|
|
165
181
|
};
|
|
@@ -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,0BAA0B,EAC1B,WAAW,EACX,aAAa,EACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"message-bubble.d.ts","sourceRoot":"","sources":["../../src/models/message-bubble.ts"],"names":[],"mappings":"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"}
|
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.
|
|
4
|
+
"version": "1.2.0-dev.213",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -19,12 +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.2.0-dev.
|
|
22
|
+
"@epam/ai-dial-attachment-input": "1.2.0-dev.213"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^19.2.8",
|
|
26
|
-
"
|
|
27
|
-
"@epam/ai-dial-
|
|
26
|
+
"react-dom": "^19.2.8",
|
|
27
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.213",
|
|
28
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.27"
|
|
28
29
|
},
|
|
29
30
|
"repository": {
|
|
30
31
|
"type": "git",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ClipboardEvent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* `onCopy` handler that writes the current selection to the clipboard without
|
|
4
|
+
* the app's colors and fonts. Left to itself, the browser inlines every
|
|
5
|
+
* computed style of the selected markup into `text/html`, so pasting into a
|
|
6
|
+
* rich-text target (Teams, Outlook, Word) brings along the message's
|
|
7
|
+
* background band. This keeps the structure (paragraphs, lists, tables, code,
|
|
8
|
+
* links, line breaks) and lets the target document style it.
|
|
9
|
+
*/
|
|
10
|
+
export declare const copySelectionWithoutStyles: (event: ClipboardEvent<HTMLElement>) => void;
|
|
11
|
+
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../src/utils/clipboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAwG5C;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GACrC,OAAO,cAAc,CAAC,WAAW,CAAC,KACjC,IA0BF,CAAC"}
|