@epam/ai-dial-conversation-messages 1.3.0-dev.322 → 1.3.0-dev.326
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/NegativeFeedbackModal/NegativeFeedbackModal.d.ts +5 -0
- package/components/NegativeFeedbackModal/NegativeFeedbackModal.d.ts.map +1 -0
- package/index.css +1 -1
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -1
- package/index.js +293 -244
- package/models/negative-feedback-modal.d.ts +28 -0
- package/models/negative-feedback-modal.d.ts.map +1 -0
- package/package.json +3 -3
- package/types/negative-feedback-category.d.ts +14 -0
- package/types/negative-feedback-category.d.ts.map +1 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { NegativeFeedbackModalProps } from '../../models/negative-feedback-modal';
|
|
3
|
+
/** Popup shown before a dislike is sent, collecting a required category and an optional comment. */
|
|
4
|
+
export declare const NegativeFeedbackModal: FC<NegativeFeedbackModalProps>;
|
|
5
|
+
//# sourceMappingURL=NegativeFeedbackModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NegativeFeedbackModal.d.ts","sourceRoot":"","sources":["../../../src/components/NegativeFeedbackModal/NegativeFeedbackModal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGvF,oGAAoG;AACpG,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAuEhE,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
._activeRating_ygoee_1{color:var(--ma-active-rating-text,var(--text-accent,#1d4ed8))}._time_16pwx_2{color:var(--cm-timestamp-text,var(--text-secondary,#57647a))}._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}._label_1nohb_1{color:var(--cst-text,var(--text-secondary,#57647a))}
|
|
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}.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}.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}
|
|
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}.h-\[422px\]\!{height:422px!important}.h-full{height:100%}.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}.flex-1{flex:1}.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}.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.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ export { StatusMessageBubble } from './components/MessageBubble/StatusMessageBub
|
|
|
6
6
|
export { MessageActions } from './components/MessageActions/MessageActions';
|
|
7
7
|
export { MessageSelectionReply } from './components/MessageSelectionReply/MessageSelectionReply';
|
|
8
8
|
export { ConversationStartTimestamp } from './components/ConversationStartTimestamp/ConversationStartTimestamp';
|
|
9
|
+
export { NegativeFeedbackModal } from './components/NegativeFeedbackModal/NegativeFeedbackModal';
|
|
10
|
+
export type { NegativeFeedbackModalLabels, NegativeFeedbackModalProps, } from './models/negative-feedback-modal';
|
|
11
|
+
export { NegativeFeedbackCategory } from './types/negative-feedback-category';
|
|
9
12
|
export { BubblePosition } from './types/bubble-position';
|
|
10
13
|
export type { MessageBubbleProps, UserMessageBubbleProps, AssistantMessageBubbleProps, MessageBubbleStyles, MessageBubbleColors, MessageBubbleTypography, MessageBubbleLabels, AssistantMessageBubbleLabels, UserMessageBubbleLabels, MarkdownContentLabels, } from './models/message-bubble';
|
|
11
14
|
export type { MessageSelectionReplyColors, MessageSelectionReplyLabels, MessageSelectionReplyProps, MessageSelectionReplyStyles, MessageSelectionReplyTypography, } from './components/MessageSelectionReply/MessageSelectionReply';
|
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,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,0BAA0B,EAAE,MAAM,oEAAoE,CAAC;AAChH,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,EAC5B,uBAAuB,EACvB,qBAAqB,GACtB,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;AACjC,YAAY,EACV,gCAAgC,EAChC,gCAAgC,EAChC,+BAA+B,GAChC,MAAM,6BAA6B,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,0BAA0B,EAAE,MAAM,oEAAoE,CAAC;AAChH,OAAO,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;AACjG,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,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,EAC5B,uBAAuB,EACvB,qBAAqB,GACtB,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;AACjC,YAAY,EACV,gCAAgC,EAChC,gCAAgC,EAChC,+BAA+B,GAChC,MAAM,6BAA6B,CAAC"}
|
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, LiveRegion as S, LiveRegionElement as C, NeutralButton as w,
|
|
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, Popup as T, PopupSize as E, Select as D, Textarea as O, Tooltip as k } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { memo as A, useCallback as j, useEffect as M, useId as N, useLayoutEffect as P, useMemo as F, useRef as ee, useState as I } from "react";
|
|
5
|
+
import { IconArrowBackUp as L, IconChevronDown as R, IconChevronUp as te, IconMarkdown as ne, IconPencilMinus as re, IconRefresh as z, IconThumbDown as ie, IconThumbDownFilled as ae, IconThumbUp as oe, IconThumbUpFilled as se, IconTrashX as ce } from "@tabler/icons-react";
|
|
6
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
7
|
+
import { createPortal as le } from "react-dom";
|
|
8
8
|
//#region src/constants/public-class-names.ts
|
|
9
|
-
var
|
|
9
|
+
var U = {
|
|
10
10
|
userBubble: "dial-cm-user-bubble",
|
|
11
11
|
assistantContent: "dial-cm-assistant-content"
|
|
12
|
-
},
|
|
13
|
-
let t =
|
|
14
|
-
return
|
|
12
|
+
}, ue = 4, de = (e) => {
|
|
13
|
+
let t = ee(null), [n, r] = I(0);
|
|
14
|
+
return M(() => {
|
|
15
15
|
if (!e) return;
|
|
16
16
|
let n = t.current;
|
|
17
17
|
if (n == null) return;
|
|
@@ -22,201 +22,201 @@ var V = {
|
|
|
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 + ${ue}px)` : void 0
|
|
26
26
|
};
|
|
27
|
-
},
|
|
27
|
+
}, fe = [
|
|
28
28
|
"href",
|
|
29
29
|
"src",
|
|
30
30
|
"alt",
|
|
31
31
|
"colspan",
|
|
32
32
|
"rowspan",
|
|
33
33
|
"start"
|
|
34
|
-
],
|
|
34
|
+
], pe = /* @__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
|
+
fe.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 pe.has(n) && (t.style.whiteSpace = "pre-wrap"), t;
|
|
47
|
+
}, G = (e) => e instanceof SVGElement || window.getComputedStyle(e).display === "none", K = (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) ||
|
|
53
|
+
if (!(e instanceof Element) || G(e)) return null;
|
|
54
54
|
let n = W(e);
|
|
55
55
|
return e.childNodes.forEach((e) => {
|
|
56
|
-
let r =
|
|
56
|
+
let r = K(e, t);
|
|
57
57
|
r && n.appendChild(r);
|
|
58
58
|
}), n;
|
|
59
|
-
},
|
|
59
|
+
}, q = (e, t, n) => {
|
|
60
60
|
let r = e, i = t;
|
|
61
61
|
for (; i && i !== n && n.contains(i);) {
|
|
62
62
|
let e = W(i);
|
|
63
63
|
e.appendChild(r), r = e, i = i.parentElement;
|
|
64
64
|
}
|
|
65
65
|
return r;
|
|
66
|
-
},
|
|
66
|
+
}, me = (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 = K(r, e);
|
|
70
|
+
return i ? q(i, r.parentElement, t) : null;
|
|
71
|
+
}, he = (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 = me(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?.(), N("copy"),
|
|
82
|
+
}, ge = { activeRating: "_activeRating_ygoee_1" }, _e = 2e3, ve = ({ 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: E, colors: D }) => {
|
|
83
|
+
let { tooltips: O, ariaLabels: k } = E ?? {}, [A, N] = I(null), [P, F] = I(""), L = ee(void 0);
|
|
84
|
+
M(() => () => clearTimeout(L.current), []);
|
|
85
|
+
let R = j(() => {
|
|
86
|
+
clearTimeout(L.current), L.current = setTimeout(() => N(null), _e);
|
|
87
|
+
}, []), te = n != null || o != null || c != null || l != null || u != null || f != null || p != null || b != null || x != null, le = s({ "--ma-active-rating-text": D?.activeRatingText }), U = j(() => {
|
|
88
|
+
l?.(), N("copy"), F(e === a.User ? k?.copiedMessageStatus ?? "Message copied to clipboard" : k?.copiedStatus ?? "Copied to clipboard"), R();
|
|
89
89
|
}, [
|
|
90
90
|
l,
|
|
91
91
|
e,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
]),
|
|
96
|
-
u?.(), N("markdown"),
|
|
92
|
+
k?.copiedStatus,
|
|
93
|
+
k?.copiedMessageStatus,
|
|
94
|
+
R
|
|
95
|
+
]), ue = j(() => {
|
|
96
|
+
u?.(), N("markdown"), F(k?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), R();
|
|
97
97
|
}, [
|
|
98
98
|
u,
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
k?.copiedMarkdownStatus,
|
|
100
|
+
R
|
|
101
101
|
]);
|
|
102
|
-
return
|
|
102
|
+
return te ? /* @__PURE__ */ H("div", {
|
|
103
103
|
role: "toolbar",
|
|
104
|
-
"aria-label":
|
|
105
|
-
style:
|
|
104
|
+
"aria-label": k?.actionsGroup ?? "Message actions",
|
|
105
|
+
style: le,
|
|
106
106
|
className: d("flex items-center gap-1", !h && "opacity-0 group-hover:opacity-100", T),
|
|
107
107
|
children: [
|
|
108
108
|
b,
|
|
109
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ V(S, {
|
|
110
110
|
visuallyHidden: !0,
|
|
111
111
|
as: C.Span,
|
|
112
|
-
children:
|
|
112
|
+
children: P
|
|
113
113
|
}),
|
|
114
|
-
e === a.User ? /* @__PURE__ */
|
|
115
|
-
l && /* @__PURE__ */
|
|
114
|
+
e === a.User ? /* @__PURE__ */ H(B, { children: [
|
|
115
|
+
l && /* @__PURE__ */ V(t, {
|
|
116
116
|
iconSize: g.SM,
|
|
117
|
-
onClick:
|
|
117
|
+
onClick: U,
|
|
118
118
|
size: v.Small,
|
|
119
|
-
isCopied:
|
|
120
|
-
copyLabel:
|
|
121
|
-
copiedLabel:
|
|
122
|
-
ariaLabel:
|
|
119
|
+
isCopied: A === "copy",
|
|
120
|
+
copyLabel: O?.copyMessage ?? "Copy message",
|
|
121
|
+
copiedLabel: O?.copied ?? "Copied!",
|
|
122
|
+
ariaLabel: k?.copyMessage ?? "Copy message",
|
|
123
123
|
isDisabled: w
|
|
124
124
|
}),
|
|
125
|
-
n && /* @__PURE__ */
|
|
126
|
-
icon: /* @__PURE__ */
|
|
125
|
+
n && /* @__PURE__ */ V(y, {
|
|
126
|
+
icon: /* @__PURE__ */ V(re, {
|
|
127
127
|
size: g.SM,
|
|
128
128
|
"aria-hidden": !0,
|
|
129
129
|
stroke: _
|
|
130
130
|
}),
|
|
131
131
|
size: v.Small,
|
|
132
|
-
"aria-label":
|
|
133
|
-
tooltipProps: { tooltip:
|
|
132
|
+
"aria-label": k?.editMessage ?? "Edit message",
|
|
133
|
+
tooltipProps: { tooltip: O?.edit ?? "Edit" },
|
|
134
134
|
onClick: n,
|
|
135
135
|
onMouseEnter: r,
|
|
136
136
|
onFocus: r,
|
|
137
137
|
disabled: w
|
|
138
138
|
}),
|
|
139
|
-
o && /* @__PURE__ */
|
|
140
|
-
icon: /* @__PURE__ */
|
|
139
|
+
o && /* @__PURE__ */ V(y, {
|
|
140
|
+
icon: /* @__PURE__ */ V(ce, {
|
|
141
141
|
size: g.SM,
|
|
142
142
|
"aria-hidden": !0,
|
|
143
143
|
stroke: _
|
|
144
144
|
}),
|
|
145
145
|
size: v.Small,
|
|
146
|
-
"aria-label":
|
|
147
|
-
tooltipProps: { tooltip:
|
|
146
|
+
"aria-label": k?.deleteMessage ?? "Delete message",
|
|
147
|
+
tooltipProps: { tooltip: O?.delete ?? "Delete" },
|
|
148
148
|
onClick: o,
|
|
149
149
|
disabled: w
|
|
150
150
|
})
|
|
151
|
-
] }) : /* @__PURE__ */
|
|
152
|
-
c && /* @__PURE__ */
|
|
153
|
-
icon: /* @__PURE__ */
|
|
151
|
+
] }) : /* @__PURE__ */ H(B, { children: [
|
|
152
|
+
c && /* @__PURE__ */ V(y, {
|
|
153
|
+
icon: /* @__PURE__ */ V(z, {
|
|
154
154
|
size: g.SM,
|
|
155
155
|
"aria-hidden": !0,
|
|
156
156
|
stroke: _
|
|
157
157
|
}),
|
|
158
158
|
size: v.Small,
|
|
159
|
-
"aria-label":
|
|
160
|
-
tooltipProps: { tooltip:
|
|
159
|
+
"aria-label": k?.regenerateResponse ?? "Regenerate response",
|
|
160
|
+
tooltipProps: { tooltip: O?.regenerate ?? "Regenerate" },
|
|
161
161
|
onClick: c,
|
|
162
162
|
disabled: w
|
|
163
163
|
}),
|
|
164
|
-
l && /* @__PURE__ */
|
|
164
|
+
l && /* @__PURE__ */ V(t, {
|
|
165
165
|
iconSize: g.SM,
|
|
166
|
-
onClick:
|
|
166
|
+
onClick: U,
|
|
167
167
|
size: v.Small,
|
|
168
|
-
isCopied:
|
|
169
|
-
copyLabel:
|
|
170
|
-
copiedLabel:
|
|
171
|
-
ariaLabel:
|
|
168
|
+
isCopied: A === "copy",
|
|
169
|
+
copyLabel: O?.copy ?? "Copy",
|
|
170
|
+
copiedLabel: O?.copied ?? "Copied!",
|
|
171
|
+
ariaLabel: k?.copyResponse ?? "Copy response",
|
|
172
172
|
isDisabled: w
|
|
173
173
|
}),
|
|
174
|
-
u && /* @__PURE__ */
|
|
174
|
+
u && /* @__PURE__ */ V(t, {
|
|
175
175
|
iconSize: g.SM,
|
|
176
|
-
onClick:
|
|
176
|
+
onClick: ue,
|
|
177
177
|
size: v.Small,
|
|
178
|
-
isCopied:
|
|
179
|
-
iconCopy: /* @__PURE__ */
|
|
178
|
+
isCopied: A === "markdown",
|
|
179
|
+
iconCopy: /* @__PURE__ */ V(ne, {
|
|
180
180
|
size: g.SM,
|
|
181
181
|
"aria-hidden": !0,
|
|
182
182
|
stroke: _
|
|
183
183
|
}),
|
|
184
|
-
copyLabel:
|
|
185
|
-
copiedLabel:
|
|
186
|
-
ariaLabel:
|
|
184
|
+
copyLabel: O?.copyMarkdown ?? "Copy as Markdown",
|
|
185
|
+
copiedLabel: O?.copiedMarkdown ?? "Copied!",
|
|
186
|
+
ariaLabel: k?.copyAsMarkdown ?? "Copy as markdown",
|
|
187
187
|
isDisabled: w
|
|
188
188
|
}),
|
|
189
|
-
f && /* @__PURE__ */
|
|
190
|
-
icon: m === i.Like ? /* @__PURE__ */
|
|
191
|
-
className:
|
|
189
|
+
f && /* @__PURE__ */ V(y, {
|
|
190
|
+
icon: m === i.Like ? /* @__PURE__ */ V(se, {
|
|
191
|
+
className: ge.activeRating,
|
|
192
192
|
size: g.SM,
|
|
193
193
|
"aria-hidden": !0
|
|
194
|
-
}) : /* @__PURE__ */
|
|
194
|
+
}) : /* @__PURE__ */ V(oe, {
|
|
195
195
|
size: g.SM,
|
|
196
196
|
"aria-hidden": !0,
|
|
197
197
|
stroke: _
|
|
198
198
|
}),
|
|
199
199
|
size: v.Small,
|
|
200
|
-
"aria-label":
|
|
200
|
+
"aria-label": k?.likeResponse ?? "Like response",
|
|
201
201
|
"aria-pressed": m === i.Like,
|
|
202
|
-
tooltipProps: { tooltip:
|
|
202
|
+
tooltipProps: { tooltip: O?.like ?? "Like" },
|
|
203
203
|
onClick: f,
|
|
204
204
|
disabled: w
|
|
205
205
|
}),
|
|
206
|
-
p && /* @__PURE__ */
|
|
207
|
-
icon: m === i.Dislike ? /* @__PURE__ */
|
|
208
|
-
className:
|
|
206
|
+
p && /* @__PURE__ */ V(y, {
|
|
207
|
+
icon: m === i.Dislike ? /* @__PURE__ */ V(ae, {
|
|
208
|
+
className: ge.activeRating,
|
|
209
209
|
size: g.SM,
|
|
210
210
|
"aria-hidden": !0
|
|
211
|
-
}) : /* @__PURE__ */
|
|
211
|
+
}) : /* @__PURE__ */ V(ie, {
|
|
212
212
|
size: g.SM,
|
|
213
213
|
"aria-hidden": !0,
|
|
214
214
|
stroke: _
|
|
215
215
|
}),
|
|
216
216
|
size: v.Small,
|
|
217
|
-
"aria-label":
|
|
217
|
+
"aria-label": k?.dislikeResponse ?? "Dislike response",
|
|
218
218
|
"aria-pressed": m === i.Dislike,
|
|
219
|
-
tooltipProps: { tooltip:
|
|
219
|
+
tooltipProps: { tooltip: O?.dislike ?? "Dislike" },
|
|
220
220
|
onClick: p,
|
|
221
221
|
disabled: w
|
|
222
222
|
})
|
|
@@ -224,9 +224,9 @@ var V = {
|
|
|
224
224
|
x
|
|
225
225
|
]
|
|
226
226
|
}) : null;
|
|
227
|
-
},
|
|
228
|
-
let [t, n] =
|
|
229
|
-
return
|
|
227
|
+
}, ye = (e) => {
|
|
228
|
+
let [t, n] = I(() => /* @__PURE__ */ new Date());
|
|
229
|
+
return M(() => {
|
|
230
230
|
let t = setInterval(() => n(/* @__PURE__ */ new Date()), e);
|
|
231
231
|
return () => clearInterval(t);
|
|
232
232
|
}, [e]), t;
|
|
@@ -235,51 +235,51 @@ var V = {
|
|
|
235
235
|
}({}), Y = {
|
|
236
236
|
hour: "numeric",
|
|
237
237
|
minute: "2-digit"
|
|
238
|
-
},
|
|
238
|
+
}, be = {
|
|
239
239
|
year: "numeric",
|
|
240
240
|
month: "short",
|
|
241
241
|
day: "numeric",
|
|
242
242
|
...Y
|
|
243
|
-
},
|
|
244
|
-
["year", 365 *
|
|
245
|
-
["month", 30 *
|
|
246
|
-
["week", 7 *
|
|
247
|
-
["day",
|
|
248
|
-
["hour",
|
|
249
|
-
["minute",
|
|
250
|
-
],
|
|
243
|
+
}, X = 60, xe = 3600, Z = 24 * xe, Q = [
|
|
244
|
+
["year", 365 * Z],
|
|
245
|
+
["month", 30 * Z],
|
|
246
|
+
["week", 7 * Z],
|
|
247
|
+
["day", Z],
|
|
248
|
+
["hour", xe],
|
|
249
|
+
["minute", X]
|
|
250
|
+
], Se = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), Ce = (e) => {
|
|
251
251
|
if (!e) return null;
|
|
252
252
|
let t = new Date(e);
|
|
253
253
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
254
|
-
},
|
|
254
|
+
}, we = (e, t) => new Intl.DateTimeFormat(t, be).format(e), Te = (e, t, n) => {
|
|
255
255
|
let r = new Date(t.getFullYear(), t.getMonth(), t.getDate() - 1);
|
|
256
|
-
return
|
|
256
|
+
return Se(e, t) ? {
|
|
257
257
|
kind: J.Today,
|
|
258
258
|
text: new Intl.DateTimeFormat(n, Y).format(e)
|
|
259
|
-
} :
|
|
259
|
+
} : Se(e, r) ? {
|
|
260
260
|
kind: J.Yesterday,
|
|
261
261
|
text: new Intl.DateTimeFormat(n, Y).format(e)
|
|
262
262
|
} : {
|
|
263
263
|
kind: J.Absolute,
|
|
264
|
-
text:
|
|
264
|
+
text: we(e, n)
|
|
265
265
|
};
|
|
266
|
-
},
|
|
266
|
+
}, Ee = (e, t, n) => {
|
|
267
267
|
let r = new Intl.RelativeTimeFormat(n, { numeric: "auto" }), i = (t.getTime() - e.getTime()) / 1e3;
|
|
268
|
-
for (let [e, t] of
|
|
268
|
+
for (let [e, t] of Q) {
|
|
269
269
|
let n = Math.floor(i / t);
|
|
270
270
|
if (n >= 1) return r.format(-n, e);
|
|
271
271
|
}
|
|
272
272
|
return r.format(0, "second");
|
|
273
|
-
},
|
|
274
|
-
let r =
|
|
275
|
-
return i == null ? null : /* @__PURE__ */
|
|
276
|
-
tooltip:
|
|
273
|
+
}, De = { time: "_time_16pwx_2" }, Oe = 6e4, ke = "opacity-0 transition-opacity group-hover/message:opacity-100 group-focus-within/message:opacity-100 [@media(hover:none)]:opacity-100", Ae = ({ timestamp: e, locale: t, className: n = "dial-small-text" }) => {
|
|
274
|
+
let r = ye(Oe), i = Ce(e);
|
|
275
|
+
return i == null ? null : /* @__PURE__ */ V(k, {
|
|
276
|
+
tooltip: we(i, t),
|
|
277
277
|
asChild: !0,
|
|
278
|
-
children: /* @__PURE__ */
|
|
278
|
+
children: /* @__PURE__ */ V("time", {
|
|
279
279
|
dateTime: e,
|
|
280
280
|
tabIndex: 0,
|
|
281
|
-
className: d("px-1 whitespace-nowrap",
|
|
282
|
-
children:
|
|
281
|
+
className: d("px-1 whitespace-nowrap", De.time, n, ke),
|
|
282
|
+
children: Ee(i, r, t)
|
|
283
283
|
})
|
|
284
284
|
});
|
|
285
285
|
}, $ = {
|
|
@@ -289,111 +289,111 @@ var V = {
|
|
|
289
289
|
collapsedText: "_collapsedText_17fln_15",
|
|
290
290
|
startersDivider: "_startersDivider_17fln_31",
|
|
291
291
|
text: "_text_17fln_35"
|
|
292
|
-
},
|
|
293
|
-
let { colors:
|
|
292
|
+
}, je = "[&>.cm-bubble-markdown>div>*:first-child]:indent-[var(--cm-bubble-first-line-indent,0px)]", Me = ({ 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: O, onAttachmentClick: k, onDownloadAll: A, isAttachmentDownloadable: j, onAttachmentRetry: M, codeBlockTheme: N, tableOnOpenInCanvas: P, labels: ee, selectedAttachmentId: I }) => {
|
|
293
|
+
let { colors: L, typography: R, className: te, bubbleClassName: ne, timestampClassName: re } = c ?? {}, z = f == null ? void 0 : /* @__PURE__ */ V(Ae, {
|
|
294
294
|
timestamp: f,
|
|
295
295
|
locale: m,
|
|
296
|
-
className:
|
|
297
|
-
}), { attachmentClickLabel:
|
|
298
|
-
copyLabel:
|
|
299
|
-
copiedLabel:
|
|
300
|
-
downloadCsvLabel:
|
|
301
|
-
openInCanvasLabel:
|
|
296
|
+
className: re
|
|
297
|
+
}), { attachmentClickLabel: ie, attachmentDownloadLabel: ae, attachmentRetryLabel: oe, attachmentOpenInNewTabLabel: se, startersAriaLabel: ce = "Quick reply buttons", thinkingLabel: le, codeBlockCopyLabel: ue, codeBlockCopiedLabel: fe, codeBlockDownloadLabel: pe, tableCopyLabel: W, tableCopiedLabel: G, tableDownloadCsvLabel: K, tableOpenInCanvasLabel: q, tableDownloadFilename: me, tableScrollRegionAriaLabel: ge, mathScrollRegionAriaLabel: _e, assistantMessageAriaLabel: ye = "Assistant message", deploymentIconFallbackLabel: J = "AI" } = ee ?? {}, Y = F(() => ({
|
|
298
|
+
copyLabel: W,
|
|
299
|
+
copiedLabel: G,
|
|
300
|
+
downloadCsvLabel: K,
|
|
301
|
+
openInCanvasLabel: q
|
|
302
302
|
}), [
|
|
303
|
+
W,
|
|
303
304
|
G,
|
|
304
305
|
K,
|
|
305
|
-
q
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
"--cm-
|
|
309
|
-
"--cm-
|
|
310
|
-
"--cm-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
return /* @__PURE__ */ z("div", {
|
|
306
|
+
q
|
|
307
|
+
]), be = h ? (g ?? []).filter((t) => t.type !== e.Audio) : g ?? [], X = !!t?.trim(), { slotRef: xe, firstLineIndent: Z } = de(_ != null && X), Q = s({
|
|
308
|
+
"--cm-bubble-text": L?.text,
|
|
309
|
+
"--cm-starters-divider": L?.startersDivider,
|
|
310
|
+
"--cm-timestamp-text": L?.timestampText,
|
|
311
|
+
"--cm-bubble-first-line-indent": Z
|
|
312
|
+
}), Se = d($.text, R?.fontClassName), Ce = !!(C || T);
|
|
313
|
+
return /* @__PURE__ */ H("div", {
|
|
314
314
|
role: "group",
|
|
315
|
-
"aria-label":
|
|
315
|
+
"aria-label": ye,
|
|
316
316
|
style: Q,
|
|
317
|
-
onCopy:
|
|
318
|
-
className: d("group/message flex w-full items-start gap-3",
|
|
319
|
-
children: [Ce && /* @__PURE__ */
|
|
317
|
+
onCopy: he,
|
|
318
|
+
className: d("group/message flex w-full items-start gap-3", te),
|
|
319
|
+
children: [Ce && /* @__PURE__ */ V(n, {
|
|
320
320
|
src: C,
|
|
321
321
|
size: 28,
|
|
322
|
-
initialsName: T ||
|
|
323
|
-
labels: { tooltip: T ??
|
|
324
|
-
}), /* @__PURE__ */
|
|
322
|
+
initialsName: T || J,
|
|
323
|
+
labels: { tooltip: T ?? J }
|
|
324
|
+
}), /* @__PURE__ */ H("div", {
|
|
325
325
|
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",
|
|
326
|
+
children: [/* @__PURE__ */ H("div", {
|
|
327
|
+
className: d("flex w-full max-w-full min-w-0 flex-col items-start gap-4", ne),
|
|
328
328
|
children: [
|
|
329
|
-
_ != null && !
|
|
329
|
+
_ != null && !X && /* @__PURE__ */ V("div", {
|
|
330
330
|
className: "min-w-0",
|
|
331
331
|
children: _
|
|
332
332
|
}),
|
|
333
|
-
(
|
|
333
|
+
(X || h && b) && /* @__PURE__ */ H("div", {
|
|
334
334
|
"aria-live": "polite",
|
|
335
335
|
"aria-atomic": "false",
|
|
336
|
-
className: d(Se, "relative max-w-full min-w-0 text-start", _ != null &&
|
|
337
|
-
children: [_ != null &&
|
|
338
|
-
ref:
|
|
336
|
+
className: d(Se, "relative max-w-full min-w-0 text-start", _ != null && X && je, U.assistantContent),
|
|
337
|
+
children: [_ != null && X && /* @__PURE__ */ V("div", {
|
|
338
|
+
ref: xe,
|
|
339
339
|
className: "absolute inset-s-0 top-0",
|
|
340
340
|
children: _
|
|
341
|
-
}), /* @__PURE__ */
|
|
341
|
+
}), /* @__PURE__ */ V("div", {
|
|
342
342
|
ref: i,
|
|
343
343
|
className: "cm-bubble-markdown max-w-full min-w-0 wrap-anywhere",
|
|
344
|
-
children: /* @__PURE__ */
|
|
344
|
+
children: /* @__PURE__ */ V(r, {
|
|
345
345
|
content: t ?? "",
|
|
346
346
|
isPlainText: v === o.PlainText,
|
|
347
347
|
isStreaming: h,
|
|
348
348
|
thinkingLabel: le,
|
|
349
349
|
components: E,
|
|
350
350
|
classNames: D,
|
|
351
|
-
urlTransform:
|
|
351
|
+
urlTransform: O,
|
|
352
352
|
codeBlockCopyLabel: ue,
|
|
353
|
-
codeBlockCopiedLabel:
|
|
354
|
-
codeBlockDownloadLabel:
|
|
355
|
-
codeBlockTheme:
|
|
356
|
-
tableActionLabels:
|
|
357
|
-
tableDownloadFilename:
|
|
358
|
-
tableOnOpenInCanvas:
|
|
359
|
-
tableScrollRegionAriaLabel:
|
|
360
|
-
mathScrollRegionAriaLabel:
|
|
353
|
+
codeBlockCopiedLabel: fe,
|
|
354
|
+
codeBlockDownloadLabel: pe,
|
|
355
|
+
codeBlockTheme: N,
|
|
356
|
+
tableActionLabels: Y,
|
|
357
|
+
tableDownloadFilename: me,
|
|
358
|
+
tableOnOpenInCanvas: P,
|
|
359
|
+
tableScrollRegionAriaLabel: ge,
|
|
360
|
+
mathScrollRegionAriaLabel: _e
|
|
361
361
|
})
|
|
362
362
|
})]
|
|
363
363
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
365
|
-
attachments:
|
|
366
|
-
onAttachmentClick:
|
|
364
|
+
/* @__PURE__ */ V(p, {
|
|
365
|
+
attachments: be,
|
|
366
|
+
onAttachmentClick: k ? (e) => {
|
|
367
367
|
let t = g?.find((t) => t.id === e);
|
|
368
|
-
t &&
|
|
368
|
+
t && k(t);
|
|
369
369
|
} : void 0,
|
|
370
|
-
onDownloadAll:
|
|
371
|
-
isAttachmentDownloadable:
|
|
372
|
-
onRetry:
|
|
370
|
+
onDownloadAll: A,
|
|
371
|
+
isAttachmentDownloadable: j,
|
|
372
|
+
onRetry: M,
|
|
373
373
|
labels: {
|
|
374
|
-
clickLabel:
|
|
375
|
-
downloadLabel:
|
|
376
|
-
retryLabel:
|
|
377
|
-
openInNewTabLabel:
|
|
374
|
+
clickLabel: ie,
|
|
375
|
+
downloadLabel: ae,
|
|
376
|
+
retryLabel: oe,
|
|
377
|
+
openInNewTabLabel: se
|
|
378
378
|
},
|
|
379
|
-
selectedAttachmentId:
|
|
379
|
+
selectedAttachmentId: I
|
|
380
380
|
}),
|
|
381
381
|
y,
|
|
382
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ V(ve, {
|
|
383
383
|
...l,
|
|
384
384
|
isAlwaysVisible: u,
|
|
385
|
-
trailingContent:
|
|
385
|
+
trailingContent: z == null ? l?.trailingContent : /* @__PURE__ */ H(B, { children: [l?.trailingContent, z] }),
|
|
386
386
|
role: a.Assistant
|
|
387
387
|
})
|
|
388
388
|
]
|
|
389
|
-
}), x && x.length > 0 && S && /* @__PURE__ */
|
|
389
|
+
}), x && x.length > 0 && S && /* @__PURE__ */ V("div", {
|
|
390
390
|
role: "list",
|
|
391
|
-
"aria-label":
|
|
391
|
+
"aria-label": ce,
|
|
392
392
|
className: d("flex w-full flex-wrap gap-2 border-t pt-5", $.startersDivider),
|
|
393
|
-
children: x.map((e, t) => /* @__PURE__ */
|
|
393
|
+
children: x.map((e, t) => /* @__PURE__ */ V("div", {
|
|
394
394
|
role: "listitem",
|
|
395
395
|
className: "min-w-[40px]",
|
|
396
|
-
children: /* @__PURE__ */
|
|
396
|
+
children: /* @__PURE__ */ V(w, {
|
|
397
397
|
label: e.title,
|
|
398
398
|
className: "min-w-[40px]",
|
|
399
399
|
onClick: () => S(e)
|
|
@@ -402,28 +402,28 @@ var V = {
|
|
|
402
402
|
})]
|
|
403
403
|
})]
|
|
404
404
|
});
|
|
405
|
-
},
|
|
405
|
+
}, Ne = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ V(b, {
|
|
406
406
|
title: e,
|
|
407
407
|
message: t,
|
|
408
408
|
textClassName: "flex-row flex-wrap gap-1"
|
|
409
|
-
}),
|
|
409
|
+
}), Pe = /* @__PURE__ */ function(e) {
|
|
410
410
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
411
|
-
}({}),
|
|
412
|
-
let { colors: P, typography:
|
|
411
|
+
}({}), Fe = 10, Ie = "[&>div>*:first-child]:mt-0 [&>div>*:last-child]:mb-0", Le = [], Re = ({ text: e, contentRef: t, position: n = Pe.Bottom, styles: i, actions: o, hasAlwaysVisibleActions: m, timestamp: h, locale: _, attachments: y, collapsedLineCount: b = Fe, labels: S, textSegments: C, onAttachmentClick: w, onDownloadAll: T, isAttachmentDownloadable: E, onAttachmentRetry: D, selectedAttachmentId: O, markdownClassNames: k, markdownUrlTransform: A, codeBlockTheme: j, tableOnOpenInCanvas: M }) => {
|
|
412
|
+
let { colors: P, typography: ee, className: I, bubbleClassName: L, timestampClassName: ne } = i ?? {}, re = h == null ? void 0 : /* @__PURE__ */ V(Ae, {
|
|
413
413
|
timestamp: h,
|
|
414
414
|
locale: _,
|
|
415
|
-
className:
|
|
416
|
-
}), { showMoreLabel:
|
|
417
|
-
copyLabel:
|
|
418
|
-
copiedLabel:
|
|
419
|
-
downloadCsvLabel:
|
|
420
|
-
openInCanvasLabel:
|
|
415
|
+
className: ne
|
|
416
|
+
}), { showMoreLabel: z = "Show more", showLessLabel: ie = "Show less", showMoreAriaLabel: ae, showLessAriaLabel: oe, attachmentClickLabel: se, attachmentDownloadLabel: ce, attachmentRetryLabel: le, attachmentOpenInNewTabLabel: ue, userMessageAriaLabel: de = "User message", codeBlockCopyLabel: fe, codeBlockCopiedLabel: pe, codeBlockDownloadLabel: W, tableCopyLabel: G, tableCopiedLabel: K, tableDownloadCsvLabel: q, tableOpenInCanvasLabel: me, tableDownloadFilename: ge, tableScrollRegionAriaLabel: _e, mathScrollRegionAriaLabel: ye } = S ?? {}, J = F(() => ({
|
|
417
|
+
copyLabel: G,
|
|
418
|
+
copiedLabel: K,
|
|
419
|
+
downloadCsvLabel: q,
|
|
420
|
+
openInCanvasLabel: me
|
|
421
421
|
}), [
|
|
422
|
+
G,
|
|
422
423
|
K,
|
|
423
424
|
q,
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
]), { textRef: ve, isTextCollapsed: ye, isOverflowing: Z, collapsedMaxHeight: be, expandedMaxHeight: xe, isCollapsed: Q, toggleCollapsed: Se } = f({
|
|
425
|
+
me
|
|
426
|
+
]), { textRef: Y, isTextCollapsed: be, isOverflowing: X, collapsedMaxHeight: xe, expandedMaxHeight: Z, isCollapsed: Q, toggleCollapsed: Se } = f({
|
|
427
427
|
text: e ?? "",
|
|
428
428
|
collapsedLineCount: b
|
|
429
429
|
}), Ce = s({
|
|
@@ -432,12 +432,12 @@ var V = {
|
|
|
432
432
|
"--cm-bubble-fade-start": P?.fadeStart,
|
|
433
433
|
"--cm-bubble-text": P?.text,
|
|
434
434
|
"--cm-timestamp-text": P?.timestampText,
|
|
435
|
-
"--cm-bubble-collapsed-height":
|
|
436
|
-
"--cm-bubble-expanded-height":
|
|
437
|
-
}), we = n ===
|
|
435
|
+
"--cm-bubble-collapsed-height": X ? `${xe}px` : void 0,
|
|
436
|
+
"--cm-bubble-expanded-height": X ? `${Z}px` : void 0
|
|
437
|
+
}), we = n === Pe.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", Te = d($.text, ee?.fontClassName), { markdownSource: Ee, segmentRehypePlugins: De, segmentComponents: Oe } = F(() => {
|
|
438
438
|
if (C == null) return {
|
|
439
439
|
markdownSource: e ?? "",
|
|
440
|
-
segmentRehypePlugins:
|
|
440
|
+
segmentRehypePlugins: Le,
|
|
441
441
|
segmentComponents: void 0
|
|
442
442
|
};
|
|
443
443
|
let { source: t, inlineSegments: n } = c(C);
|
|
@@ -446,17 +446,17 @@ var V = {
|
|
|
446
446
|
segmentRehypePlugins: [u(n)],
|
|
447
447
|
segmentComponents: l(n)
|
|
448
448
|
};
|
|
449
|
-
}, [e, C]),
|
|
450
|
-
return /* @__PURE__ */
|
|
449
|
+
}, [e, C]), ke = ae ?? z, je = oe ?? ie, Me = Q ? z : ie, Ne = Q ? ke : je, Re = Q ? R : te, ze = N();
|
|
450
|
+
return /* @__PURE__ */ V("div", {
|
|
451
451
|
role: "group",
|
|
452
|
-
"aria-label":
|
|
452
|
+
"aria-label": de,
|
|
453
453
|
style: Ce,
|
|
454
|
-
onCopy:
|
|
455
|
-
className: d("group/message flex w-full",
|
|
456
|
-
children: /* @__PURE__ */
|
|
454
|
+
onCopy: he,
|
|
455
|
+
className: d("group/message flex w-full", I),
|
|
456
|
+
children: /* @__PURE__ */ H("div", {
|
|
457
457
|
className: "ms-auto flex w-fit max-w-full min-w-0 flex-col items-end gap-4",
|
|
458
458
|
children: [
|
|
459
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ V(p, {
|
|
460
460
|
attachments: y ?? [],
|
|
461
461
|
onAttachmentClick: w ? (e) => {
|
|
462
462
|
let t = y?.find((t) => t.id === e);
|
|
@@ -468,48 +468,48 @@ var V = {
|
|
|
468
468
|
labels: {
|
|
469
469
|
clickLabel: se,
|
|
470
470
|
downloadLabel: ce,
|
|
471
|
-
retryLabel:
|
|
472
|
-
openInNewTabLabel:
|
|
471
|
+
retryLabel: le,
|
|
472
|
+
openInNewTabLabel: ue
|
|
473
473
|
},
|
|
474
474
|
styles: { className: "max-w-[640px]" },
|
|
475
475
|
selectedAttachmentId: O
|
|
476
476
|
}),
|
|
477
|
-
e && /* @__PURE__ */
|
|
478
|
-
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", we,
|
|
479
|
-
children: /* @__PURE__ */
|
|
477
|
+
e && /* @__PURE__ */ V("div", {
|
|
478
|
+
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", we, L, U.userBubble),
|
|
479
|
+
children: /* @__PURE__ */ H("div", {
|
|
480
480
|
className: "flex min-w-0 flex-col items-start",
|
|
481
|
-
children: [/* @__PURE__ */
|
|
481
|
+
children: [/* @__PURE__ */ V("div", {
|
|
482
482
|
id: ze,
|
|
483
483
|
ref: t,
|
|
484
|
-
className: d("relative -ms-1 -me-1 w-[calc(100%+8px)] overflow-hidden ps-1 pe-1",
|
|
485
|
-
children: /* @__PURE__ */
|
|
486
|
-
ref:
|
|
487
|
-
className: d(
|
|
488
|
-
children: /* @__PURE__ */
|
|
489
|
-
content:
|
|
484
|
+
className: d("relative -ms-1 -me-1 w-[calc(100%+8px)] overflow-hidden ps-1 pe-1", X && $.collapsibleText, X && !Q && $.expandedText, be && $.collapsedText),
|
|
485
|
+
children: /* @__PURE__ */ V("div", {
|
|
486
|
+
ref: Y,
|
|
487
|
+
className: d(Te, "max-w-full min-w-0 text-start", Ie),
|
|
488
|
+
children: /* @__PURE__ */ V(r, {
|
|
489
|
+
content: Ee,
|
|
490
490
|
isRawHtmlEnabled: !1,
|
|
491
|
-
rehypePlugins:
|
|
492
|
-
components:
|
|
493
|
-
classNames:
|
|
491
|
+
rehypePlugins: De,
|
|
492
|
+
components: Oe,
|
|
493
|
+
classNames: k,
|
|
494
494
|
urlTransform: A,
|
|
495
|
-
codeBlockCopyLabel:
|
|
496
|
-
codeBlockCopiedLabel:
|
|
497
|
-
codeBlockDownloadLabel:
|
|
495
|
+
codeBlockCopyLabel: fe,
|
|
496
|
+
codeBlockCopiedLabel: pe,
|
|
497
|
+
codeBlockDownloadLabel: W,
|
|
498
498
|
codeBlockTheme: j,
|
|
499
|
-
tableActionLabels:
|
|
500
|
-
tableDownloadFilename:
|
|
501
|
-
tableOnOpenInCanvas:
|
|
502
|
-
tableScrollRegionAriaLabel:
|
|
503
|
-
mathScrollRegionAriaLabel:
|
|
499
|
+
tableActionLabels: J,
|
|
500
|
+
tableDownloadFilename: ge,
|
|
501
|
+
tableOnOpenInCanvas: M,
|
|
502
|
+
tableScrollRegionAriaLabel: _e,
|
|
503
|
+
mathScrollRegionAriaLabel: ye
|
|
504
504
|
})
|
|
505
505
|
})
|
|
506
|
-
}),
|
|
507
|
-
label: /* @__PURE__ */
|
|
508
|
-
iconBefore: /* @__PURE__ */
|
|
506
|
+
}), X && /* @__PURE__ */ V(x, {
|
|
507
|
+
label: /* @__PURE__ */ V(B, { children: Me }),
|
|
508
|
+
iconBefore: /* @__PURE__ */ V(Re, {
|
|
509
509
|
size: g.SM,
|
|
510
510
|
"aria-hidden": "true"
|
|
511
511
|
}),
|
|
512
|
-
"aria-label":
|
|
512
|
+
"aria-label": Ne,
|
|
513
513
|
"aria-expanded": !Q,
|
|
514
514
|
"aria-controls": ze,
|
|
515
515
|
className: "mt-3",
|
|
@@ -518,40 +518,40 @@ var V = {
|
|
|
518
518
|
})]
|
|
519
519
|
})
|
|
520
520
|
}),
|
|
521
|
-
/* @__PURE__ */
|
|
521
|
+
/* @__PURE__ */ V(ve, {
|
|
522
522
|
...o,
|
|
523
523
|
isAlwaysVisible: m,
|
|
524
|
-
leadingContent:
|
|
524
|
+
leadingContent: re == null ? o?.leadingContent : /* @__PURE__ */ H(B, { children: [re, o?.leadingContent] }),
|
|
525
525
|
role: a.User
|
|
526
526
|
})
|
|
527
527
|
]
|
|
528
528
|
})
|
|
529
529
|
});
|
|
530
|
-
},
|
|
530
|
+
}, ze = ({ role: e, beforeContent: t, textSegments: n, onAttachmentClick: r, responseFormat: i, markdownComponents: o, markdownUrlTransform: s, ...c }) => e === a.Status ? /* @__PURE__ */ V(Ne, { labels: {
|
|
531
531
|
titleText: c.labels?.statusTitleText,
|
|
532
532
|
bodyText: c.labels?.statusBodyText ?? ""
|
|
533
|
-
} }) : e === a.User ? /* @__PURE__ */
|
|
533
|
+
} }) : e === a.User ? /* @__PURE__ */ V(Re, {
|
|
534
534
|
...c,
|
|
535
535
|
textSegments: n,
|
|
536
536
|
markdownUrlTransform: s,
|
|
537
537
|
onAttachmentClick: r
|
|
538
|
-
}) : /* @__PURE__ */
|
|
538
|
+
}) : /* @__PURE__ */ V(Me, {
|
|
539
539
|
...c,
|
|
540
540
|
beforeContent: t,
|
|
541
541
|
responseFormat: i,
|
|
542
542
|
markdownComponents: o,
|
|
543
543
|
markdownUrlTransform: s,
|
|
544
544
|
onAttachmentClick: r
|
|
545
|
-
}),
|
|
545
|
+
}), Be = { button: "_button_tqo4d_3" }, Ve = ({ rect: e, actionRef: t, onReply: n, addedRevision: r, labels: i, styles: a, portalContainer: o }) => {
|
|
546
546
|
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({
|
|
547
547
|
"--cm-reply-background": c?.background,
|
|
548
548
|
"--cm-reply-hover-background": c?.hoverBackground,
|
|
549
549
|
"--cm-reply-text": c?.text
|
|
550
|
-
}), [b, x] =
|
|
550
|
+
}), [b, x] = I({
|
|
551
551
|
x: 0,
|
|
552
552
|
y: 0
|
|
553
553
|
});
|
|
554
|
-
return
|
|
554
|
+
return P(() => {
|
|
555
555
|
if (!e || !t.current) return;
|
|
556
556
|
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;
|
|
557
557
|
x({
|
|
@@ -566,41 +566,90 @@ var V = {
|
|
|
566
566
|
f,
|
|
567
567
|
p,
|
|
568
568
|
i.reply
|
|
569
|
-
]), g ?
|
|
569
|
+
]), g ? le(/* @__PURE__ */ H(B, { children: [e && /* @__PURE__ */ V("div", {
|
|
570
570
|
ref: t,
|
|
571
571
|
className: d("fixed top-0 left-0 z-50 max-w-[calc(100vw-16px)]", u),
|
|
572
572
|
style: {
|
|
573
573
|
...y,
|
|
574
574
|
transform: `translate(${b.x}px, ${b.y}px)`
|
|
575
575
|
},
|
|
576
|
-
children: /* @__PURE__ */
|
|
576
|
+
children: /* @__PURE__ */ V(m, {
|
|
577
577
|
variant: h.Neutral,
|
|
578
578
|
size: v.Small,
|
|
579
579
|
label: i.reply,
|
|
580
580
|
onClick: n,
|
|
581
581
|
textClassName: p,
|
|
582
|
-
className: d(
|
|
583
|
-
iconAfter: /* @__PURE__ */
|
|
582
|
+
className: d(Be.button, "h-8 min-h-8 min-w-11 px-2 shadow-lg mobile:h-11 mobile:min-h-11", f),
|
|
583
|
+
iconAfter: /* @__PURE__ */ V(L, {
|
|
584
584
|
size: 16,
|
|
585
585
|
stroke: _,
|
|
586
586
|
"aria-hidden": "true",
|
|
587
587
|
className: "rtl:scale-x-[-1]"
|
|
588
588
|
})
|
|
589
589
|
})
|
|
590
|
-
}), /* @__PURE__ */
|
|
590
|
+
}), /* @__PURE__ */ V(S, {
|
|
591
591
|
visuallyHidden: !0,
|
|
592
|
-
children: e ? i.selectionAvailable : r > 0 ? /* @__PURE__ */
|
|
592
|
+
children: e ? i.selectionAvailable : r > 0 ? /* @__PURE__ */ V("span", { children: i.attachmentAdded }, r) : null
|
|
593
593
|
})] }), g) : null;
|
|
594
|
-
},
|
|
595
|
-
let a =
|
|
594
|
+
}, He = { label: "_label_1nohb_1" }, Ue = (e) => `Today ${e}`, We = (e) => `Yesterday ${e}`, Ge = ({ timestamp: e, locale: t, labels: n, className: r = "dial-small-text", colors: i }) => {
|
|
595
|
+
let a = Ce(e);
|
|
596
596
|
if (a == null) return null;
|
|
597
|
-
let { kind: o, text: c } =
|
|
598
|
-
return o === J.Today ? l = (n?.today ??
|
|
597
|
+
let { kind: o, text: c } = Te(a, /* @__PURE__ */ new Date(), t), l = c;
|
|
598
|
+
return o === J.Today ? l = (n?.today ?? Ue)(c) : o === J.Yesterday && (l = (n?.yesterday ?? We)(c)), /* @__PURE__ */ V("time", {
|
|
599
599
|
dateTime: e,
|
|
600
|
-
className: d("self-center text-center",
|
|
600
|
+
className: d("self-center text-center", He.label, r),
|
|
601
601
|
style: s({ "--cst-text": i?.text }),
|
|
602
602
|
children: l
|
|
603
603
|
});
|
|
604
|
-
}
|
|
604
|
+
}, Ke = /* @__PURE__ */ function(e) {
|
|
605
|
+
return e.UiBug = "UI bug", e.OveractiveRefusal = "Overactive refusal", e.IncompleteResponse = "Incomplete response", e.ShouldHaveTriggeredThinking = "Should have triggered thinking", e.ShouldHaveSearchedTheWeb = "Should have searched the web", e;
|
|
606
|
+
}({}), qe = A(({ onClose: e, onSubmit: t, isCommentEnabled: n = !0, labels: r }) => {
|
|
607
|
+
let { title: i = "Send negative feedback", feedbackTypeLabel: a = "What type of feedback you want to give?", selectPlaceholder: o = "Select", commentPlaceholder: s = "Type an optional comment to your feedback", sendLabel: c = "Send", categoryLabels: l } = r ?? {}, [u, d] = I(""), [f, p] = I(""), m = F(() => Object.values(Ke).map((e) => ({
|
|
608
|
+
value: e,
|
|
609
|
+
label: l?.[e] ?? e
|
|
610
|
+
})), [l]), g = j(() => {
|
|
611
|
+
t(f.trim() ? `${u}: ${f.trim()}` : u);
|
|
612
|
+
}, [
|
|
613
|
+
u,
|
|
614
|
+
f,
|
|
615
|
+
t
|
|
616
|
+
]), _ = F(() => [{
|
|
617
|
+
label: c,
|
|
618
|
+
variant: h.Primary,
|
|
619
|
+
disabled: !u,
|
|
620
|
+
onClick: g
|
|
621
|
+
}], [
|
|
622
|
+
u,
|
|
623
|
+
g,
|
|
624
|
+
c
|
|
625
|
+
]);
|
|
626
|
+
return /* @__PURE__ */ V(T, {
|
|
627
|
+
open: !0,
|
|
628
|
+
header: i,
|
|
629
|
+
onClose: e,
|
|
630
|
+
size: E.Sm,
|
|
631
|
+
className: "h-[422px]!",
|
|
632
|
+
mainButtons: _,
|
|
633
|
+
children: /* @__PURE__ */ H("div", {
|
|
634
|
+
className: "flex h-full flex-col gap-4 px-6 py-4",
|
|
635
|
+
children: [/* @__PURE__ */ V(D, {
|
|
636
|
+
labelProps: {
|
|
637
|
+
label: a,
|
|
638
|
+
required: !0
|
|
639
|
+
},
|
|
640
|
+
options: m,
|
|
641
|
+
value: u,
|
|
642
|
+
placeholder: o,
|
|
643
|
+
onChange: (e) => d(e)
|
|
644
|
+
}), n && /* @__PURE__ */ V(O, {
|
|
645
|
+
value: f,
|
|
646
|
+
placeholder: s,
|
|
647
|
+
onChange: (e) => p(e ?? ""),
|
|
648
|
+
containerClassName: "flex-1",
|
|
649
|
+
className: "h-full"
|
|
650
|
+
})]
|
|
651
|
+
})
|
|
652
|
+
});
|
|
653
|
+
});
|
|
605
654
|
//#endregion
|
|
606
|
-
export {
|
|
655
|
+
export { Me as AssistantMessageBubble, Pe as BubblePosition, U as CONVERSATION_MESSAGES_CLASS, Ge as ConversationStartTimestamp, ve as MessageActions, ze as MessageBubble, Ve as MessageSelectionReply, Ke as NegativeFeedbackCategory, qe as NegativeFeedbackModal, Ne as StatusMessageBubble, Re as UserMessageBubble };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NegativeFeedbackCategory } from '../types/negative-feedback-category';
|
|
2
|
+
/** User-visible strings of `NegativeFeedbackModal`. */
|
|
3
|
+
export interface NegativeFeedbackModalLabels {
|
|
4
|
+
/** Popup header. Defaults to `'Send negative feedback'`. */
|
|
5
|
+
title?: string;
|
|
6
|
+
/** Label of the required category select. Defaults to `'What type of feedback you want to give?'`. */
|
|
7
|
+
feedbackTypeLabel?: string;
|
|
8
|
+
/** Placeholder of the category select. Defaults to `'Select'`. */
|
|
9
|
+
selectPlaceholder?: string;
|
|
10
|
+
/** Placeholder of the optional comment field. Defaults to `'Type an optional comment to your feedback'`. */
|
|
11
|
+
commentPlaceholder?: string;
|
|
12
|
+
/** Label of the submit button. Defaults to `'Send'`. */
|
|
13
|
+
sendLabel?: string;
|
|
14
|
+
/** Display label of each category. A missing entry shows the category's own value. */
|
|
15
|
+
categoryLabels?: Partial<Record<NegativeFeedbackCategory, string>>;
|
|
16
|
+
}
|
|
17
|
+
/** Props of `NegativeFeedbackModal`. */
|
|
18
|
+
export interface NegativeFeedbackModalProps {
|
|
19
|
+
/** Called when the user dismisses the popup without sending. */
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
/** Called with the rating comment: the category value, followed by `: <comment>` when a comment was typed. */
|
|
22
|
+
onSubmit: (comment: string) => void;
|
|
23
|
+
/** Whether the optional free-text comment field is shown. Defaults to `true`. */
|
|
24
|
+
isCommentEnabled?: boolean;
|
|
25
|
+
/** User-visible strings. */
|
|
26
|
+
labels?: NegativeFeedbackModalLabels;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=negative-feedback-modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"negative-feedback-modal.d.ts","sourceRoot":"","sources":["../../src/models/negative-feedback-modal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAEpF,uDAAuD;AACvD,MAAM,WAAW,2BAA2B;IAC1C,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sGAAsG;IACtG,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4GAA4G;IAC5G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,cAAc,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,CAAC;CACpE;AAED,wCAAwC;AACxC,MAAM,WAAW,0BAA0B;IACzC,gEAAgE;IAChE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,8GAA8G;IAC9G,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,iFAAiF;IACjF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,2BAA2B,CAAC;CACtC"}
|
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.326",
|
|
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.50.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.326"
|
|
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.
|
|
27
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.326",
|
|
28
28
|
"@epam/ai-dial-ui-kit": "^0.16.0-dev.72"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Reason a user picks when disliking a message; the value is the text sent in the rating comment. */
|
|
2
|
+
export declare enum NegativeFeedbackCategory {
|
|
3
|
+
/** Something in the interface did not work. */
|
|
4
|
+
UiBug = "UI bug",
|
|
5
|
+
/** The model refused a request it should have answered. */
|
|
6
|
+
OveractiveRefusal = "Overactive refusal",
|
|
7
|
+
/** The answer stopped short or missed part of the request. */
|
|
8
|
+
IncompleteResponse = "Incomplete response",
|
|
9
|
+
/** The model answered without reasoning when it should have. */
|
|
10
|
+
ShouldHaveTriggeredThinking = "Should have triggered thinking",
|
|
11
|
+
/** The model answered from memory when it should have searched the web. */
|
|
12
|
+
ShouldHaveSearchedTheWeb = "Should have searched the web"
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=negative-feedback-category.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"negative-feedback-category.d.ts","sourceRoot":"","sources":["../../src/types/negative-feedback-category.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,oBAAY,wBAAwB;IAClC,+CAA+C;IAC/C,KAAK,WAAW;IAChB,2DAA2D;IAC3D,iBAAiB,uBAAuB;IACxC,8DAA8D;IAC9D,kBAAkB,wBAAwB;IAC1C,gEAAgE;IAChE,2BAA2B,mCAAmC;IAC9D,2EAA2E;IAC3E,wBAAwB,iCAAiC;CAC1D"}
|