@epam/ai-dial-conversation-input 1.0.0-dev.481 → 1.0.0-dev.486
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatSettingsFields.d.ts","sourceRoot":"","sources":["../../../src/components/ChatSettingsFields/ChatSettingsFields.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAO3D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatSettingsFields.d.ts","sourceRoot":"","sources":["../../../src/components/ChatSettingsFields/ChatSettingsFields.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAO3D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,sDAAsD;AACtD,MAAM,WAAW,uBAAuB;IACtC,2DAA2D;IAC3D,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,6EAA6E;IAC7E,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,sBAAsB,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,4DAA4D;IAC5D,oBAAoB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,wDAAwD;IACxD,mBAAmB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,+GAA+G;IAC/G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,yEAAyE;IACzE,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kIAAkI;IAClI,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,2GAA2G;AAC3G,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAmE1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAeA,OAAO,EAEL,KAAK,EAAE,EAMR,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAUrD,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAeA,OAAO,EAEL,KAAK,EAAE,EAMR,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAUrD,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CA2ahC,CAAC"}
|
package/index.js
CHANGED
|
@@ -466,7 +466,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
466
466
|
a
|
|
467
467
|
])
|
|
468
468
|
};
|
|
469
|
-
}, He = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: o, onTemperatureChange: s, responseFormatLabel: c = "Response format", responseFormatHint: l = "Applies to new and existing messages", responseFormatMarkdownLabel: u = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: m = "Temperature", temperatureLabels: h = [
|
|
469
|
+
}, He = "!text-[14px] !leading-[20px] font-semibold !text-primary gap-1", Ue = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: o, onTemperatureChange: s, responseFormatLabel: c = "Response format", responseFormatHint: l = "Applies to new and existing messages", responseFormatMarkdownLabel: u = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: m = "Temperature", temperatureLabels: h = [
|
|
470
470
|
"Precise",
|
|
471
471
|
"Neutral",
|
|
472
472
|
"Creative"
|
|
@@ -475,6 +475,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
475
475
|
children: [
|
|
476
476
|
e.responseFormat && /* @__PURE__ */ B(S, {
|
|
477
477
|
fieldTitle: c,
|
|
478
|
+
labelClassName: He,
|
|
478
479
|
elementId: "response-format",
|
|
479
480
|
orientation: j.Column,
|
|
480
481
|
activeRadioButton: t ?? a.Markdown,
|
|
@@ -491,12 +492,16 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
491
492
|
e.systemPrompt && /* @__PURE__ */ B(y, {
|
|
492
493
|
value: n,
|
|
493
494
|
placeholder: p,
|
|
494
|
-
labelProps: {
|
|
495
|
+
labelProps: {
|
|
496
|
+
className: He,
|
|
497
|
+
label: f
|
|
498
|
+
},
|
|
495
499
|
onChange: (e) => o(e ?? "")
|
|
496
500
|
}),
|
|
497
501
|
e.temperature && /* @__PURE__ */ B(E, {
|
|
498
502
|
labelProps: {
|
|
499
503
|
label: m,
|
|
504
|
+
className: He,
|
|
500
505
|
caption: g
|
|
501
506
|
},
|
|
502
507
|
value: r,
|
|
@@ -507,7 +512,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
507
512
|
onChange: s
|
|
508
513
|
})
|
|
509
514
|
]
|
|
510
|
-
}),
|
|
515
|
+
}), We = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: c, initialSystemPrompt: l, 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 }) => {
|
|
511
516
|
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: A, setTemperature: ee, handleSubmit: j } = Ve({
|
|
512
517
|
isOpen: e,
|
|
513
518
|
features: o,
|
|
@@ -525,7 +530,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
525
530
|
onBack: t,
|
|
526
531
|
backLabel: n,
|
|
527
532
|
style: a,
|
|
528
|
-
children: [/* @__PURE__ */ B(
|
|
533
|
+
children: [/* @__PURE__ */ B(Ue, {
|
|
529
534
|
features: o,
|
|
530
535
|
responseFormat: w,
|
|
531
536
|
systemPrompt: T,
|
|
@@ -557,7 +562,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
557
562
|
})
|
|
558
563
|
})]
|
|
559
564
|
});
|
|
560
|
-
},
|
|
565
|
+
}, Ge = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: g = "Apply changes", saveDisabledTooltip: _ }) => {
|
|
561
566
|
let { responseFormat: v, systemPrompt: y, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: E } = Ve({
|
|
562
567
|
features: e,
|
|
563
568
|
initialResponseFormat: t,
|
|
@@ -584,7 +589,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
584
589
|
})
|
|
585
590
|
})
|
|
586
591
|
}),
|
|
587
|
-
children: /* @__PURE__ */ B(
|
|
592
|
+
children: /* @__PURE__ */ B(Ue, {
|
|
588
593
|
features: e,
|
|
589
594
|
responseFormat: v,
|
|
590
595
|
systemPrompt: y,
|
|
@@ -604,10 +609,10 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
604
609
|
})
|
|
605
610
|
});
|
|
606
611
|
};
|
|
607
|
-
me(
|
|
612
|
+
me(Ge);
|
|
608
613
|
//#endregion
|
|
609
614
|
//#region src/components/AddAttachmentButton/AddAttachmentButton.tsx
|
|
610
|
-
var
|
|
615
|
+
var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: i, style: o, listClassName: u = "cp-dropdown-overlay !w-[240px]", isDisabled: d = !1, chatSettings: p, extraMenuItems: m }) => {
|
|
611
616
|
let g = c(), [_, y] = R(!1), [b, x] = R(!1), S = I(() => [
|
|
612
617
|
...e == null ? [] : [{
|
|
613
618
|
key: "attach",
|
|
@@ -662,7 +667,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
662
667
|
className: "pb-4",
|
|
663
668
|
btnTextClassName: "flex-1"
|
|
664
669
|
}),
|
|
665
|
-
p != null && /* @__PURE__ */ B(
|
|
670
|
+
p != null && /* @__PURE__ */ B(We, {
|
|
666
671
|
isOpen: b,
|
|
667
672
|
onBack: () => {
|
|
668
673
|
x(!1), y(!0);
|
|
@@ -704,7 +709,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
704
709
|
className: "size-10 flex-shrink-0",
|
|
705
710
|
disabled: d
|
|
706
711
|
})
|
|
707
|
-
}), p != null && b && /* @__PURE__ */ B(
|
|
712
|
+
}), p != null && b && /* @__PURE__ */ B(Ge, {
|
|
708
713
|
features: p.features,
|
|
709
714
|
initialResponseFormat: p.responseFormat ?? a.Markdown,
|
|
710
715
|
initialSystemPrompt: p.systemPrompt,
|
|
@@ -730,7 +735,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
730
735
|
waveformCanvas: "_waveformCanvas_15iwh_9",
|
|
731
736
|
recordingDot: "_recordingDot_15iwh_17",
|
|
732
737
|
micRecordingIcon: "_micRecordingIcon_15iwh_21"
|
|
733
|
-
},
|
|
738
|
+
}, qe = 3, Je = 6, Ye = .12, Xe = ({ state: e, waveformData: t, errorMessage: n, onStop: r, onConfirm: i, onDiscard: a, stopLabel: o = "Stop recording", confirmLabel: c = "Send voice message", discardLabel: l = "Discard recording", uploadingLabel: u = "Uploading…", style: d, className: p }) => {
|
|
734
739
|
let m = L(null), h = L(null), g = L(!1), y = e === U.Recording, b = e === U.Uploading, x = e === U.Error;
|
|
735
740
|
g.current = y;
|
|
736
741
|
let S = N((e, t) => {
|
|
@@ -741,8 +746,8 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
741
746
|
n.clearRect(0, 0, r, i), n.fillStyle = getComputedStyle(e).color;
|
|
742
747
|
let a = Math.min(1, t * 6), o = Math.max(1, Math.floor(r / 4));
|
|
743
748
|
for (let e = 0; e < o; e++) {
|
|
744
|
-
let t = e / o *
|
|
745
|
-
n.fillRect(e * 4, (i - s) / 2,
|
|
749
|
+
let t = e / o * Je * Math.PI, r = Math.max(Ye, Math.abs(Math.sin(t)) * a), s = Math.max(3, r * i);
|
|
750
|
+
n.fillRect(e * 4, (i - s) / 2, qe, s);
|
|
746
751
|
}
|
|
747
752
|
}, []), C = N((e, t) => {
|
|
748
753
|
let n = e.getContext("2d");
|
|
@@ -754,7 +759,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
754
759
|
let a = Math.max(1, Math.floor(r / 4));
|
|
755
760
|
for (let e = 0; e < a; e++) {
|
|
756
761
|
let r = t[Math.floor(e / a * t.length)] ?? 0, o = Math.min(1, r * 6), s = Math.max(3, o * i);
|
|
757
|
-
n.fillRect(e * 4, (i - s) / 2,
|
|
762
|
+
n.fillRect(e * 4, (i - s) / 2, qe, s);
|
|
758
763
|
}
|
|
759
764
|
}, []);
|
|
760
765
|
P(() => {
|
|
@@ -847,7 +852,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
847
852
|
sendButtonEnter: "_sendButtonEnter_1q2nu_1",
|
|
848
853
|
sendButtonExiting: "_sendButtonExiting_1q2nu_55",
|
|
849
854
|
sendButtonExit: "_sendButtonExit_1q2nu_55"
|
|
850
|
-
},
|
|
855
|
+
}, Ze = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", title: r, isExiting: i = !1 }) => /* @__PURE__ */ B(k, {
|
|
851
856
|
tooltip: r,
|
|
852
857
|
hideTooltip: !r,
|
|
853
858
|
children: /* @__PURE__ */ B("button", {
|
|
@@ -859,7 +864,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
859
864
|
"aria-hidden": i,
|
|
860
865
|
children: /* @__PURE__ */ B(ne, { size: f.LG })
|
|
861
866
|
})
|
|
862
|
-
}),
|
|
867
|
+
}), Qe = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ B("button", {
|
|
863
868
|
className: s("flex cursor-pointer items-center justify-center disabled:cursor-not-allowed"),
|
|
864
869
|
"aria-label": t,
|
|
865
870
|
onClick: () => e?.(),
|
|
@@ -868,12 +873,12 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
868
873
|
size: f.LG,
|
|
869
874
|
className: J.stopIcon
|
|
870
875
|
})
|
|
871
|
-
}),
|
|
876
|
+
}), $e = ({ size: e = 20 }) => /* @__PURE__ */ B(w, {
|
|
872
877
|
variant: T.Circular,
|
|
873
878
|
width: e,
|
|
874
879
|
height: e,
|
|
875
880
|
active: !0
|
|
876
|
-
}),
|
|
881
|
+
}), et = ({ loadingLabel: e }) => /* @__PURE__ */ V("span", {
|
|
877
882
|
className: "flex min-w-0 flex-1 items-center",
|
|
878
883
|
children: [/* @__PURE__ */ B(w, {
|
|
879
884
|
variant: T.Text,
|
|
@@ -884,24 +889,24 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
884
889
|
className: "sr-only",
|
|
885
890
|
children: e
|
|
886
891
|
})]
|
|
887
|
-
}),
|
|
892
|
+
}), tt = ({ loadingLabel: e }) => /* @__PURE__ */ B("div", {
|
|
888
893
|
role: "status",
|
|
889
894
|
"aria-label": e,
|
|
890
895
|
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ V("div", {
|
|
891
896
|
className: "flex h-11 items-center gap-3 px-4",
|
|
892
897
|
"aria-hidden": "true",
|
|
893
|
-
children: [/* @__PURE__ */ B(
|
|
898
|
+
children: [/* @__PURE__ */ B($e, {}), /* @__PURE__ */ B(et, {})]
|
|
894
899
|
}, t))
|
|
895
|
-
}),
|
|
900
|
+
}), nt = (e) => e.displayName ?? e.id, rt = (e, t) => {
|
|
896
901
|
let n = t.trim().toLowerCase();
|
|
897
|
-
return n ? e.filter((e) =>
|
|
898
|
-
},
|
|
902
|
+
return n ? e.filter((e) => nt(e).toLowerCase().includes(n)) : e;
|
|
903
|
+
}, it = (e, t, r, i = 18, a) => /* @__PURE__ */ B(n, {
|
|
899
904
|
src: e,
|
|
900
905
|
size: i,
|
|
901
906
|
tooltip: a,
|
|
902
907
|
initialsName: r
|
|
903
|
-
}),
|
|
904
|
-
let [o, c] = R(""), l = I(() => e?.find((e) => e.id === t), [e, t]), u = i?.loading !== void 0, d = I(() => u ? /* @__PURE__ */ B(
|
|
908
|
+
}), at = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: i, searchHeaderClassName: a = "bg-layer-0" }) => {
|
|
909
|
+
let [o, c] = R(""), l = I(() => e?.find((e) => e.id === t), [e, t]), u = i?.loading !== void 0, d = I(() => u ? /* @__PURE__ */ B($e, { size: f.LG }) : it(l?.iconUrl, l?.type, l?.displayName ?? l?.id ?? "", f.LG), [u, l]), p = l?.displayName ?? l?.id;
|
|
905
910
|
return {
|
|
906
911
|
selectorIcon: d,
|
|
907
912
|
selectorAriaLabel: p ? `${i?.ariaLabel ?? "Select model"}: ${p}` : i?.ariaLabel ?? "Select model",
|
|
@@ -909,8 +914,8 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
909
914
|
menuItems: I(() => {
|
|
910
915
|
if (u) return Array.from({ length: 7 }, (e, t) => ({
|
|
911
916
|
key: `__loading-${t}`,
|
|
912
|
-
icon: /* @__PURE__ */ B(
|
|
913
|
-
label: /* @__PURE__ */ B(
|
|
917
|
+
icon: /* @__PURE__ */ B($e, {}),
|
|
918
|
+
label: /* @__PURE__ */ B(et, { loadingLabel: t === 0 ? i?.loading : void 0 }),
|
|
914
919
|
disabled: !0
|
|
915
920
|
}));
|
|
916
921
|
if (!e || e.length === 0) {
|
|
@@ -921,19 +926,19 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
921
926
|
disabled: !0
|
|
922
927
|
}] : [];
|
|
923
928
|
}
|
|
924
|
-
return
|
|
929
|
+
return rt(e, o).map((e) => {
|
|
925
930
|
let i = e.id === t;
|
|
926
931
|
return {
|
|
927
932
|
key: e.id,
|
|
928
933
|
label: /* @__PURE__ */ V("span", {
|
|
929
934
|
className: "flex w-full items-center justify-between gap-2",
|
|
930
935
|
children: [/* @__PURE__ */ B(r, {
|
|
931
|
-
text:
|
|
936
|
+
text: nt(e),
|
|
932
937
|
query: o,
|
|
933
938
|
maxLines: 1
|
|
934
939
|
}), i && /* @__PURE__ */ B(Re, { gradientId: "ms-check-grad" })]
|
|
935
940
|
}),
|
|
936
|
-
icon:
|
|
941
|
+
icon: it(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
937
942
|
onClick: () => n?.(e.id),
|
|
938
943
|
className: i ? "bg-accent-primary-alpha" : void 0
|
|
939
944
|
};
|
|
@@ -967,7 +972,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
967
972
|
}
|
|
968
973
|
};
|
|
969
974
|
}, Y = typeof window < "u" ? F : P;
|
|
970
|
-
function
|
|
975
|
+
function ot(e) {
|
|
971
976
|
if (e !== void 0) switch (typeof e) {
|
|
972
977
|
case "number": return e;
|
|
973
978
|
case "string":
|
|
@@ -975,10 +980,10 @@ function at(e) {
|
|
|
975
980
|
break;
|
|
976
981
|
}
|
|
977
982
|
}
|
|
978
|
-
function
|
|
983
|
+
function st({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
979
984
|
let { styleHeight: s, styleWidth: c } = I(() => ({
|
|
980
|
-
styleHeight:
|
|
981
|
-
styleWidth:
|
|
985
|
+
styleHeight: ot(o?.height),
|
|
986
|
+
styleWidth: ot(o?.width)
|
|
982
987
|
}), [o?.height, o?.width]), [l, u] = R({
|
|
983
988
|
height: t,
|
|
984
989
|
width: n
|
|
@@ -1012,7 +1017,7 @@ function ot({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1012
1017
|
c
|
|
1013
1018
|
]);
|
|
1014
1019
|
}
|
|
1015
|
-
function
|
|
1020
|
+
function ct(e) {
|
|
1016
1021
|
let t = L(() => {
|
|
1017
1022
|
throw Error("Cannot call during render.");
|
|
1018
1023
|
});
|
|
@@ -1021,7 +1026,7 @@ function st(e) {
|
|
|
1021
1026
|
}, [e]), N((e) => t.current?.(e), [t]);
|
|
1022
1027
|
}
|
|
1023
1028
|
var X = null;
|
|
1024
|
-
function
|
|
1029
|
+
function lt(e = !1) {
|
|
1025
1030
|
if (X === null || e) {
|
|
1026
1031
|
let e = document.createElement("div"), t = e.style;
|
|
1027
1032
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
@@ -1030,8 +1035,8 @@ function Z(e = !1) {
|
|
|
1030
1035
|
}
|
|
1031
1036
|
return X;
|
|
1032
1037
|
}
|
|
1033
|
-
function
|
|
1034
|
-
if (t === "horizontal" && n) switch (
|
|
1038
|
+
function Z({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1039
|
+
if (t === "horizontal" && n) switch (lt()) {
|
|
1035
1040
|
case "negative": return -r;
|
|
1036
1041
|
case "positive-descending":
|
|
1037
1042
|
if (e) {
|
|
@@ -1051,7 +1056,7 @@ function $(e, t) {
|
|
|
1051
1056
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1052
1057
|
return !0;
|
|
1053
1058
|
}
|
|
1054
|
-
function
|
|
1059
|
+
function ut({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1055
1060
|
if (t === 0) return 0;
|
|
1056
1061
|
if (typeof n == "number") return t * n;
|
|
1057
1062
|
{
|
|
@@ -1059,9 +1064,9 @@ function lt({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
|
1059
1064
|
return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1060
1065
|
}
|
|
1061
1066
|
}
|
|
1062
|
-
function
|
|
1067
|
+
function dt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1063
1068
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1064
|
-
let s =
|
|
1069
|
+
let s = ut({
|
|
1065
1070
|
cachedBounds: t,
|
|
1066
1071
|
itemCount: r,
|
|
1067
1072
|
itemSize: i
|
|
@@ -1073,7 +1078,7 @@ function ut({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1073
1078
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1074
1079
|
}
|
|
1075
1080
|
}
|
|
1076
|
-
function
|
|
1081
|
+
function ft({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1077
1082
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1078
1083
|
for (; u < a;) {
|
|
1079
1084
|
let n = e.get(u);
|
|
@@ -1092,7 +1097,7 @@ function dt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1092
1097
|
stopIndexOverscan: l
|
|
1093
1098
|
};
|
|
1094
1099
|
}
|
|
1095
|
-
function
|
|
1100
|
+
function pt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1096
1101
|
let r = /* @__PURE__ */ new Map();
|
|
1097
1102
|
return {
|
|
1098
1103
|
get(i) {
|
|
@@ -1129,8 +1134,8 @@ function ft({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1129
1134
|
}
|
|
1130
1135
|
};
|
|
1131
1136
|
}
|
|
1132
|
-
function
|
|
1133
|
-
return I(() =>
|
|
1137
|
+
function mt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1138
|
+
return I(() => pt({
|
|
1134
1139
|
itemCount: e,
|
|
1135
1140
|
itemProps: t,
|
|
1136
1141
|
itemSize: n
|
|
@@ -1140,7 +1145,7 @@ function pt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1140
1145
|
n
|
|
1141
1146
|
]);
|
|
1142
1147
|
}
|
|
1143
|
-
function
|
|
1148
|
+
function ht({ containerSize: e, itemSize: t }) {
|
|
1144
1149
|
let n;
|
|
1145
1150
|
switch (typeof t) {
|
|
1146
1151
|
case "string":
|
|
@@ -1152,8 +1157,8 @@ function mt({ containerSize: e, itemSize: t }) {
|
|
|
1152
1157
|
}
|
|
1153
1158
|
return n;
|
|
1154
1159
|
}
|
|
1155
|
-
function
|
|
1156
|
-
let { height: u = n, width: d = n } =
|
|
1160
|
+
function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1161
|
+
let { height: u = n, width: d = n } = st({
|
|
1157
1162
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1158
1163
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1159
1164
|
element: e,
|
|
@@ -1162,7 +1167,7 @@ function ht({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1162
1167
|
}), f = L({
|
|
1163
1168
|
height: 0,
|
|
1164
1169
|
width: 0
|
|
1165
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1170
|
+
}), p = r === "vertical" ? u : d, m = ht({
|
|
1166
1171
|
containerSize: p,
|
|
1167
1172
|
itemSize: s
|
|
1168
1173
|
});
|
|
@@ -1179,11 +1184,11 @@ function ht({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1179
1184
|
c,
|
|
1180
1185
|
d
|
|
1181
1186
|
]);
|
|
1182
|
-
let h =
|
|
1187
|
+
let h = mt({
|
|
1183
1188
|
itemCount: a,
|
|
1184
1189
|
itemProps: o,
|
|
1185
1190
|
itemSize: m
|
|
1186
|
-
}), g = N((e) => h.get(e), [h]), [_, v] = R(() =>
|
|
1191
|
+
}), g = N((e) => h.get(e), [h]), [_, v] = R(() => ft({
|
|
1187
1192
|
cachedBounds: h,
|
|
1188
1193
|
containerScrollOffset: 0,
|
|
1189
1194
|
containerSize: p,
|
|
@@ -1194,7 +1199,7 @@ function ht({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1194
1199
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1195
1200
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1196
1201
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1197
|
-
}, C = N(() =>
|
|
1202
|
+
}, C = N(() => ut({
|
|
1198
1203
|
cachedBounds: h,
|
|
1199
1204
|
itemCount: a,
|
|
1200
1205
|
itemSize: m
|
|
@@ -1202,9 +1207,9 @@ function ht({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1202
1207
|
h,
|
|
1203
1208
|
a,
|
|
1204
1209
|
m
|
|
1205
|
-
]), w = N((t) =>
|
|
1210
|
+
]), w = N((t) => ft({
|
|
1206
1211
|
cachedBounds: h,
|
|
1207
|
-
containerScrollOffset:
|
|
1212
|
+
containerScrollOffset: Z({
|
|
1208
1213
|
containerElement: e,
|
|
1209
1214
|
direction: r,
|
|
1210
1215
|
isRtl: i,
|
|
@@ -1232,9 +1237,9 @@ function ht({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1232
1237
|
if (!e) return;
|
|
1233
1238
|
let t = () => {
|
|
1234
1239
|
v((t) => {
|
|
1235
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1240
|
+
let { scrollLeft: n, scrollTop: o } = e, s = ft({
|
|
1236
1241
|
cachedBounds: h,
|
|
1237
|
-
containerScrollOffset:
|
|
1242
|
+
containerScrollOffset: Z({
|
|
1238
1243
|
containerElement: e,
|
|
1239
1244
|
direction: r,
|
|
1240
1245
|
isRtl: i,
|
|
@@ -1260,8 +1265,8 @@ function ht({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1260
1265
|
]), {
|
|
1261
1266
|
getCellBounds: g,
|
|
1262
1267
|
getEstimatedSize: C,
|
|
1263
|
-
scrollToIndex:
|
|
1264
|
-
let s =
|
|
1268
|
+
scrollToIndex: ct(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1269
|
+
let s = dt({
|
|
1265
1270
|
align: t,
|
|
1266
1271
|
cachedBounds: h,
|
|
1267
1272
|
containerScrollOffset: n,
|
|
@@ -1271,7 +1276,7 @@ function ht({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1271
1276
|
itemSize: m
|
|
1272
1277
|
});
|
|
1273
1278
|
if (e) {
|
|
1274
|
-
if (s =
|
|
1279
|
+
if (s = Z({
|
|
1275
1280
|
containerElement: e,
|
|
1276
1281
|
direction: r,
|
|
1277
1282
|
isRtl: i,
|
|
@@ -1289,19 +1294,19 @@ function ht({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1289
1294
|
stopIndexVisible: x
|
|
1290
1295
|
};
|
|
1291
1296
|
}
|
|
1292
|
-
function
|
|
1297
|
+
function _t(e) {
|
|
1293
1298
|
return I(() => e, Object.values(e));
|
|
1294
1299
|
}
|
|
1295
|
-
function
|
|
1300
|
+
function vt(e, t) {
|
|
1296
1301
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1297
1302
|
return $(n, a) && $(r, o) && $(i, s);
|
|
1298
1303
|
}
|
|
1299
|
-
function
|
|
1304
|
+
function yt(e) {
|
|
1300
1305
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1301
1306
|
}
|
|
1302
|
-
var
|
|
1303
|
-
function
|
|
1304
|
-
let m =
|
|
1307
|
+
var bt = "data-react-window-index";
|
|
1308
|
+
function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
|
|
1309
|
+
let m = _t(u), h = I(() => me(s, vt), [s]), [g, _] = R(null), v = yt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = gt({
|
|
1305
1310
|
containerElement: g,
|
|
1306
1311
|
containerStyle: f,
|
|
1307
1312
|
defaultContainerSize: n,
|
|
@@ -1332,7 +1337,7 @@ function bt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1332
1337
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1333
1338
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1334
1339
|
let n = `${S + t}`;
|
|
1335
|
-
return e.setAttribute(
|
|
1340
|
+
return e.setAttribute(bt, n), !0;
|
|
1336
1341
|
});
|
|
1337
1342
|
if (v) return l.observeRowElements(e);
|
|
1338
1343
|
}, [
|
|
@@ -1409,22 +1414,22 @@ function bt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1409
1414
|
}
|
|
1410
1415
|
}, E, e, D);
|
|
1411
1416
|
}
|
|
1412
|
-
var
|
|
1417
|
+
var St = {
|
|
1413
1418
|
divider: "_divider_3wv6u_1",
|
|
1414
1419
|
item: "_item_3wv6u_5",
|
|
1415
1420
|
itemIcon: "_itemIcon_3wv6u_15",
|
|
1416
1421
|
checkIcon: "_checkIcon_3wv6u_19",
|
|
1417
1422
|
stateLabel: "_stateLabel_3wv6u_23"
|
|
1418
|
-
},
|
|
1419
|
-
let u = i[e], d =
|
|
1423
|
+
}, Ct = 44, wt = 8, Tt = ({ index: e, style: t, ariaAttributes: n, items: i, selectedDeploymentId: a, labelClassName: o, query: c, onSelect: l }) => {
|
|
1424
|
+
let u = i[e], d = it(u.iconUrl, u.type, u.displayName ?? u.id, f.SM), m = u.id === a;
|
|
1420
1425
|
return /* @__PURE__ */ B("div", {
|
|
1421
1426
|
style: t,
|
|
1422
1427
|
...n,
|
|
1423
1428
|
children: /* @__PURE__ */ B(p, {
|
|
1424
1429
|
type: "button",
|
|
1425
|
-
className: s(
|
|
1430
|
+
className: s(St.item, "flex h-full w-full items-center gap-3 px-4"),
|
|
1426
1431
|
iconBefore: /* @__PURE__ */ B("span", {
|
|
1427
|
-
className:
|
|
1432
|
+
className: St.itemIcon,
|
|
1428
1433
|
children: d
|
|
1429
1434
|
}),
|
|
1430
1435
|
label: /* @__PURE__ */ V("span", {
|
|
@@ -1436,19 +1441,19 @@ var xt = {
|
|
|
1436
1441
|
className: s(o, "min-w-0 flex-1 text-left")
|
|
1437
1442
|
}), m && /* @__PURE__ */ B(re, {
|
|
1438
1443
|
size: f.SM,
|
|
1439
|
-
className:
|
|
1444
|
+
className: St.checkIcon,
|
|
1440
1445
|
"aria-hidden": !0
|
|
1441
1446
|
})]
|
|
1442
1447
|
}),
|
|
1443
1448
|
onClick: () => l(u.id)
|
|
1444
1449
|
})
|
|
1445
1450
|
});
|
|
1446
|
-
},
|
|
1451
|
+
}, Et = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: c, loadingLabel: l, errorLabel: u, emptyLabel: d, style: f, titleClassName: p = "dial-body-semi-text", labelClassName: m = "dial-small-text" }) => {
|
|
1447
1452
|
let [h, g] = R("");
|
|
1448
1453
|
P(() => {
|
|
1449
1454
|
e || g("");
|
|
1450
1455
|
}, [e]);
|
|
1451
|
-
let _ = a && a.length > 0, v = l !== void 0, y = !_ && !v ? u ?? d : void 0, b = _ ?
|
|
1456
|
+
let _ = a && a.length > 0, v = l !== void 0, y = !_ && !v ? u ?? d : void 0, b = _ ? rt(a, h) : [];
|
|
1452
1457
|
return /* @__PURE__ */ V(H, {
|
|
1453
1458
|
isOpen: e,
|
|
1454
1459
|
title: t,
|
|
@@ -1465,17 +1470,17 @@ var xt = {
|
|
|
1465
1470
|
size: A.Standard,
|
|
1466
1471
|
onChange: g
|
|
1467
1472
|
})
|
|
1468
|
-
}), /* @__PURE__ */ B("div", { className: s(
|
|
1473
|
+
}), /* @__PURE__ */ B("div", { className: s(St.divider, "h-px flex-shrink-0") })] }), v ? /* @__PURE__ */ B(tt, { loadingLabel: l }) : y ? /* @__PURE__ */ B("div", {
|
|
1469
1474
|
role: "list",
|
|
1470
|
-
className: s(
|
|
1475
|
+
className: s(St.stateLabel, m, "px-4 py-4"),
|
|
1471
1476
|
children: y
|
|
1472
|
-
}) : /* @__PURE__ */ B(
|
|
1477
|
+
}) : /* @__PURE__ */ B(xt, {
|
|
1473
1478
|
role: "list",
|
|
1474
1479
|
className: "overflow-y-auto",
|
|
1475
|
-
style: { height: Math.min(b.length,
|
|
1476
|
-
rowComponent:
|
|
1480
|
+
style: { height: Math.min(b.length, wt) * Ct },
|
|
1481
|
+
rowComponent: Tt,
|
|
1477
1482
|
rowCount: b.length,
|
|
1478
|
-
rowHeight:
|
|
1483
|
+
rowHeight: Ct,
|
|
1479
1484
|
rowProps: {
|
|
1480
1485
|
items: b,
|
|
1481
1486
|
selectedDeploymentId: o,
|
|
@@ -1487,8 +1492,8 @@ var xt = {
|
|
|
1487
1492
|
}
|
|
1488
1493
|
})]
|
|
1489
1494
|
});
|
|
1490
|
-
},
|
|
1491
|
-
let [_, y] = R(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } =
|
|
1495
|
+
}, Dt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isInputDisabled: o = !1, isDisabled: c = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: p, onPickerOpenChange: m }) => {
|
|
1496
|
+
let [_, y] = R(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } = at({
|
|
1492
1497
|
deployments: e,
|
|
1493
1498
|
selectedDeploymentId: t,
|
|
1494
1499
|
onDeploymentChange: n,
|
|
@@ -1520,7 +1525,7 @@ var xt = {
|
|
|
1520
1525
|
onClose: () => y(!1),
|
|
1521
1526
|
style: l,
|
|
1522
1527
|
children: u(() => y(!1))
|
|
1523
|
-
}) : /* @__PURE__ */ B(
|
|
1528
|
+
}) : /* @__PURE__ */ B(Et, {
|
|
1524
1529
|
isOpen: _,
|
|
1525
1530
|
title: r?.ariaLabel ?? "Select model",
|
|
1526
1531
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1575,7 +1580,7 @@ var xt = {
|
|
|
1575
1580
|
})
|
|
1576
1581
|
})
|
|
1577
1582
|
});
|
|
1578
|
-
},
|
|
1583
|
+
}, Ot = 160, kt = ({ message: e = "", onSend: t, onUploadAttachment: n, onStop: r, isStreaming: i = !1, onChange: a, onAttachmentsChange: u, placeholder: d = "Type a message...", ariaLabel: p, attachLabel: m = "Attach file", addMenuTitle: h = "Add", menuTitle: g = "Menu", menuCloseLabel: _ = "Close", removeLabel: y, retryLabel: b, sendLabel: x, stopLabel: S, micLabel: C = "Record voice message", colors: w, typography: T, className: E, pendingDropFiles: D = [], onDropFilesConsumed: O, pendingAttachments: k = [], onPendingAttachmentsConsumed: A, pasteTextThreshold: ee = 4e3, deployments: j, selectedDeploymentId: te, onDeploymentChange: ne, modelSelectorLabels: re, initialAttachments: ie = [], isStacked: ae = !1, hideAddButton: ce = !1, hideAttachFile: le = !1, hideActionBar: ue = !1, renderFooterActions: de, isInputDisabled: M = !1, isModelSelectorDisabled: fe = !1, isTranscriptionSupported: pe = !1, onUploadAudio: me, onTranscribeAudio: P, sendOnEnter: he = Ie.Enter, prefixAttachments: F = [], onRemovePrefixAttachment: ge, chatSettings: _e, autoFocus: ve = !1, messageHistory: be, onDialFileSystemClick: xe, dialFileSystemLabel: Se, validateAttachment: Ce, onAttachmentClick: Te, modelPickerOverlay: Ee }) => {
|
|
1579
1584
|
let H = c(), [De, Ae] = R(!1), je = Me(be), U = I(() => o({
|
|
1580
1585
|
"--ci-bg": w?.background,
|
|
1581
1586
|
"--ci-text": w?.text,
|
|
@@ -1596,7 +1601,7 @@ var xt = {
|
|
|
1596
1601
|
"aria-hidden": !0
|
|
1597
1602
|
}),
|
|
1598
1603
|
onClick: xe
|
|
1599
|
-
}] : [], [xe, Se]), { message: W, setMessage: G, textareaRef: Le, isMultiLine: Re } = Ne({ messageProp: e }), { attachments: K, buildAttachments: ze, addAttachments: Be, resetAttachments: Ve, handleRemove: He, handleRetry: Ue, handleExpand: We, hasBlockedAttachments:
|
|
1604
|
+
}] : [], [xe, Se]), { message: W, setMessage: G, textareaRef: Le, isMultiLine: Re } = Ne({ messageProp: e }), { attachments: K, buildAttachments: ze, addAttachments: Be, resetAttachments: Ve, handleRemove: He, handleRetry: Ue, handleExpand: We, hasBlockedAttachments: Ge } = Oe({
|
|
1600
1605
|
initialAttachments: ie,
|
|
1601
1606
|
onUploadAttachment: n,
|
|
1602
1607
|
onAttachmentsChange: u,
|
|
@@ -1608,13 +1613,13 @@ var xt = {
|
|
|
1608
1613
|
onExpandPastedText: N((e) => {
|
|
1609
1614
|
G((t) => t ? `${t}\n${e}` : e);
|
|
1610
1615
|
}, [G])
|
|
1611
|
-
}), { state:
|
|
1616
|
+
}), { state: q, waveformData: qe, errorMessage: Je, startRecording: Ye, stopRecording: $e, confirmRecording: et, discardRecording: tt } = Fe({
|
|
1612
1617
|
onUploadAudio: me,
|
|
1613
1618
|
onTranscribeAudio: P,
|
|
1614
1619
|
onTranscript: N((e) => {
|
|
1615
1620
|
G(e), a?.(e);
|
|
1616
1621
|
}, [a, G])
|
|
1617
|
-
}), nt = L(null), rt = L(null), { handlePaste: it } = we(Be, ee),
|
|
1622
|
+
}), nt = L(null), rt = L(null), { handlePaste: it } = we(Be, ee), at = W.trim().length > 0 || K.length > 0, Y = at && !Ge, { shouldRender: ot, isExiting: st, instanceKey: ct } = ke(!i && at, Ot), X = ae || K.length > 0 || W.includes("\n") || Re, lt = j === void 0 || te != null, Z = async () => {
|
|
1618
1623
|
if (M) return;
|
|
1619
1624
|
let e = W, n = K;
|
|
1620
1625
|
G(""), je.reset();
|
|
@@ -1625,7 +1630,7 @@ var xt = {
|
|
|
1625
1630
|
} catch {
|
|
1626
1631
|
G(e), Ve(n);
|
|
1627
1632
|
}
|
|
1628
|
-
},
|
|
1633
|
+
}, Q = (e) => {
|
|
1629
1634
|
if (!e.nativeEvent.isComposing && !M && !i && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1630
1635
|
let t = e.currentTarget.selectionStart ?? 0, n = je.navigate(e.key === "ArrowUp" ? "up" : "down", W, t);
|
|
1631
1636
|
if (n !== null) {
|
|
@@ -1633,15 +1638,15 @@ var xt = {
|
|
|
1633
1638
|
return;
|
|
1634
1639
|
}
|
|
1635
1640
|
}
|
|
1636
|
-
e.key === "Enter" && (he === Ie.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !i &&
|
|
1637
|
-
},
|
|
1641
|
+
e.key === "Enter" && (he === Ie.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !i && Y && lt && Z());
|
|
1642
|
+
}, $ = (e) => {
|
|
1638
1643
|
let t = Array.from(e.target.files ?? []);
|
|
1639
1644
|
if (t.length === 0) return;
|
|
1640
1645
|
let n = ze(t);
|
|
1641
1646
|
e.target.value = "", Be(n);
|
|
1642
1647
|
};
|
|
1643
|
-
if (
|
|
1644
|
-
state:
|
|
1648
|
+
if (q !== "idle") return /* @__PURE__ */ B(Xe, {
|
|
1649
|
+
state: q,
|
|
1645
1650
|
waveformData: qe,
|
|
1646
1651
|
errorMessage: Je,
|
|
1647
1652
|
onStop: $e,
|
|
@@ -1658,7 +1663,7 @@ var xt = {
|
|
|
1658
1663
|
onChange: (e) => {
|
|
1659
1664
|
G(e.target.value), je.notifyChange(), a?.(e.target.value);
|
|
1660
1665
|
},
|
|
1661
|
-
onKeyDown:
|
|
1666
|
+
onKeyDown: Q,
|
|
1662
1667
|
onPaste: it,
|
|
1663
1668
|
placeholder: d,
|
|
1664
1669
|
"aria-label": p,
|
|
@@ -1676,17 +1681,19 @@ var xt = {
|
|
|
1676
1681
|
},
|
|
1677
1682
|
onRetry: Ue,
|
|
1678
1683
|
onExpand: We,
|
|
1679
|
-
|
|
1680
|
-
|
|
1684
|
+
labels: {
|
|
1685
|
+
removeLabel: y,
|
|
1686
|
+
retryLabel: b
|
|
1687
|
+
},
|
|
1681
1688
|
onAttachmentClick: Te == null ? void 0 : (e) => {
|
|
1682
1689
|
let t = K.find((t) => t.id === e.id);
|
|
1683
1690
|
t != null && Te(t);
|
|
1684
1691
|
}
|
|
1685
|
-
}), ue ?
|
|
1686
|
-
className: s("flex items-center gap-2",
|
|
1692
|
+
}), ue ? X && ut : /* @__PURE__ */ V("div", {
|
|
1693
|
+
className: s("flex items-center gap-2", X ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
|
|
1687
1694
|
children: [
|
|
1688
1695
|
!ce && /* @__PURE__ */ V("div", {
|
|
1689
|
-
className: s("order-2 flex", !
|
|
1696
|
+
className: s("order-2 flex", !X && "desktop:order-1"),
|
|
1690
1697
|
children: [/* @__PURE__ */ B("input", {
|
|
1691
1698
|
ref: nt,
|
|
1692
1699
|
type: "file",
|
|
@@ -1694,8 +1701,8 @@ var xt = {
|
|
|
1694
1701
|
className: "sr-only",
|
|
1695
1702
|
"aria-hidden": !0,
|
|
1696
1703
|
tabIndex: -1,
|
|
1697
|
-
onChange:
|
|
1698
|
-
}), /* @__PURE__ */ B(
|
|
1704
|
+
onChange: $
|
|
1705
|
+
}), /* @__PURE__ */ B(Ke, {
|
|
1699
1706
|
onAttachClick: le ? void 0 : () => nt.current?.click(),
|
|
1700
1707
|
attachLabel: m,
|
|
1701
1708
|
addMenuTitle: h,
|
|
@@ -1708,15 +1715,15 @@ var xt = {
|
|
|
1708
1715
|
})]
|
|
1709
1716
|
}),
|
|
1710
1717
|
/* @__PURE__ */ B("div", {
|
|
1711
|
-
className: s("order-1 flex w-full min-w-0 items-center self-stretch", !
|
|
1718
|
+
className: s("order-1 flex w-full min-w-0 items-center self-stretch", !X && "desktop:order-2 desktop:w-auto desktop:flex-1"),
|
|
1712
1719
|
children: ut
|
|
1713
1720
|
}),
|
|
1714
1721
|
/* @__PURE__ */ V("div", {
|
|
1715
|
-
className: s("flex flex-shrink-0 items-center gap-2", "order-3 ms-auto", !
|
|
1722
|
+
className: s("flex flex-shrink-0 items-center gap-2", "order-3 ms-auto", !X && "desktop:ms-0"),
|
|
1716
1723
|
children: [de ? de({
|
|
1717
|
-
canSend:
|
|
1718
|
-
onSend:
|
|
1719
|
-
}) : /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(
|
|
1724
|
+
canSend: Y,
|
|
1725
|
+
onSend: Z
|
|
1726
|
+
}) : /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(Dt, {
|
|
1720
1727
|
deployments: j,
|
|
1721
1728
|
selectedDeploymentId: te,
|
|
1722
1729
|
onDeploymentChange: ne,
|
|
@@ -1730,29 +1737,29 @@ var xt = {
|
|
|
1730
1737
|
isPickerOpen: De,
|
|
1731
1738
|
onPickerToggle: () => Ae((e) => !e),
|
|
1732
1739
|
onPickerOpenChange: Ae
|
|
1733
|
-
}), i && r ? /* @__PURE__ */ B(
|
|
1740
|
+
}), i && r ? /* @__PURE__ */ B(Qe, {
|
|
1734
1741
|
onStop: r,
|
|
1735
1742
|
ariaLabel: S
|
|
1736
|
-
}) : !i && ot && /* @__PURE__ */ B(
|
|
1737
|
-
onSend:
|
|
1738
|
-
isDisabled: M || !
|
|
1743
|
+
}) : !i && ot && /* @__PURE__ */ B(Ze, {
|
|
1744
|
+
onSend: Z,
|
|
1745
|
+
isDisabled: M || !lt || Ge,
|
|
1739
1746
|
ariaLabel: x,
|
|
1740
1747
|
isExiting: st
|
|
1741
|
-
},
|
|
1748
|
+
}, ct)] }), pe && !W.trim() && !st && /* @__PURE__ */ B(v, {
|
|
1742
1749
|
icon: /* @__PURE__ */ B(se, {
|
|
1743
1750
|
size: f.LG,
|
|
1744
1751
|
"aria-hidden": !0
|
|
1745
1752
|
}),
|
|
1746
1753
|
"aria-label": C,
|
|
1747
1754
|
className: "size-8 flex-shrink-0",
|
|
1748
|
-
onClick:
|
|
1755
|
+
onClick: Ye,
|
|
1749
1756
|
disabled: M || i
|
|
1750
1757
|
})]
|
|
1751
1758
|
})
|
|
1752
1759
|
]
|
|
1753
1760
|
})]
|
|
1754
1761
|
});
|
|
1755
|
-
},
|
|
1762
|
+
}, At = { welcome: "_welcome_n2ph8_1" }, jt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, isInputDisabled: a = !1, ...c }) => {
|
|
1756
1763
|
let { colors: l, typography: u } = r ?? {};
|
|
1757
1764
|
return /* @__PURE__ */ V("div", {
|
|
1758
1765
|
style: o({
|
|
@@ -1761,11 +1768,11 @@ var xt = {
|
|
|
1761
1768
|
}),
|
|
1762
1769
|
className: s("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
|
|
1763
1770
|
children: [n && /* @__PURE__ */ B("h1", {
|
|
1764
|
-
className: s(
|
|
1771
|
+
className: s(At.welcome, "m-0 text-center", u?.welcomeClassName),
|
|
1765
1772
|
children: n
|
|
1766
1773
|
}), /* @__PURE__ */ B("div", {
|
|
1767
1774
|
className: "relative w-full max-w-[748px]",
|
|
1768
|
-
children: /* @__PURE__ */ B(
|
|
1775
|
+
children: /* @__PURE__ */ B(kt, {
|
|
1769
1776
|
placeholder: t,
|
|
1770
1777
|
isStreaming: e,
|
|
1771
1778
|
isInputDisabled: a,
|
|
@@ -1775,7 +1782,7 @@ var xt = {
|
|
|
1775
1782
|
})
|
|
1776
1783
|
})]
|
|
1777
1784
|
});
|
|
1778
|
-
},
|
|
1785
|
+
}, Mt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: r, onUploadAttachment: a, cancelLabel: o = "Cancel", saveLabel: c = "Save & Submit", ariaLabel: l, removeLabel: u, retryLabel: d, addMenuTitle: f = "Add", attachLabel: p = "Attach file", menuTitle: m = "Menu", menuCloseLabel: h = "Close", className: g, pendingDropFiles: _, onDropFilesConsumed: v, validateAttachment: y, hideAttachFile: b = !1 }) => {
|
|
1779
1786
|
let x = L(null), [S, C] = R([]);
|
|
1780
1787
|
P(() => {
|
|
1781
1788
|
_?.length && (C(_), v?.());
|
|
@@ -1792,7 +1799,7 @@ var xt = {
|
|
|
1792
1799
|
}, []);
|
|
1793
1800
|
return /* @__PURE__ */ V("div", {
|
|
1794
1801
|
className: s("flex w-full flex-col gap-2", g),
|
|
1795
|
-
children: [/* @__PURE__ */ B(
|
|
1802
|
+
children: [/* @__PURE__ */ B(kt, {
|
|
1796
1803
|
message: e,
|
|
1797
1804
|
ariaLabel: l,
|
|
1798
1805
|
isStacked: !0,
|
|
@@ -1821,7 +1828,7 @@ var xt = {
|
|
|
1821
1828
|
"aria-hidden": !0,
|
|
1822
1829
|
tabIndex: -1,
|
|
1823
1830
|
onChange: ie
|
|
1824
|
-
}), /* @__PURE__ */ B(
|
|
1831
|
+
}), /* @__PURE__ */ B(Ke, {
|
|
1825
1832
|
onAttachClick: () => x.current?.click(),
|
|
1826
1833
|
attachLabel: p,
|
|
1827
1834
|
addMenuTitle: f,
|
|
@@ -1843,4 +1850,4 @@ var xt = {
|
|
|
1843
1850
|
});
|
|
1844
1851
|
};
|
|
1845
1852
|
//#endregion
|
|
1846
|
-
export { ge as AttachmentCard, _e as AttachmentGroup, ve as AttachmentTray, H as BottomSheetShell,
|
|
1853
|
+
export { ge as AttachmentCard, _e as AttachmentGroup, ve as AttachmentTray, H as BottomSheetShell, Ge as ChatSettingsModal, jt as ConversationInput, Mt as EditMessageInput, be as FileDndOverlay, kt as Input, Ie as SendOnEnter, Ce as getAttachmentIcon };
|
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.0.0-dev.
|
|
4
|
+
"version": "1.0.0-dev.486",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@epam/ai-dial-attachment-input": "1.0.0-dev.
|
|
21
|
-
"@epam/ai-dial-chat-shared": "1.0.0-dev.
|
|
20
|
+
"@epam/ai-dial-attachment-input": "1.0.0-dev.486",
|
|
21
|
+
"@epam/ai-dial-chat-shared": "1.0.0-dev.486",
|
|
22
22
|
"@epam/ai-dial-ui-kit": "0.12.0-dev.28",
|
|
23
23
|
"@tabler/icons-react": "^3.44.0",
|
|
24
24
|
"react": "^19.0.0",
|
|
25
25
|
"react-dom": "^19.2.6",
|
|
26
|
-
"@epam/ai-dial-kit": "1.0.0-dev.
|
|
26
|
+
"@epam/ai-dial-kit": "1.0.0-dev.486"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"react-window": "^2.2.7"
|