@epam/ai-dial-conversation-input 1.2.8 → 1.2.10

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 +163 -183
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -91,11 +91,7 @@ var H = {
91
91
  });
92
92
  }, []);
93
93
  R(() => {
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 = L((e) => {
101
97
  _(e);
@@ -250,15 +246,7 @@ var H = {
250
246
  })() : "", u = L((t, n, i) => {
251
247
  if (e == null || i) return;
252
248
  let { start: c, end: l } = Pe(t, n), u = t.slice(c, l);
253
- if (!Fe(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
+ Fe(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
  R(() => {
264
252
  if (e == null) {
@@ -277,11 +265,7 @@ var H = {
277
265
  }, []), p = L((n) => {
278
266
  if (e == null) return;
279
267
  let { start: i, end: s } = Pe(t, n);
280
- if (!Fe(t.slice(i, s), e.triggerPrefix)) {
281
- a(null), r(!1);
282
- return;
283
- }
284
- a(i), r(o !== i);
268
+ Fe(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 H = {
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 H = {
800
784
  }, G = {
801
785
  icon: "_icon_1fv6z_1",
802
786
  selectedIcon: "_selectedIcon_1fv6z_5"
803
- }, pt = ({ 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__ */ F(U, {
804
- isOpen: e,
805
- title: o,
806
- closeLabel: i,
807
- onClose: r,
808
- onBack: t,
809
- backLabel: n,
810
- style: a,
811
- children: /* @__PURE__ */ F("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__ */ F("li", {
819
- role: "none",
820
- children: /* @__PURE__ */ F(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__ */ F("span", {
826
- className: l("flex items-center", G.icon),
827
- children: e.icon
828
- }),
829
- iconAfter: e.isSelected ? /* @__PURE__ */ F("span", {
830
- className: l("ms-auto", G.selectedIcon),
831
- children: /* @__PURE__ */ F(me, {
832
- size: f,
833
- "aria-hidden": !0,
834
- stroke: v
835
- })
836
- }) : null,
837
- label: /* @__PURE__ */ F("span", {
838
- className: d,
839
- children: e.label
840
- }),
841
- onClick: () => u(e.id)
842
- })
843
- }, e.id))
844
- })
845
- }), mt = {
787
+ }, pt = ({ 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__ */ F(U, {
793
+ isOpen: e,
794
+ title: o,
795
+ closeLabel: i,
796
+ onClose: r,
797
+ onBack: t,
798
+ backLabel: n,
799
+ style: a,
800
+ children: /* @__PURE__ */ F("ul", {
801
+ role: "menu",
802
+ className: "flex flex-col pb-4",
803
+ style: h,
804
+ children: s.map((e) => /* @__PURE__ */ F("li", {
805
+ role: "none",
806
+ children: /* @__PURE__ */ F(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__ */ F("span", {
812
+ className: l("flex items-center", G.icon),
813
+ children: e.icon
814
+ }),
815
+ iconAfter: e.isSelected ? /* @__PURE__ */ F("span", {
816
+ className: l("ms-auto", G.selectedIcon),
817
+ children: /* @__PURE__ */ F(me, {
818
+ size: f,
819
+ "aria-hidden": !0,
820
+ stroke: v
821
+ })
822
+ }) : null,
823
+ label: /* @__PURE__ */ F("span", {
824
+ className: d,
825
+ children: e.label
826
+ }),
827
+ onClick: () => u(e.id)
828
+ })
829
+ }, e.id))
830
+ })
831
+ });
832
+ }, mt = {
846
833
  toolIcon: "_toolIcon_ma5s5_1",
847
834
  chevronIcon: "_chevronIcon_ma5s5_5"
848
835
  }, ht = ({ 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: te }) => {
@@ -1090,23 +1077,23 @@ var H = {
1090
1077
  chipClose: "_chipClose_1lvv5_25"
1091
1078
  }, gt = (e) => `Remove ${e}`, _t = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = gt, 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__ */ F("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__ */ I("div", {
1111
1098
  className: l(K.chip, e.isSelected && K.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "pe-1 ps-2" : "px-2"),
1112
1099
  children: [/* @__PURE__ */ I("button", {
@@ -1170,7 +1157,7 @@ var H = {
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 / bt)), xt - 1), a = m.current, o = h.current;
1160
+ let i = Math.min(Math.max(1, Math.floor(n / bt)), 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) % xt + xt) % xt, o = p.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
@@ -1414,9 +1401,7 @@ var H = {
1414
1401
  function Pt(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 Ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
@@ -1477,12 +1462,10 @@ function Rt(e = !1) {
1477
1462
  function J({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1478
1463
  if (t === "horizontal" && n) switch (Rt()) {
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 Z({ 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 Ut({ containerSize: e, itemSize: t }) {
1590
1571
  case "string":
1591
1572
  Y(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Y(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 Wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1646
1625
  h,
1647
1626
  a,
1648
1627
  m
1649
- ]), w = L((t) => Vt({
1650
- cachedBounds: h,
1651
- containerScrollOffset: J({
1628
+ ]), w = L((t) => {
1629
+ let n = J({
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 Vt({
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 Wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1667
1649
  l
1668
1650
  ]);
1669
1651
  return Nt(() => {
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 Wt({ 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 = Vt({
1662
+ let { scrollLeft: n, scrollTop: o } = e, s = J({
1663
+ containerElement: e,
1664
+ direction: r,
1665
+ isRtl: i,
1666
+ scrollOffset: r === "vertical" ? o : n
1667
+ }), c = Vt({
1680
1668
  cachedBounds: h,
1681
- containerScrollOffset: J({
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 X(s, t) ? t : s;
1674
+ return X(c, t) ? t : c;
1692
1675
  });
1693
1676
  };
1694
1677
  return e.addEventListener("scroll", t), () => {
@@ -2117,7 +2100,7 @@ var Xt = {
2117
2100
  Zt.current(e?.selectionStart ?? e?.value.length ?? 0);
2118
2101
  });
2119
2102
  }, en = (e) => {
2120
- e.key !== "ArrowLeft" && e.key !== "ArrowRight" && e.key !== "Home" && e.key !== "End" && e.key !== "PageUp" && e.key !== "PageDown" || Wt(e.currentTarget.selectionStart ?? J.length);
2103
+ (e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") && Wt(e.currentTarget.selectionStart ?? J.length);
2121
2104
  }, nn = G?.emptyQueryHint != null, rn = G != null && Z != null ? Z + G.triggerPrefix.length : null, an = rn != null && J.slice(rn).split("\n", 1)[0] !== "", on = nn && Bt && Vt === "" && rn != null && !an, Q = G != null && Bt ? Z ?? 0 : null, sn = B(null), cn = B(null), [ln, un] = V(null), dn = L(() => {
2122
2105
  let e = sn.current, t = cn.current;
2123
2106
  if (e == null || t == null) {
@@ -2159,7 +2142,7 @@ var Xt = {
2159
2142
  X
2160
2143
  ]), pn = B(void 0);
2161
2144
  R(() => {
2162
- ft == null || pn.current === t || (pn.current = t, X.current?.setSelectionRange(ft, ft), Wt(ft));
2145
+ ft != null && pn.current !== t && (pn.current = t, X.current?.setSelectionRange(ft, ft), Wt(ft));
2163
2146
  }, [J]);
2164
2147
  let { attachments: mn, buildAttachments: hn, addAttachments: gn, resetAttachments: _n, handleRemove: vn, handleRetry: yn, handleExpand: bn, hasBlockedAttachments: xn } = Me({
2165
2148
  initialAttachments: we,
@@ -2221,20 +2204,20 @@ var Xt = {
2221
2204
  kt,
2222
2205
  In,
2223
2206
  G
2224
- ]), Rn = J.trim().length > 0 || mn.length > 0, zn = Rn && !xn && !Pe && !$, [Bn, Vn] = V([]);
2207
+ ]), Rn = J.trim().length > 0 || mn.length > 0, zn = Rn && !xn && !Pe && !$, [Bn, Vn] = V([]), Hn = (et ?? []).map((e) => e.id).join("|");
2225
2208
  R(() => {
2226
2209
  Vn([]);
2227
- }, [(et ?? []).map((e) => e.id).join("|")]);
2228
- let Hn = z(() => {
2210
+ }, [Hn]);
2211
+ let Un = z(() => {
2229
2212
  let e = et ?? [];
2230
2213
  return at ? e.filter((e) => e.isSelected || !Bn.includes(e.id)) : e;
2231
2214
  }, [
2232
2215
  et,
2233
2216
  Bn,
2234
2217
  at
2235
- ]), Un = L((e) => {
2218
+ ]), Wn = L((e) => {
2236
2219
  Vn((t) => t.includes(e) ? t : [...t, e]), et?.find((t) => t.id === e)?.isSelected && tt?.(e);
2237
- }, [et, tt]), Wn = be === void 0 || xe != null, Gn = Fe && !s, Kn = async () => {
2220
+ }, [et, tt]), Gn = be === void 0 || xe != null, Kn = Fe && !s, qn = async () => {
2238
2221
  if (Pe || $) return;
2239
2222
  if (J.length >= ye) {
2240
2223
  kt?.(J.length, ye);
@@ -2249,15 +2232,15 @@ var Xt = {
2249
2232
  } catch {
2250
2233
  Y(e), _n(t);
2251
2234
  }
2252
- }, qn = (e) => We === rt.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Jn = (e) => {
2235
+ }, Jn = (e) => We === rt.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Yn = (e) => {
2253
2236
  if (!Bt || e.nativeEvent.isComposing) return !1;
2254
2237
  if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), Ht(), !0;
2255
2238
  if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), Yt(e.key === "ArrowDown" ? Le.Next : Le.Previous), !0;
2256
2239
  if (e.key !== "Enter" || e.shiftKey) return !1;
2257
2240
  let t = Xt();
2258
- return t == null ? qn(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
2259
- }, Yn = (e) => {
2260
- if (!$ && !zt(e) && !Jn(e)) {
2241
+ return t == null ? Jn(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
2242
+ }, Xn = (e) => {
2243
+ if (!$ && !zt(e) && !Yn(e)) {
2261
2244
  if (!e.nativeEvent.isComposing && !W && !s) {
2262
2245
  if (e.key === "ArrowUp" || e.key === "ArrowDown") {
2263
2246
  let t = e.currentTarget.selectionStart ?? 0, n = Pt.navigate(e.key === "ArrowUp" ? "up" : "down", J, t);
@@ -2276,14 +2259,14 @@ var Xt = {
2276
2259
  }
2277
2260
  }
2278
2261
  }
2279
- e.key === "Enter" && qn(e) && (e.preventDefault(), !s && zn && Wn && !W && Kn());
2262
+ e.key === "Enter" && Jn(e) && (e.preventDefault(), !s && zn && Gn && !W && qn());
2280
2263
  }
2281
- }, Xn = (e) => {
2264
+ }, Zn = (e) => {
2282
2265
  let t = Array.from(e.target.files ?? []);
2283
2266
  if (t.length === 0) return;
2284
2267
  let n = hn(t);
2285
2268
  e.target.value = "", gn(n);
2286
- }, Zn = z(() => {
2269
+ }, Qn = z(() => {
2287
2270
  let e = [];
2288
2271
  return Q != null && e.push({
2289
2272
  offset: Q,
@@ -2306,10 +2289,10 @@ var Xt = {
2306
2289
  on,
2307
2290
  G,
2308
2291
  rn
2309
- ]), Qn = It || Zn.length > 0, { mirrorRef: $n, selectionRects: er, updateSelectionRects: tr, syncMirrorToTextarea: nr } = Ge({
2292
+ ]), $n = It || Qn.length > 0, { mirrorRef: er, selectionRects: tr, updateSelectionRects: nr, syncMirrorToTextarea: rr } = Ge({
2310
2293
  textareaRef: X,
2311
2294
  message: J,
2312
- isMirrorActive: Qn
2295
+ isMirrorActive: $n
2313
2296
  });
2314
2297
  Ae(() => {
2315
2298
  dn();
@@ -2318,8 +2301,8 @@ var Xt = {
2318
2301
  Q,
2319
2302
  J
2320
2303
  ]);
2321
- let rr = /* @__PURE__ */ F("textarea", {
2322
- className: l(q.textarea, Qn && q.textareaMentionMode, N?.fontClassName || "dial-body-paragraph-text", "relative z-0 max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent pe-1 ps-1 outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
2304
+ let ir = /* @__PURE__ */ F("textarea", {
2305
+ className: l(q.textarea, $n && q.textareaMentionMode, N?.fontClassName || "dial-body-paragraph-text", "relative z-0 max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent pe-1 ps-1 outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
2323
2306
  ref: X,
2324
2307
  autoFocus: pt,
2325
2308
  value: J,
@@ -2328,13 +2311,13 @@ var Xt = {
2328
2311
  let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
2329
2312
  Gt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
2330
2313
  },
2331
- onSelect: tr,
2314
+ onSelect: nr,
2332
2315
  onScroll: () => {
2333
- nr(), Q != null && dn();
2316
+ rr(), Q != null && dn();
2334
2317
  },
2335
2318
  onFocus: $t,
2336
2319
  onClick: Qt,
2337
- onKeyDown: Yn,
2320
+ onKeyDown: Xn,
2338
2321
  onKeyUp: en,
2339
2322
  onPaste: Ln,
2340
2323
  placeholder: m,
@@ -2346,7 +2329,7 @@ var Xt = {
2346
2329
  disabled: W,
2347
2330
  readOnly: $,
2348
2331
  rows: 1
2349
- }), ir = G == null ? rr : /* @__PURE__ */ I(P, { children: [rr, /* @__PURE__ */ F("div", {
2332
+ }), ar = G == null ? ir : /* @__PURE__ */ I(P, { children: [ir, /* @__PURE__ */ F("div", {
2350
2333
  "aria-hidden": !0,
2351
2334
  className: l("pointer-events-none absolute", N?.fontClassName || "dial-body-paragraph-text"),
2352
2335
  style: {
@@ -2363,30 +2346,33 @@ var Xt = {
2363
2346
  initialFocus: -1,
2364
2347
  matchReferenceWidth: !1,
2365
2348
  outsidePressIgnoreRef: X,
2366
- renderOverlay: () => /* @__PURE__ */ F("div", {
2367
- ref: qt,
2368
- role: G.menuLabel == null ? void 0 : "group",
2369
- "aria-label": G.menuLabel,
2370
- children: G.renderMenu({
2371
- query: Vt,
2372
- caretPosition: Z ?? 0,
2373
- close: fn,
2374
- listboxId: Kt,
2375
- activeOptionId: Jt
2376
- })
2377
- }),
2349
+ renderOverlay: () => {
2350
+ let e = G.menuLabel != null;
2351
+ return /* @__PURE__ */ F("div", {
2352
+ ref: qt,
2353
+ role: e ? "group" : void 0,
2354
+ "aria-label": G.menuLabel,
2355
+ children: G.renderMenu({
2356
+ query: Vt,
2357
+ caretPosition: Z ?? 0,
2358
+ close: fn,
2359
+ listboxId: Kt,
2360
+ activeOptionId: Jt
2361
+ })
2362
+ });
2363
+ },
2378
2364
  children: /* @__PURE__ */ F("span", {
2379
2365
  "aria-hidden": !0,
2380
2366
  className: "inline-block h-[1lh] w-0"
2381
2367
  })
2382
2368
  })
2383
- })] }), ar = /* @__PURE__ */ I("div", {
2369
+ })] }), or = /* @__PURE__ */ I("div", {
2384
2370
  ref: cn,
2385
2371
  className: "relative -me-1 -ms-1 w-[calc(100%+8px)]",
2386
- children: [Qn && /* @__PURE__ */ I("div", {
2387
- ref: $n,
2372
+ children: [$n && /* @__PURE__ */ I("div", {
2373
+ ref: er,
2388
2374
  className: l(q.textarea, N?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden whitespace-pre-wrap pe-1 ps-1 [overflow-wrap:anywhere]"),
2389
- children: [He(J, Ft, Zn, q.mentionHighlight, q.mentionHighlightUnsupported), er.map((e, t) => /* @__PURE__ */ F("div", {
2375
+ children: [He(J, Ft, Qn, q.mentionHighlight, q.mentionHighlightUnsupported), tr.map((e, t) => /* @__PURE__ */ F("div", {
2390
2376
  "aria-hidden": !0,
2391
2377
  className: "pointer-events-none absolute rounded-sm bg-control-accent-alpha-active",
2392
2378
  style: {
@@ -2396,8 +2382,8 @@ var Xt = {
2396
2382
  height: e.height
2397
2383
  }
2398
2384
  }, `selection-${t}`))]
2399
- }), ir]
2400
- }), or = Te ? void 0 : /* @__PURE__ */ F(ht, {
2385
+ }), ar]
2386
+ }), sr = Te ? void 0 : /* @__PURE__ */ F(ht, {
2401
2387
  onAttachClick: Ee ? void 0 : () => Nn.current?.click(),
2402
2388
  attachLabel: g,
2403
2389
  addMenuTitle: C,
@@ -2415,15 +2401,15 @@ var Xt = {
2415
2401
  toolsBackLabel: st,
2416
2402
  menuOverlays: lt,
2417
2403
  getCaretPosition: () => X.current?.selectionStart ?? J.length
2418
- }), sr = Oe === it.Inline && (!jt || je), cr = or && /* @__PURE__ */ F("div", {
2404
+ }), cr = Oe === it.Inline && (!jt || je), lr = sr && /* @__PURE__ */ F("div", {
2419
2405
  className: l("flex", H.addCluster),
2420
- children: or
2421
- }), lr = Hn.length > 0 && tt != null && /* @__PURE__ */ F("div", {
2406
+ children: sr
2407
+ }), ur = Un.length > 0 && tt != null && /* @__PURE__ */ F("div", {
2422
2408
  className: l("min-w-0 flex-1", H.toolsChips),
2423
2409
  children: /* @__PURE__ */ F(_t, {
2424
- items: Hn,
2410
+ items: Un,
2425
2411
  onToolToggle: tt,
2426
- onToolDismiss: Un,
2412
+ onToolDismiss: Wn,
2427
2413
  canRemove: at,
2428
2414
  removeLabel: ct?.removeLabel,
2429
2415
  stateOnLabel: ct?.stateOnLabel,
@@ -2466,7 +2452,7 @@ var Xt = {
2466
2452
  className: "sr-only",
2467
2453
  "aria-hidden": !0,
2468
2454
  tabIndex: -1,
2469
- onChange: Xn
2455
+ onChange: Zn
2470
2456
  }),
2471
2457
  kn && /* @__PURE__ */ F(x, {
2472
2458
  text: kn,
@@ -2478,31 +2464,31 @@ var Xt = {
2478
2464
  analyserNodeRef: On,
2479
2465
  onStop: jn,
2480
2466
  onDiscard: Mn,
2481
- attachButton: or,
2467
+ attachButton: sr,
2482
2468
  stopLabel: ae,
2483
2469
  discardLabel: oe,
2484
2470
  processingLabel: Be
2485
2471
  }),
2486
- !$ && De && ar,
2487
- !$ && !De && sr && lr && /* @__PURE__ */ F("div", {
2472
+ !$ && De && or,
2473
+ !$ && !De && cr && ur && /* @__PURE__ */ F("div", {
2488
2474
  className: "flex",
2489
- children: lr
2475
+ children: ur
2490
2476
  }),
2491
2477
  !$ && !De && /* @__PURE__ */ I("div", {
2492
- className: l("flex items-center gap-2", sr ? "flex-nowrap" : "flex-wrap", H.actionRow),
2478
+ className: l("flex items-center gap-2", cr ? "flex-nowrap" : "flex-wrap", H.actionRow),
2493
2479
  children: [
2494
- sr && cr,
2480
+ cr && lr,
2495
2481
  /* @__PURE__ */ F("div", {
2496
- className: l("flex min-w-0 items-center self-stretch", sr ? "flex-1" : "w-full", H.textareaWrap),
2497
- children: ar
2482
+ className: l("flex min-w-0 items-center self-stretch", cr ? "flex-1" : "w-full", H.textareaWrap),
2483
+ children: or
2498
2484
  }),
2499
- !sr && cr,
2500
- !sr && lr,
2485
+ !cr && lr,
2486
+ !cr && ur,
2501
2487
  /* @__PURE__ */ F("div", {
2502
2488
  className: l("ms-auto flex flex-shrink-0 items-center gap-2", H.footerActions),
2503
2489
  children: U ? U({
2504
2490
  canSend: zn,
2505
- onSend: Kn
2491
+ onSend: qn
2506
2492
  }) : /* @__PURE__ */ I(P, { children: [
2507
2493
  Ot,
2508
2494
  /* @__PURE__ */ F(tn, {
@@ -2520,7 +2506,7 @@ var Xt = {
2520
2506
  onPickerToggle: () => Nt((e) => !e),
2521
2507
  onPickerOpenChange: Nt
2522
2508
  }),
2523
- Gn && /* @__PURE__ */ F(S, {
2509
+ Kn && /* @__PURE__ */ F(S, {
2524
2510
  icon: /* @__PURE__ */ F(ve, {
2525
2511
  size: _.LG,
2526
2512
  stroke: v,
@@ -2536,8 +2522,8 @@ var Xt = {
2536
2522
  onStop: o,
2537
2523
  ariaLabel: ne
2538
2524
  }) : !s && /* @__PURE__ */ F(Ct, {
2539
- onSend: Kn,
2540
- isDisabled: !Wn || !zn,
2525
+ onSend: qn,
2526
+ isDisabled: !Gn || !zn,
2541
2527
  ariaLabel: k,
2542
2528
  sendTooltip: Rn ? A : j ?? A
2543
2529
  })
@@ -2560,12 +2546,12 @@ var rn = {
2560
2546
  welcome: "_welcome_1icyo_1",
2561
2547
  description: "_description_1icyo_5"
2562
2548
  }, an = ({ 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 }) => {
2563
- let { colors: p, typography: m, attachmentTray: h, modelMenu: g } = o ?? {};
2549
+ let { colors: p, typography: m, attachmentTray: h, modelMenu: g } = o ?? {}, _ = c({
2550
+ "--ci-welcome-color": p?.welcomeText,
2551
+ "--ci-description-color": p?.descriptionText
2552
+ });
2564
2553
  return /* @__PURE__ */ I("div", {
2565
- style: c({
2566
- "--ci-welcome-color": p?.welcomeText,
2567
- "--ci-description-color": p?.descriptionText
2568
- }),
2554
+ style: _,
2569
2555
  className: l("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", s),
2570
2556
  children: [
2571
2557
  n && /* @__PURE__ */ I("div", {
@@ -2611,13 +2597,7 @@ var rn = {
2611
2597
  }, De = L((e, t) => {
2612
2598
  p(e, Se, t);
2613
2599
  }, [Se, p]), Oe = () => {
2614
- if (Te) {
2615
- if (ve.length >= de) {
2616
- fe?.(ve.length, de);
2617
- return;
2618
- }
2619
- De(ve, be);
2620
- }
2600
+ Te && (ve.length >= de ? fe?.(ve.length, de) : De(ve, be));
2621
2601
  }, ke = L(() => ge([]), []), Ae = L((e) => {
2622
2602
  ye(e), n?.(e);
2623
2603
  }, [n]), H = L((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.2.8",
4
+ "version": "1.2.10",
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.2.8"
22
+ "@epam/ai-dial-attachment-input": "1.2.10"
23
23
  },
24
24
  "peerDependencies": {
25
- "@epam/ai-dial-chat-shared": "1.2.8",
25
+ "@epam/ai-dial-chat-shared": "1.2.10",
26
26
  "react": "^19.2.8",
27
27
  "@epam/ai-dial-ui-kit": "^0.15.4"
28
28
  },