@epam/ai-dial-conversation-input 1.3.0-dev.124 → 1.3.0-dev.126

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.
Files changed (2) hide show
  1. package/index.js +164 -188
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -91,11 +91,7 @@ var U = {
91
91
  });
92
92
  }, []);
93
93
  z(() => {
94
- if (x.current) {
95
- x.current = !1;
96
- return;
97
- }
98
- b.current?.(g);
94
+ x.current ? x.current = !1 : b.current?.(g);
99
95
  }, [g]);
100
96
  let C = R((e) => {
101
97
  _(e);
@@ -250,15 +246,7 @@ var U = {
250
246
  })() : "", u = R((t, n, i) => {
251
247
  if (e == null || i) return;
252
248
  let { start: c, end: l } = Ne(t, n), u = t.slice(c, l);
253
- if (!Pe(u, e.triggerPrefix)) {
254
- r(!1), s(null), a(null);
255
- return;
256
- }
257
- if (a(c), u === e.triggerPrefix || o !== c) {
258
- r(!0), s(null);
259
- return;
260
- }
261
- r(!1);
249
+ Pe(u, e.triggerPrefix) ? (a(c), u === e.triggerPrefix || o !== c ? (r(!0), s(null)) : r(!1)) : (r(!1), s(null), a(null));
262
250
  }, [e, o]);
263
251
  z(() => {
264
252
  if (e == null) {
@@ -277,11 +265,7 @@ var U = {
277
265
  }, []), p = R((n) => {
278
266
  if (e == null) return;
279
267
  let { start: i, end: s } = Ne(t, n);
280
- if (!Pe(t.slice(i, s), e.triggerPrefix)) {
281
- a(null), r(!1);
282
- return;
283
- }
284
- a(i), r(o !== i);
268
+ Pe(t.slice(i, s), e.triggerPrefix) ? (a(i), r(o !== i)) : (a(null), r(!1));
285
269
  }, [
286
270
  e,
287
271
  t,
@@ -441,7 +425,7 @@ var U = {
441
425
  if (n === i.current) return;
442
426
  i.current = n;
443
427
  let e = r.current;
444
- !t.current || !e || queueMicrotask(() => {
428
+ t.current && e && queueMicrotask(() => {
445
429
  let n = t.current;
446
430
  if (!n) return;
447
431
  let { value: r, selectionStart: i, selectionEnd: o } = n, s = i ?? r.length, c = o ?? s;
@@ -800,49 +784,52 @@ var U = {
800
784
  }, K = {
801
785
  icon: "_icon_1fv6z_1",
802
786
  selectedIcon: "_selectedIcon_1fv6z_5"
803
- }, ft = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: u, itemLabelClassName: d = "dial-small-text", colors: p }) => /* @__PURE__ */ I(W, {
804
- isOpen: e,
805
- title: o,
806
- closeLabel: i,
807
- onClose: r,
808
- onBack: t,
809
- backLabel: n,
810
- style: a,
811
- children: /* @__PURE__ */ I("ul", {
812
- role: "menu",
813
- className: "flex flex-col pb-4",
814
- style: c({
815
- "--tbs-icon-text": p?.iconText,
816
- "--tbs-selected-icon-text": p?.selectedIconText
817
- }),
818
- children: s.map((e) => /* @__PURE__ */ I("li", {
819
- role: "none",
820
- children: /* @__PURE__ */ I(m, {
821
- type: "button",
822
- role: "menuitemcheckbox",
823
- "aria-checked": e.isSelected,
824
- className: "w-full gap-3 px-4 py-[10px] text-start",
825
- iconBefore: /* @__PURE__ */ I("span", {
826
- className: l("flex items-center", K.icon),
827
- children: e.icon
828
- }),
829
- iconAfter: e.isSelected ? /* @__PURE__ */ I("span", {
830
- className: l("ms-auto", K.selectedIcon),
831
- children: /* @__PURE__ */ I(pe, {
832
- size: f,
833
- "aria-hidden": !0,
834
- stroke: v
835
- })
836
- }) : null,
837
- label: /* @__PURE__ */ I("span", {
838
- className: d,
839
- children: e.label
840
- }),
841
- onClick: () => u(e.id)
842
- })
843
- }, e.id))
844
- })
845
- }), pt = {
787
+ }, ft = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: u, itemLabelClassName: d = "dial-small-text", colors: p }) => {
788
+ let h = c({
789
+ "--tbs-icon-text": p?.iconText,
790
+ "--tbs-selected-icon-text": p?.selectedIconText
791
+ });
792
+ return /* @__PURE__ */ I(W, {
793
+ isOpen: e,
794
+ title: o,
795
+ closeLabel: i,
796
+ onClose: r,
797
+ onBack: t,
798
+ backLabel: n,
799
+ style: a,
800
+ children: /* @__PURE__ */ I("ul", {
801
+ role: "menu",
802
+ className: "flex flex-col pb-4",
803
+ style: h,
804
+ children: s.map((e) => /* @__PURE__ */ I("li", {
805
+ role: "none",
806
+ children: /* @__PURE__ */ I(m, {
807
+ type: "button",
808
+ role: "menuitemcheckbox",
809
+ "aria-checked": e.isSelected,
810
+ className: "w-full gap-3 px-4 py-[10px] text-start",
811
+ iconBefore: /* @__PURE__ */ I("span", {
812
+ className: l("flex items-center", K.icon),
813
+ children: e.icon
814
+ }),
815
+ iconAfter: e.isSelected ? /* @__PURE__ */ I("span", {
816
+ className: l("ms-auto", K.selectedIcon),
817
+ children: /* @__PURE__ */ I(pe, {
818
+ size: f,
819
+ "aria-hidden": !0,
820
+ stroke: v
821
+ })
822
+ }) : null,
823
+ label: /* @__PURE__ */ I("span", {
824
+ className: d,
825
+ children: e.label
826
+ }),
827
+ onClick: () => u(e.id)
828
+ })
829
+ }, e.id))
830
+ })
831
+ });
832
+ }, pt = {
846
833
  toolIcon: "_toolIcon_ma5s5_1",
847
834
  chevronIcon: "_chevronIcon_ma5s5_5"
848
835
  }, mt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: p = "w-[240px]", isDisabled: m = !1, chatSettings: h, extraMenuItems: g, toolsMenuItems: x = [], onToolToggle: C, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, getCaretPosition: ee, colors: O }) => {
@@ -1090,23 +1077,23 @@ var U = {
1090
1077
  chipClose: "_chipClose_1lvv5_25"
1091
1078
  }, ht = (e) => `Remove ${e}`, gt = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = ht, stateOnLabel: a, stateOffLabel: o, typography: s, colors: u }) => {
1092
1079
  if (e.length === 0) return null;
1093
- let d = !!(a && o);
1080
+ let d = !!(a && o), f = c({
1081
+ "--ci-chip-bg": u?.chipBg,
1082
+ "--ci-chip-border": u?.chipBorder,
1083
+ "--ci-chip-icon": u?.chipIcon,
1084
+ "--ci-chip-text": u?.chipText,
1085
+ "--ci-chip-hover-bg": u?.chipHoverBg,
1086
+ "--ci-chip-selected-bg": u?.chipSelectedBg,
1087
+ "--ci-chip-selected-border": u?.chipSelectedBorder,
1088
+ "--ci-chip-selected-icon": u?.chipSelectedIcon,
1089
+ "--ci-chip-selected-text": u?.chipSelectedText,
1090
+ "--ci-chip-state-text": u?.chipStateText,
1091
+ "--ci-chip-close": u?.chipClose,
1092
+ "--ci-chip-close-hover": u?.chipCloseHover
1093
+ });
1094
1094
  return /* @__PURE__ */ I("div", {
1095
1095
  className: "flex flex-wrap items-center gap-2",
1096
- style: c({
1097
- "--ci-chip-bg": u?.chipBg,
1098
- "--ci-chip-border": u?.chipBorder,
1099
- "--ci-chip-icon": u?.chipIcon,
1100
- "--ci-chip-text": u?.chipText,
1101
- "--ci-chip-hover-bg": u?.chipHoverBg,
1102
- "--ci-chip-selected-bg": u?.chipSelectedBg,
1103
- "--ci-chip-selected-border": u?.chipSelectedBorder,
1104
- "--ci-chip-selected-icon": u?.chipSelectedIcon,
1105
- "--ci-chip-selected-text": u?.chipSelectedText,
1106
- "--ci-chip-state-text": u?.chipStateText,
1107
- "--ci-chip-close": u?.chipClose,
1108
- "--ci-chip-close-hover": u?.chipCloseHover
1109
- }),
1096
+ style: f,
1110
1097
  children: e.map((e) => /* @__PURE__ */ L("div", {
1111
1098
  className: l(q.chip, e.isSelected && q.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "ps-2 pe-1" : "px-2"),
1112
1099
  children: [/* @__PURE__ */ L("button", {
@@ -1170,7 +1157,7 @@ var U = {
1170
1157
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
1171
1158
  let { width: n, height: r } = e;
1172
1159
  t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
1173
- let i = Math.min(Math.max(1, Math.floor(n / yt)), bt - 1), a = m.current, o = h.current;
1160
+ let i = Math.min(Math.max(1, Math.floor(n / yt)), 199), a = m.current, o = h.current;
1174
1161
  t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
1175
1162
  for (let e = 0; e <= i; e++) {
1176
1163
  let n = ((a - i + e) % bt + bt) % bt, o = p.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
@@ -1414,9 +1401,7 @@ var U = {
1414
1401
  function Nt(e) {
1415
1402
  if (e !== void 0) switch (typeof e) {
1416
1403
  case "number": return e;
1417
- case "string":
1418
- if (e.endsWith("px")) return parseFloat(e);
1419
- break;
1404
+ case "string": if (e.endsWith("px")) return parseFloat(e);
1420
1405
  }
1421
1406
  }
1422
1407
  function Pt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
@@ -1477,12 +1462,10 @@ function Lt(e = !1) {
1477
1462
  function Y({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1478
1463
  if (t === "horizontal" && n) switch (Lt()) {
1479
1464
  case "negative": return -r;
1480
- case "positive-descending":
1481
- if (e) {
1482
- let { clientWidth: t, scrollLeft: n, scrollWidth: r } = e;
1483
- return r - t - n;
1484
- }
1485
- break;
1465
+ case "positive-descending": if (e) {
1466
+ let { clientWidth: t, scrollLeft: n, scrollWidth: r } = e;
1467
+ return r - t - n;
1468
+ }
1486
1469
  }
1487
1470
  return r;
1488
1471
  }
@@ -1546,9 +1529,7 @@ function Q({ itemCount: e, itemProps: t, itemSize: n }) {
1546
1529
  case "function":
1547
1530
  a = n(e, t);
1548
1531
  break;
1549
- case "number":
1550
- a = n;
1551
- break;
1532
+ case "number": a = n;
1552
1533
  }
1553
1534
  if (e === 0) r.set(e, {
1554
1535
  size: a,
@@ -1590,9 +1571,7 @@ function Ht({ containerSize: e, itemSize: t }) {
1590
1571
  case "string":
1591
1572
  X(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), X(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
1592
1573
  break;
1593
- default:
1594
- n = t;
1595
- break;
1574
+ default: n = t;
1596
1575
  }
1597
1576
  return n;
1598
1577
  }
@@ -1646,18 +1625,21 @@ function Ut({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1646
1625
  h,
1647
1626
  a,
1648
1627
  m
1649
- ]), w = R((t) => Bt({
1650
- cachedBounds: h,
1651
- containerScrollOffset: Y({
1628
+ ]), w = R((t) => {
1629
+ let n = Y({
1652
1630
  containerElement: e,
1653
1631
  direction: r,
1654
1632
  isRtl: i,
1655
1633
  scrollOffset: t
1656
- }),
1657
- containerSize: p,
1658
- itemCount: a,
1659
- overscanCount: l
1660
- }), [
1634
+ });
1635
+ return Bt({
1636
+ cachedBounds: h,
1637
+ containerScrollOffset: n,
1638
+ containerSize: p,
1639
+ itemCount: a,
1640
+ overscanCount: l
1641
+ });
1642
+ }, [
1661
1643
  h,
1662
1644
  e,
1663
1645
  p,
@@ -1667,7 +1649,8 @@ function Ut({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1667
1649
  l
1668
1650
  ]);
1669
1651
  return Mt(() => {
1670
- v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
1652
+ let t = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
1653
+ v(w(t));
1671
1654
  }, [
1672
1655
  e,
1673
1656
  r,
@@ -1676,19 +1659,19 @@ function Ut({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1676
1659
  if (!e) return;
1677
1660
  let t = () => {
1678
1661
  v((t) => {
1679
- let { scrollLeft: n, scrollTop: o } = e, s = Bt({
1662
+ let { scrollLeft: n, scrollTop: o } = e, s = Y({
1663
+ containerElement: e,
1664
+ direction: r,
1665
+ isRtl: i,
1666
+ scrollOffset: r === "vertical" ? o : n
1667
+ }), c = Bt({
1680
1668
  cachedBounds: h,
1681
- containerScrollOffset: Y({
1682
- containerElement: e,
1683
- direction: r,
1684
- isRtl: i,
1685
- scrollOffset: r === "vertical" ? o : n
1686
- }),
1669
+ containerScrollOffset: s,
1687
1670
  containerSize: p,
1688
1671
  itemCount: a,
1689
1672
  overscanCount: l
1690
1673
  });
1691
- return Z(s, t) ? t : s;
1674
+ return Z(c, t) ? t : c;
1692
1675
  });
1693
1676
  };
1694
1677
  return e.addEventListener("scroll", t), () => {
@@ -2112,16 +2095,12 @@ var Yt = {
2112
2095
  let Zt = () => {
2113
2096
  Ut(Z.current?.selectionStart ?? Y.length);
2114
2097
  }, Qt = V(!1), $t = () => {
2115
- if (Qt.current) {
2116
- Qt.current = !1;
2117
- return;
2118
- }
2119
- requestAnimationFrame(() => {
2098
+ Qt.current ? Qt.current = !1 : requestAnimationFrame(() => {
2120
2099
  let e = Z.current;
2121
2100
  Xt.current(e?.selectionStart ?? e?.value.length ?? 0);
2122
2101
  });
2123
2102
  }, tn = (e) => {
2124
- e.key !== "ArrowLeft" && e.key !== "ArrowRight" && e.key !== "Home" && e.key !== "End" && e.key !== "PageUp" && e.key !== "PageDown" || Ut(e.currentTarget.selectionStart ?? Y.length);
2103
+ (e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") && Ut(e.currentTarget.selectionStart ?? Y.length);
2125
2104
  }, nn = K?.emptyQueryHint != null, rn = K != null && Q != null ? Q + K.triggerPrefix.length : null, an = rn != null && Y.slice(rn).split("\n", 1)[0] !== "", on = nn && zt && Bt === "" && rn != null && !an, sn = K != null && zt ? Q ?? 0 : null, cn = V(null), ln = V(null), [un, dn] = H(null), fn = R(() => {
2126
2105
  let e = cn.current, t = ln.current;
2127
2106
  if (e == null || t == null) {
@@ -2163,7 +2142,7 @@ var Yt = {
2163
2142
  Z
2164
2143
  ]), mn = V(void 0);
2165
2144
  z(() => {
2166
- dt == null || mn.current === t || (mn.current = t, Z.current?.setSelectionRange(dt, dt), Ut(dt));
2145
+ dt != null && mn.current !== t && (mn.current = t, Z.current?.setSelectionRange(dt, dt), Ut(dt));
2167
2146
  }, [Y]);
2168
2147
  let hn = V(Y);
2169
2148
  hn.current = Y;
@@ -2234,20 +2213,20 @@ var Yt = {
2234
2213
  Ot,
2235
2214
  Ln,
2236
2215
  K
2237
- ]), zn = Y.trim().length > 0 || gn.length > 0, Bn = zn && !Cn && !Ne && !$, [Vn, Hn] = H([]);
2216
+ ]), zn = Y.trim().length > 0 || gn.length > 0, Bn = zn && !Cn && !Ne && !$, [Vn, Hn] = H([]), Un = ($e ?? []).map((e) => e.id).join("|");
2238
2217
  z(() => {
2239
2218
  Hn([]);
2240
- }, [($e ?? []).map((e) => e.id).join("|")]);
2241
- let Un = B(() => {
2219
+ }, [Un]);
2220
+ let Wn = B(() => {
2242
2221
  let e = $e ?? [];
2243
2222
  return it ? e.filter((e) => e.isSelected || !Vn.includes(e.id)) : e;
2244
2223
  }, [
2245
2224
  $e,
2246
2225
  Vn,
2247
2226
  it
2248
- ]), Wn = R((e) => {
2227
+ ]), Gn = R((e) => {
2249
2228
  Hn((t) => t.includes(e) ? t : [...t, e]), $e?.find((t) => t.id === e)?.isSelected && et?.(e);
2250
- }, [$e, et]), Gn = ye === void 0 || be != null, Kn = Pe && !s, qn = async () => {
2229
+ }, [$e, et]), Kn = ye === void 0 || be != null, qn = Pe && !s, Jn = async () => {
2251
2230
  if (Ne || $) return;
2252
2231
  if (Y.length >= ve) {
2253
2232
  Ot?.(Y.length, ve);
@@ -2262,15 +2241,15 @@ var Yt = {
2262
2241
  } catch {
2263
2242
  X(e), yn(t);
2264
2243
  }
2265
- }, Jn = (e) => Ue === nt.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Yn = (e) => {
2244
+ }, Yn = (e) => Ue === nt.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Xn = (e) => {
2266
2245
  if (!zt || e.nativeEvent.isComposing) return !1;
2267
2246
  if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), Vt(), !0;
2268
2247
  if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), Jt(e.key === "ArrowDown" ? Ie.Next : Ie.Previous), !0;
2269
2248
  if (e.key !== "Enter" || e.shiftKey) return !1;
2270
2249
  let t = Yt();
2271
- return t == null ? Jn(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
2272
- }, Xn = (e) => {
2273
- if (!$ && !Rt(e) && !Yn(e)) {
2250
+ return t == null ? Yn(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
2251
+ }, Zn = (e) => {
2252
+ if (!$ && !Rt(e) && !Xn(e)) {
2274
2253
  if (!e.nativeEvent.isComposing && !G && !s) {
2275
2254
  if (e.key === "ArrowUp" || e.key === "ArrowDown") {
2276
2255
  let t = e.currentTarget.selectionStart ?? 0, n = Nt.navigate(e.key === "ArrowUp" ? "up" : "down", Y, t);
@@ -2289,14 +2268,14 @@ var Yt = {
2289
2268
  }
2290
2269
  }
2291
2270
  }
2292
- e.key === "Enter" && Jn(e) && (e.preventDefault(), !s && Bn && Gn && !G && qn());
2271
+ e.key === "Enter" && Yn(e) && (e.preventDefault(), !s && Bn && Kn && !G && Jn());
2293
2272
  }
2294
- }, Zn = (e) => {
2273
+ }, Qn = (e) => {
2295
2274
  let t = Array.from(e.target.files ?? []);
2296
2275
  if (t.length === 0) return;
2297
2276
  let n = _n(t);
2298
2277
  e.target.value = "", vn(n);
2299
- }, Qn = B(() => {
2278
+ }, $n = B(() => {
2300
2279
  let e = [];
2301
2280
  return sn != null && e.push({
2302
2281
  offset: sn,
@@ -2319,10 +2298,10 @@ var Yt = {
2319
2298
  on,
2320
2299
  K,
2321
2300
  rn
2322
- ]), $n = Ft || Qn.length > 0, { mirrorRef: er, selectionRects: tr, updateSelectionRects: nr, syncMirrorToTextarea: rr } = We({
2301
+ ]), er = Ft || $n.length > 0, { mirrorRef: tr, selectionRects: nr, updateSelectionRects: rr, syncMirrorToTextarea: ir } = We({
2323
2302
  textareaRef: Z,
2324
2303
  message: Y,
2325
- isMirrorActive: $n
2304
+ isMirrorActive: er
2326
2305
  });
2327
2306
  ke(() => {
2328
2307
  fn();
@@ -2331,8 +2310,8 @@ var Yt = {
2331
2310
  sn,
2332
2311
  Y
2333
2312
  ]);
2334
- let ir = /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("textarea", {
2335
- className: l(J.textarea, $n && J.textareaMentionMode, P?.fontClassName || "dial-body-paragraph-text", "relative z-0 [field-sizing:content] max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent ps-1 pe-1 outline-hidden", "disabled:cursor-not-allowed"),
2313
+ let ar = /* @__PURE__ */ I("textarea", {
2314
+ className: l(J.textarea, er && J.textareaMentionMode, P?.fontClassName || "dial-body-paragraph-text", "relative z-0 [field-sizing:content] max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent ps-1 pe-1 outline-hidden", "disabled:cursor-not-allowed"),
2336
2315
  ref: Z,
2337
2316
  autoFocus: ft,
2338
2317
  value: Y,
@@ -2341,13 +2320,13 @@ var Yt = {
2341
2320
  let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
2342
2321
  Wt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
2343
2322
  },
2344
- onSelect: nr,
2323
+ onSelect: rr,
2345
2324
  onScroll: () => {
2346
- rr(), sn != null && fn();
2325
+ ir(), sn != null && fn();
2347
2326
  },
2348
2327
  onFocus: $t,
2349
2328
  onClick: Zt,
2350
- onKeyDown: Xn,
2329
+ onKeyDown: Zn,
2351
2330
  onKeyUp: tn,
2352
2331
  onPaste: Rn,
2353
2332
  placeholder: m,
@@ -2359,7 +2338,7 @@ var Yt = {
2359
2338
  disabled: G,
2360
2339
  readOnly: $,
2361
2340
  rows: 1
2362
- }), K != null && /* @__PURE__ */ I("div", {
2341
+ }), or = /* @__PURE__ */ L(F, { children: [ar, K != null && /* @__PURE__ */ I("div", {
2363
2342
  "aria-hidden": !0,
2364
2343
  className: l("pointer-events-none absolute", P?.fontClassName || "dial-body-paragraph-text"),
2365
2344
  style: {
@@ -2376,30 +2355,33 @@ var Yt = {
2376
2355
  initialFocus: -1,
2377
2356
  matchReferenceWidth: !1,
2378
2357
  outsidePressIgnoreRef: Z,
2379
- renderOverlay: () => /* @__PURE__ */ I("div", {
2380
- ref: Kt,
2381
- role: K.menuLabel == null ? void 0 : "group",
2382
- "aria-label": K.menuLabel,
2383
- children: K.renderMenu({
2384
- query: Bt,
2385
- caretPosition: Q ?? 0,
2386
- close: pn,
2387
- listboxId: Gt,
2388
- activeOptionId: qt
2389
- })
2390
- }),
2358
+ renderOverlay: () => {
2359
+ let e = K.menuLabel != null;
2360
+ return /* @__PURE__ */ I("div", {
2361
+ ref: Kt,
2362
+ role: e ? "group" : void 0,
2363
+ "aria-label": K.menuLabel,
2364
+ children: K.renderMenu({
2365
+ query: Bt,
2366
+ caretPosition: Q ?? 0,
2367
+ close: pn,
2368
+ listboxId: Gt,
2369
+ activeOptionId: qt
2370
+ })
2371
+ });
2372
+ },
2391
2373
  children: /* @__PURE__ */ I("span", {
2392
2374
  "aria-hidden": !0,
2393
2375
  className: "inline-block h-lh w-0"
2394
2376
  })
2395
2377
  })
2396
- })] }), ar = /* @__PURE__ */ L("div", {
2378
+ })] }), sr = /* @__PURE__ */ L("div", {
2397
2379
  ref: ln,
2398
2380
  className: "relative -ms-1 -me-1 w-[calc(100%+8px)]",
2399
- children: [$n && /* @__PURE__ */ L("div", {
2400
- ref: er,
2381
+ children: [er && /* @__PURE__ */ L("div", {
2382
+ ref: tr,
2401
2383
  className: l(J.textarea, P?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden ps-1 pe-1 [overflow-wrap:anywhere] whitespace-pre-wrap"),
2402
- children: [Ve(Y, Pt, Qn, J.mentionHighlight, J.mentionHighlightUnsupported), tr.map((e, t) => /* @__PURE__ */ I("div", {
2384
+ children: [Ve(Y, Pt, $n, J.mentionHighlight, J.mentionHighlightUnsupported), nr.map((e, t) => /* @__PURE__ */ I("div", {
2403
2385
  "aria-hidden": !0,
2404
2386
  className: "pointer-events-none absolute rounded-sm bg-control-accent-alpha-active",
2405
2387
  style: {
@@ -2409,8 +2391,8 @@ var Yt = {
2409
2391
  height: e.height
2410
2392
  }
2411
2393
  }, `selection-${t}`))]
2412
- }), ir]
2413
- }), or = we ? void 0 : /* @__PURE__ */ I(mt, {
2394
+ }), or]
2395
+ }), cr = we ? void 0 : /* @__PURE__ */ I(mt, {
2414
2396
  onAttachClick: Te ? void 0 : () => Pn.current?.click(),
2415
2397
  attachLabel: g,
2416
2398
  addMenuTitle: C,
@@ -2428,15 +2410,15 @@ var Yt = {
2428
2410
  toolsBackLabel: ot,
2429
2411
  menuOverlays: ct,
2430
2412
  getCaretPosition: () => Z.current?.selectionStart ?? Y.length
2431
- }), sr = De === rt.Inline && (!At || Ae), cr = or && /* @__PURE__ */ I("div", {
2413
+ }), lr = De === rt.Inline && (!At || Ae), ur = cr && /* @__PURE__ */ I("div", {
2432
2414
  className: l("flex", U.addCluster),
2433
- children: or
2434
- }), lr = Un.length > 0 && et != null && /* @__PURE__ */ I("div", {
2415
+ children: cr
2416
+ }), dr = Wn.length > 0 && et != null && /* @__PURE__ */ I("div", {
2435
2417
  className: l("min-w-0 flex-1", U.toolsChips),
2436
2418
  children: /* @__PURE__ */ I(gt, {
2437
- items: Un,
2419
+ items: Wn,
2438
2420
  onToolToggle: et,
2439
- onToolDismiss: Wn,
2421
+ onToolDismiss: Gn,
2440
2422
  canRemove: it,
2441
2423
  removeLabel: st?.removeLabel,
2442
2424
  stateOnLabel: st?.stateOnLabel,
@@ -2479,7 +2461,7 @@ var Yt = {
2479
2461
  className: "sr-only",
2480
2462
  "aria-hidden": !0,
2481
2463
  tabIndex: -1,
2482
- onChange: Zn
2464
+ onChange: Qn
2483
2465
  }),
2484
2466
  An && /* @__PURE__ */ I(x, {
2485
2467
  text: An,
@@ -2491,31 +2473,31 @@ var Yt = {
2491
2473
  analyserNodeRef: kn,
2492
2474
  onStop: Mn,
2493
2475
  onDiscard: Nn,
2494
- attachButton: or,
2476
+ attachButton: cr,
2495
2477
  stopLabel: ie,
2496
2478
  discardLabel: ae,
2497
2479
  processingLabel: ze
2498
2480
  }),
2499
- !$ && Ee && ar,
2500
- !$ && !Ee && sr && lr && /* @__PURE__ */ I("div", {
2481
+ !$ && Ee && sr,
2482
+ !$ && !Ee && lr && dr && /* @__PURE__ */ I("div", {
2501
2483
  className: "flex",
2502
- children: lr
2484
+ children: dr
2503
2485
  }),
2504
2486
  !$ && !Ee && /* @__PURE__ */ L("div", {
2505
- className: l("flex items-center gap-2", sr ? "flex-nowrap" : "flex-wrap", U.actionRow),
2487
+ className: l("flex items-center gap-2", lr ? "flex-nowrap" : "flex-wrap", U.actionRow),
2506
2488
  children: [
2507
- sr && cr,
2489
+ lr && ur,
2508
2490
  /* @__PURE__ */ I("div", {
2509
- className: l("flex min-w-0 items-center self-stretch", sr ? "flex-1" : "w-full", U.textareaWrap),
2510
- children: ar
2491
+ className: l("flex min-w-0 items-center self-stretch", lr ? "flex-1" : "w-full", U.textareaWrap),
2492
+ children: sr
2511
2493
  }),
2512
- !sr && cr,
2513
- !sr && lr,
2494
+ !lr && ur,
2495
+ !lr && dr,
2514
2496
  /* @__PURE__ */ I("div", {
2515
2497
  className: l("ms-auto flex flex-shrink-0 items-center gap-2", U.footerActions),
2516
2498
  children: W ? W({
2517
2499
  canSend: Bn,
2518
- onSend: qn
2500
+ onSend: Jn
2519
2501
  }) : /* @__PURE__ */ L(F, { children: [
2520
2502
  Dt,
2521
2503
  /* @__PURE__ */ I(en, {
@@ -2533,7 +2515,7 @@ var Yt = {
2533
2515
  onPickerToggle: () => Mt((e) => !e),
2534
2516
  onPickerOpenChange: Mt
2535
2517
  }),
2536
- Kn && /* @__PURE__ */ I(S, {
2518
+ qn && /* @__PURE__ */ I(S, {
2537
2519
  icon: /* @__PURE__ */ I(_e, {
2538
2520
  size: _.LG,
2539
2521
  stroke: v,
@@ -2549,8 +2531,8 @@ var Yt = {
2549
2531
  onStop: o,
2550
2532
  ariaLabel: te
2551
2533
  }) : !s && /* @__PURE__ */ I(St, {
2552
- onSend: qn,
2553
- isDisabled: !Gn || !Bn,
2534
+ onSend: Jn,
2535
+ isDisabled: !Kn || !Bn,
2554
2536
  ariaLabel: A,
2555
2537
  sendTooltip: zn ? j : M ?? j
2556
2538
  })
@@ -2573,12 +2555,12 @@ var nn = {
2573
2555
  welcome: "_welcome_1icyo_1",
2574
2556
  description: "_description_1icyo_5"
2575
2557
  }, rn = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, aboveInputSlot: a, styles: o, className: s, inputClassName: u, isInputDisabled: d = !1, ...f }) => {
2576
- let { colors: p, typography: m, attachmentTray: h, modelMenu: g } = o ?? {};
2558
+ let { colors: p, typography: m, attachmentTray: h, modelMenu: g } = o ?? {}, _ = c({
2559
+ "--ci-welcome-color": p?.welcomeText,
2560
+ "--ci-description-color": p?.descriptionText
2561
+ });
2577
2562
  return /* @__PURE__ */ L("div", {
2578
- style: c({
2579
- "--ci-welcome-color": p?.welcomeText,
2580
- "--ci-description-color": p?.descriptionText
2581
- }),
2563
+ style: _,
2582
2564
  className: l("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", s),
2583
2565
  children: [
2584
2566
  n && /* @__PURE__ */ L("div", {
@@ -2624,13 +2606,7 @@ var nn = {
2624
2606
  }, Ee = R((e, t) => {
2625
2607
  p(e, xe, t);
2626
2608
  }, [xe, p]), De = () => {
2627
- if (we) {
2628
- if (_e.length >= ue) {
2629
- de?.(_e.length, ue);
2630
- return;
2631
- }
2632
- Ee(_e, ye);
2633
- }
2609
+ we && (_e.length >= ue ? de?.(_e.length, ue) : Ee(_e, ye));
2634
2610
  }, Oe = R(() => he([]), []), ke = R((e) => {
2635
2611
  ve(e), n?.(e);
2636
2612
  }, [n]), U = R((e) => {
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.124",
4
+ "version": "1.3.0-dev.126",
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.2.7",
21
21
  "@tabler/icons-react": "^3.44.0",
22
- "@epam/ai-dial-attachment-input": "1.3.0-dev.124"
22
+ "@epam/ai-dial-attachment-input": "1.3.0-dev.126"
23
23
  },
24
24
  "peerDependencies": {
25
- "@epam/ai-dial-chat-shared": "1.3.0-dev.124",
25
+ "@epam/ai-dial-chat-shared": "1.3.0-dev.126",
26
26
  "react": "^19.2.8",
27
27
  "@epam/ai-dial-ui-kit": "^0.16.0-dev.20"
28
28
  },