@epam/ai-dial-conversation-input 1.2.0-dev.266 → 1.2.0-dev.270
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":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAkDA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAalE,wIAAwI;AACxI,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAkDA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAalE,wIAAwI;AACxI,eAAO,MAAM,KAAK,oGAswCjB,CAAC"}
|
|
@@ -5,8 +5,8 @@ interface UseMentionSelectionMirrorParams {
|
|
|
5
5
|
textareaRef: RefObject<HTMLTextAreaElement | null>;
|
|
6
6
|
/** Current textarea value — a selection-rect recompute trigger. */
|
|
7
7
|
message: string;
|
|
8
|
-
/** Whether
|
|
9
|
-
|
|
8
|
+
/** Whether the highlight mirror is rendered (a mention or a synthetic insertion is present). */
|
|
9
|
+
isMirrorActive: boolean;
|
|
10
10
|
}
|
|
11
11
|
/** Return value of {@link useMentionSelectionMirror}. */
|
|
12
12
|
interface UseMentionSelectionMirrorResult {
|
|
@@ -17,6 +17,6 @@ interface UseMentionSelectionMirrorResult {
|
|
|
17
17
|
/** Recomputes `selectionRects` from the textarea's current native selection. */
|
|
18
18
|
updateSelectionRects: () => void;
|
|
19
19
|
}
|
|
20
|
-
export declare const useMentionSelectionMirror: ({ textareaRef, message,
|
|
20
|
+
export declare const useMentionSelectionMirror: ({ textareaRef, message, isMirrorActive, }: UseMentionSelectionMirrorParams) => UseMentionSelectionMirrorResult;
|
|
21
21
|
export {};
|
|
22
22
|
//# sourceMappingURL=useMentionSelectionMirror.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMentionSelectionMirror.d.ts","sourceRoot":"","sources":["../../src/hooks/useMentionSelectionMirror.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,wDAAwD;AACxD,UAAU,+BAA+B;IACvC,6EAA6E;IAC7E,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,
|
|
1
|
+
{"version":3,"file":"useMentionSelectionMirror.d.ts","sourceRoot":"","sources":["../../src/hooks/useMentionSelectionMirror.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,wDAAwD;AACxD,UAAU,+BAA+B;IACvC,6EAA6E;IAC7E,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,yDAAyD;AACzD,UAAU,+BAA+B;IACvC,qDAAqD;IACrD,SAAS,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC5C,kFAAkF;IAClF,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,gFAAgF;IAChF,oBAAoB,EAAE,MAAM,IAAI,CAAC;CAClC;AAmBD,eAAO,MAAM,yBAAyB,GAAI,2CAIvC,+BAA+B,KAAG,+BA6DpC,CAAC"}
|
package/index.js
CHANGED
|
@@ -369,7 +369,7 @@ var U = {
|
|
|
369
369
|
if (r == null || i == null) return null;
|
|
370
370
|
let a = document.createRange();
|
|
371
371
|
return a.setStart(r.node, r.offset), a.setEnd(i.node, i.offset), a;
|
|
372
|
-
}, Ve = ({ textareaRef: e, message: t,
|
|
372
|
+
}, Ve = ({ textareaRef: e, message: t, isMirrorActive: n }) => {
|
|
373
373
|
let r = V(null), [i, a] = H([]), o = R(() => {
|
|
374
374
|
let t = e.current, i = r.current, o = t?.selectionStart, s = t?.selectionEnd;
|
|
375
375
|
if (!n || t == null || i == null || o == null || s == null || o === s) {
|
|
@@ -1442,18 +1442,18 @@ function Nt(e) {
|
|
|
1442
1442
|
t.current = e;
|
|
1443
1443
|
}, [e]), R((e) => t.current?.(e), [t]);
|
|
1444
1444
|
}
|
|
1445
|
-
var
|
|
1446
|
-
function
|
|
1447
|
-
if (
|
|
1445
|
+
var Pt = null;
|
|
1446
|
+
function Ft(e = !1) {
|
|
1447
|
+
if (Pt === null || e) {
|
|
1448
1448
|
let e = document.createElement("div"), t = e.style;
|
|
1449
1449
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1450
1450
|
let n = document.createElement("div"), r = n.style;
|
|
1451
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1451
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? Pt = "positive-descending" : (e.scrollLeft = 1, Pt = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), Pt;
|
|
1452
1452
|
}
|
|
1453
|
-
return
|
|
1453
|
+
return Pt;
|
|
1454
1454
|
}
|
|
1455
|
-
function
|
|
1456
|
-
if (t === "horizontal" && n) switch (
|
|
1455
|
+
function It({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1456
|
+
if (t === "horizontal" && n) switch (Ft()) {
|
|
1457
1457
|
case "negative": return -r;
|
|
1458
1458
|
case "positive-descending":
|
|
1459
1459
|
if (e) {
|
|
@@ -1464,26 +1464,26 @@ function Ft({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
return r;
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1467
|
+
function J(e, t = "Assertion error") {
|
|
1468
1468
|
if (!e) throw console.error(t), Error(t);
|
|
1469
1469
|
}
|
|
1470
|
-
function
|
|
1470
|
+
function Y(e, t) {
|
|
1471
1471
|
if (e === t) return !0;
|
|
1472
|
-
if (!!e != !!t || (
|
|
1472
|
+
if (!!e != !!t || (J(e !== void 0), J(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1473
1473
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1474
1474
|
return !0;
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1476
|
+
function X({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1477
1477
|
if (t === 0) return 0;
|
|
1478
1478
|
if (typeof n == "number") return t * n;
|
|
1479
1479
|
{
|
|
1480
1480
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
1481
|
-
return
|
|
1481
|
+
return J(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
|
-
function
|
|
1484
|
+
function Lt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1485
1485
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1486
|
-
let s =
|
|
1486
|
+
let s = X({
|
|
1487
1487
|
cachedBounds: t,
|
|
1488
1488
|
itemCount: r,
|
|
1489
1489
|
itemSize: i
|
|
@@ -1495,7 +1495,7 @@ function It({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1495
1495
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1496
1496
|
}
|
|
1497
1497
|
}
|
|
1498
|
-
function
|
|
1498
|
+
function Rt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1499
1499
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1500
1500
|
for (; u < a;) {
|
|
1501
1501
|
let n = e.get(u);
|
|
@@ -1514,11 +1514,11 @@ function Lt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1514
1514
|
stopIndexOverscan: l
|
|
1515
1515
|
};
|
|
1516
1516
|
}
|
|
1517
|
-
function
|
|
1517
|
+
function zt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1518
1518
|
let r = /* @__PURE__ */ new Map();
|
|
1519
1519
|
return {
|
|
1520
1520
|
get(i) {
|
|
1521
|
-
for (
|
|
1521
|
+
for (J(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
|
|
1522
1522
|
let e = r.size, a;
|
|
1523
1523
|
switch (typeof n) {
|
|
1524
1524
|
case "function":
|
|
@@ -1534,14 +1534,14 @@ function Rt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1534
1534
|
});
|
|
1535
1535
|
else {
|
|
1536
1536
|
let t = r.get(e - 1);
|
|
1537
|
-
|
|
1537
|
+
J(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
1538
1538
|
scrollOffset: t.scrollOffset + t.size,
|
|
1539
1539
|
size: a
|
|
1540
1540
|
});
|
|
1541
1541
|
}
|
|
1542
1542
|
}
|
|
1543
1543
|
let a = r.get(i);
|
|
1544
|
-
return
|
|
1544
|
+
return J(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
1545
1545
|
},
|
|
1546
1546
|
set(e, t) {
|
|
1547
1547
|
r.set(e, t);
|
|
@@ -1551,8 +1551,8 @@ function Rt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1551
1551
|
}
|
|
1552
1552
|
};
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1555
|
-
return B(() =>
|
|
1554
|
+
function Z({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1555
|
+
return B(() => zt({
|
|
1556
1556
|
itemCount: e,
|
|
1557
1557
|
itemProps: t,
|
|
1558
1558
|
itemSize: n
|
|
@@ -1562,11 +1562,11 @@ function Q({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1562
1562
|
n
|
|
1563
1563
|
]);
|
|
1564
1564
|
}
|
|
1565
|
-
function
|
|
1565
|
+
function Bt({ containerSize: e, itemSize: t }) {
|
|
1566
1566
|
let n;
|
|
1567
1567
|
switch (typeof t) {
|
|
1568
1568
|
case "string":
|
|
1569
|
-
|
|
1569
|
+
J(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), J(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
|
|
1570
1570
|
break;
|
|
1571
1571
|
default:
|
|
1572
1572
|
n = t;
|
|
@@ -1574,7 +1574,7 @@ function zt({ containerSize: e, itemSize: t }) {
|
|
|
1574
1574
|
}
|
|
1575
1575
|
return n;
|
|
1576
1576
|
}
|
|
1577
|
-
function
|
|
1577
|
+
function Vt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1578
1578
|
let { height: u = n, width: d = n } = Mt({
|
|
1579
1579
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1580
1580
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
@@ -1584,7 +1584,7 @@ function Bt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1584
1584
|
}), f = V({
|
|
1585
1585
|
height: 0,
|
|
1586
1586
|
width: 0
|
|
1587
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1587
|
+
}), p = r === "vertical" ? u : d, m = Bt({
|
|
1588
1588
|
containerSize: p,
|
|
1589
1589
|
itemSize: s
|
|
1590
1590
|
});
|
|
@@ -1601,11 +1601,11 @@ function Bt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1601
1601
|
c,
|
|
1602
1602
|
d
|
|
1603
1603
|
]);
|
|
1604
|
-
let h =
|
|
1604
|
+
let h = Z({
|
|
1605
1605
|
itemCount: a,
|
|
1606
1606
|
itemProps: o,
|
|
1607
1607
|
itemSize: m
|
|
1608
|
-
}), g = R((e) => h.get(e), [h]), [_, v] = H(() =>
|
|
1608
|
+
}), g = R((e) => h.get(e), [h]), [_, v] = H(() => Rt({
|
|
1609
1609
|
cachedBounds: h,
|
|
1610
1610
|
containerScrollOffset: 0,
|
|
1611
1611
|
containerSize: p,
|
|
@@ -1616,7 +1616,7 @@ function Bt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1616
1616
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1617
1617
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1618
1618
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1619
|
-
}, C = R(() =>
|
|
1619
|
+
}, C = R(() => X({
|
|
1620
1620
|
cachedBounds: h,
|
|
1621
1621
|
itemCount: a,
|
|
1622
1622
|
itemSize: m
|
|
@@ -1624,9 +1624,9 @@ function Bt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1624
1624
|
h,
|
|
1625
1625
|
a,
|
|
1626
1626
|
m
|
|
1627
|
-
]), w = R((t) =>
|
|
1627
|
+
]), w = R((t) => Rt({
|
|
1628
1628
|
cachedBounds: h,
|
|
1629
|
-
containerScrollOffset:
|
|
1629
|
+
containerScrollOffset: It({
|
|
1630
1630
|
containerElement: e,
|
|
1631
1631
|
direction: r,
|
|
1632
1632
|
isRtl: i,
|
|
@@ -1654,9 +1654,9 @@ function Bt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1654
1654
|
if (!e) return;
|
|
1655
1655
|
let t = () => {
|
|
1656
1656
|
v((t) => {
|
|
1657
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1657
|
+
let { scrollLeft: n, scrollTop: o } = e, s = Rt({
|
|
1658
1658
|
cachedBounds: h,
|
|
1659
|
-
containerScrollOffset:
|
|
1659
|
+
containerScrollOffset: It({
|
|
1660
1660
|
containerElement: e,
|
|
1661
1661
|
direction: r,
|
|
1662
1662
|
isRtl: i,
|
|
@@ -1666,7 +1666,7 @@ function Bt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1666
1666
|
itemCount: a,
|
|
1667
1667
|
overscanCount: l
|
|
1668
1668
|
});
|
|
1669
|
-
return
|
|
1669
|
+
return Y(s, t) ? t : s;
|
|
1670
1670
|
});
|
|
1671
1671
|
};
|
|
1672
1672
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1683,7 +1683,7 @@ function Bt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1683
1683
|
getCellBounds: g,
|
|
1684
1684
|
getEstimatedSize: C,
|
|
1685
1685
|
scrollToIndex: Nt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1686
|
-
let s =
|
|
1686
|
+
let s = Lt({
|
|
1687
1687
|
align: t,
|
|
1688
1688
|
cachedBounds: h,
|
|
1689
1689
|
containerScrollOffset: n,
|
|
@@ -1693,14 +1693,14 @@ function Bt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1693
1693
|
itemSize: m
|
|
1694
1694
|
});
|
|
1695
1695
|
if (e) {
|
|
1696
|
-
if (s =
|
|
1696
|
+
if (s = It({
|
|
1697
1697
|
containerElement: e,
|
|
1698
1698
|
direction: r,
|
|
1699
1699
|
isRtl: i,
|
|
1700
1700
|
scrollOffset: s
|
|
1701
1701
|
}), typeof e.scrollTo != "function") {
|
|
1702
1702
|
let e = w(s);
|
|
1703
|
-
|
|
1703
|
+
Y(_, e) || v(e);
|
|
1704
1704
|
}
|
|
1705
1705
|
return s;
|
|
1706
1706
|
}
|
|
@@ -1711,19 +1711,19 @@ function Bt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1711
1711
|
stopIndexVisible: x
|
|
1712
1712
|
};
|
|
1713
1713
|
}
|
|
1714
|
-
function
|
|
1714
|
+
function Ht(e) {
|
|
1715
1715
|
return B(() => e, Object.values(e));
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1717
|
+
function Ut(e, t) {
|
|
1718
1718
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1719
|
-
return
|
|
1719
|
+
return Y(n, a) && Y(r, o) && Y(i, s);
|
|
1720
1720
|
}
|
|
1721
|
-
function
|
|
1721
|
+
function Wt(e) {
|
|
1722
1722
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1723
1723
|
}
|
|
1724
|
-
var
|
|
1725
|
-
function
|
|
1726
|
-
let m =
|
|
1724
|
+
var Gt = "data-react-window-index";
|
|
1725
|
+
function Kt({ 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 }) {
|
|
1726
|
+
let m = Ht(u), h = B(() => Ce(s, Ut), [s]), [g, _] = H(null), v = Wt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Vt({
|
|
1727
1727
|
containerElement: g,
|
|
1728
1728
|
containerStyle: f,
|
|
1729
1729
|
defaultContainerSize: n,
|
|
@@ -1754,7 +1754,7 @@ function Gt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1754
1754
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1755
1755
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1756
1756
|
let n = `${S + t}`;
|
|
1757
|
-
return e.setAttribute(
|
|
1757
|
+
return e.setAttribute(Gt, n), !0;
|
|
1758
1758
|
});
|
|
1759
1759
|
if (v) return l.observeRowElements(e);
|
|
1760
1760
|
}, [
|
|
@@ -1831,7 +1831,7 @@ function Gt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1831
1831
|
}
|
|
1832
1832
|
}, E, e, D);
|
|
1833
1833
|
}
|
|
1834
|
-
var
|
|
1834
|
+
var Q = {
|
|
1835
1835
|
search: "_search_5skzl_1",
|
|
1836
1836
|
divider: "_divider_5skzl_5",
|
|
1837
1837
|
item: "_item_5skzl_9",
|
|
@@ -1848,9 +1848,9 @@ var Kt = {
|
|
|
1848
1848
|
children: /* @__PURE__ */ P(m, {
|
|
1849
1849
|
type: "button",
|
|
1850
1850
|
"aria-current": v ? "true" : void 0,
|
|
1851
|
-
className: l(
|
|
1851
|
+
className: l(Q.item, "h-full w-full gap-3 px-4", v && u && Q.itemSelectedBackground, v && d && Q.itemSelectedText, s, v && c, U.modelMenuItem, v && U.modelMenuItemSelected),
|
|
1852
1852
|
iconBefore: /* @__PURE__ */ P("span", {
|
|
1853
|
-
className:
|
|
1853
|
+
className: Q.itemIcon,
|
|
1854
1854
|
children: h
|
|
1855
1855
|
}),
|
|
1856
1856
|
label: /* @__PURE__ */ F("span", {
|
|
@@ -1862,7 +1862,7 @@ var Kt = {
|
|
|
1862
1862
|
className: l(a, "min-w-0 flex-1 text-start")
|
|
1863
1863
|
}), v && /* @__PURE__ */ P(L, {
|
|
1864
1864
|
size: g.SM,
|
|
1865
|
-
className:
|
|
1865
|
+
className: Q.checkIcon,
|
|
1866
1866
|
"aria-hidden": !0,
|
|
1867
1867
|
stroke: _
|
|
1868
1868
|
})]
|
|
@@ -1901,18 +1901,18 @@ var Kt = {
|
|
|
1901
1901
|
style: D,
|
|
1902
1902
|
children: [x && !S && /* @__PURE__ */ F(oe, { children: [/* @__PURE__ */ P("div", {
|
|
1903
1903
|
style: c({ "--ci-sheet-search-bg": _?.colors?.searchHeaderBackground }),
|
|
1904
|
-
className: l("flex-shrink-0 px-4 py-[10px]",
|
|
1904
|
+
className: l("flex-shrink-0 px-4 py-[10px]", Q.search, _?.searchHeaderClassName, U.modelMenuSearch),
|
|
1905
1905
|
children: /* @__PURE__ */ P(A, {
|
|
1906
1906
|
value: v,
|
|
1907
1907
|
placeholder: r,
|
|
1908
1908
|
size: y.Standard,
|
|
1909
1909
|
onChange: (e) => b(e ?? "")
|
|
1910
1910
|
})
|
|
1911
|
-
}), /* @__PURE__ */ P("div", { className: l(
|
|
1911
|
+
}), /* @__PURE__ */ P("div", { className: l(Q.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ P(wt, { loadingLabel: u }) : C ? /* @__PURE__ */ P("div", {
|
|
1912
1912
|
role: "list",
|
|
1913
|
-
className: l(
|
|
1913
|
+
className: l(Q.stateLabel, h, "px-4 py-4"),
|
|
1914
1914
|
children: C
|
|
1915
|
-
}) : /* @__PURE__ */ P(
|
|
1915
|
+
}) : /* @__PURE__ */ P(Kt, {
|
|
1916
1916
|
role: "list",
|
|
1917
1917
|
className: "overflow-y-auto",
|
|
1918
1918
|
style: { height: Math.min(w.length, Jt) * qt },
|
|
@@ -2044,7 +2044,7 @@ var Kt = {
|
|
|
2044
2044
|
})
|
|
2045
2045
|
});
|
|
2046
2046
|
}, Qt = Se(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: u, onAttachmentsChange: p, placeholder: m = "Type a message...", ariaLabel: h, attachLabel: y = "Attach file", fileAccept: S, addMenuTitle: C = "Add", menuTitle: w = "Menu", menuCloseLabel: T = "Close", removeLabel: E, retryLabel: D, uploadingLabel: ee, sendLabel: O, sendTooltip: k, emptyMessageTooltip: te, stopLabel: A, micLabel: ne = "Dictate", recordVoiceLabel: j = "Record voice", stopRecordingLabel: re, discardRecordingLabel: ie, colors: M, typography: N, attachmentTray: ae, modelMenu: I, className: ce, pendingDropFiles: ue = [], onDropFilesConsumed: L, pendingAttachments: de = [], onPendingAttachmentsConsumed: fe, pasteTextThreshold: he = 4e3, maxMessageLength: ge = 5e4, deployments: _e, selectedDeploymentId: ve, onDeploymentChange: ye, modelSelectorLabels: be, initialAttachments: xe = [], hideAddButton: Se = !1, hideAttachFile: Ce = !1, hideActionBar: we = !1, actionRowLayout: De = et.Stacked, isInlineActionRowAllowedBelowDesktop: W = !1, renderFooterActions: Oe, isInputDisabled: G = !1, isModelSelectorDisabled: Ae = !1, isSendDisabled: je = !1, isAudioMessageSupported: Me = !1, isVoiceRecordingSupported: Fe = Me, onTranscribeAudio: Ie, transcribingLabel: ze, voiceErrorLabel: Be, sendOnEnter: We = $e.Enter, prefixAttachments: Je = [], onRemovePrefixAttachment: Ye, chatSettings: Xe, toolsMenuItems: Ze, onToolToggle: tt, canRemoveTools: nt = !0, toolsMenuTitle: rt, toolsBackLabel: it, toolsChipLabels: at, menuOverlays: ot, activeMentions: st, onBackspaceAtCaret: ct, caretPositionOverride: lt, commandMenu: K, autoFocus: ut = !1, messageHistory: ft, onDialFileSystemClick: pt, dialFileSystemLabel: ht, validateAttachment: gt, onAttachmentClick: _t, modelPickerOverlay: vt, maximumAttachmentsAmount: St, onAttachmentsLimitExceeded: Ct, isAttachmentsEnabled: wt = !0, isTextAttachmentsAllowed: Tt = !0, usageLimitsSlot: Et, onMessageTooLong: Dt }, Ot) => {
|
|
2047
|
-
let kt = d(), [At, jt] = H(!1), Mt = Le(ft), Nt = st ?? [],
|
|
2047
|
+
let kt = d(), [At, jt] = H(!1), Mt = Le(ft), Nt = st ?? [], Pt = Nt.length > 0, Ft = B(() => c({
|
|
2048
2048
|
"--ci-bg": M?.background,
|
|
2049
2049
|
"--ci-text": M?.text,
|
|
2050
2050
|
"--ci-border": M?.border,
|
|
@@ -2062,7 +2062,7 @@ var Kt = {
|
|
|
2062
2062
|
"--ci-mention-highlight-text": M?.mentionHighlightText,
|
|
2063
2063
|
"--ci-mention-highlight-unsupported-bg": M?.mentionHighlightUnsupportedBg,
|
|
2064
2064
|
"--ci-mention-highlight-unsupported-text": M?.mentionHighlightUnsupportedText
|
|
2065
|
-
}), [M]),
|
|
2065
|
+
}), [M]), It = B(() => pt ? [{
|
|
2066
2066
|
key: "dial-fs",
|
|
2067
2067
|
label: ht ?? "DIAL file system",
|
|
2068
2068
|
icon: /* @__PURE__ */ P(pe, {
|
|
@@ -2071,28 +2071,28 @@ var Kt = {
|
|
|
2071
2071
|
stroke: _
|
|
2072
2072
|
}),
|
|
2073
2073
|
onClick: pt
|
|
2074
|
-
}] : [], [pt, ht]), { message:
|
|
2074
|
+
}] : [], [pt, ht]), { message: J, setMessage: Y, textareaRef: X } = He({
|
|
2075
2075
|
messageProp: e,
|
|
2076
2076
|
messageRevision: t
|
|
2077
2077
|
});
|
|
2078
2078
|
z(() => {
|
|
2079
|
-
n !== void 0 &&
|
|
2080
|
-
}, [n,
|
|
2081
|
-
let { handleUndoKeyDown:
|
|
2079
|
+
n !== void 0 && X.current?.focus();
|
|
2080
|
+
}, [n, X]), Te(Ot, () => ({ getCaretPosition: () => X.current?.selectionStart ?? J.length }), [J, X]);
|
|
2081
|
+
let { handleUndoKeyDown: Lt } = Ge({
|
|
2082
2082
|
insertion: r,
|
|
2083
|
-
textareaRef:
|
|
2084
|
-
}), { isMenuOpen:
|
|
2083
|
+
textareaRef: X
|
|
2084
|
+
}), { isMenuOpen: Rt, query: zt, activeWordStart: Z, dismiss: Bt, closeOnOutsidePress: Vt, handleCaretMove: Ht, handleValueChange: Ut, listboxId: Wt, overlayRef: Gt, activeOptionId: Kt, moveActiveOption: Q, getActiveOption: qt } = Pe({
|
|
2085
2085
|
config: K,
|
|
2086
|
-
message:
|
|
2086
|
+
message: J
|
|
2087
2087
|
}), Jt = () => {
|
|
2088
|
-
|
|
2088
|
+
Ht(X.current?.selectionStart ?? J.length);
|
|
2089
2089
|
}, Yt = () => {
|
|
2090
2090
|
requestAnimationFrame(() => {
|
|
2091
|
-
|
|
2091
|
+
Ht(X.current?.selectionStart ?? J.length);
|
|
2092
2092
|
});
|
|
2093
2093
|
}, Xt = (e) => {
|
|
2094
|
-
e.key !== "ArrowLeft" && e.key !== "ArrowRight" && e.key !== "Home" && e.key !== "End" && e.key !== "PageUp" && e.key !== "PageDown" ||
|
|
2095
|
-
}, Qt = K?.emptyQueryHint != null, $t = K != null &&
|
|
2094
|
+
e.key !== "ArrowLeft" && e.key !== "ArrowRight" && e.key !== "Home" && e.key !== "End" && e.key !== "PageUp" && e.key !== "PageDown" || Ht(e.currentTarget.selectionStart ?? J.length);
|
|
2095
|
+
}, Qt = K?.emptyQueryHint != null, $t = K != null && Z != null ? Z + K.triggerPrefix.length : null, en = $t != null && J.slice($t).split("\n", 1)[0] !== "", tn = Qt && Rt && zt === "" && $t != null && !en, nn = K != null && Rt ? Z ?? 0 : null, rn = V(null), an = V(null), [on, sn] = H(null), cn = R(() => {
|
|
2096
2096
|
let e = rn.current, t = an.current;
|
|
2097
2097
|
if (e == null || t == null) {
|
|
2098
2098
|
sn(null);
|
|
@@ -2109,43 +2109,39 @@ var Kt = {
|
|
|
2109
2109
|
}, [
|
|
2110
2110
|
cn,
|
|
2111
2111
|
nn,
|
|
2112
|
-
|
|
2112
|
+
J
|
|
2113
2113
|
]), z(() => {
|
|
2114
2114
|
if (nn == null) return;
|
|
2115
|
-
let e =
|
|
2115
|
+
let e = X.current;
|
|
2116
2116
|
if (e == null || typeof ResizeObserver > "u") return;
|
|
2117
2117
|
let t = new ResizeObserver(cn);
|
|
2118
2118
|
return t.observe(e), () => t.disconnect();
|
|
2119
2119
|
}, [
|
|
2120
2120
|
nn,
|
|
2121
|
-
|
|
2121
|
+
X,
|
|
2122
2122
|
cn
|
|
2123
2123
|
]);
|
|
2124
|
-
let
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
let t = `${K.triggerPrefix}${Rt}`, n = Q + t.length;
|
|
2131
|
-
if (Y.slice(Q, n) !== t) return;
|
|
2132
|
-
let r = Y.slice(0, Q) + Y.slice(n);
|
|
2133
|
-
X(r), Mt.notifyChange(), u?.(r);
|
|
2124
|
+
let ln = R((e) => {
|
|
2125
|
+
if (K == null || (Bt(), !e?.consumeQuery) || (e.returnFocus !== !1 && X.current?.focus(), Z == null)) return;
|
|
2126
|
+
let t = `${K.triggerPrefix}${zt}`, n = Z + t.length;
|
|
2127
|
+
if (J.slice(Z, n) !== t) return;
|
|
2128
|
+
let r = J.slice(0, Z) + J.slice(n);
|
|
2129
|
+
Y(r), Mt.notifyChange(), u?.(r);
|
|
2134
2130
|
}, [
|
|
2135
2131
|
K,
|
|
2132
|
+
Bt,
|
|
2136
2133
|
zt,
|
|
2137
|
-
|
|
2134
|
+
J,
|
|
2135
|
+
Z,
|
|
2138
2136
|
Y,
|
|
2139
|
-
Q,
|
|
2140
|
-
X,
|
|
2141
2137
|
Mt,
|
|
2142
2138
|
u,
|
|
2143
|
-
|
|
2144
|
-
]),
|
|
2139
|
+
X
|
|
2140
|
+
]), un = V(void 0);
|
|
2145
2141
|
z(() => {
|
|
2146
|
-
lt == null ||
|
|
2147
|
-
}, [
|
|
2148
|
-
let { attachments:
|
|
2142
|
+
lt == null || un.current === t || (un.current = t, X.current?.setSelectionRange(lt, lt), Ht(lt));
|
|
2143
|
+
}, [J]);
|
|
2144
|
+
let { attachments: dn, buildAttachments: fn, addAttachments: pn, resetAttachments: mn, handleRemove: hn, handleRetry: gn, handleExpand: _n, hasBlockedAttachments: vn } = ke({
|
|
2149
2145
|
initialAttachments: xe,
|
|
2150
2146
|
onUploadAttachment: a,
|
|
2151
2147
|
onAttachmentsChange: p,
|
|
@@ -2155,94 +2151,94 @@ var Kt = {
|
|
|
2155
2151
|
pendingAttachments: de,
|
|
2156
2152
|
onPendingAttachmentsConsumed: fe,
|
|
2157
2153
|
onExpandPastedText: R((e) => {
|
|
2158
|
-
|
|
2159
|
-
}, [
|
|
2154
|
+
Y((t) => t ? `${t}\n${e}` : e);
|
|
2155
|
+
}, [Y]),
|
|
2160
2156
|
maximumAttachmentsAmount: St,
|
|
2161
2157
|
baseAttachmentsAmount: Je.length,
|
|
2162
2158
|
onAttachmentsLimitExceeded: Ct
|
|
2163
|
-
}),
|
|
2164
|
-
|
|
2165
|
-
}, [
|
|
2166
|
-
|
|
2167
|
-
let [
|
|
2159
|
+
}), yn = R((e) => {
|
|
2160
|
+
pn(fn([e]));
|
|
2161
|
+
}, [pn, fn]), bn = V(!1), xn = V(J);
|
|
2162
|
+
xn.current = J;
|
|
2163
|
+
let [Sn, Cn] = H({
|
|
2168
2164
|
text: "",
|
|
2169
2165
|
revision: 0
|
|
2170
|
-
}), { state:
|
|
2171
|
-
onAttachAudio:
|
|
2166
|
+
}), { state: wn, analyserNodeRef: Tn, errorMessage: En, startRecording: Dn, stopRecording: On, discardRecording: kn } = Qe({
|
|
2167
|
+
onAttachAudio: yn,
|
|
2172
2168
|
onTranscribeAudio: Ie,
|
|
2173
2169
|
onTranscript: R((e) => {
|
|
2174
2170
|
let t = e.trim();
|
|
2175
2171
|
if (t) {
|
|
2176
|
-
let e =
|
|
2177
|
-
|
|
2172
|
+
let e = xn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
|
|
2173
|
+
xn.current = n, Y(n), Cn((e) => ({
|
|
2178
2174
|
text: t,
|
|
2179
2175
|
revision: e.revision + 1
|
|
2180
2176
|
})), Mt.notifyChange(), u?.(n);
|
|
2181
2177
|
}
|
|
2182
|
-
|
|
2178
|
+
bn.current = !0;
|
|
2183
2179
|
}, [
|
|
2184
|
-
|
|
2180
|
+
Y,
|
|
2185
2181
|
Mt,
|
|
2186
2182
|
u
|
|
2187
2183
|
]),
|
|
2188
2184
|
errorLabel: Be
|
|
2189
|
-
}), $ =
|
|
2185
|
+
}), $ = wn === Ke.Recording || wn === Ke.Processing;
|
|
2190
2186
|
z(() => {
|
|
2191
|
-
(
|
|
2192
|
-
}, [
|
|
2193
|
-
let
|
|
2194
|
-
if (!
|
|
2187
|
+
(wn === Ke.Error || wn === Ke.Idle && bn.current) && (bn.current = !1, X.current?.focus());
|
|
2188
|
+
}, [wn, X]);
|
|
2189
|
+
let An = V(null), jn = V(null), Mn = wt && Tt, { handlePaste: Nn } = le(pn, Mn ? he : Infinity), Pn = R((e) => {
|
|
2190
|
+
if (!Mn) {
|
|
2195
2191
|
let t = e.clipboardData.getData("text/plain");
|
|
2196
2192
|
t.length >= ge && Dt?.(t.length, ge);
|
|
2197
2193
|
}
|
|
2198
|
-
|
|
2194
|
+
Nn(e);
|
|
2199
2195
|
}, [
|
|
2200
|
-
|
|
2196
|
+
Mn,
|
|
2201
2197
|
ge,
|
|
2202
2198
|
Dt,
|
|
2203
|
-
|
|
2204
|
-
]),
|
|
2199
|
+
Nn
|
|
2200
|
+
]), Fn = J.trim().length > 0 || dn.length > 0, In = Fn && !vn && !je && !$, [Ln, Rn] = H([]);
|
|
2205
2201
|
z(() => {
|
|
2206
|
-
|
|
2202
|
+
Rn([]);
|
|
2207
2203
|
}, [(Ze ?? []).map((e) => e.id).join("|")]);
|
|
2208
|
-
let
|
|
2204
|
+
let zn = B(() => {
|
|
2209
2205
|
let e = Ze ?? [];
|
|
2210
|
-
return nt ? e.filter((e) => e.isSelected || !
|
|
2206
|
+
return nt ? e.filter((e) => e.isSelected || !Ln.includes(e.id)) : e;
|
|
2211
2207
|
}, [
|
|
2212
2208
|
Ze,
|
|
2213
|
-
|
|
2209
|
+
Ln,
|
|
2214
2210
|
nt
|
|
2215
|
-
]),
|
|
2216
|
-
|
|
2217
|
-
}, [Ze, tt]),
|
|
2211
|
+
]), Bn = R((e) => {
|
|
2212
|
+
Rn((t) => t.includes(e) ? t : [...t, e]), Ze?.find((t) => t.id === e)?.isSelected && tt?.(e);
|
|
2213
|
+
}, [Ze, tt]), Vn = _e === void 0 || ve != null, Hn = Me && !s, Un = async () => {
|
|
2218
2214
|
if (je || $) return;
|
|
2219
|
-
if (
|
|
2220
|
-
Dt?.(
|
|
2215
|
+
if (J.length >= ge) {
|
|
2216
|
+
Dt?.(J.length, ge);
|
|
2221
2217
|
return;
|
|
2222
2218
|
}
|
|
2223
|
-
let e =
|
|
2224
|
-
|
|
2219
|
+
let e = J, t = dn;
|
|
2220
|
+
Y(""), Mt.reset();
|
|
2225
2221
|
try {
|
|
2226
2222
|
await i?.(e, t), t.forEach((e) => {
|
|
2227
2223
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
2228
|
-
}),
|
|
2224
|
+
}), mn([]);
|
|
2229
2225
|
} catch {
|
|
2230
|
-
|
|
2226
|
+
Y(e), mn(t);
|
|
2231
2227
|
}
|
|
2232
|
-
},
|
|
2233
|
-
if (!
|
|
2234
|
-
if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(),
|
|
2235
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(),
|
|
2228
|
+
}, Wn = (e) => We === $e.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Gn = (e) => {
|
|
2229
|
+
if (!Rt || e.nativeEvent.isComposing) return !1;
|
|
2230
|
+
if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), Bt(), !0;
|
|
2231
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), Q(e.key === "ArrowDown" ? Ne.Next : Ne.Previous), !0;
|
|
2236
2232
|
if (e.key !== "Enter" || e.shiftKey) return !1;
|
|
2237
2233
|
let t = qt();
|
|
2238
|
-
return t == null ?
|
|
2239
|
-
},
|
|
2240
|
-
if (!$ && !
|
|
2234
|
+
return t == null ? Wn(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
|
|
2235
|
+
}, Kn = (e) => {
|
|
2236
|
+
if (!$ && !Lt(e) && !Gn(e)) {
|
|
2241
2237
|
if (!e.nativeEvent.isComposing && !G && !s) {
|
|
2242
2238
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
2243
|
-
let t = e.currentTarget.selectionStart ?? 0, n = Mt.navigate(e.key === "ArrowUp" ? "up" : "down",
|
|
2239
|
+
let t = e.currentTarget.selectionStart ?? 0, n = Mt.navigate(e.key === "ArrowUp" ? "up" : "down", J, t);
|
|
2244
2240
|
if (n !== null) {
|
|
2245
|
-
e.preventDefault(),
|
|
2241
|
+
e.preventDefault(), Y(n);
|
|
2246
2242
|
return;
|
|
2247
2243
|
}
|
|
2248
2244
|
}
|
|
@@ -2251,19 +2247,19 @@ var Kt = {
|
|
|
2251
2247
|
if (t != null) {
|
|
2252
2248
|
e.preventDefault();
|
|
2253
2249
|
let n = e.currentTarget;
|
|
2254
|
-
n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Ue(n,
|
|
2250
|
+
n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Ue(n, J.slice(0, t.start) + J.slice(t.start + t.length), t.start);
|
|
2255
2251
|
return;
|
|
2256
2252
|
}
|
|
2257
2253
|
}
|
|
2258
2254
|
}
|
|
2259
|
-
e.key === "Enter" &&
|
|
2255
|
+
e.key === "Enter" && Wn(e) && (e.preventDefault(), !s && In && Vn && !G && Un());
|
|
2260
2256
|
}
|
|
2261
|
-
},
|
|
2257
|
+
}, qn = (e) => {
|
|
2262
2258
|
let t = Array.from(e.target.files ?? []);
|
|
2263
2259
|
if (t.length === 0) return;
|
|
2264
|
-
let n =
|
|
2265
|
-
e.target.value = "",
|
|
2266
|
-
},
|
|
2260
|
+
let n = fn(t);
|
|
2261
|
+
e.target.value = "", pn(n);
|
|
2262
|
+
}, Jn = B(() => {
|
|
2267
2263
|
let e = [];
|
|
2268
2264
|
return nn != null && e.push({
|
|
2269
2265
|
offset: nn,
|
|
@@ -2286,32 +2282,36 @@ var Kt = {
|
|
|
2286
2282
|
tn,
|
|
2287
2283
|
K,
|
|
2288
2284
|
$t
|
|
2289
|
-
]),
|
|
2290
|
-
|
|
2291
|
-
|
|
2285
|
+
]), Yn = Pt || Jn.length > 0, { mirrorRef: Xn, selectionRects: Zn, updateSelectionRects: Qn } = Ve({
|
|
2286
|
+
textareaRef: X,
|
|
2287
|
+
message: J,
|
|
2288
|
+
isMirrorActive: Yn
|
|
2289
|
+
}), $n = /* @__PURE__ */ P("textarea", {
|
|
2290
|
+
className: l(q.textarea, Yn && 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"),
|
|
2291
|
+
ref: X,
|
|
2292
2292
|
autoFocus: ut,
|
|
2293
|
-
value:
|
|
2293
|
+
value: J,
|
|
2294
2294
|
onChange: (e) => {
|
|
2295
|
-
|
|
2295
|
+
Y(e.target.value), Mt.notifyChange();
|
|
2296
2296
|
let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
|
|
2297
|
-
|
|
2297
|
+
Ut(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
|
|
2298
2298
|
},
|
|
2299
|
-
onSelect:
|
|
2299
|
+
onSelect: Qn,
|
|
2300
2300
|
onFocus: Yt,
|
|
2301
2301
|
onClick: Jt,
|
|
2302
|
-
onKeyDown:
|
|
2302
|
+
onKeyDown: Kn,
|
|
2303
2303
|
onKeyUp: Xt,
|
|
2304
|
-
onPaste:
|
|
2304
|
+
onPaste: Pn,
|
|
2305
2305
|
placeholder: m,
|
|
2306
2306
|
"aria-label": h,
|
|
2307
2307
|
"aria-autocomplete": K == null ? void 0 : "list",
|
|
2308
|
-
"aria-controls":
|
|
2309
|
-
"aria-activedescendant":
|
|
2310
|
-
"aria-hidden":
|
|
2308
|
+
"aria-controls": Rt ? Wt : void 0,
|
|
2309
|
+
"aria-activedescendant": Kt ?? void 0,
|
|
2310
|
+
"aria-hidden": Pt ? !0 : void 0,
|
|
2311
2311
|
disabled: G,
|
|
2312
2312
|
readOnly: $,
|
|
2313
2313
|
rows: 1
|
|
2314
|
-
}),
|
|
2314
|
+
}), er = K == null ? $n : /* @__PURE__ */ F(oe, { children: [$n, /* @__PURE__ */ P("div", {
|
|
2315
2315
|
"aria-hidden": !0,
|
|
2316
2316
|
className: l("pointer-events-none absolute", N?.fontClassName || "dial-body-paragraph-text"),
|
|
2317
2317
|
style: {
|
|
@@ -2319,25 +2319,25 @@ var Kt = {
|
|
|
2319
2319
|
top: on?.top ?? 0
|
|
2320
2320
|
},
|
|
2321
2321
|
children: /* @__PURE__ */ P(v, {
|
|
2322
|
-
open:
|
|
2322
|
+
open: Rt,
|
|
2323
2323
|
onOpenChange: (e) => {
|
|
2324
|
-
e ||
|
|
2324
|
+
e || Vt();
|
|
2325
2325
|
},
|
|
2326
2326
|
placement: "top-start",
|
|
2327
2327
|
trigger: [],
|
|
2328
2328
|
initialFocus: -1,
|
|
2329
2329
|
matchReferenceWidth: !1,
|
|
2330
|
-
outsidePressIgnoreRef:
|
|
2330
|
+
outsidePressIgnoreRef: X,
|
|
2331
2331
|
renderOverlay: () => /* @__PURE__ */ P("div", {
|
|
2332
|
-
ref:
|
|
2332
|
+
ref: Gt,
|
|
2333
2333
|
role: K.menuLabel == null ? void 0 : "group",
|
|
2334
2334
|
"aria-label": K.menuLabel,
|
|
2335
2335
|
children: K.renderMenu({
|
|
2336
|
-
query:
|
|
2337
|
-
caretPosition:
|
|
2338
|
-
close:
|
|
2339
|
-
listboxId:
|
|
2340
|
-
activeOptionId:
|
|
2336
|
+
query: zt,
|
|
2337
|
+
caretPosition: Z ?? 0,
|
|
2338
|
+
close: ln,
|
|
2339
|
+
listboxId: Wt,
|
|
2340
|
+
activeOptionId: Kt
|
|
2341
2341
|
})
|
|
2342
2342
|
}),
|
|
2343
2343
|
children: /* @__PURE__ */ P("span", {
|
|
@@ -2345,13 +2345,13 @@ var Kt = {
|
|
|
2345
2345
|
className: "inline-block h-[1lh] w-0"
|
|
2346
2346
|
})
|
|
2347
2347
|
})
|
|
2348
|
-
})] }),
|
|
2348
|
+
})] }), tr = /* @__PURE__ */ F("div", {
|
|
2349
2349
|
ref: an,
|
|
2350
2350
|
className: "relative -me-1 -ms-1 w-[calc(100%+8px)]",
|
|
2351
|
-
children: [
|
|
2352
|
-
ref:
|
|
2351
|
+
children: [Yn && /* @__PURE__ */ F("div", {
|
|
2352
|
+
ref: Xn,
|
|
2353
2353
|
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]"),
|
|
2354
|
-
children: [Re(
|
|
2354
|
+
children: [Re(J, Nt, Jn, q.mentionHighlight, q.mentionHighlightUnsupported), Zn.map((e, t) => /* @__PURE__ */ P("div", {
|
|
2355
2355
|
"aria-hidden": !0,
|
|
2356
2356
|
className: "pointer-events-none absolute rounded-sm bg-control-accent-alpha-active",
|
|
2357
2357
|
style: {
|
|
@@ -2361,34 +2361,34 @@ var Kt = {
|
|
|
2361
2361
|
height: e.height
|
|
2362
2362
|
}
|
|
2363
2363
|
}, `selection-${t}`))]
|
|
2364
|
-
}),
|
|
2365
|
-
}),
|
|
2366
|
-
onAttachClick: Ce ? void 0 : () =>
|
|
2364
|
+
}), er]
|
|
2365
|
+
}), nr = Se ? void 0 : /* @__PURE__ */ P(dt, {
|
|
2366
|
+
onAttachClick: Ce ? void 0 : () => An.current?.click(),
|
|
2367
2367
|
attachLabel: y,
|
|
2368
2368
|
addMenuTitle: C,
|
|
2369
2369
|
menuTitle: w,
|
|
2370
2370
|
menuCloseLabel: T,
|
|
2371
|
-
style:
|
|
2371
|
+
style: Ft,
|
|
2372
2372
|
isDisabled: G || $,
|
|
2373
2373
|
chatSettings: Xe,
|
|
2374
|
-
extraMenuItems:
|
|
2375
|
-
onRecordVoice: Fe && wt && !s && !$ ? () =>
|
|
2374
|
+
extraMenuItems: It,
|
|
2375
|
+
onRecordVoice: Fe && wt && !s && !$ ? () => Dn(qe.Attachment) : void 0,
|
|
2376
2376
|
recordVoiceLabel: j,
|
|
2377
2377
|
toolsMenuItems: nt ? Ze : void 0,
|
|
2378
2378
|
onToolToggle: tt,
|
|
2379
2379
|
toolsMenuTitle: rt,
|
|
2380
2380
|
toolsBackLabel: it,
|
|
2381
2381
|
menuOverlays: ot,
|
|
2382
|
-
getCaretPosition: () =>
|
|
2383
|
-
}),
|
|
2382
|
+
getCaretPosition: () => X.current?.selectionStart ?? J.length
|
|
2383
|
+
}), rr = De === et.Inline && (!kt || W), ir = nr && /* @__PURE__ */ P("div", {
|
|
2384
2384
|
className: l("flex", U.addCluster),
|
|
2385
|
-
children:
|
|
2386
|
-
}),
|
|
2385
|
+
children: nr
|
|
2386
|
+
}), ar = zn.length > 0 && tt != null && /* @__PURE__ */ P("div", {
|
|
2387
2387
|
className: l("min-w-0 flex-1", U.toolsChips),
|
|
2388
2388
|
children: /* @__PURE__ */ P(mt, {
|
|
2389
|
-
items:
|
|
2389
|
+
items: zn,
|
|
2390
2390
|
onToolToggle: tt,
|
|
2391
|
-
onToolDismiss:
|
|
2391
|
+
onToolDismiss: Bn,
|
|
2392
2392
|
canRemove: nt,
|
|
2393
2393
|
removeLabel: at?.removeLabel,
|
|
2394
2394
|
stateOnLabel: at?.stateOnLabel,
|
|
@@ -2396,17 +2396,17 @@ var Kt = {
|
|
|
2396
2396
|
})
|
|
2397
2397
|
});
|
|
2398
2398
|
return /* @__PURE__ */ F("div", {
|
|
2399
|
-
ref:
|
|
2400
|
-
style:
|
|
2401
|
-
className: l(q.wrapper, G && q.wrapperDisabled, G && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1",
|
|
2399
|
+
ref: jn,
|
|
2400
|
+
style: Ft,
|
|
2401
|
+
className: l(q.wrapper, G && q.wrapperDisabled, G && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", dn.length > 6 ? "py-4 ps-4" : "p-4", ce, U.wrapper),
|
|
2402
2402
|
children: [
|
|
2403
|
-
(Je.length > 0 ||
|
|
2404
|
-
attachments: [...Je, ...
|
|
2403
|
+
(Je.length > 0 || dn.length > 0) && /* @__PURE__ */ P(se, {
|
|
2404
|
+
attachments: [...Je, ...dn],
|
|
2405
2405
|
onRemove: (e) => {
|
|
2406
|
-
Je.some((t) => t.id === e) ? Ye?.(e) :
|
|
2406
|
+
Je.some((t) => t.id === e) ? Ye?.(e) : hn(e);
|
|
2407
2407
|
},
|
|
2408
|
-
onRetry:
|
|
2409
|
-
onExpand:
|
|
2408
|
+
onRetry: gn,
|
|
2409
|
+
onExpand: _n,
|
|
2410
2410
|
labels: {
|
|
2411
2411
|
removeLabel: E,
|
|
2412
2412
|
retryLabel: D,
|
|
@@ -2414,55 +2414,55 @@ var Kt = {
|
|
|
2414
2414
|
},
|
|
2415
2415
|
styles: ae,
|
|
2416
2416
|
onAttachmentClick: _t == null ? void 0 : (e) => {
|
|
2417
|
-
let t = [...Je, ...
|
|
2417
|
+
let t = [...Je, ...dn].find((t) => t.id === e);
|
|
2418
2418
|
t != null && _t(t);
|
|
2419
2419
|
}
|
|
2420
2420
|
}),
|
|
2421
2421
|
!Se && /* @__PURE__ */ P("input", {
|
|
2422
|
-
ref:
|
|
2422
|
+
ref: An,
|
|
2423
2423
|
type: "file",
|
|
2424
2424
|
multiple: !0,
|
|
2425
2425
|
accept: S,
|
|
2426
2426
|
className: "sr-only",
|
|
2427
2427
|
"aria-hidden": !0,
|
|
2428
2428
|
tabIndex: -1,
|
|
2429
|
-
onChange:
|
|
2429
|
+
onChange: qn
|
|
2430
2430
|
}),
|
|
2431
|
-
|
|
2432
|
-
text:
|
|
2431
|
+
En && /* @__PURE__ */ P(b, {
|
|
2432
|
+
text: En,
|
|
2433
2433
|
className: "min-w-0 break-words px-1"
|
|
2434
2434
|
}),
|
|
2435
2435
|
$ && /* @__PURE__ */ P(yt, {
|
|
2436
2436
|
embedded: !0,
|
|
2437
|
-
state:
|
|
2438
|
-
analyserNodeRef:
|
|
2439
|
-
onStop:
|
|
2440
|
-
onDiscard:
|
|
2441
|
-
attachButton:
|
|
2437
|
+
state: wn,
|
|
2438
|
+
analyserNodeRef: Tn,
|
|
2439
|
+
onStop: On,
|
|
2440
|
+
onDiscard: kn,
|
|
2441
|
+
attachButton: nr,
|
|
2442
2442
|
stopLabel: re,
|
|
2443
2443
|
discardLabel: ie,
|
|
2444
2444
|
processingLabel: ze
|
|
2445
2445
|
}),
|
|
2446
|
-
!$ && we &&
|
|
2447
|
-
!$ && !we &&
|
|
2446
|
+
!$ && we && tr,
|
|
2447
|
+
!$ && !we && rr && ar && /* @__PURE__ */ P("div", {
|
|
2448
2448
|
className: "flex",
|
|
2449
|
-
children:
|
|
2449
|
+
children: ar
|
|
2450
2450
|
}),
|
|
2451
2451
|
!$ && !we && /* @__PURE__ */ F("div", {
|
|
2452
|
-
className: l("flex items-center gap-2",
|
|
2452
|
+
className: l("flex items-center gap-2", rr ? "flex-nowrap" : "flex-wrap", U.actionRow),
|
|
2453
2453
|
children: [
|
|
2454
|
-
|
|
2454
|
+
rr && ir,
|
|
2455
2455
|
/* @__PURE__ */ P("div", {
|
|
2456
|
-
className: l("flex min-w-0 items-center self-stretch",
|
|
2457
|
-
children:
|
|
2456
|
+
className: l("flex min-w-0 items-center self-stretch", rr ? "flex-1" : "w-full", U.textareaWrap),
|
|
2457
|
+
children: tr
|
|
2458
2458
|
}),
|
|
2459
|
-
!
|
|
2460
|
-
!
|
|
2459
|
+
!rr && ir,
|
|
2460
|
+
!rr && ar,
|
|
2461
2461
|
/* @__PURE__ */ P("div", {
|
|
2462
2462
|
className: l("ms-auto flex flex-shrink-0 items-center gap-2", U.footerActions),
|
|
2463
2463
|
children: Oe ? Oe({
|
|
2464
|
-
canSend:
|
|
2465
|
-
onSend:
|
|
2464
|
+
canSend: In,
|
|
2465
|
+
onSend: Un
|
|
2466
2466
|
}) : /* @__PURE__ */ F(oe, { children: [
|
|
2467
2467
|
Et,
|
|
2468
2468
|
/* @__PURE__ */ P(Zt, {
|
|
@@ -2474,13 +2474,13 @@ var Kt = {
|
|
|
2474
2474
|
isStreaming: s,
|
|
2475
2475
|
isMobile: kt,
|
|
2476
2476
|
isDisabled: Ae,
|
|
2477
|
-
style:
|
|
2477
|
+
style: Ft,
|
|
2478
2478
|
modelPickerOverlay: vt,
|
|
2479
2479
|
isPickerOpen: At,
|
|
2480
2480
|
onPickerToggle: () => jt((e) => !e),
|
|
2481
2481
|
onPickerOpenChange: jt
|
|
2482
2482
|
}),
|
|
2483
|
-
|
|
2483
|
+
Hn && /* @__PURE__ */ P(x, {
|
|
2484
2484
|
icon: /* @__PURE__ */ P(me, {
|
|
2485
2485
|
size: g.LG,
|
|
2486
2486
|
stroke: _,
|
|
@@ -2489,17 +2489,17 @@ var Kt = {
|
|
|
2489
2489
|
"aria-label": ne,
|
|
2490
2490
|
tooltipProps: { tooltip: ne },
|
|
2491
2491
|
className: "size-[40px] flex-shrink-0 mobile:min-h-11 mobile:min-w-11",
|
|
2492
|
-
onClick: () =>
|
|
2492
|
+
onClick: () => Dn(qe.Dictation),
|
|
2493
2493
|
disabled: G || s
|
|
2494
2494
|
}),
|
|
2495
2495
|
s && o ? /* @__PURE__ */ P(xt, {
|
|
2496
2496
|
onStop: o,
|
|
2497
2497
|
ariaLabel: A
|
|
2498
2498
|
}) : !s && /* @__PURE__ */ P(bt, {
|
|
2499
|
-
onSend:
|
|
2500
|
-
isDisabled: !
|
|
2499
|
+
onSend: Un,
|
|
2500
|
+
isDisabled: !Vn || !In,
|
|
2501
2501
|
ariaLabel: O,
|
|
2502
|
-
sendTooltip:
|
|
2502
|
+
sendTooltip: Fn ? k : te ?? k
|
|
2503
2503
|
})
|
|
2504
2504
|
] })
|
|
2505
2505
|
})
|
|
@@ -2510,7 +2510,7 @@ var Kt = {
|
|
|
2510
2510
|
role: "status",
|
|
2511
2511
|
"aria-live": "polite",
|
|
2512
2512
|
"aria-atomic": "true",
|
|
2513
|
-
children: /* @__PURE__ */ P("span", { children:
|
|
2513
|
+
children: /* @__PURE__ */ P("span", { children: Sn.text }, Sn.revision)
|
|
2514
2514
|
})
|
|
2515
2515
|
]
|
|
2516
2516
|
});
|
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.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.270",
|
|
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.0-dev.
|
|
22
|
+
"@epam/ai-dial-attachment-input": "1.2.0-dev.270"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.270",
|
|
26
26
|
"react": "^19.2.8",
|
|
27
27
|
"@epam/ai-dial-ui-kit": "^0.15.0-dev.36"
|
|
28
28
|
},
|