@epam/ai-dial-conversation-input 1.3.0-dev.326 → 1.3.0-dev.331
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/Input/Input.d.ts.map +1 -1
- package/index.js +179 -178
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAsDA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAalE,wIAAwI;AACxI,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAsDA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAalE,wIAAwI;AACxI,eAAO,MAAM,KAAK,oGAw0CjB,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, MIME_TYPE_EXT_MAP as r, RESIZABLE_TEXTAREA_CLASS_NAME as i, RequestStatus as a, ResponseFormat as o, SELECT_LIST_MAX_HEIGHT_PX as s, buildCssVars as c, mergeClasses as l, normalizeMimeType as u, useIsMobile as d, useIsPhone as f } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { BASE_ICON_SIZE as p, BottomSheet as m, Button as h, ButtonVariant as g, CloseButton as _, DIAL_ICON_SIZE as v, DIAL_KIT_ICON_STROKE as y, Dropdown as b, ElementSize as x, ErrorText as S, GhostIconButton as C, Highlight as w, LiveRegion as T, LiveRegionElement as E, LiveRegionPoliteness as D, MenuItemMark as
|
|
2
|
+
import { BASE_ICON_SIZE as p, BottomSheet as m, Button as h, ButtonVariant as g, CloseButton as _, DIAL_ICON_SIZE as v, DIAL_KIT_ICON_STROKE as y, Dropdown as b, ElementSize as x, ErrorText as S, GhostIconButton as C, Highlight as w, LiveRegion as T, LiveRegionElement as E, LiveRegionPoliteness as D, MenuItemMark as O, NeutralButton as k, NeutralIconButton as A, Notification as j, NotificationType as M, NotificationVariant as N, Popup as P, PopupSize as ee, PrimaryButton as te, PrimaryIconButton as F, RadioGroup as ne, RadioGroupOrientation as I, Search as L, Skeleton as R, SkeletonVariant as re, Slider as z, Spinner as ie, Textarea as ae, TextareaResize as oe, ToggleChip as se, Tooltip as ce } from "@epam/ai-dial-ui-kit";
|
|
3
3
|
import { Fragment as le, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
4
4
|
import { AttachmentTray as ue, MAX_UPLOADS_PER_MINUTE as de, generateAttachmentId as fe, useClipboardPaste as pe } from "@epam/ai-dial-attachment-input";
|
|
5
5
|
import { IconArrowNarrowRight as me, IconCheck as he, IconChevronDown as ge, IconChevronRight as _e, IconFile as ve, IconMicrophone as ye, IconPaperclip as be, IconPlayerStop as xe, IconPlus as Se, IconSettings as Ce, IconTool as we, IconX as Te } from "@tabler/icons-react";
|
|
@@ -650,7 +650,7 @@ var q = {
|
|
|
650
650
|
className: "flex flex-col gap-4 px-6 pb-3",
|
|
651
651
|
style: S,
|
|
652
652
|
children: [
|
|
653
|
-
e.responseFormat && /* @__PURE__ */ B(
|
|
653
|
+
e.responseFormat && /* @__PURE__ */ B(ne, {
|
|
654
654
|
id: "response-format",
|
|
655
655
|
labelProps: {
|
|
656
656
|
label: d,
|
|
@@ -698,7 +698,7 @@ var q = {
|
|
|
698
698
|
]
|
|
699
699
|
});
|
|
700
700
|
}, mt = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: c, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: S = "Apply changes", saveDisabledTooltip: C }) => {
|
|
701
|
-
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat:
|
|
701
|
+
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: A, handleSubmit: j } = ft({
|
|
702
702
|
isOpen: e,
|
|
703
703
|
features: o,
|
|
704
704
|
initialResponseFormat: s,
|
|
@@ -720,9 +720,9 @@ var q = {
|
|
|
720
720
|
responseFormat: w,
|
|
721
721
|
systemPrompt: T,
|
|
722
722
|
temperature: E,
|
|
723
|
-
onResponseFormatChange:
|
|
724
|
-
onSystemPromptChange:
|
|
725
|
-
onTemperatureChange:
|
|
723
|
+
onResponseFormatChange: O,
|
|
724
|
+
onSystemPromptChange: k,
|
|
725
|
+
onTemperatureChange: A,
|
|
726
726
|
responseFormatLabel: p,
|
|
727
727
|
responseFormatHint: m,
|
|
728
728
|
responseFormatMarkdownLabel: h,
|
|
@@ -738,9 +738,9 @@ var q = {
|
|
|
738
738
|
tooltip: C,
|
|
739
739
|
hideTooltip: D || !C,
|
|
740
740
|
triggerClassName: "w-full",
|
|
741
|
-
children: /* @__PURE__ */ B(
|
|
741
|
+
children: /* @__PURE__ */ B(te, {
|
|
742
742
|
label: S,
|
|
743
|
-
onClick:
|
|
743
|
+
onClick: j,
|
|
744
744
|
disabled: !D,
|
|
745
745
|
className: "w-full"
|
|
746
746
|
})
|
|
@@ -748,7 +748,7 @@ var q = {
|
|
|
748
748
|
})]
|
|
749
749
|
});
|
|
750
750
|
}, ht = { modal: "_modal_kl0h0_1" }, gt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: l, responseFormatHint: u, responseFormatMarkdownLabel: d, responseFormatPlainTextLabel: f, systemPromptLabel: p, systemPromptTooltip: m, temperatureLabel: h, temperatureLabels: _, temperatureHint: v, saveLabel: y = "Apply changes", saveDisabledTooltip: b, backgroundClassName: x = ht.modal, colors: S }) => {
|
|
751
|
-
let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt:
|
|
751
|
+
let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = ft({
|
|
752
752
|
features: e,
|
|
753
753
|
initialResponseFormat: t,
|
|
754
754
|
initialSystemPrompt: n,
|
|
@@ -756,18 +756,18 @@ var q = {
|
|
|
756
756
|
onSave: i,
|
|
757
757
|
onClose: a
|
|
758
758
|
});
|
|
759
|
-
return /* @__PURE__ */ B(
|
|
759
|
+
return /* @__PURE__ */ B(P, {
|
|
760
760
|
open: !0,
|
|
761
761
|
header: o,
|
|
762
762
|
titleClassName: s,
|
|
763
|
-
size:
|
|
763
|
+
size: ee.Sm,
|
|
764
764
|
onClose: a,
|
|
765
765
|
className: x,
|
|
766
766
|
overlayStyle: c({ "--csm-bg": S?.background }),
|
|
767
767
|
mainButtons: [{
|
|
768
768
|
label: y,
|
|
769
769
|
variant: g.Primary,
|
|
770
|
-
onClick:
|
|
770
|
+
onClick: A,
|
|
771
771
|
disabled: !E,
|
|
772
772
|
tooltipProps: b ? {
|
|
773
773
|
tooltip: b,
|
|
@@ -780,8 +780,8 @@ var q = {
|
|
|
780
780
|
systemPrompt: w,
|
|
781
781
|
temperature: T,
|
|
782
782
|
onResponseFormatChange: D,
|
|
783
|
-
onSystemPromptChange:
|
|
784
|
-
onTemperatureChange:
|
|
783
|
+
onSystemPromptChange: O,
|
|
784
|
+
onTemperatureChange: k,
|
|
785
785
|
responseFormatLabel: l,
|
|
786
786
|
responseFormatHint: u,
|
|
787
787
|
responseFormatMarkdownLabel: d,
|
|
@@ -844,23 +844,23 @@ var q = {
|
|
|
844
844
|
}, yt = {
|
|
845
845
|
toolIcon: "_toolIcon_ma5s5_1",
|
|
846
846
|
chevronIcon: "_chevronIcon_ma5s5_5"
|
|
847
|
-
}, bt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: m = "w-[240px]", isDisabled: h = !1, chatSettings: g, extraMenuItems: _, toolsMenuItems: x = [], onToolToggle: S, toolsMenuTitle: w = "Tools", toolsBackLabel: T = "Back", menuOverlays: E, getCaretPosition: D, colors:
|
|
848
|
-
let
|
|
849
|
-
e && (
|
|
850
|
-
}, []), ie = G(
|
|
847
|
+
}, bt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: m = "w-[240px]", isDisabled: h = !1, chatSettings: g, extraMenuItems: _, toolsMenuItems: x = [], onToolToggle: S, toolsMenuTitle: w = "Tools", toolsBackLabel: T = "Back", menuOverlays: E, getCaretPosition: D, colors: k }) => {
|
|
848
|
+
let A = d(), j = f(), [M, N] = K(!1), P = G(0), [ee, te] = K(!1), [F, ne] = K(!1), [I, L] = K(!1), [R, re] = K(null), z = H((e) => {
|
|
849
|
+
e && (P.current = 0), te(e), e || (L(!1), re(null));
|
|
850
|
+
}, []), ie = G(j);
|
|
851
851
|
U(() => {
|
|
852
|
-
ie.current !==
|
|
852
|
+
ie.current !== j && (ie.current = j, j ? (N(ee && !I && R === null), te(!1)) : (P.current = I || R !== null ? -1 : 0, te(M || I || R !== null), N(!1)));
|
|
853
853
|
}, [
|
|
854
|
-
A,
|
|
855
|
-
te,
|
|
856
854
|
j,
|
|
855
|
+
ee,
|
|
856
|
+
M,
|
|
857
857
|
I,
|
|
858
858
|
R
|
|
859
859
|
]);
|
|
860
860
|
let ae = W(() => c({
|
|
861
|
-
"--aab-tool-icon":
|
|
862
|
-
"--aab-chevron-icon":
|
|
863
|
-
}), [
|
|
861
|
+
"--aab-tool-icon": k?.toolIcon,
|
|
862
|
+
"--aab-chevron-icon": k?.chevronIcon
|
|
863
|
+
}), [k?.toolIcon, k?.chevronIcon]), oe = x.length > 0 && S != null, se = W(() => x.map((e) => ({
|
|
864
864
|
key: e.id,
|
|
865
865
|
label: e.label,
|
|
866
866
|
icon: /* @__PURE__ */ B("span", {
|
|
@@ -869,7 +869,7 @@ var q = {
|
|
|
869
869
|
children: e.icon
|
|
870
870
|
}),
|
|
871
871
|
selectable: !0,
|
|
872
|
-
mark:
|
|
872
|
+
mark: O.Check,
|
|
873
873
|
checked: e.isSelected,
|
|
874
874
|
onClick: () => S?.(e.id)
|
|
875
875
|
})), [
|
|
@@ -896,10 +896,10 @@ var q = {
|
|
|
896
896
|
"aria-hidden": !0,
|
|
897
897
|
stroke: y
|
|
898
898
|
}),
|
|
899
|
-
onClick:
|
|
899
|
+
onClick: j ? () => {
|
|
900
900
|
L(!0);
|
|
901
901
|
} : () => void 0,
|
|
902
|
-
...
|
|
902
|
+
...j ? { iconAfter: /* @__PURE__ */ B(_e, {
|
|
903
903
|
size: p,
|
|
904
904
|
stroke: y,
|
|
905
905
|
style: ae,
|
|
@@ -917,10 +917,10 @@ var q = {
|
|
|
917
917
|
key: e.key,
|
|
918
918
|
label: e.title,
|
|
919
919
|
icon: e.icon,
|
|
920
|
-
onClick:
|
|
920
|
+
onClick: j ? () => {
|
|
921
921
|
re(e.key);
|
|
922
922
|
} : () => void 0,
|
|
923
|
-
...
|
|
923
|
+
...j ? { iconAfter: /* @__PURE__ */ B(_e, {
|
|
924
924
|
size: p,
|
|
925
925
|
stroke: y,
|
|
926
926
|
style: ae,
|
|
@@ -954,14 +954,14 @@ var q = {
|
|
|
954
954
|
"aria-hidden": !0,
|
|
955
955
|
stroke: y
|
|
956
956
|
}),
|
|
957
|
-
iconAfter:
|
|
957
|
+
iconAfter: A ? /* @__PURE__ */ B(_e, {
|
|
958
958
|
size: p,
|
|
959
959
|
stroke: y,
|
|
960
960
|
style: ae,
|
|
961
961
|
className: l("rtl:scale-x-[-1]", yt.chevronIcon),
|
|
962
962
|
"aria-hidden": !0
|
|
963
963
|
}) : null,
|
|
964
|
-
onClick: () =>
|
|
964
|
+
onClick: () => ne(!0)
|
|
965
965
|
}]
|
|
966
966
|
], [
|
|
967
967
|
z,
|
|
@@ -971,8 +971,8 @@ var q = {
|
|
|
971
971
|
n,
|
|
972
972
|
g,
|
|
973
973
|
_,
|
|
974
|
-
k,
|
|
975
974
|
A,
|
|
975
|
+
j,
|
|
976
976
|
oe,
|
|
977
977
|
I,
|
|
978
978
|
R,
|
|
@@ -987,11 +987,11 @@ var q = {
|
|
|
987
987
|
matchReferenceWidth: !1,
|
|
988
988
|
placement: "bottom-start",
|
|
989
989
|
listClassName: m,
|
|
990
|
-
initialFocus:
|
|
990
|
+
initialFocus: P.current,
|
|
991
991
|
overlayAriaLabel: i,
|
|
992
992
|
items: ce,
|
|
993
993
|
disabled: h,
|
|
994
|
-
open:
|
|
994
|
+
open: ee,
|
|
995
995
|
onOpenChange: z,
|
|
996
996
|
children: /* @__PURE__ */ B(C, {
|
|
997
997
|
icon: /* @__PURE__ */ B(Se, {
|
|
@@ -1006,7 +1006,7 @@ var q = {
|
|
|
1006
1006
|
})
|
|
1007
1007
|
});
|
|
1008
1008
|
return /* @__PURE__ */ V(le, { children: [
|
|
1009
|
-
|
|
1009
|
+
j ? /* @__PURE__ */ V(le, { children: [
|
|
1010
1010
|
/* @__PURE__ */ B(C, {
|
|
1011
1011
|
icon: /* @__PURE__ */ B(Se, {
|
|
1012
1012
|
size: v.LG,
|
|
@@ -1016,13 +1016,13 @@ var q = {
|
|
|
1016
1016
|
"aria-label": i,
|
|
1017
1017
|
tooltipProps: { tooltip: i },
|
|
1018
1018
|
disabled: h,
|
|
1019
|
-
onClick: () =>
|
|
1019
|
+
onClick: () => N(!0)
|
|
1020
1020
|
}),
|
|
1021
1021
|
/* @__PURE__ */ B(dt, {
|
|
1022
|
-
isOpen:
|
|
1022
|
+
isOpen: M,
|
|
1023
1023
|
title: a,
|
|
1024
1024
|
closeLabel: s,
|
|
1025
|
-
onClose: () =>
|
|
1025
|
+
onClose: () => N(!1),
|
|
1026
1026
|
style: u,
|
|
1027
1027
|
items: ce,
|
|
1028
1028
|
className: "pb-4",
|
|
@@ -1031,7 +1031,7 @@ var q = {
|
|
|
1031
1031
|
oe && /* @__PURE__ */ B(vt, {
|
|
1032
1032
|
isOpen: I,
|
|
1033
1033
|
onBack: () => {
|
|
1034
|
-
L(!1),
|
|
1034
|
+
L(!1), N(!0);
|
|
1035
1035
|
},
|
|
1036
1036
|
backLabel: T,
|
|
1037
1037
|
onClose: () => z(!1),
|
|
@@ -1046,7 +1046,7 @@ var q = {
|
|
|
1046
1046
|
title: e.title,
|
|
1047
1047
|
closeLabel: s,
|
|
1048
1048
|
onBack: () => {
|
|
1049
|
-
re(null),
|
|
1049
|
+
re(null), N(!0);
|
|
1050
1050
|
},
|
|
1051
1051
|
backLabel: e.backLabel ?? "Back",
|
|
1052
1052
|
onClose: () => z(!1),
|
|
@@ -1058,13 +1058,13 @@ var q = {
|
|
|
1058
1058
|
})
|
|
1059
1059
|
}, e.key))
|
|
1060
1060
|
] }) : /* @__PURE__ */ B(le, { children: ue }),
|
|
1061
|
-
|
|
1062
|
-
isOpen:
|
|
1061
|
+
A && g != null && /* @__PURE__ */ B(mt, {
|
|
1062
|
+
isOpen: F,
|
|
1063
1063
|
onBack: () => {
|
|
1064
|
-
|
|
1064
|
+
ne(!1), j ? N(!0) : te(!0);
|
|
1065
1065
|
},
|
|
1066
1066
|
backLabel: g.backLabel ?? "Back",
|
|
1067
|
-
onClose: () =>
|
|
1067
|
+
onClose: () => ne(!1),
|
|
1068
1068
|
closeLabel: s,
|
|
1069
1069
|
style: u,
|
|
1070
1070
|
features: g.features,
|
|
@@ -1085,13 +1085,13 @@ var q = {
|
|
|
1085
1085
|
saveLabel: g.saveLabel,
|
|
1086
1086
|
saveDisabledTooltip: g.saveDisabledTooltip
|
|
1087
1087
|
}),
|
|
1088
|
-
!
|
|
1088
|
+
!A && g != null && F && /* @__PURE__ */ B(gt, {
|
|
1089
1089
|
features: g.features,
|
|
1090
1090
|
initialResponseFormat: g.responseFormat ?? o.Markdown,
|
|
1091
1091
|
initialSystemPrompt: g.systemPrompt,
|
|
1092
1092
|
initialTemperature: g.temperature,
|
|
1093
1093
|
onSave: g.onSave,
|
|
1094
|
-
onClose: () =>
|
|
1094
|
+
onClose: () => ne(!1),
|
|
1095
1095
|
title: g.title,
|
|
1096
1096
|
responseFormatLabel: g.responseFormatLabel,
|
|
1097
1097
|
responseFormatHint: g.responseFormatHint,
|
|
@@ -1255,7 +1255,7 @@ var q = {
|
|
|
1255
1255
|
let x = /* @__PURE__ */ V("div", {
|
|
1256
1256
|
className: "flex shrink-0 items-center justify-end gap-1",
|
|
1257
1257
|
children: [
|
|
1258
|
-
/* @__PURE__ */ B(
|
|
1258
|
+
/* @__PURE__ */ B(A, {
|
|
1259
1259
|
icon: /* @__PURE__ */ B(Te, {
|
|
1260
1260
|
size: v.LG,
|
|
1261
1261
|
"aria-hidden": !0,
|
|
@@ -1265,7 +1265,7 @@ var q = {
|
|
|
1265
1265
|
className: "mobile:min-h-11 mobile:min-w-11",
|
|
1266
1266
|
onClick: r
|
|
1267
1267
|
}),
|
|
1268
|
-
g && /* @__PURE__ */ B(
|
|
1268
|
+
g && /* @__PURE__ */ B(F, {
|
|
1269
1269
|
icon: /* @__PURE__ */ B(he, {
|
|
1270
1270
|
size: v.LG,
|
|
1271
1271
|
"aria-hidden": !0,
|
|
@@ -1307,7 +1307,7 @@ var q = {
|
|
|
1307
1307
|
})]
|
|
1308
1308
|
})
|
|
1309
1309
|
});
|
|
1310
|
-
}, kt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ B(
|
|
1310
|
+
}, kt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ B(F, {
|
|
1311
1311
|
"aria-label": n,
|
|
1312
1312
|
onClick: () => e?.(),
|
|
1313
1313
|
disabled: t,
|
|
@@ -1317,7 +1317,7 @@ var q = {
|
|
|
1317
1317
|
className: "rtl:scale-x-[-1]",
|
|
1318
1318
|
stroke: y
|
|
1319
1319
|
})
|
|
1320
|
-
}), At = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ B(
|
|
1320
|
+
}), At = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ B(A, {
|
|
1321
1321
|
icon: /* @__PURE__ */ B(xe, {
|
|
1322
1322
|
size: v.LG,
|
|
1323
1323
|
stroke: y
|
|
@@ -1393,7 +1393,7 @@ var q = {
|
|
|
1393
1393
|
maxLines: 1
|
|
1394
1394
|
}),
|
|
1395
1395
|
icon: It(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1396
|
-
mark:
|
|
1396
|
+
mark: O.Check,
|
|
1397
1397
|
checked: r,
|
|
1398
1398
|
className: l(o?.itemText && Lt.itemText, o?.itemHoverBackground && Lt.itemHover, r && o?.selectedItemBackground && Lt.selectedItemBackground, r && o?.selectedItemText && Lt.selectedItemText, r && o?.checkIcon && Lt.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, q.modelMenuItem, r && q.modelMenuItemSelected),
|
|
1399
1399
|
onClick: () => n?.(e.id)
|
|
@@ -1774,12 +1774,12 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1774
1774
|
containerSize: y,
|
|
1775
1775
|
itemCount: o,
|
|
1776
1776
|
overscanCount: u
|
|
1777
|
-
})), { startIndexVisible: D, startIndexOverscan:
|
|
1777
|
+
})), { startIndexVisible: D, startIndexOverscan: O, stopIndexVisible: k, stopIndexOverscan: A } = {
|
|
1778
1778
|
startIndexVisible: Math.min(o - 1, T.startIndexVisible),
|
|
1779
1779
|
startIndexOverscan: Math.min(o - 1, T.startIndexOverscan),
|
|
1780
1780
|
stopIndexVisible: Math.min(o - 1, T.stopIndexVisible),
|
|
1781
1781
|
stopIndexOverscan: Math.min(o - 1, T.stopIndexOverscan)
|
|
1782
|
-
},
|
|
1782
|
+
}, j = H(() => rn({
|
|
1783
1783
|
cachedBounds: x,
|
|
1784
1784
|
itemCount: o,
|
|
1785
1785
|
itemSize: b
|
|
@@ -1787,7 +1787,7 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1787
1787
|
x,
|
|
1788
1788
|
o,
|
|
1789
1789
|
b
|
|
1790
|
-
]),
|
|
1790
|
+
]), M = H((t) => {
|
|
1791
1791
|
let n = Kt({
|
|
1792
1792
|
containerElement: e,
|
|
1793
1793
|
direction: i,
|
|
@@ -1809,9 +1809,9 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1809
1809
|
a,
|
|
1810
1810
|
o,
|
|
1811
1811
|
u
|
|
1812
|
-
]),
|
|
1812
|
+
]), N = G(!1);
|
|
1813
1813
|
X(() => {
|
|
1814
|
-
if (!e || o === 0 || f ||
|
|
1814
|
+
if (!e || o === 0 || f || N.current || (N.current = !0, r <= 0)) return;
|
|
1815
1815
|
let t = i === "horizontal" && zt(e);
|
|
1816
1816
|
if (Kt({
|
|
1817
1817
|
containerElement: e,
|
|
@@ -1831,7 +1831,7 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1831
1831
|
}) : i === "vertical" ? e.scrollTop = n : e.scrollLeft = n;
|
|
1832
1832
|
}, [e, o]), X(() => {
|
|
1833
1833
|
if (f && e && p) return;
|
|
1834
|
-
let t = e && !f ?
|
|
1834
|
+
let t = e && !f ? M(i === "vertical" ? e.scrollTop : e.scrollLeft) : on({
|
|
1835
1835
|
cachedBounds: x,
|
|
1836
1836
|
containerScrollOffset: C,
|
|
1837
1837
|
containerSize: y,
|
|
@@ -1844,7 +1844,7 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1844
1844
|
e,
|
|
1845
1845
|
y,
|
|
1846
1846
|
i,
|
|
1847
|
-
|
|
1847
|
+
M,
|
|
1848
1848
|
C,
|
|
1849
1849
|
f,
|
|
1850
1850
|
o,
|
|
@@ -1882,7 +1882,7 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1882
1882
|
o,
|
|
1883
1883
|
u
|
|
1884
1884
|
]);
|
|
1885
|
-
let
|
|
1885
|
+
let P = Ut(() => {
|
|
1886
1886
|
if (!e || !p) return;
|
|
1887
1887
|
let { offset: t, size: n, viewportSize: r } = $t({
|
|
1888
1888
|
containerElement: e,
|
|
@@ -1901,10 +1901,10 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1901
1901
|
E((e) => nn(s, e) ? e : s);
|
|
1902
1902
|
});
|
|
1903
1903
|
return X(() => {
|
|
1904
|
-
f &&
|
|
1904
|
+
f && P();
|
|
1905
1905
|
}), X(() => {
|
|
1906
1906
|
if (!f || !e || !p) return;
|
|
1907
|
-
let t = Ht(e), n = () =>
|
|
1907
|
+
let t = Ht(e), n = () => P();
|
|
1908
1908
|
p.addEventListener("scroll", n, { passive: !0 }), e.addEventListener("scroll", n, { passive: !0 }), t.addEventListener("resize", n);
|
|
1909
1909
|
let r, i = Z(e);
|
|
1910
1910
|
i && !Jt(p) && (r = new i(n), r.observe(p));
|
|
@@ -1920,10 +1920,10 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1920
1920
|
e,
|
|
1921
1921
|
f,
|
|
1922
1922
|
p,
|
|
1923
|
-
|
|
1923
|
+
P
|
|
1924
1924
|
]), {
|
|
1925
1925
|
getCellBounds: w,
|
|
1926
|
-
getEstimatedSize:
|
|
1926
|
+
getEstimatedSize: j,
|
|
1927
1927
|
getScrollPositionForIndex: Ut(({ align: t = "auto", index: n }) => {
|
|
1928
1928
|
let r = ({ clamp: e, containerScrollOffset: r, containerSize: i, padding: a }) => {
|
|
1929
1929
|
if (a.start === 0 && a.end === 0) return an({
|
|
@@ -1946,7 +1946,7 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1946
1946
|
itemCount: o,
|
|
1947
1947
|
itemSize: b
|
|
1948
1948
|
}) - a.start;
|
|
1949
|
-
return e ? Math.max(0, Math.min(
|
|
1949
|
+
return e ? Math.max(0, Math.min(j() - i, s)) : s;
|
|
1950
1950
|
};
|
|
1951
1951
|
if (f && e && p && !Qt(e, i)) {
|
|
1952
1952
|
let { viewportOffset: t, viewportSize: n } = $t({
|
|
@@ -1996,7 +1996,7 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1996
1996
|
isRtl: a,
|
|
1997
1997
|
scrollOffset: l
|
|
1998
1998
|
}), !f && typeof e.scrollTo != "function") {
|
|
1999
|
-
let e =
|
|
1999
|
+
let e = M(l);
|
|
2000
2000
|
nn(T, e) || E(e);
|
|
2001
2001
|
}
|
|
2002
2002
|
return {
|
|
@@ -2006,10 +2006,10 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2006
2006
|
}
|
|
2007
2007
|
}),
|
|
2008
2008
|
scrollTarget: p,
|
|
2009
|
-
startIndexOverscan:
|
|
2009
|
+
startIndexOverscan: O,
|
|
2010
2010
|
startIndexVisible: D,
|
|
2011
|
-
stopIndexOverscan:
|
|
2012
|
-
stopIndexVisible:
|
|
2011
|
+
stopIndexOverscan: A,
|
|
2012
|
+
stopIndexVisible: k
|
|
2013
2013
|
};
|
|
2014
2014
|
}
|
|
2015
2015
|
function dn(e) {
|
|
@@ -2198,7 +2198,7 @@ function wn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2198
2198
|
element: y,
|
|
2199
2199
|
enabled: w
|
|
2200
2200
|
});
|
|
2201
|
-
let { getCellBounds: D, getEstimatedSize:
|
|
2201
|
+
let { getCellBounds: D, getEstimatedSize: O, scrollTarget: k, getScrollPositionForIndex: A, startIndexOverscan: j, startIndexVisible: M, stopIndexOverscan: N, stopIndexVisible: P } = un({
|
|
2202
2202
|
containerElement: y,
|
|
2203
2203
|
containerStyle: h,
|
|
2204
2204
|
defaultContainerSize: n,
|
|
@@ -2210,66 +2210,66 @@ function wn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2210
2210
|
onResize: a,
|
|
2211
2211
|
overscanCount: s,
|
|
2212
2212
|
scrollElement: p
|
|
2213
|
-
}),
|
|
2213
|
+
}), ee = G([]), te = yn({
|
|
2214
2214
|
direction: "vertical",
|
|
2215
2215
|
element: y,
|
|
2216
2216
|
getCellBounds: D,
|
|
2217
2217
|
isDynamicSize: x,
|
|
2218
2218
|
itemCount: l,
|
|
2219
|
-
itemElements:
|
|
2220
|
-
scrollTarget:
|
|
2221
|
-
getScrollPositionForIndex:
|
|
2219
|
+
itemElements: ee,
|
|
2220
|
+
scrollTarget: k,
|
|
2221
|
+
getScrollPositionForIndex: A
|
|
2222
2222
|
});
|
|
2223
2223
|
je(i, () => ({
|
|
2224
2224
|
get element() {
|
|
2225
2225
|
return y;
|
|
2226
2226
|
},
|
|
2227
|
-
scrollToRow:
|
|
2228
|
-
}), [y,
|
|
2229
|
-
let
|
|
2227
|
+
scrollToRow: te
|
|
2228
|
+
}), [y, te]);
|
|
2229
|
+
let F = w && x && j === 0;
|
|
2230
2230
|
X(() => {
|
|
2231
2231
|
if (!y) return;
|
|
2232
2232
|
let e = Array.from(y.children).filter((e) => !e.hasAttribute(Cn)), t = xn({
|
|
2233
2233
|
elements: e,
|
|
2234
|
-
isFlowLayout:
|
|
2234
|
+
isFlowLayout: F,
|
|
2235
2235
|
rowCount: l,
|
|
2236
|
-
startIndex:
|
|
2237
|
-
stopIndex:
|
|
2236
|
+
startIndex: j,
|
|
2237
|
+
stopIndex: N
|
|
2238
2238
|
}), n = t.map(({ element: e }) => e);
|
|
2239
2239
|
if (e.forEach((e) => {
|
|
2240
2240
|
n.includes(e) || e.removeAttribute(pn);
|
|
2241
2241
|
}), t.forEach(({ element: e, index: t }) => {
|
|
2242
2242
|
e.setAttribute(pn, `${t}`);
|
|
2243
|
-
}),
|
|
2243
|
+
}), ee.current = n, x) return u.observeRowElements(n);
|
|
2244
2244
|
}, [
|
|
2245
2245
|
v,
|
|
2246
2246
|
y,
|
|
2247
2247
|
x,
|
|
2248
|
-
|
|
2248
|
+
F,
|
|
2249
2249
|
l,
|
|
2250
2250
|
u,
|
|
2251
2251
|
d,
|
|
2252
2252
|
_,
|
|
2253
|
-
|
|
2254
|
-
|
|
2253
|
+
j,
|
|
2254
|
+
N
|
|
2255
2255
|
]), U(() => {
|
|
2256
|
-
|
|
2256
|
+
j >= 0 && N >= 0 && o && o({
|
|
2257
|
+
startIndex: M,
|
|
2258
|
+
stopIndex: P
|
|
2259
|
+
}, {
|
|
2257
2260
|
startIndex: j,
|
|
2258
2261
|
stopIndex: N
|
|
2259
|
-
}, {
|
|
2260
|
-
startIndex: A,
|
|
2261
|
-
stopIndex: M
|
|
2262
2262
|
});
|
|
2263
2263
|
}, [
|
|
2264
2264
|
o,
|
|
2265
|
-
A,
|
|
2266
2265
|
j,
|
|
2267
2266
|
M,
|
|
2268
|
-
N
|
|
2267
|
+
N,
|
|
2268
|
+
P
|
|
2269
2269
|
]);
|
|
2270
|
-
let
|
|
2270
|
+
let ne = W(() => {
|
|
2271
2271
|
let e = [];
|
|
2272
|
-
if (l > 0) for (let t =
|
|
2272
|
+
if (l > 0) for (let t = j; t <= N; t++) {
|
|
2273
2273
|
let n = D(t);
|
|
2274
2274
|
e.push(/* @__PURE__ */ De(v, {
|
|
2275
2275
|
..._,
|
|
@@ -2280,7 +2280,7 @@ function wn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2280
2280
|
},
|
|
2281
2281
|
key: d ? d(t, _) : t,
|
|
2282
2282
|
index: t,
|
|
2283
|
-
style:
|
|
2283
|
+
style: F ? { width: "100%" } : {
|
|
2284
2284
|
position: "absolute",
|
|
2285
2285
|
left: 0,
|
|
2286
2286
|
transform: `translateY(${n.scrollOffset}px)`,
|
|
@@ -2294,23 +2294,23 @@ function wn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2294
2294
|
v,
|
|
2295
2295
|
D,
|
|
2296
2296
|
x,
|
|
2297
|
-
|
|
2297
|
+
F,
|
|
2298
2298
|
l,
|
|
2299
2299
|
d,
|
|
2300
2300
|
_,
|
|
2301
|
-
|
|
2302
|
-
|
|
2301
|
+
j,
|
|
2302
|
+
N
|
|
2303
2303
|
]), I = /* @__PURE__ */ B("div", {
|
|
2304
2304
|
"aria-hidden": !0,
|
|
2305
2305
|
[Cn]: "",
|
|
2306
2306
|
style: {
|
|
2307
|
-
position:
|
|
2308
|
-
top:
|
|
2309
|
-
height:
|
|
2307
|
+
position: F ? "absolute" : void 0,
|
|
2308
|
+
top: F ? 0 : void 0,
|
|
2309
|
+
height: O(),
|
|
2310
2310
|
width: "100%",
|
|
2311
2311
|
zIndex: -1
|
|
2312
2312
|
}
|
|
2313
|
-
}, "sizer"), L = /* @__PURE__ */ B(Ee, { children: e }, "children"), R = /* @__PURE__ */ B(Ee, { children:
|
|
2313
|
+
}, "sizer"), L = /* @__PURE__ */ B(Ee, { children: e }, "children"), R = /* @__PURE__ */ B(Ee, { children: ne }, "rows");
|
|
2314
2314
|
return De(m, {
|
|
2315
2315
|
role: "list",
|
|
2316
2316
|
...g,
|
|
@@ -2325,7 +2325,7 @@ function wn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2325
2325
|
},
|
|
2326
2326
|
...h
|
|
2327
2327
|
}
|
|
2328
|
-
}, ...
|
|
2328
|
+
}, ...F ? [L, R] : [R, L], I);
|
|
2329
2329
|
}
|
|
2330
2330
|
var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
2331
2331
|
search: "_search_5skzl_1",
|
|
@@ -2371,17 +2371,17 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2371
2371
|
U(() => {
|
|
2372
2372
|
e || S("");
|
|
2373
2373
|
}, [e]);
|
|
2374
|
-
let E = a && a.length > 0, D = u !== void 0,
|
|
2374
|
+
let E = a && a.length > 0, D = u !== void 0, O = !E && !D ? d ?? f : void 0, k = E ? Ft(a, C) : [], A = (e) => {
|
|
2375
2375
|
s(e), i();
|
|
2376
|
-
},
|
|
2376
|
+
}, j = _?.colors, M = c({
|
|
2377
2377
|
"--ci-sheet-divider": g?.divider,
|
|
2378
|
-
"--ci-sheet-text":
|
|
2379
|
-
"--ci-sheet-item-hover":
|
|
2378
|
+
"--ci-sheet-text": j?.itemText ?? g?.itemText,
|
|
2379
|
+
"--ci-sheet-item-hover": j?.itemHoverBackground ?? g?.itemHoverBg,
|
|
2380
2380
|
"--ci-sheet-item-active": g?.itemActiveBg,
|
|
2381
|
-
"--ci-sheet-icon":
|
|
2382
|
-
"--ci-check-icon":
|
|
2383
|
-
"--ci-sheet-selected-bg":
|
|
2384
|
-
"--ci-sheet-selected-text":
|
|
2381
|
+
"--ci-sheet-icon": j?.itemText ?? g?.itemIcon,
|
|
2382
|
+
"--ci-check-icon": j?.checkIcon ?? g?.checkIcon,
|
|
2383
|
+
"--ci-sheet-selected-bg": j?.selectedItemBackground,
|
|
2384
|
+
"--ci-sheet-selected-text": j?.selectedItemText
|
|
2385
2385
|
});
|
|
2386
2386
|
return /* @__PURE__ */ B(Fe, {
|
|
2387
2387
|
isOpen: e,
|
|
@@ -2394,7 +2394,7 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2394
2394
|
colors: g?.shell,
|
|
2395
2395
|
children: /* @__PURE__ */ V("div", {
|
|
2396
2396
|
className: "contents",
|
|
2397
|
-
style:
|
|
2397
|
+
style: M,
|
|
2398
2398
|
children: [
|
|
2399
2399
|
/* @__PURE__ */ B(T, {
|
|
2400
2400
|
visuallyHidden: !0,
|
|
@@ -2410,27 +2410,27 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2410
2410
|
onChange: (e) => w(e ?? "")
|
|
2411
2411
|
})
|
|
2412
2412
|
}), /* @__PURE__ */ B("div", { className: l(En.divider, "h-px shrink-0") })] }),
|
|
2413
|
-
D ? /* @__PURE__ */ B(Nt, {}) :
|
|
2413
|
+
D ? /* @__PURE__ */ B(Nt, {}) : O ? /* @__PURE__ */ B("div", {
|
|
2414
2414
|
role: "list",
|
|
2415
2415
|
className: l(En.stateLabel, h, "px-4 py-4"),
|
|
2416
|
-
children:
|
|
2416
|
+
children: O
|
|
2417
2417
|
}) : /* @__PURE__ */ B(Tn, {
|
|
2418
2418
|
role: "list",
|
|
2419
2419
|
className: "overflow-y-auto",
|
|
2420
|
-
style: { height: Math.min(
|
|
2420
|
+
style: { height: Math.min(k.length, On) * Dn },
|
|
2421
2421
|
rowComponent: kn,
|
|
2422
|
-
rowCount:
|
|
2422
|
+
rowCount: k.length,
|
|
2423
2423
|
rowHeight: Dn,
|
|
2424
2424
|
rowProps: {
|
|
2425
|
-
items:
|
|
2425
|
+
items: k,
|
|
2426
2426
|
selectedDeploymentId: o,
|
|
2427
2427
|
labelClassName: h,
|
|
2428
2428
|
query: C,
|
|
2429
2429
|
itemClassName: _?.itemClassName,
|
|
2430
2430
|
selectedItemClassName: _?.selectedItemClassName,
|
|
2431
|
-
hasSelectedBackground: !!
|
|
2432
|
-
hasSelectedText: !!
|
|
2433
|
-
onSelect:
|
|
2431
|
+
hasSelectedBackground: !!j?.selectedItemBackground,
|
|
2432
|
+
hasSelectedText: !!j?.selectedItemText,
|
|
2433
|
+
onSelect: A
|
|
2434
2434
|
}
|
|
2435
2435
|
})
|
|
2436
2436
|
]
|
|
@@ -2438,8 +2438,8 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2438
2438
|
});
|
|
2439
2439
|
}, jn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, nameClassName: a = "dial-small-text", versionClassName: o = "dial-tiny-text", isStreaming: u, isMobile: d, isDisabled: f = !1, style: p, modelPickerOverlay: m, isPickerOpen: g, onPickerToggle: _, onPickerOpenChange: x }) => {
|
|
2440
2440
|
let [S, w] = K(!1), T = g ?? S, E = (e) => {
|
|
2441
|
-
w(e), x?.(e),
|
|
2442
|
-
}, { searchQuery: D, onSearchQueryChange:
|
|
2441
|
+
w(e), x?.(e), te(e);
|
|
2442
|
+
}, { searchQuery: D, onSearchQueryChange: O, selectorIcon: k, selectorAriaLabel: A, selectedLabel: j, selectedVersion: M, menuItems: N, menuHeader: P, menuStyle: ee, onOpenChange: te } = Rt({
|
|
2443
2443
|
deployments: e,
|
|
2444
2444
|
selectedDeploymentId: t,
|
|
2445
2445
|
onDeploymentChange: n,
|
|
@@ -2447,27 +2447,27 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2447
2447
|
styles: i
|
|
2448
2448
|
});
|
|
2449
2449
|
if (!e) return null;
|
|
2450
|
-
let
|
|
2450
|
+
let F = u || f, ne = F ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, I = /* @__PURE__ */ B(ge, {
|
|
2451
2451
|
size: v.SM,
|
|
2452
2452
|
className: l(Y.modelSelectorCaret, q.modelSelectorCaret),
|
|
2453
2453
|
"aria-hidden": !0,
|
|
2454
2454
|
stroke: y
|
|
2455
2455
|
}), L = /* @__PURE__ */ B("span", {
|
|
2456
2456
|
className: l("flex shrink-0 items-center", q.modelSelectorIcon),
|
|
2457
|
-
children:
|
|
2457
|
+
children: k
|
|
2458
2458
|
});
|
|
2459
2459
|
if (d) return /* @__PURE__ */ V(le, { children: [/* @__PURE__ */ B(C, {
|
|
2460
|
-
tooltipProps: { tooltip:
|
|
2460
|
+
tooltipProps: { tooltip: j },
|
|
2461
2461
|
icon: /* @__PURE__ */ V("div", {
|
|
2462
2462
|
className: "flex items-center gap-1",
|
|
2463
2463
|
children: [L, I]
|
|
2464
2464
|
}),
|
|
2465
|
-
"aria-label":
|
|
2466
|
-
"aria-disabled":
|
|
2465
|
+
"aria-label": A,
|
|
2466
|
+
"aria-disabled": F || void 0,
|
|
2467
2467
|
onClick: () => {
|
|
2468
|
-
|
|
2468
|
+
F || E(!0);
|
|
2469
2469
|
},
|
|
2470
|
-
className: l("w-[50px]", Y.modelSelectorButton,
|
|
2470
|
+
className: l("w-[50px]", Y.modelSelectorButton, ne, q.modelSelectorButton)
|
|
2471
2471
|
}), m ? /* @__PURE__ */ B(Fe, {
|
|
2472
2472
|
isOpen: T,
|
|
2473
2473
|
title: r?.ariaLabel ?? "Select model",
|
|
@@ -2478,7 +2478,7 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2478
2478
|
children: m(() => E(!1))
|
|
2479
2479
|
}) : /* @__PURE__ */ B(An, {
|
|
2480
2480
|
searchQuery: D,
|
|
2481
|
-
onSearchQueryChange:
|
|
2481
|
+
onSearchQueryChange: O,
|
|
2482
2482
|
isOpen: T,
|
|
2483
2483
|
title: r?.ariaLabel ?? "Select model",
|
|
2484
2484
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -2494,7 +2494,7 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2494
2494
|
menuStyles: i
|
|
2495
2495
|
})] });
|
|
2496
2496
|
if (m) {
|
|
2497
|
-
let e =
|
|
2497
|
+
let e = M ? `${j} · ${M}` : j;
|
|
2498
2498
|
return /* @__PURE__ */ B(b, {
|
|
2499
2499
|
placement: "top-end",
|
|
2500
2500
|
matchReferenceWidth: !1,
|
|
@@ -2506,12 +2506,12 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2506
2506
|
listClassName: l("w-[368px]!", Y.modelOverlayPanel, i?.className, q.modelMenu),
|
|
2507
2507
|
listStyle: c({ "--ci-model-overlay-bg": i?.colors?.overlayBackground }),
|
|
2508
2508
|
children: /* @__PURE__ */ B(h, {
|
|
2509
|
-
"aria-label":
|
|
2510
|
-
"aria-disabled":
|
|
2509
|
+
"aria-label": A,
|
|
2510
|
+
"aria-disabled": F || void 0,
|
|
2511
2511
|
tooltipProps: { tooltip: e },
|
|
2512
|
-
className: l("h-auto min-w-0 gap-1.5 rounded-full! border-0! px-0 py-1.5 ps-1.5 pe-2", Y.modelSelectorButton,
|
|
2512
|
+
className: l("h-auto min-w-0 gap-1.5 rounded-full! border-0! px-0 py-1.5 ps-1.5 pe-2", Y.modelSelectorButton, ne, F && Y.modelSelectorButtonDisabled, q.modelSelectorButton),
|
|
2513
2513
|
onClick: () => {
|
|
2514
|
-
|
|
2514
|
+
F || (_ ? _() : E(!T));
|
|
2515
2515
|
},
|
|
2516
2516
|
iconBefore: L,
|
|
2517
2517
|
iconAfter: I,
|
|
@@ -2520,40 +2520,40 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2520
2520
|
className: "flex max-w-[180px] min-w-0 items-baseline gap-1",
|
|
2521
2521
|
children: [/* @__PURE__ */ B("span", {
|
|
2522
2522
|
className: l("max-w-[180px] shrink-0 truncate", a, Y.modelSelectorName),
|
|
2523
|
-
children: A
|
|
2524
|
-
}), j && /* @__PURE__ */ B("span", {
|
|
2525
|
-
className: l("min-w-0 truncate", o, Y.modelSelectorVersion),
|
|
2526
2523
|
children: j
|
|
2524
|
+
}), M && /* @__PURE__ */ B("span", {
|
|
2525
|
+
className: l("min-w-0 truncate", o, Y.modelSelectorVersion),
|
|
2526
|
+
children: M
|
|
2527
2527
|
})]
|
|
2528
2528
|
})
|
|
2529
2529
|
})
|
|
2530
2530
|
});
|
|
2531
2531
|
}
|
|
2532
2532
|
return /* @__PURE__ */ B("div", {
|
|
2533
|
-
className: l(
|
|
2534
|
-
"aria-disabled":
|
|
2533
|
+
className: l(ne),
|
|
2534
|
+
"aria-disabled": F || void 0,
|
|
2535
2535
|
children: /* @__PURE__ */ B(b, {
|
|
2536
|
-
items:
|
|
2537
|
-
menuHeader:
|
|
2536
|
+
items: N,
|
|
2537
|
+
menuHeader: P,
|
|
2538
2538
|
placement: "bottom-end",
|
|
2539
2539
|
matchReferenceWidth: !1,
|
|
2540
2540
|
maxDropdownHeight: s,
|
|
2541
2541
|
listClassName: l("w-[240px]!", i?.className, q.modelMenu),
|
|
2542
|
-
listStyle:
|
|
2543
|
-
disabled:
|
|
2542
|
+
listStyle: ee,
|
|
2543
|
+
disabled: F,
|
|
2544
2544
|
open: T,
|
|
2545
|
-
onOpenChange:
|
|
2545
|
+
onOpenChange: F ? void 0 : E,
|
|
2546
2546
|
children: /* @__PURE__ */ B(h, {
|
|
2547
|
-
"aria-label":
|
|
2548
|
-
"aria-disabled":
|
|
2549
|
-
tooltipProps: { tooltip:
|
|
2547
|
+
"aria-label": A,
|
|
2548
|
+
"aria-disabled": F || void 0,
|
|
2549
|
+
tooltipProps: { tooltip: j },
|
|
2550
2550
|
iconBefore: L,
|
|
2551
2551
|
iconAfter: I,
|
|
2552
|
-
className: l("h-auto gap-1 rounded-full! border-0! p-1.5", Y.modelSelectorButton,
|
|
2552
|
+
className: l("h-auto gap-1 rounded-full! border-0! p-1.5", Y.modelSelectorButton, F && Y.modelSelectorButtonDisabled, q.modelSelectorButton)
|
|
2553
2553
|
})
|
|
2554
2554
|
})
|
|
2555
2555
|
});
|
|
2556
|
-
}, Mn = Oe(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: u, onAttachmentsChange: m, placeholder: h = "Type a message...", ariaLabel: g, attachLabel: _ = "Attach file", fileAccept: x, addMenuTitle: w = "Add", menuTitle:
|
|
2556
|
+
}, Mn = Oe(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: u, onAttachmentsChange: m, placeholder: h = "Type a message...", ariaLabel: g, attachLabel: _ = "Attach file", fileAccept: x, addMenuTitle: w = "Add", menuTitle: O = "Menu", menuCloseLabel: k = "Close", removeLabel: A, retryLabel: j, uploadingLabel: M, expandLabel: N, clickLabel: P, sendLabel: ee, sendTooltip: te, emptyMessageTooltip: F, stopLabel: ne, micLabel: I = "Dictate", recordVoiceLabel: L = "Record voice", stopRecordingLabel: R, discardRecordingLabel: re, colors: z, typography: ie, attachmentTray: ae, modelMenu: oe, className: se, pendingDropFiles: ce = [], onDropFilesConsumed: de, pendingAttachments: fe = [], onPendingAttachmentsConsumed: me, pasteTextThreshold: he = 4e3, maxMessageLength: ge = 5e4, deployments: _e, selectedDeploymentId: be, onDeploymentChange: xe, modelSelectorLabels: Se, initialAttachments: Ce = [], hideAddButton: we = !1, hideAttachFile: Te = !1, hideActionBar: Ee = !1, actionRowLayout: De = lt.Stacked, isInlineActionRowAllowedBelowDesktop: Oe = !1, renderFooterActions: ke, isInputDisabled: Ae = !1, isModelSelectorDisabled: Ne = !1, isSendDisabled: Pe = !1, isAudioMessageSupported: Fe = !1, isVoiceRecordingSupported: Ie = Fe, onTranscribeAudio: Re, transcribingLabel: ze, voiceErrorLabel: Be, sendOnEnter: Ve = ct.Enter, prefixAttachments: We = [], onRemovePrefixAttachment: Ge, chatSettings: Je, toolsMenuItems: Ye, onToolToggle: $e, canRemoveTools: rt = !0, toolsMenuTitle: it, toolsBackLabel: at, toolsChipLabels: ot, menuOverlays: ut, activeMentions: dt, onBackspaceAtCaret: ft, caretPositionOverride: pt, commandMenu: J, autoFocus: mt = !1, messageHistory: ht, onDialFileSystemClick: gt, dialFileSystemLabel: _t, validateAttachment: vt, onAttachmentClick: yt, modelPickerOverlay: xt, onModelPickerOpenChange: St, maximumAttachmentsAmount: wt, onAttachmentsLimitExceeded: Tt, isAttachmentsEnabled: Et = !0, isTextAttachmentsAllowed: Dt = !0, usageLimitsSlot: jt, onMessageTooLong: Mt }, Nt) => {
|
|
2557
2557
|
let Pt = d(), Ft = f(), [It, Lt] = K(!1), Rt = (e) => {
|
|
2558
2558
|
Lt(e), St?.(e);
|
|
2559
2559
|
}, X = Ke(ht), zt = dt ?? [], Bt = zt.length > 0, Vt = W(() => c({
|
|
@@ -2729,11 +2729,12 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2729
2729
|
}, [Zn]);
|
|
2730
2730
|
let Qn = W(() => {
|
|
2731
2731
|
let e = Ye ?? [];
|
|
2732
|
-
return rt ? e.filter((e) => e.isSelected || !Yn.includes(e.id)) : e;
|
|
2732
|
+
return Ft ? e.filter((e) => e.isSelected) : rt ? e.filter((e) => e.isSelected || !Yn.includes(e.id)) : e;
|
|
2733
2733
|
}, [
|
|
2734
2734
|
Ye,
|
|
2735
2735
|
Yn,
|
|
2736
|
-
rt
|
|
2736
|
+
rt,
|
|
2737
|
+
Ft
|
|
2737
2738
|
]), $n = H((e) => {
|
|
2738
2739
|
Xn((t) => t.includes(e) ? t : [...t, e]), Ye?.find((t) => t.id === e)?.isSelected && $e?.(e);
|
|
2739
2740
|
}, [Ye, $e]), er = _e === void 0 || be != null, tr = Fe && !s, nr = async () => {
|
|
@@ -2906,15 +2907,15 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2906
2907
|
onAttachClick: Te ? void 0 : () => Hn.current?.click(),
|
|
2907
2908
|
attachLabel: _,
|
|
2908
2909
|
addMenuTitle: w,
|
|
2909
|
-
menuTitle:
|
|
2910
|
-
menuCloseLabel:
|
|
2910
|
+
menuTitle: O,
|
|
2911
|
+
menuCloseLabel: k,
|
|
2911
2912
|
style: Vt,
|
|
2912
2913
|
isDisabled: Ae || Vn,
|
|
2913
2914
|
chatSettings: Je,
|
|
2914
2915
|
extraMenuItems: Ht,
|
|
2915
2916
|
onRecordVoice: Ie && Et && !s && !Vn ? () => Rn(nt.Attachment) : void 0,
|
|
2916
2917
|
recordVoiceLabel: L,
|
|
2917
|
-
toolsMenuItems: rt ? Ye : void 0,
|
|
2918
|
+
toolsMenuItems: rt || Ft ? Ye : void 0,
|
|
2918
2919
|
onToolToggle: $e,
|
|
2919
2920
|
toolsMenuTitle: it,
|
|
2920
2921
|
toolsBackLabel: at,
|
|
@@ -2948,11 +2949,11 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2948
2949
|
onRetry: Dn,
|
|
2949
2950
|
onExpand: On,
|
|
2950
2951
|
labels: {
|
|
2951
|
-
removeLabel:
|
|
2952
|
-
retryLabel:
|
|
2953
|
-
uploadingLabel:
|
|
2954
|
-
expandLabel:
|
|
2955
|
-
clickLabel:
|
|
2952
|
+
removeLabel: A,
|
|
2953
|
+
retryLabel: j,
|
|
2954
|
+
uploadingLabel: M,
|
|
2955
|
+
expandLabel: N,
|
|
2956
|
+
clickLabel: P
|
|
2956
2957
|
},
|
|
2957
2958
|
styles: {
|
|
2958
2959
|
...ae,
|
|
@@ -3042,12 +3043,12 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
3042
3043
|
}),
|
|
3043
3044
|
s && o ? /* @__PURE__ */ B(At, {
|
|
3044
3045
|
onStop: o,
|
|
3045
|
-
ariaLabel:
|
|
3046
|
+
ariaLabel: ne
|
|
3046
3047
|
}) : !s && /* @__PURE__ */ B(kt, {
|
|
3047
3048
|
onSend: nr,
|
|
3048
3049
|
isDisabled: !er || !Jn,
|
|
3049
|
-
ariaLabel:
|
|
3050
|
-
sendTooltip: qn ?
|
|
3050
|
+
ariaLabel: ee,
|
|
3051
|
+
sendTooltip: qn ? te : F ?? te
|
|
3051
3052
|
})
|
|
3052
3053
|
] })
|
|
3053
3054
|
})
|
|
@@ -3108,11 +3109,11 @@ var Nn = {
|
|
|
3108
3109
|
})
|
|
3109
3110
|
]
|
|
3110
3111
|
});
|
|
3111
|
-
}, Fn = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, sendOnEnter: u, initialAttachments: d = [], onCancel: f, onSave: m, onUploadAttachment: h, cancelLabel: g = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: v, removeLabel: b, retryLabel: x, uploadingLabel: S, expandLabel: C, clickLabel: w, addMenuTitle: T = "Add", attachLabel: E = "Attach file", menuTitle: D = "Menu", menuCloseLabel:
|
|
3112
|
+
}, Fn = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, sendOnEnter: u, initialAttachments: d = [], onCancel: f, onSave: m, onUploadAttachment: h, cancelLabel: g = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: v, removeLabel: b, retryLabel: x, uploadingLabel: S, expandLabel: C, clickLabel: w, addMenuTitle: T = "Add", attachLabel: E = "Attach file", menuTitle: D = "Menu", menuCloseLabel: O = "Close", className: A, pendingDropFiles: j, onDropFilesConsumed: M, validateAttachment: N, isAttachmentsEnabled: P, isTextAttachmentsAllowed: ee, hideAttachFile: F = !1, fileAccept: ne, maximumAttachmentsAmount: I, onAttachmentsLimitExceeded: L, onDialFileSystemClick: R, dialFileSystemLabel: re, pendingAttachments: z, onPendingAttachmentsConsumed: ie, onAttachmentClick: ae, pasteTextThreshold: oe, maxMessageLength: se = 5e4, onMessageTooLong: ce }) => {
|
|
3112
3113
|
let le = G(null), ue = G(null), [de, fe] = K([]);
|
|
3113
3114
|
U(() => {
|
|
3114
|
-
|
|
3115
|
-
}, [
|
|
3115
|
+
j?.length && (fe(j), M?.());
|
|
3116
|
+
}, [j, M]);
|
|
3116
3117
|
let [pe, me] = K(e ?? ""), [he, ge] = K([]), [_e, ye] = K(d), be = he.some((e) => e.status === a.Loading || e.status === a.Error), xe = (pe.trim().length > 0 || he.length > 0 || _e.length > 0) && !be, Se = (e) => {
|
|
3117
3118
|
ye((t) => t.filter((t) => t.id !== e));
|
|
3118
3119
|
}, Ce = H((e, t) => {
|
|
@@ -3135,7 +3136,7 @@ var Nn = {
|
|
|
3135
3136
|
onClick: R
|
|
3136
3137
|
}] : [], [R, re]);
|
|
3137
3138
|
return /* @__PURE__ */ V("div", {
|
|
3138
|
-
className: l("flex w-full flex-col gap-2",
|
|
3139
|
+
className: l("flex w-full flex-col gap-2", A),
|
|
3139
3140
|
children: [/* @__PURE__ */ B(Mn, {
|
|
3140
3141
|
ref: ue,
|
|
3141
3142
|
message: e,
|
|
@@ -3161,9 +3162,9 @@ var Nn = {
|
|
|
3161
3162
|
className: "max-w-full",
|
|
3162
3163
|
prefixAttachments: _e,
|
|
3163
3164
|
onRemovePrefixAttachment: Se,
|
|
3164
|
-
validateAttachment:
|
|
3165
|
-
isAttachmentsEnabled:
|
|
3166
|
-
isTextAttachmentsAllowed:
|
|
3165
|
+
validateAttachment: N,
|
|
3166
|
+
isAttachmentsEnabled: P,
|
|
3167
|
+
isTextAttachmentsAllowed: ee,
|
|
3167
3168
|
maximumAttachmentsAmount: I,
|
|
3168
3169
|
onAttachmentsLimitExceeded: L,
|
|
3169
3170
|
pendingAttachments: z,
|
|
@@ -3176,31 +3177,31 @@ var Nn = {
|
|
|
3176
3177
|
className: "flex items-center justify-between",
|
|
3177
3178
|
children: [/* @__PURE__ */ V("div", {
|
|
3178
3179
|
className: "flex",
|
|
3179
|
-
children: [!
|
|
3180
|
+
children: [!F && /* @__PURE__ */ B("input", {
|
|
3180
3181
|
ref: le,
|
|
3181
3182
|
type: "file",
|
|
3182
3183
|
multiple: !0,
|
|
3183
|
-
accept:
|
|
3184
|
+
accept: ne,
|
|
3184
3185
|
className: "sr-only",
|
|
3185
3186
|
"aria-hidden": !0,
|
|
3186
3187
|
tabIndex: -1,
|
|
3187
3188
|
onChange: De
|
|
3188
|
-
}), (!
|
|
3189
|
-
onAttachClick:
|
|
3189
|
+
}), (!F || (c?.length ?? 0) > 0) && /* @__PURE__ */ B(bt, {
|
|
3190
|
+
onAttachClick: F ? void 0 : () => le.current?.click(),
|
|
3190
3191
|
attachLabel: E,
|
|
3191
3192
|
addMenuTitle: T,
|
|
3192
3193
|
menuTitle: D,
|
|
3193
|
-
menuCloseLabel:
|
|
3194
|
+
menuCloseLabel: O,
|
|
3194
3195
|
extraMenuItems: Oe,
|
|
3195
3196
|
menuOverlays: c,
|
|
3196
3197
|
getCaretPosition: () => ue.current?.getCaretPosition() ?? 0
|
|
3197
3198
|
})]
|
|
3198
3199
|
}), /* @__PURE__ */ V("div", {
|
|
3199
3200
|
className: "flex gap-2",
|
|
3200
|
-
children: [/* @__PURE__ */ B(
|
|
3201
|
+
children: [/* @__PURE__ */ B(k, {
|
|
3201
3202
|
label: g,
|
|
3202
3203
|
onClick: f
|
|
3203
|
-
}), /* @__PURE__ */ B(
|
|
3204
|
+
}), /* @__PURE__ */ B(te, {
|
|
3204
3205
|
label: _,
|
|
3205
3206
|
onClick: we,
|
|
3206
3207
|
disabled: !xe
|
|
@@ -3211,8 +3212,8 @@ var Nn = {
|
|
|
3211
3212
|
}, In = /* @__PURE__ */ function(e) {
|
|
3212
3213
|
return e.Warning = "warning", e.Reached = "reached", e;
|
|
3213
3214
|
}({}), Ln = { banner: "_banner_180n6_2" }, Rn = {
|
|
3214
|
-
[In.Warning]:
|
|
3215
|
-
[In.Reached]:
|
|
3215
|
+
[In.Warning]: N.Warning,
|
|
3216
|
+
[In.Reached]: N.Error
|
|
3216
3217
|
}, zn = ({ severity: e, limitText: t, reset: n, onClose: r, closeAriaLabel: i = "Close notification", limitTextClassName: a = "dial-small-paragraph-semi-text", resetTextClassName: o = "dial-small-paragraph-text", isLiveRegion: s = !0, className: u, colors: d }) => {
|
|
3217
3218
|
let f = /* @__PURE__ */ B("span", {
|
|
3218
3219
|
className: a,
|
|
@@ -3230,10 +3231,10 @@ var Nn = {
|
|
|
3230
3231
|
children: n.ariaLabel
|
|
3231
3232
|
})
|
|
3232
3233
|
] });
|
|
3233
|
-
return /* @__PURE__ */ B(
|
|
3234
|
+
return /* @__PURE__ */ B(j, {
|
|
3234
3235
|
role: s ? "status" : "none",
|
|
3235
3236
|
variant: Rn[e],
|
|
3236
|
-
type:
|
|
3237
|
+
type: M.SectionMessage,
|
|
3237
3238
|
title: p ? f : void 0,
|
|
3238
3239
|
message: p || f,
|
|
3239
3240
|
className: l(Ln.banner, q.usageBanner, u),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-conversation-input",
|
|
3
3
|
"description": "Conversation message input with model selection, attachments, voice input, and edit mode",
|
|
4
|
-
"version": "1.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.331",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"react-window": "^2.5.3",
|
|
21
21
|
"@tabler/icons-react": "^3.50.0",
|
|
22
|
-
"@epam/ai-dial-attachment-input": "1.3.0-dev.
|
|
22
|
+
"@epam/ai-dial-attachment-input": "1.3.0-dev.331"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.331",
|
|
26
26
|
"react": "^19.2.8",
|
|
27
27
|
"@epam/ai-dial-ui-kit": "^0.16.0-dev.72"
|
|
28
28
|
},
|